
/* ---- tokens.css ---- */
:root {
  /* ---- Brand: SSS blue (sourced from the official mark) ---- */
  --sss-blue-900: #0d2c5e;
  --sss-blue-800: #123670;
  --sss-blue-700: #163f83;
  --sss-blue-600: #1a4a9c;
  --sss-blue-500: #2456a8;
  --sss-blue-400: #3d6bc0;
  --sss-blue-300: #7797d6;
  --sss-blue-200: #b6c9e9;
  --sss-blue-100: #e3eaf7;
  --sss-blue-50: #f3f6fc;

  /* ---- Brand accent: SSS red (public-site accent) ---- */
  --sss-red-700: #8f0f22;
  --sss-red-600: #ab1329;
  --sss-red-500: #c8102e;
  --sss-red-400: #dc3a4f;
  --sss-red-100: #fbe4e7;

  /* ---- Neutrals ---- */
  --gray-950: #0b1220;
  --gray-900: #12192b;
  --gray-800: #1e2839;
  --gray-700: #2f3b52;
  --gray-600: #4a5875;
  --gray-500: #6b7793;
  --gray-400: #98a2b8;
  --gray-300: #c4cbd9;
  --gray-200: #e1e5ee;
  --gray-100: #eef1f7;
  --gray-50: #f7f9fc;
  --white: #ffffff;

  /* ---- Semantic ---- */
  --color-success-600: #157347;
  --color-success-500: #1f9d5f;
  --color-success-100: #e2f6ec;
  --color-warning-600: #a15c00;
  --color-warning-500: #c97f0a;
  --color-warning-100: #fdf1de;
  --color-danger-600: var(--sss-red-600);
  --color-danger-500: var(--sss-red-500);
  --color-danger-100: var(--sss-red-100);
  --color-info-600: var(--sss-blue-700);
  --color-info-500: var(--sss-blue-500);
  --color-info-100: var(--sss-blue-100);

  /* ---- Surface / text roles ---- */
  --bg-app: var(--gray-50);
  --bg-surface: var(--white);
  --bg-surface-alt: var(--gray-50);
  --bg-sidebar: var(--sss-blue-900);
  --bg-sidebar-hover: var(--sss-blue-800);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --text-on-brand: var(--white);
  --border-default: var(--gray-200);
  --border-strong: var(--gray-300);
  --focus-ring: var(--sss-blue-400);

  /* ---- Type ---- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;

  /* ---- Spacing scale ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ---- Radius / shadow ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.06);

  --sidebar-width: 264px;
  --topbar-height: 64px;

  /* ---- Chart categorical palette (validated: fixed order, never cycled) ---- */
  --chart-1-blue: #2456a8;
  --chart-2-aqua: #1baf7a;
  --chart-3-yellow: #eda100;
  --chart-4-green: #008300;
  --chart-5-violet: #4a3aa7;
  --chart-6-red: #c8102e;
  --chart-7-magenta: #e87ba4;
  --chart-8-orange: #eb6834;
  --chart-grid: #e1e0d9;
  --chart-axis: #c3c2b7;
  --chart-ink-muted: #898781;
}

/* ---- base.css ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-app);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#root { min-height: 100%; }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
::selection { background: var(--sss-blue-200); }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- layout.css ---- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-sidebar);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar__brand-title { font-weight: 700; font-size: 14px; color: var(--white); }
.sidebar__brand-sub { font-size: 11px; color: var(--sss-blue-200); letter-spacing: 0.03em; }

.sidebar__nav { flex: 1; padding: var(--space-4) var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); }
.sidebar__section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sss-blue-300);
  padding: var(--space-4) var(--space-3) var(--space-2);
}
.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--sss-blue-100);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
}
.sidebar__link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.sidebar__link:hover { background: var(--bg-sidebar-hover); color: var(--white); }
.sidebar__link.is-active { background: var(--white); color: var(--sss-blue-800); font-weight: 600; }
.sidebar__link.is-active svg { opacity: 1; }
.sidebar__link .badge-dot { margin-left: auto; }

.sidebar__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  color: var(--sss-blue-300);
}

/* ---- Topbar ---- */
.topbar {
  grid-area: topbar;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar__title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.topbar__subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.topbar__right { display: flex; align-items: center; gap: var(--space-4); }
.topbar__env-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: var(--radius-full); background: var(--color-warning-100); color: var(--color-warning-600);
}
.topbar__user {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 4px 8px 4px 4px; border-radius: var(--radius-full);
  cursor: pointer; border: 1px solid transparent;
}
.topbar__user:hover { background: var(--gray-50); border-color: var(--border-default); }
.topbar__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--sss-blue-600); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

