/* ==========================================================================
   Guggen'App - feuille de style
   CSS pur, organise par sections, sans dependance (pas de framework).
   Mobile-first : les regles de base ciblent le telephone, les media
   queries etendent progressivement vers tablette puis ordinateur.
   ========================================================================== */

/* ---------- 1. Variables (identite visuelle vert / noir) ---------- */
:root {
    --noir:            #12180f;
    --noir-doux:       #1c261a;
    --vert-fonce:      #10502c;
    /* Fonce depuis #1f8a4c pour atteindre 4.5:1 avec du texte blanc dessus
       (bouton primaire, avatars, puces du calendrier) - audit d'accessibilite. */
    --vert:            #1c7e45;
    --vert-vif:        #2fbf6a;
    --vert-pale:       #e6f4ea;
    --vert-pale-survol:#d9ede0;
    --fond:            #f4f7f3;
    --carte:           #ffffff;
    --texte:           #17201a;
    --texte-discret:   #647166;
    --bordure:         #dfe6db;
    /* Fonce depuis #c9382a pour atteindre 4.5:1 sur --rouge-pale. */
    --rouge:           #b83326;
    --rouge-pale:      #fbe8e5;
    --rouge-pale-survol:#f6d7d3;
    /* Fonce depuis #b8871f (qui ne faisait que 2.9:1) pour atteindre 4.5:1
       sur --jaune-pale : badges, alertes et statuts "sans reponse". */
    --jaune:           #846116;
    --jaune-pale:      #fbf1de;
    --gris-fond:       #ececec;
    --gris-fond-doux:  #eceee9;
    --gris-texte:      #6b6b6b;
    --gris-texte-fonce:#4a4a4a;
    --gris-texte-doux: #555555;
    --gris-nav-inactif:#9db3a2;
    --ombre:           0 2px 10px rgba(18, 24, 15, 0.08);
    --rayon:           14px;
    --rayon-petit:     8px;
    --hauteur-topbar:  56px;
    --hauteur-nav:     64px;
    --transition:      150ms ease;
}

/* ---------- 2. Reset minimal ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--fond);
    color: var(--texte);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; color: var(--noir); }
p { margin: 0 0 1em; max-width: 70ch; }
a { color: var(--vert-fonce); text-decoration: none; }
ul, dl { padding: 0; margin: 0; list-style: none; }
img { max-width: 100%; }
button { font-family: inherit; }
.icone { width: 1.3em; height: 1.3em; flex-shrink: 0; }

/* ---------- 2bis. Interactivite (selection, focus, survol) ---------- */
::selection { background: var(--vert-pale); color: var(--vert-fonce); }

a, button, .btn, input, select, textarea {
    transition: background-color var(--transition), border-color var(--transition),
        color var(--transition), box-shadow var(--transition), transform var(--transition);
}

a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--vert);
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    a.carte:hover, .carte-membre:hover, .carte-morceau:hover, .acces-rapide:hover {
        box-shadow: 0 4px 16px rgba(18, 24, 15, 0.14);
        transform: translateY(-1px);
    }
    .liste-evenements a:hover .liste-evenements-nom { color: var(--vert-fonce); }
    .lien-fichier:hover { background: var(--vert-pale-survol); }
}

/* Respecte la preference systeme "reduire les animations" : on garde le
   changement d'etat (couleurs, ombre) instantane mais on retire le
   deplacement (translateY/scale) qui pose probleme aux personnes sensibles
   au mouvement. */
@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; }
    a, button, .btn, input, select, textarea {
        transition-duration: 0.01ms !important;
    }
    a.carte:hover, .carte-membre:hover, .carte-morceau:hover, .acces-rapide:hover,
    .btn:active {
        transform: none !important;
    }
}

/* ---------- 3. Structure generale ---------- */
.contenu {
    padding: 16px 16px calc(var(--hauteur-nav) + 24px);
    max-width: 720px;
    margin: 0 auto;
}
.contenu-public { padding-bottom: 24px; }

.page-titre {
    font-size: 1.5rem;
    margin-top: 0.2em;
}

