/* Dossiers énergie (14/09/2026) — charte Sobria, Tomes 2 et 3 : nuit #14213B,
   cuivre #C3793A en accent seulement, crème #F4F1E9, ardoise #373946.
   Rayons 8 / 12 / 4. Tableaux : en-tête nuit, zébrage, pas de bordure
   verticale. Tout est préfixé .de- pour ne rien toucher ailleurs. */
.de-carte { background: #fff; border-radius: 12px; padding: 18px 20px; margin: 10px 0;
  box-shadow: 0 2px 8px rgba(20,33,59,.08); color: #373946; }
.de-carte h2 { font-family: "PT Serif", Georgia, serif; color: #14213B; font-size: 19px; margin: 0 0 12px; }
.de-sur { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #C3793A; font-weight: 600; }
.de-note { font-size: 13px; color: #5b5d68; }
.de-absent { color: #8a4f1f; font-style: italic; }
.de-vide { text-align: center; color: #6b6d78; padding: 14px; }
.de-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600;
  background: rgba(20,33,59,.08); color: #14213B; }
.de-badge.alerte { background: rgba(179,38,30,.1); color: #B3261E; }
.de-badge.cuivre { background: rgba(195,121,58,.14); color: #8a4f1f; }
.de-badge.attenue { opacity: .6; }
.de-btn-p { background: #14213B; color: #F4F1E9; border: 1.5px solid #14213B; border-radius: 8px;
  min-height: 44px; padding: 0 20px; font-weight: 600; font-size: 15px; cursor: pointer; }
.de-btn-p:disabled { opacity: .4; cursor: default; }
.de-btn-t { background: none; border: 0; color: #C3793A; cursor: pointer; padding: 4px 0; font: inherit; }
.de-btn-t:hover { text-decoration: underline; }
.de-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; margin: 12px 0; }
.de-form label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; }
.de-form input, .de-form select, .de-carte select { min-height: 44px; border: 1px solid #D8D3C4; border-radius: 8px;
  padding: 0 12px; font-size: 16px; background: #fff; }
.de-carte select[multiple] { min-height: 140px; padding: 8px; width: 100%; margin-bottom: 12px; }
.de-case { flex-direction: row !important; align-items: center; }
.de-resultats { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }
.de-choix { border: 1px solid #D8D3C4; background: #F4F1E9; border-radius: 4px; padding: 6px 10px; cursor: pointer; }
.de-scroll { overflow-x: auto; border-radius: 8px; background: #fff; margin: 10px 0; }
.de-table { border-collapse: collapse; width: 100%; font-size: 14px; }
/* 22/09/2026 : plus de largeur minimale globale (elle coupait les petits tableaux et tout le mobile) ; seuls les larges défilent. */
.de-table.de-fige, .de-table.de-large { min-width: 760px; }
.de-table th { background: #14213B; color: #F4F1E9; font-weight: 600; text-align: left; padding: 10px 12px; white-space: nowrap; }
.de-table td { padding: 9px 12px; border-bottom: 1px solid #E8E4D8; vertical-align: top; }
.de-table tbody tr:nth-child(even) { background: #faf8f3; }
.de-table .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Liste de statut dans une ligne : sans largeur minimale, le tableau
   l'écrasait à 40 px (flèche seule, libellé invisible) — vu au navigateur. */
.de-table select { min-width: 190px; min-height: 36px; border: 1px solid #D8D3C4; border-radius: 8px;
  padding: 0 8px; font-size: 14px; background: #fff; }
.de-fige th:first-child, .de-fige td:first-child { position: sticky; left: 0; z-index: 1; background: #fff;
  box-shadow: 1px 0 0 #E8E4D8; }
.de-fige thead th:first-child { background: #14213B; }
.de-cliquable { cursor: pointer; }
.de-cliquable:hover td { background: rgba(195,121,58,.08); }
.de-barre { height: 8px; border-radius: 4px; background: #E8E4D8; overflow: hidden; margin-top: 6px; }
.de-barre i { display: block; height: 100%; background: #14213B; }
.de-grille { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 1100px) { .de-grille { grid-template-columns: repeat(2, 1fr); } }
.de-compteurs { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.de-kpi small { display: block; color: #6b6d78; }
.de-kpi b { display: block; font-family: "PT Serif", Georgia, serif; font-size: 24px; color: #14213B; margin: 4px 0; }
.de-deux { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .de-deux { grid-template-columns: 1fr; } }
.de-etapes { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.de-etapes label { display: flex; align-items: baseline; gap: 8px; line-height: 1.35; }
.de-etapes label small { white-space: nowrap; }
.de-onglets { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 4px; border-bottom: 1px solid #D8D3C4; margin: 16px 0; }
.de-onglets::-webkit-scrollbar { display: none; }
.de-onglets .de-onglet { white-space: nowrap; flex: 0 0 auto; }
.de-onglet { background: none; border: 0; padding: 10px 14px; font: inherit; font-size: 14px; color: #373946;
  cursor: pointer; border-bottom: 3px solid transparent; }
.de-onglet.on { border-bottom-color: #C3793A; color: #14213B; font-weight: 600; }
.de-onglet:disabled { opacity: .45; cursor: default; }
.de-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px dashed #D8D3C4;
  border-radius: 12px; padding: 32px; text-align: center; cursor: pointer; }
.de-drop.survol { border-color: #C3793A; background: rgba(195,121,58,.06); }
/* Phase 3 : validation (texte lu à gauche, champs à droite), IA. */
.de-validation { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .de-validation { grid-template-columns: 1fr; } }
.de-original { position: sticky; top: 16px; max-height: 80vh; overflow: auto; }
.de-texte { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, monospace; color: #373946;
  background: #F4F1E9; border-radius: 8px; padding: 12px; margin: 0; }
.de-liste { margin: 8px 0; padding-left: 20px; }
.de-bloquants { border-left: 4px solid #B3261E; background: rgba(179,38,30,.06); border-radius: 8px;
  padding: 8px 12px; margin: 12px 0; color: #373946; }
.de-btn-s { background: transparent; color: #14213B; border: 1.5px solid #14213B; border-radius: 8px;
  min-height: 44px; padding: 0 20px; font-weight: 600; cursor: pointer; }
.de-carte h3 { font-family: "PT Serif", Georgia, serif; color: #14213B; font-size: 16px; margin: 20px 0 8px; }
/* La feuille générale du CRM met les <label> en capitales espacées : juste
   pour un intitulé de champ, faux pour une case à cocher en ligne. */
.de-label-simple { display: inline-flex; align-items: center; gap: 6px; text-transform: none;
  letter-spacing: normal; font-size: 14px; font-weight: 500; color: #373946; margin: 0; }
/* Phase 4 : éditeurs de lignes, décomposition en groupes repliables. */
.de-editeur { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.de-editeur th { text-align: left; font-weight: 600; color: #14213B; padding: 6px 8px; border-bottom: 1px solid #D8D3C4; }
.de-editeur td { padding: 4px 8px; vertical-align: top; }
.de-editeur input, .de-editeur select { width: 100%; min-height: 36px; border: 1px solid #D8D3C4; border-radius: 8px;
  padding: 0 8px; font-size: 14px; background: #fff; box-sizing: border-box; }
.de-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0; }
.de-versions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.de-version { border: 1.5px solid #14213B; background: #fff; color: #14213B; border-radius: 4px; padding: 4px 12px;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.de-version.on { background: #14213B; color: #F4F1E9; }
.de-groupe { background: #fff; border-radius: 8px; margin: 8px 0; box-shadow: 0 1px 2px rgba(20,33,59,.06); }
.de-groupe > summary { padding: 12px 16px; cursor: pointer; font-weight: 600; color: #14213B;
  display: flex; justify-content: space-between; gap: 16px; }
.de-groupe > summary .de-montant { font-variant-numeric: tabular-nums; white-space: nowrap; }
.de-total td { font-weight: 700; background: #F4F1E9; }
.de-controles li.ko { color: #B3261E; }
.de-controles li.ok { color: #2E6B4F; }

/* Phase 6 : comparatif et rapport final */
.de-fieldset { border: 1px solid #E3E0DA; border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
.de-fieldset legend { font-family: "PT Serif", Georgia, serif; font-weight: 700; padding: 0 6px; color: #14213B; }
.de-large { grid-column: 1 / -1; }
.de-large textarea { width: 100%; font: inherit; }
tr.de-top td { background: #F4F1E9; }
tr.de-repere td { background: #F1F1F1; color: #666; font-style: italic; }
.de-logo-apercu { max-height: 48px; max-width: 200px; border: 1px solid #E3E0DA; border-radius: 4px; padding: 4px; }
.de-marque { margin: 12px 0; }
/* Recette 15/09/2026 : les boutons de statut sortaient de la carte. */
.de-actions-version { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 150px; }
.de-actions-version .btn { white-space: normal; text-align: left; }

/* Progression de l'analyse IA (21/09/2026) */
.de-progres { margin-top: 8px; }
.de-progres-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.de-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #E3E0DA;
  border-top-color: #C3793A; animation: de-tourne .8s linear infinite; flex: none; }
@keyframes de-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .de-spin { animation-duration: 3s; } }
.de-actions-ia { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.de-origine { color: #8a8a8a; }
/* Le point (21/09/2026) */
.de-point-titre { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6b6b6b; margin: 10px 0 2px; }
.de-point { margin: 0; padding-left: 4px; list-style: none; }
.de-point li { padding: 2px 0; }
.de-point-manque li::before { content: "• "; color: #C3793A; }
.de-prochaine { margin-top: 10px; padding: 8px 12px; background: #F4F1E9; border-left: 3px solid #C3793A; border-radius: 4px; }

/* Espaces resserrés (21/09/2026, Adrien : « des espaces trop gros à chaque fois ») */
.de-deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 900px) { .de-deux { grid-template-columns: 1fr; } }
.de-carte.de-compacte { padding: 14px 18px; }
.de-carte.de-compacte h2 { font-size: 16px; margin-bottom: 6px; }
.de-carte h2 small { font-family: Inter, sans-serif; font-weight: 400; font-size: 13px; }
.de-postes-ligne { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px 0; }
.de-postes-ligne small { display: block; color: #6b6d78; font-size: 11px; letter-spacing: .06em; }
.de-postes-ligne b { font-family: "PT Serif", Georgia, serif; font-size: 17px; color: #14213B; }
.de-postes-ligne .de-total-poste { margin-left: auto; text-align: right; }
.de-etapes li { padding: 2px 0; }
details.de-fieldset { border: 1px solid #e3e4ea; border-radius: 8px; padding: 8px 14px; margin: 8px 0; }
details.de-fieldset > summary { cursor: pointer; padding: 4px 0; }
details.de-fieldset[open] > summary { margin-bottom: 8px; }
.de-form textarea::placeholder, .de-form input::placeholder { color: #9a9ca8; font-style: italic; }
.de-etapes li label { margin: 0; padding: 3px 0; font-size: 13px; letter-spacing: 0; text-transform: none; }
.de-etapes li input[type="checkbox"] { margin: 0; flex: 0 0 auto; }
.de-journal li { padding: 6px 0; border-bottom: 1px solid #efece4; }
/* 22/09/2026, Adrien : « réduis la hauteur de ce bloc par deux » — deux
   colonnes, lignes serrées, priorité sur les styles globaux du CRM. */
#de-contenu .de-etapes { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { #de-contenu .de-etapes { grid-template-columns: 1fr; } }
#de-contenu .de-etapes li { padding: 0 !important; margin: 0 !important; min-height: 0 !important; }
#de-contenu .de-etapes li label { display: flex !important; align-items: center; gap: 8px; margin: 0 !important;
  padding: 4px 0 !important; min-height: 0 !important; line-height: 1.25 !important; font-size: 13px; }
#de-contenu .de-etapes li input[type="checkbox"] { width: 16px; height: 16px; margin: 0 !important; }
#de-contenu .de-etapes-note { margin: 8px 0 0; }
/* 22/09/2026, Adrien : bloc de dépôt deux fois moins haut. */
.de-drop.de-drop-compact { padding: 14px 12px !important; gap: 2px; min-height: 0; }
.de-drop.de-drop-compact b { font-size: 14px; }
.de-form.de-form-depot { grid-template-columns: repeat(4, 1fr); gap: 8px 12px; margin: 8px 0; }
@media (max-width: 900px) { .de-form.de-form-depot { grid-template-columns: repeat(2, 1fr); } }
.de-form.de-form-depot label { gap: 4px; font-size: 12.5px; }
.de-form.de-form-depot input, .de-form.de-form-depot select { min-height: 38px; }
.de-depot-pied { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.de-depot-pied .de-case { margin: 0; display: flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-size: 13px; }
/* Anomalies en clair (22/09/2026) */
.de-ano-clair { font-size: 15px; line-height: 1.6; margin: 4px 0 8px; }
.de-plus { color: #A23B2A; } .de-moins { color: #1F6B45; }
.de-ano { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; border-top: 1px solid #efece4; }
.de-ano.ecartee, .de-ano.resolue { opacity: .55; }
.de-ano.confirmee { background: rgba(31,107,69,.05); }
.de-ano-texte { flex: 1 1 auto; } .de-ano-texte p { margin: 0 0 4px; }
.de-ano-actions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.de-ano-facture h3 { font-size: 15px; margin: 0 0 4px; }
@media (max-width: 700px) { .de-ano { flex-direction: column; } .de-ano-actions { flex-direction: row; flex-wrap: wrap; } }
/* Rapport en trois étapes (22/09/2026) */
.de-frise { display: flex; gap: 6px; list-style: none; padding: 0; margin: 6px 0 10px; flex-wrap: wrap; }
.de-frise li { padding: 4px 10px; border-radius: 999px; background: #efece4; color: #6b6d78; font-size: 12.5px; }
.de-frise li.on { background: #14213B; color: #F4F1E9; }
#de-f-rapport h3 { font-size: 14.5px; margin: 14px 0 4px; }
.de-lecture-ia { background: #faf8f3; border-left: 3px solid #C3793A; padding: 6px 10px; margin: 6px 0; font-size: 13px; }
.de-lecture-ia p { margin: 4px 0; }
.de-controles li { padding: 6px 0; border-bottom: 1px solid #efece4; }
.de-controles li:last-child { border-bottom: 0; }

/* Pièces qu'un contrôle n'a pas encore pu lire (22/09/2026) : un compte
   « 11/12 » qui ne nomme pas la douzième oblige à la chercher à la main. */
.de-reste { display: block; margin-top: .2rem; font-style: normal; opacity: .85; }
.de-reste i { font-style: italic; }

/* HT / TTC côte à côte (23/09/2026) : le TTC en second, plus discret. */
.de-ttc { color: #6b6e7a; font-weight: 400; white-space: nowrap; }

/* Éditeur visuel du rapport (23/09/2026) */
.de-editeur-barre { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.de-editeur { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.de-editeur-apercu { background: #e9e5dc; border-radius: 8px; padding: 16px; max-height: 80vh; overflow: auto; }
.de-editeur-panneau { position: sticky; top: 12px; max-height: 80vh; overflow: auto; }
.de-editeur-plan { padding-left: 18px; margin: 4px 0; font-size: 14px; }
.de-editeur-plan li.on a { font-weight: 700; }
.de-editeur-plan li.masque a { color: var(--gris, #8a8a8a); }
.de-editeur-plan li.masque small { color: var(--gris, #8a8a8a); font-style: italic; }
@media (max-width: 900px) { .de-editeur { grid-template-columns: 1fr; } .de-editeur-panneau { position: static; } }

/* Lien présenté en bouton (annexes PDF, 23/09/2026). */
a.de-btn-s { display: inline-flex; align-items: center; text-decoration: none; }

/* Option B (23/09/2026) : barre fait + en attente d'un tiers. */
.de-barre-double { display: flex; }
.de-barre-double i { flex: 0 0 auto; }
.de-barre-double i.attente { background: #C3793A; }

/* Relance finale (23/09/2026) : cases à cocher en grille, alignées à gauche.
   Sans ceci, « .de-form label » (colonne) les empilait au centre, une par ligne. */
.de-rel-cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.de-form label.de-rel-case { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 500;
  text-transform: none; letter-spacing: normal; margin: 0; }
.de-rel-case input { width: auto; min-height: 0; margin-top: 3px; flex: 0 0 auto; }
.de-rel-case small { display: block; color: #6b6d78; font-weight: 400; }

.de-badge.vert { background: rgba(63,143,104,.14); color: #2f6f4f; }

/* E-mail de relance préparé (24/09/2026). */
.de-mail { background: #faf8f3; border-radius: 8px; padding: 12px 14px; }
.de-mail .de-texte { max-height: 320px; overflow: auto; }
.de-mail-l { display: grid; grid-template-columns: 60px 1fr; gap: 10px; align-items: center; margin: 0 0 8px; }
.de-mail-l input { width: 100%; box-sizing: border-box; }
.de-mail textarea.de-texte { width: 100%; box-sizing: border-box; font: inherit; line-height: 1.55; }
.de-mail-de { margin: 0 0 8px; font-size: 13px; color: #6b6d78; }
.de-mail-aide { font-size: 12.5px; color: var(--cuivre, #C3793A); margin: -2px 0 8px 70px; }
.de-actions .de-mail-aide { margin: 0; color: #6b6d78; }
