/* Présences EEDF — mobile first
   Charte graphique EEDF (avril 2026) : palette rouge / orange / jaune / vert / bleu,
   palette tamisée pour les fonds, police Montserrat (sans empattement, lisible pour les personnes dys). */

/* Montserrat (SIL Open Font License, voir fonts/Montserrat-OFL.txt), hébergée ici : aucun appel à Google */
@font-face {
    font-family: "Montserrat"; font-style: normal; font-display: swap; font-weight: 100 900;
    src: url(fonts/montserrat-latin-wght-normal.woff2) format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Montserrat"; font-style: normal; font-display: swap; font-weight: 100 900;
    src: url(fonts/montserrat-latin-ext-wght-normal.woff2) format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Palette EEDF */
    --eedf-rouge: #bd1220;
    --eedf-orange: #f05a24;
    --eedf-jaune: #f7a800;
    --eedf-vert: #96bf0d;
    --eedf-bleu: #29a3c0;
    --eedf-rose: #f283b6;             /* Jeunes adultes (hors charte, choix du groupe) */
    /* Palette tamisée (fonds) */
    --eedf-rouge-t: #f5dcde;
    --eedf-orange-t: #fbeae4;
    --eedf-jaune-t: #fbeece;
    --eedf-vert-t: #eff5db;
    --eedf-bleu-t: #dff1f6;

    --bg: #f6f6f4;
    --card: #fff;
    --text: #1c2430;
    --muted: #5f6772;
    --line: #e2e3e0;
    --primary: var(--eedf-rouge);     /* rouge du typogramme EEDF : contraste suffisant avec le blanc */
    --primary-text: #fff;
    --accent: var(--eedf-bleu);
    --ok: #6f8f00;                    /* vert EEDF assombri pour les contours sur fond clair */
    --ok-bg: var(--eedf-vert-t);
    --warn-bg: var(--eedf-jaune-t);
    --err: #9e0f1b;
    --err-bg: var(--eedf-rouge-t);
    --topbar-bg: #fff;
    --topbar-text: var(--text);
    --radius: 14px;
    --tap: 52px;
    /* La pelle : bandeau nature (jour) */
    --nature-ciel: var(--eedf-bleu-t);
    --nature-astre: var(--eedf-jaune);
    --nature-lune: 0;
    --nature-neige: #ffffff;
    --nature-hiver-loin: #9fd3e0;
    --nature-vert-fonce: #6f8f00;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14171b; --card: #1e2329; --text: #eceef0; --muted: #a2a9b2; --line: #2e353e;
        --primary: var(--eedf-orange); --primary-text: #14171b; --accent: var(--eedf-bleu);
        --ok: var(--eedf-vert); --ok-bg: #26301a; --warn-bg: #3a3218; --err: #ff8a80; --err-bg: #3d1d1f;
        --topbar-bg: #1e2329; --topbar-text: var(--text);
        /* La pelle : bandeau nature (nuit, avec la lune) */
        --nature-ciel: #1b2a3a; --nature-astre: #f3f0d8; --nature-lune: 1; --nature-neige: #dfe8ee; --nature-hiver-loin: #2f5566; --nature-vert-fonce: #4d6a0b;
    }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 16px/1.5 "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 .5rem; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

/* Barre du haut */
.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem .75rem; padding-top: max(.5rem, env(safe-area-inset-top));
    background: var(--topbar-bg); color: var(--topbar-text);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
