/* ============================================================
   TSG Airline Micro AI — Design System
   ============================================================ */

:root {
  --font-display: 'Sora', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'Barlow', 'Inter', monospace;

  --orange-50:  #FFF2E8;
  --orange-100: #FFD9BF;
  --orange-200: #FFB07E;
  --orange-300: #FF8847;
  --orange-400: #F97316;
  --orange-500: #ED6B2A;
  --orange-600: #D45817;
  --orange-700: #A94410;

  --green-500: #22C55E;
  --red-500:   #EF4444;
  --amber-500: #F59E0B;
  --blue-500:  #3B82F6;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.15);

  --sidebar-w: 268px;
}

/* ---------- Dark Theme ---------- */
[data-theme="dark"] {
  --bg: #0A0A0C;
  --bg-elevated: #141418;
  --surface: #17171B;
  --surface-2: #1E1E22;
  --surface-hover: #22222A;
  --border: #2A2A32;
  --border-strong: #3A3A45;

  --text-primary: #F5F5F7;
  --text-secondary: #A8A8B0;
  --text-tertiary: #6E6E78;
  --text-inverse: #0A0A0C;

  --accent: var(--orange-500);
  --accent-soft: rgba(237, 107, 42, 0.12);
  --accent-strong: var(--orange-400);

  --success: #4ADE80;
  --danger:  #F87171;
  --warning: #FBBF24;
  --info:    #60A5FA;

  --sidebar-bg: #0F0F12;
  --header-bg: rgba(10, 10, 12, 0.85);

  color-scheme: dark;
}

/* ---------- Light Theme ---------- */
[data-theme="light"] {
  --bg: #F8F7F4;
  --bg-elevated: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #FAFAF7;
  --surface-hover: #F2F1EC;
  --border: #E8E6DF;
  --border-strong: #D5D2CA;

  --text-primary: #0F0F12;
  --text-secondary: #5A5A62;
  --text-tertiary: #8E8E96;
  --text-inverse: #FFFFFF;

  --accent: var(--orange-500);
  --accent-soft: rgba(237, 107, 42, 0.10);
  --accent-strong: var(--orange-600);

  --success: #16A34A;
  --danger:  #DC2626;
  --warning: #D97706;
  --info:    #2563EB;

  --sidebar-bg: #F3F1EB;
  --header-bg: rgba(248, 247, 244, 0.85);

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

/* ---------- Layout ---------- */
#app-root { min-height: 100vh; display: flex; }

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.content {
  padding: 28px 32px 48px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Brand ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 4px;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--orange-400), var(--orange-600));
  display: grid;
  place-items: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(237, 107, 42, 0.25);
}
.brand-logo svg { width: 22px; height: 22px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.brand-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

/* ---------- Sidebar user ---------- */
.sidebar-user {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange-500);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar > svg { width: 55%; height: 55%; }
.chat-input-wrap > svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.explain-badge > svg { width: 10px; height: 10px; }
.audit-item .avatar > svg { width: 14px; height: 14px; }
.nav-icon { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon > svg { width: 100%; height: 100%; }
.icon-btn > svg { width: 16px; height: 16px; }
.pill-btn > svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn > svg { width: 15px; height: 15px; flex-shrink: 0; }
.content-eyebrow > svg { width: 12px; height: 12px; display:inline-block; vertical-align:-2px; }
.walkthrough-bar .label > svg { width: 14px; height: 14px; }
.rules-list .check > svg { width: 12px; height: 12px; }
.breadcrumb .sep > svg { width: 10px; height: 10px; display:inline-block; vertical-align:-1px; }
.engine-status .label > svg { width: 12px; height: 12px; display:inline-block; vertical-align:-1px; }
.evidence-item .link > svg { width: 10px; height: 10px; display:inline-block; vertical-align:-1px; }
.ai-tag > svg { width: 10px; height: 10px; display:inline-block; vertical-align:-1px; }
.chevron > svg { width: 14px; height: 14px; }
.gov-card .title > svg { width: 14px; height: 14px; display:inline-block; vertical-align:-2px; }
.wt-step .num + svg { width: 10px; height: 10px; }
.route-code > svg { width: 14px; height: 14px; display:inline-block; vertical-align:-2px; }
.toast-icon > svg { width: 18px; height: 18px; }
.topbar-user .info > svg, .brand-logo > svg { width: 60%; height: 60%; }
.sidebar-user .info > svg { width: 14px; height: 14px; }
.sidebar-user .name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.sidebar-user .role { color: var(--text-tertiary); font-size: 11px; line-height: 1.2; margin-top: 2px; }

/* ---------- Sidebar nav ---------- */
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  padding: 0 10px 6px;
}
.nav-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  text-decoration: none;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item .nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-badge {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.nav-item.active .nav-badge {
  background: var(--accent);
  color: white;
}
.nav-item.active .chevron { opacity: 1; }
.chevron { opacity: 0; width: 14px; height: 14px; transition: opacity 0.15s; }

/* ---------- Status widget ---------- */
.status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 8px;
}
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.status-row .label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}
.status-dot.blue { background: var(--info); box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15); }
.status-dot.orange { background: var(--accent); box-shadow: 0 0 0 3px rgba(237, 107, 42, 0.15); }
.status-dot.amber { background: var(--warning); box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15); }
.status-row .value { font-weight: 600; color: var(--text-primary); font-size: 11px; }
.status-row .value.orange { color: var(--accent); }

