/* ============================================================================
   K2R Prix de Revient — Design system (charte figée Phase 2)
   Sémantique héritée du classeur : bleu = je saisis · blanc = calculé ·
   pêche = résultat · vermillon = alerte · vert/orange = statuts.
   Palette catégorielle (une teinte FIXE par offre, ordre validé CVD clair+sombre) :
   aqua = Transport dédié · bleu = Transfert de bureaux · orange = Déménagement ·
   violet = Transport d'objets. Statuts réservés, jamais réutilisés en séries.
   Règle de secours : l'aqua en mode clair (2,74:1) exige étiquettes directes.
   ========================================================================== */

:root {
  color-scheme: light;
  /* Surfaces & encres */
  --plan: #f9f9f7;            /* fond de page */
  --surface: #fcfcfb;         /* cartes */
  --surface-2: #f2f1ed;       /* zones secondaires (sidebar, entêtes de table) */
  --encre: #0b0b0b;
  --encre-2: #52514e;
  --encre-3: #898781;
  --filet: #e1e0d9;           /* hairline */
  --bord: rgba(11, 11, 11, .10);
  /* Marque */
  --marine: #1e3a5f;          /* titres / autorité */
  --teal: #147d78;            /* accent, navigation, sections */
  --teal-doux: rgba(20, 125, 120, .10);
  /* Sémantique du classeur */
  --saisie-fond: #e8f1fb;     /* bleu = je saisis */
  --saisie-bord: #2a78d6;
  --resultat-fond: #fdeee2;   /* pêche = résultat */
  --resultat-bord: #eb6834;
  /* Statuts (fixes, jamais thémés) */
  --ok: #0ca30c;
  --ok-texte: #006300;
  --attention: #fab219;       /* orange « à confirmer » */
  --serieux: #ec835a;
  --alerte: #d03b3b;          /* vermillon */
  --attention-fond: rgba(250, 178, 25, .14);
  --alerte-fond: rgba(208, 59, 59, .10);
  --ok-fond: rgba(12, 163, 12, .10);
  /* Catégoriel : une teinte par offre (ordre fixe validé) */
  --offre-dedie: #1baf7a;
  --offre-bureaux: #2a78d6;
  --offre-demenagement: #eb6834;
  --offre-objets: #4a3aa7;
  /* Séries neutres (blocs de coûts…) — 5 premiers slots de l'ordre de référence validé */
  --serie-1: #2a78d6;
  --serie-2: #eb6834;
  --serie-3: #1baf7a;
  --serie-4: #eda100;
  --serie-5: #e87ba4;
  /* Géométrie */
  --r-carte: 12px;
  --r-chip: 8px;
  --ombre: 0 1px 2px rgba(11, 11, 11, .05), 0 4px 16px rgba(11, 11, 11, .05);
  --ombre-haute: 0 2px 6px rgba(11, 11, 11, .08), 0 12px 32px rgba(11, 11, 11, .10);
  --sidebar-l: 248px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --plan: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222220;
    --encre: #ffffff;
    --encre-2: #c3c2b7;
    --encre-3: #898781;
    --filet: #2c2c2a;
    --bord: rgba(255, 255, 255, .10);
    --marine: #a8c4e4;
    --teal: #37b0a8;
    --teal-doux: rgba(55, 176, 168, .14);
    --saisie-fond: #16283c;
    --saisie-bord: #3987e5;
    --resultat-fond: #332215;
    --resultat-bord: #d95926;
    --ok-texte: #0ca30c;
    --offre-dedie: #199e70;
    --offre-bureaux: #3987e5;
    --offre-demenagement: #d95926;
    --offre-objets: #9085e9;
    --serie-1: #3987e5;
    --serie-2: #d95926;
    --serie-3: #199e70;
    --serie-4: #c98500;
    --serie-5: #d55181;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .35);
    --ombre-haute: 0 2px 6px rgba(0, 0, 0, .5), 0 12px 32px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --plan: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222220;
  --encre: #ffffff;
  --encre-2: #c3c2b7;
  --encre-3: #898781;
  --filet: #2c2c2a;
  --bord: rgba(255, 255, 255, .10);
  --marine: #a8c4e4;
  --teal: #37b0a8;
  --teal-doux: rgba(55, 176, 168, .14);
  --saisie-fond: #16283c;
  --saisie-bord: #3987e5;
  --resultat-fond: #332215;
  --resultat-bord: #d95926;
  --ok-texte: #0ca30c;
  --offre-dedie: #199e70;
  --offre-bureaux: #3987e5;
  --offre-demenagement: #d95926;
  --offre-objets: #9085e9;
  --serie-1: #3987e5;
  --serie-2: #d95926;
  --serie-3: #199e70;
  --serie-4: #c98500;
  --serie-5: #d55181;
  --ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .35);
  --ombre-haute: 0 2px 6px rgba(0, 0, 0, .5), 0 12px 32px rgba(0, 0, 0, .45);
}

