/* ---------------------------------------------------------------------
   Simon — direction "Civique moderne"
--------------------------------------------------------------------- */
:root {
    --simon-sidebar-bg: #14113B;
    --simon-sidebar-text: #B9B6E0;
    --simon-sidebar-text-active: #FFFFFF;
    --simon-accent: #FF6B4A;

    --bs-primary: #FF6B4A;
    --bs-primary-rgb: 255, 107, 74;
    --bs-link-color: #D9472A;
    --bs-link-color-rgb: 217, 71, 42;
    --bs-link-hover-color: #B8381E;
    --bs-link-hover-color-rgb: 184, 56, 30;
    --bs-body-font-family: 'Manrope', system-ui, sans-serif;
    --bs-border-radius: 16px;
    --bs-border-radius-sm: 10px;
    --bs-border-radius-lg: 18px;
    --bs-body-bg: #F6F6FB;
}
[data-bs-theme="dark"] {
    --bs-link-color: #FF8A6E;
    --bs-link-color-rgb: 255, 138, 110;
    --bs-link-hover-color-rgb: 255, 168, 148;
    --bs-body-bg: #0F0E26;
    --bs-body-color: #E7E6F5;
    --bs-border-color: #2A2757;
    --bs-tertiary-bg: #1B1946;
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* --- Shell / sidebar --- */
.simon-shell { display: flex; min-height: 100vh; align-items: stretch; }
.simon-sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--simon-sidebar-bg);
    color: var(--simon-sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    gap: 22px;
}
.simon-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.simon-brand-mark {
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--simon-accent); color: var(--simon-sidebar-bg);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.simon-brand-name { color: #fff; font-weight: 800; font-size: 18px; letter-spacing: -0.3px; }

.simon-nav { display: flex; flex-direction: column; gap: 3px; }
.simon-nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: 10px;
    color: var(--simon-sidebar-text); font-size: 14px; font-weight: 600;
    text-decoration: none;
}
.simon-nav-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.simon-nav-link.active { background: rgba(255,255,255,0.09); color: #fff; font-weight: 700; }

.simon-sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.simon-admin-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.14);
    color: var(--simon-sidebar-text); font-size: 13px; font-weight: 700;
    text-decoration: none;
}
.simon-admin-link:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.simon-user { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.simon-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--simon-accent); color: var(--simon-sidebar-bg);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px; flex-shrink: 0;
}
.simon-user-info { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.simon-user-name { color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.simon-user-role { color: #8480B0; font-size: 11px; font-weight: 600; }

.simon-canton { color: var(--simon-sidebar-text); font-size: 12px; font-weight: 700; padding: 0 6px; margin-top: -2px; opacity: 0.85; }

/* --- Titre de page + admin/utilisateur/déconnexion, dans la topbar --- */
.simon-page-title { font-size: 1.15rem; font-weight: 800; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.simon-admin-link-top {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: 8px;
    border: 1px solid var(--bs-border-color, #E7E7F3);
    color: inherit; font-size: 13px; font-weight: 700; text-decoration: none;
}
.simon-admin-link-top:hover { background: rgba(0,0,0,0.04); }
.simon-user-top { display: flex; align-items: center; gap: 8px; }
.simon-user-top .simon-avatar { width: 28px; height: 28px; font-size: 11px; }
.simon-user-top .simon-user-info { line-height: 1.15; }
.simon-user-top .simon-user-name { color: inherit; font-size: 12px; }
.simon-user-top .simon-user-role { font-size: 10px; }

@media (min-width: 768px) {
    .simon-sidebar {
        position: sticky !important;
        top: 0 !important;
        height: 100vh !important;
        width: 232px !important;
        background: var(--simon-sidebar-bg) !important;
        border: 0 !important;
        box-shadow: none !important;
        visibility: visible !important;
        transform: none !important;
    }
}

/* --- Main / topbar --- */
.simon-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.simon-topbar {
    height: 62px; flex-shrink: 0; display: flex; align-items: center; gap: 10px;
    padding: 0 20px; border-bottom: 1px solid var(--bs-border-color, #E7E7F3);
}
.simon-content { padding-top: 24px; padding-bottom: 32px; flex: 1; }

/* --- Cards / components --- */
.card { box-shadow: 0 1px 3px rgba(20, 17, 59, 0.06); }
[data-bs-theme="dark"] .card { box-shadow: none; }
/* Bootstrap 5.3 ne lit pas --bs-primary pour ses boutons : on fixe leurs variables. */
.btn-primary {
    --bs-btn-bg: #FF6B4A; --bs-btn-border-color: #FF6B4A; --bs-btn-color: #14113B;
    --bs-btn-hover-bg: #F25A38; --bs-btn-hover-border-color: #F25A38; --bs-btn-hover-color: #14113B;
    --bs-btn-active-bg: #E5502F; --bs-btn-active-border-color: #E5502F; --bs-btn-active-color: #14113B;
    --bs-btn-disabled-bg: #FF6B4A; --bs-btn-disabled-border-color: #FF6B4A; --bs-btn-disabled-color: #14113B;
    --bs-btn-focus-shadow-rgb: 255, 107, 74;
    font-weight: 700;
}
.btn-outline-primary {
    --bs-btn-color: #D9472A; --bs-btn-border-color: #FF6B4A;
    --bs-btn-hover-bg: #FF6B4A; --bs-btn-hover-border-color: #FF6B4A; --bs-btn-hover-color: #14113B;
    --bs-btn-active-bg: #E5502F; --bs-btn-active-border-color: #E5502F; --bs-btn-active-color: #14113B;
    --bs-btn-focus-shadow-rgb: 255, 107, 74;
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #FF8A6E; }
h1, h2, h3, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 800; letter-spacing: -0.2px; }
.table-responsive { max-height: 70vh; }
.theme-toggle { cursor: pointer; }

/* --- Badges de positionnement (couleurs dédiées par valeur) --- */
.statut-badge { font-weight: 700; border-radius: 999px; padding: 0.35em 0.75em; font-size: 0.75rem; }
.positionnement-acquis { background: #DCFCE7; color: #15803D; }
.positionnement-favorable { background: #ECFCCB; color: #4D7C0F; }
.positionnement-a_contacter { background: #FFEDD5; color: #C2410C; }
.positionnement-defavorable { background: #FEE2E2; color: #DC2626; }
.positionnement-detracteur { background: #991B1B; color: #FFFFFF; }
[data-bs-theme="dark"] .positionnement-acquis { background: #14532D; color: #86EFAC; }
[data-bs-theme="dark"] .positionnement-favorable { background: #3F6212; color: #D9F99D; }
[data-bs-theme="dark"] .positionnement-a_contacter { background: #7C2D12; color: #FDBA74; }
[data-bs-theme="dark"] .positionnement-defavorable { background: #7F1D1D; color: #FCA5A5; }
[data-bs-theme="dark"] .positionnement-detracteur { background: #450A0A; color: #FCA5A5; }

/* --- Badges de priorité (électeur) --- */
.priorite-prioritaire { background: #FEE2E2; color: #B91C1C; }
.priorite-important { background: #FFEDD5; color: #C2410C; }
.priorite-neutre { background: #F3F4F6; color: #4B5563; }
.priorite-secondaire { background: #F3F4F6; color: #9CA3AF; }

/* --- Badges de priorité (bureau de vote) --- */
.priorite-bastion { background: #166534; color: #FFFFFF; }
.priorite-favorable { background: #ECFCCB; color: #4D7C0F; }
.priorite-conquete { background: #DBEAFE; color: #1D4ED8; }
.priorite-defavorable { background: #FEE2E2; color: #B91C1C; }

@media (max-width: 576px) {
    h1, h2 { font-size: 1.4rem; }
}

/* --- Ligne électeur colorée par positionnement (mobile uniquement) --- */
@media (max-width: 767.98px) {
    tr.ligne-positionnement-acquis td { background-color: #A7F3D0 !important; }
    tr.ligne-positionnement-favorable td { background-color: #ECFCCB !important; }
    tr.ligne-positionnement-defavorable td { background-color: #FEE2E2 !important; }
    tr.ligne-positionnement-detracteur td { background-color: #FCA5A5 !important; }
}

/* --- Boutons pleine largeur, plus gros, sur mobile --- */
@media (max-width: 767.98px) {
    .mobile-full-btn {
        display: block !important;
        width: 100%;
        padding: 0.65rem 1rem;
        font-size: 1rem;
        margin-bottom: 6px;
    }
}

/* --- Foyer coloré selon la réponse au porte-à-porte --- */
.foyer-card { transition: background-color 0.25s ease; }
.foyer-reponse-ok { background-color: #DCFCE7 !important; }
.foyer-reponse-pas_ouvert { background-color: #FFEDD5 !important; }
.foyer-reponse-pas_interesse { background-color: #FEE2E2 !important; }

.champ-contact { width: 100%; }
@media (min-width: 768px) {
    .champ-contact { width: auto; max-width: 200px; }
}

/* --- Panneau de collage récemment posé (vert, 3h) --- */
.panneau-pose-recente { background-color: #DCFCE7 !important; }

/* --- Lisibilité : texte noir sur les fonds colorés, sur mobile --- */
@media (max-width: 767.98px) {
    .foyer-reponse-ok, .foyer-reponse-ok *,
    .foyer-reponse-pas_ouvert, .foyer-reponse-pas_ouvert *,
    .foyer-reponse-pas_interesse, .foyer-reponse-pas_interesse *,
    .panneau-pose-recente, .panneau-pose-recente * {
        color: #111111 !important;
    }
}

/* --- Loader : chargement de page (navigation normale) et requêtes AJAX --- */
#simon-loader {
    position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000;
    background: var(--simon-accent, #FF6B4A);
    width: 0%; opacity: 0; transition: width 0.2s ease, opacity 0.2s ease;
}
#simon-loader.actif { opacity: 1; }

/* --- Tabs par BV (page Électeurs) --- */
.simon-tabs-bv { display: flex; flex-wrap: wrap; gap: 6px; }
.simon-tab-bv {
    flex-shrink: 0; padding: 6px 14px; border-radius: 999px;
    border: 1px solid var(--bs-border-color, #E7E7F3);
    color: inherit; text-decoration: none; font-size: 0.85rem; font-weight: 600;
    white-space: nowrap;
}
.simon-tab-bv:hover { background: rgba(0,0,0,0.04); }
.simon-tab-bv.active { background: var(--simon-accent); border-color: var(--simon-accent); color: #14113B; }

/* --- Sessions porte-à-porte : gros boutons de réponse rapide --- */
.btn-reponse-rapide { font-size: 0.95rem; padding: 10px 6px; }
.foyer-card { transition: opacity 0.3s ease; }
.foyer-card.foyer-traite { opacity: 0.9; }
.confirmation-badge { font-size: 0.75rem; }

/* =====================================================================
   Terrain mobile : barre d'onglets, porte-à-porte en 3 touches, tâches
===================================================================== */
:root {
    --pap-carte: #FFFFFF;
    --pap-trait: #E4E3F0;
    --pap-doux: #6B6990;
    --pap-ok: #1F9D6B;
    --pap-ferme: #6B6990;
    --pap-refus: #C2410C;
    --pap-fav: #1F9D6B;
    --pap-pfav: #6CC49A;
    --pap-hes: #E0A100;
    --pap-popp: #EF8A5B;
    --pap-opp: #C2410C;
}
[data-bs-theme="dark"] {
    --pap-carte: #1B1946;
    --pap-trait: #2A2757;
    --pap-doux: #A9A6D3;
}

/* Barre d'onglets mobile */
@media (max-width: 767.98px) {
    .simon-content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}
.simon-onglets {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    display: flex; background: var(--simon-sidebar-bg);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 18px rgba(20, 17, 59, 0.18);
}
.simon-onglets a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 4px; border-radius: 12px; min-height: 52px; justify-content: center;
    color: var(--simon-sidebar-text); text-decoration: none; font-size: 12px; font-weight: 700;
}
.simon-onglets a.actif { color: #fff; background: rgba(255, 255, 255, 0.10); }
.simon-onglets a.actif svg { color: var(--simon-accent); }

/* Porte-à-porte : en-tête collant */
.pap { max-width: 560px; margin: 0 auto; }
.pap-entete {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 10px;
    margin: -8px -12px 8px; padding: 8px 12px;
    background: var(--bs-body-bg); border-bottom: 1px solid var(--pap-trait);
}
.pap-retour {
    width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: var(--bs-body-color); background: var(--pap-carte); border: 1px solid var(--pap-trait);
}
.pap-entete-texte { min-width: 0; flex: 1; }
.pap-rue { font-weight: 800; font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pap-sous-titre { font-size: 13px; color: var(--pap-doux); font-weight: 600; }
.pap-file {
    flex-shrink: 0; font-size: 12px; font-weight: 800; padding: 6px 10px; border-radius: 999px;
    background: #FFF4D6; color: #7A5600;
}

.pap-consigne {
    font-size: 12.5px; line-height: 1.35; padding: 8px 10px; border-radius: 10px; margin-bottom: 8px;
    border-left: 4px solid var(--pap-doux); background: var(--pap-carte); font-weight: 600;
}
.pap-consigne-survoter { border-left-color: var(--pap-ok); }
.pap-consigne-ciblee { border-left-color: var(--pap-hes); }
.pap-consigne-contre_productive { border-left-color: var(--pap-refus); }
.pap-consigne-type { color: var(--pap-doux); font-weight: 500; margin-top: 2px; }

.pap-filtres { display: flex; gap: 6px; margin-bottom: 8px; }
.pap-filtre {
    flex: 1; min-height: 38px; border-radius: 10px; font-weight: 700; font-size: 14px;
    background: var(--pap-carte); border: 1px solid var(--pap-trait); color: var(--bs-body-color);
}
.pap-filtre.actif { background: var(--simon-sidebar-bg); color: #fff; border-color: var(--simon-sidebar-bg); }
[data-bs-theme="dark"] .pap-filtre.actif { background: var(--simon-accent); border-color: var(--simon-accent); color: #14113B; }

/* La porte */
.pap-porte, .pap-fin {
    background: var(--pap-carte); border: 1px solid var(--pap-trait); border-radius: 18px;
    padding: 14px 14px 8px; box-shadow: 0 6px 20px rgba(20, 17, 59, 0.06);
}
.pap-porte-haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pap-numero { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.pap-complement { color: var(--pap-doux); font-size: 14px; font-weight: 600; margin-top: 4px; }
.pap-deja { font-size: 12px; font-weight: 800; padding: 5px 9px; border-radius: 999px; background: var(--bs-tertiary-bg, #EEEDF6); }
.pap-deja-ok { background: #DDF4EA; color: #12643F; }
.pap-deja-pas_ouvert { background: #ECEBF3; color: #4B4970; }
.pap-deja-pas_interesse { background: #FCE6DA; color: #8A2E07; }
.pap-membres { list-style: none; padding: 0; margin: 10px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.pap-membres li { font-size: 14px; font-weight: 600; padding: 4px 10px; border-radius: 8px; background: var(--bs-body-bg); }

.pap-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pap-code {
    min-height: 72px; border-radius: 14px; border: 2px solid transparent;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    font-weight: 800; font-size: 15px; color: #fff; touch-action: manipulation;
}
.pap-code:active { transform: scale(0.97); }
.pap-code-ferme { background: var(--pap-ferme); }
.pap-code-refus { background: transparent; color: var(--pap-refus); border-color: var(--pap-refus); }
.pap-code-ok { grid-column: 1 / -1; min-height: 76px; background: var(--simon-accent); color: #14113B; font-size: 17px; }

.pap-navigation { display: flex; justify-content: space-between; margin-top: 6px; }
.pap-navigation .btn { font-weight: 700; text-decoration: none; min-height: 44px; }

/* Conversation */
.pap-question { margin-bottom: 14px; }
.pap-label { display: block; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; color: var(--pap-doux); margin-bottom: 6px; }
.pap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pap-chip {
    min-height: 40px; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px;
    background: var(--bs-body-bg); border: 1px solid var(--pap-trait); color: var(--bs-body-color);
}
.pap-chip.actif { background: var(--simon-sidebar-bg); border-color: var(--simon-sidebar-bg); color: #fff; }
[data-bs-theme="dark"] .pap-chip.actif { background: var(--simon-accent); border-color: var(--simon-accent); color: #14113B; }
.pap-intentions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pap-intention {
    min-height: 56px; border-radius: 12px; font-size: 12px; font-weight: 800; line-height: 1.15; padding: 4px;
    background: var(--bs-body-bg); border: 2px solid var(--pap-trait); color: var(--bs-body-color);
}
.pap-intention-favorable.actif { background: var(--pap-fav); border-color: var(--pap-fav); color: #fff; }
.pap-intention-plutot_favorable.actif { background: var(--pap-pfav); border-color: var(--pap-pfav); color: #0B3B26; }
.pap-intention-hesitant.actif { background: var(--pap-hes); border-color: var(--pap-hes); color: #3D2C00; }
.pap-intention-plutot_oppose.actif { background: var(--pap-popp); border-color: var(--pap-popp); color: #4A1A04; }
.pap-intention-oppose.actif { background: var(--pap-opp); border-color: var(--pap-opp); color: #fff; }
.pap-bascules { display: flex; flex-direction: column; gap: 4px; }
.pap-bascule { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.pap-bascule input { width: 22px; height: 22px; accent-color: var(--simon-accent); }
.pap-conversation-actions {
    position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; gap: 8px;
    padding-top: 8px; background: var(--pap-carte);
}
@media (min-width: 768px) { .pap-conversation-actions { bottom: 0; } }
.pap-conversation-actions .btn { min-height: 52px; font-weight: 800; border-radius: 12px; }
.pap-valider { flex: 1; }

/* Fin de rue */
.pap-fin-titre { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.pap-fin-chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; font-size: 14px; }
.pap-fin-chiffres div { background: var(--bs-body-bg); border-radius: 12px; padding: 10px; }
.pap-fin-chiffres strong { font-size: 22px; display: block; }

.pap-toast {
    position: fixed; left: 50%; transform: translateX(-50%); z-index: 1040;
    bottom: calc(92px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px);
    background: #14113B; color: #fff; padding: 10px 16px; border-radius: 12px;
    font-size: 14px; font-weight: 700; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.pap-toast-erreur { background: #8A2E07; }
@media (min-width: 768px) { .pap-toast { bottom: 24px; } }

/* Liste des rues */
.pap-lien-retour { display: inline-block; font-weight: 700; text-decoration: none; margin-bottom: 6px; min-height: 32px; }
.pap-titre-page { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.pap-rues { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.pap-rue-ligne {
    display: block; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--bs-body-color);
    background: var(--pap-carte); border: 1px solid var(--pap-trait);
}
.pap-rue-ligne:active { transform: scale(0.99); }
.pap-rue-nom { font-weight: 800; font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pap-rue-chiffres { font-size: 13px; color: var(--pap-doux); font-weight: 600; margin: 2px 0 8px; }
.pap-barre { height: 6px; border-radius: 999px; background: var(--bs-body-bg); overflow: hidden; }
.pap-barre span { display: block; height: 100%; background: var(--pap-ok); border-radius: 999px; }
.pap-rue-finie { opacity: 0.6; }

/* Tâches */
.taches { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.tache {
    background: var(--pap-carte); border: 1px solid var(--pap-trait); border-radius: 16px; padding: 14px;
}
.tache-retard { border-left: 4px solid var(--pap-refus); }
.tache-faite { opacity: 0.7; }
.tache-haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.tache-type {
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;
    padding: 4px 8px; border-radius: 6px; background: var(--bs-body-bg);
}
.tache-type-porte_a_porte { background: #FFE6DF; color: #A23A1F; }
.tache-type-collage { background: #E3E2F7; color: #2F2B78; }
.tache-type-boitage, .tache-type-tractage { background: #DDF4EA; color: #12643F; }
.tache-echeance { font-size: 13px; font-weight: 700; color: var(--pap-doux); }
.tache-retard .tache-echeance { color: var(--pap-refus); }
.tache-titre { font-weight: 800; font-size: 16px; line-height: 1.3; }
.tache-lieu { font-size: 13px; color: var(--pap-doux); font-weight: 600; margin-top: 2px; }
.tache-consigne { font-size: 14px; margin-top: 8px; }
.tache-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tache-actions .btn { min-height: 44px; font-weight: 800; border-radius: 12px; padding-left: 18px; padding-right: 18px; }
.tache-vide { text-align: center; padding: 32px 16px; background: var(--pap-carte); border: 1px dashed var(--pap-trait); border-radius: 16px; }

/* En conversation, la liste des habitants laisse place au choix « Qui a répondu ? ». */
.pap-en-conversation .pap-membres { display: none; }

/* Pilotage (tableau de bord) */
.pilotage-semaine { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 767.98px) { .pilotage-semaine { grid-template-columns: repeat(2, 1fr); } }
.pilotage-tuile { background: var(--pap-carte); border: 1px solid var(--pap-trait); border-radius: 16px; padding: 14px; }
.pilotage-tuile-label { font-size: 12px; font-weight: 700; color: var(--pap-doux); }
.pilotage-tuile-chiffre { font-size: 28px; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.pilotage-indicateurs { display: flex; flex-direction: column; gap: 14px; }
.pilotage-valeur { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pilotage-barre { height: 8px; border-radius: 999px; background: var(--pap-trait); overflow: hidden; margin: 6px 0 4px; }
.pilotage-barre span { display: block; height: 100%; border-radius: 999px; background: var(--simon-accent); }
.pilotage-bureaux td, .pilotage-bureaux th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pilotage-regle { font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 6px; }
.pilotage-regle-survoter { background: #DDF4EA; color: #12643F; }
.pilotage-regle-ciblee { background: #FFF1CC; color: #6B4A00; }
.pilotage-regle-contre_productive { background: #FCE6DA; color: #8A2E07; }

/* Lots à valider */
.simon-pastille {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
    padding: 0 6px; border-radius: 999px; background: var(--simon-accent); color: #14113B;
    font-size: 11px; font-weight: 800; margin-left: auto;
}
.simon-onglet-icone { position: relative; display: inline-flex; }
.simon-onglet-icone .simon-pastille { position: absolute; top: -6px; right: -14px; margin: 0; }
.lot-carte { display: block; text-decoration: none; color: var(--bs-body-color); }
.lot-statut-en_attente { background: #FFF1CC; color: #6B4A00; }
.lot-statut-applique { background: #DDF4EA; color: #12643F; }
.lot-statut-refuse { background: #ECEBF3; color: #4B4970; }
.lot-statut-echec { background: #FCE6DA; color: #8A2E07; }
.lot-justification { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--pap-carte); border: 1px solid var(--pap-trait); font-size: 14px; }
.lot-operations { padding-left: 1.4rem; display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.lot-operations li { background: var(--pap-carte); border: 1px solid var(--pap-trait); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.lot-op-type { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: var(--pap-doux); margin-bottom: 2px; }
.lot-decision, .lot-compte-rendu { max-width: 720px; margin-top: 16px; }
.lot-compte-rendu { padding: 12px; border-radius: 12px; background: var(--pap-carte); border: 1px solid var(--pap-trait); }
.lot-nouvelle-url { border: 2px solid var(--simon-accent); }
.pap-etiquettes { display: flex; gap: 6px; flex-wrap: wrap; }
.pilotage-statut-bastion { background: #166534; color: #fff; }
.pilotage-statut-favorable { background: #7cc58b; color: #0b2e14; }
.pilotage-statut-conquete { background: #a8a7a1; color: #1a1a19; }
.pilotage-statut-defavorable { background: #ef8f8e; color: #4a0f0f; }
.pilotage-statut-tres_defavorable { background: #991b1b; color: #fff; }

/* Bureaux de vote : couleur par groupe de quartiers et tri.
   Groupes A→E = 5 premières teintes catégorielles validées (daltonisme compris). */
:root {
    --groupe-A: #2a78d6; --groupe-B: #eb6834; --groupe-C: #1baf7a; --groupe-D: #eda100; --groupe-E: #e87ba4;
    --bv-a: #e3eefb; --bv-b: #fde9e0; --bv-c: #ddf5ec; --bv-d: #fdf3d9; --bv-e: #fce8f0;
    --bv-a-bord: var(--groupe-A); --bv-b-bord: var(--groupe-B); --bv-c-bord: var(--groupe-C);
    --bv-d-bord: var(--groupe-D); --bv-e-bord: var(--groupe-E);
}
[data-bs-theme="dark"] {
    --groupe-A: #3987e5; --groupe-B: #d95926; --groupe-C: #199e70; --groupe-D: #c98500; --groupe-E: #d55181;
    --bv-a: #16263d; --bv-b: #3a1f14; --bv-c: #10302a; --bv-d: #3a2c0a; --bv-e: #3b1d29;
}
.bv-barre { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bv-tris { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bv-legende { display: flex; gap: 6px; flex-wrap: wrap; }
.bv-pastille { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border-left: 4px solid transparent; }
.bv-groupe-A { --bv-fond: var(--bv-a); --bv-bord: var(--bv-a-bord); }
.bv-groupe-B { --bv-fond: var(--bv-b); --bv-bord: var(--bv-b-bord); }
.bv-groupe-C { --bv-fond: var(--bv-c); --bv-bord: var(--bv-c-bord); }
.bv-groupe-D { --bv-fond: var(--bv-d); --bv-bord: var(--bv-d-bord); }
.bv-groupe-E { --bv-fond: var(--bv-e); --bv-bord: var(--bv-e-bord); }
.bv-pastille[class*="bv-groupe-"] { background: var(--bv-fond); border-left-color: var(--bv-bord); }
.bv-table tr[class*="bv-groupe-"] > td { --bs-table-bg: var(--bv-fond); background-color: var(--bv-fond); }
.bv-table tr[class*="bv-groupe-"] > td:first-child { box-shadow: inset 4px 0 0 var(--bv-bord); font-weight: 700; }


/* =====================================================================
   Tableau de bord : 3 onglets, graphiques en HTML (aucune bibliothèque)
===================================================================== */
:root {
    --seq: #2a78d6; --neutre: #b9b8b2; --neutre-clair: #d6d5cf;
    --p1: #104281; --p2: #1c5cab; --p3: #3987e5; --p4: #6da7ec; --p5: #86b6ef;
    --div-fort-plus: #1c5cab; --div-plus: #6da7ec; --div-zero: #a8a7a1; --div-moins: #ef8f8e; --div-fort-moins: #b8312f;
    --bon: #0ca30c; --critique: #d03b3b;
}
[data-bs-theme="dark"] { --seq: #3987e5; --neutre: #6b6a64; --neutre-clair: #4a4944; --div-zero: #77766f; }
.tdb { max-width: 1280px; }
.tdb-entete { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tdb-compte { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tdb-compte-chiffre { font-size: 22px; font-weight: 800; }
.tdb-compte-texte { font-size: 14px; color: var(--pap-doux); font-weight: 600; }
.tdb-alerte { font-weight: 800; text-decoration: none; padding: 6px 12px; border-radius: 999px; background: #FFF1CC; color: #6B4A00; }
.tdb-onglets { gap: 6px; margin-bottom: 14px; flex-wrap: nowrap; overflow-x: auto; border-bottom: 1px solid var(--pap-trait); padding-bottom: 8px; }
.tdb-onglets .nav-link { white-space: nowrap; font-weight: 700; color: var(--pap-doux); border-radius: 10px; padding: 8px 14px; border: 0; background: none; }
.tdb-onglets .nav-link.active { background: var(--simon-sidebar-bg); color: #fff; }
[data-bs-theme="dark"] .tdb-onglets .nav-link.active { background: var(--simon-accent); color: #14113B; }

.tdb-carte { background: var(--pap-carte); border: 1px solid var(--pap-trait); border-radius: 16px; padding: 16px; margin-bottom: 14px; min-width: 0; }
.tdb-titre { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.tdb-libelle { font-size: 12px; font-weight: 700; color: var(--pap-doux); }
.tdb-note { font-size: 13px; color: var(--pap-doux); margin-bottom: 10px; }
.tdb-grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tdb-grille-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 991.98px) { .tdb-grille-2, .tdb-grille-3 { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* Héros : avancement global */
.tdb-hero-tete { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.tdb-hero-chiffre { font-size: 48px; font-weight: 800; line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.tdb-hero-secondaire { font-size: 24px; font-weight: 800; color: var(--pap-doux); text-align: right; }
.tdb-hero-attendu { text-align: right; }
.tdb-jauge { position: relative; height: 14px; border-radius: 999px; background: var(--pap-trait); margin: 14px 0 10px; }
.tdb-jauge-rempli { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--simon-accent); }
.tdb-jauge-repere { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--bs-body-color); }

/* Barres horizontales */
.tdb-barre-ligne { display: grid; grid-template-columns: 52px minmax(0, 1fr) 92px; align-items: center; gap: 10px; padding: 5px 0; }
.tdb-barre-nom { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdb-barre-ligne:has(.tdb-barre-nom-long) { grid-template-columns: minmax(90px, 40%) minmax(0, 1fr) 92px; }
.tdb-barre-ligne:has(.tdb-barre-nom-bv) { grid-template-columns: 72px minmax(0, 1fr) 92px; }
.tdb-barre-nom-bv small { color: var(--pap-doux); font-weight: 700; }
.tdb-barre-piste { position: relative; height: 12px; border-radius: 4px; background: var(--pap-trait); }
.tdb-barre-rempli { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; min-width: 2px; }
.tdb-barre-repere { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--bs-body-color); opacity: 0.75; }
.tdb-barre-repere-legende { position: relative; display: inline-block; top: 0; height: 12px; vertical-align: middle; margin: 0 6px 0 2px; }
.tdb-legende-repere { font-size: 12px; color: var(--pap-doux); margin: -6px 0 14px; }
.tdb-barre-valeur { font-size: 14px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tdb-barre-valeur small { display: block; font-size: 11px; font-weight: 600; color: var(--pap-doux); }

/* Pastilles et puces */
.tdb-pastille { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 800; color: #fff; }
.tdb-puce { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: baseline; }
.tdb-p1, .tdb-fond-p1 { background: var(--p1); } .tdb-p2, .tdb-fond-p2 { background: var(--p2); } .tdb-p3, .tdb-fond-p3 { background: var(--p3); }
.tdb-p4, .tdb-fond-p4 { background: var(--p4); } .tdb-p5, .tdb-fond-p5 { background: var(--p5); }
.tdb-p4, .tdb-p5 { color: #0b2340; }
.tdb-groupe-A, .tdb-fond-groupe-A { background: var(--groupe-A); } .tdb-groupe-B, .tdb-fond-groupe-B { background: var(--groupe-B); }
.tdb-groupe-C, .tdb-fond-groupe-C { background: var(--groupe-C); } .tdb-groupe-D, .tdb-fond-groupe-D { background: var(--groupe-D); }
.tdb-groupe-E, .tdb-fond-groupe-E { background: var(--groupe-E); } .tdb-fond-groupe-aucun { background: var(--neutre); }
.tdb-groupe-C, .tdb-groupe-D, .tdb-groupe-E { color: #1a1a19; }
.tdb-fond-pos-acquis { background: var(--div-fort-plus); }
.tdb-fond-pos-favorable { background: var(--div-plus); }
.tdb-fond-pos-hesitant { background: var(--div-zero); }
.tdb-fond-pos-a_contacter { background: var(--neutre-clair); }
.tdb-fond-pos-defavorable { background: var(--div-moins); }
.tdb-fond-pos-detracteur { background: var(--div-fort-moins); }
/* Statut des bureaux : vert foncé (bastion) → gris → rouge foncé (très défavorable). */
.tdb-fond-statut-bastion { background: #166534; }
.tdb-fond-statut-favorable { background: #7cc58b; }
.tdb-fond-statut-conquete { background: var(--div-zero); }
.tdb-fond-statut-defavorable { background: #ef8f8e; }
.tdb-fond-statut-tres_defavorable { background: #991b1b; }
.tdb-fond-rep-ok { background: var(--groupe-A); } .tdb-fond-rep-pas_interesse { background: var(--groupe-B); } .tdb-fond-rep-pas_ouvert { background: var(--neutre); }
.tdb-fond-sequentiel { background: var(--seq); } .tdb-fond-neutre { background: var(--neutre); }

/* Barre empilée 100 % (2 px d'écart entre segments) */
.tdb-empile { display: flex; gap: 2px; height: 18px; border-radius: 4px; overflow: hidden; background: var(--pap-trait); margin: 8px 0; }
.tdb-empile > span { display: block; min-width: 3px; }
.tdb-tableau-legende { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 14px; font-size: 13px; }
.tdb-tableau-legende > div { display: flex; align-items: center; gap: 4px; }
.tdb-tableau-legende strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.tdb-tableau-legende em { font-style: normal; color: var(--pap-doux); min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.tdb-legende { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--pap-doux); font-weight: 600; margin-bottom: 8px; }

/* Colonnes (semaines) */
.tdb-colonnes { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 18px; }
.tdb-colonne { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.tdb-colonne-barre { width: 100%; max-width: 34px; border-radius: 4px 4px 0 0; min-height: 0; }
.tdb-colonne-empilee { display: flex; flex-direction: column-reverse; gap: 2px; background: none; }
.tdb-colonne-empilee > span { display: block; width: 100%; }
.tdb-colonne-empilee > span:last-child { border-radius: 4px 4px 0 0; }
.tdb-colonne-valeur { font-size: 11px; font-weight: 800; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.tdb-colonne-date { font-size: 10px; color: var(--pap-doux); margin-top: 4px; white-space: nowrap; }
.tdb-colonne:hover .tdb-colonne-barre { filter: brightness(1.1); }
@media (max-width: 575.98px) { .tdb-colonne:nth-child(odd) .tdb-colonne-date { visibility: hidden; } }

/* Tuiles */
.tdb-tuiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.tdb-tuiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 991.98px) { .tdb-tuiles, .tdb-tuiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tdb-tuile { background: var(--pap-carte); border: 1px solid var(--pap-trait); border-radius: 14px; padding: 12px; }
.tdb-tuile-chiffre { font-size: 24px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tdb-tuile-chiffre small { font-size: 13px; color: var(--pap-doux); font-weight: 700; }

/* Groupes : deux barres (inscrits / voix) */
.tdb-groupe { padding: 8px 0; border-bottom: 1px solid var(--pap-trait); }
.tdb-groupe:last-child { border-bottom: 0; }
.tdb-groupe-tete { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tdb-groupe-nom { font-weight: 700; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdb-groupe-meta { margin-left: auto; font-size: 12px; color: var(--pap-doux); white-space: nowrap; }
.tdb-double { display: flex; flex-direction: column; gap: 2px; }
.tdb-double-ligne { display: flex; align-items: center; gap: 8px; height: 10px; }
.tdb-double-ligne > span { display: block; height: 10px; border-radius: 0 4px 4px 0; min-width: 2px; }
.tdb-double-ligne em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--pap-doux); font-variant-numeric: tabular-nums; }

/* Rythme, statut, entonnoir, méthode */
.tdb-rythme { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 10px; }
.tdb-statut { display: inline-block; font-weight: 800; font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.tdb-statut-bon { color: var(--bon); background: rgba(12, 163, 12, 0.1); }
.tdb-statut-alerte { color: var(--critique); background: rgba(208, 59, 59, 0.1); }
.tdb-texte-alerte { color: var(--critique); }
.tdb-entonnoir { margin-bottom: 10px; }
.tdb-entonnoir-tete { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.tdb-entonnoir-tete small { color: var(--pap-doux); font-weight: 600; }
.tdb-entonnoir-piste { height: 14px; border-radius: 4px; background: var(--pap-trait); }
.tdb-entonnoir-piste > span { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.tdb-mini { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.tdb-mini-piste { position: relative; flex: 1; height: 8px; border-radius: 4px; background: var(--pap-trait); }
.tdb-mini-piste > span:first-child { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; }
.tdb-table-bureaux td, .tdb-table-bureaux th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tdb-methode { font-size: 13px; color: var(--pap-doux); margin-bottom: 14px; }
.tdb-methode summary { font-weight: 700; cursor: pointer; }
.tdb-methode ol { margin: 8px 0 0; padding-left: 1.2rem; }

/* ---------------------------------------------------------------------
   Fiche électeur : bandeau « À faire » et onglets
--------------------------------------------------------------------- */
.positionnement-hesitant { background: #FEF3C7; color: #92400E; }
[data-bs-theme="dark"] .positionnement-hesitant { background: #78350F; color: #FDE68A; }

.fiche-bandeau { background: var(--pap-carte); border: 1px solid var(--pap-trait); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.fiche-bandeau-haut { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 992px) {
    .fiche-bandeau-haut { flex-direction: row; align-items: center; gap: 24px; }
    .fiche-identite { flex: 1; min-width: 0; }
    .fiche-afaire { width: 360px; flex-shrink: 0; }
}
.fiche-nom { font-size: 22px; font-weight: 800; margin: 0; line-height: 1.2; }
.fiche-sous { color: var(--pap-doux); font-weight: 600; font-size: 14px; margin-top: 2px; }
.fiche-badges, .fiche-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fiche-badge { font-size: 12px; font-weight: 800; padding: 4px 8px; border-radius: 6px; }
.fiche-badge-bv { background: var(--simon-sidebar-bg); color: #fff; }
[data-bs-theme="dark"] .fiche-badge-bv { background: #2A2757; }
.fiche-badge-rang { background: #104281; color: #fff; }
.fiche-badge.bv-pastille { border-radius: 6px; color: inherit; }
.fiche-regle-survoter { background: #DDF4EA; color: #12643F; }
.fiche-regle-ciblee { background: #E3EEFB; color: #104281; }
.fiche-regle-contre_productive { background: #FDE2E1; color: #8E1B1B; }
.fiche-chip { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.chip-jaune { background: #FFF1CC; color: #6B4A00; }
.chip-corail { background: #FFE6DF; color: #A23A1F; }
.chip-vert { background: #DDF4EA; color: #12643F; }
.chip-bleu { background: #E3EEFB; color: #104281; }
.chip-gris { background: #EFEFF4; color: #5B5980; }
[data-bs-theme="dark"] .chip-jaune { background: #3A2C0A; color: #FDE68A; }
[data-bs-theme="dark"] .chip-corail { background: #3A1F14; color: #FFB4A0; }
[data-bs-theme="dark"] .chip-vert { background: #10302A; color: #86EFAC; }
[data-bs-theme="dark"] .chip-bleu { background: #16263D; color: #9CC3F5; }
[data-bs-theme="dark"] .chip-gris { background: #2A2757; color: #C9C7E8; }

/* Potentiel estimé (PRIO_INSCRIT) : contour en pointillés pour ne jamais le confondre
   avec le positionnement déclaré. Une pastille porte la couleur du niveau. */
.potentiel-tres_probable { --potentiel: #166534; }
.potentiel-probable { --potentiel: #7cc58b; }
.potentiel-incertain { --potentiel: #a8a7a1; }
.potentiel-peu_probable { --potentiel: #ef8f8e; }
.potentiel-improbable { --potentiel: #991b1b; }
.chip-estimation { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--bs-body-color); border: 2px dashed var(--potentiel, #a8a7a1); font-weight: 700; }
.chip-estimation::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--potentiel, #a8a7a1); flex-shrink: 0; }
.badge.chip-estimation { padding: 2px 7px; border-radius: 999px; font-size: 11px; }
.tdb-potentiel-pile { display: flex; height: 18px; border-radius: 5px; overflow: hidden; background: var(--pap-trait); margin: 6px 0 10px; }
.tdb-potentiel-pile span { display: block; height: 100%; background: var(--potentiel); }
.tdb-potentiel-ligne { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; color: inherit; text-decoration: none; }
.tdb-potentiel-ligne:hover { text-decoration: underline; }
.tdb-potentiel-ligne i { width: 12px; height: 12px; border-radius: 50%; background: var(--potentiel); }
.tdb-potentiel-ligne strong { font-variant-numeric: tabular-nums; }

.fiche-afaire { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 12px 14px; background: var(--simon-sidebar-bg); color: #fff; }
.fiche-afaire svg { color: var(--simon-accent); flex-shrink: 0; margin-top: 2px; }
.fiche-afaire-titre { font-size: 11px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: #FF8A6E; }
.fiche-afaire-texte { font-size: 15px; font-weight: 700; line-height: 1.35; }
.fiche-afaire-alerte { background: #8E1B1B; }
.fiche-afaire-alerte svg, .fiche-afaire-alerte .fiche-afaire-titre { color: #FFD3CC; }
.fiche-afaire-neutre { background: #EFEFF4; color: #14113B; }
.fiche-afaire-neutre svg, .fiche-afaire-neutre .fiche-afaire-titre { color: #5B5980; }
.fiche-afaire-fait { background: #12643F; }
.fiche-afaire-fait svg, .fiche-afaire-fait .fiche-afaire-titre { color: #B7F0D3; }
[data-bs-theme="dark"] .fiche-afaire { background: #2A2757; }
[data-bs-theme="dark"] .fiche-afaire-neutre { background: #1B1946; color: #E7E6F5; border: 1px solid #2A2757; }
.fiche-dernier { font-size: 13px; color: var(--pap-doux); font-weight: 600; margin-top: 10px; }

.fiche-onglets { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.fiche-onglets::-webkit-scrollbar { display: none; }
.fiche-onglet { flex-shrink: 0; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--pap-trait); background: var(--pap-carte); color: var(--pap-doux); font-weight: 700; font-size: 14px; }
.fiche-onglet.active { background: var(--simon-sidebar-bg); border-color: var(--simon-sidebar-bg); color: #fff; font-weight: 800; }
[data-bs-theme="dark"] .fiche-onglet.active { background: var(--simon-accent); border-color: var(--simon-accent); color: #14113B; }
.fiche-onglet-compteur { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--simon-accent); color: #14113B; font-size: 12px; font-weight: 800; }

.fiche-carte { background: var(--pap-carte); border: 1px solid var(--pap-trait); border-radius: 18px; padding: 16px; }
.fiche-carte-titre { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.fiche-grille-cartes { display: grid; gap: 12px; }
@media (min-width: 992px) {
    .fiche-grille-cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .fiche-grille-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #onglet-essentiel .fiche-carte { max-width: 760px; }
}
.fiche-grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 420px) { .fiche-grille-2 { grid-template-columns: 1fr; } }
.fiche-champ { margin-bottom: 16px; }
.fiche-champ:last-child { margin-bottom: 0; }
.fiche-label { display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: var(--pap-doux); margin-bottom: 8px; }
.fiche-aide { font-size: 13px; color: var(--pap-doux); margin-bottom: 10px; }

.fiche-choix { display: flex; flex-wrap: wrap; gap: 6px; }
.fiche-choix-btn { flex: 1 1 0; min-width: max-content; min-height: 44px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--pap-trait); background: var(--bs-body-bg); font-size: 14px; font-weight: 700; cursor: pointer; user-select: none; line-height: 1.15; }
.btn-check:checked + .fiche-choix-btn { background: var(--simon-sidebar-bg); border-color: var(--simon-sidebar-bg); color: #fff; }
[data-bs-theme="dark"] .btn-check:checked + .fiche-choix-btn { background: var(--simon-accent); border-color: var(--simon-accent); color: #14113B; }
.btn-check:focus-visible + .fiche-choix-btn { outline: 3px solid var(--simon-accent); outline-offset: 2px; }
.fiche-choix-intention { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fiche-choix-intention .fiche-choix-btn { min-width: 0; min-height: 52px; font-size: 13px; }
@media (min-width: 768px) { .fiche-choix-intention { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.fiche-choix-intention .btn-check:checked + label[for$="-acquis"], .fiche-choix-intention .btn-check:checked + label[for$="-favorable"] { background: #12643F; border-color: #12643F; color: #fff; }
.fiche-choix-intention .btn-check:checked + label[for$="-hesitant"] { background: #E0A100; border-color: #E0A100; color: #3D2C00; }
.fiche-choix-intention .btn-check:checked + label[for$="-defavorable"], .fiche-choix-intention .btn-check:checked + label[for$="-detracteur"] { background: #991B1B; border-color: #991B1B; color: #fff; }
.fiche-choix-pilules .fiche-choix-btn { flex: 0 0 auto; border-radius: 999px; min-height: 40px; font-size: 13px; }

.fiche-case { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 600; cursor: pointer; }
.fiche-case input { width: 22px; height: 22px; accent-color: var(--simon-accent); flex-shrink: 0; }
.fiche-revele { margin: 0 0 6px 32px; }
.fiche-parti { border-left: 3px solid var(--simon-accent); padding-left: 12px; }

.fiche-chaine { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.fiche-chaine li { display: flex; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--pap-trait); }
.fiche-chaine li:last-child { border-bottom: 0; }
.fiche-chaine .fiche-case { flex: 1; }
.fiche-chaine-libelle { flex: 1; font-size: 15px; font-weight: 600; }
.fiche-chaine-quand { font-size: 13px; color: var(--pap-doux); white-space: nowrap; }
.fiche-chaine-case { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #C9C7DD; flex-shrink: 0; }
.fiche-chaine li.fait .fiche-chaine-case { background: #1F9D6B url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: #1F9D6B; }

.fiche-enregistrer { position: sticky; bottom: 0; z-index: 5; padding: 12px 0; margin-top: 4px; background: linear-gradient(to top, var(--bs-body-bg) 70%, transparent); }
@media (max-width: 767.98px) {
    .fiche-enregistrer { bottom: calc(68px + env(safe-area-inset-bottom)); }
    .fiche-enregistrer .btn { width: 100%; }
}

.fiche-demande { border: 1px solid var(--pap-trait); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.fiche-demande.en-retard { border-color: #D03B3B; box-shadow: inset 4px 0 0 #D03B3B; }
.fiche-demande-objet { font-size: 15px; font-weight: 700; }
.fiche-demande-meta { font-size: 13px; color: var(--pap-doux); margin-top: 2px; }
.fiche-demande-reponse { font-size: 14px; margin-top: 8px; }
.fiche-demande-maj { margin-top: 10px; }
.fiche-etapes { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.fiche-etape { font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--pap-trait); color: var(--pap-doux); }
.fiche-etape.actuelle { background: var(--simon-sidebar-bg); border-color: var(--simon-sidebar-bg); color: #fff; }
[data-bs-theme="dark"] .fiche-etape.actuelle { background: var(--simon-accent); border-color: var(--simon-accent); color: #14113B; }

.fiche-chrono { list-style: none; padding: 0; margin: 0 0 10px; }
.fiche-chrono li { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.fiche-chrono li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--pap-trait); }
.fiche-chrono-point { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; background: #A8A7A1; }
.fiche-chrono-point.pap-ok { background: #1F9D6B; }
.fiche-chrono-point.pap-pas_interesse { background: #C2410C; }
.fiche-chrono-meta { font-size: 13px; color: var(--pap-doux); font-weight: 700; }
.fiche-chrono-titre { font-size: 15px; font-weight: 700; }
.fiche-chrono-detail { font-size: 14px; color: var(--pap-doux); }

.fiche-membre { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; margin-bottom: 6px; border-radius: 12px; border: 1px solid var(--pap-trait); color: inherit; text-decoration: none; }
.fiche-membre:hover { border-color: var(--simon-accent); color: inherit; }
.fiche-membre-nom { flex: 1; font-weight: 700; }
.fiche-membre-age { font-size: 13px; color: var(--pap-doux); }

.fiche-dl { display: grid; grid-template-columns: minmax(120px, 42%) 1fr; row-gap: 8px; column-gap: 10px; margin: 0; font-size: 14px; }
.fiche-dl dt { font-weight: 500; color: var(--pap-doux); }
.fiche-dl dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.fiche-dl-separe { border-top: 1px solid var(--pap-trait); margin-top: 14px; padding-top: 14px; }
/* Les onglets du formulaire ne sont pas enfants directs de .tab-content. */
.fiche-contenu .tab-pane { display: none; }
.fiche-contenu .tab-pane.active { display: block; }
.fiche-grille-2 { margin-bottom: 16px; } .fiche-grille-2 .fiche-champ { margin-bottom: 0; }
/* Étapes d'une demande : simple fil, pour ne pas les confondre avec des boutons. */
.fiche-etapes { gap: 4px; }
.fiche-etape, .fiche-etape.actuelle, [data-bs-theme="dark"] .fiche-etape.actuelle { border: 0; padding: 0; background: none; color: var(--pap-doux); font-weight: 600; }
.fiche-etape + .fiche-etape::before { content: "→ "; color: var(--pap-doux); font-weight: 600; }
.fiche-etape.actuelle { color: var(--bs-body-color); font-weight: 800; text-decoration: underline; text-decoration-color: var(--simon-accent); text-decoration-thickness: 3px; text-underline-offset: 4px; }

/* ---------------------------------------------------------------------
   Lobbying associatif : compteur de visites et suivi au tableau de bord
--------------------------------------------------------------------- */
:root { --lobby-jamais: #d03b3b; --lobby-en-cours: #eda100; --lobby-atteint: #0ca30c; --lobby-complet: #0b6e0b; }
.lobby-jamais { background: var(--lobby-jamais); }
.lobby-en_cours { background: var(--lobby-en-cours); }
.lobby-atteint { background: var(--lobby-atteint); }
.lobby-complet { background: var(--lobby-complet); }
.tdb-sous-titre { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: var(--pap-doux); margin-bottom: 8px; }
.lobby-ligne { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--pap-trait); color: inherit; text-decoration: none; font-size: 14px; }
.lobby-ligne:hover { color: var(--bs-link-color); }
.lobby-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-meta { flex-shrink: 0; font-size: 12px; color: var(--pap-doux); }

.orga-compteur { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; min-width: 110px; }
.orga-compteur strong { font-size: 15px; }
.orga-compteur small { color: var(--pap-doux); font-size: 12px; }
.orga-compteur .orga-piste { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--pap-trait); overflow: hidden; margin-top: 3px; }
.orga-compteur .orga-piste span { display: block; height: 100%; border-radius: 999px; background: var(--lobby-en-cours); }
.orga-jamais .orga-piste span { background: var(--lobby-jamais); }
.orga-atteint .orga-piste span { background: var(--lobby-atteint); }
.orga-complet .orga-piste span { background: var(--lobby-complet); }
.orga-compteur-grand strong { font-size: 32px; line-height: 1; }
.orga-compteur-grand .orga-piste { height: 10px; }
.orga-plus { min-width: 44px; min-height: 36px; font-weight: 800; }
.orga-table td { vertical-align: middle; }
