/* AFIS Ops Manager - portail public
 *
 * Interface d'exploitation, pas une page de site : grandes cibles, hierarchie
 * lisible d'un coup d'oeil, temoins qui montrent l'etat plutot que des
 * tableaux a dechiffrer. Le mode nuit couvre toute l'interface.
 */

.afis-hub {
    --h-fond: #ffffff;
    --h-fond2: #f5f6f8;
    --h-fond3: #eceef1;
    --h-bord: #dcdfe3;
    --h-texte: #14181c;
    --h-doux: #5c6672;
    --h-accent: #1f6feb;
    --h-accent-doux: #e8f1fe;
    --h-vert: #10702c;
    --h-vert-doux: #e4f5e9;
    --h-ambre: #9a6700;
    --h-ambre-doux: #fdf3dc;
    --h-rouge: #b3261e;
    --h-rouge-doux: #fdecea;
    --h-rayon: 12px;
    --h-ombre: 0 1px 2px rgba(20, 24, 28, .06), 0 4px 14px rgba(20, 24, 28, .05);

    max-width: 1080px;
    margin: 0 auto;
    color: var(--h-texte);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.afis-hub.nuit {
    --h-fond: #14181c;
    --h-fond2: #1b2026;
    --h-fond3: #232931;
    --h-bord: #2f3740;
    --h-texte: #e6e9ed;
    --h-doux: #98a2ad;
    --h-accent: #58a6ff;
    --h-accent-doux: #16283f;
    --h-vert: #4ec26f;
    --h-vert-doux: #14301d;
    --h-ambre: #d9a441;
    --h-ambre-doux: #33280f;
    --h-rouge: #e5706a;
    --h-rouge-doux: #34191a;
    --h-ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);

    background: var(--h-fond);
    padding: 16px;
    border-radius: 14px;
}

.afis-hub * { box-sizing: border-box; }
.afis-hub h2, .afis-hub h3 { margin: 0; line-height: 1.2; }

/* ---------- Entete ---------- */

.afis-hub-tete {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--h-bord);
}

.afis-hub-identite { display: flex; align-items: center; gap: 14px; }

.afis-hub-code {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    height: 62px;
    padding: 0 10px;
    background: var(--h-texte);
    color: var(--h-fond);
    border-radius: var(--h-rayon);
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

.afis-hub-sur {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--h-doux);
    font-weight: 600;
}
.afis-hub-tete h2 { font-size: 22px; margin-top: 3px; }

.afis-hub-outils { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.afis-hub-nuit,
.afis-hub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    background: var(--h-fond);
    color: var(--h-texte);
    border: 1px solid var(--h-bord);
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .08s;
}
.afis-hub-btn:hover, .afis-hub-nuit:hover { border-color: var(--h-accent); color: var(--h-accent); }
.afis-hub-btn:active { transform: translateY(1px); }

.afis-hub-btn.primaire {
    background: var(--h-accent);
    border-color: var(--h-accent);
    color: #fff;
}
.afis-hub-btn.primaire:hover { filter: brightness(1.08); color: #fff; }
.afis-hub-btn.grand { min-height: 52px; padding: 0 26px; font-size: 16px; }

.afis-hub-lien { color: var(--h-accent); text-decoration: none; font-weight: 600; }

/* ---------- Navigation ---------- */

.afis-hub-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--h-fond2);
    border-radius: 11px;
}
.afis-hub-nav a {
    flex: 1 1 auto;
    text-align: center;
    padding: 11px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--h-doux);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.afis-hub-nav a:hover { color: var(--h-texte); background: var(--h-fond3); }
.afis-hub-nav a.actif { background: var(--h-fond); color: var(--h-texte); box-shadow: var(--h-ombre); }

/* ---------- Sections ---------- */

.afis-hub-section { margin-bottom: 30px; }

.afis-hub-titre {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--h-doux);
    margin-bottom: 14px;
}

.afis-hub-hint { font-size: 13px; color: var(--h-doux); font-weight: 400; text-transform: none; letter-spacing: 0; }

.afis-hub-pastille {
    padding: 2px 10px;
    border-radius: 11px;
    background: var(--h-ambre-doux);
    color: var(--h-ambre);
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.afis-hub-bandeau {
    padding: 13px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 15px;
    border-left: 4px solid;
}
.afis-hub-bandeau.ok { background: var(--h-vert-doux); border-color: var(--h-vert); }
.afis-hub-bandeau.ko { background: var(--h-rouge-doux); border-color: var(--h-rouge); }

.afis-hub-message {
    padding: 40px 28px;
    text-align: center;
    background: var(--h-fond2);
    border-radius: var(--h-rayon);
}

.afis-hub-intro { color: var(--h-doux); margin-bottom: 18px; }

/* ---------- Choix de l'aerodrome ---------- */

.afis-hub-sites {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.afis-site {
    display: block;
    padding: 20px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
    text-decoration: none;
    color: var(--h-texte);
    position: relative;
    transition: border-color .15s, transform .1s, box-shadow .15s;
}
.afis-site:hover { border-color: var(--h-accent); transform: translateY(-2px); box-shadow: var(--h-ombre); }
.afis-site.actif { border-left: 4px solid var(--h-vert); }

.afis-site-code {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1px;
}
.afis-site-nom { font-size: 13px; color: var(--h-doux); margin-top: 2px; }
.afis-site-etat { margin-top: 12px; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.afis-site-ferme { color: var(--h-doux); }

.afis-site-pastille {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 2px 9px;
    border-radius: 10px;
    background: var(--h-ambre-doux);
    color: var(--h-ambre);
    font-size: 11px;
    font-weight: 700;
}

/* ---------- Pouls ---------- */

.afis-pouls {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--h-vert);
    margin-right: 7px;
    vertical-align: middle;
    animation: afis-pulse 2.2s ease-in-out infinite;
}

@keyframes afis-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 112, 44, .45); }
    50%      { box-shadow: 0 0 0 7px rgba(16, 112, 44, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .afis-pouls { animation: none; }
}

/* ---------- Vignette et carte du jour ---------- */

.afis-vignette,
.afis-carte-jour {
    display: block;
    padding: 22px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
    text-decoration: none;
    color: var(--h-texte);
    box-shadow: var(--h-ombre);
}
.afis-vignette.vivante,
.afis-carte-jour.vivante { border-left: 5px solid var(--h-vert); }
.afis-vignette.repos,
.afis-carte-jour.repos { background: var(--h-fond2); box-shadow: none; }

.afis-vignette:hover { border-color: var(--h-accent); }

.afis-vignette-tete,
.afis-carte-jour-tete {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.afis-vignette-sur {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: var(--h-doux);
    font-weight: 600;
}
.afis-vignette-titre,
.afis-carte-jour h3 { font-size: 24px; font-weight: 700; margin-top: 3px; }

.afis-vignette-statut {
    padding: 4px 12px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    background: var(--h-fond3);
    color: var(--h-doux);
    white-space: nowrap;
}
.afis-vignette-statut.ouverte { background: var(--h-accent-doux); color: var(--h-accent); }
.afis-vignette-statut.close   { background: var(--h-ambre-doux); color: var(--h-ambre); }
.afis-vignette-statut.visee   { background: var(--h-vert-doux); color: var(--h-vert); }

.afis-vignette-vide,
.afis-poste-vide { color: var(--h-doux); font-size: 14px; padding: 10px 0; }

.afis-vignette-agents { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }

.afis-agent-actif { display: flex; align-items: center; gap: 9px; font-size: 14px; }

.afis-agent-trig {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 32px;
    padding: 0 9px;
    background: var(--h-accent-doux);
    color: var(--h-accent);
    border-radius: 8px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-weight: 700;
    letter-spacing: 1px;
}
.afis-agent-trig.grand { min-width: 56px; height: 44px; font-size: 18px; }
.afis-agent-info { color: var(--h-doux); }

.afis-vignette-pied,
.afis-carte-jour-pied {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--h-bord);
    font-size: 13px;
    color: var(--h-doux);
}
.afis-vignette-action { color: var(--h-accent); font-weight: 700; }

/* ---------- Poste ---------- */

.afis-poste { margin-bottom: 18px; }
.afis-poste-agent { display: flex; align-items: center; gap: 13px; margin-bottom: 11px; }
.afis-poste-nom { font-weight: 600; }
.afis-poste-temps { font-size: 13px; color: var(--h-doux); }

.afis-poste-partis {
    font-size: 13px;
    color: var(--h-doux);
    padding-top: 10px;
    border-top: 1px dashed var(--h-bord);
}
.afis-poste-partis span {
    display: inline-block;
    margin-left: 9px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* ---------- Temoins ---------- */

.afis-temoins {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}
.afis-temoin {
    padding: 12px 14px;
    background: var(--h-fond2);
    border-radius: 10px;
    border-left: 3px solid transparent;
}
.afis-temoin.manquant { border-left-color: var(--h-ambre); background: var(--h-ambre-doux); }
.afis-temoin .lib {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: var(--h-doux);
    font-weight: 600;
}
.afis-temoin strong {
    display: block;
    font-size: 21px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    margin-top: 3px;
}
.afis-temoins.grands .afis-temoin strong { font-size: 25px; }
.afis-temoin .sous { display: block; font-size: 12px; color: var(--h-doux); margin-top: 2px; }
.afis-temoin .sous.attention { color: var(--h-ambre); font-weight: 600; }

/* ---------- Reste a renseigner ---------- */

.afis-reste {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--h-ambre-doux);
    border-radius: 10px;
    font-size: 13px;
}
.afis-reste .lib { font-weight: 700; color: var(--h-ambre); text-transform: uppercase; font-size: 11px; letter-spacing: .8px; }
.afis-reste-item {
    padding: 2px 10px;
    background: var(--h-fond);
    border-radius: 9px;
    color: var(--h-ambre);
    font-weight: 600;
}
.afis-reste.complet { background: var(--h-vert-doux); color: var(--h-vert); font-weight: 600; }

/* ---------- Tuiles ---------- */

.afis-tuiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.afis-tuile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
    text-decoration: none;
    color: var(--h-texte);
    transition: border-color .15s, transform .1s, box-shadow .15s;
}
.afis-tuile:hover {
    border-color: var(--h-accent);
    transform: translateY(-2px);
    box-shadow: var(--h-ombre);
}

.afis-tuile-icone {
    flex: none;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--h-accent-doux);
}
.afis-tuile-icone svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: var(--h-accent);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.afis-tuile.qualif .afis-tuile-icone { background: var(--h-vert-doux); }
.afis-tuile.qualif .afis-tuile-icone svg { stroke: var(--h-vert); }
.afis-tuile.formation .afis-tuile-icone { background: var(--h-ambre-doux); }
.afis-tuile.formation .afis-tuile-icone svg { stroke: var(--h-ambre); }

.afis-tuile-texte h3 { font-size: 16px; font-weight: 700; }
.afis-tuile-texte p { margin: 3px 0 0; font-size: 13px; color: var(--h-doux); }

.afis-tuile-pastille {
    position: absolute;
    top: 13px;
    right: 13px;
    min-width: 23px;
    height: 23px;
    padding: 0 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--h-ambre);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.afis-tuile-pastille.alerte { background: var(--h-rouge); }

/* ---------- Indicateurs ---------- */

.afis-indicateurs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}
.afis-indic {
    padding: 16px 18px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
}
.afis-indic .lib {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: var(--h-doux);
    font-weight: 600;
}
.afis-indic strong {
    display: block;
    font-size: 28px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    margin: 4px 0 2px;
}
.afis-indic .sous { font-size: 12px; color: var(--h-doux); display: flex; gap: 8px; flex-wrap: wrap; }

