/* ===========================================
   e-Structure — Feuille de styles principale
   Plateforme Numérique du Tchad
   Design : Institutionnel · Raffiné · Mémorable
   =========================================== */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ══════════════════════════════════════════
   VARIABLES CSS — Mode Jour (défaut)
   ══════════════════════════════════════════ */
:root {
    /* Palette principale */
    --es-primary:        #001f4d;
    --es-primary-mid:    #003580;
    --es-secondary:      #0a5dc2;
    --es-accent:         #e8a020;
    --es-accent-light:   #ffd166;
    --es-accent-subtle:  rgba(232,160,32,.12);

    /* Secteurs */
    --es-sante:          #dc2626;
    --es-education:      #1d4ed8;
    --es-hydraulique:    #0891b2;
    --es-energie:        #d97706;

    /* Surfaces */
    --es-bg:             #f0f4fb;
    --es-bg-alt:         #e8edf8;
    --es-surface:        #ffffff;
    --es-surface-raised: #ffffff;
    --es-border:         #dde4f2;
    --es-border-strong:  #c5d0e8;

    /* Textes */
    --es-text:           #0f1c35;
    --es-text-soft:      #374151;
    --es-muted:          #5d6d8a;

    /* Footer */
    --es-footer-bg:      #050e22;
    --es-footer-text:    #b8cce8;
    --es-footer-muted:   #6880a4;
    --es-footer-accent:  #e8a020;

    /* Effets */
    --es-shadow-xs:  0 1px 3px rgba(0,31,77,.06);
    --es-shadow-sm:  0 2px 8px rgba(0,31,77,.09);
    --es-shadow-md:  0 6px 24px rgba(0,31,77,.13);
    --es-shadow-lg:  0 16px 56px rgba(0,31,77,.18);
    --es-shadow-xl:  0 32px 80px rgba(0,31,77,.22);
    --es-radius:     14px;
    --es-radius-lg:  20px;
    --es-radius-xl:  28px;

    /* Transitions */
    --es-transition: .2s cubic-bezier(.4,0,.2,1);
    --es-bounce:     .35s cubic-bezier(.34,1.56,.64,1);
}

/* ══════════════════════════════════════════
   VARIABLES CSS — Mode Nuit
   ══════════════════════════════════════════ */
[data-theme="dark"] {
    --es-primary:        #5b9dff;
    --es-primary-mid:    #3a7de0;
    --es-secondary:      #4a8fe8;
    --es-accent:         #f0b030;
    --es-accent-light:   #ffd166;
    --es-accent-subtle:  rgba(240,176,48,.1);

    --es-bg:             #080f1e;
    --es-bg-alt:         #0c1526;
    --es-surface:        #111827;
    --es-surface-raised: #182035;
    --es-border:         #1e2d45;
    --es-border-strong:  #2a3d5e;

    --es-text:           #e8f0ff;
    --es-text-soft:      #b8c8e0;
    --es-muted:          #6a85a8;

    --es-footer-bg:      #050a14;
    --es-footer-text:    #7a9cc0;
    --es-footer-muted:   #3a5070;

    --es-shadow-xs:  0 1px 3px rgba(0,0,0,.3);
    --es-shadow-sm:  0 2px 8px rgba(0,0,0,.4);
    --es-shadow-md:  0 6px 24px rgba(0,0,0,.5);
    --es-shadow-lg:  0 16px 56px rgba(0,0,0,.6);
    --es-shadow-xl:  0 32px 80px rgba(0,0,0,.7);

    color-scheme: dark;
}

/* ══════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--es-text);
    background: var(--es-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--es-transition), color var(--es-transition);
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
    color: var(--es-text);
}

/* Textes blancs sur fonds sombres */
.hero-section h1, .hero-section h2, .hero-section h3,
.bg-primary h1, .bg-primary h2,
.stats-hero h1, .page-hero h1, .page-hero h2,
.structure-hero h1, .region-header h1,
.navbar h1 {
    color: #ffffff !important;
}

a {
    color: var(--es-secondary);
    text-decoration: none;
    transition: color var(--es-transition);
}
a:hover { color: var(--es-primary); }

img { max-width: 100%; }

