/* Palette STRATEGEO CONSEIL, relevée sur strategeo-conseil.fr et sur le logo :
   cyan de marque #3AADE3 (le logo tire sur #00B0E0), ardoise #303040, blanc et
   gris très clair #F9F9F9.

   Le cyan de marque ne contraste qu'à 2,5 pour 1 sur blanc : il ne peut pas
   porter de texte. En thème clair, tout ce qui doit se lire prend la même teinte
   assombrie (--accent, 5,8 pour 1) et le cyan d'origine ne sert qu'au filet de
   marque, décoratif. En thème sombre, le cyan d'origine passe à 6,5 pour 1 sur
   la surface : c'est là qu'il est lui-même.
   Tous les rapports sont vérifiés, le plus faible du jeu est 4,62 pour 1. */

/* Police générale : Roboto, servie par l'application (polices/, licence SIL OFL 1.1 à côté).
   Aucun appel à Google Fonts : la politique de sécurité n'autorise que ce serveur, et
   l'outil doit s'afficher pareil sur un réseau fermé. Fichier variable, graisses 100 à 900,
   jeu latin (accents français, €, −). */
@font-face {
  font-family: "Roboto";
  src: url("polices/roboto-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --bg: #F1F4F6; --surface: #FFFFFF; --surface-2: #F7F9FB;
  --ink: #252A34; --ink-2: #4A5560; --muted: #626D79; --line: #DBE2E8; --line-2: #EAEFF3;
  --accent: #0C6E8C;        /* cyan de marque assombri : texte, boutons, focus */
  --accent-vif: #3AADE3;    /* cyan de marque exact : filets et aplats, jamais de texte */
  --late: #9A4419; --bad: #9E2B3A;
  /* États d'autocontrôle de la grille : toujours accompagnés d'un libellé, jamais la couleur seule. */
  --ok: #2F6B51; --ok-soft: #DDEEE4; --warn: #7A5200; --warn-soft: #F5EAD2;
  --late-soft: #F7E0D3; --bad-soft: #F6DADF;
  /* Séries de graphique validées pour les daltonismes (CLAUDE.md § 12). */
  --produit: #8E5710; --facture: #0086A0;
  /* Production de l'année : activité nette = --produit, puis sous-traitance interne et externe.
     Trio validé (validateur de palette, 30/09/2026) en clair sur #FFFFFF et en sombre sur #1A2027. */
  --st-interne: #6A55C2; --st-externe: #B8467A;
  --sans: "Roboto", system-ui, "Segoe UI", -apple-system, sans-serif;
  /* Montants : Roboto en chiffres de largeur égale (tabular-nums), les colonnes restent alignées.
     La chasse fixe ne sert plus qu'aux chemins réseau et au mot de passe provisoire. */
  --chiffres: var(--sans);
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11161B; --surface: #1A2027; --surface-2: #212934; --ink: #E7EDF3; --ink-2: #B6C2CE; --muted: #8592A0;
          --line: #2B3540; --line-2: #222A34; --accent: #3AADE3; --accent-vif: #5CC3EA; --late: #E0926A; --bad: #E8808F;
          --produit: #BE8129; --facture: #2A9BB2; --st-interne: #8A77E0; --st-externe: #D25E8E;
          --ok: #7CC39D; --ok-soft: #173026; --warn: #E0B45A; --warn-soft: #33280F;
          --late-soft: #3A2217; --bad-soft: #3B1C22; }
}
* { box-sizing: border-box; }
/* Un élément masqué le reste, même si une règle lui donne un display. */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14.5px; line-height: 1.5; }
/* Filet de marque : le cyan exact de STRATEGEO, en décor, sans rien à lire dedans. */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); border-top: 3px solid var(--accent-vif); }
.marque { font-size: 19px; font-weight: 680; letter-spacing: -.02em; }
.marque span { color: var(--accent); }
.qui { font-size: 13px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
h1 { font-size: 23px; margin: 0 0 12px; }
h2 { font-size: 15px; margin: 22px 0 8px; }
.note { color: var(--muted); font-size: 13px; }
.formulaire { display: grid; gap: 12px; max-width: 340px; }
.formulaire label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
input { font: inherit; color: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-2); }
input:focus { border-color: var(--accent); }
button { font: inherit; cursor: pointer; padding: 7px 14px; border-radius: 3px; border: 1px solid var(--accent); background: var(--accent); color: var(--surface); font-weight: 550; }
button.discret { background: transparent; color: var(--ink-2); border-color: var(--line); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.erreur { color: var(--bad); min-height: 1.5em; margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.kpi { background: var(--surface); padding: 12px 14px; border-top: 2px solid var(--accent-vif); }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font-family: var(--chiffres); font-variant-numeric: tabular-nums; font-size: 21px; font-weight: 600; }
.defil { overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: left; }
th { font-size: 11.5px; color: var(--muted); background: var(--surface-2); }
.r { text-align: right; font-family: var(--chiffres); font-variant-numeric: tabular-nums; }
.alertes { padding-left: 18px; }
.alertes .haute { color: var(--late); }

/* ---------- Portefeuille : lignes cliquables ---------- */
tr.clic { cursor: pointer; }
tr.clic:hover td, tr.clic:focus td { background: var(--surface-2); }
select { font: inherit; color: inherit; padding: 7px 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-2); }

