/* ═══════════════════════════════════════════════════════════
   AUTO REGISTRATION DASHBOARD — STYLES v3
   Light/dark theme · Enhanced design
   Fonts loaded via <link> in HTML for non-blocking rendering
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg-page:       #ffffff;
  --bg-card:       #ffffff;
  --bg-surface:    #f5f7fa;
  --bg-hover:      #eef1f6;
  --bg-active:     #e8edf4;
  --border:        #e2e8f0;
  --border-light:  #d0d7e2;
  --text-primary:  #1a202c;
  --text-secondary:#4a5568;
  --text-muted:    #8494a7;
  --text-dim:      #a0aec0;
  --accent-blue:   #1a56a0;
  --accent-blue-hover: #164b8a;
  --accent-blue-light: #3182ce;
  --accent-blue-bg: rgba(26,86,160,0.06);
  --accent-orange: #e8722a;
  --accent-orange-light: #ed8936;
  --accent-orange-bg: rgba(232,114,42,0.06);
  --accent-green:  #38a169;
  --accent-green-bg: rgba(56,161,105,0.06);
  --accent-red:    #e53e3e;
  --accent-purple: #805ad5;
  --accent-purple-bg: rgba(128,90,213,0.06);
  --accent-cyan:   #319795;
  --gradient-blue:  linear-gradient(135deg, #1a56a0, #3182ce);
  --gradient-orange: linear-gradient(135deg, #e8722a, #ed8936);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow:        0 4px 16px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-xl:     0 16px 48px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.05);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-xs:     4px;
  --transition:    0.2s ease;
  --transition-slow: 0.35s ease;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-surface);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Header ─────────────────────────────────────────────── */
.header {
  background: var(--gradient-blue);
  padding: 2rem 2.5rem 1.75rem;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.header::after {
  content: '';
  position: absolute;
  bottom: -20%; left: 20%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
  pointer-events: none;
}
.header__inner {
  max-width: 1320px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
/* ── Header branding ────────────────────────────────────── */
.header__brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.header__logo {
  height: 52px;
  width: auto;
  flex-shrink: 0;
}
.header__title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.header__sub {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  margin-top: 0.35rem;
  font-weight: 400;
}
.header__period {
  color: rgba(255,255,255,0.75);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  font-weight: 400;
}

/* ── Filters bar ────────────────────────────────────────── */
.filters-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 2.5rem;
  box-shadow: 0 1px 8px rgba(0,0,0,0.03);
}
.filters-bar__inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.filter-group label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
  padding-left: 0.15rem;
}
.filter-group select {
  appearance: none;
  background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238494a7'/%3E%3C/svg%3E") no-repeat right 0.6rem center;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  min-width: 180px;
}
.filter-group select:hover {
  border-color: var(--accent-blue-light);
  box-shadow: 0 2px 8px rgba(26,86,160,0.08);
}
.filter-group select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(26,86,160,0.1);
}
.btn-reset {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.btn-reset:hover {
  background: var(--accent-orange);
  color: white;
  border-color: var(--accent-orange);
  box-shadow: 0 4px 12px rgba(232,114,42,0.25);
  transform: translateY(-1px);
}
.btn-reset:active {
  transform: translateY(0);
}

/* ── Month input ─────────────────────────────────────────── */
.filter-month {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  min-width: 150px;
}
.filter-month:hover {
  border-color: var(--accent-blue-light);
  box-shadow: 0 2px 8px rgba(26,86,160,0.08);
}
.filter-month:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(26,86,160,0.1);
}

/* ── Active filter indicator ────────────────────────────── */
.filter-group select.has-value,
.filter-group .filter-month.has-value {
  border-color: var(--accent-blue);
  background-color: var(--accent-blue-bg);
}
.filter-group select option:disabled {
  color: var(--text-dim);
}

/* ── Main content ───────────────────────────────────────── */
.main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem 2.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Grid layouts ───────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}