/* ---- Main content ---- */
.main {
  grid-area: main;
  padding: var(--space-6);
  max-width: 1400px;
  width: 100%;
}
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-6); gap: var(--space-4); flex-wrap: wrap; }
.page-header__title { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.page-header__desc { font-size: 13px; color: var(--text-secondary); margin-top: 4px; max-width: 640px; }
.page-header__actions { display: flex; gap: var(--space-3); }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 76px 1fr; }
  .sidebar__brand-text, .sidebar__section-label, .sidebar__link span, .sidebar__footer { display: none; }
  .sidebar__link { justify-content: center; }
}

/* ---- components.css ---- */
/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer; transition: all 0.12s ease; white-space: nowrap;
  line-height: 1.2;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--sss-blue-600); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--sss-blue-700); }
.btn-secondary { background: var(--white); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-50); }
.btn-danger { background: var(--color-danger-500); color: var(--white); }
.btn-danger:hover:not(:disabled) { background: var(--color-danger-600); }
.btn-success { background: var(--color-success-500); color: var(--white); }
.btn-success:hover:not(:disabled) { background: var(--color-success-600); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); color: var(--text-primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; }
.btn-block { width: 100%; }

/* ================= Card ================= */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card__header { padding: var(--space-5) var(--space-5) var(--space-4); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.card__title { font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.card__desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card__body { padding: 0 var(--space-5) var(--space-5); }
.card__body--flush { padding: 0; }

/* ================= Badge ================= */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-full);
  letter-spacing: 0.01em; line-height: 1.6;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.badge-success { background: var(--color-success-100); color: var(--color-success-600); }
.badge-success .badge-dot { background: var(--color-success-500); }
.badge-warning { background: var(--color-warning-100); color: var(--color-warning-600); }
.badge-warning .badge-dot { background: var(--color-warning-500); }
.badge-danger { background: var(--color-danger-100); color: var(--color-danger-600); }
.badge-danger .badge-dot { background: var(--color-danger-500); }
.badge-info { background: var(--color-info-100); color: var(--color-info-600); }
.badge-info .badge-dot { background: var(--color-info-500); }
.badge-neutral { background: var(--gray-100); color: var(--gray-600); }
.badge-neutral .badge-dot { background: var(--gray-500); }

/* ================= Stat card ================= */
.stat-card {
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-2); box-shadow: var(--shadow-sm);
}
.stat-card__top { display: flex; align-items: center; justify-content: space-between; }
.stat-card__label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card__icon { width: 32px; height: 32px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.stat-card__icon svg { width: 17px; height: 17px; }
.stat-card__value { font-size: 26px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.stat-card__delta { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.stat-card__delta.up { color: var(--color-success-600); }
.stat-card__delta.down { color: var(--color-danger-600); }
.stat-card__delta.flat { color: var(--text-muted); }

/* ================= Table ================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); padding: 10px 16px; border-bottom: 1px solid var(--border-default);
  background: var(--gray-50); white-space: nowrap; position: sticky; top: 0;
}
.table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border-default); vertical-align: middle; color: var(--text-primary); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--sss-blue-50); }
.table tbody tr.is-clickable { cursor: pointer; }
.table .cell-muted { color: var(--text-muted); }
.table .cell-mono { font-family: var(--font-mono); font-size: 12px; }

/* ================= Inputs ================= */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.input, .select {
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  padding: 9px 12px; font-size: 13px; background: var(--white); color: var(--text-primary);
  width: 100%;
}
.input:focus, .select:focus { border-color: var(--sss-blue-400); box-shadow: 0 0 0 3px var(--sss-blue-100); }
.input-search-wrap { position: relative; }
.input-search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-muted); }
.input-search-wrap .input { padding-left: 36px; }

/* ================= Tabs ================= */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border-default); }
.tab {
  padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--text-muted);
  border: none; background: transparent; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text-primary); }
