/* ==========================================================================
     SUPLINE STARTER CSS -- canonical tokens + core components
     Values are taken from the production platform (style.css "v4 strict
     minimal" layer). Use this file as the foundation of any new Supline-style
     project. Font: Inter 400..900 (Google Fonts), icons: Lucide, stroke 1.75.
     ========================================================================== */

/* ---------- 1. Tokens (light) ---------- */
/* 2026-11-12 (Barry): the values of the company's own dashboard platform. Navy is the brand,
   the slate ramp the neutrals, corners are tighter (cards 10, buttons 8, fields 6) and depth is a hairline more than a
   shadow. Supline keeps its own name and wordmark; only the design language follows the platform. */
:root {

    /* neutral ramp (slate) */
    --n-0:#ffffff; --n-25:#fafbfc; --n-50:#f6f7f9; --n-100:#eef0f3; --n-200:#e3e6eb;
    --n-300:#cdd2da; --n-400:#9ba2ad; --n-450:#656d7a; --n-500:#6b7380; --n-550:#5a626e;
    --n-600:#4a525e; --n-700:#323841; --n-800:#1f2329; --n-900:#11141a;
    /* the platform's blue scale (the same in both themes); navy is the brand, the yellow stays for the org chart only */
    --blue-50:#eff6ff; --blue-100:#dbeafe; --blue-200:#93c5fd; --blue-300:#5ba3e8; --blue-400:#3a8dde;
    --blue-500:#1a82d4; --blue-600:#0f6ab8; --blue-700:#0c5a9e; --blue-800:#094780; --blue-900:#072f57; --blue-950:#051e38;
    --yellow-100:#fff6d6; --yellow-300:#ffd24d; --yellow-400:#f5b700; --yellow-500:#e0a800; --yellow-800:#8a5a00;
    --navy:#0f3a64; --navy-deep:#07101e;
    /* brand (navy) */
    --brand:var(--navy); --brand-hover:#0c2f52; --accent-light:#1d5083; --brand-soft:#eaf0f7;
    --brand-text:var(--brand); --brand-ring:rgba(15,58,100,.18); --on-brand:#ffffff;
    --seg-edge:rgba(15,58,100,.08);
    /* the active nav item: a light-blue edge and icon and a soft blue glow */
    --nav-accent:#6ea8e6; --nav-glow:rgba(58,141,222,.18);
    /* accent (yellow): the org chart's gold (Ruling R7); never a primary button fill */
    --accent:var(--yellow-400); --accent-hover:var(--yellow-500);
    --accent-soft:var(--yellow-100); --accent-ink:var(--yellow-800); --on-accent:#1a1300;
    /* icon chips (P3): a tint and its ink, each ink at least 4.5:1 on its tint over the card */
    --chip-blue-bg:#eaf0f7; --chip-blue-ink:#0f3a64; --chip-yellow-bg:#fff6d6; --chip-yellow-ink:#8a5a00;
    --chip-green-bg:#e8f7ee; --chip-green-ink:#166534; --chip-pink-bg:#fce7f3; --chip-pink-ink:#be185d;
    /* semantic surfaces & text */
    --bg:var(--n-50); --bg-2:var(--n-100); --bg-card:var(--n-0);
    --text:var(--n-900); --text-2:var(--n-700); --text-muted:var(--n-550); --text-light:var(--n-450);
    --border:var(--n-200); --border-light:var(--n-100);
    /* status -- colour only when it signals something */
    --ok:#16794e; --ok-soft:#e6f4ec; --ok-bg:#d1fae5; --ok-ink:#065f46;
    --warn:#b45309; --warn-soft:#fff7ed; --warn-bg:#ffedd5; --warn-ink:#9a3412;
    --err:#b42318; --err-soft:#fdecea; --err-bg:#fee2e2; --err-ink:#991b1b;
    --yel-bg:#fef9c3; --yel-ink:#854d0e; --neu-bg:#f1f5f9; --neu-ink:#64748b;
    /* status chips (the platform's tinted chips: the status colour at 12% under its ink) */
    --chip-ok-bg:rgba(22,121,78,.12); --chip-ok-ink:#166534; --chip-warn-bg:rgba(180,83,9,.12); --chip-warn-ink:#92400e;
    --chip-err-bg:rgba(180,35,24,.12); --chip-err-ink:#991b1b; --chip-neu-bg:rgba(100,116,139,.10); --chip-neu-ink:#4a525e;
    /* alerts, toasts, attention rows, deltas (tint + ink + edge) */
    --alert-err-bg:#fef2f2; --alert-err-ink:#991b1b; --alert-err-edge:#fecaca;
    --alert-ok-bg:#ecfdf5; --alert-ok-ink:#065f46; --alert-ok-edge:#a7f3d0; --alert-warn-edge:#fdba74;
    --toast-ok-ico:#16794e; --toast-err-ico:#b42318; --on-solid:#ffffff;
    --crit:#b91c1c; --attn-warn-bg:#fffbeb; --delta-up:#15803d; --delta-down:#b91c1c;
    /* "All clear": the platform's calm green status button */
    --clear-bg:#f0fdf4; --clear-ink:#166534; --clear-edge:#86efac; --clear-ico:#16794e;
    /* freshness dot: live green, stale amber, each with its halo */
    --fresh:#10b981; --fresh-halo:rgba(16,185,129,.18); --stale:#f59e0b; --stale-halo:rgba(245,158,11,.18);
    /* the navy surfaces (sidebar, phone header): white text and white veils, the same in both themes */
    --on-navy:#ffffff;
    --on-navy-2:rgba(255,255,255,.62);
    /* the faint text (menu counts, the empty search line) and the section labels at 4.65:1 on navy (the platform has .42 / .32: 3.4 / 2.6:1) */
    --on-navy-faint:rgba(255,255,255,.55);
    --on-navy-label:rgba(255,255,255,.55);
    --on-navy-icon:rgba(255,255,255,.85);
    --navy-hover:rgba(255,255,255,.09);
    --navy-active:rgba(255,255,255,.14);
    --navy-active-edge:rgba(255,255,255,.12);
    --press-tint:rgba(16,24,40,.06);
    --navy-hairline:rgba(255,255,255,.08);
    --navy-edge:rgba(255,255,255,.06);
    --navy-field:rgba(255,255,255,.07); --navy-field-edge:rgba(255,255,255,.10);
    --navy-field-focus:rgba(255,255,255,.12); --navy-field-focus-edge:rgba(255,255,255,.25);
    --navy-well:rgba(0,0,0,.14);
    --avatar-hi:rgba(255,255,255,.3); --avatar-lo:rgba(255,255,255,.08); --avatar-edge:rgba(255,255,255,.25);
    --sb-open-shadow:4px 0 24px rgba(0,0,0,.18);
    /* table header and row-hover fills (solid: the pinned cells copy them) */
    --tbl-head:var(--n-50); --tbl-hover:var(--n-50);
    /* the modal backdrop (no blur) */
    --scrim-modal:rgba(17,20,26,.42);
    /* shadows: the platform's scale */
    --sh-xs:0 1px 2px rgba(17,20,26,.04);
    --sh-sm:0 1px 2px rgba(17,20,26,.05), 0 1px 3px rgba(17,20,26,.06);
    --sh:0 2px 4px rgba(17,20,26,.05), 0 4px 12px rgba(17,20,26,.06);
    --sh-lg:0 6px 16px rgba(17,20,26,.08), 0 12px 32px rgba(17,20,26,.06);
    --sh-xl:0 12px 32px rgba(17,20,26,.1), 0 24px 48px rgba(17,20,26,.08);
    /* elevation (P) follows the platform: a resting card is nearly flat, a popover lifts, a window floats */
    --elev-1:var(--sh-xs);
    --elev-2:var(--sh-lg);
    --elev-3:var(--sh-xl);
    --elev-press:0 1px 2px rgba(17,20,26,.06);
    --elev-1-lite:0 1px 2px rgba(17,20,26,.06);
    --elev-2-lite:0 4px 12px -2px rgba(17,20,26,.12);
    --elev-3-lite:0 12px 32px -8px rgba(17,20,26,.2);
    --highlight:inset 0 0 0 0 transparent;
    --card-edge:var(--border);
    --sh-pop:var(--sh-lg);
    --sh-window:var(--sh-xl);
    /* radii (less rounded), as the platform renders them (its last :root sets --radius-sm:6px, and its KPI tiles, sections
       and buttons use it): cards, KPI tiles, panels and buttons 6, nav items 9, fields 6, status chips 6, chips and count
       pills 12 (--radius-chip-lg), fully round 999 (--pill); windows 12: hub.css */
    --radius:8px; --radius-sm:6px; --radius-xs:4px; --radius-card:6px; --radius-kpi:6px; --radius-panel:6px;
    --radius-btn:6px; --radius-nav:9px; --radius-chip:6px; --radius-chip-lg:12px; --pill:999px;
    /* spacing scale */
    --space-1:2px; --space-2:4px; --space-3:8px; --space-4:12px; --space-5:16px;
    --space-6:24px; --space-7:32px; --space-8:48px; --space-9:64px;
    /* type: titles clearly bigger than the body */
    --font:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
    --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
    --fs-body:clamp(13px,1.4vw,14px);
    --fs-page-title:clamp(20px,4.2vw,26px);
    --fs-hero:32px;
    --fs-kpi:24px;
    /* motion vocabulary */
    /* (the old --dur-1/2/3 and --ease-out stay for existing rules; P names every duration and curve) */
    --dur-1:.14s; --dur-2:.22s; --dur-3:.34s; --dur-sheet:.42s; --dur-window:.55s; --dur-exit:.18s;
    --dur-press:.12s; --dur-fast:.18s; --dur-hover:.35s; --dur-route:.32s; --dur-count:.9s;
    --ease-out:cubic-bezier(.2,.7,.3,1); --ease-in-out:cubic-bezier(.4,0,.2,1);
    --ease-window:cubic-bezier(.2,1.1,.3,1); --ease-sheet:cubic-bezier(.32,.72,0,1); --ease-exit:cubic-bezier(.4,0,1,1);
    --ease-spring:cubic-bezier(.2,.9,.25,1.2); --ease-smooth:cubic-bezier(.22,1,.36,1);
    /* how far a hover lifts and a press sinks (reduced motion sets them to 0 / 1 / 1: same look, no movement) */
    --lift-y:-4px; --lift-scale:1.015; --press-scale:.97;
    /* layout */
    --sidebar-w:76px; --sidebar-w-open:256px;
}