.entete-page {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.lien-retour {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--texte-discret);
    font-weight: 600;
    font-size: 0.95rem;
}
.lien-retour .icone { width: 1.1em; height: 1.1em; }

.texte-discret { color: var(--texte-discret); font-size: 0.92rem; }

/* ---------- 4. Barre superieure ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--hauteur-topbar);
    background: var(--noir);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}
.topbar-marque {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.2px;
}
.topbar-marque .icone { color: var(--vert-vif); width: 1.5em; height: 1.5em; }
.logo-marque { height: 1.9em; width: auto; flex-shrink: 0; }
.topbar-profil {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 0.9rem;
}
.topbar-profil .icone { width: 1.4em; height: 1.4em; }
.topbar-profil-nom { display: none; }

/* ---------- 5. Navigation mobile (bas d'ecran) ---------- */
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 30;
    height: var(--hauteur-nav);
    background: var(--noir);
    display: flex;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.25);
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--gris-nav-inactif);
    font-size: 0.68rem;
    font-weight: 600;
}
.bottom-nav a .icone { width: 1.5em; height: 1.5em; }
.bottom-nav a.actif { color: var(--vert-vif); }
.bottom-nav a:focus-visible { outline: 2px solid var(--vert-vif); outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) {
    .bottom-nav a:hover { color: #fff; }
}

/* ---------- 6. Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--rayon-petit);
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.btn .icone { width: 1.15em; height: 1.15em; }
.btn-primary { background: var(--vert); color: #fff; }
.btn-primary:active { background: var(--vert-fonce); }
.btn-secondaire { background: var(--vert-pale); color: var(--vert-fonce); }
.btn-danger { background: var(--rouge-pale); color: var(--rouge); }
.btn-texte { background: transparent; color: var(--texte-discret); }
.btn-large { width: 100%; padding: 13px; font-size: 1rem; margin-top: 4px; }
.btn-present { background: var(--vert-pale); color: var(--vert-fonce); flex: 1; }
.btn-absent { background: var(--rouge-pale); color: var(--rouge); flex: 1; }
.btn-icone {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--carte); border: 1px solid var(--bordure); color: var(--texte);
}
.btn-icone-suivant .icone { transform: scaleX(-1); }
.btn-icone-danger {
    background: transparent; border: none; color: var(--rouge);
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; cursor: pointer;
}
.entete-page .btn { flex-shrink: 0; }
.btn:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover { background: var(--vert-fonce); }
    .btn-secondaire:hover { background: var(--vert-pale-survol); }
    .btn-danger:hover { background: var(--rouge-pale-survol); }
    .btn-texte:hover { background: var(--fond); color: var(--texte); }
    .btn-present:hover { background: var(--vert-pale-survol); }
    .btn-absent:hover { background: var(--rouge-pale-survol); }
    .btn-icone:hover { border-color: var(--vert); color: var(--vert); }
    .btn-icone-danger:hover { background: var(--rouge-pale); }
}

/* ---------- 7. Formulaires ---------- */
.formulaire { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.formulaire label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--texte-discret);
    margin-top: 10px;
}
.formulaire input[type=text],
.formulaire input[type=email],
.formulaire input[type=tel],
.formulaire input[type=password],
.formulaire input[type=search],
.formulaire input[type=date],
.formulaire input[type=time],
.formulaire input[type=datetime-local],
.formulaire input[type=file],
.formulaire select,
.formulaire textarea {
    font-size: 1rem;
    padding: 11px 12px;
    border-radius: var(--rayon-petit);
    border: 1px solid var(--bordure);
    background: var(--carte);
    color: var(--texte);
    width: 100%;
    font-family: inherit;
}
.formulaire input:focus, .formulaire select:focus, .formulaire textarea:focus {
    outline: 2px solid var(--vert);
    outline-offset: 1px;
}
.formulaire textarea { resize: vertical; }
.formulaire-colonnes { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.formulaire-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--bordure);
}
.formulaire-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.formulaire-section-titre {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--texte-discret);
    margin: 0 0 4px;
}
.formulaire-ajout-fichier { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--bordure); }
.champ-date-apercu {
    display: block;
    font-size: 0.78rem;
    margin-top: 3px;
    min-height: 1.1em;
}

