/* ═══ Design tokens ═══ */
:root {
  --bg: #f0f1f4;
  --surface: #ffffff;
  --surface-hover: #f7f8fa;
  --text-primary: #1e2330;
  --text-secondary: #5f6b7a;
  --text-tertiary: #8d95a3;
  --border: #e3e8ef;
  --border-light: #edf0f4;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --accent-border: rgba(37, 99, 235, 0.2);
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.08);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.08);
  --orange: #d97706;
  --orange-soft: rgba(217, 119, 6, 0.08);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.08);
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --sans: 'Inter', -apple-system, system-ui, sans-serif;
  --topbar-h: 48px;
  --sidebar-w: 220px;
  --inspector-w: 380px;
  --drawer-tab-h: 38px;
  --drawer-body-h: 260px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

/* ═══ TOP BAR ═══ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.logo { flex-shrink: 0; }
.topbar-brand { font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
.topbar-sep { width: 1px; height: 18px; background: var(--border); }
.topbar-label { font-size: 13px; color: var(--text-tertiary); font-weight: 500; }
.status-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  background: var(--green-soft);
  font-size: 12px; font-weight: 600; color: var(--green);
  transition: all 0.2s;
}
.status-pill.yellow { background: var(--orange-soft); color: var(--orange); }
.status-pill.red { background: var(--red-soft); color: var(--red); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-dot.green { background: var(--green); }
.status-dot.yellow { background: var(--orange); }
.status-dot.red { background: var(--red); }
.topbar-branch {
  font-family: var(--mono); font-size: 12px; color: var(--text-tertiary);
  padding: 3px 8px; background: var(--bg); border-radius: 4px;
}
.topbar-clock {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--text-secondary); font-variant-numeric: tabular-nums;
}

/* ═══ CANVAS LAYOUT ═══ */
.canvas-layout {
  position: fixed;
  top: var(--topbar-h); left: 0; right: 0;
  bottom: var(--drawer-tab-h);
  display: flex;
  transition: top 0.25s ease;
}

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto;
  z-index: 10;
}
.sb-group { padding: 14px 0 6px; }
.sb-heading {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-tertiary);
  padding: 0 16px 8px;
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px; cursor: pointer;
  transition: background 0.1s; border-left: 2px solid transparent;
}
.sb-item:hover { background: var(--surface-hover); }
.sb-item.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}
.sb-item.active .sb-name { color: var(--accent); font-weight: 600; }
.sb-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sb-dot.ok { background: var(--green); }
.sb-dot.warn { background: var(--orange); }
.sb-dot.fail { background: var(--red); }
.sb-name { font-size: 13px; font-weight: 500; color: var(--text-primary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-stat { font-family: var(--mono); font-size: 11px; color: var(--text-tertiary); }

.sb-metrics {
  margin-top: auto; padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.metric { display: flex; flex-direction: column; }
.metric-val { font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.metric-label { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); }

/* ═══ GRAPH CANVAS (full area) ═══ */
.graph-canvas {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.graph-canvas svg { width: 100%; height: 100%; display: block; }
.graph-badge {
  position: absolute; bottom: 12px; left: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 12px;
  font-family: var(--mono); font-size: 11px; color: var(--text-tertiary);
  pointer-events: none; box-shadow: var(--shadow);
}

/* ═══ INSPECTOR (right panel, hidden by default) ═══ */
.inspector {
  width: 0; overflow: hidden;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s ease;
  z-index: 10;
}
.inspector.open { width: var(--inspector-w); }
.inspector-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; flex-shrink: 0;
  border-bottom: 1px solid var(--border-light);
}
.inspector-head h2 { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.inspector-close {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--text-tertiary); line-height: 1;
  padding: 2px 6px; border-radius: 4px;
  transition: all 0.1s;
}
.inspector-close:hover { background: var(--bg); color: var(--text-primary); }
.inspector-body {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  min-width: var(--inspector-w);
}

/* ═══ BOTTOM DRAWER ═══ */
.drawer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
  transition: height 0.25s ease;
  height: var(--drawer-tab-h);
  overflow: hidden;
}
.drawer.open {
  height: calc(var(--drawer-tab-h) + var(--drawer-body-h));
}
.drawer-tabs {
  height: var(--drawer-tab-h);
  display: flex; align-items: center; gap: 2px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-light);
}
.drawer-tab {
  padding: 6px 14px; border: none; background: none;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  color: var(--text-tertiary); cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.1s;
}
.drawer-tab:hover { color: var(--text-secondary); }
.drawer-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.drawer-count {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  background: var(--bg); padding: 1px 5px; border-radius: 8px;
  color: var(--text-tertiary); margin-left: 4px;
}
.drawer-spacer { flex: 1; }
.drawer-refresh { font-size: 11px; color: var(--text-tertiary); font-family: var(--mono); }
.drawer-missing { font-size: 11px; color: var(--orange); font-family: var(--mono); margin-left: 6px; }
.drawer-rescan {
  padding: 4px 12px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-border);
  cursor: pointer; font-size: 11px; font-weight: 600;
  font-family: var(--sans); transition: all 0.12s;
  margin-left: 8px;
}
.drawer-rescan:hover { background: rgba(37,99,235,0.14); }
.drawer-rescan:disabled { opacity: 0.5; cursor: default; }
.drawer-toggle {
  margin-left: 8px; padding: 4px 8px;
  background: none; border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer;
  font-size: 11px; color: var(--text-tertiary);
  transition: all 0.15s;
}
.drawer-toggle:hover { background: var(--bg); }
.drawer.open .drawer-toggle { transform: rotate(180deg); }
.drawer-body {
  height: var(--drawer-body-h);
  overflow: hidden;
}
.drawer-panel { height: 100%; overflow-y: auto; }
.drawer-panel.hidden { display: none; }