/* ---------- 2. Tokens (dark) -- same names, inverted ramp ---------- */
[data-theme="dark"] {

    --n-0:#0e1626; --n-25:#131c30; --n-50:#0a1120; --n-100:#1a2540; --n-200:#243353; --n-300:#324569;
    --n-400:#5d6f8c; --n-450:#7d8fac; --n-500:#94a3b8; --n-600:#b0bbc9; --n-700:#cfd5de;
    --n-800:#e6eaf0; --n-900:#f0f3f8;
    --brand:#5b89c2; --brand-hover:#6f9ad0; --accent-light:#7aa5d8; --brand-soft:#1a2942;
    --brand-text:#6f9bd0; --brand-ring:rgba(91,137,194,.35);
    /* the lighter dark-theme brand carries dark ink (5.2:1), the primary button's included (as the platform's) */
    --on-brand:#0a1120;
    --seg-edge:rgba(111,155,208,.12);
    --accent-hover:#ffc72c; --accent-soft:rgba(245,183,0,.14); --accent-ink:var(--yellow-300);
    --chip-blue-bg:#1a2942; --chip-blue-ink:#6f9bd0; --chip-yellow-bg:rgba(245,183,0,.14); --chip-yellow-ink:#ffd24d;
    --chip-green-bg:rgba(34,197,94,.15); --chip-green-ink:#4ade80; --chip-pink-bg:rgba(244,114,182,.15); --chip-pink-ink:#f9a8d4;
    --text-muted:var(--n-500);
    --ok:#22c55e; --warn:#f59e0b; --err:#ef4444;
    --ok-soft:rgba(34,197,94,.15); --ok-bg:rgba(34,197,94,.15); --ok-ink:#4ade80;
    --warn-soft:rgba(245,158,11,.15); --warn-bg:rgba(245,158,11,.15); --warn-ink:#fbbf24;
    --err-soft:rgba(239,68,68,.15); --err-bg:rgba(239,68,68,.15); --err-ink:#fca5a5;
    --yel-bg:rgba(234,179,8,.15); --yel-ink:#fde047; --neu-bg:rgba(148,163,184,.15); --neu-ink:#cbd5e1;
    --chip-ok-bg:rgba(34,197,94,.18); --chip-ok-ink:#86efac; --chip-warn-bg:rgba(245,158,11,.18); --chip-warn-ink:#fcd34d;
    --chip-err-bg:rgba(239,68,68,.18); --chip-err-ink:#fca5a5; --chip-neu-bg:rgba(148,163,184,.14); --chip-neu-ink:#cbd5e1;
    --alert-err-bg:var(--err-soft); --alert-err-ink:var(--err-ink); --alert-err-edge:rgba(239,68,68,.3);
    --alert-ok-bg:var(--ok-bg); --alert-ok-ink:var(--ok-ink); --alert-ok-edge:var(--ok); --alert-warn-edge:rgba(245,158,11,.4);
    --crit:var(--err); --attn-warn-bg:var(--warn-soft); --delta-up:#4ade80; --delta-down:#f87171;
    --clear-bg:rgba(34,197,94,.12); --clear-ink:#86efac; --clear-edge:rgba(34,197,94,.45); --clear-ico:#4ade80;
    --tbl-head:#131e34; --tbl-hover:#182338;
    --sh-xs:0 1px 2px rgba(0,0,0,.45);
    --sh-sm:0 1px 3px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.25);
    --sh:0 2px 6px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.35);
    --sh-lg:0 8px 20px rgba(0,0,0,.5), 0 12px 32px rgba(0,0,0,.4);
    --sh-xl:0 12px 32px rgba(0,0,0,.55), 0 24px 48px rgba(0,0,0,.45);
    --elev-press:0 1px 2px rgba(0,0,0,.5);
    --elev-1-lite:0 1px 2px rgba(0,0,0,.5);
    --elev-2-lite:0 6px 16px -4px rgba(0,0,0,.6);
    --elev-3-lite:0 16px 40px -10px rgba(0,0,0,.7);
    --press-tint:rgba(255,255,255,.08);
    --scrim-modal:rgba(0,0,0,.55);
    color-scheme:dark;
}
[data-theme="dark"] .sidebar { background:var(--navy-deep); }

