/* ==========================================================================
   BOOSTIO BUSINESS OS — ADMIN STYLESHEET · /admin/css/admin.css · v0.1 (C0)
   --------------------------------------------------------------------------
   Standalone design system for the INTERNAL admin portal ("Business OS").
   Deploys on its own (e.g. ops.boostio.in) — deliberately does NOT depend on
   the marketing CSS or the customer portal CSS. Tokens mirror
   /portal/css/portal.css and /css/boostio.css; keep the three in sync when
   tokens change. English-only (internal tool) — no Mukta, no i18n hooks.
   Light theme only for v0.1; everything already reads semantic vars
   (--bg/--surface/--text…) so a dark block can be added later like portal.css.

   CONTENTS
   00. Fonts (Jakarta headings + Inter body)
   01. Tokens
   02. Base & a11y
   03. App shell — topbar (logo · search · admin menu), sidebar, mobile drawer
   04. Buttons
   05. Cards & KPI cards
   06. Badges, status dots, chips
   07. Data table system (toolbar · sortable · paginated)
   08. Forms (fields, select, switch, search)
   09. Overlays — modal, confirm, drawer/detail panel
   10. Toasts
   11. Audit log entries
   12. Chart cards (SVG charts rendered by js/admin.js)
   13. Menus (admin dropdown)
   14. Empty states & access-denied
   15. Auth (login) screen
   16. Utilities

   RULES CARRIED OVER (CLAUDE.md §2 — non-negotiable):
   · Gradient (--gradient-brand) on at most ONE primary element per screen.
     Each page's head comment states which element owns it.
   · No fake counters, no urgency timers, no stock photos (initials avatars).
   · Numbers tabular (brand rule — kept even on large KPI values for
     consistency with the customer portal's stat tiles).
   · Brand muted #9AA0B4 (--decor) is decorative only — readable muted text
     uses --text-3 #667090 (AA on white and #FAFAFC).
   · CHART PALETTE (validated for CVD + normal-vision separation on white):
     slot order violet #5D16EA → pink #F6197C → deep orange #B33008
     (--orange-700; the 500-step orange sits too close to pink). Fixed
     order, never cycled; status colors are reserved for status.
   ========================================================================== */

/* ==========================================================================
   00. FONTS
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap");

/* ==========================================================================
   01. TOKENS
   ========================================================================== */
