:root {
  /* ==========================================================================
     PALETTE NATURE & MONTAGNES LAURENTIENNES — SAINTE-BRIGITTE-DE-LAVAL
     Vallée encaissée, pins boréaux, rivière Montmorency & socle granitique
     ========================================================================== */
  --pine-950: #061710;
  --pine-900: #0b241a;
  --pine-800: #143829;
  --pine-700: #1b4d38;
  --pine-600: #27694d;
  --pine-500: #338562;
  --pine-400: #4aa37c;
  --pine-300: #72c49f;
  --pine-200: #a7dfc5;
  --pine-100: #e2f4eb;
  --pine-50:  #f0faf4;

  --river-950: #031b26;
  --river-900: #072e42;
  --river-800: #0c4866;
  --river-700: #0369a1;
  --river-600: #0284c7;
  --river-500: #0ea5e9;
  --river-400: #38bdf8;
  --river-100: #e0f2fe;

  --granite-900: #0f1720;
  --granite-800: #1b2631;
  --granite-700: #2c3e50;
  --granite-600: #475a6e;
  --granite-400: #889bb0;
  --granite-200: #dce4ec;
  --granite-100: #eef3f7;

  --maple-amber: #d97706;
  --maple-gold:  #f59e0b;
  --berry-rose:  #be123c;

  /* THÈME CLAIR PAR DÉFAUT (Brume alpine, conifères & vallée vivifiante) */
  --bg-primary: #f2f7f4;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-hover: #ffffff;
  --bg-surface: #f4f8f5;
  --bg-subtle: #e6f3ec;
  --bg-input: #ffffff;
  --bar-track-bg: #dcece3;
  --bg-topbar: rgba(255, 255, 255, 0.95);
  --body-bg: radial-gradient(circle at 12% 0%, #d8ece0 0%, #edf5f0 38%, #f5faf7 100%), #f5faf7;
  --border-subtle: rgba(20, 56, 41, 0.12);
  --border-highlight: rgba(39, 105, 77, 0.45);
  --text-main: #0c2017;
  --text-muted: #385447;
  --text-dim: #5c796b;

  --accent-cyan: #0284c7;
  --accent-blue: #0369a1;
  --accent-indigo: #1b4d38;
  --accent-emerald: #143829;
  --accent-amber: #d97706;
  --accent-rose: #be123c;
  --accent-purple: #27694d;

  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-lg: 0 10px 28px -8px rgba(12, 32, 23, 0.09), 0 2px 6px -1px rgba(12, 32, 23, 0.04);
  --shadow-alpine: 0 16px 36px -10px rgba(12, 32, 23, 0.13);
}

[data-theme="dark"] {
  /* MODE SOMBRE (Nuit Boréale sur les Sommets Laurentiens de SBDL) */
  --bg-primary: #06130d;
  --bg-secondary: #0c2117;
  --bg-card: rgba(12, 33, 23, 0.9);
  --bg-card-hover: rgba(18, 46, 33, 0.96);
  --bg-surface: rgba(14, 38, 27, 0.85);
  --bg-subtle: rgba(27, 77, 56, 0.45);
  --bg-input: rgba(7, 20, 14, 0.92);
  --bar-track-bg: rgba(27, 77, 56, 0.65);
  --bg-topbar: rgba(6, 19, 13, 0.94);
  --body-bg: radial-gradient(circle at 15% 0%, #0d3324 0%, #06130d 60%), #06130d;
  --border-subtle: rgba(74, 163, 124, 0.2);
  --border-highlight: rgba(114, 196, 159, 0.5);
  --text-main: #eef8f3;
  --text-muted: #a1c8b4;
  --text-dim: #719b86;

  --accent-cyan: #38bdf8;
  --accent-blue: #0284c7;
  --accent-indigo: #4aa37c;
  --accent-emerald: #4aa37c;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #72c49f;
  --shadow-lg: 0 14px 38px -10px rgba(0, 0, 0, 0.68);
  --shadow-alpine: 0 20px 48px -12px rgba(0, 0, 0, 0.85);
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--body-bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}

a {
  color: var(--river-600);
  text-decoration: none;
  transition: color 0.15s ease;
}
[data-theme="dark"] a {
  color: var(--river-400);
}
a:hover {
  text-decoration: underline;
  color: var(--pine-500);
}

/* ==========================================================================
   TOPBAR COMMAND BAR (Style Station Météo Alpin / Observatoire)
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-topbar);
  backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
  box-shadow: 0 4px 20px rgba(12, 32, 23, 0.05);
}

.topbar-inner {
  max-width: 1720px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-crest {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pine-700), var(--river-700));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(27, 77, 56, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pine-400);
  box-shadow: 0 0 10px var(--pine-400);
  animation: pulse-alpine 2.2s infinite;
}

@keyframes pulse-alpine {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(74, 163, 124, 0.75);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(74, 163, 124, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(74, 163, 124, 0);
  }
}

.brand h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-main);
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nav-pill {
  padding: 0.36rem 0.72rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.nav-pill:hover {
  color: var(--pine-800);
  border-color: var(--pine-500);
  background: var(--pine-100);
  text-decoration: none;
}
[data-theme="dark"] .nav-pill:hover {
  color: #ffffff;
  border-color: var(--pine-400);
  background: var(--pine-800);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.status-pill {
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.status-NORMAL {
  background: rgba(39, 105, 77, 0.14);
  color: var(--pine-600);
  border: 1px solid rgba(39, 105, 77, 0.35);
}
[data-theme="dark"] .status-NORMAL {
  background: rgba(74, 163, 124, 0.2);
  color: var(--pine-300);
  border-color: rgba(74, 163, 124, 0.4);
}
.status-VIGILANCE {
  background: rgba(217, 119, 6, 0.16);
  color: var(--maple-amber);
  border: 1px solid rgba(217, 119, 6, 0.45);
}
.status-ALERTE {
  background: rgba(190, 18, 60, 0.18);
  color: var(--berry-rose);
  border: 1px solid rgba(190, 18, 60, 0.5);
}

.btn {
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}
.btn:hover {
  border-color: var(--pine-500);
  background: var(--pine-50);
  text-decoration: none;
}
[data-theme="dark"] .btn:hover {
  background: var(--pine-800);
}

.btn-primary {
  background: linear-gradient(135deg, var(--pine-700), var(--pine-800));
  border-color: var(--pine-500);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(20, 56, 41, 0.25);
}
.btn-primary:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--pine-600), var(--pine-700));
  box-shadow: 0 4px 14px rgba(20, 56, 41, 0.35);
}

.btn-danger {
  background: rgba(190, 18, 60, 0.12);
  border-color: rgba(190, 18, 60, 0.45);
  color: var(--berry-rose);
}
.btn-danger:hover {
  background: rgba(190, 18, 60, 0.2);
}

/* ==========================================================================
   HERO STRIP SBDL 360° (Identité Urbaine & Boréale)
   ========================================================================== */
.sbdl-hero-strip {
  background: linear-gradient(135deg, rgba(20, 56, 41, 0.92) 0%, rgba(12, 72, 102, 0.88) 100%);
  border: 1px solid rgba(74, 163, 124, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.8rem;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-alpine);
}

.sbdl-hero-strip::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-image: 
    radial-gradient(ellipse at 85% 120%, rgba(56, 189, 248, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 15% -20%, rgba(74, 163, 124, 0.35) 0%, transparent 55%);
  pointer-events: none;
}

.sbdl-hero-strip::after {
  content: "⛰️ 🌲 🌊";
  position: absolute;
  right: 2rem;
  bottom: -0.4rem;
  font-size: 3.5rem;
  opacity: 0.14;
  pointer-events: none;
  letter-spacing: 0.5rem;
}

.hero-left {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.hero-badge-alpine {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.16);
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  margin-bottom: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-badge-alpine .altitude-tag {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  color: #e0f2fe;
}

.hero-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.45;
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.hero-stat-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 0.65rem 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 95px;
  backdrop-filter: blur(8px);
}
.hero-stat-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}
.hero-stat-lbl {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

/* Responsive visibility helpers */
.hide-mobile {
  display: inline;
}
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .topbar {
    position: relative !important; /* Libère l'écran sur mobile, ne reste pas collé en permanence */
    padding: 0.5rem 0.75rem;
    box-shadow: 0 2px 8px rgba(12, 32, 23, 0.05);
  }

  .topbar-inner {
    gap: 0.45rem;
  }

  .brand {
    width: 100%;
    justify-content: space-between;
    gap: 0.45rem;
  }

  .brand-crest {
    width: 28px;
    height: 28px;
    font-size: 0.95rem;
    border-radius: 8px;
  }

  .brand h1 {
    font-size: 0.92rem;
    gap: 0.35rem;
  }

  .brand-sub {
    display: none; /* Évite de surcharger la hauteur sur mobile */
  }

  .status-pill {
    padding: 0.18rem 0.5rem;
    font-size: 0.65rem;
  }

  /* Défilement horizontal fluide sur une seule ligne (au lieu de 4-5 lignes empilées) */
  .nav-pills {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.15rem 0 0.35rem;
    gap: 0.3rem;
  }

  .nav-pills::-webkit-scrollbar {
    display: none;
  }

  .nav-pill {
    white-space: nowrap;
    font-size: 0.72rem;
    padding: 0.26rem 0.55rem;
    flex-shrink: 0;
  }

  /* Boutons d'actions compacts alignés sur une seule ligne */
  .topbar-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
    flex-wrap: nowrap;
  }

  .topbar-actions .btn {
    padding: 0.3rem 0.45rem;
    font-size: 0.72rem;
    flex: 1;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
  }

  .sbdl-hero-strip {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    gap: 0.65rem;
  }

  .hero-title {
    font-size: 1.15rem;
  }

  .hero-desc {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .hero-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
  }

  .hero-stat-pill {
    min-width: unset;
    padding: 0.4rem 0.25rem;
  }

  .hero-stat-num {
    font-size: 0.95rem;
  }

  .hero-stat-lbl {
    font-size: 0.58rem;
  }

  .container {
    padding: 0.75rem 0.75rem 2.5rem;
    gap: 1rem;
  }
}

