:root{
  --encre:#1d1d1f;--gris:#6e6e73;--gris2:#a1a1a6;--fond:#f5f5f7;--carte:#ffffff;--ligne:#e5e5ea;--ligne2:#f0f0f2;--bord:#d2d2d7;
  --rouge:#d92d20;--vert:#1e7b3a;--vert2:#8cbf9b;--vert3:#3f7a52;--noire:#1d1d1f;--noire-texte:#ffffff;--noire-gris:#a1a1a6;
  --btn:#1d1d1f;--btn-texte:#ffffff;--btn-survol:#000000;--segs:#e8e8ed;--seg-on:#ffffff;--ombre:0 1px 3px rgba(0,0,0,.12);
  --ok-fond:#e8f3ec;--ok-texte:#14532d;--ko-fond:#fdecea;--ko-texte:#8a1c12;--voile:rgba(0,0,0,.35);
  color-scheme:light;
}
:root[data-theme="sombre"]{
  --encre:#f5f5f7;--gris:#a1a1a6;--gris2:#6e6e73;--fond:#000000;--carte:#1c1c1e;--ligne:#2c2c2e;--ligne2:#242426;--bord:#3a3a3c;
  --rouge:#ff6b5e;--vert:#3fbf6b;--vert2:#2f7a4a;--vert3:#7fd49b;--noire:#2c2c2e;--noire-texte:#ffffff;--noire-gris:#a1a1a6;
  --btn:#f5f5f7;--btn-texte:#000000;--btn-survol:#ffffff;--segs:#2c2c2e;--seg-on:#48484a;--ombre:none;
  --ok-fond:#0f2e1b;--ok-texte:#9be3b4;--ko-fond:#3a1512;--ko-texte:#ffb4ab;--voile:rgba(0,0,0,.6);
  color-scheme:dark;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--fond);color:var(--encre);font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--encre)}
