/* --------------------------------------------------------------------------
   Les écrans : connexion, choix de l'association, accueil.
   -------------------------------------------------------------------------- */

.ecran {
    display: flex;
    flex-direction: column;
    gap: var(--espace);
}

/* Un message vide posé directement sur un écran (erreur, confirmation) ne
   prend aucune place : la liste des adhérents gardait un grand blanc au-dessus
   des fiches (09/10/2026). Masqué « visuellement » seulement, il reste une
   zone annoncée par les lecteurs d'écran dès que son texte arrive. Ceux des
   formulaires, eux, gardent leur hauteur réservée (base.css). */
.ecran > .message-erreur:empty,
.ecran > .message-ok:empty {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
}

.ecran--centre {
    margin: auto 0;
    padding: 24px 0;
}

.marque {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.marque img {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
}

.marque strong {
    font-size: 1.25rem;
}

.formulaire {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Le code : gros, espacé, lisible d'un coup d'œil. */
.champ-code {
    font-size: 1.6rem;
    letter-spacing: .3em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.liste {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Une association du sélecteur : toute la ligne se touche. */
.choix {
    width: 100%;
    text-align: left;
    border-radius: var(--rayon);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.choix .doux {
    font-size: .9rem;
}

/* Une séance annulée reste dans la liste du jour, barrée (petits détails du
   test du 09/10) : un appui ouvre le rendez-vous, où elle se rétablit. */
.liste li.annulee .choix strong {
    text-decoration: line-through;
    color: var(--texte-doux);
}

.entete {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.entete h1 {
    flex: 1 1 12rem;
    min-width: 0;
}

.etiquette {
    display: inline-block;
    background: var(--accent-fond);
    color: var(--accent-encre);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: .85rem;
    font-weight: 600;
}

.ligne-acces {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 0;
    border-bottom: 1px solid var(--bordure);
}

.ligne-acces:last-child {
    border-bottom: none;
}

/* ------------------------------------------------- adhérents (chantier 2) */

.menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pastilles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pastille-filtre[aria-pressed="true"] {
    background: var(--accent);
    color: var(--accent-texte);
    box-shadow: none;
}

.ligne-adherent {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ligne-adherent input[type="checkbox"],
.case input[type="checkbox"],
.case input[type="radio"] {
    /* Une case assez grande pour le doigt : 24 px, dans une cible de 48. */
    width: 24px;
    min-height: 24px;
    height: 24px;
    margin: 12px;
    flex: 0 0 auto;
    accent-color: var(--accent);
}

.ligne-adherent .choix {
    flex: 1 1 auto;
    min-width: 0;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.barre-groupe {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--fond);
    padding: 8px 0;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bouton-lien {
    display: inline-flex;
    align-items: center;
    min-height: var(--cible);
    padding: 0 18px;
    border-radius: 999px;
    background: var(--fond-carte);
    color: var(--texte);
    box-shadow: inset 0 0 0 1px var(--bordure);
    text-decoration: none;
}

.case {
    display: flex;
    align-items: center;
    font-weight: 600;
}

.groupe-champs {
    border: 1.5px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 12px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.groupe-champs legend {
    font-weight: 650;
    padding: 0 6px;
}

.bouton-danger {
    color: var(--alerte);
}

/* ----------------------------------------------- cotisations (chantier 3) */

.etat-cotisation {
    font-size: .85rem;
    font-weight: 600;
}

.cotisation-reglee { color: var(--accent-encre); }
.cotisation-a_regler,
.cotisation-partielle { color: var(--attention); }
.cotisation-sans_tarif { color: var(--texte-doux); }

.resume-cotisation {
    font-size: 1.3rem;
    font-weight: 700;
}

/* Un versement annulé ou remboursé reste visible, barré (C3). */
.versement-hors strong {
    text-decoration: line-through;
    color: var(--texte-doux);
}

/* La nouvelle version prête (app.js) : en haut, sans cacher l'écran. */
.bandeau-maj {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px var(--espace);
    background: var(--accent-fond);
    color: var(--accent-encre);
    font-weight: 600;
}

.bandeau-maj-boutons { display: flex; flex-wrap: wrap; gap: 8px; }

.liste-nouveautes { margin: 0; padding-left: 1.2em; }
.liste-nouveautes li { margin: 0 0 .4em; }

.envoi-echec { color: var(--alerte); font-weight: 600; }
.envoi-en_attente,
.envoi-ignore { color: var(--attention); }
.envoi-envoye { color: var(--texte-doux); }

textarea {
    padding: 12px 16px;
    min-height: 8em;
    resize: vertical;
}

/* Le texte d'une annonce : ses retours à la ligne gardés, sans HTML. */
.texte-annonce {
    white-space: pre-wrap;
    margin: 8px 0 0;
}

details summary {
    cursor: pointer;
    min-height: var(--cible);
    display: flex;
    align-items: center;
    color: var(--accent-encre);
    font-weight: 600;
}

/* Un lien à copier : il tient dans la largeur, sans pousser la page. */
.champ-lien {
    font-size: .85rem;
    text-overflow: ellipsis;
}

.liste-simple {
    margin: 0 0 var(--espace);
    padding-left: 1.2em;
}

.message-ok {
    color: var(--accent-encre);
}

.bandeau {
    background: var(--alerte-fond);
    color: var(--alerte);
    border-radius: var(--rayon);
    padding: 10px 14px;
    font-weight: 600;
}

/* --------------------------------------------------- agenda (chantier 7) */

.grille-mois {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.tete-jour {
    text-align: center;
    font-size: .8rem;
    color: var(--texte-doux);
    text-transform: capitalize;
}

.case-jour {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: var(--cible);
    min-width: 0;
    padding: 2px;
    border-radius: 10px;
    font-weight: 600;
}

.case-jour.hors-mois {
    color: var(--texte-doux);
    opacity: .6;
}

.case-jour.aujourdhui {
    box-shadow: inset 0 0 0 2px var(--accent);
}

.case-jour .points {
    color: var(--accent);
    line-height: 1;
    letter-spacing: 1px;
}

/* ---------------------------------------------- tableau de bord (07/10/2026)
   docs/TABLEAU-DE-BORD.md : la vie de l'association en arrivant, et la
   barre de navigation du bas (reprise de Ma Famille). */

body.avec-barre .application {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.barre-bas {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--fond-carte) 90%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: 0 -1px 0 var(--bordure);
}

.barre-bas[hidden] { display: none; }

.barre-onglets {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 4px;
    width: 100%;
    max-width: 560px;
}

.onglet {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px;
    min-width: 0;
    padding: 4px 2px;
    border-radius: 18px;
    background: none;
    box-shadow: none;
    color: var(--texte-doux);
    font-size: .72rem;
    font-weight: 600;
}

.onglet span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.onglet[aria-current="page"] {
    color: var(--accent-encre);
    background: var(--accent-fond);
}

/* Grand écran : la barre devient un rail à gauche. */
@media (min-width: 900px) {
    body.avec-barre .application {
        padding-bottom: var(--espace);
        padding-left: calc(112px + var(--espace));
        max-width: calc(720px + 112px);
    }

    .barre-bas {
        top: 0;
        right: auto;
        width: 104px;
        padding: calc(20px + env(safe-area-inset-top)) 10px 20px calc(10px + env(safe-area-inset-left));
        box-shadow: 1px 0 0 var(--bordure);
    }

    .barre-onglets {
        grid-auto-flow: row;
        align-content: start;
        gap: 10px;
    }

    .onglet { min-height: 72px; font-size: .8rem; }
}

.tableau-entete .doux { margin: 0; }
.tableau-entete h1 { margin: 0; }

.tableau-blocs {
    display: flex;
    flex-direction: column;
    gap: var(--espace);
}

.bloc-titre {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--accent-encre);
}

.bloc-titre h2 {
    flex: 1;
    margin: 0;
    color: var(--texte);
}

.bloc-mot {
    background: var(--accent-fond);
    box-shadow: none;
}

.bloc-mot-vide {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
}

.mot-texte {
    white-space: pre-line;
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.petit { font-size: .85rem; }

.semaine, .annonces-recentes {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
}

.semaine li {
    display: grid;
    grid-template-columns: 6.5rem 4.5rem minmax(0, 1fr);
    gap: 4px 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--bordure);
}

.semaine li:last-child, .annonces-recentes li:last-child { border-bottom: none; }
.semaine li.annulee .semaine-quoi strong { text-decoration: line-through; color: var(--texte-doux); }

.semaine-jour { font-weight: 650; }
.semaine-heure { color: var(--texte-doux); }

.semaine-quoi {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 420px) {
    .semaine li { grid-template-columns: 5.5rem minmax(0, 1fr); }
    .semaine-quoi { grid-column: 1 / -1; }
}

.annonces-recentes li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--bordure);
}

.extrait {
    flex-basis: 100%;
    margin: 2px 0 0;
    color: var(--texte-doux);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
}

.choix-ligne {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.choix-icone {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.choix-icone > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chiffres {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--espace);
}

.chiffre {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chiffre strong { font-size: 1.6rem; line-height: 1.2; }

/* --------------------------------------------------------------------------
   Les conditions (chantier 12) : une feuille par-dessus l'écran en cours,
   qui le laisse intact (un formulaire à moitié rempli n'est pas perdu).
   -------------------------------------------------------------------------- */

.feuille-legale {
    position: fixed;
    inset: 0;
    z-index: 10;
    overflow-y: auto;
    background: var(--fond);
    padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
             calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}

.feuille-legale > .ecran {
    max-width: 680px;
    margin: 0 auto;
}

body.sans-defilement { overflow: hidden; }

.texte-legal p {
    margin: 0 0 .75em;
    overflow-wrap: anywhere;
}

.texte-legal p:last-child { margin-bottom: 0; }

/* Un bouton qui se lit comme un lien, dans une phrase. */
.lien-texte {
    display: inline;
    min-height: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    color: var(--accent);
    font: inherit;
    text-decoration: underline;
    width: auto;
}

.lien-discret { color: var(--texte-doux); }

.case-accord {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.case-accord input[type="checkbox"] {
    width: 24px;
    min-height: 24px;
    height: 24px;
    margin: 12px 8px 12px 0;
    flex: 0 0 auto;
    accent-color: var(--accent);
}

.case-accord label { padding-top: 12px; }

.bandeau-conditions {
    border: 1.5px solid var(--accent);
}

.texte-modele {
    font-size: .9rem;
    line-height: 1.45;
}

.bandeau-conditions .message-erreur:empty { display: none; }

/* --------------------------------------------------------------------------
   Tableau de bord « à la AC-ERP » (09/10/2026, demande de Raphaël : « un
   vrai tableau de bord ») : alertes en bandeaux, rangée d'indicateurs,
   sections à compteur en tableaux, deux colonnes sur grand écran.
   -------------------------------------------------------------------------- */

@media (min-width: 900px) {
    body.avec-barre.ecran-large .application { max-width: calc(1280px + 112px); }
}

.tb-entete {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
}

.tb-titre { min-width: 0; }
.tb-titre .doux, .tb-titre h1 { margin: 0; }

.tb-raccourcis { display: flex; flex-wrap: wrap; gap: 8px; }

.tb-raccourci {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px;
    color: var(--accent-encre);
    font-weight: 600;
    font-size: .9rem;
}

.tb-raccourci:hover { background: var(--accent-fond); }

.tb-corps { display: flex; flex-direction: column; gap: var(--espace); }

.tb-alertes { display: flex; flex-direction: column; gap: 8px; }

.tb-alerte {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 0;
    padding: 12px 16px;
    text-align: left;
    border-radius: var(--rayon);
    box-shadow: inset 0 0 0 1px var(--bordure), inset 4px 0 0 var(--attention);
}

.tb-alerte--critique { box-shadow: inset 0 0 0 1px var(--bordure), inset 4px 0 0 var(--alerte); }

.tb-alerte-texte {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    min-width: 0;
}

/* Les premiers pas (petits détails du test du 09/10) : une étape faite pâlit, sa case se coche. */
.premiers-pas ol { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }

.premiers-pas li button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 8px 4px;
    text-align: left;
    background: none;
    border: 0;
    color: inherit;
}

.premiers-pas li button:hover { background: var(--accent-fond); }

.pas-marque {
    flex: none;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 2px solid var(--bordure);
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 700;
}

.premiers-pas li.fait .pas-marque { border-color: var(--accent); background: var(--accent); color: var(--fond-carte, #fff); }
.premiers-pas li.fait strong { color: var(--texte-doux); font-weight: 600; }

/* Les indicateurs : chiffres en chasse fixe, qu'on compare d'un jour à l'autre. */
.kpi-grille {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.kpi {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-height: 0;
    padding: 14px 16px;
    text-align: left;
    border-radius: var(--rayon);
    box-shadow: inset 0 0 0 1px var(--bordure), var(--ombre);
}

.kpi:hover { box-shadow: inset 0 0 0 1px var(--accent), var(--ombre); }

.kpi-titre {
    font-size: .78rem;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--texte-doux);
}

.kpi-valeur {
    font-size: 1.85rem;
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.kpi-note { font-size: .8rem; color: var(--texte-doux); }

.kpi--attention { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--attention) 60%, var(--bordure)), var(--ombre); }
.kpi--attention .kpi-valeur { color: var(--attention); }
.kpi--alerte { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--alerte) 60%, var(--bordure)), var(--ombre); }
.kpi--alerte .kpi-valeur { color: var(--alerte); }

@media (max-width: 560px) {
    .kpi-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi-valeur { font-size: 1.4rem; }
}

.tb-grille { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--espace); }
.tb-principal, .tb-lateral { display: flex; flex-direction: column; gap: var(--espace); min-width: 0; }

@media (min-width: 1100px) {
    .tb-grille { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
}

.tb-section-titre {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--accent-encre);
}

.tb-section-titre h2 { margin: 0; font-size: 1.1rem; color: var(--texte); }

.tb-compte {
    padding: 1px 9px;
    border-radius: 999px;
    background: var(--accent-fond);
    color: var(--accent-encre);
    font-size: .8rem;
    font-weight: 700;
}

.tb-voir { margin-left: auto; min-height: 40px; padding: 0 10px; font-size: .88rem; }

.tb-table-cadre { overflow-x: auto; }

.tb-table { width: 100%; border-collapse: collapse; font-size: .95rem; }

.tb-table th {
    padding: 6px 8px;
    text-align: left;
    font-size: .74rem;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--texte-doux);
    border-bottom: 1px solid var(--bordure);
}

.tb-table td { padding: 10px 8px; vertical-align: top; border-bottom: 1px solid var(--bordure); }
.tb-table tr:last-child td { border-bottom: none; }
.tb-table tr.aujourdhui td { background: var(--accent-fond); }
.tb-table tr.annulee .tb-quoi strong { text-decoration: line-through; color: var(--texte-doux); }

.tb-jour { white-space: nowrap; font-weight: 600; }
.tb-heure { white-space: nowrap; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.tb-quoi { overflow-wrap: anywhere; }
.tb-quoi .etiquette { margin-left: 6px; }
.tb-table .tb-nombre { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tb-complet { color: var(--attention); font-weight: 650; }
.tb-negatif { color: var(--alerte); }
.tb-vide { margin: 4px 0; }

@media (max-width: 600px) {
    .col-secondaire { display: none; }
    .tb-table { font-size: .9rem; }
    .tb-table td, .tb-table th { padding-left: 4px; padding-right: 4px; }
}

/* Grand écran : les bandeaux (conditions, abonnement) sur une ligne, le texte
   à gauche, les boutons à leur taille à droite (09/10). */
@media (min-width: 700px) {
    .bandeau-conditions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        column-gap: 12px;
        align-items: center;
    }

    .bandeau-conditions > strong { grid-column: 1; }
    .bandeau-conditions > p { grid-column: 1; grid-row: 2; margin: 0; }
    .bandeau-conditions > button { grid-row: 1 / span 2; width: auto; }
    .bandeau-conditions > .message-erreur { grid-column: 1 / -1; grid-row: auto; }
}

@media (max-width: 560px) {
    /* Un nombre impair d'indicateurs : le dernier prend la ligne entière. */
    .kpi-grille > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
    /* Les raccourcis sur une seule ligne, qui défile au doigt (09/10). */
    .tb-raccourcis {
        flex-wrap: nowrap;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        margin: 0 calc(-1 * var(--espace));
        padding: 2px var(--espace);
        width: calc(100% + 2 * var(--espace));
    }

    .tb-raccourcis::-webkit-scrollbar { display: none; }
    .tb-raccourci { flex: 0 0 auto; white-space: nowrap; }
}

.tb-sous { display: block; font-weight: 400; font-size: .85rem; }

/* ------------------------------------- assemblée générale (chantier 16) */

/* Pour, contre, abstentions : une ligne chacun, le libellé entier même à
   320 px (en colonnes, « Abstentions » se coupait en deux). */
.voix {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.voix > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.voix input { width: 7em; flex: 0 0 auto; }

.tableau-emargement {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.tableau-emargement th,
.tableau-emargement td {
    border: 1px solid var(--bordure);
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.tableau-emargement th { overflow-wrap: normal; hyphens: auto; }

.tableau-emargement .case-signature { width: 35%; height: 2.4em; }

/* L'impression (feuille d'émargement, compte rendu) : la feuille seule, en
   noir sur blanc, sans barre ni boutons. */
@media print {
    body { background: #fff; color: #000; }
    .ne-pas-imprimer, .barre-bas, .bandeau-maj, .bandeau-conditions { display: none !important; }
    .application, .ecran { padding: 0; margin: 0; max-width: none; }
    .impression { color: #000; }
    .tableau-emargement th, .tableau-emargement td { border-color: #000; }
    .tableau-emargement tr { break-inside: avoid; }
}
