/* ═══════════════════════════════════════════════════════════════
   TDB LKVA — charte des modules Cevino (cf. Module Portail/public/css/portail.css)
   Aucun style inline dans le HTML : la CSP n'autorise que ce fichier.
   Couleurs des sociétés : palette validée (daltonisme, contraste) en clair et en sombre.
   ═══════════════════════════════════════════════════════════════ */
:root {
  color-scheme: light;
  --bg: #edeaf0;
  --surface: #ffffff;
  --surface2: #f5f3f8;
  --navy: #1a2268;
  --navy2: #252d82;
  --blue-mid: #3d4dbf;
  --blue-soft: #eef0fb;
  --accent: #1a2268;          /* fond des boutons et onglets actifs (texte blanc) */
  --text: #2c2c2c;
  --text2: #555566;
  --text3: #8a8aa0;
  --border: #d8d4e4;
  --border2: #c8c4d8;
  --grille: #ebe8f1;
  --axe: #c8c4d8;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(26,34,104,0.08);
  --shadow-sm: 0 2px 10px rgba(26,34,104,0.06);
  --largeur: 1800px;
  --gouttiere: 32px;

  /* Sociétés (ordre fixe : C, L, N, R) */
  --soc-C: #2a78d6;
  --soc-L: #eb6834;
  --soc-N: #1baf7a;
  --soc-R: #eda100;
  /* Statuts (réservés, toujours avec icône + libellé) */
  --ok: #0ca30c;
  --ok-texte: #006300;
  --alerte: #d03b3b;
  --attention: #fab219;
  /* Rampe séquentielle (magnitude : matrices, rôles) */
  --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5;
  --seq-5: #256abf; --seq-6: #184f95; --seq-7: #0d366b;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #11131f; --surface: #1a1d2e; --surface2: #222640; --navy: #c9cdf5; --navy2: #aab0ee;
    --blue-mid: #8f9cf0; --blue-soft: #262b4a; --accent: #3d4dbf; --text: #ecebf3; --text2: #c3c2d6; --text3: #8d8ca6;
    --border: #2f3352; --border2: #3b4066; --grille: #262a44; --axe: #3b4066;
    --shadow: 0 4px 24px rgba(0,0,0,0.35); --shadow-sm: 0 2px 10px rgba(0,0,0,0.3);
    --soc-C: #3987e5; --soc-L: #d95926; --soc-N: #199e70; --soc-R: #c98500;
    --ok-texte: #0ca30c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11131f; --surface: #1a1d2e; --surface2: #222640; --navy: #c9cdf5; --navy2: #aab0ee;
  --blue-mid: #8f9cf0; --blue-soft: #262b4a; --accent: #3d4dbf; --text: #ecebf3; --text2: #c3c2d6; --text3: #8d8ca6;
  --border: #2f3352; --border2: #3b4066; --grille: #262a44; --axe: #3b4066;
  --soc-C: #3987e5; --soc-L: #d95926; --soc-N: #199e70; --soc-R: #c98500;
  --ok-texte: #0ca30c;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 140px; }
body {
  margin: 0;
  font-family: 'Open Sans', 'Segoe UI', system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
  min-height: 100vh;
}
h1, h2, h3 { font-family: 'Raleway', 'Segoe UI', system-ui, Arial, sans-serif; color: var(--navy); margin: 0; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 15px; font-weight: 700; }
h3 { font-size: 13px; font-weight: 700; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--blue-mid); }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muet { color: var(--text3); }
.petit { font-size: 12px; }

