/* ==========================================================================
   CD Transition Portal — stylesheet
   Shares the design language of the CD Training Portal (cd-training.info).
   Brand colours are placeholders inspired by each brand; replace with the
   official hex values from each brand guide if needed.
   ========================================================================== */
:root {
  --brand-crazy-domains: #f26b21;
  --brand-vodien: #0098d8;
  --brand-resellerclub: #2c4fbf;
  --brand-dreamscape: #7a3fc6;

  --primary: #7c3aed;
  --primary-600: #6d28d9;
  --primary-50: #f3edff;
  --accent: #c026d3;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e4e8f0;
  --bg: #f4f6fb;
  --card: #ffffff;
  --side: #2a0f5c;
  --side-2: #3b1580;
  --side-ink: #dcd0f7;
  --green: #0f9d58; --green-50: #e7f7ee;
  --red: #d93025; --red-50: #fdecea;
  --amber: #b45309; --amber-50: #fff4e0;
  --blue: #1d4ed8; --blue-50: #e8efff;
  --purple: #6d28d9; --purple-50: #f3ecff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .12);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --side-w: 264px;
  --surface-2: #f8fafc;
  --surface-3: #eef1f6;
  --track: #e9edf5;
  --line-2: #d5dbe6;
  --row-hover: #fbf9ff;
  --topbar-bg: rgba(244,246,251,.85);
  --badge-muted-ink: #475569;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 1em; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid #a78bfa; outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px } .mb-0 { margin-bottom: 0 } .mb-2 { margin-bottom: 16px }
.inline { display: inline; margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); background: linear-gradient(180deg, #3b1580 0%, #2a0f5c 55%, #1a0838 100%); color: var(--side-ink); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: transform .25s ease; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; color: #fff; text-decoration: none !important; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; letter-spacing: .5px; color: #fff;
  background: conic-gradient(from 210deg, var(--brand-crazy-domains), var(--brand-dreamscape), var(--brand-resellerclub), var(--brand-vodien), var(--brand-crazy-domains)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: .98rem; }
.brand-text small { color: #b9a5e3; font-size: .75rem; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.side-nav .nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #a58bd6; font-weight: 700; padding: 14px 12px 4px; }
.side-nav a, .side-foot a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--side-ink); font-weight: 500; font-size: .9rem; text-decoration: none; }
.side-nav a:hover, .side-foot a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: linear-gradient(90deg, rgba(124,58,237,.35), rgba(124,58,237,.12)); color: #fff; box-shadow: inset 3px 0 0 #d8b4fe; }
.side-nav a .count { margin-left: auto; background: #ec4899; color: #fff; border-radius: 99px; font-size: .7rem; font-weight: 700; padding: 1px 7px; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.brand-dots { display: flex; gap: 6px; padding: 10px 12px 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #999; }
.main-wrap { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px max(32px, calc((100% - 1400px) / 2 + 32px)); background: var(--topbar-bg); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; color: var(--muted); }
.top-search input { flex: 1; border: 0; outline: none; background: none; padding: 10px 0; font: inherit; color: var(--ink); min-width: 0; }
.top-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.15); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; text-decoration: none !important; padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); }
.user-chip small { color: var(--muted); font-weight: 500; }
.icon-btn.nav-toggle { display: none; }
.scrim { display: none; }
.content { padding: 28px 32px; flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; outline: none; }
.site-footer { width: 100%; max-width: 1400px; margin: 0 auto; padding: 20px 32px; color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.footer-brands { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Brand helpers ---------- */
.brand-crazy-domains { --b: var(--brand-crazy-domains); }
.brand-vodien { --b: var(--brand-vodien); }
.brand-resellerclub { --b: var(--brand-resellerclub); }
.brand-dreamscape { --b: var(--brand-dreamscape); }
.dot[class*="brand-"] { background: var(--b, #94a3b8); }
.brand-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; color: var(--b, #475569); background: color-mix(in srgb, var(--b, #94a3b8) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--b, #94a3b8) 30%, var(--card)); }
.brand-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--b, #94a3b8); }

/* ---------- Buttons, badges, chips ---------- */
.btn { --bg: var(--card); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none !important; transition: background .15s, transform .05s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(124,58,237,.3); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-600), #a21caf); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #a21caf; }
.btn-danger { background: var(--card); color: var(--red); border-color: #f3c7c3; }
.btn-danger:hover { background: var(--red-50); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(15,23,42,.05); }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 9px; }
.btn-xs { padding: 4px 9px; font-size: .78rem; border-radius: 8px; gap: 5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.badge-muted { background: var(--surface-3); color: var(--badge-muted-ink); }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-blue { background: var(--blue-50); color: var(--blue); }
.badge-purple { background: var(--purple-50); color: var(--purple); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: .82rem; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); text-decoration: none !important; }
.chip:hover { border-color: #c7d0e0; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); flex: none; overflow: hidden; }
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; }
.avatar.lg { width: 84px; height: 84px; font-size: 1.5rem; }
.avatar.xl { width: 112px; height: 112px; font-size: 2rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.avatar { box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(15,23,42,.12); }

/* ---------- Cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head a { font-size: .85rem; font-weight: 600; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.layout-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack > * + * { margin-top: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head-text { display: flex; gap: 14px; align-items: center; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; flex: none; }
.page-icon .icon { width: 24px; height: 24px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 32px 36px; color: #fff; background:
  radial-gradient(800px 300px at 100% 0%, rgba(122,63,198,.55), transparent 60%),
  radial-gradient(600px 300px at 0% 100%, rgba(236,72,153,.35), transparent 60%),
  linear-gradient(120deg, #3b0f7a, #7c3aed 60%, #c026d3); box-shadow: var(--shadow-lg); margin-bottom: 22px; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255,255,255,.06); }
.hero h1 { font-size: 1.85rem; margin-bottom: 6px; color: #fff; }
.hero p { color: #f3e8ff; max-width: 680px; font-size: 1rem; margin: 0; }
.hero-eyebrow { display: inline-flex; gap: 8px; align-items: center; background: rgba(255,255,255,.12); padding: 5px 12px; border-radius: 99px; font-size: .8rem; font-weight: 600; margin-bottom: 12px; }
.hero-stats { display: flex; gap: 28px; margin-top: 22px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.5rem; }
.hero-stats span { color: #e9d5ff; font-size: .82rem; }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 22px; }
.tile { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none !important; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: transparent; }
.tile-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--card)); }
.tile-ic .icon { width: 22px; height: 22px; }
.tile strong { display: block; font-size: .95rem; }
.tile small { color: var(--muted); font-size: .8rem; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 14px; align-items: flex-start; padding: 13px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li:last-child { padding-bottom: 0; }
.list-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.list-ic.red { background: var(--red-50); color: var(--red); } .list-ic.amber { background: var(--amber-50); color: var(--amber); } .list-ic.green { background: var(--green-50); color: var(--green); } .list-ic.purple { background: var(--purple-50); color: var(--purple); }
.list-body { flex: 1; min-width: 0; }
.list-body strong, .list-body a.title { display: block; font-weight: 600; color: var(--ink); }
.list-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: .8rem; margin-top: 3px; align-items: center; }

/* ---------- Resource cards ---------- */
.res-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.res-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.res-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.res-type { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.res-card h3 { margin: 0; }
.res-card p { color: var(--ink-2); font-size: .9rem; margin: 0; flex: 1; }
.res-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; background: var(--card); border: 1px solid var(--line); padding: 12px; border-radius: 14px; }
.filters .search-inline { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.filters .search-inline input { border: 0; outline: 0; flex: 1; padding: 9px 0; font: inherit; min-width: 0; }
.filters select, .filters input[type=date] { flex: 0 1 190px; width: auto; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink-2); }
.field .req { color: var(--red); }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=url], input[type=number], input[type=search], input[type=month], input[type=file], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.15); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 0 0 18px; }
legend { font-weight: 700; padding: 0 6px; color: var(--ink-2); }
.table input[type=text], .table input[type=number], .table select { padding: 6px 8px; font-size: .85rem; border-radius: 8px; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; border: 1px solid; }
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--green-50); border-color: #bfe8d0; color: #0b6b3c; }
.alert-error { background: var(--red-50); border-color: #f5c2bd; color: #a32019; }
.alert-info { background: var(--blue-50); border-color: #c9d8ff; color: #1e3a8a; }
.alert-warn { background: var(--amber-50); border-color: #f8dcae; color: #8a4508; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: var(--surface-2); font-weight: 700; color: var(--ink-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--row-hover); }
.table div.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions > * + * { margin-left: 6px; }
.table td.actions form.inline { display: inline-block; }
.table td.num, .table th.num { text-align: right; }
.table.compact th, .table.compact td { padding: 7px 10px; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; text-align: center; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; text-decoration: none; }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Stats ---------- */
.stat { display: flex; gap: 14px; align-items: center; }
.stat-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--c, var(--primary)); background: color-mix(in srgb, var(--c, var(--primary)) 12%, var(--card)); flex: none; }
.stat-ic .icon { width: 24px; height: 24px; }
.stat strong { display: block; font-size: 1.6rem; line-height: 1.1; font-weight: 800; }
.stat span { color: var(--muted); font-size: .84rem; }
a.stat-link { color: inherit; text-decoration: none !important; }
a.stat-link .card:hover { box-shadow: var(--shadow-lg); }
.progress { height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.progress.thin { height: 6px; }
.ring { --p: 0; --size: 120px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--track) 0); flex: none; }
.ring::before { content: attr(data-label); width: calc(var(--size) - 22px); height: calc(var(--size) - 22px); border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; }
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) 56px; gap: 10px; align-items: center; font-size: .86rem; }
.bar-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .val { text-align: right; font-weight: 700; color: var(--ink-2); }
.bar-row .progress > span.red { background: var(--red); } .bar-row .progress > span.amber { background: #f59e0b; } .bar-row .progress > span.green { background: var(--green); }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 10px; }
.spark div { flex: 1; background: linear-gradient(180deg, var(--primary), #c4a1ff); border-radius: 6px 6px 2px 2px; min-height: 3px; position: relative; }
.spark div[data-v]:hover::after { content: attr(data-v); position: absolute; top: -22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .7rem; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.spark-labels { display: flex; gap: 4px; font-size: .68rem; color: var(--muted); margin-top: 6px; }
.spark-labels span { flex: 1; text-align: center; overflow: hidden; }
.stacked { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--track); }
.stacked span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- KV / profile ---------- */
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 16px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-head h1 { margin: 0; }
.metric-cell { font-weight: 700; }
.metric-cell.met { color: var(--green); } .metric-cell.miss { color: var(--red); }
.flag-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.flag-list li { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; }
.flag-list li .icon { color: var(--amber); margin-top: 2px; }
.flag-list li.bad .icon { color: var(--red); }
.flag-list li.ok .icon { color: var(--green); }

/* ---------- Announcements ---------- */
.ann.pinned { border-color: #ffd28a; background: linear-gradient(180deg, #fffaf0, #fff 60%); }
.ann-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--muted); font-size: .82rem; margin-bottom: 10px; }
.prose { color: var(--ink-2); white-space: pre-line; }
.prose > :last-child { margin-bottom: 0; }

/* ---------- Signatures ---------- */
.sig-pad { border: 1px dashed #b8c2d6; border-radius: 12px; background: var(--surface-2); position: relative; }
.sig-pad canvas { width: 100%; height: 150px; display: block; touch-action: none; cursor: crosshair; }
.sig-pad .sig-tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; }
.sig-pad .sig-hint { position: absolute; left: 12px; bottom: 8px; font-size: .75rem; color: var(--muted); pointer-events: none; }
.sig-img { max-height: 70px; max-width: 240px; object-fit: contain; }
.sig-block { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.sig-line { border-top: 1px solid var(--ink-2); padding-top: 4px; font-size: .82rem; color: var(--ink-2); }

/* ---------- EOS ---------- */
.eos-output { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .84rem; background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 18px; white-space: pre-wrap; max-height: 620px; overflow: auto; }
.eos-html { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: var(--card); }
.eos-html table { border-collapse: collapse; margin: 8px 0 14px; font-size: .85rem; }
.eos-html th, .eos-html td { border: 1px solid var(--line-2); padding: 5px 9px; text-align: left; }
.eos-html th { background: var(--primary-50); }

/* ---------- Attendance grid ---------- */
.att-grid select { min-width: 150px; }
.att-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.st-P { background: var(--green-50); color: var(--green); }
.st-PL { background: var(--amber-50); color: var(--amber); }
.st-PU { background: #fff7d6; color: #8a6d00; }
.st-SL { background: var(--red-50); color: var(--red); }
.st-L { background: var(--purple-50); color: var(--purple); }
.st-RD { background: var(--surface-3); color: var(--badge-muted-ink); }
.st-A { background: #fde2e1; color: #9f1d15; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .icon { width: 34px; height: 34px; margin: 0 auto 8px; display: block; opacity: .6; }
.empty p { margin: 0; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(800px 400px at 80% 0%, rgba(122,63,198,.25), transparent), linear-gradient(140deg, #2a0f5c, #7c3aed 60%, #c026d3); }
.auth-card { width: 100%; max-width: 440px; background: var(--card); border-radius: 20px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth-card .brand { padding: 0 0 18px; color: var(--ink); }
.auth-card .brand-text small { color: var(--muted); }
.auth-foot { margin-top: 18px; font-size: .85rem; color: var(--muted); display: grid; gap: 6px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.active { color: var(--primary); border-color: var(--primary); }

/* ---------- Profile sheet (printable) ---------- */
.sheet { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 34px; box-shadow: var(--shadow); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 3px solid; border-image: linear-gradient(90deg, var(--primary), var(--accent)) 1; padding-bottom: 16px; margin-bottom: 20px; }
.sheet h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--primary-600); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin: 26px 0 12px; }
.sheet .table-wrap { border-radius: 8px; }
.sheet .sigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; margin-top: 18px; }
.decision-box { border: 2px solid var(--primary); border-radius: 12px; padding: 14px 18px; background: var(--primary-50); }
.decision-box strong { font-size: 1.15rem; }
.stamp { display: inline-block; border: 2px solid currentColor; border-radius: 8px; padding: 3px 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; }

/* ---------- View-only profiles (Ops Manager / WFM / HR) ---------- */
body.readonly form[method=post]:not(.ro-ok),
body.readonly a[href^="coaching_edit.php"], body.readonly a[href^="disciplinary_edit.php"], body.readonly a[href^="agent_edit.php"],
body.readonly a[href^="agents_import.php"], body.readonly a[href="action_plan.php"], body.readonly a[href^="action_plan.php?agent"],
body.readonly a[href*="edit="], body.readonly a[href*="tab=entry"], body.readonly a[href*="tab=import"], body.readonly a[href*="tab=assign"],
body.readonly a[href*="new=1"], body.readonly a[href^="settings.php"], body.readonly .edit-only { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .layout-main { grid-template-columns: minmax(0, 1fr); }
  .grid-3, .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(8,12,30,.45); z-index: 35; }
  .main-wrap { margin-left: 0; }
  .icon-btn.nav-toggle { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  .content { padding: 20px 16px; }
  .site-footer { padding: 16px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  h1 { font-size: 1.4rem; }
  .hero { padding: 24px 20px; border-radius: 18px; }
  .hero h1 { font-size: 1.45rem; }
  .tiles, .grid-2, .grid-3, .grid-4, .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .tile small { display: none; }
  .hide-sm { display: none; }
  .hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
  .hero-stats strong { font-size: 1.25rem; }
  .page-head { align-items: flex-start; }
  .page-actions { width: 100%; }
  .filters > * { flex: 1 1 100%; }
  .filters .chips { flex-wrap: wrap; }
  .card { padding: 18px; }
  .filters select, .filters input[type=date] { flex: 1 1 140px; }
  .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; }
  .sheet { padding: 18px; }
  .user-chip > span:not(.avatar) { display: none; }
  .user-chip { padding: 3px; }
  .card-head h2, .card-head h3 { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  :root, :root[data-theme=dark] { --card: #fff; --bg: #fff; --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e4e8f0; --surface-2: #f8fafc; --surface-3: #eef1f6; --track: #e9edf5; color-scheme: light; }
  .sidebar, .topbar, .site-footer, .no-print, .alert, .page-actions, .tabs { display: none !important; }
  .main-wrap { margin: 0; } .content { padding: 0; max-width: none; } body { background: #fff; font-size: 12px; }
  .sheet, .card { box-shadow: none; border: 0; padding: 0; }
  .sheet h2 { break-after: avoid; }
  body.has-sheet .page-head { display: none !important; } .table-wrap { overflow: visible; border: 0; } tr { break-inside: avoid; }
  @page { size: A4; margin: 12mm; }
}
.top-search input[type=search], .filters .search-inline input[type=search] { border: 0; box-shadow: none; background: transparent; border-radius: 0; padding-left: 0; padding-right: 0; }
.grid > .card + .card, .grid > * + .card { margin-top: 0; }

/* ==========================================================================
   v1.3 components
   ========================================================================== */
.band-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 700; white-space: nowrap;
  color: color-mix(in srgb, var(--bc) 78%, var(--ink)); background: color-mix(in srgb, var(--bc) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--bc) 35%, var(--card)); }
.band-pill::before, .band-dot { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bc); }
.band-dot { margin-right: 6px; vertical-align: 1px; }
.band-cell { display: inline-block; min-width: 54px; padding: 3px 8px; border-radius: 8px; font-weight: 700; background: color-mix(in srgb, var(--bc) 16%, var(--card)); color: color-mix(in srgb, var(--bc) 70%, var(--ink)); box-shadow: inset 3px 0 0 var(--bc); }
.month-pill { display: inline-grid; place-items: center; min-width: 34px; height: 22px; padding: 0 7px; border-radius: 7px; font-size: .72rem; font-weight: 800; letter-spacing: .02em; color: #fff; background: #94a3b8; vertical-align: 1px; }
.month-pill.m0 { background: #94a3b8; } .month-pill.m1 { background: #0ea5e9; } .month-pill.m2 { background: #7c3aed; } .month-pill.m3 { background: #c026d3; } .month-pill.m4 { background: #ea580c; }
.month-pill.none { background: var(--surface-3); color: var(--muted); }
.eval-summary { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, var(--card)), var(--card)); border: 1px solid var(--line); margin-bottom: 14px; }
.eval-score strong { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.eval-tags { text-align: right; max-width: 380px; }
.eval-table tfoot td { background: var(--surface-2); font-weight: 700; border-top: 2px solid var(--line); }
.table tr.sep td { background: var(--surface-2); }
.set-chip { display: block; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: .82rem; margin-bottom: 4px; text-decoration: none !important; }
.set-chip small { display: block; color: var(--muted); font-weight: 500; }
.set-chip:hover { border-color: var(--primary); } .set-chip.active { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.set-chip.off { opacity: .55; }
.table.matrix td { vertical-align: top; min-width: 140px; }
.chart-wrap { width: 100%; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .ref { stroke: var(--red); stroke-dasharray: 5 4; stroke-width: 1.5; }
svg.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
svg.chart .axis.val { fill: var(--ink-2); font-weight: 700; }
svg.chart .ref-t { fill: var(--red); }
svg.spark { display: inline-block; vertical-align: middle; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: .8rem; color: var(--ink-2); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.stack-bar { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: var(--track); gap: 2px; }
.stack-bar span { display: block; height: 100%; }
.stack-bar.empty span { background: var(--track); }

/* Status boards */
.board-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.sum-tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; color: var(--ink); text-decoration: none !important; display: block; }
.sum-tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c, var(--primary)); }
.sum-tile strong { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.sum-tile span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.sum-tile small { display: block; font-size: .74rem; color: var(--muted); margin-top: 2px; }
.sum-tile.active { box-shadow: 0 0 0 2px var(--c, var(--primary)); }
.agent-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.agent-cell .avatar { width: 34px; height: 34px; font-size: .8rem; }
.mini-progress { width: 120px; }
.mini-progress .progress { height: 7px; }
.mini-progress small { display: block; font-size: .72rem; color: var(--muted); margin-top: 3px; }
.flag-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.flag-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--red-50); color: var(--red); white-space: nowrap; }
.flag-chip.amber { background: var(--amber-50); color: var(--amber); }
.flag-chip.ok { background: var(--green-50); color: var(--green); }
.risk-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.risk-dot.Medium { background: #f59e0b; box-shadow: 0 0 0 3px color-mix(in srgb, #f59e0b 22%, transparent); }
.risk-dot.High { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent); }
.status-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.board-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.agent-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--c, var(--line)); }
.agent-card .ac-head { display: flex; gap: 10px; align-items: center; }
.agent-card .ac-head strong { display: block; }
.agent-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: .8rem; }
.agent-card dt { color: var(--muted); } .agent-card dd { margin: 0; font-weight: 600; text-align: right; }
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.view-toggle a { padding: 6px 12px; font-size: .82rem; font-weight: 600; color: var(--ink-2); text-decoration: none; background: var(--card); }
.view-toggle a.active { background: var(--primary); color: #fff; }

/* Leadership dashboard */
.lead-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.leaderboard { list-style: none; margin: 0; padding: 0; }
.leaderboard li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.leaderboard li:last-child { border-bottom: 0; }
.leaderboard .rank { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .78rem; background: var(--surface-3); color: var(--ink-2); flex: none; }
.leaderboard li:nth-child(1) .rank { background: #fbbf24; color: #3b2600; } .leaderboard li:nth-child(2) .rank { background: #cbd5e1; color: #1e293b; } .leaderboard li:nth-child(3) .rank { background: #d97706; color: #fff; }
.leaderboard .lb-name { flex: 1; min-width: 0; } .leaderboard .lb-name a { font-weight: 700; } .leaderboard .lb-score { font-weight: 800; }
.redflag { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.redflag:last-child { border-bottom: 0; }
.redflag .rf-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--red-50); color: var(--red); flex: none; }
.redflag.amber .rf-ic { background: var(--amber-50); color: var(--amber); }
.quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.quick-links a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: .85rem; text-decoration: none; }
.quick-links a:hover { border-color: var(--primary); color: var(--primary); }
.trophy { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: linear-gradient(135deg, #fde68a, #fbbf24); color: #5b3a00; white-space: nowrap; }
.trophy .icon { width: 1em; height: 1em; }

/* Agent dashboard */
.milestones { list-style: none; margin: 0; padding: 0; position: relative; }
.milestones li { position: relative; padding: 0 0 16px 30px; }
.milestones li::before { content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.milestones li:last-child::before { display: none; }
.milestones .ms-dot { position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); border: 2px solid var(--line); color: #fff; }
.milestones li.done .ms-dot { background: var(--green); border-color: var(--green); }
.milestones li.current .ms-dot { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent); }
.milestones li.done strong { color: var(--ink); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .ck { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--muted); }
.checklist li.ok .ck { background: var(--green); color: #fff; }
.checklist li.todo .ck { background: var(--amber-50); color: var(--amber); }

/* Skill matrix */
.skill-matrix th.cat { background: color-mix(in srgb, var(--primary) 8%, var(--card)); color: var(--primary); text-transform: none; font-size: .82rem; letter-spacing: 0; }
.prof-scale { display: inline-flex; gap: 3px; }
.prof-scale label { position: relative; }
.prof-scale input { position: absolute; opacity: 0; pointer-events: none; }
.prof-scale span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: .82rem; cursor: pointer; color: var(--ink-2); }
.prof-scale input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.prof-scale input:focus-visible + span { outline: 3px solid #a78bfa; outline-offset: 2px; }
.prof-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.prof-dots i { width: 12px; height: 12px; border-radius: 3px; background: var(--track); }
.prof-dots i.on { background: var(--primary); }

/* Signatures */
.sig-req { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sig-req:last-child { border-bottom: 0; }
.esign { font-family: "Segoe Script", "Brush Script MT", "Lucida Handwriting", cursive; font-size: 1.35rem; color: var(--primary); }
.sig-log td { font-size: .82rem; }

/* Theme toggle */
.theme-toggle { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink); }
.theme-toggle .i-sun { display: none; }
:root[data-theme=dark] .theme-toggle .i-sun { display: block; } :root[data-theme=dark] .theme-toggle .i-moon { display: none; }
.theme-options { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-options label { flex: 1 1 140px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.theme-options label:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }

@media (max-width: 1100px) { .lead-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .eval-tags { text-align: left; } .board-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mini-progress { width: 90px; } }

/* ==========================================================================
   Dark mode — user-selectable (My account / top bar). Tokens first, then the
   few components that use fixed light colours.
   ========================================================================== */
:root[data-theme=dark] {
  color-scheme: dark;
  --primary: #a78bfa; --primary-600: #8b5cf6; --primary-50: #2a1f45; --accent: #e879f9;
  --ink: #e7e9f3; --ink-2: #c3c8d9; --muted: #98a0b8; --line: #2c3247; --line-2: #3a4159;
  --bg: #0e111b; --card: #171b29; --surface-2: #1d2233; --surface-3: #252b3f; --track: #2a3045; --row-hover: #1f2438;
  --topbar-bg: rgba(14,17,27,.82); --badge-muted-ink: #c3c8d9;
  --green: #34d399; --green-50: #0f2f25; --red: #f87171; --red-50: #3a1717; --amber: #fbbf24; --amber-50: #33270c;
  --blue: #93b4ff; --blue-50: #172446; --purple: #c4b5fd; --purple-50: #2a1f45;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.45);
}
:root[data-theme=dark] .alert-success { border-color: #1f5a44; color: #a7f3d0; }
:root[data-theme=dark] .alert-error { border-color: #6b2525; color: #fecaca; }
:root[data-theme=dark] .alert-info { border-color: #2b3f78; color: #c7d7ff; }
:root[data-theme=dark] .alert-warn { border-color: #5c4513; color: #fde68a; }
:root[data-theme=dark] .btn-primary { color: #160b2e; }
:root[data-theme=dark] .btn-danger { border-color: #6b2525; }
:root[data-theme=dark] .btn-ghost:hover { background: rgba(255,255,255,.06); }
:root[data-theme=dark] .chip.active { background: var(--primary); border-color: var(--primary); color: #160b2e; }
:root[data-theme=dark] .chip:hover { border-color: var(--line-2); }
:root[data-theme=dark] .st-PU { background: #33290a; color: #fde68a; }
:root[data-theme=dark] .st-A { background: #3a1717; color: #fca5a5; }
:root[data-theme=dark] .ann.pinned { border-color: #5c4513; background: linear-gradient(180deg, #2a2210, var(--card) 60%); }
:root[data-theme=dark] .avatar { box-shadow: 0 0 0 2px var(--card), 0 1px 4px rgba(0,0,0,.4); }
:root[data-theme=dark] .skip-link { background: var(--card); }
:root[data-theme=dark] .sig-pad canvas, :root[data-theme=dark] img.sig { background: #fff; border-radius: 8px; }
:root[data-theme=dark] .pagination a.active, :root[data-theme=dark] .view-toggle a.active { color: #160b2e; }
:root[data-theme=dark] .month-pill.none { color: var(--muted); }
:root[data-theme=dark] .hero { background: radial-gradient(800px 300px at 100% 0%, rgba(122,63,198,.45), transparent 60%), linear-gradient(120deg, #241046, #4c1d95 60%, #86198f); }
:root[data-theme=dark] input[type=color] { background: var(--card); }
:root[data-theme=dark] ::placeholder { color: #6b7390; }
:root[data-theme=dark] .eos-html { background: #fff; color: #0f172a; --ink: #0f172a; --line-2: #d5dbe6; --primary-50: #eef2ff; }
.filters input[type=month], .filters input[type=date], .filters input[type=number] { width: auto; flex: 0 1 190px; }
.grid.align-start { align-items: start; }
.set-table td:nth-child(2) { min-width: 190px; }
.set-table .small { white-space: nowrap; }
