/* Interface Métreur. Couleurs exclusivement issues du socle Berdin embarqué. */
@font-face { font-family:"Bricolage Grotesque"; src:url('/static/bricolage-grotesque-latin-wght-normal.woff2') format('woff2'); font-style:normal; font-weight:200 800; font-display:swap; }
:root { --action:var(--sapin); --gris:var(--discret); --fond:var(--papier); --doux:var(--sable); --attention:color-mix(in srgb,var(--jaune) 22%,var(--papier)); --selection:color-mix(in srgb,var(--sapin) 8%,var(--papier)); color-scheme:light; }
* { box-sizing:border-box; }
html { scroll-padding-top:28px; }
body { margin:0; color:var(--encre); background:var(--sable); font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
a { color:var(--action); text-underline-offset:3px; }
a:hover { text-decoration-thickness:2px; }
button,input,select,textarea { font:inherit; }
button,a,input,select,textarea,summary { -webkit-tap-highlight-color:transparent; }
:focus-visible { outline:3px solid var(--action); outline-offset:3px; }
[hidden] { display:none !important; }
.barre { width:208px; position:fixed; inset:0 auto 0 0; display:flex; flex-direction:column; gap:26px; padding:28px 18px 18px; background:var(--papier); border-right:1px solid var(--trait); z-index:20; overflow:auto; }
.marque { display:flex; flex-direction:column; gap:22px; text-decoration:none; color:var(--encre); padding:0 12px; font:700 24px/1.1 var(--f-titre); }
.marque img { object-fit:contain; object-position:left; }
.marque small { display:block; font:12px/1.5 system-ui,sans-serif; color:var(--discret); margin-top:6px; }
.barre nav { display:grid; gap:5px; }
.barre nav a { text-decoration:none; color:var(--encre-2); padding:10px 12px; border-radius:7px; font-weight:550; }
.barre nav a:hover { background:var(--sable); }
.barre nav a[aria-current] { background:var(--selection); color:var(--action); font-weight:700; box-shadow:inset 3px 0 var(--action); }
.pied { margin-top:auto; display:grid; gap:6px; font-size:12px; color:var(--discret); padding:12px; }
.pied a { color:inherit; }
.aide-clavier { color:var(--discret); font-size:12px; padding:0 12px; }
.aide-clavier summary { cursor:pointer; }
kbd { font:11px ui-monospace,monospace; border:1px solid var(--trait); border-radius:3px; padding:1px 3px; }
main { margin-left:208px; padding:32px clamp(20px,3vw,52px) 64px; max-width:1900px; min-height:100vh; }
h1,h2,h3,.bouton,.etiquette,.total-general,.total-lot { font-family:var(--f-titre); }
h1 { font-size:30px; font-weight:750; line-height:1.2; margin:0 0 10px; letter-spacing:-.6px; overflow-wrap:anywhere; }
h1 .discret { font-size:18px; display:block; margin-top:8px; letter-spacing:0; }
h2 { font-size:20px; line-height:1.3; margin:28px 0 14px; font-weight:650; }
h3 { font-size:16px; margin:24px 0 10px; }
p { margin:10px 0 16px; }
.discret { color:var(--discret); font-weight:400; }
.fil { font-size:13px; margin:0 0 16px; }
.entete { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; flex-wrap:wrap; margin-bottom:22px; }
.entete p { margin-bottom:0; }
.surtitre { font:600 11px var(--f-titre); text-transform:uppercase; letter-spacing:1.6px; color:var(--discret); margin-bottom:12px; }
.bouton { display:inline-flex; justify-content:center; align-items:center; gap:6px; padding:8px 13px; min-height:38px; border:1px solid var(--trait); border-radius:6px; background:var(--papier); color:var(--encre); text-decoration:none; font-size:14px; font-weight:600; cursor:pointer; line-height:1.35; }
.bouton:hover { background:var(--sable); border-color:var(--discret); }
.bouton.principal { color:var(--papier); background:var(--action); border-color:var(--action); }
.bouton.principal:hover { background:var(--encre); }
button:disabled { opacity:.55; cursor:wait; }
.lien { border:0; background:transparent; color:var(--action); cursor:pointer; font:inherit; min-width:32px; min-height:32px; padding:5px; text-decoration:underline; text-underline-offset:3px; }
.actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.actions form { margin:0; }
.barre-actions { margin:16px 0; }
.carte { border:1px solid var(--trait); border-radius:10px; padding:22px; background:var(--papier); margin:20px 0; min-width:0; }
.carte>h2:first-child { margin-top:0; }
.carte>p.discret { max-width:96ch; }
.sommaire { display:flex; gap:6px; flex-wrap:wrap; padding:10px 0; border-block:1px solid var(--trait); margin:20px 0 24px; }
.sommaire a { padding:7px 10px; font-weight:550; font-size:13px; text-decoration:none; border-radius:5px; }
.sommaire a:hover,.sommaire a[aria-current] { background:var(--selection); }
.sommaire .compte { display:inline-block; margin-left:4px; font-variant-numeric:tabular-nums; }
.synthese { display:flex; gap:16px 32px; flex-wrap:wrap; padding:16px 20px; background:var(--papier); border:1px solid var(--trait); border-radius:8px; }
.synthese>div { display:grid; gap:3px; color:var(--discret); font-size:12px; }
.synthese strong { color:var(--encre); font:650 21px var(--f-titre); }
.table-defilante { max-width:100%; overflow-x:auto; margin:12px 0; border:1px solid var(--trait); border-radius:7px; background:var(--papier); }
.table-defilante:focus-visible { outline-offset:1px; }
table { width:100%; border-collapse:collapse; background:var(--papier); font-size:13px; }
caption { text-align:left; color:var(--discret); padding:8px 12px; }
th,td { padding:11px 12px; text-align:left; border-bottom:1px solid var(--trait); vertical-align:top; }
th { font-size:12px; font-weight:600; color:var(--encre-2); background:var(--sable); white-space:nowrap; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover td { background:var(--selection); }
td.n,th.n { text-align:right; white-space:nowrap; }
td,.total-lot,.total-general,input { font-variant-numeric:tabular-nums; }
td.actions { min-width:170px; }
tfoot td { font-weight:700; border-top:2px solid var(--trait); background:var(--sable); }
.liste td:first-child>a { font-weight:650; }
.liste td:first-child .discret { display:block; }
code { font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; overflow-wrap:anywhere; }
.lignes td.justification { color:var(--discret); font-size:12px; min-width:170px; max-width:320px; }
.lignes td:nth-child(2) { min-width:200px; }
.lignes td:nth-child(6) { font-weight:700; }
tr.a-chiffrer td,tr.peu-sure td { background:var(--attention); }
tr.provision td { background:var(--sable); font-style:italic; }
.etiquette { display:inline-block; padding:3px 8px; border-radius:5px; background:var(--sable); color:var(--encre-2); font-size:12px; white-space:normal; }
.etiquette.gele { color:var(--action); background:var(--selection); }
.etiquette.jaune { background:var(--attention); color:var(--encre); }
form label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:550; color:var(--encre-2); margin-bottom:14px; }
label.case { flex-direction:row; align-items:flex-start; font-weight:400; }
input:not([type=checkbox]):not([type=hidden]),select,textarea { padding:9px 10px; border:1px solid var(--trait); border-radius:5px; background:var(--papier); color:var(--encre); min-width:0; max-width:100%; }
input:hover,textarea:hover,select:hover { border-color:var(--discret); }
input:focus,select:focus,textarea:focus { outline:2px solid var(--action); outline-offset:1px; }
input[type=checkbox] { accent-color:var(--action); }
input[type=file] { font-size:12px; }
input::file-selector-button { border:0; background:var(--sable); padding:6px 10px; border-radius:3px; color:var(--encre); cursor:pointer; margin-right:10px; }
textarea { resize:vertical; line-height:1.55; }
::placeholder { color:var(--discret); opacity:1; }
.formulaire { max-width:680px; }
.ligne-saisie { display:grid; grid-template-columns:2fr 1.7fr 1.7fr auto; gap:12px; align-items:end; }
.ligne-saisie label { margin-bottom:0; }
.ligne-saisie button { align-self:end; }
.en-ligne input { width:150px; text-align:right; }
.en-ligne { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.en-ligne .sauver-ligne { display:none; }
.en-ligne:focus-within .sauver-ligne,.en-ligne[data-modifie] .sauver-ligne { display:inline-flex; }
.etat-saisie { width:100%; font-size:11px; color:var(--discret); margin:5px 0 0; }
form[data-modifie] input:focus,form[data-modifie] textarea:focus { background:var(--attention); }
form[data-modifie]>.etat-saisie { color:var(--encre); }
.lot { margin:30px 0; }
.lot h2 { display:flex; gap:12px; align-items:baseline; border-bottom:2px solid var(--action); padding-bottom:12px; }
.lot .numero { font:13px ui-monospace,monospace; color:var(--discret); }
.total-lot { margin-left:auto; white-space:nowrap; font-size:18px; }
.total-general { padding:14px 20px; background:var(--action); color:var(--papier); border-radius:8px; font-size:13px; }
.total-general strong { display:block; font-size:28px; }
.ok,.alerte,.erreur-formulaire,.confirmation { padding:14px 16px; border-radius:6px; background:var(--attention); color:var(--encre); }
.ok { background:var(--selection); border-left:3px solid var(--action); }
.erreur-formulaire { border:2px solid var(--encre); margin:12px 0; width:100%; }
.confirmation { border:1px solid var(--encre); margin:12px 0; width:100%; text-align:left; }
.confirmation p { margin:0 0 12px; }
.confirmer summary { cursor:pointer; }
.confirmer[open] { display:block; width:100%; padding:14px; background:var(--attention); border:1px solid var(--trait); border-radius:6px; }
.confirmer[open] form { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-top:12px; }
.vide { padding:30px 20px; border:1px dashed var(--trait); border-radius:8px; color:var(--discret); background:var(--papier); }
.recherche { display:flex; gap:10px; align-items:center; margin:18px 0; }
.recherche label { flex:1; max-width:560px; margin:0; }
.recherche input { width:100%; }
ul.simple { padding-left:20px; }
.controles ul { list-style:none; padding:0; display:grid; gap:8px; margin:0; }
.controles li { padding:12px; border-radius:5px; background:var(--attention); }
.controles li.alerte { border-left:4px solid var(--encre); }
.ligne-question { display:grid; grid-template-columns:.5fr 2fr 1.5fr auto; gap:12px; align-items:end; }
.ligne-question button { margin-bottom:14px; }
section[id],h2[id],h3[id] { scroll-margin-top:24px; }
.notice-tableau { min-width:850px; table-layout:fixed; }
.notice-tableau td,.menuiseries-tableau td { padding:6px; }
.notice-tableau input,.notice-tableau select,.notice-tableau textarea,.menuiseries-tableau input { width:100%; }
.notice-intro { width:100%; min-height:70px; }
.notice-tableau textarea { min-height:64px; field-sizing:content; }
.notice-tableau tr.chapitre td { background:var(--selection); }
.notice-tableau tr.chapitre textarea { font-weight:650; text-transform:uppercase; }
.notice-tableau tr.non_compris textarea { font-style:italic; }
.notice-tableau .outils { display:grid; grid-template-columns:1fr 1fr; }
.notice-tableau textarea.observation { font-size:12px; }
.menuiseries-tableau { min-width:1160px; table-layout:fixed; }
.menuiseries-tableau th:nth-child(1) { width:9%; }
.menuiseries-tableau th:nth-child(2) { width:13%; }
.menuiseries-tableau th:nth-child(5),.menuiseries-tableau th:nth-child(6),.menuiseries-tableau th:nth-child(7) { width:7%; }
.petit { font-size:12px; }
.notes { max-width:850px; padding:28px; border:1px solid var(--trait); background:var(--papier); border-radius:10px; }
.notes h2 { border-top:1px solid var(--trait); padding-top:24px; }
.journal td { max-width:320px; overflow-wrap:anywhere; }
.journal details { max-width:320px; }
.journal pre { white-space:pre-wrap; font:12px/1.5 ui-monospace,monospace; }
#retour-global:not(:empty) { position:fixed; bottom:20px; left:calc(208px + 24px); right:24px; z-index:40; border:1px solid var(--action); background:var(--papier); padding:14px 20px; border-radius:8px; box-shadow:0 4px 20px color-mix(in srgb,var(--encre) 12%,transparent); display:flex; align-items:center; justify-content:space-between; gap:12px; }
#retour-global p { margin:0; }
.evitement { position:fixed; left:220px; top:-100px; z-index:60; padding:10px; background:var(--papier); }
.evitement:focus { top:10px; }
.htmx-request { cursor:progress; }
button.htmx-request { opacity:.6; pointer-events:none; }
.progression { display:flex; align-items:center; gap:12px; }
progress { accent-color:var(--action); width:100px; height:8px; }
@media(min-width:1600px) { main { margin-right:auto; } }
@media(max-width:1100px) { .ligne-saisie { grid-template-columns:1fr 1fr; } .ligne-question { grid-template-columns:1fr 1fr; } }
@media(max-width:800px) {
 .barre { position:relative; width:100%; padding:16px; gap:14px; border-right:0; border-bottom:1px solid var(--trait); overflow:visible; }
 .marque { flex-direction:row; align-items:center; font-size:21px; gap:20px; padding:0; }
 .marque img { width:82px; height:30px; }
 .marque small { margin-top:3px; font-size:11px; }
 .barre nav { display:flex; flex-wrap:wrap; gap:3px; }
 .barre nav a { padding:7px 9px; font-size:13px; }
 .pied { display:flex; justify-content:space-between; padding:0; margin:0; }
 .aide-clavier { padding:0; }
 main { margin:0; padding:22px 16px 64px; }
 h1 { font-size:26px; }
 .carte { padding:16px; }
 .entete { margin-bottom:16px; }
 .total-general { width:100%; }
 #retour-global:not(:empty) { left:12px; right:12px; bottom:12px; }
 .evitement { left:12px; }
 .lot h2 { flex-wrap:wrap; }
 .notes { padding:18px; }
}
@media(max-width:540px) { .ligne-saisie,.ligne-question { grid-template-columns:1fr; } .actions>form,.actions>label { max-width:100%; } .entete>.bouton { width:100%; } .recherche { flex-wrap:wrap; } .recherche label { flex-basis:100%; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; animation:none !important; transition:none !important; } }
@media print { .barre,.sommaire,.barre-actions,.evitement,#retour-global,.aide-clavier { display:none; } main { margin:0; padding:0; } body { background:var(--papier); } .table-defilante { overflow:visible; border:0; } .carte { break-inside:avoid; } }
.choisir-lot { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:24px 0; font-weight:550; }
.choisir-lot select { max-width:100%; }
.lot .table-defilante { max-height:68vh; }
.table-defilante thead th { position:sticky; top:0; z-index:1; }
.en-ligne input:focus { width:280px; }
@media print { .lot .table-defilante { max-height:none; } .table-defilante thead th { position:static; } }

/* Densité (relecture 28/10) : les codes Progemi et les noms de mesures ne se coupent jamais ; l'aide « Entrée pour
   enregistrer » n'apparaît que sur le champ en cours ; une erreur dans une cellule ne déforme pas le tableau. */
td code { white-space:nowrap; overflow-wrap:normal; }
.en-ligne .etat-saisie { display:none; }
.en-ligne:focus-within .etat-saisie,.en-ligne[data-modifie] .etat-saisie { display:block; }
td .erreur-formulaire { max-width:24rem; white-space:normal; }
.lot td,.lot th { padding-top:6px; padding-bottom:6px; }
#geometrie td,#geometrie th { padding-top:6px; padding-bottom:6px; }

/* Mode serveur : la personne connectée et la page de connexion. */
.personne { margin:8px 0 0; font-size:13px; }
.personne a { color:inherit; }
.page-connexion { display:grid; place-items:center; min-height:100vh; }
.connexion { max-width:380px; width:100%; margin:0 auto; padding:32px 24px; }
.connexion h1 { margin:12px 0 20px; }
