/* =========================================================
   APLN Dashboard — Brand CSS
   Colors: Red #E31E24 | Navy #1F2855 | Yellow #F5B82E
   Font: Open Sans
   ========================================================= */

:root {
  --apln-red: #E31E24;
  --apln-red-dark: #B5181D;
  --apln-navy: #1F2855;
  --apln-navy-dark: #141B3D;
  --apln-navy-light: #3D5680;
  --apln-yellow: #F5B82E;
  --apln-yellow-soft: #FFE5A8;
  --apln-cream: #F8F5F0;
  --apln-border: #E5E5E5;
  --apln-text: #1F2855;
  --apln-text-soft: #5C6781;
  --apln-text-mute: #8893AE;
  --bg-page: #FFFFFF;
  --bg-soft: #F8F9FB;
  --sidebar-width: 240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #E8EAF0;
  color: var(--apln-text);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: #C5CAD6; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--apln-navy-light); }

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--apln-navy-dark);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: var(--apln-navy);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}

.brand-square {
  width: 40px;
  height: 40px;
  background: var(--apln-red);
  border-radius: 7px;
  flex-shrink: 0;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-apln {
  font-weight: 800;
  font-size: 28px;
  color: #fff;
  letter-spacing: 0.05em;
  line-height: 1;
}

.brand-sub {
  font-weight: 500;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 3px;
}

.brand-pln {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.pln-badge-text {
  font-weight: 800;
  font-size: 22px;
  color: var(--apln-red);
  letter-spacing: -0.02em;
}

.pln-badge-ins {
  font-size: 11px;
  font-style: italic;
  color: rgba(255,255,255,0.6);
  font-family: 'Open Sans', sans-serif;
}

.sidebar-section-label {
  padding: 18px 16px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  position: relative;
}

.nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-left-color: rgba(255,255,255,0.3);
}

.nav-link.active {
  background: rgba(227,30,36,0.15);
  color: #fff;
  border-left-color: var(--apln-red);
  font-weight: 700;
}

.nav-icon {
  font-size: 12px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-label { flex: 1; }

.nav-badge {
  font-size: 9px;
  font-weight: 700;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  padding: 2px 6px;
  border-radius: 10px;
  letter-spacing: 0.04em;
}

.nav-link.active .nav-badge {
  background: rgba(227,30,36,0.3);
  color: rgba(255,255,255,0.8);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-footer-text {
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-footer-sub {
  font-size: 9px;
  color: rgba(255,255,255,0.2);
  margin-top: 3px;
}

/* ── Main Content ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 0 0 40px 0;
}

/* ── Page Header ───────────────────────────────────────── */
.page-header {
  background: var(--bg-page);
  padding: 22px 32px 18px;
  border-bottom: 1px solid var(--apln-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
}

.page-header::after {
  content: '';
  position: absolute;
  left: 32px;
  bottom: -1px;
  height: 3px;
  width: 64px;
  background: var(--apln-red);
}

.header-left { display: flex; flex-direction: column; gap: 3px; }

.eyebrow {
  font-weight: 700;
  font-size: 10px;
  color: var(--apln-red);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.page-title {
  font-weight: 800;
  font-size: 24px;
  color: var(--apln-navy);
  line-height: 1.1;
}

.page-sub {
  font-weight: 400;
  font-size: 12px;
  color: var(--apln-text-soft);
}

.header-right {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding-top: 4px;
}

.pln-logo-block {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.pln-text-logo {
  font-weight: 800;
  font-size: 32px;
  color: var(--apln-red);
  letter-spacing: -0.03em;
  position: relative;
}

.pln-dot-logo {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--apln-yellow);
  border-radius: 50%;
  margin-left: -2px;
  vertical-align: super;
  font-size: 0;
}

.pln-ins-logo {
  font-size: 16px;
  font-style: italic;
  color: var(--apln-navy);
  margin-left: 4px;
  margin-bottom: 4px;
  font-family: 'Open Sans', sans-serif;
}

.tagline {
  font-weight: 600;
  font-size: 9px;
  color: var(--apln-navy);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--apln-yellow);
  padding-bottom: 2px;
  margin-bottom: 6px;
}

/* ── Filter Bar ────────────────────────────────────────── */
.filter-bar {
  background: var(--bg-soft);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--apln-border);
}

.filter-label {
  font-weight: 700;
  font-size: 10px;
  color: var(--apln-navy);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Searchable autocomplete filter dropdown (replaces native selects) */
.autocomplete-filter { position: relative; }
.autocomplete-trigger {
  text-align: left; cursor: pointer; min-width: 160px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: #fff;
}
.autocomplete-trigger::after { content: '▾'; float: right; color: #8893AE; margin-left: 6px; }
.autocomplete-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 1200;
  width: 260px; max-width: 80vw; background: #fff;
  border: 1px solid #E5E5E5; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(31,40,85,0.15); padding: 8px;
}
.autocomplete-search {
  width: 100%; box-sizing: border-box; padding: 7px 9px;
  border: 1px solid #E5E5E5; border-radius: 6px; font-size: 12px;
  font-family: inherit; margin-bottom: 6px;
}
.autocomplete-actions {
  display: flex; justify-content: flex-end;
  padding: 0 4px 6px; margin-bottom: 4px; border-bottom: 1px solid #EEE;
}
.ac-clear {
  background: none; border: none; color: var(--apln-red);
  font-size: 11px; font-weight: 600; cursor: pointer; padding: 0;
}
.ac-clear:hover { text-decoration: underline; }
.autocomplete-list { max-height: 260px; overflow-y: auto; }
.autocomplete-option {
  display: flex; align-items: center;
  gap: 8px; padding: 6px 9px; border-radius: 6px; cursor: pointer;
  font-size: 12px; color: #1F2855; margin: 0;
}
.autocomplete-option:hover { background: #F4F6FB; }
.autocomplete-option .ac-cb { flex-shrink: 0; margin: 0; cursor: pointer; }
.autocomplete-option .opt-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autocomplete-option .opt-count { color: #8893AE; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.autocomplete-empty { padding: 10px 9px; color: #8893AE; font-size: 12px; text-align: center; }

/* Cross-filter chip (shown just under the filter bar when a chart click
   applies a cross-filter). */
.cross-filter-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 32px 0;
  padding: 6px 6px 6px 12px;
  width: fit-content;
  max-width: calc(100% - 64px);
  background: rgba(227,30,36,0.10);
  border: 1px solid rgba(227,30,36,0.35);
  border-radius: 16px;
  font-size: 12px;
  color: var(--apln-navy);
}

.cross-filter-chip[hidden] { display: none; }

/* Trend chart drill-down breadcrumb */
.trend-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 32px 0;
  font-size: 12px;
  color: var(--apln-navy);
}
.trend-breadcrumb:empty { display: none; }
.tb-crumb { font-weight: 600; }
.tb-crumb.link { color: var(--apln-red); cursor: pointer; text-decoration: underline; }
.tb-crumb.link:hover { color: var(--apln-red-dark, #B5181D); }
.tb-crumb.active { color: var(--apln-navy); }
.tb-sep { color: #8893AE; }
.tb-reset {
  margin-left: 6px;
  border: 1px solid var(--apln-border);
  background: #fff;
  color: var(--apln-navy);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
}
.tb-reset:hover { background: var(--bg-soft, #f4f6fb); }
.tb-hint { color: #8893AE; font-style: italic; margin-left: auto; font-size: 11px; }

/* Choropleth map legend (min → gradient → max) */
.choropleth-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--apln-navy);
  font-variant-numeric: tabular-nums;
}
.choropleth-legend:empty { display: none; }
.choropleth-legend .cl-end { flex-shrink: 0; }
.choropleth-legend .cl-bar {
  flex: 1;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(to right, rgb(254,224,210), rgb(153,0,13));
}

/* Server-side sortable table headers */
table.apln-table thead th.th-sortable { cursor: pointer; user-select: none; }
table.apln-table thead th.th-sortable:hover { background: var(--apln-navy-light); }
table.apln-table thead th.th-sorted { background: var(--apln-navy-light); }
.sort-arrow { font-size: 9px; opacity: 0.9; }

/* Cross-filterable table rows */
tr.clickable-row { cursor: pointer; }
tr.clickable-row:hover td { background: rgba(31,40,85,0.06); }
tr.clickable-row.row-selected td {
  background: rgba(227,30,36,0.10);
  box-shadow: inset 3px 0 0 var(--apln-red);
}

.cross-filter-chip .cf-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cross-filter-chip .cf-clear {
  flex-shrink: 0;
  border: none;
  background: var(--apln-red);
  color: #fff;
  width: 18px;
  height: 18px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cross-filter-chip .cf-clear:hover { background: var(--apln-red-dark, #B5181D); }

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-field-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--apln-text-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.filter-input,
.filter-select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--apln-border);
  border-radius: 6px;
  background: #fff;
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  color: var(--apln-text);
  outline: none;
  transition: border-color 0.15s;
}

.filter-input:focus,
.filter-select:focus {
  border-color: var(--apln-navy);
  box-shadow: 0 0 0 2px rgba(31,40,85,0.08);
}

.filter-select { padding-right: 28px; cursor: pointer; }

.filter-spacer { flex: 1; min-width: 8px; }

.btn-apply {
  height: 32px;
  padding: 0 16px;
  background: var(--apln-red);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s;
}

.btn-apply:hover { background: var(--apln-red-dark); }

.btn-reset {
  height: 32px;
  padding: 0 14px;
  background: transparent;
  color: var(--apln-text-soft);
  border: 1px solid var(--apln-border);
  border-radius: 6px;
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-reset:hover { border-color: var(--apln-navy); color: var(--apln-navy); }

/* ── Section Band ──────────────────────────────────────── */
.section-band {
  margin: 22px 32px 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--apln-red);
  display: flex;
  align-items: center;
  gap: 10px;
}

.accent-square {
  width: 10px;
  height: 10px;
  background: var(--apln-red);
  flex-shrink: 0;
  display: block;
}

.section-title {
  font-weight: 800;
  font-size: 13px;
  color: var(--apln-navy);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-count {
  font-weight: 500;
  font-size: 11px;
  color: var(--apln-text-mute);
  margin-left: auto;
}

/* ── KPI Grid ──────────────────────────────────────────── */
.kpi-row {
  display: grid;
  padding: 0 32px;
  margin-bottom: 10px;
  gap: 12px;
}

.kpi-row.k4 { grid-template-columns: repeat(4, 1fr); }
.kpi-row.k3 { grid-template-columns: repeat(3, 1fr); }
.kpi-row.k6 { grid-template-columns: repeat(6, 1fr); }

.kpi-card {
  background: var(--bg-page);
  border-radius: 8px;
  padding: 14px 16px;
  border: 1px solid var(--apln-border);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--apln-navy);
}

.kpi-card.accent::before { background: var(--apln-yellow); }
.kpi-card.critical::before { background: var(--apln-red); }

.kpi-label {
  font-weight: 600;
  font-size: 10px;
  color: var(--apln-text-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  line-height: 1.3;
}

.kpi-value {
  font-weight: 800;
  font-size: 20px;
  color: var(--apln-navy);
  line-height: 1;
  letter-spacing: -0.02em;
}

.kpi-value.red { color: var(--apln-red); }
.kpi-value.yellow { color: #C49019; }

.kpi-suffix {
  font-size: 10px;
  color: var(--apln-text-mute);
  margin-top: 5px;
  line-height: 1.3;
}

/* ── Chart Layout ──────────────────────────────────────── */
.chart-row {
  padding: 0 32px;
  display: grid;
  gap: 12px;
  margin-bottom: 10px;
}

.chart-row.r2-eq { grid-template-columns: 1fr 1fr; }
.chart-row.r2-13 { grid-template-columns: 2fr 1fr; }
.chart-row.r2-31 { grid-template-columns: 1fr 2fr; }
.chart-row.r1 { grid-template-columns: 1fr; }

/* ── Chart Card ────────────────────────────────────────── */
.chart-card {
  background: var(--bg-page);
  border-radius: 8px;
  padding: 16px 18px;
  border: 1px solid var(--apln-border);
}

.chart-subtitle {
  font-weight: 700;
  font-size: 10px;
  color: var(--apln-red);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.chart-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--apln-navy);
  margin-bottom: 10px;
  line-height: 1.3;
}

.chart-insight {
  font-size: 11px;
  color: var(--apln-text-soft);
  font-style: italic;
  margin-top: 10px;
}

.chart-canvas-wrap {
  position: relative;
  height: 180px;
}

/* Donut / flex layout */
.chart-card-flex {
  display: flex;
  gap: 20px;
  align-items: center;
}

.chart-donut-wrap {
  width: 160px;
  height: 160px;
  flex-shrink: 0;
  position: relative;
}

.chart-donut-info { flex: 1; }

.custom-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-label { color: var(--apln-text-soft); }
.legend-value { font-weight: 700; color: var(--apln-navy); margin-left: auto; }

/* ── Tables ────────────────────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  border-radius: 6px;
  margin-top: 10px;
}

/* Fixed-height scrollable table body with a sticky header — keeps very long
   tables (e.g. full ICD-10 list) from stretching the whole page. */
.table-scroll-fixed {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid var(--apln-border);
}

.table-scroll-fixed table.apln-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

table.apln-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

table.apln-table thead th {
  background: var(--apln-navy);
  color: #fff;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 9px 8px;
  text-align: left;
  white-space: nowrap;
}

table.apln-table thead th:first-child { padding-left: 14px; }

table.apln-table thead th.sortable { cursor: pointer; user-select: none; }
table.apln-table thead th.sortable:hover { background: var(--apln-navy-light); }

.sort-icon { font-size: 9px; opacity: 0.5; }

table.apln-table tbody td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--apln-border);
  color: var(--apln-text);
  vertical-align: middle;
}

table.apln-table tbody td:first-child {
  padding-left: 14px;
  color: var(--apln-navy);
  font-weight: 600;
}

table.apln-table tbody tr:nth-child(even) td { background: var(--apln-cream); }
table.apln-table tbody tr:hover td { background: rgba(31,40,85,0.04); }

td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

th.num { text-align: right; }

.loading-cell {
  text-align: center;
  color: var(--apln-text-mute);
  font-style: italic;
  padding: 20px !important;
}

.error-cell {
  text-align: center;
  color: var(--apln-red);
  font-style: italic;
  padding: 20px !important;
}

/* ── Status Badges ─────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-finished { background: #E8F5E9; color: #2E7D32; }
.badge-checked  { background: rgba(31,40,85,0.1); color: var(--apln-navy); }
.badge-draft    { background: #F5F5F5; color: #757575; }
.badge-review   { background: rgba(227,30,36,0.1); color: var(--apln-red); }
.badge-watch    { background: var(--apln-yellow-soft); color: #8B6A00; }
.badge-ok       { background: #E8F5E9; color: #2E7D32; }

/* ── Red mismatch highlight ────────────────────────────── */
.mismatch-high { color: var(--apln-red); font-weight: 700; }

/* ── Map Placeholder ───────────────────────────────────── */
.map-placeholder {
  height: 200px;
  background: linear-gradient(135deg, #E8EAF0 0%, #F8F9FB 100%);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--apln-border);
  gap: 6px;
  text-align: center;
  padding: 16px;
  margin-top: 10px;
}

.map-icon { font-size: 32px; opacity: 0.3; }
.map-text { font-weight: 700; font-size: 13px; color: var(--apln-text-mute); }
.map-sub { font-size: 11px; color: var(--apln-text-mute); font-style: italic; }

.map-provinces {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
}

.province-chip {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(31,40,85,0.08);
  color: var(--apln-navy);
  letter-spacing: 0.04em;
}

.province-chip.dominant {
  background: var(--apln-navy);
  color: #fff;
}

/* ── Search Bar ────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 8px;
  margin: 10px 0 0;
}

.search-input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--apln-border);
  border-radius: 6px;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: var(--apln-text);
  outline: none;
}

.search-input:focus {
  border-color: var(--apln-navy);
  box-shadow: 0 0 0 2px rgba(31,40,85,0.08);
}

.btn-search {
  height: 36px;
  padding: 0 16px;
  background: var(--apln-navy);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-search:hover { background: var(--apln-navy-light); }

/* ── Pagination ────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 0 0;
}

.page-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border: 1px solid var(--apln-border);
  background: #fff;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  color: var(--apln-text);
}

.page-btn.active {
  background: var(--apln-navy);
  color: #fff;
  border-color: var(--apln-navy);
  font-weight: 700;
}

.page-btn:hover:not(.active) { border-color: var(--apln-navy); }

.page-info {
  font-size: 11px;
  color: var(--apln-text-mute);
  margin-right: 8px;
}

/* ── Page Footer ───────────────────────────────────────── */
.page-footer {
  padding: 12px 32px;
  border-top: 1px solid var(--apln-border);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--apln-text-mute);
  margin-top: 16px;
}

.footer-accent {
  display: inline-block;
  width: 20px;
  height: 3px;
  background: var(--apln-red);
  margin-right: 8px;
  vertical-align: middle;
}

/* ── Mobile Nav Toggle ─────────────────────────────────── */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--apln-navy);
  color: #fff;
  border: none;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.2);
  }

  .mobile-nav-toggle { display: flex; align-items: center; justify-content: center; }

  .main-content {
    margin-left: 0;
    padding-top: 56px;
  }

  .chart-row.r2-eq,
  .chart-row.r2-13,
  .chart-row.r2-31 {
    grid-template-columns: 1fr;
  }

  .kpi-row.k4 { grid-template-columns: repeat(2, 1fr); }
  .kpi-row.k3 { grid-template-columns: repeat(2, 1fr); }

  .chart-card-flex { flex-direction: column; }
  .chart-donut-wrap { width: 120px; height: 120px; }
}

@media (max-width: 640px) {
  .kpi-row.k4, .kpi-row.k3 { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; gap: 12px; }
  .header-right { display: none; }
  .filter-bar { padding: 12px 16px; }
  .kpi-row, .chart-row, .section-band, .page-footer { padding-left: 16px; padding-right: 16px; }
}

/* ── Data coverage disclaimer ────────────────────────────── */
.data-disclaimer {
  margin: 0 32px 12px 32px;
  padding: 10px 16px;
  background: var(--apln-yellow-soft);
  border-left: 3px solid var(--apln-yellow);
  border-radius: 6px;
  font-size: 12px;
  color: var(--apln-text-soft);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.disclaimer-icon {
  color: #C49019;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}
