/* Administration : sobre et lisible, sans effets. Suit le mode clair ou sombre de l'appareil. */
:root {
  color-scheme: light dark;
  --fond: #f6f6f4; --carte: #ffffff; --texte: #1f2328; --doux: #5c6670; --ligne: #d9dcdf;
  --accent: #2f5d50; --accent-texte: #ffffff; --danger: #b3261e; --attention: #fff4d6;
  /* Graphiques : une seule couleur de série, validée sur le fond des cartes dans les deux modes. */
  --serie: #2a78d6; --grille: #e6e8ea; --hausse: #006300; --baisse: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #16191c; --carte: #1f2327; --texte: #e8eaed; --doux: #a3acb5; --ligne: #353b41; --accent: #7fc4ad; --accent-texte: #10201b; --danger: #ff8a80; --attention: #3b3214; --serie: #3987e5; --grille: #2b3035; --hausse: #0ca30c; --baisse: #ff8a80; }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
h1 { margin: 0 0 1rem; font-size: 1.6rem; }
h2 { margin: 0 0 .75rem; font-size: 1.1rem; }
h2:not(:first-child) { margin-top: 1.5rem; }
main { max-width: 68rem; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

.barre { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.75rem; padding: .85rem 1.25rem; background: var(--carte); border-bottom: 1px solid var(--ligne); }
.barre-marque { color: var(--texte); font-weight: 700; text-decoration: none; }
.barre-marque span { font-weight: 400; color: var(--doux); }
.barre nav { display: flex; gap: 1.25rem; flex: 1; }
.barre nav a { color: var(--texte); text-decoration: none; padding-block: .2rem; }
.barre nav a[aria-current] { border-bottom: 2px solid var(--accent); font-weight: 600; }

.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: .5rem; padding: 1.25rem; margin-bottom: 1.25rem; }
.etroite { max-width: 24rem; margin: 3rem auto; }
.attention { background: var(--attention); }
.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.25rem; align-items: start; }
.colonnes .carte { margin: 0; }
.entete-page { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.entete-page h1 { margin: 0; }
.fil { margin: 0 0 .5rem; font-size: .9rem; color: var(--doux); }

label { display: block; margin: .9rem 0 .25rem; font-size: .9rem; font-weight: 600; }
input[type="text"], input[type="password"], input[type="number"], input[type="file"], textarea { width: 100%; padding: .55rem .65rem; border: 1px solid var(--ligne); border-radius: .35rem; background: var(--fond); color: inherit; font: inherit; }
textarea { resize: vertical; }
.champs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.champs .large { grid-column: span 2; }
.champs .pleine { grid-column: 1 / -1; }
.case { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.case input { width: 1.05rem; height: 1.05rem; }
.aide { margin: .3rem 0 0; font-size: .85rem; color: var(--doux); }
.erreur { padding: .6rem .8rem; border-radius: .35rem; background: var(--attention); }

.bouton { display: inline-block; margin-top: 1rem; padding: .6rem 1.1rem; border: 0; border-radius: .35rem; background: var(--accent); color: var(--accent-texte); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.entete-page .bouton { margin-top: 0; }
.bouton.secondaire { background: none; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.bouton.danger { background: var(--danger); color: #fff; }
.lien { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.lien.danger { color: var(--danger); }
details { margin-top: 1.25rem; }
summary { cursor: pointer; color: var(--danger); }

.messages p { margin: 0 0 .6rem; padding: .65rem .9rem; border-radius: .35rem; background: var(--carte); border: 1px solid var(--ligne); border-left: .25rem solid var(--accent); }
.onglets { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.onglets a { padding: .4rem .8rem; border: 1px solid var(--ligne); border-radius: 999px; background: var(--carte); color: var(--texte); text-decoration: none; }
.onglets a[aria-current] { border-color: var(--accent); font-weight: 600; }
.compte { color: var(--doux); font-weight: 400; }
.vide { color: var(--doux); }

.defilant { overflow-x: auto; background: var(--carte); border: 1px solid var(--ligne); border-radius: .5rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .8rem; border-bottom: 1px solid var(--ligne); text-align: left; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: .85rem; color: var(--doux); font-weight: 600; white-space: nowrap; }
.nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.carte table td { padding-inline: 0; }
.carte table td + td { padding-left: 1rem; }
.total td { font-weight: 700; }
.vignette { width: 4rem; }
.vignette img { display: block; width: 3rem; height: 3rem; object-fit: cover; border-radius: .25rem; }
dl { margin: 0; }
dl div { display: grid; grid-template-columns: 7.5rem 1fr; gap: .75rem; padding-block: .3rem; }
dt { color: var(--doux); }
dd { margin: 0; overflow-wrap: anywhere; }

.etat { display: inline-block; padding: .1rem .55rem; border: 1px solid var(--ligne); border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.etat-payee { border-color: var(--accent); color: var(--accent); }
.etat-abandonnee, .etat-en_attente, .etat-remboursee { color: var(--doux); }
.etat-cache { color: var(--doux); border-style: dashed; }
tr.cache td:nth-child(-n+4) { opacity: .55; }
.situation { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; }
.situation p { margin: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.actions .bouton { margin-top: 0; }
td form { margin: 0; }
.alerte { padding: .05rem .45rem; border-radius: .25rem; background: var(--attention); font-size: .82rem; font-weight: 600; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 1rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.photos img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .35rem; border: 1px solid var(--ligne); }
.photos form { margin-top: .25rem; }

/* ---------- Messages ---------- */
.pastille { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding-inline: .3rem; border-radius: 999px; background: var(--accent); color: var(--accent-texte); font-size: .75rem; font-weight: 700; vertical-align: text-top; }
tr.non-lu td { font-weight: 600; }
.extrait { max-width: 34rem; }
.texte-message { margin: .75rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.en-ligne { display: inline-block; margin-left: 1rem; }
.liste-simple { margin: 0; padding: 0; list-style: none; }
.liste-simple li { padding-block: .25rem; }
.colonnes .large { grid-column: span 2; }

/* ---------- Audience ---------- */
.filtres { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; }
.filtres .onglets { margin-bottom: 0; }
.bascule-internes { font-size: .9rem; }
.periode-dates { margin: .6rem 0 1rem; }
.tuiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin-bottom: 1.25rem; }
.tuile { padding: .9rem 1rem; background: var(--carte); border: 1px solid var(--ligne); border-radius: .5rem; }
.tuile p { margin: 0; }
.tuile-libelle { font-size: .88rem; color: var(--doux); }
.tuile-valeur { margin-top: .1rem; font-size: 1.7rem; font-weight: 600; line-height: 1.2; }
.tuile-ecart { font-size: .82rem; color: var(--doux); }
.tuile-ecart.hausse { color: var(--hausse); }
.tuile-ecart.baisse { color: var(--baisse); }
.tuile-base { color: var(--doux); }
.colonnes.deux-tiers { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); margin-bottom: 1.25rem; }
.colonnes { margin-bottom: 1.25rem; }
.colonnes > * { min-width: 0; }

.graphique { margin: 0 0 1.25rem; }
.graphique figcaption h2 { margin-bottom: .4rem; }
.graphique-plan { position: relative; }
.graphique svg { display: block; width: 100%; height: auto; overflow: visible; }
.grille { stroke: var(--grille); stroke-width: 1; }
.axe { stroke: var(--ligne); stroke-width: 1; }
.repere { fill: var(--doux); font-size: 11px; font-variant-numeric: tabular-nums; }
.trace { fill: none; stroke: var(--serie); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.aire { fill: var(--serie); opacity: .1; }
.point { fill: var(--serie); stroke: var(--carte); stroke-width: 2; }
.colonne { fill: var(--serie); }
.viseur { stroke: var(--doux); stroke-width: 1; }
.viseur[hidden] { display: none; }
.infobulle { position: absolute; top: 0; z-index: 2; min-width: 8rem; padding: .45rem .6rem; border: 1px solid var(--ligne); border-radius: .35rem; background: var(--carte); box-shadow: 0 4px 14px rgb(0 0 0 / .12); font-size: .82rem; pointer-events: none; }
.infobulle p { margin: 0; white-space: nowrap; }
.infobulle .infobulle-titre { color: var(--doux); }
.infobulle strong { font-weight: 700; }
.chiffres { margin-top: 0; }
.chiffres summary { color: var(--accent); font-size: .9rem; }
.defilant-interne { overflow-x: auto; max-height: 22rem; overflow-y: auto; margin-top: .5rem; }

.barre-h { display: block; height: .5rem; min-width: 3rem; }
.barre-h span { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--serie); }
.cellule-barre { width: 26%; min-width: 3.5rem; }
table.serre th, table.serre td { padding-block: .4rem; }
.carte table th { padding-inline: 0; }
.carte table th + th { padding-left: 1rem; }
.defilant-x { overflow-x: auto; }
.coupe { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
code { font-size: .85em; overflow-wrap: anywhere; }

.entonnoir { margin: 0; padding: 0; list-style: none; }
.entonnoir li { display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; padding-block: .55rem; border-bottom: 1px solid var(--ligne); }
.entonnoir li:last-child { border-bottom: 0; }
.entonnoir-nombre { font-weight: 600; font-variant-numeric: tabular-nums; }
.entonnoir .barre-h { grid-column: 1 / -1; }
.entonnoir-part { grid-column: 1 / -1; font-size: .82rem; color: var(--doux); }
.faits div { grid-template-columns: 9.5rem 1fr; }

.parcours { margin: 0; padding: 0; list-style: none; }
.parcours li { display: grid; grid-template-columns: 4.5rem 1fr; gap: .75rem; padding-block: .5rem; border-bottom: 1px solid var(--ligne); }
.parcours li:last-child { border-bottom: 0; }
.parcours-heure { color: var(--doux); font-variant-numeric: tabular-nums; }
.parcours-quoi { display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: baseline; }
.parcours-quoi .aide { flex-basis: 100%; margin: 0; }
.parcours-clic strong, .parcours-accord strong { font-weight: 400; color: var(--doux); }
.parcours-paiement_reussi strong { color: var(--hausse); }

@media (max-width: 60rem) {
  .tuiles { grid-template-columns: repeat(2, 1fr); }
  .colonnes.deux-tiers { grid-template-columns: 1fr; }
  .colonnes .large { grid-column: auto; }
}
@media (max-width: 40rem) {
  .champs { grid-template-columns: 1fr; }
  .champs .large { grid-column: auto; }
}