/* ---------- 3. Base ---------- */
html { font-size:15px; }
body { margin:0; font-family:var(--font); font-size:var(--fs-body); background:var(--bg); color:var(--text); line-height:1.55;
       -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }
h1,h2,h3 { letter-spacing:-.4px; }
a { color:inherit; text-decoration:none; }
:focus-visible { outline:2px solid var(--brand); outline-offset:2px; border-radius:4px; }
.num, td.num, .tnum { font-variant-numeric:tabular-nums; }
[data-lucide], svg.lucide { width:16px; height:16px; stroke-width:1.75; vertical-align:-3px; flex-shrink:0; }

/* ---------- 4. App shell ---------- */
.app { display:flex; min-height:100vh; min-height:100svh; }
.sidebar { position:fixed; inset:0 auto 0 0; width:var(--sidebar-w); background:var(--navy); color:var(--on-navy);
           display:flex; flex-direction:column; z-index:100; border-right:1px solid var(--navy-edge);
           transition:width var(--dur-3) cubic-bezier(.22,1,.36,1); overflow:hidden; }
html.sidebar-pinned .sidebar { width:var(--sidebar-w-open); } /* no :hover widening: the rail opens by click (kit/rail.js) */
.sb-logo { padding:22px 20px; border-bottom:1px solid var(--navy-hairline); display:flex; align-items:center; gap:12px; }
.sb-search { margin:14px 14px 4px; border-radius:var(--radius); background:var(--navy-field);
             border:1px solid var(--navy-field-edge); padding:0 10px; display:flex; align-items:center; gap:8px;
             transition:background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out); }
