/* ============================================================
   CommissionIQ AI — Executive Design System
   Developed by IdeazShuttle LLC
   ============================================================ */

:root {
  --bg: #F4F6FB;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #EEF0FF 0%, rgba(238,240,255,0) 55%),
             radial-gradient(900px 500px at -10% 10%, #F3ECFF 0%, rgba(243,236,255,0) 50%);
  --surface: #FFFFFF;
  --surface-2: #FBFCFE;
  --surface-3: #F5F7FC;
  --border: #E8EAF2;
  --border-strong: #DCDFEC;
  --text: #0B1220;
  --text-2: #4B5568;
  /* P2-004: was #939AAD (2.81:1 vs white - fails WCAG AA's 4.5:1 minimum
     for normal text). #5C6470 computes to 5.98:1 vs white / 5.53:1 vs
     --bg, comfortably passing while staying visibly lighter/more muted
     than --text-2 (7.5:1) to preserve the existing 3-tier text hierarchy.
     Dark mode's --text-3 (#828B98, 5.82:1) already passed and is unchanged. */
  --text-3: #5C6470;
  --brand: #6366F1;
  --brand-2: #8B5CF6;
  --brand-3: #A855F7;
  --brand-grad: linear-gradient(135deg, #6366F1 0%, #8B5CF6 55%, #A855F7 100%);
  --brand-soft: #EEF0FE;
  --emerald: #10B981;
  --emerald-soft: #E7F8F1;
  --amber: #F59E0B;
  --amber-soft: #FEF4E2;
  --rose: #F43F5E;
  --rose-soft: #FEECEF;
  --sky: #0EA5E9;
  --sky-soft: #E6F6FE;
  --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
  --shadow-sm: 0 1px 3px rgba(16,24,40,.07), 0 1px 2px rgba(16,24,40,.04);
  --shadow-md: 0 8px 24px rgba(16,24,40,.08), 0 2px 6px rgba(16,24,40,.04);
  --shadow-lg: 0 20px 48px rgba(16,24,40,.14), 0 6px 14px rgba(16,24,40,.06);
  --shadow-glow: 0 12px 40px rgba(99,102,241,.28);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --sidebar-w: 264px;
  --topbar-h: 72px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  /* Tells the browser this page is light-themed so native form-control
     chrome (placeholder text, scrollbars, date/number spinners, autofill)
     uses light-appropriate defaults instead of guessing from the OS
     preference - without this, a user whose OS is set to light mode while
     toggling THIS app to dark mode gets browser-default placeholder text
     colored for a light background rendered on a dark input, which fails
     contrast. See docs root-cause note in the hotfix that added this. */
  color-scheme: light;
}

[data-theme="dark"] {
  /* "Command Center" — near-black canvas with an ambient aurora and frosted glass panels */
  color-scheme: dark;
  --bg: #070809;
  --bg-grad: radial-gradient(60% 50% at 18% -8%, rgba(125,108,247,.20), transparent 60%),
             radial-gradient(50% 42% at 92% 0%, rgba(91,157,255,.14), transparent 60%),
             radial-gradient(60% 50% at 50% 120%, rgba(55,211,154,.07), transparent 60%);
  --surface: rgba(255,255,255,.030);
  --surface-2: rgba(255,255,255,.05);
  --surface-3: rgba(255,255,255,.07);
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.13);
  --text: #F5F6F8;
  --text-2: #AAB2BF;
  --text-3: #828B98;
  --brand-soft: rgba(125,108,247,.16);
  --emerald-soft: rgba(55,211,154,.14);
  --amber-soft: rgba(245,180,84,.14);
  --rose-soft: rgba(251,111,125,.14);
  --sky-soft: rgba(91,157,255,.14);
  --shadow-xs: 0 1px 0 rgba(255,255,255,.03) inset, 0 1px 2px rgba(0,0,0,.5);
  --shadow-sm: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 26px -16px rgba(0,0,0,.85);
  --shadow-md: 0 1px 0 rgba(255,255,255,.05) inset, 0 18px 44px -22px rgba(0,0,0,.9);
  --shadow-lg: 0 1px 0 rgba(255,255,255,.06) inset, 0 30px 64px -26px rgba(0,0,0,.95);
  --shadow-glow: 0 12px 40px rgba(125,108,247,.40);
}
/* Frosted glass on panels in dark mode (harmless in light — surfaces are opaque) */
[data-theme="dark"] .card,
[data-theme="dark"] .kpi,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .chat,
[data-theme="dark"] .statement,
[data-theme="dark"] .feature,
[data-theme="dark"] .notif-panel {
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  letter-spacing: -0.01em;
}
::selection { background: rgba(99,102,241,.22); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

/* ============================================================
   LANDING / WELCOME
   ============================================================ */
.landing {
  position: fixed; inset: 0; z-index: 100;
  background: #06070D;
  color: #fff;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.landing::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(900px 500px at 80% -5%, rgba(139,92,246,.35), transparent 60%),
    radial-gradient(800px 500px at 10% 100%, rgba(99,102,241,.30), transparent 55%),
    radial-gradient(600px 400px at 50% 50%, rgba(168,85,247,.10), transparent 60%);
  animation: drift 16s ease-in-out infinite alternate;
}
@keyframes drift {
  0% { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(-20px,18px,0) scale(1.06); }
}
.landing-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 75%);
}
.landing-nav {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 48px;
}
.landing-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.landing-brand .logo-badge { width: 38px; height: 38px; }
.landing-nav-links { display: flex; gap: 30px; font-size: 14.5px; color: rgba(255,255,255,.72); font-weight: 500; }
.landing-nav-links span { cursor: pointer; transition: color .2s; }
.landing-nav-links span:hover { color: #fff; }
.landing-nav-links span:focus-visible { outline: none; color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.35); border-radius: 6px; }
.landing-hero {
  position: relative; z-index: 2;
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 24px;
}
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 15px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  font-size: 13px; color: rgba(255,255,255,.85); font-weight: 500; margin-bottom: 28px;
  backdrop-filter: blur(8px);
  animation: fadeUp .7s ease both;
}
.hero-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 4px rgba(52,211,153,.18); }
.hero-title {
  font-size: clamp(40px, 6vw, 74px); font-weight: 800; line-height: 1.04;
  letter-spacing: -.035em; max-width: 980px;
  background: linear-gradient(180deg, #fff 35%, #C9C5FF 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: fadeUp .7s .05s ease both;
}
.hero-title .accent {
  background: linear-gradient(120deg, #818CF8, #C084FC 60%, #E879F9);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub {
  margin-top: 24px; font-size: clamp(16px, 1.7vw, 20px); color: rgba(255,255,255,.66);
  max-width: 660px; font-weight: 400; line-height: 1.6;
  animation: fadeUp .7s .12s ease both;
}
.hero-cta { margin-top: 40px; display: flex; gap: 14px; animation: fadeUp .7s .2s ease both; }
.hero-meta { margin-top: 54px; display: flex; gap: 40px; animation: fadeUp .7s .3s ease both; }
.hero-meta .m-val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; background: linear-gradient(180deg,#fff,#B9B4FF); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.hero-meta .m-lbl { font-size: 12.5px; color: rgba(255,255,255,.5); margin-top: 4px; text-transform: uppercase; letter-spacing: .08em; }
.landing-foot {
  position: relative; z-index: 2; text-align: center; padding: 22px;
  color: rgba(255,255,255,.4); font-size: 13px;
}
.btn-hero {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 26px; border-radius: 14px; font-weight: 600; font-size: 15.5px;
  transition: transform .18s ease, box-shadow .25s ease;
}
.btn-hero.primary { background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-glow); }
.btn-hero.primary:hover { transform: translateY(-2px); box-shadow: 0 18px 50px rgba(139,92,246,.45); }
.btn-hero.ghost { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); color: #fff; }
.btn-hero.ghost:hover { background: rgba(255,255,255,.12); transform: translateY(-2px); }

/* ============================================================
   LOGIN
   ============================================================ */
.login-screen { z-index: 200; }
.login-center { position: relative; z-index: 2; flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; text-align: center;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg); padding: 36px 32px; backdrop-filter: blur(14px);
  animation: fadeUp .5s ease both;
}
.login-card .logo-badge { margin: 0 auto 18px; }
.login-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.login-sub { margin: 6px 0 26px; font-size: 13.5px; color: rgba(255,255,255,.55); }
.login-card form { text-align: left; }
.login-card .calc-field label { color: rgba(255,255,255,.7); }
.login-card .input { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: #fff; }
.login-card .input:focus { border-color: var(--brand); }
.login-submit { width: 100%; justify-content: center; margin-top: 4px; }
.login-error {
  font-size: 13px; color: #FCA5A5; background: rgba(244,63,94,.12); border: 1px solid rgba(244,63,94,.3);
  border-radius: 10px; padding: 9px 12px; margin-bottom: 16px;
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; opacity: 0; transition: opacity .5s ease; }
.app-shell.ready { opacity: 1; }

/* Sidebar - fixed to viewport height; only .sidebar-scroll scrolls, brand
   header and footer stay pinned, independent of the main content's scroll. */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 22px 16px; z-index: 30;
  overflow: hidden;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 6px 8px 22px; flex-shrink: 0; }
.sidebar-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  margin: 0 -8px; padding: 0 8px;
}
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