/* ==========================================================================
   CONTAINER & LAYOUT
   ========================================================================== */
.container {
  max-width: 1720px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

/* Alert Banner */
.alert-banner {
  background: linear-gradient(90deg, rgba(190, 18, 60, 0.14), rgba(217, 119, 6, 0.12));
  border: 1px solid rgba(190, 18, 60, 0.45);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  display: none;
  flex-direction: column;
  gap: 0.45rem;
}
.alert-banner.active {
  display: flex;
}

/* ==========================================================================
   KPI TELEMETRY STRIP (Cartes Montagneuses Épurées)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 0.85rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--pine-600);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.kpi-card:hover {
  transform: translateY(-3px);
  border-top-color: var(--river-500);
  box-shadow: var(--shadow-alpine);
}
.kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}
.kpi-value {
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}
.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   SECTION HEADERS (Style Sommets & Crêtes)
   ========================================================================== */
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.section-title {
  font-size: 1.18rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-main);
}
.section-badge {
  font-size: 0.72rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: rgba(39, 105, 77, 0.12);
  color: var(--pine-600);
  border: 1px solid rgba(39, 105, 77, 0.3);
  font-weight: 600;
}
[data-theme="dark"] .section-badge {
  background: rgba(74, 163, 124, 0.18);
  color: var(--pine-300);
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.15rem;
}
.grid-2-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
}

