/* =====================================================================
   Premium finish. Loaded last, after style.css and brand.css.
   Only refines the look: depth, light, texture and a few cramped layouts.
   Keeps the AFT brand tokens from brand.css (navy #103157, mid blue #516993,
   ice #e7f0ff, League Spartan / Ramabhadra / Segoe UI) and does not change
   the KPI tiles' structure, the 1280px grid, sticky table heads or [hidden].
   ===================================================================== */

:root {
  --pm-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --pm-hairline: rgba(231, 240, 255, 0.07);
  --pm-glow-a: rgba(81, 105, 147, 0.28);
  --pm-glow-b: rgba(26, 74, 122, 0.35);
  --pm-dots: rgba(231, 240, 255, 0.05);
  --pm-btn-hi: rgba(255, 255, 255, 0.05);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -14px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 26px 56px -22px rgba(0, 0, 0, 0.7);
}
:root[data-theme="light"] {
  --page: #eef2f8;
  --border: #e0e7f0;
  --pm-hairline: rgba(255, 255, 255, 0.9);
  --pm-glow-a: rgba(81, 105, 147, 0.16);
  --pm-glow-b: rgba(16, 49, 87, 0.09);
  --pm-dots: rgba(16, 49, 87, 0.045);
  --pm-btn-hi: rgba(255, 255, 255, 0.85);
  --shadow: 0 1px 2px rgba(16, 49, 87, 0.05), 0 10px 30px -14px rgba(16, 49, 87, 0.2);
  --shadow-lg: 0 2px 4px rgba(16, 49, 87, 0.06), 0 26px 52px -22px rgba(16, 49, 87, 0.34);
}

/* ---------- page: soft navy light from the top corners, faint dot texture ---------- */
body {
  background:
    radial-gradient(1100px 560px at 88% -8%, var(--pm-glow-a), transparent 62%),
    radial-gradient(900px 520px at -8% -4%, var(--pm-glow-b), transparent 60%),
    radial-gradient(var(--pm-dots) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--page);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--aft-mid); outline-offset: 3px; }

/* ---------- top bar: deeper navy with a lit hairline underneath ---------- */
.topbar {
  background: linear-gradient(180deg, #13385f 0%, #0f2d50 100%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 10px 30px -12px rgba(8, 24, 44, 0.55);
}
:root:not([data-theme="light"]) .topbar { background: linear-gradient(180deg, #0f2a49 0%, #0b2139 100%); }
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(231, 240, 255, 0.45) 30%, rgba(141, 156, 185, 0.6) 70%, transparent 100%);
}
.brand { letter-spacing: 0.005em; }
.brand-logo { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25)); }

/* ---------- cards: layered shadow, a lit top edge, smoother hover ---------- */
.card {
  border-color: var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 var(--pm-hairline);
  transition: border-color 0.35s var(--pm-ease), box-shadow 0.45s var(--pm-ease), transform 0.45s var(--pm-ease);
}
.card:hover { box-shadow: var(--shadow-lg), inset 0 1px 0 var(--pm-hairline); }
main { gap: 22px; }
.card-head h2 { font-size: 20px; letter-spacing: -0.005em; }
.card-head h2::after { width: 36px; height: 3px; background: linear-gradient(90deg, var(--aft-navy), var(--aft-mid) 70%, var(--aft-soft)); }
:root:not([data-theme="light"]) .card-head h2::after { background: linear-gradient(90deg, var(--aft-soft), var(--aft-ice)); }
.card-head .sub { color: var(--muted); }

