/* css-version: 5 */
/* ^ Marqueur de déploiement. DOIT RESTER EN PREMIÈRE LIGNE : config.php ne lit
   que les 300 premiers octets du fichier.
   À INCRÉMENTER à chaque modification de ce fichier, en même temps que
   CSS_VERSION_REQUISE dans config.php. Si les deux valeurs diffèrent, un bandeau
   d'avertissement s'affiche aux administrateurs. */

/* =====================================================================
   Share to Dance - Feuille de style
   Palette inspirée de la page Calendrier :
     violet profond, orange accent, fonds crème / lila clair
   ===================================================================== */
:root {
    --violet:        #6d28d9;
    --violet-fonce:  #5b21b6;
    --violet-clair:  #f3e8ff;
    --orange:        #f97316;
    --orange-fonce:  #ea580c;
    --creme:         #fdf3e7;
    --bleu:          #2563eb;
    --texte:         #2b2140;
    --gris:          #6b7280;
    --bordure:       #e7e2f0;
    --rouge:         #dc2626;
    --vert:          #16a34a;
    --radius:        14px;
    --ombre:         0 6px 22px rgba(109,40,217,.10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding-top: 52px;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--texte);
    background: linear-gradient(135deg, var(--violet-clair) 0%, var(--creme) 100%);
    min-height: 100vh;
}

a { color: var(--violet); }

/* ---- En-tête / barre de navigation ---- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--violet);
    color: #fff;
    padding: 14px 26px;
    box-shadow: var(--ombre);
    z-index: 100;
}
.topbar .brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .3px;
}
.topbar .brand span { color: var(--orange); }

/* ---- Entrées de menu en icônes (ajouté le 13/09/2026) ----
   Les libellés texte sont remplacés par des icônes (émojis, comme le 👤
   déjà utilisé pour « Mon profil » — aucune ressource à charger en plus).
   Le nom complet reste accessible via aria-label sur chaque lien, et
   visible au survol : en étiquette flottante pour les liens simples
   (.etiquette), en titre de panneau pour les tiroirs (.sous-menu .titre) —
   voir menu_icone_html() / menu_principal() / topbar() dans config.php. */
.topbar nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    transition: background .15s;
}
.topbar nav a .glyphe { font-size: 30px; line-height: 1; }
.topbar nav a:hover { background: rgba(255,255,255,.15); }
.topbar nav a.actif { background: var(--orange); }
.topbar nav a.logout { background: rgba(255,255,255,.15); }

/* Étiquette flottante au survol/focus, pour les liens simples uniquement
   (Accueil, Chorées des cours) : les tiroirs affichent déjà leur nom en
   titre du panneau, une étiquette par-dessus ferait doublon. */
.topbar nav a .etiquette {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    margin-top: 10px;
    padding: 5px 10px;
    background: var(--violet-fonce);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 7px;
    box-shadow: 0 4px 14px rgba(43,33,64,.30);
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease, transform .12s ease;
    z-index: 1100;
}
.topbar nav a:hover .etiquette,
.topbar nav a:focus-visible .etiquette { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Entrée de menu avec sous-menu déroulant ---- */
/* Le parent occupe toute la hauteur de la barre (padding 14px de .topbar absorbé
   par padding + marge négative) : « top: 100% » tombe alors pile sous la barre,
   et la zone de survol est continue jusqu'au panneau — aucun espace mort. */
.topbar nav .menu-parent {
    position: relative;
    display: inline-block;
    padding: 14px 0;
    margin: -14px 0;
}
.topbar nav .sous-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);  /* centré sous l'icône du parent */
    min-width: 210px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--bordure);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(43,33,64,.22);
    z-index: 50;
}
/* Affiché au survol et au clavier (focus dans le parent ou le sous-menu) */
.topbar nav .menu-parent:hover .sous-menu,
.topbar nav .menu-parent:focus-within .sous-menu { display: block; }
/* Titre du panneau : porte le nom complet du tiroir (l'icône seule dans la
   barre ne le dit plus), à la place de l'étiquette flottante des liens
   simples. */
