/* ===================================================
   LesDeputesEnChiffres - Design Républicain
   Transparence citoyenne pour tous
   =================================================== */

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

:root {
  /* Palette principale - Républicain */
  --bg: #f8fafc;
  --bg-gradient: radial-gradient(ellipse at 20% 50%, #edf3fa 0%, #f8fafc 50%, #ffffff 100%);
  --ink: #0F1C50;
  --ink-light: #334155;
  --muted: #64748b;
  
  /* Couleurs de marque */
  --primary: #003776;
  --primary-dark: #0F1C50;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --accent-soft: #dbeafe;
  --accent-red: #ed2939;
  --sun: #f59e0b;
  
  /* Tricolore */
  --bleu: #002395;
  --blanc: #ffffff;
  --rouge: #ed2939;
  
  /* Couleurs sémantiques */
  --success: #10b981;
  --success-soft: #d1fae5;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  
  /* Surfaces */
  --card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --pill: rgba(59, 130, 246, 0.08);
  
  /* Ombres */
  --shadow-sm: 0 1px 3px rgba(15, 28, 80, 0.06);
  --shadow-md: 0 4px 12px -2px rgba(15, 28, 80, 0.08);
  --shadow-lg: 0 10px 25px -5px rgba(15, 28, 80, 0.10);
  --shadow-xl: 0 20px 40px -8px rgba(15, 28, 80, 0.12);
}

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

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

a {
  color: var(--primary);
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent);
}

.subtitle {
  margin: 0 0 1.5rem;
  max-width: 680px;
  color: var(--ink-light);
  font-size: 1.125rem;
  line-height: 1.7;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--primary);
  background: var(--accent-soft);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  margin: 0 0 0.75rem;
}

/* ========== HERO SECTION ========== */
.hero {
  background: linear-gradient(135deg, #0F1C50 0%, #003776 50%, #1a4f9e 100%);
  padding: 3rem 2rem 2.5rem;
  border-bottom: none;
  position: relative;
  overflow: hidden;
  color: #ffffff;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(255,255,255,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.15) 0%, transparent 50%);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 2;
}

.hero__hemicycle {
  position: absolute;
  top: 50%;
  left: calc(680px + (100% - 680px) / 2);
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
}

.hero__hemicycle svg {
  width: 400px;
  height: 290px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1a1a2e 0%, #0f0f23 100%);
}

/* Popup hémicycle agrandi */
.hemicycle-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.hemicycle-popup.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.hemicycle-popup__content {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 25px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1);
  max-width: 90vw;
  max-height: 90vh;
}

.hemicycle-popup__content svg {
  display: block;
  width: 700px;
  height: 480px;
  max-width: 100%;
}

.hemicycle-popup__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.hemicycle-popup__legend .legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
  font-size: 0.75rem;
}

.hemicycle-popup__legend .legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.hemicycle-popup__legend .legend-label {
  color: rgba(255,255,255,0.9);
  font-weight: 600;
}

.hemicycle-popup__legend .legend-count {
  color: rgba(255,255,255,0.5);
  font-size: 0.7rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.hero .subtitle {
  color: rgba(255, 255, 255, 0.85);
}

.hero .eyebrow {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* ========== BOUTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
}

.btn.secondary {
  background: var(--accent-soft);
  color: var(--primary);
  border-color: transparent;
}

.btn.secondary:hover {
  background: var(--accent);
  color: white;
}

.btn-theme {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-theme:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 55, 118, 0.3);
  color: #ffffff;
}

/* ========== STATS CARDS (Hero) ========== */
.hero__highlights {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.pill {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 1rem 1.25rem;
  border-radius: 16px;
  min-width: 160px;
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
}

.pill:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.pill strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.pill span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}

.hero__banner {
  margin-top: 1.5rem;
  background: linear-gradient(90deg, var(--success-soft) 0%, var(--accent-soft) 100%);
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  font-size: 0.9rem;
}

