/* Argos — mobile d'abord. Pas de framework : ~150 lignes suffisent. */
:root {
  --bg: #f4f5f7; --card: #ffffff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --accent: #2563eb; --up: #15803d; --down: #b91c1c; --warn-bg: #fef3c7; --warn: #92400e;
  --urgent: #dc2626; --attention: #d97706; --info: #2563eb;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1220; --card: #111a2e; --text: #e5e7eb; --muted: #94a3b8; --line: #1f2a44;
          --accent: #60a5fa; --up: #4ade80; --down: #f87171; --warn-bg: #3b2f0b; --warn: #fde68a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.4rem; margin: .25rem 0 .75rem; }
h2 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; letter-spacing: .04em; color: var(--text); }
.content { padding: 1rem 1rem calc(4.5rem + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem;
  padding: .5rem 0 .4rem; font-size: .7rem; color: var(--muted); }
.tabbar a.active { color: var(--accent); font-weight: 600; }
.tabbar .ico { font-size: 1.15rem; line-height: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin: 0 0 .75rem; }
.label { display: block; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.big { font-size: 2.2rem; font-weight: 700; margin: .1rem 0 .6rem; letter-spacing: -.02em; }
.kpi { font-size: 1.15rem; font-weight: 600; }
.split, .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .75rem; }
.split > div, .kpis > div { display: flex; flex-direction: column; }
.up { color: var(--up); } .down { color: var(--down); }
.muted { color: var(--muted); } .small { font-size: .8rem; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: .6rem; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.thin { height: 5px; margin-top: .35rem; }
.bar.near span { background: var(--attention); } .bar.over span { background: var(--urgent); }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.row-head h2 { margin: 1.25rem 0 .5rem; }
ul.items, ul.list, ul.tx, ul.holdings, ul.budgets, ul.cats { list-style: none; margin: 0 0 .75rem; padding: 0; }
.item { background: var(--card); border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px; padding: .75rem .9rem; margin-bottom: .5rem; }
.item.urgent { border-left-color: var(--urgent); } .item.attention { border-left-color: var(--attention); } .item.info { border-left-color: var(--info); }
.item p { margin: .3rem 0 .5rem; font-size: .9rem; color: var(--muted); }
.item-head { display: flex; align-items: center; gap: .5rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .6; }
.chip { display: inline-block; font-size: .8rem; font-weight: 600; padding: .3rem .7rem; border-radius: 99px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.empty { color: var(--muted); font-size: .9rem; padding: .5rem 0; }
.list li, .tx li { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child, .tx li:last-child { border-bottom: 0; }
.tx-date { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3em; }
.tx-desc { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tx-desc, .h-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-desc small, .h-main small, .h-side small { color: var(--muted); font-size: .75rem; }
.tx-amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.holdings li { display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.holdings li:last-child { border-bottom: 0; }
.holdings .bar { grid-column: 1 / -1; }
.h-main, .h-side { display: flex; flex-direction: column; min-width: 0; }
.h-side { text-align: right; }
.budgets li, .cats li { padding: .5rem 0; border-bottom: 1px solid var(--line); } .budgets li:last-child, .cats li:last-child { border-bottom: 0; }
.banner { border-radius: 12px; padding: .75rem 1rem; margin-bottom: .75rem; font-size: .85rem; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner ul { margin: .3rem 0 0 1rem; padding: 0; }
.disclaimer { color: var(--muted); font-size: .72rem; margin-top: 1.5rem; }
/* Connexion */
.login { max-width: 360px; margin: 10vh auto 0; text-align: center; }
.login h1 { font-size: 2rem; letter-spacing: .05em; }
.login form { text-align: left; display: flex; flex-direction: column; gap: .6rem; }
.login label { font-size: .85rem; color: var(--muted); }
input[type=password], input[type=text] { font: inherit; padding: .75rem .9rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
button.primary { font: inherit; font-weight: 600; padding: .8rem; border: 0; border-radius: 10px; background: var(--accent); color: #fff; }
button.link { font: inherit; background: none; border: 0; color: var(--muted); padding: 0; }
.error { color: var(--down); font-size: .9rem; margin: 0; }
.actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.actions button.primary { padding: .6rem 1rem; }