@media (max-width: 1200px) {
  .grid-2,
  .grid-2-equal,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  backdrop-filter: blur(12px);
  transition: border-color 0.15s ease;
}
.card:hover {
  border-color: var(--border-highlight);
}

.card-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.65rem;
}

/* ==========================================================================
   CARTE INTERACTIVE LEAFLET (Stylisation Rivières & Relief)
   ========================================================================== */
#sbdl-map {
  width: 100%;
  height: 520px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

.dark-map-tiles {
  filter: invert(100%) hue-rotate(180deg) brightness(92%) contrast(92%);
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.layer-toggle {
  padding: 0.35rem 0.72rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.layer-toggle.active {
  background: rgba(39, 105, 77, 0.16);
  border-color: var(--pine-500);
  color: var(--pine-700);
  font-weight: 700;
}
[data-theme="dark"] .layer-toggle.active {
  background: rgba(74, 163, 124, 0.25);
  color: #ffffff;
  border-color: var(--pine-400);
}

/* ==========================================================================
   WOW PROPERTY EXPLORER (Fiche Citoyenne Cadastre & Valeur)
   ========================================================================== */
.wow-card {
  background: var(--bg-card);
  border: 2px solid var(--border-highlight);
  border-top: 4px solid var(--pine-600);
  box-shadow: var(--shadow-alpine);
}

.search-bar-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.7fr auto;
  gap: 0.65rem;
}
@media (max-width: 900px) {
  .search-bar-row {
    grid-template-columns: 1fr;
  }
}

.input,
.select {
  width: 100%;
  padding: 0.62rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus,
.select:focus {
  border-color: var(--pine-500);
  box-shadow: 0 0 0 3px rgba(39, 105, 77, 0.18);
}

.prop-results-scroll {
  max-height: 440px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-right: 0.3rem;
}

.prop-item {
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}
.prop-item:hover {
  border-color: var(--pine-500);
  background: var(--pine-50);
  transform: translateX(2px);
}
[data-theme="dark"] .prop-item:hover {
  background: var(--pine-800);
}
.prop-item.selected {
  border-color: var(--pine-600);
  background: rgba(39, 105, 77, 0.14);
  box-shadow: inset 3px 0 0 var(--pine-600);
}
[data-theme="dark"] .prop-item.selected {
  background: rgba(74, 163, 124, 0.22);
  box-shadow: inset 3px 0 0 var(--pine-400);
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
}

.spec-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
}
.spec-box .lbl {
  font-size: 0.69rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}
.spec-box .val {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.1rem;
}

/* ==========================================================================
   STATUS CHECKS (Infrastructures Municipales & Services)
   ========================================================================== */
.status-check-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.dot-ok {
  background: var(--pine-400);
  box-shadow: 0 0 8px var(--pine-400);
}
.dot-warn {
  background: var(--maple-gold);
  box-shadow: 0 0 8px var(--maple-gold);
}
.dot-crit {
  background: var(--berry-rose);
  box-shadow: 0 0 8px var(--berry-rose);
}

/* River Gauge */
.gauge-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: var(--bg-surface);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-subtle);
}
.gauge-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #38bdf8, #f59e0b, #be123c);
  transition: width 0.4s ease;
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.81rem;
}
.data-table th,
.data-table td {
  padding: 0.52rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.data-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-subtle);
}
.data-table tr:hover td {
  background: var(--bg-card-hover);
}