.tab.is-active { color: var(--sss-blue-600); border-bottom-color: var(--sss-blue-600); }

/* ================= Progress steps ================= */
.steps { display: flex; align-items: center; gap: 0; }
.step { display: flex; align-items: center; gap: var(--space-2); flex: 1; }
.step__circle {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; border: 2px solid var(--border-strong); color: var(--text-muted); background: var(--white); flex-shrink: 0;
}
.step.is-done .step__circle { background: var(--color-success-500); border-color: var(--color-success-500); color: var(--white); }
.step.is-active .step__circle { background: var(--sss-blue-600); border-color: var(--sss-blue-600); color: var(--white); }
.step__label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.step.is-active .step__label, .step.is-done .step__label { color: var(--text-primary); }
.step__connector { flex: 1; height: 2px; background: var(--border-strong); margin: 0 4px; }
.step__connector.is-done { background: var(--color-success-500); }

/* ================= JSON viewer ================= */
.json-viewer {
  font-family: var(--font-mono); font-size: 12px; background: var(--gray-950); color: #d5deee;
  border-radius: var(--radius-md); padding: var(--space-4); overflow-x: auto; line-height: 1.6;
}
.json-viewer .k { color: #7db4ff; }
.json-viewer .s { color: #9ee6a8; }
.json-viewer .n { color: #ffb86b; }
.json-viewer .b { color: #ff8fb3; }

/* ================= Drawer / Modal ================= */
.overlay { position: fixed; inset: 0; background: rgba(11, 18, 32, 0.5); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 480px; max-width: 92vw;
  background: var(--bg-surface); box-shadow: var(--shadow-lg); z-index: 50;
  display: flex; flex-direction: column;
}
.drawer__header { padding: var(--space-5); border-bottom: 1px solid var(--border-default); display: flex; align-items: center; justify-content: space-between; }
.drawer__title { font-size: 15px; font-weight: 700; }
.drawer__body { padding: var(--space-5); overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: var(--space-5); }
.drawer__close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: var(--radius-sm); }
.drawer__close:hover { background: var(--gray-100); color: var(--text-primary); }

.modal-center { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.modal { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 440px; max-width: 100%; }

/* ================= Kv list ================= */
.kv-list { display: flex; flex-direction: column; gap: 0; }
.kv-row { display: flex; justify-content: space-between; gap: var(--space-4); padding: 9px 0; border-bottom: 1px dashed var(--border-default); font-size: 13px; }
.kv-row:last-child { border-bottom: none; }
.kv-row__label { color: var(--text-muted); }
.kv-row__value { color: var(--text-primary); font-weight: 600; text-align: right; }

/* ================= Alert / banner ================= */
.alert { display: flex; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); border: 1px solid; font-size: 13px; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-info { background: var(--sss-blue-50); border-color: var(--sss-blue-200); color: var(--sss-blue-800); }
.alert-warning { background: var(--color-warning-100); border-color: #f0d19a; color: var(--color-warning-600); }
.alert-danger { background: var(--color-danger-100); border-color: #f0b8c1; color: var(--color-danger-600); }
.alert-success { background: var(--color-success-100); border-color: #a9e0c1; color: var(--color-success-600); }
.alert__title { font-weight: 700; margin-bottom: 2px; }

/* ================= Toast ================= */
.toast-stack { position: fixed; bottom: var(--space-5); right: var(--space-5); z-index: 60; display: flex; flex-direction: column; gap: var(--space-2); }
.toast {
  background: var(--gray-900); color: var(--white); padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 13px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; min-width: 260px;
}

/* ================= Empty state ================= */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--space-12) var(--space-6); color: var(--text-muted); }
.empty-state svg { width: 40px; height: 40px; margin-bottom: var(--space-3); opacity: 0.5; }
.empty-state__title { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.empty-state__desc { font-size: 12.5px; margin-top: 4px; max-width: 320px; }

/* ================= Skeleton / loading ================= */
.skeleton { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 37%, var(--gray-100) 63%); background-size: 400% 100%; animation: skeleton 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.35); border-top-color: var(--white); border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner-dark { border: 2px solid var(--gray-200); border-top-color: var(--sss-blue-600); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= Misc utility ================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.flex-row { display: flex; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); } .gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); }
.text-muted { color: var(--text-muted); } .text-secondary { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }
.divider { height: 1px; background: var(--border-default); border: none; margin: var(--space-4) 0; }

/* ---- pages.css ---- */
/* ================= Login page ================= */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
}
.login-page__brand {
  background: linear-gradient(155deg, var(--sss-blue-800) 0%, var(--sss-blue-900) 60%, var(--gray-950) 100%);
  color: var(--white); display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--space-12);
}
.login-page__brand-top { display: flex; align-items: center; gap: var(--space-3); }
.login-page__headline { font-size: 32px; font-weight: 800; line-height: 1.25; max-width: 460px; }
.login-page__sub { font-size: 14px; color: var(--sss-blue-200); margin-top: var(--space-4); max-width: 420px; line-height: 1.6; }
.login-page__stats { display: flex; gap: var(--space-8); }
.login-page__stat-value { font-size: 24px; font-weight: 800; }
.login-page__stat-label { font-size: 11.5px; color: var(--sss-blue-300); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.login-page__form-side { display: flex; align-items: center; justify-content: center; padding: var(--space-6); background: var(--bg-app); }
.login-card { width: 100%; max-width: 380px; }
.login-card__title { font-size: 20px; font-weight: 800; }
.login-card__sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; margin-bottom: var(--space-6); }
.role-option {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md); cursor: pointer; margin-bottom: var(--space-2);
  transition: all 0.12s ease;
}
.role-option:hover { border-color: var(--sss-blue-400); background: var(--sss-blue-50); }
.role-option.is-selected { border-color: var(--sss-blue-600); background: var(--sss-blue-50); box-shadow: 0 0 0 3px var(--sss-blue-100); }
.role-option__icon { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--sss-blue-100); color: var(--sss-blue-700); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.role-option__name { font-size: 13.5px; font-weight: 700; }
.role-option__desc { font-size: 11.5px; color: var(--text-muted); }
@media (max-width: 860px) { .login-page { grid-template-columns: 1fr; } .login-page__brand { display: none; } }