/* ═══════════ EN-TÊTE (charte des modules Cevino) ═══════════ */
body { display: flex; flex-direction: column; }
.app-header {
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
  height: 62px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 30; flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.logo-img { height: 38px; width: auto; object-fit: contain; }
.logo-text { font-family: 'Raleway', 'Segoe UI', sans-serif; font-size: 16px; font-weight: 800; color: var(--navy); letter-spacing: 0.04em; }
.header-divider { width: 1px; height: 28px; background: var(--border); margin: 0 4px; }
.header-app-name { font-family: 'Raleway', 'Segoe UI', sans-serif; font-size: 11.5px; font-weight: 700; color: var(--text2); letter-spacing: 0.07em; text-transform: uppercase; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-info {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 22px; padding: 4px 14px; font-size: 12px; font-weight: 600; color: var(--text2);
}
.header-info::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green, #2a8a4a); }

/* ═══════════ MISE EN PAGE : menu latéral + contenu ═══════════ */
.app-layout { display: flex; flex: 1; min-height: 0; }
.app-sidebar {
  width: 232px; min-width: 232px; background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto;
}
.nav-section-label {
  font-family: 'Raleway', 'Segoe UI', sans-serif; font-size: 9px; font-weight: 800; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.14em; padding: 12px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; color: var(--text2); text-decoration: none; transition: all 0.15s;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text3); }
.nav-item:hover { background: var(--surface2); color: var(--navy); }
.nav-item[aria-current="page"] { background: var(--blue-soft); color: var(--navy); }
.nav-item[aria-current="page"] svg, .nav-item:hover svg { color: var(--blue-mid); }
.sidebar-pied { margin-top: auto; padding: 12px 10px 0; font-size: 11px; color: var(--text3); line-height: 1.5; }
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-footer {
  background: var(--navy-fixe, #1a2268); padding: 12px 28px; font-size: 11.5px; color: rgba(255,255,255,0.55);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.footer-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--red, #c0392b); }

/* ═══════════ FILTRES ═══════════ */
.barre-filtres { background: var(--surface2); border-bottom: 1px solid var(--border); position: sticky; top: 62px; z-index: 20; }
.filtres-inner {
  max-width: var(--largeur); margin: 0 auto; padding: 10px 28px;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 22px;
}
.filtre { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--text2); font-weight: 600; }
.filtre select, .champ {
  min-width: 150px; padding: 6px 10px; border: 1px solid var(--border2); border-radius: var(--radius);
  background: var(--surface); font-weight: 400; font-size: 13px;
}
.filtre-case { flex-direction: row; align-items: center; gap: 7px; padding-bottom: 7px; }
.filtre-resume { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding-bottom: 3px; text-align: right; }
.resume-titre { font: 700 13px 'Raleway', 'Segoe UI', sans-serif; color: var(--navy); }
.resume-detail { font-size: 11.5px; color: var(--text3); }
#f-periode { max-width: 400px; }
.puces { display: flex; gap: 6px; flex-wrap: wrap; }
.puce {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border2); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--text2);
}
.puce[aria-pressed="true"] { border-color: var(--navy); color: var(--text); background: var(--blue-soft); }
.puce[aria-pressed="false"] { opacity: 0.55; }
.pastille { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.pastille.C { background: var(--soc-C); } .pastille.L { background: var(--soc-L); }
.pastille.N { background: var(--soc-N); } .pastille.R { background: var(--soc-R); }
.pastille.rond { border-radius: 50%; }

/* ═══════════ CONTENU ═══════════ */
.contenu { width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 24px 28px 60px; outline: none; flex: 1; }
.chargement { padding: 80px 0; text-align: center; color: var(--text3); font-size: 15px; }
.erreur-bloc { padding: 18px; border-radius: var(--radius); background: var(--surface); border-left: 4px solid var(--alerte); }
.entete-vue { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.entete-vue p { color: var(--text2); max-width: 900px; margin-top: 4px; }
.grille { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-simu { grid-template-columns: 360px minmax(0, 1fr); align-items: start; }
.g32 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.grille > * { min-width: 0; }
.span2 { grid-column: span 2; }
.pile { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1300px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .g-simu, .g32 { grid-template-columns: 1fr; } .panneau { position: static; max-height: none; } }
@media (max-width: 860px) {
  :root { --gouttiere: 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .barre-filtres, .app-header { position: static; }
  .app-header { padding: 0 16px; }
  .logo-text, .header-divider, .header-info { display: none; }
  .app-layout { flex-direction: column; }
  .app-sidebar { position: static; width: auto; min-width: 0; height: auto; flex-direction: row; overflow-x: auto; padding: 6px 10px; border-right: none; border-bottom: 1px solid var(--border); }
  .nav-section-label, .sidebar-pied { display: none; }
  .nav-item { white-space: nowrap; }
  .contenu { padding: 18px 16px 40px; }
  .filtres-inner { padding: 10px 16px; }
  .be-ligne { grid-template-columns: 100px 1fr 64px; }
  .tuile.heros .valeur { font-size: 32px; }
}

/* Cartes */
.carte {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 16px 18px; min-width: 0;
}
.carte-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.carte-tete p { color: var(--text3); font-size: 12px; margin-top: 2px; }
.bouton-lien {
  background: none; border: 1px solid var(--border2); border-radius: 999px; padding: 3px 10px;
  font-size: 11.5px; color: var(--text2); cursor: pointer; white-space: nowrap;
}
.bouton-lien:hover { background: var(--blue-soft); color: var(--navy); }
.zone-graph { position: relative; height: 300px; }
.zone-graph.haute { height: 380px; }
.zone-graph.basse { height: 220px; }
.tableau-graph { max-height: 380px; overflow: auto; }

/* Tuiles KPI */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tuile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.tuile .libelle { font-size: 12px; color: var(--text2); font-weight: 600; }
.tuile .valeur { font-size: 25px; font-weight: 700; color: var(--text); line-height: 1.25; margin-top: 2px; }
.tuile .detail { font-size: 11.5px; color: var(--text3); margin-top: 2px; }
.tuile.heros .valeur { font-size: 40px; }
.tuile-societe { border-top: 4px solid var(--border2); }
.tuile-societe.C { border-top-color: var(--soc-C); } .tuile-societe.L { border-top-color: var(--soc-L); }
.tuile-societe.N { border-top-color: var(--soc-N); } .tuile-societe.R { border-top-color: var(--soc-R); }
.tuile-societe .ligne-kv { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text2); }
.tuile-societe .ligne-kv b { color: var(--text); font-variant-numeric: tabular-nums; }
.delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.pos { color: var(--ok-texte); }
.delta.neg { color: var(--alerte); }

/* Tableaux */
table.tab { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tab th { text-align: left; font-weight: 600; color: var(--text2); border-bottom: 1px solid var(--border2); padding: 6px 8px; position: sticky; top: 0; background: var(--surface); }
.tab td { padding: 5px 8px; border-bottom: 1px solid var(--grille); }
.tab tr:hover td { background: var(--surface2); }
.tab th.num, .tab td.num { text-align: right; }
.tab tfoot td { font-weight: 700; border-top: 1px solid var(--border2); border-bottom: none; }
.tab .cliquable { cursor: pointer; color: var(--blue-mid); text-decoration: underline; }
.defile { max-height: 440px; overflow: auto; }

/* Matrice (carte de chaleur) */
table.matrice { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 12.5px; }
.matrice th { font-weight: 600; color: var(--text2); padding: 6px; text-align: center; }
.matrice th.lig { text-align: left; white-space: nowrap; }
.matrice td { padding: 10px 6px; text-align: center; border-radius: 4px; font-variant-numeric: tabular-nums; background: var(--surface2); cursor: default; }
.matrice td.diag { outline: 1px dashed var(--border2); outline-offset: -3px; }
.matrice td.total, .matrice th.total { background: none; font-weight: 700; color: var(--text); }
.matrice .clair { color: #0b0b0b; }
.matrice .fonce { color: #ffffff; }
.matrice-legende { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text3); margin-top: 8px; }
.rampe { height: 8px; width: 160px; border-radius: 4px; background: linear-gradient(90deg, var(--seq-1), var(--seq-3), var(--seq-5), var(--seq-7)); }

/* Flux nets (qui doit à qui) */
.flux-liste { display: flex; flex-direction: column; gap: 8px; }
.flux-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface2); }
.flux-item .qui { display: flex; align-items: center; gap: 8px; font-weight: 600; flex-wrap: wrap; }
.flux-item .fleche { color: var(--text3); }
.flux-item .montant { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.flux-item .sous { grid-column: 1 / -1; font-size: 11.5px; color: var(--text3); }
.barre-flux { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--grille); overflow: hidden; }
.barre-flux span { display: block; height: 100%; background: var(--seq-5); border-radius: 3px; }

/* Panneau du simulateur */
.panneau { position: sticky; top: 132px; max-height: calc(100vh - 150px); overflow: auto; }
.panneau h3 { margin: 14px 0 6px; }
.panneau h3:first-child { margin-top: 0; }
.aide { font-size: 11.5px; color: var(--text3); margin-bottom: 6px; }
.choix-modele { display: flex; flex-direction: column; gap: 6px; }
.choix-modele label {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; background: var(--surface2);
}
.choix-modele label:has(input:checked) { border-color: var(--navy); background: var(--blue-soft); }
.choix-modele input { margin-top: 3px; }
.choix-modele b { font-size: 12.5px; }
.choix-modele small { grid-column: 2; color: var(--text3); font-size: 11.5px; line-height: 1.4; }
.curseur { display: grid; grid-template-columns: 1fr 64px; gap: 4px 8px; align-items: center; margin: 6px 0; }
.curseur label { font-size: 12.5px; font-weight: 600; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.curseur input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--navy); }
.curseur input[type="number"] { width: 64px; padding: 3px 6px; border: 1px solid var(--border2); border-radius: 6px; text-align: right; background: var(--surface); }
.jauge-roles { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 8px 0 4px; background: var(--surface); }
.jauge-roles span { display: block; height: 100%; }
.jr-vente { background: var(--seq-7); } .jr-livraison { background: var(--seq-5); }
.jr-transport { background: var(--seq-3); } .jr-fabrication { background: var(--seq-2); }
.table-coefs { width: 100%; font-size: 12px; border-collapse: collapse; }
.table-coefs td { padding: 3px 4px; border-bottom: 1px solid var(--grille); }
.table-coefs input { width: 58px; padding: 2px 5px; border: 1px solid var(--border2); border-radius: 5px; text-align: right; background: var(--surface); }
.table-coefs .cat td { font-weight: 700; color: var(--navy); padding-top: 8px; border-bottom: none; }
details.repli { border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; margin: 8px 0; background: var(--surface2); }
details.repli summary { cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--navy); }
.segment { display: inline-flex; border: 1px solid var(--border2); border-radius: 999px; overflow: hidden; }
.segment button { border: none; background: var(--surface); padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--text2); }
.segment button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bouton {
  border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: var(--radius);
  padding: 6px 12px; font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.bouton.secondaire { background: var(--surface); color: var(--navy); }
.bouton:disabled { opacity: 0.5; cursor: default; }
.message { font-size: 12px; margin-top: 6px; color: var(--text2); }

/* Légende maison (graphes HTML) */
.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text2); margin-bottom: 8px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }

/* Barres HTML (répartition) */
.barres-empilees { display: flex; flex-direction: column; gap: 10px; }
.be-ligne { display: grid; grid-template-columns: 150px 1fr 90px; gap: 10px; align-items: center; font-size: 12.5px; }
.be-barre { display: flex; height: 20px; gap: 2px; }
.be-barre span { display: block; height: 100%; min-width: 0; }
.be-barre span:first-child { border-radius: 4px 0 0 4px; }
.be-barre span:last-child { border-radius: 0 4px 4px 0; }
.be-barre span:only-child { border-radius: 4px; }
.seg-C { background: var(--soc-C); } .seg-L { background: var(--soc-L); } .seg-N { background: var(--soc-N); } .seg-R { background: var(--soc-R); }

/* Badges de statut (icône + libellé) */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border2); white-space: nowrap; }
.badge.ok::before { content: "✓"; color: var(--ok); font-weight: 800; }
.badge.ko::before { content: "!"; color: var(--alerte); font-weight: 800; }
.badge.info::before { content: "i"; color: var(--blue-mid); font-weight: 800; font-style: italic; }

/* Fiche commande */
.recherche { display: flex; gap: 8px; flex-wrap: wrap; }
.recherche input { flex: 1; min-width: 240px; padding: 8px 12px; border: 1px solid var(--border2); border-radius: var(--radius); background: var(--surface); }
.fiche-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; }
.fiche-kv div { display: flex; flex-direction: column; }
.fiche-kv span { font-size: 11.5px; color: var(--text3); }
.fiche-kv b { font-weight: 600; }
.chaine { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.etape { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border2); background: var(--surface2); white-space: nowrap; }
.etape.tournee { border-style: dashed; }
.chaine .sep { color: var(--text3); }

