/* ============================================================
   BINUH Human Rights — Sexual Violence Dashboard
   Shared stylesheet (dark theme, UN blue #009EDB)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ── Variables (UN-friendly palette: UN Blue #009EDB) ───────── */
:root {
  --bg:          #0c1f3a;
  --bg-card:     #122a4d;
  --bg-card2:    #163258;
  --bg-hover:    #1a3965;
  --border:      rgba(0,158,219,0.2);
  --border-glow: rgba(0,158,219,0.4);

  --text:        #e8f1fa;
  --text-muted:  #8ba8c4;
  --text-dim:    #5a7a9a;

  --accent:      #009EDB;
  --accent2:     #4da6e8;

  /* Violation palette */
  --killed:    #f43f5e;
  --injured:   #fb923c;
  --abducted:  #c084fc;
  --crsv:      #34d399;

  /* Gender palette */
  --male:   #60a5fa;
  --female: #f472b6;
  --boys:   #93c5fd;
  --girls:  #f9a8d4;

  /* Perpetrator palette */
  --militia:       #fbbf24;
  --conventional:  #818cf8;
  --opportunistic: #34d399;

  /* State palette */
  --state-warrap:   #f43f5e;
  --state-central:  #c084fc;
  --state-unity:    #60a5fa;
  --state-lakes:    #34d399;
  --state-eastern:  #fb923c;
  --state-western:  #2dd4bf;
  --state-jonglei:  #a78bfa;
  --state-upper:    #94a3b8;
  --state-wbeg:     #f59e0b;
  --state-nbeg:     #ec4899;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.45);
  --shadow-card: 0 2px 16px rgba(0,0,0,0.4), 0 0 0 1px var(--border);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1e3a5c; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2a4a70; }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(12,31,58,0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 62px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.navbar-brand img { height: 38px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}
.brand-sub { font-size: 11px; color: var(--text-muted); }
.navbar-divider { width: 1px; height: 28px; background: var(--border); flex-shrink: 0; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}
.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link:hover { background: var(--bg-card2); color: var(--text); }
.nav-link.active {
  background: rgba(0,158,219,0.15);
  color: var(--accent);
  font-weight: 600;
}
.nav-badge {
  font-size: 10px;
  background: var(--accent);
  color: #000;
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 700;
}
.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;           /* flush to trigger — no gap to cross */
  left: 0;
  padding-top: 6px;    /* visual gap lives inside the element, hover area stays connected */
  min-width: 180px;
  z-index: 100;
}
/* inner box */
.dropdown-menu::before {
  content: '';
  display: block;
}
.dropdown-menu-inner {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu { display: block; }
.dropdown-item {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
  text-decoration: none;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text); }
.dropdown-item.active { color: var(--accent); }

/* ── Page Header ───────────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, #122a4d 0%, #163258 50%, #122a4d 100%);
  border-bottom: 1px solid var(--border);
  padding: 32px 32px 28px;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(0,158,219,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: -80px; left: 20%;
  width: 400px; height: 200px;
  background: radial-gradient(ellipse, rgba(77,166,232,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.page-header-inner { position: relative; z-index: 1; }
.page-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,158,219,0.12);
  border: 1px solid rgba(0,158,219,0.3);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
}
.page-title span { color: var(--accent); }
.page-subtitle { font-size: 14px; color: var(--text-muted); max-width: 600px; }
.page-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}
.meta-item strong { color: var(--text-muted); }

/* ── Layout ────────────────────────────────────────────────── */
.container { max-width: 1440px; margin: 0 auto; padding: 0 24px; }
.main { padding: 28px 0 60px; }
.section { margin-bottom: 40px; }
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-kpi  { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .page-header { padding: 20px; }
  .container { padding: 0 16px; }
  .navbar { padding: 0 16px; }
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card), 0 0 20px rgba(0,158,219,0.08);
}
.card-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── KPI Cards ─────────────────────────────────────────────── */
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.kpi-card.victims::before       { background: var(--accent); }
.kpi-card.sv-collective::before { background: var(--killed); }
.kpi-card.sv-rape::before       { background: var(--injured); }
.kpi-card.gangs::before         { background: var(--crsv); }
.kpi-card.total::before   { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.kpi-card.male::before    { background: var(--male); }
.kpi-card.female::before  { background: var(--female); }
.kpi-card.boys::before    { background: var(--boys); }
.kpi-card.girls::before   { background: var(--girls); }
.kpi-card.militia::before       { background: var(--militia); }
.kpi-card.conventional::before  { background: var(--conventional); }
.kpi-card.opportunistic::before { background: var(--opportunistic); }
.kpi-card.sgbv::before    { background: linear-gradient(90deg, var(--female), var(--girls)); }

/* ── SGBV Note Box (overview page) ─────────────────────────── */
.sgbv-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 16px;
  padding: 16px 20px;
  background: rgba(244,114,182,0.07);
  border: 1px solid rgba(244,114,182,0.3);
  border-left: 4px solid var(--female);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}