/* ================= Verification workspace ================= */
.channel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
@media (max-width: 900px) { .channel-grid { grid-template-columns: repeat(2, 1fr); } }
.channel-card {
  border: 1.5px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-5);
  cursor: pointer; text-align: left; background: var(--white); transition: all 0.12s ease;
  display: flex; flex-direction: column; gap: var(--space-3);
}
.channel-card:hover { border-color: var(--sss-blue-300); box-shadow: var(--shadow-md); }
.channel-card.is-selected { border-color: var(--sss-blue-600); background: var(--sss-blue-50); box-shadow: 0 0 0 3px var(--sss-blue-100); }
.channel-card__icon { width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--sss-blue-100); color: var(--sss-blue-700); display: flex; align-items: center; justify-content: center; }
.channel-card__name { font-size: 14px; font-weight: 700; }
.channel-card__desc { font-size: 12px; color: var(--text-muted); }

.capture-stage {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  background: var(--gray-950); position: relative; overflow: hidden; max-width: 420px;
}
.capture-stage video, .capture-stage img { width: 100%; height: 100%; object-fit: cover; }
.capture-stage__placeholder { color: var(--gray-400); display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.capture-stage__placeholder svg { width: 44px; height: 44px; opacity: 0.6; }
.capture-stage__scanline {
  position: absolute; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, #4dd6ff, transparent);
  box-shadow: 0 0 12px 2px #4dd6ff; animation: scan 1.6s ease-in-out infinite;
}
@keyframes scan { 0% { top: 4%; } 50% { top: 94%; } 100% { top: 4%; } }
.capture-stage__frame {
  position: absolute; inset: 12%; border: 2px solid rgba(255,255,255,0.5); border-radius: var(--radius-md);
}
.capture-stage__badge { position: absolute; top: 10px; left: 10px; }
.capture-stage__action { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); }