.afis-ev { font-weight: 700; padding: 0 7px; border-radius: 8px; }
.afis-ev.hausse { background: var(--h-vert-doux); color: var(--h-vert); }
.afis-ev.baisse { background: var(--h-rouge-doux); color: var(--h-rouge); }

/* ---------- Alertes ---------- */

.afis-hub-alertes { display: flex; flex-direction: column; gap: 9px; }
.afis-hub-alerte {
    padding: 13px 16px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-left: 4px solid var(--h-accent);
    border-radius: 10px;
}
.afis-hub-alerte.urgent   { border-left-color: var(--h-ambre); }
.afis-hub-alerte.bloquant { border-left-color: var(--h-rouge); }
.afis-hub-alerte strong { display: block; font-size: 14px; }
.afis-hub-alerte span { font-size: 13px; color: var(--h-doux); }

/* ---------- Ouverture ---------- */

.afis-ouvrir { margin: 18px 0; }

.afis-qfu-choix { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }

.afis-qfu-bouton { position: relative; }
.afis-qfu-bouton input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.afis-qfu-bouton span {
    display: inline-flex;
    align-items: center;
    min-height: 50px;
    padding: 0 20px;
    background: var(--h-fond);
    border: 2px solid var(--h-bord);
    border-radius: 10px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
}
.afis-qfu-bouton input:checked + span {
    border-color: var(--h-accent);
    background: var(--h-accent-doux);
    color: var(--h-accent);
}
.afis-qfu-bouton input:focus-visible + span { outline: 2px solid var(--h-accent); outline-offset: 2px; }

/* ---------- Veille et liste ---------- */

.afis-carte-veille {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
    text-decoration: none;
    color: var(--h-texte);
}
.afis-carte-veille:hover { border-color: var(--h-accent); }
.afis-carte-veille-date { font-weight: 700; font-size: 17px; }

.afis-liste-pages { display: flex; flex-direction: column; gap: 6px; }

.afis-ligne-page {
    display: grid;
    grid-template-columns: 110px 1fr 74px 70px auto;
    gap: 12px;
    align-items: center;
    padding: 13px 16px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: 10px;
    text-decoration: none;
    color: var(--h-texte);
    font-size: 14px;
}
.afis-ligne-page:hover { border-color: var(--h-accent); background: var(--h-fond2); }
.afis-ligne-page .date { font-weight: 600; }
.afis-ligne-page .agents,
.afis-ligne-page .duree,
.afis-ligne-page .mvts {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    color: var(--h-doux);
}

/* ---------- Ecrans etroits ---------- */

@media (max-width: 680px) {
    .afis-hub { font-size: 15px; }
    .afis-hub-code { min-width: 52px; height: 52px; font-size: 17px; }
    .afis-hub-tete h2 { font-size: 19px; }
    .afis-vignette-titre, .afis-carte-jour h3 { font-size: 20px; }
    .afis-hub-nav a { flex: 1 1 42%; font-size: 13px; padding: 10px 8px; }
    .afis-ligne-page { grid-template-columns: 1fr auto; row-gap: 5px; }
    .afis-ligne-page .agents { grid-column: 1 / -1; }
    .afis-ligne-page .mvts { display: none; }
}

/* ---------- Fiches agent (qualifications, formations) ---------- */

.afis-tableau-public { display: flex; flex-direction: column; gap: 10px; }

.afis-fiche {
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
    padding: 16px 18px;
}
.afis-fiche.moi { border-left: 4px solid var(--h-accent); }

.afis-fiche-tete {
    display: flex;
    align-items: center;
    gap: 13px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.afis-fiche-identite { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.afis-fiche-identite strong { font-size: 16px; }

.afis-fiche-moi {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 9px;
    background: var(--h-accent-doux);
    color: var(--h-accent);
    font-size: 11px;
    font-weight: 700;
    width: fit-content;
}

.afis-etat {
    padding: 4px 12px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    background: var(--h-fond3);
    color: var(--h-doux);
    white-space: nowrap;
}
.afis-etat.valide       { background: var(--h-vert-doux); color: var(--h-vert); }
.afis-etat.echeance_1an { background: var(--h-ambre-doux); color: var(--h-ambre); }
.afis-etat.echeance_6m  { background: var(--h-ambre-doux); color: var(--h-ambre); }
.afis-etat.perimee_1an,
.afis-etat.perimee_sup,
.afis-etat.suspendue,
.afis-etat.bloquant     { background: var(--h-rouge-doux); color: var(--h-rouge); }

.afis-fiche-corps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.afis-fiche-bloc { padding: 11px 13px; background: var(--h-fond2); border-radius: 9px; }
.afis-fiche-bloc.large { grid-column: span 2; }
.afis-fiche-bloc .lib {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: var(--h-doux);
    font-weight: 600;
}
.afis-fiche-bloc strong {
    display: block;
    font-size: 19px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    margin-top: 3px;
}
.afis-fiche-bloc strong.ok { color: var(--h-vert); }
.afis-fiche-bloc strong.ko { color: var(--h-ambre); }
.afis-fiche-bloc .sous { display: block; font-size: 12px; color: var(--h-doux); margin-top: 2px; }
.afis-fiche-bloc .sous.attention { color: var(--h-ambre); font-weight: 600; }

.afis-fiche-pied {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--h-bord);
}

.afis-barre {
    height: 6px;
    background: var(--h-fond3);
    border-radius: 3px;
    overflow: hidden;
    margin: 6px 0 4px;
}
.afis-barre-remplie { height: 100%; border-radius: 3px; }
.afis-barre-remplie.ok { background: var(--h-vert); }
.afis-barre-remplie.ko { background: var(--h-ambre); }

.afis-ligne-formation {
    display: grid;
    grid-template-columns: 95px 60px 1fr 72px 160px;
    gap: 12px;
    align-items: center;
    padding: 11px 16px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: 9px;
    font-size: 14px;
}
.afis-ligne-formation .date,
.afis-ligne-formation .agent,
.afis-ligne-formation .duree,
.afis-ligne-formation .blocs {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    color: var(--h-doux);
}
.afis-ligne-formation .agent { font-weight: 700; color: var(--h-texte); }

@media (max-width: 680px) {
    .afis-fiche-bloc.large { grid-column: span 1; }
    .afis-ligne-formation { grid-template-columns: 1fr auto; row-gap: 4px; }
    .afis-ligne-formation .type { grid-column: 1 / -1; }
    .afis-ligne-formation .blocs { grid-column: 1 / -1; font-size: 12px; }
}

/* ---------- Prise de poste ---------- */

.afis-poste-case {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 16px;
    margin-bottom: 18px;
    background: var(--h-accent-doux);
    border: 1px solid var(--h-accent);
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
}
.afis-poste-case input { width: 21px; height: 21px; flex: none; }
.afis-poste-case strong {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    letter-spacing: 1px;
}

/* ---------- Visas ---------- */

.afis-nav-compte {
    display: inline-block;
    min-width: 19px;
    padding: 0 6px;
    margin-left: 5px;
    border-radius: 10px;
    background: var(--h-ambre);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
}

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

.afis-visa-carte {
    padding: 18px 20px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-left: 4px solid var(--h-accent);
    border-radius: var(--h-rayon);
}
.afis-visa-carte.retard { border-left-color: var(--h-rouge); }

.afis-visa-tete {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.afis-visa-date { font-size: 18px; font-weight: 700; }

.afis-visa-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.afis-visa-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.afis-visa-form input[type="text"] {
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid var(--h-bord);
    border-radius: 9px;
    font-size: 15px;
    min-width: 190px;
    background: var(--h-fond);
    color: var(--h-texte);
}

/* ---------- Statistiques ---------- */

.afis-graph-boite {
    padding: 16px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
}
.afis-graph-boite svg { width: 100%; height: auto; display: block; }
.afis-graph-boite .stat-axe { stroke: var(--h-bord); stroke-width: 1; }
.afis-graph-boite .stat-barre { fill: var(--h-accent-doux); }
.afis-graph-boite .stat-barre:hover { fill: var(--h-accent); }
.afis-graph-boite .stat-ligne { fill: none; stroke: var(--h-accent); stroke-width: 2; stroke-linejoin: round; }
.afis-graph-boite .stat-legende { font-size: 11px; fill: var(--h-doux); }

.afis-ligne-annee {
    display: grid;
    grid-template-columns: 70px repeat(4, 1fr);
    gap: 12px;
    align-items: center;
    padding: 13px 16px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: 9px;
    font-size: 14px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    color: var(--h-doux);
}
.afis-ligne-annee .annee {
    font-size: 17px;
    font-weight: 700;
    color: var(--h-texte);
}

@media (max-width: 680px) {
    .afis-ligne-annee { grid-template-columns: 1fr 1fr; row-gap: 5px; }
    .afis-ligne-annee .annee { grid-column: 1 / -1; }
    .afis-visa-form input[type="text"] { min-width: 140px; }
}

.afis-tuile.visa .afis-tuile-icone { background: var(--h-ambre-doux); }
.afis-tuile.visa .afis-tuile-icone svg { stroke: var(--h-ambre); }

/* ---------- Saisie dans le portail ---------- */

.afis-saisie {
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
    margin-bottom: 20px;
    overflow: hidden;
}
.afis-saisie.compacte { margin: 14px 0 0; background: var(--h-fond2); }

.afis-saisie > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 14px 18px;
    background: var(--h-fond2);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.afis-saisie > summary::-webkit-details-marker { display: none; }
.afis-saisie > summary::after { content: '+'; font-size: 22px; font-weight: 400; color: var(--h-doux); }
.afis-saisie[open] > summary::after { content: '\2212'; }
.afis-saisie.compacte > summary { min-height: 42px; font-size: 13px; padding: 10px 14px; }

.afis-saisie-corps { padding: 18px; }
.afis-saisie.compacte .afis-saisie-corps { padding: 14px; }

.afis-saisie-grille {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.afis-saisie-grille label { display: flex; flex-direction: column; gap: 5px;
                            font-size: 12px; font-weight: 600; color: var(--h-doux); }
.afis-saisie-grille label.large { grid-column: span 2; }
.afis-saisie-grille label.pleine { grid-column: 1 / -1; }

.afis-saisie input[type="text"],
.afis-saisie input[type="date"],
.afis-saisie input[type="time"],
.afis-saisie select,
.afis-saisie textarea {
    min-height: 44px;
    padding: 9px 12px;
    background: var(--h-fond);
    color: var(--h-texte);
    border: 1px solid var(--h-bord);
    border-radius: 9px;
    font-size: 16px;
    width: 100%;
}
.afis-saisie textarea { min-height: 80px; resize: vertical; }

.afis-saisie-themes { margin-bottom: 16px; }
.afis-saisie-themes .lib {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--h-doux);
    font-weight: 700;
    margin-bottom: 8px;
}
.afis-saisie-themes fieldset {
    border: 1px solid var(--h-bord);
    border-radius: 9px;
    padding: 10px 14px;
    margin-bottom: 9px;
}
.afis-saisie-themes legend { font-size: 12px; font-weight: 700; padding: 0 6px; color: var(--h-doux); }
.afis-saisie-themes label {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
}
.afis-saisie-themes input { width: 19px; height: 19px; flex: none; }

@media (max-width: 680px) {
    .afis-saisie-grille label.large { grid-column: 1 / -1; }
}

/* ---------- Gestion du service ---------- */

.afis-ligne-resp,
.afis-ligne-agent,
.afis-ligne-piste {
    display: grid;
    gap: 12px;
    align-items: center;
    padding: 13px 16px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: 10px;
    font-size: 14px;
    text-decoration: none;
    color: var(--h-texte);
}
.afis-ligne-agent:hover,
.afis-ligne-piste:hover { border-color: var(--h-accent); background: var(--h-fond2); }

.afis-ligne-resp  { grid-template-columns: 220px 1fr 1fr auto; }
.afis-ligne-agent { grid-template-columns: 62px 1fr 150px 92px auto; }
.afis-ligne-piste { grid-template-columns: 110px 130px 100px 1fr auto; }

.afis-ligne-resp .role { font-weight: 700; }
.afis-ligne-resp .mail,
.afis-ligne-agent .compte,
.afis-ligne-piste .periode { color: var(--h-doux); font-size: 13px; }

.afis-ligne-agent .nom { font-weight: 600; }
.afis-ligne-agent .qualif,
.afis-ligne-piste .qfu {
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
.afis-ligne-piste .qfu { font-size: 16px; font-weight: 700; }
.afis-ligne-piste .dim,
.afis-ligne-piste .rev { color: var(--h-doux); font-size: 13px; }

.afis-retirer { color: var(--h-rouge); text-decoration: none; font-size: 13px; font-weight: 600; }

.afis-case-simple {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin-bottom: 14px;
    font-size: 15px;
    cursor: pointer;
}
.afis-case-simple input { width: 20px; height: 20px; }

@media (max-width: 680px) {
    .afis-ligne-resp,
    .afis-ligne-agent,
    .afis-ligne-piste { grid-template-columns: 1fr auto; row-gap: 5px; }
    .afis-ligne-agent .compte,
    .afis-ligne-piste .dim,
    .afis-ligne-piste .rev { display: none; }
    .afis-ligne-resp .mail { grid-column: 1 / -1; }
}


/* ---------- Entree : icones et vignettes ---------- */

.afis-hub-entree .afis-hub-sites {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

a.afis-hub-code { text-decoration: none; transition: transform .1s; }
a.afis-hub-code:hover { transform: scale(1.04); }

.afis-site-chiffres {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--h-bord);
    font-size: 12px;
    color: var(--h-doux);
}
.afis-site-chiffres strong { color: var(--h-texte); font-size: 14px; }
.afis-site-chiffres .attention strong { color: var(--h-ambre); }

.afis-hub-icone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--h-bord);
    border-radius: 9px;
    text-decoration: none;
    color: var(--h-texte);
    font-size: 14px;
    font-weight: 600;
}
.afis-hub-icone:hover { border-color: var(--h-accent); color: var(--h-accent); }
.afis-hub-icone.actif { background: var(--h-accent); border-color: var(--h-accent); color: #fff; }
.afis-hub-icone svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Les trois themes ---------- */







/* ---------- Rappel de visa ---------- */

.afis-rappel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 20px;
    margin-bottom: 20px;
    background: var(--h-ambre-doux);
    border: 1px solid var(--h-ambre);
    border-radius: var(--h-rayon);
    text-decoration: none;
    color: var(--h-ambre);
    font-size: 15px;
}
.afis-rappel:hover { filter: brightness(.97); }
.afis-rappel span { font-weight: 700; }

@media (max-width: 680px) {
    .afis-hub-icone-texte { display: none; }
    .afis-hub-icone { padding: 0 13px; }
    }

.afis-recap-form {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 16px 18px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
}
.afis-recap-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--h-doux);
}
.afis-recap-form input {
    min-height: 44px;
    padding: 0 12px;
    background: var(--h-fond);
    color: var(--h-texte);
    border: 1px solid var(--h-bord);
    border-radius: 9px;
    font-size: 15px;
}