.sb-search:focus-within { background:var(--navy-field-focus); border-color:var(--navy-field-focus-edge); }
.sb-search input { all:unset; color:var(--on-navy); font-size:13px; padding:9px 0; width:100%; min-width:0; }
.sb-search input::placeholder { color:var(--on-navy-2); } /* 5.48:1 on navy */
.sb-nav { padding:14px 10px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:var(--on-navy-label) transparent; flex:1; min-height:0; } /* scrolls closed or open; min-height:0 lets the flex item shrink so it can */
.sb-label { display:flex; align-items:center; gap:8px; font-size:10px; font-weight:700; text-transform:uppercase;
            letter-spacing:1.1px; color:var(--on-navy-label); padding:18px 8px 7px; white-space:nowrap; }
.sb-label::after { content:''; flex:1; height:1px; background:var(--navy-hairline); }
.sb-nav > .sb-label:first-child { padding-top:4px; }
.nav-item { position:relative; display:flex; align-items:center; gap:11px; width:100%; padding:9px 12px; margin-bottom:2px; border-radius:var(--radius-nav);
            color:var(--on-navy-2); font-size:13.5px; font-weight:500; white-space:nowrap; cursor:pointer;
            transition:background var(--dur-fast) var(--ease-smooth),color var(--dur-fast) var(--ease-smooth),box-shadow var(--dur-fast) var(--ease-smooth),transform var(--dur-hover) var(--ease-spring); }
.nav-item [data-lucide], .nav-item svg { width:18px; height:18px; color:var(--on-navy-icon); }
.nav-item:hover { background:var(--navy-hover); color:var(--on-navy); }
@media (hover:hover) and (pointer:fine) { .nav-item:hover { transform:translateX(3px); } }
.nav-item.active { background:var(--navy-active); color:var(--on-navy); font-weight:700;
                   box-shadow:0 0 8px -2px var(--nav-glow), inset 0 0 0 1px var(--navy-active-edge); } /* Barry 2026-11-17: the glow stays inside the menu's 10px padding, never reaching the sidebar edge */
/* the light-blue edge is always there, collapsed; the active item springs it open (transform only) */
.nav-item::before { content:''; position:absolute; left:0; top:14%; bottom:14%; width:3px; border-radius:0 3px 3px 0;
                    background:var(--nav-accent); transform:scaleY(0); transform-origin:center;
                    transition:transform var(--dur-hover) var(--ease-spring); }
.nav-item.active::before { transform:scaleY(1); }
.nav-item.active svg { color:var(--nav-accent); }
.nav-count { margin-left:auto; font-size:11px; font-weight:600; color:var(--on-navy-faint); }
.nav-item:hover .nav-count { color:var(--on-navy-2); }
.sb-user { padding:12px 14px; background:var(--navy-well); border-top:1px solid var(--navy-hairline); display:flex;
           gap:10px; align-items:center; }
.avatar { width:40px; height:40px; border-radius:50%; display:grid; place-items:center; font-weight:700;
          background:linear-gradient(135deg,var(--avatar-hi),var(--avatar-lo)); border:1.5px solid var(--avatar-edge); }
.main { margin-left:var(--sidebar-w); flex:1; min-width:0; }
.page { padding:24px; } /* no wasted space: content runs edge to edge with the platform's 24px page gutter */

/* page header */
.crumbs { font-size:12px; color:var(--text-muted); display:flex; gap:6px; align-items:center; }
.crumbs .sep { opacity:.4; }
.page-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap;
             padding-bottom:16px; margin-bottom:18px; border-bottom:1px solid var(--border); }
/* the eyebrow above a page title (the platform's: 11.5px / 800 / uppercase / 1.38px, in the brand) */
.cat-badge { display:inline-flex; align-items:center; gap:6px; padding:0; border-radius:0; background:none;
             color:var(--brand-text); font-size:11.5px; font-weight:800; line-height:1.2; text-transform:uppercase; letter-spacing:.12em; }
.cat-badge svg { width:13px; height:13px; }
.page-title { font-size:var(--fs-page-title); font-weight:800; letter-spacing:-.6px; line-height:1.15; margin:8px 0 0; color:var(--text); }
.page-sub { font-size:13.5px; font-weight:500; color:var(--text-muted); margin-top:6px; }
.fresh { display:inline-flex; align-items:center; gap:7px; font-size:12px; color:var(--text-muted); margin-top:8px; }
.fresh-dot { width:7px; height:7px; border-radius:50%; background:var(--fresh); box-shadow:0 0 0 3px var(--fresh-halo); }
.fresh.stale .fresh-dot { background:var(--stale); box-shadow:0 0 0 3px var(--stale-halo); }
.page-head > :first-child { flex:1; min-width:0; }
.page-actions { display:flex; gap:10px; align-items:flex-start; flex-wrap:wrap; }
.stack { display:flex; flex-direction:column; gap:14px; }
.row-sep { border-top:1px solid var(--border); padding-top:14px; }

/* ---------- 5. Buttons ---------- */
/* The company platform's buttons as it renders them (its last override layer: .btn radius --radius-sm and no shadow,
   !important): radius 6, 700 weight, flat. Primary is solid brand with --on-brand text (white on navy; dark ink on the
   dark theme's lighter brand, as the platform's --n-0); outline and secondary are the white "How it works" / "Print" look,
   --text-2 on the card with a 1px neutral edge (transparent with --text in dark); ghost bare. Where a pointer can hover
   a button rises 1px (a quarter of --lift-y); a press sinks to --press-scale over --dur-press and springs back over
   --dur-hover. .btn:active follows the hover block and .btn:disabled follows both, so a press beats the rise and a
   disabled button never moves. */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:36px; padding:10px 20px; border-radius:var(--radius-btn);
       font:700 13.5px/1 var(--font); border:1px solid transparent; cursor:pointer; white-space:nowrap;
       transition:background var(--dur-fast) var(--ease-smooth), border-color var(--dur-fast) var(--ease-smooth), color var(--dur-fast),
                  box-shadow var(--dur-fast) var(--ease-smooth), transform var(--dur-hover) var(--ease-spring); }
