/* SPIT Budget — charte SPIT (géométrique, sobre, angles francs, palette restreinte) */
:root {
  --spit-color-primary: #32455b;
  --spit-color-white: #ffffff;
  --spit-color-surface-subtle: #f3f5f7;
  --spit-color-surface-muted: #e4eaf0;
  --spit-color-deep: #243447;
  --spit-color-primary-hover: #273749;
  --spit-color-primary-active: #1d2937;
  --spit-color-surface-hover: #dce4ec;
  --spit-color-success: #1e5138;
  --spit-color-success-bg: #edf5f0;
  --spit-color-success-border: #9dc4ae;
  --spit-color-warning: #734f18;
  --spit-color-warning-bg: #faf3e8;
  --spit-color-warning-border: #d3b787;
  --spit-color-error: #822727;
  --spit-color-error-bg: #f9eded;
  --spit-color-error-border: #d89898;
  --spit-color-info-bg: #e8eef5;
  --spit-color-info-border: #b7cbdc;
  --spit-text-primary: var(--spit-color-deep);
  --spit-text-secondary: var(--spit-color-primary);
  --spit-text-muted: #576a80;
  --spit-text-inverse: #ffffff;
  --spit-text-disabled: #8d9faf;
  --field-border: #cbd5e1;
  --font-base: "Ebrima", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Consolas", "Courier New", monospace;
  --cut-trapezoid: polygon(9px 0%, calc(100% - 9px) 0%, 100% 100%, 0% 100%);
  --cut-parallelogram: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
  --cut-corner: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  --cut-chamfer: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --t-fast: 140ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-base); font-size: 16px; line-height: 1.5;
  color: var(--spit-text-primary); background: var(--spit-color-surface-subtle);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; color: var(--spit-color-deep); }
h1 { font-size: 1.5rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 12px; }
a { color: var(--spit-color-primary); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--spit-color-deep); outline-offset: 2px; }
.num, .amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--spit-text-muted); }
.small { font-size: .875rem; }
.xs { font-size: .75rem; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--spit-text-muted); }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.pos { color: var(--spit-color-success); }
.neg { color: var(--spit-color-error); }

