/* ============================================================================
   Sentinel AI — Design System v2
   Language: restrained, flat, typography-first (Linear / Vercel / Stripe grade)
   One accent color. No gradients on surfaces. Precision borders. Dense but calm.
   ========================================================================== */
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;

  --bg: #0b0b0e;
  --surface: #131318;
  --surface-2: #1a1a21;
  --surface-3: #22222b;
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .13);
  --text: #ececf1;
  --text-2: #9b9ba6;
  --text-3: #63636e;

  --accent: #5e6ad2;
  --accent-hover: #6d78dd;
  --accent-soft: rgba(94, 106, 210, .13);
  --accent-border: rgba(94, 106, 210, .4);

  --crit: #eb5c5c;  --crit-bg: rgba(235, 92, 92, .1);
  --high: #e8964b;  --high-bg: rgba(232, 150, 75, .1);
  --med:  #d9b84a;  --med-bg:  rgba(217, 184, 74, .1);
  --low:  #5a9fd4;  --low-bg:  rgba(90, 159, 212, .1);
  --info: #8a8a96;  --info-bg: rgba(138, 138, 150, .1);
  --ok:   #4cb782;  --ok-bg:   rgba(76, 183, 130, .1);

  --r-sm: 6px; --r-md: 8px; --r-lg: 10px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .5);
  --sidebar-w: 224px; --topbar-h: 56px;
}
[data-theme="light"] {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f7f7f8; --surface-3: #ececed;
  --border: rgba(0, 0, 0, .08); --border-strong: rgba(0, 0, 0, .15);
  --text: #17171c; --text-2: #5c5c66; --text-3: #9a9aa4;
  --accent-soft: rgba(94, 106, 210, .09);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 13.5px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  letter-spacing: -0.006em;
}
::selection { background: rgba(94, 106, 210, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 550; letter-spacing: -0.01em; }
p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 12px; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 9px; user-select: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--accent);
  flex: none;
}
.brand-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.brand-name b { color: var(--text-2); font-weight: 600; }
.brand-tag { font-size: 10px; color: var(--text-3); letter-spacing: .02em; margin-top: 1px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 13px; border-radius: var(--r-md); border: 1px solid transparent;
  background: var(--accent); color: #fff; font-weight: 500; font-size: 13px;
  cursor: pointer; transition: background .12s, border-color .12s, color .12s;
  font-family: var(--font); white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-soft { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-soft:hover { background: var(--surface-3); }
.btn-danger { background: transparent; color: var(--crit); border-color: rgba(235, 92, 92, .35); }
.btn-danger:hover { background: var(--crit-bg); }
.btn-ok { background: var(--ok); }
.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: var(--r-sm); }
.btn-icon { width: 30px; padding: 0; }
.btn-block { width: 100%; height: 36px; }
.btn svg { flex: none; }

/* ---------- Inputs ---------- */
.input, select.input, textarea.input {
  width: 100%; height: 34px; background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text); padding: 0 11px; border-radius: var(--r-md);
  font-size: 13px; font-family: var(--font); outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 9px 11px; }
