/* Foda Service — feuille de style unique, sans dépendance externe. */

:root {
    --vert-profond: #00312B;
    --vert: #006540;
    --vert-clair: #019360;
    --jaune: #FCD118;

    --encre: #16201D;
    --encre-attenuee: #5B6360;
    --filet: #DCE4E1;
    --fond: #F4F7F6;
    --surface: #FFFFFF;
    --surface-attenuee: #EEF3F1;

    --alerte: #B42318;
    --alerte-fond: #FEF3F2;
    --succes: #05713C;
    --succes-fond: #ECFDF3;
    --attention: #B45309;
    --attention-fond: #FFFAEB;

    --rayon: 8px;
    --ombre: 0 1px 2px rgba(0, 49, 43, .06), 0 4px 12px rgba(0, 49, 43, .04);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--fond);
    color: var(--encre);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

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

/* ─────────────── Ossature : rail latéral ─────────────── */

.rail-bascule { position: absolute; opacity: 0; pointer-events: none; }

.rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: 244px;
    background: var(--vert-profond);
    border-right: 3px solid var(--jaune);
    display: flex;
    flex-direction: column;
    z-index: 30;
}

.rail-marque {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    text-decoration: none;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.rail-marque img { height: 26px; }
.rail-marque span { font-weight: 700; font-size: 1rem; letter-spacing: .01em; }

.rail-nav { flex: 1; overflow-y: auto; padding: 14px 10px 10px; }

.rail-section { margin-bottom: 18px; }

.rail-titre {
    display: block;
    padding: 0 10px 6px;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .42);
}

.rail-nav a {
    display: block;
    padding: 7px 10px;
    margin-bottom: 1px;
    border-radius: 6px;
    color: rgba(255, 255, 255, .8);
    text-decoration: none;
    font-size: .875rem;
    border-left: 3px solid transparent;
}

.rail-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.rail-nav a.actif {
    background: rgba(252, 209, 24, .14);
    border-left-color: var(--jaune);
    color: var(--jaune);
    font-weight: 600;
}

