@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&family=Instrument+Serif&display=swap');

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg: #0b0c0f;
  --surface-1: rgba(15,16,20,0.7);
  --surface-2: rgba(255,255,255,0.04);
  --surface-3: rgba(255,255,255,0.03);
  --surface-4: rgba(255,255,255,0.015);
  --border-1: rgba(255,255,255,0.06);
  --border-2: rgba(255,255,255,0.07);
  --border-3: rgba(255,255,255,0.08);
  --border-4: rgba(255,255,255,0.05);
  --text-1: #e6e7ea;
  --text-2: #c4c5cd;
  --text-3: #a1a2aa;
  --text-4: #8b8c93;
  --text-5: #71727a;
  --text-6: #5a5b62;
  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --accent-light: #818cf8;
  --pink: #f472b6;
  --pink-dark: #d946ef;
  --red: #ef4444;
  --red-light: #fca5a5;
  --red-dark: #b91c1c;
  --amber: #f59e0b;
  --amber-light: #fcd34d;
  --amber-dark: #d97706;
  --green: #10b981;
  --green-light: #6ee7b7;
  --blue: #6366f1;
  --blue-light: #c4b5fd;
  --purple: #a78bfa;
  --radius-s: 7px;
  --radius-m: 9px;
  --radius-l: 12px;
  --radius-xl: 14px;
  --radius-2xl: 16px;
  --shadow-glow-red: 0 0 12px rgba(239,68,68,0.5);
  --shadow-glow-amber: 0 0 12px rgba(245,158,11,0.4);
  --shadow-glow-green: 0 0 8px rgba(16,185,129,0.5);
  --shadow-glow-blue: 0 0 8px rgba(99,102,241,0.6);
  --font-sans: 'Geist', system-ui, sans-serif;
  --font-mono: 'Geist Mono', monospace;
  --font-serif: 'Instrument Serif', serif;
  --transition-fast: 0.15s ease;
  --transition-med: 0.25s ease;
}

/* ── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(99,102,241,0.08), transparent 60%),
    radial-gradient(800px 500px at -10% 30%, rgba(244,114,182,0.05), transparent 60%),
    var(--bg);
  color: var(--text-1);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ── APP SHELL ──────────────────────────────────────────── */
