:root{
  --orange:#F97316; --orange-fonce:#EA580C; --orange-pale:#FFF3E9;
  --encre:#111827; --texte:#374151; --gris:#6B7280; --gris-clair:#F4F5F7;
  --bord:#E8EAEE; --vert:#059669; --bleu:#2563EB; --rouge:#DC2626;
  --rayon:18px; --ombre:0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.06);
  --police:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{font-family:var(--police);background:#F6F7F9;color:var(--texte);font-size:15px;line-height:1.45;
  -webkit-font-smoothing:antialiased;overscroll-behavior-y:none}
h1,h2,h3{margin:0;color:var(--encre);font-weight:700}
button{font-family:inherit;font-size:inherit;border:0;background:none;cursor:pointer;color:inherit}
input,select,textarea{font-family:inherit;font-size:16px;color:var(--encre);width:100%;
  border:1px solid var(--bord);border-radius:12px;padding:11px 12px;background:#fff;appearance:none}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--orange);box-shadow:0 0 0 3px rgba(249,115,22,.12)}
select{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236B7280'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat:no-repeat;background-position:right 8px center;background-size:22px;padding-right:34px}
.cache{display:none !important}
svg{width:22px;height:22px;fill:currentColor;display:block}

/* ------------------------------------------------------------- connexion */
.connexion{min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:24px;
  background:linear-gradient(160deg,#F97316,#EA580C 55%,#C2410C)}
.connexion-boite{background:#fff;border-radius:22px;padding:28px 22px;width:100%;max-width:380px;
  box-shadow:0 20px 50px rgba(0,0,0,.22);text-align:center}
.logo{width:56px;height:56px;margin:0 auto 14px;border-radius:16px;background:var(--orange);color:#fff;
  font-size:26px;font-weight:700;display:flex;align-items:center;justify-content:center}
.connexion h1{font-size:20px;margin-bottom:6px}
.connexion .aide{color:var(--gris);font-size:13.5px;margin:0 0 18px}
.connexion form{display:flex;flex-direction:column;gap:10px}
.erreur{color:var(--rouge);font-size:13px;min-height:18px;margin:10px 0 0}

/* ------------------------------------------------------------------ app */
.app{min-height:100dvh;padding-bottom:96px}
.entete{position:sticky;top:0;z-index:20;background:linear-gradient(135deg,#FB923C,#F97316 60%,#EA580C);
  color:#fff;padding:calc(env(safe-area-inset-top,0px) + 12px) 16px 0;border-radius:0 0 22px 22px;
  box-shadow:0 6px 20px rgba(249,115,22,.25)}
.entete-ligne{display:flex;align-items:center;gap:10px}
.entete-texte{flex:1;min-width:0}
.entete h1{font-size:19px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.entete-sous{display:none}
.icone-bouton{width:38px;height:38px;border-radius:12px;display:flex;align-items:center;justify-content:center;
  color:#fff;background:rgba(255,255,255,.16);flex:0 0 auto}
.icone-bouton svg{width:20px;height:20px}
.entete-stats{display:flex;gap:20px;padding:12px 2px 14px}
.entete-stats .bloc small{display:block;font-size:11.5px;opacity:.85;font-weight:500}
.entete-stats .bloc strong{font-size:19px;font-weight:700;letter-spacing:-.3px;font-variant-numeric:tabular-nums}
.onglets{display:flex;flex-wrap:wrap;gap:8px;padding-bottom:12px}
.onglets button{flex:0 0 auto;padding:7px 13px;border-radius:999px;background:rgba(255,255,255,.18);
  color:#fff;font-size:13px;font-weight:600}
.onglets button.actif{background:#fff;color:var(--orange-fonce)}
.vue{padding:16px 14px 0}

/* ---------------------------------------------------------------- cartes */
.carte{background:#fff;border-radius:var(--rayon);box-shadow:var(--ombre);padding:15px;margin-bottom:12px}
.carte-note{display:block;width:100%;text-align:left}
.carte-note .ligne{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.carte-note h3{font-size:16.5px;letter-spacing:-.2px}
.carte-note .montant{font-size:17px;font-weight:700;color:var(--encre);font-variant-numeric:tabular-nums}
.carte-note .pied{display:flex;align-items:center;justify-content:space-between;margin-top:9px;gap:10px}
.carte-note .nb{color:var(--gris);font-size:13px}
.pastille{display:inline-block;padding:3px 9px;border-radius:7px;font-size:11.5px;font-weight:700;letter-spacing:.2px}
.pastille.en_cours{background:#DBEAFE;color:#1D4ED8}
.pastille.validee{background:#FEF3C7;color:#B45309}
.pastille.remboursee{background:#D1FAE5;color:#047857}
.remb{font-size:12.5px;color:var(--gris)}
.remb b{color:var(--orange-fonce)}

/* ------------------------------------------------------------- depenses */
.depense{display:flex;align-items:center;gap:12px;background:#fff;border-radius:var(--rayon);
  box-shadow:var(--ombre);padding:12px;margin-bottom:10px;width:100%;text-align:left}
.depense .vignette{width:46px;height:46px;border-radius:14px;display:flex;align-items:center;justify-content:center;
  color:#fff;flex:0 0 auto}
.depense .vignette svg{width:24px;height:24px}
.depense .infos{flex:1;min-width:0}
.depense .nom{font-weight:600;color:var(--encre);font-size:14.8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.depense .meta{color:var(--gris);font-size:12.5px;margin-top:2px;display:flex;align-items:center;gap:6px}
.depense .prix{font-weight:700;color:var(--encre);font-variant-numeric:tabular-nums;white-space:nowrap}
.depense .droite{text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:5px}
.marqueur{display:inline-flex;align-items:center;gap:3px;color:var(--orange);font-size:11.5px;font-weight:600}
.marqueur svg{width:13px;height:13px}
.etiquette{font-size:10.5px;font-weight:700;padding:2px 7px;border-radius:6px;background:var(--gris-clair);color:var(--gris)}
.etiquette.oui{background:#DBEAFE;color:#1D4ED8}

/* --------------------------------------------------------------- boutons */
.bouton{border-radius:14px;padding:13px 16px;font-weight:650;font-size:15px;display:flex;
  align-items:center;justify-content:center;gap:8px;width:100%}
.bouton.principal{background:var(--orange);color:#fff;box-shadow:0 4px 12px rgba(249,115,22,.3)}
.bouton.principal:active{background:var(--orange-fonce)}
.bouton.secondaire{background:#fff;color:var(--encre);border:1px solid var(--bord)}
.bouton.texte{color:var(--orange-fonce);background:var(--orange-pale);box-shadow:none}
.bouton.danger{background:#FEF2F2;color:var(--rouge)}
.bouton svg{width:19px;height:19px}
.rangee-boutons{display:flex;gap:10px;margin:4px 0 16px}
.section-titre{font-size:12.5px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--gris);
  margin:18px 4px 8px}
.vide{text-align:center;color:var(--gris);padding:38px 18px;background:#fff;border-radius:var(--rayon);box-shadow:var(--ombre)}
.vide svg{width:44px;height:44px;color:#D1D5DB;margin:0 auto 10px}

/* ------------------------------------------------------------- feuille */
.voile{position:fixed;inset:0;background:rgba(17,24,39,.45);z-index:40;backdrop-filter:blur(2px)}
.feuille{position:fixed;left:0;right:0;bottom:0;z-index:50;background:#F6F7F9;border-radius:22px 22px 0 0;
  max-height:92dvh;display:flex;flex-direction:column;animation:monte .22s ease-out}
@keyframes monte{from{transform:translateY(30px);opacity:.6}to{transform:translateY(0);opacity:1}}
.feuille-entete{display:flex;align-items:center;justify-content:space-between;padding:16px 16px 8px;
  border-bottom:1px solid var(--bord);background:#fff;border-radius:22px 22px 0 0}
.feuille-entete h2{font-size:17px}
.feuille-entete .icone-bouton{background:var(--gris-clair);color:var(--gris)}
.feuille-corps{overflow-y:auto;padding:14px 14px calc(env(safe-area-inset-bottom,0px) + 20px)}
.champ{margin-bottom:11px}
.champ label{display:block;font-size:12.5px;font-weight:650;color:var(--gris);margin:0 0 5px 3px}
.champ .duo{display:flex;gap:10px}
.champ .duo>*{flex:1}
.bascule{display:flex;align-items:center;justify-content:space-between;background:#fff;border:1px solid var(--bord);
  border-radius:12px;padding:12px;margin-bottom:10px}
.bascule span{font-weight:600;color:var(--encre);font-size:14.5px}
.interrupteur{width:46px;height:27px;border-radius:999px;background:#D1D5DB;position:relative;transition:.15s;flex:0 0 auto}
.interrupteur::after{content:"";position:absolute;top:3px;left:3px;width:21px;height:21px;border-radius:50%;
  background:#fff;transition:.15s;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.interrupteur.actif{background:var(--orange)}
.interrupteur.actif::after{transform:translateX(19px)}
.apercu{width:100%;max-height:220px;object-fit:contain;border-radius:14px;background:var(--gris-clair);display:block}
.info-lecture{display:flex;align-items:center;gap:8px;background:#ECFDF5;color:#047857;border-radius:12px;
  padding:10px 12px;font-size:13px;font-weight:600;margin-bottom:12px}
.info-lecture.avertissement{background:#FEF3C7;color:#B45309}
.info-lecture svg{width:17px;height:17px;flex:0 0 auto}
.mini-rond{width:15px;height:15px;border-radius:50%;border:2px solid rgba(4,120,87,.25);
  border-top-color:#047857;animation:tourne .8s linear infinite;flex:0 0 auto}

/* ---------------------------------------------------------- chargement */
.chargement{position:fixed;inset:0;background:rgba(255,255,255,.86);z-index:60;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:14px;font-weight:600;color:var(--encre)}
.rond{width:42px;height:42px;border-radius:50%;border:3.5px solid var(--orange-pale);border-top-color:var(--orange);
  animation:tourne .8s linear infinite}
@keyframes tourne{to{transform:rotate(360deg)}}
.bulle{position:fixed;left:50%;bottom:110px;transform:translateX(-50%);z-index:70;background:var(--encre);
  color:#fff;padding:11px 16px;border-radius:12px;font-size:13.5px;font-weight:600;max-width:88vw;text-align:center;
  box-shadow:0 10px 30px rgba(0,0,0,.25)}

/* --------------------------------------------------------- navigation */
.action-principale{position:fixed;right:18px;bottom:calc(env(safe-area-inset-bottom,0px) + 78px);z-index:30;
  width:58px;height:58px;border-radius:50%;background:var(--orange);color:#fff;display:flex;align-items:center;
  justify-content:center;box-shadow:0 8px 22px rgba(249,115,22,.45)}
.action-principale svg{width:28px;height:28px}
.barre{position:fixed;left:0;right:0;bottom:0;z-index:30;display:flex;background:#fff;
  border-top:1px solid var(--bord);padding-bottom:env(safe-area-inset-bottom,0px)}
.onglet{flex:1;padding:9px 0 10px;display:flex;flex-direction:column;align-items:center;gap:3px;
  color:var(--gris);font-size:11px;font-weight:600}
.onglet svg{width:22px;height:22px}
.onglet.actif{color:var(--orange)}

/* -------------------------------------------------------------- divers */
.stats-carte{background:#fff;border-radius:var(--rayon);box-shadow:var(--ombre);padding:15px;margin-bottom:12px}
.stats-carte h3{font-size:15.5px;margin-bottom:12px}
.barre-cat{margin-bottom:11px}
.barre-cat .haut{display:flex;justify-content:space-between;font-size:13.5px;font-weight:600;color:var(--encre);margin-bottom:4px}
.barre-cat .haut span:last-child{font-variant-numeric:tabular-nums}
.barre-cat .jauge{height:8px;border-radius:5px;background:var(--gris-clair);overflow:hidden}
.barre-cat .jauge>div{height:100%;border-radius:5px}
.ligne-info{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid var(--bord);font-size:14px}
.ligne-info:last-child{border-bottom:0}
.ligne-info b{font-variant-numeric:tabular-nums}
.note-legere{font-size:12.5px;color:var(--gris);margin:6px 4px 14px}
@media (min-width:720px){
  .vue{max-width:640px;margin:0 auto}
  .entete{padding-left:max(16px,calc(50% - 320px));padding-right:max(16px,calc(50% - 320px))}
}