/* Liseré aux cinq couleurs EEDF sous la barre */
.topbar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px;
    background: linear-gradient(90deg,
        var(--eedf-rouge) 0 20%, var(--eedf-orange) 20% 40%, var(--eedf-jaune) 40% 60%,
        var(--eedf-vert) 60% 80%, var(--eedf-bleu) 80% 100%);
}
.topbar-back { font-size: 1.8rem; line-height: 1; text-decoration: none; width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.topbar-back:hover { background: var(--bg); }
/* Griffe EEDF (trèfle et arcs) : fond blanc imposé par la charte, y compris en mode sombre */
.topbar-logo { flex: none; display: block; height: 40px; max-width: 112px; border-radius: 10px; background: #fff; padding: 2px; }
.topbar-logo img { display: block; height: 36px; width: auto; max-width: 108px; object-fit: contain; }
.topbar-title { flex: 1; font-size: 1.05rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-login { text-decoration: none; font-weight: 600; color: var(--primary); }
.menu { position: relative; }
.menu summary {
    list-style: none; cursor: pointer; width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center; background: var(--primary); color: var(--primary-text); font-weight: 700;
}
.menu summary::-webkit-details-marker { display: none; }
.menu nav {
    position: absolute; right: 0; top: 48px; min-width: 240px; background: var(--card); color: var(--text);
    border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: .4rem; display: flex; flex-direction: column;
}
.menu nav a { padding: .75rem .9rem; text-decoration: none; border-radius: 10px; }
.menu nav a:hover { background: var(--bg); }
.menu-form { margin: 0; }
.menu-form button { width: 100%; text-align: left; padding: .75rem .9rem; border: 0; border-radius: 10px; background: var(--warn-bg); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.menu-who { padding: .6rem .9rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; font-weight: 600; }
.menu-who small { display: block; color: var(--muted); font-weight: 400; }

.container { max-width: 760px; margin: 0 auto; padding: 1.25rem .9rem 2rem; }
/* Logo complet (bloc marque) : 160 px, au-dessus de la taille minimale de la charte (20 mm) */
.logo-full { display: block; width: 160px; height: auto; margin: .5rem auto 1rem; background: #fff; border-radius: 12px; padding: 8px; }
.has-savebar .container { padding-bottom: 6rem; }
.section-title { margin: 1.4rem 0 .6rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* Cartes, tuiles */
.card { background: var(--card); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.card > summary { cursor: pointer; padding: .2rem 0; }
.tiles { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile {
    --c: var(--primary);
    display: flex; flex-direction: column; gap: .2rem; text-decoration: none;
    background: var(--card); border-radius: var(--radius); padding: 1.1rem 1rem;
    border-left: 8px solid var(--c); box-shadow: 0 1px 2px rgba(0,0,0,.06); min-height: 84px; justify-content: center;
}
.tile:active { transform: scale(.98); }
.tile-title { font-size: 1.2rem; font-weight: 700; }
.tile-sub { color: var(--muted); font-size: .9rem; }
/* Fond « tamisé » de la couleur de branche : texte foncé lisible quelle que soit la couleur */
.tile-big { background: color-mix(in srgb, var(--c) 18%, var(--card)); margin-bottom: .5rem; }
.tile-big .tile-title { font-size: 1.35rem; }

.unit-head {
    display: flex; justify-content: space-between; align-items: center; gap: .5rem;
    border-left: 6px solid var(--c); padding: .3rem .7rem; margin-bottom: .8rem; color: var(--muted);
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.stats > div { background: var(--card); border-radius: var(--radius); padding: .7rem .5rem; text-align: center; }
.stats strong { display: block; font-size: 1.35rem; }
.stats span { font-size: .78rem; color: var(--muted); }

/* Boutons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-height: 44px; padding: .55rem 1rem; border-radius: 12px; border: 1px solid var(--line);
    background: var(--card); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn-danger { color: var(--err); border-color: var(--err); background: transparent; }
.btn-block { display: flex; width: 100%; margin-bottom: .6rem; }
.btn-xl { min-height: 58px; font-size: 1.1rem; }
.btn-small { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }
.actions-list { display: flex; flex-direction: column; gap: .5rem; }
.actions-list .btn { justify-content: flex-start; }

/* Formulaires */
.form { display: flex; flex-direction: column; gap: .8rem; margin-top: .5rem; }
.form label, .inline label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .92rem; }
input, select, textarea {
    font: inherit; font-size: 16px; color: var(--text); background: var(--card);
    border: 1px solid var(--line); border-radius: 10px; padding: .65rem .75rem; min-height: 46px; width: 100%;
}
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
input[type=file] { padding: .5rem; }
.inline { display: flex; align-items: flex-end; gap: .5rem; flex-wrap: wrap; }
.inline select, .inline input { width: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; align-items: end; }
.row-inline { display: flex; gap: .5rem; margin-top: .5rem; }
.select-small { width: auto; max-width: 48%; min-height: 40px; padding: .3rem .5rem; }
fieldset { border: 0; padding: 0; margin: 0; }
/* Fiche d'un responsable (menu Équipe) : affectations, puis identité */
.js .sans-js { display: none; }
.fiche { padding: .2rem 0 .4rem; width: 100%; }
.fiche-titre { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1.1rem 0 .5rem; }
.fiche-titre:first-child { margin-top: .6rem; }
/* Une affectation = trait de couleur de la branche, unité, rôle modifiable, bouton Retirer */
.affs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.aff {
    display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; align-items: center;
    padding: .45rem .5rem .45rem .8rem; border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 10px; background: var(--card);
}
.aff form { margin: 0; }
.aff-unite { font-weight: 700; }
.aff-role { display: flex; gap: .3rem; }
.aff-role select { min-height: 38px; padding: .3rem .5rem; width: auto; }
.aff-fixe { color: var(--muted); }
.aff .btn-small { white-space: nowrap; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
/* Ajout : une seule ligne Unité + Rôle + bouton */
.aff-ajout {
    display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; align-items: center; margin-top: .6rem;
    padding: .6rem; border: 1px dashed var(--line); border-radius: 10px;
}
.aff-ajout-titre { grid-column: 1 / -1; font-weight: 600; font-size: .9rem; }
.aff-ajout select, .aff-choix select { min-height: 40px; padding: .35rem .5rem; }
.aff-choix { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
/* Résumé dans la liste : une pastille par affectation */
.aff-resume { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.aff-pastille { font-size: .78rem; padding: .1rem .5rem; border-radius: 999px; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 14%, var(--card)); }
@media (max-width: 480px) {
    .aff { grid-template-columns: 1fr auto; }
    .aff-unite { grid-column: 1 / -1; }
    .aff-ajout { grid-template-columns: 1fr 1fr; }
    .aff-ajout .btn { grid-column: 1 / -1; }
}
legend { font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: .5rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 500; cursor: pointer; }
.chip input:checked + span { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.chips-nav { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: 1rem; }
.chip-link { padding: .4rem .8rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; white-space: nowrap; }
.chip-link.actif { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }

/* Listes */
.list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.list-item {
    display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; min-height: var(--tap);
    background: var(--card); border-radius: 12px; text-decoration: none;
}
.list-edit { display: block; }
.list-edit > summary { display: flex; cursor: pointer; list-style: none; }
.list-edit > summary::-webkit-details-marker { display: none; }
.list-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.list-title { font-weight: 600; }
.list-sub { font-size: .85rem; color: var(--muted); }
.inactif { opacity: .55; }
.date-badge { min-width: 62px; text-align: center; font-size: .85rem; font-weight: 700; color: var(--primary); }
.count { font-weight: 700; font-size: 1.1rem; }
.count small { color: var(--muted); font-weight: 400; }
.count-todo { font-size: .8rem; color: var(--err); background: var(--err-bg); padding: .2rem .5rem; border-radius: 999px; }
.tag { font-size: .7rem; background: var(--bg); border: 1px solid var(--line); padding: 0 .4rem; border-radius: 6px; font-weight: 500; vertical-align: middle; }

/* Saisie des présences */
.act-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; background: var(--card); padding: .8rem; border-radius: var(--radius); }
.saisie-tools { display: flex; gap: .5rem; margin-top: 1rem; align-items: center; }
.saisie-tools input { flex: 1; }
.checks { display: grid; grid-template-columns: 1fr; gap: .45rem; }
@media (min-width: 480px) { .checks { grid-template-columns: 1fr 1fr; } }
.check { position: relative; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
.check input { position: absolute; opacity: 0; }
.check span {
    display: flex; align-items: center; gap: .6rem; min-height: 56px; padding: .6rem .9rem;
    background: var(--card); border: 2px solid var(--line); border-radius: 12px; transition: background .1s, border-color .1s;
}
.check span::before {
    content: ""; flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg);
}
.check input:checked + span { background: var(--ok-bg); border-color: var(--ok); }
.check input:checked + span::before { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 4px var(--ok-bg); }
.check input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.check.hidden { display: none; }
.checks-staff .check span { min-height: 48px; }
.ajout { margin-top: .7rem; }
.ajout summary { cursor: pointer; color: var(--muted); padding: .4rem 0; }
.savebar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: .7rem 1rem; padding-bottom: max(.7rem, env(safe-area-inset-bottom));
    background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}
.savebar .btn { min-width: 150px; min-height: 50px; }

/* Page de détail d'une personne */
.fiche-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; flex-wrap: wrap; }
.fiche-entete h2 { margin-bottom: .4rem; }
.fiche-contact { display: flex; gap: .4rem; flex-wrap: wrap; }
.fiche-dl { display: grid; grid-template-columns: minmax(9rem, auto) 1fr; gap: .35rem .9rem; margin: 0 0 .8rem; }
.fiche-dl dt { color: var(--muted); font-size: .88rem; }
.fiche-dl dd { margin: 0; overflow-wrap: anywhere; }
.fiche-modif > summary { list-style: none; display: inline-flex; }
.fiche-modif > summary::-webkit-details-marker { display: none; }
.fiche-modif[open] > summary { margin-bottom: .6rem; }
.check-lecture span { opacity: .6; cursor: not-allowed; }
@media (max-width: 480px) { .fiche-dl { grid-template-columns: 1fr; gap: 0; } .fiche-dl dd { margin-bottom: .4rem; } }

/* Grand tableau des présences : première colonne et en-tête figés */
.grand-tableau { max-height: 75vh; overflow: auto; }
.grand-tableau table { font-size: .8rem; }
.grand-tableau th, .grand-tableau td { padding: .3rem .35rem; text-align: center; border-right: 1px solid var(--line); }
.grand-tableau thead th { position: sticky; top: 0; z-index: 2; background: var(--card); vertical-align: bottom; text-transform: none; }
.grand-tableau .tg-act span { display: block; font-weight: 700; color: var(--text); }
.grand-tableau .tg-act small { display: block; font-weight: 400; max-width: 6rem; white-space: normal; line-height: 1.15; }
.grand-tableau .tg-groupe { color: var(--primary); }
.grand-tableau .tg-nom { position: sticky; left: 0; z-index: 1; background: var(--card); text-align: left; white-space: nowrap; border-left: 4px solid var(--c, transparent); font-weight: 500; }
.grand-tableau thead .tg-nom { z-index: 3; }
.grand-tableau .tg-nom a { text-decoration: none; }
.grand-tableau .tg-oui { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.grand-tableau .tg-section th { text-align: left; background: var(--bg); position: sticky; left: 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.grand-tableau .tg-total td, .grand-tableau .tg-total th { font-weight: 700; border-top: 2px solid var(--line); }
@media print { .grand-tableau { max-height: none; overflow: visible; } .grand-tableau .tg-nom, .grand-tableau thead th { position: static; } @page { size: landscape; } }

/* Matrice des droits */
.matrice td, .matrice th { text-align: center; }
.matrice td:first-child, .matrice th:first-child { text-align: left; white-space: normal; min-width: 12rem; }
.matrice thead th { white-space: normal; }
.matrice input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--primary); }
.matrice .oui { color: var(--ok); font-weight: 700; }
.matrice .non { color: var(--muted); }
.tag-modifie { background: var(--warn-bg); }

/* Messages */
.flash { padding: .75rem .9rem; border-radius: 12px; margin-bottom: 1rem; background: var(--ok-bg); }
.flash-err { background: var(--err-bg); color: var(--err); }
.flash-warn { background: var(--warn-bg); }

/* Tableaux */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); margin-bottom: 1rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child, .col2-texte th:nth-child(2), .col2-texte td:nth-child(2) { text-align: left; }
thead th { font-size: .78rem; color: var(--muted); text-transform: uppercase; }
tfoot th { border-top: 2px solid var(--line); }

.print-only { display: none; }
@media print {
    .topbar, .no-print, .savebar { display: none !important; }
    .print-only { display: block; }
    /* Logo EEDF obligatoire sur les documents officiels (charte) : 96 px ≈ 25 mm, au-dessus du minimum de 20 mm */
    .print-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
    .print-head img { width: 25mm; height: auto; }
    /* Tableaux entiers sur papier : pas de défilement, en-têtes sur plusieurs lignes */
    .table-wrap { overflow: visible; }
    table { font-size: .75rem; }
    th, td { padding: .35rem .4rem; }
    thead th { white-space: normal; }
    body { background: #fff; color: #000; }
    .card, .table-wrap, .stats > div { box-shadow: none; border: 1px solid #ccc; }
}
.envoi-lien { margin-top: .8rem; }
/* Préparer la rentrée : passage de branche suggéré d'après l'âge */
.list-item.passage { border-left: 6px solid var(--c); background: color-mix(in srgb, var(--c) 10%, var(--card)); }
/* Activité : unités concernées */
.unites-choix { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .3rem; }
.chip-unite span { border-left: 5px solid var(--c); }
.chip-unite input:checked + span { background: color-mix(in srgb, var(--c) 22%, var(--card)); color: var(--text); border-color: var(--c); }
/* Contrôle du profil : bandeau toujours visible en haut de l'écran */
.bandeau-controle {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap;
    padding: .5rem .9rem; padding-top: max(.5rem, env(safe-area-inset-top));
    background: var(--eedf-orange); color: #fff; font-size: .95rem;
}
.bandeau-controle form { margin: 0; }
.bandeau-controle .btn { background: #fff; color: #1c2430; border-color: #fff; min-height: 34px; }
.en-controle .topbar { top: 46px; }
@media print { .bandeau-controle { display: none; } }

/* Statut d'accès d'un responsable (Équipe) */
.acces { margin-top: .8rem; padding: .6rem .8rem; border-radius: 8px; border-left: 4px solid var(--line); background: var(--bg); }
.acces-statut { margin: 0 0 .5rem; font-weight: 600; }
.acces-ok { border-left-color: var(--ok); background: var(--ok-bg); }
.acces-attente { border-left-color: var(--eedf-jaune, #f7a800); background: var(--warn-bg); }
.acces-alerte { border-left-color: var(--err); background: var(--err-bg); }
.acces-pastille { font-size: .7rem; padding: 0 .4rem; border-radius: 999px; font-weight: 600; vertical-align: middle; border: 1px solid var(--line); white-space: nowrap; }

/* Accueil (tableau de bord du groupe) */
.hero { padding: .4rem 0 .8rem; }
.hero-salut { margin: 0; font-size: 1.5rem; font-weight: 800; }
.hero-haut { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; }
.hero-haut .hero-salut { min-width: 0; }
.annee-choix { margin: 0; margin-left: auto; }
.annee-choix label { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .85rem; color: var(--muted); }
.annee-choix select { width: auto; padding: .3rem .5rem; font-weight: 600; }
.annee-autre { margin: 0 0 .8rem; font-size: .85rem; color: var(--muted); }
.hero-sub { margin: .15rem 0 .5rem; color: var(--muted); }
.todo-tete { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.todo-tete h2 { margin: 0; font-size: 1.15rem; }
.todo-pct { font-weight: 800; font-size: 1.3rem; color: var(--ok); }
.progression { display: block; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin: .5rem 0 .3rem; }
.progression > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--eedf-vert), var(--ok)); transition: width .4s; }
.progression.petite { height: 6px; margin: .2rem 0 0; }
.progression.petite > span { background: var(--c); }
.bravo { margin: .6rem 0 0; padding: .6rem .8rem; border-radius: 10px; background: var(--ok-bg); font-weight: 600; }
.todo .list { margin-top: .6rem; }
.unites-grille { display: grid; gap: .6rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .unites-grille { grid-template-columns: 1fr 1fr; } }
.unite-carte { display: flex; flex-direction: column; gap: .35rem; padding: .85rem 1rem; border-radius: var(--radius); background: var(--card);
    border-left: 6px solid var(--c); color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.unite-carte.mienne { background: color-mix(in srgb, var(--c) 14%, var(--card)); }
.unite-carte:active { transform: scale(.98); }
.unite-nom { font-weight: 700; font-size: 1.1rem; }
.unite-chiffres { display: flex; flex-wrap: wrap; gap: .3rem .9rem; color: var(--muted); font-size: .85rem; }
.unite-chiffres strong { color: var(--text); font-size: 1rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.kpis > div { background: var(--card); border-radius: var(--radius); padding: .8rem .6rem; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.kpis strong { display: block; font-size: 1.4rem; color: var(--primary); }
.kpis span { font-size: .8rem; color: var(--muted); }
.merci { display: flex; gap: .8rem; align-items: center; margin: 1rem 0; padding: .9rem 1rem; border-radius: var(--radius); background: var(--ok-bg); }
.merci p { margin: 0; }
.merci-icone { font-size: 2rem; }
.outils { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: 2rem; }
@media (min-width: 560px) { .outils { grid-template-columns: repeat(3, 1fr); } }
.outil { display: flex; flex-direction: column; gap: .15rem; padding: .8rem; border-radius: var(--radius); background: var(--card); color: inherit; text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,.05); min-height: 92px; }
.outil:active { transform: scale(.98); }
.outil-icone { font-size: 1.4rem; }
.outil-titre { font-weight: 700; line-height: 1.2; }
.outil-sous { font-size: .78rem; color: var(--muted); }

/* Grand tableau en modification */
.edition-barre { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin: .5rem 0; padding: .6rem .8rem;
    border-radius: 10px; background: var(--warn-bg); font-size: .85rem; }
.edition-actions { display: flex; gap: .4rem; }
.grand-tableau.en-edition td { padding: 0; }
.grand-tableau.en-edition td input[type="checkbox"] { width: 1.25rem; height: 1.25rem; margin: .35rem; accent-color: var(--ok); cursor: pointer; }
.grand-tableau .tg-hors { background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 4px, var(--card) 4px, var(--card) 8px); }

/* ---------- La pelle ---------- */
/* Bandeau nature de la saison, sous la barre du haut */
.nature { background: var(--nature-ciel); line-height: 0; }
.nature-dessin { display: block; width: 100%; height: 26px; }
.nature-plein .nature-dessin { height: 64px; margin-top: -6px; }
.nature-astre { fill: var(--nature-astre); }
.nature-lune { fill: var(--nature-ciel); opacity: var(--nature-lune); }
.nature-hero { max-width: 760px; margin: 0 auto; padding: 1rem .9rem 0; line-height: 1.4; }
.nature-hero .hero { padding: 0; }
.nature-vole { animation: nature-vole 6s ease-in-out infinite alternate; }
@keyframes nature-vole { from { transform: translateY(0); } to { transform: translateY(4px); } }

/* Écran de démarrage : Pelle sort de la colline */
.splash { position: fixed; inset: 0; z-index: 100; background: var(--eedf-rouge); overflow: hidden; cursor: pointer; transition: opacity .3s; }
.splash-fin { opacity: 0; }
.splash-titre { position: absolute; top: 14%; left: 0; right: 0; text-align: center; color: #fff; animation: splash-apparait 1.6s ease-out both; }
.splash-titre b { display: block; font-size: clamp(2.4rem, 11vw, 3.6rem); font-weight: 900; letter-spacing: -.035em; line-height: 1; }
.splash-titre span { display: block; margin-top: .4rem; font-size: 1.05rem; font-weight: 600; }
.splash-colline { position: absolute; left: -20%; right: -20%; bottom: -16%; height: 44%; background: var(--eedf-vert); border-radius: 50%; }
.splash-mascotte { position: absolute; left: 50%; bottom: 20%; width: min(30vw, 130px); height: auto; margin-left: calc(min(30vw, 130px) / -2); animation: splash-surgir 1.6s cubic-bezier(.3,1.5,.5,1) both; }
.splash-bulle { position: absolute; left: calc(50% + min(14vw, 60px)); bottom: calc(20% + min(52vw, 230px)); background: #fff; color: var(--eedf-rouge); font-weight: 800; font-size: 1.2rem;
    padding: .2rem .8rem; border-radius: 16px; transform-origin: 0 100%; animation: splash-bulle 1.6s ease-out both; }
.splash-bulle::after { content: ""; position: absolute; left: 14px; bottom: -9px; border: 6px solid transparent; border-top: 8px solid #fff; border-left: 4px solid #fff; }
@keyframes splash-surgir { 0% { transform: translateY(130%); } 55% { transform: translateY(-6%); } 70% { transform: translateY(2%) rotate(-3deg); } 100% { transform: rotate(3deg); } }
@keyframes splash-bulle { 0%, 58% { opacity: 0; transform: scale(.2); } 76% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
@keyframes splash-apparait { 0%, 40% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: none; } }

/* Pluie de feuilles : tous les appels sont faits */
.feuilles { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.feuilles span { position: absolute; top: -20px; left: var(--x); width: 12px; height: 17px; border-radius: 0 70% 0 70%; background: var(--c); opacity: 0;
    animation: feuille 2.2s var(--d) ease-in forwards; }
@keyframes feuille { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(105vh) translateX(40px) rotate(400deg); } }

/* Écrans vides et pages d'erreur illustrés */
.vide-illustre { display: grid; justify-items: center; gap: .8rem; text-align: center; padding: 2rem 1rem; }
.vide-illustre img { width: 44px; height: auto; transform: rotate(-24deg); }
.vide-illustre p { margin: 0; max-width: 32ch; color: var(--muted); font-weight: 600; }

/* Accueil : la tranchée qui se creuse et la mascotte qui remercie */
.tranchee { position: relative; height: 12px; border-radius: 999px; background: var(--line); margin: .9rem 0 .3rem; }
.tranchee > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--eedf-vert), var(--ok)); transition: width .4s; }
.tranchee img { position: absolute; top: -17px; width: 15px; height: auto; transform: translateX(-60%) rotate(28deg); }
.merci-mascotte { width: 38px; height: auto; flex: none; transform: rotate(8deg); }

@media (prefers-reduced-motion: reduce) {
    .splash *, .nature-vole { animation: none !important; }
    .feuilles { display: none; }
}
/* Connexion : la pelle, son nom, sa signature, et le logo EEDF (fond blanc imposé par la charte) */
.marque { display: flex; align-items: center; gap: .7rem; margin: .3rem 0 1.2rem; }
.marque-pelle { width: 30px; height: auto; flex: none; transform: rotate(14deg); }
.marque b { display: block; font-size: 2rem; font-weight: 900; letter-spacing: -.035em; line-height: 1; }
.marque span { display: block; margin-top: .25rem; font-size: .9rem; font-weight: 600; color: var(--muted); }
.marque-eedf { margin-left: auto; width: 56px; height: auto; background: #fff; border-radius: 10px; padding: 4px; flex: none; }

/* Fusion de deux fiches de responsable */
.fusion th, .fusion td { text-align: left; vertical-align: top; padding: .55rem .7rem; border-bottom: 1px solid var(--line); }
.fusion tbody th { font-weight: 600; color: var(--muted); white-space: nowrap; }
.fusion-diff { background: var(--warn-bg); }
.fusion .choix { display: flex; gap: .4rem; align-items: flex-start; cursor: pointer; }
.check-ligne { display: flex; gap: .5rem; align-items: flex-start; margin: .8rem 0; font-weight: 600; }
.matrice .indispo { color: var(--muted); opacity: .45; cursor: not-allowed; }

/* Conventions CAF */
.convention-tete { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.convention-tete h2 { margin: 0; font-size: 1.15rem; }
.convention details { margin-top: .7rem; }
.convention details > summary { cursor: pointer; font-weight: 600; color: var(--primary); }

/* Bilan CAF par convention : tableaux alignés d'un bloc à l'autre, une convention par page à l'impression */
.tbl-caf { table-layout: fixed; }
.tbl-caf .tbl-caf-nom { width: 26%; }
.tbl-caf td:first-child, .tbl-caf thead th { white-space: normal; vertical-align: bottom; }
.tbl-caf thead th { font-size: .7rem; letter-spacing: 0; }
.bloc-caf-titre { margin: 1.8rem 0 .6rem; font-size: 1.25rem; padding-left: .6rem; border-left: 5px solid var(--primary); }
@media (max-width: 600px) { .tbl-caf { table-layout: auto; } }
@media print { .bloc-caf + .bloc-caf { break-before: page; } }

/* Activités du groupe */
[id^="act-"] { scroll-margin-top: 5rem; }
.list-item.mise-en-avant { outline: 3px solid var(--primary); outline-offset: 2px; }
.appels-unites { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.appels-unites .chip-link { padding: .2rem .6rem; font-size: .8rem; }
.appels-unites .chip-link.a-faire { color: var(--err); background: var(--err-bg); border-color: transparent; }
.activite-ligne { display: flex; align-items: center; gap: .4rem; }
.activite-ligne > .list-item { flex: 1; min-width: 0; }
.activite-modifier { flex: none; }

/* Logo du groupe (en haut à gauche ; page apparence) */
.logo-apercu { display: flex; align-items: center; gap: .8rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.logo-apercu img { height: 36px; width: auto; max-width: 108px; object-fit: contain; }