.app { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content { padding: 28px 32px 40px; }

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: 232px;
  background: var(--surface-1);
  border-right: 1px solid var(--border-1);
  backdrop-filter: blur(20px);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 20px 14px;
  flex-shrink: 0;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 24px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #d946ef);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
.logo-text { font-weight: 600; font-size: 15px; letter-spacing: -0.02em; }
.logo-text small { display: block; font-weight: 400; font-size: 10px; color: var(--text-5); letter-spacing: 0.06em; text-transform: uppercase; }
.nav-section {
  padding: 14px 10px 6px; font-size: 10.5px; color: var(--text-6);
  font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--radius-m);
  color: var(--text-3); font-weight: 500;
  cursor: pointer; margin-bottom: 2px; font-size: 13px;
  transition: all var(--transition-fast);
}
.nav-item:hover { background: var(--surface-2); color: var(--text-1); }
.nav-item.active {
  background: linear-gradient(180deg, rgba(99,102,241,0.18), rgba(99,102,241,0.08));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(99,102,241,0.3);
}
.nav-item svg, .nav-item .icon { width: 16px; height: 16px; opacity: 0.85; }
.nav-item .icon { display: inline-flex; }
.nav-badge {
  margin-left: auto;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white; font-size: 10.5px;
  padding: 2px 7px; border-radius: 10px;
  font-weight: 600; font-family: var(--font-mono);
}
.sidebar-footer {
  margin-top: auto; padding: 14px; border-radius: var(--radius-l);
  background: var(--surface-3); border: 1px solid var(--border-1);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-footer .logout-btn {
  margin-left: auto; color: var(--text-5); cursor: pointer; transition: color var(--transition-fast);
}
.sidebar-footer .logout-btn:hover { color: var(--red-light); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #f472b6, #8b5cf6);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; flex-shrink: 0;
}
.user-name { font-weight: 600; font-size: 13px; color: var(--text-1); }
.user-role { font-size: 11px; color: var(--text-5); }

/* ── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  height: 64px; border-bottom: 1px solid var(--border-4);
  display: flex; align-items: center;
  padding: 0 32px; gap: 18px;
  background: rgba(11,12,15,0.7);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 10;
}
.search {
  flex: 1; max-width: 460px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border-2);
  padding: 9px 14px; border-radius: 10px;
  color: var(--text-5); font-size: 13px;
}
.search .icon { opacity: 0.6; }
.kbd {
  margin-left: auto; font-size: 11px; padding: 2px 6px;
  background: var(--surface-2); border: 1px solid var(--border-3);
  border-radius: 5px; color: var(--text-3); font-family: var(--font-mono);
}
.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.market-pill {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 13px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius-m); font-size: 12px; font-weight: 500; color: var(--green-light);
}
.pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-m);
  background: var(--surface-2); border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-3); position: relative;
  transition: all var(--transition-fast);
}
.icon-btn:hover { background: rgba(255,255,255,0.07); color: white; }
.icon-btn:active { transform: scale(0.93); }
.dot-indicator {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 8px var(--red);
}

/* ── BREADCRUMB ─────────────────────────────────────────── */
.breadcrumb {
  font-size: 12.5px; color: var(--text-5); margin-bottom: 14px;
  display: flex; gap: 8px; align-items: center;
}
.breadcrumb .current { color: var(--text-1); }

/* ── PAGE HEADER ────────────────────────────────────────── */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px; gap: 24px;
}
.page-title {
  font-size: 30px; font-weight: 600; letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff, #b8b9c2);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-title em {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  background: linear-gradient(135deg, #a78bfa, #f472b6);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-subtitle { font-size: 13.5px; color: var(--text-4); margin-top: 8px; max-width: 540px; }
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  padding: 9px 15px; border-radius: var(--radius-m);
  border: 1px solid var(--border-3);
  background: var(--surface-3); color: var(--text-1);
  font-size: 13px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: inherit; transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.97); box-shadow: 0 0 12px rgba(255,255,255,0.06); }