.input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(94, 106, 210, .15); }
.input::placeholder { color: var(--text-3); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2363636e' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.checkbox input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-wrap .input { padding-left: 31px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border-radius: 5px; font-size: 11px; font-weight: 500; letter-spacing: 0;
  border: 1px solid transparent; white-space: nowrap; font-family: var(--mono);
}
.badge-dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.sev-critical { color: var(--crit); background: var(--crit-bg); }
.sev-high     { color: var(--high); background: var(--high-bg); }
.sev-medium   { color: var(--med);  background: var(--med-bg); }
.sev-low      { color: var(--low);  background: var(--low-bg); }
.sev-info     { color: var(--info); background: var(--info-bg); }
.st-open          { color: var(--crit); background: var(--crit-bg); }
.st-in_review     { color: #a48fdf; background: rgba(164, 143, 223, .1); }
.st-verified      { color: var(--ok); background: var(--ok-bg); }
.st-false_positive{ color: var(--info); background: var(--info-bg); }
.st-resolved      { color: var(--ok); background: var(--ok-bg); }
.st-fix_generated { color: #5a9fd4; background: var(--low-bg); }
.st-reopened      { color: var(--high); background: var(--high-bg); }
.st-completed     { color: var(--ok); background: var(--ok-bg); }
.st-running       { color: #5a9fd4; background: var(--low-bg); }
.st-queued        { color: var(--med); background: var(--med-bg); }
.st-failed        { color: var(--crit); background: var(--crit-bg); }
.st-neutral { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }

kbd {
  font-family: var(--mono); font-size: 10px; padding: 1px 5px; border-radius: 4px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px;
}
.card-hover { transition: border-color .12s, background .12s; cursor: pointer; }
.card-hover:hover { border-color: var(--border-strong); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-size: 13px; font-weight: 550; display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.card-title svg { color: var(--text-3); }
.grid { display: grid; gap: 12px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cols-2 { grid-template-columns: 1.4fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1080px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

.kpi { padding: 14px 16px; }
.kpi .k-label { font-size: 11.5px; font-weight: 500; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 24px; font-weight: 600; margin-top: 4px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.k-crit .k-value { color: var(--crit); } .k-high .k-value { color: var(--high); }
.k-med .k-value  { color: var(--med); }  .k-low .k-value { color: var(--low); }
.k-ok .k-value   { color: var(--ok); }   .k-accent .k-value { color: var(--accent); }

/* ---------- Shell ---------- */
#shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 14px 10px;
  background: var(--bg); border-right: 1px solid var(--border);
}
.sidebar .brand { padding: 6px 8px 18px; }
.nav-section { font-size: 11px; font-weight: 500; color: var(--text-3); padding: 16px 10px 5px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 10px; border-radius: var(--r-md);
  color: var(--text-2); cursor: pointer; font-weight: 450; font-size: 13px;
  transition: background .1s, color .1s;
}
.nav-item svg { color: var(--text-3); flex: none; transition: color .1s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover svg { color: var(--text-2); }
.nav-item.active { background: var(--surface-2); color: var(--text); font-weight: 500; }
.nav-item.active svg { color: var(--accent); }
.nav-item .pill { margin-left: auto; font-size: 10.5px; font-weight: 500; padding: 0 6px; height: 17px; display: inline-flex; align-items: center; border-radius: 4px; background: var(--crit-bg); color: var(--crit); font-family: var(--mono); }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.user-card { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: var(--r-md); cursor: pointer; transition: background .1s; }
.user-card:hover { background: var(--surface-2); }
.avatar { width: 26px; height: 26px; border-radius: 6px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); font-weight: 550; font-size: 11px; flex: none; }
.user-card .u-name { font-size: 12.5px; font-weight: 500; line-height: 1.25; }
.user-card .u-mail { font-size: 11px; color: var(--text-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 14px;
  padding: 0 22px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40; background: var(--bg);
}
.topbar h1 { font-size: 13.5px; font-weight: 550; }
.topbar .crumb { font-size: 11.5px; color: var(--text-3); margin-top: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 22px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 16px; font-weight: 550; }
.page-head .sub { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }

/* ---------- Tables ---------- */
.table-card { padding: 0; overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 500; color: var(--text-3);
  padding: 9px 14px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .08s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .t-title { font-weight: 480; }
.tbl .t-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.tbl .mono-cell { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.tbl .num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Progress / meters ---------- */
.progress { height: 4px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .4s ease; }
.score-ring { position: relative; width: 84px; height: 84px; }
.score-ring .val { position: absolute; inset: 0; display: grid; place-items: center; flex-direction: column; }
.score-ring .val b { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.score-ring .val span { font-size: 9px; color: var(--text-3); }

/* ---------- Auth ---------- */
.auth {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 20px; position: relative; background: var(--bg);
}
.auth::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(700px 340px at 50% -8%, rgba(94, 106, 210, .1), transparent 70%);
}
.auth-card { position: relative; width: 100%; max-width: 360px; }
.auth-card::before {
  content: ""; position: absolute; inset: -70px -80px; border-radius: 44px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(94, 106, 210, .14), transparent 72%);
}
.auth-card > .brand { justify-content: center; margin-bottom: 26px; }
.auth-card h2 { font-size: 15px; font-weight: 550; text-align: center; }
.auth-card .auth-sub { color: var(--text-2); font-size: 12.5px; text-align: center; margin: 4px 0 20px; }
.auth-panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px; box-shadow: var(--shadow-2); }
.auth-tabs { display: flex; background: var(--surface-2); border: 1px solid var(--border); padding: 3px; border-radius: 8px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; background: none; border: none; color: var(--text-2); font-weight: 500; font-size: 12.5px; height: 28px; border-radius: 6px; cursor: pointer; font-family: var(--font); transition: .12s; }
.auth-tabs button.active { background: var(--surface-3); color: var(--text); }
.demo-note { display: flex; align-items: center; gap: 9px; margin-top: 16px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); cursor: pointer; transition: border-color .12s; }
.demo-note:hover { border-color: var(--border-strong); }
.demo-note b { color: var(--text); font-weight: 550; }
.demo-note svg { color: var(--accent); flex: none; }
.err-msg { display: flex; gap: 7px; align-items: center; color: var(--crit); background: var(--crit-bg); padding: 8px 11px; border-radius: var(--r-md); font-size: 12.5px; }
.auth-foot { margin-top: 22px; font-size: 11.5px; color: var(--text-3); display: flex; gap: 14px; }
.auth-foot span { cursor: pointer; }
.auth-foot span:hover { color: var(--text-2); }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search-wrap { flex: 1; min-width: 200px; max-width: 340px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 26px; padding: 0 11px; display: inline-flex; align-items: center; border-radius: var(--r-md); border: 1px solid var(--border); background: transparent; color: var(--text-2); font-size: 12px; font-weight: 450; cursor: pointer; transition: .1s; }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--text); }
.count-note { font-size: 12px; color: var(--text-3); margin-left: auto; }

/* ---------- Empty / skeleton ---------- */
.empty { text-align: center; padding: 48px 24px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.empty .e-ico { width: 40px; height: 40px; margin: 0 auto 12px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.empty h3 { font-size: 13.5px; margin-bottom: 4px; }
.empty p { color: var(--text-2); font-size: 12.5px; max-width: 340px; margin: 0 auto 16px; }
.skel { border-radius: 6px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-line { height: 12px; margin: 12px 0; }

/* ---------- Drawer ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 60; animation: fade .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 96vw); z-index: 61;
  background: var(--bg); border-left: 1px solid var(--border); display: flex; flex-direction: column;
  animation: slideIn .2s cubic-bezier(.32, .72, .35, 1);
}
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer-head { padding: 18px 22px 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; }
.drawer-foot { padding: 12px 22px; border-top: 1px solid var(--border); display: flex; gap: 7px; flex-wrap: wrap; background: var(--bg); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-top: 14px; }
.tabs button {
  background: none; border: none; color: var(--text-2); padding: 8px 12px; font-size: 12.5px;
  font-weight: 480; cursor: pointer; border-bottom: 1.5px solid transparent; margin-bottom: -1px;
  font-family: var(--font); transition: .1s; display: flex; align-items: center; gap: 6px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--text); }

/* ---------- Code viewer ---------- */
.code-view { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: auto; font-family: var(--mono); font-size: 12px; line-height: 1.7; }
.code-line { display: flex; }
.code-line .ln { flex: none; width: 44px; text-align: right; padding: 0 12px; color: var(--text-3); user-select: none; }
.code-line .cl { padding: 0 14px; white-space: pre; flex: 1; color: var(--text-2); }
.code-line.hit { background: var(--crit-bg); }
.code-line.hit .cl { color: var(--text); }
.code-line .tag { font-size: 9px; font-weight: 600; margin-left: 10px; padding: 1px 5px; border-radius: 3px; vertical-align: 1px; font-family: var(--mono); }
.tag-sink { background: var(--crit-bg); color: var(--crit); }
.tag-src { background: var(--low-bg); color: var(--low); }
.flow-chain { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.flow-node { padding: 5px 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 450; }
.flow-node.fn-sink { border-color: rgba(235, 92, 92, .4); color: var(--crit); }
.flow-node.fn-src { border-color: rgba(90, 159, 212, .4); color: var(--low); }
.flow-arrow { color: var(--text-3); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--border-strong); }
.tl-item { position: relative; }
.tl-item::before { content: ""; position: absolute; left: -19px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--surface-3); border: 1.5px solid var(--text-3); }
.tl-item.done::before { background: var(--accent); border-color: var(--accent); }
.tl-item .tl-time { font-size: 10.5px; color: var(--text-3); font-family: var(--mono); }
.tl-item .tl-text { font-size: 12.5px; margin-top: 1px; }

/* ---------- KV grid ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13px; }
.kv .k { color: var(--text-3); font-size: 12px; display: flex; align-items: center; gap: 6px; }

/* ---------- Modal / palette / toast ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; z-index: 70; animation: fade .13s; }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; width: min(440px, 94vw); padding: 22px; box-shadow: var(--shadow-2); animation: pop .15s cubic-bezier(.34, 1.3, .5, 1); }
@keyframes pop { from { transform: scale(.97) translateY(4px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 14.5px; margin-bottom: 4px; }
.modal .m-sub { color: var(--text-2); font-size: 12.5px; margin-bottom: 16px; }

.palette-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 80; display: flex; justify-content: center; padding-top: 14vh; animation: fade .12s; }
.palette { width: min(520px, 92vw); height: fit-content; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-2); overflow: hidden; animation: pop .14s; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.palette-input svg { color: var(--text-3); }
.palette-input input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; font-family: var(--font); }
.palette-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); cursor: pointer; font-size: 13px; color: var(--text-2); }
.palette-item svg { color: var(--text-3); flex: none; }
.palette-item .p-sub { font-size: 11px; color: var(--text-3); margin-left: auto; font-family: var(--mono); }
.palette-item.sel, .palette-item:hover { background: var(--surface-2); color: var(--text); }
.palette-foot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 10.5px; color: var(--text-3); }

#toast-root { position: fixed; bottom: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--border-strong); padding: 10px 14px; border-radius: var(--r-md); box-shadow: var(--shadow-2); font-size: 12.5px; min-width: 240px; max-width: 360px; animation: slideUp .2s cubic-bezier(.34, 1.3, .5, 1); }
.toast svg { color: var(--ok); flex: none; }
.toast.err svg { color: var(--crit); }
.toast.info svg { color: var(--accent); }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Dropdown ---------- */
.dd { position: relative; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-2); padding: 5px; z-index: 50; animation: pop .13s; }
.dd-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--text-2); transition: background .08s; }
.dd-item:hover { background: var(--surface-2); color: var(--text); }
.dd-item svg { color: var(--text-3); }
.dd-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.dd-head { padding: 7px 10px; font-size: 10.5px; color: var(--text-3); font-weight: 500; }
.bell-dot { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--crit); border: 1.5px solid var(--bg); }
.notif-item { padding: 9px 11px; border-radius: 6px; cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item .n-msg { font-size: 12.5px; }
.notif-item .n-time { font-size: 10.5px; color: var(--text-3); margin-top: 2px; font-family: var(--mono); }

/* ---------- Repo cards ---------- */
.repo-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.repo-card .r-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.repo-card h3 { font-size: 13.5px; font-weight: 550; display: flex; align-items: center; gap: 8px; }
.repo-card h3 svg { color: var(--text-3); }
.sev-mini { display: flex; gap: 3px; margin-top: 12px; }
.sev-mini span { flex: 1; height: 3px; border-radius: 2px; background: var(--surface-3); }
.sev-mini span.on-critical { background: var(--crit); }
.sev-mini span.on-high { background: var(--high); }
.sev-mini span.on-medium { background: var(--med); }
.sev-mini span.on-low { background: var(--low); }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 11px; }
.section-title h3 { font-size: 13px; font-weight: 550; display: flex; align-items: center; gap: 7px; }
.section-title h3 svg { color: var(--text-3); }
.section-title a { font-size: 12px; color: var(--text-3); cursor: pointer; }
.section-title a:hover { color: var(--text-2); }

/* charts */
.chart-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; justify-content: center; }
.chart-legend span { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2); font-family: var(--mono); }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.hbar-row { display: grid; grid-template-columns: 120px 1fr 36px; gap: 10px; align-items: center; margin: 8px 0; }
.hbar-row .hb-name { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.hbar > div { height: 100%; border-radius: 3px; background: var(--accent); transition: width .5s ease; }
.hbar-row .hb-val { font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-family: var(--mono); }
.activity { display: flex; align-items: flex-end; gap: 3px; height: 96px; padding-top: 6px; }
.activity .act { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; align-items: center; }
.activity .act > i { width: 100%; max-width: 22px; border-radius: 2px 2px 1px 1px; background: var(--accent); opacity: .75; min-height: 2px; transition: opacity .15s; }
.activity .act:hover > i { opacity: 1; }
.activity .act span { font-size: 9px; color: var(--text-3); font-family: var(--mono); }

/* settings */
.set-grid { display: grid; grid-template-columns: 190px 1fr; gap: 18px; }
@media (max-width: 900px) { .set-grid { grid-template-columns: 1fr; } }
.set-nav { display: flex; flex-direction: column; gap: 2px; }
.set-nav button { display: flex; align-items: center; gap: 9px; background: none; border: none; color: var(--text-2); padding: 8px 10px; border-radius: var(--r-md); cursor: pointer; font-size: 13px; font-weight: 450; text-align: left; font-family: var(--font); transition: .1s; height: 32px; }
.set-nav button:hover { background: var(--surface-2); color: var(--text); }
.set-nav button.active { background: var(--surface-2); color: var(--text); font-weight: 500; }
.set-nav button.active svg { color: var(--accent); }
.int-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.int-row:last-child { border-bottom: none; }
.int-logo { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); flex: none; }
.int-row .i-name { font-weight: 500; font-size: 13px; }
.int-row .i-desc { font-size: 11.5px; color: var(--text-3); }
.int-status { margin-left: auto; }

