/* Écran d'un module de saisie (saisie.js), interface 2.0 : propriété de l'agent SAISIE.
   Chargé par index.html après grille.css. Uniquement les jetons de app.css (docs/INTERFACE.md, points 8 et 9) : aucune
   couleur en dur, aucun attribut style dans le HTML produit. L'hôte de l'écran porte la classe .metier-hote et
   l'attribut data-ecran="saisie" (docs/INTERFACE.md, section 12). La page ne défile jamais : seuls les panneaux internes. */

.metier-hote[data-ecran="saisie"] { overflow: hidden; }
.sa-ecran { flex: 1 1 0; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.sa-avis { flex: none; padding: var(--e2) var(--e4); border-bottom: 1px solid var(--line); background: var(--bg-1); }
.sa-avis[hidden] { display: none; }
/* Outil de données actif (Données > Outils de données) : la grille est filtrée sur son résultat, annoncé ici. */
.sa-outil { flex: none; gap: var(--e3); overflow: hidden; }
.sa-outil[hidden] { display: none; }
.sa-outil .note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Filtres de dimension reçus du département (piste du diagnostic, filtrage croisé) : « Filtré : mine KK, régolithe Sap ». */
.sa-filtre { flex: none; gap: var(--e3); overflow: hidden; }
.sa-filtre[hidden] { display: none; }
.sa-filtre strong { flex: none; font-size: var(--fs-s); }
.sa-filtre .note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-filtre .btn { flex: none; }
.sa-corps { flex: 1 1 0; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.sa-defile { flex: 1 1 0; min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--grid-bg); }

/* Grille horaire du Dispatcher : une case par engin et par heure ; l'état est écrit (OP, MT, SB, AR), jamais la couleur seule. */
.sa-barre { flex: none; gap: var(--e4); overflow: hidden; }
.sa-legende { display: flex; align-items: center; gap: var(--e4); list-style: none; color: var(--ink-2); font-size: var(--fs-s); white-space: nowrap; }
.sa-legende li { display: inline-flex; align-items: center; gap: var(--e2); }
.sa-legende .sa-case { width: 24px; height: 16px; cursor: default; }
/* Légende de la grille horaire dans sa bulle « Légende » (bulles.js, 04/11/2026) : liste verticale, sans retrait. */
.sa-legende.sa-legende-liste { flex-direction: column; align-items: flex-start; gap: var(--e2); margin: 0; padding: 0; white-space: normal; }
.sa-legende.sa-legende-liste li + li { margin-top: 0; }
.sa-horaire .sa-c-tot { width: 44px; }
.sa-horaire th.sa-h, .sa-horaire td.sa-h { padding: 0; text-align: center; }
.sa-horaire td.sa-h { border-left: 1px solid var(--grid-line); }
.sa-case { width: 100%; height: 100%; min-height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink-2); font: 600 var(--fs-s)/1 var(--font); cursor: pointer; }
.sa-case:hover { background: var(--survol); }
.sa-case:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sa-case[aria-disabled="true"] { cursor: default; }
.sa-case.e-OP { background: var(--ok-bg); color: var(--ok); }
.sa-case.e-MT { background: var(--bad-bg); color: var(--bad); }
.sa-case.e-SB { background: var(--warn-bg); color: var(--warn); }
.sa-case.e-AR { background: var(--info-bg); color: var(--info); }
.sa-case.e-vide { color: var(--ink-2); font-weight: 400; }
.sa-case.sa-prov { outline: 1px dashed currentColor; outline-offset: -3px; }
.sa-case.sa-prov:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* Indicateurs du jour : une rangée par indicateur, champs posés dans les cellules. */
.sa-ind td.sa-in { padding: 1px 2px; }
.sa-ind .champ { height: 20px; }
.sa-ind .champ.n { text-align: right; }
.sa-ind .champ:disabled { background: transparent; border-color: transparent; color: var(--ink-2); }
.sa-ind tr.sa-groupe th { background: var(--bg-2); color: var(--ink-2); font-size: var(--fs-s); font-weight: 600; }
.sa-ind .puce { margin-left: var(--e2); }