/* Collapsible nav groups */
.nav-group { margin-bottom: 2px; }
.nav-group-header {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 12px 8px; background: none; border: none; cursor: pointer;
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 600;
}
.nav-group-header:hover { color: var(--text-2); }
.nav-group-chevron { width: 14px; height: 14px; transition: transform .18s ease; }
.nav-group.collapsed .nav-group-chevron { transform: rotate(-90deg); }
.nav-group.collapsed .nav-group-body { display: none; }
.logo-badge {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: var(--brand-grad); display: grid; place-items: center;
  box-shadow: var(--shadow-glow); overflow: hidden;
}
.logo-badge img { width: 100%; height: 100%; object-fit: cover; }
.brand-text .b-name { font-weight: 750; font-size: 16px; letter-spacing: -.02em; }
.brand-text .b-name b { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand-text .b-sub { font-size: 11px; color: var(--text-3); font-weight: 500; letter-spacing: .02em; }
.nav-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 600; padding: 16px 12px 8px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px;
  color: var(--text-2); font-weight: 530; font-size: 14.5px; position: relative;
  transition: background .16s, color .16s; width: 100%; text-align: left;
}
.nav-item i { width: 19px; height: 19px; stroke-width: 2; color: var(--text-3); transition: color .16s; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item:hover i { color: var(--text-2); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 620; }
.nav-item.active i { color: var(--brand); }
.nav-item.active::before { content:''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-grad); }
.nav-badge { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--brand-grad); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--border); }
.sidebar-foot .made { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.sidebar-foot .ver { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* Main column */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Topbar */
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 25;
  display: flex; align-items: center; gap: 18px; padding: 0 32px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.greet { display: flex; flex-direction: column; }
.greet .g-hi { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.greet .g-date { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.search {
  margin-left: 10px; flex: 0 1 360px; display: flex; align-items: center; gap: 9px;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; padding: 9px 13px;
  color: var(--text-3); font-size: 13.5px; transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search input { border: none; background: none; outline: none; color: var(--text); font-size: 13.5px; width: 100%; }
.search .kbd { margin-left: auto; font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2);
  transition: background .16s, color .16s, transform .16s; position: relative;
}
.icon-btn:hover { background: var(--surface); color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.icon-btn i { width: 18px; height: 18px; }
.icon-btn .ping { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 3px var(--surface); }
.avatar {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-sm);
  cursor: pointer; outline: none;
}
.avatar:focus-visible { box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow-sm); }

/* Mobile off-canvas sidebar (P2-003) - reuses the same 900px breakpoint
   already used by .admin-layout's own fixed-width-nav collapse, above. */
.sidebar-hamburger { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 900px) {
  .sidebar-hamburger { display: grid; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55;
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  /* With the sidebar off-canvas, the topbar is the only visible chrome and
     no longer has room for the search box alongside the greeting and the
     4 fixed-width icon buttons - hiding it here prevents a new horizontal
     overflow this off-canvas change would otherwise introduce. */
  .topbar .search { display: none; }
}
body.sidebar-locked { overflow: hidden; }

/* Content */
.content { padding: 30px 32px 56px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; animation: pageIn .45s cubic-bezier(.22,.61,.36,1) both; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 20px; flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 780; letter-spacing: -.03em; }
.page-sub { color: var(--text-3); font-size: 14px; margin-top: 4px; font-weight: 500; }
.page-actions { display: flex; gap: 10px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 11px;
  font-weight: 600; font-size: 14px; transition: transform .15s, box-shadow .2s, background .16s, border-color .16s;
}
.btn i { width: 16px; height: 16px; }
.btn.primary { background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-glow); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(139,92,246,.4); }
.btn.soft { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); box-shadow: var(--shadow-xs); }
.btn.soft:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
[data-theme="dark"] .btn.soft { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: var(--text-2); }
[data-theme="dark"] .btn.soft:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.24); color: var(--text); }
[data-theme="dark"] .btn.ghost:hover { background: rgba(255,255,255,.07); }
.btn.soft.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