/* ═══ D3 GRAPH NODES ═══ */
.node-group { cursor: pointer; }
.node-group:hover .node-circle { filter: brightness(1.08) saturate(1.1); }
.node-circle { transition: filter 0.15s; }
.node-label {
  fill: var(--text-primary); font-size: 12px; text-anchor: middle;
  pointer-events: none; font-weight: 600; font-family: var(--sans);
}
.node-label-halo {
  fill: none; stroke: var(--bg); stroke-width: 4; stroke-linejoin: round;
  font-size: 12px; text-anchor: middle; pointer-events: none; font-weight: 600;
  font-family: var(--sans);
}
.node-label-inside {
  fill: #ffffff; font-size: 10px; text-anchor: middle;
  dominant-baseline: central; pointer-events: none; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--mono);
}
.node-ring { fill: none; stroke-width: 2; stroke-linecap: round; }
.link-line { fill: none; stroke: #c7d0dc; stroke-opacity: 0.45; stroke-width: 1.4; }
@keyframes ring-pulse {
  0%,100% { stroke-opacity: 0.4; }
  50%     { stroke-opacity: 1; }
}
@keyframes ring-spin { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -30; } }
.ring-animated { animation: ring-pulse 3s ease-in-out infinite, ring-spin 4s linear infinite; stroke-dasharray: 6 3; }
.node-selected .node-circle { filter: brightness(1.12) saturate(1.15) drop-shadow(0 0 8px rgba(37,99,235,0.3)) !important; }

/* ═══ INSPECTOR DETAIL CONTENT ═══ */
.detail-header {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border-light);
}
.detail-type {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px;
}
.detail-type.app { background: var(--accent-soft); color: var(--accent); }
.detail-type.pkg { background: var(--purple-soft); color: var(--purple); }
.detail-header h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.detail-header .blurb { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }

.detail-content { padding: 12px 16px 16px; }

