/* Objectifs DG — habillage Groupe Beaucage (même système qu'Opérations fixes) : en-tête charbon souligné de rouge,
   Barlow Condensed pour les titres, IBM Plex Sans pour le texte, chiffres alignés, état en vert / jaune / rouge. */
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("vendor/polices/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("vendor/polices/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("vendor/polices/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("vendor/polices/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
:root {
  --encre: #303435; --fond: #f3f3f3; --surface: #ffffff; --trait: #e1e1e1; --texte: #1a1a1a; --doux: #686868;
  --accent: #c8102e; --accent-doux: #fbe8eb; --gb-rouge: #c8102e; --marine: #141414; --marine-2: #2a2a2a;
  --vert: #1f7a4a; --vert-fond: #e3f3e9; --jaune: #8a5a00; --jaune-fond: #fdf0d8; --rouge: #b0102a; --rouge-fond: #fbe3e6;
  --entete-texte: #ffffff;
  --cadre: #303435; --cadre-fond: #e9e9e9; --carte-tete: #f4f4f4; --btn-fonce: #303435; --btn-fonce-texte: #ffffff; --pale: #bdbdbd; --case-fond: #f6f6f6;
  --vert-pale: #d3eedc; --vert-pale-2: #c2e6ce; --jaune-pale: #fbe5b4; --jaune-pale-2: #f8d993; --rouge-pale: #f7d2d8; --rouge-pale-2: #f2bec6;
  --police: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --police-titre: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --rayon: 6px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --encre: #000000; --fond: #0f0f0f; --surface: #1a1a1a; --trait: #333333; --texte: #ededed; --doux: #a3a3a3;
  --accent: #ef5b6e; --accent-doux: #3a1a20; --gb-rouge: #e8384f; --marine: #000000; --marine-2: #1c1c1c;
  --vert: #8fd8ae; --vert-fond: #143323; --jaune: #f0c96a; --jaune-fond: #3a2c10; --rouge: #f4a3a3; --rouge-fond: #44201f;
  --entete-texte: #ededed; --cadre: #9a9a9a; --cadre-fond: #202020; --carte-tete: #262626; --btn-fonce: #e4e4e4; --btn-fonce-texte: #111111; --pale: #5a5a5a; --case-fond: #232323; --vert-pale: #1f3a29; --vert-pale-2: #26462f; --jaune-pale: #3d3110; --jaune-pale-2: #4a3b12; --rouge-pale: #452127; --rouge-pale-2: #53282f;
  --vert-pale: #1f3a29; --vert-pale-2: #26462f; --jaune-pale: #3d3110; --jaune-pale-2: #4a3b12; --rouge-pale: #452127; --rouge-pale-2: #53282f;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --cadre: #9a9a9a; --cadre-fond: #202020; --carte-tete: #262626; --btn-fonce: #e4e4e4; --btn-fonce-texte: #111111; --pale: #5a5a5a; --case-fond: #232323;
  --encre: #000000; --fond: #0f0f0f; --surface: #1a1a1a; --trait: #333333; --texte: #ededed; --doux: #a3a3a3;
  --accent: #ef5b6e; --accent-doux: #3a1a20; --gb-rouge: #e8384f; --marine: #000000; --marine-2: #1c1c1c;
  --vert: #8fd8ae; --vert-fond: #143323; --jaune: #f0c96a; --jaune-fond: #3a2c10; --rouge: #f4a3a3; --rouge-fond: #44201f;
  --entete-texte: #ededed; color-scheme: dark; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 14px/1.45 var(--police); font-variant-numeric: tabular-nums; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--marine); }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--police-titre); text-wrap: balance; margin: 0; color: var(--texte); }
h1 { font-size: 2rem; font-weight: 600; letter-spacing: 0; line-height: 1.05; }
h2 { font-size: 1.45rem; font-weight: 600; }
h3 { font-family: var(--police); font-size: 0.95rem; font-weight: 600; }
.muet { color: var(--doux); }
.sous { color: var(--doux); margin: 4px 0 0; max-width: 75ch; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* En-tête */
.entete { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: linear-gradient(100deg, var(--marine) 0%, var(--marine-2) 100%);
  border-bottom: 4px solid var(--gb-rouge); color: var(--entete-texte); }
.entete-int, .page, .bandeau-demo { max-width: 1320px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.entete-int { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 10px; }
.entete-gauche { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-width: 0; }
.entete-gauche .retour-portail + .marque { padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .25); }
.marque { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.marque b { display: block; font-family: var(--police-titre); font-weight: 600; font-size: 24px; line-height: 1; }
.marque small { display: block; color: rgba(255, 255, 255, .75); font-size: 12.5px; margin-top: 2px; }
.logo { width: 40px; height: 40px; border-radius: 50%; background: #fff; padding: 2px; flex: none; display: block; }
.logo-connexion { width: 72px; height: 72px; display: block; }
.entete-droite { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 0.85rem; }
.a-jour { color: rgba(255, 255, 255, .75); } .a-jour b { color: var(--entete-texte); }
.role-demo { display: flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .75); }
.role-demo select { background: #2a2a2a; color: #fff; border: 1px solid rgba(255, 255, 255, .35); border-radius: var(--rayon); padding: 4px 6px; }
.qui { color: rgba(255, 255, 255, .85); }
.entete .lien { color: #fff; }
.bandeau-demo { background: var(--jaune-fond); color: var(--jaune); font-weight: 600; font-size: 0.85rem; padding-block: 6px; max-width: none; text-align: center; }

.page { padding-block: 20px 48px; display: flex; flex-direction: column; gap: 20px; }
.bandeau-vue { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.fil { margin: 0 0 2px; font-size: 0.85rem; color: var(--doux); }
.fil a { text-decoration: none; }
.outils { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.choix-mois { display: flex; align-items: center; gap: 6px; color: var(--doux); font-size: 0.85rem; }
select, input { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 6px 8px; }
.bascule { display: inline-flex; border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
.bascule button { border: 0; background: var(--surface); padding: 6px 14px; cursor: pointer; color: var(--doux); }
.bascule button.actif { background: var(--encre); color: #fff; }
.bouton { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 7px 14px; border-radius: var(--rayon);
  text-decoration: none; cursor: pointer; font-weight: 600; }
.bouton.secondaire { background: transparent; color: var(--accent); }
.bouton:disabled { opacity: 0.45; cursor: default; }
.lien { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }

/* Sommaire */
.sommaire { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tuile { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tuile b { font: 650 1.7rem var(--police-titre); }
.etiquette { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--doux); }
.vert-t { color: var(--vert); } .jaune-t { color: var(--jaune); } .rouge-t { color: var(--rouge); }

/* Tableaux */
.table-defile { overflow-x: auto; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); }
.grille { border-collapse: collapse; width: 100%; font-size: 0.86rem; }
.grille th, .grille td { padding: 7px 9px; text-align: right; border-bottom: 1px solid var(--trait); white-space: nowrap; }
.grille th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--doux); font-weight: 600; background: var(--fond); }
.grille th.grp { text-align: center; border-left: 1px solid var(--trait); color: var(--texte); }
.grille .g { text-align: left; }
.grille tbody tr:last-child td { border-bottom: 0; }
.grille.suivi td:nth-child(4), .grille.suivi td:nth-child(8) { border-left: 1px solid var(--trait); }
.grille.suivi td.g { white-space: normal; min-width: 220px; }
.grille.groupe td { vertical-align: middle; }
tr.cliquable { cursor: pointer; } tr.cliquable:hover td { background: var(--fond); }
.grille.groupe td.g a { color: var(--texte); font-weight: 600; text-decoration: none; }
.lib { font-weight: 550; }
.note-ind { display: block; font-size: 0.78rem; color: var(--doux); white-space: normal; margin-top: 2px; }
.note-bas { font-size: 0.8rem; color: var(--doux); margin: 8px 0 0; max-width: 90ch; }
.dep { display: flex; flex-direction: column; gap: 8px; }
.dep h3 { margin-top: 10px; }

.puce { display: inline-block; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.03em; padding: 1px 6px; border-radius: 3px; vertical-align: 1px; }
.src-doc { background: var(--encre); color: #fff; }
.src-saisie { background: var(--fond); color: var(--doux); border: 1px solid var(--trait); }
.src-calcule { background: transparent; color: var(--doux); border: 1px dashed var(--trait); }
.brouillon { background: var(--jaune-fond); color: var(--jaune); }
.prio-puce { background: var(--gb-rouge); color: #fff; }

.pastille { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 600; }
.pastille i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pastille.vert { color: var(--vert); } .pastille.jaune { color: var(--jaune); } .pastille.rouge { color: var(--rouge); }
.pastille.vide { color: var(--doux); }
.ecart.vert { color: var(--vert); } .ecart.jaune { color: var(--jaune); } .ecart.rouge { color: var(--rouge); }

.repart { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.repart-barre { display: flex; width: 52px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--trait); gap: 1px; }
.repart-barre .vert { background: var(--vert); } .repart-barre .jaune { background: var(--jaune); } .repart-barre .rouge { background: var(--rouge); }
.repart-txt { font-size: 0.8rem; color: var(--doux); min-width: 3.2em; text-align: left; } .repart-txt b { color: var(--texte); }
.kpi-cell small { color: var(--doux); margin-left: 4px; }
.kpi-cell.vert b { color: var(--vert); } .kpi-cell.rouge b { color: var(--rouge); } .kpi-cell.jaune b { color: var(--jaune); }

/* Blocs */
.bloc { display: flex; flex-direction: column; gap: 10px; }
.titre-bloc { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.prios { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.prio { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; background: var(--surface); border: 1px solid var(--trait);
  border-left: 4px solid var(--trait); border-radius: var(--rayon); padding: 12px; }
.prio.vert { border-left-color: var(--vert); } .prio.jaune { border-left-color: var(--jaune); } .prio.rouge { border-left-color: var(--rouge); }
.rang { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gb-rouge); color: #fff; font-weight: 700; font-size: 0.85rem; }
.prio-corps { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.prio p { margin: 0; }
.chiffres b { font-size: 1.15rem; }
.msg { font-size: 0.85rem; color: var(--doux); font-style: italic; margin: 0; }

.liste-actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.liste-actions li { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.liste-actions li.rouge { box-shadow: inset 3px 0 0 var(--rouge); } .liste-actions li.jaune { box-shadow: inset 3px 0 0 var(--jaune); }
.liste-actions li.vert { box-shadow: inset 3px 0 0 var(--vert); }
.act-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act-tete h3 { flex: 1; min-width: 0; }
.consigne { margin: 0; font-weight: 600; }
.levier { margin: 0; color: var(--doux); font-size: 0.88rem; }
.impact { margin: 0; font-size: 0.82rem; color: var(--texte); font-weight: 600; }
.vide-etat { background: var(--surface); border: 1px dashed var(--trait); border-radius: var(--rayon); padding: 16px; color: var(--doux); margin: 0; }

/* Saisie et objectifs */
.grille.saisie input, .grille.objectifs input.num { width: 92px; text-align: right; padding: 4px 6px; }
.grille.objectifs input.note { width: 100%; min-width: 220px; }
.grille.saisie input.occupe { opacity: 0.5; }
.grille tr.sep td { text-align: left; font-weight: 650; background: var(--fond); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--doux); }
.unite { color: var(--doux); font-size: 0.78rem; }
.saison { display: inline-flex; align-items: flex-end; gap: 2px; height: 34px; padding-bottom: 12px; position: relative; }
.saison span { width: 9px; background: var(--encre); opacity: 0.7; border-radius: 2px 2px 0 0; position: relative; }
.saison em { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 0.6rem; color: var(--doux); margin-top: 1px; }
.edit-prios { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.edit-prios li { display: grid; grid-template-columns: auto minmax(140px, 220px) 1fr auto; gap: 10px; align-items: center; background: var(--surface);
  border: 1px solid var(--trait); border-radius: var(--rayon); padding: 8px 10px; }
.edit-prios input { min-width: 0; }
.mini-outils { display: flex; gap: 4px; }
.mini-outils button { border: 1px solid var(--trait); background: var(--surface); border-radius: 4px; width: 30px; height: 30px; cursor: pointer; }
.mini-outils button:disabled { opacity: 0.35; cursor: default; }
.ajout-prio { display: flex; gap: 10px; flex-wrap: wrap; }

.toast { position: fixed; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--encre); color: #e8eef4;
  padding: 10px 16px; border-radius: var(--rayon); z-index: 20; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); max-width: calc(100% - 32px); }
.toast.err { background: var(--rouge); color: #fff; }
.ecran-msg { max-width: 460px; margin: 12vh auto; padding-inline: 16px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.connexion form { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 16px; }
.erreur { color: var(--rouge); margin: 0; }

@media (max-width: 640px) {
  h1 { font-size: 1.3rem; }
  .sommaire { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .tuile { padding: 8px; } .tuile b { font-size: 1.3rem; }
  .edit-prios li { grid-template-columns: auto 1fr auto; }
  .edit-prios li input { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Historique (courbe du réel par extraction du DOC) : voir plus bas, cartes */
.lien.petit { font-size: 0.75rem; margin-left: 4px; }

/* Bouton « Retour » (remplace le fil d'Ariane) */
.retour { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; margin-bottom: 10px;
  padding: 6px 18px 6px 6px; border-radius: 999px; background: var(--encre); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 15px; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.retour:hover { background: var(--gb-rouge); color: #fff; }
.retour:focus-visible { outline: 3px solid var(--gb-rouge); outline-offset: 3px; }
.retour .fleche { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .18); font-size: 18px; line-height: 1; }
@media print { .retour { display: none; } }

/* Vue Groupe : résumé dépliable d'une concession */
.nom-conc { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--texte); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chevron { display: inline-grid; place-items: center; width: 18px; color: var(--gb-rouge); font-size: 14px; }
tr.ouverte td { background: var(--fond); border-bottom-color: transparent; }
tr.resume td { background: var(--fond); white-space: normal; text-align: left; padding: 4px 10px 16px; }
.resume-int { position: sticky; left: 10px; max-width: min(1240px, calc(100vw - 54px)); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.resume-blocs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 370px), 1fr)); gap: 10px; width: 100%; }
.resume-dep { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 10px 12px; min-width: 0; }
.resume-dep h3 { margin: 0 0 6px; font-family: var(--police-titre); font-size: 1.15rem; }
.resume-dep h3 .muet { font-family: var(--police); font-size: 0.78rem; font-weight: 500; }
.resume-dep ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.resume-dep li { border-top: 1px solid var(--trait); font-size: 0.84rem; }
.r-ligne { display: grid; grid-template-columns: 14px minmax(0, 1fr) max-content 12px; column-gap: 8px; align-items: baseline; width: 100%;
  padding: 5px 4px; background: none; border: 0; border-radius: 4px; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.r-ligne:hover { background: var(--fond); }
.r-ligne:hover .r-lib { text-decoration: underline; }
.r-fleche { color: var(--gb-rouge); font-weight: 600; }
.resume-dep li:first-child { border-top: 0; }
.r-lib { min-width: 0; }
.r-val { white-space: nowrap; text-align: right; }
.r-ecart { grid-column: 3; white-space: nowrap; text-align: right; font-size: 0.78rem; }

/* Ligne d'objectif choisie : cadre ardoise autour de la ligne et de ses cartes ouvertes, jusqu'au clic sur une autre ligne */
.grille.suivi tbody tr[id] { scroll-margin-top: 120px; }
tr.ligne-obj { cursor: pointer; }
tr.ligne-obj:hover td { background: var(--fond); }
/* Fond très pâle selon la pastille du mois (vert, jaune, rouge) */
tr.ligne-obj.e-vert td { background: var(--vert-pale); } tr.ligne-obj.e-vert:hover td { background: var(--vert-pale-2); }
tr.ligne-obj.e-jaune td { background: var(--jaune-pale); } tr.ligne-obj.e-jaune:hover td { background: var(--jaune-pale-2); }
tr.ligne-obj.e-rouge td { background: var(--rouge-pale); } tr.ligne-obj.e-rouge:hover td { background: var(--rouge-pale-2); }
tr.choisie:not(.e-vert):not(.e-jaune):not(.e-rouge) td { background: var(--cadre-fond); }
tr.choisie .lib { font-family: var(--police-titre); font-size: 1.3rem; font-weight: 600; line-height: 1.1; }
/* Ligne ouverte + panneau dessous : un seul cadre ardoise continu, aux coins arrondis */
.grille.suivi { border-collapse: separate; border-spacing: 0; }
tr.choisie td { box-shadow: inset 0 2px 0 var(--cadre), inset 0 -2px 0 var(--cadre); }
tr.choisie td:first-child { box-shadow: inset 2px 0 0 var(--cadre), inset 0 2px 0 var(--cadre), inset 0 -2px 0 var(--cadre); border-radius: 14px 0 0 14px; }
tr.choisie td:last-child { box-shadow: inset -2px 0 0 var(--cadre), inset 0 2px 0 var(--cadre), inset 0 -2px 0 var(--cadre); border-radius: 0 14px 14px 0; }
tr.choisie.avec-suite td { box-shadow: inset 0 2px 0 var(--cadre); border-bottom-color: transparent; }
tr.choisie.avec-suite td:first-child { box-shadow: inset 2px 0 0 var(--cadre), inset 0 2px 0 var(--cadre); border-radius: 14px 0 0 0; }
tr.choisie.avec-suite td:last-child { box-shadow: inset -2px 0 0 var(--cadre), inset 0 2px 0 var(--cadre); border-radius: 0 14px 0 0; }
tr.panneau td { padding: 0; background: transparent; border-bottom: 0; white-space: normal; text-align: left; }
.panneau-int { display: flex; flex-direction: column; gap: 12px; padding: 16px 12px 14px; margin-bottom: 8px; }
tr.panneau.de-choisie .panneau-int { background: var(--cadre-fond); border: 2px solid var(--cadre); border-top: 0; border-radius: 0 0 14px 14px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .08); }

/* Cartes à en-tête marqué */
.carte { position: sticky; left: 12px; max-width: min(1120px, calc(100vw - 64px)); background: var(--surface); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 6px 16px rgba(0, 0, 0, .05); }
.carte-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 18px; background: var(--carte-tete); border-bottom: 1px solid var(--trait); }
.carte-trait { width: 5px; height: 20px; border-radius: 3px; background: var(--cadre); }
.carte-tete h4 { margin: 0; font: 600 1.35rem/1.1 var(--police-titre); letter-spacing: .02em; color: var(--texte); }
.carte-sous { font-size: 0.82rem; color: var(--doux); }
.carte-droite { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; }
.carte-corps { padding: 14px 18px 16px; }

/* « Que faire ? » : étapes à gauche, piste et cases à droite */
.conseil-grille { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 26px; }
@media (max-width: 760px) { .conseil-grille { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.etapes-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; position: relative; }
.etapes::before { content: ""; position: absolute; left: 13px; top: 16px; bottom: 16px; width: 2px; background: var(--trait); }
.etapes li { position: relative; display: flex; gap: 12px; align-items: center; padding: 5px 12px 5px 0; border-radius: 14px; }
.etapes li > div { display: flex; flex-direction: column; min-width: 0; }
.etapes .num { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--pale); color: #fff; font-size: 0.8rem; font-weight: 700; }
.et-lib { font-size: 0.75rem; color: var(--doux); }
.etapes b { font: 600 1.35rem/1.15 var(--police-titre); color: var(--texte); }
.etapes b.petit { font: 600 0.9rem var(--police); }
.etapes b .sur { color: var(--doux); font-size: 1rem; }
.etapes small { font-size: 0.78rem; color: var(--doux); }
.et-texte { font-size: 0.88rem; font-weight: 600; }
.etapes li.cle { background: var(--accent-doux); }
.etapes li.cle .num { background: var(--gb-rouge); box-shadow: 0 0 0 4px var(--accent-doux); }
.etapes li.cle .et-lib { color: var(--rouge); }
.etapes li.cle b { color: var(--gb-rouge); }
/* Étape 2 selon l'état du mois : vert = atteint, jaune = proche, rouge = en retard */
.etapes li.cle.e-vert { background: var(--vert-fond); }
.etapes li.cle.e-vert .num { background: var(--vert); color: var(--surface); box-shadow: 0 0 0 4px var(--vert-fond); }
.etapes li.cle.e-vert .et-lib, .etapes li.cle.e-vert b { color: var(--vert); }
.etapes li.cle.e-jaune { background: var(--jaune-fond); }
.etapes li.cle.e-jaune .num { background: var(--jaune); color: var(--surface); box-shadow: 0 0 0 4px var(--jaune-fond); }
.etapes li.cle.e-jaune .et-lib, .etapes li.cle.e-jaune b { color: var(--jaune); }
.puces-conseil { display: flex; gap: 6px; flex-wrap: wrap; padding-left: 40px; }
.puce-g { font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--case-fond); color: var(--texte); border: 1px solid var(--trait); }
.puce-g.fonce { background: var(--btn-fonce); color: var(--btn-fonce-texte); border-color: var(--btn-fonce); }
.etapes-col .msg { padding-left: 40px; }
.conseil-droite { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Piste de course */
.piste { padding: 8px 4px 0; }
.piste-rail { position: relative; height: 20px; background: var(--trait); border-radius: 999px; }
.piste-plein { position: absolute; inset: 0 auto 0 0; background: var(--gb-rouge); border-radius: 999px; }
.piste-repere { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1px; background: var(--cadre); border-radius: 2px; }
.piste-bulle { position: absolute; top: 50%; transform: translate(-50%, -50%); min-width: 30px; height: 30px; padding: 0 8px; box-sizing: border-box;
  display: grid; place-items: center; border-radius: 999px; background: var(--surface); border: 3px solid var(--gb-rouge); font-weight: 700; font-size: 0.8rem; white-space: nowrap; }
.piste-legende { position: relative; height: 18px; margin-top: 6px; font-size: 0.75rem; color: var(--doux); }
.piste-legende > span { position: absolute; white-space: nowrap; }
.piste-lib-repere { transform: translateX(-50%); color: var(--texte); font-weight: 600; }
.piste-fin { right: 0; color: var(--texte); font-weight: 600; }

/* Cases à cocher (propres au navigateur, remises à zéro chaque jour) */
.cases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cases label { display: flex; gap: 10px; align-items: flex-start; background: var(--case-fond); border-radius: 12px; padding: 8px 12px; cursor: pointer; font-size: 0.88rem; }
.cases input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--cadre); padding: 0; }
.cases label.fait span { text-decoration: line-through; color: var(--doux); }

/* Courbe de l'historique */
.leg { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--doux); }
.leg i { display: inline-block; width: 18px; }
.leg-reel { height: 3px; border-radius: 2px; background: var(--gb-rouge); }
.leg-rythme { border-top: 2px dashed var(--cadre); }
.courbe { position: relative; height: 170px; margin: 6px 0 0 56px; }
.courbe svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.c-grad { position: absolute; left: 0; right: 0; border-top: 1px solid var(--trait); }
.c-grad span { position: absolute; right: calc(100% + 8px); top: -0.6em; font-size: 0.72rem; color: var(--doux); white-space: nowrap; }
.c-aire { fill: var(--gb-rouge); fill-opacity: .08; }
.c-reel { fill: none; stroke: var(--gb-rouge); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.c-rythme { fill: none; stroke: var(--cadre); stroke-width: 2; stroke-dasharray: 6 5; }
.c-point { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--gb-rouge); }
.c-point.dernier { width: 14px; height: 14px; margin: -7px 0 0 -7px; box-shadow: 0 0 0 3px var(--surface); }
.c-valeur { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: var(--gb-rouge); color: #fff; font-weight: 600; font-size: 0.8rem;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.courbe-attente { height: 200px; display: grid; place-items: center; }
.c-dates { position: relative; height: 18px; margin: 6px 0 0 56px; font-size: 0.72rem; color: var(--doux); }
.c-dates span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

/* Ligne cliquable : petit chevron devant le nom */
.chevron-ligne { display: inline-block; width: 14px; color: var(--doux); font-size: 0.8rem; }
tr.choisie .chevron-ligne { color: var(--cadre); }
tr.ligne-obj:focus-visible { outline: 2px solid var(--cadre); outline-offset: -2px; }

/* Avis « Nouvelle version disponible » (même apparence qu'Opérations fixes) */
.bouton.petit { padding: 5px 12px; font-size: 13px; }
.maj-dispo { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(env(safe-area-inset-top, 0px) + 78px); z-index: 30;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: calc(100vw - 32px);
  padding: 10px 14px; background: var(--surface); color: var(--texte); border: 2px solid var(--gb-rouge); border-left-width: 6px; border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .25); font-size: 14px; font-weight: 500; animation: maj-clignote 1.1s ease-in-out infinite; }
@keyframes maj-clignote {
  0%, 100% { background: var(--surface); box-shadow: 0 4px 18px rgba(0, 0, 0, .25); }
  50% { background: var(--accent-doux); box-shadow: 0 0 0 4px var(--gb-rouge), 0 4px 18px rgba(0, 0, 0, .25); }
}
@media (prefers-reduced-motion: reduce) { .maj-dispo { animation: none; background: var(--accent-doux); box-shadow: 0 0 0 3px var(--gb-rouge), 0 4px 18px rgba(0, 0, 0, .25); } }
@media print { .maj-dispo { display: none; } }

/* ===== Fiche de la concession : « À faire aujourd'hui », « Actions du jour », départements repliables ===== */
.ligne-section { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: var(--texte); background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; padding: 12px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: background-color .15s, box-shadow .15s; }
.ligne-section:hover { background: var(--fond); box-shadow: 0 3px 10px rgba(0, 0, 0, .07); }
.ligne-section:focus-visible { outline: 2px solid var(--cadre); outline-offset: 2px; }
.ls-titre { font: 600 1.35rem/1.1 var(--police-titre); }
.ls-info { color: var(--doux); font-size: 0.85rem; }
.ls-chevron { margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--fond); color: var(--cadre); font-size: 0.85rem; }
.ligne-section[aria-expanded="true"] .ls-chevron { background: var(--btn-fonce); color: var(--btn-fonce-texte); }
.dep { margin-top: 10px; }
.dep-ligne .ls-chevron { margin-left: 0; }
.dep-ligne .repart { margin-left: auto; }
.dep-etats { display: flex; gap: 6px; flex-wrap: wrap; }
.puce-etat { font-size: 0.75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.puce-etat.rouge { background: var(--rouge-fond); color: var(--rouge); }
.puce-etat.jaune { background: var(--jaune-fond); color: var(--jaune); }
.puce-etat.vert { background: var(--vert-fond); color: var(--vert); }
.dep.ouvert .table-defile { margin-top: 8px; }

/* Liste complète des actions du jour */
.liste-act { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.act-ligne { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: var(--texte); background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; padding: 10px 14px 10px 10px;
  box-shadow: inset 5px 0 0 var(--trait); }
.act-ligne.e-rouge { box-shadow: inset 5px 0 0 var(--gb-rouge); } .act-ligne.e-jaune { box-shadow: inset 5px 0 0 #c98a00; } .act-ligne.e-vert { box-shadow: inset 5px 0 0 var(--vert); }
.act-ligne:hover { background: var(--fond); }
.act-num { display: grid; place-items: center; width: 32px; height: 32px; margin-left: 6px; border-radius: 50%; background: var(--fond); font-weight: 700; font-size: 0.8rem; }
.act-ligne.e-rouge .act-num { background: var(--rouge-fond); color: var(--rouge); } .act-ligne.e-jaune .act-num { background: var(--jaune-fond); color: var(--jaune); }
.act-ligne.e-vert .act-num { background: var(--vert-fond); color: var(--vert); }
.act-corps { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.act-titre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act-consigne { font-size: 0.88rem; color: var(--doux); }
.act-droite { display: flex; align-items: center; gap: 10px; }
@media (max-width: 600px) { .act-ligne { grid-template-columns: 40px minmax(0, 1fr); } .act-droite { grid-column: 2; } }

/* « À faire aujourd'hui » : base commune */
.a-faire { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; margin-top: 10px; }
.af-carte { position: relative; display: flex; gap: 14px; align-items: flex-start; text-align: left; cursor: pointer; font: inherit; color: var(--texte);
  background: var(--surface); border: 1px solid var(--trait); border-radius: 18px; padding: 16px 18px 14px; min-width: 0;
  transition: transform .15s, box-shadow .15s; }
.af-carte:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, .10); }
.af-carte:focus-visible { outline: 2px solid var(--cadre); outline-offset: 2px; }
.af-corps { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.af-tete { display: flex; gap: 6px; flex-wrap: wrap; min-height: 0; }
.af-tete:empty { display: none; }
.af-lib { font-weight: 600; font-size: 0.95rem; }
.af-but { font: 600 1.7rem/1.1 var(--police-titre); color: var(--gb-rouge); }
.af-carte.e-jaune .af-but { color: var(--jaune); } .af-carte.e-vert .af-but { color: var(--vert); }
.af-detail { font-size: 0.82rem; color: var(--doux); } .af-detail.fort { font-size: 0.9rem; font-weight: 600; color: var(--texte); }
.af-msg { font-size: 0.82rem; font-style: italic; color: var(--doux); }
.af-lien { position: absolute; right: 16px; bottom: 12px; font-size: 0.8rem; font-weight: 600; color: var(--cadre); opacity: .7; }
.af-carte:hover .af-lien { opacity: 1; }
.af-piste { position: relative; height: 8px; margin: 6px 40px 0 0; border-radius: 999px; background: var(--trait); overflow: hidden; }
.af-piste i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--gb-rouge); }
.af-carte.e-jaune .af-piste i { background: #c98a00; } .af-carte.e-vert .af-piste i { background: var(--vert); }
.af-num { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 700; color: #fff; background: var(--gb-rouge); }
.af-carte.e-jaune .af-num { background: #c98a00; } .af-carte.e-vert .af-num { background: var(--vert); color: var(--surface); }

/* Bulles colorées : cartes teintées selon l'état, barre de progression */
.v-bulles .af-carte { border: 0; background: var(--rouge-pale); box-shadow: 0 2px 6px rgba(0, 0, 0, .05); }
.v-bulles .af-carte.e-jaune { background: var(--jaune-pale); } .v-bulles .af-carte.e-vert { background: var(--vert-pale); }
.v-bulles .af-piste { background: rgba(255, 255, 255, .7); }

.af-dep { font-weight: 400; font-size: 0.8rem; color: var(--doux); }
.act-titre .af-dep { background: var(--fond); padding: 1px 8px; border-radius: 999px; font-size: 0.72rem; }
.af-carte { padding-bottom: 34px; }
/* Indicateur sans résultat ce mois-ci : gris */
.af-carte.e-aucun .af-num { background: var(--pale); }
.af-carte.e-aucun .af-but { color: var(--texte); }
.v-bulles .af-carte.e-aucun { background: var(--case-fond); }
@media (max-width: 600px) { .act-ligne .r-fleche { display: none; } .act-droite:empty, .act-droite:not(:has(.puce-g)) { display: none; } }

/* Ligne de département : la ligne entière ouvre ou ferme; les bulles d'état filtrent les indicateurs */
.dep-ligne { cursor: pointer; }
.dep-titre { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.dep-titre:focus-visible { outline: 2px solid var(--cadre); outline-offset: 4px; border-radius: 4px; }
button.puce-etat { font: inherit; font-size: 0.75rem; font-weight: 600; border: 1.5px solid transparent; cursor: pointer; transition: transform .1s, box-shadow .1s; }
button.puce-etat:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
button.puce-etat.rouge:hover, button.puce-etat.rouge[aria-pressed="true"] { border-color: var(--rouge); }
button.puce-etat.jaune:hover, button.puce-etat.jaune[aria-pressed="true"] { border-color: var(--jaune); }
button.puce-etat.vert:hover, button.puce-etat.vert[aria-pressed="true"] { border-color: var(--vert); }
button.puce-etat[aria-pressed="true"].rouge { background: var(--gb-rouge); color: #fff; }
button.puce-etat[aria-pressed="true"].jaune { background: var(--jaune); color: var(--surface); }
button.puce-etat[aria-pressed="true"].vert { background: var(--vert); color: var(--surface); }
button.puce-etat:focus-visible { outline: 2px solid var(--cadre); outline-offset: 2px; }
.dep.ouvert .dep-ligne .ls-chevron { background: var(--btn-fonce); color: var(--btn-fonce-texte); }
/* Département ouvert : ligne de titre en surbrillance (cadre ardoise, comme la ligne d'indicateur ouverte) */
.dep.ouvert .dep-ligne { background: var(--cadre-fond); border: 2px solid var(--cadre); box-shadow: inset 6px 0 0 var(--cadre), 0 3px 10px rgba(0, 0, 0, .08); padding-left: 22px; }
.dep.ouvert .dep-ligne:hover { background: var(--cadre-fond); }

/* Ouverture et fermeture animées des sections (départements, Actions du jour, « Que faire ? », « Historique ») */
.repli { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .26s ease, opacity .22s ease; }
.repli.ouvert { grid-template-rows: 1fr; opacity: 1; }
.repli-int { min-height: 0; overflow: hidden; }
.repli.fini .repli-int { overflow: visible; }
.ls-chevron { transition: transform .2s ease, background-color .2s; }
@media (prefers-reduced-motion: reduce) { .repli { transition: none; } }

/* Aperçu « vue d'un DG » (direction et analyste) */
.bandeau-apercu { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  background: var(--btn-fonce); color: var(--btn-fonce-texte); font-size: 0.9rem; text-align: center; }
.bandeau-apercu .bouton { background: var(--gb-rouge); border-color: var(--gb-rouge); color: #fff; }
.vue-dg select { max-width: 220px; }
.saisie input:disabled { background: var(--fond); color: var(--doux); cursor: not-allowed; }