.barre-filtres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 18px;
}
.champ-recherche {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--carte);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-petit);
    padding: 0 12px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.champ-recherche:focus-within {
    border-color: var(--vert);
    box-shadow: 0 0 0 3px var(--vert-pale);
}
.champ-recherche .icone { color: var(--texte-discret); width: 1.1em; height: 1.1em; }
.champ-recherche input { border: none; padding: 10px 0; flex: 1; background: transparent; font-size: 1rem; }
.champ-recherche input:focus { outline: none; }
.barre-filtres select {
    flex: 1;
    padding: 9px 10px;
    border-radius: var(--rayon-petit);
    border: 1px solid var(--bordure);
    background: var(--carte);
    font-size: 0.9rem;
}
.barre-filtres .btn { flex: 1 1 100%; }

/* ---------- 8. Cartes / sections ---------- */
.section-carte {
    background: var(--carte);
    border-radius: var(--rayon);
    padding: 16px;
    margin: 16px 0;
    box-shadow: var(--ombre);
}
.section-carte h2 { font-size: 1.05rem; }
.section-carte summary { cursor: pointer; font-weight: 700; color: var(--noir); }

.grille-cartes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
}
.carte {
    background: var(--carte);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    padding: 14px 16px;
}
.carte-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
}
.icone-stat { width: 2em; height: 2em; color: var(--vert); flex-shrink: 0; }
.carte-stat-valeur { font-weight: 700; font-size: 1.05rem; color: var(--noir); font-variant-numeric: tabular-nums; }
.carte-stat-label { font-size: 0.85rem; color: var(--texte-discret); }

.acces-rapides {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 18px 0;
}
.acces-rapides-titre {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--texte-discret);
    margin: 0 0 8px;
}
.acces-rapides-grille {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.acces-rapide {
    background: var(--carte);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    padding: 14px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--noir);
    text-align: center;
    /* Un libelle de deux mots ("Nouvel evenement") passe sur deux lignes
       alors que ses voisins ("Membres", "Photos"...) restent sur une seule :
       une hauteur minimale commune evite que cette carte paraisse plus
       grande/desalignee a cote des autres. */
    min-height: 96px;
}
.acces-rapide .icone {
    width: 1.4em;
    height: 1.4em;
    color: var(--vert-fonce);
    background: var(--vert-pale);
    border-radius: 50%;
    padding: 8px;
    box-sizing: content-box;
}

/* ---------- 9. Badges & statuts ---------- */
.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 100px;
    background: var(--vert-pale);
    color: var(--vert-fonce);
    white-space: nowrap;
}
.badge-comite { background: var(--noir); color: #fff; }
.badge-membre { background: var(--vert-pale); color: var(--vert-fonce); }
.badge-inactif { background: var(--gris-fond); color: var(--gris-texte); }
.badge-actif { background: var(--vert-pale); color: var(--vert-fonce); }
.badge-neutre { background: var(--gris-fond); color: var(--gris-texte-fonce); }
.badge-attente { background: var(--jaune-pale); color: var(--jaune); }
.badge-repetition { background: var(--vert-pale); color: var(--vert-fonce); }
.badge-sortie { background: var(--jaune-pale); color: var(--jaune); }
.badge-autre { background: var(--gris-fond); color: var(--gris-texte-fonce); }

.statut-actuel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 100px;
    background: var(--gris-fond);
    color: var(--gris-texte-doux);
}
.statut-present { background: var(--vert-pale); color: var(--vert-fonce); }
.statut-absent { background: var(--rouge-pale); color: var(--rouge); }
.statut-sans_reponse { background: var(--jaune-pale); color: var(--jaune); }

.alerte-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--jaune-pale);
    color: var(--jaune);
    padding: 10px 14px;
    border-radius: var(--rayon-petit);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ---------- 10. Messages flash ---------- */