.topbar nav .sous-menu .titre {
    display: block;
    padding: 6px 12px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--violet);
    border-bottom: 1px solid var(--bordure);
    margin-bottom: 4px;
    white-space: nowrap;
}
.topbar nav .sous-menu a {
    display: block;
    width: auto;
    height: auto;
    margin: 0;
    padding: 9px 14px;
    color: var(--violet-fonce);
    border-radius: 8px;
    white-space: nowrap;
    font-weight: 600;
}
.topbar nav .sous-menu a:hover { background: var(--violet-clair); }

@media (max-width: 640px) {
    /* Sur petit écran, le sous-menu se déplie sous le parent plutôt qu'en flottant */
    .topbar nav .menu-parent { padding: 0; margin: 0; }
    .topbar nav .sous-menu {
        position: static;
        top: auto;
        left: auto;
        transform: none;        /* le centrage du bureau ne s'applique plus en statique */
        min-width: 0;
        box-shadow: none;
    }
}

/* ---- Conteneur ---- */
.container { max-width: 1320px; margin: 30px auto; padding: 0 20px; }

.card {
    background: #fff;
    border: 1px solid var(--bordure);
    border-radius: var(--radius);
    box-shadow: var(--ombre);
    padding: 12px;
}

h1, h2 { color: var(--violet-fonce); margin-top: 0; }
h1 span, h2 span { color: var(--orange); }

/* ---- Page de connexion ---- */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 20px;
}
.login-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--ombre);
    padding: 40px 38px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.login-card .logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--violet);
    margin-bottom: 4px;
}
.login-card .logo span { color: var(--orange); }
.login-card .logo-img {
    max-width: 100%;
    max-height: 120px;
    height: auto;
    width: auto;
    margin: 0 auto 12px auto;
    display: block;
}
.login-card .soustitre { color: var(--gris); margin-bottom: 26px; }

/* ---- Formulaires ---- */
label { display: block; font-weight: 600; margin: 14px 0 6px; text-align: left; }
input[type=text], input[type=password], input[type=email],
input[type=date], input[type=number], select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--bordure);
    border-radius: 10px;
    font-size: 1rem;
    background: #faf9fd;
    transition: border .15s, box-shadow .15s;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(109,40,217,.15);
}

.btn {
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    padding: 12px 26px;
    border-radius: 999px;
    color: #fff;
    background: var(--violet);
    transition: background .15s, transform .05s;
    text-decoration: none;
}
.btn:hover { background: var(--violet-fonce); }
.btn:active { transform: translateY(1px); }
.btn-orange { background: var(--orange); }
.btn-orange:hover { background: var(--orange-fonce); }
.btn-block { width: 100%; margin-top: 22px; }

