/* Agent IA passation – styles simples, lisibles sur téléphone */
:root {
  --brun: #6B2E10; --brun-fonce: #4A1F0A; --fond: #F7F4EF; --carte: #FFFFFF; --bord: #E4DDD2;
  --texte: #2B2118; --doux: #5A4A3C; --vert: #1F6B3A; --vert-clair: #E3F1E7;
  --orange: #8A4B0A; --orange-clair: #FCEBD6; --rouge: #8E2A12; --rouge-clair: #F4E1DC; --gris-clair: #EEEBE6;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 18px/1.45 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--brun); }
header.barre { background: var(--brun); color: #fff; padding: 14px 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
header.barre .marque { font-weight: 700; font-size: 20px; color: #fff; text-decoration: none; }
header.barre.admin { background: var(--texte); }
header.barre nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 16px; }
header.barre nav a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 6px; }
header.barre nav a.actif { background: rgba(255,255,255,.16); }
header.barre form { margin: 0; }
header.barre .lien-bouton { background: none; border: 1px solid rgba(255,255,255,.5); color: #fff; font: inherit; font-size: 15px; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
main { max-width: 760px; margin: 0 auto; padding: 24px 16px 56px; display: flex; flex-direction: column; gap: 18px; }
main.large { max-width: 1180px; }
h1 { margin: 0; font-size: 28px; }
h2 { margin: 0; font-size: 20px; }
.etape { color: var(--orange); font-weight: 600; font-size: 16px; }
.doux { color: var(--doux); font-size: 16px; }
.carte { background: var(--carte); border: 2px solid var(--bord); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.ligne { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.grille2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .grille2 { grid-template-columns: 1fr; } }
label.champ { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 17px; }
input[type=text], input[type=password], input[type=date], input[type=time], select {
  font: inherit; font-size: 19px; padding: 12px 14px; border: 2px solid #CFC4B5; border-radius: 10px; min-height: 54px; width: 100%; background: #fff; color: var(--texte);
}
input:focus, select:focus, button:focus-visible, a:focus-visible, .choix:focus-within { outline: 3px solid #E08A2E; outline-offset: 2px; }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: inherit; font-weight: 700; font-size: 19px; padding: 14px 20px; min-height: 58px; border-radius: 12px; border: none; background: var(--brun); color: #fff; text-decoration: none; cursor: pointer; }
.bouton:hover { background: var(--brun-fonce); color: #fff; }
.bouton.plein { width: 100%; }
.bouton.secondaire { background: #fff; color: var(--brun); border: 2px solid var(--brun); }
.bouton.discret { background: #fff; color: var(--texte); border: 2px solid #CFC4B5; font-size: 16px; min-height: 48px; padding: 10px 16px; }
.bouton.danger { background: #fff; color: var(--rouge); border: 2px solid var(--rouge); font-size: 16px; min-height: 48px; padding: 10px 16px; }
.bouton.pointille { background: #fff; color: var(--brun); border: 2px dashed var(--brun); }
.badge { display: inline-block; font-size: 15px; font-weight: 700; padding: 5px 12px; border-radius: 999px; white-space: nowrap; align-self: flex-start; }
.badge.vert { background: var(--vert-clair); color: var(--vert); }
.badge.orange { background: var(--orange-clair); color: var(--orange); }
.badge.gris { background: var(--gris-clair); color: #4A4038; }
.badge.rouge { background: var(--rouge-clair); color: var(--rouge); }
.message { padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.message.ok { background: var(--vert-clair); color: var(--vert); }
.message.erreur { background: var(--rouge-clair); color: var(--rouge); }
.message.info { background: var(--orange-clair); color: var(--orange); }
/* Choix du sous-projet */
.choix { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 2px solid var(--bord); border-radius: 12px; padding: 16px; cursor: pointer; }
.choix:has(input:checked) { border: 3px solid var(--brun); background: var(--orange-clair); }
.choix input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--brun); flex: none; }
.choix span { display: flex; flex-direction: column; gap: 2px; }
/* Boutons photo */
.photo-bouton { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 110px; padding: 14px; border-radius: 12px; border: 2px dashed #8A7E72; background: #fff; text-align: center; cursor: pointer; font-weight: 700; }
.photo-bouton.fait { border: 2px solid var(--vert); background: var(--vert-clair); color: var(--vert); }
.photo-bouton small { font-weight: 500; font-size: 15px; }
.photo-bouton input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-bloc { display: flex; flex-direction: column; gap: 6px; position: relative; }
.vignettes { display: flex; flex-wrap: wrap; gap: 8px; }
.vignette { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; }
.vignette img, .vignette .pdf { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--bord); background: var(--gris-clair); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--doux); }
.vignette form { margin: 0; }
.vignette button { font: inherit; font-size: 13px; background: none; border: none; color: var(--rouge); text-decoration: underline; cursor: pointer; min-height: 32px; }
/* Offres en accordéon */
details.offre { background: #fff; border: 2px solid var(--bord); border-radius: 12px; }
details.offre > summary { list-style: none; cursor: pointer; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 64px; }
details.offre > summary::-webkit-details-marker { display: none; }
details.offre[open] > summary { border-bottom: 1px solid var(--bord); }
details.offre .contenu { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.titre-offre { display: flex; flex-direction: column; gap: 2px; }
.titre-offre strong { font-size: 19px; }
/* Tableaux de la Coordination */
.tableau { background: #fff; border: 1px solid var(--bord); border-radius: 12px; overflow-x: auto; }
.tableau table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 760px; }
.tableau th { text-align: left; background: #F1ECE4; color: var(--doux); padding: 10px 14px; font-weight: 600; }
.tableau td { padding: 10px 14px; border-top: 1px solid #EDE7DE; vertical-align: top; }
.tableau tr.exclu td { color: var(--doux); background: #FAF8F5; }
.tableau form { margin: 0; display: inline; }
.mono { font-family: ui-monospace, "IBM Plex Mono", monospace; font-size: 14px; }
.petit { font-size: 14px; }
.cache-texte { position: absolute; left: -9999px; }
/* Vérification des pièces */
fieldset.piece { border: 1px solid var(--bord); border-radius: 10px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
fieldset.piece legend { font-weight: 700; font-size: 17px; padding: 0 6px; }
.statuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .statuts { grid-template-columns: 1fr; } }
.statut { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 10px 12px; border: 2px solid #CFC4B5; border-radius: 10px; font-weight: 700; cursor: pointer; background: #fff; }
.statut input { width: 22px; height: 22px; accent-color: var(--brun); flex: none; }
.statut-fc:has(input:checked) { background: var(--vert-clair); border-color: var(--vert); color: var(--vert); }
.statut-fnc:has(input:checked) { background: var(--orange-clair); border-color: var(--orange); color: var(--orange); }
.statut-nf:has(input:checked) { background: var(--rouge-clair); border-color: var(--rouge); color: var(--rouge); }
.petit-champ input { font-size: 16px; min-height: 46px; }
.bouton[disabled] { background: #D9D2C7; color: #5A5148; cursor: not-allowed; }
/* Étapes */
ol.etapes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
ol.etapes li { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 6px; border-radius: 10px; background: var(--gris-clair); color: #4A4038; font-weight: 700; font-size: 16px; }
ol.etapes li span { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; background: #fff; font-size: 14px; }
ol.etapes li.fait { background: var(--vert-clair); color: var(--vert); }
ol.etapes li.actif { background: var(--brun); color: #fff; }
ol.etapes li.actif span { color: var(--brun); }
/* Proposition de l'agent */
.proposition { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--vert-clair); color: #1B4D2C; font-size: 16px; }
.proposition.douteux { background: var(--orange-clair); color: #5A3608; }
.proposition .attention { font-weight: 700; color: var(--orange); }
.lettres { font-size: 15px; color: var(--doux); }
[hidden] { display: none !important; }
/* Tableau de bord */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tuile { background: #fff; border: 1px solid var(--bord); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.tuile span { font-size: 14px; font-weight: 600; color: var(--doux); }
.tuile strong { font-size: 30px; }
.tuile.petite strong { font-size: 24px; }
.tuile small { font-size: 13px; color: var(--doux); }
.jauge-ligne { display: grid; grid-template-columns: minmax(160px, 280px) minmax(0, 1fr) 90px; gap: 12px; align-items: center; font-size: 15px; }
.jauge { height: 14px; background: var(--gris-clair); border-radius: 4px; display: block; }
.jauge span { display: block; height: 14px; border-radius: 4px; }
.jauge .bon { background: var(--vert); } .jauge .moyen { background: #C2700F; } .jauge .faible { background: var(--rouge); }
/* Grille du DAOL */
.table-grille { min-width: 980px; }
.table-grille input[type=text], .table-grille select, .table-grille textarea { font: inherit; font-size: 15px; min-height: 42px; padding: 8px 10px; width: 100%; border: 2px solid #CFC4B5; border-radius: 8px; background: #fff; color: var(--texte); }
.table-grille textarea { resize: vertical; }
.table-grille details summary { cursor: pointer; font-size: 13px; }
/* Scanner intégré */
.lien-import { font-size: 14px; color: var(--brun); text-decoration: underline; cursor: pointer; text-align: center; }
.scanner { position: fixed; inset: 0; z-index: 50; background: #111; color: #fff; display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.scanner.flash { background: #fff; }
.scanner-haut { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.scanner-vue { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 10px; background: #000; }
.scanner-vue video { width: 100%; height: 100%; object-fit: contain; }
.scanner-cadre { position: absolute; inset: 6%; border: 3px dashed rgba(255,255,255,.75); border-radius: 8px; pointer-events: none; }
.scanner-aide { margin: 0; font-size: 15px; color: #ddd; text-align: center; }
.scanner-pages { display: flex; gap: 8px; overflow-x: auto; min-height: 76px; }
.scanner-vignette { position: relative; flex: none; }
.scanner-vignette img { width: 56px; height: 72px; object-fit: cover; border-radius: 6px; border: 2px solid #fff; }
.scanner-vignette span { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.6); font-size: 12px; padding: 0 4px; border-radius: 4px; }
.scanner-vignette button { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: none; background: #8E2A12; color: #fff; font-size: 13px; cursor: pointer; }
.scanner-bas { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 8px; }
.scanner-bas .bouton { min-height: 56px; font-size: 16px; padding: 10px; }
button.photo-bouton { font: inherit; font-weight: 700; color: inherit; width: 100%; }
/* Fenêtre de confirmation */
dialog.confirmation { border: none; border-radius: 16px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(43,33,24,.35); color: var(--texte); }
dialog.confirmation::backdrop { background: rgba(43,33,24,.55); }
dialog.confirmation form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
dialog.confirmation h2 { font-size: 22px; }
dialog.confirmation p { margin: 0; color: var(--doux); }
.confirmation-boutons { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
/* Pages simples (SI, Bamako, FT) */
.entete-dossier { display: flex; flex-direction: column; gap: 6px; }
.entete-dossier h1 { font-size: 26px; }
.sur-titre { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); }
.avis-gros { font-size: 30px; font-weight: 800; align-self: flex-start; padding: 6px 18px; border-radius: 12px; }
.avis-gros.vert { background: var(--vert-clair); color: var(--vert); }
.avis-gros.orange { background: var(--orange-clair); color: var(--orange); }
.avis-gros.rouge { background: var(--rouge-clair); color: var(--rouge); }
.bord-vert { border-color: var(--vert) !important; } .bord-orange { border-color: var(--orange) !important; } .bord-rouge { border-color: var(--rouge) !important; }
.phrase { margin: 0; font-size: 21px; font-weight: 700; }
.explication { margin: 0; color: var(--doux); font-size: 16px; }
ul.conditions { margin: 0; padding-left: 22px; font-size: 17px; font-weight: 600; color: var(--orange); }
.raisons ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.raisons li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; border-left: 6px solid var(--bord); background: #FAF8F5; }
.raisons li span { font-weight: 700; }
.raisons li small { font-size: 15px; color: var(--doux); }
.raisons li.raison-objection { border-left-color: var(--rouge); }
.raisons li.raison-reserve { border-left-color: var(--orange); }
.tout-va-bien { margin: 0; font-weight: 700; color: var(--vert); }
.decision { border-color: var(--brun); }
.choix-avis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 700px) { .choix-avis { grid-template-columns: 1fr; } }
.carte-avis { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 2px solid #CFC4B5; border-radius: 12px; cursor: pointer; background: #fff; }
.carte-avis input { width: 22px; height: 22px; accent-color: var(--brun); }
.carte-avis strong { font-size: 19px; }
.carte-avis em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--brun); background: var(--gris-clair); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.carte-avis span { font-size: 15px; color: var(--doux); }
.carte-vert:has(input:checked) { border-color: var(--vert); background: var(--vert-clair); }
.carte-orange:has(input:checked) { border-color: var(--orange); background: var(--orange-clair); }
.carte-rouge:has(input:checked) { border-color: var(--rouge); background: var(--rouge-clair); }
.decision textarea { font: inherit; padding: 10px; border: 2px solid #CFC4B5; border-radius: 10px; }
details.carte-pliee { background: #fff; border: 2px solid var(--bord); border-radius: 12px; }
details.carte-pliee > summary { cursor: pointer; padding: 16px 18px; font-weight: 700; color: var(--brun); }
details.carte-pliee > form, .details-contenu { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.compteurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.compteur { background: #fff; border: 2px solid var(--bord); border-radius: 12px; padding: 14px; text-decoration: none; color: var(--texte); display: flex; flex-direction: column; gap: 2px; }
.compteur strong { font-size: 32px; }
.compteur span { font-size: 15px; font-weight: 600; color: var(--doux); }
.compteur:first-child { border-color: var(--brun); }
.groupe { display: flex; flex-direction: column; gap: 10px; }
a.carte-dossier { flex-direction: row; align-items: center; justify-content: space-between; text-decoration: none; color: var(--texte); }
a.carte-dossier:hover { border-color: var(--brun); }
.carte-dossier-texte { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 600px) { a.carte-dossier { flex-direction: column; align-items: stretch; } }
.etat-ft { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.pastille { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.pastille.vert { background: var(--vert); } .pastille.orange { background: #C2700F; } .pastille.gris { background: #B5ABA0; }
.decision-ft { display: flex; flex-direction: column; gap: 8px; border: 2px solid var(--bord); border-radius: 12px; padding: 14px; }
/* Page de décision simplifiée */
.verdict { gap: 14px; }
.verdict-boutons { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.verdict-boutons form { margin: 0; }
.table-simple { min-width: 0 !important; font-size: 16px !important; }
.table-simple td, .table-simple th { padding: 14px !important; }
tr[data-expliquer] { cursor: pointer; }
tr[data-expliquer]:hover td, tr[data-expliquer]:focus-visible td { background: #F6F1E9; }
tr.ecart td { background: var(--rouge-clair); }
tr.ecart:hover td, tr.ecart:focus-visible td { background: #EFD3CC; }
.rond { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.rond.vert { background: var(--vert-clair); color: var(--vert); }
.rond.rouge { background: var(--rouge); color: #fff; }
.raisons-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.raisons-liste li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; border-left: 6px solid var(--bord); background: #FAF8F5; }
.raisons-liste li span { font-weight: 700; }
.raisons-liste li small { font-size: 15px; color: var(--doux); }
.raisons-liste li.raison-objection { border-left-color: var(--rouge); }
.raisons-liste li.raison-reserve { border-left-color: var(--orange); }