:root {
  /* Brand ramps (subset; full ramps live in the marketing CSS) */
  --violet-50:#F5F0FE; --violet-100:#EADFFD; --violet-200:#D3BEFA;
  --violet-400:#8E55F0; --violet-500:#5D16EA; --violet-600:#4B11C2; --violet-700:#3B0D99;
  --pink-100:#FDDEEC; --pink-500:#F6197C; --pink-600:#D40E67; --pink-700:#A80A52;
  --orange-100:#FFE4D9; --orange-500:#FE5621; --orange-700:#B33008;
  --navy-50:#F2F4F9; --navy-100:#E4E6EE; --navy-200:#C6CBDD; --navy-300:#9AA0B4;
  --navy-400:#667090; --navy-500:#3E4A6B; --navy-600:#232F52; --navy-700:#0A1740;
  --navy-800:#051238; --navy-900:#000C36;
  --success-50:#E7F8F0; --success-500:#12B76A; --success-700:#067647;
  --warning-50:#FEF4E6; --warning-500:#F5A524; --warning-700:#B54708;
  --error-50:#FEECEE;  --error-500:#F0384B;  --error-700:#B42318;

  /* Gradient — hero/CTA ONLY; at most ONE element per screen */
  --gradient-brand: linear-gradient(135deg,#482AF6 0%,#F6197C 62%,#FC3C54 100%);

  /* Semantic surfaces & text (THEMEABLE — components must use these) */
  --bg:        #FAFAFC;
  --surface:   #FFFFFF;
  --surface-2: #F2F4F9;
  --border:    #E4E6EE;
  --text:      #0A1740;
  --text-2:    #3E4A6B;
  --text-3:    #667090;          /* AA-safe muted */
  --decor:     #9AA0B4;          /* decorative only — never body text */
  --link:      #4B11C2;
  --focus:     #5D16EA;
  --shadow-soft: 0 4px 16px rgba(10,23,64,.08);
  --shadow-lift: 0 10px 28px rgba(10,23,64,.14);
  --scrim: rgba(10,23,64,.45);

  /* Tinted chips */
  --tint-violet-bg:#F5F0FE; --tint-violet-tx:#3B0D99; --tint-violet-bd:#EADFFD;
  --tint-success-bg:#E7F8F0; --tint-success-tx:#067647;
  --tint-warning-bg:#FEF4E6; --tint-warning-tx:#B54708;
  --tint-error-bg:#FEECEE;  --tint-error-tx:#B42318;
  --tint-neutral-bg:#F2F4F9; --tint-neutral-tx:#3E4A6B;

  /* Chart palette (validated — see header note) */
  --chart-1:#5D16EA; --chart-1-soft:#8E55F0;
  --chart-2:#F6197C;
  --chart-3:#B33008;
  --chart-grid:#E4E6EE;
  --chart-spark:#C6CBDD;         /* de-emphasis sparkline body */

  /* Type */
  --font-heading:"Plus Jakarta Sans","Inter",ui-sans-serif,system-ui,sans-serif;
  --font-body:"Inter",ui-sans-serif,system-ui,sans-serif;
  --text-xs:.75rem; --text-sm:.875rem; --text-md:1rem; --text-lg:1.125rem;

  /* Spacing / radius / motion */
  --sp-2xs:.25rem; --sp-xs:.5rem; --sp-sm:.75rem; --sp-md:1rem;
  --sp-lg:1.5rem; --sp-xl:2rem; --sp-2xl:3rem;
  --r-sm:8px; --r-md:12px; --r-lg:16px; --r-pill:999px;
  --ease:cubic-bezier(.4,0,.2,1);
  --tr-fast:150ms var(--ease); --tr:220ms var(--ease);

  /* Shell metrics */
  --topbar-h:60px; --sidebar-w:256px; --content-max:1280px;
  --z-topbar:100; --z-drawer:150; --z-overlay:200; --z-toast:300;
}

/* ==========================================================================
   02. BASE & A11Y
   ========================================================================== */
*,*::before,*::after{box-sizing:border-box}
*{margin:0}
html{-webkit-text-size-adjust:100%}
body{
  font-family:var(--font-body); font-size:var(--text-md); line-height:1.55;
  color:var(--text); background:var(--bg);
  -webkit-font-smoothing:antialiased;
}
img,svg{display:block;max-width:100%;height:auto}
[hidden]{display:none!important}
input,button,select,textarea{font:inherit;color:inherit}
ul[class],ol[class]{list-style:none;padding:0}
h1,h2,h3,h4,.h-lg,.h-md,.h-sm{
  font-family:var(--font-heading); font-weight:700; line-height:1.2;
  letter-spacing:-.01em; color:var(--text);
}
.h-lg{font-size:1.5rem;font-weight:800}
.h-md{font-size:1.125rem}
.h-sm{font-size:1rem}
a{color:var(--link)}
.tabular{font-variant-numeric:tabular-nums}
code{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:.8125em; background:var(--surface-2);
  border:1px solid var(--border); border-radius:6px; padding:.1em .4em;
  color:var(--text-2);
}
.skip-link{
  position:fixed; top:10px; left:10px; z-index:var(--z-toast);
  padding:.65rem 1rem; background:var(--navy-700); color:#fff;
  font-size:var(--text-sm); font-weight:600; text-decoration:none;
  border-radius:var(--r-sm);
  transform:translateY(calc(-100% - 20px));
}
.skip-link:focus{transform:none}
:focus-visible{outline:3px solid var(--focus); outline-offset:2px; border-radius:var(--r-sm)}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}
}

/* ==========================================================================
   03. APP SHELL
   --------------------------------------------------------------------------
   Mobile-first: topbar + content; hamburger opens the sidebar as an
   off-canvas drawer. ≥1024px: sidebar is fixed-open, hamburger hides.
   ========================================================================== */
.app{min-height:100vh; display:flex; flex-direction:column}

/* ---- Topbar: logo · global search · admin menu --------------------------- */
.topbar{
  position:sticky; top:0; z-index:var(--z-topbar);
  display:flex; align-items:center; gap:var(--sp-sm);
  height:var(--topbar-h); padding-inline:var(--sp-md);
  background:var(--surface); border-bottom:1px solid var(--border);
}
.topbar__brand{display:inline-flex; align-items:center; gap:10px; text-decoration:none; flex:none}
.topbar__brand img{width:30px;height:30px}
.topbar__name{font-family:var(--font-heading); font-weight:800; font-size:1.125rem; color:var(--text)}
.topbar__tag{
  padding:2px 8px; border-radius:var(--r-pill);
  background:var(--navy-700); color:#fff;
  font-size:var(--text-xs); font-weight:700; letter-spacing:.04em; white-space:nowrap;
}
@media (max-width:767.98px){ .topbar__name,.topbar__tag{display:none} }

/* Global search (routes to the Customers module) */
.g-search{flex:1; max-width:440px; margin-inline:auto; min-width:0}
.g-search .search{width:100%}
.topbar__spacer{flex:1}