/* ---------- Governance card ---------- */
.gov-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: auto;
}
.gov-card .title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
}
.gov-card p {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---------- Topbar ---------- */
.topbar-left { display: flex; align-items: center; gap: 20px; }
.topbar-title { display: flex; flex-direction: column; }
.topbar-title .module { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.topbar-title .page { font-size: 10px; letter-spacing: 0.14em; color: var(--accent); font-weight: 700; text-transform: uppercase; }

.engine-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}
.engine-status .label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.engine-pill {
  background: rgba(74, 222, 128, 0.12);
  color: var(--success);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}
.engine-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-user { display: flex; align-items: center; gap: 10px; padding-left: 10px; }
.topbar-user .info { display: flex; flex-direction: column; align-items: flex-end; }
.topbar-user .name { font-weight: 600; font-size: 13px; }
.topbar-user .role { font-size: 11px; color: var(--text-tertiary); }

/* ---------- Icon button ---------- */
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.icon-btn svg { width: 16px; height: 16px; }

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.pill-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.pill-btn svg { width: 14px; height: 14px; }

/* ---------- Content header ---------- */
.content-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.content-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.content-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 10px;
  line-height: 1.5;
  max-width: 720px;
}

.content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.content-header-actions {
  display: flex;
  gap: 10px;
  padding-top: 20px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.btn.btn-lg { padding: 12px 20px; font-size: 14px; }

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
}
.btn-ghost:hover { background: var(--surface-hover); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--border);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.08); border-color: var(--danger); }

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.btn-success:hover { opacity: 0.9; }

/* ---------- KPI card ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 130px;
  display: flex;
  flex-direction: column;
}
.kpi-card .label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.kpi-card .value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 2px;
}
.kpi-card .value .suffix {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-left: 6px;
}
.kpi-card .value .prefix {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-right: 6px;
}
.kpi-card .sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: auto;
  padding-top: 8px;
}
.kpi-card.accent {
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border-color: rgba(237, 107, 42, 0.3);
}
.kpi-card.accent .value { color: var(--accent); }

/* ---------- KPI + stat hover micro-interactions ---------- */
.kpi-card {
  cursor: default;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease,
              background 0.22s ease;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(237, 107, 42, 0.08), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
[data-theme="light"] .kpi-card:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
}
.kpi-card:hover::before { opacity: 1; }
.kpi-card.accent:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(237, 107, 42, 0.18);
}
.kpi-card .value {
  transition: letter-spacing 0.22s ease;
}
.kpi-card:hover .value {
  letter-spacing: -0.025em;
}

/* Explain badge pulses to accent on hover */
.explain-badge {
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.explain-badge:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(237, 107, 42, 0.25);
}

/* ---------- Explain badge ---------- */
.explain-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.explain-badge:hover { border-color: var(--accent); }
.explain-badge svg { width: 10px; height: 10px; }

