:root {
  --bg: #1A1814;
  --surface: #221E18;
  --surface-2: #2A251E;
  --gold: #C5A059;
  --text: #C8BCA8;
  --heading: #FCFAF7;
  --muted: #8A8172;
  --border: rgba(197, 160, 89, 0.16);
  --border-soft: rgba(255, 255, 255, 0.06);

  --reg-cbuae: #4a8fe0;
  --reg-dfsa: #3fae6e;
  --reg-vara: #9b7fe0;
  --reg-adgm: #e0954a;
  --reg-sca: #d9614f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3 { color: var(--heading); margin: 0 0 0.5rem; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}
.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--heading);
}
.logo span { color: var(--gold); }
.site-nav a {
  color: var(--text);
  margin-left: 1.5rem;
  font-size: 0.92rem;
}
.site-nav a:hover { color: var(--gold); }

main { min-height: 60vh; }

/* Hero */
.hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border-soft);
}
.eyebrow {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--gold); margin-bottom: 0.5rem;
}
.lede { color: var(--text); max-width: 68ch; font-size: 1rem; }

.section { padding: 2rem 0; }

/* Stat cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.35rem;
}
.stat-label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); margin-bottom: 0.4rem;
}
.stat-value {
  font-size: 1.75rem; font-weight: 650; color: var(--heading);
  font-variant-numeric: tabular-nums;
}

/* Filter bar */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  align-items: end;
  margin-bottom: 1.25rem;
}
.filter-field { display: flex; flex-direction: column; gap: 0.3rem; }
.filter-field label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--muted);
}
.filter-field input,
.filter-field select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  font-size: 0.88rem;
  font-family: inherit;
}
.filter-field input:focus,
.filter-field select:focus {
  outline: none;
  border-color: var(--gold);
}
.filter-actions { display: flex; gap: 0.5rem; }
.btn {
  background: var(--gold);
  color: #1A1814;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { opacity: 0.9; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.results-count {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

/* Table */
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
thead th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.88rem;
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-link { color: var(--heading); }
.row-link:hover { color: var(--gold); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-CBUAE { background: color-mix(in srgb, var(--reg-cbuae) 20%, transparent); color: var(--reg-cbuae); }
.badge-DFSA  { background: color-mix(in srgb, var(--reg-dfsa) 20%, transparent); color: var(--reg-dfsa); }
.badge-VARA  { background: color-mix(in srgb, var(--reg-vara) 20%, transparent); color: var(--reg-vara); }
.badge-ADGM  { background: color-mix(in srgb, var(--reg-adgm) 20%, transparent); color: var(--reg-adgm); }
.badge-SCA   { background: color-mix(in srgb, var(--reg-sca) 20%, transparent); color: var(--reg-sca); }

.source-link { font-size: 1rem; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.disclaimer-banner {
  background: color-mix(in srgb, var(--gold) 8%, var(--surface));
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text);
}
.disclaimer-banner strong { color: var(--heading); }

/* Pagination */
.pagination {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
}
.pagination a:hover { border-color: var(--gold); text-decoration: none; }
.pagination .current {
  background: var(--gold);
  color: #1A1814;
  font-weight: 700;
  border-color: var(--gold);
}
.pagination .disabled { opacity: 0.35; }

/* Statistics page */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.toggle-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.toggle-group button {
  background: transparent;
  color: var(--text);
  border: none;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}
.toggle-group button.active {
  background: var(--gold);
  color: #1A1814;
  font-weight: 600;
}
.chart-canvas-wrap { position: relative; height: 320px; }

/* Heatmap */
.heatmap-table td, .heatmap-table th { text-align: center; }
.heatmap-cell {
  font-variant-numeric: tabular-nums;
  border-radius: 4px;
}

/* Detail page */
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  max-width: 760px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
  margin: 1.25rem 0;
}
.detail-field .stat-label { margin-bottom: 0.25rem; }
.detail-field .value { color: var(--heading); font-size: 0.95rem; }
.summary-callout {
  background: var(--surface-2);
  border-left: 3px solid var(--gold);
  padding: 1rem 1.1rem;
  margin: 1.25rem 0;
  color: var(--heading);
  font-size: 1.02rem;
  border-radius: 0 6px 6px 0;
}
.back-link { display: inline-block; margin-bottom: 1.25rem; color: var(--muted); }
.back-link:hover { color: var(--gold); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 3rem;
  padding: 2rem 0 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  padding-bottom: 1.5rem;
}
.footer-nav { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-nav a { color: var(--text); font-size: 0.88rem; }
.subscribe-form { display: flex; gap: 0.5rem; }
.subscribe-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  flex: 1;
  font-family: inherit;
}
.subscribe-message { font-size: 0.82rem; color: var(--gold); margin-top: 0.5rem; }
.footer-bottom {
  border-top: 1px solid var(--border-soft);
  padding: 1rem 1.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}