.icon-btn{
  display:inline-flex; align-items:center; justify-content:center; flex:none;
  width:40px; height:40px; border:1px solid var(--border); border-radius:var(--r-md);
  background:var(--surface); color:var(--text-2); cursor:pointer;
  transition:border-color var(--tr-fast), color var(--tr-fast);
}
.icon-btn:hover{color:var(--violet-500); border-color:var(--violet-200)}
.nav-open-btn{display:inline-flex}
@media (min-width:1024px){ .nav-open-btn{display:none} }

.user-btn{
  display:inline-flex; align-items:center; gap:8px; flex:none;
  padding:4px 10px 4px 4px; border:1px solid var(--border); border-radius:var(--r-pill);
  background:var(--surface); cursor:pointer;
}
.user-btn:hover{border-color:var(--violet-200)}
.avatar{
  display:inline-flex; align-items:center; justify-content:center; flex:none;
  width:32px; height:32px; border-radius:var(--r-pill);
  background:var(--violet-100); color:var(--violet-700);
  font-family:var(--font-heading); font-weight:700; font-size:.8125rem;
}
.avatar--sm{width:26px;height:26px;font-size:.6875rem}
.user-btn__name{font-size:var(--text-sm); font-weight:600; color:var(--text)}
@media (max-width:639.98px){ .user-btn__name{display:none} }

/* ---- Body: sidebar + content --------------------------------------------- */
.app__body{display:flex; flex:1}

.sidebar{
  width:var(--sidebar-w); flex:none;
  padding:var(--sp-md) var(--sp-sm);
  border-right:1px solid var(--border);
  background:var(--surface);
  display:flex; flex-direction:column;
}
/* Off-canvas drawer below 1024px */
@media (max-width:1023.98px){
  .sidebar{
    position:fixed; top:0; bottom:0; left:0; z-index:var(--z-drawer);
    transform:translateX(-104%); transition:transform var(--tr);
    box-shadow:var(--shadow-lift); overflow-y:auto;
  }
  .sidebar.is-open{transform:none}
}
@media (min-width:1024px){
  .sidebar{
    position:sticky; top:var(--topbar-h);
    height:calc(100vh - var(--topbar-h)); overflow-y:auto;
  }
}
.sidebar-scrim{
  position:fixed; inset:0; z-index:calc(var(--z-drawer) - 1);
  background:var(--scrim); border:0; padding:0; display:none; cursor:pointer;
}
body.nav-open{overflow:hidden}
body.nav-open .sidebar-scrim{display:block}
@media (min-width:1024px){ body.nav-open{overflow:auto} body.nav-open .sidebar-scrim{display:none} }

.sidebar__close{align-self:flex-end; margin-bottom:var(--sp-xs)}
@media (min-width:1024px){ .sidebar__close{display:none} }