.alert-card {
  padding: 10px 12px; border-radius: 6px; margin-bottom: 14px;
  border-left: 3px solid; font-size: 13px;
}
.alert-card.ok { background: var(--green-soft); border-color: var(--green); }
.alert-card.fail { background: var(--red-soft); border-color: var(--red); }
.alert-card.warn { background: var(--orange-soft); border-color: var(--orange); }
.alert-card.pr { background: var(--purple-soft); border-color: var(--purple); }
.alert-title { font-weight: 600; }
.alert-card.ok .alert-title { color: var(--green); }
.alert-card.fail .alert-title { color: var(--red); }
.alert-card.warn .alert-title { color: var(--orange); }
.alert-card.pr .alert-title { color: var(--purple); }
.alert-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.d-section { margin-bottom: 14px; }
.d-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-tertiary);
  margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border-light);
}
.kv-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 3px 0;
}
.kv-key { font-size: 13px; color: var(--text-secondary); }
.kv-val { font-size: 13px; font-weight: 500; font-family: var(--mono); color: var(--text-primary); }
.pill-list { display: flex; flex-wrap: wrap; gap: 4px; }
.pill {
  padding: 2px 8px; border-radius: 4px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent);
}
.route-list { max-height: 140px; overflow-y: auto; font-size: 12px; font-family: var(--mono); color: var(--text-secondary); }
.route-list div { padding: 1px 0; }
.todo-list { max-height: 140px; overflow-y: auto; }
.todo-item { padding: 4px 0; border-bottom: 1px solid var(--border-light); font-size: 12px; }
.todo-item:last-child { border-bottom: none; }
.todo-kind {
  font-family: var(--mono); font-weight: 700; font-size: 9px;
  text-transform: uppercase; color: var(--orange); padding: 1px 4px;
  background: var(--orange-soft); border-radius: 3px; margin-right: 4px;
}
.todo-loc { display: block; font-size: 11px; color: var(--text-tertiary); font-family: var(--mono); margin-top: 1px; }
.commit-list { max-height: 140px; overflow-y: auto; }
.commit-item { padding: 4px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.commit-item:last-child { border-bottom: none; }
.commit-time { font-size: 11px; color: var(--text-tertiary); font-family: var(--mono); }
.signal-item { padding: 5px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.signal-item:last-child { border-bottom: none; }
.signal-meta { font-size: 11px; color: var(--text-tertiary); font-family: var(--mono); margin-top: 1px; }
.pill.pass { background: var(--green-soft); color: var(--green); }
.pill.fail { background: var(--red-soft); color: var(--red); }

.empty-state {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-tertiary); font-size: 13px;
  padding: 24px;
}

/* ═══ BRANCH ROWS (inside drawer) ═══ */
.branch-row {
  display: grid; grid-template-columns: 1fr auto auto;
  align-items: center; gap: 8px;
  padding: 6px 16px; border-bottom: 1px solid var(--border-light);
  font-size: 13px; transition: background 0.08s;
}
.branch-row:last-child { border-bottom: none; }
.branch-row:hover { background: var(--surface-hover); }
.branch-row.current { background: var(--accent-soft); }
.branch-name {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.branch-name.is-main { color: var(--green); font-weight: 600; }
.branch-msg {
  font-size: 12px; color: var(--text-tertiary); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 280px;
}
.branch-when { font-family: var(--mono); font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }
.branch-tag {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  padding: 1px 5px; border-radius: 3px; text-transform: uppercase;
}
.branch-tag.ahead { background: var(--green-soft); color: var(--green); }
.branch-tag.behind { background: var(--orange-soft); color: var(--orange); }
.branch-tag.gone { background: var(--red-soft); color: var(--red); }

/* ═══ ACTIVITY LOG (inside drawer) ═══ */
.log-row {
  display: grid; grid-template-columns: 70px 58px 1fr 110px 74px;
  align-items: center; gap: 10px;
  padding: 5px 16px; border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.log-row:last-child { border-bottom: none; }
.log-row:hover { background: var(--surface-hover); }
.log-time { font-family: var(--mono); font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.log-kind {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  text-transform: uppercase; padding: 2px 6px;
  border-radius: 3px; text-align: center;
}
.log-kind.feature  { background: var(--green-soft); color: var(--green); }
.log-kind.fix      { background: var(--red-soft); color: var(--red); }
.log-kind.chore    { background: var(--bg); color: var(--text-tertiary); }
.log-kind.docs     { background: var(--accent-soft); color: var(--accent); }
.log-kind.refactor { background: var(--purple-soft); color: var(--purple); }
.log-kind.test     { background: var(--orange-soft); color: var(--orange); }
.log-kind.change   { background: var(--bg); color: var(--text-tertiary); }
.log-subject { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-ref {
  font-family: var(--mono); font-size: 10px; color: var(--accent);
  background: var(--accent-soft); padding: 1px 5px; border-radius: 3px;
  margin-left: 4px;
}
.log-author { font-family: var(--mono); font-size: 11px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-hash { font-family: var(--mono); font-size: 11px; color: var(--text-tertiary); }

/* ═══ SOUND BUTTON ═══ */
.sound-btn {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  cursor: pointer; font-size: 14px; padding: 2px 6px;
  line-height: 1; transition: all 0.1s;
}
.sound-btn:hover { background: var(--bg); }
.sound-btn.muted { opacity: 0.4; }
.quiet-label {
  font-size: 10px; font-weight: 600; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* ═══ DEFCON ALERT SYSTEM ═══ */

/* Danger vignette — pulsing red edges around entire viewport */
.danger-vignette {
  position: fixed; inset: 0; z-index: 9998;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.danger-vignette.active {
  animation: vignette-pulse 2s ease-in-out infinite;
}
.danger-vignette.warning {
  animation: vignette-pulse-warn 3s ease-in-out infinite;
}
@keyframes vignette-pulse {
  0%, 100% { box-shadow: inset 0 0 100px rgba(220, 38, 38, 0.18), inset 0 0 250px rgba(220, 38, 38, 0.06); }
  50% { box-shadow: inset 0 0 140px rgba(220, 38, 38, 0.38), inset 0 0 350px rgba(220, 38, 38, 0.12); }
}
@keyframes vignette-pulse-warn {
  0%, 100% { box-shadow: inset 0 0 60px rgba(217, 119, 6, 0.08); }
  50% { box-shadow: inset 0 0 110px rgba(217, 119, 6, 0.2); }
}

/* Alert bar — dark war-room panel, impossible to ignore */
.alert-bar {
  position: fixed; top: var(--topbar-h); left: 0; right: 0; z-index: 150;
  background: linear-gradient(180deg, #1a0a0a 0%, #1c1012 100%);
  border-bottom: 2px solid rgba(239, 68, 68, 0.6);
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease, border-color 0.3s;
}
.alert-bar.visible { max-height: 600px; }
.alert-bar.warn-mode {
  background: linear-gradient(180deg, #1a1408 0%, #1c1608 100%);
  border-bottom-color: rgba(245, 158, 11, 0.6);
}

.alert-bar-summary {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 24px 10px;
}
.alert-siren {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ef4444; flex-shrink: 0;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.7);
  animation: siren-blink 1s ease-in-out infinite;
}
.warn-mode .alert-siren {
  background: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.7);
}
@keyframes siren-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}
.alert-headline {
  font-size: 15px; font-weight: 800; color: #fca5a5;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.warn-mode .alert-headline { color: #fcd34d; }

.dismiss-btn {
  margin-left: auto;
  padding: 6px 16px; border-radius: 6px;
  background: rgba(255,255,255,0.08); color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer; font-family: var(--sans);
  font-size: 12px; font-weight: 600;
  transition: all 0.15s;
}
.dismiss-btn:hover { background: rgba(255,255,255,0.15); color: #e2e8f0; }

.alert-bar-list {
  padding: 4px 24px 18px;
  display: flex; flex-direction: column; gap: 8px;
}

/* Alert card row */
.alert-card-row {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 18px;
  transition: background 0.15s;
}
.alert-card-row:hover { background: rgba(255, 255, 255, 0.07); }

.alert-severity-badge {
  flex-shrink: 0;
  padding: 5px 10px; border-radius: 6px;
  font-family: var(--mono); font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em; line-height: 1;
}
.alert-severity-badge.critical { background: #dc2626; color: #fff; }
.alert-severity-badge.warning { background: #d97706; color: #fff; }
.alert-severity-badge.info { background: #2563eb; color: #fff; }

.alert-card-body { flex: 1; min-width: 0; }
.alert-card-title {
  font-size: 14px; font-weight: 700; color: #f1f5f9;
  line-height: 1.3; margin-bottom: 3px;
}
.alert-card-detail {
  font-size: 12px; color: #94a3b8; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.alert-card-time {
  font-size: 11px; color: #64748b; font-family: var(--mono); margin-top: 3px;
}

.alert-card-actions {
  display: flex; gap: 8px; flex-shrink: 0; align-items: center;
}

/* THE fix button — big, red, unmissable */
.fix-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px;
  background: #ef4444; color: #fff;
  border: none; cursor: pointer;
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  transition: all 0.15s; white-space: nowrap;
}
.fix-btn:hover {
  background: #dc2626; transform: scale(1.04);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.35);
}
.fix-btn:active { transform: scale(0.97); }
.fix-btn.copied { background: #16a34a; box-shadow: 0 4px 20px rgba(22, 163, 74, 0.3); }
.fix-btn .fix-icon { font-size: 14px; }

.alert-view-link {
  padding: 10px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #94a3b8; border: 1px solid rgba(255,255,255,0.1);
  font-size: 12px; font-weight: 600;
  text-decoration: none; transition: all 0.12s; white-space: nowrap;
}
.alert-view-link:hover { background: rgba(255,255,255,0.12); color: #e2e8f0; }

/* Drawer alert cards — light theme overrides */
.drawer-panel .alert-card-row {
  background: var(--surface-hover);
  border-color: var(--border);
}
.drawer-panel .alert-card-row:hover { background: var(--bg); }
.drawer-panel .alert-card-title { color: var(--text-primary); }
.drawer-panel .alert-card-detail { color: var(--text-secondary); }
.drawer-panel .alert-card-time { color: var(--text-tertiary); }
.drawer-panel .alert-view-link {
  background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent-border);
}
.drawer-panel .alert-view-link:hover { background: rgba(37,99,235,0.14); }

/* Alert count badge — pulsing */
.alert-count.has-alerts {
  background: #dc2626 !important; color: #fff !important; font-weight: 700;
  animation: count-pulse 2s ease-in-out infinite;
}
@keyframes count-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Status pill — throbs when degraded */
.status-pill.red { animation: status-throb 1.5s ease-in-out infinite; }
@keyframes status-throb {
  0%, 100% { background: var(--red-soft); }
  50% { background: rgba(220, 38, 38, 0.22); box-shadow: 0 0 14px rgba(220, 38, 38, 0.25); }
}

/* ═══ TOAST NOTIFICATIONS ═══ */
.toast-container {
  position: fixed; top: calc(var(--topbar-h) + 8px); right: 16px;
  z-index: 300; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: #1c1012; border: 1px solid rgba(239, 68, 68, 0.2);
  border-left: 4px solid #ef4444; border-radius: 10px;
  padding: 14px 20px; max-width: 420px; min-width: 300px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.1);
  animation: toast-in 0.4s ease; pointer-events: auto;
}
.toast.warn { border-left-color: #f59e0b; border-color: rgba(245,158,11,0.2); background: #1c1608; }
.toast.info { border-left-color: #2563eb; border-color: rgba(37,99,235,0.2); background: #0c1220; }
.toast-title { font-size: 14px; font-weight: 700; color: #f1f5f9; margin-bottom: 4px; }
.toast-detail { font-size: 12px; color: #94a3b8; line-height: 1.4; }
.toast.fade-out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ═══ Scrollbars ═══ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
::selection { background: rgba(37,99,235,0.12); }