/* ══════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════ */
.navbar {
    background: linear-gradient(90deg, var(--es-primary) 0%, #012f70 100%) !important;
    padding: .6rem 0;
    border-bottom: 1px solid rgba(232,160,32,.3);
    box-shadow: 0 2px 24px rgba(0,10,40,.4);
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: background var(--es-transition);
}

[data-theme="dark"] .navbar {
    background: linear-gradient(90deg, #070f22 0%, #0d1a38 100%) !important;
    border-bottom-color: rgba(240,176,48,.2);
}

.navbar-brand {
    font-family: 'Fraunces', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff !important;
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.navbar-brand .brand-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--es-accent), var(--es-accent-light));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(232,160,32,.4);
}

.navbar-brand .brand-name { font-weight: 700; }
.navbar-brand .brand-country {
    font-size: .7rem;
    opacity: .55;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 400;
    letter-spacing: .05em;
    text-transform: uppercase;
    align-self: flex-end;
    margin-bottom: 2px;
}

.navbar .nav-link {
    font-size: .84rem;
    font-weight: 500;
    color: rgba(255,255,255,.75) !important;
    padding: .4rem .8rem !important;
    border-radius: 8px;
    transition: background var(--es-transition), color var(--es-transition);
    display: flex; align-items: center; gap: .3rem;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,.1);
}
.navbar .nav-link .bi { font-size: .85rem; opacity: .75; }

.navbar .dropdown-menu {
    border: 1px solid var(--es-border);
    border-radius: 12px;
    box-shadow: var(--es-shadow-lg);
    padding: .5rem;
    background: var(--es-surface);
    margin-top: .35rem;
}
.navbar .dropdown-item {
    border-radius: 8px;
    padding: .45rem .85rem;
    font-size: .86rem;
    font-weight: 500;
    color: var(--es-text);
    transition: background var(--es-transition);
}
.navbar .dropdown-item:hover {
    background: var(--es-bg);
    color: var(--es-primary);
}
.navbar .dropdown-divider { border-color: var(--es-border); margin: .35rem .5rem; }

/* Bouton Admin */
.navbar .btn-nav-admin {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .35rem .9rem; border-radius: 9px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.22);
    color: rgba(255,255,255,.88) !important;
    font-size: .82rem; font-weight: 600;
    transition: all var(--es-transition);
    cursor: pointer;
}
.navbar .btn-nav-admin:hover {
    background: rgba(255,255,255,.18);
    color: #fff !important;
}

/* Bouton thème dans la navbar */
.navbar-theme-btn {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .33rem .8rem; border-radius: 20px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: rgba(255,255,255,.85) !important;
    font-size: .78rem; font-weight: 600;
    cursor: pointer;
    transition: all var(--es-transition);
    text-decoration: none;
    white-space: nowrap;
}
.navbar-theme-btn:hover {
    background: rgba(255,255,255,.18);
    color: #fff !important;
}

/* ══════════════════════════════════════════
   HERO SECTION — Page d'accueil
   ══════════════════════════════════════════ */
.hero-section {
    background:
        linear-gradient(145deg, var(--es-primary) 0%, #012f70 40%, #0a4a9e 100%);
    padding: 4.5rem 0 5rem;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(145deg, #040c1e 0%, #070f22 40%, #0a1530 100%);
}

/* Fond géométrique animé */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 70% at 90% 30%, rgba(10,93,194,.3) 0%, transparent 55%),
        radial-gradient(ellipse 60% 80% at 5% 80%,  rgba(232,160,32,.14) 0%, transparent 50%),
        radial-gradient(ellipse 40% 50% at 50% 100%, rgba(0,53,128,.4) 0%, transparent 60%);
    pointer-events: none;
}

/* Grille de points décorative */
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.5) 30%, rgba(0,0,0,.5) 70%, transparent 100%);
}

.hero-section .container { position: relative; z-index: 2; }

/* Badge "Banque Mondiale" */
.hero-badge {
    display: inline-flex; align-items: center; gap: .4rem;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.88);
    padding: .3rem .9rem; border-radius: 30px;
    font-size: .76rem; font-weight: 600;
    letter-spacing: .03em;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    animation: fadeSlideDown .6s ease both;
}
.hero-badge .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--es-accent-light);
    animation: pulse-dot 2s infinite;
}

