/* ==========================================================
   Patrimonio · Finanze personali
   ========================================================== */
:root {
  --bg: #f4f5f9;
  --bg-2: #eceef4;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --surface-3: #eef0f6;
  --border: rgba(15, 23, 42, .08);
  --border-strong: rgba(15, 23, 42, .15);
  --text: #0f172a;
  --text-2: #4b5567;
  --text-3: #8b94a7;
  --accent: #5850ec;
  --accent-2: #22d3ee;
  --accent-soft: rgba(88, 80, 236, .1);
  --on-accent: #fff;
  --pos: #059669;
  --pos-soft: rgba(5, 150, 105, .1);
  --neg: #e11d48;
  --neg-soft: rgba(225, 29, 72, .09);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, .12);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -18px rgba(15, 23, 42, .18);
  --shadow-lg: 0 40px 90px -30px rgba(15, 23, 42, .45);
  --radius: 18px;
  --radius-sm: 11px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #090b10;
  --bg-2: #0d1017;
  --surface: #11141c;
  --surface-2: #161a24;
  --surface-3: #1c212d;
  --border: rgba(255, 255, 255, .065);
  --border-strong: rgba(255, 255, 255, .12);
  --text: #e9ecf3;
  --text-2: #a5adbf;
  --text-3: #687186;
  --accent: #7c7cff;
  --accent-soft: rgba(124, 124, 255, .14);
  --pos: #34d399;
  --pos-soft: rgba(52, 211, 153, .12);
  --neg: #fb7185;
  --neg-soft: rgba(251, 113, 133, .12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .13);
  --shadow: 0 1px 0 rgba(255, 255, 255, .025) inset, 0 16px 40px -24px rgba(0, 0, 0, .8);
  --shadow-lg: 0 40px 100px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 14px/1.5 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: var(--accent-soft); }