.report-frame { width: 100%; height: 540px; border: 1px solid var(--border); border-radius: var(--r-md); background: #fff; }
.banner { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border-radius: var(--r-md); font-size: 12px; margin-bottom: 16px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.banner svg { color: var(--text-3); flex: none; }

/* ---------------------------------------------------------------------------
   Premium motion — restrained, terminal-style. Respects reduced-motion.
   ------------------------------------------------------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes caretBlink { 50% { opacity: 0; } }
@keyframes sheen { 0% { background-position: -80% 0; } 100% { background-position: 180% 0; } }

/* typewriter status line (login hero + scan feel) */
.typeline {
  display: flex; align-items: center; justify-content: center;
  height: 18px; font-family: var(--mono); font-size: 11px; color: var(--text-3);
  margin: 2px 0 14px; letter-spacing: .01em;
}
.typeline .tw-text { white-space: nowrap; }
.typeline .tw-caret {
  display: inline-block; width: 7px; height: 12.5px; margin-left: 2px; vertical-align: -1px;
  background: var(--accent); animation: caretBlink 1.05s step-end infinite;
}
.typeline .tw-icon { color: var(--ok); margin-right: 7px; display: inline-flex; animation: pulseSoft 2.4s ease-in-out infinite; }
@keyframes pulseSoft { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

/* staggered rise for freshly rendered views */
#content > *, .auth-card > * { animation: fadeUp .5s cubic-bezier(.22, 1, .36, 1) both; }
#content > *:nth-child(2), .auth-card > *:nth-child(2) { animation-delay: .05s; }
#content > *:nth-child(3), .auth-card > *:nth-child(3) { animation-delay: .10s; }
#content > *:nth-child(4), .auth-card > *:nth-child(4) { animation-delay: .15s; }
#content > *:nth-child(5), .auth-card > *:nth-child(5) { animation-delay: .20s; }
#content > *:nth-child(n+6), .auth-card > *:nth-child(n+6) { animation-delay: .25s; }

/* count-up numerals */
.k-value { font-variant-numeric: tabular-nums; }

/* premium login micro-polish */
.auth-panel-card { transition: box-shadow .3s; }
.auth-panel-card:focus-within { box-shadow: var(--shadow-2), 0 0 0 1px var(--accent-border); }

@media (prefers-reduced-motion: reduce) {
  #content > *, .auth-card > * { animation: none; }
  .typeline .tw-caret { animation: none; }
  .progress > div, .bar > div, .hbar > div { transition: none; }
  .fx-orb { animation: none; }
  .n-packet { display: none; }
  .n-dot { animation: none; }
}

/* ---------------------------------------------------------------------------
   Background art — cyber grid, drifting glow orbs, threat-network graph.
   Fixed layer behind everything; surfaces are translucent so it shows
   through without reducing readability.
   ------------------------------------------------------------------------- */
#bg-fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#root, #drawer-root, #palette-root, #modal-root, #toast-root { position: relative; z-index: 1; }

.fx-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .05) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% -5%, #000 15%, transparent 70%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% -5%, #000 15%, transparent 70%);
}
.fx-orb { position: absolute; border-radius: 50%; filter: blur(95px); opacity: .55; animation: drift 30s ease-in-out infinite alternate; }
.fx-orb.o1 { width: 560px; height: 560px; top: -190px; left: -140px; background: radial-gradient(circle, rgba(94, 106, 210, .32), transparent 70%); }
.fx-orb.o2 { width: 480px; height: 480px; bottom: -200px; right: -120px; background: radial-gradient(circle, rgba(34, 158, 211, .20), transparent 70%); animation-delay: -10s; }
.fx-orb.o3 { width: 340px; height: 340px; top: 36%; right: 22%; background: radial-gradient(circle, rgba(139, 92, 246, .16), transparent 70%); animation-delay: -20s; }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(70px, 48px, 0) scale(1.18); } }