.hero-section .hero-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1.1;
    color: #fff !important;
    text-shadow: 0 2px 30px rgba(0,0,0,.25);
    animation: fadeSlideUp .6s .1s ease both;
}
.hero-section .hero-title em {
    font-style: italic;
    color: var(--es-accent-light) !important;
    opacity: 1;
}

.hero-section .hero-sub {
    font-size: 1.05rem;
    color: rgba(255,255,255,.72);
    font-weight: 300;
    max-width: 560px;
    margin: 1.1rem auto 0;
    animation: fadeSlideUp .6s .2s ease both;
}

/* Barre de recherche hero */
.hero-search-wrap {
    max-width: 580px;
    margin: 2.2rem auto 0;
    animation: fadeSlideUp .6s .3s ease both;
}
.hero-search {
    background: rgba(255,255,255,.97);
    border-radius: 14px;
    border: none;
    box-shadow: 0 8px 40px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.15);
    display: flex; align-items: center;
    padding: .35rem .35rem .35rem 1.1rem;
    gap: .5rem;
    transition: box-shadow var(--es-transition), transform var(--es-transition);
}
.hero-search:focus-within {
    box-shadow: 0 12px 48px rgba(0,0,0,.32), 0 0 0 3px rgba(232,160,32,.4);
    transform: translateY(-1px);
}
.hero-search .bi-search {
    color: var(--es-muted);
    font-size: 1rem;
    flex-shrink: 0;
}
.hero-search input {
    flex: 1; border: none; outline: none;
    background: transparent;
    font-size: .95rem; font-weight: 500;
    color: var(--es-text);
    padding: .55rem 0;
}
.hero-search input::placeholder { color: #a0aec0; font-weight: 400; }
.hero-search .btn-search {
    background: linear-gradient(135deg, var(--es-accent) 0%, #c8840e 100%);
    border: none; border-radius: 10px;
    color: var(--es-primary);
    font-weight: 700; font-size: .88rem;
    padding: .65rem 1.4rem;
    display: flex; align-items: center; gap: .4rem;
    transition: all var(--es-transition);
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(232,160,32,.4);
}
.hero-search .btn-search:hover {
    background: linear-gradient(135deg, var(--es-accent-light) 0%, var(--es-accent) 100%);
    box-shadow: 0 4px 16px rgba(232,160,32,.5);
    transform: translateY(-1px);
}

/* Liens rapides hero */
.hero-quick-links {
    display: flex; align-items: center; gap: .75rem;
    flex-wrap: wrap; justify-content: center;
    margin-top: 1.5rem;
    animation: fadeSlideUp .6s .4s ease both;
}
.hero-quick-links span {
    font-size: .77rem; color: rgba(255,255,255,.45); font-weight: 500;
}
.hero-quick-link {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .3rem .75rem; border-radius: 20px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.16);
    color: rgba(255,255,255,.8) !important;
    font-size: .79rem; font-weight: 600;
    transition: all var(--es-transition);
    text-decoration: none;
}
.hero-quick-link:hover {
    background: rgba(255,255,255,.18);
    color: #fff !important;
    transform: translateY(-2px);
}

/* ══════════════════════════════════════════
   COMPTEURS / STATS — Section accueil
   ══════════════════════════════════════════ */
.stats-section {
    padding: 3.5rem 0;
    background: var(--es-surface);
    border-bottom: 1px solid var(--es-border);
}
[data-theme="dark"] .stats-section { background: var(--es-surface); }

.stats-section .stat-card {
    display: flex; flex-direction: column; align-items: center;
    padding: 1.75rem 1.25rem;
    border-radius: var(--es-radius-lg);
    background: var(--es-bg);
    border: 1px solid var(--es-border);
    box-shadow: var(--es-shadow-xs);
    transition: transform var(--es-bounce), box-shadow var(--es-transition);
    position: relative; overflow: hidden;
    text-decoration: none;
}
.stats-section .stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--es-secondary), var(--es-accent));
    opacity: 0; transition: opacity var(--es-transition);
}
.stats-section .stat-card:hover { transform: translateY(-5px); box-shadow: var(--es-shadow-md); }
.stats-section .stat-card:hover::before { opacity: 1; }

