[hidden] { display: none !important; }

:root {
  --fond: #f6f3ee;
  --panneau: #ffffff;
  --encre: #13294b;          /* titres, chiffres */
  --texte: #1f2328;
  --doux: #6b6b6b;           /* sous-titres, axes */
  --ligne: #e4e0d7;
  --grille: #ebe8e1;
  --piste: #ecebe8;          /* fond des jauges */
  --bleu: #2e7cd6;           /* la série qui compte */
  --gris: #c4bfb3;           /* les autres barres */
  --gris-clair: #d6d2c8;     /* l'an dernier */
  --gris-fonce: #8a8a8a;     /* prévisionnel, objectifs */
  --rouge: #e0807b;
  --rouge-vif: #d94a43;
  --orange: #f2b53c;
  --vert: #3aa655;
  --bande: #efeeec;          /* zone mise en avant */
  --rayon: 12px;
  --titre: "Newsreader", Georgia, "Times New Roman", serif;
  --corps: Lato, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.5 var(--corps); }
h1, h2, h3 { margin: 0; color: var(--encre); }
button { font: inherit; cursor: pointer; }
input { font: inherit; }

/* ---------------------------------------------------------------- connexion */
.connexion { max-width: 30rem; margin: 5rem auto; padding: 0 1rem; }
.connexion h1 { font-family: var(--titre); font-weight: 500; font-size: 2.2rem; }
.connexion p { color: var(--doux); }
.formulaire { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.2rem; }
.formulaire input { flex: 1 1 14rem; padding: .65rem .8rem; border: 1px solid var(--ligne); border-radius: 10px; background: var(--panneau); }
.bouton { background: var(--encre); color: #fff; border: 0; border-radius: 10px; padding: .65rem 1.1rem; font-weight: 700; }
.bouton:disabled { opacity: .6; }
.discret { color: var(--doux); font-size: .9rem; }

/* ---------------------------------------------------------------- cadre du cockpit */
.cadre { max-width: 76rem; margin: 1.5rem auto 3rem; padding: 0 1rem; }
.panneau { background: var(--panneau); border: 1px solid var(--ligne); border-radius: 18px; overflow: hidden; }

.nav { display: flex; align-items: stretch; gap: .25rem; padding: 0 1.25rem; border-bottom: 1px solid var(--ligne); overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav .logo { font-weight: 900; color: var(--encre); font-size: 1.05rem; padding: 1rem 1.25rem 1rem 0; white-space: nowrap; }
.nav .logo small { font-weight: 400; color: var(--doux); }
.onglet { background: none; border: 0; color: var(--doux); padding: 1rem .8rem; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.onglet:hover { color: var(--encre); }
.onglet[aria-selected="true"] { color: var(--encre); font-weight: 700; border-bottom-color: var(--bleu); }
.nav .periode { margin-left: auto; color: var(--doux); padding: 1rem 0 1rem 1rem; white-space: nowrap; }
.nav .sortie { background: none; border: 0; color: var(--doux); text-decoration: underline; padding: 1rem 0 1rem 1rem; white-space: nowrap; font-size: .85rem; }

.page { padding: 1.5rem 1.25rem 1.75rem; display: flex; flex-direction: column; gap: 1.25rem; }
.chapeau h1 { font-family: var(--corps); font-weight: 900; font-size: 1.35rem; line-height: 1.3; }
.chapeau p { margin: .25rem 0 0; color: var(--doux); font-size: .92rem; }

/* ---------------------------------------------------------------- indicateurs */
.indicateurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.kpi { border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1rem 1.1rem 1.1rem; background: var(--panneau); min-width: 0; }
.kpi .haut { display: flex; justify-content: space-between; align-items: center; gap: .5rem; color: #3d3d3d; font-size: .92rem; }
.kpi .point { width: .7rem; height: .7rem; border-radius: 50%; flex: none; background: var(--gris); }
.kpi .valeur { font-size: 2.1rem; font-weight: 900; color: var(--encre); letter-spacing: -.01em; margin-top: .35rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi .reference { font-size: .8rem; color: var(--doux); margin-top: .1rem; min-height: 1.2em; }
.kpi .jauge { height: 6px; border-radius: 3px; background: var(--piste); margin-top: .65rem; overflow: hidden; }
.kpi .jauge span { display: block; height: 100%; border-radius: 3px; background: var(--gris); }
.vert { background: var(--vert) !important; }
.orange { background: var(--orange) !important; }
.rouge { background: var(--rouge-vif) !important; }
.jauge .rouge { background: var(--rouge) !important; }

.actions { border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1.1rem 1.25rem; }
.actions h2 { font-family: var(--corps); font-size: 1rem; font-weight: 900; margin-bottom: .6rem; }
.actions ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; counter-reset: a; }
.actions li { counter-increment: a; display: flex; gap: .7rem; align-items: baseline; font-size: .95rem; }
.actions li::before { content: counter(a); flex: none; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: #e6eefa; color: var(--encre); font-size: .78rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; transform: translateY(-1px); }

/* ---------------------------------------------------------------- graphiques */
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 1.25rem; }
.graphe { min-width: 0; }
.graphe h2 { font-family: var(--corps); font-weight: 900; font-size: 1.08rem; line-height: 1.35; }
.graphe .sous { color: var(--doux); font-size: .85rem; margin: .2rem 0 .6rem; }
.graphe .dessin { position: relative; width: 100%; }
.graphe svg { display: block; width: 100%; height: auto; overflow: visible; }
.graphe .source { color: var(--doux); font-size: .78rem; margin-top: .4rem; }
.graphe .lecture { font-size: .95rem; line-height: 1.55; margin: .7rem 0 0; color: var(--texte); max-width: 52rem; }
.graphe .vide { color: var(--doux); font-size: .92rem; border: 1px dashed var(--ligne); border-radius: var(--rayon); padding: 2rem 1rem; text-align: center; }
.separateur { border: 0; border-top: 1px solid var(--ligne); margin: .25rem 0; }

svg text { font-family: var(--corps); }
.axe { fill: var(--doux); font-size: 12px; }
.etiquette { fill: #333; font-size: 12.5px; }
.etiquette.forte { fill: var(--encre); font-weight: 700; }
.annotation { fill: #333; font-size: 12px; font-weight: 700; }

.infobulle { position: absolute; pointer-events: none; background: var(--panneau); border: 1px solid var(--ligne); border-radius: 8px; box-shadow: 0 6px 18px rgba(19, 41, 75, .12); padding: .35rem .6rem; font-size: .8rem; white-space: nowrap; z-index: 2; }
.infobulle b { color: var(--encre); }

/* ---------------------------------------------------------------- réglages et pied */
.objectifs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: .9rem; align-items: end; }
.objectif { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--doux); }
.objectif input { padding: .55rem .7rem; border: 1px solid var(--ligne); border-radius: 8px; background: var(--panneau); color: var(--texte); }
.pied { color: var(--doux); font-size: .8rem; margin: .9rem .25rem 0; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

@media (max-width: 640px) {
  .page { padding: 1.1rem .9rem 1.4rem; }
  .kpi .valeur { font-size: 1.8rem; }
  .chapeau h1 { font-size: 1.15rem; }
}