/* ---------- Module cards ---------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.module-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.module-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.module-card .icon svg { width: 20px; height: 20px; }
.module-card .title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.module-card .desc {
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.module-card .stats {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.module-card .stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}
.module-card .stat-row .v { font-weight: 600; color: var(--text-primary); font-family: var(--font-mono); }
.module-card .stat-row .v.accent { color: var(--accent); }
.module-card .stat-row .v.green { color: var(--success); }
.module-card .cta {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
}
.module-card .cta.pulse {
  background: var(--accent-soft);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.audit-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1200px) {
  .audit-layout { grid-template-columns: 1fr; }
}
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

/* ---------- Rules list ---------- */
.rules-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.rules-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
}
.rules-list .check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.rules-list .check svg { width: 11px; height: 11px; }

/* ---------- Table ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-tools {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 8px;
  flex: 1;
  max-width: 320px;
}
.search-box svg { width: 14px; height: 14px; color: var(--text-tertiary); flex-shrink: 0; }
.search-box input {
  background: none;
  border: none;
  outline: none;
  flex: 1;
  font-size: 13px;
}

.filter-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 8px; }
.filter-tab {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.filter-tab:hover { color: var(--text-primary); }
.filter-tab.active { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--surface-2);
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
table.data-table th.sortable { cursor: pointer; }
table.data-table th.sortable:hover { color: var(--text-primary); }
table.data-table th .sort-ind { opacity: 0.5; margin-left: 4px; }
table.data-table th.active .sort-ind { opacity: 1; color: var(--accent); }

table.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data-table tbody tr { transition: background 0.1s; cursor: pointer; }
table.data-table tbody tr:hover { background: var(--surface-hover); }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table td.mono { font-family: var(--font-mono); font-weight: 600; }
table.data-table td.right { text-align: right; }
table.data-table .id-cell { font-family: var(--font-mono); color: var(--text-tertiary); font-size: 12px; }
table.data-table .amount { font-family: var(--font-mono); font-weight: 600; }
table.data-table .amount.accent { color: var(--accent); }

/* Status pill */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.badge.success { background: rgba(74, 222, 128, 0.12); color: var(--success); border-color: transparent; }
.badge.warning { background: rgba(251, 191, 36, 0.12); color: var(--warning); border-color: transparent; }
.badge.danger { background: rgba(248, 113, 113, 0.12); color: var(--danger); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.info { background: rgba(96, 165, 250, 0.12); color: var(--info); border-color: transparent; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.confidence-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 80px;
}
.confidence-track {
  flex: 1;
  height: 5px;
  background: var(--surface-2);
  border-radius: 10px;
  overflow: hidden;
  min-width: 50px;
}
.confidence-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
}
.confidence-fill.high { background: var(--success); }
.confidence-fill.med { background: var(--warning); }
.confidence-value { font-family: var(--font-mono); font-weight: 600; font-size: 11px; min-width: 28px; }

.urgency-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.urgency-pill.high { background: rgba(248, 113, 113, 0.12); color: var(--danger); }
.urgency-pill.med { background: rgba(251, 191, 36, 0.12); color: var(--warning); }
.urgency-pill.low { background: rgba(74, 222, 128, 0.12); color: var(--success); }

.table-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}
.bulk-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s;
}
.checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox.checked::after {
  content: '';
  width: 8px;
  height: 4px;
  border: 1.5px solid white;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translateY(-1px);
}

/* ---------- Audit trail ---------- */
.audit-list { display: flex; flex-direction: column; gap: 14px; }
.audit-item { display: flex; gap: 12px; align-items: flex-start; }
.audit-item .avatar { flex-shrink: 0; }
.audit-item .body { flex: 1; min-width: 0; }
.audit-item .act-line { font-weight: 600; font-size: 13px; }
.audit-item .sub-line { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
.audit-item .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 6px;
}
.ai-tag svg { width: 10px; height: 10px; }

/* ---------- Case detail ---------- */
.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.case-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}
.case-panel .ph {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.case-panel .ph-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  font-family: var(--font-display);
}
.case-panel .ph-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
}
.case-panel .ph-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}
.case-panel .ph-body p { margin-bottom: 10px; }
.case-panel .ph-body strong { color: var(--text-primary); font-weight: 600; }
.case-panel .ph-body code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.evidence-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.evidence-item {
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
}
.evidence-item .key { font-weight: 600; color: var(--text-primary); font-family: var(--font-mono); font-size: 11.5px; }
.evidence-item .val { color: var(--text-secondary); margin-top: 2px; }
.evidence-item .link { color: var(--accent); font-weight: 500; font-size: 11px; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }

.calc-steps {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
}
.calc-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  border-bottom: 1px dashed var(--border);
}
.calc-row:last-child { border-bottom: none; }
.calc-row.total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 2px solid var(--border-strong);
  border-bottom: none;
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
}

/* ---------- Action buttons on case ---------- */
.case-actions {
  display: flex;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ---------- Document preview ---------- */
.doc-preview {
  background: #FFFFFF;
  color: #111;
  border-radius: 8px;
  padding: 20px;
  font-family: 'Georgia', serif;
  font-size: 12px;
  line-height: 1.6;
  min-height: 240px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
}
.doc-preview h4 { font-family: 'Georgia', serif; margin-bottom: 10px; font-size: 14px; }
.doc-preview .doc-meta { font-size: 10.5px; color: #666; margin-bottom: 14px; }
.doc-preview .doc-table { width: 100%; margin: 10px 0; border-collapse: collapse; font-size: 11px; }
.doc-preview .doc-table td { padding: 4px 8px; border: 1px solid #ddd; }
.doc-preview .doc-sig { margin-top: 24px; padding-top: 10px; border-top: 1px dashed #999; font-size: 11px; color: #333; }

/* ---------- Ask the data chat ---------- */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 180px); max-height: 760px; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-message { display: flex; gap: 12px; }
.chat-message.user { flex-direction: row-reverse; }
.chat-message .bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
}
.chat-message.ai .bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}
.chat-message.user .bubble {
  background: var(--accent);
  color: white;
  border-top-right-radius: 4px;
}
.chat-message .bubble strong { font-weight: 600; }
.chat-message .citation {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-tertiary);
}
.chat-input-wrap {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}
.chat-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
}
.chat-starter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.chat-starter button {
  padding: 7px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}
.chat-starter button:hover { background: var(--surface-hover); color: var(--text-primary); border-color: var(--accent); }

/* ---------- Custom Select ---------- */
.cs {
  position: relative;
  width: 100%;
}
.cs-trigger {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  padding-right: 40px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  cursor: pointer;
  min-height: 44px;
}
.cs-trigger:hover { background: var(--surface-hover); }
.cs-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cs.open .cs-trigger {
  border-color: var(--accent);
  background: var(--surface-hover);
}
.cs-trigger .cs-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  transition: transform 0.2s;
  pointer-events: none;
}
.cs.open .cs-trigger .cs-chevron {
  transform: translateY(-50%) rotate(180deg);
  color: var(--accent);
}
.cs-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-trigger .cs-sub {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px;
  box-shadow: var(--shadow-lg);
  z-index: 10;
  display: none;
  max-height: 260px;
  overflow-y: auto;
  animation: csFade 0.14s ease;
}
@keyframes csFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cs.open .cs-menu { display: block; }
.cs-option {
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  transition: background 0.1s;
}
.cs-option .cs-opt-sub {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.cs-option:hover { background: var(--surface-hover); }
.cs-option.selected {
  background: var(--accent-soft);
  color: var(--accent);
}
.cs-option.selected .cs-opt-sub { color: var(--accent); opacity: 0.75; }
.cs-option .cs-check {
  margin-left: auto;
  opacity: 0;
  color: var(--accent);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.cs-option.selected .cs-check { opacity: 1; }
.cs-option-body { flex: 1; min-width: 0; overflow: hidden; }
.cs-option-body > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Textarea in modal */
.cs-textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  transition: border-color 0.15s;
}
.cs-textarea:focus { border-color: var(--accent); background: var(--surface-hover); }
.cs-textarea::placeholder { color: var(--text-tertiary); }

.cs-label {
  display: block;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

/* ---------- Phase cards (full-width stacked case detail) ---------- */
.phase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 18px;
  position: relative;
}
.phase-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.phase-head .spacer { flex: 1; }
.phase-chip {
  padding: 5px 11px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-display);
}
.phase-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.phase-body { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; }
.phase-body p { margin-bottom: 10px; }
.phase-body strong { color: var(--text-primary); font-weight: 600; }
.phase-body code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.phase-narrative { font-size: 14px; line-height: 1.65; }