.btn svg, .btn [data-lucide] { width:14px; height:14px; }
.btn-primary { background:var(--brand); border-color:var(--brand); color:var(--on-brand); box-shadow:none; }
.btn-primary:hover { background:var(--brand-hover); border-color:var(--brand-hover); }
.btn-secondary, .btn-outline { background:var(--bg-card); color:var(--text-2); border:1px solid var(--border); }
.btn-secondary:hover, .btn-outline:hover { background:var(--n-50); border-color:var(--n-300); }
[data-theme="dark"] .btn-secondary, [data-theme="dark"] .btn-outline { background:transparent; color:var(--text); }
[data-theme="dark"] .btn-secondary:hover, [data-theme="dark"] .btn-outline:hover { background:var(--n-100); }
.btn-ghost { background:transparent; color:var(--text-2); padding:8px 12px; }
.btn-ghost:hover { background:var(--n-100); color:var(--text); }
[data-theme="dark"] .btn-ghost { color:var(--text-muted); }
[data-theme="dark"] .btn-ghost:hover { color:var(--text); }
.btn-danger { background:var(--err); border-color:var(--err); color:var(--on-solid); box-shadow:none; }
.btn-danger:hover { filter:brightness(.92); }
.btn-sm { min-height:30px; padding:7px 13px; font-size:12px; }
.btn-sm svg, .btn-sm [data-lucide] { width:13px; height:13px; }
.btn-xs { min-height:0; padding:3px 10px; font-size:11px; font-weight:600; border-radius:var(--radius-sm); }
@media (hover:hover) and (pointer:fine) { .btn:hover { transform:translateY(calc(var(--lift-y) / 4)); } }
.btn:active { transform:scale(var(--press-scale)); transition:transform var(--dur-press) var(--ease-out); }
.btn:disabled { opacity:.5; cursor:not-allowed; transform:none; box-shadow:none; }
.icon-btn { width:30px; height:30px; display:grid; place-items:center; border-radius:var(--radius-sm); color:var(--text-muted);
            background:none; border:0; cursor:pointer;
            transition:background var(--dur-fast) var(--ease-smooth), color var(--dur-fast), transform var(--dur-hover) var(--ease-spring); }
.icon-btn:hover { background:var(--bg-2); color:var(--text); }
.icon-btn:active { transform:scale(var(--press-scale)); transition:transform var(--dur-press) var(--ease-out); }
.icon-btn:disabled { transform:none; }

/* segmented tabs (view switch in a page header): the platform's view tabs, a light track with the chosen tab raised on it */
.seg { display:inline-flex; gap:2px; padding:3px; background:var(--n-100); border:1px solid var(--border); border-radius:var(--radius); }
.seg button { padding:6px 14px; border-radius:var(--radius-sm); font:600 13px var(--font); color:var(--text-muted); background:none;
              border:0; cursor:pointer; display:inline-flex; gap:6px; align-items:center;
              transition:background var(--dur-fast) var(--ease-smooth), color var(--dur-fast), box-shadow var(--dur-fast) var(--ease-smooth); }
.seg button:hover:not(.active) { color:var(--text); }
.seg button.active { background:var(--bg-card); color:var(--brand-text); font-weight:700; box-shadow:var(--sh-sm), 0 0 0 1px var(--seg-edge); }
/* the same tabs when they are links (Tasks, Communication, Leave) */
.seg a { padding:6px 14px; border-radius:var(--radius-sm); font:600 13px var(--font); color:var(--text-muted); text-decoration:none;
         display:inline-flex; gap:6px; align-items:center;
         transition:background var(--dur-fast) var(--ease-smooth), color var(--dur-fast), box-shadow var(--dur-fast) var(--ease-smooth); }
.seg a:hover:not(.active) { color:var(--text); }
.seg a.active { background:var(--bg-card); color:var(--brand-text); font-weight:700; box-shadow:var(--sh-sm), 0 0 0 1px var(--seg-edge); }

/* ---------- 6. Pills, badges, deltas ---------- */
/* status chips: the platform's soft tint under a coloured 11px / 700 label, radius 6 */
.badge { display:inline-block; padding:2px 8px; border-radius:var(--radius-chip); font-size:11px; font-weight:700; line-height:1.45; }
.badge-green { background:var(--chip-ok-bg); color:var(--chip-ok-ink); }
.badge-yellow { background:var(--yel-bg); color:var(--yel-ink); }
.badge-amber { background:var(--chip-warn-bg); color:var(--chip-warn-ink); }
.badge-red { background:var(--chip-err-bg); color:var(--chip-err-ink); }
.badge-neutral { background:var(--chip-neu-bg); color:var(--chip-neu-ink); }
.count-pill { font-size:11px; font-weight:700; padding:2px 8px; border-radius:var(--radius-chip-lg); background:var(--brand-soft);
              color:var(--brand-text); text-transform:none; letter-spacing:0; font-variant-numeric:tabular-nums; }
.yoy { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:var(--radius-chip-lg); font-size:11px;
       font-weight:700; font-variant-numeric:tabular-nums; }
.yoy svg { width:12px; height:12px; }
.yoy-good { background:var(--ok-soft); color:var(--ok); }
.yoy-bad { background:var(--err-soft); color:var(--err); }
.yoy-neutral { background:var(--n-100); color:var(--text-muted); }
.pos { color:var(--delta-up); } .neg { color:var(--delta-down); } .muted { color:var(--text-muted); }
.chip { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:var(--radius-chip-lg); background:var(--brand-soft);
        color:var(--brand-text); font-size:11px; font-weight:700; }