.sidebar__list{display:grid; gap:2px}
.nav-item{
  display:flex; align-items:center; gap:10px;
  padding:.6rem .75rem; border-radius:var(--r-md);
  font-size:var(--text-sm); font-weight:600; color:var(--text-2);
  text-decoration:none;
  transition:background-color var(--tr-fast), color var(--tr-fast);
}
.nav-item svg{flex:none; opacity:.85}
.nav-item:hover{background:var(--surface-2); color:var(--violet-500)}
.nav-item[aria-current="page"]{background:var(--tint-violet-bg); color:var(--tint-violet-tx)}
.nav-item .nav-item__count{
  margin-left:auto; padding:1px 8px; border-radius:var(--r-pill);
  background:var(--surface-2); color:var(--text-3);
  font-size:var(--text-xs); font-weight:700; font-variant-numeric:tabular-nums;
}
.nav-item[aria-current="page"] .nav-item__count{background:#fff}

.sidebar__foot{
  margin-top:auto; padding:var(--sp-md) var(--sp-sm) var(--sp-xs);
  border-top:1px solid var(--border);
  font-size:var(--text-xs); color:var(--text-3); display:grid; gap:6px;
}
.sidebar__foot a{color:var(--link); font-weight:600; text-decoration:none}
.sidebar__foot a:hover{text-decoration:underline}

.content{
  flex:1; min-width:0;
  padding:var(--sp-lg) var(--sp-md) var(--sp-2xl);
}
@media (min-width:640px){ .content{padding-inline:var(--sp-lg)} }
@media (min-width:1024px){
  .content{padding:var(--sp-xl) var(--sp-2xl) var(--sp-2xl)}
  .content > *{max-width:var(--content-max)}
}
.page-head{
  display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between;
  gap:var(--sp-sm); margin-bottom:var(--sp-lg);
}
.page-head h1{font-size:1.375rem; font-weight:800}
.page-head__sub{margin-top:2px; font-size:var(--text-sm); color:var(--text-3)}
.page-foot{
  margin-top:var(--sp-2xl); padding-top:var(--sp-md);
  border-top:1px solid var(--border);
  font-size:var(--text-xs); color:var(--text-3);
}

/* ==========================================================================
   04. BUTTONS
   ========================================================================== */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:44px; padding:.6rem 1.25rem;
  border:2px solid transparent; border-radius:var(--r-md);
  font-family:var(--font-heading); font-weight:700; font-size:.9375rem; line-height:1;
  text-decoration:none; white-space:nowrap; cursor:pointer;
  transition:transform var(--tr-fast), box-shadow var(--tr-fast),
             background-color var(--tr-fast), border-color var(--tr-fast), color var(--tr-fast);
}
.btn:active{transform:translateY(1px)}
.btn[disabled]{opacity:.55; cursor:not-allowed}
.btn--primary{background-image:var(--gradient-brand); color:#fff; box-shadow:var(--shadow-soft)}
.btn--primary:hover:not([disabled]){transform:translateY(-1px); box-shadow:var(--shadow-lift)}
.btn--solid{background:var(--violet-500); color:#fff}
.btn--solid:hover:not([disabled]){background:var(--violet-600)}
.btn--outline{background:var(--surface); border-color:var(--violet-500); color:var(--link)}
.btn--outline:hover:not([disabled]){background:var(--tint-violet-bg)}
.btn--ghost{background:transparent; color:var(--text-2)}
.btn--ghost:hover:not([disabled]){color:var(--violet-500); background:var(--surface-2)}
.btn--danger{background:var(--error-500); color:#fff}
.btn--danger:hover:not([disabled]){background:#D22736}
.btn--sm{min-height:36px; padding:.35rem .9rem; font-size:.8125rem}
.btn--block{display:flex; width:100%}

/* ==========================================================================
   05. CARDS & KPI CARDS
   ========================================================================== */
.card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-lg); box-shadow:var(--shadow-soft);
  padding:var(--sp-lg);
}
.card__head{display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:var(--sp-sm); margin-bottom:var(--sp-md)}
.card__title{font-size:1rem}
.card__sub{flex-basis:100%; margin-top:-6px; font-size:var(--text-xs); color:var(--text-3)}
.card--well{background:var(--surface-2); box-shadow:none}

/* KPI card — label · value · delta · optional sparkline · note */
.kpi-row{display:grid; gap:var(--sp-md); grid-template-columns:repeat(2,1fr)}
@media (min-width:1024px){ .kpi-row{grid-template-columns:repeat(4,1fr)} }
.kpi{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-lg); box-shadow:var(--shadow-soft);
  padding:var(--sp-md) var(--sp-lg);
  display:flex; flex-direction:column; gap:2px;
}
.kpi__top{display:flex; align-items:center; justify-content:space-between; gap:var(--sp-xs)}
.kpi__label{font-size:var(--text-xs); font-weight:600; color:var(--text-3);
  text-transform:uppercase; letter-spacing:.06em}
.kpi__value{
  margin-top:2px; font-family:var(--font-heading); font-weight:800;
  font-size:clamp(1.375rem,1.2rem + .8vw,1.75rem); line-height:1.1;
  color:var(--text); font-variant-numeric:tabular-nums; /* brand rule */
}
.kpi__delta{display:inline-flex; align-items:center; gap:4px; margin-top:6px;
  font-size:var(--text-xs); font-weight:600; font-variant-numeric:tabular-nums; color:var(--text-3)}
.kpi__delta--good{color:var(--tint-success-tx)}
.kpi__delta--bad{color:var(--tint-error-tx)}
.kpi__note{margin-top:4px; font-size:var(--text-xs); color:var(--text-3)}
.kpi__spark{margin-top:6px}
.kpi__spark svg{display:block; width:100%; height:36px}

/* ==========================================================================
   06. BADGES, STATUS DOTS & CHIPS
   ========================================================================== */
.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:.25rem .7rem; border-radius:var(--r-pill);
  font-size:var(--text-xs); font-weight:700; white-space:nowrap;
}
.badge i{width:7px; height:7px; border-radius:50%; background:currentColor; flex:none}
.badge--violet{background:var(--tint-violet-bg); color:var(--tint-violet-tx)}
.badge--success{background:var(--tint-success-bg); color:var(--tint-success-tx)}
.badge--warning{background:var(--tint-warning-bg); color:var(--tint-warning-tx)}
.badge--error{background:var(--tint-error-bg); color:var(--tint-error-tx)}
.badge--neutral{background:var(--tint-neutral-bg); color:var(--tint-neutral-tx)}

.plan-badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:.25rem .75rem; border-radius:var(--r-pill);
  background:var(--tint-violet-bg); border:1px solid var(--tint-violet-bd);
  color:var(--tint-violet-tx); font-weight:700; font-size:var(--text-xs);
}
.role-chip{
  display:inline-flex; align-items:center; gap:6px;
  padding:.2rem .65rem; border-radius:var(--r-pill);
  background:var(--navy-700); color:#fff;
  font-size:var(--text-xs); font-weight:700; letter-spacing:.03em;
}
.role-chip--staff{background:var(--navy-500)}