/* ---------- Grille de programmation (E7 / E13) ---------- */
.tete-affaire { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 6px; }
.tete-affaire h1 { margin: 8px 0 2px; }
.tete-affaire p { margin: 0; }
.bascule { display: inline-flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.bascule button { border: 0; border-radius: 0; background: var(--surface); color: var(--ink-2); font-weight: 500; }
.bascule button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.legende { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 8px 0 10px; font-size: 12.5px; }
.prog th, .prog td { padding: 5px 7px; vertical-align: top; }
.prog th.courant, .prog td.courant { box-shadow: inset 2px 0 var(--accent-vif), inset -2px 0 var(--accent-vif); }
.prog .lib { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 230px; max-width: 300px; }
.prog tr.sec td { background: var(--surface-2); font-weight: 600; font-size: 12.5px; }
.prog .cel { min-width: 96px; text-align: right; font-family: var(--chiffres); font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }
.prog .nature { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.prog tr.l-fact td { border-bottom: 1px solid var(--line); }
.prog .prevu { color: var(--muted); font-weight: 400; }
.prog .fact { color: var(--accent); }
.prog .haut, .prog .bas { display: block; min-height: 1.35em; }
.prog button.saisie { width: 100%; background: transparent; border: 1px solid transparent; color: var(--ink); padding: 3px 4px; text-align: right; font: inherit; font-weight: 400; }
.prog button.saisie:hover { border-color: var(--accent); background: var(--surface-2); }
.etat { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 12px; }
.etat.a_jour { background: var(--ok-soft); color: var(--ok); }
.etat.en_cours { background: var(--warn-soft); color: var(--warn); }
.etat.en_cours_ancien { background: var(--late-soft); color: var(--late); }
.etat.anomalie { background: var(--bad-soft); color: var(--bad); font-weight: 600; }

/* ---------- Éditeur de cellule ---------- */
.panneau { background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 14px 16px; margin-top: 16px; }
.editeur h2 { margin: 0 0 4px; }
.ligne-champs { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; }
.ligne-champs label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.ligne-champs input { width: 130px; }
.message { margin: 10px 0 0; font-size: 13px; min-height: 1.4em; }
.message.ok { color: var(--ok); }
.message.bad { color: var(--bad); }
.message.info { color: var(--ink-2); }
.prog .sec-lib { position: sticky; left: 7px; }

/* ---------- Liste des affaires (E3) ---------- */
.filtres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.filtre { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; }
.filtre[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
select.statut { padding: 4px 6px; font-size: 13px; }
.pastille { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; border: 1px solid var(--line); color: var(--ink-2); }

/* ---------- Fiche affaire (E4) ---------- */
.onglets { display: inline-flex; gap: 2px; border-bottom: 1px solid var(--line); }
.onglets button { background: transparent; color: var(--ink-2); border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-weight: 550; padding: 8px 14px; }
.onglets button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent-vif); }
#panneau-fiche, #panneau-programmation { margin-top: 14px; }
.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.colonnes .panneau { margin-top: 16px; }
dl.fiche { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
dl.fiche dt { color: var(--muted); }
dl.fiche dd { margin: 0; min-width: 0; }
code.chemin { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; word-break: break-all; }
.affectations { list-style: none; margin: 0 0 6px; padding: 0; }
.affectations li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.affectations li span { color: var(--muted); min-width: 120px; }
.affectations li b { flex: 1; font-weight: 550; }
.affectations li button, #fiche-devis button { padding: 3px 10px; font-size: 12.5px; }

/* ---------- En-cours de facturation (E10) ---------- */
.encours tr.detail > td { background: var(--surface-2); padding: 10px 14px 14px; }
.encours tr.detail table { margin-bottom: 8px; font-size: 13px; }
.encours tr.detail th { background: transparent; }

/* ---------- Mon compte, administration (E6 / E12) ---------- */
#compte .formulaire { margin-top: 12px; }
.provisoire { background: var(--warn-soft); color: var(--ink); border: 1px solid var(--warn); border-radius: 3px; padding: 12px 16px; margin: 12px 0; }
.provisoire code { font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: .04em; background: var(--surface); padding: 2px 8px; border-radius: 3px; }
.provisoire p { margin: 6px 0; }
tr.inactif td { color: var(--muted); }
.equipe { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.equipe .cases { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; }
.equipe button { justify-self: start; padding: 4px 10px; font-size: 12.5px; }
h3 { font-size: 13.5px; margin: 16px 0 6px; }

/* ---------- Export intégral (SEC8) ---------- */
a.bouton { display: inline-block; padding: 7px 14px; border-radius: 3px; border: 1px solid var(--accent); background: var(--accent); color: var(--surface); font-weight: 550; text-decoration: none; }
a.bouton:hover { filter: brightness(1.1); }

/* ---------- Tableau de bord (D9, D10, D11) ---------- */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 8px; }
.tuile { background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 12px 14px; border-top: 2px solid var(--accent-vif); min-width: 0; }
.tuile .k { font-size: 12px; color: var(--muted); }
.tuile .v { font-family: var(--chiffres); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; min-height: 4px; }
.tuile ul { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.tuile li { padding: 3px 0; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 8px; }
.tuile li b { font-family: var(--chiffres); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.tuile a, .kpi a { color: var(--accent); }
.alerte-texte { color: var(--late); }
.jauge { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.jauge i { display: block; height: 100%; background: var(--accent); }
.graphes { margin-top: 16px; }
figure.graphe { margin: 0; }
.graphe figcaption { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 6px; }
.legende-graphe { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
.pastille-serie { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.pastille-serie.produit { background: var(--produit); }
.pastille-serie.facture { background: var(--facture); }
.pastille-serie.serie-nette { background: var(--produit); }
.pastille-serie.serie-st-interne { background: var(--st-interne); }
.pastille-serie.serie-st-externe { background: var(--st-externe); }
.pastille-serie.prevu { background: repeating-linear-gradient(45deg, var(--muted) 0 2px, transparent 2px 5px); border: 1px solid var(--muted); }
.trait-serie { display: inline-block; width: 16px; height: 0; margin-right: 6px; vertical-align: 3px; border-top: 2px solid var(--ink); }
.trait-serie.objectif { border-top: 2px dashed var(--ink-2); }
.trait-serie.point-mort { border-top: 2px dotted var(--bad); }
.zone-graphe { position: relative; }
.zone-graphe svg { display: block; overflow: visible; }
.zone-graphe .grille { stroke: var(--line-2); stroke-width: 1; }
.zone-graphe .base { stroke: var(--line); stroke-width: 1; }
.zone-graphe .axe { fill: var(--muted); font-family: var(--chiffres); font-variant-numeric: tabular-nums; font-size: 10.5px; }
.zone-graphe .axe.courant { fill: var(--ink); font-weight: 600; }
.zone-graphe .serie-produit { fill: var(--produit); }
.zone-graphe .serie-facture { fill: var(--facture); }
/* Production de l'année (30/09/2026). Un mois prévu : même couleur, adoucie et hachurée ; jamais la couleur seule,
   l'info-bulle, le nom accessible et le tableau disent « prévu ». */
.zone-graphe .serie-nette { fill: var(--produit); }
.zone-graphe .serie-st-interne { fill: var(--st-interne); }
.zone-graphe .serie-st-externe { fill: var(--st-externe); }
.zone-graphe .prevu { fill-opacity: .55; }
.zone-graphe .hachure { stroke: var(--surface); stroke-width: 2.5; }
.zone-graphe .courbe-travaux { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.zone-graphe .point-travaux { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.zone-graphe .seuil { stroke-width: 1.5; }
.zone-graphe .seuil.objectif { stroke: var(--ink-2); stroke-dasharray: 6 4; }
.zone-graphe .seuil.point-mort { stroke: var(--bad); stroke-dasharray: 2 3; }
.zone-graphe .seuil-texte { fill: var(--ink-2); font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.production { margin-top: 8px; }
.production figure.graphe { margin-top: 12px; }
.table-production th, .table-production td { white-space: nowrap; font-size: 12.5px; padding: 6px 8px; }
.table-production thead th small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.table-production tbody th { font-weight: 500; color: var(--ink-2); }
.table-production tr.fort th, .table-production tr.fort td { font-weight: 650; color: var(--ink); }
.table-production td.prevu { color: var(--muted); font-style: italic; }
.zone-graphe .aire { fill: var(--accent); opacity: .12; }
.zone-graphe .courbe { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.zone-graphe .point { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.zone-graphe .valeur { fill: var(--ink); font-family: var(--chiffres); font-variant-numeric: tabular-nums; font-size: 11.5px; font-weight: 600; }
.zone-graphe .zone { fill: transparent; cursor: default; }
.zone-graphe .zone:hover, .zone-graphe .zone:focus { fill: var(--ink); fill-opacity: .04; outline: none; }
.infobulle { position: absolute; top: 0; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 6px 9px; font-size: 12.5px; box-shadow: 0 4px 14px rgba(0,0,0,.18); white-space: nowrap; }
.infobulle div { display: flex; align-items: center; gap: 4px; }
.infobulle span { margin-left: auto; padding-left: 12px; font-family: var(--chiffres); font-variant-numeric: tabular-nums; }
details summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }

#tdb-annee { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* Lignes de devis dans la fiche (AG-10) */
#fiche-devis tr.ligne-devis td { font-size: 12.5px; color: var(--ink-2); padding-top: 3px; padding-bottom: 3px; }
#fiche-devis tr.ligne-devis td:first-child { padding-left: 22px; }
.coche { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; }

/* Import d'un devis (E1) */
.titre-action { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.titre-action h2 { margin-right: auto; }
.depot { display: grid; gap: 4px; justify-items: center; padding: 28px 16px; border: 1px dashed var(--line); border-radius: 3px; background: var(--surface-2); color: var(--ink-2); cursor: pointer; text-align: center; }
.depot.survol, .depot:focus-within { border-color: var(--accent); }
.depot input[type="file"] { max-width: 100%; margin-top: 8px; }
.ligne-champs label.large input { width: 240px; }
#import-lignes select { padding: 4px 6px; font-size: 13px; }
#import-lignes tr.option td { color: var(--ink-2); }
@media (max-width: 600px) { .ligne-champs label.large input { width: 100%; } .ligne-champs label.large { flex: 1 1 100%; } }

a.bouton.discret { background: transparent; color: var(--ink-2); border-color: var(--line); font-weight: 500; margin-top: 6px; }

/* Production mensuelle par affaire (spec du 25/10/2026) : le tableau de prod du client, en pleine largeur. */
body.large main { max-width: none; }
.actions-tete { display: flex; flex-wrap: wrap; gap: 8px; }
.annees { display: flex; align-items: center; gap: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.etat.avance { background: var(--late-soft); color: var(--late); }
table.production-mensuelle { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.production-mensuelle th, table.production-mensuelle td { padding: 4px 6px; white-space: nowrap; vertical-align: top; }
table.production-mensuelle th.mois { text-align: center; border-left: 1px solid var(--line); }
table.production-mensuelle th.mois .note { font-weight: 400; font-style: italic; }
table.production-mensuelle .m { border-left: 1px solid var(--line); }
table.production-mensuelle td.prevu { font-style: italic; color: var(--muted); }
table.production-mensuelle .fige { position: sticky; left: 0; z-index: 1; background: var(--surface); border-right: 1px solid var(--line); min-width: 180px; max-width: 260px; }
table.production-mensuelle th.fige { background: var(--surface-2); }
table.production-mensuelle .fige a { color: var(--accent); font-weight: 600; }
table.production-mensuelle .fige .nom { white-space: normal; color: var(--ink-2); font-size: 12px; line-height: 1.3; }
table.production-mensuelle .etat { font-size: 11px; margin-top: 2px; }
table.production-mensuelle tfoot th, table.production-mensuelle tfoot td { font-weight: 600; background: var(--surface-2); border-top: 2px solid var(--line); }