/* ------------------------------------------------------------------- base */
* { box-sizing: border-box; margin: 0; }
html { height: 100%; }
body {
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--encre);
  background: var(--plan);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: var(--teal); }
:focus-visible { outline: 2px solid var(--saisie-bord); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--sidebar-l) 1fr; height: 100%; }

.sidebar {
  background: var(--surface-2);
  border-right: 1px solid var(--filet);
  padding: 16px 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--filet) transparent;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 16px;
}
.logo-pastille {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--teal); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; letter-spacing: .3px;
  flex: none;
}
.logo-titre { font-weight: 650; color: var(--marine); font-size: 15px; line-height: 1.25; }
.logo-sous { font-size: 11px; color: var(--encre-3); }

.nav-domaine {
  font-size: 11px; font-weight: 650; letter-spacing: .8px; text-transform: uppercase;
  color: var(--encre-3);
  padding: 14px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border: 0; border-radius: var(--r-chip);
  background: transparent;
  color: var(--encre-2);
  text-align: left; width: 100%;
  cursor: pointer;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item:hover { background: var(--teal-doux); color: var(--encre); }
.nav-item[aria-current="page"] {
  background: var(--teal-doux);
  color: var(--teal);
  font-weight: 600;
}
.nav-item[aria-current="page"]::before {
  content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px;
  width: 3px; border-radius: 2px; background: var(--teal);
}
.nav-item svg { flex: none; opacity: .85; }
.nav-item .phase-a-venir {
  margin-left: auto; font-size: 10px; color: var(--encre-3);
  border: 1px solid var(--filet); border-radius: 999px; padding: 0 6px;
}

/* ------------------------------------------------------------------- main */
.principal { display: flex; flex-direction: column; overflow: hidden; }
.entete {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--filet);
  background: var(--surface);
}
.entete h1 { font-size: 17px; font-weight: 650; color: var(--marine); margin-right: auto; }
.contenu {
  overflow-y: auto; padding: 24px; flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--filet) transparent;
}
.ecran { max-width: 1100px; margin: 0 auto; display: grid; gap: 16px; }

/* rôle de l'écran — la phrase « Je saisis ici ▪ Je lis ici » du classeur */
.role-ecran {
  font-size: 12.5px; color: var(--encre-3);
  display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline;
}
.role-ecran b { color: var(--encre-2); font-weight: 600; }

/* --------------------------------------------------------------- bandeaux */
.bandeau {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 24px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--filet);
}
.bandeau-fictif { background: var(--attention-fond); color: var(--encre); }
.bandeau-fictif .lien { margin-left: auto; }
.bandeau svg { flex: none; color: var(--attention); }

