/* Checklist NFC — feuille de style (thème clair / sombre) */
:root {
  --fond: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-3: #e8ebf0;
  --texte: #141820;
  --texte-2: #444c5a;
  --discret: #6a7280;
  --bordure: #e2e5ea;
  --bordure-forte: #cfd4dc;
  --grille: #e6e8ec;
  --axe: #c3c7cf;
  --primaire: #1f5aa6;
  --primaire-fort: #174787;
  --primaire-doux: #e7eef8;
  --sur-primaire: #ffffff;
  --succes: #0b7a0b;
  --danger: #c0352f;
  --danger-doux: #fbeceb;
  --avert-doux: #fdf4e1;
  --etat-ok: #0ca30c;
  --etat-anomalie: #d03b3b;
  --etat-alerte: #e9a20c;
  --etat-neutre: #9aa0a8;
  --ombre: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --ombre-haute: 0 12px 32px rgba(16, 24, 40, .18);
  --rayon: 12px;
  --rayon-petit: 8px;
  --police: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0f1215; --surface: #171b20; --surface-2: #1d2228; --surface-3: #262c33;
    --texte: #e9ebee; --texte-2: #b9bfc8; --discret: #8e96a2; --bordure: #2a3038; --bordure-forte: #3a414b;
    --grille: #2a2f36; --axe: #3d434c; --primaire: #6aa5f2; --primaire-fort: #8db9f5; --primaire-doux: #1b2b40;
    --sur-primaire: #0c1420; --succes: #3fc03f; --danger: #f07167; --danger-doux: #3a1f1e; --avert-doux: #3a2f17;
    --ombre: 0 1px 2px rgba(0,0,0,.4); --ombre-haute: 0 12px 32px rgba(0,0,0,.55); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #0f1215; --surface: #171b20; --surface-2: #1d2228; --surface-3: #262c33;
  --texte: #e9ebee; --texte-2: #b9bfc8; --discret: #8e96a2; --bordure: #2a3038; --bordure-forte: #3a414b;
  --grille: #2a2f36; --axe: #3d434c; --primaire: #6aa5f2; --primaire-fort: #8db9f5; --primaire-doux: #1b2b40;
  --sur-primaire: #0c1420; --succes: #3fc03f; --danger: #f07167; --danger-doux: #3a1f1e; --avert-doux: #3a2f17;
  --ombre: 0 1px 2px rgba(0,0,0,.4); --ombre-haute: 0 12px 32px rgba(0,0,0,.55); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--fond); color: var(--texte); font-family: var(--police);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--primaire); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.55rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 640; }
h3 { font-size: .95rem; font-weight: 620; }
small, .discret { color: var(--discret); }
svg.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Structure ---------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }
.nav {
  width: 232px; flex: none; background: var(--surface); border-right: 1px solid var(--bordure);
  padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
}
.marque { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 1.05rem; }
.marque .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--primaire); color: var(--sur-primaire); display: grid; place-items: center; }
.marque .logo svg { width: 20px; height: 20px; }
.marque small { display: block; font-weight: 500; font-size: .75rem; }
.nav a.lien {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  color: var(--texte-2); font-weight: 550; text-decoration: none;
}
.nav a.lien:hover { background: var(--surface-2); color: var(--texte); }
.nav a.lien.actif { background: var(--primaire-doux); color: var(--primaire); }
.nav .bas { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.principal { flex: 1; min-width: 0; padding: 26px 30px 60px; max-width: 1320px; }
.entete { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.entete .titres { flex: 1; min-width: 220px; }
.entete .titres p { margin: 4px 0 0; color: var(--discret); }
.entete .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.barre-mobile, .onglets-mobile { display: none; }
.retour { display: inline-flex; align-items: center; gap: 6px; color: var(--discret); margin-bottom: 10px; font-weight: 550; }

/* ---- Composants --------------------------------------------------------- */
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 18px; min-width: 0; }
.carte > h2, .carte-titre { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.carte-titre h2 { flex: 1; }
.grille { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; } .s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
.pile { display: flex; flex-direction: column; gap: 16px; }
.ligne-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.espace { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 15px;
  border-radius: 9px; border: 1px solid var(--bordure-forte); background: var(--surface); color: var(--texte);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primaire { background: var(--primaire); border-color: var(--primaire); color: var(--sur-primaire); }
.btn.primaire:hover { background: var(--primaire-fort); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--bordure)); }
.btn.danger:hover { background: var(--danger-doux); }
.btn.fantome { border-color: transparent; background: transparent; }
.btn.fantome:hover { background: var(--surface-2); }
.btn.petit { min-height: 32px; padding: 4px 10px; font-size: .88rem; }
.btn.icone { padding: 0; width: 40px; }
.btn.icone.petit { width: 32px; }
.btn.grand { min-height: 52px; font-size: 1.02rem; padding: 10px 20px; }
.btn.bloc { width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primaire) 55%, transparent); outline-offset: 2px; }

