/* ============================================================================
   Design System — refonte visuelle complète · marque blanche
   Palette « Encre + bleu confiance » : encre #0F172A, accent #2563EB.
   Ce bloc pose la fondation (police, jetons, composants partagés). Les règles
   spécifiques aux pages, plus bas dans ce fichier, héritent de ces jetons et se
   re-skinnent donc automatiquement. Les surcharges premium sont en fin de fichier.
   ============================================================================ */

/* — Police auto-hébergée : Inter variable. Rendu identique sur tous les postes
     et hors-ligne (le portail doit tenir même sans réseau). */
/* Outfit — titres uniquement (titre de page, titre de carte, libellé de section). */
@font-face{
  font-family:'Outfit';font-style:normal;font-weight:100 900;font-display:swap;
  src:url('fonts/outfit-latin-wght-normal.woff2') format('woff2');
}
/* Plus Jakarta Sans — tout le reste, y compris les grands chiffres. */
@font-face{
  font-family:'Jakarta';font-style:normal;font-weight:200 800;font-display:swap;
  src:url('fonts/jakarta-latin-wght-normal.woff2') format('woff2');
}
@font-face{
  font-family:'Jakarta';font-style:italic;font-weight:200 800;font-display:swap;
  src:url('fonts/jakarta-latin-wght-italic.woff2') format('woff2');
}

:root{
  /* Surfaces */
  /* Surfaces — charte Agarim (p4) */
  --bg:#F5F7F9; --bg-2:#EDF1F4; --paper:#FFFFFF; --paper-2:#FAFBFC;
  /* Encre & texte — encre #0a2d41 (titres), corps #1f3a4a, secondaire, plancher */
  --ink:#0A2D41; --ink-2:#1F3A4A; --text:#1F3A4A; --muted:#42545F; --faint:#5F6D77;
  /* Filets */
  --line:#E4EAEF; --line-2:#EEF2F5; --line-strong:#D3DCE3;
  /* Accent UI — bleu-canard de la charte (boutons, actif, liens) */
  --accent:#186A8A; --accent-strong:#12556F; --accent-ink:#0E4A61;
  --accent-soft:#E7F1F5; --accent-soft-2:#C9E4EE;
  /* Séries de données (vérifiées daltonisme) : bleu saturé + ambre */
  --data-blue:#0F7BA8; --data-blue-soft:#E3F1F8; --data-blue-ink:#0B5E80;   /* disponible / entrées */
  --amber:#D97706; --amber-soft:#FCEED9; --amber-ink:#B45309;               /* sous option / sorties */
  --accent-2:#0F7BA8;  /* couleur de data-viz principale = série 1 */
  /* Sémantique */
  --green:#0E8A5F; --green-soft:#E3F5EE; --green-ink:#0B6E4C;   /* statut positif */
  --red:#C0392B;   --red-soft:#FBEAE8;   --red-ink:#8E2A20;
  --info:#0F7BA8;  --info-soft:#E3F1F8;  --info-ink:#0B5E80;
  --slate:#5F6D77; --slate-soft:#EDF1F4; --slate-ink:#42545F;  /* réservé / vendu / acté */
  /* Barre latérale sombre — encre #0a2d41, état actif #17506e */
  --side:#0A2D41; --side-2:#123B52; --side-3:#17506E; --side-active:#17506E;
  --side-line:rgba(255,255,255,.09);
  --side-text:#8FA6B6; --side-text-strong:#EAF3F7;
  /* Marque foncée (bandeaux profonds, code) */
  --deep:#0A2D41; --deep-2:#123B52;
  /* Rayons */
  --r-xs:6px; --r-sm:8px; --r:10px; --r-md:12px; --r-lg:16px; --r-xl:20px; --pill:999px;
  /* Ombres — fines, en couches */
  --sh-xs:0 1px 2px rgba(16,24,40,.05);
  --sh-sm:0 1px 3px rgba(16,24,40,.07), 0 1px 2px rgba(16,24,40,.04);
  --sh:0 4px 14px -4px rgba(16,24,40,.10), 0 2px 6px -3px rgba(16,24,40,.05);
  --sh-md:0 14px 32px -10px rgba(16,24,40,.16), 0 4px 10px -6px rgba(16,24,40,.06);
  --sh-lg:0 30px 60px -18px rgba(16,24,40,.24);
  --ring:0 0 0 4px rgba(24,106,138,.16);

  /* Alias hérités : ces noms parsèment tout le code existant. On les redirige
     vers la nouvelle palette pour tout re-skinner d'un seul coup. */
  --encre:var(--ink); --texte:var(--text); --second:var(--muted); --trait:var(--line);
  --perle:var(--bg-2); --blue:var(--accent); --blue2:var(--accent); --ciel:var(--accent-soft-2);
  --gain:var(--green); --gain-clair:var(--green-soft);
  --engage:var(--amber); --engage-clair:var(--amber-soft);
  --alerte:var(--red); --alerte-clair:var(--red-soft);
  --shadow:var(--sh);
  --mine:var(--muted);
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
:root{
  --font-titre:'Outfit',ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --font-corps:'Jakarta',ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}
body{
  margin:0;background:var(--bg);color:var(--text);
  font:400 13.5px/1.5 var(--font-corps);
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;
}
::selection{background:var(--accent-soft-2);color:var(--ink)}
a{color:var(--accent)}

h1,h2,h3{color:var(--ink);font-family:var(--font-titre);font-weight:700;margin:0}
h1{font-size:24px;line-height:1.15;letter-spacing:-.01em}
h2{font-size:15px;letter-spacing:-.005em}
h3{font-size:14px}
.eyebrow{font-family:var(--font-titre);text-transform:uppercase;letter-spacing:.1em;color:var(--faint);font-size:11px;font-weight:700;margin:0 0 7px}

main{max-width:1440px;margin:0 auto;padding:30px 24px 66px}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:24px}

/* ---------- Boutons ---------- */
.button{
  appearance:none;border:1px solid var(--line-strong);background:var(--paper);color:var(--ink);
  border-radius:9px;padding:9px 15px;font:inherit;font-weight:650;font-size:13.5px;line-height:1.2;
  text-decoration:none;cursor:pointer;display:inline-flex;align-items:center;gap:7px;
  box-shadow:var(--sh-xs);transition:.13s ease;
}
.button:hover{border-color:var(--faint);background:var(--paper-2);box-shadow:var(--sh-sm)}
.button:active{opacity:.85}
.button.primary{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 5px 14px -4px rgba(37,99,235,.55)}
.button.primary:hover{background:var(--accent-strong);border-color:var(--accent-strong)}
.button:disabled{opacity:.5;cursor:not-allowed;box-shadow:none;transform:none}
.button.compact{padding:7px 11px;font-size:12px}

/* ---------- Cartes, panneaux, résumés ---------- */
.panel {background:var(--paper);border:1px solid var(--line);border-radius:var(--r-md);box-shadow:var(--sh-sm)}
.grid-2{display:grid;grid-template-columns:1.35fr 1fr;gap:18px;margin-top:18px}
.panel{overflow:hidden}
.panel>h2{padding:16px 20px;border-bottom:1px solid var(--line)}
.panel-head{display:flex;align-items:center;justify-content:space-between;padding:15px 20px;border-bottom:1px solid var(--line);gap:14px}
.panel-head a{color:var(--accent);text-decoration:none;font-weight:650}

/* ---------- Tableaux ---------- */
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse}
th{text-align:left;text-transform:uppercase;letter-spacing:.05em;font-size:10.5px;font-weight:700;color:var(--muted);background:var(--paper-2);white-space:nowrap}
th,td{padding:11px 16px;border-bottom:1px solid var(--line-2);vertical-align:middle}
thead th{border-bottom:1px solid var(--line)}
tbody tr{transition:background .1s}
tbody tr:hover{background:var(--accent-soft)}
td a{color:var(--accent);text-decoration:none;font-weight:600}
td a:hover{text-decoration:underline}
td small,.block{color:var(--muted)}
.block{display:block;margin-top:3px}
.empty{padding:36px!important;text-align:center;color:var(--muted)}

/* ---------- Champs ---------- */
input,select,textarea{
  border:1px solid var(--line-strong);border-radius:9px;padding:9px 11px;background:var(--paper);
  color:var(--ink);font:inherit;min-width:0;transition:border-color .12s,box-shadow .12s;
}
input::placeholder,textarea::placeholder{color:var(--faint)}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:var(--ring)}

/* ---------- Statuts & étiquettes ---------- */
.status,.badge{display:inline-flex;align-items:center;border-radius:var(--pill);padding:3px 10px;font-size:11px;font-weight:700;white-space:nowrap;background:var(--bg-2);color:var(--muted);letter-spacing:.01em}
.status.open{background:var(--data-blue-soft);color:var(--data-blue-ink)}
.status.option,.status.firmOption{background:var(--amber-soft);color:var(--amber-ink)}
.status.booked,.status.act{background:var(--slate-soft);color:var(--slate-ink)}
.status.notAvailable{background:var(--red-soft);color:var(--red-ink)}
.status.large{font-size:12.5px;padding:6px 13px}
.badge.lot_added,.badge.program_added,.badge.lot_returned{background:var(--green-soft);color:var(--green-ink)}
.badge.field_changed{background:var(--info-soft);color:var(--info-ink)}
.badge.lot_removed,.badge.program_removed{background:var(--red-soft);color:var(--red-ink)}

/* ---------- Journal des changements ---------- */

/* ---------- Encadrés d'information ---------- */
.notice{padding:13px 16px;border-radius:var(--r);margin-bottom:18px;border:1px solid;font-weight:500}
.notice.success{background:var(--green-soft);border-color:#A7F3D0;color:var(--green-ink)}
.notice.error{background:var(--red-soft);border-color:#FECACA;color:var(--red-ink)}
.notice.warning{background:var(--amber-soft);border-color:#FDE68A;color:var(--amber-ink)}

/* ---------- Détail (fiches) ---------- */
.detail-grid{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:18px}
.panel dl{margin:0;padding:8px 20px 18px}
.panel dl div{display:flex;justify-content:space-between;gap:20px;padding:10px 0;border-bottom:1px solid var(--line-2)}
.panel dt{color:var(--muted)}
.panel dd{margin:0;font-weight:650;text-align:right;color:var(--ink)}
.panel dd.price{font-size:18px;font-variant-numeric:tabular-nums}

/* ---------- Documents ---------- */
.document-list{padding:8px 18px 18px}
.document{display:flex;flex-direction:column;align-items:flex-start;gap:5px;padding:12px 0;border-bottom:1px solid var(--line-2);text-decoration:none;color:var(--ink)}
.document form{margin:3px 0 0}
.document span{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.04em}
.document strong{color:var(--accent);margin-top:2px}
.document-action{color:var(--green);font-weight:700;text-decoration:none}

@media(max-width:900px){
  .grid-2,.detail-grid{grid-template-columns:1fr}
  main{padding:22px 14px}
  .page-head{align-items:flex-start;flex-direction:column}
  h1{font-size:25px}
}


/* ===== Règles spécifiques aux pages (héritent des jetons ci-dessus) ===== */


/* ==========================================
   AGARIM PORTAIL - DESIGN SYSTEM & THÈME MODERNE
   ========================================== */
:root {
  /* ==========================================================
     JETONS AGARIM — arrêtés le 21/09/2026 (canvas « Refonte »).
     Les contrastes indiqués sont mesurés sur blanc.
     Ne pas éclaircir un jeton de texte : #5f6d77 est le plancher.
     ========================================================== */

  /* Encre & surfaces */
  --encre: #0a2d41;          /* rail, titres — 14,3:1 */
  --encre-clair: #17506e;    /* état actif dans le rail */
  --encre-medium: #12405c;   /* survol dans le rail */
  --surface: #ffffff;        /* cartes */
  --plan: #f5f7f9;           /* fond de page */
  --filet: #e4eaef;          /* bordures */
  --filet-fort: #ccd8e0;     /* ligne de base d'un graphique */

  /* Encres de texte */
  --texte: #1f3a4a;          /* corps — 11,9:1 */
  --texte-2: #42545f;        /* secondaire — 7,9:1 */
  --texte-3: #5f6d77;        /* discret, PLANCHER — 5,3:1 */

  /* Séries de données — paire validée (ΔE 20,4 protanopie / 29,2 normal).
     Le bleu de charte #186a8a échoue au plancher de chroma : il habille
     l'interface, jamais une barre. #0f7ba8 est son voisin saturé. */
  --serie-1: #0f7ba8;        /* disponible, entrées — 4,8:1 */
  --serie-2: #d97706;        /* sous option, sorties — marques seulement */
  --serie-1-fond: #d7e8f1;   /* piste de jauge, ton clair de la rampe */
  --serie-2-fond: #f6e3c6;

  /* Statuts */
  --gain: #0a6647;           /* texte vert — 6,4:1 */
  --gain-marque: #0e8a5f;    /* pastille, marque */
  --gain-clair: #e3f3ec;
  --engage: #8f4308;         /* texte ambre — 7,0:1 */
  --engage-marque: #d97706;
  --engage-clair: #fdf0dd;
  --alerte: #a31824;         /* texte rouge — 7,4:1 */
  --alerte-marque: #e52e3d;  /* Rouge Aga officiel */
  --alerte-clair: #fceaec;

  /* Identité Agarim */
  --accent: #186a8a;         /* Bleu Moyen AGARIM — accent d'interface */
  --accent-fort: #0f5470;
  --ciel: #7fb4cc;           /* sur fond encre uniquement */
  --ciel-clair: #c0e6f5;
  --rouge-aga: #e52e3d;

  /* Alias hérités : les 37 gabarits s'appuient dessus. Ne pas supprimer. */
  --second: var(--texte-3);
  --muted: var(--texte-3);
  --line: var(--filet);
  --line-hover: var(--filet-fort);
  --paper: var(--surface);
  --bg: var(--plan);
  --bg-subtle: #f0f7fa;
  --perle: var(--plan);
  --blue: var(--encre);
  --blue2: var(--accent);
  --blue-hover: var(--serie-1);
  --amber: var(--engage-marque);
  --red: var(--alerte-marque);
  --green: var(--gain-marque);
  --trait: var(--filet);

  /* Typographie — Outfit pour les titres SEULEMENT ; Plus Jakarta Sans
     pour tout le reste, chiffres compris. */
  --font-main: 'Jakarta', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont,
               'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Outfit', 'Avenir Next', 'Segoe UI Variable Display',
                  -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Ombres — discrètes : une carte se pose, elle ne flotte pas. */
  --shadow-sm: 0 1px 2px rgba(10, 45, 65, 0.04);
  --shadow-md: 0 2px 6px -2px rgba(10, 45, 65, 0.08);
  --shadow-lg: 0 8px 24px -12px rgba(10, 45, 65, 0.18);
  --shadow-xl: 0 20px 40px -20px rgba(10, 45, 65, 0.25);
  --shadow-glow: var(--shadow-md);

  /* Les dégradés sont bannis. Ces deux alias restent, en aplat, pour que
     les règles héritées qui les utilisent tombent sur une couleur pleine. */
  --gradient-accent: var(--accent);
  --gradient-dark: var(--encre);

  /* Mesures */
  --rail: 248px;
  --rayon: 10px;
  --rayon-carte: 12px;
}

/* Base global */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--texte);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--encre);
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-top: 0;
}
h1 { font-size: 2.1rem; line-height: 1.15; margin-bottom: 0.2rem; }
h2 { font-size: 1.35rem; line-height: 1.25; }
h3 { font-size: 1.1rem; }

