/* ===== HORMUZ SITMON — Military Intelligence Theme ===== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --bg: #0a0c10;
  --bg-card: rgba(12, 16, 24, 0.75);
  --bg-card-solid: #0c1018;
  --surface: rgba(16, 22, 34, 0.85);
  --surface-hover: rgba(20, 28, 42, 0.9);
  --border: rgba(0, 255, 136, 0.08);
  --border-hover: rgba(0, 255, 136, 0.18);
  --text: #c8d6e5;
  --text-muted: #5a6a7e;
  --text-faint: #2e3a4c;
  --accent: #00ff88;
  --accent-dim: rgba(0, 255, 136, 0.15);
  --cyan: #00d4ff;
  --cyan-dim: rgba(0, 212, 255, 0.12);
  --red: #ff3355;
  --red-dim: rgba(255, 51, 85, 0.12);
  --amber: #ffaa00;
  --amber-dim: rgba(255, 170, 0, 0.10);
  --green: #00ff88;
  --iran-color: #44cc44;
  --radius: 6px;
  --radius-lg: 10px;
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --glow-red: 0 0 20px rgba(255, 51, 85, 0.15), inset 0 0 20px rgba(255, 51, 85, 0.03);
  --glow-amber: 0 0 20px rgba(255, 170, 0, 0.12), inset 0 0 20px rgba(255, 170, 0, 0.03);
  --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.12), inset 0 0 20px rgba(0, 212, 255, 0.03);
  --glow-green: 0 0 20px rgba(0, 255, 136, 0.12), inset 0 0 20px rgba(0, 255, 136, 0.03);
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow: hidden;
  height: 100dvh;
}

/* --- WebGL Background --- */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- Scan-line Overlay --- */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  mix-blend-mode: overlay;
}

/* --- Vignette --- */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.6) 100%);
}

/* --- Dashboard Grid --- */
.dashboard {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
  grid-row: 1 / -1;
  background: rgba(8, 10, 16, 0.92);
  backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.radar-logo { position: relative; flex-shrink: 0; }

.radar-sweep {
  transform-box: fill-box;
  transform-origin: 0% 100%;
  animation: sweep 3s linear infinite;
  will-change: transform;
}
@keyframes sweep { to { transform: rotate(360deg); } }

.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 3px;
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.nav-item:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
.nav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(0, 255, 136, 0.15);
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}
.nav-item svg, .nav-item i { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 16px 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.threat-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
#threat-radar { width: 44px; height: 44px; flex-shrink: 0; }
.threat-text { display: flex; flex-direction: column; }
.threat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 2px;
}
.threat-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  text-shadow: 0 0 10px rgba(255, 51, 85, 0.5);
  animation: pulse-text 2s ease-in-out infinite;
}
@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.update-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 0;
}

/* --- Header --- */
.header {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(8, 10, 16, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  min-width: 0;
  overflow: hidden;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

.header-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.page-title {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
  mask-image: linear-gradient(to right, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
}
.status-badge.critical {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255, 51, 85, 0.2);
  text-shadow: 0 0 8px rgba(255, 51, 85, 0.3);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
  animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  will-change: opacity, box-shadow;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--red); }
  50% { opacity: 0.4; box-shadow: 0 0 2px var(--red); }
}

.header-right { display: flex; gap: 20px; }
.header-stat { display: flex; flex-direction: column; align-items: flex-end; }
.stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
}
.stat-value.accent { color: var(--red); text-shadow: 0 0 8px rgba(255, 51, 85, 0.3); }

/* --- Main --- */
.main {
  grid-column: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 136, 0.15) transparent;
  min-width: 0;
}

/* --- Sections --- */
.section { display: flex; flex-direction: column; gap: 20px; }
.section.hidden { display: none; }

/* --- KPI Cards --- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  gap: 12px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--transition);
}
.kpi-card:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.kpi-card:hover::before { opacity: 1; }

.kpi-card.glow-red { box-shadow: var(--glow-red); }
.kpi-card.glow-red::before { background: radial-gradient(ellipse at 30% 50%, rgba(255,51,85,0.04), transparent 70%); }
.kpi-card.glow-amber { box-shadow: var(--glow-amber); }
.kpi-card.glow-amber::before { background: radial-gradient(ellipse at 30% 50%, rgba(255,170,0,0.03), transparent 70%); }
.kpi-card.glow-cyan { box-shadow: var(--glow-cyan); }
.kpi-card.glow-cyan::before { background: radial-gradient(ellipse at 30% 50%, rgba(0,212,255,0.03), transparent 70%); }

.kpi-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--accent-dim);
  color: var(--accent);
  flex-shrink: 0;
}
.kpi-card.glow-red .kpi-icon { background: var(--red-dim); color: var(--red); }
.kpi-card.glow-amber .kpi-icon { background: var(--amber-dim); color: var(--amber); }
.kpi-card.glow-cyan .kpi-icon { background: var(--cyan-dim); color: var(--cyan); }
.kpi-icon svg, .kpi-icon i { width: 18px; height: 18px; }

.kpi-content { display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.kpi-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.2;
}
.kpi-delta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.kpi-delta.negative { color: var(--red); }

/* --- Content Grid --- */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.hero-grid { grid-template-columns: 1.5fr 1fr; }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-hover); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-header h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.card-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(0, 255, 136, 0.15);
}
.card-badge.red { background: var(--red-dim); color: var(--red); border-color: rgba(255,51,85,0.2); }
.card-badge.green { background: var(--accent-dim); color: var(--accent); }

