/* ============================================================================
   CVN Console theme — shared skin for the back-of-house UIs
   Admin console · Staff console · Client portal · CP staff console.

   Purely presentational: no new markup, no behaviour. It re-tunes the dark
   palette to a near-black navy, gives each surface its own accent hue
   (configuration = teal, employee = blue, client = violet), and restyles the
   shared console chrome — sidebar nav, KPI tiles, cards, pills, search and
   segmented switchers — to match the platform design.
   Load AFTER the page's own stylesheets.
   ========================================================================== */

/* ---- per-surface accent -------------------------------------------------- */
body[data-page="admin"]{--brand-h:192;--accent-h:70}
body[data-page="cpadmin"]{--brand-h:210}
body[data-page="portal"]{--brand-h:258}
body[data-page="clientportal"]{--brand-h:296}

/* ---- near-black navy base (dark theme only) ------------------------------ */
[data-theme="dark"] body[data-page="admin"],
[data-theme="dark"] body[data-page="cpadmin"],
[data-theme="dark"] body[data-page="portal"],
[data-theme="dark"] body[data-page="clientportal"]{
  --bg:oklch(0.148 0.013 255);
  --bg-2:oklch(0.126 0.013 255);
  --surface:oklch(0.176 0.015 256);
  --surface-2:oklch(0.208 0.016 256);
  --surface-3:oklch(0.248 0.018 256);
  --line:oklch(0.272 0.016 256);
  --line-2:oklch(0.34 0.018 256);
  --ink:oklch(0.972 0.005 250);
  --ink-2:oklch(0.80 0.012 250);
  --ink-3:oklch(0.635 0.016 252);
  --brand:oklch(0.78 0.12 var(--brand-h));
  --brand-strong:oklch(0.72 0.13 var(--brand-h));
  --brand-ink:oklch(0.84 0.10 var(--brand-h));
  --brand-soft:oklch(0.30 0.055 var(--brand-h));
  --glass:oklch(0.17 0.015 256 / .78);
  --shadow-sm:0 1px 2px rgba(0,0,0,.5);
  --shadow-md:0 6px 18px rgba(0,0,0,.5);
  --shadow-lg:0 18px 44px rgba(0,0,0,.55);
  --on-brand:oklch(0.14 0.02 255);
  background:
    radial-gradient(120% 80% at 100% 0%, oklch(0.34 0.06 var(--brand-h) / .22), transparent 62%),
    radial-gradient(90% 70% at 0% 100%, oklch(0.30 0.05 var(--brand-h) / .14), transparent 60%),
    var(--bg);
  background-attachment:fixed;
}

/* ---- sidebar ------------------------------------------------------------- */
[data-theme="dark"] body[data-page="admin"] .asidebar,
[data-theme="dark"] body[data-page="portal"] .p-side,
[data-theme="dark"] body[data-page="clientportal"] .p-side,
[data-theme="dark"] body[data-page="cpadmin"] .ap-side{
  background:oklch(0.132 0.013 256);
  border-right:1px solid var(--line);
  backdrop-filter:none;
}
/* nav items read as small mono labels, active one sits in a tinted pill */
body[data-page="admin"] .atab,
body[data-page="portal"] .p-navtab,
body[data-page="clientportal"] .p-navtab,
body[data-page="cpadmin"] .ap-conitem{
  font-family:var(--font-mono);
  font-size:.72rem;
  font-weight:600;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--ink-3);
  border-radius:12px;
}
body[data-page="admin"] .atab:hover,
body[data-page="portal"] .p-navtab:hover,
body[data-page="clientportal"] .p-navtab:hover,
body[data-page="cpadmin"] .ap-conitem:hover{color:var(--ink);background:oklch(1 0 0 / .04)}
body[data-page="admin"] .atab.on,
body[data-page="admin"] .atab[aria-current],
body[data-page="portal"] .p-navtab.on,
body[data-page="clientportal"] .p-navtab.on,
body[data-page="cpadmin"] .ap-conitem.on{
  background:oklch(0.30 0.055 var(--brand-h) / .5);
  color:var(--brand-ink);
  box-shadow:inset 0 0 0 1px oklch(0.60 0.10 var(--brand-h) / .35);
}
body[data-page="admin"] .atab.on svg,
body[data-page="portal"] .p-navtab.on svg,
body[data-page="clientportal"] .p-navtab.on svg,
body[data-page="cpadmin"] .ap-conitem.on svg{color:var(--brand)}
/* group headers */
body[data-page="portal"] .p-navgroup__head,
body[data-page="clientportal"] .p-navgroup__head,
body[data-page="admin"] .anavgroup__head,
body[data-page="cpadmin"] .ap-congroup__head{
  font-family:var(--font-mono);font-size:.68rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3);
}