.rail-pied {
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.rail-identite { margin-bottom: 8px; }
.rail-identite .nom { display: block; color: #fff; font-weight: 600; font-size: .84rem; }

.rail-identite .role {
    display: block;
    color: rgba(255, 255, 255, .55);
    font-size: .72rem;
    line-height: 1.3;
    margin-top: 1px;
}

.rail-quitter { color: var(--jaune); font-size: .78rem; text-decoration: none; }
.rail-quitter:hover { text-decoration: underline; }

.rail-voile { display: none; }
.barre-compacte { display: none; }

body.avec-rail > main { margin-left: 244px; padding: 22px 26px 50px; }
body.avec-rail > .pied { margin-left: 244px; padding: 14px 26px 30px; }
body.sans-rail > main.pleine-page { max-width: 760px; margin: 0 auto; padding: 40px 20px; }

.pied {
    color: var(--encre-attenuee);
    font-size: .76rem;
    border-top: 1px solid var(--filet);
}

/* Petit écran : le rail se replie derrière une barre compacte. */
@media (max-width: 960px) {
    .rail {
        transform: translateX(-100%);
        transition: transform .18s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, .3);
    }

    .rail-bascule:checked ~ .rail { transform: translateX(0); }

    .rail-bascule:checked ~ .rail-voile {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 49, 43, .45);
        z-index: 25;
    }

    .barre-compacte {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 20;
        background: var(--vert-profond);
        border-bottom: 3px solid var(--jaune);
        color: #fff;
        padding: 10px 16px;
    }

    .rail-bouton {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        width: 26px;
        height: 24px;
        cursor: pointer;
    }

    .rail-bouton span { display: block; height: 2px; background: #fff; border-radius: 2px; }

    body.avec-rail > main { margin-left: 0; padding: 18px 16px 40px; }
    body.avec-rail > .pied { margin-left: 0; padding: 14px 16px 28px; }
}

/* ─────────────── Titres ─────────────── */

.titre-page { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.titre-page h1 { margin: 0; font-size: 1.5rem; color: var(--vert-profond); }
.titre-page p { margin: 4px 0 0; color: var(--encre-attenuee); font-size: .88rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

h2 { font-size: 1.1rem; color: var(--vert-profond); margin: 0 0 12px; }

/* ─────────────── Cartes ─────────────── */

.carte {
    background: var(--surface);
    border: 1px solid var(--filet);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    padding: 18px;
    margin-bottom: 18px;
}

.carte > h2:first-child { margin-top: 0; }

.grille { display: grid; gap: 14px; }
.grille.deux { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grille.trois { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
.grille.quatre { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }

/* ─────────────── Chiffres clés ─────────────── */

.chiffre {
    background: var(--surface);
    border: 1px solid var(--filet);
    border-radius: var(--rayon);
    padding: 14px 16px;
}

.chiffre .libelle { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--encre-attenuee); }
.chiffre .valeur { font-size: 1.32rem; font-weight: 700; color: var(--vert-profond); margin-top: 4px; font-variant-numeric: tabular-nums; }
.chiffre .detail { font-size: .76rem; color: var(--encre-attenuee); margin-top: 2px; }
.chiffre.fort { background: var(--vert-profond); border-color: var(--vert-profond); }
.chiffre.fort .libelle { color: rgba(255, 255, 255, .7); }
.chiffre.fort .valeur { color: var(--jaune); }
.chiffre.fort .detail { color: rgba(255, 255, 255, .7); }

/* ─────────────── Tableaux ─────────────── */

.tableau-enveloppe { overflow-x: auto; border: 1px solid var(--filet); border-radius: var(--rayon); background: var(--surface); }

table.tableau { width: 100%; border-collapse: collapse; font-size: .86rem; }

table.tableau th {
    background: var(--vert-profond);
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 9px 12px;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}

table.tableau td { padding: 9px 12px; border-top: 1px solid var(--filet); }
table.tableau tbody tr:hover { background: var(--surface-attenuee); }
table.tableau .nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tableau tfoot td { background: var(--surface-attenuee); font-weight: 700; border-top: 2px solid var(--vert); }
table.tableau .sourdine { color: var(--encre-attenuee); }

/* ─────────────── Boutons ─────────────── */

.bouton {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--filet);
    background: var(--surface);
    color: var(--encre);
    font-size: .86rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}

.bouton:hover { background: var(--surface-attenuee); }
.bouton.principal { background: var(--vert); border-color: var(--vert); color: #fff; }
.bouton.principal:hover { background: var(--vert-profond); }
.bouton.danger { color: var(--alerte); border-color: #FDA29B; }
.bouton.danger:hover { background: var(--alerte-fond); }
.bouton:disabled, .bouton[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.bouton.petit { padding: 5px 10px; font-size: .78rem; }

/* ─────────────── Formulaires ─────────────── */

.champ { margin-bottom: 14px; }
.champ label { display: block; font-size: .78rem; font-weight: 600; color: var(--encre-attenuee); margin-bottom: 4px; }

.champ input[type=text], .champ input[type=email], .champ input[type=number],
.champ input[type=date], .champ input[type=password], .champ select, .champ textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--filet);
    border-radius: 6px;
    font-size: .9rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--encre);
}

.champ input:focus, .champ select:focus, .champ textarea:focus {
    outline: 2px solid var(--vert-clair);
    outline-offset: -1px;
    border-color: var(--vert-clair);
}

.champ input[type=number] { text-align: right; font-variant-numeric: tabular-nums; }
/* Les montants se tapent au clavier : les flèches du navigateur, qui ajoutent ou retirent 1 GNF,
   passaient pour un menu déroulant. Elles sont retirées partout ; ↑/↓ au clavier restent actifs. */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.champ .aide { font-size: .74rem; color: var(--encre-attenuee); margin-top: 3px; }
.champ.case { display: flex; align-items: flex-start; gap: 8px; }
.champ.case input { margin-top: 3px; }
.champ.case label { margin: 0; font-weight: 500; color: var(--encre); font-size: .86rem; }

fieldset { border: 1px solid var(--filet); border-radius: var(--rayon); padding: 14px 16px; margin: 0 0 16px; }
legend { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--vert); padding: 0 6px; }

/* ─────────────── Messages ─────────────── */

.message { padding: 11px 14px; border-radius: var(--rayon); margin-bottom: 16px; font-size: .88rem; border: 1px solid; }
.message.succes { background: var(--succes-fond); border-color: #ABEFC6; color: var(--succes); }
.message.erreur { background: var(--alerte-fond); border-color: #FDA29B; color: var(--alerte); }
.message.attention { background: var(--attention-fond); border-color: #FEDF89; color: var(--attention); }
.message ul { margin: 6px 0 0; padding-left: 18px; }

/* ─────────────── Étiquettes ─────────────── */

.etiquette {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.etiquette.brouillon { background: var(--attention-fond); color: var(--attention); }
.etiquette.close { background: var(--succes-fond); color: var(--succes); }
.etiquette.neutre { background: var(--surface-attenuee); color: var(--encre-attenuee); }
.etiquette.echec { background: var(--alerte-fond); color: var(--alerte); }

.vide { padding: 40px 20px; text-align: center; color: var(--encre-attenuee); }
.vide p { margin: 0 0 12px; }

@media (max-width: 720px) {
    .bandeau-interieur { min-height: 0; padding: 10px 16px; }
    main { padding: 16px 16px 40px; }
    .titre-page h1 { font-size: 1.25rem; }
}

/* ─────────────── Graphiques ─────────────── */

.graphique { padding: 18px 20px 14px; }

.graphique-entete { margin-bottom: 14px; }
.graphique-entete h2 { margin: 0; }
.graphique-entete .aide { margin: 3px 0 0; font-size: .78rem; color: var(--encre-attenuee); }

.toile { width: 100%; height: auto; display: block; overflow: visible; }

/* La grille et la ligne de base s'effacent : ce sont les marques qui portent le sens. */
.toile .repere { stroke: var(--filet); stroke-width: 1; stroke-dasharray: 3 4; }
.toile .ligne-base { stroke: var(--filet); stroke-width: 1; }

.toile .valeur-marque {
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    fill: var(--encre);
    font-variant-numeric: tabular-nums;
}

.toile .etiquette-axe {
    font-family: inherit;
    font-size: 11px;
    fill: var(--encre-attenuee);
}

.toile path, .toile rect { transition: opacity .12s ease; }
.toile:hover path, .toile:hover rect { opacity: .78; }
.toile path:hover, .toile rect:hover { opacity: 1; }

/* ─────────────── Légende ─────────────── */

.legende {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--filet);
}

.legende-poste { display: flex; align-items: baseline; gap: 7px; font-size: .82rem; }

.pastille {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex: 0 0 auto;
    transform: translateY(1px);
}

.legende-nom { color: var(--encre); }
.legende-valeur { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--encre); }
.legende-part { color: var(--encre-attenuee); font-size: .76rem; }

/* ─────────────── Vue tabulaire d'un graphique ─────────────── */

.donnees { margin-top: 14px; }

.donnees > summary {
    cursor: pointer;
    font-size: .78rem;
    font-weight: 600;
    color: var(--vert);
    padding: 4px 0;
}

.donnees > summary:hover { text-decoration: underline; }
.donnees table { margin-top: 8px; font-size: .82rem; }
.donnees table th { font-size: .7rem; }

/* ─────────────── Barres horizontales, en HTML ─────────────── */

.barres { list-style: none; margin: 0; padding: 0; }

.barres li {
    display: grid;
    grid-template-columns: minmax(90px, 34%) 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
}

.barre-libelle {
    font-size: .82rem;
    color: var(--encre);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.barre-piste { height: 16px; background: var(--surface-attenuee); border-radius: 4px; }

.barre-marque {
    display: block;
    height: 100%;
    border-radius: 4px;
    min-width: 3px;
}

.barre-valeur {
    font-size: .82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--encre);
    white-space: nowrap;
}

/* Une colonne unique ne doit pas occuper tout l'écran : le dessin se contient. */
.toile { max-height: 300px; }

@media (max-width: 640px) {
    .barres li { grid-template-columns: 1fr auto; gap: 4px 10px; }
    .barre-libelle { grid-column: 1 / -1; text-align: left; }
}

/* ─────────────── Barre du haut ─────────────── */

.barre-haute {
    position: sticky;
    top: 0;
    z-index: 18;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 56px;
    padding: 0 26px;
    margin-left: 244px;
    background: var(--surface);
    border-bottom: 1px solid var(--filet);
}

.barre-titre { font-size: .95rem; color: var(--vert-profond); flex: 1; }
.barre-fin { display: flex; align-items: center; gap: 10px; }
.rail-mention { font-size: .7rem; color: rgba(255, 255, 255, .4); }

.pastille-profil {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--vert-profond);
    color: var(--jaune);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    user-select: none;
    border: 2px solid transparent;
}

.pastille-profil:hover { border-color: var(--jaune); }
.pastille-profil.grande { width: 52px; height: 52px; font-size: 1.05rem; cursor: default; }

/* La barre du haut prend la place de la barre compacte : une seule suffit. */
.barre-compacte { display: none !important; }

/* ─────────────── Panneau glissant de profil ─────────────── */

.panneau-bascule { position: absolute; opacity: 0; pointer-events: none; }

.panneau {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    max-width: 92vw;
    background: var(--surface);
    border-left: 3px solid var(--jaune);
    box-shadow: -10px 0 40px rgba(0, 49, 43, .18);
    transform: translateX(100%);
    transition: transform .2s ease;
    z-index: 40;
    display: flex;
    flex-direction: column;
}

.panneau-bascule:checked ~ .panneau { transform: translateX(0); }

.panneau-bascule:checked ~ .panneau-voile {
    position: fixed;
    inset: 0;
    background: rgba(0, 49, 43, .35);
    z-index: 35;
    display: block;
}

.panneau-voile { display: none; }

.panneau-entete {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px 16px;
    background: var(--vert-profond);
    color: #fff;
}

.panneau-identite { flex: 1; min-width: 0; }
.panneau-identite strong { display: block; font-size: .95rem; }
.panneau-identite span { display: block; font-size: .76rem; color: rgba(255, 255, 255, .72); }
.panneau-identite .sourdine { color: rgba(255, 255, 255, .5); word-break: break-all; }

.panneau-fermer {
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: rgba(255, 255, 255, .7);
    padding: 0 2px;
}

.panneau-fermer:hover { color: #fff; }

.panneau-corps { flex: 1; overflow-y: auto; padding: 4px 18px 18px; }

.panneau-section { padding: 14px 0; border-bottom: 1px solid var(--filet); }
.panneau-section:last-child { border-bottom: none; }

.panneau-titre {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--encre-attenuee);
    margin-bottom: 8px;
}

.panneau-texte { margin: 0; font-size: .84rem; }

.panneau-liste { display: grid; grid-template-columns: 96px 1fr; gap: 4px 10px; margin: 0 0 10px; font-size: .82rem; }
.panneau-liste dt { color: var(--encre-attenuee); }
.panneau-liste dd { margin: 0; color: var(--encre); }

.panneau-chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.panneau-chiffres > div { background: var(--surface-attenuee); border-radius: var(--rayon); padding: 10px 12px; }
.panneau-chiffres .valeur { display: block; font-size: 1.15rem; font-weight: 700; color: var(--vert-profond); }
.panneau-chiffres .libelle { display: block; font-size: .7rem; color: var(--encre-attenuee); margin-top: 2px; }

.panneau-liens { list-style: none; margin: 0; padding: 0; }

.panneau-liens a {
    display: block;
    padding: 8px 10px;
    margin-bottom: 2px;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid transparent;
}

.panneau-liens a:hover { background: var(--surface-attenuee); border-color: var(--filet); }
.panneau-liens .lien-nom { display: block; font-size: .86rem; font-weight: 600; color: var(--vert); }
.panneau-liens .lien-detail { display: block; font-size: .74rem; color: var(--encre-attenuee); }

.panneau-pied { padding: 14px 18px; border-top: 1px solid var(--filet); }

@media (max-width: 960px) {
    .barre-haute { margin-left: 0; padding: 0 16px; }
}

/* ─── Porte d'entrée (connexion / déconnexion) ─── */
body.sans-rail > main { padding: 0; }
.porte { min-height: 100vh; display: flex; align-items: center; justify-content: center;
         background: linear-gradient(160deg, #f3f6f4 0%, #e6efe9 100%); padding: 24px; }
.porte-carte { background: #fff; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,49,43,.12);
               padding: 40px 44px; width: 100%; max-width: 480px; text-align: center; }
.porte-marque { height: 64px; margin-bottom: 14px; }
.porte-carte h1 { margin: 0 0 6px; color: var(--vert-profond); font-size: 1.7rem; }
.porte-sous { color: #5b6661; margin: 0 0 22px; }
.porte-bouton { display: block; width: 100%; padding: 12px 16px; font-size: 1rem; margin: 6px 0 12px; }
.porte-carte form { text-align: left; }
.porte-carte .message { text-align: left; }
.porte-pied { margin: 26px 0 0; font-size: .78rem; color: #8a9590; }

/* ─── Modales ─── */
dialog.modale { border: 0; border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px));
                box-shadow: 0 18px 60px rgba(0,49,43,.25); color: var(--encre, inherit); }
dialog.modale::backdrop { background: rgba(0,49,43,.45); }
dialog.modale.large { width: min(820px, calc(100vw - 32px)); }
.modale-tete { padding: 18px 22px 0; }
.modale-tete h2 { margin: 0 0 4px; font-size: 1.1rem; }
.modale-tete p { margin: 0; color: #5b6661; font-size: .9rem; }
.modale-corps { padding: 16px 22px; }
.modale-pied { padding: 12px 22px 18px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--trait, #e3e8e5); }

/* Les boutons portés par un formulaire s alignent sur les autres. */
.actions form { display: inline-flex; margin: 0; }

/* ─── Mobile ─── */
/* Le bouton menu n'existe que sur petit écran, en traits verts sur la barre blanche. */
.rail-bouton { display: none; }
@media (max-width: 960px) {
    .rail-bouton {
        display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
        width: 40px; height: 40px; padding: 9px; margin-left: -8px;
        border-radius: 8px; cursor: pointer; flex: none;
    }
    .rail-bouton:active { background: var(--surface-attenuee); }
    .rail-bouton span { display: block; height: 2px; background: var(--vert-profond); border-radius: 2px; }
    .rail { width: min(280px, 84vw); }
    .rail-nav a { padding-top: 11px; padding-bottom: 11px; }   /* cibles tactiles */
    .barre-titre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 640px) {
    /* Les grilles passent sur une colonne sans déborder. */
    .grille.deux, .grille.trois, .grille.quatre { grid-template-columns: 1fr; }
    .grille.quatre { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .titre-page { align-items: stretch; }
    .titre-page .actions { width: 100%; }
    .titre-page .actions > .bouton, .titre-page .actions > form { flex: 1 1 auto; }
    .titre-page .actions > form .bouton { width: 100%; }
    .carte { padding: 14px; }
    .tableau { font-size: .82rem; }
    .modale-pied { flex-wrap: wrap; }
    .modale-pied .bouton { flex: 1 1 auto; }
    input, select, textarea { font-size: 16px; }   /* évite le zoom automatique d'iOS */
}

/* Photo d'un agent sur sa fiche. */
.photo-agent { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--jaune); flex: none; }

/* ─── Charte FODA dans le menu ───
   Vert institutionnel #006540 (bandeau du papier à en-tête) ; le logo, dont le mot « FODA »
   est en vert profond, repose sur un bandeau blanc pour rester lisible. */
.rail { background: var(--vert); }
.rail-marque {
    flex-direction: column; align-items: flex-start; gap: 4px;
    background: #fff; color: var(--vert-profond); padding: 14px 16px 10px;
    border-bottom: 3px solid var(--jaune);
}
.rail-marque img { height: auto; width: 100%; max-width: 180px; }
.rail-marque span { font-size: .78rem; font-weight: 700; color: var(--vert); letter-spacing: .04em; text-transform: uppercase; }
.rail-nav a.actif { background: var(--vert-profond); }
.rail-titre { color: rgba(255, 255, 255, .62); }

/* ─── Panneau glissant de détail ─── */
dialog.tiroir {
    margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(760px, 100vw); max-width: 100vw;
    border: 0; border-left: 3px solid var(--jaune); padding: 0; background: var(--fond, #f3f6f4);
    box-shadow: -12px 0 44px rgba(0, 49, 43, .22); display: flex; flex-direction: column;
    animation: tiroir-entree .2s ease;
}
dialog.tiroir:not([open]) { display: none; }
dialog.tiroir::backdrop { background: rgba(0, 49, 43, .35); }
@keyframes tiroir-entree { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.tiroir-tete { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--vert-profond); color: #fff; flex: none; }
.tiroir-tete strong { flex: 1; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiroir-tete .bouton { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.tiroir-corps { flex: 1; overflow-y: auto; padding: 18px 20px 30px; }
.tiroir-corps .titre-page h1 { font-size: 1.25rem; }
@media (max-width: 640px) { dialog.tiroir { width: 100vw; border-left: 0; } .tiroir-corps { padding: 14px; } }

/* ── Visa des bulletins : aperçu dans les paramètres ── */
.apercu-visa {
    width: 260px; max-width: 100%; margin: 0 auto; padding: 12px 10px; text-align: center;
    border: 1px solid var(--filet); border-radius: 8px;
    /* Damier : montre que le fond des images est bien transparent. */
    background-color: #fff;
    background-image: linear-gradient(45deg, #eef1ef 25%, transparent 25%), linear-gradient(-45deg, #eef1ef 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #eef1ef 75%), linear-gradient(-45deg, transparent 75%, #eef1ef 75%);
    background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.apercu-visa .ligne { font-weight: 700; color: var(--vert-profond); font-size: .86rem; }
.apercu-visa .manque { font-weight: 700; color: #c62828; font-size: .84rem; }
/* Comme sur les pièces : signature à gauche, cachet décalé à droite, 30 % de recouvrement
   (la marge du cachet est posée par modales.js d'après la largeur réelle des deux images). */
.apercu-visa .superposition { position: relative; height: 120px; margin: 6px 0; display: flex; align-items: center; justify-content: center; }
.apercu-visa .superposition img { height: 100%; width: auto; max-width: 62%; object-fit: contain; }
.apercu-visa .superposition img.signature { order: 1; height: 78%; position: relative; z-index: 1; }
.apercu-visa .superposition img.cachet { order: 2; }
.apercu-visa .manques { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; }

/* Ligne mise à jour après un enregistrement dans le panneau : bref surlignage. */
@keyframes ligne-rafraichie { from { background: #fff4c2; } to { background: transparent; } }
.ligne-rafraichie > td { animation: ligne-rafraichie 1.6s ease-out; }

/* Aperçu d'un document PDF dans une fenêtre, avant téléchargement ou impression. */
dialog.modale.apercu { width: min(920px, calc(100vw - 24px)); height: min(94vh, 1200px); display: none; flex-direction: column; }
dialog.modale.apercu[open] { display: flex; }
.apercu-cadre { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 12px 22px 8px; min-height: 0; }
.apercu-cadre iframe { flex: 1; width: 100%; min-height: 0; border: 1px solid var(--filet); border-radius: 8px; background: #f3f5f4; }
.apercu-secours { color: #5b6661; font-size: .8rem; margin: 0; }
.apercu-tete { display: flex; align-items: center; gap: 12px; padding: 12px 14px 0 22px; }
.apercu-tete h2 { flex: 1; margin: 0; font-size: 1.05rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apercu-actions { display: flex; gap: 6px; }
.icone-bouton {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
    border: 1px solid var(--filet); border-radius: 9px; background: #fff; color: var(--vert-profond); cursor: pointer;
}
.icone-bouton[hidden] { display: none; }
.icone-bouton:hover { background: #eef3f1; }
.icone-bouton.principal { background: var(--vert); border-color: var(--vert); color: #fff; }
.icone-bouton.principal:hover { background: var(--vert-profond); }
.icone-bouton svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 640px) { .apercu-cadre { padding: 8px; } .apercu-tete { padding-left: 14px; } }

/* ── Actions des fenêtres : icônes en haut à droite (le libellé passe en infobulle) ── */
dialog.modale.actions-en-tete { position: relative; }
dialog.modale.actions-en-tete .modale-tete { padding-right: calc(var(--actions, 2) * 44px + 20px); min-height: 38px; }
dialog.modale.actions-en-tete .modale-pied { position: absolute; top: 12px; right: 14px; padding: 0; border: 0; gap: 6px; }
.icone-bouton[data-icone] { font-size: 0; padding: 0; }
.icone-bouton[data-icone]::before { content: ""; width: 20px; height: 20px; background: currentColor;
    -webkit-mask: var(--icone) center / contain no-repeat; mask: var(--icone) center / contain no-repeat; }
.icone-bouton.danger { background: #c62828; border-color: #c62828; color: #fff; }
.icone-bouton.danger:hover { background: #a31f1f; }
/* Bascule entre deux versions d'un document : le bouton enfoncé est celui affiché. */
.bascule { display: inline-flex; gap: 4px; padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--filet); }
.icone-bouton[aria-pressed="true"] { background: #e3f1ea; border-color: var(--vert); color: var(--vert); }
/* Panneau glissant : en-tête sombre, icônes claires. */
.tiroir-tete .icone-bouton { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.tiroir-tete .icone-bouton:hover { background: rgba(255,255,255,.12); }
[data-icone="fermer"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 6l12 12M18 6 6 18'/></svg>"); }
[data-icone="valider"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7'/></svg>"); }
[data-icone="enregistrer"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 3h11l3 3v15H5zM8 3v6h8M8 21v-7h8v7'/></svg>"); }
[data-icone="supprimer"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3'/></svg>"); }
[data-icone="ajouter"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 5v14M5 12h14'/></svg>"); }
[data-icone="deposer"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 16V4m0 0-5 5m5-5 5 5M4 20h16'/></svg>"); }
[data-icone="publier"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M7 18a4 4 0 0 1-.5-8A6 6 0 0 1 18 9a4 4 0 0 1-1 9M12 12v8m0-8-3 3m3-3 3 3'/></svg>"); }
[data-icone="refuser"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM9 9l6 6M15 9l-6 6'/></svg>"); }
[data-icone="ouvrir"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 7h6l2 2h10v10H3zM12 11.5v5M9.5 14h5'/></svg>"); }
[data-icone="abandonner"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M19 12H5m0 0 6-6m-6 6 6 6'/></svg>"); }
[data-icone="rouvrir"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 12a8 8 0 1 0 2.5-5.8M4 4v5h5'/></svg>"); }
[data-icone="cloturer"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 11h12v10H6zM8 11V7a4 4 0 0 1 8 0v4'/></svg>"); }
[data-icone="envoyer"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 2 11 13M22 2l-7 20-4-9-9-4z'/></svg>"); }
[data-icone="retirer"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM22 11h-6'/></svg>"); }
[data-icone="annuler"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM5.6 5.6l12.8 12.8'/></svg>"); }
[data-icone="terminer"] { --icone: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 21V4h11l-1.5 4L16 12H5'/></svg>"); }
/* La fermeture est toujours la dernière icône, à l'extrême droite. */
dialog.modale.actions-en-tete .modale-pied [data-icone="fermer"] { order: 99; }

/* ── Pastille d'agent : sa photo dans un cercle, ses initiales à défaut ── */
.pastille-profil { overflow: hidden; }
.pastille-profil img, .pastille-agent img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.pastille-agent {
    display: inline-flex; align-items: center; justify-content: center; flex: none; vertical-align: middle;
    border-radius: 50%; overflow: hidden; background: var(--vert-profond); color: var(--jaune);
    font-weight: 700; letter-spacing: .02em; line-height: 1;
}
.pastille-agent.mini { width: 20px; height: 20px; font-size: .52rem; }
.pastille-agent.petite { width: 30px; height: 30px; font-size: .66rem; }
.pastille-agent.moyenne { width: 36px; height: 36px; font-size: .78rem; }
.pastille-agent.grande { width: 52px; height: 52px; font-size: 1.05rem; border: 2px solid var(--jaune); }
.pastille-agent.tres-grande { width: 96px; height: 96px; font-size: 1.8rem; border: 3px solid var(--jaune); }
table.tableau td.avec-pastille, td.avec-pastille { position: relative; padding-left: 52px; }
td.avec-pastille > .pastille-agent { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.bouton .pastille-agent.mini { margin-right: 2px; }
.photo-profil { display: flex; gap: 22px; align-items: center; }
.photo-profil-texte { flex: 1; min-width: 0; }
.photo-profil-texte p { margin: 4px 0 10px; }
.photo-profil-envoi { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@media (max-width: 640px) { .photo-profil { flex-direction: column; align-items: flex-start; } }

/* ── Activité en cours : barre de progression et sablier ── */
:root { --sablier: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 2h12M6 22h12M7 2v4a5 5 0 0 0 10 0V2M7 22v-4a5 5 0 0 1 10 0v4'/></svg>"); }
html.occupe, html.occupe * { cursor: progress !important; }
#barre-activite {
    position: fixed; inset: 0 0 auto 0; width: 100%; height: 3px; margin: 0; padding: 0; border: 0;
    background: transparent; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .25s;
}
#barre-activite.active { opacity: 1; }
#barre-activite > span {
    display: block; height: 100%; width: 0; transition: width .25s ease-out;
    background: linear-gradient(90deg, var(--jaune), var(--vert-clair));
    box-shadow: 0 0 6px rgba(1,147,96,.6);
}
#barre-activite.indetermine > span { width: 35%; animation: activite-glisse 1.1s ease-in-out infinite; }
@keyframes activite-glisse { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* Le bouton cliqué porte un sablier qui se retourne, et ne se reclique pas. */
.occupe-bouton { pointer-events: none; }
.bouton.occupe-bouton::before {
    content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 7px; vertical-align: -2px;
    background: currentColor; -webkit-mask: var(--sablier) center / contain no-repeat; mask: var(--sablier) center / contain no-repeat;
    animation: activite-sablier 1.4s ease-in-out infinite;
}
.icone-bouton.occupe-bouton svg { display: none; }
.icone-bouton.occupe-bouton::before {
    content: ""; width: 20px; height: 20px; background: currentColor;
    -webkit-mask: var(--sablier) center / contain no-repeat; mask: var(--sablier) center / contain no-repeat;
    animation: activite-sablier 1.4s ease-in-out infinite;
}
@keyframes activite-sablier { 0%, 40% { transform: rotate(0); } 60%, 100% { transform: rotate(180deg); } }
@media (prefers-reduced-motion: reduce) {
    #barre-activite.indetermine > span, .occupe-bouton::before { animation: none; }
}

/* ── Infobulle immédiate (remplace la bulle native, trop lente) ── */
.infobulle {
    position: fixed; inset: auto; margin: 0; max-width: 300px; padding: 6px 10px; border: 0; border-radius: 7px;
    background: var(--vert-profond); color: #fff; font-size: .78rem; line-height: 1.35; font-weight: 500;
    box-shadow: 0 6px 20px rgba(0,49,43,.25); pointer-events: none; opacity: 0; transition: opacity .12s;
}
.infobulle.visible { opacity: 1; }

/* Nom et habilitation de l'utilisateur connecté, à gauche de sa pastille. */
.barre-utilisateur { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; cursor: pointer; text-align: right; }
.barre-utilisateur strong { font-size: .86rem; color: var(--vert-profond); white-space: nowrap; }
.barre-utilisateur > span { font-size: .72rem; color: #5b6661; white-space: nowrap; display: flex; max-width: 46vw; }
.barre-utilisateur .barre-fonction { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.barre-utilisateur .barre-sep { padding: 0 5px; flex: none; }
.barre-utilisateur .barre-role { flex: none; }
.barre-utilisateur:hover strong { text-decoration: underline; }
@media (max-width: 640px) { .barre-utilisateur > span { display: none; } .barre-utilisateur strong { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; } }

/* ═══════════════ Habillage de l'interface ═══════════════ */

/* Bas du menu : images et messages d'accueil, l'un après l'autre. */
/* Le bloc est fixé en bas du menu, au-dessus du pied. Le menu passe d'abord : le bloc ne prend
   que la place libre (124 px au plus) et s'efface quand il en reste trop peu. Ne pas l'agrandir :
   les images, larges, sont rognées à gauche et à droite au-delà (essai à 210 px abandonné). */
.rail-nav { flex: 0 1 auto; }
.deco-bas[hidden] + .rail-pied { margin-top: auto; }
.deco-bas {
    position: relative; flex: 1 1 0; min-height: 0; max-height: 124px; margin: auto 12px 10px; border-radius: 10px;
    overflow: hidden; background: rgba(255,255,255,.04); transition: max-height .5s ease, margin .5s ease, opacity .5s;
    container-type: size;
}
@container (max-height: 72px) { .deco-element { display: none; } }
.deco-bas.replie { max-height: 0; margin-bottom: 0; opacity: 0; }
.deco-bas .deco-element { position: absolute; inset: 0; }
.deco-bas img.deco-element { width: 100%; height: 100%; object-fit: cover; }

/* Message d'accueil : une carte qui s'écrit lettre à lettre. */
.deco-message {
    display: flex; align-items: center; justify-content: center; padding: 12px 16px; text-align: center;
    background: linear-gradient(135deg, rgba(252,209,24,.16), rgba(1,147,96,.22));
    color: #fff; font-size: .92rem; font-weight: 600; line-height: 1.35;
}
.deco-message-curseur { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; background: var(--jaune); vertical-align: -2px; animation: curseur 1s steps(1) infinite; }
.deco-message.ecrit .deco-message-curseur { animation-duration: .5s; }
@keyframes curseur { 50% { opacity: 0; } }

/* Barre du haut : icône du lot, météo, heure. */
.deco-haut { position: relative; flex: none; width: 34px; height: 34px; }
.deco-haut .deco-element { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.barre-temps { display: flex; align-items: center; gap: 10px; flex: none; color: var(--vert-profond); font-size: .86rem; font-weight: 600; }
.meteo { display: inline-flex; align-items: center; gap: 4px; }
.meteo svg { width: 22px; height: 22px; }
.horloge { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
@media (max-width: 640px) { .meteo span, .deco-haut { display: none; } }

/* Fond : l'image couvre la zone de lecture ; la barre du haut flotte au-dessus, translucide. */
body.avec-fond { background: var(--fond-image) center / cover fixed no-repeat, var(--fond); }
body.avec-fond .barre-haute {
    background: rgba(255,255,255,.58); border-bottom-color: rgba(0,49,43,.10);
    -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3);
}

/* ── Animations : entrées et sorties feutrées ── */
.entree-simple { animation: deco-fondu .5s ease both; }
.sortie-simple { animation: deco-fondu .5s ease reverse both; }
.entree-fondu-montee { animation: deco-fondu-montee .8s cubic-bezier(.2,.7,.2,1) both; }
.sortie-fuite-haut { animation: deco-fuite-haut .7s ease-in both; }
.entree-zoom-doux { animation: deco-zoom-doux .8s cubic-bezier(.2,.7,.2,1) both; }
.sortie-fuite-zoom { animation: deco-fuite-zoom .7s ease-in both; }
.entree-flou { animation: deco-flou .9s ease-out both; }
.sortie-flou { animation: deco-flou .7s ease-in reverse both; }
.entree-glisse-droite { animation: deco-glisse-droite .8s cubic-bezier(.2,.7,.2,1) both; }
.sortie-fuite-gauche { animation: deco-fuite-gauche .7s ease-in both; }
.entree-bascule { animation: deco-bascule .9s cubic-bezier(.2,.7,.2,1) both; }
.sortie-bascule { animation: deco-bascule-sortie .7s ease-in both; }
.entree-descente { animation: deco-descente .8s cubic-bezier(.2,.7,.2,1) both; }
.sortie-fuite-bas { animation: deco-fuite-bas .7s ease-in both; }
.entree-rideau { animation: deco-rideau .9s cubic-bezier(.2,.7,.2,1) both; }
.sortie-rideau { animation: deco-rideau-sortie .7s ease-in both; }
.entree-rebond { animation: deco-rebond .9s cubic-bezier(.3,1.4,.5,1) both; }
.sortie-tourbillon { animation: deco-tourbillon .7s ease-in both; }
.entree-pivot { animation: deco-pivot .8s cubic-bezier(.2,.7,.2,1) both; }
.sortie-pivot { animation: deco-pivot .6s ease-in reverse both; }
/* Messages d'accueil : leur propre mouvement, une carte qui se pose puis s'envole. */
.entree-message { animation: deco-message-entree .9s cubic-bezier(.3,1.3,.5,1) both; }
.sortie-message { animation: deco-message-sortie .7s ease-in both; }

@keyframes deco-fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes deco-fondu-montee { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes deco-fuite-haut { to { opacity: 0; transform: translateY(-22px); } }
@keyframes deco-zoom-doux { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
@keyframes deco-fuite-zoom { to { opacity: 0; transform: scale(1.12); } }
@keyframes deco-flou { from { opacity: 0; filter: blur(10px); } to { opacity: 1; filter: blur(0); } }
@keyframes deco-glisse-droite { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: none; } }
@keyframes deco-fuite-gauche { to { opacity: 0; transform: translateX(-34px); } }
@keyframes deco-bascule { from { opacity: 0; transform: perspective(500px) rotateX(-70deg); transform-origin: top; } to { opacity: 1; transform: none; } }
@keyframes deco-bascule-sortie { to { opacity: 0; transform: perspective(500px) rotateX(70deg); transform-origin: bottom; } }
@keyframes deco-descente { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: none; } }
@keyframes deco-fuite-bas { to { opacity: 0; transform: translateY(22px); } }
@keyframes deco-rideau { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes deco-rideau-sortie { to { clip-path: inset(0 0 0 100%); opacity: .6; } }
@keyframes deco-rebond { from { opacity: 0; transform: translateY(-16px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes deco-tourbillon { to { opacity: 0; transform: rotate(200deg) scale(.3); } }
@keyframes deco-pivot { from { opacity: 0; transform: rotateY(90deg); } to { opacity: 1; transform: none; } }
@keyframes deco-message-entree { from { opacity: 0; transform: translateY(26px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes deco-message-sortie { to { opacity: 0; transform: translateY(-30px) scale(.96); filter: blur(3px); } }
@media (prefers-reduced-motion: reduce) { .deco-element { animation-duration: .01s !important; } }

/* ── Page Affichage ── */
.encadre-aide { font-size: .88rem; color: #3f4a46; }
.lot-tete { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.lot-tete h2 { margin: 0 0 4px; }
.lot-tete .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lot-tete .actions form { margin: 0; }
.zone-habillage { border-top: 1px solid var(--filet); padding-top: 14px; margin-top: 14px; }
.zone-tete { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.zone-envoi { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.vignettes.icones { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.vignette { margin: 0; border: 1px solid var(--filet); border-radius: 10px; overflow: hidden; background: #fff; }
.vignette.fond-choisi { border-color: var(--vert); box-shadow: 0 0 0 2px rgba(0,101,64,.25); }
.vignette img { display: block; width: 100%; height: 120px; object-fit: contain;
    background-color: #fff; background-image: linear-gradient(45deg, #eef1ef 25%, transparent 25%), linear-gradient(-45deg, #eef1ef 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef1ef 75%), linear-gradient(-45deg, transparent 75%, #eef1ef 75%);
    background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0; }
.vignettes.icones img { height: 80px; }
.vignette figcaption { display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 6px 8px; font-size: .76rem; }
.vignette-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: #5b6661; }
.vignette-actions { display: flex; gap: 4px; flex: none; }
.vignette-actions form { margin: 0; }
textarea.messages-accueil { width: 100%; font-family: inherit; font-size: .9rem; line-height: 1.5; padding: 10px 12px; border: 1px solid var(--filet); border-radius: 8px; resize: vertical; }

/* Décompte d'un événement du calendrier : carte en bas, pastille en haut. */
.deco-decompte {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 14px;
    text-align: center; color: #fff; background: linear-gradient(135deg, rgba(252,209,24,.22), rgba(206,17,38,.28));
}
.deco-decompte-court { font-size: 2.1rem; line-height: 1; font-weight: 900; color: var(--jaune); letter-spacing: .02em; }
.deco-decompte-texte { font-size: .84rem; font-weight: 600; line-height: 1.3; }
.deco-haut-bloc { display: flex; align-items: center; gap: 6px; flex: none; }
.deco-badge {
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; flex: none;
    background: #ce1126; color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .02em; cursor: default;
    animation: deco-badge 2.4s ease-in-out infinite;
}
@keyframes deco-badge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .deco-badge { animation: none; } }
.titre-groupe { margin: 26px 0 8px; font-size: 1.15rem; color: var(--vert-profond); }
.credits { margin-top: 24px; font-size: .78rem; }

/* Petit mot d'un lot : entre guillemets, qui glisse et s'écrit. */
.deco-mot {
    display: flex; align-items: center; justify-content: center; padding: 12px 18px; text-align: center;
    background: linear-gradient(135deg, rgba(1,147,96,.30), rgba(0,49,43,.2)); color: #fff;
    font-size: .92rem; font-style: italic; font-weight: 600; line-height: 1.35;
}
.deco-mot::before, .deco-mot::after { font-size: 1.6rem; color: var(--jaune); font-style: normal; line-height: 0; }
.deco-mot::before { content: "« "; }
.deco-mot::after { content: " »"; }
.entree-mot { animation: deco-mot-entree .8s cubic-bezier(.2,.8,.2,1) both; }
.sortie-mot { animation: deco-mot-sortie .6s ease-in both; }
@keyframes deco-mot-entree { from { opacity: 0; transform: translateX(-28px) skewX(8deg); } to { opacity: 1; transform: none; } }
@keyframes deco-mot-sortie { to { opacity: 0; transform: translateX(28px) skewX(-8deg); } }

/* ── Page Affichage : l'état du lot se lit à sa couleur ── */
.etiquette.succes { background: var(--succes-fond); color: var(--succes); }
.etiquette.attente { background: #fff6d6; color: #8a6400; }
.lot-habillage { border-left: 5px solid transparent; transition: opacity .2s; }
.lot-habillage.etat-affiche {
    border-left-color: var(--vert);
    background: linear-gradient(90deg, #e6f4ec 0%, #fff 45%);
    box-shadow: 0 0 0 1px rgba(0,101,64,.18), 0 6px 18px rgba(0,101,64,.08);
}
.lot-habillage.etat-affiche .etiquette.succes::before {
    content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%;
    background: var(--vert); vertical-align: 1px; animation: pastille-vivante 1.6s ease-in-out infinite;
}
@keyframes pastille-vivante { 0%, 100% { box-shadow: 0 0 0 0 rgba(0,101,64,.5); } 50% { box-shadow: 0 0 0 5px rgba(0,101,64,0); } }
.lot-habillage.etat-attente { border-left-color: var(--jaune); }
.lot-habillage.etat-inactif { border-left-color: #c8cfcc; background: #f6f7f7; }
.lot-habillage.etat-inactif .vignette img { filter: grayscale(.85); opacity: .7; }
.lot-habillage.etat-inactif h2 { color: #7a8581; }
.legende-lots { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 14px; font-size: .86rem; color: #3f4a46; }
.pastille-etat { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 8px; }
.pastille-etat:first-child { margin-left: 0; }
.pastille-etat.etat-affiche { background: var(--vert); }
.pastille-etat.etat-attente { background: var(--jaune); }
.pastille-etat.etat-inactif { background: #c8cfcc; }
@media (prefers-reduced-motion: reduce) { .lot-habillage.etat-affiche .etiquette.succes::before { animation: none; } }

/* Historique des intérims : une liste souple, les actions passent sous l'intérim si la place manque. */
.pile-cartes { display: flex; flex-direction: column; gap: 16px; }
.liste-interims { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.liste-interims li {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px;
    padding: 10px 12px; border: 1px solid var(--filet); border-left: 4px solid #c8cfcc; border-radius: 8px; background: #fff;
}
.liste-interims li.en-cours { border-left-color: var(--vert); background: #f3faf6; }
.interim-infos { flex: 1 1 260px; min-width: 0; }
.interim-dates { font-size: .84rem; color: #3f4a46; margin-top: 2px; }
.interim-note { font-size: .78rem; margin-top: 2px; }
.interim-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.interim-actions form { margin: 0; }

/* ── Calendrier de plage de dates ── */
.calendrier-plage { border: 1px solid var(--filet); border-radius: 10px; padding: 10px 12px 8px; margin-bottom: 12px; background: #fff; user-select: none; }
.cal-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-mois { text-transform: capitalize; color: var(--vert-profond); font-size: .95rem; }
.cal-nav { width: 30px; height: 30px; border: 1px solid var(--filet); border-radius: 8px; background: #fff; cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--vert-profond); }
.cal-nav:hover { background: #eef3f1; }
.cal-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-jsem { text-align: center; font-size: .68rem; font-weight: 700; text-transform: uppercase; color: #7a8581; padding: 2px 0 4px; }
.cal-jour {
    position: relative; height: 34px; border: 0; border-radius: 7px; background: transparent; cursor: pointer;
    font: inherit; font-size: .84rem; color: var(--encre, #1d2a26);
}
.cal-jour:hover { background: #e9f3ee; }
.cal-jour.weekend { color: #9aa4a0; background: #f5f6f6; }
.cal-jour.ferie { color: #b3261e; font-weight: 700; background: #fdecea; }
.cal-jour.ferie::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #d32f2f; }
.cal-jour.occupe { box-shadow: inset 0 -3px 0 #f0a020; }
.cal-jour.aujourdhui { outline: 2px solid var(--jaune); outline-offset: -2px; }
.cal-jour.dans-plage { background: #d7ede1; color: var(--vert-profond); border-radius: 0; }
.cal-jour.borne { background: var(--vert); color: #fff; font-weight: 700; }
.cal-jour.borne-debut { border-radius: 7px 0 0 7px; }
.cal-jour.borne-fin { border-radius: 0 7px 7px 0; }
.cal-jour.borne-debut.borne-fin { border-radius: 7px; }
.cal-bilan { margin-top: 8px; font-size: .84rem; color: #3f4a46; }
.cal-legende { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; font-size: .72rem; color: #7a8581; }
.cal-l { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-left: 6px; }
.cal-l:first-child { margin-left: 0; }
.cal-l.choisi { background: var(--vert); }
.cal-l.ferie { background: #fdecea; border: 1px solid #d32f2f; }
.cal-l.weekend { background: #f5f6f6; border: 1px solid #dfe3e1; }
.cal-l.occupe { background: #fff; box-shadow: inset 0 -3px 0 #f0a020; border: 1px solid #dfe3e1; }
.cal-jour:disabled { opacity: .35; cursor: not-allowed; }
.cal-jour.ferie.borne { color: #fff; }

/* ── Sélecteur de date (selecteur-date.js) : le calendrier ci-dessus, en fenêtre sous le champ ── */
input[type=date]:not([data-sans-selecteur])::-webkit-calendar-picker-indicator { display: none; }
input[type=date]:not([data-sans-selecteur]) {
    cursor: pointer; padding-right: 32px;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23006540' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M16 3v4M8 3v4M3 11h18'/></svg>") no-repeat right 9px center / 16px;
}
.champ-date { position: relative; display: inline-block; max-width: 100%; }
.champ-date.pleine-largeur { display: block; width: 100%; }
.champ-date > input[type=date].avec-jour { padding-left: 84px; }
.champ-date.pleine-largeur > input[type=date] { width: 100%; }
.champ-date-jour {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none;
    font-size: .84rem; font-weight: 600; color: var(--vert); text-transform: none;
}
.champ-date-jour.weekend { color: #7a8581; }
.champ-date-jour.ferie { color: #b3261e; }
.selecteur-date {
    position: fixed; z-index: 1000; width: 300px; max-width: calc(100vw - 16px);
    border: 1px solid var(--filet); border-radius: 10px; padding: 10px 12px 8px; background: #fff;
    box-shadow: 0 10px 30px rgba(0, 49, 43, .18); user-select: none;
}
.selecteur-date .cal-jour { height: 32px; }
.selecteur-actions { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--filet); }
.selecteur-actions button { border: 0; background: none; padding: 4px 2px; font: inherit; font-size: .84rem; font-weight: 600; color: var(--vert); cursor: pointer; }
.selecteur-actions button:only-child { margin-left: auto; }
.selecteur-actions button:hover { text-decoration: underline; }

/* Fenêtres « Congés » et « Cumul salarial » : chiffres serrés, tableau qui défile s'il déborde. */
.grille.chiffres-compacts { margin-bottom: 8px; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.chiffres-compacts .chiffre { padding: 10px 12px; }
.chiffres-compacts .chiffre .valeur { font-size: 1.15rem; }
.defilement-horizontal { overflow-x: auto; }

/* Menu : Accueil et Tableau de bord en tête, hors des groupes, séparés d'eux par un filet. */
.rail-tete { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, .12); }

/* Menu : groupes repliables (titre cliquable, chevron qui pivote). */
details.rail-section > summary.rail-titre { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; border-radius: 6px; user-select: none; }
details.rail-section > summary.rail-titre::-webkit-details-marker { display: none; }
details.rail-section > summary.rail-titre:hover { color: #fff; }
details.rail-section > summary.rail-titre::after {
    content: ""; width: 7px; height: 7px; margin-right: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); transition: transform .2s ease; opacity: .8;
}
details.rail-section:not([open]) > summary.rail-titre::after { transform: rotate(-45deg); }
details.rail-section:not([open]) { margin-bottom: 8px; }
details.rail-section[open] > a { animation: rail-deplie .18s ease-out both; }
@keyframes rail-deplie { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { details.rail-section[open] > a { animation: none; } details.rail-section > summary.rail-titre::after { transition: none; } }

/* Prime de fête : une étiquette par fête versée, retirable. */
.fetes-versees { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.etiquette-fete {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px;
    background: var(--vert-profond); color: #fff; font-weight: 600; font-size: .86rem;
}
.etiquette-fete form { margin: 0; display: inline; }
.retirer-fete {
    border: 0; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; line-height: 1;
    background: rgba(255,255,255,.18); color: #fff; font-size: 1rem;
}
.retirer-fete:hover { background: var(--jaune); color: var(--vert-profond); }

/* ─── Détail d'une ligne de liste : bouton « Voir », petite fenêtre (modales.js) ─── */
/* Colonne d'action en fin de ligne : les boutons ne se replient pas. */
table.tableau td.actions-ligne { text-align: right; white-space: nowrap; width: 1%; }
table.tableau td.actions-ligne > * + * { margin-left: 4px; }
/* Dans le flux (et non en absolu) : un texte masqué en absolu échappe au défilement du tableau et élargit la page. */
.lecteur-seul { display: inline-block; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; vertical-align: top; }

/* Plus étroite que les autres fenêtres : on y lit, on n'y saisit pas. */
dialog.modale.detail { width: min(500px, calc(100vw - 24px)); max-height: min(86vh, 760px); display: none; flex-direction: column; }
dialog.modale.detail[open] { display: flex; animation: detail-entree .16s ease-out; }
@keyframes detail-entree { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
dialog.modale.detail .modale-tete { flex: none; }  /* le corps défile, la tête ne se tasse jamais */
dialog.modale.detail .modale-tete h2 { overflow-wrap: anywhere; }
dialog.modale.detail .detail-corps { overflow-y: auto; min-height: 0; flex: 1; padding-top: 12px; font-size: .88rem; }

/* Fiche d'un élément : libellé à gauche, valeur à droite. */
.detail-fiche { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 7px 14px; margin: 0; }
.detail-fiche dt { color: var(--encre-attenuee); font-size: .8rem; padding-top: 1px; }
.detail-fiche dd { margin: 0; color: var(--encre); overflow-wrap: anywhere; }
.detail-fiche dd.nombre { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.detail-fiche .separateur { grid-column: 1 / -1; border-top: 1px solid var(--filet); margin: 3px 0; }
.detail-fiche dt.fort, .detail-fiche dd.fort { font-weight: 700; color: var(--vert-profond); font-size: .9rem; }
.detail-section { margin: 16px 0 8px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--vert); }
.detail-section:first-child { margin-top: 0; }

/* Éléments d'un agrégat : une carte par élément, lisible sur un téléphone. */
.detail-resume { margin: 0 0 10px; color: var(--encre-attenuee); }
.detail-elements { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.detail-elements > li { border: 1px solid var(--filet); border-radius: var(--rayon); padding: 8px 10px; }
.detail-elements > li.attente { border-left: 3px solid var(--attention); }
.detail-elements > li.validee { border-left: 3px solid var(--succes); }
.detail-element-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.detail-element-tete strong { overflow-wrap: anywhere; }
.detail-element-infos { color: var(--encre-attenuee); font-size: .8rem; margin-top: 2px; }
.detail-vide { margin: 0; color: var(--encre-attenuee); }

@media (max-width: 480px) {
    dialog.modale.detail .modale-tete { padding: 14px 16px 0; }
    dialog.modale.detail .detail-corps { padding: 12px 16px 16px; }
    .detail-fiche { grid-template-columns: 1fr 1.3fr; gap: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
    dialog.modale.detail[open] { animation: none; }
}
/* Liste à puces dont chaque élément porte son bouton « Voir ». */
.liste-avec-actions { list-style: none; margin: 0; padding: 0; }
.liste-avec-actions > li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--filet); }
.liste-avec-actions > li:first-child { border-top: 0; }

/* ─────────────── Cumul de l'année (page d'une période) ─────────────── */

.titre-bloc-chiffres { font-size: .95rem; margin: 4px 0 10px; }
.cumul-annee { margin: -4px 0 20px; padding: 14px 16px 6px; border: 1px dashed var(--filet); border-radius: 12px; background: var(--surface-attenuee); }
.cumul-entete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 10px; }
.cumul-entete h2 { font-size: .95rem; margin: 0; }
.cumul-entete .aide { margin: 0; font-size: .78rem; }

.agents-manquants > summary { cursor: pointer; font-size: .88rem; }
.agents-manquants[open] > summary { margin-bottom: 12px; }

/* ─────────────── Onglets ─────────────── */

.onglets-barre {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    border-bottom: 1px solid var(--filet);
    margin-bottom: 18px;
    scrollbar-width: thin;
}

.onglets-barre [role="tab"] {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    color: var(--encre-attenuee);
    font: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: -1px;
}

.onglets-barre [role="tab"]:hover { color: var(--encre); }
.onglets-barre [role="tab"][aria-selected="true"] { color: var(--vert-profond); border-bottom-color: var(--vert); }
.onglets-barre [role="tab"]:focus-visible { outline: 2px solid var(--vert); outline-offset: -2px; border-radius: 4px; }

.onglets-barre .compteur {
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface-attenuee);
    color: var(--encre);
    font-size: .74rem;
    text-align: center;
}

[data-panneau][hidden] { display: none; }

/* Courbes : trait de 2 px, point cerclé de fond, zone de survol plus large que la marque. */
.toile .trace { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.toile .point .cible { fill: transparent; }
.toile .point .marque { stroke: var(--surface); stroke-width: 2; }
.toile.courbes:hover path, .toile.courbes:hover rect { opacity: 1; }
.toile .point:hover .marque { r: 6; }

[data-montrer-si][hidden] { display: none; }

/* Choix de la cible d'une période : trois cartes à cocher. */
.choix-cible { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 8px; margin-bottom: 14px; border: 0; padding: 0; }
.choix-cible legend { font-size: .8rem; font-weight: 600; margin-bottom: 6px; padding: 0; }
.choix-cible label { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--filet); border-radius: 8px; cursor: pointer; background: var(--surface); }
.choix-cible label:has(input:checked) { border-color: var(--vert); box-shadow: 0 0 0 1px var(--vert) inset; background: var(--surface-attenuee); }
.choix-cible input { margin-top: 3px; accent-color: var(--vert); }
.choix-cible strong { display: block; font-size: .88rem; }
.choix-cible small { display: block; color: var(--encre-attenuee); font-size: .74rem; line-height: 1.35; margin-top: 2px; }

/* Filtre des cibles au tableau de bord. */
.filtre-cibles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 14px; margin-bottom: 14px; }
.filtre-cibles .libelle-filtre { font-size: .8rem; font-weight: 600; color: var(--encre-attenuee); }
.filtre-cibles label { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; cursor: pointer; }
.filtre-cibles input { accent-color: var(--vert); width: 16px; height: 16px; }

/* Fêtes d'une période : origine, libellé affiché au bulletin, retrait des seules fêtes ajoutées. */
.liste-fetes { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }
.fete-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border: 1px solid var(--filet); border-radius: 8px; background: var(--surface); }
.fete-origine { min-width: 150px; }
.fete-bulletin { flex: 1 1 240px; }

/* ── Départs ───────────────────────────────────────────────────────────── */
/* Cas particuliers de la fenêtre de départ : repliés tant qu'ils ne servent pas. */
details.champ-replie { border: 1px solid var(--filet); border-radius: var(--rayon); padding: 8px 12px; margin: 12px 0; background: var(--surface); }
details.champ-replie > summary { cursor: pointer; font-weight: 600; color: var(--vert); }
details.champ-replie[open] > summary { margin-bottom: 10px; }
/* Montant proratisé par le départ : lisible, mais signalé comme non modifiable ici. */
input[readonly] { background: var(--surface-attenuee); color: var(--encre-attenuee); cursor: not-allowed; }
.tableau input[type="text"], .tableau input[type="number"], .tableau select { width: 100%; min-width: 90px; }

/* ── Base documentaire ─────────────────────────────────────────────────── */
/* Référence juridique d'un paramètre, en filigrane sous le champ. */
.reference-legale { margin-top: 3px; font-size: .74rem; line-height: 1.35; color: var(--encre-attenuee); opacity: .85; }
.reference-legale a { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }
.reference-legale a:hover, .reference-legale a:focus-visible { color: var(--vert); opacity: 1; }
.reference-legale span { font-style: italic; }
.filtres-themes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.filtres-themes a { padding: 4px 10px; border: 1px solid var(--filet); border-radius: 999px; font-size: .8rem; text-decoration: none; color: var(--encre); background: var(--surface); }
.filtres-themes a[aria-current="true"] { border-color: var(--vert); background: var(--surface-attenuee); color: var(--vert); font-weight: 600; }

/* Courriers du départ : un bouton par courrier, son usage à côté. */
.liste-pieces { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.liste-pieces li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.liste-pieces .sourdine { font-size: .82rem; }

/* ─────────────── Instances de la Direction générale ─────────────── */

.sourdine { color: var(--encre-attenuee); }
.bouton svg.icone { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bouton.jaune { background: var(--jaune); border-color: var(--jaune); color: var(--vert-profond); }
.bouton.jaune:hover { background: #ffe066; }
.bouton.clair { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); color: #fff; }
.bouton.clair:hover { background: rgba(255,255,255,.2); }
.titre-bloc { margin: 0 0 12px; font-size: 1rem; }
.rail-section-dg > summary.rail-titre { color: var(--jaune); }

/* Couleurs des statuts : une par statut du classeur, partout (étiquettes, colonnes, frise). */
.statut-en-attente { --statut: #B45309; --statut-fond: #FFFAEB; }
.statut-en-cours   { --statut: #1D4E89; --statut-fond: #E8F1FD; }
.statut-fait       { --statut: #05713C; --statut-fond: #ECFDF3; }
.statut-pas-fait   { --statut: #B42318; --statut-fond: #FEF3F2; }
.etiquette[class*="statut-"] { background: var(--statut-fond); color: var(--statut); }

/* Jauge d'avancement */
.jauge { height: 6px; border-radius: 99px; background: var(--surface-attenuee); overflow: hidden; }
.jauge > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--vert-clair), var(--vert)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.jauge.grande { height: 10px; margin-bottom: 14px; }

/* Anneau de progression (conic-gradient, sans script) */
.anneau {
    --taille: 76px; --p: 0;
    width: var(--taille); height: var(--taille); flex: none; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--vert) calc(var(--p) * 1%), var(--surface-attenuee) 0);
    position: relative;
}
.anneau::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.anneau > span { position: relative; font-weight: 800; font-size: 1.2rem; color: var(--vert-profond); line-height: 1; text-align: center; }
.anneau small { font-size: .6em; font-weight: 700; }
.anneau em { display: block; font-style: normal; font-size: .62rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--encre-attenuee); margin-top: 3px; }
.anneau.grand { --taille: 148px; background: conic-gradient(var(--jaune) calc(var(--p) * 1%), rgba(255,255,255,.14) 0); }
.anneau.grand::before { inset: 14px; background: var(--vert-profond); }
.anneau.grand > span { font-size: 2.4rem; color: #fff; }
.anneau.grand em { color: rgba(255,255,255,.7); }

/* Compte à rebours de l'échéance */
.rebours { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .7rem; font-weight: 700; white-space: nowrap; background: var(--surface-attenuee); color: var(--encre-attenuee); }
.rebours.loin { background: #EEF3F1; color: var(--vert); }
.rebours.proche { background: #FFF6D6; color: #8A6400; }
.rebours.urgent { background: #FFE2C7; color: #9A3412; }
.rebours.retard { background: var(--alerte); color: #fff; animation: rebours-pouls 1.8s ease-in-out infinite; }
.rebours.fait { background: var(--succes-fond); color: var(--succes); }
.rebours.grand { font-size: .78rem; padding: 4px 10px; min-width: 88px; text-align: center; }
@keyframes rebours-pouls { 0%, 100% { box-shadow: 0 0 0 0 rgba(180,35,24,.45); } 50% { box-shadow: 0 0 0 5px rgba(180,35,24,0); } }

.drapeau-priorite { display: inline-flex; align-items: center; gap: 3px; font-size: .7rem; font-weight: 700; color: #9A3412; }
.drapeau-priorite svg { width: 13px; height: 13px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.drapeau-priorite.petit { margin-left: 6px; padding: 1px 6px; border-radius: 99px; background: #FFE2C7; }

/* ── Vue d'ensemble ── */
.accueil-instances {
    display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
    padding: 26px 28px; margin-bottom: 18px; border-radius: 14px; color: #fff;
    background:
        radial-gradient(circle at 92% 12%, rgba(252,209,24,.22) 0, transparent 38%),
        radial-gradient(circle at 8% 110%, rgba(1,147,96,.55) 0, transparent 45%),
        linear-gradient(135deg, var(--vert-profond), var(--vert));
    box-shadow: 0 10px 30px rgba(0,49,43,.18);
    animation: accueil-entree .5s cubic-bezier(.2,.8,.2,1);
}
.accueil-instances h1 { margin: 2px 0 6px; font-size: 1.8rem; color: #fff; }
.accueil-date { margin: 0; text-transform: capitalize; font-size: .8rem; letter-spacing: .04em; color: rgba(255,255,255,.7); }
.accueil-humeur { margin: 0 0 16px; max-width: 62ch; color: rgba(255,255,255,.9); }
.accueil-instances .actions { display: flex; gap: 8px; flex-wrap: wrap; }
@keyframes accueil-entree { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.tuiles-instances { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tuile {
    display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px; text-decoration: none;
    background: var(--surface); border: 1px solid var(--filet); border-top: 4px solid var(--statut, var(--vert-profond));
    color: var(--encre); transition: transform .15s ease, box-shadow .15s ease;
}
.tuile:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,49,43,.1); }
.tuile-libelle { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--encre-attenuee); font-weight: 600; }
.tuile-valeur { font-size: 2rem; font-weight: 800; color: var(--statut, var(--vert-profond)); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tuile-detail { font-size: .76rem; color: var(--encre-attenuee); }
.tuile.alerte { --statut: var(--alerte); background: var(--alerte-fond); }
.tuile.calme { --statut: var(--succes); }

.radar { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.radar li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--fond); }
.radar-texte { flex: 1; min-width: 0; display: grid; gap: 3px; }
.radar-texte strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radar-calme { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 10px; background: var(--succes-fond); color: var(--succes); }
.radar-calme svg { width: 32px; height: 32px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.radar-calme p { margin: 0; }

.porteurs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.porteurs li { display: grid; grid-template-columns: minmax(0, 11rem) 1fr auto auto; align-items: center; gap: 10px; font-size: .86rem; }
.porteurs .avec-pastille { display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.porteurs-barre { display: flex; height: 12px; border-radius: 99px; background: var(--surface-attenuee); overflow: hidden; }
.porteurs-barre .ouvertes, .legende-porteurs .ouvertes { background: #1D4E89; }
.porteurs-barre .faites, .legende-porteurs .faites { background: var(--vert-clair); }
.porteurs-compte { font-weight: 700; font-variant-numeric: tabular-nums; }
.porteurs-compte small { font-weight: 500; color: var(--encre-attenuee); }
.legende-porteurs { margin: 10px 0 0; font-size: .74rem; color: var(--encre-attenuee); }
.legende-porteurs span { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 10px; vertical-align: -1px; }

/* ── Fil d'une instance ── */
.fil-instance { list-style: none; margin: 14px 0 0; padding: 0; position: relative; }
.fil-instance::before { content: ""; position: absolute; left: 15px; top: 4px; bottom: 4px; width: 2px; background: var(--filet); }
.fil-instance li { position: relative; display: flex; gap: 12px; padding: 6px 0; }
.fil-instance p { margin: 4px 0 0; font-size: .88rem; }
.fil-icone { position: relative; z-index: 1; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--filet); color: var(--encre-attenuee); }
.fil-icone svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fil-creation .fil-icone, .fil-import .fil-icone { border-color: var(--vert); color: var(--vert); }
.fil-etape .fil-icone { border-color: var(--vert-clair); color: #fff; background: var(--vert-clair); }
.fil-statut .fil-icone { border-color: #1D4E89; color: #1D4E89; }
.fil-echeance .fil-icone, .fil-priorite .fil-icone { border-color: #B45309; color: #B45309; }
.fil-note .fil-icone { border-color: var(--jaune); background: #FFF6D6; color: #8A6400; }
.fil-instance.compact li { padding: 4px 0; }
.fil-instance.compact p { font-size: .84rem; }

/* ── Tableau en colonnes ── */
.filtres-instances { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filtres-instances .champ { margin: 0; min-width: 150px; }
.filtres-instances .champ.recherche { flex: 1 1 260px; }
.champ input[type=search] { width: 100%; padding: 8px 10px; border: 1px solid var(--filet); border-radius: 6px; font: inherit; background: var(--surface); }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.kanban-colonne { background: var(--surface-attenuee); border-radius: 12px; padding: 10px; border-top: 4px solid var(--statut); transition: background .15s, box-shadow .15s; min-height: 160px; }
.kanban-colonne.survolee { background: var(--statut-fond); box-shadow: inset 0 0 0 2px var(--statut); }
.kanban-tete { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; font-size: .9rem; }
.kanban-point { width: 10px; height: 10px; border-radius: 50%; background: var(--statut); }
.kanban-compte { margin-left: auto; min-width: 26px; padding: 1px 8px; border-radius: 99px; background: var(--surface); color: var(--statut); font-weight: 800; font-size: .8rem; text-align: center; }
.kanban-cartes { display: grid; gap: 10px; }
.kanban-vide { display: none; margin: 0; padding: 18px 8px; border: 2px dashed var(--filet); border-radius: 10px; text-align: center; font-size: .78rem; color: var(--encre-attenuee); }
.kanban-colonne.sans-carte .kanban-vide { display: block; }

.carte-instance {
    background: var(--surface); border: 1px solid var(--filet); border-radius: 10px; padding: 12px; cursor: grab;
    box-shadow: 0 1px 2px rgba(0,49,43,.06); display: grid; gap: 8px; transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
    border-left: 4px solid transparent;
}
.carte-instance:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,49,43,.1); }
.carte-instance:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }
.carte-instance.en-main { opacity: .45; transform: rotate(2deg); }
.carte-instance.en-vol { opacity: .7; }
.carte-instance.priorite-haute { border-left-color: #F59E0B; }
.carte-instance.priorite-urgente { border-left-color: var(--alerte); }
.carte-instance.en-retard { background: linear-gradient(180deg, #FFF5F4, var(--surface) 60%); }
.carte-instance-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.carte-instance-titre { margin: 0; font-size: .92rem; line-height: 1.35; color: var(--vert-profond); }
.carte-instance-structure { margin: -4px 0 0; font-size: .76rem; color: var(--encre-attenuee); }
.carte-instance-pied { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .78rem; }
.carte-instance-pied .avec-pastille { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.carte-instance-chiffres { display: flex; align-items: center; gap: 8px; color: var(--encre-attenuee); font-weight: 700; }

/* ── Fiche ── */
.fiche-instance-tete { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.fiche-instance-titre h1 { margin: 0 0 4px; font-size: 1.3rem; color: var(--vert-profond); }
.fiche-instance-titre p { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fiche-instance-titre .avec-pastille { gap: 8px; }
.statuts-rapides { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

.pilule {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; cursor: pointer;
    border: 1.5px solid var(--statut, var(--filet)); background: var(--surface); color: var(--statut, var(--encre));
    font: inherit; font-size: .82rem; font-weight: 700; transition: background .15s, color .15s, transform .1s;
}
.pilule:hover { background: var(--statut-fond, var(--surface-attenuee)); }
.pilule:active { transform: scale(.97); }
.pilule.choisie, .pilule:has(input:checked) { background: var(--statut, var(--vert)); color: #fff; }
.pilule input { position: absolute; opacity: 0; pointer-events: none; }
.pilule:has(input:focus-visible) { outline: 3px solid var(--jaune); outline-offset: 2px; }
.pilule.priorite-normale { --statut: var(--vert); --statut-fond: #EEF3F1; }
.pilule.priorite-haute { --statut: #B45309; --statut-fond: #FFFAEB; }
.pilule.priorite-urgente { --statut: var(--alerte); --statut-fond: var(--alerte-fond); }
.choix-pilules { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.choix-pilules legend { font-size: .78rem; font-weight: 600; color: var(--encre-attenuee); margin-bottom: 6px; padding: 0; }

.etapes { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.etapes li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; transition: background .2s; }
.etapes li:hover { background: var(--fond); }
.etapes form { margin: 0; display: flex; }
.etape-libelle { flex: 1; font-size: .9rem; display: grid; }
.etapes li.faite .etape-libelle { color: var(--encre-attenuee); text-decoration: line-through; text-decoration-color: rgba(0,101,64,.5); }
.etapes button.case {
    width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--vert); background: var(--surface);
    display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent; transition: background .15s, transform .15s;
}
.etapes button.case svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.etapes button.case:hover { transform: scale(1.1); }
.etapes li.faite button.case { background: var(--vert); color: #fff; animation: case-cochee .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes case-cochee { from { transform: scale(.6); } to { transform: scale(1); } }
.icone-bouton.discret { border-color: transparent; background: transparent; opacity: .45; width: 30px; height: 30px; }
.icone-bouton.discret:hover { opacity: 1; background: var(--alerte-fond); color: var(--alerte); }
.icone-bouton.discret svg { width: 16px; height: 16px; }
.ajout-etape { display: flex; gap: 8px; }
.ajout-etape input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--filet); border-radius: 6px; font: inherit; }
.pied-formulaire { display: flex; justify-content: flex-end; }
.zone-suppression { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .8rem; margin-bottom: 18px; }

/* ── Échéancier ── */
.frise-carte { overflow-x: auto; }
.frise { position: relative; min-width: 720px; padding-top: 34px; padding-bottom: 22px; }
.frise-mois { position: absolute; inset: 0 0 auto 0; height: 100%; pointer-events: none; }
.frise-mois span {
    position: absolute; top: 0; bottom: 0; padding: 4px 8px; font-size: .74rem; font-weight: 700; text-transform: capitalize;
    color: var(--encre-attenuee); border-left: 1px dashed var(--filet);
}
.frise-aujourdhui { position: absolute; top: 24px; bottom: 20px; left: var(--maintenant); width: 2px; background: var(--jaune); box-shadow: 0 0 0 1px rgba(0,49,43,.1); z-index: 2; }
.frise-aujourdhui::before { content: "Aujourd'hui"; position: absolute; bottom: -4px; left: 50%; transform: translate(-50%, 100%); font-size: .64rem; font-weight: 800; color: #8A6400; background: #FFF6D6; padding: 1px 6px; border-radius: 99px; white-space: nowrap; }
.frise-lignes { list-style: none; margin: 0; padding: 8px 0; position: relative; z-index: 1; display: grid; gap: 8px; }
.frise-lignes li { position: relative; height: 30px; }
.frise-barre {
    position: absolute; top: 0; height: 30px; border-radius: 8px; overflow: hidden; text-decoration: none;
    background: var(--statut-fond); border: 1.5px solid var(--statut); color: var(--statut);
    display: flex; align-items: center; transition: transform .15s, box-shadow .15s;
}
.frise-barre::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--avancement); background: var(--statut); opacity: .18; }
.frise-barre:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,49,43,.14); z-index: 3; }
.frise-barre.en-retard { border-color: var(--alerte); background: repeating-linear-gradient(135deg, var(--alerte-fond) 0 8px, #fff 8px 16px); color: var(--alerte); }
.frise-barre.coupee-debut { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dashed; }
.frise-barre.coupee-fin { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-style: dashed; }
.frise-texte { position: relative; padding: 0 8px; font-size: .76rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legende-frise { margin: 12px 0 0; font-size: .74rem; color: var(--encre-attenuee); }
.legende-frise span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin: 0 4px 0 12px; vertical-align: -2px; background: var(--statut-fond); border: 1.5px solid var(--statut); }
.legende-frise span.en-retard { background: repeating-linear-gradient(135deg, var(--alerte-fond) 0 3px, #fff 3px 6px); border: 1.5px solid var(--alerte); }
.frise-barre.etroite { overflow: visible; }
.frise-barre.etroite .frise-texte { position: absolute; left: calc(100% + 6px); padding: 0; color: var(--encre); }
.liste-sans-dates { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.liste-sans-dates li { display: flex; align-items: center; gap: 10px; }
.liste-sans-dates li > span:nth-child(2) { flex: 1; }

.zone-depot-classeur { display: grid; place-items: center; gap: 8px; padding: 26px; border: 2px dashed var(--filet); border-radius: 12px; background: var(--fond); cursor: pointer; text-align: center; }
.zone-depot-classeur:hover { border-color: var(--vert); }
.zone-depot-classeur span { font-size: .8rem; color: var(--encre-attenuee); }

.confettis { position: fixed; inset: 0; pointer-events: none; z-index: 1000; }

@media (max-width: 1100px) { .tuiles-instances { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
    .tuiles-instances { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .accueil-instances { padding: 20px; }
    .accueil-instances h1 { font-size: 1.45rem; }
    .anneau.grand { --taille: 112px; }
    .anneau.grand > span { font-size: 1.8rem; }
    .kanban { grid-template-columns: repeat(4, minmax(240px, 80vw)); scroll-snap-type: x mandatory; }
    .kanban-colonne { scroll-snap-align: start; }
    .porteurs li { grid-template-columns: minmax(0, 1fr) 70px auto auto; }
    .ajout-etape { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    .accueil-instances, .rebours.retard, .etapes li.faite button.case { animation: none; }
    .tuile, .carte-instance, .frise-barre { transition: none; }
}
.pastille-agent.vide-porteur { background: var(--surface-attenuee); color: var(--encre-attenuee); }
.raccourci-instances { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; text-decoration: none; color: var(--encre); border-left: 5px solid var(--jaune); transition: transform .15s, box-shadow .15s; }
.raccourci-instances:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,49,43,.1); }
.raccourci-instances > div:first-child { flex: 1 1 280px; }
.raccourci-instances h2 { margin-bottom: 4px; }
.raccourci-instances p { margin: 0; color: var(--encre-attenuee); font-size: .88rem; }
.raccourci-chiffres { display: flex; gap: 16px; font-size: .8rem; color: var(--encre-attenuee); }
.raccourci-chiffres strong { display: block; font-size: 1.4rem; color: var(--vert-profond); }
.raccourci-chiffres .alerte strong { color: var(--alerte); }

/* ─────────────── Comptes hors annuaire ─────────────── */

.porte-locale { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--filet); text-align: left; }
.porte-locale > summary { cursor: pointer; font-weight: 600; color: var(--vert); list-style: none; text-align: center; }
.porte-locale > summary::-webkit-details-marker { display: none; }
.porte-locale > summary::after { content: " ›"; }
.porte-locale[open] > summary::after { content: " ⌄"; }
.porte-locale .aide { font-size: .78rem; color: var(--encre-attenuee); }
.champ input[type=password] { width: 100%; padding: 8px 10px; border: 1px solid var(--filet); border-radius: 6px; font: inherit; background: var(--surface); }

/* Consultation seule : les formulaires restent lisibles, champs grisés (formulaires.js), mais
   leurs boutons d'action disparaissent ; le serveur refuse de toute façon tout envoi. */
body.lecture-seule form[method="post"]:not(.toujours) :is(button, input[type="submit"], .zone-envoi),
body.lecture-seule form[method="POST"]:not(.toujours) :is(button, input[type="submit"], .zone-envoi),
body.lecture-seule [data-ouvrir]:not(.toujours),
body.lecture-seule .action-ecriture,
/* … ni aucun téléchargement ou aperçu de document (le serveur les refuse aussi). */
body.lecture-seule a[download], body.lecture-seule [data-apercu], body.lecture-seule [data-telecharger],
body.lecture-seule a:is([href*="handler=Bulletin"], [href*="handler=Livre"], [href*="handler=Archive"],
    [href*="handler=EtatSalaire"], [href*="handler=EtatVersement"], [href*="handler=EtatCarburant"],
    [href*="handler=LettreCarburant"], [href*="handler=Tableur"], [href*="handler=Document"],
    [href*="handler=Piece"], [href*="handler=Pdf"], [href*="handler=Fichier"], [href*="handler=Registre"],
    [href*="handler=Recu"], [href*="handler=Certificat"], [href*="handler=Exporter"]) { display: none !important; }
.bandeau-lecture-seule { margin: 0 0 14px; padding: 8px 12px; border-radius: 8px; background: #EEF3F1; color: var(--vert-profond); font-size: .82rem; }

.habilitations-choix { display: grid; gap: 8px; }
.habilitations-choix label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--filet); border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--encre); font-size: .88rem; }
.habilitations-choix label:has(input:checked) { border-color: var(--vert); background: #F1F8F4; }
.habilitations-choix small { display: block; color: var(--encre-attenuee); font-weight: 400; }
.lien-a-copier { width: 100%; font-family: ui-monospace, monospace; font-size: .8rem; padding: 8px; border: 1px dashed var(--vert); border-radius: 6px; background: #F1F8F4; }

/* ─────────────── Planning de l'effectif (diagramme de Gantt) ─────────────── */

.planning { --c0: #2E7D5B; --c1: #1D4E89; --c2: #B45309; --c3: #7C3AED; --c4: #B42318; --c5: #0E7490; --c6: #A16207; --c7: #BE185D; padding-bottom: 12px; }
.planning-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.planning-tete .titre-bloc { margin-bottom: 2px; }
.planning-periode { text-transform: capitalize; }
.planning-tete p { margin: 0; font-size: .8rem; }
.planning-commandes { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.planning-nav { display: flex; gap: 4px; align-items: center; }
.planning-nav .icone-bouton { width: 32px; height: 32px; }
.bascule-segments { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--surface-attenuee); }
.bascule-segments a { padding: 5px 12px; border-radius: 99px; font-size: .8rem; font-weight: 700; color: var(--encre-attenuee); text-decoration: none; }
.bascule-segments a.choisi { background: var(--vert); color: #fff; box-shadow: var(--ombre); }

.planning-defile { overflow-x: auto; border: 1px solid var(--filet); border-radius: 10px; }
.planning-grille { --nom: 210px; position: relative; min-width: calc(var(--nom) + var(--n) * 24px); }
.planning-grille.par-mois { min-width: calc(var(--nom) + var(--n) * 60px); }
.planning-rangee { display: grid; grid-template-columns: var(--nom) 1fr; border-bottom: 1px solid var(--filet); }
.planning-rangee:last-of-type { border-bottom: 0; }
.planning-rangee:not(.planning-entete):not(.planning-pied):hover { background: #F7FAF9; }
.planning-nom { position: sticky; left: 0; z-index: 3; display: flex; align-items: center; gap: 7px; padding: 4px 10px; background: var(--surface); border-right: 1px solid var(--filet); font-size: .8rem; min-width: 0; }
.planning-nom-texte { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planning-compte { font-size: .68rem; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: var(--alerte-fond); color: var(--alerte); white-space: nowrap; }
.planning-compte.present { background: var(--succes-fond); color: var(--succes); }
.planning-piste { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); min-height: 30px; }

.planning-entete { position: sticky; top: 0; z-index: 4; background: var(--vert-profond); border-bottom: 0; }
.planning-entete .planning-nom { background: var(--vert-profond); color: #fff; font-weight: 700; text-transform: uppercase; font-size: .7rem; letter-spacing: .04em; border-right-color: rgba(255,255,255,.15); }
.planning-col { display: grid; place-items: center; align-content: center; padding: 5px 0; color: rgba(255,255,255,.85); font-size: .7rem; font-weight: 700; line-height: 1.1; text-transform: capitalize; }
.planning-col small { font-size: .6rem; font-weight: 500; opacity: .7; }
.planning-col.chomee { color: rgba(255,255,255,.4); }
.planning-col.aujourdhui span { background: var(--jaune); color: var(--vert-profond); border-radius: 99px; padding: 1px 5px; }

.planning-case { border-left: 1px solid #EEF2F0; position: relative; }
.planning-case.chomee { background: repeating-linear-gradient(135deg, #F1F4F3 0 4px, #FAFBFB 4px 8px); }
.planning-case.aujourdhui { background-color: #FFFBEA; }
.planning-case.present::after, .planning-case.absent::after { content: ""; position: absolute; inset: 7px 3px; border-radius: 4px; }
.planning-case.present::after { background: #8FD3B0; }
.planning-case.absent::after { background: #F4A39C; }
.accent-absences .planning-case.present::after { background: #D9EFE4; }
.planning-case.mois { background: color-mix(in srgb, var(--vert-clair) calc(var(--taux, 0) * .55%), transparent); display: grid; place-items: center; }
.planning-case.mois span { font-size: .68rem; font-weight: 700; color: var(--vert-profond); }

.planning-barre {
    position: absolute; top: 5px; bottom: 5px; z-index: 2; display: flex; align-items: center; overflow: hidden;
    border-radius: 6px; background: var(--b); color: #fff; text-decoration: none; font-size: .68rem; font-weight: 700;
    box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: transform .12s, box-shadow .12s;
}
.planning-barre span { padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planning-barre:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,49,43,.25); z-index: 3; }
.accent-presences .planning-barre { top: 9px; bottom: 9px; opacity: .85; }
.planning-barre.en-attente { background: repeating-linear-gradient(135deg, var(--b) 0 6px, color-mix(in srgb, var(--b) 55%, #fff) 6px 12px); outline: 1.5px dashed var(--b); outline-offset: -1px; }
.planning-barre.coupee-debut { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.planning-barre.coupee-fin { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.c0 { --b: var(--c0); } .c1 { --b: var(--c1); } .c2 { --b: var(--c2); } .c3 { --b: var(--c3); }
.c4 { --b: var(--c4); } .c5 { --b: var(--c5); } .c6 { --b: var(--c6); } .c7 { --b: var(--c7); }

.planning-pied { background: var(--surface-attenuee); }
.planning-pied .planning-nom { background: var(--surface-attenuee); font-weight: 700; color: var(--vert-profond); }
.planning-bilan { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 46px; padding: 4px 1px 3px; gap: 2px; }
.planning-jauge { width: 60%; max-width: 22px; height: calc(var(--taux) * .3px); min-height: 2px; border-radius: 3px 3px 0 0;
    background: color-mix(in srgb, var(--vert) calc(var(--taux) * 1%), var(--alerte)); }
.planning-bilan small { font-size: .62rem; font-weight: 700; color: var(--encre-attenuee); }
.planning-bilan.aujourdhui small { color: var(--vert-profond); }

.planning-maintenant { position: absolute; top: 0; bottom: 0; left: calc(var(--nom) + (100% - var(--nom)) * var(--m)); width: 2px; background: var(--jaune); z-index: 2; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,49,43,.08); }

.planning-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: .74rem; color: var(--encre-attenuee); }
.planning-legende span { display: inline-flex; align-items: center; gap: 6px; }
.planning-legende i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: var(--b, #ccc); }
.planning-legende i.en-attente { background: repeating-linear-gradient(135deg, #6B7280 0 3px, #D1D5DB 3px 6px); }
.planning-legende i.present { background: #8FD3B0; }
.planning-legende i.absent { background: #F4A39C; }
.planning-legende i.chomee { background: repeating-linear-gradient(135deg, #E3E8E6 0 3px, #FAFBFB 3px 6px); border: 1px solid var(--filet); }
.planning-legende i.taux { background: linear-gradient(90deg, transparent, var(--vert-clair)); border: 1px solid var(--filet); }

@media (max-width: 720px) { .planning-grille { --nom: 130px; } .planning-nom .pastille-agent { display: none; } }
/* Vue 12 mois du registre : les absences en trait fin, sous le taux de présence. */
.accent-presences .par-mois .planning-barre { top: auto; bottom: 3px; height: 4px; border-radius: 2px; box-shadow: none; }
.accent-presences .par-mois .planning-barre span { display: none; }

/* Registre : le jour à saisir et sa navigation, au-dessus du tableau qu'ils pilotent. */
.jour-a-saisir { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.jour-a-saisir form .champ { margin: 0; max-width: 240px; }
.jour-a-saisir-nav { display: flex; gap: 6px; }
.jour-a-saisir-infos { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .82rem; }
.planning-nav .bouton.petit { text-transform: none; }
/* En-tête d'une section de page : ce qui pilote le bloc qui suit (titre, compte, action). */
.titre-section { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 26px 0 12px; padding-top: 14px; border-top: 1px solid var(--filet); }
.titre-section h2 { margin: 0; }
.titre-section p { margin: 2px 0 0; color: var(--encre-attenuee); font-size: .85rem; }

/* ─────────────── Pile des fenêtres (pile-modales.js) ─────────────── */
/* La fenêtre quittée reste ouverte en retrait, invisible ; son voile ne double pas celui de la suivante. */
dialog.pile-retrait { visibility: hidden !important; pointer-events: none; }
dialog.pile-retrait::backdrop { background: transparent !important; }
dialog.pile-entree-droite { animation: pile-entree-droite .11s ease-out both !important; }
dialog.pile-entree-gauche { animation: pile-entree-gauche .09s ease-out both !important; }
dialog.pile-sortie-gauche { animation: pile-sortie-gauche .11s ease-in both !important; }
dialog.pile-sortie-droite { animation: pile-sortie-droite .09s ease-in both !important; }
@keyframes pile-entree-droite { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pile-entree-gauche { from { transform: translateX(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pile-sortie-gauche { to { transform: translateX(-16px); opacity: 0; } }
@keyframes pile-sortie-droite { to { transform: translateX(12px); opacity: 0; } }

.pile-retour {
    display: inline-flex; align-items: center; gap: 4px; margin: 0 0 8px; padding: 4px 10px 4px 6px;
    border: 1px solid var(--filet); border-radius: 99px; background: var(--surface); color: var(--vert);
    font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer;
}
.pile-retour:hover { background: var(--surface-attenuee); }
.pile-retour svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tiroir-tete .pile-retour, .apercu-tete .pile-retour { margin: 0; flex: none; background: transparent; color: inherit; border-color: rgba(255,255,255,.4); }
.apercu-tete .pile-retour { color: var(--vert); border-color: var(--filet); }
@media (prefers-reduced-motion: reduce) {
    dialog.pile-entree-droite, dialog.pile-entree-gauche, dialog.pile-sortie-gauche, dialog.pile-sortie-droite { animation: none !important; }
}

/* ─────────────── Boutons-tuiles et grandes fenêtres de travail ─────────────── */
.acces-blocs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; margin: 0 0 18px; }
.acces-bloc {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left;
    border: 1px solid var(--filet); border-radius: 12px; background: var(--surface); color: var(--encre);
    font: inherit; cursor: pointer; box-shadow: var(--ombre); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.acces-bloc:hover { transform: translateY(-2px); border-color: var(--vert-clair); box-shadow: 0 10px 22px rgba(0,49,43,.1); }
.acces-bloc:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }
.acces-bloc > svg { flex: none; width: 38px; height: 38px; padding: 8px; border-radius: 10px; background: #E6F4EC; color: var(--vert);
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.acces-bloc span { display: grid; gap: 2px; min-width: 0; }
.acces-bloc strong { font-size: .95rem; color: var(--vert-profond); }
.acces-bloc small { font-size: .78rem; color: var(--encre-attenuee); }
.acces-bloc.a-traiter { border-color: #F5C26B; }
.acces-bloc.a-traiter > svg { background: #FFF6D6; color: #8A6400; }
.acces-badge { position: absolute; top: 10px; right: 12px; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--alerte);
    color: #fff; font-style: normal; font-size: .72rem; font-weight: 800; text-align: center; }

dialog.modale.grande { width: min(1240px, calc(100vw - 32px)); max-height: calc(100vh - 32px); display: none; flex-direction: column; }
dialog.modale.grande[open] { display: flex; }
.grande-tete { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--filet); flex: none; flex-wrap: wrap; }
.grande-tete h2 { margin: 0; flex: 1 1 auto; text-transform: none; }
.grande-tete h2::first-letter { text-transform: uppercase; }
.grande-tete .pile-retour { margin: 0; }
.grande-corps { flex: 1; overflow: auto; padding: 16px 18px 20px; background: var(--fond); }
.grande-corps > .carte:last-child, .grande-corps form:last-child .actions { margin-bottom: 0; }
@media (max-width: 720px) { dialog.modale.grande { width: 100vw; max-height: 100vh; border-radius: 0; } .grande-corps { padding: 12px; } }
/* Sous-fenêtre (pile-modales.js) : ouverte comme la première fenêtre de la pile, à la taille de son contenu. */
dialog.pile-cadre {
    width: var(--pile-largeur) !important; max-width: none !important;
    border-radius: var(--pile-arrondi) !important; overflow: hidden;
    display: flex !important; flex-direction: column;
}
/* Parente centrée : au centre de l'écran, hauteur du contenu, dans la limite de l'écran. */
dialog.pile-cadre-centre {
    position: fixed !important; inset: 0 !important; margin: auto !important;
    height: fit-content !important; max-height: calc(100vh - 32px) !important;
    border: 0 !important;
}
/* Parente en panneau : panneau à droite, sur toute la hauteur. */
dialog.pile-cadre-panneau {
    position: fixed !important; inset: 0 0 0 auto !important; margin: 0 !important;
    height: 100vh !important; max-height: none !important;
}
dialog.pile-cadre > :is(.modale-corps, .detail-corps, .tiroir-corps, .grande-corps, .apercu-cadre, form) { flex: 1 1 auto; min-height: 0; overflow: auto; }
dialog.pile-cadre > :is(.modale-tete, .apercu-tete, .tiroir-tete, .grande-tete, .modale-pied) { flex: none; }
/* Aller en deux temps : la nouvelle fenêtre attend, invisible, que la précédente soit sortie. */
dialog.pile-attente { visibility: hidden !important; }
dialog.pile-attente::backdrop { background: transparent !important; }
/* Même fenêtre : l'image figée de l'ancien contenu sort, le nouveau attend derrière. */
dialog.pile-contenu-attente { overflow: hidden; }
dialog.pile-contenu-attente > :not(.pile-fantome) { visibility: hidden; }
.pile-fantome { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; overflow: hidden;
    background: inherit; border-radius: inherit; pointer-events: none; }
.pile-fantome.pile-sortie-gauche { animation: pile-sortie-gauche .11s ease-in both; }
@media (prefers-reduced-motion: reduce) { .pile-fantome.pile-sortie-gauche { animation: none; } }
/* Fenêtre affichée imbriquée dans une fenêtre en retrait (ex. « Ressources Microsoft 365 » dans la
   fiche ouverte au panneau) : elle n'hérite ni de l'invisibilité ni de l'insensibilité au clic. */
dialog[open]:not(.pile-retrait):not(.pile-attente) { visibility: visible !important; pointer-events: auto !important; }

/* Fenêtre passée par la pile : son animation d'ouverture propre ne repart pas après la nôtre. */
dialog.pile-sans-anim:not(.pile-entree-droite):not(.pile-entree-gauche):not(.pile-sortie-gauche):not(.pile-sortie-droite) { animation: none !important; }
/* L'aperçu d'un document garde sa hauteur : son contenu (le PDF) n'a pas de hauteur propre. */
dialog.pile-cadre-centre.apercu { height: min(94vh, 1200px) !important; }

/* Détail en tableau (éléments de même nature) : la fenêtre s'élargit pour ses colonnes. */
dialog.modale.detail:has(table.tableau-detail) { width: min(1040px, calc(100vw - 24px)); }
table.tableau-detail { font-size: .84rem; }
table.tableau-detail tr.a-expliquer td { background: var(--alerte-fond); }
table.tableau-detail tr.en-attente td { background: var(--attention-fond); }

/* Transformation du cadre (tailles très différentes) : le contenu s'efface, un cadre vide passe d'une
   taille à l'autre, puis le contenu apparaît (pile-modales.js). */
dialog.pile-vidage > * { animation: pile-vidage .07s ease-in both; }
@keyframes pile-vidage { to { opacity: 0; } }
dialog.pile-morphe { background: transparent !important; box-shadow: none !important; border-color: transparent !important; }
dialog.pile-morphe > :not(.pile-morphose) { visibility: hidden !important; }
.pile-morphose { position: fixed; z-index: 10; pointer-events: none; box-shadow: 0 18px 60px rgba(0,49,43,.25); }
dialog.pile-apparition > :not(.pile-morphose) { animation: pile-apparition .08s ease-out both; }
@keyframes pile-apparition { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.pile-vidage > *, dialog.pile-apparition > * { animation: none !important; } }