/* ---------- hero: richer navy, corner light and a fading dot grid ---------- */
.hero.card {
  background:
    radial-gradient(720px 380px at 100% 0%, rgba(141, 156, 185, 0.32), transparent 62%),
    radial-gradient(640px 420px at 0% 110%, rgba(6, 20, 38, 0.55), transparent 60%),
    linear-gradient(135deg, #0e2b4d 0%, #17436f 48%, #4d6690 100%);
  box-shadow: 0 2px 4px rgba(8, 24, 44, 0.2), 0 30px 60px -28px rgba(8, 24, 44, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.hero.card:hover { box-shadow: 0 2px 4px rgba(8, 24, 44, 0.2), 0 30px 60px -28px rgba(8, 24, 44, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.hero.card::before {
  display: block; content: ""; position: absolute; inset: 0; height: auto; z-index: -1; transform: none; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px) 0 0 / 22px 22px;
  -webkit-mask-image: linear-gradient(120deg, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 75%);
  mask-image: linear-gradient(120deg, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 75%);
}
.hero h1 { text-shadow: 0 2px 24px rgba(4, 16, 32, 0.35); }
.hero .eyebrow { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.hero-chip { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }
/* the four pipeline steps overflowed the hero's right column and clipped "Deliver" */
.hero .pipeline { min-width: 0; grid-template-columns: auto minmax(10px, 1fr) auto minmax(10px, 1fr) auto minmax(10px, 1fr) auto; }
.hero .pnode { width: 80px; }
.hero .orb { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 24px -10px rgba(0, 0, 0, 0.6); }

/* ---------- KPI tiles: keep the design, add the lit edge to match the cards ---------- */
.kpis .kpi { box-shadow: 0 1px 2px var(--kpi-ring), 0 12px 30px -16px rgba(16, 49, 87, 0.3), inset 0 1px 0 var(--pm-hairline); }
.kpis .kpi:hover { box-shadow: 0 1px 2px var(--kpi-ring), 0 22px 44px -18px rgba(16, 49, 87, 0.42), inset 0 1px 0 var(--pm-hairline); }

/* Admin summary tiles: same finish as the home KPI cards */
.tiles:not(.kpis) .tile {
  border-radius: 16px;
  background-image: radial-gradient(130% 100% at 100% 0%, rgba(81, 105, 147, 0.11) 0%, transparent 58%);
}
:root:not([data-theme="light"]) .tiles:not(.kpis) .tile { background-image: radial-gradient(130% 100% at 100% 0%, rgba(141, 156, 185, 0.14) 0%, transparent 58%); }
.tile-value { font-variant-numeric: tabular-nums; }

/* ---------- carousel cards ---------- */
.car-card {
  background: linear-gradient(180deg, var(--surface-solid) 0%, var(--surface-2) 100%);
  box-shadow: 0 1px 2px rgba(16, 49, 87, 0.05), inset 0 1px 0 var(--pm-hairline);
  transition: transform 0.45s var(--pm-ease), box-shadow 0.45s var(--pm-ease), border-color 0.3s;
}
.car-card:hover { background: var(--surface-solid); border-color: var(--accent-line); box-shadow: var(--shadow-lg); }

/* ---------- tables: calmer rows, clear hover, aligned numbers ---------- */
table { font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }
td { padding-top: 13px; padding-bottom: 13px; border-bottom-color: color-mix(in srgb, var(--grid, var(--border)) 80%, transparent); }
tbody tr { transition: background 0.25s var(--pm-ease), box-shadow 0.25s var(--pm-ease); }
tbody tr.clickable:hover { background: var(--accent-wash); box-shadow: inset 3px 0 0 var(--aft-mid); }
tbody tr.selected { box-shadow: inset 3px 0 0 var(--accent-strong); }
td .btn, .team-form .btn, .pager .btn { white-space: nowrap; }

/* ---------- buttons and inputs ---------- */
.btn:not(.btn-primary) {
  background: linear-gradient(180deg, var(--surface-solid), var(--surface-2));
  box-shadow: 0 1px 2px rgba(16, 49, 87, 0.06), inset 0 1px 0 var(--pm-btn-hi);
}
.btn:not(.btn-primary):hover { border-color: var(--accent-line); box-shadow: 0 6px 16px -8px rgba(16, 49, 87, 0.35), inset 0 1px 0 var(--pm-btn-hi); }
.btn-primary, .login .submit { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 22px -10px rgba(16, 49, 87, 0.7); }
.toolbar input[type="search"], .toolbar select, .team-form input, .team-form select, .login input {
  transition: border-color 0.25s var(--pm-ease), box-shadow 0.25s var(--pm-ease), background 0.25s;
}
.toolbar input[type="search"]:focus, .toolbar select:focus,
.team-form input:focus, .team-form select:focus, .login input:focus {
  outline: none; border-color: var(--aft-mid); box-shadow: 0 0 0 4px rgba(81, 105, 147, 0.18);
}
.seg { box-shadow: inset 0 1px 2px rgba(16, 49, 87, 0.06); }
.seg button.on { box-shadow: 0 1px 2px rgba(16, 49, 87, 0.12), 0 4px 12px -6px rgba(16, 49, 87, 0.35); }

/* ---------- filter sidebar: same surface language ---------- */
.results-layout > .filters { border: 1px solid var(--border); box-shadow: inset 0 1px 0 var(--pm-hairline); }

/* ---------- results: filters always in a left column on desktop, like a store's collection page ---------- */
.results-main > .toolbar-search { margin-bottom: 10px; }
@media (min-width: 761px) {
  /* "Hide" used to turn the sidebar into a full-width bar on top; now it just folds to its header and stays left */
  .results-layout:has(.filters.closed) { grid-template-columns: 280px minmax(0, 1fr); }
  .results-layout > .filters.closed { position: sticky; top: 84px; padding: 14px 12px 14px 16px; }
}
@media (min-width: 761px) and (max-width: 1200px) {
  .results-layout:has(.filters.closed) { grid-template-columns: 230px minmax(0, 1fr); }
}

/* admin Agents card (.jobs/.job/.btn-play) is styled in brand.css by another session; left alone here */
.team-row { box-shadow: inset 0 1px 0 var(--pm-hairline); }

/* ---------- log ---------- */
.log { box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08); }

/* ---------- login: lit navy backdrop with texture, floating card ---------- */
.login-wrap {
  background:
    radial-gradient(900px 600px at 85% 0%, rgba(141, 156, 185, 0.35), transparent 60%),
    radial-gradient(800px 600px at 0% 100%, rgba(6, 20, 38, 0.6), transparent 60%),
    radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(135deg, #0e2b4d 0%, #17436f 50%, #4d6690 100%);
}
.login.card {
  border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 6px rgba(4, 16, 32, 0.2), 0 40px 80px -30px rgba(4, 16, 32, 0.8);
}
.login.card:hover { box-shadow: 0 2px 6px rgba(4, 16, 32, 0.2), 0 40px 80px -30px rgba(4, 16, 32, 0.8); }
.login .brand-badge {
  border-radius: 16px 16px 0 0;
  background: radial-gradient(420px 160px at 50% 0%, rgba(141, 156, 185, 0.35), transparent 70%), linear-gradient(180deg, #13385f, #0e2b4d);
}

@media (prefers-reduced-motion: reduce) {
  .card, .car-card, tbody tr, .btn { transition: none; }
}
