/* Budget famille : tokens de la maquette validée (2026-11-11). Thème clair seulement. */

@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(/static/fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(/static/fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(/static/fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(/static/fonts/inter-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Manrope; font-weight: 700; font-display: swap; src: url(/static/fonts/manrope-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(/static/fonts/manrope-latin-800-normal.woff2) format("woff2"); }

:root {
  --fond: #F3F5F9;
  --surface: #FFFFFF;
  --bord: #DDE2EC;
  --filet: #EDF0F5;
  --texte: #161A24;
  --texte-2: #565D6E;
  --accent: #2F55A4;
  --accent-fort: #21407F;
  --accent-doux: #EEF2FA;
  --barre: #B9C5DD;
  --jauge: #E4E8F0;
  --ok: #2F7D55; --t-ok: #2A7049; --p-ok-bg: #E3F1E9; --p-ok: #25694A;
  --att: #C27A1A; --t-att: #94590F; --p-att-bg: #F8EBD7; --p-att: #85500E;
  --dep: #B03A33; --t-dep: #A8342D; --p-dep-bg: #F6E0DE; --p-dep: #9C322C;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--fond);
  color: var(--texte);
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-fort); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { font-family: inherit; }

.s { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.h { font-family: Manrope, Inter, sans-serif; font-weight: 800; margin: 0; }
.k { font-size: 12.5px; color: var(--texte-2); }
.num { font-variant-numeric: tabular-nums; }
.fort { font-weight: 600; }
.grand { font-size: 34px; }

.tete { padding: 22px 16px 6px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.tete h1 { font-size: 28px; }
.tete-poste { padding: 18px 16px 4px; }
.tete-poste h1 { font-size: 28px; }
.retour { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; text-decoration: none; font-weight: 600; font-size: 14px; }

.pile { padding: 8px 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--bord); border-radius: 14px; padding: 14px 16px; }
.grp { display: flex; justify-content: space-between; align-items: baseline; margin: 10px 2px 0; gap: 10px; }
.grp h2 { font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--texte-2); margin: 0; font-weight: 700; }
.row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }

.bar { position: relative; height: 10px; border-radius: 5px; background: var(--jauge); margin-top: 7px; }
.fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--texte); border-radius: 1px; }
.bar-l { height: 12px; border-radius: 6px; margin-top: 10px; }
.bar-l .fill { border-radius: 6px; }
.bar-l .mark { top: -5px; bottom: -5px; }
.fill.ok { background: var(--ok); } .fill.att { background: var(--att); } .fill.dep { background: var(--dep); }
.t-ok { color: var(--t-ok); } .t-att { color: var(--t-att); } .t-dep { color: var(--t-dep); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.p-ok { background: var(--p-ok-bg); color: var(--p-ok); }
.p-att { background: var(--p-att-bg); color: var(--p-att); }
.p-dep { background: var(--p-dep-bg); color: var(--p-dep); }
.p-neutre { background: var(--jauge); color: #464D5E; }

.poste { padding: 12px 0; border-bottom: 1px solid var(--filet); }
.poste:last-child { border-bottom: none; padding-bottom: 2px; }
.poste a { color: var(--texte); text-decoration: none; display: block; }
.li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--filet); font-size: 14px; }
.li:last-child { border-bottom: none; }
.li > .num { white-space: nowrap; }
.done { color: var(--t-ok); font-size: 12px; font-weight: 600; }
.later { color: var(--texte-2); font-size: 12px; }
.legende-trait { display: flex; gap: 8px; align-items: center; margin: -4px 2px 0; }
.legende-trait span { display: inline-block; width: 2px; height: 14px; background: var(--texte); }

/* Fin de mois sur l'année */
.annee { display: flex; align-items: flex-end; gap: 6px; height: 72px; margin-top: 14px; border-bottom: 1px solid var(--bord); }
.annee-b { flex: 1; background: var(--barre); border-radius: 3px 3px 0 0; display: block; }
.annee-b.fort { background: var(--accent); }
.annee-b.prevue { background: repeating-linear-gradient(135deg, var(--accent) 0 3px, #FFFFFF 3px 6px); border: 1px solid var(--accent); border-bottom: none; }
.annee-b.neg { background: var(--dep); }
.annee-l { display: flex; gap: 6px; font-size: 10.5px; color: var(--texte-2); margin-top: 4px; text-align: center; }
.annee-l span { flex: 1; }
.annee-l span.fort { color: var(--texte); }

/* Poste : historique */
.encadre { margin-top: 12px; padding: 12px; background: var(--accent-doux); border-radius: 10px; }
.histo { display: flex; gap: 6px; align-items: flex-end; border-bottom: 1px solid var(--bord); }
.col { position: relative; flex: 1; display: flex; align-items: flex-end; height: 96px; }
.col .b { width: 100%; background: var(--barre); border-radius: 3px 3px 0 0; }
.col .t { position: absolute; left: -2px; right: -2px; height: 2px; background: var(--texte); }
.legende-histo { display: flex; gap: 14px; margin-top: 8px; }
.pt-depense { display: inline-block; width: 10px; height: 10px; background: var(--barre); border-radius: 2px; margin-right: 5px; }
.pt-prevu { display: inline-block; width: 12px; height: 2px; background: var(--texte); vertical-align: 3px; margin-right: 5px; }

/* Boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 14px; border: 1px solid transparent; font-family: inherit; text-decoration: none; cursor: pointer; }
.btn-p { background: var(--accent); color: #FFFFFF; }
.btn-p:hover { background: var(--accent-fort); color: #FFFFFF; }
.btn-s { background: var(--surface); border-color: #CBD2DF; color: var(--texte); }
.champ { margin-bottom: 16px; }
.champ label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.saisie { width: 100%; min-height: 46px; border: 1px solid var(--bord); border-radius: 10px; padding: 11px 12px; font-size: 15px; background: var(--fond); color: var(--texte); font-family: inherit; }
.saisie:focus { border-color: var(--accent); outline: none; }

.login { max-width: 360px; margin: 0 auto; min-height: 100vh; padding: 20px 16px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.login h1 { font-size: 26px; text-align: center; }
.login-erreur { color: var(--t-dep); font-size: 13px; margin: 0 0 12px; }

/* Barre du bas (Mois · Enveloppes · Vacances · Budget) : affichée quand un 2e écran existera. */
.tabbar { position: sticky; bottom: 0; margin-top: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--bord); padding: 8px 4px 14px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--texte-2); text-decoration: none; min-height: 44px; justify-content: center; }
.tabbar a.on { color: var(--accent); font-weight: 700; }
.tabbar svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