/* Grid */
.grid { display: grid; gap: 20px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
@media (max-width: 1180px) { .cols-4 { grid-template-columns: repeat(2,1fr);} .cols-3{grid-template-columns:repeat(2,1fr);} }
@media (max-width: 760px) { .cols-4,.cols-3,.cols-2{grid-template-columns:1fr;} .span-2,.span-3{grid-column:auto;} }

/* Card */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .25s, border-color .2s;
}
.card.hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-title { font-size: 15.5px; font-weight: 680; letter-spacing: -.01em; }
.card-meta { font-size: 12.5px; color: var(--text-3); font-weight: 500; }

/* KPI card */
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .25s, border-color .2s;
}
.kpi.hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.kpi::after { content:''; position:absolute; right:-30px; top:-30px; width:120px; height:120px; border-radius:50%; background: var(--accent-soft, var(--brand-soft)); opacity:.5; filter: blur(6px); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; position: relative; z-index: 1; }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.kpi-icon i { width: 20px; height: 20px; }
.kpi-label { font-size: 12.5px; color: var(--text-3); font-weight: 600; letter-spacing: .01em; text-transform: uppercase; position: relative; z-index: 1; }
.kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 3px; position: relative; z-index: 1; }
.kpi-foot { display: flex; align-items: center; gap: 7px; margin-top: 12px; position: relative; z-index: 1; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.delta i { width: 13px; height: 13px; }
.delta.up { color: var(--emerald); background: var(--emerald-soft); }
.delta.down { color: var(--rose); background: var(--rose-soft); }
.delta.flat { color: var(--text-2); background: var(--surface-3); }
.kpi-foot .since { font-size: 12px; color: var(--text-3); font-weight: 500; }

.grad-indigo { background: linear-gradient(135deg,#6366F1,#818CF8); }
.grad-violet { background: linear-gradient(135deg,#8B5CF6,#A855F7); }
.grad-emerald { background: linear-gradient(135deg,#10B981,#34D399); }
.grad-amber { background: linear-gradient(135deg,#F59E0B,#FBBF24); }
.grad-sky { background: linear-gradient(135deg,#0EA5E9,#38BDF8); }
.grad-rose { background: linear-gradient(135deg,#F43F5E,#FB7185); }

/* Chart */
.chart-wrap { position: relative; width: 100%; }

/* Table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 650; padding: 0 14px 12px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .14s; }
.tbl tbody tr:hover { background: var(--surface-3); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cell-user { display: flex; align-items: center; gap: 11px; }
.mini-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
.cell-user .cu-name { font-weight: 620; font-size: 14px; }
.cell-user .cu-sub { font-size: 12px; color: var(--text-3); }

/* Badge */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 999px; }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { color: var(--emerald); background: var(--emerald-soft); }
.badge.amber { color: var(--amber); background: var(--amber-soft); }
.badge.sky { color: var(--sky); background: var(--sky-soft); }
.badge.rose { color: var(--rose); background: var(--rose-soft); }
.badge.indigo { color: var(--brand); background: var(--brand-soft); }
.badge.slate { color: var(--text-2); background: var(--surface-3); }

/* Commission Period current-period banner */
.period-current-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 16px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.period-current-banner.muted { color: var(--text-3); font-weight: 500; }

/* Progress */
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--brand-grad); transition: width 1s cubic-bezier(.22,.61,.36,1); }

/* Leaderboard */
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--border); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; flex-shrink: 0; background: var(--surface-3); color: var(--text-2); }
.lb-rank.gold { background: linear-gradient(135deg,#F59E0B,#FBBF24); color: #fff; }
.lb-rank.silver { background: linear-gradient(135deg,#94A3B8,#CBD5E1); color: #fff; }
.lb-rank.bronze { background: linear-gradient(135deg,#B45309,#D97706); color: #fff; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 620; font-size: 14px; }
.lb-sub { font-size: 12px; color: var(--text-3); }
.lb-val { font-weight: 750; font-size: 14.5px; font-variant-numeric: tabular-nums; }

/* Executive Dashboard stat tiles (Mission 3.8) */
.stat-tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stat-tile.clickable { cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.stat-tile.clickable:hover { border-color: var(--brand); transform: translateY(-1px); }
.stat-tile-label { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .02em; margin-bottom: 6px; }
.stat-tile-value { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }

/* Activity timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content:''; position:absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -22px; top: 3px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--surface); }
.tl-title { font-size: 13.5px; font-weight: 600; }
.tl-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Commission Copilot */
.ai-layout { display: grid; grid-template-columns: minmax(0,3fr) minmax(300px,1fr); gap: 20px; align-items: start; }
@media (max-width: 1080px){ .ai-layout{ grid-template-columns: 1fr; } }
.suggest-row { display: flex; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--border); overflow-x: auto; flex-wrap: nowrap; }
.suggest-row .suggest-chip { flex-shrink: 0; padding: 8px 13px; }
.suggest-row::-webkit-scrollbar { height: 0; }
.mic-btn, .attach-btn { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2); display: grid; place-items: center; transition: all .15s; flex-shrink: 0; }
.mic-btn:hover { color: var(--brand); border-color: var(--brand); }
.mic-btn.listening { background: var(--rose-soft); color: var(--rose); border-color: var(--rose); animation: pulse 1.4s ease-in-out infinite; }
.attach-btn { opacity: .5; cursor: not-allowed; }
/* ES-009 Evidence Workspace - synced to the active AssistantResponse only */
.evidence-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 18px; display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0; max-height: calc(100vh - 220px); min-height: 520px; overflow-y: auto;
}
.evidence-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.ev-block { display: flex; flex-direction: column; gap: 6px; }
.ev-block-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.resp-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 8px 10px; background: var(--surface-3); border-radius: 10px; }
.evidence-empty { display: flex; flex-direction: column; padding: 10px 4px; }
.empty-suggest-list { display: flex; flex-direction: column; gap: 8px; }
.empty-suggest-item { display: flex; align-items: center; gap: 9px; text-align: left; padding: 10px 12px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); transition: all .15s; }
.empty-suggest-item i { width: 14px; height: 14px; color: var(--brand); flex-shrink: 0; }
.empty-suggest-item:hover { border-color: var(--brand); color: var(--text); }
.evidence-skeleton { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.skel-line { height: 12px; }
.followup-row { display: flex; flex-direction: column; gap: 8px; }
.followup-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; padding: 9px 12px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); transition: all .15s; }
.followup-chip:hover { border-color: var(--brand); color: var(--text); }
.followup-chip i { color: var(--brand); flex-shrink: 0; }
.thread-turn { display: flex; flex-direction: column; gap: 18px; border-radius: 14px; padding: 8px; margin: -8px; transition: background .15s; }
.thread-turn.clickable { cursor: pointer; }
.thread-turn.clickable:hover { background: var(--surface-2); }
.active-indicator { display: flex; align-items: center; gap: 6px; font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); margin-bottom: 6px; }
.active-indicator .adot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.chat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 520px; overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.ai-orb { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-grad); display: grid; place-items: center; color: #fff; box-shadow: var(--shadow-glow); position: relative; }
.ai-orb::after { content:''; position:absolute; inset:-3px; border-radius: 14px; background: var(--brand-grad); opacity:.35; filter: blur(8px); z-index:-1; animation: pulse 2.6s ease-in-out infinite; }
.chat-body { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; max-width: 86%; animation: fadeUp .4s ease both; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-ava { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; }
.msg-ava.ai { background: var(--brand-grad); }
.msg-ava.me { background: linear-gradient(135deg,#0EA5E9,#38BDF8); }
.bubble { padding: 14px 16px; border-radius: 16px; font-size: 14.5px; line-height: 1.6; }
.msg.ai .bubble { background: var(--surface-3); border: 1px solid var(--border); border-top-left-radius: 5px; }
.msg.user .bubble { background: var(--brand-grad); color: #fff; border-top-right-radius: 5px; }
.bubble h4 { font-size: 14.5px; margin-bottom: 8px; font-weight: 700; }
.bubble ul { margin: 8px 0 0 2px; padding-left: 16px; }
.bubble li { margin: 4px 0; }
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 2px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: typing 1.2s infinite ease-in-out; }
.typing span:nth-child(2){ animation-delay:.18s; } .typing span:nth-child(3){ animation-delay:.36s; }
.chat-input { padding: 16px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.chat-input input { flex: 1; background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px; font-size: 14.5px; color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s; }
.chat-input input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.send-btn { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-grad); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-glow); transition: transform .15s; }
.send-btn:hover { transform: translateY(-1px) scale(1.03); }
.suggest { display: flex; flex-direction: column; gap: 10px; }
.suggest-chip { text-align: left; padding: 13px 15px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); font-weight: 530; transition: all .16s; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-xs); }
.suggest-chip i { width: 16px; height: 16px; color: var(--brand); flex-shrink: 0; }
.suggest-chip:hover { border-color: var(--brand); color: var(--text); transform: translateX(3px); box-shadow: var(--shadow-sm); }

/* Copilot extras */
.insight p { margin: 0; }
.resp { display: flex; flex-direction: column; gap: 12px; }
.resp-body h4 { font-size: 15px; font-weight: 750; margin-bottom: 4px; }
.resp-body p { margin: 6px 0; }
.resp-body ul { margin: 6px 0 6px 2px; padding-left: 18px; }
.resp-body li { margin: 4px 0; }
.ref-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-chip { font-size: 12px; padding: 5px 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.ref-chip b { color: var(--text); font-variant-numeric: tabular-nums; }
.evidence-list { display: flex; flex-direction: column; gap: 7px; }
.evidence-item { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.resp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.prov { font-size: 11.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 5px; }
.resp-actions { display: flex; gap: 6px; }
.mini-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2); transition: all .14s; }
.mini-btn i { width: 13px; height: 13px; }
.mini-btn:hover { color: var(--brand); border-color: var(--brand); }

/* KPI sparkline + accent edge (command-center look) */
.kpi-spark { margin-top: 12px; height: 34px; position: relative; z-index: 1; }
.kpi-spark .spark { width: 100%; height: 100%; display: block; }
.kpi.edge { border-left: 2px solid var(--edge, var(--brand)); }

/* Notifications dropdown */
.notif-panel { position: fixed; top: 70px; right: 26px; width: 348px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 80; overflow: hidden; animation: fadeUp .22s ease both; }
[data-theme="light"] .notif-panel { background: var(--surface); }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px; border-bottom: 1px solid var(--border); }
.notif-head .nt { font-weight: 750; font-size: 14.5px; }
.notif-head .nclear { font-size: 12px; font-weight: 600; color: var(--brand); }
.notif-list { max-height: 384px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 13px 17px; border-bottom: 1px solid var(--border); transition: background .14s; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-3); }
.notif-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.notif-ic i { width: 17px; height: 17px; }
.notif-b .ntitle { font-size: 13.5px; font-weight: 620; line-height: 1.35; }
.notif-b .nsub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.notif-foot { padding: 11px 17px; text-align: center; font-size: 12.5px; color: var(--text-3); border-top: 1px solid var(--border); }

/* Account menu (avatar dropdown) */
.account-menu { position: fixed; top: 70px; right: 26px; width: 264px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 80; overflow: hidden; animation: fadeUp .22s ease both; }
[data-theme="dark"] .account-menu { backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); }
.account-menu-head { padding: 15px 17px; border-bottom: 1px solid var(--border); }
.account-menu-head .amname { font-size: 14px; font-weight: 700; }
.account-menu-head .amemail { font-size: 12px; color: var(--text-3); margin-top: 2px; word-break: break-all; }
.account-menu-list { padding: 6px; }
.account-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 11px; border-radius: 10px; border: none;
  background: transparent; color: var(--text); font-size: 13.5px; font-weight: 560; text-align: left; cursor: pointer; transition: background .14s; }
.account-menu-item:hover, .account-menu-item:focus-visible { background: var(--surface-3); outline: none; }
.account-menu-item i { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }
.account-menu-item.danger { color: var(--rose, #e11d48); }
.account-menu-item.danger i { color: var(--rose, #e11d48); }
.account-menu-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* Calculator */
.calc-field { margin-bottom: 18px; }
.calc-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.input, select.input { width: 100%; background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 14.5px; color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s; font-family: inherit; }
.input:focus, select.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
/* Without this, placeholder text falls back to the browser's own UA
   default gray (~rgb(117,117,117), tuned for a light background) since
   nothing here otherwise tells the browser this input's background is
   dark - confirmed via computed-style inspection to fail WCAG AA contrast
   in dark mode (3.81:1 vs the 4.5:1 minimum for normal text). --text-2
   passes AA in both themes (dark: 8.22:1, light: 7.00:1 - actually an
   improvement over the previous unstyled 4.30:1 in light mode too). */
.input::placeholder, select.input::placeholder { color: var(--text-2); opacity: 1; }
/* select.input's own color/background don't propagate into the native
   option popup in every browser - without this, options can render with
   the OS-default light background + dark text regardless of page theme,
   making them unreadable in dark mode. Uses --bg (a solid, opaque color)
   rather than the --surface-* tokens, which are deliberately translucent
   (e.g. rgba(255,255,255,.07) in dark mode) and meant to be composited
   over the page background - the native option popup is frequently its
   own rendering layer that doesn't composite that way, so a translucent
   background there can still leave text unreadable against the browser's
   own default popup backdrop. */
select.input option { background: var(--bg); color: var(--text); }
select.input option:disabled { color: var(--text-2); }
.range { width: 100%; }
.tier-line { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.tier-line:last-child { border-bottom: none; }
.tier-band { font-size: 13px; font-weight: 600; width: 90px; }
.tier-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.tier-bar > span { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; }
.tier-amt { font-size: 13px; font-weight: 700; width: 90px; text-align: right; font-variant-numeric: tabular-nums; }

/* Statement */
.statement { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.stmt-head { padding: 30px 34px; background: linear-gradient(135deg, #0B1220, #1E1B4B); color: #fff; display: flex; justify-content: space-between; align-items: flex-start; }
.stmt-body { padding: 30px 34px; }
.stmt-row { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.stmt-row.total { border-bottom: none; border-top: 2px solid var(--border-strong); margin-top: 8px; font-weight: 800; font-size: 18px; }
.stmt-row .lbl { color: var(--text-2); }
.stmt-row .val { font-weight: 650; font-variant-numeric: tabular-nums; }

/* Feature card (landing/welcome/about) */
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .25s; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature:focus-visible { outline: none; border-color: var(--brand); animation: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.feature .f-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; color: #fff; margin-bottom: 16px; }
.feature .f-icon i { width: 23px; height: 23px; }
.feature h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; }
.feature p { font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* FAQ / Help */
.faq-item { border: 1px solid var(--border); border-radius: 14px; margin-bottom: 12px; overflow: hidden; background: var(--surface); transition: box-shadow .2s; }
.faq-item:hover { box-shadow: var(--shadow-sm); }
.faq-q { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; font-weight: 620; font-size: 15px; cursor: pointer; }
.faq-q:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--brand-soft); }
.faq-q i { transition: transform .25s; color: var(--text-3); }
.faq-item.open .faq-q i { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s ease; padding: 0 20px; color: var(--text-2); font-size: 14px; line-height: 1.7; }
.faq-item.open .faq-a { max-height: 320px; padding: 0 20px 20px; }

/* Skeleton */
.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 8px; }
.skeleton::after { content:''; position:absolute; inset:0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent); animation: shimmer 1.4s infinite; }

/* Toast */
/* Must render above .modal-overlay (z-index: 300) - toasts are used for
   in-modal feedback (e.g. "Select a provider first" from the AI Provider
   wizard) and were previously getting visually buried under the modal's
   dark blurred backdrop whenever a modal was open. */
.toast-wrap { position: fixed; bottom: 26px; right: 26px; z-index: 400; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); min-width: 280px; animation: toastIn .4s cubic-bezier(.22,.61,.36,1) both; }
.toast .t-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.toast .t-title { font-weight: 650; font-size: 14px; } .toast .t-sub { font-size: 12.5px; color: var(--text-3); }

/* Footer */
.app-footer { padding: 20px 32px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; color: var(--text-3); font-size: 12.5px; }

/* Animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes pulse { 0%,100%{ opacity:.35; transform: scale(1);} 50%{ opacity:.6; transform: scale(1.08);} }
@keyframes typing { 0%,60%,100%{ transform: translateY(0); opacity:.4;} 30%{ transform: translateY(-5px); opacity:1;} }
@keyframes toastIn { from{ opacity:0; transform: translateX(30px);} to{ opacity:1; transform: translateX(0);} }
.stagger > * { animation: fadeUp .5s ease both; }
.stagger > *:nth-child(1){ animation-delay: .03s; } .stagger > *:nth-child(2){ animation-delay: .08s; }
.stagger > *:nth-child(3){ animation-delay: .13s; } .stagger > *:nth-child(4){ animation-delay: .18s; }
.stagger > *:nth-child(5){ animation-delay: .23s; } .stagger > *:nth-child(6){ animation-delay: .28s; }

/* Utilities */
.flex { display:flex; } .items-center{ align-items:center; } .justify-between{ justify-content:space-between; }
.gap-2{ gap:8px;} .gap-3{ gap:12px;} .gap-4{ gap:16px;} .mt-2{ margin-top:8px;} .mt-4{ margin-top:16px;} .mt-6{ margin-top:24px;}
.text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); } .wrap { flex-wrap: wrap; }
.muted { color: var(--text-3); font-size: 13px; }

/* ============================================================
   ADMIN CENTER
   ============================================================ */
.admin-layout { display: flex; gap: 24px; align-items: flex-start; }
.admin-subnav {
  width: 220px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 10px; box-shadow: var(--shadow-sm);
}
.admin-subnav .nav-section-label:first-child { padding-top: 2px; }
.admin-content { flex: 1; min-width: 0; }
@media (max-width: 900px) { .admin-layout { flex-direction: column; } .admin-subnav { width: 100%; } }

.admin-pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px 4px; margin-top: 10px; border-top: 1px solid var(--border);
}
.admin-pagination .btn.soft { padding: 8px 12px; }

.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
@media (max-width: 700px) { .security-grid { grid-template-columns: 1fr; } }
.security-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.security-row:last-child { border-bottom: none; }

.perm-group { margin-bottom: 16px; }
.perm-group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 8px; }
.perm-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; text-transform: capitalize; }

.audit-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.audit-row:last-child { border-bottom: none; }
.audit-row-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.audit-diff { font-size: 12.5px; color: var(--text-2); font-family: ui-monospace, SFMono-Regular, monospace; word-break: break-word; margin-top: 2px; }

/* ============================================================
   ENTERPRISE LIST (UI Standardization Mission)
   Business-object row cards replacing raw <table> icon-stacks,
   a generic anchored overflow (⋮) menu, and a compact workflow
   stepper - shared across every Phase 3 list page.
   ============================================================ */
.list-kpis { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.list-kpi { flex: 1 1 150px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 13px 16px; }
.list-kpi-val { font-size: 19px; font-weight: 780; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.list-kpi-lbl { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; margin-top: 3px; font-weight: 600; }

.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .input, .filter-bar select.input { width: auto; min-width: 150px; padding: 9px 12px; font-size: 13.5px; }
.filter-bar .search-input { flex: 1 1 220px; min-width: 180px; }

.elist { display: flex; flex-direction: column; gap: 8px; }
.erow {
  display: flex; align-items: center; gap: 16px; padding: 13px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.erow.clickable { cursor: pointer; }
.erow.clickable:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.erow.clickable:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.erow-id { min-width: 0; flex: 1 1 200px; }
.erow-title { font-weight: 660; font-size: 14.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erow-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erow-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 0 0 auto; }
.erow-metrics { display: flex; align-items: center; gap: 20px; flex: 1 1 auto; flex-wrap: wrap; }
.erow-metric { min-width: 68px; }
.erow-metric-val { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.erow-metric-lbl { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-top: 1px; white-space: nowrap; }
.erow-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; margin-left: auto; }
.erow-empty { text-align: center; padding: 48px 24px; color: var(--text-3); font-size: 13.5px; }

/* Compact workflow stepper - at-a-glance lifecycle chips */
.wf-steps { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.wf-step { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 650; padding: 3px 7px 3px 5px; border-radius: 999px; color: var(--text-3); background: var(--surface-3); white-space: nowrap; }
.wf-step i { width: 10px; height: 10px; }
.wf-step.done { color: var(--emerald); background: var(--emerald-soft); }
.wf-step.current { color: var(--brand); background: var(--brand-soft); }
.wf-step.blocked { color: var(--rose); background: var(--rose-soft); }

/* Primary "Open" button - compact, paired with the ⋮ overflow trigger */
.btn.open-btn { padding: 8px 14px; font-size: 13px; }

/* Generic anchored overflow menu - same visual language as .account-menu,
   but positioned via inline style relative to its trigger (any row action). */
.row-menu { position: fixed; width: 240px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 120; overflow: hidden; animation: fadeUp .16s ease both; padding: 6px; }
[data-theme="dark"] .row-menu { backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); }
.row-menu-section { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 8px 10px 4px; }
.row-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; border: none;
  background: transparent; color: var(--text); font-size: 13.5px; font-weight: 560; text-align: left; cursor: pointer; transition: background .14s; }
.row-menu-item:hover, .row-menu-item:focus-visible { background: var(--surface-3); outline: none; }
.row-menu-item i { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.row-menu-item.danger { color: var(--rose); }
.row-menu-item.danger i { color: var(--rose); }
.row-menu-divider { height: 1px; background: var(--border); margin: 5px 4px; }
.row-menu-trigger.active { background: var(--surface); color: var(--text); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(8,10,20,.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); animation: fadeUp .25s ease both;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }
.modal-error {
  font-size: 13px; color: var(--rose); background: var(--rose-soft); border: 1px solid var(--rose);
  border-radius: 10px; padding: 9px 12px; margin-top: 4px;
}