/* ---- Alertes ---- */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-weight: 600;
}
.alert-error   { background: #fde8e8; color: var(--rouge); }
.alert-success { background: #e7f7ec; color: var(--vert); }

/* ---- Grille du formulaire membre ---- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px 22px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid .col-2 { grid-column: span 2; }

/* Sous-grille de 4 colonnes dans un .form-grid (ligne des licences fédérales).
   La grille est aussi posée en style en ligne dans edit.php pour ne pas dépendre
   du déploiement de ce fichier ; d'où le !important ci-dessous, seul moyen pour
   une media query de reprendre la main sur un style en ligne. */
.grille-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 22px;
}
/* 4 champs lisibles demandent ~700px de carte, soit ~820px de fenêtre */
@media (max-width: 820px) { .grille-4 { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 520px) { .grille-4 { grid-template-columns: 1fr !important; } }

.fieldset {
    border: 1px solid var(--bordure);
    border-radius: var(--radius);
    padding: 8px 22px 22px;
    margin-bottom: 24px;
}
.fieldset legend {
    color: var(--violet);
    font-weight: 700;
    padding: 0 10px;
}

/* Cases à cocher niveaux */
.checks { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 8px; }
.checks label {
    display: flex; align-items: center; gap: 7px;
    margin: 0; font-weight: 600;
    background: var(--violet-clair);
    padding: 8px 14px; border-radius: 999px;
}
.checks input { width: auto; }

/* ---- Tableau des membres ---- */
.table-wrap {
    overflow-x: auto;
    margin-top: 26px;
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}
table.membres {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    font-size: .92rem;
    background: #fff;
}
/* Colonne Action toujours visible et sur une seule ligne */
table.membres th:last-child,
table.membres td:last-child {
    white-space: nowrap;
    text-align: center;
}
table.membres th {
    background: var(--violet);
    color: #fff;
    text-align: left;
    padding: 11px 12px;
    font-weight: 600;
}
table.membres td { padding: 10px 12px; border-bottom: 1px solid var(--bordure); }
table.membres tr:nth-child(even) td { background: #faf7fe; }
table.membres tr:hover td { background: var(--creme); }

/* ---- Trésorerie : largeur des colonnes ----
   Date, Type, Montant et État sont réduites à leur contenu (width: 1% + nowrap :
   le navigateur leur donne la largeur minimale et répartit le reste ailleurs).
   L'espace ainsi libéré va au libellé du compte, souvent tronqué sur deux lignes. */
.table-compta th:nth-child(1), .table-compta td:nth-child(1),   /* Date    */
.table-compta th:nth-child(2), .table-compta td:nth-child(2),   /* Type    */
.table-compta th:nth-child(6), .table-compta td:nth-child(6),   /* Montant */
.table-compta th:nth-child(8), .table-compta td:nth-child(8) {  /* État    */
    width: 1%;
    white-space: nowrap;
}
/* Les champs de filtre de ces colonnes ne doivent pas les élargir à leur tour */
.table-compta tr.ligne-filtres th:nth-child(1) input,
.table-compta tr.ligne-filtres th:nth-child(2) input,
.table-compta tr.ligne-filtres th:nth-child(6) input,
.table-compta tr.ligne-filtres th:nth-child(8) input { min-width: 0; }

/* Le compte prend la place rendue disponible */
.table-compta th:nth-child(3), .table-compta td:nth-child(3) { width: 40%; }

.badge {
    display: inline-block;
    background: var(--orange);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
}

.muted { color: var(--gris); font-size: .9rem; }

/* En-têtes de tri : liens blancs sur fond violet */
table.membres th a {
    color: #fff;
    text-decoration: none;
    display: inline-block;
}
table.membres th a:hover { text-decoration: underline; }

/* Petit bouton d'action dans le tableau */
.btn-mini {
    padding: 5px 14px;
    font-size: .82rem;
    background: var(--orange);
}
.btn-mini:hover { background: var(--orange-fonce); }
.btn-danger { background: var(--rouge); }
.btn-danger:hover { background: #b91c1c; }

/* Boutons de retour / d'annulation : toujours gris, en taille normale (.btn)
   comme en petite taille (.btn-mini). Déclaré APRÈS .btn-mini et .btn-danger :
   à spécificité égale, c'est la dernière règle qui l'emporte. */
.btn-retour { background: var(--gris); }
.btn-retour:hover { background: #4b5563; }

/* ---- Sélection de membres ---- */
.barre-selection {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--violet-clair);
    border: 1px solid var(--bordure);
    border-radius: 8px;
}
.barre-selection .chk-tout {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 600;
    cursor: pointer;
}
.barre-selection input[type="checkbox"] { width: auto; margin: 0; }
.barre-selection .btn:disabled { opacity: .45; cursor: not-allowed; }

table.membres th.col-select,
table.membres td.col-select { width: 34px; text-align: center; }
table.membres td.col-select input { width: auto; margin: 0; cursor: pointer; }
table.membres tbody tr.sans-email td { color: #999; font-style: italic; }
table.membres tbody tr.sans-email td.col-select { font-style: normal; }

/* ---- Formulaire de courrier (générique) ---- */
.form-courrier label { display: block; margin-top: 14px; font-weight: 600; }
.form-courrier .muted { font-weight: 400; }
.form-courrier input[type="text"],
.form-courrier input[type="email"],
.form-courrier textarea { width: 100%; margin-top: 5px; }
.form-courrier textarea { font-family: inherit; line-height: 1.5; }
.form-courrier code {
    background: var(--violet-clair); padding: 1px 5px; border-radius: 4px; font-size: .9em;
}
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grille-2 { grid-template-columns: 1fr; } }

.bloc-envoi {
    margin-top: 20px; padding: 12px 16px;
    border: 1px solid var(--bordure); border-radius: 8px; background: var(--violet-clair);
}
.bloc-envoi legend { font-weight: 700; padding: 0 6px; color: var(--violet-fonce); }
.ligne-radio {
    display: flex; align-items: center; gap: 8px;
    margin: 6px 0; font-weight: 500; cursor: pointer;
}
.ligne-radio input { width: auto; margin: 0; }

/* ---- Historique des emails ---- */
table.fiche-email { width: 100%; margin: 16px 0; border-collapse: collapse; }
table.fiche-email th {
    text-align: left; vertical-align: top; white-space: nowrap;
    padding: 6px 16px 6px 0; color: var(--gris); font-weight: 600; width: 150px;
}
table.fiche-email td { padding: 6px 0; word-break: break-word; }
.corps-email {
    padding: 16px; background: #fbfbfb;
    border: 1px solid var(--bordure); border-radius: 8px; line-height: 1.6;
}
.badge.statut-ok      { background: var(--vert); color: #fff; }
.badge.statut-partiel { background: var(--orange-fonce); color: #fff; }
.badge.statut-erreur  { background: var(--rouge); color: #fff; }
.pagination { display: flex; gap: 10px; margin-top: 14px; }
.pagination strong { text-decoration: underline; }

/* ---- Ligne de filtres sous les en-têtes d'un tableau ---- */
table.membres tr.ligne-filtres th {
    background: var(--violet-fonce);
    padding: 6px 8px;
}
table.membres tr.ligne-filtres input {
    width: 100%;
    min-width: 60px;
    padding: 5px 8px;
    font-size: .82rem;
    font-weight: 400;
    border: none;
    border-radius: 6px;
    background: #fff;
}
table.membres tr.ligne-filtres input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--orange);
}

/* ---- Icône crayon (édition rapide d'une liste depuis un label) ---- */
.icon-edit {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 6px;
    color: var(--violet);
}
.icon-edit:hover { color: var(--orange); }
.icon-edit svg { width: 13px; height: 13px; fill: currentColor; }

/* ---- Compose façon Outlook (courrier.php) ---- */
.compose {
    border: 1px solid var(--bordure);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}
.compose-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--creme);
    border-bottom: 1px solid var(--bordure);
}
.btn-envoyer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    padding: 11px 22px;
    border-radius: 999px;
    color: #fff;
    background: var(--orange);
    transition: background .15s, transform .05s;
}
.btn-envoyer:hover { background: var(--orange-fonce); }
.btn-envoyer:active { transform: translateY(1px); }
.btn-envoyer svg { width: 17px; height: 17px; fill: #fff; transform: rotate(-45deg); }
/* rotate(-45deg) et non 45 : le tracé de l'avion pointe vers l'EST, et une
   rotation CSS positive tourne dans le sens HORAIRE — +45deg l'envoyait donc
   vers le sud-est, d'où une flèche qui semblait pointer vers le bas.
   -45deg tourne dans l'autre sens et le place au nord-est. */

.compose-champ {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--bordure);
}
.compose-champ:focus-within { background: var(--violet-clair); }
.compose-label {
    flex: 0 0 112px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-weight: 600;
    font-size: .88rem;
    line-height: 1.2;
    color: var(--violet-fonce);
    background: #faf9fd;
    border-right: 1px solid var(--bordure);
    user-select: none;
}
.compose-label.optionnel { color: var(--gris); cursor: pointer; }
.compose-valeur {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
}
.compose-champ input[type="text"],
.compose-champ input[type="email"],
.compose-champ textarea {
    flex: 1 1 220px;
    width: auto;
    border: none;
    background: transparent;
    padding: 6px 0;
    margin: 0;
    font-size: .96rem;
    resize: none;
}
.compose-champ input:focus,
.compose-champ textarea:focus {
    outline: none;
    box-shadow: none;
}
.compose-champ .compose-nom-affiche {
    flex: 0 1 220px;
    border-left: 1px solid var(--bordure);
    padding-left: 16px !important;
    color: var(--gris);
}
.compose-corps {
    width: 100%;
    border: none;
    padding: 18px 20px;
    font-family: inherit;
    font-size: .98rem;
    line-height: 1.55;
    resize: vertical;
}
.compose-corps:focus { outline: none; }
.compose-pied {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-top: 1px solid var(--bordure);
    background: #faf9fd;
}
/* --- Sélection de membres --- */
.barre-selection {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #faf7f2;
    border: 1px solid #e6ded2;
    border-radius: 8px;
}
.barre-selection .chk-tout {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 600;
    cursor: pointer;
}
.barre-selection input[type="checkbox"] { width: auto; margin: 0; }
.barre-selection .btn:disabled { opacity: .45; cursor: not-allowed; }

table.membres th.col-select,
table.membres td.col-select { width: 34px; text-align: center; }
table.membres td.col-select input { width: auto; margin: 0; cursor: pointer; }
table.membres tbody tr:hover { background: #fbf8f3; }
table.membres tbody tr.sans-email td { color: #999; font-style: italic; }
table.membres tbody tr.sans-email td.col-select { font-style: normal; }

/* --- Formulaire de courrier --- */
.form-courrier label { display: block; margin-top: 14px; font-weight: 600; }
.form-courrier .muted { font-weight: 400; }
.form-courrier input[type="text"],
.form-courrier input[type="email"],
.form-courrier textarea { width: 100%; margin-top: 5px; }
.form-courrier textarea { font-family: inherit; line-height: 1.5; }
.form-courrier code {
    background: #f2ede5; padding: 1px 5px; border-radius: 4px; font-size: .9em;
}
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grille-2 { grid-template-columns: 1fr; } }

.bloc-envoi {
    margin-top: 20px; padding: 12px 16px;
    border: 1px solid #e6ded2; border-radius: 8px; background: #faf7f2;
}
.bloc-envoi legend { font-weight: 700; padding: 0 6px; }
.ligne-radio {
    display: flex; align-items: center; gap: 8px;
    margin: 6px 0; font-weight: 500; cursor: pointer;
}
.ligne-radio input { width: auto; margin: 0; }

/* --- Historique --- */
table.fiche-email { width: 100%; margin: 16px 0; border-collapse: collapse; }
table.fiche-email th {
    text-align: left; vertical-align: top; white-space: nowrap;
    padding: 6px 16px 6px 0; color: #777; font-weight: 600; width: 150px;
}
table.fiche-email td { padding: 6px 0; word-break: break-word; }
.corps-email {
    padding: 16px; background: #fbfbfb;
    border: 1px solid #e6ded2; border-radius: 8px; line-height: 1.6;
}
.badge.statut-ok      { background: #2e7d32; color: #fff; }
.badge.statut-partiel { background: #ef6c00; color: #fff; }
.badge.statut-erreur  { background: #c62828; color: #fff; }
.pagination { display: flex; gap: 10px; margin-top: 14px; }

/* ---- Page d'accueil ---- */
/* Colonne flex occupant la hauteur d'écran restante (46px de barre + 2×30px de
   marges du conteneur) : le bloc logo absorbe l'espace libre et s'y centre. */
.accueil {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 106px);
    text-align: center;
}
.accueil h2, .accueil h3 { text-align: center; }
/* Le récap reste lisible : tableau compact, centré, sans largeur minimale imposée */
.accueil .table-wrap { overflow-x: auto; }
.accueil table.tbl-recap { min-width: 0; }
.accueil table.tbl-recap th,
.accueil table.tbl-recap td { text-align: center; }
.accueil table.tbl-recap th:first-child,
.accueil table.tbl-recap td:first-child { text-align: left; }

/* ---- Tableau de bord adhérents ----------------------------------------
   Palette : les deux teintes de la charte (#6d28d9 / #f97316), validées par
   le script du guide dataviz — ΔE 35,6 en daltonisme (protan) et 42,1 en
   vision normale, toutes paires. L'orange étant à 2,80:1 sur fond blanc
   (sous le seuil de 3:1), chaque valeur est écrite en clair à côté de sa
   barre : l'information ne repose jamais sur la couleur seule.
   --------------------------------------------------------------------- */

/* Chiffres clés */
.tuiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin: 22px 0 6px;
}
.tuile {
    padding: 16px 12px;
    background: var(--violet-clair);
    border-radius: var(--radius);
}
.tuile-nb {
    display: block;
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--violet-fonce);
}
.tuile-lib { display: block; margin-top: 4px; font-size: .86rem; color: var(--gris); }

/* Bloc dépliable (+ / −) : balise <details> native, sans JavaScript */
.bloc-stat {
    margin-top: 22px;
    border: 1px solid var(--bordure);
    border-radius: var(--radius);
    background: #fff;
    text-align: left;
}
.bloc-stat > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 18px;
    font-weight: 700;
    color: var(--violet-fonce);
    cursor: pointer;
    list-style: none;          /* masque le triangle par défaut */
    border-radius: var(--radius);
}
.bloc-stat > summary::-webkit-details-marker { display: none; }
.bloc-stat > summary:hover { background: var(--violet-clair); }
.bloc-stat > summary::after {
    content: '+';
    flex: 0 0 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: var(--violet);
    border-radius: 999px;
}
.bloc-stat[open] > summary::after { content: '\2212'; }   /* signe moins */
.bloc-stat[open] > summary { border-radius: var(--radius) var(--radius) 0 0; }
.bloc-stat > *:not(summary) { padding: 0 18px; }
.bloc-stat > *:last-child { padding-bottom: 16px; }

.legende-stat { margin: 10px 0 0; }
.puce {
    display: inline-block;
    width: 11px; height: 11px;
    border-radius: 3px;
    vertical-align: -1px;
    margin-right: 4px;
}
.puce-violet { background: var(--violet); }
.puce-orange { background: var(--orange); }

/* Barres horizontales : libellé | piste | valeur */
.graph-barres { margin-top: 14px; }
.barre-ligne {
    display: grid;
    /* colonne libellé élargie x1,5 (90/190 -> 135/285) : les noms de communes
       composés tiennent désormais sans troncature, y compris sur mobile */
    grid-template-columns: minmax(135px, 285px) 1fr 46px;
    align-items: center;
    gap: 12px;
    padding: 3px 0;
}
.barre-lib {
    font-size: .9rem;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.barre-piste {
    position: relative;
    height: 16px;
    background: #f4f1f9;
    border-radius: 4px;
}
.barre-fill {
    display: block;
    height: 100%;
    min-width: 3px;                  /* une valeur de 1 reste visible */
    border-radius: 0 4px 4px 0;      /* extrémité data arrondie, base droite */
}
.fill-violet { background: var(--violet); }
.fill-orange { background: var(--orange); }
.barre-val { font-size: .9rem; font-weight: 700; text-align: left; }

@media (max-width: 640px) {
    .barre-ligne { grid-template-columns: minmax(111px, 180px) 1fr 38px; gap: 8px; }
    .barre-lib { font-size: .82rem; }
}

/* Anneau femmes / hommes */
.anneau-bloc {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.anneau { width: 160px; height: 160px; flex: 0 0 auto; }
.anneau-nb {
    text-anchor: middle;
    font-size: 34px;
    font-weight: 800;
    fill: var(--violet-fonce);
    font-family: inherit;
}
.anneau-txt {
    text-anchor: middle;
    font-size: 14px;
    fill: var(--gris);
    font-family: inherit;
}
.anneau-legende { margin: 0; padding: 0; list-style: none; }
.anneau-legende li { margin: 7px 0; font-size: .95rem; }

/* Absorbe la hauteur restante et y centre le logo, verticalement et horizontalement */
.accueil-logo {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
}
.accueil-logo img {
    max-width: 100%;
    width: 320px;
    height: auto;
}
@media (max-width: 640px) {
    .accueil { min-height: 0; }        /* pas d'étirement sur petit écran */
    .accueil-logo img { width: 200px; }
}

/* ---- Avertissement « résultat partiel » (écran + PDF) ---- */
.bandeau-partiel {
    margin: 0 0 18px;
    padding: 10px 16px;
    border-left: 5px solid var(--orange);
    border-radius: 8px;
    background: #fff4e8;
    color: #8a4b06;
    font-size: .92rem;
}
.mention-partiel { color: var(--orange); }

/* ---- Export PDF (impression navigateur) ---- */
.print-entete { display: none; }
.print-pied { display: none; }
/* Bascule Charges/Produits avec ou sans les comptes 86/87 (case "Version commune") :
   masqués par défaut (avant même l'exécution du script) et à l'écran comme à
   l'impression, pour que l'aperçu corresponde toujours au PDF exporté. */
.ligne-nature, .total-avec-nature, .resultat-avec-nature { display: none; }
@media print {
    @page { size: A4; margin: 10mm 12mm; }
    html { font-size: 12px; }
    body { background: #fff; padding-bottom: 30px; }
    .no-print { display: none !important; }

    /* Sans ça, les navigateurs suppriment par défaut les couleurs de fond à l'impression
       (bandeaux violets du plan comptable, encadré vert du résultat...) */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .print-entete {
        display: flex;
        align-items: center;
        gap: 14px;
        margin-bottom: 10px;
    }
    .print-entete img { height: 100px; width: auto; }
    .print-entete .brand { display: none; font-size: 2.85rem; font-weight: 800; color: var(--violet); }
    .print-entete .brand span { color: var(--orange); }
    .print-entete h2 { margin: 3px 0 0 30px; font-size: 1.9rem; color: var(--violet-fonce); }
    .print-entete-page2 { page-break-before: always; }

    .container { margin: 0; padding: 0; max-width: none; }
    .card { box-shadow: none; border: none; padding: 0; }
    h2 { font-size: 1.15rem; margin: 0 0 6px; }
    h3 { font-size: 1rem; margin: 8px 0 4px; }

    .grille-2 { gap: 10px; }
    /* L'avertissement doit rester lisible sur le PDF remis aux tiers */
    .bandeau-partiel { margin-bottom: 10px !important; padding: 6px 10px !important; font-size: .85rem; }
    table.fiche-email th[colspan] { padding: 3px 6px !important; }
    table.fiche-email td { padding: 2px 0 !important; }
    .alert { padding: 6px 10px !important; margin-top: 10px !important; font-size: 1rem !important; }

    #bloc-repartition .table-wrap { overflow: visible; }
    #bloc-repartition table.membres { min-width: 0; width: 100%; }

    .print-pied {
        display: block;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        text-align: center;
        font-size: .68rem;
        color: var(--gris);
        border-top: 1px solid var(--bordure);
        padding-top: 4px;
        background: #fff;
    }
}
.pagination strong { text-decoration: underline; }

/* ---- Affichage du contenu HTML des emails ---- */
.corps-email {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.corps-email p {
    margin: 0 0 10px 0;
    padding: 0;
}

.corps-email ul, .corps-email ol {
    margin: 0 0 10px 20px;
    padding: 0;
}

.corps-email li {
    margin-bottom: 5px;
}