/* Conteneur principal */
main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}

/* En-tête de page */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--texte-3);
  font-size: 0.68rem;
  font-weight: 700;
  margin: 0 0 6px;
  display: block;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

/* Boutons */
.button {
  appearance: none;
  border: 1px solid var(--line-hover);
  background: #ffffff;
  color: var(--encre);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}
.button:hover {
  border-color: var(--filet-fort);
  background: #fbfcfd;
}
.button.primary {
  background: var(--encre);
  border: 1px solid var(--encre);
  color: #ffffff;
  box-shadow: none;
}
.button.primary:hover {
  background: var(--encre-clair);
}
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.button.compact { padding: 6px 12px; font-size: 0.78rem; border-radius: 8px; }

/* Grilles & Cartes KPI / Tuiles */
.tuiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 1100px) { .tuiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .tuiles { grid-template-columns: 1fr; } }

.tuile, .panel {
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: var(--rayon-carte);
  box-shadow: none;
}

.tuile {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.tuile:hover {
  border-color: var(--filet-fort);
}

.tuile-titre {
  display: block;
  color: var(--texte-3);
  font-weight: 600;
  font-size: 0.78rem;
  margin-bottom: 0;
}
.tuile strong {
  display: block;
  margin-top: 6px;
  font-family: var(--font-main);
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--encre);
}
.tuile-detail {
  display: block;
  color: var(--texte-3);
  font-size: 0.74rem;
  margin-top: 8px;
}

/* Variantes Tuiles Métier */
.tuile.gain {
  border-top-color: var(--gain-marque);
}
.tuile.gain strong { color: var(--gain); }

.tuile.engage {
  border-top-color: var(--engage-marque);
}
.tuile.engage strong { color: var(--engage); }

.tuile.alerte {
  border-top-color: var(--alerte-marque);
}
.tuile.alerte strong { color: var(--alerte); }

/* Grilles 2 colonnes */
.grid-2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
/* `minmax(0, 1fr)` et non `1fr` : une colonne `1fr` ne descend pas sous la largeur
   minimale de son contenu, un tableau large la gonflait au-delà de l'écran. */