/* ── Summary cards row ──────────────────────────────────── */
.summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.summary-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: var(--radius) 0 0 var(--radius);
}
.summary-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.summary-card--blue::before { background: var(--gradient-blue); }
.summary-card--green::before { background: linear-gradient(180deg, #38a169, #48bb78); }
.summary-card--orange::before { background: var(--gradient-orange); }
.summary-card--purple::before { background: linear-gradient(180deg, #805ad5, #9f7aea); }

.summary-card__icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}
.summary-card--blue .summary-card__icon { background: var(--accent-blue-bg); }
.summary-card--green .summary-card__icon { background: var(--accent-green-bg); }
.summary-card--orange .summary-card__icon { background: var(--accent-orange-bg); }
.summary-card--purple .summary-card__icon { background: var(--accent-purple-bg); }

.summary-card__label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}
.summary-card__value {
  font-size: 1.65rem;
  font-weight: 900;
  margin-top: 0.15rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-card__value--text {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.summary-card__value--blue { color: var(--accent-blue); }
.summary-card__value--orange { color: var(--accent-orange); }
.summary-card__value--green { color: var(--accent-green); }
.summary-card__value--purple { color: var(--accent-purple); }
.summary-card__change {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

/* ── Section card ───────────────────────────────────────── */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition-slow);
  position: relative;
}
.section-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/static/brand-bg.png') repeat top left;
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
}
.section-card > * {
  position: relative;
  z-index: 1;
}
.section-card:hover {
  box-shadow: var(--shadow);
}
.section-card__header {
  padding: 1.15rem 1.5rem 0.65rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.section-card__title-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.section-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.3;
}
.section-card__title .icon {
  font-size: 1rem;
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-blue-bg);
  border-radius: var(--radius-xs);
}
.section-card__subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}
.section-card__badge {
  font-size: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-blue);
  background: var(--accent-blue-bg);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-weight: 600;
  border: 1px solid rgba(26,86,160,0.12);
}
.section-card__body {
  padding: 1.25rem 1.5rem 1.5rem;
}

/* ── Chart containers ───────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
  height: 340px;
}
.chart-container--tall {
  height: 420px;
}
.chart-container--short {
  height: 280px;
}
.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ── Map container ──────────────────────────────────────── */
.map-container {
  height: 440px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
#sec-regions.section-card.view-map::before {
  display: none;
}
#sec-regions.view-map .section-card__body {
  padding: 0;
}
#sec-regions .map-container {
  border: none;
  border-radius: 0;
  height: 480px;
}
.map-brand {
  background: rgba(255,255,255,0.9);
  border-radius: 6px;
  padding: 3px 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.map-brand img {
  height: 24px;
  width: auto;
  display: block;
}

/* ── View toggle ────────────────────────────────────────── */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1.5px solid var(--border);
}
.view-toggle__btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.view-toggle__btn.active {
  background: var(--accent-blue);
  color: white;
  box-shadow: 0 2px 6px rgba(26,86,160,0.25);
}
.view-toggle__btn:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ── Data table ─────────────────────────────────────────── */
.data-table-wrapper {
  max-height: 400px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.data-table th {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.62rem;
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
  z-index: 2;
}
.data-table td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.78rem;
}
.data-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  width: 32px;
}
.data-table td.name-cell {
  font-weight: 600;
}
.data-table td.number-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.75rem;
  text-align: right;
}
.data-table td.pct-cell {
  text-align: right;
  width: 70px;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:hover td {
  background: var(--bg-hover);
}
/* Dynamics table overrides */
.data-table--dynamics td:first-child {
  width: auto;
  white-space: nowrap;
}
.dynamics-td-month {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: nowrap;
  text-align: center !important;
}
.dynamics-th-month {
  white-space: nowrap;
  width: 90px;
  text-align: center !important;
}
.dynamics-th-num {
  text-align: center !important;
}
.data-table--dynamics td.number-cell {
  text-align: center !important;
}

/* percent bar in table */
.pct-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}
.pct-bar {
  width: 50px; height: 5px;
  background: var(--bg-surface);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.pct-bar__fill {
  height: 100%;
  border-radius: 10px;
  background: var(--accent-blue);
  transition: width 0.5s ease;
}
.pct-bar__text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: right;
}