.stat-icon-wrap {
    width: 56px; height: 56px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; margin-bottom: .875rem;
}
.stat-number {
    font-family: 'Fraunces', serif;
    font-size: 2.4rem; font-weight: 700;
    color: var(--es-primary);
    line-height: 1; margin-bottom: .3rem;
    letter-spacing: -.04em;
}
[data-theme="dark"] .stat-number { color: var(--es-accent-light); }
.stat-label {
    font-size: .78rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--es-muted);
    text-align: center;
}

/* ══════════════════════════════════════════
   SECTEURS D'INTERVENTION
   ══════════════════════════════════════════ */
.secteurs-section {
    padding: 4rem 0;
    background: var(--es-bg);
}

.section-heading {
    font-family: 'Fraunces', serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--es-text);
    letter-spacing: -.025em;
}
.section-heading-line {
    display: inline-block; width: 40px; height: 3px;
    background: linear-gradient(90deg, var(--es-accent), var(--es-accent-light));
    border-radius: 3px; vertical-align: middle; margin-right: .6rem;
}
.section-sub {
    font-size: .9rem; color: var(--es-muted);
    max-width: 480px; margin: .5rem auto 0;
}

.sector-card {
    border-radius: var(--es-radius-lg) !important;
    border: 1.5px solid var(--es-border) !important;
    box-shadow: var(--es-shadow-sm);
    transition: transform var(--es-bounce), box-shadow var(--es-transition);
    background: var(--es-surface) !important;
    position: relative; overflow: hidden;
    text-decoration: none;
}
.sector-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 0;
    transition: height .3s ease;
}
.sector-card-sante::before   { background: linear-gradient(180deg, rgba(220,38,38,.06) 0%, transparent 100%); }
.sector-card-edu::before     { background: linear-gradient(180deg, rgba(29,78,216,.06) 0%, transparent 100%); }
.sector-card-hydro::before   { background: linear-gradient(180deg, rgba(8,145,178,.06) 0%, transparent 100%); }
.sector-card-energie::before { background: linear-gradient(180deg, rgba(217,119,6,.06) 0%, transparent 100%); }

.sector-card:hover {
    transform: translateY(-8px) scale(1.015);
    box-shadow: var(--es-shadow-lg);
}
.sector-card:hover::before { height: 100%; }

.sector-card-body {
    padding: 2rem 1.5rem 1.75rem;
    display: flex; flex-direction: column; align-items: center;
    gap: .6rem; text-align: center;
}
.sector-emoji {
    font-size: 3rem; line-height: 1;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,.12));
    transition: transform var(--es-bounce);
}
.sector-card:hover .sector-emoji { transform: scale(1.18) rotate(-4deg); }

.sector-name {
    font-family: 'Fraunces', serif;
    font-size: 1.15rem; font-weight: 700;
    margin: 0;
}
.sector-name-sante   { color: var(--es-sante) !important; }
.sector-name-edu     { color: var(--es-education) !important; }
.sector-name-hydro   { color: var(--es-hydraulique) !important; }
.sector-name-energie { color: var(--es-energie) !important; }