/* brand block: rounded accent tile + accent wordmark */
body[data-page="admin"] .asidebar__brand .mark,
body[data-page="portal"] .p-side__logo .mark,
body[data-page="clientportal"] .p-side__logo .mark,
body[data-page="cpadmin"] .ap-side .mark{
  border-radius:12px;
  background:linear-gradient(150deg,oklch(0.66 0.15 var(--brand-h)),oklch(0.50 0.13 calc(var(--brand-h) + 18)));
  box-shadow:0 6px 18px -6px oklch(0.60 0.15 var(--brand-h) / .6);
}
body[data-page="portal"] .p-side__wm b,
body[data-page="clientportal"] .p-side__wm b{color:var(--brand-ink)}
body[data-page="portal"] .p-side__wm small,
body[data-page="clientportal"] .p-side__wm small{
  font-family:var(--font-mono);font-size:.62rem;letter-spacing:.16em;text-transform:uppercase;color:var(--ink-3);
}

/* ---- cards & KPI tiles --------------------------------------------------- */
[data-theme="dark"] body[data-page="admin"] .dash-kpi,
[data-theme="dark"] body[data-page="admin"] .inv-stat,
[data-theme="dark"] body[data-page="admin"] .acc-kpi,
[data-theme="dark"] body[data-page="portal"] .cp-stat,
[data-theme="dark"] body[data-page="clientportal"] .cp-stat,
[data-theme="dark"] body[data-page="portal"] .cp-card,
[data-theme="dark"] body[data-page="clientportal"] .cp-card,
[data-theme="dark"] body[data-page="cpadmin"] .cp-card{
  position:relative;
  background:linear-gradient(180deg,oklch(0.20 0.016 256),oklch(0.176 0.015 256));
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
}
/* faint accent bloom in the corner, as in the platform tiles */
[data-theme="dark"] body[data-page="admin"] .dash-kpi::after,
[data-theme="dark"] body[data-page="admin"] .inv-stat::after,
[data-theme="dark"] body[data-page="portal"] .cp-stat::after,
[data-theme="dark"] body[data-page="clientportal"] .cp-stat::after{
  content:"";position:absolute;inset:auto -30% 40% 55%;height:120%;
  background:radial-gradient(closest-side,oklch(0.55 0.12 var(--brand-h) / .16),transparent);
  pointer-events:none;
}
/* icon tiles */
body[data-page="admin"] .dash-kpi__ic,
body[data-page="admin"] .inv-stat__ic,
body[data-page="portal"] .cp-card__ic,
body[data-page="clientportal"] .cp-card__ic,
body[data-page="cpadmin"] .cp-card__ic{
  border-radius:10px;
  background:oklch(0.32 0.06 var(--brand-h) / .55);
  color:var(--brand);
  box-shadow:inset 0 0 0 1px oklch(0.60 0.10 var(--brand-h) / .3);
}

/* panel headings + their small mono action links */
[data-theme="dark"] body[data-page="admin"] .apanel-head,
[data-theme="dark"] body[data-page="portal"] .apanel-head,
[data-theme="dark"] body[data-page="clientportal"] .apanel-head{border-color:var(--line)}
body[data-page="admin"] .apanel-head .sub,
body[data-page="portal"] .apanel-head .sub,
body[data-page="clientportal"] .apanel-head .sub{color:var(--ink-3)}
body[data-page="admin"] .acc-rep__head span,
body[data-page="portal"] .cp-sectionlabel,
body[data-page="clientportal"] .cp-sectionlabel{
  font-family:var(--font-mono);font-size:.68rem;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3);
}