input, select, textarea {
  font: inherit; color: var(--texte); background: var(--surface); border: 1px solid var(--bordure-forte);
  border-radius: 9px; padding: 9px 12px; min-height: 40px; width: 100%;
}
textarea { min-height: 76px; resize: vertical; }
input[type="color"] { padding: 3px; width: 48px; min-height: 36px; cursor: pointer; }
input[type="checkbox"] { width: auto; min-height: 0; }
label.champ { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--texte-2); }
label.champ small { font-weight: 400; }
.formulaire { display: grid; gap: 14px; }
.formulaire .deux { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.recherche { position: relative; flex: 1; min-width: 200px; }
.recherche svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--discret); }
.recherche input { padding-left: 38px; }

.puce {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; background: var(--surface-2); color: var(--texte); white-space: nowrap; border: 1px solid transparent;
}
.puce .point { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.puce.vide { border: 1px dashed var(--bordure-forte); background: transparent; color: var(--discret); }
.puce.grande { font-size: .95rem; padding: 6px 14px 6px 10px; }
.puce.grande .point { width: 12px; height: 12px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--texte-2); font-size: .78rem; font-weight: 650; letter-spacing: .02em; }
.badge.code { font-family: Consolas, "Cascadia Mono", monospace; }
.badge.encours { background: var(--primaire-doux); color: var(--primaire); }
.badge.termine { background: color-mix(in srgb, var(--etat-ok) 15%, transparent); color: var(--succes); }

.alerte { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--primaire-doux); color: var(--texte); margin-bottom: 14px; }
.alerte.avert { background: var(--avert-doux); }
.alerte.danger { background: var(--danger-doux); }
.alerte.ok { background: color-mix(in srgb, var(--etat-ok) 13%, var(--surface)); }
.alerte svg { margin-top: 1px; }