/* ---------- 7. Cards & sections ---------- */
/* the platform's panel: a white card on a 1px border, radius 10, nearly flat; a header with a 14px / 800 title and an
   11.5px subtitle on the left, a chip or an action on the right */
.card { background:var(--bg-card); border:1px solid var(--card-edge); border-radius:var(--radius-card); box-shadow:var(--elev-1), var(--highlight);
        padding:14px 18px 16px; display:flex; flex-direction:column; gap:10px; min-width:0; }
.card-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap;
             padding-bottom:10px; border-bottom:1px solid var(--border-light); }
.card-title { font-size:14px; font-weight:800; letter-spacing:-.1px; color:var(--text);
              display:flex; gap:8px; align-items:center; }
.card-sub { font-size:12px; font-weight:500; color:var(--text-muted); margin-top:2px; }
.card-actions { display:inline-flex; gap:8px; margin-left:auto; }
.card-body-fixed { height:320px; overflow-y:auto; } /* cards never grow with their content */
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.divider-label { display:flex; align-items:center; gap:12px; margin:8px 0 18px; font-size:10.5px; font-weight:700;
                 text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted); }
.divider-label::before,.divider-label::after { content:''; flex:1; height:1px; background:linear-gradient(90deg,transparent,var(--border) 50%,transparent); }

/* ---------- 8. KPI cards ---------- */
/* the platform's KPI tiles: a row of tight cards 12px apart, a tight card with an uppercase label, the big value, a
   delta line and, under a dashed rule, a sub-metric. A hover darkens the edge and fades in a small shadow on ::after
   (opacity, so the compositor does the work); nothing moves. .kpi-accent-warn / -err put the status colour on the left edge (Today's
   "Needs attention" while someone is late or a no-show), as the platform's accented tile. */
.kpi-row { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; } /* Today's four tiles share one row (the platform puts its six in rows of three) */
.kpi { position:relative; background:var(--bg-card); border:1px solid var(--card-edge); border-radius:var(--radius-kpi); padding:14px 16px 12px;
       box-shadow:var(--elev-1), var(--highlight); min-height:104px; min-width:0; display:flex; flex-direction:column; gap:6px; justify-content:flex-start;
       transition:transform var(--dur-hover) var(--ease-spring), border-color var(--dur-fast) var(--ease-smooth); }
.kpi::before { content:''; position:absolute; left:-1px; top:-1px; bottom:-1px; width:3px; border-radius:var(--radius-kpi) 0 0 var(--radius-kpi);
               background:var(--kpi-accent, transparent); }
.kpi-accent-warn { --kpi-accent:var(--warn); } .kpi-accent-err { --kpi-accent:var(--err); }
.kpi::after { content:''; position:absolute; inset:-1px; border-radius:inherit; box-shadow:var(--sh-sm); opacity:0;
              transition:opacity var(--dur-hover) var(--ease-smooth); pointer-events:none; }
@media (hover:hover) and (pointer:fine) {
    .kpi:hover { border-color:var(--n-300); z-index:1; }
    .kpi:hover::after { opacity:1; }
}
.kpi:active:not(:has(.info-tip:active)) { transform:scale(var(--press-scale)); transition:transform var(--dur-press) var(--ease-out); }
.kpi-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--text-muted);
             padding-right:28px; }
.kpi-value { font-size:var(--fs-kpi); font-weight:800; line-height:1.1; letter-spacing:-.5px; color:var(--text); font-variant-numeric:tabular-nums; }
.kpi-sub { font-size:12px; font-weight:500; color:var(--text-muted); margin-top:auto; padding-top:6px; border-top:1px dashed var(--border-light);
           display:flex; gap:6px; align-items:baseline; flex-wrap:wrap; }
.kpi-sub b, .kpi-sub strong { color:var(--text-2); font-weight:700; font-variant-numeric:tabular-nums; }
.kpi-icon { position:absolute; top:12px; right:14px; opacity:.85; color:var(--brand-text); }
.kpi-icon.ok { color:var(--ok); } .kpi-icon.warn { color:var(--warn); } .kpi-icon.err { color:var(--err); }
.delta-up { color:var(--delta-up); font-weight:600; font-size:12px; } .delta-down { color:var(--delta-down); font-weight:600; font-size:12px; }

/* ---------- 9. Tables ---------- */
/* the platform's tables: rows about 40px on hairlines, an uppercase muted head, right-aligned tabular numbers, bold totals */
.tbl-wrap { overflow:auto; border:1px solid var(--card-edge); border-radius:var(--radius-panel); max-height:58vh; max-height:58dvh; overscroll-behavior-x:contain; background:var(--bg-card); box-shadow:var(--elev-1); }
.tbl { width:100%; border-collapse:collapse; font-size:13px; font-variant-numeric:tabular-nums; }
.tbl th { position:sticky; top:0; z-index:2; background:var(--tbl-head); color:var(--text-muted); font-size:11px; font-weight:700;
          text-transform:uppercase; letter-spacing:.04em; text-align:left; padding:9px 14px; border-bottom:1px solid var(--border); white-space:nowrap; }