.card-body { padding: 16px 18px; }
.card-actions { display: flex; align-items: center; gap: 8px; }

.globe-pause-btn {
  background: rgba(0, 255, 136, 0.06);
  border: 1px solid rgba(0, 255, 136, 0.15);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 4px 6px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.globe-pause-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0, 255, 136, 0.12);
}

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 5px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); }
.btn-icon svg, .btn-icon i { width: 14px; height: 14px; }

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent);
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-live 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  will-change: opacity, box-shadow;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent); }
  50% { opacity: 0.5; box-shadow: 0 0 3px var(--accent); }
}

/* --- Globe Card --- */
.globe-card .card-body {
  position: relative;
  padding: 0;
  height: 420px;
  background: radial-gradient(ellipse at center, rgba(0, 20, 40, 0.3), transparent);
}
#globe-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#globe-canvas:active { cursor: grabbing; }

.globe-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
}
.globe-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.gl-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.gl-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.gl-dot.red { background: var(--red); box-shadow: 0 0 6px var(--red); }
.gl-dot.amber { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.gl-dot.cyan { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.gl-dot.green { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

.globe-coords {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  opacity: 0.5;
  margin-top: 6px;
  letter-spacing: 1px;
}

/* --- Timeline --- */
.timeline-card .card-body {
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.timeline-scroll { padding: 4px 0; }

.timeline-entry {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.timeline-entry:last-child { border-bottom: none; }

.timeline-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  width: 50px;
  flex-shrink: 0;
  padding-top: 2px;
}
.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.timeline-dot.red { background: var(--red); box-shadow: 0 0 8px rgba(255,51,85,0.4); }
.timeline-dot.amber { background: var(--amber); box-shadow: 0 0 8px rgba(255,170,0,0.4); }
.timeline-dot.cyan { background: var(--cyan); box-shadow: 0 0 8px rgba(0,212,255,0.4); }
.timeline-dot.green { background: var(--accent); box-shadow: 0 0 8px rgba(0,255,136,0.4); }

.timeline-text { flex: 1; min-width: 0; }
.timeline-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.timeline-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}

/* --- Chart --- */
.chart-card .card-body { padding: 12px 14px; height: 260px; }
.chart-card .card-body canvas { width: 100% !important; height: 100% !important; }

/* --- Feed --- */
.feed-card .card-body { max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.feed-scroll { padding: 0; }

.feed-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.feed-item:last-child { border-bottom: none; }

.feed-tag {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  height: fit-content;
  margin-top: 2px;
}
.feed-tag.attack { background: var(--red-dim); color: var(--red); }
.feed-tag.maritime { background: var(--cyan-dim); color: var(--cyan); }
.feed-tag.energy { background: var(--amber-dim); color: var(--amber); }
.feed-tag.diplomatic { background: var(--accent-dim); color: var(--accent); }
.feed-tag.military { background: rgba(160, 80, 255, 0.12); color: #b070ff; }

.feed-content { flex: 1; min-width: 0; }
.feed-time {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.feed-text { font-size: 12px; color: var(--text); line-height: 1.4; }
.feed-source { font-size: 10px; color: var(--text-faint); margin-top: 3px; }

/* --- Data Table --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card-solid);
  z-index: 1;
}
.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.data-table tr:hover td { background: var(--surface); }
.data-table tr.baseline td { color: var(--accent); font-weight: 500; }

/* --- Exceptions Grid --- */
.exceptions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.exception-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.exception-item.allowed { border-color: rgba(0, 255, 136, 0.15); }
.exception-item.partial { border-color: rgba(255, 170, 0, 0.15); }
.exception-item.denied { border-color: rgba(255, 51, 85, 0.15); }
.exception-flag { font-size: 24px; flex-shrink: 0; margin-top: 2px; }
.exception-item strong { font-size: 13px; color: var(--text); }
.exception-item p { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }

/* --- Impact Grid --- */
.impact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.impact-item {
  text-align: center;
  padding: 20px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.impact-metric {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
  line-height: 1.2;
}
.impact-label { font-size: 11px; color: var(--text-muted); margin-top: 6px; line-height: 1.3; }

/* --- Force List --- */
.force-list { display: flex; flex-direction: column; gap: 4px; }
.force-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color var(--transition);
}
.force-item:hover { border-color: var(--border-hover); }
.force-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  height: fit-content;
  margin-top: 2px;
}
.force-badge.us { background: var(--cyan-dim); color: var(--cyan); border: 1px solid rgba(0,212,255,0.2); }
.force-badge.standby { background: rgba(100,100,120,0.12); color: #888; border: 1px solid rgba(100,100,120,0.2); }
.force-badge.iran { background: rgba(68,204,68,0.1); color: var(--iran-color); border: 1px solid rgba(68,204,68,0.15); }
.force-badge.iran-active { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,51,85,0.2); }
.force-item strong { font-size: 13px; color: var(--text); }
.force-item p { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }

/* --- Filter Buttons --- */
.feed-filters { display: flex; gap: 4px; }
.filter-btn {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 100px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { color: var(--text); border-color: var(--border-hover); }
.filter-btn.active { background: var(--accent-dim); color: var(--accent); border-color: rgba(0,255,136,0.2); }

/* --- Intel Full Feed --- */
.intel-full-feed { display: flex; flex-direction: column; gap: 0; }

/* --- Footer --- */
.site-footer {
  position: fixed;
  bottom: 8px;
  right: 16px;
  z-index: 100;
}
.site-footer a {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-faint);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color var(--transition);
}
.site-footer a:hover { color: var(--text-muted); }

/* --- Responsive --- */
@media (max-width: 1200px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .content-grid, .hero-grid { grid-template-columns: 1fr; }
  .exceptions-grid { grid-template-columns: 1fr; }
  .impact-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: 250px;
    z-index: 100;
    transition: left 0.3s ease;
  }
  .sidebar.open { left: 0; }
  .menu-toggle { display: block; }
  .header { grid-column: 1; padding: 10px 14px; gap: 10px; }
  .main { grid-column: 1; padding: 12px; }
  .kpi-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }

  /* Show header stats as a compact row below the title on tablet */
  .header-right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }
  .header-stat { flex-direction: row; align-items: baseline; gap: 4px; }
  .stat-value { font-size: 13px; }
  .stat-label { font-size: 8px; }

  /* Constrain status badge */
  .status-badge {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 8px;
    padding: 3px 8px;
  }

  .page-title { font-size: 13px; }

  .globe-card .card-body { height: 280px; }
  .impact-grid { grid-template-columns: 1fr 1fr; }
  .feed-filters { flex-wrap: wrap; }

  /* Tables scroll horizontally */
  .card-body:has(.data-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 600px; }

  /* KPI cards compact */
  .kpi-card { padding: 12px; gap: 10px; }
  .kpi-value { font-size: 20px; }
  .kpi-delta { font-size: 9px; }
  .kpi-icon { width: 32px; height: 32px; }
  .kpi-icon svg, .kpi-icon i { width: 16px; height: 16px; }

  /* Force list and exceptions */
  .force-item { flex-direction: column; gap: 6px; }
  .exception-item { flex-direction: column; gap: 6px; }

  /* Chart card */
  .chart-card .card-body { height: 220px; }

  /* Feed items */
  .feed-text { font-size: 11px; }

  /* Content gaps */
  .section { gap: 12px; }
  .content-grid { gap: 12px; }
}

@media (max-width: 480px) {
  .dashboard { height: auto; min-height: 100dvh; }
  body { overflow: auto; height: auto; }

  .header {
    flex-wrap: wrap;
    padding: 8px 12px;
  }
  .header-left { width: 100%; }
  .header-right {
    width: 100%;
    justify-content: space-between;
    padding-top: 4px;
    border-top: 1px solid var(--border);
    gap: 8px;
  }
  .stat-value { font-size: 12px; }

  .status-badge { display: none; }

  .main {
    overflow-y: visible;
    padding: 10px;
  }

  .kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card { flex-direction: row; align-items: center; padding: 12px 14px; }
  .kpi-value { font-size: 18px; }

  .globe-card .card-body { height: 240px; }
  .globe-legend { gap: 8px; }
  .gl-item { font-size: 8px; }

  .timeline-card .card-body { max-height: 320px; }

  .chart-card .card-body { height: 180px; }

  .feed-card .card-body { max-height: 300px; }

  .impact-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .impact-item { padding: 14px 8px; }
  .impact-metric { font-size: 22px; }
  .impact-label { font-size: 10px; }

  /* Card padding */
  .card-header { padding: 10px 14px; }
  .card-header h2 { font-size: 11px; }
  .card-body { padding: 12px 14px; }

  .site-footer { bottom: 4px; right: 8px; }
  .site-footer a { font-size: 8px; }
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.section > * { animation: fadeIn 0.4s ease-out both; }
.section > *:nth-child(2) { animation-delay: 0.05s; }
.section > *:nth-child(3) { animation-delay: 0.1s; }
.section > *:nth-child(4) { animation-delay: 0.15s; }

/* Focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* Selection */
::selection { background: rgba(0, 255, 136, 0.2); color: var(--text); }