.fx-net { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.n-edge { stroke: rgba(94, 106, 210, .16); stroke-width: 1; }
.n-edge.hot { stroke: rgba(34, 158, 211, .22); stroke-dasharray: 4 6; animation: edgeFlow 18s linear infinite; }
@keyframes edgeFlow { to { stroke-dashoffset: -300; } }
.n-dot { fill: rgba(148, 163, 184, .38); animation: twinkle 7s ease-in-out infinite; }
.n-dot.hub { fill: rgba(94, 106, 210, .55); }
@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.n-packet { fill: #22d3ee; filter: drop-shadow(0 0 4px rgba(34, 211, 238, .8)); }

/* translucent chrome so the art is visible around content */
.auth { background: transparent; }
.topbar { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.sidebar { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.main { background: transparent; }

[data-theme="light"] #bg-fx .fx-grid { background-image: linear-gradient(rgba(15, 23, 42, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, .05) 1px, transparent 1px); }
[data-theme="light"] .fx-orb { opacity: .4; }
[data-theme="light"] .fx-net { opacity: .5; }
[data-theme="light"] .n-edge { stroke: rgba(94, 106, 210, .14); }
[data-theme="light"] .n-dot { fill: rgba(71, 85, 105, .30); }
[data-theme="light"] .topbar, [data-theme="light"] .sidebar { background: color-mix(in srgb, var(--bg) 80%, transparent); }