.grid-2-1 {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) {
  .grid-2-1 { grid-template-columns: 1fr; }
}

/* Phase 1 horizontal stat strip */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1200px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}
.stat-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 92px;
}
.stat-tile-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-tile-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 4px;
  line-height: 1.1;
}
.stat-tile-value.accent { color: var(--accent); }
.stat-tile-value.danger { color: var(--danger); }
.stat-tile-value.warning { color: var(--warning); }
.stat-tile-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-tile .pb { margin-top: 6px; }

/* Rule chip in Phase 2 header */
.rule-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
}

/* Rule grid (horizontal rule card) */
.rule-grid {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  overflow: hidden;
}
.rule-grid-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
}
.rule-grid-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
}
@media (max-width: 900px) {
  .rule-grid-body { grid-template-columns: 1fr; }
}
.rule-grid-cell {
  padding: 10px 14px;
  background: var(--surface-2);
}
.rgc-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.rgc-value {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.4;
}

/* 5:4 grid for evidence+calc */
.grid-5-4 {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) {
  .grid-5-4 { grid-template-columns: 1fr; }
}

/* Sub-heads */
.sub-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Evidence grid */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.evidence-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
}
.evidence-card .key { font-weight: 700; color: var(--text-primary); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.evidence-card .val { color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }
.evidence-card .link {
  color: var(--accent);
  font-weight: 500;
  font-size: 11.5px;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.evidence-card .link:hover { text-decoration: underline; }
.evidence-card .link svg { width: 11px; height: 11px; }

/* Headline recommendation banner */
.headline-recc {
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid rgba(237, 107, 42, 0.3);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
}
.headline-recc-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.headline-recc-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  font-family: var(--font-display);
}

/* Workflow vertical stepper */
.wf-vertical {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.wf-vertical::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border);
  z-index: 0;
}
.wfv-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  position: relative;
  padding-bottom: 14px;
}
.wfv-item:last-child { padding-bottom: 0; }
.wfv-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-tertiary);
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  z-index: 1;
}
.wfv-marker svg { width: 12px; height: 12px; }
.wfv-item.done .wfv-marker {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.wfv-item.current .wfv-marker {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.wfv-body { padding-top: 4px; }
.wfv-label { font-weight: 600; font-size: 13px; color: var(--text-primary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wfv-item.current .wfv-label::after {
  content: 'Now';
  background: var(--accent);
  color: white;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.wfv-item:not(.done):not(.current) .wfv-label { color: var(--text-secondary); }
.wfv-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* ---------- Rule card (Why panel) ---------- */
.rule-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 14px;
}
.rule-code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}
.rule-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-top: 2px;
}
.rule-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.rule-table td {
  padding: 7px 0;
  font-size: 12px;
  border-bottom: 1px dashed var(--border);
  vertical-align: top;
}
.rule-table td:first-child {
  color: var(--text-tertiary);
  font-weight: 600;
  width: 42%;
  padding-right: 12px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rule-table td:last-child { color: var(--text-primary); }
.rule-table tr:last-child td { border-bottom: none; }

/* ---------- Step list (What to do) ---------- */
.step-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.step-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent);
  color: white;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  margin-top: 2px;
}
.step-title { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.step-detail { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }
.step-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
}
.step-meta svg { width: 11px; height: 11px; }

/* ---------- Workflow strip ---------- */
.workflow-strip {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 0;
  overflow-x: auto;
}
.wf-stage {
  min-width: 94px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.wf-circle {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-tertiary);
  border: 1.5px solid var(--border);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}
.wf-circle svg { width: 12px; height: 12px; }
.wf-stage.done .wf-circle {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.wf-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.wf-meta {
  font-size: 10px;
  color: var(--text-tertiary);
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.wf-arrow {
  margin-top: 10px;
  color: var(--border-strong);
}
.wf-arrow svg { width: 14px; height: 14px; }

/* ---------- Simulator panel (Route Studio case) ---------- */
.simulator-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.sim-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 14px;
}
@media (max-width: 1200px) {
  .sim-layout { grid-template-columns: 1fr; }
}
.sim-section-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sim-field {
  margin-bottom: 14px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.sim-field-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.sim-field-label {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-primary);
}
.sim-field-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--accent);
}
.sim-field-note {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
}
.sim-field input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 10px;
  outline: none;
  margin: 6px 0 2px;
}
.sim-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.sim-field input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
}
.sim-dow-row { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.sim-dow-btn {
  padding: 7px 10px;
  min-width: 44px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.sim-dow-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.sim-dow-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.sim-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sim-kpi {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.sim-kpi.green { border-left: 3px solid var(--success); }
.sim-kpi.red { border-left: 3px solid var(--danger); }
.sim-kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.sim-kpi-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.sim-kpi.red .sim-kpi-value { color: var(--danger); }
.sim-kpi.green .sim-kpi-value { color: var(--success); }
.sim-kpi-unit { font-size: 11px; font-weight: 500; color: var(--text-tertiary); }
.sim-kpi-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.sim-insights {
  background: var(--accent-soft);
  border: 1px solid rgba(237, 107, 42, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
}
.sim-insight-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sim-insight-head svg { width: 12px; height: 12px; }

.sim-saved-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s;
}
.sim-saved-row:hover { border-color: var(--accent); }
.sim-saved-row.best {
  border-color: rgba(237, 107, 42, 0.5);
  background: var(--accent-soft);
}

/* ---------- Linked case card ---------- */
.linked-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.linked-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}
.linked-title { font-weight: 600; font-size: 13px; color: var(--text-primary); margin-top: 6px; }
.linked-sub { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; font-family: var(--font-mono); }
.linked-why { color: var(--text-secondary); line-height: 1.5; margin-top: 8px; font-size: 12.5px; }

.linked-modal-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.linked-modal-kpis > div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.linked-modal-kpis .label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}
.linked-modal-kpis .value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
}
.linked-modal-kpis .value.accent { color: var(--accent); }

