/* Interface en trois colonnes de l'espace collaborateur : barre du haut, navigation (gauche), espace de travail (centre), contexte (droite).
   Colonnes latérales redimensionnables et repliables ; thème clair et sombre ; densité d'information élevée. */
body.trois { display: flex; flex-direction: column; height: 100vh; overflow: hidden; font-size: 14px; }
.tb { display: flex; align-items: center; gap: 14px; height: 46px; padding: 0 12px; border-bottom: 1px solid var(--trait); background: var(--papier); flex: none; }
.tb-marque { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--encre); font-weight: 650; min-width: 0; width: calc(var(--g, 260px) - 24px); }
.tb-marque span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.tb-marque .marque-logo { max-height: 26px; }
.tb-recherche { flex: 1; max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; height: 30px; padding: 0 10px; border: 1px solid var(--trait-fort);
  border-radius: 8px; background: var(--fond); color: var(--gris); font: inherit; font-size: .85rem; cursor: text; }
kbd { font: 11px/1 var(--sans); border: 1px solid var(--trait-fort); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; color: var(--gris); background: var(--fond); }
.tb-droite { display: flex; align-items: center; gap: 6px; }
.tb details { position: relative; } .tb summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px; border-radius: 7px; color: var(--encre); }
.tb summary::-webkit-details-marker { display: none; } .tb summary:hover { background: var(--trait); }
.tb .pastille { position: static; display: inline-block; height: auto; min-width: 0; line-height: 1.5; }
.tb .pan { position: absolute; right: 0; top: 36px; width: 340px; max-height: 70vh; overflow: auto; background: var(--fond); border: 1px solid var(--trait-fort); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 8px; z-index: 40; }
.tb .pan a, .tb .pan button.lien { display: block; width: 100%; text-align: left; padding: 7px 8px; border-radius: 6px; text-decoration: none; color: var(--texte); font: inherit; background: none; border: 0; cursor: pointer; }
.tb .pan a:hover, .tb .pan button.lien:hover { background: var(--papier); } .tb .pan small { display: block; color: var(--gris); }
.tb .pan h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gris); margin: 8px 8px 4px; }
.initiales { width: 26px; height: 26px; border-radius: 50%; background: var(--encre); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }

.shell { flex: 1; display: grid; grid-template-columns: var(--g, 260px) 5px minmax(0, 1fr) 5px var(--d, 330px); min-height: 0; }
.shell.sans-g { grid-template-columns: 0 5px minmax(0, 1fr) 5px var(--d, 330px); } .shell.sans-d { grid-template-columns: var(--g, 260px) 5px minmax(0, 1fr) 5px 0; }
.shell.sans-g.sans-d { grid-template-columns: 0 5px minmax(0, 1fr) 5px 0; }
.shell.sans-g .col-g, .shell.sans-d .col-d { visibility: hidden; }
.poignee { cursor: col-resize; background: transparent; position: relative; } .poignee:hover, .poignee.actif { background: var(--trait-fort); }
.poignee button { position: absolute; top: 8px; left: -7px; width: 19px; height: 19px; border-radius: 50%; border: 1px solid var(--trait-fort); background: var(--fond); color: var(--gris);
  font-size: 11px; line-height: 1; padding: 0; cursor: pointer; z-index: 5; opacity: 0; } .poignee:hover button, .shell.sans-g .poignee-g button, .shell.sans-d .poignee-d button { opacity: 1; }