/* Feeds */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.feed-item {
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.feed-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.tag {
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(39, 105, 77, 0.14);
  color: var(--pine-600);
}
[data-theme="dark"] .tag {
  color: var(--pine-300);
}
.tag-critical {
  background: rgba(190, 18, 60, 0.15);
  color: var(--berry-rose);
}
.tag-warning {
  background: rgba(217, 119, 6, 0.16);
  color: var(--maple-amber);
}

.chart-box {
  position: relative;
  width: 100%;
  height: 230px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-surface);
}
::-webkit-scrollbar-thumb {
  background: rgba(74, 163, 124, 0.35);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--pine-500);
}

/* ==========================================================================
   SECTION HISTORIQUE & ARCHIVES CENTENAIRES (1900-2026)
   ========================================================================== */
#sec-historique .card {
  border-color: rgba(74, 163, 124, 0.3);
}

.hist-badge {
  background: linear-gradient(135deg, rgba(20, 56, 41, 0.18), rgba(3, 105, 161, 0.18));
  color: var(--pine-700);
  border: 1px solid rgba(74, 163, 124, 0.4);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 0.5rem;
}
[data-theme="dark"] .hist-badge {
  color: var(--pine-300);
}

.hist-grid-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.hist-kpi-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
}
.hist-kpi-box .h-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}
.hist-kpi-box .h-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.15rem;
}
.hist-kpi-box .h-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

/* ==========================================================================
   FOOTER (Projet Citoyen Indépendant)
   ========================================================================== */
.site-footer {
  border-top: 2px solid var(--border-subtle);
  background: var(--bg-card);
  padding: 2.2rem 1.5rem;
  margin-top: 2rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.footer-disclaimer {
  line-height: 1.55;
  color: var(--text-dim);
}
.footer-meta {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--pine-500);
}