.point{color:#d92d20}
.cache{display:none!important}

/* connexion */
.connexion{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:16px;background:#1d1d1f}
.connexion .boite{width:100%;max-width:440px;background:var(--carte);border-radius:28px;padding:44px 36px;display:flex;flex-direction:column;align-items:center;gap:20px;text-align:center}
.logo{font-size:21px;font-weight:700;letter-spacing:-.3px}
.connexion .logo{font-size:30px}
.connexion h1{margin:0;font-size:22px;font-weight:600}
.sous{font-size:15px;line-height:1.5;color:var(--gris);margin:0}
.petit{font-size:13px;line-height:1.5;color:var(--gris)}
.alerte{background:var(--ko-fond);color:var(--ko-texte);border-radius:12px;padding:10px 14px;font-size:14px;width:100%}

/* boutons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:44px;padding:0 22px;border:0;border-radius:999px;background:var(--btn);color:var(--btn-texte);font-weight:600;font-size:15px;cursor:pointer;text-decoration:none}
.btn:hover{background:var(--btn-survol)}
.btn.large{width:100%;min-height:52px;font-size:16px}
.btn:disabled{opacity:.5;cursor:default}
.btn2{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:0 16px;border:1px solid var(--bord);border-radius:999px;background:var(--carte);font-size:14px;font-weight:500;cursor:pointer;text-decoration:none;color:var(--encre)}
.btn2:hover{border-color:var(--encre)}
.lien{background:none;border:0;padding:0;color:var(--encre);text-decoration:underline;cursor:pointer;font-size:14px;text-align:left}

/* coquille */
.app{display:flex;flex-wrap:wrap;align-items:flex-start;min-height:100vh}
.menu{flex:1 1 240px;max-width:280px;padding:28px 16px;display:flex;flex-direction:column;gap:4px;background:var(--carte);border-right:1px solid var(--ligne);min-height:100vh}
.menu .tete{padding:0 14px 26px;display:flex;flex-direction:column;gap:4px}
.nav{display:flex;align-items:center;gap:12px;width:100%;min-height:44px;padding:0 14px;border:0;border-radius:12px;background:transparent;font-size:15px;font-weight:500;text-align:left;cursor:pointer}
.nav:hover{background:var(--fond)}
.nav.on{background:var(--btn);color:var(--btn-texte)}
.nav svg{flex:0 0 20px}
.menu .pied{margin-top:28px;padding:16px 14px;border-top:1px solid var(--ligne);display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--gris)}
.menu .pied b{color:var(--encre)}
.contenu{flex:999 1 560px;min-width:0;padding:36px 40px 64px}
.page{max-width:1100px;margin:0 auto;display:flex;flex-direction:column;gap:24px}
.entete{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px}
.entete h1{margin:4px 0 0;font-size:40px;font-weight:700;letter-spacing:-.8px}
@media (max-width:760px){.menu{max-width:none;min-height:0;border-right:0;border-bottom:1px solid var(--ligne);flex-direction:row;flex-wrap:wrap;padding:14px}.menu .tete{width:100%;padding:0 6px 10px}.menu .pied{display:none}.nav{width:auto;padding:0 12px}.contenu{padding:24px 16px 48px}.entete h1{font-size:30px}}

/* cartes */
.grille{display:grid;gap:16px}
.g4{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.g2{grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}
.g2l{grid-template-columns:repeat(auto-fit,minmax(min(420px,100%),1fr))}
.carte{background:var(--carte);border-radius:20px;padding:22px 24px;display:flex;flex-direction:column;gap:10px;min-width:0}
.carte.noire{background:var(--noire);color:var(--noire-texte)}
.carte.noire .etiquette,.carte.noire .detail{color:var(--noire-gris)}
.etiquette{font-size:14px;color:var(--gris)}
.chiffre{font-size:34px;font-weight:700;letter-spacing:-.6px;font-variant-numeric:tabular-nums}
.chiffre.gros{font-size:40px}
.chiffre.moyen{font-size:28px}
.detail{font-size:13px;color:var(--gris);line-height:1.4}
.titre-carte{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap;margin:0}
.titre-carte h2,h2.titre-carte{margin:0;font-size:17px;font-weight:600}
.vert{color:var(--vert)}.rouge{color:var(--rouge)}.grisc{color:var(--gris)}
.barre-tri{display:flex;height:12px;border-radius:999px;overflow:hidden;background:var(--ligne2)}
.legende{display:flex;flex-wrap:wrap;gap:16px;font-size:13px;color:var(--gris)}
.legende b{font-weight:600}
.pastille{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:6px;vertical-align:-1px;flex:0 0 10px}
.ligne-info{display:flex;justify-content:space-between;gap:12px;font-size:14px}
.ligne-info span:first-child{color:var(--gris)}

/* graphiques */
.colonnes{display:flex;align-items:flex-end;justify-content:space-between;gap:8px;height:200px;border-bottom:1px solid var(--ligne)}
.col{flex:1 1 0;display:flex;align-items:flex-end;justify-content:center;gap:4px;height:100%;min-width:0}
.col .b{width:40%;max-width:26px;border-radius:6px 6px 0 0}
.col .pile{width:60%;max-width:48px;display:flex;flex-direction:column-reverse;border-radius:6px 6px 0 0;overflow:hidden}
.col .pile>div+div{border-bottom:1px solid var(--carte)}
.etiquettes{display:flex;justify-content:space-between;gap:8px;margin-top:-4px}
.etiquettes div{flex:1 1 0;text-align:center;font-size:12px;color:var(--gris);min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hbar{display:flex;flex-direction:column;gap:6px}
.hbar .piste{height:8px;border-radius:999px;background:var(--ligne2)}
.hbar .rempli{height:8px;border-radius:999px;background:var(--rouge)}
.hbar.epais .piste,.hbar.epais .rempli{height:12px}
.liste-f{display:flex;justify-content:space-between;gap:16px;padding:9px 0;border-bottom:1px solid var(--ligne2)}
.liste-f .nom{font-size:14px;font-weight:500}
.liste-f .usage{font-size:12px;color:var(--gris)}
svg.courbe{width:100%;height:220px}
.beigne{display:flex;flex-wrap:wrap;align-items:center;gap:20px}
.beigne svg{width:180px;height:180px;flex:0 0 180px}
.beigne .leg{flex:1 1 220px;display:flex;flex-direction:column;gap:8px;min-width:0}
.beigne .leg .l{display:flex;align-items:center;gap:8px;font-size:14px}
.beigne .leg .l .n{flex:1 1 auto;min-width:0;line-height:1.3}
.beigne .leg .l .v{font-variant-numeric:tabular-nums}
.beigne .leg .l .p{color:var(--gris);font-size:12px;width:40px;text-align:right}

/* tableaux */
.barre-outils{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.filtres{display:inline-flex;align-self:flex-start;flex-wrap:wrap;gap:2px;padding:3px;border-radius:22px;background:var(--segs)}
.seg{min-height:36px;padding:0 16px;border:0;border-radius:999px;background:transparent;font-size:14px;font-weight:500;cursor:pointer}
.seg.on{background:var(--seg-on);box-shadow:var(--ombre)}
.boite-table{background:var(--carte);border-radius:20px;padding:8px 12px;overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:14px}
th{text-align:left;font-weight:500;color:var(--gris);font-size:12px;padding:10px 12px;border-bottom:1px solid var(--ligne);white-space:nowrap}
td{padding:13px 12px;border-bottom:1px solid var(--ligne2);white-space:nowrap}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}
td.fort{font-weight:500}
tr.pale td{color:var(--gris2)}
.progres{display:flex;align-items:center;gap:10px}
.progres .piste{flex:1 1 auto;min-width:80px;height:6px;border-radius:999px;background:var(--ligne2)}
.progres .rempli{height:6px;border-radius:999px;background:var(--encre)}
.recherche{min-height:40px;padding:0 14px;border:1px solid var(--bord);border-radius:999px;background:var(--carte);font-size:14px;min-width:220px}

/* à payer, qui doit */
.groupe-l{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid var(--ligne2)}
.groupe-l .quoi{font-size:15px;font-weight:500}
.groupe-l .droite{display:flex;align-items:center;gap:16px}
.total{display:flex;justify-content:space-between;gap:16px;padding-top:14px;border-top:2px solid var(--encre);font-weight:700}

/* fenêtre */
.voile{position:fixed;inset:0;background:var(--voile);display:flex;align-items:center;justify-content:center;padding:16px;z-index:10;overflow-y:auto}
.fenetre{width:100%;max-width:540px;background:var(--carte);border-radius:24px;padding:28px;display:flex;flex-direction:column;gap:18px;box-shadow:0 20px 60px rgba(0,0,0,.25);margin:auto}
.fenetre h2{margin:0;font-size:24px}
.form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.form .large{grid-column:span 2}
.champ{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--gris)}
.champ input,.champ select,.champ textarea{min-height:44px;padding:0 12px;border:1px solid var(--bord);border-radius:12px;font-size:15px;color:var(--encre);background:var(--carte)}
.champ textarea{padding:10px 12px;min-height:70px}
.actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.message{font-size:14px;border-radius:12px;padding:10px 14px}
.message.ok{background:var(--ok-fond);color:var(--ok-texte)}
.message.ko{background:var(--ko-fond);color:var(--ko-texte)}
.code{font-family:ui-monospace,Menlo,monospace;font-size:13px;background:var(--fond);border-radius:10px;padding:10px 12px;word-break:break-all;color:var(--encre)}
.chargement{padding:80px 0;text-align:center;color:var(--gris)}
@media (max-width:560px){.form{grid-template-columns:1fr}.form .large{grid-column:auto}}