@media (max-width: 960px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Panneaux & Cartes Conteneurs */
.panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panel > h2 {
  padding: 18px 22px;
  margin: 0;
  border-bottom: 1px solid var(--filet);
  background: var(--surface);
  font-size: 0.95rem;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.panel-head h2 { margin: 0; font-size: 0.95rem; }
.panel-head a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
}
.panel-head a:hover { text-decoration: underline; }
/* Le petit compte ou la note à droite d'un titre de panneau (`panel-head`) —
   « 26 critères notés », « {{ n }} programmes »… Discret : jamais plus clair
   que --texte-3 (charte § 1, plancher de contraste). */
.tally { font-size: .8rem; color: var(--texte-3); }

/* Tableaux modernes */
/* `position: relative` : un élément en `position: absolute` du tableau (le libellé masqué
   d'une colonne, par exemple) reste dans le cadre qui défile. Sans cela il échappait au
   découpage, tombait à droite du tableau large et faisait défiler la page entière. */
.table-wrap { overflow-x: auto; width: 100%; position: relative; }
/* Le relevé à copier dans Outlook (copilote) : son tableau défile dans ce cadre. */
.releve-html { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--texte-3);
  background: transparent;
  white-space: nowrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--filet);
}
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.88rem;
  color: var(--texte);
}
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: #f1f5f9; }
tbody tr:last-child td { border-bottom: none; }
td a { color: var(--accent); font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
td small, .block { color: var(--second); font-size: 0.78rem; }
.empty { padding: 36px !important; text-align: center; color: var(--second); font-weight: 500; }

/* Badges de statut & Pastilles */
.status, .badge, .pill, .etiquette {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: #eef2f5;
  color: var(--texte-2);
}
.status.open, .etiquette.gain {
  background: var(--gain-clair);
  color: var(--gain);
}
.status.option, .status.firmOption, .etiquette.engage, .pill.alerte {
  background: var(--engage-clair);
  color: var(--engage);
}
.status.booked, .status.notAvailable, .status.act, .pill.bloquant {
  background: var(--alerte-clair);
  color: var(--alerte);
}
.status.large { font-size: 0.84rem; padding: 6px 14px; }


/* Notices d'alerte */
.notice {
  padding: 14px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid;
}
.notice.success { background: var(--gain-clair); border-color: #b5ddca; color: var(--gain); }
.notice.error { background: var(--alerte-clair); border-color: #f0bec3; color: var(--alerte); }
.notice.warning { background: var(--engage-clair); border-color: #f0d3a8; color: var(--engage); }
/* Sur téléphone une notice se lit comme un paragraphe. En rangée flex, chaque morceau de
   phrase (gras, lien, texte nu) devenait une colonne : leurs largeurs minimales s'additionnaient
   au-delà de l'écran. */
@media (max-width: 760px) { .notice { display: block; } }

/* Formulaires & Champs */
input, select, textarea {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  background: #ffffff;
  color: var(--encre);
  font-family: inherit;
  font-size: 0.88rem;
  transition: all 0.15s ease;
  min-width: 0;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

/* ==========================================================
   LE PORTAIL — l'accueil (/portail), dans le cadre commun
   (voir « LE CADRE DU PORTAIL ») : une carte par module ouvert
   au compte. Ni dégradé, ni verre dépoli.
   ========================================================== */
/* Une carte par module : sa tête (icône, nom, phrase, date des données), ses
   chiffres clés, puis l'accès direct à ses pages principales. Pleine largeur : un
   seul module ne reste pas perdu au milieu de la page. */
.accueil-modules{display:flex;flex-direction:column;gap:20px;max-width:1100px}
.module-accueil{display:flex;flex-direction:column;gap:18px;padding:24px;background:var(--surface);
  border:1px solid var(--filet);border-radius:14px}
.module-accueil-inerte{background:#fbfcfd;border-style:dashed}
.module-accueil-tete{display:flex;align-items:flex-start;flex-wrap:wrap;gap:12px 16px}
.module-accueil-icone{width:44px;height:44px;flex:none;border-radius:11px;background:#e4f1f8;color:#0a5b7e;
  display:flex;align-items:center;justify-content:center}
.module-accueil-icone svg{width:22px;height:22px}
.module-accueil-inerte .module-accueil-icone{background:#eef2f5;color:var(--texte-3)}
.module-accueil-titre{flex:1 1 260px;min-width:0}
.module-accueil-titre h2{margin:0;font-family:var(--font-display);font-size:1.25rem;font-weight:700;color:var(--encre)}
.module-accueil-titre h2 a{color:inherit;text-decoration:none}
.module-accueil-titre h2 a:hover{text-decoration:underline}
.module-accueil-titre p{margin:4px 0 0;font-size:.88rem;line-height:1.5;color:var(--texte-2)}
.module-accueil-date{margin:2px 0 0;font-size:.8rem;font-weight:500;color:var(--texte-3);white-space:nowrap}
.module-accueil-date[title]{cursor:help}
.module-accueil-etat{margin:0;font-size:.88rem;font-weight:600;color:var(--texte-2)}
.module-accueil-etiquettes{display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none}
.module-accueil-etiquettes li{padding:3px 8px;border:1px solid var(--filet);border-radius:6px;background:var(--plan);
  font-size:.74rem;font-weight:600;color:var(--texte-2)}
.module-accueil-note{margin:0;font-size:.82rem;color:var(--texte-2)}
.module-accueil-chiffres{display:flex;flex-wrap:wrap;gap:12px;margin:0}
.module-accueil-chiffres > div{flex:1 1 200px;padding:14px 16px;border:1px solid var(--filet);border-radius:10px;background:var(--plan)}
.module-accueil-chiffres dt{font-size:.8rem;font-weight:600;color:var(--texte-2)}
.module-accueil-chiffres dd{margin:4px 0 0}
.module-accueil-chiffres strong{display:block;font-size:1.6rem;font-weight:700;line-height:1.15;color:var(--encre)}
.module-accueil-chiffres small{display:block;margin-top:2px;font-size:.78rem;color:var(--texte-3)}
.module-accueil-pages{display:flex;flex-wrap:wrap;gap:10px;padding-top:16px;border-top:1px solid var(--filet)}
.module-accueil-pages .button{display:inline-flex;align-items:center;gap:8px;min-height:44px}
.module-accueil-pages .button svg{width:16px;height:16px;flex:none}
@media(max-width:760px){
  .module-accueil{padding:18px}
  .module-accueil-date{white-space:normal}
  .module-accueil-pages .button{flex:1 1 calc(50% - 10px);justify-content:center}
}


/* Modales & Dialogues */
dialog {
  border: none;
  border-radius: 18px;
  box-shadow: var(--shadow-xl);
}
dialog::backdrop {
  background: rgba(10, 45, 65, 0.45);
}

/* Barre d'attente globale */
.attente { position: fixed; inset: 0 0 auto; z-index: 1000; pointer-events: none; }

/* L'infobulle de survol de la carte Radar (carte_ventes.js, placerBulle/remplirBulle) :
   fond encre, texte clair — même famille que le fond du rail (--side*).
   Retirée par erreur en d1cd4f7, rétablie sur jetons. */
.carte-bulle { position: absolute; z-index: 3; pointer-events: none;
  background: rgba(10, 45, 65, .94); /* --encre translucide : cf. dialog::backdrop plus haut, même triplet */
  color: var(--surface); border-radius: var(--r-sm);
  padding: .35rem .55rem; max-width: 15rem; box-shadow: var(--shadow-lg); }
.carte-bulle.a-gauche { transform: translateX(-100%); }
.carte-bulle strong { display: block; font-size: .86rem; line-height: 1.25; } /* prix isolé, pas de tabular-nums : § 2 de refonte-design.md */
.carte-bulle span { display: block; font-size: .73rem; color: var(--ciel-clair); line-height: 1.3; }
.carte-bulle em { display: block; font-size: .64rem; font-style: normal; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; margin-top: .2rem; color: var(--side-text); }
.attente-barre {
  height: 4px;
  background: var(--serie-1);
  background-size: 40% 100%;
  animation: attente-glisse 1.1s ease-in-out infinite;
}
.attente-texte {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  background: #ffffff;
  color: var(--encre);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 30px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
  border: 1px solid var(--line);
}
@keyframes attente-glisse { 0% { background-position: -40% 0; } 100% { background-position: 140% 0; } }

/* Réglages & Grilles complexes */
.reglages .panel { margin-bottom: 20px; }
.champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ label { font-size: 0.82rem; font-weight: 700; color: var(--encre); }

/* Responsive adjustments */
@media (max-width: 900px) {
  main { padding: 20px 14px; }
  h1 { font-size: 1.75rem; }
}

/* ==========================================================
   LA COQUE — le rail, la zone de travail et l'en-tête de page
   sont réunis plus bas, dans « LE CADRE DU PORTAIL ». Reste ici
   le témoin de synchronisation, posé dans l'en-tête par les pages.
   ========================================================== */
.temoin {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--filet);
  border-radius: 8px;
  background: #fbfcfd;
  font-size: 0.74rem;
  color: var(--texte-2);
  white-space: nowrap;
}
.temoin::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gain-marque);
  flex-shrink: 0;
}
.temoin strong { font-weight: 600; color: var(--texte); }

@media (max-width: 620px) {
  .entete .temoin { font-size: 0.7rem; padding: 6px 10px; }
  .entete-titre p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tuiles-bord { gap: 12px; }
  .barre-nom { width: 46%; }
  .barre-valeur { display: none; }
}

/* ==========================================================
   LA COUCHE GRAPHIQUE
   Deux couleurs, une échelle, les valeurs écrites. Les six
   règles sont sur l'artboard « Système de design » du canvas.
   ========================================================== */

/* --- Tuiles chiffrées --- */
.tuiles-bord { display: grid; grid-template-columns: 1.38fr 1fr 1fr 1fr; gap: 16px; margin-bottom: 18px; }
@media (max-width: 1280px) { .tuiles-bord { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .tuiles-bord { grid-template-columns: 1fr; } }

.tuile-bord {
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: var(--rayon-carte);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  min-height: 138px;
}
.tuile-bord > p:first-child { margin: 0; font-size: 0.78rem; font-weight: 600; color: var(--texte-3); }
/* Chiffres proportionnels : tabular-nums desserre un grand nombre isolé. */
.chiffre {
  display: block;
  margin-top: 6px;
  font-size: 2.15rem;
  line-height: 1;
  font-weight: 700;
  color: var(--encre);
  letter-spacing: -0.02em;
}
.tuile-pied { margin: auto 0 0; font-size: 0.74rem; color: var(--texte-3); padding-top: 10px; }
.tuile-pied strong { font-weight: 600; color: var(--texte); }



/* --- Carte de graphique --- */
.carte {
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: var(--rayon-carte);
  padding: 20px 22px;
  position: relative;
}
/* Cartes empilées (copilote.html, analyse.html…) : un souffle entre deux, sans
   toucher les paires posées côte à côte dans .colonnes-bord. */
main > .carte + .carte { margin-top: 20px; }
.carte-tete { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
/* Sur téléphone, le titre d'une carte et ses onglets ou son lien se mettent l'un sous l'autre :
   côte à côte, le titre était écrasé dans une colonne de quelques lettres. */
@media (max-width: 760px) { .carte-tete { flex-wrap: wrap; } }
.carte-tete > div:first-child { flex-grow: 1; min-width: 0; }
.carte h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--encre);
}
/* Un sous-titre de section dans une carte (« À faire » liste plusieurs
   tableaux : _copilote_profondeur.html). Plus discret qu'un h2 de carte. */
.carte h3 {
  margin: 18px 0 8px;
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--encre);
}
.carte-note { margin: 2px 0 0; font-size: 0.74rem; color: var(--texte-3); }
/* Le titre d'un bloc de cartes (« Le rythme du stock », analyse.html). */
.bloc-titre { margin: 28px 0 12px; font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--encre); }
.releve-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.carte-tete a { font-size: 0.76rem; font-weight: 600; color: var(--serie-1); text-decoration: none; white-space: nowrap; }
.carte-tete a:hover { text-decoration: underline; }

/* Repli natif dans une carte (« Mouvements du stock », _copilote_profondeur.html) : pas de
   classe côté gabarit, juste details/summary — à ne pas confondre avec
   .pourquoi ou details.sujet, qui restent des variantes à part. */
.carte > details { margin-top: 8px; border: 1px solid var(--filet); border-radius: 8px; }
.carte > details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  color: var(--texte-2);
}
.carte > details > summary::-webkit-details-marker { display: none; }
.carte > details > summary strong { color: var(--encre); font-weight: 650; }
.carte > details[open] > summary { border-bottom: 1px solid var(--filet); }
.carte > details > .fil { padding: 4px 8px; }

/* Une barre de données posée en SVG (macros `barre()` de _macros.html) : la
   couleur vient de la charte, jamais d'un attribut fill en dur. */
svg .barre-serie, svg rect[data-serie="1"] { fill: var(--serie-1); }
svg .barre-serie-2 { fill: var(--serie-2); }
/* Les 2 px de blanc entre deux segments : du vide, jamais un contour. */
svg .barre-blanc { fill: var(--surface); }
.barre-svg { display: block; }
.mouvement-jour { flex: 1; min-width: 0; height: 100%; }

/* L'identité ne repose jamais sur la couleur seule : pastille + mot. */
.legende { display: flex; align-items: center; gap: 18px; margin-bottom: 10px; flex-wrap: wrap; }
.legende span { display: inline-flex; align-items: center; gap: 7px; font-size: 0.74rem; font-weight: 600; color: var(--texte-2); }
.legende i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.legende .s1 { background: var(--serie-1); }
.legende .s2 { background: var(--serie-2); }
.legende .pousse { flex-grow: 1; }
.legende em { font-style: normal; font-size: 0.7rem; font-weight: 400; color: var(--texte-3); }

/* --- Barres empilées horizontales --- */
.barre-rang { display: flex; align-items: center; gap: 10px; height: 34px; border-radius: 6px; }
.barre-rang:hover { background: #f7fafb; }
.barre-nom { width: 40%; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.barre-nom strong { font-size: 0.8rem; font-weight: 600; color: var(--texte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-nom small { font-size: 0.68rem; color: var(--texte-3); white-space: nowrap; }
/* Le 2px de blanc entre segments sort de la piste : on lui rend la place. */
.barre-piste { flex-grow: 1; min-width: 0; display: flex; height: 20px; padding-right: 2px; }
.barre-piste i { display: block; height: 20px; }
.barre-piste .s1 { background: var(--serie-1); border-radius: 2px 4px 4px 2px; }
.barre-piste .s1.suivi { border-radius: 2px 0 0 2px; }
.barre-piste .s2 { background: var(--serie-2); border-radius: 0 4px 4px 0; margin-left: 2px; }
.barre-total { width: 38px; flex-shrink: 0; text-align: right; font-size: 0.82rem; font-weight: 700; color: var(--encre); font-variant-numeric: tabular-nums; }
.barre-valeur { width: 86px; flex-shrink: 0; text-align: right; font-size: 0.74rem; color: var(--texte-3); font-variant-numeric: tabular-nums; }

/* --- Colonnes groupées (le mouvement) --- */
.mouvement { display: flex; align-items: flex-end; justify-content: space-between; height: 180px; border-bottom: 1px solid var(--filet-fort); gap: 4px; }
.mouvement-jour { display: flex; align-items: flex-end; gap: 3px; height: 100%; }
.mouvement-jour i { width: 16px; display: block; border-radius: 4px 4px 0 0; }
.mouvement-jour .s1 { background: var(--serie-1); }
.mouvement-jour .s2 { background: var(--serie-2); }
.mouvement-axe { display: flex; justify-content: space-between; margin-top: 6px; gap: 4px; }
.mouvement-axe small { flex: 1; text-align: center; font-size: 0.66rem; color: var(--texte-3); font-variant-numeric: tabular-nums; }
.mouvement-somme { display: flex; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--filet); }
.mouvement-somme small { display: block; font-size: 0.68rem; color: var(--texte-3); }
.mouvement-somme strong { font-size: 1rem; font-weight: 700; color: var(--encre); }

/* --- Bascule sans JavaScript : trois vues, un groupe de radios --- */
.bascule { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.onglets { display: flex; gap: 2px; padding: 3px; background: #f1f5f7; border-radius: 9px; flex-shrink: 0; }
/* Sur téléphone les quatre onglets ne tiennent pas dans la carte : ils défilent dans leur
   cadre au lieu de déborder de la page. Pas ailleurs : le cadre rognerait l'anneau de focus. */
@media (max-width: 760px) { .onglets { max-width: 100%; overflow-x: auto; } }
.onglets label {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--texte-2);
  cursor: pointer;
  white-space: nowrap;
}
.onglets label:hover { background: #e8eef2; }
.jeu { display: none; }
#vue-programme:checked ~ .jeu-programme,
#vue-ville:checked ~ .jeu-ville,
#vue-typologie:checked ~ .jeu-typologie { display: block; }
#vue-programme:checked ~ .carte-tete label[for="vue-programme"],
#vue-ville:checked ~ .carte-tete label[for="vue-ville"],
#vue-typologie:checked ~ .carte-tete label[for="vue-typologie"] { background: var(--encre); color: #ffffff; }
#vue-programme:focus-visible ~ .carte-tete label[for="vue-programme"],
#vue-ville:focus-visible ~ .carte-tete label[for="vue-ville"],
#vue-typologie:focus-visible ~ .carte-tete label[for="vue-typologie"] { outline: 2px solid var(--serie-1); outline-offset: 2px; }

/* --- Les deux colonnes du bas --- */
.colonnes-bord { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 18px; }

/* --- La carte des lots (_carte_stock.html, carte_stock.js) ---
   Le fond des départements est teinté par cinq paliers de --serie-1, assez
   clairs pour que les points des programmes restent lisibles ; chaque point
   porte un anneau disponible / sous option, les deux séries de la charte. */
.carte-stock { margin-bottom: 18px; }
/* Quand la carte est étroite (téléphone, ou section « Le stock à vendre » de la vue
   Commercial), le témoin passe sous le titre et revient à la ligne : sur une seule
   ligne, il écrasait le titre en une colonne d'un mot et débordait de la carte. */
.carte-stock .carte-tete { flex-wrap: wrap; }
.carte-stock .carte-tete > div:first-child { flex-basis: 260px; }
.carte-stock .temoin { flex-wrap: wrap; white-space: normal; }
.carte-stock-corps { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .carte-stock-corps { grid-template-columns: 1fr; } }
.carte-stock-plan { position: relative; margin: 0; max-width: 560px; width: 100%; justify-self: center; }
.carte-stock-plan .carte-fr { display: block; width: 100%; max-width: none; height: auto; }
.carte-stock-points { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.carte-stock-points a { pointer-events: auto; cursor: pointer; }
.carte-stock-points a:focus-visible { outline: none; }
.carte-stock-points a:focus-visible .point-fond { stroke: var(--encre); stroke-width: 2; }
.carte-fr .dep { fill: var(--filet); stroke: var(--surface); stroke-width: 0.6; stroke-linejoin: round; }
.carte-fr .dep.a-du-stock { cursor: pointer; }
.carte-fr .dep.n1 { fill: var(--serie-1); fill-opacity: 0.10; }
.carte-fr .dep.n2 { fill: var(--serie-1); fill-opacity: 0.18; }
.carte-fr .dep.n3 { fill: var(--serie-1); fill-opacity: 0.26; }
.carte-fr .dep.n4 { fill: var(--serie-1); fill-opacity: 0.34; }
.carte-fr .dep.n5 { fill: var(--serie-1); fill-opacity: 0.42; }
.carte-fr .dep.actif { stroke: var(--encre); stroke-width: 1.4; }
.point-fond { fill: var(--surface); }
.point-dispo, .point-option { fill: none; }
.point-dispo { stroke: var(--serie-1); }
.point-option { stroke: var(--serie-2); }
.carte-stock-bulle {
  position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; gap: 1px; max-width: 280px;
  background: var(--encre); color: #ffffff; padding: 8px 11px; border-radius: 8px;
  font-size: 0.74rem; line-height: 1.4;
}
.carte-stock-bulle[hidden] { display: none; }
.carte-stock-bulle strong { font-weight: 700; }
.carte-stock-bulle span { color: #cfe0ea; }
.carte-stock-panneau { max-height: 520px; overflow-y: auto; }
.carte-stock-panneau h3 { margin-top: 0; }
.carte-stock-deps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.carte-stock-deps > li { border-radius: 8px; }
.carte-stock-deps > li.actif, .carte-stock-deps > li:hover { background: #f2f7fa; }
.carte-stock-deps summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; cursor: pointer; list-style: none; }
.carte-stock-deps summary::-webkit-details-marker { display: none; }
.dep-nom { flex-grow: 1; min-width: 0; }
.dep-nom strong { display: block; font-size: 0.8rem; font-weight: 600; color: var(--texte); }
.dep-nom small, .dep-chiffres small { font-size: 0.68rem; color: var(--texte-3); }
.dep-chiffres { text-align: right; font-variant-numeric: tabular-nums; }
.dep-chiffres strong { display: block; font-size: 0.86rem; font-weight: 700; color: var(--encre); }
.dep-entree { flex-shrink: 0; font-size: 0.72rem; color: var(--texte-2); font-variant-numeric: tabular-nums; }
.carte-stock-deps .fil { padding: 0 4px 6px 12px; }
/* Le détail d'un programme se lit en entier dans le panneau étroit : il passe à la ligne. */
.carte-stock-deps .fil small { white-space: normal; }
.carte-stock-inconnus { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--filet); }
.carte-stock-inconnus summary { cursor: pointer; font-size: 0.8rem; color: var(--texte-2); }
.carte-stock-inconnus summary span { margin-left: 6px; color: var(--accent); text-decoration: underline; }

/* --- Tableau du tableau de bord --- */
.table-bord th:first-child, .table-bord td:first-child { padding-left: 0; }
.table-bord th:last-child, .table-bord td:last-child { padding-right: 0; }
.lien-programme { font-weight: 700; color: var(--serie-1); text-decoration: none; }
.lien-programme:hover { text-decoration: underline; }
/* Le rail garde ses 248 px jusqu'a 1100 px : entre 1101 et 1280, deux
   colonnes ne tiennent plus dans ce qui reste et la carte de droite
   depassait de 99 px. On empile plus tot. */
@media (max-width: 1280px) { .colonnes-bord { grid-template-columns: minmax(0, 1fr); } }

/* --- Tableau posé dans une carte --- */
.carte table { width: 100%; border-collapse: collapse; }
.carte th {
  background: transparent;
  padding: 0 8px 8px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--texte-3);
  border-bottom: 1px solid var(--filet);
}
.carte td { padding: 9px 8px; border-bottom: 1px solid #f1f5f7; font-size: 0.8rem; }
.carte tr:last-child td { border-bottom: none; }
.carte .chiffre-cellule { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* --- Fil d'activité --- */
.fil { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.fil li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 6px; border-radius: 7px; }
.fil li:hover { background: #f7fafb; }
.fil strong { display: block; font-size: 0.8rem; font-weight: 600; color: var(--texte); }
.fil small { display: block; font-size: 0.72rem; color: var(--texte-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fil time { flex-shrink: 0; font-size: 0.68rem; color: var(--texte-3); font-variant-numeric: tabular-nums; }
.fil > li > span { min-width: 0; flex-grow: 1; }
/* L'étiquette d'état garde sa largeur de mot : sinon elle s'étirait sur la moitié de la ligne. */
.fil > li > .etat { flex-grow: 0; }

/* --- Étiquette d'état : un mot, jamais la couleur seule --- */
.etat {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  background: #eef2f5;
  color: var(--texte-2);
}
.etat.entree { background: #e4f1f8; color: #0a5b7e; }
.etat.sortie { background: var(--engage-clair); color: var(--engage); }
.etat.retour { background: var(--gain-clair); color: var(--gain); }
.etat.alerte { background: var(--alerte-clair); color: var(--alerte); }


/* --- La pastille du chat d'équipe : un vrai bouton, un aplat encre --- */
#chat-badge-count {
  background: var(--alerte-marque);
  color: #ffffff;
  border-radius: 10px;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}

/* Une page pas encore portée garde son propre .page-head : l'en-tête ne
   doit pas afficher un second titre au-dessus. Tant que le gabarit ne
   remplit pas le bloc `entete_titre`, le h1 reste vide et disparaît. */

/* Modale Relance Commerciale (fiche_programme.html, l'aperçu PDF) */
.modal-relance {
  width: 90vw;
  max-width: 680px;
  border: none;
  border-radius: 12px;
  padding: 0;
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  overflow: hidden;
  font-family: inherit;
}
.modal-relance-header {
  background: var(--encre);
  color: #ffffff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-relance-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-relance-title h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
}
.modal-relance-close {
  background: transparent;
  border: none;
  color: var(--filet);
  font-size: 1.2rem;
  cursor: pointer;
}



/* ==========================================================
   RÈGLES RÉCUPÉRÉES — ne pas supprimer
   La réécriture de cette feuille avait emporté ces blocs :
   Radar, page de connexion, comptes, matrice de référencement,
   détail des ventes, volets, fiches. Les gabarits les utilisent
   toujours : sans elles, des sections entières s'affichaient à
   hauteur nulle (le détail des ventes en avait deux).
   Récupérées de a72aade le 21/09/2026.
   ========================================================== */

/* Jetons que les regles recuperees appellent encore. */
:root {
  --ink: var(--texte);
  --shadow: var(--shadow-md);
  --teinte: var(--texte-3);
}

.document{align-items:flex-start;gap:5px}
.document form{margin:3px 0 0}
.document-action{color:var(--green);font-weight:750;text-decoration:none}
.detail-grid{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:18px}
.document-list{padding:8px 18px 18px}
.document{display:flex;flex-direction:column;padding:11px 0;border-bottom:1px solid #edf1f3;text-decoration:none;color:var(--ink)}
.document span{color:var(--muted);font-size:11px;text-transform:uppercase}
.document strong{color:var(--blue);margin-top:2px}
.astuce { font-size: .8rem; color: var(--second); background: var(--perle); border-left: 3px solid var(--ciel); padding: .55rem .8rem; border-radius: 0 6px 6px 0; margin: 0 0 1.2rem; }

/* Un formulaire pose dans une cellule de tableau ne doit jamais deborder :
   le remplace un `style="margin:0"` en dur. */
td form { margin: 0; }

.compteurs { display: flex; gap: 1.6rem; padding: .3rem 0 .9rem; border-bottom: 1px solid var(--trait); margin-bottom: .5rem; flex-wrap: wrap; }
.compteurs div { display: flex; flex-direction: column; }
.compteurs span { font-size: .7rem; color: var(--second); text-transform: uppercase; letter-spacing: .03em; }
.compteurs strong { font-size: 1.6rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.compteurs small { font-size: .72rem; color: var(--second); }
strong.neutre { color: var(--encre); }
.anomalies { display: flex; flex-direction: column; max-height: 24rem; overflow-y: auto; }
.anomalie { display: flex; gap: .7rem; padding: .55rem .2rem; border-bottom: 1px solid #eef1f4; align-items: flex-start; }
.anomalie:last-child { border-bottom: none; }
/* Le copilote en profondeur (_copilote_profondeur.html) : une règle par ligne,
   son compte, et le détail replié. Un état porte toujours un mot. */
ul.anomalies { list-style: none; margin: 0; padding: 0; max-height: none; }
.anomalie > details, .anomalie > .anomalie-vide { flex-grow: 1; min-width: 0; }
.anomalie summary, .anomalie-vide { display: flex; align-items: center; gap: .7rem; min-height: 44px; cursor: pointer; list-style: none; }
.anomalie-vide { cursor: default; }
.anomalie summary::-webkit-details-marker { display: none; }
.anomalie summary > span, .anomalie-vide > span { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.anomalie .anomalie-compte { min-width: 2.6rem; text-align: right; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.anomalie details > p, .anomalie details > .fil { margin-left: 3.3rem; }
.anomalie p { margin: .1rem 0 0; font-size: .8rem; color: #4b5b68; }
.anomalie strong { font-size: .78rem; color: var(--encre); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.codes { font-size: .74rem; color: var(--second); }
td small.lieu { display: block; font-size: .72rem; color: var(--second); font-weight: 400; }
td small.commission { display: block; font-size: .72rem; color: var(--gain); font-weight: 600; }
th.repartition, td.repartition { width: 9rem; padding-left: .6rem; padding-right: .6rem; }
.barre { display: block; height: 7px; border-radius: 4px; background: var(--serie-1); min-width: 2px; }
tr.inactif { opacity: .5; }
.manquant { color: var(--alerte); font-weight: 600; }
.resume { font-size: .82rem; color: var(--second); margin: -.2rem 0 .9rem; }

/* --- Programmes en attente de rattachement (NP-04/TB-14) --- */
.attente-badge-programme { background: var(--accent); color: var(--surface); }
.attente-badge-sans-partenaire { background: var(--engage-marque); color: var(--surface); }
.attente-form { margin: 0; }
table.comptes input { font: inherit; font-size: .82rem; padding: .32rem .5rem; border: 1px solid var(--trait); border-radius: 5px; width: 100%; box-sizing: border-box; }
table.comptes input.vide { border-color: #f0c9c9; background: #fffafa; }
.barre-actions { position: sticky; bottom: 0; padding: .8rem 0; background: #f7f9fb; display: flex; justify-content: flex-end; }
.test-envoi { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin: .9rem 0; }
.test-envoi .en-ligne { display: flex; gap: .5rem; align-items: center; }
.test-envoi input { font: inherit; font-size: .85rem; padding: .45rem .6rem; border: 1px solid var(--trait); border-radius: 6px; min-width: 16rem; }
.generation-options { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; justify-content: flex-end; }
.case-option { display: inline-flex; align-items: center; gap: .5rem; padding: .52rem .7rem; border: 1px solid var(--trait); border-radius: 8px; background: #fff; color: var(--encre); font-size: .8rem; font-weight: 650; cursor: pointer; }
.case-option input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent); }
/* Date et poids du lot du jour, a cote du bouton ZIP. */
.mention-lot { font-size: .8rem; color: var(--texte-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Plan de travail : filtres + tri interactifs */
.barre-travail { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fbfdfe; }
.barre-travail input[type=search] { flex: 1 1 220px; min-width: 180px; }
.barre-travail .case { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 650; color: var(--ink); white-space: nowrap; cursor: pointer; }
.barre-travail .case input { accent-color: var(--accent); width: 1rem; height: 1rem; margin: 0; }
.note-liste { display: flex; flex-direction: column; }
.note-item { padding: 12px 20px; border-bottom: 1px solid #eef1f4; }
.note-item:last-child { border-bottom: none; }
.note-item strong { color: var(--encre); font-size: .92rem; }
.note-item p { margin: .25rem 0 0; font-size: .82rem; color: var(--second); }
.texte-note { width: 100%; min-height: 9rem; resize: vertical; border: 1px solid var(--trait); border-radius: 8px; padding: 14px 16px; font: inherit; font-size: .85rem; line-height: 1.5; color: var(--texte); background: var(--perle); box-sizing: border-box; }
/* Page du référencement : matrice des partenaires */
.matrice { max-height: 72vh; }
.matrice table { border-collapse: separate; border-spacing: 0; }
.matrice th, .matrice td { border-bottom: 1px solid #e8eef2; }
.matrice thead th { position: sticky; top: 0; z-index: 1; background: #f3f7f9; }
.matrice th.coin { position: sticky; left: 0; z-index: 2; background: #f3f7f9; text-align: left; text-transform: none; letter-spacing: 0; min-width: 12rem; max-width: 15rem; }
.matrice thead th.coin { z-index: 3; }
.matrice tbody th.coin { font-size: .82rem; font-weight: 650; color: var(--encre); }
.matrice th.prog { height: 160px; vertical-align: bottom; padding: 6px 0; }
.matrice th.prog span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--encre); max-height: 150px; overflow: hidden; text-overflow: ellipsis; }
.matrice td.case { text-align: center; padding: 6px 10px; border-left: 1px solid #eef2f5; }
.matrice td.case input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--accent); cursor: pointer; }
.matrice tbody tr:hover td.case { background: #eef7fb; }
.matrice tbody tr:hover th.coin { background: #eef7fb; }
/* Page en construction */
.construction { text-align: center; padding: 48px 24px; }
.construction-picto { font-size: 3rem; }
.construction h2 { margin: 12px 0 6px; color: var(--encre); }
.construction p { color: var(--second); max-width: 32rem; margin: 6px auto; }
.construction-liens a { color: var(--blue); font-weight: 700; text-decoration: none; }
/* Matrice : en-têtes cliquables (toggle ligne/colonne) */
.matrice th.tog-row, .matrice th.tog-col { cursor: pointer; }
.matrice th.tog-row:hover, .matrice th.tog-col:hover { color: var(--accent); background: #eef7fb; }
/* Sélecteur d'année (page Ventes) */
.annees { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.annees .annee { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--trait); background: #fff; color: var(--second); font-weight: 700; text-decoration: none; font-size: .9rem; }
.annees .annee:hover { border-color: var(--accent); color: var(--accent); }
/* Années partielles (historique tor-i incomplet) */
.annees .annee.partiel { color: var(--texte-3); border-style: dashed; font-weight: 600; }
.annees .annee.partiel::after { content: ""; }
/* Options de generation : partenaire vise + lots sous option. */
.generation-options { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin: 0; }
.generation-options select { padding: 8px 10px; max-width: 17rem; }
.case-option { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--second); white-space: nowrap; }
/* Livrable produit, ouvrable depuis la page. */
.livrable { display: inline-flex; gap: .45rem; }
.livrable a { font-weight: 700; text-decoration: none; color: var(--accent); }
.livrable a:hover { text-decoration: underline; }
/* ---------- Automatisation : la chaîne et sa cadence ---------- */
.chaine { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.chaine li { padding: 1.1rem 1.3rem; border-right: 1px solid var(--trait); display: flex; flex-direction: column; gap: .3rem; position: relative; }
.chaine li:last-child { border-right: 0; }
.chaine-titre { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--second); font-weight: 700; }
.chaine-detail { font-size: .88rem; line-height: 1.4; }
.chaine li.faite .chaine-titre { color: var(--gain); }
.chaine li.faite::before { content: "✓"; position: absolute; top: 1rem; right: 1.1rem; color: var(--gain); font-weight: 800; }
.chaine li.sautee { background: var(--perle); }
.chaine li.sautee .chaine-detail { color: var(--second); }
.chaine-erreurs { padding: 0 1.3rem 1.1rem; border-top: 1px solid var(--trait); }
.chaine-erreurs p { margin: .7rem 0 0; }
.cadence { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.1rem 1.3rem; flex-wrap: wrap; }
.cadence .resume { margin: 0; flex: 1; min-width: 18rem; }
.cadence form { margin: 0; }
.manquant { color: var(--alerte); }
.tuile-declencheur { appearance: none; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .25rem; border-radius: 10px; }
.tuile-declencheur:hover { background: rgba(24,106,138,.05); }
.tuile-appel { font-size: .74rem; font-weight: 700; color: var(--accent); margin-top: .35rem; }
/* ---------- Fenêtre de détail ---------- */
.fenetre { width: min(1200px, 94vw); max-height: 88vh; border: 0; border-radius: 14px; padding: 1.4rem; background: var(--perle); color: var(--encre); box-shadow: 0 24px 70px rgba(10,45,65,.35); overflow: auto; }
.fenetre::backdrop { background: rgba(10,45,65,.45); }
.fenetre-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin: 0 0 1rem; }
.fenetre-tete h2 { font-size: 1.5rem; letter-spacing: -.02em; }
.fenetre-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 1000px) {
  .fenetre-colonnes { grid-template-columns: 1fr; }
}
/* ---------- Enseigne qui se déplie sur ses comptes ---------- */
.deplier { appearance: none; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 0; display: block; }
.deplier small { display: block; margin-top: 2px; padding-left: 14px; color: var(--muted); font-weight: 650; }
.deplier .chevron { display: inline-block; width: 14px; color: var(--accent); font-weight: 800; transition: transform .12s ease; }
.deplier[aria-expanded="true"] .chevron { transform: rotate(90deg); }
.depliable td { background: #fbfdfe; }
.sous-ligne td { padding-top: 8px; padding-bottom: 8px; color: var(--muted); }
.sous-ligne td:first-child { padding-left: 34px; }
/* ---------- Bandeau des vues d'action ---------- */
.bandeau-action { margin: 26px 0 14px; padding: 0 2px; }
.bandeau-action h2 { font-size: 1.25rem; letter-spacing: -.02em; }
.bandeau-action p { margin: .35rem 0 0; color: var(--muted); max-width: 70ch; }
td.sans-retour { white-space: nowrap; }
/* ---------- Connexion et identité de la session ---------- */
.page-connexion { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--encre); }
.cadre-connexion { width: min(420px, 92vw); background: var(--paper); border-radius: 14px; padding: 2rem; box-shadow: 0 24px 70px rgba(10,45,65,.4); }
.logo-connexion { height: 34px; margin-bottom: 1.2rem; }
.cadre-connexion h1 { font-size: 1.4rem; margin: 0 0 1rem; letter-spacing: -.02em; }
.cadre-connexion .explication { color: var(--muted); line-height: 1.5; }
.formulaire-connexion { display: flex; flex-direction: column; gap: .9rem; margin: 0; }
.formulaire-connexion label { display: flex; flex-direction: column; gap: .3rem; }
.formulaire-connexion label span { font-size: .78rem; font-weight: 700; color: var(--muted); }

/* ---------- Gestion des comptes ---------- */
.formulaire-compte { display: flex; flex-direction: column; gap: .8rem; padding: 16px 20px; }
.formulaire-compte label { display: flex; flex-direction: column; gap: .3rem; }
.formulaire-compte label span { font-size: .78rem; font-weight: 700; color: var(--muted); }
.code-unique { font-family: ui-monospace, Menlo, monospace; font-size: 1.15rem; font-weight: 700; letter-spacing: .02em; background: #fff; border: 1px dashed var(--gain); border-radius: 8px; padding: .7rem 1rem; margin: .6rem 0; user-select: all; color: var(--encre); }

/* Invitation et mail de bienvenue pour création de compte */
.carte-invitation-reussie { padding: 22px 24px; border-radius: 12px; }
.carte-invitation-entete { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.carte-invitation-titre h3 { margin: 0 0 4px 0; color: var(--encre, #0a2d41); font-size: 1.15rem; font-weight: 700; }
.carte-invitation-titre p { margin: 0; font-size: 0.88rem; color: var(--second, #4b5b68); }
.carte-invitation-actions { display: flex; gap: 10px; align-items: center; }

/* Carte Email style Claude / SaaS moderne */
.mail-apercu {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
  box-shadow: 0 4px 20px rgba(10, 45, 65, 0.06);
  max-width: 620px;
}
.mail-apercu-en-tete {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
}
.mail-apercu-ligne { display: flex; align-items: center; gap: 8px; }
.mail-apercu-etiquette { color: #64748b; font-weight: 600; width: 85px; flex-shrink: 0; }
.mail-apercu-adresse { color: #0f172a; font-weight: 600; }
.mail-apercu-sujet { color: #0f172a; font-weight: 700; }

/* Le corps de l'aperçu : la version texte du vrai message, retours à la ligne
   gardés ; une adresse ou un code très long se coupe au lieu de déborder. */
.mail-apercu-contenu {
  padding: 28px 32px;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.94rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.invitation-texte-brut-titre {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--texte-2, #4b5b68);
  margin: 0 0 6px 0;
}

.grille-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin: .8rem 0; }
.grille-codes code { font-family: ui-monospace, Menlo, monospace; font-size: 1.05rem; font-weight: 600; letter-spacing: .04em; background: #fff; border: 1px solid var(--gain); border-radius: 6px; padding: .5rem .6rem; text-align: center; user-select: all; color: var(--encre); }
tr.ligne-alerte td { background: #fdecec; }
tr.ligne-alerte td:nth-child(2) { font-weight: 600; color: #a02020; }
.chemin { color: var(--mine, #6b7a86); }
/* ---------- Agarim Radar : la liste et la fiche d'une étude ----------
   La carte porte un fond IGN (photo aérienne ou plan) et un calque de ventes.
   La vue inclinée bascule le plan en perspective : on lit l'implantation du
   quartier, pas un modèle du bâti. */
.radar-compte { color: var(--second); font-size: .82rem; margin: 0; }
.radar-verdict { display: flex; align-items: center; gap: .7rem; }
.radar-verdict strong { font-size: 2.1rem; line-height: 1; font-variant-numeric: tabular-nums; }
.radar-verdict strong small { font-size: .9rem; color: var(--second); font-weight: 600; }
.radar-panneau-carte { margin-bottom: 1.1rem; }
.carte-outils { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  padding: .8rem 1.25rem; border-bottom: 1px solid var(--trait); background: #fafcfd; }
.carte-outils fieldset { border: 0; margin: 0; padding: 0; display: flex; align-items: center; gap: .55rem; }
.carte-outils legend { float: left; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--second); font-weight: 700; margin-right: .45rem; }
.carte-outils label { font-size: .8rem; display: inline-flex; align-items: center; gap: .3rem; }
.carte-outils input { min-width: 0; }
.carte-boutons { display: flex; gap: .35rem; flex-wrap: wrap; }
.carte-echelle { display: flex; align-items: center; gap: .5rem; margin-left: auto;
  font-size: .72rem; color: var(--second); font-variant-numeric: tabular-nums; }
.carte-echelle .rampe { display: block; width: 8rem; height: .5rem; border-radius: 999px;
  background: linear-gradient(90deg, rgb(23,118,176) 0%, rgb(245,245,240) 50%, rgb(176,24,24) 100%);
  border: 1px solid rgba(10,45,65,.15); }
.carte-echelle small { color: #93a5af; }
.carte-zone { position: relative; }
.carte-cadre { position: relative; overflow: hidden; border-radius: 12px;
  margin: 0 1.25rem 1.25rem; box-shadow: 0 1px 3px rgba(10,45,70,.18), 0 10px 30px rgba(10,45,70,.12); }
.carte-scene { position: relative; width: 100%; height: 34rem; overflow: hidden;
  background: #10202b; cursor: grab; touch-action: none; perspective: 1100px; }
/* La photo aérienne est grise et chargée : les points s'y noient. On la calme —
   un peu désaturée, un peu assombrie — pour que la couleur du prix soit la
   seule chose vive à l'écran. Le plan IGN, lui, est déjà clair : on le laisse. */
.carte-scene.sur-photo .carte-tuiles { filter: saturate(.72) brightness(.82) contrast(1.06); }
/* Un voile qui fonce les bords et laisse le centre net : l'œil va au milieu,
   là où se trouve l'adresse étudiée. */
.carte-scene::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  z-index: 2; box-shadow: inset 0 0 7rem rgba(8,24,34,.55); }
.carte-scene.attrape { cursor: grabbing; }
.carte-plan { position: absolute; left: 50%; top: 50%; transform-origin: center center;
  transition: none; }
/* Le plan se centre sur lui-même (translate), s'incline (rotate), puis le zoom
   fractionnaire l'échelonne — le `transform` posé par le script s'applique en
   dernier, après ces deux proprietes. */
.carte-plan { translate: -50% -50%; }
.carte-scene.inclinee .carte-plan { rotate: x 52deg; }
/* Le ciel derrière l'horizon, quand la carte est inclinée. */
.carte-scene.inclinee { background: linear-gradient(180deg, #b9ccd6 0%, #dfe7ea 38%); }
.carte-tuiles { position: absolute; inset: 0; }
.carte-tuiles .carte-tuile { position: absolute; display: block; user-select: none;
  -webkit-user-drag: none; pointer-events: none; }
.carte-calque { position: absolute; left: 0; top: 0; overflow: visible; }
.carte-calque .anneau { stroke: rgba(255,255,255,.55); stroke-width: 1.2; stroke-dasharray: 2 7;
  stroke-linecap: round; }
.carte-scene:not(.sur-photo) .carte-calque .anneau { stroke: rgba(10,45,65,.35); }
.carte-calque .anneau-etiquette { fill: #fff; font-size: 11px; font-weight: 700;
  text-anchor: middle; paint-order: stroke; stroke: rgba(10,45,65,.55); stroke-width: 3px; }
.carte-scene:not(.sur-photo) .carte-calque .anneau-etiquette { fill: #55707f; stroke: #fff; }
.carte-calque .marque { stroke: rgba(255,255,255,.9); stroke-width: 1.1; cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(6,20,28,.55)); }
/* Les lieux (transports, écoles, commerces…) portent un liseré clair : à teinte
   égale on les distingue des ventes, qui n'en ont pas. */
.carte-calque g:not([data-couche="ventes"]) .marque { stroke: #fff; stroke-width: 1.6; }
.carte-calque .marque:hover { stroke: #fff; stroke-width: 2.5; }
.carte-calque .marque.choisie { stroke: #fff; stroke-width: 3; }
.carte-calque .adresse { pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(8,24,34,.9)); }
.carte-calque .adresse-halo { fill: rgba(255,255,255,.18); stroke: none; }
.carte-calque .adresse-anneau { fill: none; stroke: #fff; stroke-width: 2.4; }
.carte-calque .adresse-coeur { fill: #fff; stroke: none; }
.carte-aide { position: absolute; left: .9rem; bottom: .75rem; margin: 0; font-size: .7rem;
  z-index: 3; color: rgba(255,255,255,.72); background: rgba(8,24,34,.62);
  padding: .3rem .65rem; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14); }
.carte-credit { position: absolute; right: .9rem; bottom: .8rem; margin: 0; font-size: .64rem;
  z-index: 3; color: rgba(255,255,255,.55); pointer-events: none; letter-spacing: .01em; }
.carte-fiche { position: absolute; top: 1rem; right: 1rem; width: 16.5rem; background: #fff;
  border: 1px solid var(--trait); border-radius: 10px; box-shadow: 0 10px 28px rgba(17,45,70,.22);
  padding: .9rem 1rem; }
.carte-fiche > strong { font-size: 1.45rem; display: block; font-variant-numeric: tabular-nums; }
.carte-fiche .carte-ecart { display: block; font-size: .74rem; color: var(--second); margin-bottom: .6rem; }
.carte-fiche .carte-ecart.au-dessus { color: var(--alerte); }
.carte-fiche .carte-ecart.en-dessous { color: var(--accent); }
.carte-fiche dl { margin: 0; }
.carte-fiche dl div { display: flex; justify-content: space-between; gap: .8rem;
  padding: .35rem 0; border-bottom: 1px solid #eef1f4; font-size: .78rem; }
.carte-fiche dl div:last-child { border-bottom: 0; }
.carte-fiche dt { color: var(--second); }
.carte-fiche dd { margin: 0; font-weight: 650; text-align: right; }
.carte-fermer { float: right; border: 0; background: transparent; font-size: 1.2rem;
  line-height: 1; color: var(--second); cursor: pointer; padding: 0 0 0 .5rem; }
@media (max-width: 900px) {
  .carte-fiche { position: static; width: auto; margin: .8rem 1rem 1rem; }
  .carte-scene { height: 22rem; }
  .carte-echelle { margin-left: 0; }
}
/* ---------- Radar : les calques, le lancement, le dossier ---------- */
.carte-couches { display: flex; flex-wrap: wrap; gap: .3rem .5rem;
  padding: .75rem 1.25rem; border-bottom: 1px solid var(--trait); background: #fff; }
.carte-couche { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem;
  padding: .22rem .55rem .22rem .3rem; border: 1px solid var(--trait); border-radius: 999px;
  cursor: pointer; user-select: none; }
.carte-couche:hover { border-color: var(--teinte); }
.carte-couche input { margin: 0; accent-color: var(--teinte); }
.carte-couche .pastille { width: .62rem; height: .62rem; border-radius: 50%;
  background: var(--teinte); box-shadow: 0 0 0 1px rgba(10,45,65,.25) inset; flex: 0 0 auto; }
.carte-couche small { color: var(--second); font-variant-numeric: tabular-nums; }
.carte-couche:has(input:checked) { border-color: var(--teinte); background: color-mix(in srgb, var(--teinte) 8%, #fff); }
/* La couche des prix n'a pas de teinte : sa pastille porte l'échelle. */
.carte-couche:first-child .pastille {
  background: linear-gradient(135deg, rgb(23,118,176) 0%, rgb(245,245,240) 50%, rgb(176,24,24) 100%); }
.carte-origine { display: block; font-size: .66rem; text-transform: uppercase;
  letter-spacing: .06em; font-weight: 800; color: var(--second); margin-bottom: .15rem; }
.radar-lancer { display: flex; align-items: flex-end; gap: .7rem; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--trait); border-radius: 12px;
  padding: 1rem 1.2rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.radar-lancer-champ { flex: 1 1 22rem; display: flex; flex-direction: column; gap: .3rem; }
/* Seul le libellé du champ est en capitales : la règle visait lui, pas les
   cartes de profil qui vivent aussi dans ce formulaire. */
.radar-lancer-champ label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--second); font-weight: 700; }
.radar-lancer-champ input { width: 100%; }
.radar-lancer-note { flex: 1 0 100%; margin: .1rem 0 0; font-size: .74rem; color: var(--second); }
.radar-filtre { width: 16rem; }
.radar-attente-corps { padding: 1.2rem 1.25rem 1.4rem; }
.radar-attente-corps p { margin: .2rem 0 .9rem; color: var(--second); font-size: .85rem; }
.radar-jauge { height: .4rem; border-radius: 999px; background: var(--perle); overflow: hidden; }
.radar-jauge i { display: block; height: 100%; width: 35%; border-radius: 999px;
  background: var(--accent); animation: radar-va-et-vient 1.6s ease-in-out infinite; }
.radar-journal { margin: 0; padding-left: 1.1rem; font-size: .78rem; color: var(--second);
  font-variant-numeric: tabular-nums; }
.radar-document-corps { padding: .4rem 1.5rem 1.6rem; max-width: 62rem; }
.radar-document-corps h1 { font-size: 1.5rem; margin: 1.2rem 0 .4rem; }
.radar-document-corps h2 { font-size: 1.15rem; margin: 2rem 0 .5rem; padding-top: .9rem;
  border-top: 2px solid var(--encre); }
.radar-document-corps h3 { font-size: .95rem; margin: 1.3rem 0 .4rem; }
.radar-document-corps h4 { font-size: .78rem; margin: 1.5rem 0 .4rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: .06em; }
.radar-document-corps p { margin: .5rem 0; line-height: 1.55; }
.radar-document-corps em { color: var(--second); }
.radar-document-corps blockquote { margin: .8rem 0; padding: .6rem .9rem; background: var(--perle);
  border-left: 3px solid var(--ciel); border-radius: 0 6px 6px 0; }
.radar-document-corps blockquote p { margin: 0; font-size: .85rem; }
.radar-document-corps hr { border: 0; border-top: 1px solid var(--trait); margin: 1.4rem 0; }
.radar-document-corps table { font-size: .82rem; margin: .3rem 0 .6rem; }
.radar-document-corps th, .radar-document-corps td { padding: .4rem .6rem; }
.radar-document-corps td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.radar-document-corps a { color: var(--accent); }
.radar-document-corps ul { margin: .4rem 0; padding-left: 1.2rem; }
/* ---------- Radar : la tête de fiche, à la forme des synthèses Agarim ---------- */
.fiche-tete { margin-bottom: 1.1rem; }
.fiche-phrase { font-size: 1.02rem; line-height: 1.5; color: var(--encre); margin: 0 0 .5rem;
  max-width: 62rem; }
.fiche-phrase:first-child { font-size: 1.12rem; font-weight: 600; }
.fiche-acces-corps { display: grid; grid-template-columns: 1.6fr 1fr; gap: 0; }
.fiche-reperes { list-style: none; margin: 0; padding: .6rem 1.25rem 1rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .1rem 1.4rem; }
.fiche-poles { border-left: 1px solid var(--trait); grid-template-columns: 1fr; }
.fiche-reperes li { display: grid; grid-template-columns: 1fr auto; align-items: baseline;
  gap: .4rem; padding: .42rem 0; border-bottom: 1px solid #eef1f4; }
.fiche-reperes li:last-child { border-bottom: 0; }
.fiche-repere-nom { color: var(--encre); font-size: .85rem; }
.fiche-reperes strong { font-variant-numeric: tabular-nums; font-size: .92rem; white-space: nowrap; }
.fiche-reperes small { grid-column: 1 / -1; color: var(--second); font-size: .71rem; margin-top: -.15rem; }
.radar-repli summary { cursor: pointer; padding: 1rem 1.25rem; font-weight: 700;
  color: var(--accent); list-style: revert; }
.radar-repli summary small { display: block; font-weight: 400; color: var(--second);
  font-size: .76rem; margin-top: .15rem; }
.radar-repli[open] summary { border-bottom: 1px solid var(--trait); }
@media (max-width: 900px) {
  .fiche-acces-corps { grid-template-columns: 1fr; }
  .fiche-poles { border-left: 0; border-top: 1px solid var(--trait); }
}
/* Une marque survolée grossit : le geste doit se voir avant le clic. */
.carte-calque .marque { transition: r .09s ease-out, stroke-width .09s ease-out; }
/* `r` en CSS ne vaut qu'au survol : hors survol, c'est l'attribut posé par le
   script qui commande, et l'échelle du zoom reste la sienne. */
.carte-calque .marque:hover { stroke: #fff; stroke-width: 2.6; r: 8; }
.carte-calque .marque.choisie { r: 8; }
/* Le titre de chaque base de calcul, dans le panneau de nue-propriété. */
.fiche-base { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--second); font-weight: 800; margin: 1.1rem 1.25rem .3rem; }
.radar-recalculer { margin: 0; }
/* Le chapeau d'un panneau : ce qu'on regarde, et pourquoi ça compte. Sans lui,
   un tableau de chiffres reste un tableau de chiffres. */
.panneau-chapeau { margin: 0; padding: .9rem 1.25rem 0; max-width: 54rem;
  font-size: .86rem; line-height: 1.55; color: #4b5b68; }
.panneau-chapeau strong { color: var(--encre); font-weight: 650; }
/* ---------- « Ce qu'il faut retenir » : la seule page qu'on lira vraiment ---------- */
.retenir { margin-bottom: 1.1rem; border-top: 3px solid var(--accent); }
.retenir-verdict { margin: 0; padding: 1.1rem 1.25rem .2rem; font-size: 1.04rem; line-height: 1.55; }
.retenir-verdict strong { font-size: .74rem; letter-spacing: .09em; text-transform: uppercase;
  padding: .2rem .5rem; border-radius: 5px; margin-right: .5rem; vertical-align: .1rem; }
.retenir-axes { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: .2rem 1.6rem; padding: 1rem 1.25rem .4rem; }
.axe { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .1rem .6rem;
  padding: .35rem 0; }
.axe-nom { font-size: .82rem; color: var(--encre); }
.axe-nom small { display: block; font-size: .68rem; color: var(--second); }
.axe-barre { grid-column: 1 / -1; grid-row: 2; height: .34rem; border-radius: 999px;
  background: var(--perle); overflow: hidden; }
.axe-barre i { display: block; height: 100%; border-radius: 999px; background: var(--serie-1); }
.axe strong { font-variant-numeric: tabular-nums; font-size: .95rem; }
.retenir-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.6rem;
  padding: .8rem 1.25rem 1.3rem; }
.retenir-colonnes h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--second); font-weight: 800; margin: .6rem 0 .5rem; }
.retenir-colonnes ul { list-style: none; margin: 0; padding: 0; }
.retenir-colonnes li { padding: .42rem 0 .42rem .95rem; border-bottom: 1px solid #eef1f4;
  position: relative; }
.retenir-colonnes li::before { content: ""; position: absolute; left: 0; top: .78rem;
  width: .38rem; height: .38rem; border-radius: 50%; background: var(--gain); }
.retenir-colonnes ul.pese li::before { background: var(--alerte); }
.retenir-colonnes li:last-child { border-bottom: 0; }
.retenir-colonnes strong { display: block; font-size: .85rem; font-weight: 650; }
.retenir-colonnes span { display: block; font-size: .78rem; color: var(--second); line-height: 1.4; }
@media (max-width: 900px) {
  .retenir-colonnes { grid-template-columns: 1fr; }
}
/* ---------- Les profils métier : pour qui l'étude est faite ----------
   Carte = un <label class="radar-profil"> cliquable, radio en coin
   (haut-gauche), contenu dans un <span> : titre, description, ligne
   « N sections ». Grille 3 colonnes, puis 2, puis 1 (charte §refonte). */
.radar-profils { flex: 1 0 100%; border: 0; margin: .4rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.radar-profils legend { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--texte-2); font-weight: 700; padding: 0; margin-bottom: .5rem; }
.radar-profil { display: flex; gap: .5rem; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--filet); border-radius: 10px; padding: .9rem 1rem;
  background: var(--surface); }
.radar-profil:hover,
.radar-profil:has(input:checked) { border-color: var(--serie-1);
  background: var(--serie-1-fond); box-shadow: 0 0 0 1px var(--serie-1); }
.radar-profil input[type="radio"] { width: auto; flex: none; margin: .15rem 0 0;
  accent-color: var(--serie-1); }
.radar-profil span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.radar-profil strong { display: block; font-size: .85rem; color: var(--texte); }
.radar-profil small { display: block; font-size: .73rem; color: var(--texte-2); line-height: 1.35;
  margin: .1rem 0 .2rem; }
.radar-profil em { display: block; font-size: .68rem; font-style: normal; color: var(--texte-3); }
@media (max-width: 900px) {
  .radar-profils { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .radar-profils { grid-template-columns: 1fr; }
}
.fiche-profil { margin: 0 0 .8rem; padding: .55rem .9rem; border-radius: 8px;
  background: var(--perle); border-left: 3px solid var(--accent); font-size: .82rem;
  color: var(--second); max-width: 60rem; }
.fiche-profil strong { color: var(--encre); }
/* Note discrète sous un seuil de réglage (radar_reglages.html), et sous une
   analyse en cours ailleurs : texte en italique, encre la plus pâle. */
.volet-attente { margin: .5rem 0 0; font-size: .78rem; color: #93a5af; }
/* ---------- L'export des données ---------- */
.export-liens { display: flex; flex-wrap: wrap; gap: .6rem; padding: 1rem 1.25rem; }
/* ---------- La fiche mise au propre ----------
   Une étude fait dix écrans. Trois choses la rendaient brouillonne : aucun
   repère pour s'y déplacer, des chapeaux qui expliquaient la section au lieu de
   l'annoncer, et des panneaux tous de même poids. */
.fiche-sommaire { position: sticky; top: 0; z-index: 6; display: flex; flex-wrap: wrap;
  gap: .15rem; margin: 0 0 1rem; padding: .5rem .2rem; background: var(--bg);
  border-bottom: 1px solid var(--trait); }
.fiche-sommaire a { font-size: .78rem; font-weight: 600; color: var(--second);
  text-decoration: none; padding: .3rem .6rem; border-radius: 999px; white-space: nowrap; }
.fiche-sommaire a:hover { background: #fff; color: var(--encre); box-shadow: 0 1px 3px rgba(17,45,70,.1); }
/* L'explication : disponible, jamais imposée. */
.pourquoi { margin: .15rem 1.25rem .2rem; max-width: 54rem; }
.pourquoi > summary { cursor: pointer; font-size: .76rem; font-weight: 600;
  color: var(--accent); list-style: none; padding: .15rem 0; }
.pourquoi > summary::-webkit-details-marker { display: none; }
.pourquoi > summary::before { content: "＋ "; font-weight: 700; }
.pourquoi[open] > summary::before { content: "－ "; }
.pourquoi > div { font-size: .8rem; line-height: 1.55; color: var(--second);
  padding: .35rem 0 .2rem; border-left: 2px solid var(--trait); padding-left: .7rem;
  margin-top: .3rem; }
.pourquoi strong { color: var(--encre); font-weight: 650; }
.pourquoi code { background: var(--perle); padding: .05rem .3rem; border-radius: 4px;
  font-size: .95em; }
/* Le chapeau redevient une annonce : une phrase, plus courte que le panneau. */
.panneau-chapeau { font-size: .84rem; }
@media (max-width: 620px) {
  .fiche-sommaire { overflow-x: auto; flex-wrap: nowrap; }
}
/* Une note assise sur la moitié de ses critères doit le dire. */
.axe-partiel { font-style: normal; color: var(--engage); font-weight: 600; }
/* ---------- Les réglages du moteur ---------- */
.reglages-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: .7rem; padding: .9rem 1.25rem 1.2rem; }
.reglage { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--trait);
  border-radius: 9px; padding: .55rem .7rem; background: #fff; }
.reglage > span { flex: 1; font-size: .82rem; color: var(--second); }
.reglage input { width: 5rem; text-align: right; font-variant-numeric: tabular-nums; }
.reglage small { color: var(--second); font-size: .75rem; }
.total-faux { color: var(--alerte); font-weight: 700; }
.reglages-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  margin: 1.1rem 0 2rem; }
.reglages-actions small { color: var(--second); font-size: .78rem; }
.reglages-actions code { background: var(--perle); padding: .1rem .35rem; border-radius: 4px; }
.radar-compte { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: 0; }
/* Calendrier des ventes : deux barres a la meme echelle, l'une sous l'autre.
   On lit la hauteur relative d'un coup d'oeil, sans chiffre a comparer. */
table.cadence td.barre-cellule { width: 34%; min-width: 160px; padding: 6px 12px; }
table.cadence .barre-ventes,
table.cadence .barre-annulations {
  display: block; height: 9px; border-radius: 5px; min-width: 2px;
}
table.cadence .barre-ventes { background: var(--serie-1); }
table.cadence .barre-annulations { background: var(--serie-2); margin-top: 3px; }
table.cadence tr.periode-vide td { opacity: .45; }
/* Fiche programme. La grille des reglages est faite pour des cases et des
   nombres ; ici on saisit des phrases et des adresses, il faut de la largeur. */
.fiche-grille {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 1rem 1.4rem; padding: 1rem 1.25rem 1.3rem;
}
.fiche-champ {
  display: flex; flex-direction: column; gap: .3rem; align-items: stretch;
  border: 1px solid var(--trait); border-radius: 9px; padding: .7rem .85rem;
  background: #fff;
}
.fiche-champ.pleine-largeur { grid-column: 1 / -1; }
.fiche-champ > label {
  font-size: .82rem; font-weight: 600; color: var(--encre);
  display: flex; gap: .5rem; align-items: baseline;
}
.fiche-champ > label small { font-weight: 400; color: var(--second); font-size: .74rem; }
.fiche-champ input, .fiche-champ textarea {
  font: inherit; font-size: .85rem; padding: .45rem .6rem; width: 100%;
  border: 1px solid var(--trait); border-radius: 6px; box-sizing: border-box;
  text-align: left; background: #fff;
}
.fiche-champ textarea { resize: vertical; line-height: 1.5; }
.fiche-champ.vide { border-color: #e2b98a; background: #fffdf8; }
.fiche-champ .propose {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 6px; font-size: 12px; color: #5a6b76;
  /* Sans cela, une proposition longue (une adresse, un texte de presentation)
     pousse la grille et fait deborder la page en largeur. */
  min-width: 0;
}
.fiche-champ .propose > span { flex: none; }
.fiche-champ .propose code {
  background: #eef3f6; padding: 2px 6px; border-radius: 4px;
  flex: 1 1 8rem; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.galerie { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 20px 16px; }
.galerie-choix { margin: 0; }
.galerie-choix button {
  padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  background: none; cursor: pointer; display: block; line-height: 0;
}
.galerie-choix button:hover { border-color: var(--accent, #186A8A); }
.galerie-choix img { width: 190px; height: 120px; object-fit: cover; display: block; }
.galerie-choix span {
  display: block; line-height: 1.6; font-size: 12px; padding: 4px;
  background: var(--bg-2); color: var(--ink);
}
/* ---------- La page Comptes : un rôle, des outils, par personne ----------
   Chaque ligne est un petit formulaire : le nom, le rôle et les outils se
   règlent côte à côte et s'enregistrent d'un seul bouton. Les cases doivent
   rester lisibles dans une cellule étroite, d'où la colonne compacte. */
.acces-outils { display: flex; flex-direction: column; gap: .22rem; }
.acces-outils label { font-size: .8rem; display: inline-flex; align-items: center;
  gap: .35rem; white-space: nowrap; color: var(--second); cursor: pointer; }
.acces-outils input { min-width: 0; margin: 0; }
.champ-nom { margin-top: .3rem; width: 100%; min-width: 9rem; padding: .35rem .5rem; font-size: .82rem; }
.champ-email { margin-top: .3rem; width: 100%; min-width: 12rem; padding: .35rem .5rem; font-size: .78rem; }
.champ-profil-tori { display: flex; flex-direction: column; gap: .25rem; margin-top: .55rem; }
.champ-profil-tori span { color: var(--texte-2); font-size: .7rem; font-weight: 700; }
.champ-profil-tori select { width: 100%; min-width: 10rem; font-size: .78rem; }
.actions-compte { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
/* Le compte de présentation, ouvert pour une démonstration (D-80) : son état, puis la durée et
   les deux boutons, sous le rôle. */
.demonstration-compte { display: flex; flex-direction: column; gap: .35rem; margin-top: .55rem; }
.demonstration-activer { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.demonstration-activer select { font-size: .78rem; }
.acces-outils-creation { border: 1px solid var(--trait); border-radius: 8px;
  padding: .55rem .7rem; margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.acces-outils-creation legend { font-size: .78rem; font-weight: 700; color: var(--muted);
  padding: 0 .3rem; }
/* `.formulaire-compte label` empile ses champs en colonne ; une case à cocher
   et son nom, eux, vont sur une seule ligne. */
.acces-outils-creation label { font-size: .85rem; display: flex; flex-direction: row;
  align-items: center; gap: .4rem; cursor: pointer; }
.acces-outils-creation input { flex: none; }
/* La liste des comptes porte cinq colonnes réglables : elle mérite plus de
   place que le formulaire de création, qui n'en demande qu'une. */
.grid-comptes { grid-template-columns: 2.1fr 1fr; }
.acces-outils-creation small { color: var(--second); font-size: .74rem; margin-top: .15rem; }
/* Chaque sujet tient sur une ligne, et ne se déplie que si on le demande.
   Cinq tableaux ouverts d'affilée, personne ne les lit. */
details.sujet {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: .6rem; box-shadow: var(--shadow); overflow: hidden;
}
details.sujet > summary {
  display: flex; align-items: center; gap: .8rem; padding: .85rem 1.1rem;
  cursor: pointer; list-style: none; font-size: 1rem;
}
details.sujet > summary::-webkit-details-marker { display: none; }
details.sujet > summary::after {
  content: "déplier"; margin-left: auto; color: var(--accent);
  font-size: .78rem; font-weight: 700;
}
details.sujet[open] > summary::after { content: "replier"; }
details.sujet > summary:hover { background: #f8fbfc; }
.sujet-nombre {
  min-width: 2.4rem; text-align: center; font-weight: 800; font-size: 1.15rem;
  color: #fff; background: var(--accent); border-radius: 6px; padding: .15rem .4rem;
}
.sujet-titre { font-weight: 700; color: var(--encre); }
.sujet-valeur { color: var(--second); font-size: .85rem; }
/* Blanc sur #9fb3bf ne donnait que 2,17:1 : le plancher des encres, 5,3:1. */
details.sujet.constat .sujet-nombre { background: var(--texte-3); }


/* ============================================================================
   SURCHARGES PREMIUM (fin de fichier : gagnent sur les règles héritées ci-dessus)
   ============================================================================ */

/* ---------- Tuiles (KPI) épurées ---------- */
.tuiles{gap:14px;margin-bottom:20px}
.tuile{padding:16px 18px;border-radius:var(--r-md);background:var(--paper);border:1px solid var(--line);border-top:1px solid var(--line);box-shadow:var(--sh-sm);gap:6px}
.tuile-titre{font-size:11px;letter-spacing:.06em;color:var(--muted);font-weight:700;text-transform:uppercase}
.tuile strong{font-size:1.85rem;color:var(--ink);letter-spacing:-.022em;font-variant-numeric:tabular-nums}
.tuile-detail{font-size:.78rem;color:var(--muted)}
.tuile.gain,.tuile.engage,.tuile.stock,.tuile.neutre,.tuile.alerte{background:var(--paper)}
.tuile.gain{border-top:2px solid var(--green)}
.tuile.gain strong{color:var(--green)}
.tuile.engage{border-top:2px solid var(--amber)}
.tuile.engage strong{color:var(--amber)}
.tuile.alerte{border-top:2px solid var(--red)}
.tuile.alerte strong{color:var(--red)}
.tuile.stock{border-top:2px solid var(--accent)}
.tuile.neutre{border-top:2px solid var(--line-strong)}
.tuile.ouvrable{padding:0}
.tuile-declencheur{padding:16px 18px;border-radius:var(--r-md)}
.tuile-declencheur:hover{background:var(--accent-soft)}
.tuile-appel{color:var(--accent);font-weight:700}

.astuce{font-size:.82rem;color:var(--text);background:var(--accent-soft);border-left:3px solid var(--accent);padding:.6rem .85rem;border-radius:0 var(--r-sm) var(--r-sm) 0;margin:0 0 1.2rem}


/* ---------- Connexion ---------- */
.page-connexion{display:flex;align-items:center;justify-content:center;min-height:100vh;
  background:var(--deep);
  padding:24px}
.cadre-connexion{width:min(410px,92vw);background:var(--paper);border-radius:var(--r-xl);padding:2.2rem 2.1rem;
  box-shadow:0 40px 90px -30px rgba(0,0,0,.55),0 2px 0 rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.06)}
.logo-connexion{height:30px;margin-bottom:1.4rem}
.cadre-connexion h1{font-size:1.45rem;margin:0 0 1.2rem;letter-spacing:-.02em}
.cadre-connexion .explication{color:var(--muted);line-height:1.55;font-size:.9rem}
.formulaire-connexion{display:flex;flex-direction:column;gap:1rem;margin:0}
.formulaire-connexion label{display:flex;flex-direction:column;gap:.35rem}
.formulaire-connexion label span{font-size:.78rem;font-weight:650;color:var(--muted)}
.formulaire-connexion .button.primary{margin-top:.3rem;justify-content:center;padding:11px}

/* ---------- Barre d'attente (traitement long) : accent bleu ---------- */
.attente-barre{background:linear-gradient(90deg,var(--accent-soft),var(--accent),var(--accent-soft));background-size:40% 100%;background-repeat:no-repeat}
.attente-texte{box-shadow:var(--sh-md)}
.attente-texte::before{border:2px solid var(--accent-soft-2);border-top-color:var(--accent)}

/* ---------- Sélecteur d'année (Ventes) ---------- */
.annees .annee{border-radius:var(--pill)}
/* L'année choisie : texte blanc sur le bleu de charte, survol compris (le texte
   restait gris sur bleu, illisible). */
.annees .annee.actif,.annees .annee.actif:hover{background:var(--accent);border-color:var(--accent);color:#fff}
.annees .annee:hover{border-color:var(--accent);color:var(--accent)}




/* ---------- Calendrier : projection d'atterrissage & comparatif YoY ---------- */
.calendrier-projections{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px;margin:20px 0}
.projection{background:linear-gradient(150deg,var(--deep) 0%,var(--deep-2) 100%);color:#fff;border-radius:var(--r-md);padding:20px 22px;box-shadow:var(--sh-md);border:1px solid rgba(255,255,255,.06)}
.projection .tete{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
.projection .eyebrow{color:#7FB2FF;margin:0}
.projection .repere{font-size:.72rem;background:rgba(255,255,255,.10);padding:3px 9px;border-radius:var(--pill);color:#CBD5E1;white-space:nowrap}
.projection .montant{font-size:1.9rem;font-weight:800;letter-spacing:-.022em;margin:2px 0;font-variant-numeric:tabular-nums}
.projection .detail{font-size:.84rem;color:#9FB2CC;line-height:1.5}
.projection .detail strong{color:#fff;font-weight:650}
.projection .detail .rythme{color:#7FB2FF}
.comparatif{background:var(--paper);border:1px solid var(--line);border-radius:var(--r-md);padding:18px 20px;box-shadow:var(--sh-sm)}
.comparatif .tete{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}
.comparatif .tete .eyebrow{margin:0}
.comparatif .tete small{color:var(--muted);font-weight:500}
.comparatif table{font-size:.84rem}
.comparatif th,.comparatif td{padding:6px 8px}
.comparatif tr.actuelle td{font-weight:700;background:var(--accent-soft)}
.comparatif .yoy-pos{color:var(--green);font-weight:700}
.comparatif .yoy-neg{color:var(--red);font-weight:700}
.comparatif .yoy-nc{color:var(--faint)}
.annee-separateur td{background:var(--bg-2);font-weight:700;color:var(--ink);border-top:2px solid var(--line-strong);border-bottom:1px solid var(--line);padding:.6rem 1rem;text-transform:none;letter-spacing:0}
.annee-separateur small{font-size:.8rem;font-weight:400;color:var(--muted)}

/* ============================================================================
   LE CADRE DU PORTAIL — le rail, la zone de travail et l'en-tête de toutes les
   pages, noyau et modules (`base_portail.html` ; macros `rail`, `menu_compte`,
   `fil_ariane` de `_macros.html`).
   Le rail : la marque, l'accueil, une entrée par module ouvert au compte (celle
   de la page affichée dépliée sur ses groupes et ses pages, en retrait sous un
   filet), l'administration ; en bas, l'aide et le compte, dont le menu s'ouvre
   au-dessus. L'en-tête : fil d'Ariane, titre, ligne de contexte, actions.
   ============================================================================ */
:root{ --rail-w:248px; }
body.coque{min-height:100vh;background:var(--plan)}

/* Le lien d'évitement : hors de l'écran tant qu'on n'y arrive pas au clavier. */
.lien-evitement{position:absolute;left:12px;top:-64px;z-index:60;padding:10px 14px;border-radius:8px;
  background:var(--surface);color:var(--encre);font-weight:700;text-decoration:none;box-shadow:var(--shadow-lg)}
.lien-evitement:focus{top:12px}

/* — Le rail — */
.rail{position:fixed;top:0;left:0;bottom:0;width:var(--rail-w);background:var(--side);color:var(--side-text);
  display:flex;flex-direction:column;z-index:40;border-right:1px solid var(--side-line)}
.rail-marque{display:flex;align-items:center;gap:12px;padding:20px 18px 14px;text-decoration:none}
.rail-logo{background:#fff;border-radius:10px;padding:9px 13px;display:inline-flex;align-items:center;box-shadow:0 6px 16px -6px rgba(0,0,0,.5)}
.rail-logo img{height:24px;width:auto;display:block}
.rail-marque .sec{font-family:var(--font-titre);color:var(--side-text-strong);font-weight:700;font-size:13px;text-transform:uppercase;letter-spacing:.14em}
.rail-bascule{position:absolute;opacity:0;pointer-events:none}
.rail-bouton{display:none}
.rail-nav{display:flex;flex-direction:column;gap:2px;padding:6px 12px 10px;flex:1 1 0;min-height:0;overflow-y:auto;scrollbar-width:thin}
.rail-sec{margin:0;padding:14px 12px 6px;font-size:10.5px;text-transform:uppercase;letter-spacing:.09em;color:#b9c7d3;font-weight:700}
.rail-lien{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:9px;color:var(--side-text);
  text-decoration:none;font-weight:600;font-size:13.5px;transition:background .12s,color .12s;white-space:nowrap}
.rail-lien svg{width:18px;height:18px;flex:0 0 auto;opacity:.85}
.rail-lien:hover{background:var(--side-2);color:var(--side-text-strong)}
.rail-lien.actif{background:var(--side-active);color:#fff}
.rail-lien.actif svg{opacity:1}

/* Un module : son entrée ; s'il porte la page affichée, ses groupes et ses pages en
   retrait, sous un filet qui descend de son icône. */
.rail-module,.rail-administration{display:flex;flex-direction:column;gap:2px}
.rail-lien-module.courant{color:#fff}
.rail-lien-module.courant svg{opacity:1}
.rail-pages{display:flex;flex-direction:column;gap:1px;margin:2px 0 8px 21px;padding-left:9px;border-left:1px solid var(--side-line)}
.rail-pages .rail-sec{padding:10px 10px 4px}
.rail-pages .rail-lien{gap:10px;padding:8px 10px;font-size:13px;line-height:1.3;white-space:normal}
.rail-pages .rail-lien svg{width:16px;height:16px}
.rail-administration{margin-top:6px}

/* — Le pied du rail : l'aide, puis le compte — */
.rail-pied{flex:none;display:flex;flex-direction:column;gap:2px;padding:8px 12px 12px;border-top:1px solid var(--side-line)}
.menu-compte{position:relative}
.rail-user{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:9px;cursor:pointer;list-style:none;color:var(--side-text)}
.rail-user::-webkit-details-marker{display:none}
.rail-user:hover,.menu-compte[open] > .rail-user{background:var(--side-2)}
.rail-user .avatar{width:34px;height:34px;flex:0 0 auto;border-radius:9px;display:grid;place-items:center;font-weight:700;font-size:12.5px;color:#fff;background:var(--side-3)}
.rail-user .txt{display:flex;flex-direction:column;flex:1;min-width:0}
/* Le nom et le rôle passent à la ligne plutôt que d'être coupés (« Gér… ») : la place du
   pied du rail varie avec la largeur, le nom d'une personne ne se tronque pas. */
.rail-user .nom{color:#fff;font-weight:650;font-size:13px;line-height:1.25;overflow-wrap:anywhere}
.rail-user .meta{color:var(--side-text);font-size:11px;line-height:1.3;overflow-wrap:anywhere}
.rail-user > svg{width:16px;height:16px;flex:0 0 auto;opacity:.75}
/* Le menu du compte : un panneau clair posé au-dessus du pied, sur le rail. */
.menu-compte-liste{position:absolute;left:0;right:0;bottom:calc(100% + 8px);z-index:45;display:flex;flex-direction:column;gap:2px;
  padding:8px;background:var(--surface);border:1px solid var(--filet);border-radius:12px;box-shadow:var(--shadow-xl)}
.menu-compte-lien{display:flex;align-items:center;gap:10px;min-height:40px;padding:6px 10px;border-radius:8px;
  color:var(--texte);text-decoration:none;font-size:13px;font-weight:600}
.menu-compte-lien svg{width:16px;height:16px;flex:0 0 auto;color:var(--texte-3)}
.menu-compte-lien span{display:flex;flex-direction:column}
.menu-compte-lien small{font-size:11px;font-weight:500;color:var(--texte-3)}
.menu-compte-lien:hover,.menu-compte-lien.actif{background:var(--plan);color:var(--encre)}

/* — La zone de travail : les bandeaux, l'en-tête, la page — */
.zone{margin-left:var(--rail-w);min-height:100vh;display:flex;flex-direction:column;min-width:0}
.entete{display:flex;flex-direction:column;gap:10px;max-width:1560px;padding:24px 28px 0}
.fil-ariane ol{display:flex;flex-wrap:wrap;align-items:center;margin:0;padding:0;list-style:none;font-size:12.5px;color:var(--texte-3)}
.fil-ariane li + li::before{content:"\203A";margin:0 8px;color:var(--texte-3)}
.fil-ariane a{color:var(--texte-2);text-decoration:none}
.fil-ariane a:hover{color:var(--accent);text-decoration:underline}
.fil-ariane [aria-current]{color:var(--texte);font-weight:600}
.entete-corps{display:flex;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;gap:12px 24px}
/* Une page qui garde son titre dans son contenu (Radar, l'Aide) n'a dans l'en-tête que le
   fil d'Ariane : le corps vide de l'en-tête ne laisse pas de blanc dessous. */
.entete-corps:not(:has(h1:not(:empty))):not(:has(.entete-actions:not(:empty))){display:none}
.entete-titre{flex:1 1 320px;min-width:0}
.entete-titre h1{margin:0;font-family:var(--font-display);font-size:1.5rem;font-weight:700;line-height:1.2;color:var(--encre);letter-spacing:-.015em}
.entete-titre h1:empty{display:none}
.entete-note{margin-top:4px;font-size:.84rem;color:var(--texte-2)}
.entete-note:empty{display:none}
.entete-note p{margin:2px 0 0}
/* La ligne de contexte se lit d'un seul ton : l'ancien sourcil (`.eyebrow`) que des
   pages y posent n'y passe plus en capitales. */
.entete-note .eyebrow{margin:2px 0 0;font-family:inherit;font-size:inherit;font-weight:500;text-transform:none;letter-spacing:0;color:inherit}
.entete-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px}
.entete-actions:empty{display:none}
/* La date des données du module, une fois, à côté de l'action qui les met à jour. */
.entete-fraicheur{margin:0;font-size:.8rem;font-weight:500;color:var(--texte-3);white-space:nowrap}
.entete-fraicheur[title]{cursor:help}
.entete-fraicheur.ancienne{color:#8a4b06;font-weight:650}
/* Sans les identifiants Tor-i, l'administrateur lit l'état de la synchronisation, sans bouton. */
.entete-etat{margin:0;font-size:.8rem;font-weight:600;color:var(--texte-2);white-space:nowrap}
.entete form{margin:0}
.entete .button{white-space:nowrap}
body.coque main{flex:1;width:100%;max-width:1560px;margin:0;padding:20px 28px 56px}

@media(max-width:1100px){
  .entete{padding:20px 20px 0}
  body.coque main{padding:18px 20px 40px}
}

/* — Sur téléphone, le rail devient un bandeau en tête de page — */
@media(max-width:760px){
  /* Une colonne : la marque, la navigation, puis l'aide et le compte. En colonne, la
     navigation (des liens sans retour à la ligne) doit prendre la largeur du rail et
     défiler dans son propre cadre : sans `align-items: stretch` ni `flex-wrap: nowrap`,
     elle gardait sa largeur maximale, 1 500 à 2 600 px selon le profil, et c'est la page
     entière qui défilait de côté (constat du 09/10/2026). */
  /* `relative` et non `static` : le rail forme son propre plan (`view-transition-name`) ;
     sans rang au-dessus de la page, le menu du compte ouvert passait sous ses cartes. */
  .rail{position:relative;z-index:50;width:auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch;bottom:auto;border-right:0}
  .rail-marque{padding:14px 16px 8px}
  /* Le menu est replié derrière le bouton « Menu » ; ouvert, il reprend la colonne du bureau. */
  .rail-bouton{display:flex;position:absolute;top:18px;right:16px;align-items:center;padding:8px 14px;border:1px solid var(--side-line);border-radius:8px;color:#fff;font-size:13px;font-weight:650;cursor:pointer}
  .rail-bascule:focus-visible ~ .rail-bouton{outline:2px solid #fff;outline-offset:2px}
  .rail-bascule:checked ~ .rail-bouton{background:var(--side-line)}
  .rail-nav{display:none;flex:none;padding:4px 10px 8px;max-height:65vh}
  .rail-bascule:checked ~ .rail-nav{display:flex}
  .rail-pied{flex-direction:row;align-items:center;justify-content:space-between;gap:8px;padding:6px 10px}
  /* L'aide garde sa taille ; le compte prend le reste, et son nom passe à la ligne. */
  .rail-pied > .rail-lien{flex:none}
  .menu-compte{flex:0 1 auto;min-width:0}
  .menu-compte-liste{left:auto;right:0;bottom:auto;top:calc(100% + 6px);width:min(300px, calc(100vw - 24px))}
  .zone{margin-left:0}
  .entete{padding:18px 16px 0}
  .entete-titre h1{font-size:1.3rem}
  body.coque main{padding:16px 16px 40px}
}

/* ---- Raccords palette d'origine (teal/bleu nuit) ---- */
.page-connexion{background:var(--side)}
.logo-connexion{height:30px;margin-bottom:.5rem}
.sous-marque{margin:0 0 1.5rem;font-size:.72rem;font-weight:600;letter-spacing:.09em;text-transform:uppercase;color:var(--muted)}

/* ============================================================================
   TABLEAU DE BORD — grille à deux colonnes, carte de France
   ============================================================================ */
.dash-grid{display:grid;grid-template-columns:1.5fr 1fr;gap:18px;margin-bottom:18px}
@media(max-width:1050px){.dash-grid{grid-template-columns:1fr}}

/* Carte de France */
.carte-fr{display:block;width:100%;max-width:340px;height:auto}
.carte-fr circle{transition:opacity .12s}

.entete .button.primary svg{width:15px;height:15px}

/* ============================================================================
   FICHE PROGRAMME (p2) — en-tête, KPIs, stock par étage, fourchettes de prix
   ============================================================================ */
.prog-meta{margin:.6rem 0 0;color:var(--muted);font-size:13.5px;display:flex;gap:8px;flex-wrap:wrap;align-items:center}

.legende{display:flex;align-items:center;gap:16px;padding:12px 20px 0;font-size:12.5px;color:var(--muted);font-weight:600}
.legende .pastille{width:11px;height:11px;border-radius:3px;display:inline-block;margin-right:5px;vertical-align:-1px}
.pastille.option{background:var(--amber)}

/* ---- Analyse des prix : barres horizontales de prix/m² ---- */
.barres-prix{padding:16px 20px 20px;display:flex;flex-direction:column;gap:12px}
.bp-ligne{display:grid;grid-template-columns:9.5rem 1fr 5.5rem 3.5rem;align-items:center;gap:12px}
.bp-nom{font-size:13px;font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bp-nom small{color:var(--muted);font-weight:500}
.bp-piste{height:14px;background:var(--bg-2);border-radius:5px;overflow:hidden}
.bp-barre{display:block;height:100%;background:var(--data-blue);border-radius:5px;min-width:3px}
.bp-val{font-weight:700;color:var(--ink);text-align:right;font-size:13px;font-variant-numeric:tabular-nums}
.bp-n{font-size:12px;color:var(--muted);text-align:right}

/* ==========================================================
   REFONTE VISUELLE — COMPOSANTS SPECIFIQUES DES MAQUETTES
   ========================================================== */

/* Fiche Programme (Maquette p. 2) */

.prog-en-tete {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--filet);
  padding: 24px;
  margin-bottom: 20px;
}

.prog-titre-ligne {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}
.prog-titre-ligne h1,
.prog-titre-ligne h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--encre);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Sur téléphone, le titre (avec ses pastilles) et la valeur du stock passent à la ligne :
   en rangée, le titre gardait la largeur de toutes ses pastilles et sortait de l'écran. */
@media (max-width: 760px) {
  .prog-titre-ligne { flex-wrap: wrap; }
  .prog-titre-ligne h1,
  .prog-titre-ligne h2 { flex-wrap: wrap; }
}

.prog-valeur-hero {
  text-align: right;
}

.prog-valeur-hero small {
  display: block;
  font-size: 0.75rem;
  color: var(--texte-3);
}

.prog-valeur-hero strong {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--encre);
  font-family: var(--font-main);
}

.prog-meta {
  font-size: 0.82rem;
  color: var(--texte-2);
  margin-bottom: 20px;
}

.prog-meta span + span::before {
  content: " | ";
  color: var(--texte-3);
  margin: 0 6px;
}

.prog-kpis-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

@media (max-width: 1100px) {
  .prog-kpis-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .prog-kpis-6 { grid-template-columns: repeat(2, 1fr); }
}

.prog-kpi-boite {
  background: var(--plan);
  border: 1px solid var(--filet);
  border-radius: 8px;
  padding: 12px 14px;
}

.prog-kpi-boite .kpi-label {
  font-size: 0.72rem;
  color: var(--texte-3);
  margin-bottom: 4px;
}

.prog-kpi-boite .kpi-valeur {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--encre);
  font-family: var(--font-main);
  line-height: 1.2;
}

.prog-kpi-boite .kpi-detail {
  font-size: 0.7rem;
  color: var(--texte-2);
  margin-top: 4px;
}

/* Fourchette de prix par typologie (Chart Range) */

.fourchette-typologies {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 10px;
}

.fourchette-ligne {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fourchette-info {
  width: 140px;
  flex-shrink: 0;
}

.fourchette-info strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--encre);
}

.fourchette-info small {
  font-size: 0.72rem;
  color: var(--texte-3);
}

.fourchette-piste {
  flex-grow: 1;
  position: relative;
  height: 32px;
  display: flex;
  align-items: center;
}

.fourchette-ligne-segment {
  position: absolute;
  height: 6px;
  border-radius: 3px;
  background: var(--serie-1);
}

.fourchette-bulle-prix {
  position: absolute;
  background: var(--encre);
  color: var(--surface);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.fourchette-dispo {
  width: 70px;
  flex-shrink: 0;
  text-align: right;
  font-size: 0.78rem;
  color: var(--texte-3);
}
/* Filtres des listes (lots) et details des pages Radar — repris de la refonte
   (f08e538) : seulement les regles que la feuille n'avait pas encore. */
.filtres-barre {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--filet);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filtre-item {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Un filtre ne dépasse jamais sa barre : sans cela, la liste déroulante gardait la
     largeur de son option la plus longue (un nom de programme) et débordait de l'écran. */
  min-width: 0;
  max-width: 100%;
}

.filtre-item label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--texte-2);
}

.filtre-item select {
  min-width: 0;
  padding: 6px 12px;
  border: 1px solid var(--filet-fort);
  border-radius: 6px;
  font-size: 0.82rem;
  background: var(--surface);
  color: var(--texte);
  font-weight: 600;
}

.filtres-pousse {
  margin-left: auto;
}

.radar-lancer-champ label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--encre);
  margin-bottom: 8px;
}

.radar-lancer-champ input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--filet-fort);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--texte);
  box-sizing: border-box;
}

.fiche-sommaire {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 20px;
}

details.radar-repli {
  border: 1px solid var(--filet);
  border-radius: 8px;
  background: var(--surface);
  margin: 16px 0;
  overflow: hidden;
}

details.radar-repli summary {
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--encre);
  cursor: pointer;
  background: var(--plan);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

details.radar-repli summary small {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--texte-3);
}

.export-liens {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.export-liens .button {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 16px;
  height: auto;
  line-height: 1.35;
}

.export-liens .button small {
  font-size: 0.72rem;
  opacity: 0.8;
  font-weight: 400;
  margin-top: 3px;
}

.radar-journal li {
  padding: 4px 0;
  color: var(--texte-2);
  border-bottom: 1px solid var(--filet);
}

.radar-journal li:last-child {
  border-bottom: none;
}

/* Accessibilite au clavier (repris de 37d6ca3) : un lien, un bouton ou un
   volet qui prend le focus au clavier le montre. Les champs l'avaient deja. */
a:focus-visible, button:focus-visible, .button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
.rail a:focus-visible, .rail button:focus-visible, .rail summary:focus-visible { outline-color: var(--ciel); }
.menu-compte-liste a:focus-visible { outline-color: var(--accent); }

/* Relecture page par page (repris de 5b37765). */
/* La ligne survolee prend un lisere a gauche : l'oeil la suit jusqu'au bout. */
tbody tr:hover > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* Un texte d'explication qui court sur 1 400 px ne se lit pas. */
.astuce, .resume { max-width: 88ch; }
/* Une ancre ne se cache pas derriere la barre collante. */
[id] { scroll-margin-top: 92px; }

/* ---------- Tendances : la courbe des lots à vendre et les derniers relevés (historique.py) ---------- */
.tendances-corps { padding: 18px 24px 22px; }
.tendances-note { margin: 10px 0 0; color: var(--texte-2); }
.tendances-texte { color: var(--texte-2); }
.tendances-discret { color: var(--texte-3); }
.tendances-nombre { text-align: right; }

/* ---------- Journal des mouvements et série du stock (M13, evenements.py, historique.py) ---------- */
.tuiles-journal { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) { .tuiles-journal { grid-template-columns: 1fr; } }
.journal td small.block { color: var(--texte-3); }
.journal-pages { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-size: 0.8rem; color: var(--texte-2); }
.serie-svg { display: block; width: 100%; height: auto; margin-top: 6px; }
svg .serie-base { fill: var(--filet-fort); }
svg .serie-valeur, svg .serie-axe { font-size: 9px; text-anchor: middle; font-variant-numeric: tabular-nums; }
svg .serie-valeur { fill: var(--texte-2); }
svg .serie-axe { fill: var(--texte-3); }

/* Utilitaires issus des anciens style="..." en ligne (CSP style-src fermee le 26/09/2026).
   Une propriete par classe, nommee <prefixe>-<propriete>-<valeur>. !important : un style
   en ligne l'emportait sur toute regle de feuille, l'utilitaire doit faire pareil.
   Raccourcis avant proprietes detaillees (margin avant margin-top) : l'ordre compte. */
.u-display-flex { display: flex !important; }
.u-gap-10px { gap: 10px !important; }
.u-gap-14px { gap: 14px !important; }
.u-gap-6px { gap: 6px !important; }
.u-margin-0 { margin: 0 !important; }
.u-padding-14px-0 { padding: 14px 0 !important; }
.u-width-100pc { width: 100% !important; }
.u-align-items-center { align-items: center !important; }
.u-flex-wrap-wrap { flex-wrap: wrap !important; }
.u-justify-content-center { justify-content: center !important; }
.u-margin-bottom-20px { margin-bottom: 20px !important; }
.u-min-width-160px { min-width: 160px !important; }
.u-min-width-220px { min-width: 220px !important; }

/* Changement de page sans flash blanc (navigateurs recents : Chrome, Edge,
   Safari 18.2) : la page suivante se fond dans la precedente, et le rail de
   gauche reste en place. Rien pour qui demande moins d'animations. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .rail { view-transition-name: rail; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 140ms; }
}

/* ============================================================================
   Simulateur de vue / Changement de profil pour Administrateur
   ============================================================================ */

/* Le choix de vue, en tête du menu du compte de l'administrateur : quatre
   boutons sur deux rangs, la vue active en aplat (encre, ou ambre foncé tant
   qu'une vue est empruntée, comme le bandeau de la vue empruntée). */
.rail-simul-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 4px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--filet);
}
.rail-simul-titre {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texte-3);
}
.rail-simul-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.rail-btn-role {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--filet);
  border-radius: 7px;
  background: var(--surface);
  color: var(--texte);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.rail-btn-role:hover {
  border-color: var(--accent);
  color: var(--encre);
}
.rail-btn-role.actif {
  background: var(--encre);
  border-color: var(--encre);
  color: #ffffff;
}
.rail-simul-box.is-simule .rail-btn-role.actif {
  background: var(--engage);
  border-color: var(--engage);
}

/* Bandeau d'alerte simulation en haut de page */
.bandeau-alerte-simulation {
  background: var(--amber-soft, #fceed9);
  color: var(--amber-ink, #b45309);
  border-bottom: 1px solid #fde68a;
  padding: 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  position: relative;
  z-index: 50;
}

/* Une prévisualisation doit être impossible à confondre avec le portail officiel. */
.bandeau-environnement {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 8px 18px;
  background: var(--amber-soft, #fceed9);
  border-bottom: 1px solid #fde68a;
  color: var(--amber-ink, #92400e);
  font-size: 12px;
  text-align: center;
}
.bandeau-environnement strong {
  text-transform: uppercase;
  letter-spacing: .06em;
}
.bandeau-environnement-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.cadre-connexion .bandeau-environnement {
  margin: 0 0 18px;
  border: 1px solid #fde68a;
  border-radius: 8px;
}
.bandeau-simul-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bandeau-simul-badge {
  background: var(--amber, #d97706);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}
.bandeau-simul-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bandeau-simul-txt {
  font-size: 11.5px;
  color: var(--amber-ink, #b45309);
}
.bandeau-btn-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #f59e0b;
  color: #92400e;
  text-decoration: none;
}
.bandeau-btn-switch:hover {
  background: #ffffff;
  color: #78350f;
}
.bandeau-btn-quitter {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--encre, #0a2d41);
  color: #ffffff !important;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.bandeau-btn-quitter:hover {
  background: #17506e;
}

/* Un changement de vue est un envoi de formulaire (POST), plus un lien : le formulaire ne fait
   pas de boîte (ses boutons restent les éléments de la grille ou de la rangée), et le bouton
   reprend de son parent ce que le lien lui donnait : police, interligne, curseur. La vue active
   (un `span`) n'est pas cliquable : seuls les boutons ont la main. */
.form-vue {
  display: contents;
}
button.rail-btn-role,
button.bandeau-btn-switch,
button.bandeau-btn-quitter {
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
}
/* Le bouton de retour n'a pas de bordure à lui : sans cette ligne, le navigateur lui en donne une. */
button.bandeau-btn-quitter {
  border: 0;
}

/* Bandeau lisible en visio (compte de présentation, partage d'écran). Le badge
   blanc sur --engage-marque (#d97706) ne faisait que 3,2:1 : il passe sur
   --engage (plus de 7:1). Le texte du bandeau, en ambre #b45309 sur fond ambre
   clair, était à 4,4:1 : il passe sur --engage (6,2:1). Les boutons de vue
   montent aux 44 px de la charte (docs/refonte-design.md §4). Ces classes
   servent aussi le bandeau de la vue empruntée de l'administrateur. */
.bandeau-simul-badge {
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--engage);
}
.bandeau-alerte-simulation,
.bandeau-simul-txt {
  color: var(--engage);
}
.bandeau-simul-actions .bandeau-btn-switch,
.bandeau-simul-actions .btn-vue-pill {
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
}

.btn-vue-pill {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-2, #edf1f4);
  color: var(--text, #1f3a4a);
  text-decoration: none;
  border: 1px solid var(--line);
}
.btn-vue-pill:hover {
  background: var(--paper, #ffffff);
  border-color: var(--accent);
}
.btn-vue-pill.actif {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ==========================================================================
   PAGE AIDE, GUIDE & FAQ (/aide)
   ========================================================================== */
.aide-conteneur {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.aide-hero { margin-bottom: 1.5rem; }
.carte-support {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.carte-support-tete {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.contact-ico {
  line-height: 1;
  color: #166534;
}
.carte-support-tete h2 {
  font-size: 1rem;
  color: #166534;
  margin: 0;
}
.carte-support-texte {
  font-size: 0.84rem;
  color: #1e3a2b;
  line-height: 1.45;
  margin: 0 0 1rem 0;
}
.carte-support-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.aide-sommaire {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.sommaire-pill {
  padding: 0.45rem 0.85rem;
  background: #ffffff;
  border: 1px solid var(--trait, #e2e8f0);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--encre, #0a2d41);
  text-decoration: none;
  transition: all 0.15s ease;
}
.sommaire-pill:hover {
  background: var(--fond, #f8fafc);
  border-color: var(--accent, #0f7ba8);
  color: var(--accent, #0f7ba8);
}

/* Barre de recherche dans la FAQ */
.aide-recherche { margin: 0 0 28px 0; }
.aide-recherche-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--texte-2, #4b5b68);
  margin-bottom: 6px;
}
.aide-recherche-champ {
  width: 100%;
  max-width: 540px;
  padding: 10px 14px;
  border: 1.5px solid var(--trait, #e2e8f0);
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--encre, #0a2d41);
  background: var(--fond-page, #fff);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.aide-recherche-champ:focus {
  border-color: var(--bleu-charte, #186a8a);
  box-shadow: 0 0 0 3px rgba(24,106,138,.12);
}

.faq-groupe {
  background: #ffffff;
  border: 1px solid var(--trait, #e2e8f0);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.faq-groupe-titre {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.faq-icone {
  line-height: 1;
  color: var(--accent);
}
.faq-groupe-titre h2 {
  font-size: 1.25rem;
  color: var(--encre, #0a2d41);
  margin: 0 0 0.2rem 0;
}

.tableau-roles-synthese {
  overflow-x: auto;
  margin-bottom: 1.25rem;
}
.tableau-roles-synthese table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.tableau-roles-synthese th,
.tableau-roles-synthese td {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--trait, #e2e8f0);
  text-align: left;
  line-height: 1.45;
}
.tableau-roles-synthese th {
  background: var(--fond, #f8fafc);
  color: var(--encre, #0a2d41);
  font-weight: 700;
}

.faq-item {
  border: 1px solid #edf2f7;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  background: #fafbfc;
}
.faq-item[open] {
  background: #ffffff;
  border-color: #cbd5e1;
}
.faq-item summary {
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--encre, #0a2d41);
  cursor: pointer;
  list-style: revert;
}
.faq-item summary:hover {
  color: var(--accent, #0f7ba8);
}
.faq-corps {
  padding: 0 1rem 1rem 1rem;
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.6;
}
.faq-corps p { margin: 0.4rem 0; }
.faq-corps ul, .faq-corps ol { margin: 0.4rem 0; padding-left: 1.4rem; }