.tbl td { padding:10px 14px; border-bottom:1px solid var(--border-light); color:var(--text); transition:background var(--dur-fast) var(--ease-smooth); }
.tbl tbody tr:last-child td { border-bottom:0; }
.tbl tbody tr:hover td { background:var(--tbl-hover); }
.tbl .r { text-align:right; }
.tbl th.sticky, .tbl td.sticky { position:sticky; left:0; background:var(--bg-card); z-index:1; box-shadow:1px 0 0 var(--border-light); }
.tbl th.sticky { z-index:3; background:var(--tbl-head); }
.tbl th.sort { cursor:pointer; } .tbl th.sort:hover { color:var(--brand-text); }
.tbl th .arrow { color:var(--brand-text); font-weight:700; margin-left:4px; }
.tbl tr.subtotal td { background:var(--brand-soft); font-weight:700; color:var(--brand-text); }
.tbl tr.total td { background:var(--n-50); font-weight:800; border-top:1px solid var(--border); }
.tbl tr.click { cursor:pointer; } .tbl tr.click:hover td { background:var(--brand-soft); }
.tbl .dash { color:var(--text-light); }
.cf-btn { width:18px; height:18px; display:inline-grid; place-items:center; margin-left:4px; border-radius:var(--radius-xs); color:var(--text-muted); vertical-align:middle; }
.cf-btn.on { color:var(--brand); background:var(--brand-soft); }
.tbl-more td { text-align:center; padding:8px; }
.tbl-foot { font-size:12px; color:var(--text-light); padding:8px 2px 0; }
.tbl-empty { text-align:center; color:var(--text-muted); padding:24px 12px; }

/* ---------- 10. Filters & inputs ---------- */
.filter-bar { display:flex; align-items:flex-end; flex-wrap:wrap; gap:10px; background:var(--bg-card); border:1px solid var(--card-edge);
              border-radius:var(--radius-panel); padding:12px 14px; box-shadow:var(--elev-1); }
.f-group { display:flex; flex-direction:column; gap:4px; }
.f-label { font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); }
/* the platform's field: white, a 1.5px border (its .form-input), radius 6 and a soft brand ring on focus */
.f-input { height:36px; padding:0 12px; border:1.5px solid var(--border); border-radius:var(--radius-sm); background:var(--bg-card); font:13px var(--font);
           color:var(--text); display:inline-flex; align-items:center; gap:8px; min-width:150px; justify-content:space-between;
           transition:border-color var(--dur-fast) var(--ease-smooth), box-shadow var(--dur-fast) var(--ease-smooth); }
.f-input:hover { border-color:var(--n-300); }
.f-input:focus, .f-input.open { border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-ring); outline:none; }
/* one control look for every field: as tall as a button, the same corner and the same soft focus ring (textarea grows) */
.f-input, .acc-input, .af-input, .dp-input, select, textarea { height:36px; border-radius:var(--radius-sm); border-width:1.5px; }
.f-input:focus, .acc-input:focus, .af-input:focus, .dp-input:focus, select:focus, textarea:focus { border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-ring); outline:none; }
textarea { height:auto; min-height:76px; }
/* the date pill (the platform's: brand text on the brand tint, 12px / 700, radius 12) */
.period-chip { margin-left:auto; display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:var(--radius-chip-lg);
               background:var(--brand-soft); color:var(--brand-text); font-size:12px; font-weight:700; font-variant-numeric:tabular-nums; }
.popover { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-panel); box-shadow:var(--elev-2); padding:6px; min-width:248px; }
.pop-item { display:flex; align-items:center; gap:8px; padding:7px 10px; border-radius:var(--radius-sm); font-size:13px; color:var(--text-2);
            transition:background var(--dur-fast) var(--ease-smooth); }
.pop-item:hover { background:var(--n-50); }
.pop-item.active { background:var(--brand-soft); color:var(--brand-text); font-weight:600; }
.pop-sep { height:1px; background:var(--border-light); margin:6px 4px; }
.pop-actions { display:flex; justify-content:space-between; padding:4px 8px 6px; font-size:11.5px; font-weight:600; color:var(--brand-text); }
input[type=checkbox] { accent-color:var(--brand); }

/* ---------- 11. Feedback ---------- */
.alert { padding:11px 14px; border-radius:var(--radius-panel); font-size:13px; font-weight:500; border:1px solid; }
.alert-error { background:var(--alert-err-bg); color:var(--alert-err-ink); border-color:var(--alert-err-edge); }
.alert-success { background:var(--alert-ok-bg); color:var(--alert-ok-ink); border-color:var(--alert-ok-edge); }
.alert-warn { background:var(--warn-soft); color:var(--warn); border-color:var(--alert-warn-edge); }
.toast { display:inline-flex; align-items:center; gap:10px; padding:12px 16px; border-radius:var(--radius-panel); font-size:13px; font-weight:600;
         max-width:340px; border:1px solid; box-shadow:var(--elev-2),var(--highlight); }
.toast-success { background:var(--alert-ok-bg); color:var(--alert-ok-ink); border-color:var(--alert-ok-edge); }
.toast-error { background:var(--alert-err-bg); color:var(--alert-err-ink); border-color:var(--alert-err-edge); }
.toast-ico { width:22px; height:22px; flex-shrink:0; border-radius:50%; display:grid; place-items:center; color:var(--on-solid); font-size:12px; font-weight:700; }
.toast-success .toast-ico { background:var(--toast-ok-ico); } .toast-error .toast-ico { background:var(--toast-err-ico); }
.empty { text-align:center; padding:20px 20px; border:1px solid var(--card-edge); border-radius:var(--radius-panel); background:var(--bg-2); color:var(--text-muted); }
.empty-title { font-size:15px; font-weight:800; letter-spacing:-.2px; color:var(--text); margin:6px 0 2px; } /* fill-space: compact */
.attn-item { display:grid; grid-template-columns:32px 1fr auto; gap:12px; align-items:center; padding:11px 18px 11px 14px;
             border-left:3px solid var(--warn); background:var(--bg-card); border-bottom:1px solid var(--border-light); }
