:root { --bg:#f1f5f9; --card:#fff; --ink:#0f172a; --muted:#64748b; --line:#e2e8f0; --brand:#0f172a; --ok:#065f46; --okbg:#ecfdf5; --err:#9f1239; --errbg:#fff1f2; }
* { box-sizing: border-box; }
body.page { margin:0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background:var(--bg); color:var(--ink); min-height:100vh; }
.wrap { max-width:72rem; margin:0 auto; padding:0 1rem; }
.nav { background:var(--brand); color:#fff; }
.nav-inner { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:1rem; padding:.75rem 1rem; }
.brand { color:#fff; text-decoration:none; font-weight:600; }
.nav-links { display:flex; flex-wrap:wrap; gap:.75rem; font-size:.9rem; align-items:center; }
.nav-links a { color:#e2e8f0; text-decoration:none; }
.nav-links a:hover { color:#7dd3fc; }
.linkish { background:none; border:0; color:#e2e8f0; cursor:pointer; font:inherit; padding:0; }
.linkish:hover { color:#fda4af; }
.inline { display:inline; }
.main { padding:1.5rem 1rem; }
.alert { border-radius:.75rem; padding:.75rem 1rem; margin-bottom:1rem; font-size:.9rem; }
.alert.ok { background:var(--okbg); color:var(--ok); border:1px solid #a7f3d0; }
.alert.err { background:var(--errbg); color:var(--err); border:1px solid #fecdd3; }
.card { background:var(--card); border-radius:1rem; padding:1.25rem; box-shadow:0 1px 3px rgba(0,0,0,.08); }
.grid { display:grid; gap:1rem; }
@media (min-width:768px){ .grid-2{grid-template-columns:1fr 1fr;} .grid-3{grid-template-columns:2fr 1fr;} .span-2{grid-column:span 2;} }
h1 { font-size:1.5rem; margin:0 0 .25rem; }
h2 { font-size:1.1rem; margin:0 0 .75rem; }
.muted { color:var(--muted); font-size:.875rem; }
.hero { background:linear-gradient(135deg,#0f172a,#334155); color:#fff; border-radius:1rem; padding:1.5rem; }
.hero .big { font-size:2.5rem; font-weight:700; margin:.5rem 0; font-variant-numeric:tabular-nums; }
.stat-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:.75rem; margin-top:1rem; font-size:.875rem; }
@media (min-width:768px){ .stat-grid{grid-template-columns:repeat(4,1fr);} .hero .big{font-size:3rem;} }
.stat-grid .lbl { color:#94a3b8; }
table { width:100%; border-collapse:collapse; font-size:.875rem; }
th { text-align:left; color:var(--muted); border-bottom:1px solid var(--line); padding:.5rem 0; }
td { padding:.5rem 0; border-bottom:1px solid #f1f5f9; }
.right { text-align:right; }
.neg { color:#e11d48; }
.pos { color:#059669; }
.btn { display:inline-block; background:var(--brand); color:#fff; border:0; border-radius:.5rem; padding:.6rem 1rem; cursor:pointer; text-decoration:none; font-size:.9rem; }
.btn:hover { background:#1e293b; }
.btn-sm { padding:.35rem .7rem; font-size:.8rem; }
.btn-danger { background:#be123c; }
input, select, textarea { width:100%; padding:.5rem .75rem; border:1px solid #cbd5e1; border-radius:.5rem; font:inherit; }
label { display:block; font-size:.875rem; font-weight:500; margin-bottom:.25rem; }
.form-row { margin-bottom:1rem; }
.row { display:flex; gap:.75rem; flex-wrap:wrap; align-items:end; }
.row > * { flex:1; min-width:8rem; }
.login-box { max-width:28rem; margin:4rem auto; }
.dot { display:inline-block; width:.5rem; height:.5rem; border-radius:999px; margin-right:.25rem; }
.mb { margin-bottom:1.5rem; }
.flex-between { display:flex; justify-content:space-between; align-items:center; gap:1rem; }
ul.clean { list-style:none; padding:0; margin:0; }
ul.clean li { padding:.5rem 0; border-bottom:1px solid #f1f5f9; display:flex; justify-content:space-between; gap:.75rem; }
.badge { font-size:.75rem; color:#b45309; }

.accounts-row { display:flex; flex-wrap:nowrap; gap:1rem; overflow-x:auto; padding-bottom:.25rem; }
.account-tile { flex:1 1 12rem; min-width:12rem; max-width:18rem; }
.account-tile__provider { font-size:.7rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.account-tile__name { font-weight:600; margin:.2rem 0 .5rem; }
.account-tile__balance { font-size:1.5rem; font-weight:700; font-variant-numeric:tabular-nums; }
.account-tile__meta { font-size:.75rem; margin-top:.35rem; }
.account-tile--locked { opacity:.85; border:1px dashed #cbd5e1; }
.accounts-empty { text-align:center; padding:1.75rem 1.25rem; }
.hero .neg { color:#fda4af; }

.kind { display:inline-block; font-size:.7rem; font-weight:600; padding:.15rem .45rem; border-radius:999px; background:#e2e8f0; color:#334155; white-space:nowrap; }
.kind-transfer { background:#e0f2fe; color:#075985; }
.kind-giro { background:#f1f5f9; color:#334155; border:1px dashed #94a3b8; }
.kind-card { background:#fce7f3; color:#9d174d; }
.kind-card_settlement { background:#e7e5e4; color:#44403c; border:1px dashed #a8a29e; }
.kind-direct_debit { background:#ffedd5; color:#9a3412; }
.kind-cash { background:#ecfccb; color:#3f6212; }
.kind-other { background:#f1f5f9; color:#475569; }

.pager { display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap; padding:.75rem 0; border-top:1px solid var(--line); margin-top:1rem; }
.pager a { color:#0f172a; text-decoration:none; font-weight:600; }
.pager a:hover { color:#0284c7; }
.pager-disabled { color:#94a3b8; }
.pager-status { font-size:.85rem; }

.tx-table { table-layout: fixed; width: 100%; }
.tx-table th, .tx-table td { padding: .7rem .85rem; vertical-align: middle; }
.tx-table th { white-space: nowrap; }
.tx-table .col-date { width: 7.5rem; }
.tx-table .col-bank { width: 8.5rem; white-space: nowrap; font-weight: 600; }
.tx-table .col-desc { width: 32%; max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-table .col-kind { width: 8.5rem; }
.tx-table .col-cat { width: 11rem; }
.tx-table .col-amount { width: 7.5rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tx-table .cat-form { margin: 0; }
.tx-table .cat-form select { width: 100%; min-width: 0; }
@media (max-width: 900px) {
  .tx-table .col-desc { width: 28%; }
  .tx-table th, .tx-table td { padding: .55rem .6rem; }
}

.budget-rings { display:grid; grid-template-columns:repeat(auto-fill, minmax(9.5rem, 1fr)); gap:1.25rem; }
.budget-ring { text-align:center; }
.budget-ring__chart {
  width: 7.5rem; height: 7.5rem; border-radius: 50%;
  margin: 0 auto .6rem; display:grid; place-items:center;
}
.budget-ring__hole {
  width: 5rem; height: 5rem; border-radius: 50%; background: var(--card);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  box-shadow: inset 0 0 0 1px #f1f5f9;
}
.budget-ring__spent { font-weight:700; font-size:.95rem; font-variant-numeric:tabular-nums; line-height:1.1; }
.budget-ring__of { font-size:.7rem; }
.budget-ring__name { font-weight:600; font-size:.9rem; }
.budget-ring__meta { font-size:.75rem; margin-top:.15rem; }
.budget-ring.is-over .budget-ring__spent { color:#e11d48; }

.month-nav { display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap; }
.month-nav__current { text-align:center; flex:1; }
.month-nav a { color:#0f172a; text-decoration:none; font-weight:600; }
.month-nav a:hover { color:#0284c7; }