.col-g { background: var(--papier); border-right: 1px solid var(--trait); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.sections { padding: 8px 6px 4px; display: grid; gap: 1px; flex: none; }
.sections a { display: flex; align-items: center; gap: 8px; padding: 4px 9px; border-radius: 7px; text-decoration: none; color: var(--texte); font-size: .88rem; }
.sections a:hover { background: var(--trait); } .sections a.actif { background: var(--fond); color: var(--encre); font-weight: 650; box-shadow: inset 2px 0 0 var(--cire); }
.sections .ico { width: 16px; text-align: center; color: var(--gris); font-size: .9rem; } .sections .pastille { margin-left: auto; }
.sous-page { border-top: 1px solid var(--trait); padding: 4px 6px; flex: none; max-height: 30vh; overflow: auto; } .sous-page:not(.plein) { display: none; }
.sous-page > summary { cursor: pointer; list-style: none; } .sous-page > summary::before { content: '▸ '; } .sous-page[open] > summary::before { content: '▾ '; }
.sous-page .titre-zone, .liste-ctx .titre-zone { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gris); padding: 4px 8px; display: flex; justify-content: space-between; align-items: center; }
.sous-page .item { padding: 5px 9px; border-radius: 7px; } .sous-page .item-t { font-size: .85rem; }
.liste-ctx { border-top: 1px solid var(--trait); flex: 1; min-height: 0; display: flex; flex-direction: column; }
.liste-ctx form { padding: 6px 8px; display: grid; gap: 5px; } .liste-ctx input[type=search] { height: 28px; font-size: .85rem; padding: 3px 8px; }
.filtres { display: flex; flex-wrap: wrap; gap: 4px; } .filtres label { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; padding: 1px 7px; border: 1px solid var(--trait-fort);
  border-radius: 99px; cursor: pointer; color: var(--gris); margin: 0; } .filtres input { display: none; } .filtres label:has(input:checked) { background: var(--encre); color: #fff; border-color: var(--encre); }
.filtres select { font-size: .74rem; height: 22px; padding: 0 4px; border-radius: 99px; }
.dossiers-l { overflow-y: auto; flex: 1; padding: 0 6px 10px; } .dossiers-l a.ligne { display: grid; grid-template-columns: 8px 1fr auto; gap: 2px 7px; padding: 6px 8px; border-radius: 7px; text-decoration: none; color: var(--texte); }
.dossiers-l a.ligne:hover { background: var(--trait); } .dossiers-l a.ligne.courant { background: var(--fond); box-shadow: inset 2px 0 0 var(--cire); }
.dossiers-l .pt { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; } .dossiers-l .pt.nouveau { background: var(--cire); }
.dossiers-l .ref { font-weight: 650; font-size: .82rem; } .dossiers-l .etoile { color: #d9a400; font-size: .8rem; } .dossiers-l small { grid-column: 2 / -1; color: var(--gris); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bouton-nouveau { margin: 4px 8px 8px; display: block; text-align: center; }

.col-c { overflow-y: auto; min-width: 0; padding: 0 28px 60px; } .col-c > .flash:first-child { margin-top: 14px; }
.col-c h1 { margin-top: 16px; }
.entete-d { position: sticky; top: 0; z-index: 8; background: var(--fond); margin: 0 -28px 14px; padding: 12px 28px 0; border-bottom: 1px solid var(--trait); }
.entete-d .l1 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; } .entete-d .ref { font-size: 1.15rem; font-weight: 700; color: var(--encre); text-decoration: none; }
.entete-d .int { font-size: .95rem; color: var(--texte); } .entete-d .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--gris); margin: 4px 0 6px; }
.entete-d .meta b { color: var(--texte); font-weight: 600; }
.modules { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; } .module { font-size: .74rem; padding: 1px 8px; border-radius: 99px; background: var(--cire-pale); color: var(--encre); text-decoration: none; }
.module em { font-style: normal; color: var(--gris); } .module-plus { border: 1px dashed var(--trait-fort); background: none; color: var(--gris); }
.onglets-d { display: flex; gap: 2px; overflow-x: auto; } .onglets-d a { padding: 6px 8px; font-size: .84rem; text-decoration: none; color: var(--gris); border-bottom: 2px solid transparent; white-space: nowrap; }
.onglets-d a:hover { color: var(--texte); } .onglets-d a.actif { color: var(--encre); border-bottom-color: var(--cire); font-weight: 600; }
.bandeau-sig { background: var(--avert-pale); border: 1px solid #ecd9a6; border-radius: 8px; padding: 6px 10px; font-size: .82rem; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.etiquette-clos { font-size: .72rem; padding: 1px 8px; border-radius: 99px; background: var(--trait); color: var(--gris); }

.col-d { border-left: 1px solid var(--trait); background: var(--papier); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.onglets-ctx { display: flex; border-bottom: 1px solid var(--trait); flex: none; } .onglets-ctx button { flex: 1; padding: 9px 4px; font: inherit; font-size: .82rem; border: 0; background: none;
  color: var(--gris); cursor: pointer; border-bottom: 2px solid transparent; } .onglets-ctx button.actif { color: var(--encre); border-bottom-color: var(--cire); font-weight: 600; }
.ctx-corps { flex: 1; overflow-y: auto; padding: 10px 12px; font-size: .85rem; } .ctx-corps .vide { color: var(--gris); }
.ctx-item { padding: 8px 0; border-bottom: 1px solid var(--trait); } .ctx-item small { color: var(--gris); display: block; } .ctx-item .actions-prop { margin-top: 4px; }
.ctx-corps textarea { width: 100%; min-height: 55vh; font: 13px/1.5 var(--sans); }
.apercu { display: flex; flex-direction: column; flex: 1; min-height: 0; } .apercu-barre { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--trait); font-size: .8rem; gap: 8px; }
.apercu-barre span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .apercu iframe { flex: 1; border: 0; width: 100%; background: #fff; }

/* Tableau de bord et vues agrégées */
.chiffres-tb { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; margin: 14px 0 16px; }
.chiffres-tb a { display: block; border: 1px solid var(--trait); border-radius: 10px; padding: 10px 14px; text-decoration: none; color: var(--texte); background: var(--fond); }
.chiffres-tb b { display: block; font-size: 1.5rem; color: var(--encre); } .chiffres-tb span { font-size: .8rem; color: var(--gris); }
.grille-tb { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; } .grille-tb .carte { margin: 0; padding: 12px 14px; }
.liste-dense > * { display: block; padding: 6px 0; border-bottom: 1px solid var(--trait); text-decoration: none; color: var(--texte); font-size: .87rem; } .liste-dense small { color: var(--gris); }

/* Palette de recherche (Cmd+K) et aide */
.voile { position: fixed; inset: 0; background: rgba(10, 20, 35, .35); z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.voile[hidden] { display: none; } .palette { width: min(640px, 92vw); background: var(--fond); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; border: 1px solid var(--trait-fort); }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--trait); border-radius: 0; height: 46px; font-size: 1rem; padding: 0 16px; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; } .palette li a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 7px; text-decoration: none; color: var(--texte); }
.palette li a small { color: var(--gris); } .palette li.sel a { background: var(--cire-pale); }
.aide { width: min(520px, 92vw); background: var(--fond); border-radius: 12px; padding: 18px 22px; } .aide td { padding: 4px 10px 4px 0; font-size: .9rem; }