/* ---- pills, chips, segmented switchers ---------------------------------- */
body[data-page="admin"] .statuspill,
body[data-page="portal"] .statuspill,
body[data-page="clientportal"] .statuspill,
body[data-page="cpadmin"] .statuspill,
body[data-page="admin"] .rep-pill{
  font-family:var(--font-mono);font-size:.66rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  border-radius:var(--radius-pill);
}
[data-theme="dark"] body[data-page="admin"] .aseg,
[data-theme="dark"] body[data-page="admin"] .fin-sub2,
[data-theme="dark"] body[data-page="portal"] .aseg,
[data-theme="dark"] body[data-page="clientportal"] .aseg{
  background:oklch(0.19 0.015 256);border:1px solid var(--line);border-radius:var(--radius-pill);
}
[data-theme="dark"] body[data-page="admin"] .aseg button.on,
[data-theme="dark"] body[data-page="admin"] .fin-sub2__b.on,
[data-theme="dark"] body[data-page="portal"] .aseg button.on,
[data-theme="dark"] body[data-page="clientportal"] .aseg button.on{
  background:oklch(0.32 0.06 var(--brand-h) / .7);color:var(--brand-ink);
  box-shadow:inset 0 0 0 1px oklch(0.62 0.10 var(--brand-h) / .4);
}
body[data-page="admin"] .hc-chip,
body[data-page="portal"] .hc-chip,
body[data-page="clientportal"] .hc-chip,
body[data-page="admin"] .loy-chip{border-radius:var(--radius-pill)}
[data-theme="dark"] body[data-page="clientportal"] .hc-chip.on,
[data-theme="dark"] body[data-page="portal"] .hc-chip.on{
  background:oklch(0.34 0.07 var(--brand-h) / .75);border-color:oklch(0.60 0.10 var(--brand-h) / .5);color:var(--brand-ink);
}

/* ---- inputs & search ---------------------------------------------------- */
[data-theme="dark"] body[data-page="admin"] input,
[data-theme="dark"] body[data-page="admin"] select,
[data-theme="dark"] body[data-page="admin"] textarea,
[data-theme="dark"] body[data-page="portal"] input,
[data-theme="dark"] body[data-page="portal"] select,
[data-theme="dark"] body[data-page="portal"] textarea,
[data-theme="dark"] body[data-page="clientportal"] input,
[data-theme="dark"] body[data-page="clientportal"] select,
[data-theme="dark"] body[data-page="clientportal"] textarea{
  background:oklch(0.165 0.015 256);
  border-color:var(--line);
}
[data-theme="dark"] body[data-page="admin"] input:focus,
[data-theme="dark"] body[data-page="portal"] input:focus,
[data-theme="dark"] body[data-page="clientportal"] input:focus{border-color:var(--brand-strong)}
body[data-page="admin"] .asearch,
body[data-page="portal"] .p-search,
body[data-page="clientportal"] .hc-search{border-radius:var(--radius-pill)}

/* ---- buttons ------------------------------------------------------------ */
[data-theme="dark"] body[data-page="admin"] .btn--primary,
[data-theme="dark"] body[data-page="portal"] .btn--primary,
[data-theme="dark"] body[data-page="clientportal"] .btn--primary,
[data-theme="dark"] body[data-page="cpadmin"] .btn--primary{
  background:linear-gradient(180deg,oklch(0.74 0.13 var(--brand-h)),oklch(0.66 0.13 var(--brand-h)));
  color:oklch(0.15 0.02 255);
  border:0;
  box-shadow:0 8px 22px -10px oklch(0.66 0.13 var(--brand-h) / .8);
}
[data-theme="dark"] body[data-page="admin"] .btn--ghost,
[data-theme="dark"] body[data-page="portal"] .btn--ghost,
[data-theme="dark"] body[data-page="clientportal"] .btn--ghost{
  background:oklch(0.21 0.016 256);border:1px solid var(--line);color:var(--ink-2);
}
[data-theme="dark"] body[data-page="admin"] .btn--ghost:hover,
[data-theme="dark"] body[data-page="portal"] .btn--ghost:hover,
[data-theme="dark"] body[data-page="clientportal"] .btn--ghost:hover{border-color:var(--brand-strong);color:var(--ink)}

/* ---- tables & lists ----------------------------------------------------- */
[data-theme="dark"] body[data-page="admin"] th,
[data-theme="dark"] body[data-page="portal"] th,
[data-theme="dark"] body[data-page="clientportal"] th{
  font-family:var(--font-mono);font-size:.68rem;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-3);
}
[data-theme="dark"] body[data-page="admin"] .apanel,
[data-theme="dark"] body[data-page="admin"] .acc-rep,
[data-theme="dark"] body[data-page="admin"] .editor__panel,
[data-theme="dark"] body[data-page="portal"] .p-card,
[data-theme="dark"] body[data-page="clientportal"] .p-card{
  background:oklch(0.172 0.015 256);border-color:var(--line);
}