.btn-primary {
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  border-color: #4f46e5;
  box-shadow: 0 6px 20px -6px rgba(99,102,241,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
  color: white;
}
.btn-primary:hover { background: linear-gradient(180deg, #7376f3, #5b54ea); }
.btn-primary:active { box-shadow: 0 0 16px rgba(99,102,241,0.5), inset 0 1px 0 rgba(255,255,255,0.2); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: var(--radius-s); }
.btn-danger {
  background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3);
  color: var(--red-light);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn:disabled, .btn[disabled] {
  opacity: 0.4; cursor: not-allowed; pointer-events: none;
}

/* ── KPI CARDS ──────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.kpi {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-4));
  border: 1px solid var(--border-2); border-radius: var(--radius-xl);
  padding: 18px 20px; position: relative; overflow: hidden;
  animation: kpiSlideUp 0.4s ease both;
}
.kpi.featured {
  background: linear-gradient(180deg, rgba(239,68,68,0.12), rgba(239,68,68,0.02));
  border-color: rgba(239,68,68,0.35);
}
.kpi-top { display: flex; justify-content: space-between; align-items: center; }
.kpi-label { font-size: 12px; color: var(--text-4); font-weight: 500; }
.kpi-value {
  font-size: 30px; font-weight: 600; margin-top: 10px;
  letter-spacing: -0.025em; color: #fff; font-family: var(--font-sans);
}
.kpi.featured .kpi-value { color: var(--red-light); }
.kpi-meta { font-size: 12px; color: var(--text-4); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.spark { position: absolute; right: 12px; bottom: 12px; opacity: 0.7; }
.delta-up { color: var(--red-light); font-weight: 500; }
.delta-down { color: var(--green-light); font-weight: 500; }

/* ── TABS ───────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-3); border: 1px solid var(--border-1);
  border-radius: 10px; margin-bottom: 20px; width: fit-content;
}
.tab {
  padding: 7px 14px; font-size: 12.5px; font-weight: 500;
  color: var(--text-4); cursor: pointer; border-radius: var(--radius-s);
  transition: all var(--transition-fast);
}
.tab:hover { color: var(--text-1); }
.tab.active {
  background: rgba(255,255,255,0.07); color: #fff;
  box-shadow: inset 0 0 0 1px var(--border-1);
}
.tab .count {
  margin-left: 6px; font-family: var(--font-mono);
  font-size: 11px; color: var(--text-5);
}
.tab.active .count { color: var(--purple); }

/* ── CHIPS ──────────────────────────────────────────────── */
.chip {
  display: inline-flex; padding: 3px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 500;
  align-items: center; gap: 5px; white-space: nowrap;
}
.chip-red { background: rgba(239,68,68,0.12); color: var(--red-light); box-shadow: inset 0 0 0 1px rgba(239,68,68,0.3); }
.chip-amber { background: rgba(245,158,11,0.12); color: var(--amber-light); box-shadow: inset 0 0 0 1px rgba(245,158,11,0.3); }
.chip-blue { background: rgba(99,102,241,0.14); color: var(--blue-light); box-shadow: inset 0 0 0 1px rgba(99,102,241,0.3); }
.chip-gray { background: rgba(255,255,255,0.05); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--border-3); }
.chip-green { background: rgba(16,185,129,0.1); color: var(--green-light); box-shadow: inset 0 0 0 1px rgba(16,185,129,0.3); }

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, var(--surface-3), rgba(255,255,255,0.01));
  border: 1px solid var(--border-2); border-radius: var(--radius-2xl); overflow: hidden;
}