/* ---------- Explain modal (xp- prefix) ---------- */
.xp-body { max-height: 72vh; overflow-y: auto; }
.xp-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.xp-section:last-child { border-bottom: none; padding-bottom: 0; }
.xp-section:first-child { padding-top: 0; }
.xp-section-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.xp-list {
  padding-left: 18px;
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.xp-list li { margin-bottom: 4px; }
.xp-list code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.xp-conf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.xp-conf-table th { text-align: left; padding: 6px 0; font-size: 10.5px; color: var(--text-tertiary); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.xp-conf-table th.right { text-align: right; }
.xp-conf-table td { padding: 7px 0; border-bottom: 1px dashed var(--border); }
.xp-conf-table td.right { text-align: right; }
.xp-conf-table tr:last-child td { border-bottom: none; }

.xp-example {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 560px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}
.modal.wide { max-width: 760px; }
.modal.mega { max-width: 1000px; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 10px; }
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.modal-close { color: var(--text-tertiary); padding: 4px; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--border); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Toast ---------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  min-width: 280px;
  max-width: 400px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.25s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.danger { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast .toast-icon { color: var(--accent); flex-shrink: 0; }
.toast .toast-icon svg { width: 18px; height: 18px; }
.toast .toast-content { flex: 1; }
.toast .toast-title { font-weight: 600; font-size: 13px; }
.toast .toast-msg { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
@keyframes slideInRight { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- Executive dashboard ---------- */
.exec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.exec-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.exec-stage .step {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.exec-stage .amt {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.exec-stage .by {
  color: var(--text-tertiary);
  font-size: 11px;
  margin-top: 4px;
}
.exec-stage.identified .step { color: var(--info); }
.exec-stage.approved .step { color: var(--accent); }
.exec-stage.raised .step { color: var(--warning); }
.exec-stage.recovered .step { color: var(--success); }

/* ---------- Walkthrough bar ---------- */
.walkthrough-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.walkthrough-bar .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.walkthrough-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }
.wt-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.wt-step .num {
  width: 18px; height: 18px; border-radius: 50%; background: var(--surface);
  display: grid; place-items: center; font-weight: 700; font-size: 10px;
  color: var(--text-tertiary);
}
.wt-step:hover { background: var(--surface-hover); color: var(--text-primary); }
.wt-step.active { background: var(--accent); color: white; border-color: var(--accent); }
.wt-step.active .num { background: rgba(255,255,255,0.2); color: white; }
.wt-step.done .num { background: var(--success); color: white; }

/* ---------- Flight timeline ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}
.timeline-item.highlight::before { background: var(--accent); }
.timeline-item .ti-time { font-size: 11px; color: var(--text-tertiary); font-family: var(--font-mono); }
.timeline-item .ti-title { font-weight: 600; font-size: 13px; margin-top: 2px; }
.timeline-item .ti-body { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ---------- Route card ---------- */
.route-list { display: flex; flex-direction: column; gap: 10px; }
.route-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.15s;
}
.route-card:hover { border-color: var(--accent); }
.route-code {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}
.route-code svg { width: 14px; height: 14px; color: var(--text-tertiary); }
.route-stats { display: flex; gap: 20px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }
.route-stats .label { color: var(--text-tertiary); font-size: 11px; }
.route-stats .v { font-weight: 600; color: var(--text-primary); font-family: var(--font-mono); }
.route-stats .v.red { color: var(--danger); }
.route-stats .v.green { color: var(--success); }

/* ---------- Progress bar component ---------- */
.pb {
  width: 100%;
  height: 6px;
  background: var(--surface-2);
  border-radius: 10px;
  overflow: hidden;
}
.pb-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
  transition: width 0.5s ease;
}
.pb-fill.green { background: var(--success); }
.pb-fill.red { background: var(--danger); }
.pb-fill.amber { background: var(--warning); }

/* ---------- Chart (SVG-based) ---------- */
.chart-wrap { padding: 10px 0; }
.chart-axis { font-size: 10px; fill: var(--text-tertiary); font-family: var(--font-mono); }
.chart-grid { stroke: var(--border); stroke-dasharray: 2 4; }
.chart-bar { fill: var(--accent); }
.chart-bar.success { fill: var(--success); }
.chart-bar.danger { fill: var(--danger); }
.chart-line { stroke: var(--accent); stroke-width: 2; fill: none; }
.chart-area { fill: var(--accent-soft); }
.chart-dot { fill: var(--accent); }
.chart-label { font-size: 10px; fill: var(--text-tertiary); font-family: var(--font-mono); text-anchor: middle; }

/* ---------- Fleet grid ---------- */
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.fleet-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.fleet-tile:hover { border-color: var(--accent); }
.fleet-tile .tail { font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.fleet-tile .type { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.fleet-tile .health { margin-top: 6px; }
.fleet-tile.warning { border-color: var(--warning); background: rgba(251, 191, 36, 0.05); }
.fleet-tile.danger { border-color: var(--danger); background: rgba(248, 113, 113, 0.05); }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}
.breadcrumb a {
  color: var(--text-tertiary);
  cursor: pointer;
}
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: var(--text-primary); font-weight: 500; }

/* ---------- Persona switcher dropdown ---------- */
.dropdown {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 240px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 100;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: background 0.1s;
}
.dropdown-item:hover { background: var(--surface-hover); }
.dropdown-item .d-title { font-weight: 600; font-size: 13px; }
.dropdown-item .d-desc { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.dropdown-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.dropdown-item.active .d-desc { color: var(--accent); opacity: 0.8; }

/* ---------- Section head ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 24px 0 14px;
}
.section-head h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}
.section-head .sub { font-size: 12px; color: var(--text-tertiary); }

/* ---------- Footer ---------- */
.app-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

/* ---------- Utility ---------- */
.row { display: flex; gap: 8px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.text-tertiary { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-mono { font-family: var(--font-mono); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.gap-sm { gap: 6px !important; }
.gap-lg { gap: 20px !important; }

/* ---------- Universal hover micro-interactions ---------- */
.stat-tile,
.exec-stage,
.evidence-card,
.sim-kpi,
.wfv-item,
.rule-grid-cell {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s ease,
              border-color 0.2s ease,
              background 0.2s ease;
}

.stat-tile { cursor: default; }
.stat-tile:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .stat-tile:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05); }

.exec-stage:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .exec-stage:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05); }

.evidence-card {
  cursor: pointer;
}
.evidence-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--surface-hover);
}

.sim-kpi:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.sim-kpi.green:hover { border-color: var(--success); }
.sim-kpi.red:hover { border-color: var(--danger); }

/* Vertical workflow items pop on hover */
.wfv-item:hover .wfv-marker {
  transform: scale(1.08);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.wfv-marker { transition: transform 0.2s, box-shadow 0.2s; }

/* Rule grid cells highlight on hover */
.rule-grid-cell { cursor: default; }
.rule-grid-cell:hover { background: var(--surface-hover); }

/* Audit items highlight */
.audit-item {
  padding: 10px 12px;
  margin: -10px -12px;
  border-radius: 10px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.audit-item:hover {
  background: var(--surface-hover);
  transform: translateX(2px);
}

/* Phase cards get a subtle lift */
.phase-card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.phase-card:hover { border-color: var(--border-strong); }

/* Step items in What-to-do highlight on hover */
.step-item { transition: all 0.2s ease; cursor: default; }
.step-item:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  transform: translateX(2px);
}
.step-item .step-num { transition: transform 0.2s ease; }
.step-item:hover .step-num { transform: scale(1.1); }

/* Nav items slide slightly */
.nav-item { transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1); }
.nav-item:not(.active):hover {
  transform: translateX(3px);
  background: var(--surface-hover);
}

/* Walkthrough steps */
.wt-step { transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1); }
.wt-step:hover { transform: translateY(-1px); }
.wt-step.active:hover { transform: translateY(-1px) scale(1.02); }

/* Status rows in sidebar hover */
.status-row { transition: color 0.15s ease; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; }
.status-row:hover { background: var(--surface-hover); }

/* Buttons microanimation */
.btn { transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(237, 107, 42, 0.3);
}
.btn-secondary:hover { transform: translateY(-1px); }

/* Pill buttons */
.pill-btn { transition: all 0.18s ease; }
.pill-btn:hover { transform: translateY(-1px); }
.icon-btn { transition: all 0.18s ease; }
.icon-btn:hover { transform: translateY(-1px); }

/* Table rows */
table.data-table tbody tr { transition: background 0.15s ease, box-shadow 0.15s ease; }
table.data-table tbody tr:hover {
  background: var(--surface-hover);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* Linked card lift */
.linked-card { transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.linked-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(237, 107, 42, 0.15);
}

/* Simulator saved rows */
.sim-saved-row { transition: all 0.18s ease; }
.sim-saved-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .sim-saved-row:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); }