/* ----------------------------------------------------------------- cartes */
.carte {
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: var(--r-carte);
  box-shadow: var(--ombre);
  padding: 18px 20px;
}
.carte-titre {
  font-size: 12px; font-weight: 650; letter-spacing: .6px; text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.carte-resultat { background: var(--resultat-fond); border-color: var(--resultat-bord); }

/* ---------------------------------------------------------- tuiles chiffres */
.grille-tuiles {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.tuile {
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: var(--r-carte);
  box-shadow: var(--ombre);
  padding: 14px 16px;
  display: grid; gap: 2px;
  transition: box-shadow .15s, transform .15s;
}
.tuile:hover { box-shadow: var(--ombre-haute); transform: translateY(-1px); }
.tuile-libelle { font-size: 12px; color: var(--encre-2); font-weight: 600; }
.tuile-valeur {
  font-size: 27px; font-weight: 700; color: var(--encre);
  line-height: 1.15; margin: 2px 0;
}
.tuile-valeur.est-resultat { color: var(--resultat-bord); }
.tuile-note { font-size: 11.5px; color: var(--encre-3); }
.tuile-erreur { color: var(--alerte); font-weight: 700; }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600;
  border-radius: 999px; padding: 2px 9px;
  border: 1px solid transparent;
}
.badge svg { flex: none; }
.badge-ok { background: var(--ok-fond); color: var(--ok-texte); border-color: var(--ok); }
.badge-attention { background: var(--attention-fond); color: var(--encre); border-color: var(--attention); }
.badge-alerte { background: var(--alerte-fond); color: var(--alerte); border-color: var(--alerte); }
.badge-neutre { background: var(--surface-2); color: var(--encre-2); border-color: var(--filet); }

/* pastille d'offre — la couleur suit l'entité, partout dans l'app */
.pastille-offre { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.pastille-offre.dedie { background: var(--offre-dedie); }
.pastille-offre.bureaux { background: var(--offre-bureaux); }
.pastille-offre.demenagement { background: var(--offre-demenagement); }
.pastille-offre.objets { background: var(--offre-objets); }

/* ---------------------------------------------------------------- boutons */
.bouton {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border-radius: var(--r-chip);
  border: 1px solid var(--filet);
  background: var(--surface);
  color: var(--encre-2);
  cursor: pointer;
  font-size: 12.5px; font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.bouton:hover { border-color: var(--teal); color: var(--teal); }
.bouton-primaire { background: var(--teal); border-color: var(--teal); color: #fff; }
.bouton-primaire:hover { filter: brightness(1.08); color: #fff; }
.bouton-icone { padding: 6px 8px; }

/* ------------------------------------------------------------ anneau santé */
.sante {
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center;
}
.anneau { position: relative; width: 108px; height: 108px; }
.anneau svg { transform: rotate(-90deg); }
.anneau-fond { fill: none; stroke: var(--filet); stroke-width: 9; }
.anneau-valeur {
  fill: none; stroke-width: 9; stroke-linecap: round;
  transition: stroke-dashoffset .6s ease;
}
.anneau-centre {
  position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center;
}
.anneau-centre .pct { font-size: 21px; font-weight: 700; }
.anneau-centre .leg { font-size: 10px; color: var(--encre-3); }
.sante-lignes { display: grid; gap: 6px; }
.sante-verdict { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sante-detail { font-size: 12.5px; color: var(--encre-2); }

/* ---------------------------------------------------------------- veille */
.table-veille { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table-veille th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--encre-3); font-weight: 650;
  padding: 4px 10px 6px; border-bottom: 1px solid var(--filet);
}
.table-veille td { padding: 6px 10px; border-bottom: 1px solid var(--filet); vertical-align: top; }
.table-veille tr:last-child td { border-bottom: 0; }
.table-veille .valeur { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.table-veille .source { color: var(--encre-3); font-size: 11.5px; }

/* -------------------------------------------------------------- accès rapide */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--filet); border-radius: 999px;
  background: var(--surface);
  padding: 5px 12px;
  font-size: 12px; font-weight: 600; color: var(--encre-2);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-doux); }

/* --------------------------------------------------------- mode d'emploi */
.mode-demploi { display: grid; gap: 8px; font-size: 13px; color: var(--encre-2); }
.mode-demploi li { margin-left: 18px; }
.mode-demploi b { color: var(--encre); }

/* -------------------------------------------------------- écran placeholder */
.placeholder {
  text-align: center;
  padding: 56px 24px;
  display: grid; gap: 10px; justify-items: center;
}
.placeholder svg { color: var(--teal); opacity: .5; }
.placeholder h2 { font-size: 19px; color: var(--marine); }
.placeholder .desc { color: var(--encre-2); max-width: 480px; }
.placeholder .phase {
  font-size: 12px; font-weight: 650;
  color: var(--teal); background: var(--teal-doux);
  border-radius: 999px; padding: 3px 12px;
}

/* ---------------------------------------------------------------- infobulle */
[data-infobulle] { position: relative; cursor: help; border-bottom: 1px dotted var(--encre-3); }
[data-infobulle]:hover::after {
  content: attr(data-infobulle);
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--encre); color: var(--plan);
  font-size: 12px; line-height: 1.45; font-weight: 400;
  padding: 8px 10px; border-radius: 8px;
  width: max-content; max-width: 300px;
  box-shadow: var(--ombre-haute);
}

/* tout contenu large défile dans son propre conteneur, jamais la page */
.defilable { overflow-x: auto; scrollbar-width: thin; }

/* -------------------------------------------------------- donut (Piloter) */
.bloc-donut { display: grid; grid-template-columns: 240px 1fr; gap: 22px; align-items: center; }
@media (max-width: 860px) { .bloc-donut { grid-template-columns: 1fr; justify-items: center; } }
.donut { position: relative; width: 220px; height: 220px; }
.donut svg { width: 100%; height: 100%; }
.donut path { stroke: var(--surface); stroke-width: 2; transition: opacity .15s; cursor: default; }
.donut path:hover { opacity: .82; }
.donut-centre {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  pointer-events: none;
}
.donut-centre .total { font-size: 19px; font-weight: 700; }
.donut-centre .leg { font-size: 10.5px; color: var(--encre-3); }
.legende { display: grid; gap: 5px; font-size: 12.5px; }
.legende-ligne { display: flex; align-items: center; gap: 8px; }
.legende-pastille { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legende-part { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 650; }

.encart-pedagogie {
  border-left: 3px solid var(--teal);
  background: var(--teal-doux);
  border-radius: 0 10px 10px 0;
  padding: 10px 14px;
  font-size: 12.5px; color: var(--encre-2);
}

/* ---------------------------------------------------------- édition (Régler) */
.champ-saisie {
  background: var(--saisie-fond);
  border: 1px solid transparent;
  border-bottom: 1.5px solid var(--saisie-bord);
  border-radius: 6px 6px 0 0;
  color: var(--encre);
  font: inherit;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  width: 110px;
  text-align: right;
  transition: border-color .15s, background .15s;
}
.champ-saisie:hover { border-color: var(--saisie-bord); }
.champ-saisie:focus { outline: none; border-color: var(--saisie-bord); background: var(--surface); }
.champ-saisie.texte { text-align: left; width: 100%; }
.champ-saisie.invalide { border-color: var(--alerte); background: var(--alerte-fond); animation: secousse .2s; }
@keyframes secousse { 25% { translate: -3px 0; } 75% { translate: 3px 0; } }
select.champ-saisie { text-align: left; width: auto; cursor: pointer; }

.table-donnees { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table-donnees th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--encre-3); font-weight: 650;
  padding: 5px 10px; border-bottom: 1px solid var(--filet);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.table-donnees td { padding: 5px 10px; border-bottom: 1px solid var(--filet); vertical-align: middle; }
.table-donnees tr:last-child td { border-bottom: 0; }
.table-donnees tbody tr:hover { background: var(--teal-doux); }
.table-donnees .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-donnees .calc { color: var(--encre-2); }
.table-donnees .groupe td {
  background: var(--surface-2); font-weight: 650; font-size: 11px;
  text-transform: uppercase; letter-spacing: .6px; color: var(--teal);
}
.ligne-total td {
  border-top: 2px solid var(--resultat-bord);
  background: var(--resultat-fond);
  font-weight: 700;
}
.ligne-cliquable { cursor: pointer; }

.filtres { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filtres input[type="search"] {
  background: var(--surface); border: 1px solid var(--filet); border-radius: var(--r-chip);
  color: var(--encre); font: inherit; padding: 6px 12px; min-width: 200px;
}
.filtres input[type="search"]:focus { outline: none; border-color: var(--teal); }

.sous-onglets { display: flex; gap: 6px; flex-wrap: wrap; }
.sous-onglet {
  border: 1px solid var(--filet); border-radius: 999px;
  background: var(--surface); color: var(--encre-2);
  padding: 5px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.sous-onglet:hover { border-color: var(--teal); color: var(--teal); }
.sous-onglet.actif { background: var(--teal); border-color: var(--teal); color: #fff; }

.bascule {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--filet); border-radius: 999px;
  background: var(--surface); padding: 2px 9px;
  font-size: 11.5px; font-weight: 600; cursor: pointer; color: var(--encre-2);
}
.bascule.oui { background: var(--ok-fond); border-color: var(--ok); color: var(--ok-texte); }

/* entonnoir de capacité */
.entonnoir { display: grid; gap: 7px; }
.entonnoir-ligne { display: grid; grid-template-columns: 200px 1fr 90px; gap: 12px; align-items: center; }
.entonnoir-libelle { font-size: 12.5px; color: var(--encre-2); text-align: right; }
.entonnoir-barre-fond { background: var(--surface-2); border-radius: 6px; height: 22px; overflow: hidden; }
.entonnoir-barre {
  height: 100%; border-radius: 6px 4px 4px 6px;
  background: linear-gradient(90deg, var(--teal), color-mix(in oklab, var(--teal) 55%, transparent));
  min-width: 3px;
  transition: width .4s ease;
}
.entonnoir-ligne.calcule .entonnoir-barre { background: var(--marine); opacity: .75; }
.entonnoir-valeur { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 13px; white-space: nowrap; }
@media (max-width: 700px) {
  .entonnoir-ligne { grid-template-columns: 1fr; gap: 2px; }
  .entonnoir-libelle { text-align: left; }
}

/* cartes segments */
.grille-segments { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.carte-segment { border-top: 3px solid var(--filet); }
.carte-segment .grille-champs { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.carte-segment .grille-champs label { font-size: 12.5px; color: var(--encre-2); }

/* fiche modale d'édition */
.fiche { max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; scrollbar-width: thin; }
.fiche .grille-fiche { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; align-items: center; }
.fiche .grille-fiche label { font-size: 12.5px; color: var(--encre-2); }
.fiche textarea.champ-saisie { text-align: left; width: 100%; resize: vertical; min-height: 40px; font-variant-numeric: normal; }
.fiche .meta-fixe { font-size: 12px; color: var(--encre-3); }
@media (max-width: 600px) { .fiche .grille-fiche { grid-template-columns: 1fr; gap: 2px 0; } }

/* ------------------------------------------------------ simulateur (Coter) */
.simu { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1020px) { .simu { grid-template-columns: 1fr; } }
.simu-formulaire { display: grid; gap: 12px; min-width: 0; }
.simu-panneau { position: sticky; top: 12px; display: grid; gap: 12px; }
@media (max-width: 1020px) { .simu-panneau { position: static; } }

details.simu-section { border: 1px solid var(--bord); border-radius: var(--r-carte); background: var(--surface); box-shadow: var(--ombre); }
details.simu-section > summary {
  cursor: pointer; list-style: none;
  padding: 12px 18px;
  font-size: 12px; font-weight: 650; letter-spacing: .6px; text-transform: uppercase;
  color: var(--teal);
  display: flex; align-items: center; gap: 8px;
}
details.simu-section > summary::before { content: "▸"; transition: rotate .15s; }
details.simu-section[open] > summary::before { rotate: 90deg; }
details.simu-section > .simu-corps { padding: 2px 18px 14px; }
.simu-grille { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; align-items: center; }
.simu-grille label { font-size: 12.5px; color: var(--encre-2); }
.simu-grille .indic { grid-column: 1 / -1; font-size: 11.5px; color: var(--encre-3); margin-top: -3px; }
.simu-bascules { display: flex; gap: 8px; flex-wrap: wrap; }

.prix-hero { text-align: center; padding: 4px 0 8px; }
.prix-hero .montant { font-size: 34px; font-weight: 750; color: var(--resultat-bord); line-height: 1.1; }
.prix-hero .ttc { font-size: 12.5px; color: var(--encre-2); }

/* jauge de position du prix : 4 zones + curseur */
.jauge { display: grid; gap: 4px; }
.jauge-zones { position: relative; display: flex; height: 16px; border-radius: 8px; overflow: hidden; }
.jauge-zone-rouge { background: var(--alerte); opacity: .82; }
.jauge-zone-orange { background: var(--serieux); opacity: .82; }
.jauge-zone-jaune { background: var(--attention); opacity: .82; }
.jauge-zone-verte { background: var(--ok); opacity: .82; }
.jauge-curseur {
  position: absolute; top: -3px; bottom: -3px; width: 3px;
  background: var(--encre); border-radius: 2px;
  box-shadow: 0 0 0 2px var(--surface);
}
.jauge-reperes { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--encre-3); }
.jauge-verdict { font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 7px; }

.liste-diagnostics { display: grid; gap: 5px; font-size: 12.5px; }
.liste-diagnostics .ligne { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.detail-cout { font-size: 12.5px; display: grid; gap: 3px; }
.detail-cout .ligne { display: flex; justify-content: space-between; gap: 10px; }
.detail-cout .ligne span:last-child { font-variant-numeric: tabular-nums; }
.clause { font-size: 11.5px; color: var(--encre-2); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }

/* ----------------------------------------------- exploitation (Journal etc.) */
.table-donnees td.saisie-cellule { background: var(--saisie-fond); }
.table-donnees .negatif { color: var(--alerte); font-weight: 650; }
.table-donnees th.calc-tete { color: var(--teal); }

/* graphique en barres (SVG) */
.graph-barres { width: 100%; }
.graph-barres .grille-h { stroke: var(--filet); stroke-width: 1; }
.graph-barres .axe { stroke: var(--encre-3); stroke-width: 1.25; }
.graph-barres text { fill: var(--encre-3); font-size: 10px; font-variant-numeric: tabular-nums; }
.graph-barres rect { rx: 3; }
.graph-barres rect:hover { opacity: .82; }

/* carte thermique divergente (sensibilité) */
.heatmap td { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.heatmap th { text-align: right; }

/* ---------------------------------------------------------------- impression */
#fiche-print { display: none; }
@media print {
  .shell, .voile-modal, .voile { display: none !important; }
  #fiche-print { display: block; font-size: 12px; color: #000; }
  #fiche-print h1 { font-size: 17px; margin-bottom: 2px; }
  #fiche-print h2 { font-size: 13px; margin: 12px 0 4px; border-bottom: 1px solid #999; }
  #fiche-print table { width: 100%; border-collapse: collapse; }
  #fiche-print td { padding: 3px 6px; border-bottom: 1px solid #ddd; vertical-align: top; }
  #fiche-print td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
  #fiche-print .gros { font-size: 15px; font-weight: 700; }
  #fiche-print .pied { margin-top: 14px; font-size: 10px; color: #444; }
}

/* ------------------------------------------------------------------- modal */
.voile-modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .45);
  display: grid; place-items: center;
  padding: 20px;
}
.modal { max-width: 460px; box-shadow: var(--ombre-haute); }
.modal p { margin: 4px 0 14px; color: var(--encre-2); font-size: 13px; }
.modal-boutons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* --------------------------------------------------------------- responsive */
.bouton-menu { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 30% 0 0; z-index: 40;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--ombre-haute);
  }
  .sidebar.ouverte { transform: translateX(0); }
  .voile {
    position: fixed; inset: 0; z-index: 35;
    background: rgba(0, 0, 0, .35);
  }
  .bouton-menu { display: inline-flex; }
  .contenu { padding: 16px; }
  .entete { padding: 10px 16px; }
  .entete h1 { font-size: 15px; }
  .tuile-valeur { font-size: 23px; }
}
@media (max-width: 600px) {
  .table-veille .source { display: none; } /* la source reste en infobulle (title) */
}
