:root {
  --fond: #f2f5f4; --carte: #ffffff; --trait: #dbe5e1; --encre: #0e1f1a; --doux: #52655e; --neutre: #aebdb7;
  --marque: #0b6e55; --marque-fond: #e3f2ec; --or: #e9c870; --nuit: #0b241e; --nuit-doux: #9fc0b4;
  --gain: #1a9e80; --perte: #d9622b; --alerte-fond: #fff4d6; --alerte-trait: #e2b13c;
  --ombre: 0 1px 2px rgba(8, 40, 30, .06), 0 6px 18px rgba(8, 40, 30, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0a1512; --carte: #12211c; --trait: #223a32; --encre: #e9f3ef; --doux: #9ab3aa; --neutre: #526b62;
    --marque: #45cfa4; --marque-fond: #17382d; --nuit: #071a15;
    --alerte-fond: #352b12; --alerte-trait: #8a6d22; --ombre: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 15px/1.5 Geist, system-ui, sans-serif; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--marque); outline-offset: 2px; }

header { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center;
  padding: 12px 28px; background: var(--nuit); color: #fff; border-bottom: 3px solid var(--or); }
.marque { display: flex; gap: 12px; align-items: center; line-height: 1.15; }
.marque strong { font-size: 18px; }
.marque small { display: block; color: var(--or); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.logo { display: block; border-radius: 50%; }
nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
nav a { padding: 8px 10px; border-radius: 8px; color: var(--nuit-doux); text-decoration: none; font-weight: 600; }
nav a:hover { color: #fff; }
nav a[aria-current] { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 -2px 0 var(--or); }
nav .nombre { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px;
  background: var(--or); color: #1d1604; font-size: 12px; text-align: center; }
.choix-mois { display: flex; gap: 8px; align-items: center; color: var(--nuit-doux); }
.choix-mois select { background: #123a2f; border-color: #2b5a4b; color: #fff; font-weight: 600; }
header :focus-visible { outline-color: var(--or); }
header form .puce { background: transparent; border-color: #2b5a4b; color: #fff; font-weight: 600; }
header form .puce:hover { border-color: var(--or); }
#fiche header { background: none; color: inherit; border: 0; }
select, input[type=search], input[type=text], input[type=number] { padding: 7px 10px; border: 1px solid var(--trait);
  border-radius: 8px; background: var(--carte); }

main { max-width: 1120px; margin: 0 auto; padding: 24px 20px 60px; }
h1 { margin: 0 0 4px; font-size: 24px; }
h1::first-letter { text-transform: uppercase; }
h2 { margin: 0 0 12px; font-size: 16px; }
.sous-titre { margin: 0 0 20px; color: var(--doux); }
.montant, .valeur, input[type=number] { font-variant-numeric: tabular-nums; }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 20px;
  box-shadow: var(--ombre); }
.carte + .carte, .grille + .carte, .carte + .grille, .grille + .grille { margin-top: 16px; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grille > .carte { margin: 0; }

.bandeau { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding: 14px 18px; border: 1px solid var(--alerte-trait); border-radius: 12px;
  background: var(--alerte-fond); }
.bouton { padding: 9px 16px; border: 0; border-radius: 8px; background: var(--marque); color: var(--carte);
  font-weight: 600; text-decoration: none; display: inline-block; }
.bouton.discret { background: transparent; color: var(--marque); border: 1px solid var(--trait); }
.lien { padding: 0; border: 0; background: none; color: var(--marque); font-weight: 600; text-decoration: none; }

.heros { text-align: center; padding: 30px 20px; background: linear-gradient(135deg, #0b241e, #0f4a3a); color: #fff; border: 0; }
.tuile { border-top: 3px solid var(--marque); }
.tuile .etiquette { color: var(--doux); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.heros .etiquette { color: var(--or); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.heros .valeur { font-size: 58px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.tuile .valeur { font-size: 30px; font-weight: 700; }
.tuile p { margin: 4px 0 0; color: var(--doux); }
.heros p { margin: 4px 0 0; color: #cfe5dd; }
.heros .lien { color: var(--or); }
.valeur.negatif::before, .valeur.positif::before { content: ""; display: inline-block; width: .28em; height: .28em;
  margin-right: .25em; border-radius: 50%; vertical-align: middle; background: var(--perte); }
.valeur.positif::before { background: var(--gain); }

details.poste { border-top: 1px solid var(--trait); }
details.poste:first-of-type { border-top: 0; }
.ligne-poste { display: grid; grid-template-columns: minmax(150px, 230px) 1fr 110px; gap: 14px; align-items: center;
  padding: 11px 0; list-style: none; cursor: pointer; }
.ligne-poste::-webkit-details-marker { display: none; }
.ligne-poste .nom::before { content: "▸ "; color: var(--doux); }
details[open] > .ligne-poste .nom::before { content: "▾ "; }
.ligne-poste.fixe { cursor: default; border-top: 2px solid var(--encre); font-weight: 700; }
.ligne-poste.fixe .nom::before { content: ""; }
.piste { height: 10px; }
.barre { display: block; height: 10px; border-radius: 0 4px 4px 0; background: var(--gain); }
.barre.perte { background: var(--perte); }
.montant { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sous-lignes { margin: 0 0 12px 18px; padding: 0; list-style: none; color: var(--doux); }
.sous-lignes li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }

.divergent { display: grid; grid-template-columns: minmax(90px, 140px) 1fr 80px; gap: 10px; align-items: center;
  width: 100%; padding: 6px 4px; border: 0; border-radius: 6px; background: none; text-align: left; }
.divergent:hover { background: var(--marque-fond); }
.axe { position: relative; height: 12px; }
.axe i { position: absolute; top: 0; height: 12px; }
.axe i.g { background: var(--gain); border-radius: 0 4px 4px 0; }
.axe i.p { background: var(--perte); border-radius: 4px 0 0 4px; }
.axe b { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--neutre); }

.outils { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.outils input[type=search] { min-width: 220px; }
.puce { padding: 6px 13px; border: 1px solid var(--trait); border-radius: 999px; background: var(--carte); }
.puce[aria-pressed=true] { border-color: var(--marque); background: var(--marque-fond); color: var(--marque); font-weight: 600; }
.defile { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--trait); text-align: left; vertical-align: middle; }
th { color: var(--doux); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
th button { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
td.montant, th.montant { text-align: right; }
tbody tr.cliquable { cursor: pointer; }
tbody tr.cliquable:hover { background: var(--marque-fond); }
.etat { display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--trait);
  color: var(--doux); font-size: 12px; white-space: nowrap; }
.etat.fort { border-color: var(--alerte-trait); background: var(--alerte-fond); color: var(--encre); }
.operation { max-width: 420px; overflow-wrap: anywhere; }
.operation small { display: block; color: var(--doux); }
.retenir { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px;
  background: var(--marque-fond); border-radius: 10px; }

#voile { position: fixed; inset: 0; z-index: 4; background: rgba(20, 12, 8, .45); }
#fiche { position: fixed; z-index: 5; top: 0; right: 0; bottom: 0; width: min(460px, 100%); overflow-y: auto;
  padding: 24px; background: var(--carte); border-left: 1px solid var(--trait); }
#fiche header { position: static; justify-content: space-between; padding: 0 0 14px; }
#message { position: fixed; z-index: 6; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: 90%;
  padding: 12px 20px; border-radius: 12px; background: var(--encre); color: var(--fond); }

.point { display: grid; grid-template-columns: 130px 1fr auto; gap: 14px; align-items: center; padding: 13px 0;
  border-top: 1px solid var(--trait); }
.point:first-child { border-top: 0; }
.point p { margin: 0; color: var(--doux); }
.depot { display: block; padding: 48px 20px; border: 2px dashed var(--neutre); border-radius: 14px;
  text-align: center; cursor: pointer; }
.depot.survol { border-color: var(--marque); background: var(--marque-fond); }
.depot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.depot:focus-within { outline: 2px solid var(--marque); }
.note { color: var(--doux); font-size: 13px; }

@media (max-width: 700px) {
  header, main { padding-left: 14px; padding-right: 14px; }
  header { position: static; justify-content: space-between; }
  nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; }
  nav a { white-space: nowrap; }
  .heros .valeur { font-size: 40px; }
  .ligne-poste { grid-template-columns: 1fr 100px; }
  .ligne-poste .piste { display: none; }
  .point { grid-template-columns: 1fr; gap: 6px; }
}

.controle { display: grid; grid-template-columns: minmax(180px, 1fr) 110px 110px 110px 150px; gap: 12px; align-items: center;
  padding: 12px 0; list-style: none; cursor: pointer; }
.controle::-webkit-details-marker { display: none; }
.controle small { display: block; color: var(--doux); font-size: 12px; }
.controle .etat { justify-self: end; }
.detail { padding: 0 0 16px 18px; }
.alerte-ligne { padding: 10px 14px; border: 1px solid var(--alerte-trait); border-radius: 8px; background: var(--alerte-fond); }
@media (max-width: 700px) {
  .controle { grid-template-columns: 1fr 1fr; }
  .controle > span:empty { display: none; }
  .controle .montant { text-align: left; }
}
@media (max-width: 700px) { .controle .etat { justify-self: start; } }

input.court { width: 76px; text-align: right; padding: 5px 6px; }
td.signale { background: var(--alerte-fond); }
#fiche.large { width: min(920px, 100%); }
.champs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 12px; }
.champs label span, .acces-boite label span { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.champs input, .champs select, .saisie input, .saisie select { width: 100%; padding: 7px 8px; border: 1px solid var(--trait);
  border-radius: 8px; background: var(--carte); }
.case { display: block; margin-bottom: 12px; }
.saisie td { padding: 4px; }
.saisie input, .saisie select { min-width: 96px; }
.saisie select { min-width: 160px; }
.saisie td:first-child input { min-width: 200px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.sortie { background: transparent; border-color: #2b5a4b; color: #fff; font-weight: 600; }
.attente { text-align: center; padding: 60px 20px; color: var(--doux); }
body.acces header { display: none; }
.acces-boite { max-width: 384px; margin: 8vh auto 0; }
.acces-marque { text-align: center; margin-bottom: 28px; }
.acces-marque img { display: block; margin: 0 auto; border-radius: 50%; }
.acces-marque strong { display: block; margin-top: 12px; font-size: 24px; color: var(--marque); }
.acces-marque span { color: var(--doux); }
.acces-boite form { display: grid; gap: 14px; padding: 24px; border-radius: 16px; }
.acces-boite h1, .acces-boite .sous-titre { margin: 0; }
.acces-boite input { width: 100%; padding: 12px 14px; border: 1px solid var(--trait); border-radius: 12px; background: var(--carte); font-size: 16px; }
.acces-boite .bouton { padding: 13px; border-radius: 12px; font-weight: 700; }
.acces-boite .note { text-align: center; }
.point small { display: block; color: var(--doux); }
.sortie { margin-left: auto; }
@media (max-width: 1360px) {
  nav { order: 3; flex: 1 0 100%; }
  .choix-mois { margin-left: auto; }
  .sortie { margin-left: 0; }
}