/* "Sample data" honesty chip — show wherever demo numbers render */
.chip-sample{
  display:inline-flex; align-items:center; gap:6px;
  padding:.25rem .7rem; border-radius:var(--r-pill);
  background:var(--surface-2); border:1px solid var(--border);
  font-size:var(--text-xs); color:var(--text-3); white-space:nowrap;
}
.chip-sample i{width:7px;height:7px;border-radius:50%;background:var(--warning-500)}

/* ==========================================================================
   07. DATA TABLE SYSTEM — .dt (built by AdminOS.DataTable)
   ========================================================================== */
.dt{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-lg); box-shadow:var(--shadow-soft);
  display:flex; flex-direction:column; overflow:hidden;
}
.dt__bar{
  display:flex; flex-wrap:wrap; align-items:center; gap:var(--sp-sm);
  padding:var(--sp-sm) var(--sp-md);
  border-bottom:1px solid var(--border);
}
.dt__bar .search{flex:1 1 220px; max-width:340px}
.dt__bar select{flex:none}
.dt__spacer{flex:1}
.dt__count{font-size:var(--text-xs); color:var(--text-3); font-variant-numeric:tabular-nums}

.dt__scroll{
  overflow-x:auto; -webkit-overflow-scrolling:touch;
  position:relative;   /* contain absolutely-positioned .visually-hidden helpers
                          (a th's hidden label would otherwise escape the clip
                          at its static position and widen the page on mobile) */
}
.table{width:100%; min-width:560px; border-collapse:collapse; font-size:var(--text-sm)}
.table th,.table td{padding:.65rem var(--sp-md); text-align:left; vertical-align:middle}
.table thead th{
  font-size:var(--text-xs); font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--text-3); border-bottom:2px solid var(--border); white-space:nowrap;
}
.table tbody tr + tr td{border-top:1px solid var(--border)}
.table td{color:var(--text-2)}
.table .td-num,.table .th-num{text-align:right}
.table .td-num{font-variant-numeric:tabular-nums; color:var(--text); font-weight:600}
.table tbody tr[data-href]{cursor:pointer}
.table tbody tr:hover td{background:var(--surface-2)}
.table .td-main{font-weight:600; color:var(--text)}
.table .td-sub{display:block; font-size:var(--text-xs); color:var(--text-3); font-weight:400}

/* Sortable headers */
.th-btn{
  display:inline-flex; align-items:center; gap:4px;
  border:0; background:transparent; padding:0; cursor:pointer;
  font:inherit; color:inherit; letter-spacing:inherit; text-transform:inherit;
}
.th-btn:hover{color:var(--violet-500)}
.th-btn svg{flex:none; opacity:.55}
th[aria-sort="ascending"] .th-btn,th[aria-sort="descending"] .th-btn{color:var(--violet-600)}
th[aria-sort="ascending"] .th-btn svg,th[aria-sort="descending"] .th-btn svg{opacity:1}

/* Footer: count + pagination */
.dt__foot{
  display:flex; flex-wrap:wrap; align-items:center; gap:var(--sp-sm);
  padding:var(--sp-sm) var(--sp-md);
  border-top:1px solid var(--border);
  font-size:var(--text-sm); color:var(--text-3);
}
.pager{display:inline-flex; align-items:center; gap:var(--sp-xs); margin-left:auto}
.pager__info{font-size:var(--text-xs); color:var(--text-3); font-variant-numeric:tabular-nums}
.pager button{
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; border:1px solid var(--border); border-radius:var(--r-sm);
  background:var(--surface); color:var(--text-2); cursor:pointer;
}
.pager button:hover:not([disabled]){border-color:var(--violet-200); color:var(--violet-500)}
.pager button[disabled]{opacity:.4; cursor:not-allowed}
.dt__size{display:inline-flex; align-items:center; gap:6px; font-size:var(--text-xs)}
.dt__size select{min-height:34px; padding:.2rem .5rem; border:1px solid var(--border);
  border-radius:var(--r-sm); background:var(--surface); font-size:var(--text-xs)}

.dt__empty{padding:var(--sp-2xl) var(--sp-lg); text-align:center; color:var(--text-3); font-size:var(--text-sm)}

/* ==========================================================================
   08. FORMS
   ========================================================================== */
.field{margin-bottom:var(--sp-md)}
.field label{display:block; margin-bottom:4px; font-size:var(--text-sm); font-weight:600; color:var(--text)}
.field input,.field select,.field textarea{
  width:100%; min-height:46px; padding:.6rem .85rem;
  border:1px solid var(--border); border-radius:var(--r-md);
  background:var(--surface); color:var(--text); font-size:1rem;
  transition:border-color var(--tr-fast);
}
.field textarea{min-height:96px; resize:vertical}
.field input:hover,.field select:hover,.field textarea:hover{border-color:var(--navy-200)}
.field input[aria-invalid="true"]{border-color:var(--error-500)}
.field__hint{margin-top:4px; font-size:var(--text-xs); color:var(--text-3)}
.field__error{display:none; margin-top:4px; font-size:var(--text-xs); color:var(--tint-error-tx)}
.field.has-error .field__error{display:block}

