/* CPA Price Intelligence 360° — interface locale V0.4 (aucune ressource externe). */
:root {
  --fond: #f5f6f8;
  --surface: #ffffff;
  --texte: #1d2433;
  --texte-doux: #5b6475;
  --bordure: #dfe3ea;
  --primaire: #1f4e79;
  --primaire-clair: #e8f0f8;
  --accent: #c8102e;
  --ok: #1e7b4f;
  --ok-fond: #e6f4ed;
  --alerte: #a15c00;
  --alerte-fond: #fdf3e2;
  --danger: #b42318;
  --danger-fond: #fdecea;
  --info: #3d5a80;
  --info-fond: #eaf0f7;
  --simu: #6b3fa0;
  --simu-fond: #f1ebf8;
  --rayon: 8px;
  --ombre: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--texte);
  background: var(--fond);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #12161f;
    --surface: #1b212d;
    --texte: #e6e9ef;
    --texte-doux: #a3abbb;
    --bordure: #2c3443;
    --primaire: #7fb2e5;
    --primaire-clair: #1f2c3d;
    --ok-fond: #15301f;
    --ok: #6fcf97;
    --alerte-fond: #33270f;
    --alerte: #f2c46d;
    --danger-fond: #3a1714;
    --danger: #f28b82;
    --info-fond: #1c2738;
    --info: #9cb7d9;
    --simu-fond: #2a2038;
    --simu: #c7a6ec;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.45; }
a { color: var(--primaire); }
.fictif {
  background: var(--accent); color: #fff; text-align: center; font-size: 12px;
  padding: 3px 8px; letter-spacing: 0.02em;
}
.entete {
  display: flex; align-items: center; gap: 16px; padding: 10px 24px;
  background: var(--surface); border-bottom: 1px solid var(--bordure); flex-wrap: wrap;
}
.marque { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--texte); }
.marque span { color: var(--accent); }
.espaces { display: flex; gap: 6px; }
.espaces a, .navigation a {
  padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--texte-doux);
  font-weight: 500;
}
.espaces a.actif, .navigation a.actif { background: var(--primaire-clair); color: var(--primaire); }
.utilisateur { margin-left: auto; display: flex; gap: 10px; align-items: center; color: var(--texte-doux); }
.navigation {
  display: flex; gap: 4px; padding: 8px 24px; background: var(--surface);
  border-bottom: 1px solid var(--bordure); flex-wrap: wrap; align-items: center;
}
.navigation .recherche { margin-left: auto; display: flex; gap: 6px; }
.contenu { max-width: 1280px; margin: 0 auto; padding: 20px 24px 64px; }
.contenu:focus { outline: none; } /* focus programmatique après navigation (lecteurs d'écran) */
h1 { font-size: 22px; margin: 6px 0 4px; }
h2 { font-size: 17px; margin: 22px 0 10px; }
h3 { font-size: 15px; margin: 14px 0 6px; }
.sous-titre { color: var(--texte-doux); margin: 0 0 16px; }
.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.carte {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon);
  padding: 14px 16px; box-shadow: var(--ombre);
}
.carte .libelle { color: var(--texte-doux); font-size: 13px; }
.carte .valeur { font-size: 24px; font-weight: 650; margin-top: 2px; }
.carte .detail { font-size: 13px; color: var(--texte-doux); margin-top: 4px; }
.bloc { margin-top: 18px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--bordure); vertical-align: top; font-size: 14px; }
th { background: var(--primaire-clair); color: var(--primaire); font-weight: 600; font-size: 13px; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.cliquable { cursor: pointer; }
tr.cliquable:hover td { background: var(--primaire-clair); }
.pastille {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.p-ok { background: var(--ok-fond); color: var(--ok); }
.p-alerte { background: var(--alerte-fond); color: var(--alerte); }
.p-danger { background: var(--danger-fond); color: var(--danger); }
.p-info { background: var(--info-fond); color: var(--info); }
.p-simu { background: var(--simu-fond); color: var(--simu); }
button, .bouton {
  font: inherit; border: 1px solid var(--primaire); background: var(--primaire); color: #fff;
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: 500;
}
button.secondaire { background: transparent; color: var(--primaire); }
button.danger { background: var(--danger); border-color: var(--danger); }
button:disabled { opacity: 0.55; cursor: wait; }
input, select, textarea {
  font: inherit; padding: 6px 8px; border: 1px solid var(--bordure); border-radius: 6px;
  background: var(--surface); color: var(--texte);
}
textarea { width: 100%; min-height: 70px; }
form.formulaire { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); align-items: end; }
form.formulaire label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--texte-doux); }
form.formulaire .large { grid-column: 1 / -1; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.message { padding: 10px 14px; border-radius: var(--rayon); margin: 10px 0; }
.m-erreur { background: var(--danger-fond); color: var(--danger); }
.m-ok { background: var(--ok-fond); color: var(--ok); }
.m-info { background: var(--info-fond); color: var(--info); }
.m-simu { background: var(--simu-fond); color: var(--simu); }
.m-alerte { background: var(--alerte-fond); color: var(--alerte); }
.liste-puces { margin: 6px 0; padding-left: 20px; }
.liste-puces li { margin: 3px 0; }
.colonnes { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .colonnes { grid-template-columns: 1fr; } }
.connexion { max-width: 720px; margin: 30px auto; }
.connexion .identite { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 0; }
.petit { font-size: 12px; color: var(--texte-doux); }
.barre { height: 8px; background: var(--bordure); border-radius: 4px; position: relative; margin-top: 6px; }
.barre .zone { position: absolute; top: 0; bottom: 0; background: var(--primaire-clair); border: 1px solid var(--primaire); border-radius: 4px; }
.barre .point { position: absolute; top: -4px; width: 4px; height: 16px; background: var(--accent); border-radius: 2px; }
.cadre-pdf { width: 100%; height: 640px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: #fff; }
.chargement { color: var(--texte-doux); }
details summary { cursor: pointer; color: var(--primaire); }
.trace { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; color: var(--texte-doux); }

/* Lecture des chiffres (prix, référence, écart, gain ; niveaux de marge) */
details.lecture { margin: 8px 0 14px; padding: 8px 12px; background: var(--info-fond); border-radius: 8px; }
details.lecture summary { cursor: pointer; color: var(--info); font-weight: 600; }
details.lecture dl { margin: 8px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
details.lecture dt { font-weight: 600; }
details.lecture dd { margin: 0; }
.legende-zone { display: inline-block; width: 18px; height: 8px; background: var(--primaire-clair); border: 1px solid var(--primaire); border-radius: 3px; vertical-align: middle; }
.legende-point { display: inline-block; width: 4px; height: 12px; background: var(--accent); border-radius: 2px; vertical-align: middle; }
@media (max-width: 700px) { details.lecture dl { grid-template-columns: 1fr; } }
