/* Pointage des intérimaires — feuille de style « mobile d'abord »
   Contrastes forts (lisible en extérieur), zones tactiles ≥ 44 px, aucune ressource externe. */
:root {
  --bleu: #1f4e79; --bleu-clair: #e8f0f8; --fond: #f4f6f9; --carte: #fff; --texte: #1b1f24; --discret: #5b6573;
  --bord: #d9dee5; --vert: #1e7e34; --vert-clair: #e3f4e7; --ambre: #b26a00; --ambre-clair: #fff3dc;
  --rouge: #c62828; --rouge-clair: #fdecea; --gris: #616161; --gris-clair: #eceff1;
  --rayon: 12px; --ombre: 0 1px 3px rgba(0,0,0,.08); --pied: 132px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texte); background: var(--fond); }
a { color: var(--bleu); }
h1 { font-size: 1.35rem; margin: .4rem 0 .8rem; }
h2 { font-size: 1.05rem; margin: 1.2rem 0 .6rem; }
.carte h2:first-child { margin-top: 0; }
small { font-size: .82rem; }
.discret { color: var(--discret); }
.centre { text-align: center; }
.vide { color: var(--discret); text-align: center; padding: 1rem; }
[hidden] { display: none !important; }

/* Barre supérieure */
.barre { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem;
  padding-top: max(.5rem, env(safe-area-inset-top)); background: var(--bleu); color: #fff; }
.barre__titre { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.barre__titre img { background: #fff; border-radius: 6px; }
.barre__reseau { margin-left: auto; background: var(--ambre); color: #fff; font-size: .78rem; padding: .2rem .5rem; border-radius: 99px; }
.menu { margin-left: auto; position: relative; }
.barre__reseau:not([hidden]) + .menu { margin-left: .25rem; }
.menu summary { list-style: none; cursor: pointer; font-size: 1.5rem; padding: .25rem .6rem; border-radius: 8px; user-select: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: rgba(255,255,255,.15); }
.menu__liste { position: absolute; right: 0; top: calc(100% + .4rem); width: min(85vw, 300px); background: var(--carte); color: var(--texte);
  border-radius: var(--rayon); box-shadow: 0 8px 24px rgba(0,0,0,.2); padding: .4rem 0; display: flex; flex-direction: column; }
.menu__liste a, .menu__liste .lien { display: block; padding: .8rem 1rem; color: var(--texte); text-decoration: none; font-size: 1rem;
  text-align: left; width: 100%; background: none; border: 0; font: inherit; cursor: pointer; }
.menu__liste a:hover, .menu__liste .lien:hover { background: var(--bleu-clair); }
.menu__qui { padding: .6rem 1rem .8rem; border-bottom: 1px solid var(--bord); font-weight: 600; }
.menu__qui small { display: block; font-weight: 400; color: var(--discret); }
.pastille { display: inline-block; min-width: 1.3em; padding: 0 .35em; margin-left: .3em; border-radius: 99px; background: var(--rouge);
  color: #fff; font-size: .75rem; font-weight: 700; text-align: center; vertical-align: top; }

/* Mise en page */
.contenu { max-width: 1100px; margin: 0 auto; padding: .75rem .75rem 2rem; }
.contenu--avec-pied { padding-bottom: calc(var(--pied) + 1.5rem + env(safe-area-inset-bottom)); }
.carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1rem; margin-bottom: .9rem; }
.titre-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.titre-actions h1 { margin-right: auto; }
.rangee { display: flex; gap: .5rem; flex-wrap: wrap; }
.grille-2 { display: grid; gap: 0 .9rem; }
@media (min-width: 800px) { .grille-2 { grid-template-columns: 1fr 1fr; } h1 { font-size: 1.6rem; } }

/* Boutons */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 44px; padding: .55rem 1rem;
  border: 1px solid var(--bord); border-radius: 10px; background: var(--carte); color: var(--texte); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; }
.bouton:active { transform: scale(.98); }
.bouton--principal { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.bouton--secondaire { background: var(--vert-clair); border-color: var(--vert); color: var(--vert); }
.bouton--danger { background: var(--rouge-clair); border-color: var(--rouge); color: var(--rouge); }
.bouton--lien { border: 0; background: none; color: var(--bleu); padding-left: 0; padding-right: 0; }
.bouton--danger-texte { color: var(--rouge); }
.bouton--large { width: 100%; font-size: 1.05rem; min-height: 52px; }
.bouton--petit { min-height: 34px; padding: .3rem .7rem; font-size: .85rem; }
.bouton--icone { width: 44px; padding: 0; font-size: 1.5rem; }
.bouton[disabled], .inactif { opacity: .4; pointer-events: none; }

/* Messages et bandeaux */
.messages { margin-bottom: .75rem; }
.message { padding: .75rem 1rem; border-radius: 10px; margin-bottom: .5rem; background: var(--bleu-clair); }
.message--success { background: var(--vert-clair); color: var(--vert); }
.message--error { background: var(--rouge-clair); color: var(--rouge); }
.message--warning { background: var(--ambre-clair); color: var(--ambre); }
.bandeau { display: block; padding: .7rem .9rem; border-radius: 10px; margin: .5rem 0 .8rem; background: var(--bleu-clair); text-decoration: none; color: var(--texte); }
.bandeau--ok { background: var(--vert-clair); color: var(--vert); }
.bandeau--alerte { background: var(--ambre-clair); color: #7a4800; }
.bandeau form { margin-top: .5rem; }

/* Formulaires */
input, select, textarea { font: inherit; width: 100%; min-height: 44px; padding: .55rem .7rem; border: 1px solid var(--bord); border-radius: 10px; background: #fff; color: var(--texte); }
input[type=checkbox], input[type=radio] { width: 1.3rem; height: 1.3rem; min-height: 0; vertical-align: middle; accent-color: var(--bleu); }
input:focus, select:focus, textarea:focus, .bouton:focus-visible, .choix__btn:focus-visible { outline: 3px solid #7fb2e5; outline-offset: 1px; }
label { display: block; font-weight: 600; font-size: .92rem; }
.formulaire .champ { margin-bottom: .9rem; }
.formulaire label + input, .formulaire label + select, .formulaire label + textarea { margin-top: .3rem; }
.champ--case label { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.champ small { display: block; margin-top: .25rem; }
.erreur { color: var(--rouge); }
.champ--erreur input, .champ--erreur select { border-color: var(--rouge); }
.connexion { max-width: 380px; margin: 8vh auto 0; text-align: center; }
.connexion form { text-align: left; margin-top: 1rem; }
.connexion label { margin-bottom: .9rem; }
.connexion label input { margin-top: .3rem; }
.filtres { display: grid; grid-template-columns: 1fr; gap: .5rem; margin-bottom: .8rem; }
@media (min-width: 700px) { .filtres { grid-template-columns: 2fr 1fr 1fr 1fr auto; } }
.filtres-avances summary { cursor: pointer; font-size: .95rem; }
.grille-filtres { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .8rem; }
.grille-filtres label { font-size: .82rem; font-weight: 600; }
.grille-filtres label > * { margin-top: .2rem; }
.grille-filtres .bouton, .grille-filtres .champ--case { grid-column: 1 / -1; }
@media (min-width: 800px) { .grille-filtres { grid-template-columns: repeat(4, 1fr); } .grille-filtres .bouton { grid-column: auto; } }

/* Navigation par date */
.navdate { display: flex; align-items: center; gap: .5rem; margin: .3rem 0 .6rem; }
.navdate__jour { flex: 1; text-align: center; background: var(--carte); border-radius: 10px; padding: .4rem; box-shadow: var(--ombre); }
.navdate__jour strong { display: block; text-transform: capitalize; }
.navdate__jour small { color: var(--bleu); font-weight: 600; }
.entete-feuille__depot { display: flex; align-items: center; gap: .5rem; }
.entete-feuille__depot h1 { margin: 0; }
.retour { font-size: 2rem; text-decoration: none; padding: 0 .5rem; line-height: 1; }
.retour-texte { display: inline-block; margin: .2rem 0; text-decoration: none; }

/* Liste de pointage */
.outils { display: flex; gap: .5rem; position: sticky; top: 56px; z-index: 10; background: var(--fond); padding: .4rem 0; }
.outils input { flex: 1; }
.outils .bouton { white-space: nowrap; }
.liste-pointage { list-style: none; margin: 0; padding: 0; }
.ligne { display: flex; align-items: center; gap: .5rem; background: var(--carte); border-radius: 10px; padding: .55rem .6rem .55rem .8rem;
  margin-bottom: .45rem; box-shadow: var(--ombre); border-left: 5px solid var(--bord); }
.ligne[data-statut="P"] { border-left-color: var(--vert); }
.ligne[data-statut="D"] { border-left-color: var(--ambre); }
.ligne[data-statut="A"] { border-left-color: var(--rouge); }
.ligne[data-statut="R"] { border-left-color: var(--gris); }
.ligne--attente { background: #fffdf3; }
.ligne--erreur { background: var(--rouge-clair); }
.ligne__qui { flex: 1; min-width: 0; }
.ligne__qui strong { display: block; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne__qui small { color: var(--discret); }
.choix { display: flex; gap: .3rem; flex-shrink: 0; border: 0; padding: 0; margin: 0; }
.choix__btn { width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--bord); background: #fff; font: inherit; font-weight: 800;
  font-size: 1.05rem; color: var(--discret); cursor: pointer; touch-action: manipulation; padding: 0; }
@media (min-width: 400px) { .choix__btn { width: 48px; height: 48px; } }
.choix__btn--P[aria-checked=true] { background: var(--vert); border-color: var(--vert); color: #fff; }
.choix__btn--D[aria-checked=true] { background: var(--ambre); border-color: var(--ambre); color: #fff; }
.choix__btn--A[aria-checked=true] { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.choix__btn--R[aria-checked=true] { background: var(--gris); border-color: var(--gris); color: #fff; }
.statut-fige { display: inline-block; padding: .4rem .7rem; border-radius: 99px; font-weight: 700; font-size: .85rem; text-decoration: none; white-space: nowrap;
  background: var(--gris-clair); color: var(--gris); }
.statut-fige--P { background: var(--vert-clair); color: var(--vert); }
.statut-fige--D { background: var(--ambre-clair); color: var(--ambre); }
.statut-fige--A { background: var(--rouge-clair); color: var(--rouge); }
a.statut-fige::after { content: " ✎"; }
.legende { text-align: center; font-size: .8rem; }
.choix--grand { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.choix--grand legend { font-weight: 600; margin-bottom: .4rem; }
.choix__radio { display: flex; align-items: center; gap: .5rem; padding: .8rem; border: 2px solid var(--bord); border-radius: 10px; font-weight: 600; }
.choix__radio:has(input:checked) { border-color: var(--bleu); background: var(--bleu-clair); }
.choix__radio:has(input:disabled) { opacity: .4; }

/* Pied fixe du pointage */
.pied-pointage { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--carte); box-shadow: 0 -2px 12px rgba(0,0,0,.12);
  padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom)); }
.pied-pointage > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.compteurs { display: flex; flex-wrap: wrap; gap: .3rem .8rem; justify-content: center; font-size: .88rem; margin-bottom: .5rem; }
.compteur b { font-size: 1.05rem; }
.compteur--P b { color: var(--vert); } .compteur--D b { color: var(--ambre); } .compteur--A b { color: var(--rouge); } .compteur--R b { color: var(--gris); }
.compteur--total { font-weight: 700; }
.synchro { text-align: center; font-size: .85rem; color: var(--ambre); margin-bottom: .4rem; }
.synchro--ok { color: var(--vert); }

/* Cartes de dépôts, listes */
.cartes-depots, .liste-simple { list-style: none; padding: 0; margin: 0; }
.carte--lien, .liste-simple li > a, .liste-simple li:not(:has(a)) { display: flex; align-items: center; justify-content: space-between; gap: .75rem; text-decoration: none; color: var(--texte); }
.cartes-depots .carte small, .liste-simple small { display: block; }
.liste-simple li { background: var(--carte); border-radius: 10px; margin-bottom: .4rem; box-shadow: var(--ombre); padding: .7rem .9rem; }
.liste-simple--compacte li { padding: .5rem .8rem; box-shadow: none; border-bottom: 1px solid var(--bord); border-radius: 0; margin: 0; }
.droite { text-align: right; flex-shrink: 0; }
.carte--alerte { border-left: 5px solid var(--ambre); }
.etat--VALIDE { border-left: 5px solid var(--vert); }
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--gris-clair); color: var(--gris); }
.tag--alerte, .tag--NON_COMMENCE, .tag--FACTURE_NON_POINTE, .tag--DOUBLON_FACTURE, .tag--MATRICULE_INCONNU { background: var(--rouge-clair); color: var(--rouge); }
.tag--EN_COURS, .tag--info, .tag--ECART_JOURNEES, .tag--ECART_DEPOT, .tag--POINTAGE_NON_VALIDE { background: var(--ambre-clair); color: var(--ambre); }
.tag--VALIDE { background: var(--vert-clair); color: var(--vert); }
.tag--POINTE_NON_FACTURE { background: var(--bleu-clair); color: var(--bleu); }
.fiche { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.fiche dt { color: var(--discret); } .fiche dd { margin: 0; font-weight: 600; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1rem 0; }
.erreurs { color: var(--rouge); font-size: .9rem; max-height: 320px; overflow: auto; }
.correction__changement { font-size: 1.05rem; }
.correction__actions input { margin-bottom: .5rem; }
.correction__actions .rangee .bouton { flex: 1; }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: .9rem; }
@media (min-width: 800px) { .kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.kpi { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: .8rem; }
.kpi b { display: block; font-size: 1.5rem; color: var(--bleu); font-variant-numeric: tabular-nums; }
.kpi span { font-size: .82rem; color: var(--discret); }
.kpi--alerte b { color: var(--rouge); } .kpi--ok b { color: var(--vert); }
.barres { list-style: none; padding: 0; margin: 0; }
.barres li { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; align-items: center; gap: .5rem; padding: .25rem 0; font-size: .88rem; }
.barres__libelle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barres__piste { height: 14px; background: var(--gris-clair); border-radius: 99px; overflow: hidden; }
.barres__valeur { display: block; height: 100%; width: 0; background: var(--bleu); border-radius: 99px; transition: width .4s; }
.barres__nombre { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 3.5em; text-align: right; }
.histogramme { display: flex; align-items: flex-end; gap: 2px; height: 140px; overflow-x: auto; }
.histogramme__col { flex: 1 0 8px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.histogramme__barre { display: block; width: 100%; height: 0; background: var(--bleu); border-radius: 3px 3px 0 0; min-height: 1px; transition: height .4s; }
.histogramme__col small { font-size: .6rem; color: var(--discret); }

/* Tableaux */
.tableau-defilant { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; }
.tableau { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tableau th, .tableau td { padding: .5rem .6rem; border-bottom: 1px solid var(--bord); text-align: left; white-space: nowrap; }
.tableau th { background: var(--bleu-clair); font-weight: 700; position: sticky; top: 0; }
.tableau--serre th, .tableau--serre td { padding: .35rem .5rem; font-size: .8rem; }
.nombre { text-align: right !important; font-variant-numeric: tabular-nums; }
.ligne-alerte td { background: #fff8e6; }
.telechargements { display: grid; gap: .6rem; }
@media (min-width: 700px) { .telechargements { grid-template-columns: 1fr 1fr; } .telechargements p { grid-column: 1 / -1; } }

/* Page de connexion */
.page-connexion { background: linear-gradient(160deg, var(--bleu) 0 40%, var(--fond) 40%); min-height: 100vh; }