.flash-zone { margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.flash {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: var(--rayon-petit);
    font-size: 0.9rem;
    font-weight: 600;
}
.flash .icone { width: 1.2em; height: 1.2em; flex-shrink: 0; }
.flash-succes { background: var(--vert-pale); color: var(--vert-fonce); }
.flash-erreur { background: var(--rouge-pale); color: var(--rouge); }

/* ---------- 10bis. Dialogue de confirmation renforcee ---------- */
/* Reserve aux actions vraiment irreversibles a fort impact (suppression
   d'un membre et son historique, reinitialisation de tous les mots de
   passe...) : il faut taper un mot exact pour activer "Confirmer".
   Les suppressions anodines (photo, fichier...) gardent le confirm()
   rapide existant (.js-confirmer). */
.dialogue-confirmation {
    border: none;
    border-radius: var(--rayon);
    padding: 20px;
    width: min(420px, calc(100vw - 48px));
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    color: var(--texte);
}
.dialogue-confirmation::backdrop { background: rgba(18, 24, 15, 0.55); }
.dialogue-confirmation h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    color: var(--rouge);
    margin: 0 0 10px;
}
.dialogue-confirmation h2 .icone { width: 1.3em; height: 1.3em; flex-shrink: 0; }
.dialogue-confirmation p { color: var(--texte); max-width: none; }
.dialogue-confirmation label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--texte-discret);
    margin-top: 12px;
    margin-bottom: 6px;
}
.dialogue-confirmation input[type="text"] {
    width: 100%;
    font-size: 1rem;
    padding: 11px 12px;
    border-radius: var(--rayon-petit);
    border: 1px solid var(--bordure);
    font-family: inherit;
}
.dialogue-confirmation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}
.dialogue-confirmation-actions .btn-danger:disabled {
    background: var(--gris-fond);
    color: var(--gris-texte);
    cursor: not-allowed;
}

/* ---------- 11. Listes (membres, morceaux, evenements) ---------- */
.liste-membres, .liste-morceaux { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.carte-membre-ligne { display: flex; align-items: center; gap: 8px; }
.carte-membre-ligne > .carte-membre { flex: 1; min-width: 0; }
.case-inviter, .case-inviter-vide { width: 18px; height: 18px; flex-shrink: 0; }
.barre-actions-groupees { margin-top: 12px; }
.carte-membre, .carte-morceau {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--carte);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    padding: 12px 14px;
    color: inherit;
}
.avatar-initiales {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--vert);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.avatar-grand { width: 68px; height: 68px; font-size: 1.4rem; margin: 0 auto 8px; }
.carte-membre-nom { font-weight: 700; color: var(--noir); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.carte-membre-detail { color: var(--texte-discret); font-size: 0.85rem; }
.icone-morceau { width: 1.7em; height: 1.7em; color: var(--vert); flex-shrink: 0; }
.carte-morceau-titre { font-weight: 700; color: var(--noir); }
.carte-morceau-detail { color: var(--texte-discret); font-size: 0.82rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }

.liste-evenements li + li { border-top: 1px solid var(--bordure); }
.liste-evenements a {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 4px;
    gap: 10px;
    padding: 10px 0;
    color: inherit;
}
.liste-evenements-nom { font-weight: 600; color: var(--noir); flex: 1; }
.liste-evenements-date { font-size: 0.8rem; color: var(--texte-discret); white-space: nowrap; }

.fiche-membre { text-align: center; margin-top: 8px; }
.badges-fiche { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }

.liste-details { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; }
.liste-details dt { color: var(--texte-discret); font-size: 0.85rem; }
.liste-details dd { margin: 0; font-weight: 600; color: var(--noir); }

.liste-historique li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--bordure);
}
.liste-historique li:last-child { border-bottom: none; }
.liste-historique .icone { width: 1.1em; height: 1.1em; }
.liste-historique.statut-present .icone,
li.statut-present .icone { color: var(--vert); }
li.statut-absent .icone { color: var(--rouge); }
li.statut-sans_reponse .icone { color: var(--jaune); }