/* ---------- Entrance stagger on dashboard load ---------- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.kpi-grid > .kpi-card,
.module-grid > .module-card,
.exec-grid > .exec-stage {
  animation: fadeSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.kpi-grid > .kpi-card:nth-child(1),
.module-grid > .module-card:nth-child(1),
.exec-grid > .exec-stage:nth-child(1) { animation-delay: 40ms; }
.kpi-grid > .kpi-card:nth-child(2),
.module-grid > .module-card:nth-child(2),
.exec-grid > .exec-stage:nth-child(2) { animation-delay: 90ms; }
.kpi-grid > .kpi-card:nth-child(3),
.module-grid > .module-card:nth-child(3),
.exec-grid > .exec-stage:nth-child(3) { animation-delay: 140ms; }
.kpi-grid > .kpi-card:nth-child(4),
.module-grid > .module-card:nth-child(4),
.exec-grid > .exec-stage:nth-child(4) { animation-delay: 190ms; }

.phase-card {
  animation: fadeSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.phase-card:nth-of-type(1) { animation-delay: 60ms; }
.phase-card:nth-of-type(2) { animation-delay: 120ms; }
.phase-card:nth-of-type(3) { animation-delay: 180ms; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.1ms !important;
  }
}

/* ---------- Spinner ---------- */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Fade in ---------- */
.fade-in { animation: fadeIn 0.25s ease; }

/* ---------- Responsive scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ---------- Smaller screens ---------- */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .exec-grid { grid-template-columns: repeat(2, 1fr); }
  .case-grid { grid-template-columns: 1fr; }
  .two-col, .three-col { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { width: 72px; min-width: 72px; }
  .brand-name, .brand-tag, .nav-label, .nav-badge, .sidebar-user .info, .gov-card, .nav-section-label, .status-list { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .sidebar-user { justify-content: center; padding: 8px; }
}