.sector-desc {
    font-size: .79rem; color: var(--es-muted);
    line-height: 1.6; margin: 0;
}
.sector-count {
    display: inline-flex; align-items: center;
    padding: .25rem .75rem; border-radius: 20px;
    font-size: .76rem; font-weight: 700;
    margin-top: .25rem;
}
.sector-count-sante   { background: #fee2e2; color: #b91c1c; }
.sector-count-edu     { background: #dbeafe; color: #1e40af; }
.sector-count-hydro   { background: #cffafe; color: #0e7490; }
.sector-count-energie { background: #fef9c3; color: #92400e; }

[data-theme="dark"] .sector-count-sante   { background: rgba(220,38,38,.15);  color: #fca5a5; }
[data-theme="dark"] .sector-count-edu     { background: rgba(29,78,216,.15);   color: #93c5fd; }
[data-theme="dark"] .sector-count-hydro   { background: rgba(8,145,178,.15);   color: #67e8f9; }
[data-theme="dark"] .sector-count-energie { background: rgba(217,119,6,.15);   color: #fcd34d; }

/* ══════════════════════════════════════════
   MINI CARTE SECTION
   ══════════════════════════════════════════ */
.map-section {
    padding: 4rem 0;
    background: var(--es-surface);
    border-top: 1px solid var(--es-border);
}
[data-theme="dark"] .map-section { background: var(--es-bg-alt); }

.map-section-inner {
    border-radius: var(--es-radius-xl);
    overflow: hidden;
    box-shadow: var(--es-shadow-lg);
    border: 1px solid var(--es-border);
    position: relative;
}
.map-overlay-btn {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    z-index: 10;
    background: var(--es-primary);
    color: #fff !important;
    border: none; border-radius: 12px;
    padding: .7rem 1.6rem;
    font-size: .88rem; font-weight: 700;
    box-shadow: var(--es-shadow-md);
    display: flex; align-items: center; gap: .4rem;
    transition: all var(--es-transition);
    text-decoration: none;
    white-space: nowrap;
}
.map-overlay-btn:hover {
    background: var(--es-secondary);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: var(--es-shadow-lg);
    color: #fff !important;
}

/* ══════════════════════════════════════════
   CARDS génériques
   ══════════════════════════════════════════ */
.card {
    border-radius: var(--es-radius) !important;
    border: 1px solid var(--es-border) !important;
    box-shadow: var(--es-shadow-sm);
    background: var(--es-surface) !important;
    transition: transform var(--es-transition), box-shadow var(--es-transition);
}
.card:hover { box-shadow: var(--es-shadow-md); }
.card-header {
    background: var(--es-bg) !important;
    border-bottom: 1px solid var(--es-border) !important;
    font-weight: 700; color: var(--es-text) !important;
}

/* Stagger animation */
.card { animation: fadeInUp .4s ease-out both; }
.row > *:nth-child(1) .card { animation-delay: .04s; }
.row > *:nth-child(2) .card { animation-delay: .10s; }
.row > *:nth-child(3) .card { animation-delay: .16s; }
.row > *:nth-child(4) .card { animation-delay: .22s; }

/* ══════════════════════════════════════════
   TABLEAUX
   ══════════════════════════════════════════ */
.table {
    color: var(--es-text);
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(10,93,194,.03);
}
[data-theme="dark"] .table { --bs-table-hover-bg: rgba(90,150,255,.05); }
.table th {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700; font-size: .73rem;
    text-transform: uppercase; letter-spacing: .07em;
    color: var(--es-muted);
    background: var(--es-bg);
    border-color: var(--es-border);
    padding: .75rem 1rem;
}
.table td {
    border-color: var(--es-border);
    padding: .7rem 1rem; vertical-align: middle;
    color: var(--es-text-soft);
}
.table tbody tr { transition: background var(--es-transition); }

/* ══════════════════════════════════════════
   BADGES D'ÉTAT
   ══════════════════════════════════════════ */
.badge-etat {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .28rem .75rem; border-radius: 20px;
    font-size: .76rem; font-weight: 700;
    border: 1px solid;
}
.badge-etat::before {
    content: ''; width: 6px; height: 6px;
    border-radius: 50%; flex-shrink: 0;
}
.badge-operationnelle  { background: #dcfce7; color: #15803d; border-color: #86efac; }
.badge-operationnelle::before  { background: #22c55e; }
.badge-degradee        { background: #fef9c3; color: #a16207; border-color: #fde047; }
.badge-degradee::before        { background: #eab308; }
.badge-fermee          { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.badge-fermee::before          { background: #ef4444; }
.badge-en_construction { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.badge-en_construction::before { background: #3b82f6; }
.badge-planifiee       { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.badge-planifiee::before       { background: #94a3b8; }

[data-theme="dark"] .badge-operationnelle  { background: rgba(34,197,94,.12);  color: #4ade80;  border-color: rgba(34,197,94,.25); }
[data-theme="dark"] .badge-degradee        { background: rgba(234,179,8,.12);  color: #fbbf24;  border-color: rgba(234,179,8,.25); }
[data-theme="dark"] .badge-fermee          { background: rgba(239,68,68,.12);  color: #f87171;  border-color: rgba(239,68,68,.25); }
[data-theme="dark"] .badge-en_construction { background: rgba(59,130,246,.12); color: #60a5fa;  border-color: rgba(59,130,246,.25); }
[data-theme="dark"] .badge-planifiee       { background: rgba(100,116,139,.1); color: #94a3b8;  border-color: rgba(100,116,139,.2); }

/* Alias pour les anciennes classes */
.badge-operationnelle,
.badge-degradee,
.badge-fermee,
.badge-en_construction,
.badge-planifiee {
    /* backward compat */
}

/* ══════════════════════════════════════════
   CARTES LEAFLET
   ══════════════════════════════════════════ */
#miniMap, #mapContainer, #detailMap, #regionMap {
    border-radius: var(--es-radius-lg);
    box-shadow: var(--es-shadow-md);
    z-index: 1;
    border: 1px solid var(--es-border);
}
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: var(--es-shadow-lg);
    border: 1px solid var(--es-border);
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--es-surface);
    color: var(--es-text);
}
.leaflet-popup-tip { background: var(--es-surface); }

/* ══════════════════════════════════════════
   FORMULAIRES
   ══════════════════════════════════════════ */
.form-control,
.form-select {
    border: 1.5px solid var(--es-border);
    border-radius: 10px;
    font-size: .88rem;
    padding: .55rem .95rem;
    transition: border-color var(--es-transition), box-shadow var(--es-transition);
    background: var(--es-surface);
    color: var(--es-text);
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.form-control::placeholder { color: var(--es-muted); }
.form-control:focus,
.form-select:focus {
    border-color: var(--es-secondary);
    box-shadow: 0 0 0 3px rgba(10,93,194,.14);
    outline: none;
    background: var(--es-surface);
    color: var(--es-text);
}
.form-label {
    font-size: .79rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    color: var(--es-muted); margin-bottom: .4rem;
}

/* ══════════════════════════════════════════
   BOUTONS
   ══════════════════════════════════════════ */
.btn {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    border-radius: 10px;
    transition: all var(--es-transition);
}
.btn-primary {
    background: var(--es-secondary);
    border-color: var(--es-secondary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--es-primary-mid);
    border-color: var(--es-primary-mid);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(10,93,194,.3);
}
.btn-warning {
    background: var(--es-accent);
    border-color: var(--es-accent);
    color: var(--es-primary);
}
.btn-warning:hover {
    background: var(--es-accent-light);
    border-color: var(--es-accent-light);
    color: var(--es-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(232,160,32,.35);
}
.btn-outline-primary { border-color: var(--es-secondary); color: var(--es-secondary); }
.btn-outline-primary:hover { background: var(--es-secondary); color: #fff; }

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
footer {
    background: var(--es-footer-bg) !important;
    color: var(--es-footer-text) !important;
    position: relative; overflow: hidden;
}
footer::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(232,160,32,.6) 20%,
        rgba(255,209,102,.8) 50%,
        rgba(232,160,32,.6) 80%,
        transparent 100%
    );
}
footer::after {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 55% 70% at 95% 95%, rgba(10,93,194,.1) 0%, transparent 55%),
        radial-gradient(ellipse 35% 50% at 5% 15%,  rgba(232,160,32,.05) 0%, transparent 50%);
    pointer-events: none;
}
footer .container { position: relative; z-index: 1; }

footer h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.6px;
    color: var(--es-accent-light) !important;
    margin-bottom: 1rem; padding-bottom: .5rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
footer p, footer li, footer .small {
    color: var(--es-footer-text) !important;
    font-size: .84rem; line-height: 1.75;
}
footer a {
    color: var(--es-footer-text) !important;
    text-decoration: none;
    transition: color var(--es-transition), padding-left var(--es-transition);
    display: inline-block;
}
footer a:hover {
    color: var(--es-accent-light) !important;
    padding-left: 4px;
}
footer ul li { margin-bottom: .3rem; }
footer hr { border-color: rgba(255,255,255,.08) !important; margin: 1.5rem 0; }
footer .copyright {
    color: var(--es-footer-muted) !important;
    font-size: .77rem;
}
footer .footer-brand {
    font-family: 'Fraunces', serif;
    font-size: 1.1rem; font-weight: 700;
    color: #fff !important;
    display: flex; align-items: center; gap: .4rem;
    margin-bottom: .75rem;
}
footer .footer-brand .brand-icon {
    width: 28px; height: 28px; border-radius: 7px;
    background: linear-gradient(135deg, var(--es-accent), var(--es-accent-light));
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem;
}
footer .bi { color: var(--es-accent); margin-right: .3rem; }
footer .footer-brand .bi { color: var(--es-accent-light); }

/* Contact links */
footer .contact-link {
    display: flex; align-items: center; gap: .5rem;
    margin-bottom: .35rem;
    font-size: .84rem;
    color: var(--es-footer-text) !important;
}
footer .contact-link .bi { color: var(--es-accent); margin-right: 0; }

/* ══════════════════════════════════════════
   SPINNER / LOADING
   ══════════════════════════════════════════ */
.spinner-overlay {
    position: fixed; inset: 0;
    background: rgba(5,14,34,.7);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}
.spinner-overlay .spinner-border {
    width: 3rem; height: 3rem; border-width: .3rem;
    color: var(--es-accent) !important;
}

/* Loading skeleton */
.skel {
    background: linear-gradient(90deg, var(--es-border) 25%, var(--es-bg-alt) 50%, var(--es-border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 7px;
}
@keyframes shimmer { 0%{background-position:200%} 100%{background-position:-200%} }

/* ══════════════════════════════════════════
   PAGE HERO générique
   ══════════════════════════════════════════ */
.page-hero {
    background: linear-gradient(135deg, var(--es-primary) 0%, var(--es-primary-mid) 60%, #0a4a8c 100%);
    padding: 2.5rem 0 2rem;
    color: #fff;
    border-bottom: 2px solid var(--es-accent);
    position: relative; overflow: hidden;
}
[data-theme="dark"] .page-hero {
    background: linear-gradient(135deg, #050e22 0%, #091525 60%, #0a1a35 100%);
}
.page-hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    opacity: .5;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 {
    font-size: 1.8rem; font-weight: 800; margin-bottom: .3rem;
    color: #fff !important;
}
.page-hero p { color: rgba(255,255,255,.6); font-size: .88rem; margin: 0; }

/* ══════════════════════════════════════════
   BG-LIGHT override
   ══════════════════════════════════════════ */
.bg-light {
    background: var(--es-bg) !important;
}
[data-theme="dark"] .bg-light {
    background: var(--es-bg-alt) !important;
}

/* ══════════════════════════════════════════
   UTILITAIRES
   ══════════════════════════════════════════ */
.text-muted  { color: var(--es-muted) !important; }
.text-primary { color: var(--es-secondary) !important; }
[data-theme="dark"] .text-primary { color: var(--es-primary) !important; }

/* ══════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--es-bg); }
::-webkit-scrollbar-thumb {
    background: var(--es-border-strong);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--es-muted); }

/* ══════════════════════════════════════════
   DROPDOWNS Bootstrap
   ══════════════════════════════════════════ */
.dropdown-menu {
    background: var(--es-surface);
    border-color: var(--es-border);
    box-shadow: var(--es-shadow-lg);
}
.dropdown-item { color: var(--es-text); }
.dropdown-item:hover { background: var(--es-bg); color: var(--es-primary); }
.dropdown-divider { border-color: var(--es-border); }

/* ══════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════ */
.pagination .page-link {
    background: var(--es-surface);
    border-color: var(--es-border);
    color: var(--es-secondary);
    border-radius: 9px !important;
    margin: 0 2px;
    font-size: .85rem; padding: .38rem .72rem;
    transition: all var(--es-transition);
}
.pagination .page-link:hover { background: var(--es-bg); }
.pagination .page-item.active .page-link {
    background: var(--es-secondary);
    border-color: var(--es-secondary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(10,93,194,.3);
}
.pagination .page-item.disabled .page-link { color: var(--es-muted); background: var(--es-bg); }

/* ══════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════ */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes pulse-dot {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .6; transform: scale(.85); }
}

/* ══════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════ */
@media print {
    .navbar, footer, .btn, .filter-panel,
    .map-actions, .map-legend, .map-statusbar { display: none !important; }
    body { font-size: 12pt; color: #000 !important; background: #fff !important; }
    h1,h2,h3,h4,h5 { color: #000 !important; }
    .card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ══════════════════════════════════════════
   RESPONSIVE GLOBAL
   ══════════════════════════════════════════ */
@media (max-width: 767.98px) {
    .hero-section { padding: 3rem 0 3.5rem; }
    .hero-section .hero-title { font-size: 1.9rem; }
    .stats-section { padding: 2rem 0; }
    .secteurs-section { padding: 2.5rem 0; }
    .map-section { padding: 2.5rem 0; }
    footer .col-md-4 { text-align: center; }
    footer ul { padding-left: 0; list-style: none; }
}