.actions-fiche { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.actions-fiche form { display: contents; }
.actions-fiche .btn { width: 100%; }

/* ---------- 12. Fichiers / partitions ---------- */
.liste-fichiers { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.liste-fichiers li { display: flex; align-items: center; gap: 6px; }
.lien-fichier {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--vert-pale);
    color: var(--vert-fonce);
    padding: 10px 12px;
    border-radius: var(--rayon-petit);
}
.lien-fichier-nom { flex: 1; font-weight: 700; display: flex; flex-direction: column; }
.lien-fichier-nom small { font-weight: 400; color: var(--texte-discret); }

/* ---------- 13. Presence (comite) ---------- */
.stats-presence { display: flex; gap: 8px; margin: 10px 0; }
.stat-presence {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 6px;
    border-radius: var(--rayon-petit);
    font-weight: 700;
}
.stat-presence .icone { width: 1.3em; height: 1.3em; }
.stat-presence small { font-weight: 500; font-size: 0.8rem; }
.stat-present { background: var(--vert-pale); color: var(--vert-fonce); }
.stat-absent { background: var(--rouge-pale); color: var(--rouge); }
.stat-attente { background: var(--jaune-pale); color: var(--jaune); }

.choix-presence { display: flex; gap: 10px; margin-top: 10px; }

.liste-presences-comite { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.liste-presences-comite li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid var(--bordure);
}
.liste-presences-nom { font-weight: 600; }
.liste-presences-nom small { color: var(--texte-discret); font-weight: 400; }
.selecteur-statut select {
    padding: 6px 8px;
    border-radius: var(--rayon-petit);
    border: 1px solid var(--bordure);
    font-size: 0.85rem;
    font-weight: 600;
}
.marge-haut { margin-top: 6px; }

/* ---------- 14. Details evenement / agenda ---------- */
.details-evenement { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 16px; }
.details-evenement li { display: flex; align-items: center; gap: 8px; color: var(--texte-discret); font-size: 0.92rem; }
.details-evenement .icone { width: 1.1em; height: 1.1em; color: var(--vert); }

.onglets { display: flex; gap: 6px; margin: 14px 0; background: var(--gris-fond-doux); padding: 4px; border-radius: 100px; }
.onglet { flex: 1; text-align: center; padding: 8px; border-radius: 100px; font-weight: 700; font-size: 0.85rem; color: var(--texte-discret); }
.onglet-actif { background: var(--noir); color: #fff; }

/* ---------- 15. Calendrier ---------- */
.calendrier-entete { display: flex; align-items: center; justify-content: space-between; margin: 14px 0; }
.calendrier-entete h2 { margin: 0; font-size: 1.05rem; }
.calendrier-grille {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: var(--carte);
    border-radius: var(--rayon);
    padding: 10px;
    box-shadow: var(--ombre);
}
.calendrier-jour-label { text-align: center; font-size: 0.7rem; font-weight: 700; color: var(--texte-discret); padding-bottom: 4px; }
.calendrier-case {
    min-height: 54px;
    border-radius: 6px;
    padding: 3px;
    background: var(--fond);
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}
.calendrier-case-vide { background: transparent; }
.calendrier-numero { font-size: 0.72rem; font-weight: 700; color: var(--texte-discret); }
.a-des-evenements { background: var(--vert-pale); }
.a-des-evenements .calendrier-numero { color: var(--vert-fonce); }
.calendrier-evenements { display: flex; flex-direction: column; gap: 2px; }
.calendrier-puce {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    background: var(--vert);
    color: #fff;
    padding: 1px 4px;
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.calendrier-puce.badge-sortie { background: var(--jaune); }
.calendrier-puce.badge-autre { background: var(--gris-texte); }

/* ---------- 15bis. Cotisations ---------- */
.liste-cotisations { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.liste-cotisations li {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--carte);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    padding: 10px 12px;
    flex-wrap: wrap;
}
.cotisation-info { display: flex; flex-direction: column; flex: 1 1 160px; }
.cotisation-membre { font-weight: 700; color: var(--noir); }

.choix-mode-cotisation { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 14px; }
.option-radio { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.92rem; color: var(--texte); }
.option-radio input { width: 18px; height: 18px; }

.liste-cases-membres {
    display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto;
    padding: 10px; border: 1px solid var(--bordure); border-radius: 8px; margin-bottom: 14px;
    scrollbar-width: thin; scrollbar-color: var(--bordure) transparent;
}
.liste-cases-membres::-webkit-scrollbar { width: 8px; }
.liste-cases-membres::-webkit-scrollbar-thumb { background: var(--bordure); border-radius: 100px; }
.option-case { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--texte); }
.option-case input { width: 16px; height: 16px; }

.note-apero { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--texte-discret); font-style: italic; margin: 4px 0 16px; }
.liste-apero { margin-top: 6px; font-size: 0.92rem; color: var(--texte-discret); }

/* ---------- 15ter. Annonces ---------- */
.liste-annonces { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.carte-annonce {
    background: var(--carte);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    padding: 14px 16px;
}
.annonce-epinglee { border: 2px solid var(--vert); }
.annonce-entete { display: flex; align-items: center; gap: 6px; }
.annonce-entete h2 { margin: 0; font-size: 1.05rem; }
.icone-epingle { color: var(--vert); width: 1.1em; height: 1.1em; }
.annonce-meta { margin-top: 4px; }
.annonce-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ---------- 15quater. Galerie photos ---------- */
.galerie-photos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 16px;
}
.galerie-item {
    position: relative;
    margin: 0;
    background: var(--carte);
    border-radius: var(--rayon-petit);
    overflow: hidden;
    box-shadow: var(--ombre);
}
.galerie-item img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.galerie-item figcaption { font-size: 0.75rem; color: var(--texte-discret); padding: 6px 8px; }
.galerie-supprimer { position: absolute; top: 4px; right: 4px; }
.galerie-supprimer .btn-icone-danger { background: rgba(255,255,255,0.85); border-radius: 50%; }

/* Champ d'ajout de photo : l'input natif reste dans le DOM (accessible,
   activable au clavier) mais est masque visuellement ; le label associe
   sert de bouton visible, et l'etat (nom de fichier + miniature) est
   affiche a part une fois un fichier choisi. */
.champ-fichier { margin-bottom: 4px; }
.champ-fichier-natif {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.champ-fichier-bouton {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: var(--rayon-petit);
    background: var(--vert-pale);
    color: var(--vert-fonce);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}
.champ-fichier-natif:focus-visible + .champ-fichier-bouton {
    outline: 2px solid var(--vert);
    outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
    .champ-fichier-bouton:hover { background: var(--vert-pale-survol); }
}
.champ-fichier-etat {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.champ-fichier-etat img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: var(--rayon-petit);
    box-shadow: var(--ombre);
}
.champ-fichier-etat .champ-fichier-nom { font-size: 0.85rem; color: var(--texte); word-break: break-all; }

/* ---------- 15quinquies. Inventaire ---------- */
.liste-inventaire { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.liste-inventaire li {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--carte);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    padding: 10px 12px;
    flex-wrap: wrap;
}
.badge-etat-bon { background: var(--vert-pale); color: var(--vert-fonce); }
.badge-etat-use { background: var(--jaune-pale); color: var(--jaune); }
.badge-etat-a_reparer { background: var(--jaune-pale); color: var(--jaune); }
.badge-etat-hors_service { background: var(--rouge-pale); color: var(--rouge); }

/* ---------- 15sexies. Tableau statistiques ---------- */
.tableau-scroll {
    overflow-x: auto; margin-top: 10px;
    scrollbar-width: thin; scrollbar-color: var(--bordure) transparent;
}
.tableau-scroll::-webkit-scrollbar { height: 8px; }
.tableau-scroll::-webkit-scrollbar-thumb { background: var(--bordure); border-radius: 100px; }
.tableau-stats { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.tableau-stats th, .tableau-stats td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--bordure); white-space: nowrap; }
.tableau-stats th { color: var(--texte-discret); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; }

.tableau-preferences { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.tableau-preferences th, .tableau-preferences td { text-align: left; padding: 10px; border-bottom: 1px solid var(--bordure); }
.tableau-preferences th { color: var(--texte-discret); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; }
.tableau-preferences th:not(:first-child), .tableau-preferences td:not(:first-child) { text-align: center; white-space: nowrap; }
.notifications-appareil { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--bordure); }

/* ---------- 16. Ecrans d'authentification ---------- */
.page-auth { background: var(--noir); min-height: 100vh; }
.auth-ecran { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-carte {
    background: var(--carte);
    border-radius: var(--rayon);
    padding: 28px 22px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 6px; }
.icone-logo { width: 3em; height: 3em; color: var(--vert); }
.logo-connexion { height: 5.5em; width: auto; }
.auth-titre { font-size: 1.3rem; margin-bottom: 2px; }
.auth-soustitre { color: var(--texte-discret); font-size: 0.9rem; margin-bottom: 18px; }
.auth-carte .formulaire { text-align: left; margin-bottom: 12px; }
.auth-lien { display: inline-block; margin-top: 6px; font-size: 0.88rem; color: var(--texte-discret); font-weight: 600; }

/* ---------- 17. Pages d'erreur ---------- */
.page-erreur { background: var(--noir); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.erreur-box { text-align: center; color: #fff; }
.erreur-box h1 { font-size: 3rem; color: var(--vert-vif); margin-bottom: 4px; }
.erreur-box .btn { margin-top: 16px; }

/* ---------- 18. Tablette / ordinateur (>= 720px) ---------- */
@media (min-width: 720px) {
    /* padding-left reserve la place de la barre laterale (84px + marge) ;
       .contenu garde "margin: 0 auto" (regle de base, section 3) pour que
       .contenu-app se centre tout seul dans l'espace restant, plutot que
       de cumuler un margin-left en plus du padding (ancien bug qui collait
       le contenu a gauche et laissait un grand vide a droite). */
    .contenu { padding: 24px 24px calc(var(--hauteur-nav) + 24px) 100px; max-width: none; }

    .bottom-nav {
        top: var(--hauteur-topbar);
        bottom: 0;
        left: 0;
        right: auto;
        width: 84px;
        height: auto;
        flex-direction: column;
        padding-top: 18px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.15);
    }
    .bottom-nav a { flex: none; padding: 14px 0; font-size: 0.7rem; }

    .contenu-app { max-width: 760px; }

    .topbar-profil-nom { display: inline; }

    .grille-cartes { grid-template-columns: repeat(2, 1fr); }
    .formulaire-colonnes { grid-template-columns: 1fr 1fr; }
    .barre-filtres { flex-wrap: nowrap; }
    .champ-recherche { flex: 2 1 auto; }
    .barre-filtres .btn { flex: 0 0 auto; }

    .actions-fiche { flex-direction: row; }

    .calendrier-case { min-height: 90px; }
}

/* ---------- 18bis. Grand ecran (>= 1100px) : exploiter la largeur ---------- */
@media (min-width: 1100px) {
    .contenu-app { max-width: 1000px; }

    .grille-cartes { grid-template-columns: repeat(3, 1fr); }

    /* Les groupes d'acces rapides passent en colonnes cote a cote au lieu
       de s'empiler, pour ne pas laisser le reste de l'ecran vide. Chaque
       groupe garde la largeur de son propre contenu (flex: 0 1 auto) au
       lieu d'etre etire a largeur egale (flex: 1) : un groupe avec un seul
       bouton ("Activite" n'a souvent que "Nouvel evenement") ne laisse
       alors plus un grand espace vide a cote de ce bouton - la grille a 3
       colonnes fixes aurait sinon reserve la largeur de 2 colonnes inutilisees. */
    .acces-rapides { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 32px; }
    .acces-rapides-groupe { flex: 0 1 auto; min-width: 0; }
    .acces-rapides-grille { display: flex; flex-wrap: wrap; }
    .acces-rapide { flex: 0 0 100px; }

    .galerie-photos { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 18ter. Tres grand ecran (>= 1400px) ---------- */
@media (min-width: 1400px) {
    .contenu-app { max-width: 1220px; }
}