/* Indicateurs refusés par le serveur : valeurs remises dans les champs, motif écrit dans la colonne Statut (pas la couleur seule). */
.sa-ind .sa-refus { display: block; overflow: hidden; color: var(--bad); font-size: var(--fs-s); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

/* Ruban : action du circuit en cours (aria-disabled garde le focus clavier, contrairement à disabled) ; pictogramme
   retourné pour « Rétablir » (Ctrl+Y) tant que le jeu commun n'a pas de pictogramme « refaire ». */
.sa-miroir .ic { transform: scaleX(-1); }

/* Panneau Détail */
.sa-actions { display: flex; flex-wrap: wrap; gap: var(--e2); }
.sa-actions .btn[aria-disabled="true"] { cursor: progress; }
.sa-zone-histo { min-width: 0; }
.sa-histo li { align-items: flex-start; }
.sa-histo li > span { min-width: 0; overflow-wrap: anywhere; }

/* Panneau Contrôles et alertes du module : une ligne en alerte par bouton (niveau écrit, jamais la couleur seule). */
.sa-alertes li { align-items: stretch; }
.sa-lien { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: var(--e3); padding: 1px var(--e2); border: 1px solid transparent; border-radius: var(--r1); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.sa-lien:hover { background: var(--survol); }
.sa-lien:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sa-lien strong { flex: none; color: var(--warn); font-weight: 600; }
.sa-lien span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Contrat R4 : sous chaque ligne, ses motifs comme dans la bulle de la grille (niveau écrit, champ, message, correction),
   filet gauche de forme propre au niveau (plein et épais : bloquant ; tirets : à vérifier ; points : information). */
.sa-alertes li.sa-al { flex-direction: column; gap: 1px; padding: 2px 0 2px var(--e2); border-left: 2px dashed var(--warn); }
.sa-alertes li.sa-al.e { border-left: 3px solid var(--bad); }
.sa-al.e > .sa-lien strong { color: var(--bad); }
.sa-motifs { display: grid; gap: 2px; margin: 0; padding: 0 0 0 var(--e4); list-style: none; }
.sa-motifs li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--e2); min-height: 0; line-height: 1.4; overflow-wrap: anywhere; }
.sa-m-niv { font-weight: 600; color: var(--warn); }
.sa-motifs li.e .sa-m-niv { color: var(--bad); }
.sa-motifs li.i .sa-m-niv { color: var(--info); }
.sa-m-champ { color: var(--ink); font-weight: 600; }
.sa-m-champ::after { content: " :"; font-weight: 400; color: var(--ink-2); }
.sa-m-msg { color: var(--ink-2); }
.sa-m-cor { flex-basis: 100%; color: var(--ink); }
/* Panneau Détail : motifs de la ligne, même lecture (filet de forme par niveau, correction sous le motif). */
.sa-motif { border-left: 2px dashed var(--warn); margin: 1px var(--e4); }
.sa-motif.e { border-left: 3px solid var(--bad); }
.sa-motif.i { border-left: 2px dotted var(--info); }
.sa-motif .d-note { padding: 1px var(--e3); }
.sa-motif.e .d-note.alerte strong { color: var(--bad); }
.sa-correction { color: var(--ink); }

/* Collage depuis Excel : texte collé, aperçu des lignes lues, rejets du serveur */
.sa-ordre { display: flex; flex-wrap: wrap; gap: var(--e2); }
.sa-texte { height: 132px; min-height: 66px; }
.sa-apercu { display: grid; gap: var(--e3); }
.sa-apercu:empty { display: none; }
.sa-apercu-t { max-height: 220px; overflow: auto; border: 1px solid var(--line); }
.sa-apercu-t .tableau { table-layout: auto; }
.sa-rejets { max-height: 120px; overflow: auto; padding-left: var(--e5); color: var(--ink); font-size: var(--fs-s); line-height: 1.5; }