/* ── LAYOUT ─────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: 1fr 420px; gap: 18px; }

/* ── FILTER BAR ─────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 8px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border-4);
  flex-wrap: wrap;
}
.filter {
  padding: 6px 11px; background: var(--surface-2);
  border: 1px solid var(--border-2); border-radius: var(--radius-s);
  font-size: 12px; display: flex; align-items: center; gap: 6px;
  color: var(--text-2); cursor: pointer; transition: all var(--transition-fast);
  position: relative; user-select: none;
}
.filter:hover { background: rgba(255,255,255,0.07); }
.filter strong { color: white; font-weight: 500; }

/* ── DROPDOWN ───────────────────────────────────────────── */
.dropdown-menu {
  position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 160px; z-index: 100;
  background: rgba(22,23,28,0.95); backdrop-filter: blur(16px);
  border: 1px solid var(--border-2); border-radius: var(--radius-m);
  padding: 4px; box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  animation: dropIn 0.15s ease;
}
.dropdown-item {
  padding: 8px 12px; border-radius: 6px; font-size: 12.5px;
  color: var(--text-2); cursor: pointer; transition: background var(--transition-fast);
}
.dropdown-item:hover { background: rgba(255,255,255,0.06); color: white; }
.dropdown-item.active { background: rgba(99,102,241,0.15); color: var(--blue-light); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ── ALERT LIST ─────────────────────────────────────────── */
.alert-list { padding: 8px; }
.alert-row {
  display: grid;
  grid-template-columns: 12px 1fr 130px 170px 110px 90px;
  gap: 14px; align-items: center;
  padding: 14px; border-radius: 11px;
  cursor: pointer; transition: background var(--transition-fast);
}
.alert-row + .alert-row { margin-top: 2px; }
.alert-row:hover { background: var(--surface-3); }
.alert-row.selected {
  background: linear-gradient(180deg, rgba(99,102,241,0.12), rgba(99,102,241,0.05));
  box-shadow: inset 0 0 0 1px rgba(99,102,241,0.3);
}
.sev-bar { width: 3px; height: 38px; border-radius: 2px; }
.sev-critical { background: linear-gradient(180deg, #ef4444, #b91c1c); box-shadow: var(--shadow-glow-red); animation: sevPulse 2s ease-in-out infinite; }
.sev-high { background: linear-gradient(180deg, #f59e0b, #d97706); }
.sev-medium { background: linear-gradient(180deg, #6366f1, #4f46e5); }
.sev-low { background: linear-gradient(180deg, #71727a, #5a5b62); }

.alert-title { font-weight: 600; color: #fff; font-size: 13.5px; letter-spacing: -0.01em; }
.alert-sub { font-size: 11.5px; color: var(--text-5); margin-top: 3px; font-family: var(--font-mono); }
.cell-label { font-size: 10.5px; color: var(--text-6); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.cell-value { font-size: 13px; color: var(--text-1); }
.mono { font-family: var(--font-mono); }

/* ── UTILIZATION TRACK ──────────────────────────────────── */
.util-track { width: 100%; height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.util-fill { height: 100%; border-radius: 2px; transition: width 0.3s ease; }
.util-fill.red { background: linear-gradient(90deg, #ef4444, #f59e0b); }
.util-fill.amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.util-fill.green { background: linear-gradient(90deg, #10b981, #6ee7b7); }
.util-fill.blue { background: linear-gradient(90deg, #6366f1, #818cf8); }

/* ── DETAIL PANEL ───────────────────────────────────────── */
.detail-panel {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-4));
  border: 1px solid var(--border-3); border-radius: var(--radius-2xl);
  overflow: hidden; height: fit-content; position: relative;
}
.detail-glow {
  position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(239,68,68,0.25), transparent 70%);
  pointer-events: none;
}
.detail-header { padding: 20px; border-bottom: 1px solid var(--border-1); position: relative; }
.detail-section { padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.detail-section:last-of-type { border-bottom: none; }
.section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-5); font-weight: 500; margin-bottom: 12px; }
.detail-title { font-size: 18px; font-weight: 600; margin-top: 12px; letter-spacing: -0.02em; }
.detail-id { font-size: 11.5px; color: var(--text-5); font-family: var(--font-mono); margin-top: 4px; }

/* ── METRIC GRID ────────────────────────────────────────── */
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.metric {
  background: var(--surface-3); border: 1px solid var(--border-4);
  border-radius: 10px; padding: 12px 14px;
}
.metric-label { font-size: 10.5px; color: var(--text-5); text-transform: uppercase; letter-spacing: 0.06em; }
.metric-value { font-size: 18px; font-weight: 600; margin-top: 4px; font-family: var(--font-mono); letter-spacing: -0.02em; }
.metric-value.danger { color: var(--red-light); }

/* ── SLA CARD ───────────────────────────────────────────── */
.sla-card {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 10px; padding: 12px 14px;
  transition: background var(--transition-med), border-color var(--transition-med);
}
.sla-card.sla-expired {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.25);
}
.sla-card.sla-critical {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.35);
  animation: slaPulse 2s ease-in-out infinite;
}
@keyframes slaPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(239,68,68,0); }
  50% { box-shadow: 0 0 12px rgba(239,68,68,0.15); }
}
.sla-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.sla-bar { height: 5px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.sla-fill { height: 100%; background: linear-gradient(90deg, #f59e0b, #fbbf24); box-shadow: 0 0 8px rgba(251,191,36,0.5); transition: width 0.3s ease; }
.sla-fill.sla-fill-expired { background: linear-gradient(90deg, #ef4444, #b91c1c); box-shadow: 0 0 8px rgba(239,68,68,0.5); }

/* ── CAUSE LIST ─────────────────────────────────────────── */
.cause-list { display: flex; flex-direction: column; gap: 10px; }
.cause-item { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-2); }
.cause-icon {
  width: 22px; height: 22px; border-radius: 6px;
  background: rgba(239,68,68,0.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px; color: var(--red-light); font-size: 12px;
}

/* ── TIMELINE ───────────────────────────────────────────── */
.timeline-item { display: flex; gap: 12px; padding: 6px 0; position: relative; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; position: relative; }
.timeline-dot.red { background: var(--red); box-shadow: 0 0 8px rgba(239,68,68,0.6); }
.timeline-dot.blue { background: var(--accent); box-shadow: var(--shadow-glow-blue); }
.timeline-dot.green { background: var(--green); box-shadow: var(--shadow-glow-green); }
.timeline-dot.gray { background: #4b4c54; }
.timeline-dot::after {
  content: ''; position: absolute; top: 13px; left: 3.5px;
  width: 2px; height: 22px; background: var(--border-3);
}
.timeline-item:last-child .timeline-dot::after { display: none; }
.timeline-content { font-size: 13px; color: var(--text-1); }
.timeline-time { font-size: 11px; color: var(--text-5); margin-top: 2px; font-family: var(--font-mono); }

/* ── ACTION BAR ─────────────────────────────────────────── */
.action-bar {
  display: grid; grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px; padding: 18px 20px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid var(--border-1);
}
.action-bar .btn { justify-content: center; }

/* ── FOOTER ─────────────────────────────────────────────── */
.page-footer {
  margin-top: 32px; display: flex; justify-content: space-between;
  font-size: 11.5px; color: var(--text-6);
  padding-top: 20px; border-top: 1px solid var(--border-4);
}

/* ── TOAST ──────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius-m);
  background: rgba(22,23,28,0.95); backdrop-filter: blur(16px);
  border: 1px solid var(--border-2); color: var(--text-1);
  font-size: 13px; font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  pointer-events: auto; min-width: 280px;
}
.toast.success { border-color: rgba(16,185,129,0.3); }
.toast.success .toast-icon { color: var(--green-light); }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.error .toast-icon { color: var(--red-light); }
.toast.info { border-color: rgba(99,102,241,0.3); }
.toast.info .toast-icon { color: var(--blue-light); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }

/* ── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-box {
  background: rgba(22,23,28,0.98); backdrop-filter: blur(20px);
  border: 1px solid var(--border-2); border-radius: var(--radius-2xl);
  width: 480px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: modalIn 0.25s ease;
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border-1);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border-1);
  display: flex; justify-content: flex-end; gap: 8px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ── FORM ELEMENTS ──────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; color: var(--text-4); margin-bottom: 6px; font-weight: 500; }
.form-input, .form-textarea {
  width: 100%; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-m); color: var(--text-1);
  font-size: 13px; font-family: inherit;
  transition: border-color var(--transition-fast);
}
.form-input:focus, .form-textarea:focus {
  outline: none; border-color: rgba(99,102,241,0.5);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-textarea { min-height: 80px; resize: vertical; }

/* ── TABLE ──────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 10px 14px; font-size: 10.5px; font-weight: 500;
  color: var(--text-5); text-transform: uppercase; letter-spacing: 0.06em;
  text-align: left; border-bottom: 1px solid var(--border-1);
  white-space: nowrap; cursor: default;
}
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--text-1); }
.data-table th .sort-icon { margin-left: 4px; opacity: 0.5; }
.data-table th.sorted .sort-icon { opacity: 1; color: var(--purple); }
.data-table td {
  padding: 12px 14px; font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-1); vertical-align: middle;
}
.data-table tbody tr { transition: background var(--transition-fast); cursor: pointer; }
.data-table tbody tr:hover { background: var(--surface-3); }
.data-table tbody tr.expanded { background: rgba(99,102,241,0.06); }

/* ── FEED CARDS ─────────────────────────────────────────── */
.feed-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 28px; }
.feed-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-4));
  border: 1px solid var(--border-2); border-radius: var(--radius-xl);
  padding: 18px 20px; position: relative;
}
.feed-card.degraded { border-color: rgba(245,158,11,0.35); }
.feed-card.offline { border-color: rgba(239,68,68,0.35); }

/* ── STATUS PILLS ───────────────────────────────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
}
.status-active { background: rgba(16,185,129,0.1); color: var(--green-light); border: 1px solid rgba(16,185,129,0.3); }
.status-stale { background: rgba(245,158,11,0.1); color: var(--amber-light); border: 1px solid rgba(245,158,11,0.3); }
.status-failedover { background: rgba(99,102,241,0.1); color: var(--blue-light); border: 1px solid rgba(99,102,241,0.3); }
.status-offline { background: rgba(239,68,68,0.1); color: var(--red-light); border: 1px solid rgba(239,68,68,0.3); }
.status-breached { background: rgba(239,68,68,0.1); color: var(--red-light); border: 1px solid rgba(239,68,68,0.3); }
.status-warning { background: rgba(245,158,11,0.1); color: var(--amber-light); border: 1px solid rgba(245,158,11,0.3); }
.status-normal { background: rgba(16,185,129,0.1); color: var(--green-light); border: 1px solid rgba(16,185,129,0.3); }
.status-completed { background: rgba(16,185,129,0.1); color: var(--green-light); border: 1px solid rgba(16,185,129,0.3); }
.status-scheduled { background: rgba(99,102,241,0.1); color: var(--blue-light); border: 1px solid rgba(99,102,241,0.3); }
.status-running { background: rgba(245,158,11,0.1); color: var(--amber-light); border: 1px solid rgba(245,158,11,0.3); }
.status-failed { background: rgba(239,68,68,0.1); color: var(--red-light); border: 1px solid rgba(239,68,68,0.3); }

/* ── SCENARIO CARDS ─────────────────────────────────────── */
.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.scenario-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-4));
  border: 1px solid var(--border-2); border-radius: var(--radius-xl);
  padding: 20px; display: flex; flex-direction: column;
}
.scenario-card .card-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.scenario-card .card-desc { font-size: 12.5px; color: var(--text-4); margin-bottom: 14px; flex: 1; }
.scenario-card.failed-card { border-color: rgba(239,68,68,0.25); }
.scenario-card.failed-card .card-title { color: var(--red-light); }
.shock-params { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.shock-row { display: flex; justify-content: space-between; font-size: 12px; }
.shock-row .key { color: var(--text-5); }
.shock-row .val { color: var(--red-light); font-family: var(--font-mono); font-weight: 500; }

/* ── BACKTESTING CHART ──────────────────────────────────── */
.backtest-chart { padding: 20px; }

/* ── SPARKLINE ──────────────────────────────────────────── */
.sparkline-cell { display: flex; align-items: center; }

/* ── EXPANDED ROW ───────────────────────────────────────── */
.expanded-content {
  padding: 16px 14px 16px 40px;
  background: rgba(99,102,241,0.03);
  border-bottom: 1px solid var(--border-1);
  animation: expandIn 0.2s ease;
}
@keyframes expandIn { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 300px; } }

/* ── LOGIN SCREEN ───────────────────────────────────────── */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 40px;
}
.login-container { width: 560px; text-align: center; }
.login-logo {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, #6366f1, #d946ef);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 22px; color: white;
  margin: 0 auto 20px; box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}
.login-title { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 6px; }
.login-subtitle { font-size: 14px; color: var(--text-4); margin-bottom: 36px; }
.user-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.user-cards.row-2 { grid-template-columns: repeat(2, 1fr); max-width: 380px; margin: 0 auto 24px; }
.user-card {
  padding: 20px 16px; border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-4));
  border: 1px solid var(--border-2); cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}
.user-card:hover {
  background: linear-gradient(180deg, rgba(99,102,241,0.12), rgba(99,102,241,0.05));
  border-color: rgba(99,102,241,0.3);
  transform: translateY(-2px);
}
.user-card.selected {
  background: linear-gradient(180deg, rgba(99,102,241,0.18), rgba(99,102,241,0.08));
  border-color: rgba(99,102,241,0.5);
  box-shadow: 0 0 20px rgba(99,102,241,0.2);
}
.user-card .avatar { margin: 0 auto 10px; width: 44px; height: 44px; font-size: 14px; }
.user-card .user-name { font-size: 13.5px; margin-bottom: 4px; }
.user-card .user-role { font-size: 11.5px; }
.login-form { max-width: 340px; margin: 0 auto; }
.login-form .form-input {
  text-align: center; margin-bottom: 12px; background: var(--surface-3);
}
.login-btn {
  width: 100%; padding: 12px; border-radius: var(--radius-m);
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  border: 1px solid #4f46e5;
  box-shadow: 0 6px 20px -6px rgba(99,102,241,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
  color: white; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all var(--transition-fast);
}
.login-btn:hover { background: linear-gradient(180deg, #7376f3, #5b54ea); }
.login-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── INLINE EDIT ────────────────────────────────────────── */
.inline-edit {
  background: var(--surface-2); border: 1px solid rgba(99,102,241,0.4);
  border-radius: 5px; padding: 4px 8px; color: var(--text-1);
  font-size: 13px; font-family: var(--font-mono);
  width: 90px; text-align: right;
}
.inline-edit:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-5);
  animation: fadeIn 0.3s ease;
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state .empty-title { font-size: 16px; font-weight: 600; color: var(--text-3); margin-bottom: 8px; }
.empty-state .empty-desc { font-size: 13px; max-width: 300px; margin: 0 auto; }
.empty-state.all-clear .empty-icon { color: var(--green-light); opacity: 0.7; }
.empty-state.all-clear .empty-title { color: var(--green-light); }
.empty-state.all-clear .empty-desc { color: var(--text-4); }

/* ── ANIMATIONS ─────────────────────────────────────────── */
@keyframes kpiSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.kpi:nth-child(1) { animation-delay: 0s; }
.kpi:nth-child(2) { animation-delay: 0.06s; }
.kpi:nth-child(3) { animation-delay: 0.12s; }
.kpi:nth-child(4) { animation-delay: 0.18s; }

@keyframes sevPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 16px rgba(239,68,68,0.7); }
}

@keyframes rowStagger {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.alert-row { animation: rowStagger 0.3s ease both; }
.alert-row:nth-child(1) { animation-delay: 0s; }
.alert-row:nth-child(2) { animation-delay: 0.04s; }
.alert-row:nth-child(3) { animation-delay: 0.08s; }
.alert-row:nth-child(4) { animation-delay: 0.12s; }
.alert-row:nth-child(5) { animation-delay: 0.16s; }
.alert-row:nth-child(6) { animation-delay: 0.20s; }
.alert-row:nth-child(7) { animation-delay: 0.24s; }

@keyframes detailFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.detail-panel { animation: detailFade 0.25s ease; }

/* ── CONTENT TRANSITIONS ───────────────────────────────── */
@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.content-animated { animation: contentFadeIn 0.25s ease; }

/* ── CONTEXT MENU ──────────────────────────────────────── */
.context-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  min-width: 180px; z-index: 100;
  background: rgba(22,23,28,0.95); backdrop-filter: blur(16px);
  border: 1px solid var(--border-2); border-radius: var(--radius-m);
  padding: 4px; box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  animation: dropIn 0.15s ease;
}
.context-menu-item {
  padding: 8px 12px; border-radius: 6px; font-size: 12.5px;
  color: var(--text-2); cursor: pointer; transition: background var(--transition-fast);
  display: flex; align-items: center; gap: 8px;
}
.context-menu-item:hover { background: rgba(255,255,255,0.06); color: white; }

/* ── UTILITY ────────────────────────────────────────────── */
.text-red { color: var(--red-light); }
.text-amber { color: var(--amber-light); }
.text-green { color: var(--green-light); }
.text-blue { color: var(--blue-light); }
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-5); }
.text-sm { font-size: 11.5px; }
.text-right { text-align: right; }
.fw-600 { font-weight: 600; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-28 { margin-bottom: 28px; }
.hidden { display: none !important; }
