/* ================================================================
   Apofis Intelligence Center — Design System
   GlobalEye + FlowCore
   ================================================================ */

:root {
  /* Brand */
  --brand-primary:   #4F8EF7;
  --brand-glow:      rgba(79,142,247,.18);

  /* Sidebar */
  --sidebar-bg:      #0B1222;
  --sidebar-border:  rgba(255,255,255,.07);
  --sidebar-text:    #8A93A8;
  --sidebar-active:  #FFFFFF;
  --sidebar-hover:   rgba(255,255,255,.06);
  --sidebar-section: #4A5568;

  /* Content */
  --bg-base:         #F0F3F8;
  --bg-card:         #FFFFFF;
  --bg-card-hover:   #F8FAFF;
  --bg-subtle:       #EEF1F7;

  /* Text */
  --text-primary:    #0F1623;
  --text-secondary:  #4A5568;
  --text-muted:      #8A93A8;

  /* Borders */
  --border:          #E2E8F0;
  --border-strong:   #CBD5E1;

  /* Severity */
  --crit:   #EF4444;
  --high:   #F97316;
  --med:    #EAB308;
  --low:    #3B82F6;
  --info:   #8B5CF6;

  --crit-bg: rgba(239,68,68,.08);
  --high-bg: rgba(249,115,22,.08);
  --med-bg:  rgba(234,179,8,.08);
  --low-bg:  rgba(59,130,246,.08);
  --info-bg: rgba(139,92,246,.08);

  /* Status */
  --green:  #10B981;
  --red:    #EF4444;
  --yellow: #F59E0B;

  /* Layout */
  --sidebar-w:  240px;
  --topbar-h:   56px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.14);

  /* Transition */
  --t: 160ms cubic-bezier(.4,0,.2,1);
}

/* ── Reset ─────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; height: 100%; }
body { font-family: -apple-system,BlinkMacSystemFont,'Inter','Segoe UI',sans-serif; background: var(--bg-base); color: var(--text-primary); height: 100%; overflow: hidden; display: flex; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input,select,textarea { font: inherit; }
ul,ol { list-style: none; }

/* ── Layout ─────────────────────────────────────────────────── */
.layout { display: flex; height: 100vh; width: 100vw; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--sidebar-border);
}
.brand-icon { width: 32px; height: 32px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: -.2px; }
.brand-sub  { font-size: 10px; color: var(--sidebar-section); text-transform: uppercase; letter-spacing: .6px; margin-top: 1px; }

/* Workspace selector */
.ws-selector {
  margin: 12px 12px 4px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  transition: background var(--t);
  color: #fff;
}
.ws-selector:hover { background: rgba(255,255,255,.08); }
.ws-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-plan { font-size: 10px; color: var(--brand-primary); background: var(--brand-glow); padding: 1px 6px; border-radius: 99px; }
.ws-chevron { color: var(--sidebar-section); font-size: 10px; }