/* Lot E : clôture de période. Bandeau compact au-dessus de la grille (état écrit : « Mois clôturé », jamais la couleur seule). */
.sa-cloture { flex: none; gap: var(--e3); overflow: hidden; background: var(--warn-bg); color: var(--warn); }
.sa-cloture[hidden] { display: none; }
.sa-cloture strong { flex: none; font-size: var(--fs-s); font-weight: 600; }
.sa-rb-clot { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }

/* Lot E : commentaires d'une ligne (panneau Détail). Pastille du titre : nombre écrit (« 2 non résolus »). */
.sa-com-n[hidden] { display: none; }
.sa-com .d-titre .puce { margin-left: auto; border-color: currentColor; color: var(--warn); }
.sa-com-liste li { display: block; min-height: 0; padding: var(--e2) 0; border-bottom: 1px solid var(--grid-line); }
.sa-com-liste li:last-child { border-bottom: 0; }
.sa-com-tete { display: flex; align-items: baseline; gap: var(--e3); min-width: 0; }
.sa-com-tete strong { min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sa-com-tete .puce { margin-left: auto; }
.sa-com-texte { color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.sa-com-liste li.resolu .sa-com-texte { color: var(--ink-2); }
.sa-com-pied { color: var(--ink-2); }
.sa-com-form { padding-top: var(--e2); }
.sa-com-saisie { min-height: 48px; font-family: var(--font); }
.sa-com-form .actions { flex-wrap: nowrap; justify-content: space-between; }
.sa-com-m { min-width: 0; overflow-wrap: anywhere; }

/* 2.33.0 (lot 1, cadre commun des écrans). Bande de la feuille (registre bandes_feuille.js) et bandeau des valeurs
   proposées par le lien (« ?nouveau= ») : texte du niveau toujours écrit, couleur par jetons ; explication dans la bulle. */
.sa-bande-info { background: var(--info-bg); color: var(--info); }
.sa-bande-ok { background: var(--ok-bg); color: var(--ok); }
.sa-bande-attention { background: var(--warn-bg); color: var(--warn); }
.sa-bande-alerte { background: var(--bad-bg); color: var(--bad); }
.sa-bande strong, .sa-nouveau strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sa-nouveau .btn { margin-left: auto; }
/* Import d'un fichier CSV : réglages de lecture, colonnes rattachées aux champs, valeurs pour tout le fichier. */
.sa-csv-reglages { flex-wrap: wrap; gap: var(--e4); padding: var(--e2) 0; }
.sa-csv-reglages[hidden] { display: none; }
.sa-csv-t select { max-width: 26ch; }
.sa-csv-ex { max-width: 32ch; overflow: hidden; color: var(--ink-2); text-overflow: ellipsis; white-space: nowrap; }
.sa-csv-fixes-f { margin: 0; padding: var(--e3) var(--e4); border: 1px solid var(--line); border-radius: var(--r2); }
.sa-csv-fixes-f legend { padding: 0 var(--e2); color: var(--ink-2); font-size: var(--fs-s); }
.sa-csv-grille { display: flex; flex-wrap: wrap; gap: var(--e4); }
.sa-csv-grille .champ { max-width: 22ch; }
/* 2.33.0 (intégration) : volet de la feuille (registre volets_feuille.js) : levés de mesure saisis avant la 2.33.0. */
/* Lot 10 (relecture R3, défaut 2) : le volet ouvert ne pousse jamais la grille à zéro ; il défile seul. */
.sa-volet { flex: none; max-height: 40%; overflow: auto; padding: var(--e3) 0; }
.sa-volet[hidden] { display: none; }
.sa-volet-det > summary { cursor: pointer; padding: var(--e2) 0; }
.sa-volet tr.annule td { color: var(--ink-2); text-decoration: line-through; }
.sa-volet-motif { display: flex; flex-wrap: wrap; gap: var(--e3); align-items: end; padding-top: var(--e2); }
.sa-volet-motif[hidden] { display: none; }