/* ---- Tableau de bord ------------------------------------------------------ */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 14px 16px; box-shadow: var(--ombre); display: block; color: inherit; text-decoration: none !important; }
a.kpi:hover { border-color: var(--bordure-forte); }
.kpi .lib { display: flex; align-items: center; gap: 7px; color: var(--discret); font-size: .84rem; font-weight: 600; }
.kpi .val { font-size: 1.9rem; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.kpi .val small { font-size: .9rem; font-weight: 600; }
.kpi .indic { width: 9px; height: 9px; border-radius: 50%; }
.anneau-bloc { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.graph-anneau { width: 190px; height: 190px; flex: none; }
.graph-anneau .arc:hover { opacity: .85; }
.anneau-valeur { font-size: 34px; font-weight: 700; fill: var(--texte); }
.anneau-libelle { font-size: 13px; fill: var(--discret); }
.legende { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 180px; }
.legende li { display: flex; align-items: center; gap: 9px; font-size: .9rem; }
.legende .leg-lib { flex: 1; color: var(--texte-2); }
.legende .leg-val { font-weight: 650; font-variant-numeric: tabular-nums; }
.legende .leg-val small { font-weight: 500; margin-left: 4px; }
.legende-ligne { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.legende-ligne li { font-size: .82rem; color: var(--texte-2); }
.pastille { width: 11px; height: 11px; border-radius: 3px; flex: none; display: inline-block; }
.graph-colonnes, .graph-courbe { width: 100%; height: auto; display: block; }
line.quad { stroke: var(--grille); stroke-width: 1; }
line.axe { stroke: var(--axe); stroke-width: 1; }
.tick { font-size: 11px; fill: var(--discret); font-variant-numeric: tabular-nums; }
.val-direct { font-size: 12px; font-weight: 700; fill: var(--texte); }
.zone-tip { fill: transparent; cursor: default; }
.zone-tip:hover { fill: color-mix(in srgb, var(--texte) 5%, transparent); }
.barres-h { display: flex; flex-direction: column; gap: 10px; }
.bh-ligne { display: grid; grid-template-columns: minmax(90px, 30%) 1fr 34px; align-items: center; gap: 10px; }
.bh-lib { font-size: .88rem; color: var(--texte-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-piste { height: 16px; }
.bh-barre { display: flex; height: 100%; gap: 2px; min-width: 4px; }
.bh-barre span { height: 100%; min-width: 3px; }
.bh-barre span:first-child { border-radius: 0; }
.bh-barre span:last-child { border-radius: 0 4px 4px 0; }
.bh-total { font-weight: 650; font-size: .88rem; text-align: right; font-variant-numeric: tabular-nums; }
.prog { display: flex; gap: 2px; height: 10px; border-radius: 6px; overflow: hidden; background: var(--grille); }
.prog span { height: 100%; }
.jauge-val { font-size: 21px; font-weight: 750; fill: var(--texte); }
.jauge-sous { font-size: 9.5px; fill: var(--discret); }
.liste-simple { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.liste-simple > li { padding: 11px 2px; border-bottom: 1px solid var(--bordure); display: flex; gap: 12px; align-items: center; }
.liste-simple > li:last-child { border-bottom: 0; }
.liste-simple .corps { flex: 1; min-width: 0; }
.liste-simple .corps .t { font-weight: 620; }
.liste-simple .corps .s { color: var(--discret); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vide-petit { color: var(--discret); text-align: center; padding: 18px 8px; margin: 0; }
.vide { text-align: center; padding: 46px 20px; }
.vide .ic-grand { width: 64px; height: 64px; border-radius: 18px; background: var(--primaire-doux); color: var(--primaire); display: inline-grid; place-items: center; margin-bottom: 14px; }
.vide .ic-grand svg { width: 32px; height: 32px; }
.vide h2 { margin-bottom: 8px; font-size: 1.2rem; }
.vide p { color: var(--discret); max-width: 520px; margin: 0 auto 18px; }

/* ---- Éléments -------------------------------------------------------------- */
.filtres { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filtres select { width: auto; min-width: 160px; }
.cartes-elements { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.carte-el {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre);
  display: flex; flex-direction: column; overflow: hidden; color: inherit; text-decoration: none !important; transition: border-color .12s, transform .12s;
  border-top: 4px solid var(--c, var(--etat-neutre));
}
.carte-el:hover { border-color: var(--bordure-forte); transform: translateY(-1px); }
.carte-el { position: relative; }
.carte-el .haut { padding-right: 40px !important; }
.suppr-rapide {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--bordure); border-radius: 8px; background: var(--surface); color: var(--discret); cursor: pointer;
  opacity: 0; transition: opacity .12s, color .12s, background .12s;
}
.suppr-rapide svg { width: 17px; height: 17px; }
.carte-el:hover .suppr-rapide, .suppr-rapide:focus-visible { opacity: 1; }
.suppr-rapide:hover { color: var(--danger); background: var(--danger-doux); border-color: var(--danger); }
@media (hover: none) { .suppr-rapide { opacity: .85; } }
.sel-case {
  display: none; position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 7px;
  border: 2px solid var(--bordure-forte); background: var(--surface); place-items: center; color: transparent;
}
.sel-case svg { width: 17px; height: 17px; }
.mode-selection .sel-case { display: grid; }
.mode-selection .suppr-rapide { display: none; }
.mode-selection .carte-el { cursor: pointer; }
.mode-selection .carte-el:hover { transform: none; }
.mode-selection .carte-el.choisi { outline: 2px solid var(--primaire); outline-offset: -1px; background: var(--primaire-doux); }
.mode-selection .carte-el.choisi .sel-case { background: var(--primaire); border-color: var(--primaire); color: var(--sur-primaire, #fff); }
.barre-sel {
  position: sticky; bottom: 16px; z-index: 15; margin-top: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--bordure-forte); border-radius: var(--rayon); box-shadow: 0 8px 28px rgba(0,0,0,.18);
}
.barre-sel[hidden] { display: none; }
.barre-sel .espace { flex: 1; }
@media (max-width: 820px) { .barre-sel { bottom: calc(76px + env(safe-area-inset-bottom)); } }
.carte-el .haut { display: flex; gap: 12px; padding: 14px 14px 10px; }
.vignette { width: 56px; height: 56px; border-radius: 10px; background: var(--surface-2); flex: none; display: grid; place-items: center; color: var(--discret); overflow: hidden; font-weight: 700; font-size: 1.2rem; }
.vignette img { width: 100%; height: 100%; object-fit: cover; }
.carte-el .nom { font-weight: 650; line-height: 1.25; }
.carte-el .meta { color: var(--discret); font-size: .83rem; margin-top: 3px; }
.carte-el .bas { padding: 0 14px 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.carte-el .commentaire { padding: 0 14px 12px; font-size: .84rem; color: var(--texte-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.compteur { color: var(--discret); font-size: .88rem; margin-bottom: 10px; }

/* ---- Fiche élément ---------------------------------------------------------- */
.fiche-tete { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.fiche-photo { width: 132px; height: 132px; border-radius: 14px; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; color: var(--discret); flex: none; position: relative; }
.fiche-photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.fiche-photo svg { width: 40px; height: 40px; }
.fiche-info { flex: 1; min-width: 220px; }
.fiche-info h1 { margin-bottom: 6px; }
.fiche-info .meta { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--texte-2); font-size: .92rem; margin: 6px 0 10px; }
.fiche-info .meta span { display: inline-flex; align-items: center; gap: 5px; }
.fiche-info .meta svg { width: 16px; height: 16px; color: var(--discret); }
.etats-grands { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.btn-etat {
  display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--bordure); background: var(--surface); color: var(--texte); font: inherit; font-weight: 650; font-size: 1rem; text-align: left;
  border-left: 8px solid var(--c);
}
.btn-etat:hover { background: var(--surface-2); }
.btn-etat .point { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; }
.btn-etat.actuel { background: var(--c); color: var(--sur-c, #fff); border-color: var(--c); }
.btn-etat.actuel .point { background: var(--sur-c, #fff); }
.btn-etat:disabled { opacity: .6; cursor: wait; }
.cible-passage { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.option-passage { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 2px solid var(--bordure); cursor: pointer; background: var(--surface); }
.option-passage.choisi { border-color: var(--primaire); background: var(--primaire-doux); }
.option-passage input { width: 20px; height: 20px; accent-color: var(--primaire); }
.option-passage .corps { flex: 1; min-width: 0; }
.option-passage .t { font-weight: 650; }
.option-passage .s { font-size: .84rem; color: var(--discret); }
.case-coche { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-weight: 650; cursor: pointer; margin-bottom: 14px; }
.case-coche input { width: 24px; height: 24px; accent-color: var(--etat-ok); }
.photo-choisie { display: flex; align-items: center; gap: 10px; }
.photo-choisie img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; }
.chronologie { list-style: none; margin: 0; padding: 0; position: relative; }
.chronologie li { position: relative; padding: 0 0 18px 34px; }
.chronologie li::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--bordure); }
.chronologie li:last-child::before { display: none; }
.chronologie .ic-type { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--texte-2); }
.chronologie .ic-type svg { width: 14px; height: 14px; }
.chronologie .quand { font-size: .8rem; color: var(--discret); }
.chronologie .quoi { margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chronologie .texte { margin-top: 4px; background: var(--surface-2); border-radius: 8px; padding: 8px 11px; white-space: pre-wrap; font-size: .92rem; }
.chronologie img.mini { margin-top: 6px; width: 120px; height: 90px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.fleche { color: var(--discret); }
.qr-bloc { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.qr-bloc .qr { width: 168px; height: 168px; background: #fff; border-radius: 10px; padding: 6px; border: 1px solid var(--bordure); flex: none; }
.qr-bloc .qr svg { width: 100%; height: 100%; display: block; }
.url-tag { font-family: Consolas, "Cascadia Mono", monospace; font-size: .9rem; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; word-break: break-all; }
details.guide { border: 1px solid var(--bordure); border-radius: 10px; padding: 10px 14px; margin-top: 14px; background: var(--surface); }
details.guide summary { cursor: pointer; font-weight: 650; }
details.guide ol { margin: 10px 0 4px; padding-left: 22px; }
details.guide li { margin-bottom: 6px; }

/* ---- Checklist (éditeur) ---------------------------------------------------- */
.liste-ordonnee { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.item-ordre { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--bordure); background: var(--surface); }
.item-ordre.glisse { opacity: .45; }
.item-ordre.cible-haut { box-shadow: inset 0 3px 0 var(--primaire); }
.item-ordre.cible-bas { box-shadow: inset 0 -3px 0 var(--primaire); }
.poignee { cursor: grab; color: var(--discret); display: grid; place-items: center; padding: 4px; touch-action: none; }
.num { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--texte-2); flex: none; }
.item-ordre .corps { flex: 1; min-width: 0; }
.item-ordre .t { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-ordre .s { font-size: .82rem; color: var(--discret); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-ordre .actions { display: flex; gap: 2px; }
.selecteur { max-height: 520px; overflow: auto; margin-top: 10px; }

/* ---- Passage ------------------------------------------------------------- */
.passage-tete { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.passage-tete .chiffres { display: flex; gap: 22px; flex-wrap: wrap; }
.passage-tete .chiffre .v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.passage-tete .chiffre .l { font-size: .82rem; color: var(--discret); }
.filtre-puces { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 12px; }
.filtre-puces button { border: 1px solid var(--bordure-forte); background: var(--surface); color: var(--texte-2); border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; }
.filtre-puces button.actif { background: var(--texte); color: var(--surface); border-color: var(--texte); }
.lignes-passage { display: flex; flex-direction: column; gap: 8px; }
.ligne-p { background: var(--surface); border: 1px solid var(--bordure); border-radius: 12px; padding: 12px 14px; box-shadow: var(--ombre); border-left: 5px solid var(--c, var(--bordure)); }
.ligne-p .rangee { display: flex; align-items: center; gap: 12px; }
.coche-xl { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--bordure-forte); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; color: transparent; padding: 0; }
.coche-xl svg { width: 24px; height: 24px; stroke-width: 3; }
.coche-xl.oui { background: var(--etat-ok); border-color: var(--etat-ok); color: #fff; }
.coche-xl:disabled { cursor: default; }
.ligne-p .corps { flex: 1; min-width: 0; }
.ligne-p .t { font-weight: 650; }
.ligne-p .s { font-size: .83rem; color: var(--discret); }
.etats-compacts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-left: 52px; }
.etats-compacts button { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--bordure-forte); background: var(--surface); color: var(--texte); border-radius: 999px; padding: 6px 12px; min-height: 36px; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; }
.etats-compacts button .point { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.etats-compacts button.actuel { background: var(--c); border-color: var(--c); color: var(--sur-c, #fff); }
.etats-compacts button.actuel .point { background: var(--sur-c, #fff); }
.etats-compacts button:disabled { cursor: default; opacity: .75; }
.ligne-p .com { margin: 8px 0 0 52px; font-size: .88rem; color: var(--texte-2); white-space: pre-wrap; background: var(--surface-2); border-radius: 8px; padding: 6px 10px; }
.ligne-p .zone-com { margin: 10px 0 0 52px; display: flex; flex-direction: column; gap: 8px; }

/* ---- Paramètres ------------------------------------------------------------- */
.etat-param { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--bordure); }
.etat-param input[data-champ="libelle"] { flex: 1 1 140px; min-width: 120px; width: auto; }
.etat-param select { flex: 0 1 150px; width: auto; min-width: 120px; }
.etat-param:last-child { border-bottom: 0; }
.etat-param .nb { font-size: .8rem; color: var(--discret); white-space: nowrap; }

/* ---- Étiquettes à imprimer --------------------------------------------------- */
.planche { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.etiquette { background: #fff; color: #111; border: 1px dashed #b9bec7; border-radius: 10px; padding: 12px; display: flex; gap: 10px; align-items: center; break-inside: avoid; }
.etiquette .qr { width: 92px; height: 92px; flex: none; }
.etiquette .qr svg { width: 100%; height: 100%; }
.etiquette .n { font-weight: 700; font-size: .9rem; line-height: 1.2; }
.etiquette .e { font-size: .75rem; color: #555; margin-top: 3px; }
.etiquette .c { font-family: Consolas, monospace; font-size: .8rem; margin-top: 5px; font-weight: 700; }

/* ---- Modale, toasts, infobulle, visionneuse ------------------------------------ */
.voile { position: fixed; inset: 0; background: rgba(8, 12, 18, .5); display: grid; place-items: center; z-index: 50; padding: 16px; animation: apparait .12s ease-out; }
.modale { background: var(--surface); border-radius: 16px; box-shadow: var(--ombre-haute); width: min(620px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; border: 1px solid var(--bordure); }
.modale .m-tete { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--bordure); }
.modale .m-tete h2 { flex: 1; font-size: 1.1rem; }
.modale .m-corps { padding: 18px; overflow: auto; }
.modale .m-pied { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--bordure); flex-wrap: wrap; }
@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--texte); color: var(--surface); padding: 11px 16px; border-radius: 10px; box-shadow: var(--ombre-haute); font-weight: 550; max-width: 360px; display: flex; gap: 9px; align-items: center; animation: monte .18s ease-out; }
.toast.erreur { background: var(--danger); color: #fff; }
@keyframes monte { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.infobulle { position: fixed; z-index: 90; pointer-events: none; background: var(--texte); color: var(--surface); padding: 7px 10px; border-radius: 8px; font-size: .82rem; white-space: pre-line; box-shadow: var(--ombre-haute); max-width: 260px; display: none; }
.visionneuse { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 95; display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.visionneuse img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.chargement { padding: 40px; text-align: center; color: var(--discret); }

/* ---- Responsive (téléphone) ---------------------------------------------------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s4, .s5, .s6, .s7, .s8 { grid-column: span 12; }
}
@media (max-width: 820px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .barre-mobile {
    display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: 8px; padding: 10px 16px;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--bordure);
  }
  .barre-mobile .marque { padding: 0; flex: 1; font-size: 1rem; }
  .onglets-mobile {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--bordure); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .onglets-mobile a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: .7rem; font-weight: 600; color: var(--discret); text-decoration: none; border-radius: 10px; }
  .onglets-mobile a.actif { color: var(--primaire); background: var(--primaire-doux); }
  .onglets-mobile a svg { width: 22px; height: 22px; }
  .app { display: block; }
  .principal { padding: 16px 16px 100px; }
  h1 { font-size: 1.3rem; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .val { font-size: 1.6rem; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .formulaire .deux { grid-template-columns: 1fr; }
  .carte { padding: 14px; }
  .fiche-photo { width: 100%; height: 200px; }
  .fiche-photo.sans-photo { display: none; }
  .etats-grands { grid-template-columns: 1fr 1fr; }
  .btn-etat { min-height: 68px; font-size: 1.02rem; }
  .entete .actions { width: 100%; }
  .entete .actions .btn { flex: 1; }
  .etats-compacts, .ligne-p .com, .ligne-p .zone-com { padding-left: 0; margin-left: 0; }
  .filtres select { flex: 1; min-width: 0; }
  .toasts { left: 16px; right: 16px; bottom: 84px; }
  .toast { max-width: none; }
  .graph-anneau { width: 160px; height: 160px; margin: 0 auto; }
  .anneau-bloc { justify-content: center; }
}

/* ---- Impression -------------------------------------------------------------- */
@media print {
  .nav, .barre-mobile, .onglets-mobile, .entete .actions, .filtres, .non-imprime, .toasts { display: none !important; }
  body { background: #fff; color: #000; }
  .principal { padding: 0; max-width: none; }
  .planche { grid-template-columns: repeat(3, 1fr); gap: 6mm; }
  .etiquette { border-color: #999; }
}

/* ---- Connexion, comptes et sécurité ---- */
[hidden] { display: none !important; }
body:not(.est-admin) .admin-seul { display: none !important; }
.page-connexion { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.connexion { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; }
.connexion .marque { justify-content: center; padding: 0 0 4px; }
.connexion h1 { margin-bottom: 14px; font-size: 1.35rem; }
.connexion .carte { padding: 22px; }
.msg { min-height: 1.2em; margin: 0; font-size: .9rem; color: var(--texte-2); }
.msg.erreur { color: var(--danger); font-weight: 600; }
.aide { font-size: .84rem; margin: 12px 0 0; }
.mention { font-size: .78rem; text-align: center; margin: 0; }
.lien-invitation { font-family: Consolas, "Cascadia Mono", monospace; font-size: .84rem; word-break: break-all; background: var(--surface-2); border: 1px solid var(--bordure); border-radius: var(--rayon-petit); padding: 10px; user-select: all; }
.table-comptes { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table-comptes th, .table-comptes td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--bordure); vertical-align: middle; }
.table-comptes th { color: var(--discret); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.table-comptes tr.inactif td { opacity: .55; }
.table-comptes .actions-compte { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.defile-x { overflow-x: auto; }
.journal-ligne { font-size: .86rem; }
.journal-ligne .type { font-weight: 650; }
.journal-ligne.echec .type { color: var(--danger); }
.secret-totp { font-family: Consolas, "Cascadia Mono", monospace; letter-spacing: .08em; word-break: break-all; }

/* ---- Tags NFC : passage actif, écran de confirmation, ronde, association ---------- */
.bandeau-passage { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 30px 0; max-width: 1260px; padding: 10px 14px; border-radius: 12px; background: var(--primaire); color: var(--sur-primaire); box-shadow: var(--ombre); }
.bandeau-passage[hidden] { display: none; }
.bandeau-passage .bp-ic { display: grid; place-items: center; }
.bandeau-passage a.bp-texte { color: inherit; flex: 1 1 200px; min-width: 0; text-decoration: none; }
.bandeau-passage .bp-nb { font-weight: 800; font-variant-numeric: tabular-nums; }
.bandeau-passage .btn { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--sur-primaire) 55%, transparent); }
.bandeau-passage .btn:hover { background: color-mix(in srgb, var(--sur-primaire) 15%, transparent); }
.ecran-scan { text-align: center; max-width: 540px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.ecran-scan .grand-ok { width: 128px; height: 128px; border-radius: 50%; background: var(--etat-ok); color: #fff; display: grid; place-items: center; margin: 6px auto 0; animation: pop .4s ease-out; box-shadow: 0 10px 30px color-mix(in srgb, var(--etat-ok) 40%, transparent); }
.ecran-scan .grand-ok svg { width: 78px; height: 78px; stroke-width: 3; }
.ecran-scan.deja .grand-ok { background: var(--primaire); box-shadow: none; }
.ecran-scan h1 { font-size: 1.7rem; }
.ecran-scan .nom-objet { font-size: 1.3rem; font-weight: 700; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
.alerte.fort { border: 2px solid var(--etat-alerte); }
.note-evidence { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--avert-doux); border-left: 4px solid var(--etat-alerte); }
.note-evidence .q { font-size: .8rem; color: var(--discret); margin-bottom: 2px; }
.infos-tag { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 14px; font-size: .9rem; }
.infos-tag dt { color: var(--discret); }
.infos-tag dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.badge.scan { background: color-mix(in srgb, var(--etat-ok) 15%, transparent); color: var(--succes); }
.badge .ic, .badge svg { width: 13px; height: 13px; vertical-align: -2px; }
.barre-scan { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 60; width: min(560px, calc(100% - 32px)); display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--texte); color: var(--surface); box-shadow: var(--ombre-haute); transition: background .2s; }
.barre-scan .bs-ic { width: 42px; height: 42px; border-radius: 50%; background: var(--primaire); color: #fff; display: grid; place-items: center; flex: none; animation: pulse 1.6s infinite; }
.barre-scan .bs-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .9rem; }
.barre-scan .bs-txt strong { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre-scan .btn { flex: none; }
.barre-scan.ok { background: #0b7a0b; color: #fff; }
.barre-scan.info { background: var(--primaire-fort); color: #fff; }
.barre-scan.avert { background: #a35f00; color: #fff; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 90, 166, .6); } 70% { box-shadow: 0 0 0 14px rgba(31, 90, 166, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 90, 166, 0); } }
.ligne-p.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--etat-ok) 40%, var(--surface)); } 100% { background: var(--surface); } }
.etape-nfc { text-align: center; padding: 6px 2px; }
.etape-nfc .ic-etape { width: 86px; height: 86px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--primaire-doux); color: var(--primaire); margin-bottom: 12px; }
.etape-nfc .ic-etape svg { width: 44px; height: 44px; }
.etape-nfc .ic-etape.attente { animation: pulse 1.6s infinite; }
.etape-nfc .ic-etape.ok { background: var(--etat-ok); color: #fff; }
.etape-nfc .ic-etape.ok svg { stroke-width: 3; }
.etape-nfc .ic-etape.erreur { background: var(--danger-doux); color: var(--danger); }
.etape-nfc h3 { font-size: 1.15rem; margin-bottom: 6px; }
.etape-nfc p { color: var(--texte-2); margin: 6px 0; }
.etape-nfc .actions-etape { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.etape-nfc .actions-etape .btn { white-space: normal; min-height: 48px; }
.verrou { text-align: left; display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); margin-top: 12px; cursor: pointer; }
.verrou input { margin-top: 3px; width: auto; }
.liste-lot li.fait .corps .t { color: var(--succes); }
@media (max-width: 820px) {
  .bandeau-passage { margin: 10px 16px 0; padding: 9px 12px; }
  .bandeau-passage .btn { flex: 1; }
  .barre-scan { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media print { .bandeau-passage, .barre-scan { display: none !important; } }
