/* Habillage « Blocs » de la démo publique (/demo), chargé après le style du générateur.
   Ne concerne que la démo : les dashboards clients gardent leur propre thème. */

:root {
  --navy: var(--c-encre); --primaire: var(--c-encre); --blue: var(--c-bleu); --bl: var(--c-gris);
  --bg: var(--c-fond); --white: var(--c-surface); --slate: var(--c-texte-doux); --border: var(--c-gris);
  --green: var(--c-encre); --orange: var(--c-encre); --red: var(--c-danger); --r: var(--r-lg);
}
body { font-family: var(--police); font-size: var(--t-sm); background: var(--c-fond); color: var(--c-texte); padding: 0 var(--gouttiere) var(--gouttiere); }
.wrap { max-width: var(--largeur-page); }
header h1, h2, .kpi .v, .entete-maj b, .modal-header h3, details.bloc-repliable > summary, .sc .big, .sim-res b, .card h3 {
  font-family: var(--police-titre); font-weight: var(--graisse-titre); letter-spacing: -.03em; }
nav button, .btn, .btn-ajout, .filtre, .toggle button, .exb, .filtres-ligne select, .filtres-ligne input, .modal-actions button { font-family: var(--police); }

/* Bandeau de démonstration */
.demo-bandeau { position: sticky; top: 0; z-index: 9999; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--e-2) var(--e-4);
  margin: 0 calc(-1 * var(--gouttiere)) var(--e-2); padding: var(--e-3) var(--gouttiere); background: var(--c-fond); font-size: var(--t-sm); }
.demo-bandeau .logo { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--police-titre); font-weight: var(--graisse-titre); font-size: 1.375rem;
  letter-spacing: -.03em; color: var(--c-texte); text-decoration: none; }
.logo-barre--1 { fill: var(--c-encre); } .logo-barre--2 { fill: var(--c-bleu); } .logo-barre--3 { fill: var(--c-rose); }
.demo-bandeau-texte { flex: 1 1 18rem; display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-2); }
.demo-etiquette { display: inline-flex; align-items: center; min-height: 1.5rem; padding: .15rem .7rem; border-radius: var(--r-plein); background: var(--c-rose); color: var(--c-sur-rose);
  font-size: var(--t-xs); font-weight: 700; }
.demo-bandeau-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-3); }
.demo-bandeau a:not(.logo) { color: var(--c-lien); font-weight: 700; text-underline-offset: .22em; }
.demo-bandeau a.demo-btn { display: inline-flex; align-items: center; min-height: var(--cible-petite); padding: .3rem 1rem; border-radius: var(--r-plein);
  background: var(--c-primaire); color: var(--c-sur-primaire); text-decoration: none; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--c-fond); }

/* En-tête du dashboard : la tuile jaune */
header { background: var(--c-jaune); color: var(--c-sur-jaune); border-radius: var(--r-lg); padding: var(--e-5); }
header h1 { font-size: var(--t-2xl); line-height: 1.05; }
header p, .entete-maj span { opacity: 1; }

/* Onglets et exercices : rangées de pilules */
nav { background: var(--c-gris); margin-top: var(--espace-tuiles); padding: 4px; border-radius: var(--r-plein); }
.nav-tabs { gap: 2px; }
nav button { color: var(--c-texte); padding: .45rem 1rem; border: 0; border-radius: var(--r-plein); font-weight: 500; }
nav button:hover { color: var(--c-texte); background: var(--c-surface); }
nav button.on { color: var(--c-sur-primaire); background: var(--c-primaire); font-weight: 700; }
.exbar { background: transparent; padding: var(--e-2) 0 0; }
.exb { background: var(--c-gris); border: 0; color: var(--c-texte); border-radius: var(--r-plein); }
.exb:hover { background: var(--c-surface); box-shadow: inset 0 0 0 2px var(--c-gris); }
.exb.pin, .exb.cur, .exb.cur.pin { background: var(--c-primaire); color: var(--c-sur-primaire); box-shadow: none; }
.exb-badge { background: var(--c-menthe); color: var(--c-sur-menthe); }

