/* Custom project styles (moved from inline tags) */
body{font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:#0b1220;color:#dbe2f1}
.card{border-radius:1rem;background:#0f172a;color:#e2e8f0;box-shadow:0 10px 30px rgba(2,6,23,.5)}
.navbar{background:#0f172a}
a{color:#93c5fd}

/* Index page hover card styles */
.hover-card { transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; }
.hover-card:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important; }
.card { border: none; border-radius: 0.75rem; }
.card.bg-primary { background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important; }
.display-4 { font-size: 2.5rem; }

/* Contract view styles */
.contract-content { white-space: pre-wrap; font-family: monospace; background: #f8f9fa; padding: 15px; border-radius: 5px; max-height: 600px; overflow-y: auto; color: #000; }
.monospace-textarea { font-family: monospace; }

/* Hide dynamic fields by default (Bootstrap provides d-none but ensure fallback) */
.dynamic-hidden { display: none !important; }

/* Affiliate management UI improvements */
.table tbody tr td { vertical-align: middle; }
.table tbody tr { padding: 0.75rem 0; }
.table .btn { min-width: 72px; }
.table .btn i { vertical-align: middle; }
.table .btn-sm { padding: .28rem .6rem; font-size: .85rem; }
/* Compact icon-only affiliate action buttons */
.table .btn.affiliate-action {
	min-width: 0;              /* don't force wide buttons */
	padding: .12rem .16rem;    /* even tighter padding so outline hugs icon */
	width: auto;               /* let padding define width */
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: .82rem;
	border-radius: .35rem;
	line-height: 1;
}
.table .btn.affiliate-action i { font-size: 1rem; }
.card .table thead th { background: transparent; color: #ffffff; }
.badge.bg-info { background-color: #0ea5e9 !important; color: #04263a; border-radius: .75rem; padding: .35rem .6rem; }
.btn-outline-success { border-color: #198754; color: #198754; }
.btn-outline-success:hover { background-color: #198754; color: #fff; }

/* Make badges look like small pills and clickable area larger */
.table a.btn.btn-sm.btn-info { display:inline-flex; align-items:center; gap:6px; }

/* Improve modal label contrast and section spacing */
.modal .fw-bold.text-primary { color: #0ea5e9 !important; }
.modal .row.g-3 > .col-md-6, .modal .row.g-3 > .col-md-4, .modal .row.g-3 > .col-md-3 { margin-bottom: 0.5rem; }

/* Row focus state for keyboard navigation */
.table-row-focused { outline: 2px solid rgba(14,165,233,0.22); background: rgba(14,165,233,0.03); }

/* Hide button labels on very small screens to conserve space */
@media (max-width: 576px) {
	.btn-label { display: none; }
}

/* Toast container tweaks (ensure visibility) */
.toast { box-shadow: 0 6px 18px rgba(2,6,23,0.2); }

/* Prevent the table wrapper from clipping dropdowns and make only horizontal overflow scroll on small screens */
.affiliates-table-responsive {
	overflow-x: auto; /* keep horizontal scrolling for narrow screens */
	overflow-y: visible !important; /* allow dropdowns and menus to extend outside */
}

/* Ensure dropdown menus show above other content */
.affiliates-table-responsive .dropdown-menu {
	z-index: 2000; /* high enough to avoid clipping */
}

/* Style reparented dropdown so it looks correct when moved to body */
.dropdown-reparented {
	box-shadow: 0 6px 18px rgba(2,6,23,0.25);
	border-radius: .5rem;
}

/* On very small screens, we still want vertical scrolling for the card body */
@media (max-width: 576px) {
	.affiliates-table-responsive { overflow-y: auto; }
}
