@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.81419bf5abb5.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.8e986e86d57e.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.a1e2a2d7d4c0.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-latin-700-normal.15481e4eab6d.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-500-normal.69988ca9d262.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-600-normal.64a19a7cafc2.woff2") format("woff2"); }

:root {
  --encre: #16283a;
  --encre-2: #22394f;
  --fond: #edf0f3;
  --surface: #ffffff;
  --trait: #cfd6de;
  --trait-fort: #9aa7b4;
  --texte: #1c2733;
  --texte-2: #586676;
  --fibre: #2f5d8a;
  --balise: #e3a008;
  --balise-pale: #fdf3d7;
  --rupture: #c42b1c;
  --rupture-pale: #fbe7e4;
  --sain: #12795f;
  --sain-pale: #e2f3ee;
  --rayon: 4px;
  --serre: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; font-family: "Barlow", system-ui, sans-serif; font-size: 1rem; line-height: 1.45;
  color: var(--texte); background: var(--fond);
}
a { color: var(--fibre); }
a:hover { color: var(--encre); }
:focus-visible { outline: 3px solid var(--balise); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { max-width: 72ch; }

/* --- Cadre ------------------------------------------------------------ */
.cadre { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.rail { background: var(--encre); color: #dbe3ea; padding: 20px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.rail .marque { display: flex; align-items: center; gap: 10px; padding: 0 20px 22px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.rail .marque svg { flex: none; }
.rail nav a {
  display: flex; justify-content: space-between; align-items: center; padding: 5px 20px; font-size: .95rem; color: #c8d3dd;
  text-decoration: none; font-weight: 500; border-left: 3px solid transparent;
}
.rail nav a:hover { background: var(--encre-2); color: #fff; }
.rail nav a[aria-current="page"] { border-left-color: var(--balise); color: #fff; background: var(--encre-2); }
.rail nav a.fournisseur { gap: 8px; }
.rail nav a.fournisseur > span:first-child { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.rail .pastille-f { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.rail .discret-rail { font-size: .78rem; color: #8195a8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 84px; }
.rail nav a.fournisseur.ouvert { color: #fff; }
.rail nav a.sous-entree { padding: 5px 20px 5px 36px; font-size: .93rem; }
.rail nav a.sous-entree.niveau2 { padding-left: 52px; font-size: .88rem; }
.rail .groupe { margin: 14px 20px 4px; color: #8195a8; font-size: .82rem; }
.rail .compteur { background: var(--rupture); color: #fff; border-radius: 10px; padding: 0 7px; font-size: .8rem; font-weight: 600; }
.rail .compteur.attention { background: var(--balise); color: var(--encre); }
.rail .pied { margin: 28px 20px 0; font-size: .85rem; color: #8195a8; border-top: 1px solid var(--encre-2); padding-top: 14px; }
.rail .pied .compte { display: block; color: #fff; text-decoration: none; margin-bottom: 6px; border-left: 3px solid transparent; padding-left: 0; }
.rail .pied .compte span { display: block; color: #8195a8; font-size: .8rem; }
.rail .pied .compte[aria-current="page"] strong { color: var(--balise); }
.rail .pied form { display: inline; }
.rail .pied button { background: none; border: 0; color: #c8d3dd; font: inherit; padding: 0; cursor: pointer; text-decoration: underline; }

main { padding: 28px 32px 48px; min-width: 0; }
main.plein { padding: 0; height: 100vh; display: flex; flex-direction: column; }
main.plein > .bandeau, main.plein > .messages { margin: 0; flex: none; }
.entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.entete h1 { margin: 0; }
.entete .sous { color: var(--texte-2); margin: 4px 0 0; }

/* --- Éléments ------------------------------------------------------------ */
.panneau { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 18px 20px; margin-bottom: 20px; }
.panneau > h2:first-child { margin-top: 0; }
.grille-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grille-moitie { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

.bouton, button.bouton {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--rayon);
  background: var(--encre); color: #fff; border: 1px solid var(--encre); font: 600 .95rem "Barlow", sans-serif;
  text-decoration: none; cursor: pointer;
}
.bouton:hover { background: var(--encre-2); color: #fff; }
.bouton.secondaire { background: var(--surface); color: var(--encre); border-color: var(--trait-fort); }
.bouton.secondaire:hover { background: var(--fond); }
.bouton.danger { background: var(--surface); color: var(--rupture); border-color: var(--rupture); }
.bouton.petit { padding: 4px 10px; font-size: .88rem; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--texte-2); font-size: .88rem; border-bottom: 2px solid var(--trait); padding: 6px 10px; }
td { padding: 8px 10px; border-bottom: 1px solid var(--trait); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.ref { font-family: var(--serre); font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.discret { color: var(--texte-2); }
.petit { font-size: .88rem; }
.vide { color: var(--texte-2); padding: 12px 0; }

.pastille { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.pastille.ok { background: var(--sain-pale); color: var(--sain); }
.pastille.attention { background: var(--balise-pale); color: #7a5300; }
.pastille.critique { background: var(--rupture-pale); color: var(--rupture); }
.pastille.neutre { background: var(--fond); color: var(--texte-2); }

.messages { list-style: none; padding: 0; margin: 0 0 18px; }
.messages li { padding: 10px 14px; border-radius: var(--rayon); margin-bottom: 8px; border-left: 4px solid var(--fibre); background: var(--surface); }
.messages .success { border-color: var(--sain); }
.messages .warning { border-color: var(--balise); }
.messages .error { border-color: var(--rupture); }

.avertissements { background: var(--balise-pale); border: 1px solid #ecc561; border-radius: var(--rayon); padding: 12px 16px 12px 34px; margin: 0 0 18px; }
.avertissements li { margin: 3px 0; }
.alerte-bandeau { background: var(--rupture-pale); border: 1px solid #e9a79e; border-left: 6px solid var(--rupture); border-radius: var(--rayon); padding: 14px 18px; margin-bottom: 20px; }
.alerte-bandeau h2 { color: var(--rupture); margin-bottom: 6px; }
.alerte-bandeau ul { margin: 0; padding-left: 18px; }

/* --- Frise des 7 jours : la balise de chantier ------------------------------- */
.frise { display: grid; grid-template-columns: repeat(var(--jours, 7), minmax(0, 1fr)); border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--surface); overflow: hidden; margin-bottom: 20px; }
.frise .jour { border-right: 1px solid var(--trait); min-height: 168px; display: flex; flex-direction: column; }
.frise .jour:last-child { border-right: 0; }
.frise .jour.ferme { background: repeating-linear-gradient(0deg, #f6f8fa, #f6f8fa 6px, #fff 6px, #fff 12px); }
.frise .date { padding: 8px 10px; border-bottom: 1px solid var(--trait); }
.frise .date b { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1; }
.frise .date span { color: var(--texte-2); font-size: .85rem; }
.frise .jour.aujourdhui .date { background: var(--encre); color: #fff; }
.frise .jour.aujourdhui .date span { color: #c8d3dd; }
.frise .evts { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.balise {
  display: block; text-decoration: none; color: var(--encre); border-radius: 3px; padding: 6px 8px 6px 14px;
  background: var(--balise-pale); position: relative; font-size: .85rem; line-height: 1.25;
  border: 1px solid #ecc561;
}
.balise::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; border-radius: 3px 0 0 3px;
  background: repeating-linear-gradient(135deg, var(--balise) 0 5px, var(--encre) 5px 10px);
}
.balise.critique { background: var(--rupture-pale); border-color: #e9a79e; }
.balise.critique::before { background: repeating-linear-gradient(135deg, var(--rupture) 0 5px, #fff 5px 10px); }
.balise.rebond { background: var(--surface); border-style: dashed; }
.balise .ref { display: block; }
.balise:hover { border-color: var(--encre); color: var(--encre); }

.liste-fournisseurs { list-style: none; padding: 0; margin: 0; }
.liste-fournisseurs li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--trait); }
.liste-fournisseurs li:last-child { border-bottom: 0; }
.liste-fournisseurs .trait { width: 4px; align-self: stretch; border-radius: 2px; }
.liste-fournisseurs .nom { flex: 1; }
.liste-fournisseurs .nom small { display: block; color: var(--texte-2); }

/* --- Formulaires --------------------------------------------------------- */
form .champ { margin-bottom: 14px; }
form label { display: block; font-weight: 600; margin-bottom: 4px; }
form .aide, .helptext { color: var(--texte-2); font-size: .85rem; display: block; margin-top: 3px; }
input[type=text], input[type=search], input[type=password], input[type=email], input[type=datetime-local],
input[type=date], input[type=time], input[type=number], input[type=url], input[type=tel], input[type=file], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--trait-fort); border-radius: var(--rayon);
  font: 1rem "Barlow", sans-serif; background: #fff; color: var(--texte);
}
textarea { font-family: var(--serre); }
.errorlist { color: var(--rupture); margin: 4px 0; padding-left: 18px; font-size: .9rem; }
.cases { max-height: 280px; overflow-y: auto; border: 1px solid var(--trait); border-radius: var(--rayon); padding: 6px 10px; background: #fff; }
.cases div { padding: 2px 0; }
.cases label { display: inline; font-weight: 400; font-family: var(--serre); }
.cases-ligne { max-height: none; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.cases-ligne > div { padding: 0; }
table.extremites td { padding: 6px 6px 6px 0; border-bottom: 0; }
table.extremites select { min-width: 120px; }
table.extremites td:first-child select { min-width: 240px; }
.actions-ligne { display: flex; gap: 8px; flex-wrap: wrap; }
.ligne-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.filtres { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filtres input[type=search] { max-width: 280px; }
.filtres select { width: auto; }
.onglets { display: flex; gap: 4px; }
.onglets a { padding: 6px 12px; border-radius: var(--rayon); text-decoration: none; color: var(--texte-2); font-weight: 600; }
.onglets a[aria-current="true"] { background: var(--encre); color: #fff; }

.choix-fournisseur { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.choix-fournisseur a {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid var(--trait-fort);
  border-radius: var(--rayon); background: var(--surface); color: var(--texte); text-decoration: none; min-width: 150px;
}
.choix-fournisseur a:hover { border-color: var(--encre); }
.choix-fournisseur a[aria-current="true"] { background: var(--encre); border-color: var(--encre); color: #fff; }
.choix-fournisseur a[aria-current="true"] small { color: #c8d3dd; }
.choix-fournisseur i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.choix-fournisseur small { display: block; color: var(--texte-2); font-size: .82rem; line-height: 1.2; }

/* --- Listes : barre de filtres, tri, pagination ------------------------------ */
.filtres { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 10px 12px; }
.filtres .onglets { margin-right: 6px; }
.filtres label.date { display: flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; color: var(--texte-2); }
.filtres input[type=date] { width: auto; padding: 6px 8px; }
.filtres .effacer { margin-left: auto; font-size: .9rem; }
.filtres .bouton { padding: 6px 12px; }
.outils-liste { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: -6px 0 10px; color: var(--texte-2); font-size: .9rem; }
th a.tri { color: var(--texte-2); text-decoration: none; white-space: nowrap; }
th a.tri:hover, th a.tri.actif { color: var(--encre); }
th a.tri::after { content: ""; }
.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: .9rem; }
.pagination a, .pagination span.courant { padding: 4px 10px; border: 1px solid var(--trait); border-radius: var(--rayon); text-decoration: none; background: var(--surface); }
.pagination span.courant { background: var(--encre); color: #fff; border-color: var(--encre); }
.puce-filtre { background: var(--encre); color: #fff; border-radius: 14px; padding: 4px 12px; text-decoration: none; font-size: .9rem; font-weight: 600; }
.puce-filtre:hover { background: var(--encre-2); color: #fff; }
.puce { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
tr.inactif td { color: var(--texte-2); }

/* --- Formulaires de gestion --------------------------------------------------- */
fieldset { border: 0; border-top: 1px solid var(--trait); margin: 0 0 6px; padding: 14px 0 0; }
fieldset:first-of-type { border-top: 0; padding-top: 0; }
fieldset legend { font-weight: 700; font-size: 1.02rem; padding: 0; margin-bottom: 10px; float: left; width: 100%; }
fieldset legend + * { clear: both; }
.formulaire-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; max-width: 1000px; }
.formulaire-grille > .errorlist, .formulaire-grille > .champ.large { grid-column: 1 / -1; }
.champs-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
.champs-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.champ.case label { display: flex; gap: 8px; align-items: baseline; font-weight: 600; }
.champ.case label input { margin: 0; }
.champ .requis { color: var(--rupture); margin-left: 2px; }
.filtre-cases { margin-bottom: 6px; }
.cases-liste { list-style: none; padding: 6px 10px; margin: 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--trait); border-radius: var(--rayon); background: #fff; }
.cases-liste > div, .cases-liste > li { padding: 2px 0; }
.cases-liste label { display: inline; font-weight: 400; font-family: var(--serre); }
textarea.markdown { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92rem; }
input[type=color] { width: 64px; height: 36px; padding: 2px; }
.barre-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.barre-actions .droite { margin-left: auto; }
.zone-danger { border-color: #e9a79e; }
.zone-danger h2 { color: var(--rupture); }

/* --- Fournisseurs ------------------------------------------------------------ */
.cartes-fournisseurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.carte-fournisseur { background: var(--surface); border: 1px solid var(--trait); border-top: 5px solid var(--couleur); border-radius: var(--rayon); padding: 14px 16px; }
.carte-fournisseur.inactif { opacity: .65; }
.carte-fournisseur h2 { margin: 0; font-size: 1.15rem; }
.carte-fournisseur h2 a { color: var(--encre); text-decoration: none; }
.carte-fournisseur dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 6px; }
.carte-fournisseur dt { color: var(--texte-2); font-size: .82rem; }
.carte-fournisseur dd { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--encre); }
.carte-fournisseur dd.alerte { color: var(--rupture); }

/* --- Administration ------------------------------------------------------------ */
.sous-nav { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--trait); margin-bottom: 20px; }
.sous-nav a { padding: 8px 14px; text-decoration: none; color: var(--texte-2); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.sous-nav a:hover { color: var(--encre); }
.sous-nav a[aria-current="page"] { color: var(--encre); border-bottom-color: var(--balise); }
.etats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 20px; }
.etat { background: var(--surface); border: 1px solid var(--trait); border-left: 5px solid var(--sain); border-radius: var(--rayon); padding: 14px 16px; }
.etat.attention { border-left-color: var(--balise); }
.etat.critique { border-left-color: var(--rupture); }
.etat.neutre { border-left-color: var(--trait-fort); }
.etat h3 { margin: 0 0 4px; font-size: .95rem; color: var(--texte-2); font-weight: 600; }
.etat .valeur { font-size: 1.15rem; font-weight: 700; color: var(--encre); }
.etat p { margin: 4px 0 0; font-size: .88rem; color: var(--texte-2); }
.trace { font-family: var(--serre); font-size: .92rem; background: var(--fond); border-radius: var(--rayon); padding: 10px 14px; margin: 10px 0 0; list-style: none; }
.trace li { padding: 2px 0; }
.roles { list-style: none; padding: 0; margin: 0; }
.roles li { padding: 6px 0; border-bottom: 1px solid var(--trait); font-size: .92rem; }
.roles li:last-child { border-bottom: 0; }
table.acces td { padding: 6px 8px; }
table.acces select { width: auto; min-width: 140px; }
.choix-niveau { display: flex; gap: 16px; flex-wrap: wrap; }
.choix-niveau label { display: flex; gap: 6px; align-items: center; font-weight: 500; margin: 0; white-space: nowrap; }
#perimetre .champ ul, #perimetre .champ > div { list-style: none; padding: 0; margin: 4px 0 0; }
#perimetre input[type=radio] { margin-right: 6px; }
#perimetre .champ label + div label, #perimetre .champ ul label { font-weight: 500; display: flex; align-items: center; margin: 4px 0; }
.estompe { opacity: .55; }
.bandeau { background: var(--encre); color: #fff; padding: 8px 14px; border-radius: var(--rayon); margin-bottom: 16px; font-weight: 500; border-left: 6px solid var(--balise); }
.bandeau.maintenance { background: var(--rupture-pale); color: var(--rupture); border-left-color: var(--rupture); }
.page-erreur { max-width: 560px; margin: 10vh auto; }
.page-erreur .code { font-size: 3rem; font-weight: 700; color: var(--trait-fort); line-height: 1; }

/* --- Fiches ---------------------------------------------------------------- */
dl.fiche { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.fiche dt { color: var(--texte-2); }
dl.fiche dd { margin: 0; }
.chronologie { list-style: none; padding: 0; margin: 0; }
.chronologie li { padding: 6px 0; border-bottom: 1px solid var(--trait); font-size: .92rem; }
.verdict { display: flex; gap: 14px; align-items: flex-start; }
.verdict .icone { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.2rem; }
.verdict.ok .icone { background: var(--sain); }
.verdict.attention .icone { background: var(--balise); color: var(--encre); }
.verdict.critique .icone { background: var(--rupture); }
.primaires { border: 1px solid var(--trait); border-left: 6px solid var(--encre); border-radius: var(--rayon); padding: 12px 14px; margin: 14px 0 16px; background: #f7f9fb; }
.primaires h3 { margin-bottom: 8px; }
.primaire { padding: 6px 0; border-top: 1px solid var(--trait); }
.primaire:first-of-type { border-top: 0; padding-top: 0; }
.marque-primaire { display: inline-block; font-size: .72rem; font-weight: 700; background: var(--encre); color: #fff; border-radius: 3px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; }
.segments { font-size: .9rem; }
.article-contenu table { width: auto; }
.article-contenu td, .article-contenu th { border: 1px solid var(--trait); }
pre.mail { white-space: pre-wrap; font-family: var(--serre); font-size: .92rem; background: var(--fond); padding: 14px; border-radius: var(--rayon); max-height: 480px; overflow: auto; }

/* --- Carte ------------------------------------------------------------------ */
.carte-cadre { display: grid; grid-template-columns: 1fr 340px; flex: 1; min-height: 0; }
#carte { background:
  radial-gradient(circle, #d5dce3 1px, transparent 1.2px) 0 0 / 22px 22px, #f4f6f8; position: relative; }
.carte-barre { position: absolute; top: 14px; left: 14px; right: 14px; z-index: 5; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; pointer-events: none; }
.carte-barre > * { pointer-events: auto; }
.carte-barre .boite { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 6px 10px; display: flex; gap: 8px; align-items: center; box-shadow: 0 1px 2px rgba(22, 40, 58, .08); }
.carte-barre input[type=datetime-local] { width: auto; padding: 4px 6px; }
.carte-barre label { margin: 0; font-weight: 500; }
.carte-instant { font-weight: 600; }
.legende { position: absolute; left: 14px; bottom: 14px; z-index: 5; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 8px 12px; font-size: .85rem; }
.legende div { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.legende i { display: inline-block; width: 26px; height: 0; border-top: 4px solid var(--fibre); }
.legende i.sec { border-top: 2px dashed var(--fibre); }
.legende i.planif { border-top-color: var(--balise); }
.legende i.coupe { border-top: 4px dotted var(--rupture); }
.legende i.crit { border-top: 2px solid var(--fibre); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--trait-fort); }
.legende i.srlg { border-top: 3px dashed var(--balise); }
.zoom { position: absolute; right: 14px; bottom: 14px; z-index: 6; display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.zoom button { width: 38px; height: 36px; border: 1px solid var(--trait-fort); background: var(--surface); color: var(--encre); border-radius: var(--rayon);
  font: 700 1.05rem "Barlow", sans-serif; cursor: pointer; display: grid; place-items: center; box-shadow: 0 1px 2px rgba(22, 40, 58, .08); }
.zoom button:hover { background: var(--fond); border-color: var(--encre); }
.zoom #zoom-100 { font-size: .8rem; }
.zoom span { font-size: .78rem; color: var(--texte-2); text-align: center; background: var(--surface); border-radius: var(--rayon); padding: 1px 0; }
.infobulle { position: absolute; z-index: 8; pointer-events: none; max-width: 300px; min-width: 190px; background: var(--encre); color: #fff;
  border-radius: var(--rayon); padding: 9px 12px; font-size: .86rem; line-height: 1.35; box-shadow: 0 4px 14px rgba(22, 40, 58, .25); }
.infobulle strong { display: block; font-size: .95rem; margin-bottom: 2px; }
.infobulle .sous-titre { color: #b9c7d4; display: block; margin-bottom: 4px; }
.infobulle dl { display: grid; grid-template-columns: max-content 1fr; gap: 1px 10px; margin: 4px 0 0; }
.infobulle dt { color: #b9c7d4; }
.infobulle dd { margin: 0; }
.infobulle .etat { display: inline-block; margin-top: 5px; padding: 0 7px; border-radius: 9px; font-weight: 600; font-size: .8rem; }
.infobulle .etat.coupe { background: var(--rupture); }
.infobulle .etat.planif { background: var(--balise); color: var(--encre); }
.infobulle .etat.fragile { background: var(--balise); color: var(--encre); }
.aide-bulle { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--trait-fort); background: var(--surface); color: var(--encre); font-weight: 700; cursor: pointer; padding: 0; }
.explication { position: absolute; z-index: 9; top: 120px; left: 14px; max-width: 380px; background: var(--surface); border: 1px solid var(--trait-fort);
  border-left: 5px solid var(--balise); border-radius: var(--rayon); padding: 12px 16px; box-shadow: 0 4px 14px rgba(22, 40, 58, .18); font-size: .92rem; }
.explication p { margin: 6px 0; }
.legende b.prim { display: inline-block; width: 14px; height: 14px; border: 3px solid var(--encre); background: #fff; }
.legende b.fragile { display: inline-block; width: 14px; height: 14px; border: 2px dashed var(--balise); background: #fff; }
.legende b.iso { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--rupture); background: var(--rupture-pale); }
.volet { background: var(--surface); border-left: 1px solid var(--trait); overflow-y: auto; padding: 18px; }
.volet h2 { margin-top: 0; }
.volet .vide { padding-top: 0; }
.volet section { border-bottom: 1px solid var(--trait); padding-bottom: 12px; margin-bottom: 12px; }

.connexion { max-width: 380px; margin: 12vh auto; }
.connexion .marque { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 1.3rem; margin-bottom: 20px; color: var(--encre); }

@media (max-width: 1000px) {
  .grille-2, .grille-moitie { grid-template-columns: 1fr; }
  main.plein { height: auto; display: block; }
  .carte-cadre { grid-template-columns: 1fr; grid-template-rows: 70vh auto; height: auto; }
  .volet { border-left: 0; border-top: 1px solid var(--trait); }
}
@media (max-width: 760px) {
  .cadre { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; padding: 10px 0; }
  .rail nav { display: flex; flex-wrap: wrap; }
  .rail nav a { border-left: 0; padding: 6px 12px; }
  .rail nav a.sous-entree { padding: 6px 12px; }
  .rail .discret-rail { display: none; }
  .rail .groupe, .rail .pied { display: none; }
  .rail .marque { padding: 0 16px 8px; }
  main { padding: 18px 16px 40px; }
  .frise { grid-template-columns: 1fr; }
  .frise .jour { min-height: 0; border-right: 0; border-bottom: 1px solid var(--trait); }
  .ligne-champs, .champs-2, .champs-4, .formulaire-grille { grid-template-columns: 1fr; }
  .filtres .effacer { margin-left: 0; }
  table.extremites select { min-width: 0; }
  table { font-size: .92rem; }
  .tableau-defilant { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Mon compte */
.compte-entete { justify-content: flex-start; align-items: center; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--encre); color: #fff; display: grid; place-items: center;
  font: 700 1.3rem "Barlow", sans-serif; letter-spacing: .02em; flex: none; box-shadow: inset 0 -3px 0 var(--balise); }
.liste-simple { margin: 0; padding-left: 16px; }
.liste-simple li { margin: 1px 0; }
.copie { display: flex; gap: 8px; margin: 4px 0 8px; }
.copie input { flex: 1; font-family: ui-monospace, monospace; font-size: .82rem; }
.barre-actions form { display: inline; }

/* Exports */
.exports { display: inline-flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.exports a, .lien-bouton { color: var(--fibre); font-weight: 600; }
.lien-bouton { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Impression : contenu seul, pleine largeur */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; }
  .cadre { display: block; }
  .rail, .filtres, .pagination, .messages, .bandeau, .exports, .barre-actions, .sous-nav, .entete .bouton, .entete form,
  button, .zoom, .volet { display: none !important; }
  main { padding: 0 !important; }
  .panneau { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  table { font-size: 9pt; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  .mention-impression { display: block !important; position: fixed; bottom: 0; left: 0; right: 0; text-align: center;
    font-size: 7.5pt; color: #444; border-top: 1px solid #999; padding-top: 2px; background: #fff; }
  main { padding-bottom: 14mm !important; }
  .pied-app { display: none; }
}

/* Import et export */
.titre-section { margin: 28px 0 12px; }
.etapes { margin: 0 0 16px; padding-left: 20px; color: var(--texte-2); font-size: .92rem; }
.etapes li { margin: 3px 0; }
.etapes strong { color: var(--encre); }
.modeles td { padding: 8px 4px; }
td.droite, th.droite { text-align: right; white-space: nowrap; }
details.format summary { cursor: pointer; font-size: 1.02rem; }
details.format[open] summary { margin-bottom: 8px; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tuile { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--trait); border-left: 4px solid var(--fibre);
  border-radius: var(--rayon); padding: 14px 16px; text-decoration: none; color: var(--texte); }
.tuile strong { color: var(--encre); font-size: 1.05rem; }
.tuile:hover { border-color: var(--encre); border-left-color: var(--balise); }
.bilan { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.bilan div { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 10px 14px; }
.bilan dt { color: var(--texte-2); font-size: .82rem; }
.bilan dd { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--encre); }
.bilan .erreur dd { color: var(--rupture); }
.bilan .creation dd { color: var(--sain); }
tr.ligne-erreur td { background: var(--rupture-pale); }
tr.ligne-inchange td, tr.ligne-ignore td { color: var(--texte-2); }
.msg-erreur { color: var(--rupture); }
.msg-avert { color: #7a5300; }

/* Horloge du tableau de bord */
.horloge { display: flex; flex-direction: column; align-items: flex-end; background: var(--encre); color: #fff; border-radius: var(--rayon);
  padding: 8px 16px; border-bottom: 3px solid var(--balise); min-width: 210px; }
.horloge-heure { font: 700 1.7rem/1.1 "Barlow", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.horloge-jour { font-size: .85rem; color: #c9d6e2; text-transform: capitalize; }
@media print { .horloge { background: none; color: #000; border: 0; } .horloge-jour { color: #000; } }
[hidden] { display: none !important; }

/* Périodes de gel */
.gel-bandeau { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
  padding: 12px 16px; border-radius: var(--rayon); background: var(--balise-pale); border-left: 5px solid var(--balise);
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(227, 160, 8, .12) 14px 28px); }
.gel-bandeau.bloquant { background-color: var(--rupture-pale); border-left-color: var(--rupture);
  background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(196, 43, 28, .08) 14px 28px); }
.gel-encart { border-left: 4px solid var(--rupture); }
.gels-accueil { display: grid; gap: 8px; margin-bottom: 18px; }
.gels-accueil .gel-bandeau { margin: 0; text-decoration: none; color: var(--encre); }

/* Calendrier mensuel */
.nav-periode { display: flex; gap: 6px; }
.legende-cal { display: flex; flex-wrap: wrap; gap: 16px; color: var(--texte-2); margin: -4px 0 10px; }
.legende-cal i { font-style: normal; }
.marque-chev { display: inline-grid; place-items: center; width: 20px; height: 18px; border-radius: 4px; background: var(--rupture); color: #fff; font-weight: 700; font-size: .78rem; }
.marque-gel { display: inline-block; width: 22px; height: 10px; vertical-align: middle; border-radius: 2px;
  background: repeating-linear-gradient(135deg, var(--rupture) 0 3px, var(--rupture-pale) 3px 7px); }
.marque-rebond { display: inline-block; width: 22px; height: 10px; vertical-align: middle; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--fibre) 0 4px, transparent 4px 7px); border: 1px solid var(--fibre); }
.calendrier { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
.cal-entete, .cal-semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-entete div { padding: 8px 10px; font-size: .8rem; font-weight: 700; color: var(--texte-2); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--trait); }
.cal-jour { min-height: 118px; padding: 6px 6px 8px; border-right: 1px solid var(--trait); border-bottom: 1px solid var(--trait);
  display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-semaine .cal-jour:last-child { border-right: 0; }
.cal-jour.repos { background: repeating-linear-gradient(0deg, #f6f8fa 0 6px, #fbfcfd 6px 12px); }
.cal-jour.hors-mois { opacity: .45; }
.cal-jour.aujourdhui { box-shadow: inset 0 3px 0 var(--balise); }
.cal-jour.aujourdhui .cal-num > span:first-child { background: var(--encre); color: #fff; border-radius: 4px; padding: 0 6px; }
.cal-num { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 1.05rem; color: var(--encre); }
.cal-ferie { font-size: .7rem; font-weight: 600; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-gel { display: block; font-size: .72rem; font-weight: 700; color: #7a5300; text-decoration: none; padding: 1px 6px; border-radius: 3px;
  background: repeating-linear-gradient(135deg, var(--balise-pale) 0 5px, #fff6dc 5px 10px); border-left: 3px solid var(--balise);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 -6px; border-radius: 0; }
.cal-gel.bloquant { color: var(--rupture); border-left-color: var(--rupture);
  background: repeating-linear-gradient(135deg, var(--rupture-pale) 0 5px, #fff 5px 10px); }
.cal-tp { display: flex; justify-content: space-between; gap: 4px; align-items: baseline; padding: 2px 6px; border-radius: 3px; text-decoration: none;
  color: var(--encre); background: var(--fond); border-left: 4px solid var(--couleur, var(--fibre)); font-size: .78rem; min-width: 0; }
.cal-tp .ref { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-tp .heure { color: var(--texte-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-tp.sev2 { background: var(--rupture-pale); }
.cal-tp.sev1 { background: var(--balise-pale); }
.cal-tp.rebond { background-image: repeating-linear-gradient(90deg, transparent 0 6px, rgba(47, 93, 138, .08) 6px 9px); font-style: italic; }
.cal-tp.annule { text-decoration: line-through; opacity: .6; }
.cal-tp.chev { outline: 2px solid var(--rupture); outline-offset: -2px; }
.cal-tp:hover { filter: brightness(.95); }
.cal-plus { font-size: .76rem; color: var(--fibre); font-weight: 600; }

/* Chronologie */
.chrono { padding: 10px 14px 14px; overflow-x: auto; }
.chrono-ligne { display: grid; grid-template-columns: 210px minmax(640px, 1fr); align-items: center; min-height: 34px; border-bottom: 1px solid var(--trait); }
.chrono-libelle { padding: 4px 10px 4px 0; font-size: .88rem; line-height: 1.25; }
.chrono-libelle .pastille { font-size: .7rem; padding: 0 6px; }
.chrono-piste { position: relative; height: 100%; min-height: 34px; }
.chrono-axe { position: sticky; top: 0; background: var(--surface); z-index: 3; min-height: 30px; border-bottom: 2px solid var(--encre); }
.chrono-axe .chrono-piste { min-height: 30px; }
.chrono-jour { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--trait); font-size: .74rem; color: var(--texte-2); padding: 6px 4px; white-space: nowrap; overflow: hidden; }
.chrono-jour.repos { background: #f3f5f8; }
.chrono-jour.aujourdhui { color: var(--encre); font-weight: 700; box-shadow: inset 0 -3px 0 var(--balise); }
.chrono-nuit { position: absolute; top: 0; bottom: 0; background: rgba(22, 40, 58, .045); }
.chrono-gel { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(227, 160, 8, .16) 0 5px, transparent 5px 10px); }
.chrono-gel.bloquant { background: repeating-linear-gradient(135deg, rgba(196, 43, 28, .13) 0 5px, transparent 5px 10px); }
.chrono-maintenant { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--balise); z-index: 2; }
.chrono-barre { position: absolute; top: 8px; height: 18px; border-radius: 3px; background: var(--couleur, var(--fibre)); min-width: 4px; z-index: 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }
.chrono-barre.sev2 { box-shadow: 0 0 0 2px var(--rupture); }
.chrono-barre.sev1 { box-shadow: 0 0 0 2px var(--balise); }
.chrono-barre.rebond { background: repeating-linear-gradient(90deg, var(--couleur, var(--fibre)) 0 4px, transparent 4px 7px); }
.chrono-barre.annule { opacity: .35; }
.chrono-barre:hover { filter: brightness(1.15); z-index: 4; }
.chrono-ligne.chevauche .chrono-libelle a.ref::after { content: " ⇄"; color: var(--rupture); }
.chrono-chev { background: #fbfcfd; min-height: 40px; }
.chev-seg { position: absolute; top: 9px; height: 22px; border-radius: 3px; background: var(--balise); color: #16283a; font-size: .74rem; font-weight: 700;
  display: grid; place-items: center; text-decoration: none; min-width: 6px; overflow: hidden; z-index: 1; }
.chev-seg.grave { background: var(--rupture); color: #fff; }
.chrono-vide { position: absolute; left: 8px; top: 11px; }
.chrono-groupe { padding: 10px 0 4px; font-weight: 700; color: var(--encre); border-bottom: 1px solid var(--trait); }
@media (max-width: 760px) { .cal-jour { min-height: 80px; } .cal-tp .heure { display: none; } }

/* Statistiques */
.bilan.kpi div { display: flex; flex-direction: column; }
.legende-graphe { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; padding: 0; margin: 0 0 8px; font-size: .86rem; color: var(--texte-2); }
.legende-graphe .cle { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.graphe-cadre { position: relative; }
.graphe { width: 100%; height: auto; display: block; font-family: "Barlow", sans-serif; }
.graphe .grille { stroke: #e3e8ee; stroke-width: 1; }
.graphe .base { stroke: #9aa7b4; stroke-width: 1; }
.graphe .axe { fill: var(--texte-2); font-size: 11px; }
.graphe .valeur { fill: var(--encre); font-size: 11px; font-weight: 700; }
.graphe .colonne { cursor: default; outline: none; }
.graphe .colonne:hover path, .graphe .colonne:focus path { filter: brightness(1.12); }
.bulle-graphe { position: absolute; z-index: 5; pointer-events: none; background: var(--encre); color: #fff; font-size: .82rem; padding: 6px 10px;
  border-radius: var(--rayon); white-space: nowrap; box-shadow: 0 4px 14px rgba(22, 40, 58, .25); }
table.barres td { vertical-align: middle; }
.barre-cellule { width: 45%; }
.barre { display: block; height: 10px; border-radius: 0 4px 4px 0; background: var(--fibre); min-width: 2px; }
.barre.isole { background: var(--rupture); margin-top: 3px; }

/* Historique de l'inventaire */
.lot { padding: 12px 16px; }
.lot-entete { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--trait); }
.lot-entete form, .col-annuler form { display: flex; gap: 8px; align-items: center; }
table.modifs td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; }
.col-action { width: 120px; }
.col-objet { width: 26%; }
.col-annuler { width: 210px; text-align: right; }
dl.diff { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 0; }
dl.diff dt { color: var(--texte-2); }
dl.diff dd { margin: 0; overflow-wrap: anywhere; }
dl.diff del { color: var(--rupture); text-decoration: line-through; text-decoration-color: rgba(196, 43, 28, .5); }
dl.diff ins { color: var(--sain); text-decoration: none; font-weight: 600; }
tr.annulee td { opacity: .5; }
.code-otp { font: 700 1.6rem/1.2 ui-monospace, monospace; letter-spacing: .3em; text-align: center; }
.qr-totp svg { width: 200px; height: 200px; display: block; background: #fff; border: 1px solid var(--trait); border-radius: var(--rayon); }
.cle-totp { font-size: .95rem; letter-spacing: .05em; user-select: all; }
.liste-codes { columns: 2; font-size: 1.15rem; padding-left: 28px; }
.liste-codes code { letter-spacing: .08em; }
.codes-secours { border-left: 5px solid var(--balise); }
.cache-visuel { position: absolute; left: -9999px; width: 1px; height: 1px; }
.actions-sauvegarde { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; }
.actions-sauvegarde form { display: inline; }
details.restaurer summary { list-style: none; cursor: pointer; }
details.restaurer summary::-webkit-details-marker { display: none; }
details.restaurer[open] { flex-basis: 100%; order: 3; background: var(--rupture-pale); padding: 8px 10px; border-radius: var(--rayon); }
details.restaurer[open] summary { margin-bottom: 6px; }
.petit-champ { width: 120px; padding: 3px 6px; }

/* Pied de page : version et copyright */
main { display: flex; flex-direction: column; min-height: 100vh; }
.pied-app { margin-top: auto; padding: 18px 0 2px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: .78rem; color: var(--texte-2); border-top: 1px solid var(--trait); }
main > .pied-app { margin-top: auto; }
main.plein .pied-app { margin: 0; padding: 6px 16px; flex: none; background: var(--surface); }
.pied-app a { color: var(--texte-2); }
.pied-connexion { text-align: center; font-size: .78rem; color: var(--texte-2); margin-top: 16px; }
.notes-version h2 { display: flex; gap: 10px; align-items: baseline; }
.notes-version ul { margin: 6px 0 0; padding-left: 18px; }
@media print { .pied-app { display: none !important; } }

/* Charte et guide */
.charte, .article-guide { max-width: 860px; line-height: 1.6; }
.charte h2, .article-guide h2 { font-size: 1.15rem; margin: 22px 0 8px; padding-top: 14px; border-top: 1px solid var(--trait); }
.charte h2:first-child, .article-guide > h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.charte li, .article-guide li { margin: 4px 0; }
.acceptation { max-width: 860px; border-left: 5px solid var(--balise); }
.refus { margin: -6px 0 20px; }
textarea.texte-long { font-family: ui-monospace, monospace; font-size: .85rem; line-height: 1.5; }
.guide-encart { border-left: 5px solid var(--fibre); }
.guide-chapitres { list-style: none; padding: 0; margin: 10px 0 0; columns: 2; column-gap: 28px; }
.guide-chapitres li { margin: 0 0 6px; break-inside: avoid; }
.sommaire-guide ol { list-style: none; padding: 0; margin: 0 0 12px; }
.sommaire-guide li { padding: 5px 0; border-bottom: 1px solid var(--trait); font-size: .92rem; }
.guide-suite { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.article-guide table { margin: 8px 0; }
@media (max-width: 760px) { .guide-chapitres { columns: 1; } }

.mention-impression { display: none; }