.sgbv-note-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}
.sgbv-note-body strong {
  color: var(--text);
}
.sgbv-note-count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--female);
}
.sgbv-note-link {
  display: inline-block;
  margin-left: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--female);
  opacity: 0.85;
  white-space: nowrap;
}
.sgbv-note-link:hover { opacity: 1; text-decoration: underline; }

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  margin-bottom: 6px;
}
.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.kpi-pct {
  font-size: 13px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.kpi-pct.up   { background: rgba(52,211,153,0.12); color: var(--crsv); }
.kpi-pct.down { background: rgba(244,63,94,0.12);  color: var(--killed); }
.kpi-icon {
  position: absolute;
  right: 18px; top: 18px;
  font-size: 28px;
  opacity: 0.18;
}

/* ── Chart Containers ──────────────────────────────────────── */
.chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.chart-wrap:hover { border-color: rgba(0,158,219,0.35); }
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
  gap: 12px;
  flex-wrap: wrap;
}
.chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.chart-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.4;
  flex-basis: 100%;
}
.chart-explain {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: rgba(0, 158, 219, 0.06);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.lang-switch {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-right: 8px;
  flex-shrink: 0;
}
.lang-btn {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.lang-btn:hover { color: var(--text); border-color: rgba(0, 158, 219, 0.35); }
.lang-btn.active {
  background: rgba(0, 158, 219, 0.2);
  color: var(--accent);
  border-color: rgba(0, 158, 219, 0.45);
}
.page-disclaimer {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  max-width: 720px;
  line-height: 1.6;
}
.section-intro {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(0, 158, 219, 0.05);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.chart-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.chart-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}
.chart-badge.q4 { background: rgba(0,158,219,0.15); color: var(--accent); border: 1px solid rgba(0,158,219,0.25); }
.chart-badge.yearly { background: rgba(77,166,232,0.12); color: var(--accent2); border: 1px solid rgba(77,166,232,0.2); }

.chart-download-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 8px;
}
.chart-download-actions .btn-download-chart,
.chart-download-actions .btn-download-data {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.chart-download-actions .btn-download-chart:hover,
.chart-download-actions .btn-download-data:hover {
  background: rgba(0,158,219,0.15);
  color: var(--accent);
  border-color: rgba(0,158,219,0.35);
}

.chart-export-footnote {
  font-size: 10px;
  color: var(--text-muted);
  padding: 8px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* Chart plotly containers */
.plotly-chart { width: 100%; min-height: 320px; }

/* ── Insight Box ───────────────────────────────────────────── */
.insight-box {
  background: linear-gradient(135deg, rgba(0,158,219,0.08), rgba(77,166,232,0.05));
  border: 1px solid rgba(0,158,219,0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}
.insight-heading { font-size: 14px; font-weight: 600; color: var(--text); margin: 0 0 10px; }
.insight-box strong { color: var(--accent); }
.insight-box .highlight { color: var(--text); font-weight: 600; }
.insight-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.insight-list li { display: flex; align-items: flex-start; gap: 8px; }
.insight-list li::before { content: '▸'; color: var(--accent); flex-shrink: 0; margin-top: 1px; }

/* ── Footer downloads ─────────────────────────────────────── */
.footer-downloads { margin-top: 12px; font-size: 13px; }
.footer-dl-sep { margin: 0 8px; color: var(--text-dim); }
.footer-dl-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.footer-dl-link:hover { text-decoration: underline; }

/* ── Stat Row ──────────────────────────────────────────────── */
.stat-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: none; }
.stat-row-label { flex: 1; font-size: 13px; color: var(--text-muted); }
.stat-row-value { font-weight: 700; font-size: 15px; color: var(--text); font-family: 'Space Grotesk', sans-serif; }
.stat-row-bar { flex: 2; height: 6px; background: var(--bg-card2); border-radius: 3px; overflow: hidden; }
.stat-row-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }

/* ── Table ─────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,158,219,0.1);
  color: var(--text);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(0,158,219,0.06); }
.data-table .rank { color: var(--text-dim); font-size: 12px; width: 30px; }
.data-table .total-col { font-weight: 700; color: var(--text); font-family: 'Space Grotesk', sans-serif; }
.data-table .bar-col { width: 100px; }

/* ── Filter Bar ────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.filter-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-right: 4px; }
.filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.filter-btn:hover { background: var(--bg-card2); color: var(--text); border-color: rgba(0,158,219,0.35); }
.filter-btn.active { background: rgba(0,158,219,0.15); color: var(--accent); border-color: rgba(0,158,219,0.35); font-weight: 600; }

/* ── Legend ────────────────────────────────────────────────── */
.legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-sq { width: 12px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* ── Change Indicators ─────────────────────────────────────── */
.change { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; }
.change.up   { color: var(--killed); }
.change.down { color: var(--crsv); }
.change.neutral { color: var(--text-muted); }

/* ── Progress Bars ─────────────────────────────────────────── */
.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.progress-label { width: 110px; font-size: 12px; color: var(--text-muted); text-align: right; flex-shrink: 0; }
.progress-track { flex: 1; height: 8px; background: var(--bg-card2); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.progress-val { width: 48px; font-size: 12px; font-weight: 600; color: var(--text); font-family: 'Space Grotesk', sans-serif; }

/* ── Footer ────────────────────────────────────────────────── */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 24px 32px;
  text-align: center;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
footer p { font-size: 12px; color: var(--text-dim); }
footer a { color: var(--text-muted); }
footer strong { color: var(--text-muted); font-weight: 600; }

/* ── Map ───────────────────────────────────────────────────── */
#map, #sgbv-map { width: 100%; height: 560px; border-radius: var(--radius); }
.leaflet-popup-content-wrapper {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  box-shadow: var(--shadow);
}
.leaflet-popup-tip { background: var(--bg-card2); }
.popup-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--accent); }
.popup-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 2px 0; }
.popup-row span:first-child { color: var(--text-muted); }
.popup-row span:last-child { font-weight: 600; }

/* ── Map Sidebar ───────────────────────────────────────────── */
.map-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
@media (max-width: 900px) { .map-layout { grid-template-columns: 1fr; } }
.map-sidebar { display: flex; flex-direction: column; gap: 16px; }
.map-legend-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes countUp { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.fade-up { animation: fadeUp 0.5s ease both; }
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }
.stagger-5 { animation-delay: 0.25s; }

/* ── Utilities ─────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-killed  { color: var(--killed); }
.text-injured { color: var(--injured); }
.text-abducted{ color: var(--abducted); }
.text-crsv    { color: var(--crsv); }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'Space Grotesk', monospace; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }

/* ── Loading State ─────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-dim);
  font-size: 13px;
  gap: 10px;
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Quarter Comparison Bar ────────────────────────────────── */
.quarter-bar { display: flex; gap: 3px; height: 40px; align-items: flex-end; }
.quarter-bar-seg {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height 0.6s ease;
  cursor: pointer;
}
.quarter-bar-seg:hover { opacity: 0.8; }

/* ── Donut Center Text ─────────────────────────────────────── */
.donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.donut-center-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.donut-center-label { font-size: 11px; color: var(--text-muted); }

/* ── Heatmap cell ──────────────────────────────────────────── */
.heatmap-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  transition: opacity 0.2s;
  min-height: 32px;
}

/* ── Responsive nav ────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links { gap: 2px; }
  .nav-link { padding: 5px 10px; font-size: 12px; }
}
@media (max-width: 600px) {
  .brand-sub { display: none; }
  .navbar-divider { display: none; }
}

.kpi-card.killed::before { background: var(--killed); }
.kpi-card.injured::before { background: var(--injured); }
.kpi-card.abducted::before { background: var(--abducted); }