/* Compact select used in table toolbars */
.select-sm{
  min-height:40px; padding:.35rem .6rem;
  border:1px solid var(--border); border-radius:var(--r-md);
  background:var(--surface); color:var(--text-2); font-size:var(--text-sm);
}

/* Search input with icon (+ optional "/" kbd hint) */
.search{position:relative; display:flex; align-items:center}
.search svg{position:absolute; left:12px; color:var(--decor); pointer-events:none}
.search input{
  width:100%; min-height:40px; padding:.45rem 2.4rem .45rem 2.35rem;
  border:1px solid var(--border); border-radius:var(--r-md);
  background:var(--surface); color:var(--text); font-size:var(--text-sm);
  transition:border-color var(--tr-fast);
}
.search input:hover{border-color:var(--navy-200)}
.search input::placeholder{color:var(--text-3)}
.search kbd{
  position:absolute; right:10px; pointer-events:none;
  padding:1px 7px; border:1px solid var(--border); border-radius:6px;
  background:var(--surface-2); color:var(--text-3);
  font-family:var(--font-body); font-size:var(--text-xs);
}

/* Segmented control (login role picker etc.) */
.seg{
  display:flex; gap:2px; padding:3px;
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--r-md);
}
.seg button{
  flex:1; min-height:40px; padding:.3rem .8rem; border:0; border-radius:var(--r-sm);
  background:transparent; cursor:pointer;
  font-weight:700; font-size:var(--text-sm); color:var(--text-2);
  transition:background-color var(--tr-fast), color var(--tr-fast);
}
.seg button[aria-pressed="true"]{background:var(--navy-700); color:#fff}

/* Switch (role/permission toggles) */
.switch{
  position:relative; width:44px; height:26px; flex:none;
  border:0; border-radius:var(--r-pill); cursor:pointer;
  background:var(--navy-200); transition:background-color var(--tr-fast);
}
.switch::after{
  content:""; position:absolute; top:3px; left:3px; width:20px; height:20px;
  border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(10,23,64,.3);
  transition:transform var(--tr-fast);
}
.switch[aria-checked="true"]{background:var(--success-500)}
.switch[aria-checked="true"]::after{transform:translateX(18px)}
.switch[disabled]{opacity:.5; cursor:not-allowed}
.switch-row{display:flex; align-items:center; justify-content:space-between; gap:var(--sp-md)}
.switch-row > span{font-size:var(--text-sm); color:var(--text-2)}

/* ==========================================================================
   09. OVERLAYS — modal, confirm & drawer (detail panel)
   ========================================================================== */
.overlay{
  position:fixed; inset:0; z-index:var(--z-overlay);
  display:none; align-items:center; justify-content:center;
  background:var(--scrim); padding:var(--sp-md);
}
.overlay.is-open{display:flex}

.modal{
  width:100%; max-width:440px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-lg); box-shadow:var(--shadow-lift);
  padding:var(--sp-lg);
  animation:pop 160ms var(--ease);
}
@keyframes pop{from{opacity:0; transform:translateY(8px) scale(.98)} to{opacity:1; transform:none}}
.modal__head{display:flex; align-items:flex-start; justify-content:space-between; gap:var(--sp-sm); margin-bottom:var(--sp-sm)}
.modal__title{font-size:1.0625rem}
.modal__close{
  width:34px; height:34px; flex:none; border:0; border-radius:var(--r-sm);
  display:inline-flex; align-items:center; justify-content:center;
  background:transparent; color:var(--text-3); cursor:pointer; font-size:1.1rem;
}
.modal__close:hover{color:var(--text); background:var(--surface-2)}
.modal__body{font-size:var(--text-sm); color:var(--text-2)}
.modal__foot{display:flex; justify-content:flex-end; gap:var(--sp-sm); margin-top:var(--sp-lg)}

/* Drawer — right-hand detail panel */
.overlay--drawer{align-items:stretch; justify-content:flex-end; padding:0}
.drawer{
  width:min(480px,100%); height:100dvh; display:flex; flex-direction:column;
  background:var(--surface); border-left:1px solid var(--border);
  box-shadow:var(--shadow-lift);
  animation:slide-in 200ms var(--ease);
}
@keyframes slide-in{from{transform:translateX(32px); opacity:.4} to{transform:none; opacity:1}}
.drawer__head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:var(--sp-sm);
  padding:var(--sp-md) var(--sp-lg);
  border-bottom:1px solid var(--border); flex:none;
}
.drawer__title{font-size:1.0625rem}
.drawer__sub{margin-top:2px; font-size:var(--text-xs); color:var(--text-3)}
.drawer__body{flex:1; overflow-y:auto; padding:var(--sp-lg); display:grid; gap:var(--sp-lg); align-content:start}
.drawer__foot{
  flex:none; display:flex; gap:var(--sp-sm); justify-content:flex-end;
  padding:var(--sp-sm) var(--sp-lg); border-top:1px solid var(--border);
}