/* ---------- Qualifications additionnelles ---------- */

.afis-pied-lib {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: var(--h-doux);
    font-weight: 700;
    width: 100%;
}

.afis-add-puce {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    padding: 7px 12px;
    border-radius: 9px;
    background: var(--h-fond2);
    border-left: 3px solid var(--h-doux);
    font-size: 13px;
}
.afis-add-puce.ok { border-left-color: var(--h-vert); }
.afis-add-puce.ko { border-left-color: var(--h-ambre); background: var(--h-ambre-doux); }
.afis-add-puce strong { font-weight: 700; }
.afis-add-puce em { font-style: normal; font-size: 11px; color: var(--h-doux); }

/* ---------- Aerodrome et suppression d'agent ---------- */

.afis-logo-actuel {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: var(--h-fond2);
    border-radius: 9px;
}
.afis-logo-actuel img { max-height: 54px; max-width: 160px; }

.afis-ligne-agent-boite { display: flex; align-items: stretch; gap: 8px; }
.afis-ligne-agent-boite .afis-ligne-agent { flex: 1 1 auto; }
.afis-retirer-agent {
    display: flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--h-bord);
    border-radius: 10px;
    white-space: nowrap;
}
.afis-retirer-agent:hover { border-color: var(--h-rouge); background: var(--h-rouge-doux); }

.afis-poste-partis span.incomplet {
    color: var(--h-ambre);
    font-weight: 700;
    font-family: inherit;
}

.afis-carte-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Carte d'aerodrome, ecran Service ---------- */

.afis-carte-apercu {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 14px;
    margin-bottom: 14px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
}
.afis-carte-apercu img {
    max-width: 260px;
    max-height: 170px;
    border-radius: 8px;
    border: 1px solid var(--h-bord);
}
.afis-carte-apercu > div { display: flex; flex-direction: column; gap: 5px; }

#afis-carte-zone { display: none; margin: 14px 0; }
#afis-carte-zone.visible { display: block; }
#afis-carte-toile {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--h-bord);
    border-radius: 8px;
    cursor: crosshair;
    touch-action: none;
}

/* ---------- Phase de mise en service ---------- */