/* Nav sections */
.nav-section { margin-top: 8px; }
.nav-section-label {
  font-size: 10px; font-weight: 600; color: var(--sidebar-section);
  text-transform: uppercase; letter-spacing: .7px;
  padding: 6px 16px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 16px;
  color: var(--sidebar-text);
  font-size: 13px; font-weight: 500;
  border-radius: 0;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  position: relative;
  margin: 1px 6px;
  border-radius: var(--r-sm);
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: rgba(79,142,247,.18); color: var(--brand-primary); }
.nav-item.active .nav-icon { color: var(--brand-primary); }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { opacity: 1; }
.nav-lock { margin-left: auto; font-size: 10px; opacity: .5; }
.nav-badge { margin-left: auto; font-size: 10px; font-weight: 700; background: var(--crit); color: #fff; border-radius: 99px; padding: 0 6px; min-width: 18px; text-align: center; }

/* Exposure card in sidebar */
.sidebar-exposure {
  margin: 12px 10px;
  padding: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--r-md);
}
.exposure-label { font-size: 10px; color: var(--sidebar-section); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.exposure-score-row { display: flex; align-items: baseline; gap: 4px; }
.exposure-score-num { font-size: 24px; font-weight: 800; color: #fff; }
.exposure-score-max { font-size: 11px; color: var(--sidebar-section); }
.exposure-bar-wrap { margin-top: 8px; height: 4px; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden; }
.exposure-bar { height: 100%; border-radius: 99px; transition: width .6s ease; }

/* User chip */
.sidebar-user {
  margin-top: auto;
  padding: 12px 12px;
  border-top: 1px solid var(--sidebar-border);
  display: flex; align-items: center; gap: 8px;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-name  { font-size: 12px; font-weight: 600; color: #fff; }
.user-role  { font-size: 10px; color: var(--sidebar-section); }
.user-status { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

/* ── Main ─────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h); min-height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  z-index: 10;
}
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.breadcrumb-item { color: var(--text-muted); }
.breadcrumb-sep  { color: var(--border-strong); }
.breadcrumb-current { color: var(--text-primary); font-weight: 600; }

.topbar-search {
  flex: 1; max-width: 360px; margin-left: 16px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 10px; height: 32px;
  cursor: text;
  transition: border-color var(--t);
}
.topbar-search:hover { border-color: var(--brand-primary); }
.search-icon { color: var(--text-muted); font-size: 13px; }
.search-placeholder { font-size: 12px; color: var(--text-muted); flex: 1; }
.search-kbd { font-size: 10px; color: var(--text-muted); background: var(--border); padding: 1px 5px; border-radius: 4px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.scan-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--green);
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.2);
  border-radius: 99px; padding: 3px 10px;
}
.scan-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }

.topbar-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  font-size: 15px;
  transition: background var(--t), border-color var(--t);
  position: relative;
}
.topbar-btn:hover { background: var(--bg-subtle); border-color: var(--border); }
.notif-dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; background: var(--crit); border-radius: 50%; border: 2px solid var(--bg-card); }

.topbar-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-primary); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; cursor: pointer; }

/* ── Content ─────────────────────────────────────────────────── */
.content { flex: 1; overflow-y: auto; padding: 20px 24px; }
.view { display: none; }
.view.active { display: block; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-size: 18px; font-weight: 700; }
.page-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card-title { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; }

/* ── Stat grid ─────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 28px; font-weight: 800; margin-top: 6px; line-height: 1; }
.stat-delta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.stat-delta.up { color: var(--red); }
.stat-delta.down { color: var(--green); }

/* ── Overview top row ──────────────────────────────────────── */
.overview-top { display: grid; grid-template-columns: 260px 1fr; gap: 16px; margin-bottom: 20px; }

/* Exposure gauge */
.gauge-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px 18px;
  display: flex; flex-direction: column; align-items: center;
  box-shadow: var(--shadow-sm);
}
.gauge-title { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; align-self: flex-start; }
.gauge-svg { width: 160px; height: 100px; }
.gauge-score-label { font-size: 28px; font-weight: 800; }
.gauge-rating-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.gauge-sub { font-size: 11px; color: var(--text-muted); margin-top: 10px; }

/* ── Overview bottom grid ─────────────────────────────────── */
.overview-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Table ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
table { width: 100%; border-collapse: collapse; }
thead th {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
  padding: 10px 14px; text-align: left;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }
tbody td { padding: 11px 14px; font-size: 13px; vertical-align: middle; }
.table-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px;
  white-space: nowrap;
}
.badge-crit  { background: var(--crit-bg);  color: var(--crit);  }
.badge-high  { background: var(--high-bg);  color: var(--high);  }
.badge-med   { background: var(--med-bg);   color: var(--med);   }
.badge-low   { background: var(--low-bg);   color: var(--low);   }
.badge-info  { background: var(--info-bg);  color: var(--info);  }
.badge-open  { background: var(--low-bg);   color: var(--low);   }
.badge-ack   { background: var(--med-bg);   color: var(--med);   }
.badge-res   { background: rgba(16,185,129,.08); color: var(--green); }
.badge-verified { background: rgba(16,185,129,.08); color: var(--green); }
.badge-pending  { background: var(--med-bg); color: var(--med); }
.badge-queued   { background: var(--info-bg); color: var(--info); }
.badge-running  { background: rgba(16,185,129,.08); color: var(--green); }
.badge-done     { background: var(--low-bg);  color: var(--low); }
.badge-failed   { background: var(--crit-bg); color: var(--crit); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: background var(--t), color var(--t), border-color var(--t), box-shadow var(--t);
  cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: #3a7de0; box-shadow: 0 2px 8px rgba(79,142,247,.4); }
.btn-secondary { background: var(--bg-card); color: var(--text-secondary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--border-strong); }
.btn-danger { background: var(--crit-bg); color: var(--crit); border-color: rgba(239,68,68,.2); }
.btn-danger:hover { background: rgba(239,68,68,.14); }
.btn-sm { font-size: 11px; padding: 4px 10px; }
.btn-icon { padding: 7px; }

/* ── Findings feed ─────────────────────────────────────────── */
.findings-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.sev-tabs { display: flex; gap: 4px; }
.sev-tab {
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-muted);
  cursor: pointer; transition: all var(--t);
}
.sev-tab.active { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--brand-glow); }
.sev-tab[data-sev="critical"].active { border-color: var(--crit); color: var(--crit); background: var(--crit-bg); }
.sev-tab[data-sev="high"].active    { border-color: var(--high); color: var(--high); background: var(--high-bg); }
.sev-tab[data-sev="medium"].active  { border-color: var(--med);  color: var(--med);  background: var(--med-bg);  }
.sev-tab[data-sev="low"].active     { border-color: var(--low);  color: var(--low);  background: var(--low-bg);  }
.sev-tab[data-sev="info"].active    { border-color: var(--info); color: var(--info); background: var(--info-bg); }

.finding-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t); cursor: pointer;
}
.finding-item:last-child { border-bottom: none; }
.finding-item:hover { background: var(--bg-card-hover); }
.finding-sev-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.finding-sev-dot.critical { background: var(--crit); box-shadow: 0 0 6px var(--crit); }
.finding-sev-dot.high     { background: var(--high); }
.finding-sev-dot.medium   { background: var(--med); }
.finding-sev-dot.low      { background: var(--low); }
.finding-sev-dot.info     { background: var(--info); }
.finding-body { flex: 1; min-width: 0; }
.finding-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.finding-meta  { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.finding-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Verify stepper ─────────────────────────────────────────── */
.verify-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.stepper { display: flex; align-items: center; margin-bottom: 24px; }
.step-item { display: flex; align-items: center; gap: 8px; flex: 1; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  background: var(--bg-subtle); color: var(--text-muted);
  border: 2px solid var(--border);
  transition: all var(--t);
}
.step-item.active .step-num { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.step-item.done .step-num   { background: var(--green); color: #fff; border-color: var(--green); }
.step-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.step-item.active .step-label { color: var(--brand-primary); }
.step-item.done  .step-label  { color: var(--green); }
.step-line { flex: 1; height: 1px; background: var(--border); margin: 0 8px; }
.step-item.done ~ .step-line { background: var(--green); }

.verify-panel { padding: 20px; }
.method-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.method-card {
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.method-card:hover { border-color: var(--brand-primary); background: var(--brand-glow); }
.method-card.selected { border-color: var(--brand-primary); background: var(--brand-glow); }
.method-icon { font-size: 20px; margin-bottom: 8px; }
.method-name { font-size: 13px; font-weight: 700; }
.method-desc { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.code-block {
  background: var(--sidebar-bg);
  color: #A8D0FF;
  font-family: 'SF Mono','Fira Code',monospace;
  font-size: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  margin: 12px 0;
  overflow-x: auto;
  white-space: pre;
  border: 1px solid rgba(255,255,255,.1);
}
.copy-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.copy-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }

.verify-info-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.verify-info-title { font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.verify-info-item { display: flex; gap: 8px; margin-bottom: 10px; font-size: 12px; }
.verify-info-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--brand-primary); }

/* ── Scan UI ─────────────────────────────────────────────────── */
.scan-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.scan-type-card {
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.scan-type-card:hover { border-color: var(--brand-primary); }
.scan-type-card.selected { border-color: var(--brand-primary); background: var(--brand-glow); }
.scan-type-icon { font-size: 20px; margin-bottom: 8px; }
.scan-type-name { font-size: 13px; font-weight: 700; }
.scan-type-desc { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.progress-bar-wrap { height: 6px; background: var(--bg-subtle); border-radius: 99px; overflow: hidden; margin: 12px 0; }
.progress-bar { height: 100%; border-radius: 99px; background: var(--brand-primary); transition: width .4s ease; }

.verified-gate {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.gate-icon { font-size: 48px; margin-bottom: 16px; }
.gate-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.gate-sub   { font-size: 13px; color: var(--text-muted); max-width: 360px; line-height: 1.5; margin-bottom: 20px; }

/* ── FlowCore load test ────────────────────────────────────── */
.flow-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.form-input {
  padding: 8px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 13px; color: var(--text-primary);
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
}
.form-input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-glow); }
.form-hint { font-size: 11px; color: var(--text-muted); }

.region-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.region-chip {
  padding: 4px 12px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg-card);
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all var(--t); color: var(--text-secondary);
}
.region-chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.region-chip.selected { background: var(--brand-glow); border-color: var(--brand-primary); color: var(--brand-primary); }

.flow-metric-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-top: 16px; }
.flow-metric { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; text-align: center; }
.flow-metric-val { font-size: 22px; font-weight: 800; font-family: 'SF Mono',monospace; }
.flow-metric-key { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }

/* RPS chart placeholder */
.rps-chart { height: 140px; background: var(--bg-subtle); border-radius: var(--r-md); margin-top: 16px; display: flex; align-items: flex-end; padding: 0 4px 4px; gap: 2px; overflow: hidden; }
.rps-bar { flex: 1; border-radius: 3px 3px 0 0; background: var(--brand-primary); opacity: .7; transition: height .3s ease; min-height: 2px; }

/* ── Certificates ────────────────────────────────────────────── */
.cert-expiry-bar { height: 4px; border-radius: 99px; margin-top: 6px; }

/* ── Settings ────────────────────────────────────────────────── */
.settings-layout { display: grid; grid-template-columns: 180px 1fr; gap: 20px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item { padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-secondary); transition: background var(--t); }
.settings-nav-item:hover { background: var(--bg-subtle); }
.settings-nav-item.active { background: var(--brand-glow); color: var(--brand-primary); font-weight: 600; }
.settings-section { display: none; }
.settings-section.active { display: block; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 13px; font-weight: 600; }
.settings-row-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Toggle */
.toggle { position: relative; width: 36px; height: 20px; cursor: pointer; }
.toggle input { display: none; }
.toggle-track { position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong); transition: background var(--t); }
.toggle input:checked + .toggle-track { background: var(--brand-primary); }
.toggle-thumb { position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--t); }
.toggle input:checked ~ .toggle-thumb { transform: translateX(16px); }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 480px; max-width: 96vw;
  padding: 24px;
  transform: translateY(16px);
  transition: transform var(--t);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close { width: 28px; height: 28px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: background var(--t); }