.hero__banner code {
  background: rgba(0,0,0,0.05);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* ========== SECTIONS ========== */
.section {
  max-width: 1600px;
  margin: 2rem auto 1rem;
  padding: 0 2rem;
}

.section__header {
  display: flex;
  justify-content: flex-start;
  gap: 1.5rem;
  align-items: center;
}

.section__header h2 {
  font-size: 1.75rem;
  margin-bottom: 0;
}

.section__lead {
  color: var(--muted);
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.section__cta {
  flex-shrink: 0;
}

/* ========== LAYOUT ========== */
.layout {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 25% 1fr;
  gap: 2rem;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
  .hero {
    padding: 2rem 1.5rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero__hemicycle {
    position: static;
    margin-top: 1.5rem;
  }
  .hero__hemicycle svg {
    width: 320px;
    height: 250px;
  }
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.75rem;
  }
  .hero__highlights {
    flex-direction: column;
  }
  .pill {
    min-width: 100%;
  }
  .hero__hemicycle {
    display: none;
  }
}

/* ========== CARDS ========== */
.card {
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--ink);
}

.card h3 i {
  color: var(--primary);
  margin-right: 0.5rem;
}

/* ========== FORMS ========== */
label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

select, input[type="search"], input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: white;
  color: var(--ink);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select:hover, input[type="search"]:hover {
  border-color: #cbd5e1;
}

select:focus, input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.divider {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

/* ========== MINI STATS ========== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
}

.stat {
  background: linear-gradient(135deg, var(--accent-soft) 0%, white 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--accent);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.stat span {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: capitalize;
}

/* ========== TABLES ========== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  color: var(--ink);
}

thead {
  background: var(--bg);
}

th, td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr {
  transition: background-color 0.15s ease;
}

tbody tr:hover {
  background-color: var(--accent-soft);
}

/* ========== BADGES DE VOTE ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge.pour {
  background: var(--success-soft);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.contre {
  background: var(--danger-soft);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.abstention {
  background: var(--warning-soft);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.non-votant {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.caption {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 8px;
}

button.reset {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.5rem 0;
  text-decoration: underline;
  transition: color 0.15s ease;
}

button.reset:hover {
  color: var(--accent-dark);
}

/* ========== API SECTION ========== */
.api {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 20px;
  padding: 2rem;
}

.api h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.api__list {
  display: grid;
  gap: 1rem;
}

.api__list > div {
  background: white;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.api__list strong {
  display: block;
  color: var(--accent);
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.api__list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .api {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
}

/* ========== NAVIGATION OVERRIDES ========== */
/* La navigation principale est gérée par navigation.css */
/* Ces styles sont des fallbacks ou surcharges mineures */
.navbar .navbar-brand {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  font-weight: 800;
}

/* ========== GROUP BADGES ========== */
.group-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
  color: #fff;
  border: none;
  background: #6b7280;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.group-rn { background: #0a2d63; }
.group-lfi, .group-lfi-nfp { background: #d10060; }
.group-soc, .group-ps { background: #d8242f; }
.group-eelv, .group-ecos { background: #2b8a3e; }
.group-lr { background: #0069b4; }
.group-dem { background: #f59e0b; color: #1d1d1d; }
.group-epr { background: #5c7dd4; }
.group-hor { background: #4f6fcf; } /* Horizons */
.group-dr, .group-udr { background: #374151; }
.group-liot { background: #d97706; }
.group-gdr { background: #b0121b; }
.group-horizons { background: #4f6fcf; }
.group-na, .group-autre { background: #6b7280; }

/* Chips for results */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
}

.chip i {
  font-style: normal;
  font-weight: 700;
}

.chip-pour { 
  background: var(--success-soft); 
  color: #059669; 
  border: 1px solid rgba(16, 185, 129, 0.25); 
}

.chip-contre { 
  background: var(--danger-soft); 
  color: #dc2626; 
  border: 1px solid rgba(239, 68, 68, 0.25); 
}

.chip-abst { 
  background: #f1f5f9; 
  color: #64748b; 
  border: 1px solid #e2e8f0; 
}

/* ========== TABLE STYLES ========== */
.table thead th {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
}

/* DataTables override */
table.dataTable {
  table-layout: auto;
}

table.dataTable thead th,
table.dataTable thead td {
  background-color: var(--bg) !important;
  color: var(--ink);
  border-bottom: 2px solid var(--border);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

table.dataTable tbody tr:hover {
  background-color: var(--accent-soft) !important;
}

table.dataTable tbody tr:nth-child(even) {
  background-color: #fafcff;
}

/* DataTables search and controls */
.dataTables_wrapper .dataTables_filter input {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.15s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 8px !important;
  margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--accent) !important;
  color: white !important;
  border-color: var(--accent) !important;
}

/* ========== PROGRESS BARS ========== */
.progress-bar-custom {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar-custom .fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-bar-custom .fill.pour { background: var(--success); }
.progress-bar-custom .fill.contre { background: var(--danger); }
.progress-bar-custom .fill.abstention { background: var(--warning); }

/* ========== INFO CARDS ========== */
.info-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.info-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.info-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.info-card .icon.blue { background: var(--accent-soft); }
.info-card .icon.green { background: var(--success-soft); }
.info-card .icon.orange { background: var(--warning-soft); }
.info-card .icon.red { background: var(--danger-soft); }

.info-card h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.info-card .value {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ink);
  line-height: 1;
}

.info-card .label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ========== PAGE HEADER ========== */
.page-header {
  background: linear-gradient(135deg, #0F1C50 0%, #003776 50%, #1a4f9e 100%);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  color: #ffffff;
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.15) 0%, transparent 50%);
  pointer-events: none;
}

.page-header > * {
  position: relative;
  z-index: 2;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.page-header p {
  color: rgba(255, 255, 255, 0.75);
}

.page-header .eyebrow {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========== FILTER CARD ========== */
.filter-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ========== TABLE CONTAINER ========== */
.table-container {
  background: white;
  border-radius: 1rem;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* ========== TOOLTIPS CUSTOM ========== */
.help-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: help;
  margin-left: 0.35rem;
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--ink);
  margin-bottom: 0.5rem;
}

/* ========== ALERTS ========== */
.alert-custom {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-custom.info {
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--accent-dark);
}

.alert-custom.success {
  background: var(--success-soft);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #059669;
}

.alert-custom.warning {
  background: var(--warning-soft);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #d97706;
}

/* ========== FOOTER ========== */
.footer {
  background: linear-gradient(135deg, #0F1C50 0%, #003776 100%);
  color: rgba(255,255,255,0.7);
  padding: 3rem 2rem;
  margin-top: 3rem;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #002395 0%, #002395 33.33%, #ffffff 33.33%, #ffffff 66.66%, #ed2939 66.66%, #ed2939 100%);
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer__brand-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer__brand p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.6;
}

.footer__section h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.75rem;
}

.footer__section ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer__section ul li a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.footer__section ul li a:hover {
  color: #ffffff;
}

.footer__bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.footer__bottom a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: underline;
}

.footer__bottom a:hover {
  color: #ffffff;
}

@media (max-width: 768px) {
  .footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* ========== CONTAINER ========== */
.container-app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 640px) {
  .container-app {
    padding: 0 1rem;
  }
}

/* ==========================================================
   MOBILE RESPONSIVE — Global overrides
   ========================================================== */

/* ── Tablet (≤ 768px) ── */
@media (max-width: 768px) {
  /* Reduce page-level container padding */
  .stats-main,
  .deputes-main,
  .scrutins-main,
  .scrutin-main,
  .agenda-main,
  .dossier-main,
  .dossiers-main,
  .reunion-main,
  .glossaire-main,
  .budget-main,
  .depute-main,
  .questions-main,
  .qdetail-main {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Page header */
  .page-header {
    padding: 1.5rem 1rem;
  }
  .page-header h1 {
    font-size: 1.5rem;
  }
  .page-header p {
    font-size: 0.85rem;
  }

  /* Footer */
  .footer {
    padding: 2rem 1rem;
  }

  /* Filter bars — all pages */
  .stats-filters,
  .filter-card {
    padding: 0.85rem 1rem;
  }

  /* Stat dividers */
  .stats-divider-title {
    font-size: 1.2rem;
  }

  /* Table cards — tighter on mobile */
  .stats-table-card__header {
    padding: 0.65rem 0.85rem;
  }
  .stats-table-card .table th,
  .stats-table-card .table td {
    padding: 0.4rem 0.5rem;
    font-size: 0.78rem;
  }

  /* Chart cards */
  .chart-card {
    padding: 0.85rem;
  }

  /* Info bars */
  .stats-info-bar {
    font-size: 0.75rem;
    padding: 0.5rem 0.65rem;
  }
}

/* ── Mobile (≤ 480px) ── */
@media (max-width: 480px) {
  /* Even tighter padding */
  .stats-main,
  .deputes-main,
  .scrutins-main,
  .scrutin-main,
  .agenda-main,
  .dossier-main,
  .dossiers-main,
  .reunion-main,
  .glossaire-main,
  .budget-main,
  .depute-main,
  .questions-main,
  .qdetail-main {
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
    padding-bottom: 2rem !important;
  }

  .page-header {
    padding: 1.25rem 0.75rem;
    margin-bottom: 1rem;
  }
  .page-header h1 {
    font-size: 1.25rem;
  }

  /* KPI cards — smaller on phones */
  .kpi-card {
    padding: 0.75rem 0.5rem;
  }
  .kpi-card__value {
    font-size: 1.4rem;
  }
  .kpi-card__label {
    font-size: 0.7rem;
  }

  /* Filter groups: full-width stacking */
  .stats-filters__row,
  .filter-card .d-flex,
  .filter-card .row {
    flex-direction: column;
  }
  .stats-filters__group,
  .filter-card .col,
  .filter-card [class*="col-"] {
    min-width: 100% !important;
    flex: 1 1 100%;
  }
  .stats-filters__actions {
    width: 100%;
    justify-content: stretch;
  }
  .stats-filters__btn {
    flex: 1;
    justify-content: center;
  }

  /* Tables — force smaller text */
  .table th,
  .table td {
    font-size: 0.75rem;
    padding: 0.35rem 0.4rem;
  }

  /* Deputy profile page */
  .depute-profile__name {
    font-size: 1.2rem;
  }
  .depute-stat__value {
    font-size: 1.3rem;
  }

  /* Glossaire — single column always */
  .glossaire-letter-section {
    grid-template-columns: 1fr !important;
  }

  /* Scrutin cards — compact */
  .scrutin-card {
    padding: 0.65rem;
  }

  /* Active filter bar */
  .stats-active-filter {
    font-size: 0.78rem;
    padding: 0.4rem 0.65rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
  .stats-active-filter a {
    margin-left: 0;
  }

  /* Footer compact */
  .footer {
    padding: 1.5rem 0.75rem;
  }
  .footer__bottom {
    font-size: 0.75rem;
  }
}