/* ── Loading overlay ────────────────────────────────────── */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: var(--radius);
  backdrop-filter: blur(2px);
}
.loading-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Leaflet overrides ──────────────────────────────────── */
.leaflet-container {
  background: var(--bg-surface) !important;
  font-family: 'Inter', sans-serif !important;
}
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border) !important;
  padding: 0 !important;
}
.leaflet-popup-tip {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-top: none !important;
  border-left: none !important;
}
.leaflet-popup-content {
  font-family: 'Inter', sans-serif !important;
  font-size: 0.85rem !important;
  margin: 0.65rem 0.85rem !important;
  line-height: 1.5 !important;
}
.leaflet-popup-content strong {
  color: var(--accent-blue);
  font-weight: 700;
}
.leaflet-popup-content .popup-count {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-primary);
}
.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
  font-weight: 700 !important;
  width: 30px !important;
  height: 30px !important;
  line-height: 28px !important;
}
.leaflet-control-zoom a:hover {
  background: var(--bg-hover) !important;
}
.map-legend {
  background: rgba(255, 255, 255, 0.97) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 0.6rem 0.8rem !important;
  color: var(--text-secondary) !important;
  font-size: 0.62rem !important;
  line-height: 1.6 !important;
  box-shadow: var(--shadow-sm) !important;
  backdrop-filter: blur(8px) !important;
  min-width: 120px;
}
.map-legend i {
  width: 14px; height: 14px;
  display: inline-block;
  margin-right: 5px;
  border-radius: 3px;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.map-legend__gradient {
  height: 12px;
  margin: 6px 0 3px;
  border-radius: 3px;
  background: linear-gradient(to right, #fff5eb, #fee6ce, #fdd0a2, #fdae6b, #f16913, #d94801, #a63603, #7f2704);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.map-legend__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
/* Map tooltip */
.map-tooltip-container {
  background: rgba(26, 32, 44, 0.95) !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 0 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
  color: #fff !important;
}
.map-tooltip-container .leaflet-tooltip-tip {
  border-top-color: rgba(26, 32, 44, 0.95) !important;
}
.map-tooltip {
  padding: 8px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  line-height: 1.5;
}
.map-tooltip strong {
  font-size: 0.8rem;
  color: #fff;
}
.map-tooltip__val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #fdae6b;
}
.map-tooltip__pct {
  font-size: 0.65rem;
  color: #a0aec0;
}

/* ── Treemap ───────────────────────────────────────────── */
.treemap {
  position: relative;
  width: 100%;
  height: 370px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.treemap-cell {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px solid rgba(255,255,255,0.4);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  cursor: default;
  color: #fff;
  transition: filter 0.15s ease, border-color 0.15s ease;
}
.treemap-cell:hover {
  filter: brightness(1.18);
  border-color: rgba(255,255,255,0.85);
  z-index: 2;
}
.treemap-cell--sm {
  padding: 4px 6px;
}
.treemap-cell__name {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.treemap-cell__value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.treemap-cell__pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  opacity: 0.8;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
@media (max-width: 768px) {
  .treemap { height: 320px; }
  .treemap-cell__value { font-size: 0.9rem; }
  .treemap-cell__name { font-size: 0.65rem; }
}

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state__icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}
.empty-state__text {
  font-size: 0.85rem;
  font-weight: 500;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .header { padding: 0.85rem 1rem; }
  .header__top-row { flex-wrap: wrap; gap: 0.5rem; }
  .header__brand { gap: 0.6rem; min-width: 0; flex: 1; }
  .header__title { font-size: 1.05rem; }
  .header__sub { font-size: 0.65rem; }
  .header__logo { height: 34px; }
  .header__period { font-size: 0.68rem; margin-top: 0.3rem; }
  .header__controls { flex-shrink: 0; }
  .filters-bar { padding: 0.5rem 0.75rem; }
  .filters-bar__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.5rem;
    align-items: end;
  }
  .filter-group select { min-width: 0; width: 100%; font-size: 0.72rem; }
  .filter-month { min-width: 0; width: 100%; font-size: 0.72rem; }
  .btn-reset { width: 100%; }
  .main { padding: 0.75rem 0.75rem 2rem; gap: 1rem; }
  .section-card__header { padding: 0.75rem 0.85rem 0.5rem; }
  .section-card__body { padding: 0.75rem 0.85rem 0.85rem; }
  .chart-container { height: 260px; }
  .chart-container--tall { height: 320px; }
  .map-container { height: 300px; }
  .summary-row { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .footer { padding: 0.85rem 0.75rem; }
  .footer__inner { flex-direction: column; text-align: center; gap: 1rem; }
  .footer__brand { flex-direction: column; }
  .footer__logo { height: 32px; }
  .footer__right { align-items: center; }
  .footer__contacts { align-items: center; font-size: 0.72rem; }
  .footer__legal { font-size: 0.65rem; }
}
@media (max-width: 480px) {
  .summary-row { grid-template-columns: 1fr; }
  .header__title { font-size: 0.9rem; }
  .header__sub { display: none; }
  .header__period { font-size: 0.62rem; }
}

/* ── Animations ─────────────────────────────────────────── */
.section-card, .summary-card {
  animation: fadeUp 0.45s ease both;
}
.summary-card:nth-child(1) { animation-delay: 0.02s; }
.summary-card:nth-child(2) { animation-delay: 0.04s; }
.summary-card:nth-child(3) { animation-delay: 0.06s; }
.summary-card:nth-child(4) { animation-delay: 0.08s; }
.section-card:nth-child(1) { animation-delay: 0.05s; }
.section-card:nth-child(2) { animation-delay: 0.08s; }
.section-card:nth-child(3) { animation-delay: 0.11s; }
.section-card:nth-child(4) { animation-delay: 0.14s; }
.section-card:nth-child(5) { animation-delay: 0.17s; }
.section-card:nth-child(6) { animation-delay: 0.20s; }
.section-card:nth-child(7) { animation-delay: 0.23s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ── Header top row (for theme toggle) ─────────────────── */
.header__top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}


/* ── Header controls (lang switch + design toggle) ─────── */
.header__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Language switcher ────────────────────────────────────── */
.lang-switch {
  display: flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.25);
}
.lang-switch__btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.6);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.03em;
}
.lang-switch__btn:not(:last-child) {
  border-right: 1px solid rgba(255,255,255,0.15);
}
.lang-switch__btn:hover {
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.9);
}
.lang-switch__btn.active {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
}