.modal-close:hover { background: var(--bg-subtle); color: var(--text-primary); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.type-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.type-tab { padding: 4px 10px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--bg-subtle); font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all var(--t); }
.type-tab.active { background: var(--brand-glow); border-color: var(--brand-primary); color: var(--brand-primary); }

/* ── Command palette ─────────────────────────────────────────── */
.cmdk-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); backdrop-filter: blur(3px); z-index: 200; opacity: 0; pointer-events: none; transition: opacity var(--t); display: flex; align-items: flex-start; justify-content: center; padding-top: 100px; }
.cmdk-overlay.open { opacity: 1; pointer-events: all; }
.cmdk {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 560px; max-width: 94vw;
  overflow: hidden;
  transform: translateY(-12px);
  transition: transform var(--t);
}
.cmdk-overlay.open .cmdk { transform: translateY(0); }
.cmdk-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cmdk-search-icon { color: var(--text-muted); font-size: 14px; }
.cmdk-input { flex: 1; border: none; background: none; outline: none; font-size: 14px; font-weight: 500; color: var(--text-primary); }
.cmdk-list { max-height: 320px; overflow-y: auto; padding: 8px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; transition: background var(--t); }
.cmdk-item:hover, .cmdk-item.highlighted { background: var(--brand-glow); }
.cmdk-item-icon { width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--bg-subtle); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.cmdk-item-name { font-size: 13px; font-weight: 600; }
.cmdk-item-sub  { font-size: 11px; color: var(--text-muted); }
.cmdk-group-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px 4px; }
.cmdk-footer { padding: 8px 14px; border-top: 1px solid var(--border); display: flex; gap: 16px; }
.cmdk-kbd-hint { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.cmdk-kbd { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; font-size: 10px; }

/* ── Mono helpers ────────────────────────────────────────────── */
.mono { font-family: 'SF Mono','Fira Code',monospace; font-size: 12px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px; color: var(--text-muted); text-align: center; }
.empty-icon  { font-size: 36px; margin-bottom: 12px; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-sub   { font-size: 12px; }

/* ── Audit notice ────────────────────────────────────────────── */
.audit-notice {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 12px; margin-top: 12px;
}
.audit-icon { color: var(--brand-primary); }

/* ── Alert popover ────────────────────────────────────────────── */
.alerts-popover {
  position: absolute; top: 44px; right: 0;
  width: 340px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  z-index: 50;
  opacity: 0; pointer-events: none; transform: translateY(4px);
  transition: opacity var(--t), transform var(--t);
}
.alerts-popover.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.alerts-header { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.alerts-list { max-height: 300px; overflow-y: auto; }
.alert-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); transition: background var(--t); cursor: pointer; }
.alert-item:hover { background: var(--bg-subtle); }
.alert-item:last-child { border-bottom: none; }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.alert-title { font-size: 12px; font-weight: 600; }
.alert-sub   { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ── Scrollbar ─────────────────────────────────────────────── */
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* ── Tooltip ─────────────────────────────────────────────────── */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: #fff;
  font-size: 11px; padding: 4px 8px; border-radius: 4px;
  white-space: nowrap; pointer-events: none;
  z-index: 999;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .overview-top { grid-template-columns: 1fr; }
  .overview-bottom { grid-template-columns: 1fr; }
  .flow-form { grid-template-columns: 1fr; }
  .verify-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
