* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary:       #3b82f6;
    --rose:          #f9a8d4;
    --rose-border:   #ec4899;
    --blue:          #93c5fd;
    --blue-border:   #3b82f6;
    --green:      #6ee7b7;
    --green-border: #10b981;
    --bg:            #f8fafc;
    --surface:       #ffffff;
    --text:          #1e293b;
    --text-muted:    #64748b;
    --border:        #e2e8f0;
    --shadow:        0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.1);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 20px 15px;
}

/* ── Header ── */
.header {
    text-align: center;
    padding: 10px;
    background: var(--primary);
    border-radius: 16px;
    color: white;
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
}

.header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.3rem, 3.5vw, 1.8rem);
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 6px;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.2rem);
    opacity: 0.9;
}

/* ── Filters panel ── */
.filters-panel {
    background: var(--surface);
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.filters-left {
    flex: 0 0 auto;
}

.filters-right {
    flex: 0 0 auto;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-btn {
    padding: 8px 14px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: center;
    line-height: 1.3;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filter-btn:hover {
    border-color: var(--primary);
    background: #f5f3ff;
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ── Sub-filters ── */
.sub-filters-panel {
    background: var(--surface);
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.sub-filters-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.sub-filters-header:hover { opacity: 0.75; }

.sub-filters-header h4 {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 600;
}

.toggle-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.sub-filters-panel:not(.collapsed) .toggle-icon {
    transform: rotate(180deg);
}

.sub-filters-content {
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.3s ease, margin-top 0.3s ease, opacity 0.3s ease;
    opacity: 1;
    margin-top: 14px;
}

.sub-filters-panel.collapsed .sub-filters-content {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
}

.sub-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-section-title {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.2s;
    font-size: 0.87rem;
}

.checkbox-label:hover { background: #f8fafc; }

.sub-filter-checkbox {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.checkbox-label--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.checkbox-label--disabled span {
    color: var(--text-muted);
}

.reset-filters-btn {
    display: block;
    margin: 0 auto;
    padding: 8px 20px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    font-family: inherit;
}

.reset-filters-btn:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
}

/* ── Map wrapper ── */
.map-wrapper {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.maps-container {
    display: flex;
    gap: 10px;
    height: 700px;
}

.main-map-container {
    flex: 1;
    min-width: 0;
    position: relative;
    height: 700px;
}

.main-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ── DOM-TOM ── */
.domtom-maps {
    width: 28%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: #f8fafc;
    height: 700px;
}

.domtom-map-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.mini-map {
    flex: 1;
    min-height: 0;
    position: relative;
}

.mini-map-label {
    padding: 5px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #f1f5f9;
    border-top: 1px solid var(--border);
}

/* ── Stats panel ── */
.stats-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(8px);
    padding: 14px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    width: 210px;
    border-top: 3px solid var(--primary);
}

.stats-panel h3 {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.stats-theme-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stats-theme-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 5px 8px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

.stats-theme-name {
    font-size: 0.70rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.2;
}

.stats-theme-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary);
}

/* ── Légende ── */
.legend {
    position: absolute;
    bottom: 30px;
    right: 20px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(8px);
    padding: 14px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 200px;
    border-top: 3px solid var(--primary);
}

.legend h4 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
    color: var(--text);
}

.legend-scale {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.83rem;
    color: var(--text);
}

/* Points de légende */
.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2.5px solid;
}

.legend-dot.fd    { background: var(--rose);     border-color: var(--rose-border); }
.legend-dot.ur-fd { background: var(--blue);     border-color: var(--blue-border); }
.legend-dot.ur    { background: var(--green); border-color: var(--green-border); }
.legend-dot.none  { background: #ffffff;          border-color: #cbd5e1; }

/* Bicolore FD+UR */
.legend-dot.fd-ur {
    background: var(--green);
    border-color: var(--rose-border);
}

/* ── Modale ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: 14px;
    padding: 24px 28px 28px;
    max-width: 440px;
    width: 92%;
    max-height: 82vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalIn 0.18s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    transition: color 0.2s;
    z-index: 1;
}

.modal-close:hover { color: var(--text); }

/* ── Onglets ── */
.modal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.modal-tab {
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 7px;
}

.modal-tab:hover {
    color: var(--text);
}

.modal-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.modal-tabs:empty {
    display: none;
}

.modal-tabs:has(.modal-tab:only-child) {
    display: none;
}

/* Pastille colorée dans l'onglet */
.tab-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid;
    display: inline-block;
}

.tab-dot.fd    { background: var(--rose);     border-color: var(--rose-border); }
.tab-dot.ur    { background: var(--green); border-color: var(--green-border); }

/* ── Contenu modale ── */
.modal-pane { display: none; }
.modal-pane.active { display: block; }

.popup-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 3px;
    padding-right: 24px;
}

.popup-type {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.popup-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--primary);
    margin: 12px 0 6px;
}

.popup-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popup-list li {
    padding: 5px 0;
    font-size: 0.87rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.popup-list li:last-child { border-bottom: none; }

.popup-list li strong {
    color: var(--primary);
    white-space: nowrap;
    font-size: 0.92rem;
}

.popup-no-data {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.87rem;
    padding: 8px 0;
}

/* ── Footer ── */
footer {
    text-align: center;
    padding-top: 1.3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
  
.separator {
    margin: 0 .7rem;
}
  
footer a {
    color: var(--text-muted);
    text-decoration: none;
}

footer a:hover {
    color: var(--text);
}

/* ── Leaflet ── */
.leaflet-tooltip { display: none !important; }


/* ============================================================
   ICÔNES D'INFO DANS LES SECTIONS
   ============================================================ */

.filter-section-title {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: inline-flex;  /* ← inline-flex au lieu de flex */
    align-items: center;
    gap: 6px;  /* ← petit gap pour coller l'icône au texte */
}

.info-icon-small {
    background: none;
    border: none;
    color: #f59e0b;
    font-size: 0.95em;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;  /* ← réduit de 18 à 16 */
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.info-icon-small:hover {
    color: #d97706;
    background: rgba(251, 191, 36, 0.15);
    transform: scale(1.2);
}

.info-icon-small:active {
    transform: scale(0.95);
}

/* ============================================================
   MODALES D'EXPLICATION - VERSION SIMPLIFIÉE
   ============================================================ */

.explanation-box-simple {
    max-width: 500px;
    max-height: 80vh;
}

.explanation-modal-simple {
    padding: 0;
}

.explanation-title-simple {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    color: var(--primary);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 30px;
}

.explanation-title-simple i {
    font-size: 1.3em;
    flex-shrink: 0;
}

.explanation-text {
    color: #475569;
    line-height: 1.7;
    margin: 0 0 20px 0;
    font-size: 0.95em;
}

.info-box-simple {
    background: #eff6ff;
    border-left: 4px solid var(--primary);
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.info-box-simple.warning {
    background: #fff7ed;
    border-left-color: #f59e0b;
}

.info-box-simple.warning i {
    color: #f59e0b;
}

.info-box-simple i {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 1.1em;
}

.info-box-simple p {
    margin: 0;
    color: #1e40af;
    line-height: 1.6;
    font-size: 0.9em;
}

.info-box-simple.warning p {
    color: #92400e;
}

.doc-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s;
    margin-top: 8px;
}

.doc-link:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.doc-link i {
    font-size: 1.1em;
}

/* Footer - lien documentation */
.doc-part {
    white-space: nowrap;
}

.doc-part a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.doc-part i {
    font-size: 0.9em;
}