/* ── Design toggle button ─────────────────────────────────── */
.btn-design {
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  height: 36px;
  padding: 0 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.65rem;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.02em;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-design:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}

/* ── Toast notifications ───────────────────────────────── */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  max-width: 360px;
}
.toast--error {
  background: var(--accent-red);
}
.toast--success {
  background: var(--accent-green);
}
.toast--info {
  background: var(--accent-blue);
}
.toast--fade-out {
  opacity: 0;
  transition: opacity 0.4s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  background: #111;
  color: #ccc;
  padding: 1.5rem 2.5rem;
  margin-top: 0;
}
.footer__inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.footer__left {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.footer__brand {
  display: flex;
  align-items: center;
}
.footer__logo {
  height: 40px;
  width: auto;
  cursor: pointer;
  transition: opacity var(--transition);
}
.footer__logo:hover {
  opacity: 0.7;
}
.footer__legal {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.72rem;
  color: #999;
  line-height: 1.5;
}
.footer__legal .footer__link {
  color: #ccc;
  text-decoration: none;
  font-style: italic;
  font-weight: 500;
}
.footer__legal .footer__link:hover {
  text-decoration: underline;
}
.footer__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.8rem;
}
.footer__socials {
  display: flex;
  gap: 0.75rem;
}
.footer__social-link {
  color: #ccc;
  transition: color 0.2s;
}
.footer__social-link:hover {
  color: #fff;
}
.footer__contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: #aaa;
}
.footer__contacts a {
  color: #ddd;
  text-decoration: none;
}
.footer__contacts a:hover {
  text-decoration: underline;
}


/* ── Print ──────────────────────────────────────────────── */
@media print {
  .header { background: #1a56a0 !important; print-color-adjust: exact; }
  .filters-bar { position: static; }
  .section-card, .summary-card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .view-toggle { display: none; }
  .btn-design { display: none; }
  .lang-switch { display: none; }
  .toast-container { display: none; }
  .footer { background: #111 !important; }
}
