:root {
  --bleu: #1e3a5f; --bleu-clair: #eaf1f8; --accent: #f5a623;
  --ok: #2e7d32; --ko: #c62828; --gris: #6b7280; --bord: #d7dee8;
  --n1: #c62828; --n2: #e5734a; --n3: #f5a623; --n4: #8bc34a; --n5: #2e7d32;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; background: #f4f6f9; color: #1f2937; }
header { background: var(--bleu); color: #fff; padding: 10px 18px; display: flex; align-items: center; gap: 18px; }
.brand { font-weight: 700; font-size: 17px; cursor: pointer; white-space: nowrap; }
#mission-titre { font-size: 15px; opacity: .9; }
nav { background: #fff; border-bottom: 1px solid var(--bord); padding: 0 18px; display: flex; gap: 4px; flex-wrap: wrap; }
nav a { padding: 11px 16px; text-decoration: none; color: var(--gris); font-size: 14px; border-bottom: 3px solid transparent; }
nav a.actif { color: var(--bleu); border-bottom-color: var(--accent); font-weight: 600; }
nav a.fait { color: var(--ok); }
#tab-termine { margin-left: auto; align-self: center; padding: 4px 10px; font-size: 12.5px; white-space: nowrap; }
button.fait-btn { background: var(--ok); }
button.fait-btn.secondaire { background: #fff; color: var(--ok); border-color: var(--ok); }
main { padding: 18px; max-width: 1250px; margin: 0 auto; }
.hidden { display: none !important; }
h2 { font-size: 18px; margin: 4px 0 14px; }
.carte { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
button { background: var(--bleu); color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; font-size: 14px; cursor: pointer; }
button.secondaire { background: #fff; color: var(--bleu); border: 1px solid var(--bleu); }
button.danger { background: #fff; color: var(--ko); border: 1px solid var(--ko); padding: 4px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { border: 1px solid var(--bord); border-radius: 6px; padding: 7px 9px; font-size: 14px; font-family: inherit; }
textarea { width: 100%; resize: vertical; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--gris); font-weight: 600; font-size: 12.5px; padding: 6px 8px; border-bottom: 2px solid var(--bord); }
td { padding: 7px 8px; border-bottom: 1px solid #edf0f4; vertical-align: top; }
tr.clic { cursor: pointer; }
tr.clic:hover { background: var(--bleu-clair); }
.ligne-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* Tables denses (listes de personnes, pré-requis…) : lignes resserrées */
table.serree td { padding: 2px 4px; border-bottom: 1px solid #f1f4f8; }
table.serree th { padding: 4px 4px; }
table.serree input, table.serree select { padding: 3px 6px; font-size: 13px; }
table.serree button.danger { padding: 2px 6px; }
/* Drapeaux OK / KO / À investiguer des questions de cadrage */
.flag-btn { width: 26px; height: 22px; padding: 0; border: 1px solid var(--bord); background: #fff; color: var(--gris); border-radius: 5px; font-size: 12px; font-weight: 700; cursor: pointer; margin-left: 3px; }
.flag-btn.actif-ok { background: var(--n5); border-color: var(--n5); color: #fff; }
.flag-btn.actif-ko { background: var(--n1); border-color: var(--n1); color: #fff; }
.flag-btn.actif-inv { background: var(--n3); border-color: var(--n3); color: #fff; }
.flag-com { width: 100%; margin-top: 3px; font-size: 12.5px; border-color: var(--n3); }
/* Modale de progression des traitements IA */
.modale-fond { position: fixed; inset: 0; background: rgba(30,58,95,.45); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modale { background: #fff; border-radius: 10px; padding: 18px 22px; width: min(560px, 92vw); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modale-etapes { max-height: 300px; overflow-y: auto; border: 1px solid var(--bord); border-radius: 6px; padding: 8px 10px; min-height: 40px; background: #f8fafc; }
.spinner { width: 16px; height: 16px; border: 3px solid var(--bord); border-top-color: var(--bleu); border-radius: 50%; animation: tourner .8s linear infinite; flex: none; }
@keyframes tourner { to { transform: rotate(360deg); } }
/* Proposition IA (Remplacer / Ignorer) — rien n'est écrasé sans validation */
.proposition-ia { border: 2px dashed var(--accent); border-radius: 8px; background: #fffaf0; padding: 8px 12px; margin-top: 6px; }
/* Réponse rapide OUI / NON / NE SAIT PAS des questions fermées du cadrage */
.onn { background: #fff; color: var(--gris); border: 1px solid var(--bord); border-radius: 6px; padding: 3px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.onn.onn-actif { background: var(--bleu); border-color: var(--bleu); color: #fff; }
/* Bandeau bleu + menu toujours visibles au défilement */
#haut { position: sticky; top: 0; z-index: 30; }
/* Plan d'action : pas d'ascenseur horizontal, en-têtes toujours visibles au défilement
   (décalés sous le bandeau collant, hauteur mesurée par app.js dans --haut-h) */
#act-table th { position: sticky; top: var(--haut-h, 0px); background: #fff; z-index: 5; box-shadow: 0 2px 0 var(--bord); border-bottom: 0; }
#act-table td { padding: 6px 5px; }
#act-table input, #act-table select, #act-table textarea { padding: 5px 6px; font-size: 12.5px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: var(--bleu-clair); color: var(--bleu); }
.chapitre-titre { background: var(--bleu); color: #fff; padding: 8px 12px; border-radius: 6px; margin: 18px 0 8px; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.chapitre-titre .compteur { float: right; font-weight: 400; opacity: .85; font-size: 13px; }
.item-carte { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.item-entete { display: flex; gap: 10px; align-items: baseline; }
.item-num { font-weight: 700; color: var(--bleu); white-space: nowrap; }
.item-intitule { flex: 1; }
.aide { color: var(--gris); cursor: help; font-size: 13px; border-bottom: 1px dotted var(--gris); }
.notes-btns { display: flex; gap: 5px; margin: 8px 0 6px; flex-wrap: wrap; align-items: center; }
.note-btn { width: 34px; height: 30px; border-radius: 6px; border: 1px solid var(--bord); background: #fff; color: #374151; font-weight: 700; cursor: pointer; font-size: 13px; }
.note-btn.na { width: auto; padding: 0 9px; font-weight: 600; }
.note-btn.sel-1 { background: var(--n1); } .note-btn.sel-2 { background: var(--n2); }
.note-btn.sel-3 { background: var(--n3); } .note-btn.sel-4 { background: var(--n4); }
.note-btn.sel-5 { background: var(--n5); }
.note-btn[class*="sel-"] { color: #fff; border-color: transparent; }
.note-btn.sel-sp { background: var(--gris); color: #fff; border-color: transparent; }
.pastille { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; border-radius: 5px; color: #fff; font-size: 12px; font-weight: 700; padding: 0 4px; }
.p1 { background: var(--n1); } .p2 { background: var(--n2); } .p3 { background: var(--n3); }
.p4 { background: var(--n4); } .p5 { background: var(--n5); } .pna { background: var(--gris); }
.pv { background: #e5e7eb; color: #6b7280; }
.obs-ligne { display: flex; gap: 8px; align-items: flex-start; margin: 3px 0; font-size: 13px; }
.obs-qui { min-width: 170px; color: var(--gris); }
.exemples { font-size: 12.5px; color: var(--gris); background: #f8fafc; border-left: 3px solid var(--bord); padding: 6px 10px; margin-top: 6px; display: none; }
.exemples b { color: #374151; }
.item-carte.ouvert .exemples { display: block; }
.grille-conso { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
@media (max-width: 980px) { .grille-conso { grid-template-columns: 1fr; } }
.score-tuile { display: inline-block; background: var(--bleu); color: #fff; border-radius: 10px; padding: 14px 22px; margin: 0 10px 10px 0; text-align: center; }
.score-tuile .val { font-size: 30px; font-weight: 700; }
.score-tuile .leg { font-size: 12.5px; opacity: .85; }
.barre { height: 10px; border-radius: 5px; background: #e5e7eb; overflow: hidden; position: relative; }
.barre > div { height: 100%; background: var(--bleu); }
.barre > div.proj { position: absolute; top: 0; left: 0; background: repeating-linear-gradient(45deg, var(--accent), var(--accent) 4px, transparent 4px, transparent 8px); }
.item-carte.critique { border-left: 4px solid var(--n1); }
.carto { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.carto-dom { border: 1px solid var(--bord); border-radius: 8px; min-width: 170px; max-width: 240px; overflow: hidden; }
.carto-titre { background: var(--bleu); color: #fff; padding: 5px 10px; font-size: 13px; font-weight: 600; }
.carto-app { padding: 4px 10px; font-size: 13px; border-top: 1px solid #edf0f4; cursor: help; }
.carto-app:hover { background: var(--bleu-clair); }
.grille-resti { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 8px; }
@media (max-width: 980px) { .grille-resti { grid-template-columns: 1fr; } }
.grille-resti label { font-size: 12.5px; font-weight: 600; }
#toast { position: fixed; bottom: 20px; right: 20px; background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 50; }
#toast.erreur { background: var(--ko); }
.filtres { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.muted { color: var(--gris); font-size: 13px; }
progress { width: 160px; height: 10px; }