/* ---------- Layout ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--spit-color-white);
  border-bottom: 1px solid var(--spit-color-surface-muted);
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
}
.topbar .logo { height: 22px; width: auto; display: block; }
.topbar .app-name { font-weight: 700; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--spit-color-primary);
  border-left: 1px solid var(--spit-color-surface-muted); padding-left: 12px; }
.topbar .spacer { flex: 1; }
.budget-switch { max-width: 44vw; border: 1px solid var(--spit-color-surface-muted); background: var(--spit-color-surface-subtle); padding: 6px 8px; font-size: .85rem; }
.icon-btn { background: none; border: 0; padding: 8px; cursor: pointer; color: var(--spit-color-primary); display: inline-flex; }
.icon-btn:hover { background: var(--spit-color-surface-subtle); }
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: square; stroke-linejoin: miter; }

main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px 16px calc(var(--tab-h) + 32px + var(--safe-b)); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--spit-color-deep); display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch;
}
.tabbar a { color: #b7c5d5; text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .68rem; letter-spacing: .04em; position: relative; }
.tabbar a .icon { width: 22px; height: 22px; }
.tabbar a.active { color: #fff; }
.tabbar a.active::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; background: #fff; }
.tabbar .add { align-self: center; justify-self: center; width: 58px; height: 46px; background: var(--spit-color-white); color: var(--spit-color-deep);
  clip-path: var(--cut-trapezoid); border: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tabbar .add .icon { width: 26px; height: 26px; stroke-width: 2.4; }

@media (min-width: 900px) {
  .app { padding-left: 220px; }
  .tabbar { top: 0; right: auto; width: 220px; height: auto; grid-template-columns: 1fr; grid-auto-rows: 52px; align-content: start; padding-top: 80px; }
  .tabbar a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 24px; font-size: .9rem; }
  .tabbar a.active::before { top: 12px; bottom: 12px; left: 0; right: auto; width: 3px; height: auto; }
  .tabbar .add { order: -1; justify-self: start; margin: 0 24px 16px; width: 172px; height: 44px; font-weight: 700; gap: 8px; }
  .tabbar .add::after { content: "Nouvelle opération"; font-size: .85rem; }
  .tabbar .add .icon { width: 20px; height: 20px; }
  main { padding-bottom: 48px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
}

/* ---------- Surfaces ---------- */
.panel { background: var(--spit-color-white); border: 1px solid var(--spit-color-surface-muted); padding: 16px; }
.panel + .panel { margin-top: 16px; }
.panel.cut { clip-path: var(--cut-corner); }
.panel.contrast { background: var(--spit-color-deep); border-color: var(--spit-color-deep); color: #fff; }
.panel.contrast h2, .panel.contrast h3, .panel.contrast .eyebrow { color: #c9d5e2; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 24px 0 10px; }
.section-title h2 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.section-title h2::before { content: ""; width: 9px; height: 9px; background: var(--spit-color-primary); transform: rotate(45deg); flex: none; }
.grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .grid.g2 { grid-template-columns: 1fr 1fr; } .grid.g3 { grid-template-columns: repeat(3, 1fr); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.banner { display: inline-block; background: var(--spit-color-primary); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding: 4px 18px; clip-path: var(--cut-parallelogram); margin-bottom: 6px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--spit-color-surface-muted); border: 1px solid var(--spit-color-surface-muted); }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--spit-color-white); padding: 14px 16px; }
.kpi .value { font-size: 1.35rem; font-weight: 700; color: var(--spit-color-deep); }
.kpi .sub { font-size: .75rem; color: var(--spit-text-muted); }
.hero { background: var(--spit-color-deep); color: #fff; padding: 18px 16px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: 0; bottom: 0; width: 160px; background: var(--spit-color-primary); transform: skewX(-20deg); opacity: .55; }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: #b7c5d5; }
.hero .big { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.meter { height: 8px; background: rgba(255,255,255,.18); margin-top: 12px; }
.meter > i { display: block; height: 100%; background: #fff; }
.meter.light { background: var(--spit-color-surface-muted); }
.meter.light > i { background: var(--spit-color-primary); }
.meter.light > i.over { background: var(--spit-color-error); }

/* ---------- Month picker ---------- */
.month-nav { display: inline-flex; align-items: stretch; border: 1px solid var(--spit-color-surface-muted); background: var(--spit-color-white); }
.month-nav button { background: none; border: 0; padding: 6px 10px; cursor: pointer; color: var(--spit-color-primary); }
.month-nav span { padding: 6px 4px; min-width: 128px; text-align: center; font-weight: 700; text-transform: capitalize; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border: 0; cursor: pointer;
  background: var(--spit-color-primary); color: #fff; font-weight: 700; font-size: .95rem; text-decoration: none; transition: background var(--t-fast); }
.btn:hover { background: var(--spit-color-primary-hover); }
.btn:active { background: var(--spit-color-primary-active); }
.btn.trap { clip-path: var(--cut-trapezoid); padding-left: 26px; padding-right: 26px; }
.btn.deep { background: var(--spit-color-deep); }
.btn.secondary { background: var(--spit-color-surface-muted); color: var(--spit-color-deep); }
.btn.secondary:hover { background: var(--spit-color-surface-hover); }
.btn.outline { background: transparent; color: var(--spit-color-primary); box-shadow: inset 0 0 0 1.5px var(--spit-color-primary); }
.btn.ghost { background: transparent; color: var(--spit-color-primary); }
.btn.ghost:hover { background: var(--spit-color-surface-subtle); }
.btn.danger { background: var(--spit-color-error); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .8rem; font-weight: 700; margin-bottom: 5px; color: var(--spit-color-deep); }
.field small { display: block; color: var(--spit-text-muted); font-size: .75rem; margin-top: 4px; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--field-border); background: #fff; border-radius: 0; appearance: none; }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--spit-color-primary) 50%), linear-gradient(135deg, var(--spit-color-primary) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.input:focus { border-color: var(--spit-color-primary); outline: 2px solid var(--spit-color-deep); outline-offset: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1.5px solid var(--spit-color-primary); }
.seg button { border: 0; background: #fff; padding: 9px 6px; font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--spit-color-primary); }
.seg button + button { border-left: 1.5px solid var(--spit-color-primary); }
.seg button.on { background: var(--spit-color-primary); color: #fff; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--spit-color-primary); margin: 2px 0 0; flex: none; }
.choice { display: grid; gap: 8px; }
.choice label { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--spit-color-surface-muted); background: #fff; cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--spit-color-primary); box-shadow: inset 3px 0 0 var(--spit-color-primary); background: var(--spit-color-surface-subtle); }
.choice input { accent-color: var(--spit-color-primary); width: 18px; height: 18px; }

/* ---------- Lists ---------- */
.list { background: #fff; border: 1px solid var(--spit-color-surface-muted); }
.list .day { padding: 8px 16px; background: var(--spit-color-surface-subtle); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--spit-text-muted); display: flex; justify-content: space-between; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--spit-color-surface-muted); cursor: pointer; background: #fff; width: 100%; text-align: left; border-left: 0; border-right: 0; border-bottom: 0; }
.list > .item:first-child { border-top: 0; }
.item:hover { background: var(--spit-color-surface-subtle); }
.item .title { font-weight: 700; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { font-size: .78rem; color: var(--spit-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .amount { font-weight: 700; }
.mark { width: 36px; height: 36px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem;
  background: var(--spit-color-surface-muted); color: var(--spit-color-deep); clip-path: var(--cut-chamfer); }
.mark.in { background: var(--spit-color-success-bg); color: var(--spit-color-success); }
.mark.sv { background: var(--spit-color-info-bg); color: var(--spit-color-deep); }
.mark.tr { background: #fff; box-shadow: inset 0 0 0 1.5px var(--spit-color-surface-muted); }
.empty { padding: 32px 16px; text-align: center; color: var(--spit-text-muted); }
.empty::before { content: ""; display: block; width: 14px; height: 14px; margin: 0 auto 12px; border: 2px solid var(--spit-color-primary); transform: rotate(45deg); }

.badge { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; background: var(--spit-color-surface-muted); color: var(--spit-color-deep); }
.badge.warn { background: var(--spit-color-warning-bg); color: var(--spit-color-warning); box-shadow: inset 0 0 0 1px var(--spit-color-warning-border); }
.badge.ok { background: var(--spit-color-success-bg); color: var(--spit-color-success); }

.feedback { padding: 12px 14px; border-left: 3px solid var(--spit-color-primary); background: var(--spit-color-info-bg); font-size: .9rem; margin-bottom: 12px; }
.feedback.warn { border-color: var(--spit-color-warning); background: var(--spit-color-warning-bg); color: var(--spit-color-warning); }
.feedback.err { border-color: var(--spit-color-error); background: var(--spit-color-error-bg); color: var(--spit-color-error); }
.feedback.ok { border-color: var(--spit-color-success); background: var(--spit-color-success-bg); color: var(--spit-color-success); }

/* ---------- Bars ---------- */
.bars { display: grid; gap: 12px; }
.bar-row .label { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 4px; gap: 8px; }
.bar-row .label b { font-weight: 700; }
.bar { height: 10px; background: var(--spit-color-surface-subtle); }
.bar > i { display: block; height: 100%; background: var(--spit-color-primary); }
.bar > i.alt { background: var(--spit-color-deep); }

/* ---------- Sheet / modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(36, 52, 71, .55); display: flex; align-items: flex-end; justify-content: center; animation: fade .14s ease; }
@media (min-width: 700px) { .overlay { align-items: center; } }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 94dvh; overflow: auto; padding: 0 16px calc(16px + var(--safe-b)); animation: up .18s ease; }
.sheet-head { position: sticky; top: 0; background: #fff; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; border-bottom: 1px solid var(--spit-color-surface-muted); margin-bottom: 14px; }
.sheet-head h2 { margin: 0; font-size: 1.05rem; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .overlay, .sheet { animation: none; } }

/* ---------- Quick add ---------- */
.amount-input { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 8px 0 4px; }
.amount-input input { border: 0; border-bottom: 3px solid var(--spit-color-primary); font-size: 2.4rem; font-weight: 700; width: 100%; max-width: 260px; text-align: right; padding: 4px 0; color: var(--spit-color-deep); background: transparent; border-radius: 0; }
.amount-input input:focus { outline: none; border-color: var(--spit-color-deep); }
.amount-input .cur { font-size: 1.6rem; font-weight: 700; color: var(--spit-text-muted); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 6px; max-height: 236px; overflow: auto; padding: 2px; }
.cat-chip { border: 1px solid var(--spit-color-surface-muted); background: #fff; padding: 9px 6px; font-size: .78rem; line-height: 1.2; cursor: pointer; text-align: center; min-height: 52px; display: flex; align-items: center; justify-content: center; }
.cat-chip.on { background: var(--spit-color-primary); color: #fff; border-color: var(--spit-color-primary); }
.cat-group-label { grid-column: 1 / -1; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--spit-text-muted); padding-top: 6px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 70; background: var(--spit-color-deep); color: #fff;
  padding: 12px 18px; font-size: .9rem; max-width: calc(100% - 32px); clip-path: var(--cut-chamfer); display: flex; gap: 12px; align-items: center; }
.toast button { background: none; border: 0; color: #fff; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---------- Table (vue annuelle type Excel) ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--spit-color-surface-muted); -webkit-overflow-scrolling: touch; }
table.annual { border-collapse: collapse; font-size: .8rem; min-width: 1100px; width: 100%; }
table.annual th, table.annual td { padding: 6px 8px; border-bottom: 1px solid var(--spit-color-surface-muted); text-align: right; white-space: nowrap; }
table.annual th:first-child, table.annual td:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
table.annual thead th { background: var(--spit-color-deep); color: #fff; font-weight: 700; position: sticky; top: 0; }
table.annual thead th:first-child { background: var(--spit-color-deep); z-index: 2; }
table.annual tr.kind td { background: var(--spit-color-primary); color: #fff; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .72rem; }
table.annual tr.kind td:first-child { background: var(--spit-color-primary); }
table.annual tr.group td { background: var(--spit-color-surface-subtle); font-weight: 700; }
table.annual tr.group td:first-child { background: var(--spit-color-surface-subtle); }
table.annual tr.total td { font-weight: 700; border-top: 2px solid var(--spit-color-deep); }
table.annual tr.result td { background: var(--spit-color-surface-muted); font-weight: 700; }
table.annual tr.result td:first-child { background: var(--spit-color-surface-muted); }
table.annual td.zero { color: var(--spit-text-disabled); }
table.annual td.clickable { cursor: pointer; }
table.annual td.clickable:hover { background: var(--spit-color-info-bg); }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font-base); fill: var(--spit-text-muted); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; display: inline-block; transform: rotate(45deg); }
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
@media (max-width: 420px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } }

/* ---------- Wallet ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.loyalty { position: relative; aspect-ratio: 1.586; background: var(--spit-color-primary); color: #fff; padding: 12px; cursor: pointer; border: 0; text-align: left;
  clip-path: var(--cut-corner); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.loyalty::after { content: ""; position: absolute; right: -30px; top: 0; bottom: 0; width: 90px; background: rgba(255,255,255,.08); transform: skewX(-20deg); }
.loyalty:nth-child(3n+2) { background: var(--spit-color-deep); }
.loyalty:nth-child(3n+3) { background: #3f5670; }
.loyalty .name { font-weight: 700; font-size: 1rem; position: relative; z-index: 1; }
.loyalty .code { font-family: var(--font-mono); font-size: .7rem; opacity: .75; position: relative; z-index: 1; }
.loyalty.add { background: #fff; color: var(--spit-color-primary); box-shadow: inset 0 0 0 1.5px var(--spit-color-primary); align-items: center; justify-content: center; font-weight: 700; }
.loyalty.add::after { display: none; }
.card-view { position: fixed; inset: 0; z-index: 60; background: #fff; display: flex; flex-direction: column; }
.card-view header { background: var(--spit-color-deep); color: #fff; padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; }
.card-view header h2 { color: #fff; margin: 0; }
.card-view .code-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 16px; }
.card-view svg.barcode { width: 100%; max-width: 520px; height: auto; }
.card-view .qr { width: min(72vw, 320px); height: auto; image-rendering: pixelated; }
.card-view .code-text { font-family: var(--font-mono); font-size: 1.1rem; letter-spacing: .1em; }
.card-view footer { padding: 16px; padding-bottom: calc(16px + var(--safe-b)); }
video.scan { width: 100%; max-height: 50vh; background: #000; object-fit: cover; }

/* ---------- Auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--spit-color-white); position: relative; overflow: hidden; }
.auth::before { content: ""; position: absolute; left: -10%; bottom: -20%; width: 70%; height: 60%; background: var(--spit-color-surface-subtle); transform: skewX(-25deg); }
.auth::after { content: ""; position: absolute; right: -15%; top: -10%; width: 45%; height: 40%; background: var(--spit-color-surface-muted); transform: skewX(-25deg); }
.auth .box { position: relative; z-index: 1; width: 100%; max-width: 400px; }
.auth .logo { height: 46px; width: auto; display: block; margin-bottom: 24px; }
.auth .tagline { color: var(--spit-text-muted); margin-bottom: 24px; }

/* ---------- Onboarding ---------- */
.steps { display: flex; gap: 4px; margin-bottom: 20px; }
.steps i { flex: 1; height: 4px; background: var(--spit-color-surface-muted); }
.steps i.on { background: var(--spit-color-primary); }
.ob-q { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; }

.offline-pill { font-size: .7rem; font-weight: 700; background: var(--spit-color-warning-bg); color: var(--spit-color-warning); padding: 3px 8px; border: 1px solid var(--spit-color-warning-border); }

.menu-list a, .menu-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; background: #fff; border: 0; border-top: 1px solid var(--spit-color-surface-muted); text-decoration: none; color: var(--spit-color-deep); cursor: pointer; font-weight: 700; text-align: left; }
.menu-list a:first-child, .menu-list button:first-child { border-top: 0; }
.menu-list a:hover, .menu-list button:hover { background: var(--spit-color-surface-subtle); }
.menu-list .chev { margin-left: auto; color: var(--spit-text-muted); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .input { min-height: 38px; padding: 6px 10px; width: auto; }
.toolbar .search { flex: 1; min-width: 160px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.preview-table th, .preview-table td { border-bottom: 1px solid var(--spit-color-surface-muted); padding: 5px 6px; text-align: left; white-space: nowrap; }
.preview-table th { background: var(--spit-color-surface-subtle); }

.tabbar .desk { display: none; }
@media (min-width: 900px) { .tabbar .desk { display: flex; } .tabbar .desk.hidden { display: none; } }

.grid > .panel + .panel { margin-top: 0; }
.panel > svg.chart { max-height: 300px; }
/* Aperçu d'import : lignes empilées lisibles sur téléphone */
.imp-list { border: 1px solid var(--spit-color-surface-muted); max-height: 60vh; overflow: auto; background: #fff; }
.imp-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--spit-color-surface-muted); }
.imp-row:first-child { border-top: 0; }
.imp-row.dup { opacity: .45; }
.imp-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--spit-color-primary); }
.imp-row .lbl { font-weight: 700; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-row .sub { grid-column: 2 / 4; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .78rem; color: var(--spit-text-muted); }
.imp-row .sub select { flex: 1; min-width: 160px; min-height: 34px; padding: 4px 28px 4px 8px; font-size: .8rem; }
.imp-row .sub label { display: inline-flex; gap: 4px; align-items: center; }

/* ---------- Case à cocher SPIT (carré, angles francs) ---------- */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; flex: none; margin: 0; cursor: pointer;
  border: 1.5px solid var(--spit-color-primary); background: #fff; display: inline-grid; place-content: center; border-radius: 0;
  transition: background var(--t-fast);
}
input[type="checkbox"]::before {
  content: ""; width: 12px; height: 12px; background: #fff; transform: scale(0); transition: transform 80ms ease;
  clip-path: polygon(14% 44%, 0 62%, 42% 100%, 100% 18%, 84% 4%, 40% 70%);
}
input[type="checkbox"]:checked { background: var(--spit-color-primary); }
input[type="checkbox"]:checked::before { transform: scale(1); }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--spit-color-deep); outline-offset: 2px; }

.roundup { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin: 0 0 14px; cursor: pointer;
  background: var(--spit-color-surface-subtle); border: 1px solid var(--spit-color-surface-muted); border-left: 3px solid var(--spit-color-primary); }
.roundup input { margin-top: 1px; }
.roundup b { font-size: .92rem; }

/* ---------- Comptes / soldes ---------- */
.acc-total { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 16px; background: var(--spit-color-surface-subtle); font-weight: 700; }
.balance-row .amount { text-align: right; }
.balance-row .est { display: block; font-size: .72rem; font-weight: 400; color: var(--spit-text-muted); }
.acc-edit { display: grid; grid-template-columns: 1fr 120px 110px 36px; gap: 6px; align-items: center; padding: 8px 0; border-top: 1px solid var(--spit-color-surface-muted); }
.acc-edit .input { min-height: 38px; padding: 6px 8px; font-size: .85rem; }
.acc-edit .pro { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-size: .8rem; color: var(--spit-text-muted); }
@media (max-width: 480px) { .acc-edit { grid-template-columns: 1fr 1fr; } .acc-edit .del { justify-self: end; } }