/* Definition rows inside drawers */
.dl{display:grid; gap:0; font-size:var(--text-sm)}
.dl > div{
  display:flex; justify-content:space-between; gap:var(--sp-md);
  padding:.55rem 0; border-bottom:1px solid var(--border);
}
.dl > div:last-child{border-bottom:0}
.dl dt{color:var(--text-3)}
.dl dd{color:var(--text); font-weight:600; text-align:right; font-variant-numeric:tabular-nums}

/* ==========================================================================
   10. TOASTS (top-right on desktop, top-center on small screens)
   ========================================================================== */
.toast-region{
  position:fixed; z-index:var(--z-toast);
  top:calc(var(--topbar-h) + var(--sp-sm)); right:var(--sp-md);
  display:grid; gap:var(--sp-xs); width:min(92vw,360px);
  pointer-events:none;
}
@media (max-width:639.98px){
  .toast-region{left:50%; right:auto; transform:translateX(-50%)}
}
.toast{
  display:flex; align-items:flex-start; gap:10px;
  background:var(--surface); border:1px solid var(--border); border-left:4px solid var(--violet-500);
  border-radius:var(--r-md); box-shadow:var(--shadow-lift);
  padding:.7rem .9rem; font-size:var(--text-sm); color:var(--text);
  animation:pop 160ms var(--ease); pointer-events:auto;
}
.toast--success{border-left-color:var(--success-500)}
.toast--error{border-left-color:var(--error-500)}
.toast--warning{border-left-color:var(--warning-500)}
.toast__close{
  margin-left:auto; flex:none; border:0; background:transparent; cursor:pointer;
  color:var(--text-3); font-size:1rem; line-height:1; padding:2px;
}
.toast__close:hover{color:var(--text)}

/* ==========================================================================
   11. AUDIT LOG ENTRIES
   ========================================================================== */
.audit{display:grid; gap:0}
.audit li{
  position:relative; display:flex; gap:12px; align-items:flex-start;
  padding:var(--sp-sm) 0 var(--sp-sm) 0;
}
.audit li + li{border-top:1px solid var(--border)}
.audit__icon{
  flex:none; width:32px; height:32px; border-radius:var(--r-pill);
  display:inline-flex; align-items:center; justify-content:center;
  background:var(--tint-violet-bg); color:var(--tint-violet-tx);
}
.audit__icon--payment{background:var(--tint-success-bg); color:var(--tint-success-tx)}
.audit__icon--ticket{background:var(--tint-warning-bg); color:var(--tint-warning-tx)}
.audit__icon--role{background:var(--tint-error-bg); color:var(--tint-error-tx)}
.audit__body{font-size:var(--text-sm); color:var(--text-2); min-width:0}
.audit__body b{color:var(--text); font-weight:600}
.audit__meta{display:block; margin-top:1px; font-size:var(--text-xs); color:var(--text-3);
  font-variant-numeric:tabular-nums}

/* ==========================================================================
   12. CHART CARDS — SVG rendered by AdminOS.chart (no chart libraries)
   ========================================================================== */
.chart-wrap{position:relative}
.chart-wrap svg{display:block; width:100%; height:auto}
.chart-note{margin-top:var(--sp-sm); font-size:var(--text-xs); color:var(--text-3)}
.chart-legend{
  display:flex; flex-wrap:wrap; gap:var(--sp-xs) var(--sp-md);
  margin-top:var(--sp-sm); font-size:var(--text-xs); color:var(--text-2);
}
.chart-legend span{display:inline-flex; align-items:center; gap:6px;
  font-variant-numeric:tabular-nums}
.chart-legend i{width:10px; height:10px; border-radius:3px; flex:none}
.chart-legend i.is-line{height:3px; border-radius:2px; width:14px}

/* Tooltip (shared by all charts; positioned by JS) */
.chart-tip{
  position:absolute; z-index:2; pointer-events:none;
  background:var(--navy-700); color:#fff;
  border-radius:var(--r-sm); padding:.35rem .6rem;
  font-size:var(--text-xs); line-height:1.35; white-space:nowrap;
  box-shadow:var(--shadow-lift);
  transform:translate(-50%,calc(-100% - 8px));
  opacity:0; transition:opacity 80ms linear;
}
.chart-tip.is-on{opacity:1}
.chart-tip b{font-weight:700; font-variant-numeric:tabular-nums}
.chart-tip span{opacity:.75}