/* Infobulle */
.infobulle {
  position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--border2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 10px; font-size: 12px; max-width: 320px;
}
.infobulle .v { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.infobulle .l { color: var(--text2); }

/* Note / avertissement */
.note { font-size: 12px; color: var(--text2); background: var(--blue-soft); border-radius: var(--radius); padding: 10px 12px; }
.note b { color: var(--navy); }

@media print {
  .app-header, .barre-filtres, .panneau, .bouton-lien, .actions { display: none !important; }
  .g-simu { grid-template-columns: 1fr; }
  body { background: #fff; }
  .carte, .tuile { box-shadow: none; break-inside: avoid; }
}

/* Espacements utilitaires */
.mt { margin-top: 16px; }
.grille + .grille, .tuiles + .grille, .grille + .note, .note + .grille { margin-top: 16px; }
.entete-vue + .grille { margin-top: 0; }
.nom-soc { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

.matrice-conteneur { overflow-x: auto; }
.matrice-conteneur table.matrice { min-width: 520px; }
.mb { margin-bottom: 16px; }
.table-conteneur { overflow-x: auto; }

/* ═══════════ Composants aux couleurs des modules Cevino ═══════════ */
:root { --red: #c0392b; --green: #2a8a4a; --navy-fixe: #1a2268; }
body { font-size: 13.5px; }
.entete-vue h1 {
  font-size: 20px; font-weight: 800; color: var(--navy); display: flex; align-items: center; gap: 10px; margin-bottom: 2px;
}
.entete-vue h1::before { content: ''; width: 4px; height: 20px; background: var(--red); border-radius: 2px; flex-shrink: 0; }
.entete-vue p { font-size: 12.5px; color: var(--text3); padding-left: 14px; }
.carte-tete h2, .carte > h2 {
  font-size: 11px; font-weight: 800; color: var(--navy); text-transform: uppercase; letter-spacing: 0.08em;
}
.carte-tete { padding-bottom: 10px; border-bottom: 1px solid var(--border); margin: -2px -2px 12px; }
.tuile { border-top: 4px solid var(--navy-fixe); padding: 16px 18px; }
.tuile .libelle { font-size: 10.5px; color: var(--text3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.tuile .valeur { font-family: 'Raleway', 'Segoe UI', sans-serif; font-weight: 800; color: var(--navy); font-size: 26px; line-height: 1.1; }
.tuile.heros .valeur { font-size: 38px; }
.tuile-societe .libelle { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text2); }
.tab thead th {
  background: var(--navy-fixe); color: rgba(255,255,255,0.92); font-family: 'Raleway', 'Segoe UI', sans-serif;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: none; padding: 9px 10px; white-space: nowrap;
}
.tab tbody tr:nth-child(even) td { background: var(--surface2); }
.tab tbody tr:hover td { background: var(--blue-soft); }
.bouton {
  font-family: 'Raleway', 'Segoe UI', sans-serif; font-weight: 700; letter-spacing: 0.02em; border-radius: 10px; padding: 8px 16px;
  box-shadow: 0 2px 8px rgba(26,34,104,0.25); transition: all 0.15s ease;
}
.bouton:hover:not(:disabled) { transform: translateY(-1px); }
.bouton.secondaire { box-shadow: none; border: 1.5px solid var(--border2); color: var(--text2); background: var(--surface); }
.bouton.secondaire:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.bouton.danger { background: var(--surface); color: var(--red); border: 1.5px solid #f5c0c0; box-shadow: none; }
.note { background: #f0f0fc; border: 1px solid #b0b4e8; color: var(--navy); }
.note.attention { background: var(--orange-soft, #fdf3e3); border-color: #f0d9a8; color: #7a5500; }
.note.attention b { color: #7a5500; }
.note.ok { background: var(--green-soft, #eaf6ef); border-color: #a8d8b8; color: #1a5c2c; }
.note.ok b { color: #1a5c2c; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .note { background: var(--blue-soft); border-color: var(--border2); color: var(--text); }
  :root:where(:not([data-theme="light"])) .note.attention { background: #3a2f16; border-color: #6b5320; color: #f3d9a4; }
  :root:where(:not([data-theme="light"])) .note.ok { background: #16301f; border-color: #2c5a3a; color: #bfe6cc; }
  :root:where(:not([data-theme="light"])) .tuile { border-top-color: var(--blue-mid); }
}

/* ═══════════ Import des données (version fichier HTML) ═══════════ */
.zone-depot {
  border: 2px dashed var(--border2); border-radius: var(--radius-lg); background: var(--surface2);
  padding: 34px 20px; text-align: center; transition: all 0.15s;
}
.zone-depot.survol { border-color: var(--blue-mid); background: var(--blue-soft); }
.zone-depot h2 { font-size: 16px; margin-bottom: 6px; }
.zone-depot p { color: var(--text2); margin-bottom: 14px; }
.zone-depot input[type="file"] { display: none; }
.progression { height: 8px; border-radius: 4px; background: var(--grille); overflow: hidden; min-width: 120px; }
.progression span { display: block; height: 100%; width: 0; background: var(--blue-mid); border-radius: 4px; transition: width 0.1s; }
.statut-ok { color: var(--ok-texte); font-weight: 700; }
.statut-ko { color: var(--alerte); font-weight: 700; }
.statut-attente { color: var(--text3); }
.statut-reco { color: #a86400; font-weight: 700; }

/* Import : marche à suivre en 3 étapes et fichiers attendus */
.import-etapes { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 4px 0 0; padding: 0; }
.import-etapes li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface2); }
.import-num {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy-fixe); color: #fff; font: 800 14px 'Raleway', system-ui, sans-serif;
}
.import-etapes b { display: block; color: var(--navy); font-size: 13.5px; margin-bottom: 3px; }
.import-etapes p { font-size: 12.5px; line-height: 1.5; color: var(--text2); }
.import-etapes code { font: 700 12px Consolas, 'Courier New', monospace; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; color: var(--text); }
.import-attendus { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.import-attendus-titre { font-size: 12px; font-weight: 700; color: var(--text2); margin-bottom: 8px; }
.import-fichiers { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.import-fichier { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border2); background: var(--surface); font: 600 12px Consolas, 'Courier New', monospace; color: var(--text2); }
.import-fichier.obligatoire { background: var(--navy-fixe); border-color: var(--navy-fixe); color: #fff; }
.import-fichier.historique { background: #fdf3e3; border-color: #e8c27a; color: #7a5500; }
@media (max-width: 1100px) { .import-etapes { grid-template-columns: 1fr; } }
.actions.centre { justify-content: center; }
.header-info.vide::before { background: var(--text3); }
.matrice td.total, .matrice th.total { white-space: nowrap; }
/* Largeur utile réduite par le menu latéral */
.tuile-societe .ligne-kv b { white-space: nowrap; }
.tuile-societe .ligne-kv span, .tuile-societe .ligne-kv { min-width: 0; }
@media (max-width: 1600px) {
  .g32 { grid-template-columns: 1fr; }
  .g-simu { grid-template-columns: 320px minmax(0, 1fr); }
  .tuile .valeur { font-size: 23px; }
}
@media (max-width: 1350px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.panneau .curseur:has(.champ) { grid-template-columns: 1fr; }
.panneau .champ { width: 100%; min-width: 0; }
.segment button { white-space: nowrap; padding: 4px 9px; font-size: 11.5px; }
/* Téléphone (en dernier pour primer sur les règles de largeur intermédiaire) */
@media (max-width: 860px) {
  .app-sidebar nav { display: flex; gap: 4px; }
  .g2, .g3, .g4, .g32, .g-simu { grid-template-columns: 1fr; }
  .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tuile.heros { grid-column: 1 / -1; }
}

/* Qui fait quoi */
.qfq { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.qfq div { display: grid; grid-template-columns: 86px 1fr; gap: 8px; font-size: 12.5px; color: var(--text2); }
.qfq b { font-family: 'Raleway', 'Segoe UI', sans-serif; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--navy); padding-top: 2px; }
.etape.prevue { opacity: 0.55; border-style: dotted; }

/* Tableaux */
.sous-onglets { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.sous-onglets button {
  border: none; background: none; padding: 9px 16px; font-family: 'Raleway', 'Segoe UI', sans-serif; font-weight: 700; font-size: 13px;
  color: var(--text2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.sous-onglets button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--red); }
.sous-onglets button:hover { color: var(--navy); }
.outils-tableau { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 12px; }
.outils-tableau input[type="search"] { min-width: 300px; flex: 1; }
.grille-donnees { max-height: 70vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.tab-donnees { font-size: 12px; }
.tab-donnees th { position: sticky; top: 0; z-index: 2; }
.tab-donnees th.triable { cursor: pointer; user-select: none; }
.tab-donnees th.triable:hover { background: var(--navy2, #252d82); }
.tab-donnees th.centre { text-align: center; }
.tab-donnees td { white-space: nowrap; }
.tab-donnees tfoot td { position: sticky; bottom: 0; background: var(--surface); z-index: 1; font-weight: 700; border-top: 2px solid var(--navy-fixe); }
.tab-donnees td.pos { color: var(--ok-texte); font-weight: 600; }
.tab-donnees td.neg { color: var(--alerte); font-weight: 600; }
.tab-donnees tr.reference td { background: var(--blue-soft); }
.tab-donnees td .muet { white-space: normal; max-width: 420px; }
.tab-croise td:first-child { font-weight: 600; }
.tab-croise td.total { font-weight: 700; }
.pagination { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 10px; font-size: 12.5px; color: var(--text2); }
.choix-colonnes { position: relative; }
.choix-colonnes summary {
  cursor: pointer; padding: 7px 12px; border: 1.5px solid var(--border2); border-radius: 10px; font-weight: 700; font-size: 12.5px;
  font-family: 'Raleway', 'Segoe UI', sans-serif; color: var(--text2); list-style: none; background: var(--surface);
}
.choix-colonnes[open] > div {
  position: absolute; z-index: 10; top: 110%; left: 0; background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px; display: grid; grid-template-columns: repeat(2, minmax(170px, 1fr)); gap: 4px 16px;
}
.choix-colonnes label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.paire { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* À traiter */
.tuile-lien { text-decoration: none; color: inherit; cursor: pointer; transition: transform 0.15s; }
.tuile-lien:hover { transform: translateY(-2px); }
.tuile.alerte { border-top-color: var(--red); }

/* Compte connecté (version en ligne) */
.compte { display: flex; align-items: center; gap: 9px; background: var(--surface2); border: 1px solid var(--border); border-radius: 22px; padding: 4px 12px 4px 5px; }
.compte .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--navy-fixe); color: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Raleway', 'Segoe UI', sans-serif; font-weight: 800; font-size: 11px; }
.compte-nom { display: flex; flex-direction: column; line-height: 1.2; }
.compte-nom b { font-size: 12.5px; color: var(--text); }
.compte-nom small { font-size: 10.5px; color: var(--text3); }
.compte form { margin: 0; }
.lien-bouton { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 12px; padding: 2px 4px; text-decoration: underline; }
.lien-bouton:hover { color: var(--red); }

/* Pages simples : connexion, mot de passe, erreur */
.page-simple { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.simple-conteneur { width: 430px; max-width: 100%; }
.simple-logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 22px; }
.simple-logo img { height: 42px; }
.simple-badge { background: var(--navy-fixe); color: #fff; border-radius: 8px; padding: 5px 11px; font-family: 'Raleway', 'Segoe UI', sans-serif; font-weight: 800; font-size: 12px; letter-spacing: 0.06em; }
.simple-carte { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 34px; box-shadow: 0 16px 50px rgba(26,34,104,0.12); }
.simple-carte h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.simple-sous { font-size: 13px; color: var(--text3); text-align: center; margin-bottom: 24px; }
.simple-carte label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 5px; }
.simple-carte input { display: block; width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; background: var(--surface); }
.simple-carte input:focus { outline: none; border-color: var(--navy); }
.bouton-large { width: 100%; padding: 12px; text-transform: uppercase; letter-spacing: 0.06em; display: block; text-align: center; text-decoration: none; }
.simple-erreur { background: #fdf0f0; border: 1.5px solid #f5c0c0; color: #8b1a1a; border-radius: var(--radius); padding: 10px 14px; font-size: 12.5px; margin-bottom: 18px; }
.simple-lien { text-align: center; margin-top: 14px; }
.simple-pied { text-align: center; font-size: 11.5px; color: var(--text3); margin-top: 18px; }

/* ── Aide en ligne : ⓘ par bloc, visite guidée, panneau d'aide ─── */
.entete-vue h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.bouton-aide {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border: 1px solid var(--border2); border-radius: 50%; background: var(--surface); color: var(--blue-mid);
  font: 700 15px/1 'Open Sans', system-ui, sans-serif; cursor: pointer; flex-shrink: 0;
}
.bouton-visite {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 10px; border: 1px solid var(--blue-mid); border-radius: 999px;
  background: var(--blue-soft); color: var(--navy); font: 700 12px 'Open Sans', system-ui, sans-serif; cursor: pointer; letter-spacing: 0;
}
.bouton-visite span { font-size: 9px; }
.bouton-aide:hover, .bouton-aide:focus-visible, .bouton-visite:hover, .bouton-visite:focus-visible { background: var(--blue-soft); border-color: var(--navy); outline: none; }
.bouton-aide-barre {
  align-self: flex-end; margin-bottom: 3px; padding: 6px 12px; border: 1px solid var(--border2); border-radius: var(--radius);
  background: var(--surface); color: var(--navy); font: 700 12px 'Open Sans', system-ui, sans-serif; cursor: pointer; white-space: nowrap;
}
.bouton-aide-barre:hover, .bouton-aide-barre:focus-visible, .bouton-aide-barre[aria-expanded="true"] { background: var(--blue-soft); border-color: var(--blue-mid); outline: none; }
.filtre-resume + .bouton-aide-barre { margin-left: 12px; }
.lien-mode-emploi { margin-top: 14px; }

/* Petit « i » posé sur chaque bloc */
.bouton-info {
  display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; margin-left: 7px; padding: 0;
  border: 1.5px solid var(--blue-mid); border-radius: 50%; background: transparent; color: var(--blue-mid);
  font: italic 700 11px/1 Georgia, 'Times New Roman', serif; text-transform: none; letter-spacing: 0;
  vertical-align: 1px; cursor: pointer; opacity: 0.55; transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.carte:hover .bouton-info, .tuile:hover .bouton-info, .panneau h3:hover .bouton-info { opacity: 1; }
.bouton-info:hover, .bouton-info:focus-visible, .bouton-info[aria-expanded="true"] { opacity: 1; background: var(--blue-mid); color: #fff; outline: none; }

.bulle-aide {
  position: fixed; z-index: 60; width: 340px; max-width: calc(100vw - 24px); padding: 14px 16px 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border2); border-top: 3px solid var(--blue-mid);
  border-radius: var(--radius); box-shadow: 0 12px 36px rgba(10, 14, 50, 0.22); animation: aide-apparait 0.12s ease-out;
}
.bulle-aide.attention { border-top-color: #d68a00; }
.bulle-aide-titre { font: 800 14px 'Raleway', system-ui, sans-serif; color: var(--navy); padding-right: 22px; margin-bottom: 6px; }
.bulle-aide p { font-size: 13px; line-height: 1.55; color: var(--text2); }
.bulle-aide p b { color: var(--text); }
.bulle-aide-fermer { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--text3); cursor: pointer; }
.bulle-aide-fermer:hover { background: var(--surface2); color: var(--navy); }
.bulle-aide-plus { margin-top: 10px; padding: 0; border: 0; background: none; color: var(--blue-mid); font: 700 12px 'Open Sans', system-ui, sans-serif; cursor: pointer; }
.bulle-aide-plus:hover, .bulle-aide-plus:focus-visible { text-decoration: underline; outline: none; }
@keyframes aide-apparait { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Visite guidée */
.visite-voile { position: fixed; inset: 0; z-index: 70; background: transparent; }
.visite-voile.sombre { background: rgba(12, 16, 45, 0.55); }
.visite-spot {
  position: fixed; z-index: 71; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--blue-mid), 0 0 0 9999px rgba(12, 16, 45, 0.55); transition: all 0.25s ease;
}
.visite-bulle {
  position: fixed; z-index: 72; width: 400px; max-width: calc(100vw - 24px); padding: 18px 20px 14px;
  background: var(--surface); color: var(--text); border-radius: var(--radius-lg); box-shadow: 0 18px 60px rgba(10, 14, 50, 0.4);
  transition: top 0.25s ease, left 0.25s ease;
}
.visite-bulle.accueil { width: 480px; padding: 24px 26px 18px; }
.visite-compteur { font-size: 11px; font-weight: 700; color: var(--blue-mid); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.visite-titre { font: 800 17px 'Raleway', system-ui, sans-serif; color: var(--navy); margin-bottom: 8px; padding-right: 26px; }
.visite-bulle.accueil .visite-titre { font-size: 21px; }
.visite-titre.attention { color: #8a5a00; }
.visite-bulle p { font-size: 13.5px; line-height: 1.55; color: var(--text2); }
.visite-bulle b { color: var(--text); }
.visite-bref { margin: 4px 0 0 18px; font-size: 14px; line-height: 1.55; color: var(--text2); }
.visite-bref li + li { margin-top: 6px; }
.visite-bulle .visite-astuce { margin-top: 12px; font-size: 12px; color: var(--text3); }
.visite-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.visite-actions > div:last-child { display: flex; gap: 8px; }
.visite-actions .bouton { padding: 7px 14px; white-space: nowrap; }
.visite-actions .bouton:disabled { opacity: 0.4; cursor: default; }
.visite-points { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.visite-points span { width: 7px; height: 7px; border-radius: 50%; background: var(--border2); }
.visite-points span.fait { background: var(--blue-mid); opacity: 0.45; }
.visite-points span.actif { background: var(--blue-mid); width: 18px; border-radius: 4px; }
.visite-fermer { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--text3); font-size: 15px; cursor: pointer; }
.visite-fermer:hover, .visite-fermer:focus-visible { background: var(--surface2); color: var(--navy); outline: none; }

/* Bloc montré depuis le panneau d'aide */
.aide-repere { animation: aide-repere 2.4s ease-out; }
@keyframes aide-repere {
  0%, 40% { box-shadow: 0 0 0 3px var(--blue-mid), 0 0 0 9px rgba(60, 110, 220, 0.18); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Panneau d'aide à droite */
.aide-panneau {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 55; width: 440px; max-width: 100vw; display: flex; flex-direction: column;
  background: var(--surface); color: var(--text); border-left: 1px solid var(--border2); box-shadow: -18px 0 50px rgba(10, 14, 50, 0.18);
  animation: aide-glisse 0.18s ease-out;
}
@keyframes aide-glisse { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.aide-panneau-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px 14px; background: var(--navy-fixe); color: #fff; }
.aide-sur { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.7; }
.aide-panneau-tete h2 { font: 800 19px 'Raleway', system-ui, sans-serif; color: #fff; margin-top: 2px; }
.aide-fermer { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--text3); font-size: 16px; cursor: pointer; flex-shrink: 0; }
.aide-panneau-tete .aide-fermer { color: #fff; opacity: 0.8; }
.aide-panneau-tete .aide-fermer:hover, .aide-panneau-tete .aide-fermer:focus-visible { background: rgba(255, 255, 255, 0.15); opacity: 1; outline: none; }
.aide-panneau-corps { flex: 1; overflow-y: auto; padding: 16px 22px 22px; }
.aide-bref { padding: 12px 14px; border-radius: var(--radius); background: var(--blue-soft); border-left: 4px solid var(--blue-mid); }
.aide-bref-titre { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--navy); margin-bottom: 6px; }
.aide-bref ul { margin-left: 18px; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.aide-bref li + li { margin-top: 4px; }
.aide-lancer { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; padding: 10px 14px; font-size: 13px; }
.aide-lancer span { font-size: 10px; }
.aide-panneau h3 { margin: 20px 0 6px; font: 800 12px 'Raleway', system-ui, sans-serif; color: var(--navy); text-transform: uppercase; letter-spacing: 0.06em; }
.aide-intro { font-size: 12.5px; color: var(--text2); margin-bottom: 10px; line-height: 1.55; }
.aide-intro b { color: var(--text); }
.aide-liste { display: flex; flex-direction: column; gap: 6px; }
.aide-item {
  position: relative; display: block; width: 100%; padding: 10px 12px; text-align: left; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit;
}
.aide-item p { margin-top: 5px; font-size: 12.5px; line-height: 1.5; color: var(--text2); }
.aide-item p b { color: var(--text); }
.aide-item.cliquable { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.aide-item.cliquable:hover, .aide-item.cliquable:focus-visible { border-color: var(--blue-mid); background: var(--blue-soft); outline: none; }
.aide-voir { position: absolute; top: 11px; right: 12px; font-size: 11.5px; font-weight: 700; color: var(--blue-mid); opacity: 0; transition: opacity 0.15s; }
.aide-item.cliquable:hover .aide-voir, .aide-item.cliquable:focus-visible .aide-voir { opacity: 1; }
.aide-etiquette {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.4;
  background: var(--blue-soft); color: var(--navy);
}
.aide-etiquette.attention { background: #fdf3e3; color: #7a5500; }
.aide-etiquette.ok { background: #eaf6ef; color: #1a5c2c; }
.aide-repli { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.aide-repli summary { padding: 11px 14px; cursor: pointer; font: 800 12.5px 'Raleway', system-ui, sans-serif; color: var(--navy); }
.aide-repli summary:hover { background: var(--surface2); }
.aide-repli[open] summary { border-bottom: 1px solid var(--border); }
.aide-repli > .aide-liste, .aide-repli > .aide-lexique { padding: 10px 12px 12px; }
.aide-repli .aide-item { border: 0; padding: 6px 2px; border-bottom: 1px dashed var(--grille); border-radius: 0; }
.aide-recherche { display: block; width: calc(100% - 24px); margin: 10px 12px 0; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--surface); color: var(--text); }
.aide-recherche:focus { outline: none; border-color: var(--blue-mid); }
.aide-terme { padding: 7px 0; border-bottom: 1px dashed var(--grille); }
.aide-terme b { font-size: 13px; color: var(--navy); }
.aide-terme p { font-size: 12.5px; line-height: 1.5; color: var(--text2); margin-top: 2px; }
.aide-terme p b { color: var(--text); font-size: inherit; }
.aide-pied { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text3); }
.aide-pied a { color: var(--blue-mid); font-weight: 700; }

/* Proposition de visite à la première ouverture d'un écran */
.aide-toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; align-items: center; gap: 18px; max-width: 540px;
  padding: 14px 16px 14px 18px; background: var(--navy-fixe); color: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 14px 40px rgba(10, 14, 50, 0.35); animation: aide-apparait 0.25s ease-out;
}
.aide-toast > div:first-child { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.aide-toast > div:first-child span { opacity: 0.8; font-size: 12.5px; }
.aide-toast-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.aide-toast .bouton { background: #fff; color: var(--navy-fixe); border-color: #fff; }
.aide-toast .bouton-lien { color: #fff; opacity: 0.8; }

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .aide-etiquette.attention { background: #3a2f16; color: #f0c870; }
  :root:where(:not([data-theme="light"])) .aide-etiquette.ok { background: #183524; color: #8fd6a8; }
}
:root[data-theme="dark"] .aide-etiquette.attention { background: #3a2f16; color: #f0c870; }
:root[data-theme="dark"] .aide-etiquette.ok { background: #183524; color: #8fd6a8; }
@media print { .bouton-aide, .bouton-aide-barre, .bouton-visite, .bouton-info, .bulle-aide, .aide-panneau, .aide-toast, .visite-voile, .visite-spot, .visite-bulle { display: none !important; } }

/* ═══════════ Modes Normal / Expert ═══════════
   Normal : écrans et filtres essentiels, imputation selon le scénario de référence. Expert : tout. */
body.mode-normal [data-expert] { display: none !important; }
.mode-bascule button { font-family: 'Raleway', system-ui, sans-serif; font-weight: 700; letter-spacing: 0.03em; }
.mode-bascule button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.imputation-normal { max-width: 1200px; }

/* Rangée « 4 sociétés + total groupe » (Imputation) */
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1300px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.g-simu .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .g5 { grid-template-columns: 1fr; } }
.tuile-total { border-top-color: var(--navy-fixe); background: var(--blue-soft); }
.tuile-total .libelle { font-weight: 800; color: var(--navy); }