.fp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); max-width: 420px; }
.fp-slot {
  border: 1.5px solid var(--border-default); border-radius: var(--radius-md); padding: var(--space-4);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center;
}
.fp-slot__icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--gray-100); color: var(--gray-400); }
.fp-slot.has-data .fp-slot__icon { background: var(--sss-blue-100); color: var(--sss-blue-600); }
.fp-slot.is-capturing .fp-slot__icon { background: var(--color-warning-100); color: var(--color-warning-600); }
.fp-slot__label { font-size: 12px; font-weight: 700; }
.fp-slot__meta { font-size: 11px; color: var(--text-muted); }

.routing-flow { display: flex; align-items: stretch; gap: var(--space-3); }
.routing-node {
  flex: 1; border: 1.5px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2); position: relative; background: var(--white);
}
.routing-node.is-active { border-color: var(--sss-blue-500); box-shadow: 0 0 0 3px var(--sss-blue-100); }
.routing-node.is-taken { border-color: var(--color-success-500); background: var(--color-success-100); }
.routing-node.is-skipped { opacity: 0.45; }
.routing-arrow { display: flex; align-items: center; color: var(--text-muted); }

.result-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-8) var(--space-4);
}
.result-hero__icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.result-hero__icon.success { background: var(--color-success-100); color: var(--color-success-600); }
.result-hero__icon.danger { background: var(--color-danger-100); color: var(--color-danger-600); }
.result-hero__icon.review { background: var(--color-warning-100); color: var(--color-warning-600); }
.result-hero__icon svg { width: 36px; height: 36px; }
.result-hero__title { font-size: 20px; font-weight: 800; }
.result-hero__sub { font-size: 13px; color: var(--text-muted); max-width: 420px; }
.confidence-bar { width: 100%; max-width: 320px; height: 8px; border-radius: var(--radius-full); background: var(--gray-200); overflow: hidden; }
.confidence-bar__fill { height: 100%; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--sss-blue-500), var(--color-success-500)); }

/* ================= Analytics ================= */
.chart-card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

/* ================= System health ================= */
.health-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
@media (max-width: 900px) { .health-grid { grid-template-columns: 1fr; } }
.service-row { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) 0; border-bottom: 1px solid var(--border-default); }
.service-row:last-child { border-bottom: none; }
.service-row__name { font-size: 13px; font-weight: 600; }
.service-row__meta { font-size: 11.5px; color: var(--text-muted); }
.uptime-bars { display: flex; gap: 2px; align-items: flex-end; height: 24px; }
.uptime-bar { width: 5px; border-radius: 2px; background: var(--color-success-500); }
.uptime-bar.degraded { background: var(--color-warning-500); }
.uptime-bar.down { background: var(--color-danger-500); }

.deploy-toggle { display: flex; border: 1.5px solid var(--border-strong); border-radius: var(--radius-full); padding: 3px; width: fit-content; }
.deploy-toggle button { border: none; background: transparent; padding: 7px 16px; border-radius: var(--radius-full); font-size: 12.5px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.deploy-toggle button.is-active { background: var(--sss-blue-600); color: var(--white); }

/* ================= Member lookup ================= */
.member-summary { display: grid; grid-template-columns: 120px 1fr; gap: var(--space-5); }
.member-photo { width: 120px; height: 149px; border-radius: var(--radius-md); background: var(--gray-200); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--gray-400); }
.file-chip { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md); font-size: 12.5px; }
.file-chip__icon { width: 30px; height: 30px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ================= Security page ================= */
.compliance-item { display: flex; gap: var(--space-3); padding: var(--space-4) 0; border-bottom: 1px solid var(--border-default); }
.compliance-item:last-child { border-bottom: none; }
.compliance-item__icon { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--color-success-100); color: var(--color-success-600); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ================= Review queue ================= */
.review-card { border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-4); display: flex; gap: var(--space-4); align-items: flex-start; }
.review-card__thumb { width: 56px; height: 56px; border-radius: var(--radius-md); background: var(--gray-200); flex-shrink: 0; }