/* Thème sombre (au-dessus des couleurs de la marque) */
html[data-theme="sombre"] { color-scheme: dark; --fond: #151b23; --papier: #10151c; --trait: #26303b; --trait-fort: #34404d; --texte: #dde3ea; --gris: #95a1ad; --encre: #9cc3ef;
  --encre-2: #8ab8ea; --cire-pale: #173326; --alerte-pale: #3a1d1b; --avert-pale: #3a3118; }
html[data-theme="sombre"] input, html[data-theme="sombre"] select, html[data-theme="sombre"] textarea { background: #0e1319; color: var(--texte); border-color: var(--trait-fort); }
html[data-theme="sombre"] .btn-ghost, html[data-theme="sombre"] .btn.alt, html[data-theme="sombre"] button.alt { background: transparent; color: var(--texte); border-color: var(--trait-fort); }
html[data-theme="sombre"] .flash { color: #10151c; } html[data-theme="sombre"] img.graphique { background: #fff; border-radius: 6px; }
html[data-theme="sombre"] .ed-page { background-color: #fff; color: #15233a; --texte: #15233a; --fond: #fff; }   /* le document reste une feuille de papier */
html[data-theme="sombre"] .initiales { background: var(--cire); }
.sections .pastille, .col-g .pastille, .entete-d .pastille { position: static; display: inline-block; height: auto; min-width: 0; line-height: 1.5; padding: 0 6px; font-size: .7rem; }
html[data-theme="sombre"] .btn:not(.btn-ghost):not(.alt):not(.btn-danger) { color: #0b1420; }

.bandeau-sig { justify-content: space-between; flex-wrap: wrap; } .actions-sig { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .actions-sig form { display: flex; gap: 4px; align-items: center; }
.actions-sig details[open] form { margin-top: 4px; } .actions-sig summary, .bandeau-clos summary { list-style: none; cursor: pointer; }
.bandeau-clos { background: var(--papier); border: 1px solid var(--trait-fort); border-radius: 8px; padding: 6px 10px; font-size: .82rem; margin-bottom: 8px; color: var(--gris); }
.bandeau-clos details { display: inline-block; margin-left: 8px; } .bandeau-clos details[open] { display: block; margin: 6px 0 0; }
.entete-d.clos .ref, .entete-d.clos .module { color: var(--gris); } .entete-d.clos .module { background: var(--trait); }
.entete-d.clos ~ * .btn:not(.btn-ghost) { filter: grayscale(1); }

/* Panneau : page affichée dans la colonne de droite (génération, bibliothèque) */
body.app.panneau { display: block; height: auto; overflow: auto; font-size: 13.5px; } .panneau .side, .panneau .barre-haut, .panneau .pied-marque, .panneau .macaron-expert { display: none; }
.panneau .centre { padding: 10px 12px 30px; overflow: visible; } .panneau h1 { font-size: 1.1rem; margin: 0 0 8px; } .panneau .carte { padding: 12px; }
.panneau .grille-form { grid-template-columns: 1fr; }
.apercu.generation iframe { background: var(--papier); }
.btn-rediger { position: absolute; right: 28px; top: 12px; }
.col-d [hidden], .voile[hidden] { display: none !important; }   /* l'attribut hidden l'emporte sur les règles de mise en page */
.file-valider { border-left: 3px solid var(--cire); } .file-valider .proposition { padding: 8px 0; border-bottom: 1px solid var(--trait); }
/* Synthèse du dossier (responsable) */
.synthese { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin: 4px 0 16px; }
.syn-bloc { background: var(--fond); border: 1px solid var(--trait); border-radius: 10px; padding: 10px 14px; font-size: .86rem; min-width: 0; }
.syn-bloc h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gris); margin: 0 0 8px; } .syn-bloc h3 { font-size: .74rem; color: var(--gris); margin: 10px 0 4px; text-transform: uppercase; }
.syn-ligne { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--trait); text-decoration: none; color: var(--texte); align-items: baseline; } .syn-ligne:last-of-type { border-bottom: 0; }
.syn-date { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; min-width: 78px; }
.syn-ligne.depasse { color: var(--alerte); } .syn-ligne.proche .syn-date { color: #b26a00; } .syn-ligne.tache.urgent { color: var(--alerte); font-weight: 600; }
.syn-ico { width: 14px; text-align: center; color: var(--gris); } .tache.suggestion .syn-ico { color: var(--cire); } a.syn-ligne:hover { background: var(--papier); }
.syn-alerte { margin: 6px 0 0; padding: 5px 8px; border-radius: 6px; font-size: .8rem; } .syn-alerte.erreur { background: var(--alerte-pale); } .syn-alerte.attention { background: var(--avert-pale); }
.syn-point { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; margin-bottom: 6px; border-radius: 6px; background: var(--papier); } .syn-point.important { background: var(--alerte-pale); font-weight: 600; }
.syn-point small { font-weight: 400; color: var(--gris); } .lien-discret { background: none; border: 0; color: var(--encre-2); cursor: pointer; font-size: .78rem; text-decoration: underline; padding: 0; }
.syn-part { display: grid; grid-template-columns: 112px 1fr; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--trait); } .syn-part:last-of-type { border-bottom: 0; } .syn-part strong { font-weight: 600; }
.syn-ajout textarea { width: 100%; } .syn-contact { padding: 5px 0; border-bottom: 1px solid var(--trait); } .syn-contact:last-child { border-bottom: 0; } .syn-contact a { color: var(--encre-2); }

.syn-conditions { padding: 6px 0 8px; border-bottom: 1px solid var(--trait); margin-bottom: 4px; } .syn-conditions > a { text-decoration: none; color: var(--texte); display: block; margin-bottom: 4px; }
.syn-cond { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; } .pastille-etat { font-size: .7rem; padding: 0 7px; border-radius: 99px; background: var(--trait); white-space: nowrap; }
.syn-cond.realisee .pastille-etat, .syn-cond.renoncee .pastille-etat { background: var(--cire-pale); color: var(--cire); } .syn-cond.defaillie .pastille-etat, .syn-cond.echue .pastille-etat { background: var(--alerte-pale); color: var(--alerte); }
.syn-cond.en_cours:not(.echue) .pastille-etat { background: var(--avert-pale); color: #8a5a00; }
.cond { border: 1px solid var(--trait); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; } .cond.realisee, .cond.renoncee { border-left: 3px solid var(--cire); }
.cond.defaillie, .cond.echue { border-left: 3px solid var(--alerte); } .cond.en_cours { border-left: 3px solid #d9a400; } .cond-tete { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
blockquote.extrait { margin: 0 0 6px; padding: 6px 10px; border-left: 3px solid var(--trait-fort); background: var(--papier); font-size: .84rem; color: var(--texte); max-height: 9em; overflow: auto; }
.e-envoi { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--trait); }
.suggestions { list-style: none; margin: -6px 0 8px; padding: 0; border: 1px solid var(--trait); border-radius: 8px; background: var(--fond); } .suggestions:empty { display: none; }
.suggestions li { padding: 6px 10px; cursor: pointer; font-size: .88rem; } .suggestions li:hover { background: var(--cire-pale); }
tr.a-verifier-ligne td { background: var(--avert-pale); } .a-verifier-bloc { border-left: 3px solid #d9a400; padding-left: 10px; } .extrait-court { color: var(--gris); font-style: italic; }
details.lot { border-bottom: 1px solid var(--trait); padding: 6px 0; } details.lot > summary { cursor: pointer; } details.lot h4 { font-size: .8rem; margin: 8px 0 4px; color: var(--gris); text-transform: uppercase; }
.import-lots { padding: 10px 12px; margin-bottom: 10px; } .lots-dossier .filtres label:has(input:checked) { background: var(--encre); color: #fff; } .lots-dossier .filtres input { display: inline; }
.zone-image { max-width: 100%; max-height: 260px; border: 1px solid var(--trait); border-radius: 6px; background: #fff; display: block; margin: 6px 0; }
.qualite-faible { color: var(--alerte); font-weight: 600; } .lien-cherchable { font-size: .78rem; }
.projet-attente { border-left: 3px solid var(--cire); background: var(--cire-pale); }
