/* Charte Groupe InCA : couleurs « Guide d'expression », Jost (substitut libre de Futura), motif « coin en L ». */
@font-face { font-family: Jost; font-weight: 400; font-display: swap; src: url("../fonts/jost-latin-400-normal.3c986c6628b4.woff2") format("woff2"); }
@font-face { font-family: Jost; font-weight: 500; font-display: swap; src: url("../fonts/jost-latin-500-normal.a3c2438bfe16.woff2") format("woff2"); }
@font-face { font-family: Jost; font-weight: 600; font-display: swap; src: url("../fonts/jost-latin-600-normal.b6346d671c34.woff2") format("woff2"); }
:root {
  --gris: #b0adb0; --taupe: #7e7672; --taupe-f: #696361; --clair: #ecebea; --noir: #1f1c1b; --ligne: #d9d6d4; --fond: #f4f3f2;
  --ok: #5d8657; --attente: #b9822f; --alerte: #a8473b; --info: #5b6f80;
}
* { box-sizing: border-box; }
html { font-size: 14.5px; color: var(--noir); background: var(--clair); }
body { margin: 0; font-family: Jost, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
h1 { font-size: 1.6rem; font-weight: 500; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 1.1rem; font-weight: 500; margin: 0; }
a { color: var(--taupe-f); }
input, select, textarea, button { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }

/* Mise en page */
.app { display: flex; min-height: 100vh; }
.menu { position: sticky; top: 0; height: 100vh; width: 232px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--taupe-f); color: #fff; padding: 20px 0; }
.menu .logo { display: flex; align-items: center; gap: 12px; padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,.2); color: #fff; text-decoration: none; }
.menu .logo b { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; }
.menu .logo span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.menu nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; }
.menu nav a { display: flex; justify-content: space-between; align-items: center; border-radius: 4px; padding: 8px 14px; font-size: 14px; color: #fff; text-decoration: none; opacity: .85; }
.menu nav a:hover { background: rgba(255,255,255,.1); }
.menu nav a.actif { opacity: 1; background: rgba(255,255,255,.15); font-weight: 500; box-shadow: inset 3px 0 0 #fff; }
.menu nav .pastille { border-radius: 999px; background: rgba(255,255,255,.25); padding: 0 8px; font-size: 11px; }
.menu nav .rub { padding: 16px 14px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; opacity: .55; }
.menu .pied { margin-top: auto; border-top: 1px solid rgba(255,255,255,.2); padding: 12px 20px 0; font-size: 12.5px; }
.menu .pied a { color: #fff; opacity: .8; font-size: 12px; }
.principal { flex: 1; min-width: 0; }
.entete { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--ligne); }
.entete .ariane { font-size: 13px; color: var(--taupe); }
.entete .ariane a { color: var(--taupe); text-decoration: none; }
.entete .ariane b { font-weight: 500; color: var(--noir); }
.entete form { margin-left: auto; }
.entete input { width: 320px; border: 0; border-radius: 4px; background: var(--clair); padding: 8px 14px; font-size: 13px; outline: none; }
.page { padding: 28px; }

/* Composants */
.surtitre { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .18em; color: var(--taupe); }
.carte { position: relative; border: 1px solid var(--ligne); border-radius: 4px; background: #fff; }
.carte-coin::before { content: ""; position: absolute; left: -1px; bottom: -1px; width: 24px; height: 24px; border-left: 4px solid var(--taupe-f); border-bottom: 4px solid var(--taupe-f); }
.carte-titre { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--ligne); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .16em; }
.carte-titre .note, .carte-titre a.note { text-transform: none; letter-spacing: normal; font-weight: 400; }
.carte-corps { padding: 12px 16px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--taupe-f); border-radius: 4px; background: #fff; padding: 8px 14px; font-size: 13.5px; font-weight: 500; color: var(--taupe-f); text-decoration: none; text-transform: none; letter-spacing: normal; white-space: nowrap; }
.btn:hover { background: var(--clair); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-p { background: var(--taupe-f); color: #fff; }
.btn-p:hover { background: var(--taupe); }
.btn-s { padding: 4px 10px; font-size: 12.5px; }
.btn-danger { border-color: var(--alerte); color: var(--alerte); }
.btn-danger:hover { background: #fbeeee; }
.inp { border: 1px solid var(--ligne); border-radius: 3px; background: #fff; padding: 6px 8px; font-size: 13.5px; outline: none; max-width: 100%; }
.inp:focus { border-color: var(--taupe); box-shadow: 0 0 0 2px var(--clair); }
.inp:disabled { background: #f7f6f5; color: #555; }
.inp-n { text-align: right; font-variant-numeric: tabular-nums; }
.inp-force { border-color: #e3c48f; background: #fbf3e5; }
.lbl { display: block; margin-bottom: 4px; font-size: 12px; color: var(--taupe); }
.tag { display: inline-block; white-space: nowrap; border-radius: 999px; padding: 2px 10px; font-size: 11.5px; font-weight: 500; text-decoration: none; }
.st-afaire { background: #eeeceb; color: #5c5755; } .st-encours { background: #e2e8ee; color: var(--info); } .st-averifier { background: #f6ead6; color: var(--attente); }
.st-valide { background: #e3eee1; color: var(--ok); } .st-envoye { background: #e4e2e1; color: #3e3a38; }
.t-ok { background: #e3eee1; color: var(--ok); } .t-attente { background: #f6ead6; color: var(--attente); } .t-alerte { background: #f4e1de; color: var(--alerte); } .t-gris { background: #eeeceb; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { border-bottom: 1px solid var(--ligne); padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--taupe); }
.tbl td { border-bottom: 1px solid #eeeceb; padding: 6px 10px; vertical-align: middle; font-size: 13.5px; }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.groupe td { background: var(--clair); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; }
.tbl tr.clic { cursor: pointer; } .tbl tr.clic:hover, .tbl tr.sel { background: var(--fond); }
.note { font-size: 12.5px; color: var(--taupe); }
.alerte, .avert, .ok { border-radius: 3px; padding: 8px 12px; font-size: 13px; }
.alerte { border-left: 4px solid var(--alerte); background: #f7ebe9; }
.avert { border-left: 4px solid var(--attente); background: #f8efe0; }
.ok { border-left: 4px solid var(--ok); background: #ebf2ea; }
.onglets { display: flex; flex-wrap: wrap; margin: 12px 0 16px; border-bottom: 1px solid var(--ligne); }
.onglets a, .onglets button { padding: 10px 16px; font-size: 13.5px; color: var(--taupe); text-decoration: none; background: none; border: 0; }
.onglets a.actif, .onglets button.actif { font-weight: 500; color: var(--noir); box-shadow: inset 0 -3px 0 var(--taupe-f); }
.mini-onglets { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--ligne); }
.mini-onglets button { border: 0; background: none; border-radius: 4px 4px 0 0; padding: 6px 12px; font-size: 12.5px; color: var(--taupe); }
.mini-onglets button.actif { background: var(--taupe-f); color: #fff; }
.etapes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 20px; }
.etapes button { border: 1px solid var(--ligne); border-radius: 4px; background: #fff; padding: 8px 12px; text-align: left; font-size: 12.5px; color: var(--taupe); }
.etapes button b { display: block; font-size: 13.5px; font-weight: 500; color: var(--noir); }
.etapes button.actif { border-color: var(--taupe-f); box-shadow: inset 0 -3px 0 var(--taupe-f); }
.ouinon { display: inline-flex; overflow: hidden; border: 1px solid var(--ligne); border-radius: 4px; font-size: 13px; }
.ouinon label { padding: 4px 12px; background: #fff; color: var(--taupe); cursor: pointer; }
.ouinon input { display: none; }
.ouinon input:checked + span { color: #fff; }
.ouinon label:has(input:checked) { background: var(--taupe-f); color: #fff; }
.ouinon.couleurs label.oui:has(input:checked) { background: var(--ok); } .ouinon.couleurs label.non:has(input:checked) { background: var(--alerte); }

/* Utilitaires */
.flex { display: flex; } .wrap { flex-wrap: wrap; } .centre { align-items: center; } .fin { align-items: flex-end; } .debut { align-self: flex-start; }
.entre { justify-content: space-between; } .droite { margin-left: auto; } .g1 { gap: 4px; } .g2 { gap: 8px; } .g3 { gap: 12px; } .g4 { gap: 16px; } .g5 { gap: 20px; }
.grille { display: grid; gap: 20px; } .g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pile > * + * { margin-top: 16px; } .pile-s > * + * { margin-top: 8px; }
.mt1 { margin-top: 4px; } .mt2 { margin-top: 8px; } .mt3 { margin-top: 12px; } .mt4 { margin-top: 16px; } .mt5 { margin-top: 20px; } .mb2 { margin-bottom: 8px; } .mb3 { margin-bottom: 12px; } .mb4 { margin-bottom: 16px; } .mb5 { margin-bottom: 20px; }
.p2 { padding: 8px; } .w-full { width: 100%; } .w12 { width: 48px; } .w16 { width: 64px; } .w20 { width: 80px; } .w24 { width: 96px; } .w32 { width: 128px; } .w40 { width: 160px; } .w48 { width: 192px; } .w56 { width: 224px; } .w64 { width: 256px; } .w80 { width: 320px; }
.nowrap { white-space: nowrap; } .gras { font-weight: 500; } .petit { font-size: 12.5px; } .xl { font-size: 1.4rem; font-weight: 500; } .texte-ok { color: var(--ok); } .texte-alerte { color: var(--alerte); } .texte-attente { color: var(--attente); }
.n { text-align: right; } .defile-x { overflow-x: auto; } .grise { opacity: .6; } .cache { display: none !important; } .sticky { position: sticky; top: 80px; align-self: flex-start; }
.svg svg { display: block; }
.col-apercu { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 1500px) { .col-apercu.avec { grid-template-columns: minmax(0, 1fr) 480px; } .xl-g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .g-3, .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Aperçu du PDF (page A4 réduite) */
.apercu-cadre { max-height: calc(100vh - 160px); overflow-y: auto; overflow-x: hidden; background: var(--ligne); padding: 8px; }
.apercu-page { width: 794px; transform-origin: top left; background: #fff; padding: 0 12mm; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.htmx-request .indic { opacity: 1; } .indic { opacity: 0; transition: opacity .2s; }
@media print { .no-print { display: none !important; } html, body { background: #fff !important; } }

/* v1.4 : lignes déplaçables */
td.poignee { cursor: grab; color: var(--taupe); user-select: none; width: 18px; text-align: center; font-size: 15px; }
tr.tire { opacity: .45; background: var(--fond); }

/* v1.6 · menuiseries : sous-lignes par fenêtre (une par fenêtre d'une ligne « n × », options pour nb = 1) */
.tbl tr.men-fen td { background: var(--fond); border-bottom: 1px solid var(--clair); padding: 3px 10px; font-size: 12.5px; }
.tbl tr.men-fen-der td { border-bottom: 1px solid var(--ligne); }
.tbl tr.men-fen td.men-fen-n { text-align: right; color: var(--taupe); font-variant-numeric: tabular-nums; }
.men-fen-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; position: sticky; left: 10px; max-width: 1080px; }
.men-fen-opts label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.men-fen-opts .inp { padding: 3px 6px; font-size: 12.5px; }
.men-fen-titre { min-width: 92px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--taupe); }
.men-fen-print { font-size: 11px; color: var(--taupe-f); }

/* v1.6 · plâtrerie : saisie rapide, typologies et sous-totaux */
.tbl tr.pl-typo td { background: var(--fond); color: var(--taupe-f); }
.tbl tr.pl-st td { font-weight: 500; border-top: 1px solid var(--taupe); background: var(--fond); }
.pl-rapide .carte-corps { background: var(--fond); }
.pl-rapide .flash { animation: pl-flash 1.2s ease-out; }
@keyframes pl-flash { from { background: #e3ecdf; } to { background: transparent; } }
/* v1.6 · demandes : questions Oui / Non deux par ligne, autres champs sur toute la largeur */
.champs-demande { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.champs-demande > .ch-large { grid-column: 1 / -1; }
/* v1.6 · éditeur de formulaire (administration) */
.tbl-form td { vertical-align: top; } .tbl-form .inp { font-size: 12.5px; } .tbl-form tr.retire td:not(:first-child) { opacity: .5; }
.marque-modif { color: var(--attente); font-size: 11px; }
/* v1.6 · contrôles avant validation : bloquant (rouge, .alerte), avertissement (orange, .avert), encart permanent de l'étude */
.ctl-ligne { display: flex; align-items: baseline; gap: 12px; }
.ctl-ligne .ctl-niveau { flex-shrink: 0; width: 76px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.ctl-ligne.alerte .ctl-niveau { color: var(--alerte); } .ctl-ligne.avert .ctl-niveau { color: var(--attente); }
.ctl-ligne .ctl-msg { flex: 1; min-width: 0; }
.ctl-ligne .ctl-lien { flex-shrink: 0; font-size: 12.5px; }
.ctl-valider { border-top: 1px solid var(--ligne); padding-top: 10px; margin-top: 4px; }
.ctl-coche { font-size: 13.5px; font-weight: 500; }
.ctl-encart { border: 0; cursor: pointer; }
.ctl-encart:hover { filter: brightness(.96); }
.ctl-tbl select.modifie { border-color: var(--attente); }


/* v1.6 · parcours : démarrage du dossier en 3 étapes, modules verrouillés, avancement du tableau de bord */
.demarrage-etapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.demarrage-etapes li { display: flex; gap: 12px; padding: 12px 16px; }
.demarrage-etapes li + li { border-left: 1px solid var(--ligne); }
.demarrage-etapes .dm-num { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--taupe-f); font-weight: 600; color: var(--taupe-f); }
.demarrage-etapes li.fait .dm-num { border-color: var(--ok); background: var(--ok); color: #fff; }
.demarrage-etapes .dm-corps { min-width: 0; }
.demarrage-etapes .dm-sans-plan { display: inline-flex; }
.demarrage-ok { display: flex; align-items: center; gap: 8px; }
@media (max-width: 1100px) { .demarrage-etapes { grid-template-columns: minmax(0, 1fr); } .demarrage-etapes li + li { border-left: 0; border-top: 1px solid var(--ligne); } }
.cadenas { flex-shrink: 0; vertical-align: -2px; }
.module-verrou { background: var(--fond); color: var(--taupe); cursor: not-allowed; }
.module-verrou .carte-titre { color: var(--taupe); }
.module-verrou .btn:disabled { pointer-events: none; }
.av { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 500; text-decoration: none; }
.av-afaire { background: #eeeceb; color: #5c5755; } .av-encours { background: #e2e8ee; color: var(--info); } .av-valide { background: #e3eee1; color: var(--ok); }
.av-incomplet { background: #f6ead6; color: var(--attente); } .av-sansobjet, .av-facultatif { color: var(--gris); padding: 2px 4px; } .av-verrou { color: var(--gris); }

/* v1.6 · aide « ? » par écran (panneau latéral) */
.btn-aide { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--taupe-f); background: #fff; color: var(--taupe-f); font-weight: 600; font-size: 15px; line-height: 1; }
.btn-aide:hover, .btn-aide[aria-expanded=true] { background: var(--taupe-f); color: #fff; }
.aide-panneau { position: fixed; z-index: 60; top: 64px; right: 0; bottom: 0; width: 380px; max-width: 100vw; overflow-y: auto; padding: 16px 22px 22px;
  background: #fff; border-left: 1px solid var(--ligne); box-shadow: -8px 0 24px rgba(31,28,27,.12); }
.aide-panneau[hidden] { display: none; }
.aide-panneau::before { content: ""; position: absolute; left: 0; bottom: 0; width: 24px; height: 24px; border-left: 4px solid var(--taupe-f); border-bottom: 4px solid var(--taupe-f); }
.aide-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.aide-fermer { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--taupe); padding: 0 4px; }
.aide-panneau h2 { margin-bottom: 10px; }
.aide-texte { font-size: 13.5px; line-height: 1.5; }
.aide-texte p { margin: 0 0 8px; } .aide-texte ul { margin: 0 0 10px; padding-left: 18px; } .aide-texte li { margin-bottom: 4px; }
.aide-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--ligne); }

/* v1.6 · bienvenue : visite guidée en bulles */
.menu-visite { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 0; border: 0; background: none; color: #fff; opacity: .85; font-size: 12.5px; }
.menu-visite:hover { opacity: 1; }
.rond-aide { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(255,255,255,.7); font-weight: 600; font-size: 12px; }
.visite-couche { position: fixed; inset: 0; z-index: 1000; }
.visite-couche.sombre { background: rgba(31,28,27,.45); }
.visite-halo { position: fixed; z-index: 1001; border-radius: 6px; box-shadow: 0 0 0 3px #fff, 0 0 0 9999px rgba(31,28,27,.45); pointer-events: none; transition: all .2s ease; }
.visite-halo[hidden] { display: none; }
.visite-bulle { position: fixed; z-index: 1002; width: 340px; max-width: calc(100vw - 24px); padding: 14px 18px 14px; border-radius: 4px; background: #fff;
  box-shadow: 0 10px 30px rgba(31,28,27,.3); }
.visite-bulle.carte-coin::before { left: 0; bottom: 0; }
.visite-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.visite-passer { border: 0; background: none; padding: 0; font-size: 12.5px; color: var(--taupe); text-decoration: underline; }
.visite-bulle h2 { margin-bottom: 6px; }
.visite-bulle p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.5; color: var(--noir); }
.visite-pied { display: flex; justify-content: flex-end; gap: 8px; }


/* Soubassement : rangs depuis la semelle (N) et rangs enterrés (E) mis en évidence (24/11/2026) */
.lbl.lbl-fort { font-size: 13.5px; font-weight: 600; color: var(--noir); margin-bottom: 2px; }
.lbl-fort + .note { font-size: 11.5px; margin-bottom: 4px; }
.pastille-rang { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--taupe-f); color: #fff; font-size: 11px; font-weight: 600; text-align: center; line-height: 18px; vertical-align: 1px; }
.tbl th.th-rang { color: var(--noir); font-weight: 600; white-space: nowrap; line-height: 1.25; }
/* Plan de l'éditeur en lecture seule dans l'étude de maçonnerie (24/11/2026) */
.plan-lecture-carte > summary { cursor: pointer; list-style: none; }
.plan-lecture-carte > summary::-webkit-details-marker { display: none; }
.plan-lecture-carte > summary > span::before { content: "▸ "; }
.plan-lecture-carte[open] > summary > span::before { content: "▾ "; }

/* v1.7 · lot A · couleurs des modules, mode sombre, tableau de bord, lightbox, raccourcis ------------------------------------- */
/* Couleurs pastel des modules (variables partagées par tous les lots) : fond pastel, et variante -f (plus foncée) pour liserés et textes.
   Une zone d'un module porte la classe .mod-macon / .mod-platre / .mod-devis, qui définit --mod et --mod-f. */
:root {
  --mod-macon: #fbe4d0; --mod-macon-f: #cf7f40;
  --mod-platre: #ddefda; --mod-platre-f: #5f9b5a;
  --mod-devis: #dce8f5; --mod-devis-f: #4f86bf;
  --surface: #fff; --surface-2: #f7f6f5; --lien: var(--taupe-f); --ombre: rgba(31,28,27,.18);
}
.mod-macon { --mod: var(--mod-macon); --mod-f: var(--mod-macon-f); }
.mod-platre { --mod: var(--mod-platre); --mod-f: var(--mod-platre-f); }
.mod-devis { --mod: var(--mod-devis); --mod-f: var(--mod-devis-f); }
.pastille-mod { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--mod-f); flex-shrink: 0; }

a { color: var(--lien); }

/* Cartes de modules (fiche du dossier) : liseré discret à gauche, titre sur fond pastel */
.carte.carte-module { border-left: 3px solid var(--mod-f); }
.carte.carte-module > .carte-titre { background: var(--mod); }
.carte.carte-module.grise { opacity: .75; }

/* Écrans d'étude : fine barre de la couleur du module sous le titre, étape / onglet actif souligné */
.etude-entete { padding-bottom: 12px; border-bottom: 3px solid var(--mod-f); }
.etude-entete .surtitre .pastille-mod { margin-right: 2px; }
.etude-module .etapes button.actif { border-color: var(--mod-f); box-shadow: inset 0 -3px 0 var(--mod-f); background: var(--mod); }
.etude-module .mini-onglets button.actif { background: var(--mod-f); }
.etude-module .onglets a.actif, .etude-module .onglets button.actif { box-shadow: inset 0 -3px 0 var(--mod-f); }
.etude-module [data-pl-niveaux] .btn.actif { box-shadow: inset 0 -3px 0 var(--mod-f); }

/* Tableau de bord : 3 colonnes Maçonnerie / Plâtrerie / Demandes */
.tb-colonnes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .tb-colonnes { grid-template-columns: minmax(0, 1fr); } }
.tb-col { border-top: 3px solid var(--mod-f); }
.tb-col > .carte-titre { background: var(--mod); }
.tb-col .tb-ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--ligne); }
.tb-col .tb-ligne:last-child { border-bottom: 0; }
.tb-col .tb-ligne:hover { background: var(--fond); }
.tb-col .tb-doss { font-weight: 500; text-decoration: none; color: var(--noir); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-col .tb-etude { font-size: 12.5px; color: var(--taupe); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-col .tb-av { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.tb-col .tb-actions { grid-row: 1 / 3; grid-column: 2; display: flex; align-items: center; gap: 4px; }
.tb-etapes { display: inline-flex; gap: 2px; vertical-align: middle; }
.tb-etapes i { width: 9px; height: 6px; border-radius: 1px; background: var(--ligne); }
.tb-etapes i.fait { background: var(--mod-f); }
.btn-oeil { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 28px; border: 1px solid var(--ligne); border-radius: 4px; background: var(--surface); color: var(--taupe-f); }
.btn-oeil:hover { border-color: var(--mod-f, var(--taupe-f)); color: var(--noir); }
.tb-filtre { display: inline-flex; border: 1px solid var(--ligne); border-radius: 4px; overflow: hidden; }
.tb-filtre a { padding: 5px 12px; font-size: 12.5px; text-decoration: none; color: var(--taupe); background: var(--surface); }
.tb-filtre a + a { border-left: 1px solid var(--ligne); }
.tb-filtre a.actif { background: var(--taupe-f); color: #fff; }

/* Lightbox (aperçu du PDF sans quitter la page) */
dialog.lightbox { width: min(1100px, 94vw); height: 92vh; max-height: 92vh; padding: 0; border: 0; border-radius: 6px; background: var(--surface); color: var(--noir); box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; }
dialog.lightbox::backdrop { background: rgba(31,28,27,.55); }
dialog.lightbox .lb-tete { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 10px 0 16px; border-bottom: 3px solid var(--mod-f, var(--ligne)); }
dialog.lightbox .lb-tete b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
dialog.lightbox .lb-fermer { margin-left: 8px; border: 0; background: none; font-size: 24px; line-height: 1; color: var(--taupe); padding: 0 6px; }
dialog.lightbox iframe { display: block; width: 100%; height: calc(100% - 46px); border: 0; background: #fff; }

/* Thème (menu et « Mon compte ») */
.theme-choix { display: inline-flex; border: 1px solid var(--ligne); border-radius: 4px; overflow: hidden; }
.theme-choix button { border: 0; background: var(--surface); color: var(--taupe); padding: 4px 10px; font-size: 12.5px; }
.theme-choix button + button { border-left: 1px solid var(--ligne); }
.theme-choix button.actif { background: var(--taupe-f); color: #fff; }
.menu .theme-choix { border-color: rgba(255,255,255,.3); margin: 4px 0 10px; }
.menu .theme-choix button { background: transparent; color: #fff; opacity: .75; padding: 3px 8px; font-size: 11.5px; }
.menu .theme-choix button + button { border-left-color: rgba(255,255,255,.3); }
.menu .theme-choix button.actif { background: rgba(255,255,255,.2); opacity: 1; }
.menu .pied .compte { color: #fff; opacity: 1; font-size: 12.5px; text-decoration: none; font-weight: 500; }
.menu .pied .compte:hover { text-decoration: underline; }
.menu nav a.actif-compte { opacity: 1; }

/* Raccourcis clavier */
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border: 1px solid var(--ligne); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2); font: 500 11.5px/1.5 Jost, Arial, sans-serif; text-align: center; color: var(--noir); }
dialog.raccourcis { width: 440px; max-width: 94vw; padding: 18px 22px; border: 0; border-radius: 4px; background: var(--surface); color: var(--noir); box-shadow: 0 10px 30px rgba(0,0,0,.3); }
dialog.raccourcis::backdrop { background: rgba(31,28,27,.45); }
dialog.raccourcis table { width: 100%; margin: 8px 0 12px; } dialog.raccourcis td { padding: 6px 0; border-bottom: 1px solid var(--ligne); font-size: 13.5px; }
dialog.raccourcis td:first-child { white-space: nowrap; width: 1%; padding-right: 16px; }
.entete .ariane { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Historique filtrable */
.histo-filtres { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--ligne); }
.histo-mod { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--taupe); white-space: nowrap; }

/* Mode sombre : html[data-theme="dark"] (choix « Sombre », ou « Système » quand l'ordinateur est en sombre ; résolu dans <head>) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --noir: #ebe7e4; --clair: #171514; --fond: #23201f; --ligne: #3b3735; --gris: #7d7876; --taupe: #a9a19c; --taupe-f: #6f6763;
  --surface: #1f1c1b; --surface-2: #2a2725; --lien: #cbbfb8; --ombre: rgba(0,0,0,.5);
  --ok: #8cc287; --attente: #e0ac5c; --alerte: #e58a7c; --info: #9fb6ca;
  --mod-macon: #3a2a1d; --mod-macon-f: #e3a06a; --mod-platre: #1f3221; --mod-platre-f: #86c282; --mod-devis: #1c2a3a; --mod-devis-f: #84b3e3;
}
:root[data-theme="dark"] .menu { background: #2a2624; }
:root[data-theme="dark"] .entete, :root[data-theme="dark"] .carte, :root[data-theme="dark"] .inp,
:root[data-theme="dark"] .aide-panneau, :root[data-theme="dark"] .visite-bulle { background-color: var(--surface); }
:root[data-theme="dark"] .btn { background-color: var(--surface); color: var(--lien); border-color: #6f6763; }
:root[data-theme="dark"] .btn:hover { background-color: var(--fond); }
:root[data-theme="dark"] .btn-p { background-color: #6f6763; color: #fff; } :root[data-theme="dark"] .btn-p:hover { background-color: #857c77; }
:root[data-theme="dark"] .btn-danger { border-color: var(--alerte); color: var(--alerte); }
:root[data-theme="dark"] .etapes button:not(.actif), :root[data-theme="dark"] .ouinon label:not(:has(input:checked)) { background-color: var(--surface); }
:root[data-theme="dark"] .btn-aide:not(:hover):not([aria-expanded=true]) { background-color: var(--surface); color: var(--lien); border-color: #6f6763; }
:root[data-theme="dark"] .inp:disabled { background: var(--surface-2); color: #bdb6b1; }
:root[data-theme="dark"] .alerte { background: #3a2522; } :root[data-theme="dark"] .avert { background: #382d1b; } :root[data-theme="dark"] .ok { background: #1f3020; }
:root[data-theme="dark"] .t-gris, :root[data-theme="dark"] .st-afaire, :root[data-theme="dark"] .av-afaire { background: #34302e; color: #d6d0cc; }
:root[data-theme="dark"] .st-encours, :root[data-theme="dark"] .av-encours { background: #22303d; color: var(--info); }
:root[data-theme="dark"] .st-averifier, :root[data-theme="dark"] .t-attente, :root[data-theme="dark"] .av-incomplet { background: #3a2f1b; color: var(--attente); }
:root[data-theme="dark"] .st-valide, :root[data-theme="dark"] .t-ok, :root[data-theme="dark"] .av-valide { background: #1f3220; color: var(--ok); }
:root[data-theme="dark"] .t-alerte { background: #3c2421; color: var(--alerte); } :root[data-theme="dark"] .st-envoye { background: #34302e; color: #e3ddd9; }
:root[data-theme="dark"] .inp-force { border-color: #8a6a35; background: #3a2f1b; }
:root[data-theme="dark"] .btn-danger:hover { background: #3a2522; }
:root[data-theme="dark"] .inp:focus { box-shadow: 0 0 0 2px #3b3735; }
:root[data-theme="dark"] .tbl td { border-bottom-color: #2e2a28; }
:root[data-theme="dark"] .visite-halo { box-shadow: 0 0 0 3px #ebe7e4, 0 0 0 9999px rgba(0,0,0,.55); }
/* Dessins (SVG), éditeur de plan et aperçu du PDF : fond papier clair et couleurs claires, quel que soit le thème */
:root[data-theme="dark"] :is(.svg, .apercu-page, .feuille, .plan-lecture-carte > .carte-corps, .papier) {
  color-scheme: light;
  --noir: #1f1c1b; --clair: #ecebea; --fond: #f4f3f2; --ligne: #d9d6d4; --gris: #b0adb0; --taupe: #7e7672; --taupe-f: #696361;
  --surface: #fff; --surface-2: #f7f6f5; --lien: #696361; --ok: #5d8657; --attente: #b9822f; --alerte: #a8473b; --info: #5b6f80;
  color: #1f1c1b;
}
:root[data-theme="dark"] :is(.svg, .plan-lecture-carte > .carte-corps) { background: #fbfaf8; border-radius: 3px; }
:root[data-theme="dark"] .apercu-cadre { background: #3b3735; }

/* v1.7 · lot C · menuiseries : pièce, repère automatique, options en liste à sélection multiple ; e-mail des demandes */
.men-humide { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 1px 5px; border-radius: 8px; cursor: help; background: var(--fond); border: 1px solid var(--ligne); color: var(--taupe-f); vertical-align: middle; }
.men-rep { display: inline-flex; align-items: center; gap: 4px; }
.men-rep-auto .inp { color: var(--taupe-f); font-style: italic; }
.men-rep-tag { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--taupe); }
.men-piece { max-width: 170px; }
.men-multi { position: relative; display: inline-block; }
.men-multi > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 3px 26px 3px 8px; border: 1px solid var(--ligne); border-radius: 4px; background: #fff; font-size: 12.5px; max-width: 360px; position: relative; }
.men-multi > summary::-webkit-details-marker { display: none; }
.men-multi > summary::after { content: "▾"; position: absolute; right: 8px; color: var(--taupe); }
.men-multi-texte { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.men-multi[open] > summary { border-color: var(--taupe); }
.men-multi-liste { position: absolute; z-index: 30; top: calc(100% + 2px); left: 0; min-width: 240px; background: #fff; border: 1px solid var(--ligne); border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: 6px 4px; display: flex; flex-direction: column; }
.men-multi-liste label { padding: 4px 8px; border-radius: 3px; cursor: pointer; }
.men-multi-liste label:hover { background: var(--fond); }
.mail-devis { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.mail-devis .note b { color: var(--noir); }
.tbl-men td { padding-left: 6px; padding-right: 6px; }
.tbl-men select.inp { max-width: 132px; } .tbl-men .men-piece { max-width: 124px; }
.tbl-men .men-rep-auto .inp { width: 104px; }

/* v1.7 · lot E · plâtrerie : blocs de saisie, options de plaque par face, accents vert pastel (variables du lot A, repli local) */
.pl-editeur { --pl: var(--mod-platre, #dcebd5); --pl-f: var(--mod-platre-f, #5d8657); }
.pl-editeur .pl-bloc > .carte-titre { box-shadow: inset 4px 0 0 var(--pl-f); background: linear-gradient(90deg, var(--pl), #fff 60%); }
.pl-editeur .pl-entete [data-cible].btn-p { background: var(--pl-f); border-color: var(--pl-f); }
.pl-total { font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--taupe-f); white-space: nowrap; }
.pl-total b { font-weight: 600; color: var(--noir); }
.pl-tot-opt { display: inline-block; border-radius: 3px; background: var(--pl, #dcebd5); padding: 0 5px; color: var(--noir); }
.pl-tbl td { padding-top: 4px; padding-bottom: 4px; }
.pl-opts { display: inline-flex; gap: 3px; }
.pl-opt { position: relative; display: inline-flex; cursor: pointer; }
.pl-opt input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pl-opt span { min-width: 26px; border: 1px solid var(--ligne); border-radius: 3px; padding: 2px 5px; text-align: center; font-size: 11px; font-weight: 500; color: var(--taupe); background: #fff; }
.pl-opt input:checked + span { border-color: var(--pl-f, #5d8657); background: var(--pl, #dcebd5); color: var(--noir); }
.pl-opt input:focus-visible + span { outline: 2px solid var(--pl-f, #5d8657); outline-offset: 1px; }
.pl-ico { border: 0; background: none; padding: 2px 5px; color: var(--taupe); font-size: 14px; cursor: pointer; }
.pl-ico:hover { color: var(--noir); }
.pl-tag { margin-left: 4px; padding: 1px 7px; font-size: 10.5px; }
.pl-plan td:first-child { box-shadow: inset 3px 0 0 var(--pl-f, #5d8657); }
.pl-entree td { background: var(--fond); }
.pl-dialog { width: min(860px, 94vw); border: 0; padding: 0; background: transparent; }
.pl-dialog::backdrop { background: rgba(31, 28, 27, .35); }

/* v1.7 · lot F · dessins de maçonnerie : schéma du soubassement à la hauteur de la section voisine (R29), plein écran (R39) */
.schema-soub-carte { display: flex; flex-direction: column; }
.schema-soub-carte > .svg { position: relative; flex: 1; min-height: 240px; }
.schema-soub-carte > .svg > svg { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
.zoomable { cursor: zoom-in; }
.lightbox-dessin { position: fixed; inset: 0; z-index: 1000; background: rgba(31, 28, 27, .82); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox-dessin .lightbox-corps { background: #fff; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; border-radius: 4px; padding: 8px; cursor: default; }
.lightbox-dessin .lightbox-corps > svg { width: 100%; height: 100%; }
.lightbox-dessin .lightbox-fermer { position: absolute; top: 8px; right: 14px; background: none; border: 0; color: #fff; font-size: 32px; line-height: 1; cursor: pointer; }

/* v1.7 · lot D · maçonnerie : champs liés à l'éditeur de plan (⤴), infobulles du quantitatif */
.champ-lien { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.btn-reprendre { background: none; border: 1px solid #e3c48f; color: var(--attente); border-radius: 3px; cursor: pointer; font-size: 12px; line-height: 1; padding: 3px 5px; }
.btn-reprendre:hover { background: #fbf3e5; }
.q-detail[data-detail] { position: relative; border-bottom: 1px dotted var(--taupe, #8a817c); cursor: help; }
.q-detail[data-detail]:hover::after, .q-detail[data-detail]:focus::after {
  content: attr(data-detail); position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: max-content; max-width: 460px;
  white-space: normal; text-align: left; background: #2b2725; color: #fff; font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); font-weight: 400; }