/* Corps : plus de cadre, les blocs sont des tuiles */
main { background: transparent; box-shadow: none; padding: var(--e-5) 0 0; border-radius: 0; }
h2 { font-size: var(--t-xl); border-bottom: 0; padding-bottom: 0; color: var(--c-texte); }
.kpis { gap: var(--espace-tuiles); }
.kpi { background: var(--c-gris); border: 0; border-radius: var(--r-lg); padding: var(--e-4) var(--e-5); }
.kpi.g { background: var(--c-menthe); }
.kpi.r, .kpi.a { background: var(--c-rose); }
.pane > h2 + .kpis > .kpi:first-child { background: var(--c-bleu); color: var(--c-sur-bleu); }
.pane > h2 + .kpis > .kpi:first-child .l, .pane > h2 + .kpis > .kpi:first-child .s, .pane > h2 + .kpis > .kpi:first-child .v { color: var(--c-sur-bleu); }
.kpi .l { text-transform: none; letter-spacing: 0; font-size: var(--t-xs); color: var(--c-texte); }
.kpi .v, .kpi.g .v, .kpi.r .v, .kpi.a .v { font-size: var(--t-xl); color: var(--c-texte); letter-spacing: -.04em; }
.kpi .s { color: var(--c-texte); }
.card, .sc > div, details.repli-historique { background: var(--c-gris); border: 0; border-radius: var(--r-lg); box-shadow: none; }
.card { padding: var(--e-5); }
.card h3 { font-size: var(--t-lg); color: var(--c-texte); }
.sc > div.mid { background: var(--c-menthe); border: 0; box-shadow: none; }
.sc > div.mid .big, .sc .big { color: var(--c-texte); }
.sc ul { border-top: 0; }
.sc-ind { border: 0; border-radius: var(--r-bande); }

/* Tableaux en bandes, dans une tuile grise */
.table-wrapper { background: var(--c-gris); border-radius: var(--r-lg); padding: var(--e-2) var(--e-3); }
.card .table-wrapper { padding: 0; }
@media (max-width: 50rem) { .table-wrapper table { table-layout: auto; min-width: 40rem; } }
table { border-collapse: separate; border-spacing: 0 var(--e-1); font-size: var(--t-sm); }
th { background: var(--c-gris); color: var(--c-texte-doux); text-transform: none; letter-spacing: 0; font-size: var(--t-xs); }
th.th-tri:hover { background: var(--c-surface); }
td { background: var(--c-surface); border-bottom: 0; }
tr > td:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
tr > td:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }
tbody tr:hover { background: transparent; }
tbody tr:hover td { background: var(--c-fond); box-shadow: inset 0 0 0 2px var(--c-encre); }
td.cur { background: var(--c-jaune); }

/* Contrôles : pilules et champs de la charte */
.btn, .btn-ajout, .modal-actions button { border-radius: var(--r-plein); border: var(--bordure-champ) solid var(--c-primaire); background: var(--c-primaire); color: var(--c-sur-primaire); font-weight: 700; }
.btn:hover { background: var(--c-primaire-survol); }
.btn.ghost, .btn-ajout.secondaire { background: var(--c-surface); color: var(--c-texte); border-color: var(--c-bordure-forte); }
.btn.ghost:hover { background: var(--c-gris); }
.filtre { border: 0; background: var(--c-surface); color: var(--c-texte); border-radius: var(--r-plein); }
.card .filtre, .sc .filtre { background: var(--c-surface); }
.filtre.on { background: var(--c-primaire); color: var(--c-sur-primaire); }
.toggle { border: 0; background: var(--c-gris); border-radius: var(--r-plein); padding: 3px; }
.toggle button { color: var(--c-texte); border-radius: var(--r-plein); }
.toggle button.on { background: var(--c-primaire); color: var(--c-sur-primaire); }
.filtres-ligne select, .filtres-ligne input { border: var(--bordure-champ) solid var(--c-bordure-forte); border-radius: var(--r-md); color: var(--c-texte); }
.tag { border-radius: var(--r-plein); background: var(--c-surface); color: var(--c-texte); }
.tag.imp { background: var(--c-rose); color: var(--c-sur-rose); }
.tag.dif, .tag.hyp, .tag.mix, .tag.calc { background: var(--c-surface); color: var(--c-texte); }
.note { background: var(--c-jaune); color: var(--c-sur-jaune); border-left: 0; border-radius: var(--r-bande); }
.note.r { background: var(--c-surface); color: var(--c-danger); box-shadow: inset 0 0 0 2px var(--c-danger); }
.note.g { background: var(--c-menthe); color: var(--c-sur-menthe); }
footer { color: var(--c-texte-doux); }

/* Réglages et export : petites pilules lisibles */
.nav-config-btn, .export-png-btn { opacity: 1; min-height: 2rem; padding: .25rem .8rem; border: var(--bordure-champ) solid var(--c-bordure-forte); border-radius: var(--r-plein);
  background: var(--c-surface); color: var(--c-texte); font: 700 var(--t-xs) var(--police); cursor: pointer; }
.nav-config-btn:hover, .export-png-btn:hover { background: var(--c-gris); color: var(--c-texte); }