.attn-item.crit { border-left-color:var(--crit); }
.attn-ico { width:32px; height:32px; border-radius:var(--radius-sm); display:grid; place-items:center; background:var(--attn-warn-bg); color:var(--warn); }
.attn-item.crit .attn-ico { background:var(--alert-err-bg); color:var(--crit); }

/* ---------- 12. Overlays ---------- */
/* P: a dimmed backdrop with no blur; the modal is a window (the platform's: radius 12, --sh-xl, a 16px / 800 title, the
   actions right-aligned in the foot). The exit (.overlay.is-leaving, through Hub.motion.leave) is in hub.css beside the window's. */
.overlay { position:fixed; inset:0; background:var(--scrim-modal); display:flex; align-items:center;
           justify-content:center; padding:max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); z-index:200; animation:fadeIn var(--dur-route) var(--ease-smooth); }
.modal { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-window); /* --radius-window is defined in hub.css :root */ box-shadow:var(--sh-window);
         width:min(500px,100%); max-height:90vh; max-height:90dvh;
         display:flex; flex-direction:column; animation:windowIn var(--dur-window) var(--ease-window) backwards; }
.modal.drill { width:min(960px,100%); max-height:min(85vh,720px); max-height:min(85dvh,720px); }
.modal.wide { width:min(1180px,100%); }
.modal-head { display:flex; align-items:flex-start; gap:12px; padding:16px 18px 12px; border-bottom:1px solid var(--border-light); }
.modal-title { font-size:16px; font-weight:800; letter-spacing:-.2px; display:flex; gap:8px; align-items:center; }
.modal-sub { font-size:12px; color:var(--text-muted); margin-top:2px; }
.modal-body { padding:16px 18px; overflow:auto; overscroll-behavior:contain; }
.modal-foot { display:flex; justify-content:flex-end; gap:10px; padding:12px 18px; border-top:1px solid var(--border-light); }
.method { background:var(--bg-card); border:1px solid var(--border); border-left:3px solid var(--brand); border-radius:var(--radius-card); padding:16px 18px;
          display:grid; grid-template-columns:1fr 1fr; gap:16px 24px; position:relative; }
.method h4 { margin:0 0 4px; font-size:12.5px; font-weight:700; color:var(--brand-text); }
.method p { margin:0; font-size:12.5px; line-height:1.5; color:var(--text-2); }
.method strong { color:var(--brand-text); }

/* ---------- 13. Loading ---------- */
.api-loader { position:fixed; top:0; left:0; right:0; height:2px; z-index:100000; opacity:0; }
body.is-fetching .api-loader { opacity:1; background:linear-gradient(90deg,transparent,var(--brand),var(--accent),transparent);
       background-size:280px 100%; background-repeat:no-repeat; animation:apiLoaderSlide 1.4s linear infinite; }
.spinner { width:36px; height:36px; border:3px solid var(--border); border-top-color:var(--brand); border-radius:50%; animation:spin .7s linear infinite; }
.skel { border-radius:var(--radius-xs); background:linear-gradient(90deg,var(--border-light) 25%,var(--bg) 50%,var(--border-light) 75%);
        background-size:800px 100%; animation:shimmer 1.6s ease-in-out infinite; }

/* ---------- 14. Motion ---------- */
/* P keyframes move only opacity and transform. riseIn: the content enter (.p-enter children); popIn: popovers;
   scaleIn: a plain pop at the windows' scale. windowIn / windowOut / sheetUp / sheetDown / fadeOut are in hub.css. */
@keyframes riseIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes popIn { from { opacity:0; transform:translateY(4px) scale(.98); } to { opacity:1; transform:none; } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes scaleIn { from { opacity:0; transform:scale(.96); } to { opacity:1; transform:none; } }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes shimmer { from { background-position:-400px 0; } to { background-position:400px 0; } }
@keyframes apiLoaderSlide { from { background-position:-280px 0; } to { background-position:calc(100% + 280px) 0; } }
@keyframes handWaveOnce { 0%,100% { transform:rotate(0); } 20% { transform:rotate(14deg); } 40% { transform:rotate(-8deg); } 60% { transform:rotate(14deg); } 80% { transform:rotate(-4deg); } }
@media (prefers-reduced-motion:reduce) {
    *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:var(--dur-1) !important; }
}

/* ---------- 15. Responsive ---------- */

@media (max-width:1100px) { .kpi-row { grid-template-columns:repeat(2,1fr); } }

@media (max-width:900px) { .grid-2 { grid-template-columns:1fr; } .method { grid-template-columns:1fr; } }

@media (max-width:768px) {
    :root { --sidebar-w:0px; }
    .sidebar { width:min(85vw,300px); transform:translateX(-100%); transition:transform var(--dur-2) cubic-bezier(.32,.72,.4,1); }
    .sidebar.open { transform:none; box-shadow:var(--sb-open-shadow); }
    .page { padding:70px 14px 32px; }
    .f-input, input, select, textarea { font-size:16px; }  /* stops iOS zoom */
    .nav-item { min-height:44px; }
}

@media (max-width:600px) {
    .kpi-row { grid-template-columns:1fr; }
    .overlay { align-items:flex-end; padding:0; }
    .modal { width:100%; border-radius:var(--radius-window) var(--radius-window) 0 0; border-width:1px 0 0; }
}