.i { flex: none; display: block; }
.num, .money { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Privacy mode */
.privacy .money { filter: blur(7px); transition: filter .2s; }
.privacy .money:hover { filter: none; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 2px;
  padding: 20px 14px;
  border-right: 1px solid var(--border);
  background: var(--bg-2);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--text-3); letter-spacing: 0; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, .7);
}
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 8px 11px; }
.nav a.active .i { color: var(--accent); }
.side-foot {
  margin-top: auto; padding: 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.side-foot .label { font-size: 12px; color: var(--text-3); }
.side-foot .v { font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0; }

.main { min-width: 0; width: 100%; max-width: 1440px; margin: 0 auto; padding: 26px 34px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.topbar h1 { font-size: 26px; line-height: 1.2; margin: 0; letter-spacing: -.025em; font-weight: 700; }
.topbar .subtitle { color: var(--text-3); font-size: 13px; margin-top: 3px; }
.topbar .actions { display: flex; gap: 8px; align-items: center; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.c-12 { grid-column: span 12; } .c-8 { grid-column: span 8; } .c-7 { grid-column: span 7; }
.c-6 { grid-column: span 6; } .c-5 { grid-column: span 5; } .c-4 { grid-column: span 4; } .c-3 { grid-column: span 3; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 15px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
.card-sub { font-size: 12.5px; color: var(--text-3); }
.link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }
.muted { color: var(--text-3); }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus-visible, .seg button:focus-visible, .tx:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: 0 8px 20px -10px var(--accent); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--neg); }
.btn-danger:hover { background: var(--neg-soft); }
.btn-icon { width: 38px; padding: 0; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-sm.btn-icon { width: 32px; }

.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:hover { border-color: var(--text-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
textarea.input { height: auto; padding: 10px 13px; resize: vertical; }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b94a7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); font-weight: 400; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.seg {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 9px;
  font-weight: 600; font-size: 12.5px; color: var(--text-3); transition: color .15s, background .15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 1px var(--border); }
[data-theme="dark"] .seg button.on { background: var(--surface-3); }
.seg-full { display: flex; width: 100%; }
.seg-full button { flex: 1; padding: 9px 10px; font-size: 13.5px; }
.seg button.on.t-expense { color: var(--neg); }
.seg button.on.t-income { color: var(--pos); }
.seg button.on.t-transfer { color: var(--accent); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 650; }
.badge.pos { background: var(--pos-soft); }
.badge.neg { background: var(--neg-soft); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.neutral { background: var(--surface-3); color: var(--text-2); }

/* ---------- Hero / net worth ---------- */
.hero { position: relative; overflow: hidden; padding: 24px 24px 12px; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 480px; height: 480px; pointer-events: none;
  background: radial-gradient(circle, var(--accent-soft), transparent 65%);
}
.hero-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 12.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; }
.big { font-size: 40px; font-weight: 750; letter-spacing: -.035em; line-height: 1.1; margin: 6px 0 8px; }
.delta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; }
.delta .muted { font-weight: 500; }
.chart { position: relative; height: 270px; margin: 10px -6px 0; user-select: none; touch-action: pan-y; }
.chart svg { display: block; overflow: visible; }
.chart .gl { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .yl, .chart .xl { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .guide { stroke: var(--text-3); stroke-dasharray: 3 3; opacity: 0; }
.chart .dot { opacity: 0; }
.chart.hover .guide, .chart.hover .dot { opacity: 1; }
.tip {
  position: absolute; top: 0; left: 0; pointer-events: none; opacity: 0; transform: translate(-50%, -110%);
  background: var(--text); color: var(--bg); padding: 8px 11px; border-radius: 10px; font-size: 12px; white-space: nowrap;
  box-shadow: var(--shadow-lg); transition: opacity .12s;
}
.tip b { display: block; font-size: 14px; letter-spacing: -.01em; }
.chart.hover .tip { opacity: 1; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--text-3); font-size: 13px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.kpi { padding: 18px 20px; }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .k-label { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.kpi .k-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.kpi .k-ic.pos { background: var(--pos-soft); color: var(--pos); }
.kpi .k-ic.neg { background: var(--neg-soft); color: var(--neg); }
.kpi .k-ic.acc { background: var(--accent-soft); color: var(--accent); }
.kpi .k-val { font-size: 23px; font-weight: 720; letter-spacing: -.025em; margin: 10px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-foot { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---------- Accounts ---------- */
.acc-list { display: flex; flex-direction: column; gap: 4px; }
.acc-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 9px 8px; border-radius: 12px; text-decoration: none; }
.acc-row:hover { background: var(--surface-2); }
.acc-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; background: color-mix(in srgb, var(--c) 16%, transparent); }
.acc-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-type { font-size: 12px; color: var(--text-3); }
.acc-bal { font-weight: 650; text-align: right; }
.acc-share { height: 6px; border-radius: 6px; overflow: hidden; display: flex; background: var(--surface-3); margin: 4px 0 14px; }
.acc-share span { height: 100%; }

.acc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.acc-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 14px; }
.acc-card::after { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--c); }
.acc-card .top { display: flex; gap: 12px; align-items: center; }
.acc-card .bal { font-size: 28px; font-weight: 740; letter-spacing: -.03em; line-height: 1.1; }
.acc-card .spark { height: 46px; }
.acc-card .spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.acc-card .foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.acc-card.excluded { opacity: .75; }
.acc-total { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-end; }
.acc-total .big { font-size: 34px; margin: 4px 0 0; }

/* ---------- Transactions ---------- */
.tx-list { display: flex; flex-direction: column; }
.tx-day { display: flex; justify-content: space-between; align-items: center; padding: 14px 8px 6px; font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.tx-day:first-child { padding-top: 2px; }
.tx {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  width: 100%; text-align: left; padding: 9px 8px; border-radius: 12px; border: 0; background: transparent;
  transition: background .12s;
}
.tx:hover { background: var(--surface-2); }
.tx-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.tx-main { min-width: 0; display: flex; flex-direction: column; }
.tx-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { font-weight: 680; text-align: right; white-space: nowrap; }
.tx-amt small { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.tx.future { opacity: .6; }

.filters { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(4, minmax(130px, 1fr)); gap: 10px; }
.search { position: relative; }
.search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 38px; }
.sumbar { display: flex; gap: 28px; flex-wrap: wrap; padding: 14px 4px 4px; }
.sumbar div { display: flex; flex-direction: column; }
.sumbar small { font-size: 12px; color: var(--text-3); font-weight: 600; }
.sumbar b { font-size: 17px; letter-spacing: -.01em; }

/* ---------- Donut & breakdown ---------- */
.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 22px; align-items: center; }
.donut { position: relative; width: 170px; height: 170px; }
.donut svg { width: 100%; height: 100%; display: block; }
.donut .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .center small { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.donut .center b { font-size: 17px; letter-spacing: -.02em; }
.legend { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 13px; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.legend-row .pc { color: var(--text-3); font-size: 12px; width: 38px; text-align: right; }
.legend-row .vl { font-weight: 600; text-align: right; }

.cat-table { display: flex; flex-direction: column; gap: 14px; }
.cat-line { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.cat-line .tx-ic { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }
.cat-line .meta { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.cat-line .meta b { font-weight: 600; }

.bar { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 8px; background: var(--c, var(--accent)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar.lg { height: 12px; }

/* ---------- Monthly bars ---------- */
.mbars { display: flex; align-items: stretch; gap: 6px; height: 220px; padding-top: 8px; }
.mcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; position: relative; }
.mcol .stack2 { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-radius: 8px; padding: 0 2px; transition: background .15s; }
.mcol:hover .stack2 { background: var(--surface-2); }
.mcol .b { width: min(18px, 40%); border-radius: 5px 5px 2px 2px; min-height: 2px; transition: height .5s cubic-bezier(.2,.8,.2,1); }
.mcol .b.inc { background: var(--pos); }
.mcol .b.exp { background: var(--neg); opacity: .85; }
.mcol .ml { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: capitalize; }
.mcol.cur .ml { color: var(--text); }
.mcol .mt {
  position: absolute; bottom: calc(100% - 4px); left: 50%; transform: translateX(-50%); z-index: 5;
  background: var(--text); color: var(--bg); border-radius: 10px; padding: 8px 11px; font-size: 12px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s; box-shadow: var(--shadow-lg);
}
.mcol:hover .mt { opacity: 1; }
.leg-inline { display: flex; gap: 14px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.leg-inline i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Budget ---------- */
.month-nav { display: inline-flex; align-items: center; gap: 4px; }
.month-nav b { min-width: 150px; text-align: center; text-transform: capitalize; font-size: 14px; }
.budget-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 140px; gap: 14px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--border); }
.budget-row:first-child { border-top: 0; }
.budget-row .meta { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 7px; flex-wrap: wrap; }
.budget-row .meta b { font-weight: 650; font-size: 14px; }
.budget-row .input { height: 36px; text-align: right; }
.b-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 4px 0 18px; }
.b-sum small { display: block; font-size: 12px; color: var(--text-3); font-weight: 600; }
.b-sum b { font-size: 20px; letter-spacing: -.02em; }

/* ---------- Recurring / settings lists ---------- */
.list-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: 0; }
.list-row .acts { display: flex; gap: 4px; }
.list-row.paused { opacity: .55; }
.set-section h3 { margin: 0 0 4px; font-size: 15px; }
.set-section p { margin: 0 0 14px; color: var(--text-3); font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-mini { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 6px 4px; border-radius: 10px; }
.cat-mini:hover { background: var(--surface-2); }
.cat-mini .tx-ic { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--text-3); }
.empty .e-ic { font-size: 34px; margin-bottom: 8px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.onboard { text-align: center; padding: 56px 24px; }
.onboard h2 { font-size: 28px; letter-spacing: -.03em; margin: 18px 0 8px; }
.onboard p { color: var(--text-2); max-width: 520px; margin: 0 auto 24px; font-size: 15px; }
.onboard .brand-logo { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 760px; margin: 36px auto 0; text-align: left; }
.features div { padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.features b { display: block; color: var(--text); margin-bottom: 2px; font-size: 14px; }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px;
  background: rgba(6, 8, 14, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .16s ease-out;
}
.modal {
  width: min(560px, 100%); max-height: calc(100dvh - 36px); overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg);
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.2);
}
.modal.sm { width: min(420px, 100%); }
.m-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 4px; }
.m-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.m-body { padding: 14px 22px 8px; display: flex; flex-direction: column; gap: 16px; }
.m-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 14px 22px 22px; }
.m-foot .spacer { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.amount-field { display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border-strong); transition: border-color .15s, box-shadow .15s; }
.amount-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.amount-field span { font-size: 26px; font-weight: 600; color: var(--text-3); }
.amount-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 34px; font-weight: 720; letter-spacing: -.03em; height: 56px; font-variant-numeric: tabular-nums; }
.t-expense .amount-field input { color: var(--neg); }
.t-income .amount-field input { color: var(--pos); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cat-opt { position: relative; }
.cat-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cat-opt label {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--text-2); text-align: center;
  transition: border-color .12s, background .12s, color .12s;
}
.cat-opt label .e { font-size: 20px; line-height: 1; }
.cat-opt label:hover { border-color: var(--border-strong); }
.cat-opt input:checked + label { border-color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: var(--text); box-shadow: 0 0 0 1px var(--c) inset; }
.cat-opt input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.only-transfer { display: none; }
.is-transfer .only-transfer { display: flex; }
.is-transfer .no-transfer { display: none; }
.is-adjust .no-adjust { display: none; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches label { width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: 0 0 0 2px var(--surface) inset; border: 2px solid transparent; transition: transform .1s; }
.swatches label:hover { transform: scale(1.08); }
.swatches input:checked + label { border-color: var(--c); box-shadow: 0 0 0 3px var(--surface) inset; }

.sheet-nav a { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 15px; }
.sheet-nav a:hover, .sheet-nav a.active { background: var(--surface-2); }
.sheet-nav a.active .i { color: var(--accent); }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 14px; align-items: center; padding: 11px 12px 11px 16px; border-radius: 13px;
  background: var(--text); color: var(--bg); font-weight: 550; font-size: 13.5px; box-shadow: var(--shadow-lg);
  animation: pop .2s ease-out;
}
.toast button { border: 0; background: rgba(127, 127, 127, .22); color: inherit; padding: 5px 11px; border-radius: 8px; font-weight: 700; }

/* ---------- Mobile tab bar ---------- */
.tabbar { display: none; }
.fab { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .c-8, .c-7, .c-5, .c-4 { grid-column: span 12; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr 1fr 1fr; }
  .filters .search { grid-column: span 3; }
}
@media (max-width: 1180px) and (min-width: 901px) {
  .c-6 { grid-column: span 12; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 16px; }
  .topbar h1 { font-size: 22px; }
  .topbar .hide-m { display: none; }
  .grid { gap: 14px; }
  .c-6, .c-3 { grid-column: span 12; }
  .card { padding: 16px; border-radius: 16px; }
  .hero { padding: 18px 16px 8px; }
  .big { font-size: 32px; }
  .chart { height: 220px; }
  .kpis { gap: 12px; }
  .kpi { padding: 14px; }
  .kpi .k-val { font-size: 19px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-top: 1px solid var(--border);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border: 0; background: none;
    font-size: 10.5px; font-weight: 600; color: var(--text-3); text-decoration: none;
  }
  .tabbar .active { color: var(--accent); }
  .tabbar .plus { justify-self: center; width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; padding: 0; color: #fff; background: linear-gradient(135deg, #6366f1, #22d3ee); box-shadow: 0 10px 24px -8px rgba(99, 102, 241, .8); margin-top: -18px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .search { grid-column: span 2; }
  .donut-wrap { grid-template-columns: 130px 1fr; gap: 16px; }
  .donut { width: 130px; height: 130px; }
  .features { grid-template-columns: 1fr; }
  .overlay { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; animation: slideup .25s cubic-bezier(.2, .9, .3, 1); padding-bottom: env(safe-area-inset-bottom); }
  .modal.sm { width: 100%; }
  .toasts { bottom: calc(92px + env(safe-area-inset-bottom)); width: calc(100% - 32px); }
  .budget-row { grid-template-columns: 36px minmax(0, 1fr) 104px; gap: 10px; }
  .b-sum { grid-template-columns: 1fr 1fr; }
  .list-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .list-row .acts { grid-column: 2 / -1; }
  .mbars { height: 180px; gap: 3px; }
}
@media (max-width: 480px) {
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .donut-wrap .legend { width: 100%; }
  .row { grid-template-columns: 1fr; }
  .kpi .k-val { font-size: 17px; }
  .hero-head .seg { width: 100%; }
  .hero-head .seg button { flex: 1; }
  .acc-cards { grid-template-columns: 1fr; }
}
@keyframes slideup { from { transform: translateY(40px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================
   v2 · Premium — Christian Perito
   ========================================================== */
:root {
  --display: "Sora", "Inter", var(--font);
  --grad: linear-gradient(135deg, #6d6afe 0%, #8b5cf6 45%, #22d3ee 100%);
  --grad-text: linear-gradient(100deg, #6d6afe 0%, #a855f7 40%, #06b6d4 100%);
  --surface-solid: #ffffff;
  --bg: #f1f2f7;
  --surface: rgba(255, 255, 255, .78);
  --bg-2: rgba(255, 255, 255, .55);
  --aur-1: rgba(109, 106, 254, .16); --aur-2: rgba(34, 211, 238, .12); --aur-3: rgba(16, 185, 129, .08);
  --gridline: rgba(15, 23, 42, .035);
}
[data-theme="dark"] {
  --bg: #05060a;
  --bg-2: rgba(9, 11, 17, .72);
  --surface: rgba(16, 19, 29, .74);
  --surface-solid: #0f121b;
  --surface-2: rgba(255, 255, 255, .035);
  --surface-3: rgba(255, 255, 255, .07);
  --border: rgba(255, 255, 255, .075);
  --border-strong: rgba(255, 255, 255, .13);
  --accent: #8b8cff;
  --grad-text: linear-gradient(100deg, #a5b4fc 0%, #c084fc 40%, #67e8f9 100%);
  --aur-1: rgba(109, 106, 254, .24); --aur-2: rgba(34, 211, 238, .13); --aur-3: rgba(16, 185, 129, .09);
  --gridline: rgba(255, 255, 255, .028);
}
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before {
  background:
    radial-gradient(900px 620px at 6% -12%, var(--aur-1), transparent 62%),
    radial-gradient(760px 520px at 102% -4%, var(--aur-2), transparent 60%),
    radial-gradient(900px 640px at 55% 118%, var(--aur-3), transparent 60%);
}
body::after {
  background-image: linear-gradient(var(--gridline) 1px, transparent 1px), linear-gradient(90deg, var(--gridline) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 10%, transparent 75%);
}
h1, h2, h3, .big, .k-val, .bank-bal, .donut .center b, .side-foot .v, .acc-total .big, .b-sum b, .sumbar b, .brand-name { font-family: var(--display); }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Sidebar & brand */
.sidebar { background: var(--bg-2); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); }
.brand { text-decoration: none; padding: 4px 8px 22px; border-radius: 14px; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 15px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  position: relative; flex: none; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .03em; color: #fff; text-decoration: none;
  background: var(--grad);
  box-shadow: 0 10px 26px -10px rgba(109, 106, 254, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.avatar::after { content: ""; position: absolute; inset: -3px; border-radius: 16px; border: 1px solid rgba(139, 140, 255, .35); }
.avatar.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 19px; }
.avatar.lg::after { border-radius: 21px; }
.avatar.xl { width: 76px; height: 76px; border-radius: 24px; font-size: 26px; margin: 0 auto; }
.avatar.xl::after { inset: -5px; border-radius: 28px; }
.only-m { display: none; }
.tb-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar h1 { font-size: 28px; font-weight: 650; letter-spacing: -.03em; }
.nav a { position: relative; }
.nav a.active { background: linear-gradient(90deg, var(--accent-soft), transparent 90%); box-shadow: none; }
.nav a.active::before { content: ""; position: absolute; left: -15px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.side-foot { background: var(--surface); position: relative; overflow: hidden; }
.side-foot::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--aur-1), transparent 70%); }

/* Buttons */
.btn-primary { background: linear-gradient(135deg, #6d6afe, #8b5cf6); box-shadow: 0 10px 24px -10px rgba(109, 106, 254, .9), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-primary:hover { background: linear-gradient(135deg, #6d6afe, #8b5cf6); filter: brightness(1.1); }

/* Cards */
.card { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 24px 60px -36px rgba(0, 0, 0, .75); transition: border-color .2s; }
.card:hover { border-color: var(--border-strong); }
:root:not([data-theme="dark"]) .card { box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(15, 23, 42, .04), 0 22px 44px -30px rgba(15, 23, 42, .28); }
.modal, .tip { background-clip: padding-box; }
.modal { background: var(--surface-solid); }
.seg button.on { background: var(--surface-solid); }
[data-theme="dark"] .seg button.on { background: rgba(255, 255, 255, .09); }

/* Hero */
.hero {
  border: 1px solid transparent; padding: 28px 28px 14px;
  background:
    radial-gradient(640px 320px at 0% 0%, var(--aur-1), transparent 70%) padding-box,
    radial-gradient(520px 280px at 100% 100%, var(--aur-2), transparent 70%) padding-box,
    linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box,
    linear-gradient(140deg, rgba(139, 140, 255, .6), rgba(34, 211, 238, .28) 35%, var(--border) 65%) border-box;
}
.hero::before { display: none; }
.eyebrow { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 13px; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 0 0 var(--pos); animation: live 2.4s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } }
.hero .big {
  font-size: 54px; font-weight: 700; letter-spacing: -.045em; margin: 10px 0 12px;
  background: linear-gradient(180deg, var(--text) 35%, color-mix(in srgb, var(--text) 62%, transparent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 18px; }
.hero-stats { display: flex; gap: 26px; }
.hero-stats div { display: flex; flex-direction: column; align-items: flex-end; }
.hero-stats small { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.hero-stats b { font-family: var(--display); font-size: 15px; font-weight: 600; }
.chart { height: 300px; }
.chart .ln { filter: drop-shadow(0 8px 14px rgba(34, 211, 238, .35)); }
.chart svg.down .ln { filter: drop-shadow(0 8px 14px rgba(251, 113, 133, .35)); }
.chart .ln.anim { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s cubic-bezier(.65, 0, .35, 1) forwards; }
.chart .area.anim { animation: fadeIn 1s .5s both; }
.chart .end.anim { animation: fadeIn .4s 1.3s both; }
.chart .end-ring { transform-box: fill-box; transform-origin: center; animation: ring 2.4s 1.4s infinite; opacity: 0; }
.chart .gl { stroke-dasharray: 2 6; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes ring { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(3.2); opacity: 0; } }
.tip { background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong); backdrop-filter: blur(10px); }

/* KPI */
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -50px; top: -60px; width: 160px; height: 160px; border-radius: 50%; pointer-events: none; opacity: .55; background: radial-gradient(circle, var(--kg, var(--aur-1)), transparent 70%); }
.kpi:has(.k-ic.pos) { --kg: rgba(52, 211, 153, .22); }
.kpi:has(.k-ic.neg) { --kg: rgba(251, 113, 133, .2); }
.kpi:has(.k-ic.acc) { --kg: rgba(139, 140, 255, .26); }
.kpi .k-val { font-size: 26px; font-weight: 650; letter-spacing: -.03em; }
.kpi .k-ic { width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--border); }

/* Monthly bars & donut */
.mcol .b.inc { background: linear-gradient(180deg, #34d399, rgba(16, 185, 129, .55)); box-shadow: 0 0 18px -6px rgba(52, 211, 153, .6); }
.mcol .b.exp { background: linear-gradient(180deg, #fb7185, rgba(225, 29, 72, .5)); opacity: 1; }
.mcol .b { border-radius: 6px 6px 3px 3px; }
.mcol .mt { background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong); }
.donut svg circle:not(:first-child) { transition: stroke-width .2s; }
.donut svg circle:hover { stroke-width: 5.6; }
.bar > span { background: linear-gradient(90deg, color-mix(in srgb, var(--c, var(--accent)) 70%, transparent), var(--c, var(--accent))); }

/* Bank cards */
.acc-cards { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 26px 22px; }
.acc-wrap { display: flex; flex-direction: column; gap: 12px; perspective: 1000px; }
.acc-wrap.excluded .bank { filter: saturate(.45); }
.acc-wrap .foot { display: flex; gap: 6px; flex-wrap: wrap; }
.bank {
  position: relative; aspect-ratio: 1.586; border-radius: 22px; padding: 20px 22px; color: #fff; overflow: hidden;
  display: flex; flex-direction: column; isolation: isolate;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c) 70%, #fff 30%) 0%, transparent 55%),
    linear-gradient(150deg, color-mix(in srgb, var(--c) 92%, #000 8%) 0%, color-mix(in srgb, var(--c) 38%, #07080d) 88%);
  box-shadow: 0 28px 50px -26px color-mix(in srgb, var(--c) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s;
}
.bank:hover { transform: translateY(-5px) rotateX(5deg); box-shadow: 0 40px 60px -28px color-mix(in srgb, var(--c) 90%, transparent), inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 0 0 1px rgba(255, 255, 255, .1); }
.bank::before { content: ""; position: absolute; z-index: -1; width: 300px; height: 300px; border-radius: 50%; right: -110px; bottom: -170px; border: 44px solid rgba(255, 255, 255, .07); }
.bank::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .16) 48%, transparent 62%); transform: translateX(-110%); transition: transform 1s ease; }
.bank:hover::after { transform: translateX(110%); }
.bank-spark { position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 48%; opacity: .22; }
.bank-spark svg { width: 100%; height: 100%; display: block; }
.bank-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.bank-btn { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; border: 0; color: #fff; background: rgba(255, 255, 255, .14); backdrop-filter: blur(6px); transition: background .15s; }
.bank-btn:hover { background: rgba(255, 255, 255, .26); }
.bank-mid { display: flex; align-items: center; gap: 10px; margin: 12px 0 auto; opacity: .95; }
.bank-chip { width: 42px; height: 31px; border-radius: 7px; position: relative; overflow: hidden; background: linear-gradient(135deg, #f8e3a1, #c9a24a 50%, #f3d98c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.bank-chip::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 32%, rgba(0, 0, 0, .22) 33% 35%, transparent 36% 64%, rgba(0, 0, 0, .22) 65% 67%, transparent 68%), linear-gradient(0deg, transparent 46%, rgba(0, 0, 0, .22) 47% 53%, transparent 54%); }
.bank-bal { font-size: 30px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; text-shadow: 0 2px 14px rgba(0, 0, 0, .2); }
.bank-delta { font-size: 12px; opacity: .8; margin-top: 4px; }
.bank-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 14px; font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.bank-bottom .holder { opacity: .9; white-space: nowrap; }
.bank-bottom .bank-name { opacity: .75; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .06em; }
.bank-add {
  aspect-ratio: 1.586; border-radius: 22px; border: 1.5px dashed var(--border-strong); background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-3); font-weight: 600;
  transition: border-color .2s, color .2s, background .2s;
}
.bank-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.privacy .bank-bal.money { filter: blur(10px); }

/* Settings profile & onboarding */
.profile { display: flex; gap: 16px; align-items: flex-end; }
.onboard { position: relative; overflow: hidden; }
.onboard h2 { font-size: 34px; letter-spacing: -.035em; margin-top: 22px; }

/* Entrance animation (solo al cambio pagina) */
.enter .grid > *, .enter .stack > *, .enter .acc-cards > *, .enter .kpis > * { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; }
.enter .grid > :nth-child(2), .enter .stack > :nth-child(2), .enter .acc-cards > :nth-child(2), .enter .kpis > :nth-child(2) { animation-delay: .05s; }
.enter .grid > :nth-child(3), .enter .acc-cards > :nth-child(3), .enter .kpis > :nth-child(3) { animation-delay: .1s; }
.enter .grid > :nth-child(4), .enter .acc-cards > :nth-child(4), .enter .kpis > :nth-child(4) { animation-delay: .15s; }
.enter .grid > :nth-child(n+5), .enter .acc-cards > :nth-child(n+5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

@media (max-width: 900px) {
  .only-m { display: grid; }
  .avatar.only-m { width: 38px; height: 38px; border-radius: 12px; font-size: 13px; }
  .topbar h1 { font-size: 21px; }
  .hero { padding: 20px 18px 10px; }
  .hero .big { font-size: 40px; }
  .hero-side { align-items: stretch; width: 100%; }
  .hero-stats { justify-content: space-between; }
  .hero-stats div { align-items: flex-start; }
  .chart { height: 230px; }
  .kpi .k-val { font-size: 20px; }
  .bank-bal { font-size: 27px; }
}
@media (max-width: 480px) {
  .hero .big { font-size: 36px; }
  .kpi .k-val { font-size: 17px; }
}

/* Stato salvataggio & avvisi */
.save-st { display: flex; align-items: center; gap: 7px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-3); position: relative; z-index: 1; }
.save-st i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.save-st.ok i { background: var(--pos); box-shadow: 0 0 8px var(--pos); }
.save-st.warn i { background: var(--warn); }
.save-st.err i { background: var(--neg); }
.save-st.err { color: var(--neg); }
.notice { display: flex; gap: 14px; align-items: center; padding: 14px 16px; margin-bottom: 18px; border-radius: 16px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); font-size: 13.5px; color: var(--text); }
.notice.err { background: var(--neg-soft); border-color: color-mix(in srgb, var(--neg) 35%, transparent); }
.notice .n-ic { font-size: 22px; }
.notice > div { flex: 1; }
@media (max-width: 900px) { .notice { flex-wrap: wrap; } }

/* ---------- Accesso / registrazione (versione online) ---------- */
.auth-page { min-height: 100vh; }
.auth { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-side {
  position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 36px 48px; gap: 40px;
  border-right: 1px solid var(--border);
  background: radial-gradient(700px 500px at 0% 0%, var(--aur-1), transparent 65%), radial-gradient(600px 500px at 100% 100%, var(--aur-2), transparent 65%), var(--bg-2);
}
.auth-side .brand { padding: 0; }
.brand-logo { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 10px 26px -10px rgba(109, 106, 254, .9), inset 0 1px 0 rgba(255,255,255,.35); flex: none; }
.auth-pitch { margin-top: auto; max-width: 520px; }
.auth-pitch h2 { font-size: 46px; line-height: 1.08; letter-spacing: -.045em; margin: 0 0 16px; font-weight: 700; }
.auth-pitch p { font-size: 16px; color: var(--text-2); margin: 0 0 26px; max-width: 440px; }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-pitch li { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--text-2); }
.auth-pitch li .i { color: var(--accent); }
.auth-card-deco { margin-bottom: auto; width: min(380px, 100%); transform: rotate(-6deg) translateX(30px); }
.auth-card-deco .bank { pointer-events: none; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-box { width: min(410px, 100%); display: flex; flex-direction: column; gap: 18px; }
.auth-box h1 { font-size: 32px; letter-spacing: -.035em; margin: 0; font-weight: 700; }
.auth-box > p.muted { margin: -10px 0 4px; font-size: 15px; }
.btn-lg { height: 48px; font-size: 15px; border-radius: 13px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; color: var(--text-3); display: grid; place-items: center; border-radius: 8px; }
.pw-eye:hover { color: var(--text); background: var(--surface-2); }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: -4px; }
.pw-meter span { height: 5px; border-radius: 5px; background: var(--surface-3); transition: background .2s; }
.pw-meter .on.s1 { background: var(--neg); } .pw-meter .on.s2 { background: var(--warn); }
.pw-meter .on.s3 { background: #22d3ee; } .pw-meter .on.s4 { background: var(--pos); }
.auth-err { color: var(--neg); font-size: 13.5px; font-weight: 600; min-height: 1px; }
.auth-err:empty { display: none; }
.auth-foot { font-size: 12.5px; color: var(--text-3); text-align: center; margin: 4px 0 0; }
.auth-box .brand.only-m { padding: 0 0 8px; }
.side-logout { margin-left: auto; border: 0; background: none; color: var(--text-3); font-weight: 600; font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.side-logout:hover { color: var(--neg); background: var(--neg-soft); }
.save-st.err .side-logout { color: var(--text-3); }
.acct-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.acct-head h3 { margin: 0; }
.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.acct-grid h4 { margin: 0; font-size: 14px; }
.sess { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--border); color: var(--text); }
.sess:first-child { border-top: 0; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { align-items: start; padding-top: 48px; }
  .acct-grid { grid-template-columns: 1fr; }
  .auth-box .brand.only-m { display: flex; }
}