/* SVG helpers (charts read these via currentColor / CSS vars) */
.chart-hit{fill:transparent; cursor:pointer}
.chart-hit:focus-visible{outline:none; fill:rgba(93,22,234,.08)}
.chart-arc{cursor:pointer}
.chart-arc:focus-visible{outline:2px solid var(--focus); outline-offset:2px}

/* ==========================================================================
   13. MENUS (admin dropdown)
   ========================================================================== */
.menu-wrap{position:relative}
.menu{
  position:absolute; top:calc(100% + 8px); right:0; z-index:var(--z-overlay);
  min-width:230px; display:none;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-md); box-shadow:var(--shadow-lift); padding:6px;
}
.menu.is-open{display:block; animation:pop 140ms var(--ease)}
.menu__info{padding:8px 10px 10px; border-bottom:1px solid var(--border); margin-bottom:6px}
.menu__name{font-weight:700; font-size:var(--text-sm); color:var(--text)}
.menu__meta{font-size:var(--text-xs); color:var(--text-3); display:flex; align-items:center; gap:6px; margin-top:3px}
.menu__item{
  display:flex; width:100%; align-items:center; gap:8px;
  padding:.55rem .65rem; border:0; border-radius:var(--r-sm);
  background:transparent; text-align:left; cursor:pointer;
  font-size:var(--text-sm); font-weight:600; color:var(--text-2); text-decoration:none;
}
.menu__item:hover{background:var(--surface-2); color:var(--violet-500)}
.menu__item--danger{color:var(--tint-error-tx)}
.menu__item--danger:hover{background:var(--tint-error-bg); color:var(--tint-error-tx)}
.menu__rule{height:1px; margin:6px 0; background:var(--border)}

/* ==========================================================================
   14. EMPTY STATES & ACCESS-DENIED
   ========================================================================== */
.empty{
  padding:var(--sp-2xl) var(--sp-lg);
  border:2px dashed var(--border); border-radius:var(--r-lg);
  text-align:center; color:var(--text-3);
}
.empty__icon{
  width:48px; height:48px; margin:0 auto var(--sp-sm);
  display:flex; align-items:center; justify-content:center;
  border-radius:var(--r-md); background:var(--tint-violet-bg); color:var(--tint-violet-tx);
}
.empty__title{font-family:var(--font-heading); font-weight:700; color:var(--text); margin-bottom:4px}
.empty p{font-size:var(--text-sm); max-width:30rem; margin-inline:auto}
.empty .btn{margin-top:var(--sp-md)}
.empty__list{
  max-width:30rem; margin:var(--sp-md) auto 0; display:grid; gap:6px; text-align:left;
}
.empty__list li{
  display:flex; gap:8px; align-items:flex-start;
  font-size:var(--text-sm); color:var(--text-2);
}
.empty__list svg{flex:none; margin-top:3px; color:var(--violet-500)}

/* Access denied (role guard) — uses .empty with error tint */
.empty--denied{border-color:var(--tint-error-bg)}
.empty--denied .empty__icon{background:var(--tint-error-bg); color:var(--tint-error-tx)}

/* ==========================================================================
   15. AUTH (LOGIN) SCREEN
   ========================================================================== */
.auth-page{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  padding:var(--sp-lg); background:var(--bg);
}
.auth-box{width:100%; max-width:420px}
.auth-box .card{padding:var(--sp-xl)}
.auth-brand{display:flex; justify-content:center; align-items:center; gap:10px; margin-bottom:var(--sp-lg)}
.auth-brand img{height:40px; width:auto}
.auth-foot{margin-top:var(--sp-md); text-align:center; font-size:var(--text-xs); color:var(--text-3)}

/* ==========================================================================
   16. UTILITIES
   ========================================================================== */
.visually-hidden{
  position:absolute!important; width:1px; height:1px; margin:-1px; padding:0;
  overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0;
}
.row{display:flex; flex-wrap:wrap; align-items:center; gap:var(--sp-sm)}
.row--between{justify-content:space-between}
.stack{display:grid; gap:var(--sp-md)}
.muted{color:var(--text-3); font-size:var(--text-sm)}
.mt-lg{margin-top:var(--sp-lg)}
.mt-md{margin-top:var(--sp-md)}
.duo{display:grid; gap:var(--sp-md); margin-top:var(--sp-md)}
.duo > *{min-width:0}          /* let cards shrink so inner tables scroll, not the page */
.kpi-row > *{min-width:0}
@media (min-width:1024px){
  .duo{grid-template-columns:7fr 5fr; gap:var(--sp-lg)}
  .duo--even{grid-template-columns:1fr 1fr}
}
.section-gap{margin-top:var(--sp-lg)}