.afis-phases { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.afis-phase {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 4px 12px;
    padding: 13px 16px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: 10px;
    cursor: pointer;
}
.afis-phase.actif { border-color: var(--h-accent); background: var(--h-accent-doux); }
.afis-phase input { grid-row: span 2; width: 20px; height: 20px; margin-top: 2px; }
.afis-phase-titre { font-weight: 700; font-size: 15px; }
.afis-phase-texte { font-size: 13px; color: var(--h-doux); line-height: 1.5; }

/* ---------- Creer un aerodrome ---------- */

.afis-site-nouveau {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-style: dashed;
    color: var(--h-doux);
    min-height: 130px;
}
.afis-site-nouveau:hover { color: var(--h-accent); }
.afis-site-plus { font-size: 34px; line-height: 1; font-weight: 300; }

/* ---------- Traitement groupe des visas ---------- */

.afis-lot-barre {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 14px;
    background: var(--h-fond2);
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
}
.afis-lot-barre .afis-case { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.afis-lot-barre input[type="checkbox"] { width: 19px; height: 19px; }

.afis-visa-case { display: flex; align-items: center; }
.afis-visa-case input { width: 22px; height: 22px; }

.afis-formulaire-large {
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
    padding: 22px;
}


/* AFIS Ops Manager - registres
 *
 * Meme langage visuel que le reste du portail : fond clair, accent bleu,
 * mode nuit herite. On garde d'ACAP MCP ce qui sert - densite, en-tetes
 * collants, barre de filtres, pastilles typees, compteur - sans le fond
 * sombre, qui jurait avec les autres ecrans.
 */

.afis-registre {
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--h-ombre);
}

/* ---------- Bandeau ---------- */

.afis-reg-tete {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 20px;
    background: var(--h-fond2);
    border-bottom: 2px solid var(--h-accent);
}

.afis-reg-titre { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }

.afis-reg-nom {
    color: var(--h-texte);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.afis-reg-sous {
    color: var(--h-accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.6px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

.afis-reg-compte {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 14px;
    background: var(--h-accent-doux);
    border-radius: 16px;
}
.afis-reg-n {
    color: var(--h-accent);
    font-size: 16px;
    font-weight: 700;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
.afis-reg-n-lib { color: var(--h-doux); font-size: 11px; }

/* ---------- Filtres ---------- */

.afis-reg-filtres {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 14px 20px;
    background: var(--h-fond);
    border-bottom: 1px solid var(--h-bord);
}

.afis-reg-groupe { display: flex; flex-direction: column; gap: 4px; }
.afis-reg-groupe-large { flex: 1 1 210px; }

.afis-reg-label {
    color: var(--h-doux);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.afis-reg-select,
.afis-reg-recherche,
.afis-reg-btn {
    background: var(--h-fond);
    color: var(--h-texte);
    border: 1px solid var(--h-bord);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    min-height: 40px;
}
.afis-reg-select { min-width: 128px; cursor: pointer; }
.afis-reg-recherche { width: 100%; }

.afis-reg-select:focus,
.afis-reg-recherche:focus {
    border-color: var(--h-accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--h-accent-doux);
}

.afis-reg-btn { cursor: pointer; color: var(--h-doux); font-weight: 600; }
.afis-reg-btn:hover { border-color: var(--h-accent); color: var(--h-accent); }

.afis-reg-actions a,
.afis-reg-actions button {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    background: var(--h-fond);
    border: 1px solid var(--h-bord);
    border-radius: 8px;
    color: var(--h-doux);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.afis-reg-actions a:hover { border-color: var(--h-accent); color: var(--h-accent); }

/* ---------- Tableau ---------- */

.afis-reg-corps { overflow-x: auto; max-height: 72vh; overflow-y: auto; }

.afis-reg-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.afis-reg-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--h-fond2);
    color: var(--h-doux);
    padding: 11px 12px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    border-bottom: 2px solid var(--h-bord);
    white-space: nowrap;
}
.afis-reg-table thead th[data-tri] { cursor: pointer; user-select: none; }
.afis-reg-table thead th[data-tri]:hover { color: var(--h-accent); }

.afis-reg-fleche::after { content: ''; opacity: .4; margin-left: 4px; }
th.tri-asc .afis-reg-fleche::after { content: '\2191'; opacity: 1; }
th.tri-desc .afis-reg-fleche::after { content: '\2193'; opacity: 1; }

.afis-reg-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--h-bord);
    color: var(--h-texte);
    vertical-align: middle;
}
.afis-reg-table tbody tr:hover td { background: var(--h-fond2); }
.afis-reg-table tbody tr[hidden] { display: none; }

.afis-reg-table td.mono,
.afis-reg-table td.num {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-variant-numeric: tabular-nums;
}
.afis-reg-table td.num { text-align: right; }
.afis-reg-table td.fort,
.afis-reg-table .fort { font-weight: 700; }
.afis-reg-table td.actions { text-align: right; white-space: nowrap; }

.afis-reg-table a { color: var(--h-accent); text-decoration: none; }
.afis-reg-table a:hover { text-decoration: underline; }

.afis-reg-vide td,
.afis-reg-aucun {
    padding: 24px 20px;
    text-align: center;
    color: var(--h-doux);
    font-style: italic;
}

.afis-reg-pied { background: var(--h-fond2); border-top: 1px solid var(--h-bord); }
.afis-reg-pied .afis-reg-aucun { display: block; }
.afis-reg-pied .afis-reg-aucun[hidden] { display: none; }

/* ---------- Lignes depliables ---------- */

.afis-reg-table tr.afis-reg-detail td {
    background: var(--h-fond2);
    padding: 14px 18px;
    border-bottom: 2px solid var(--h-bord);
}
.afis-reg-table tr.afis-reg-detail[hidden] { display: none; }

.afis-reg-detail-grille {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px 22px;
}
.afis-reg-detail-champ .lib {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--h-doux);
}
.afis-reg-detail-champ .val { font-size: 14px; }

.afis-reg-plier {
    width: 28px;
    height: 28px;
    border: 1px solid var(--h-bord);
    border-radius: 7px;
    background: var(--h-fond);
    color: var(--h-doux);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
}
.afis-reg-plier:hover { border-color: var(--h-accent); color: var(--h-accent); }
tr.ouvert .afis-reg-plier { background: var(--h-accent); border-color: var(--h-accent); color: #fff; }

.afis-reg-lien {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    margin-left: 5px;
    border: 1px solid var(--h-bord);
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none !important;
    color: var(--h-doux) !important;
}
.afis-reg-lien:hover { border-color: var(--h-accent); color: var(--h-accent) !important; }

/* ---------- Pastilles ---------- */

.afis-puce {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    white-space: nowrap;
}
.afis-puce.neutre    { background: var(--h-fond3); color: var(--h-doux); }
.afis-puce.ok        { background: var(--h-vert-doux); color: var(--h-vert); }
.afis-puce.info      { background: var(--h-accent-doux); color: var(--h-accent); }
.afis-puce.attention { background: var(--h-ambre-doux); color: var(--h-ambre); }
.afis-puce.chaud     { background: #fde8d5; color: #a2500d; }
.afis-puce.alerte    { background: var(--h-rouge-doux); color: var(--h-rouge); }
.afis-puce.site      {
    background: var(--h-accent-doux);
    color: var(--h-accent);
    font-family: ui-monospace, Menlo, Consolas, monospace;
    letter-spacing: 1px;
}

.afis-hub.nuit .afis-puce.chaud { background: #3a2410; color: #e39a4e; }

/* ---------- Jauge en ligne ---------- */

.afis-jauge-reg {
    display: block;
    height: 5px;
    background: var(--h-fond3);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
    min-width: 76px;
}
.afis-jauge-reg span { display: block; height: 100%; border-radius: 3px; }
.afis-jauge-reg span.ok { background: var(--h-vert); }
.afis-jauge-reg span.ko { background: var(--h-ambre); }

@media (max-width: 680px) {
    .afis-reg-tete,
    .afis-reg-filtres { padding: 12px 14px; }
    .afis-reg-nom { font-size: 13px; letter-spacing: 1px; }
    .afis-reg-table thead th,
    .afis-reg-table tbody td { padding: 8px; }
}

/* ---------- Pieces jointes reprises ---------- */

.afis-pieces-liste { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.afis-piece-lien {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 13px;
    background: var(--h-fond2);
    border: 1px solid var(--h-bord);
    border-left: 3px solid var(--h-accent);
    border-radius: 8px;
    text-decoration: none;
    color: var(--h-texte);
    font-size: 13px;
    max-width: 290px;
}
.afis-piece-lien:hover { border-color: var(--h-accent); }
.afis-piece-lien strong { font-weight: 700; }
.afis-piece-lien em {
    font-style: normal;
    font-size: 11.5px;
    color: var(--h-doux);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Recueil annuel et saisie mensuelle ---------- */

.afis-annuel { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.afis-annuel .afis-champ { margin: 0; }

.afis-grille-saisie { overflow-x: auto; margin-bottom: 14px; }

.afis-saisie-mois { min-width: 900px; font-size: 13px; }
.afis-saisie-mois th { white-space: nowrap; text-align: center; }
.afis-saisie-mois td { padding: 4px; text-align: center; vertical-align: middle; }

.afis-saisie-agent { text-align: left !important; white-space: nowrap; }
.afis-saisie-agent strong {
    display: block;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    letter-spacing: 1px;
}
.afis-saisie-agent span { font-size: 11px; color: var(--h-doux); }

.afis-cell-vac, .afis-cell-min {
    width: 52px;
    min-height: 30px;
    padding: 2px 4px;
    font-size: 12px;
    text-align: center;
    border: 1px solid var(--h-bord);
    border-radius: 5px;
    background: var(--h-fond);
    color: var(--h-texte);
}
.afis-cell-min { margin-top: 3px; }

.afis-cell-plugin { background: var(--h-fond2); }
.afis-cell-lu {
    display: block;
    font-weight: 700;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
.afis-cell-h { display: block; font-size: 11px; color: var(--h-doux); }

/* ---------- Evolution d'une annee sur l'autre ---------- */

.afis-ev {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.afis-ev.hausse { background: var(--h-vert-doux); color: var(--h-vert); }
.afis-ev.baisse { background: var(--h-rouge-doux); color: var(--h-rouge); }
.afis-ev.stable { background: var(--h-fond3); color: var(--h-doux); }


/* ==================================================================
   PRISE DE POSTE
   L'ecran d'accueil repond d'abord a « puis-je tenir le poste ? ».
   Trois etats, et leur difference se voit avant d'etre lue : la
   couleur, le poids et l'icone portent le meme message.
   ================================================================== */

.afis-apt {
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
    background: var(--h-fond);
    box-shadow: var(--h-ombre);
    overflow: hidden;
    margin-bottom: 18px;
}

.afis-apt-tete {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 20px;
}

.afis-apt-pastille {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}
.afis-apt-pastille svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.afis-apt-dit { min-width: 0; }

.afis-apt-sur {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--h-doux);
    margin-bottom: 3px;
}

.afis-apt h2 {
    margin: 0 0 4px;
    font-size: 23px;
    line-height: 1.2;
    font-weight: 700;
}

.afis-apt-dit p {
    margin: 0;
    font-size: 15px;
    color: var(--h-doux);
    line-height: 1.5;
}

/* --- Les trois etats --- */

.afis-apt-apte { border-left: 5px solid var(--h-vert); }
.afis-apt-apte .afis-apt-pastille { background: var(--h-vert-doux); color: var(--h-vert); }
.afis-apt-apte h2 { color: var(--h-vert); }

.afis-apt-reserve { border-left: 5px solid var(--h-ambre); }
.afis-apt-reserve .afis-apt-pastille { background: var(--h-ambre-doux); color: var(--h-ambre); }
.afis-apt-reserve h2 { color: var(--h-ambre); }

.afis-apt-bloquant {
    border-left: 5px solid var(--h-rouge);
    box-shadow: 0 0 0 1px var(--h-rouge-doux), var(--h-ombre);
}
.afis-apt-bloquant .afis-apt-pastille { background: var(--h-rouge-doux); color: var(--h-rouge); }
.afis-apt-bloquant h2 { color: var(--h-rouge); }

.afis-apt-inconnu { border-left: 5px solid var(--h-doux); }
.afis-apt-inconnu .afis-apt-pastille { background: var(--h-fond3); color: var(--h-doux); }

/* --- Points a traiter --- */

.afis-apt-points {
    list-style: none;
    margin: 0;
    padding: 0 20px 4px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.afis-apt-point {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--h-fond2);
    border: 1px solid var(--h-bord);
}
.afis-apt-point.bloquant {
    background: var(--h-rouge-doux);
    border-color: #f3c9c5;
}

.afis-apt-point-tete {
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.afis-apt-tag {
    flex: none;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    background: var(--h-ambre-doux);
    color: var(--h-ambre);
}
.afis-apt-point.bloquant .afis-apt-tag { background: var(--h-rouge); color: #fff; }

.afis-apt-point strong { font-size: 15px; }
.afis-apt-point p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--h-doux);
}

.afis-apt-jauge {
    display: block;
    height: 5px;
    margin-top: 9px;
    border-radius: 3px;
    background: var(--h-fond3);
    overflow: hidden;
}
.afis-apt-jauge span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--h-ambre);
}

.afis-apt-pied {
    padding: 12px 20px 16px;
}
.afis-apt-lien {
    font-size: 14px;
    font-weight: 600;
    color: var(--h-accent);
    text-decoration: none;
}
.afis-apt-lien:hover { text-decoration: underline; }

/* ==================================================================
   ACTION DU JOUR
   Une cible large : c'est le geste fait chaque jour, et souvent au
   doigt sur une tablette posee en vigie.
   ================================================================== */

.afis-jour {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "sur    fleche"
        "titre  fleche"
        "etat   fleche";
    align-items: center;
    gap: 2px 16px;
    padding: 20px 22px;
    margin-bottom: 18px;
    min-height: 104px;
    border-radius: var(--h-rayon);
    background: var(--h-accent);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 14px rgba(31, 111, 235, .26);
}
.afis-jour:hover { background: #1a5fcc; color: #fff; }
.afis-jour:focus-visible { outline: 3px solid #14181c; outline-offset: 3px; }

.afis-jour-sur {
    grid-area: sur;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    opacity: .85;
}
.afis-jour-titre {
    grid-area: titre;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}
.afis-jour-etat {
    grid-area: etat;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    opacity: .92;
}
.afis-jour-fleche {
    grid-area: fleche;
    font-size: 30px;
    opacity: .8;
}

.afis-jour .afis-pouls {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, .7);
    animation: afis-pouls 2s infinite;
}
@keyframes afis-pouls {
    70% { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .afis-jour .afis-pouls { animation: none; }
}

/* ==================================================================
   AUTRES ACCES
   ================================================================== */

.afis-acces {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.afis-acces-item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "icone nom"
        "icone etat";
    gap: 1px 13px;
    align-items: center;
    padding: 16px;
    min-height: 82px;
    border: 1px solid var(--h-bord);
    border-radius: var(--h-rayon);
    background: var(--h-fond);
    color: var(--h-texte);
    text-decoration: none;
    box-shadow: var(--h-ombre);
}
.afis-acces-item:hover {
    border-color: var(--h-accent);
    color: var(--h-texte);
}
.afis-acces-item:focus-visible { outline: 3px solid var(--h-accent); outline-offset: 2px; }

.afis-acces-icone {
    grid-area: icone;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--h-accent-doux);
    color: var(--h-accent);
    display: grid;
    place-items: center;
}
.afis-acces-icone svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.afis-acces-nom { grid-area: nom; font-size: 16px; font-weight: 700; }
.afis-acces-etat { grid-area: etat; font-size: 13px; color: var(--h-doux); }
.afis-acces-etat .attention { color: var(--h-ambre); font-weight: 600; }


/* ==================================================================
   TABLETTE ET TELEPHONE
   La vigie se tient souvent avec une tablette posee ou un telephone
   a la main. Deux regles president a tout ce qui suit : aucun champ
   sous 16px, et aucune largeur qui force un defilement lateral.
   ================================================================== */

/* --- Le zoom automatique de Safari ---------------------------------
   Sous 16px, iOS agrandit la page des qu'un champ prend le focus et
   ne la remet jamais droite. L'agent se retrouve a faire glisser
   l'ecran pour retrouver son formulaire. La regle vaut pour la
   tablette comme pour le telephone, et prime sur les tailles fixees
   plus haut. */
@media (max-width: 1024px) {
    .afis-hub input,
    .afis-hub select,
    .afis-hub textarea,
    .afis-vigie input,
    .afis-vigie select,
    .afis-vigie textarea,
    .afis-portail input,
    .afis-portail select,
    .afis-portail textarea {
        font-size: 16px !important;
    }
}

/* --- Cibles tactiles ----------------------------------------------
   Un doigt n'a pas la precision d'un pointeur : les commandes
   passent a 44px, la taille retenue par les guides d'accessibilite. */
@media (pointer: coarse) {
    .afis-hub button,
    .afis-hub .afis-hub-btn,
    .afis-hub input,
    .afis-hub select,
    .afis-reg-btn,
    .afis-reg-select,
    .afis-reg-recherche,
    .afis-vigie button,
    .afis-vigie .afis-btn {
        min-height: 44px;
    }

    .afis-hub input[type="checkbox"],
    .afis-hub input[type="radio"],
    .afis-vigie input[type="checkbox"],
    .afis-vigie input[type="radio"] {
        width: 24px;
        height: 24px;
        min-height: 0;
    }

    .afis-reg-plier { width: 40px; height: 40px; }
    .afis-releve-x { width: 40px; height: 40px; }
}

/* ==================================================================
   REGISTRES SUR PETIT ECRAN
   Un tableau de neuf colonnes ne se lit pas sur un telephone. Chaque
   ligne devient une carte, et chaque valeur reprend l'intitule de sa
   colonne : on garde l'information sans le defilement lateral.
   ================================================================== */

@media (max-width: 760px) {

    .afis-reg-corps { overflow-x: visible; max-height: none; }

    .afis-reg-table thead { display: none; }

    .afis-reg-table,
    .afis-reg-table tbody,
    .afis-reg-table tr,
    .afis-reg-table td { display: block; width: auto; }

    .afis-reg-table tbody tr:not(.afis-reg-detail) {
        margin: 0 12px 10px;
        padding: 6px 2px;
        border: 1px solid var(--h-bord);
        border-radius: 10px;
        background: var(--h-fond);
    }
    .afis-reg-table tbody tr:hover td { background: none; }

    .afis-reg-table tbody td {
        display: grid;
        grid-template-columns: minmax(96px, 38%) 1fr;
        gap: 10px;
        align-items: baseline;
        padding: 7px 12px;
        border: 0;
        text-align: left !important;
    }

    /* L'intitule de colonne accompagne la valeur. */
    .afis-reg-table tbody td[data-libelle]::before {
        content: attr(data-libelle);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .8px;
        color: var(--h-doux);
    }

    /* Une colonne sans intitule — les boutons d'action — occupe
       toute la largeur plutot que de laisser une colonne vide. */
    .afis-reg-table tbody td[data-libelle=""] {
        grid-template-columns: 1fr;
        padding-top: 10px;
        border-top: 1px solid var(--h-bord);
        margin-top: 4px;
    }
    .afis-reg-table tbody td[data-libelle=""]::before { content: none; }

    /* Une cellule vide n'a pas a occuper une ligne. */
    .afis-reg-table tbody td:empty { display: none; }

    .afis-reg-table tbody tr.afis-reg-detail td {
        margin: -6px 12px 12px;
        border-radius: 0 0 10px 10px;
    }
    .afis-reg-detail-grille { grid-template-columns: 1fr; }

    .afis-reg-filtres { padding: 12px; }
    .afis-reg-groupe { flex: 1 1 100%; }
    .afis-reg-select, .afis-reg-recherche { width: 100%; }
    .afis-reg-actions { flex: 1 1 100%; }
    .afis-reg-actions a, .afis-reg-actions button { width: 100%; justify-content: center; }
}

/* ==================================================================
   SAISIE MENSUELLE
   Douze colonnes de mois ne tiennent pas sur un telephone. Le
   tableau garde son defilement, mais la colonne de l'agent reste
   visible : sans elle, on ne sait plus quelle ligne on remplit.
   ================================================================== */

@media (max-width: 900px) {
    .afis-saisie-mois { min-width: 760px; }

    .afis-saisie-mois .afis-saisie-agent {
        position: sticky;
        left: 0;
        z-index: 2;
        background: var(--h-fond);
        box-shadow: 1px 0 0 var(--h-bord);
    }

    .afis-grille-saisie {
        margin-inline: -14px;
        padding-inline: 14px;
    }
}

/* ==================================================================
   ACCUEIL ET MISE EN PAGE GENERALE
   ================================================================== */

@media (max-width: 640px) {

    .afis-hub { font-size: 15.5px; }

    /* Les marges laterales se resserrent : sur un telephone, chaque
       point de largeur compte plus que l'air autour du contenu. */
    .afis-hub-section,
    .afis-apt-tete,
    .afis-apt-points,
    .afis-apt-pied { padding-inline: 14px; }

    .afis-apt-tete { gap: 12px; padding-top: 16px; }
    .afis-apt-pastille { width: 40px; height: 40px; }
    .afis-apt-pastille svg { width: 22px; height: 22px; }
    .afis-apt h2 { font-size: 20px; }
    .afis-apt-points { grid-template-columns: 1fr; }

    .afis-jour {
        padding: 16px 18px;
        min-height: 96px;
        gap: 2px 12px;
    }
    .afis-jour-titre { font-size: 19px; }
    .afis-jour-fleche { font-size: 24px; }

    .afis-acces { grid-template-columns: 1fr; gap: 10px; }
    .afis-acces-item { min-height: 72px; padding: 14px; }

    /* Les grilles de formulaire s'empilent plutot que de comprimer
       chaque champ a une largeur ou plus rien ne se lit. */
    .afis-saisie-grille { grid-template-columns: 1fr; }
    .afis-phases { gap: 8px; }
    .afis-phase { padding: 12px 14px; }

    .afis-hub-tete { flex-direction: column; align-items: flex-start; gap: 12px; }
    .afis-hub-outils { width: 100%; flex-wrap: wrap; }
}

/* Rien ne doit depasser horizontalement : un defilement lateral sur
   la page entiere rend la lecture penible et masque des commandes. */
.afis-hub, .afis-portail { overflow-x: clip; }
.afis-hub img, .afis-portail img { max-width: 100%; height: auto; }

/* ------------------------------------------------------------
   Registre : rangees fournies par une extension (filtres
   afis_ops_registre_formation / afis_ops_registre_formations)
   ------------------------------------------------------------ */
.afis-reg-table tr.afis-reg-proposition > td { background: var(--h-accent-doux); }
.afis-reg-table tr.afis-reg-a-valider > td { background: var(--h-ambre-doux); }
.afis-reg-table tr.afis-reg-vivante > td:first-child { box-shadow: inset 3px 0 0 var(--h-accent); }
.afis-campus-cmd { font-size: 13px; }

/* ------------------------------------------------------------
   Prise de service (2.26.0)
   ------------------------------------------------------------ */
.afis-prise .afis-prise-tete { margin-bottom: 16px; }
.afis-prise .afis-prise-sur {
    font-size: 12px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--h-doux);
}
.afis-prise .afis-prise-tete h2 { font-size: 26px; margin: 4px 0 6px; }
.afis-prise .afis-prise-tete p { margin: 0; color: var(--h-doux); }

.afis-prise-liste { display: grid; gap: 8px; margin: 16px 0; }
.afis-prise-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 14px; border: 1px solid var(--h-bord); border-left-width: 5px;
    border-radius: var(--h-rayon); background: var(--h-fond);
}
.afis-prise-item p { margin: 2px 0 0; font-size: 14px; color: var(--h-doux); overflow-wrap: anywhere; }
.afis-prise-pastille {
    flex: 0 0 14px; width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; background: var(--h-doux);
}
.afis-prise-niveau {
    margin-left: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--h-doux);
}
.afis-prise-item.ok { border-left-color: var(--h-vert); }
.afis-prise-item.ok .afis-prise-pastille { background: var(--h-vert); }
.afis-prise-item.attention { border-left-color: var(--h-ambre); background: var(--h-ambre-doux); }
.afis-prise-item.attention .afis-prise-pastille { background: var(--h-ambre); }
.afis-prise-item.bloque { border-left-color: var(--h-rouge); background: var(--h-rouge-doux); }
.afis-prise-item.bloque .afis-prise-pastille { background: var(--h-rouge); }
.afis-prise-item.bloque .afis-prise-niveau { color: var(--h-rouge); font-weight: 700; }
.afis-prise-item.info { border-left-color: var(--h-accent); }
.afis-prise-item.info .afis-prise-pastille { background: var(--h-accent); }

.afis-prise-decision { margin: 18px 0 24px; }
.afis-prise-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.afis-hub-btn.danger { border-color: var(--h-rouge); color: var(--h-rouge); }
.afis-hub-btn.danger:hover { background: var(--h-rouge); color: #fff; }
.afis-prise-forcage {
    margin-top: 12px; padding: 16px; border: 2px solid var(--h-rouge);
    border-radius: var(--h-rayon); background: var(--h-rouge-doux);
}
.afis-prise-forcage[hidden] { display: none; }
.afis-prise-forcage h3 { margin-bottom: 8px; color: var(--h-rouge); }
.afis-prise-case { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 14px; }
.afis-prise-case input { margin-top: 3px; flex: 0 0 auto; }
.afis-prise-raison { display: block; margin: 12px 0; font-weight: 600; font-size: 14px; }
.afis-prise-raison textarea {
    display: block; width: 100%; margin-top: 6px; padding: 10px; font: inherit; font-weight: 400;
    border: 1px solid var(--h-bord); border-radius: 8px; background: var(--h-fond); color: var(--h-texte);
}
.afis-prise-liens { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; font-size: 14px; }
.afis-prise-liens a { color: var(--h-accent); }
.afis-prise-blocs { max-width: none; margin-top: 8px; }
.afis-prise-admin { margin: 20px 20px 0 0; }

/* Forcages a traiter (page du site, consolide) */
.afis-forcages { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--h-rouge, #b3261e);
    border-left-width: 5px; border-radius: 12px; background: var(--h-rouge-doux, #fdecea); }
.afis-forcages h3 { margin: 0 0 10px; }
.afis-forcages table { width: 100%; border-collapse: collapse; font-size: 14px; }
.afis-forcages th, .afis-forcages td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(0,0,0,.08); vertical-align: top; }
.afis-forcages td.raison { overflow-wrap: anywhere; max-width: 360px; }
.afis-forcages form { margin: 0; }
@media (max-width: 700px) {
    .afis-forcages table, .afis-forcages tbody, .afis-forcages tr, .afis-forcages td { display: block; width: 100%; }
    .afis-forcages thead { display: none; }
    .afis-forcages tr { padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.12); }
    .afis-forcages td { border: 0; padding: 2px 0; }
}

/* ================= 2.27.0 : planning des agents ================= */
.afis-plan-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 4px 0 14px; }
.afis-plan-mois { display: flex; align-items: center; gap: 8px; }
.afis-plan-mois h2 { margin: 0; font-size: 22px; min-width: 170px; text-align: center; }
.afis-plan-mois a { text-decoration: none; font-size: 20px; padding: 2px 10px; border-radius: 6px; background: var(--h-fond3, #eef2f7); color: var(--h-texte); }
.afis-plan-mois .afis-plan-auj { font-size: 13px; }
.afis-plan-chiffres { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.afis-plan-chiffres div { background: var(--h-fond); border: 1px solid var(--h-bord); border-radius: var(--h-rayon, 10px); padding: 6px 12px; }
.afis-plan-chiffres dt { font-size: 12px; color: var(--h-doux); }
.afis-plan-chiffres dd { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.afis-plan-chiffres .ok dd { color: var(--h-vert); }
.afis-plan-chiffres .moyen dd { color: var(--h-ambre); }
.afis-plan-chiffres .ko dd { color: var(--h-rouge); }
.afis-plan-bascule { margin-left: auto; display: flex; gap: 4px; background: var(--h-fond3, #eef2f7); padding: 3px; border-radius: 8px; }
.afis-plan-bascule a { padding: 6px 12px; border-radius: 6px; font-size: 14px; text-decoration: none; color: var(--h-doux); }
.afis-plan-bascule a.actif { background: var(--h-fond); color: var(--h-texte); box-shadow: var(--h-ombre); }
.afis-plan-sel { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--h-rayon, 10px); background: var(--h-fond); border: 1px solid var(--h-bord); margin-bottom: 12px; }
.afis-plan-sel > div:nth-child(2) { flex: 1 1 260px; }
.afis-plan-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.afis-plan-actions form { margin: 0; }
.afis-plan-pastille { display: inline-block; width: 14px; height: 14px; border-radius: 4px; flex: none; margin-top: 3px; vertical-align: -2px; }
.afis-plan-doux { color: var(--h-doux); font-size: 13px; }
.afis-plan-grille-w { overflow-x: auto; border: 1px solid var(--h-bord); border-radius: var(--h-rayon, 10px); background: var(--h-fond); }
.afis-plan-grille { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
.afis-plan-grille th, .afis-plan-grille td { border-bottom: 1px solid var(--h-bord); padding: 3px 2px; text-align: center; min-width: 38px; vertical-align: top; }
.afis-plan-grille thead th { font-weight: 600; color: var(--h-doux); position: sticky; top: 0; background: var(--h-fond); }
.afis-plan-grille thead th span { display: block; font-size: 10px; font-weight: 400; }
.afis-plan-grille .we { background: var(--h-fond3, #f4f6f9); }
.afis-plan-grille .auj { box-shadow: inset 2px 0 0 var(--h-accent), inset -2px 0 0 var(--h-accent); }
.afis-plan-ag { position: sticky; left: 0; z-index: 1; background: var(--h-fond); text-align: left !important; white-space: nowrap; padding: 4px 10px !important; min-width: 120px !important; }
.afis-plan-ag span { color: var(--h-doux); font-weight: 400; }
tr.moi .afis-plan-ag { box-shadow: inset 3px 0 0 var(--h-accent); }
.afis-plan-tot { font-variant-numeric: tabular-nums; white-space: nowrap; padding: 4px 8px !important; font-weight: 600; }
.afis-plan-c { display: block; margin: 1px 0; padding: 3px 2px; border-radius: 4px; font-size: 11px; line-height: 1.2; font-weight: 600; color: #fff !important; text-decoration: none;
    background: var(--c, #5b6670); font-variant-numeric: tabular-nums; white-space: nowrap; }
.afis-plan-c.annule { background: transparent; color: var(--h-doux) !important; text-decoration: line-through; box-shadow: inset 0 0 0 1px var(--c); }
.afis-plan-c:focus-visible, .afis-plan-plus:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 1px; }
.afis-plan-plus { display: block; color: transparent !important; text-decoration: none; border-radius: 4px; min-height: 22px; }
.afis-plan-plus:hover, .afis-plan-plus:focus-visible { color: var(--h-accent) !important; background: var(--h-accent-doux); }
.afis-plan-couv th, .afis-plan-couv td { border-bottom: 0; }
.afis-plan-pct { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 4px; border-radius: 4px; }
.afis-plan-pct.ok { color: var(--h-vert); }
.afis-plan-pct.moyen { color: var(--h-ambre); background: var(--h-ambre-doux); }
.afis-plan-pct.ko { color: var(--h-rouge); background: var(--h-rouge-doux); }
.afis-plan-legende { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; margin: 8px 0 18px; }
.afis-plan-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.afis-plan-moi { margin: 18px 0; }
.afis-plan-moi:not(.seul) { display: none; }
.afis-plan-moi h3 { font-size: 17px; margin: 0 0 10px; }
.afis-plan-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 420px; margin-bottom: 14px; }
.afis-plan-cal-h { font-size: 11px; color: var(--h-doux); text-align: center; }
.afis-plan-cal-j { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; background: var(--h-fond); border: 1px solid var(--h-bord); font-size: 14px; text-decoration: none; color: var(--h-texte); font-variant-numeric: tabular-nums; }
.afis-plan-cal-j svg { position: absolute; right: 3px; bottom: 3px; width: 15px; height: 15px; color: var(--h-accent); }
.afis-plan-cal-j.vac { background: var(--h-accent-doux); border-color: var(--h-accent); font-weight: 700; }
.afis-plan-cal-j.abs { background: var(--h-fond3, #eef2f7); color: var(--h-doux); }
.afis-plan-cal-j.auj { box-shadow: 0 0 0 2px var(--h-texte); }
.afis-plan-jours { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.afis-plan-jours > li { background: var(--h-fond); border: 1px solid var(--h-bord); border-radius: var(--h-rayon, 10px); padding: 10px 12px; scroll-margin-top: 80px; }
.afis-plan-jours > li.auj { border-color: var(--h-accent); }
.afis-plan-jours h4 { margin: 0 0 6px; font-size: 14px; }
.afis-plan-jours ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.afis-plan-jours ul li { display: grid; grid-template-columns: 10px 100px 44px 1fr; gap: 8px; align-items: center; font-size: 14px; }
.afis-plan-jours ul li i { width: 10px; height: 10px; border-radius: 3px; }
.afis-plan-jours ul li.moi { font-weight: 700; }
.afis-plan-jours ul li.annule { text-decoration: line-through; color: var(--h-doux); }
.afis-plan-h { font-variant-numeric: tabular-nums; color: var(--h-doux); }
.afis-plan-saisie summary, #afis-plan-outils summary, #afis-plan-reglages summary { cursor: pointer; font-weight: 700; }
.afis-plan-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 10px 14px; margin-top: 12px; align-items: end; }
.afis-plan-form label { display: grid; gap: 4px; font-size: 13px; color: var(--h-doux); }
.afis-plan-form input, .afis-plan-form select { font: inherit; padding: 7px 9px; border-radius: 6px; border: 1px solid var(--h-bord); background: var(--h-fond); color: var(--h-texte); width: 100%; box-sizing: border-box; }
.afis-plan-form input[type=checkbox], .afis-plan-form input[type=radio] { width: auto; }
.afis-plan-form h4 { margin: 0; grid-column: 1 / -1; font-size: 15px; }
.afis-plan-large { grid-column: 1 / -1; }
.afis-plan-chk { display: flex !important; align-items: center; gap: 8px; grid-column: 1 / -1; color: var(--h-texte) !important; }
.afis-plan-form fieldset { border: 1px solid var(--h-bord); border-radius: 8px; padding: 8px 12px; }
.afis-plan-outils { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 20px; }
.afis-plan-horaires, .afis-plan-types { border-collapse: collapse; width: 100%; font-size: 14px; }
.afis-plan-horaires th, .afis-plan-horaires td, .afis-plan-types th, .afis-plan-types td { padding: 5px 8px; border-bottom: 1px solid var(--h-bord); text-align: left; }
.afis-plan-types tr.archive { opacity: .5; }
@media (max-width: 680px) {
    .afis-plan-moi:not(.seul) { display: block; }
    .afis-plan-grille-w { display: none; }
    .afis-plan-legende { display: none; }
    .afis-plan-bascule { margin-left: 0; }
    .afis-plan-jours ul li { grid-template-columns: 10px 92px 40px 1fr; font-size: 13px; }
}
@media (max-width: 680px) { .afis-plan-moi.seul ~ .afis-plan-grille-w { display: none; } }

/* 2.27.0 : profil enrichi */
.afis-profil-sms h2 { font-size: 18px; margin: 0 0 8px; }
.afis-profil-sms h3 { font-size: 14px; margin: 14px 0 6px; color: var(--h-doux); }
.afis-psms-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.afis-psms-liste li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px; border-radius: 8px; background: var(--h-fond); border: 1px solid var(--h-bord); border-left: 4px solid var(--h-bord); font-size: 14px; }
.afis-psms-liste li span { flex: 1 1 240px; }
.afis-psms-liste li.ok { border-left-color: var(--h-vert); }
.afis-psms-liste li.attente { border-left-color: var(--h-ambre); }
.afis-psms-liste li.ko { border-left-color: var(--h-rouge); }
.afis-psms-liste em { color: var(--h-doux); font-style: normal; font-size: 13px; }

/* 2.28.0 : vues de pilotage (regles, journaux, documents, droits) */
.afis-pil-intro { margin: 0 0 16px; color: var(--h-doux); font-size: 14px; max-width: 760px; }
.afis-pil-defile { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--h-bord); border-radius: var(--h-rayon); background: var(--h-fond); margin-bottom: 18px; }
.afis-pil-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.afis-pil-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--h-doux); background: var(--h-fond2); padding: 9px 12px; border-bottom: 1px solid var(--h-bord); white-space: nowrap; }
.afis-pil-table td { padding: 9px 12px; border-bottom: 1px solid var(--h-bord); vertical-align: top; }
.afis-pil-table tr:last-child td { border-bottom: 0; }
.afis-pil-table th[scope="row"] { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--h-texte); background: transparent; width: 34%; white-space: normal; }
.afis-pil-table .mono, .afis-pil-table code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.afis-pil-table tr.notable td { background: var(--h-ambre-doux); }
.afis-pil-table tr.archive td { opacity: .6; }
.afis-pil-doux { color: var(--h-doux); font-size: 13px; }
.afis-pil-avant { text-decoration: line-through; color: var(--h-doux); }
.afis-pil-apres { font-weight: 600; }
.afis-pil-avert { color: var(--h-ambre); font-size: 13px; }
.afis-pil-filtres { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 16px; padding: 14px; background: var(--h-fond2); border-radius: var(--h-rayon); }
.afis-pil-filtres label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--h-doux); }
.afis-pil-filtres input, .afis-pil-filtres select { min-height: 40px; padding: 6px 10px; border: 1px solid var(--h-bord); border-radius: 8px; background: var(--h-fond); color: var(--h-texte); font-size: 15px; }
.afis-pil-pages { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.afis-pil-pages a { min-width: 36px; padding: 6px 10px; text-align: center; border: 1px solid var(--h-bord); border-radius: 8px; text-decoration: none; color: var(--h-texte); }
.afis-pil-pages a.actif { background: var(--h-accent); border-color: var(--h-accent); color: #fff; }
.afis-pil-log { margin: 0 0 18px; padding: 14px; max-height: 70vh; overflow: auto; background: var(--h-fond2); color: var(--h-texte); border: 1px solid var(--h-bord); border-radius: var(--h-rayon); font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.afis-pil-tag { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--h-fond3); color: var(--h-doux); }
.afis-pil-tag.info { background: var(--h-accent-doux); color: var(--h-accent); }
.afis-pil-tag.ok { background: var(--h-vert-doux); color: var(--h-vert); }
.afis-pil-tag.ko { background: var(--h-rouge-doux); color: var(--h-rouge); }
.afis-pil-docs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.afis-pil-docs input[type="date"] { min-height: 36px; padding: 4px 8px; border: 1px solid var(--h-bord); border-radius: 8px; background: var(--h-fond); color: var(--h-texte); }
.afis-pil-docs .afis-hub-btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
.afis-pil-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.afis-saisie input[type="number"], .afis-saisie input[type="email"] { min-height: 44px; padding: 9px 12px; background: var(--h-fond); color: var(--h-texte); border: 1px solid var(--h-bord); border-radius: 9px; font-size: 16px; width: 100%; }

/* Ecran « Source des droits » repris dans le portail */
.afis-hub-droits .card { background: var(--h-fond); border: 1px solid var(--h-bord); border-radius: var(--h-rayon); padding: 16px 18px; margin-bottom: 18px; }
.afis-hub-droits h2 { font-size: 16px; margin: 18px 0 10px; }
.afis-hub-droits .card h2 { margin-top: 0; }
.afis-hub-droits p { color: var(--h-texte); }
.afis-hub-droits table.widefat { width: 100% !important; max-width: none !important; border-collapse: collapse; font-size: 14px; margin-bottom: 12px; background: var(--h-fond); border: 1px solid var(--h-bord); border-radius: var(--h-rayon); display: block; overflow-x: auto; }
.afis-hub-droits table.widefat th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--h-doux); background: var(--h-fond2); padding: 8px 10px; }
.afis-hub-droits table.widefat td { padding: 8px 10px; border-top: 1px solid var(--h-bord); vertical-align: top; }
.afis-hub-droits .notice { padding: 12px 14px; border-radius: 10px; border-left: 4px solid var(--h-rouge); background: var(--h-rouge-doux); margin: 10px 0; }
.afis-hub-droits .button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--h-bord); background: var(--h-fond); color: var(--h-texte); font-weight: 600; cursor: pointer; }
.afis-hub-droits .button-primary { background: var(--h-accent); border-color: var(--h-accent); color: #fff; }
.afis-hub-droits .button[disabled] { opacity: .5; cursor: not-allowed; }
.afis-hub.nuit .afis-hub-droits td[style] { background: transparent !important; }

/* 2.29.2 : liens du profil (CRESNA, notes signées, raccourcis) toujours lisibles, quel que soit le thème */
.afis-hub .afis-psms-liste a, .afis-hub .afis-hub-section p > a:not(.afis-hub-btn) { color: var(--h-accent) !important; text-decoration: underline; opacity: 1; visibility: visible; }
.afis-hub .afis-psms-liste li span { min-width: 0; color: var(--h-texte, inherit); }

/* 2.29.3 : ecrans Import et Diagnostic repris dans le portail (habillage de .afis-hub-droits + complements) */
.afis-hub-bandeau.info { background: var(--h-accent-doux); border-color: var(--h-accent); }
.afis-hub-admin .notice-success { border-left-color: var(--h-vert); background: var(--h-vert-doux); }
.afis-hub-admin .notice-info { border-left-color: var(--h-accent); background: var(--h-accent-doux); }
.afis-hub-admin .notice-warning { border-left-color: var(--h-ambre); background: var(--h-ambre-doux); }
.afis-hub-admin .notice p { margin: 4px 0; }
.afis-hub-admin h2 { font-size: 17px; margin: 26px 0 10px; color: var(--h-texte); }
.afis-hub-admin h3 { font-size: 15px; margin: 18px 0 8px; color: var(--h-texte); }
.afis-hub-admin table.form-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.afis-hub-admin table.form-table th { text-align: left; width: 200px; padding: 10px 10px 10px 0; vertical-align: top; font-weight: 600; }
.afis-hub-admin table.form-table td { padding: 8px 0; }
.afis-hub-admin input[type="text"], .afis-hub-admin input[type="email"], .afis-hub-admin select, .afis-hub-admin input[type="file"] { min-height: 40px; padding: 6px 10px; border: 1px solid var(--h-bord); border-radius: 8px; background: var(--h-fond); color: var(--h-texte); font-size: 15px; max-width: 100%; }
.afis-hub-admin .regular-text { width: 26em; }
.afis-hub-admin .afis-ops-hint, .afis-hub-admin .description { color: var(--h-doux); font-size: 13px; font-style: italic; margin-left: 6px; }
.afis-hub-admin .afis-ops-alerte { color: var(--h-rouge); font-weight: 600; }
.afis-hub-admin .afis-ops-encart { border: 1px solid var(--h-bord); border-radius: var(--h-rayon); padding: 14px 16px; margin: 14px 0; background: var(--h-fond2); }
.afis-hub-admin .afis-ops-liste, .afis-hub-admin ul { margin: 6px 0 6px 18px; list-style: disc; }
.afis-hub-admin code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--h-fond2); padding: 1px 5px; border-radius: 4px; }
.afis-hub-admin .afis-pastille { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--h-fond3); color: var(--h-doux); }
.afis-hub-admin .afis-pastille.valide { background: var(--h-vert-doux); color: var(--h-vert); }
.afis-hub-admin .afis-pastille.bloquant { background: var(--h-rouge-doux); color: var(--h-rouge); }
.afis-hub-admin .afis-ecart th, .afis-hub-admin .afis-ecart td { padding: 2px 10px 2px 0; border: 0; font-size: 12px; }
.afis-hub-admin .afis-audit-avant { text-decoration: line-through; color: var(--h-doux); }
.afis-hub-admin .afis-audit-apres { font-weight: 600; }
.afis-hub-admin .afis-diag-cles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 14px 0 10px; max-width: 640px; }
.afis-hub-admin .afis-diag-cle { background: var(--h-fond); border: 1px solid var(--h-bord); border-left: 4px solid var(--h-bord); border-radius: 10px; padding: 12px 14px; text-align: center; }
.afis-hub-admin .afis-diag-cle.ok { border-left-color: var(--h-vert); }
.afis-hub-admin .afis-diag-cle.avert { border-left-color: var(--h-ambre); }
.afis-hub-admin .afis-diag-cle.echec { border-left-color: var(--h-rouge); }
.afis-hub-admin .afis-diag-cle.info { border-left-color: var(--h-accent); }
.afis-hub-admin .afis-diag-cle strong { display: block; font-size: 26px; line-height: 1.1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.afis-hub-admin .afis-diag-cle span { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--h-doux); }
.afis-hub-admin .afis-diag-point { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-top: 3px; background: var(--h-bord); }
.afis-hub-admin .afis-diag-point.ok { background: var(--h-vert); }
.afis-hub-admin .afis-diag-point.avert { background: var(--h-ambre); }
.afis-hub-admin .afis-diag-point.echec { background: var(--h-rouge); }
.afis-hub-admin .afis-diag-point.info { background: var(--h-accent); }
.afis-hub-admin .afis-diag-table tr.etat-echec td { background: var(--h-rouge-doux); }
.afis-hub-admin .afis-diag-table tr.etat-avert td { background: var(--h-ambre-doux); }
.afis-hub-admin .afis-diag-trace { font-size: 11px; color: var(--h-rouge); }
.afis-hub-admin a.actif { font-weight: 700; text-decoration: underline; }
.afis-hub-admin a:not(.button) { color: var(--h-accent); }
.afis-hub-admin .afis-cdm-form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.afis-hub-admin .afis-cdm-form-inline label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
@media (max-width: 640px) {
    .afis-hub-admin table.form-table th, .afis-hub-admin table.form-table td { display: block; width: auto; padding: 4px 0; }
    .afis-hub-admin .regular-text { width: 100%; }
}

/* ==================================================================
   2.29.4 : AFFICHAGE TELEPHONE ET TABLETTE
   Tableaux de reglages du planning qui defilent dans leur bloc au
   lieu d'etre coupes, cibles tactiles d'au moins 40 px, petits
   libelles portes a 12 px sur telephone.
   ================================================================== */
.afis-hub, .afis-vigie, .afis-portail { min-width: 0; }
.afis-hub img, .afis-vigie img, .afis-portail img { max-width: 100%; height: auto; }

@media (max-width: 760px) {
    .afis-plan-horaires,
    .afis-plan-types,
    .afis-hub-admin table.widefat,
    .afis-hub .afis-table-defile {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .afis-plan-form > * { min-width: 0; }

}

@media (max-width: 1024px) {
    :is(.afis-hub, .afis-vigie, .afis-portail) :is(
        small, .lib, .afis-hub-sur, .afis-etat, .afis-jour-sur, .afis-reg-n-lib,
        .afis-reg-label, .afis-vignette-sur, .afis-vignette-statut, .afis-puce,
        .cdmx-statut, .site, .afis-bloc-etat, .afis-apt-tag, .afis-j1,
        .afis-note-type, .afis-notam-classe, .afis-pied-lib, .afis-hub-pastille, th
    ) {
        font-size: 12px !important;
    }
    .afis-graph-boite .stat-legende { font-size: 12px; }
    .afis-hub-sur { font-size: 12px; }
    :is(.afis-hub, .afis-vigie, .afis-portail) [style*="font-size:11px"],
    :is(.afis-hub, .afis-vigie, .afis-portail) [style*="font-size:10px"] { font-size: 12px !important; }
}

@media (pointer: coarse), (max-width: 760px) {
    .afis-plan-mois > a {
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .afis-plan-jours ul li a,
    .afis-reg-table td > a,
    .cdmx-retour,
    .afis-reg-lien,
    .afis-retirer,
    .afis-apt-lien {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
    }
    .afis-plan-saisie summary,
    #afis-plan-outils summary,
    #afis-plan-reglages summary,
    .afis-hub details > summary {
        min-height: 40px;
        box-sizing: border-box;
        padding-top: 9px;
        padding-bottom: 9px;
    }
}

/* 2.29.4 : grille du planning sur tablette tactile — creneaux et cases vides
   assez hauts pour le doigt, chiffres lisibles ; la grille defile deja de cote. */
@media (pointer: coarse) {
    .afis-plan-c {
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        margin: 2px 0;
    }
    .afis-plan-plus { min-height: 32px; }
    .afis-plan-grille th, .afis-plan-grille td { min-width: 44px; }
    .afis-plan-grille thead th span, .afis-plan-pct { font-size: 12px; }
}

/* 2.30.0 : saisie d'une vacation passee */
.afis-retro > summary { list-style: none; cursor: pointer; display: inline-flex; }
.afis-retro > summary::-webkit-details-marker { display: none; }
.afis-retro[open] > summary { margin-bottom: 12px; }
.afis-retro-form { border: 1px solid var(--h-bord); border-radius: 8px; padding: 14px; background: var(--h-fond2); }
.afis-retro-grille { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 12px; }
@media (max-width: 560px) { .afis-retro-grille { grid-template-columns: minmax(0, 1fr); } }
.afis-retro-champ { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.afis-retro-champ > span { font-size: 13px; color: var(--h-doux); }
.afis-retro-champ input, .afis-retro-champ select { min-height: 42px; max-width: 100%; }
.afis-retro-lignes { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.afis-retro-ligne { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end;
    padding: 8px; border: 1px dashed var(--h-bord); border-radius: 6px; background: var(--h-fond); }
.afis-retro-moi { font-size: 18px; min-height: 42px; display: flex; align-items: center; }
.afis-retro-motif { margin: 12px 0 4px; }
@media (max-width: 560px) {
    .afis-retro-ligne { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .afis-retro-ligne > .afis-retro-champ:first-child { grid-column: 1 / -1; }
}

/* 2.30.0 : import Excel du cahier de marche */
.afis-impx-etapes { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 18px; padding: 0; }
.afis-impx-etapes li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px;
    background: var(--h-fond2); color: var(--h-doux); font-size: 14px; }
.afis-impx-etapes li .num { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--h-fond3); font-weight: 700; font-size: 12px; }
.afis-impx-etapes li.actif { background: var(--h-accent); color: #fff; font-weight: 600; }
.afis-impx-etapes li.actif .num { background: rgba(255,255,255,.25); }
.afis-impx-etapes li.fait { color: var(--h-vert); }
.afis-impx-depot { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px;
    background: var(--h-fond2); border-radius: var(--h-rayon); margin-bottom: 8px; }
.afis-impx-fichier { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 260px; }
.afis-impx-fichier span, .afis-impx-champ > span { font-size: 13px; color: var(--h-doux); }
.afis-impx-fichier input { max-width: 100%; }
.afis-impx-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; margin-bottom: 14px; }
.afis-impx-champ { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.afis-impx-champ select { min-height: 42px; max-width: 100%; padding: 6px 8px; border: 1px solid var(--h-bord); border-radius: 8px;
    background: var(--h-fond); color: var(--h-texte); }
.afis-impx-agents { border: 1px solid var(--h-bord); border-radius: var(--h-rayon); padding: 10px 14px; margin: 0 0 14px; min-width: 0; }
.afis-impx-agents legend { font-weight: 600; padding: 0 4px; }
.afis-impx-cols { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.afis-impx-col { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 10px; border: 1px solid var(--h-bord);
    border-radius: 20px; background: var(--h-fond); cursor: pointer; max-width: 100%; font-size: 14px; }
.afis-impx-col span { overflow-wrap: anywhere; }
.afis-impx-col:has(input:checked) { border-color: var(--h-accent); background: var(--h-accent-doux); font-weight: 600; }
.afis-impx-sous { margin: 18px 0 8px; font-size: 15px; }
.afis-impx-apercu td { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.afis-impx-comptes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px; margin: 0 0 16px; }
.afis-impx-comptes > div { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--h-bord); border-radius: var(--h-rayon); background: var(--h-fond); }
.afis-impx-comptes strong { font-size: 24px; line-height: 1.2; }
.afis-impx-comptes span { font-size: 13px; color: var(--h-doux); }
.afis-impx-comptes .ok strong { color: var(--h-vert); }
.afis-impx-comptes .info strong { color: var(--h-accent); }
.afis-impx-comptes .ko { border-color: var(--h-rouge); }
.afis-impx-comptes .ko strong { color: var(--h-rouge); }
.afis-impx-resolution { padding: 14px; background: var(--h-fond2); border-radius: var(--h-rayon); margin-bottom: 8px; }
.afis-impx-inconnus { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; margin-bottom: 10px; }
.afis-impx-barre { height: 12px; border-radius: 6px; background: var(--h-fond3); overflow: hidden; margin: 6px 0; }
.afis-impx-barre span { display: block; height: 100%; background: var(--h-accent); transition: width .3s; }
.afis-impx-abandon { margin-top: 10px; }
.afis-impx .afis-pil-actions form { margin: 0; }
.afis-impx-lu { color: var(--h-vert); font-size: 12px; font-weight: 600; }
.afis-impx-detail td.mono { white-space: nowrap; }
.afis-impx-detail td:last-child { min-width: 220px; }
.afis-impx .afis-hub-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- 2.34.0 : dossiers DSAC ---------- */

.afis-dsac { --dsac-violet: #6f42c1; --dsac-violet-doux: #f0e9fb; }
.afis-hub.nuit .afis-dsac, .afis-hub.nuit.afis-dsac { --dsac-violet: #b392f0; --dsac-violet-doux: #2a1f3d; }
.afis-portail .afis-dsac { margin: 0 0 34px; padding: 0; }
.afis-dsac-vide, .afis-dsac-note { color: var(--h-doux); font-size: 14px; margin: 8px 0; }

.afis-dsac-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.afis-dsac-ligne {
    display: grid; grid-template-columns: auto 1fr auto; gap: 10px 14px; align-items: center;
    padding: 12px 14px; background: var(--h-fond); border: 1px solid var(--h-bord);
    border-left: 4px solid var(--h-bord); border-radius: 10px;
}
.afis-dsac-ligne.urg-proche { border-left-color: var(--h-ambre); }
.afis-dsac-ligne.urg-urgente, .afis-dsac-ligne.urg-depassee { border-left-color: var(--h-rouge); }
.afis-dsac-corps { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.afis-dsac-motif { font-size: 14px; color: var(--h-doux); }
.afis-dsac-dates { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--h-doux); align-items: center; }
.afis-dsac-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.afis-dsac-actions form { margin: 0; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.afis-dsac-actions .afis-hub-btn { min-height: 38px; padding: 0 12px; font-size: 13px; }
.afis-dsac-depot label { font-size: 13px; color: var(--h-doux); display: inline-flex; gap: 6px; align-items: center; }
.afis-dsac input[type="date"], .afis-dsac input[type="text"], .afis-dsac input[type="tel"], .afis-dsac select, .afis-dsac textarea {
    min-height: 38px; padding: 6px 9px; border: 1px solid var(--h-bord); border-radius: 8px;
    background: var(--h-fond); color: var(--h-texte); font: inherit; font-size: 14px; max-width: 100%;
}

/* Pastille de statut (repli quand le moteur ne fournit pas son bouton) */
.afis-dsac-bouton {
    display: inline-flex; gap: 5px; align-items: center; padding: 5px 11px; border-radius: 8px;
    font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
    background: var(--h-fond3); color: var(--h-doux);
}
.afis-dsac-bouton.info   { background: var(--h-accent-doux); color: var(--h-accent); }
.afis-dsac-bouton.violet { background: var(--dsac-violet-doux); color: var(--dsac-violet); }
.afis-dsac-bouton.pret   { background: var(--h-vert-doux); color: var(--h-vert); border-color: var(--h-vert); border-style: dashed; }
.afis-dsac-bouton.ok     { background: var(--h-vert); color: #fff; }
.afis-dsac-bouton.chaud  { background: #fde8d5; color: #a2500d; }
.afis-dsac-bouton.alerte { background: var(--h-rouge-doux); color: var(--h-rouge); border-color: var(--h-rouge); }
.afis-hub.nuit .afis-dsac-bouton.chaud { background: #3a2410; color: #e39a4e; }

/* Compteurs et filtres de la liste */
.afis-dsac-compteurs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.afis-dsac-compteur {
    flex: 1 1 150px; padding: 10px 14px; border-radius: 10px; text-decoration: none; font-size: 13px;
    background: var(--h-fond2); color: var(--h-doux); border: 1px solid var(--h-bord);
}
.afis-dsac-compteur strong { display: block; font-size: 22px; color: var(--h-texte); }
.afis-dsac-compteur.alerte strong { color: var(--h-rouge); }
.afis-dsac-compteur.chaud strong { color: #a2500d; }
.afis-dsac-filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.afis-dsac-filtres label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--h-doux); }
.afis-dsac-filtres label { flex: 1 1 170px; min-width: 0; }
.afis-dsac-filtres select { width: 100%; }
.afis-dsac-table tr.urg-depassee td:first-child, .afis-dsac-table tr.urg-urgente td:first-child { box-shadow: inset 4px 0 0 var(--h-rouge); }
.afis-dsac-table tr.urg-proche td:first-child { box-shadow: inset 4px 0 0 var(--h-ambre); }
.afis-dsac-table .afis-dsac-actions { justify-content: flex-start; }
.afis-dsac-etapes { font-size: 12px; color: var(--h-doux); white-space: nowrap; }
.afis-dsac-grille td { white-space: nowrap; }
.afis-dsac-case { text-decoration: none; }
.afis-dsac-ech { display: block; font-size: 11px; color: var(--h-doux); margin-top: 2px; }

/* Fiche personnelle */
.afis-dsac-fiche { margin-top: 16px; border: 1px solid var(--h-bord); border-radius: 10px; background: var(--h-fond2); }
.afis-dsac-fiche summary { cursor: pointer; padding: 12px 14px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.afis-dsac-fiche .afis-dsac-note { padding: 0 14px; }
.afis-dsac-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; padding: 4px 14px 14px; }
.afis-dsac-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--h-doux); }
.afis-dsac-form .large { grid-column: 1 / -1; }
.afis-dsac-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Attestation a l'ecran */
.afis-dsac-att-outils { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.afis-dsac-att-ecran { background: var(--h-fond); border: 1px solid var(--h-bord); border-radius: 12px; padding: 18px 20px; overflow-x: auto; }
.afis-dsac-att { font-size: 14px; line-height: 1.55; }
.afis-dsac-att .att-entete { border-bottom: 2px solid var(--h-texte); padding-bottom: 8px; margin-bottom: 10px; font-size: 13px; }
.afis-dsac-att .att-entete span { color: var(--h-doux); }
.afis-dsac-att .att-titre { font-size: 17px; text-transform: uppercase; letter-spacing: .6px; text-align: center; margin: 12px 0 2px; }
.afis-dsac-att .att-sous { text-align: center; color: var(--h-doux); font-size: 13px; margin: 0 0 14px; }
.afis-dsac-att h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--h-doux); margin: 20px 0 8px; }
.afis-dsac-att .att-chiffres { width: 100%; border-collapse: separate; border-spacing: 8px 0; margin: 10px -8px; }
.afis-dsac-att .att-chiffres td { background: var(--h-fond2); border: 1px solid var(--h-bord); border-radius: 10px; padding: 10px 12px; vertical-align: top; }
.afis-dsac-att .att-chiffres td.ok { border-color: var(--h-vert); }
.afis-dsac-att .att-chiffres td.ko { border-color: var(--h-rouge); background: var(--h-rouge-doux); }
.afis-dsac-att .att-chiffres .lib { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--h-doux); }
.afis-dsac-att .att-chiffres .val { display: block; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.afis-dsac-att .att-conclusion { border-left: 4px solid var(--h-vert); background: var(--h-vert-doux); padding: 9px 12px; border-radius: 6px; }
.afis-dsac-att .att-conclusion.ko { border-left-color: var(--h-rouge); background: var(--h-rouge-doux); }
.afis-dsac-att .att-note { font-size: 13px; color: var(--h-doux); }
.afis-dsac-att .att-regles { font-size: 13px; color: var(--h-doux); padding-left: 18px; }
.afis-dsac-att .att-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.afis-dsac-att .att-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--h-doux); background: var(--h-fond2); padding: 7px 9px; border-bottom: 1px solid var(--h-bord); }
.afis-dsac-att .att-table td { padding: 6px 9px; border-bottom: 1px solid var(--h-bord); }
.afis-dsac-att .att-table tfoot td { font-weight: 700; border-top: 2px solid var(--h-texte); }
.afis-dsac-att .att-table .vide { color: var(--h-doux); font-style: italic; text-align: center; }
.afis-dsac-att .att-signature { width: 100%; margin-top: 20px; }
.afis-dsac-att .att-signature td { width: 50%; vertical-align: top; }
.afis-dsac-att .att-signature .cadre { border: 1px dashed var(--h-bord); height: 70px; border-radius: 8px; margin-top: 6px; }
.afis-dsac-att .att-mention { font-size: 12px; color: var(--h-doux); font-style: italic; }

@media (max-width: 680px) {
    .afis-dsac-ligne { grid-template-columns: 1fr; }
    .afis-dsac-actions { justify-content: flex-start; }
    .afis-dsac-att-ecran { padding: 12px; }
    .afis-dsac-att .att-chiffres, .afis-dsac-att .att-chiffres tbody, .afis-dsac-att .att-chiffres tr { display: block; margin: 0; }
    .afis-dsac-att .att-chiffres td { display: block; margin-bottom: 8px; }
}

/* Liste des dossiers : cartes quand la colonne de contenu est etroite (theme ou telephone) */
.afis-dsac .afis-pil-defile { container-type: inline-size; }
@container (max-width: 860px) {
    .afis-dsac-table thead { display: none; }
    .afis-dsac-table, .afis-dsac-table tbody { display: block; width: 100%; }
    .afis-dsac-table tr {
        display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px;
        border-bottom: 1px solid var(--h-bord); padding: 12px 14px; border-left: 4px solid transparent;
    }
    .afis-dsac-table tr.urg-depassee, .afis-dsac-table tr.urg-urgente { border-left-color: var(--h-rouge); }
    .afis-dsac-table tr.urg-proche { border-left-color: var(--h-ambre); }
    .afis-dsac-table td { display: block; border: 0; padding: 0; min-width: 0; }
    .afis-dsac-table td[data-lib]::before { content: attr(data-lib); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--h-doux); margin-bottom: 2px; }
    .afis-dsac-table td.afis-dsac-actions { grid-column: 1 / -1; display: flex; }
    .afis-dsac-table tr td:first-child { box-shadow: none !important; }
    .afis-dsac-etapes { white-space: normal; }
}

/* 2.41.0 : attestation fondée sur des données déclarées (cahier de marche non utilisé) */
.afis-dsac-att .att-declare { border: 1px solid var(--h-ambre); background: var(--h-ambre-doux); padding: 8px 12px; border-radius: 6px; }
