/* ALPHA MONEY — foglio di stile. 6 design selezionabili: [data-design] su <html> */
:root {
  --accent: #1F7A6E; --accent-2: #B8892B;
  --bg: #F3F4F1; --surface: #FFFFFF; --surface-2: #F7F8F5; --line: #E3E6E0;
  --text: #1B2027; --muted: #69727D; --pos: #1F8A4C; --neg: #B4442F; --warn: #C98A12;
  --on-accent: #fff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-2-soft: color-mix(in srgb, var(--accent-2) 16%, transparent);
  --r: 14px; --r-sm: 10px; --r-btn: 10px;
  --shadow: 0 1px 2px rgba(20,30,30,.06), 0 4px 16px rgba(20,30,30,.05);
  --shadow-lg: 0 10px 40px rgba(20,30,30,.14);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pad: 20px; --gap: 18px; --row: 12px;
  --side-w: 248px;
  --card-bg: var(--surface); --card-border: 1px solid var(--line); --blur: none;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  html[data-mode="auto"] { --bg: #101416; --surface: #181D20; --surface-2: #1E2427; --line: #2A3236; --text: #E7ECEA; --muted: #95A0A6; --pos: #4CC38A; --neg: #EF7B63; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 40px rgba(0,0,0,.5); color-scheme: dark; }
}
html[data-mode="dark"] { --bg: #101416; --surface: #181D20; --surface-2: #1E2427; --line: #2A3236; --text: #E7ECEA; --muted: #95A0A6; --pos: #4CC38A; --neg: #EF7B63; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 40px rgba(0,0,0,.5); color-scheme: dark; }
html[data-density="compact"] { --pad: 14px; --gap: 12px; --row: 8px; font-size: 14px; }

* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.45; font-variant-numeric: tabular-nums; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.1rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
h2.sub { margin-top: 1.2em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.break { word-break: break-all; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.block { display: block; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.r { text-align: right; }
.grow { flex: 1; min-width: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--muted); margin: 0 0 4px; }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 62ch; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side-w); flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--text); font-weight: 600; letter-spacing: .06em; font-size: .92rem; }
.brand:hover { text-decoration: none; }
.brand b, .brand-mark b { font-weight: 800; color: var(--accent); margin-left: 3px; }
.alpha { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2))); color: #fff; font-size: 1.35rem; font-weight: 800; font-family: Georgia, serif; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text); font-weight: 600; font-size: .92rem; }
.side nav a:hover { background: var(--surface-2); text-decoration: none; }
.side nav a.on { background: var(--accent-soft); color: var(--accent); }
.side svg, .top svg, .bottom-nav svg, .icon-btn svg, .btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; padding: 14px 12px 4px; border-top: 1px solid var(--line); font-size: .85rem; }
.side-foot .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 12px var(--pad); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; color: var(--muted); }
.search input { border: 0 !important; background: transparent !important; padding: 9px 0 !important; box-shadow: none !important; flex: 1; min-width: 0; }
.add-top { margin-left: auto; }
.content { padding: 8px var(--pad) 40px; max-width: 1320px; width: 100%; }
.flash { margin: 10px var(--pad) 0; padding: 11px 16px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--text); border-left: 4px solid var(--accent); font-weight: 600; }
.flash.err { background: color-mix(in srgb, var(--neg) 12%, transparent); border-color: var(--neg); }
.bottom-nav, .scrim, .only-m { display: none; }

/* ---------------------------------------------------------------- componenti */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 14px 0 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.with-icon { display: flex; gap: 16px; align-items: center; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions.wrap { flex-wrap: wrap; }
.card { background: var(--card-bg); border: var(--card-border); border-radius: var(--r); padding: var(--pad); box-shadow: var(--shadow); margin-bottom: var(--gap); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--gap); align-items: start; }
.dash-grid > .card { margin: 0; }
.dash-grid > .wide { grid-column: 1 / -1; }
.group { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 14px 0 4px; }
.notice { display: block; padding: 12px 16px; border-radius: var(--r-sm); background: var(--accent-2-soft); color: var(--text); margin-bottom: var(--gap); font-weight: 600; }
.notice.warn { background: color-mix(in srgb, var(--neg) 12%, transparent); }
.empty { text-align: center; padding: 40px 20px; }
.empty strong { font-size: 1.15rem; }
.empty p { color: var(--muted); max-width: 46ch; margin: 8px auto 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: var(--r-btn); border: 1px solid transparent; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; white-space: nowrap; transition: filter .15s, transform .1s, background .15s; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--neg); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--neg); border-color: color-mix(in srgb, var(--neg) 40%, transparent); }
.btn.small { padding: 6px 11px; font-size: .82rem; }
.btn.big { padding: 12px 22px; font-size: 1rem; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; font-size: .88rem; }
.link.neg { color: var(--neg); }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text); cursor: pointer; font-size: 1.2rem; list-style: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.big { width: 56px; height: 56px; border: 1px dashed var(--line); border-radius: var(--r-sm); }
.badge { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--neg); color: #fff; font-size: .68rem; font-style: normal; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }

/* form */
label { display: flex; flex-direction: column; gap: 5px; font-size: .84rem; font-weight: 600; color: var(--muted); min-width: 0; }
label small { font-weight: 500; }
input, select, textarea { font: inherit; font-size: .95rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; width: 100%; min-width: 0; font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); margin: 0; }
input[type=color] { height: 40px; padding: 3px; cursor: pointer; }
input:disabled, select:disabled { opacity: .65; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 16px; }
.span2 { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 16px; margin: 0; min-width: 0; }
fieldset.plain { border: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
legend { font-weight: 800; padding: 0 6px; font-size: .9rem; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.filters > label { flex: 0 1 auto; }
.filters > label.grow { flex: 1 1 220px; }
.filters details.more { align-self: center; }
.filters details.more[open] { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; }
.filters details summary { cursor: pointer; font-weight: 700; color: var(--accent); font-size: .85rem; }
.filters-card { display: flex; flex-direction: column; gap: 12px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
form.inline { display: inline-flex; }
.small-form input, .small-form select { padding: 6px 8px; font-size: .85rem; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.inline input { width: 90px; }
.inline em { font-style: normal; color: var(--text); }
.otp { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; align-self: flex-start; flex-wrap: wrap; }
.seg label { flex-direction: row; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .seg.links a { display: block; padding: 7px 16px; border-radius: 999px; font-weight: 700; color: var(--muted); cursor: pointer; font-size: .9rem; }
.seg input:checked + span, .seg.links a.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.seg.links a:hover { text-decoration: none; }
.amount-field { display: flex; align-items: center; gap: 8px; border-bottom: 2px solid var(--line); padding: 4px 0; }
.amount-field:focus-within { border-color: var(--accent); }
.amount-field span { font-size: 1.8rem; font-weight: 800; color: var(--muted); }
.amount-field input { border: 0 !important; outline: 0 !important; font-size: 2.2rem; font-weight: 800; padding: 4px 0; background: transparent; }
.pill { flex-direction: row; cursor: pointer; }
.pill input { position: absolute; opacity: 0; }
.pill span { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; color: var(--muted); font-size: .82rem; }
.pill input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pill input:focus-visible + span { outline: 2px solid var(--accent); }
.weekdays, .acc-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rec { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--surface-2); border-radius: var(--r); }
.splits { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface-2); border-radius: var(--r-sm); margin: 8px 0; }
.split-row { display: grid; grid-template-columns: 2fr 1fr 2fr auto; gap: 8px; align-items: center; }
.split-foot { display: flex; justify-content: space-between; align-items: center; }
.attach { display: flex; align-items: flex-end; gap: 12px; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--r); padding: 34px 20px; text-align: center; cursor: pointer; color: var(--text); align-items: center; transition: border-color .15s, background .15s; }
.dropzone.over, .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { max-width: 300px; margin: 0 auto; }
.dropzone span { font-size: 1.05rem; }
.switch { position: relative; flex-direction: row; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 40px; height: 22px; border-radius: 11px; background: var(--line); position: relative; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }

/* elenchi */
.rows { display: flex; flex-direction: column; }
.row-link { display: flex; align-items: center; gap: 12px; padding: var(--row) 6px; border-radius: var(--r-sm); color: var(--text); border-bottom: 1px solid var(--line); min-width: 0; }
.rows > .row-link:last-child, .rows > .sel-row:last-child .row-link { border-bottom: 0; }
a.row-link:hover, .row-link a.grow:hover { background: var(--surface-2); text-decoration: none; }
.row-link a.grow { color: var(--text); }
.row-link strong { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-link strong + .chip, .row-link .chip { vertical-align: middle; }
.row-link small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-link .r small { text-align: right; }
.row-link.off { opacity: .55; }
.row-link.unread strong::before { content: "●"; color: var(--accent); margin-right: 6px; font-size: .7em; vertical-align: middle; }
.rows.compact .row-link { padding: 8px 4px; }
.row-link .run { color: var(--muted); min-width: 90px; text-align: right; }
.row-link .amt { font-weight: 800; white-space: nowrap; }
.sel-row { display: flex; align-items: center; gap: 6px; }
.sel-row > input { margin-left: 4px; }
.sel-row > .row-link { flex: 1; }
.day-sep { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 6px 4px; }
.bulk-bar { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; margin: -6px -6px 10px; background: var(--accent-soft); border-radius: var(--r-sm); backdrop-filter: blur(8px); }
.bulk-bar select, .bulk-bar input { width: auto; padding: 6px 8px; font-size: .85rem; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .72rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.chip.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); border-color: transparent; }
.chip.ok { background: color-mix(in srgb, var(--pos) 14%, transparent); color: var(--pos); border-color: transparent; }
.chip.neg { background: color-mix(in srgb, var(--neg) 14%, transparent); color: var(--neg); border-color: transparent; }
.chip.big { font-size: .88rem; padding: 6px 12px; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; flex: none; }
.date-badge { width: 44px; flex: none; text-align: center; font-size: .7rem; text-transform: uppercase; color: var(--muted); font-weight: 700; line-height: 1.1; }
.date-badge b { display: block; font-size: 1.25rem; color: var(--text); }
.pager { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.pager a, .pager span { min-width: 36px; padding: 6px 10px; text-align: center; border-radius: var(--r-sm); color: var(--text); font-weight: 700; }
.pager a.on { background: var(--accent); color: var(--on-accent); }
.steps { padding-left: 20px; }
.steps li { margin: 6px 0; }

/* icone categoria: SVG monocromatici colorati con mask */
.ic { --c: var(--accent); flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 15%, transparent); }
.ic i { width: 21px; height: 21px; background: var(--c); -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.ic-img img { width: 24px; height: 24px; object-fit: contain; }
.ic.sm { width: 22px; height: 22px; border-radius: 6px; } .ic.sm i { width: 14px; height: 14px; }
.ic.lg { width: 58px; height: 58px; border-radius: 16px; } .ic.lg i { width: 32px; height: 32px; }
.icon-picker { display: flex; align-items: center; gap: 12px; }
.icon-pop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(10,15,20,.45); padding: 16px; }
.icon-pop .ip-box { background: var(--surface); color: var(--text); border-radius: var(--r); width: min(720px, 100%); max-height: 86vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; }
.ip-head { display: flex; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); }
.ip-body { overflow-y: auto; padding: 8px 14px 16px; }
.ip-head input[type=search] { flex: 1; }
.ip-upload { cursor: pointer; }
.ip-msg { margin: 8px 14px 0; }
.ip-body h4 { margin: 14px 0 6px; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.ip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.ip-grid button { border: 1px solid transparent; background: var(--surface-2); border-radius: 10px; height: 46px; display: grid; place-items: center; cursor: pointer; padding: 0; }
.ip-grid button:hover { border-color: var(--accent); }
.ip-grid .ic { width: 34px; height: 34px; background: transparent; }

/* numeri, KPI, barre */
.big-num { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; display: block; line-height: 1.1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.card .kpis { margin: 4px 0 14px; }
.kpi { background: var(--card-bg); border: var(--card-border); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); min-width: 0; }
.card .kpi { box-shadow: none; background: var(--surface-2); border: 0; }
.kpi > span { display: block; font-size: .78rem; color: var(--muted); font-weight: 700; }
.kpi strong { display: block; font-size: 1.35rem; font-weight: 800; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { color: var(--muted); display: block; }
.kpis.slim .kpi { padding: 10px 14px; } .kpis.slim .kpi strong { font-size: 1.1rem; }
.bar { height: 8px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin: 6px 0; box-shadow: inset 0 0 0 1px var(--line); }
.bar i { display: block; height: 100%; border-radius: 5px; background: var(--accent); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.warn i { background: var(--warn); } .bar.over i { background: var(--neg); }
.bar.thin { height: 4px; margin: 4px 0 0; }
.bar-wrap { position: relative; }
.time-mark { position: absolute; top: 2px; bottom: 2px; width: 2px; background: var(--text); opacity: .45; border-radius: 1px; }
.budget-line { padding: 8px 0; }
.budget-line.big { padding: 12px 0; border-bottom: 1px solid var(--line); }
.bl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bl-head strong { flex: 1; }
.budget-line.big .bl-head strong { flex: none; }
.bl-head .ic { width: 30px; height: 30px; border-radius: 9px; } .bl-head .ic i { width: 17px; height: 17px; }
.delta { font-weight: 700; font-size: .88rem; }

.hero { display: grid; grid-template-columns: minmax(260px, 1fr) 1.4fr; gap: 20px; align-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 92%, #000) 0%, color-mix(in srgb, var(--accent) 70%, var(--accent-2)) 100%); color: #fff; border-radius: calc(var(--r) + 6px); padding: 24px 26px; margin-bottom: var(--gap); box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 30%, transparent); overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%); pointer-events: none; }
.hero .muted, .hero .delta { color: rgba(255,255,255,.85); }
.hero .big-num { font-size: 2.6rem; margin: 4px 0; }
.hero-split { display: flex; gap: 20px; margin-top: 12px; font-size: .88rem; color: rgba(255,255,255,.85); flex-wrap: wrap; }
.hero-split b { color: #fff; display: block; font-size: 1.05rem; }
.hero .chart-box { position: relative; z-index: 1; }
.chart-box { position: relative; width: 100%; min-width: 0; }
.report-split { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; gap: 24px; align-items: start; }

/* carta di credito */
.cc { display: block; padding: 16px 18px; border-radius: var(--r); margin-bottom: 12px; color: #fff; background: linear-gradient(135deg, var(--cc), color-mix(in srgb, var(--cc) 55%, #0b0f14)); box-shadow: 0 8px 24px color-mix(in srgb, var(--cc) 30%, transparent); }
.cc:hover { text-decoration: none; filter: brightness(1.05); }
.cc-top, .cc-foot { display: flex; justify-content: space-between; font-size: .84rem; opacity: .95; gap: 8px; flex-wrap: wrap; }
.cc-top strong { font-size: 1rem; }
.cc-mid { margin: 14px 0 6px; }
.cc-mid span { font-size: .75rem; opacity: .8; display: block; }
.cc-mid b { font-size: 1.5rem; }
.cc-mid small { display: block; opacity: .85; }
.cc .bar { background: rgba(255,255,255,.25); box-shadow: none; }
.cc .bar i { background: #fff; }
.cc .bar.over i { background: #ffb4a6; }

/* tabelle */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; padding: 10px 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.done td { opacity: .5; }
.table tr.err td { background: color-mix(in srgb, var(--neg) 7%, transparent); }
.table tfoot th { border-top: 2px solid var(--line); border-bottom: 0; color: var(--text); font-size: .9rem; }
.table th.r, .table td.r { text-align: right; white-space: nowrap; }
.map-table select { min-width: 150px; font-weight: 700; }
.map-table select.ign { color: var(--muted); font-weight: 500; }

.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: var(--gap); padding-bottom: 2px; scrollbar-width: thin; }
.tabs a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 700; white-space: nowrap; font-size: .88rem; border: 1px solid transparent; }
.tabs a:hover { background: var(--surface); text-decoration: none; }
.tabs a.on { background: var(--surface); color: var(--accent); border-color: var(--line); box-shadow: var(--shadow); }
.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 10px 0 20px; flex-wrap: wrap; counter-reset: st; }
.stepper li { counter-increment: st; display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--surface-2); font-size: .8rem; font-weight: 700; color: var(--muted); }
.stepper li::before { content: counter(st); width: 22px; height: 22px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-size: .72rem; }
.stepper li.on { background: var(--accent-soft); color: var(--accent); }
.stepper li.on::before { background: var(--accent); color: #fff; }
.stepper li.done::before { content: "✓"; background: var(--pos); color: #fff; }
.stepper a { color: inherit; }

details.pop { position: relative; }
details.pop > summary { list-style: none; cursor: pointer; }
details.pop > summary::-webkit-details-marker { display: none; }
details.pop .menu, details.pop form.stack { position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); padding: 6px; min-width: 210px; }
details.pop form.stack { padding: 12px; min-width: 240px; }
details.pop .menu.wide { min-width: 260px; }
.menu > a, .menu > form > button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 8px; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; font-size: .88rem; }
.menu > a:hover, .menu > form > button:hover { background: var(--surface-2); text-decoration: none; }
.menu form.stack { position: static; box-shadow: none; border: 0; padding: 8px 10px; }
.inline-note { font-size: .86rem; margin: 6px 0; }

/* notifiche */
.notif { position: relative; }
.notif-pop { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, 92vw); max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); z-index: 60; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.notif-pop ul { list-style: none; margin: 0; padding: 4px; }
.notif-pop li a { display: block; padding: 10px; border-radius: var(--r-sm); color: var(--text); }
.notif-pop li a:hover { background: var(--surface-2); text-decoration: none; }
.notif-pop li.unread a { background: var(--accent-soft); }
.notif-pop li small { display: block; color: var(--muted); }
.install { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 80; display: flex; gap: 12px; align-items: center; padding: 12px 14px 12px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); width: min(560px, calc(100% - 24px)); font-size: .9rem; }
.install span { flex: 1; }

/* calendario */
.cal-wrap { display: grid; grid-template-columns: 1fr 340px; gap: var(--gap); align-items: start; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-h { text-align: center; font-size: .72rem; font-weight: 800; text-transform: uppercase; color: var(--muted); padding: 4px; }
.cal-d { min-height: 86px; border-radius: var(--r-sm); background: var(--surface-2); padding: 6px 7px; display: flex; flex-direction: column; gap: 1px; color: var(--text); font-size: .74rem; position: relative; border: 2px solid transparent; }
.cal-d:hover { text-decoration: none; border-color: var(--line); }
.cal-d.empty { background: transparent; }
.cal-d.we { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.cal-d b { font-size: .9rem; }
.cal-d.today b { background: var(--accent); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.cal-d.sel { border-color: var(--accent); }
.cal-d .dots { position: absolute; right: 6px; top: 8px; display: flex; gap: 2px; }
.dots em, .legend em, .kind-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.done, .legend .done { } 
em.done, .kind-dot.done { background: var(--accent); } em.pending, .kind-dot.pending { background: var(--warn); } em.planned, .kind-dot.planned { background: var(--accent-2); } em.info, .kind-dot.info { background: var(--muted); } em.transfer, .kind-dot.transfer { background: var(--line); }
.kind-dot { width: 10px; height: 10px; flex: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); margin: 12px 0 0; }
.legend span { display: inline-flex; gap: 5px; align-items: center; }

/* categorie */
.cat-tree { display: flex; flex-direction: column; gap: 2px; }
.cat-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r-sm); color: var(--text); font-weight: 700; }
.cat-item:hover { background: var(--surface-2); text-decoration: none; }
.cat-item span { flex: 1; }
.cat-item small { color: var(--muted); }
.cat-item.sub { margin-left: 30px; font-weight: 600; }
.cat-item.sub .ic { width: 28px; height: 28px; } .cat-item.sub .ic i { width: 16px; height: 16px; }
.cat-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.cat-opt { flex-direction: row; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text); cursor: pointer; }
.cat-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cat-opt span { display: flex; flex-direction: column; min-width: 0; }
.cat-opt small { color: var(--muted); font-weight: 500; }

/* obiettivi */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.goal { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.goal.off { opacity: .55; }
.goal-head { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; }
.goal-head strong { flex: 1; }
.goal p { margin: 0; }
.ring { --p: 0; width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring span { width: 84px; height: 84px; border-radius: 50%; background: var(--card-bg); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; }
.goal .inline-form { margin: 0; justify-content: center; }
.goal .inline-form input { width: 90px; }
.goal .inline-form select { width: 130px; }

/* aspetto: anteprime design */
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.design-opt { cursor: pointer; color: var(--text); gap: 3px; padding: 10px; border: 2px solid var(--line); border-radius: var(--r); }
.design-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.design-opt input { position: absolute; opacity: 0; }
.design-opt small { color: var(--muted); font-weight: 500; }
.design-prev { display: block; position: relative; height: 96px; border-radius: 10px; background: #EEF0EC; overflow: hidden; margin-bottom: 6px; }
.design-prev i { position: absolute; display: block; }
.dp-bar { left: 0; right: 0; top: 0; height: 16px; background: #fff; }
.dp-card { left: 10px; top: 26px; width: 58%; height: 58px; background: #fff; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.dp-card b { display: block; height: 6px; margin: 10px 10px 0; border-radius: 3px; background: #D9DDD6; }
.dp-card b:first-child { width: 50%; background: var(--accent); }
.dp-card.sm { left: auto; right: 10px; width: 28%; height: 30px; }
.dp-btn { right: 10px; bottom: 10px; width: 28%; height: 18px; border-radius: 6px; background: var(--accent); }
.design-prev[data-design="liquid"] { background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 45%, #fff), transparent 55%), radial-gradient(circle at 80% 80%, color-mix(in srgb, var(--accent-2) 45%, #fff), transparent 55%), #EEF3F2; }
.design-prev[data-design="liquid"] .dp-card { border-radius: 18px; background: rgba(255,255,255,.55); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 6px 16px rgba(0,0,0,.08); }
.design-prev[data-design="liquid"] .dp-btn { border-radius: 99px; }
.design-prev[data-design="liquid"] .dp-bar { background: rgba(255,255,255,.5); }
.design-prev[data-design="chrome"] { background: #F1F3F4; }
.design-prev[data-design="chrome"] .dp-bar { background: #DEE1E6; height: 18px; }
.design-prev[data-design="chrome"] .dp-card { border-radius: 4px; box-shadow: none; border: 1px solid #DADCE0; }
.design-prev[data-design="chrome"] .dp-btn { border-radius: 4px; }
.design-prev[data-design="expressive"] { background: color-mix(in srgb, var(--accent) 12%, #fff); }
.design-prev[data-design="expressive"] .dp-card { border-radius: 22px; background: color-mix(in srgb, var(--accent) 22%, #fff); box-shadow: none; }
.design-prev[data-design="expressive"] .dp-btn { border-radius: 99px; height: 22px; }
.design-prev[data-design="glass"] { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.design-prev[data-design="glass"] .dp-card, .design-prev[data-design="glass"] .dp-bar { background: rgba(255,255,255,.25); border: 1px solid rgba(255,255,255,.45); box-shadow: none; }
.design-prev[data-design="glass"] .dp-btn { background: rgba(255,255,255,.85); }
.design-prev[data-design="gradient"] .dp-btn, .design-prev[data-design="gradient"] .dp-bar { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.design-prev[data-design="gradient"] .dp-card b:first-child { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%); }
.qr { width: 200px; height: 200px; padding: 10px; background: #fff; border-radius: 12px; margin: 10px 0; }
.qr img, .qr canvas { width: 100% !important; height: auto !important; }

/* wizard e accesso */
.wizard { max-width: 860px; margin: 0 auto; }
.wz-head { margin: 20px 0 8px; }
.wz-skip { display: flex; justify-content: space-between; align-items: center; margin: 24px 0; gap: 12px; flex-wrap: wrap; }
.auth-body { display: grid; place-items: center; padding: 20px; background: radial-gradient(1000px 600px at 10% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent), radial-gradient(800px 500px at 110% 110%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent), var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 30px; box-shadow: var(--shadow-lg); }
.auth-card.wide { width: min(760px, 100%); }
.auth-card .flash { margin: 0 0 14px; }
.brand-mark { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .06em; margin-bottom: 22px; }
.req { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: .88rem; }
.req li::before { margin-right: 6px; font-weight: 800; }
.req li.ok::before { content: "✓"; color: var(--pos); } .req li.ko::before { content: "✕"; color: var(--neg); }
.danger-zone { border-color: color-mix(in srgb, var(--neg) 30%, var(--line)); }

/* privacy: importi nascosti */
html[data-hide="1"] [data-amt] { filter: blur(7px); transition: filter .2s; user-select: none; }
html[data-hide="1"] [data-amt]:hover { filter: none; }

/* giorni lavorativi e fine mese */
.field-group { display: flex; flex-direction: column; gap: 8px; }
.bd-switches { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.switch-row { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-weight: 600; cursor: pointer; }
.switch-row .switch { display: inline-flex; }
.warn-text { color: var(--warn); }
.quick-dates { display: flex; flex-wrap: wrap; gap: 4px; }
.quick-dates button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 2px 9px; font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; }
.quick-dates button:hover { color: var(--accent); border-color: var(--accent); }

/* maschera di import */
.import-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.import-tools .inline-form { margin: 0; align-items: center; }
.import-tools select { width: auto; }
.import-wrap { max-height: 70vh; overflow: auto; }
.import-table thead th { position: sticky; top: 0; background: var(--card-bg); z-index: 1; backdrop-filter: var(--blur); }
html[data-design="glass"] .import-table thead th, html[data-design="liquid"] .import-table thead th { background: var(--surface); }
.import-table td { padding: 6px; }
.import-table input, .import-table select { padding: 5px 7px; font-size: .86rem; }
.import-table .in-date { width: 140px; }
.import-table .in-desc { min-width: 260px; }
.import-table .in-desc input + input { margin-top: 4px; }
.import-table .in-payee { color: var(--muted); }
.import-table select[data-f="cat"] { min-width: 180px; }
.import-table select.verify { min-width: 240px; border-color: var(--warn); font-weight: 700; }
tr.imp-check td { background: color-mix(in srgb, var(--warn) 9%, transparent); }
tr.imp-check.imp-resolved td { background: transparent; }
tr.imp-check.imp-resolved select.verify { border-color: var(--line); font-weight: 500; }
tr.imp-dup td { opacity: .55; }
tr.imp-err td { background: color-mix(in srgb, var(--neg) 7%, transparent); }
tr[data-nocat="1"] select[data-f="cat"] { border-style: dashed; }

/* opzioni sì/no come interruttori */
label.check > input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 40px; height: 22px; border-radius: 11px; background: var(--line); position: relative; flex: none; cursor: pointer; margin: 0; transition: background .2s; }
label.check > input[type=checkbox]::before { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
label.check > input[type=checkbox]:checked { background: var(--accent); }
html[data-design="gradient"] label.check > input[type=checkbox]:checked { background: var(--grad); }
label.check > input[type=checkbox]:checked::before { transform: translateX(18px); }
label.check > input[type=checkbox]:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
label.check > input[type=checkbox]:disabled { opacity: .5; cursor: default; }
label.check { gap: 10px; line-height: 1.3; }
.view-switch { margin: 4px 0 var(--gap); }

/* assistente AI */
.ai-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--gap); align-items: start; }
.ai-history { position: sticky; top: 80px; }
.md { line-height: 1.6; }
.md h2, .md h3, .md h4 { margin: 1.1em 0 .4em; }
.md ul, .md ol { padding-left: 22px; } .md li { margin: 3px 0; }
.md table { margin: 8px 0; }
.ai-preview { max-height: 320px; overflow: auto; background: var(--surface-2); padding: 10px 12px; border-radius: var(--r-sm); font-size: .76rem; white-space: pre-wrap; }
.in-amt { width: 110px; text-align: right; }
@media (max-width: 1000px) { .ai-layout { grid-template-columns: 1fr; } .ai-history { position: static; } }

/* scelta del tipo di conto */
.type-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--gap); }
.type-pick a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; font-size: .84rem; }
.type-pick a:hover { border-color: var(--accent); text-decoration: none; }
.type-pick a.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* costi del finanziamento */
.taeg-box { display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 18px; align-items: start; padding: 14px 16px; margin: 6px 0 14px; border-radius: var(--r-sm); background: var(--surface-2); }
.taeg-main span { display: block; font-size: .78rem; font-weight: 800; color: var(--muted); letter-spacing: .06em; }
.taeg-main strong { display: block; font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.taeg-main small { color: var(--muted); }
.taeg-list { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 18px; }
.taeg-list div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.taeg-list dt { color: var(--muted); } .taeg-list dd { margin: 0; font-weight: 700; white-space: nowrap; }
.taeg-list .strong dt { color: var(--text); font-weight: 700; } .taeg-list .strong dd { font-weight: 800; }
@media (max-width: 640px) { .taeg-box { grid-template-columns: 1fr; } }

.taeg-list.single { grid-template-columns: 1fr; }
.rows.wrap .row-link strong, .rows.wrap .row-link small { white-space: normal; }
.taeg-box.compact { grid-template-columns: 1fr; margin-top: 12px; }

/* report controparti */
.cp-search { position: relative; max-width: 640px; }
.cp-search input { font-size: 1.02rem; padding: 11px 14px; }
.cp-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 25; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); max-height: 420px; overflow-y: auto; padding: 4px; }
.cp-suggest button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; color: var(--text); font: inherit; cursor: pointer; }
.cp-suggest button:hover, .cp-suggest button.on { background: var(--accent-soft); }
.cp-suggest small { display: block; color: var(--muted); font-size: .78rem; }
.cp-head { margin: 18px 0 8px; }
.cp-head h2 { font-size: 1.3rem; margin: 0 0 4px; }

/* aggiornamenti */
.cmd { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; padding: 10px 12px; background: #11181C; color: #D7E3DF; border-radius: var(--r-sm); }
.cmd code { flex: 1; background: none; color: inherit; padding: 0; white-space: pre-wrap; word-break: break-all; font-size: .82rem; line-height: 1.5; }
.cmd .btn.ghost { color: #D7E3DF; border-color: rgba(255,255,255,.25); flex: none; }
.cmd .btn.ghost:hover { background: rgba(255,255,255,.08); }
.card.attention { border: 2px solid var(--warn); }
textarea.sql { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; background: var(--surface-2); margin: 8px 0; }
.file-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 3px; margin: 8px 0; }
.pre-step { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.pre-step p { margin: 4px 0 0 26px; }
ul.changes { margin: 4px 0 14px; padding-left: 20px; }
ul.changes li { margin: 3px 0; }

/* ================================================================ DESIGN */
/* Material Design: default sopra */

/* Liquid Design: vetro fluido, forme morbide, riflessi */
html[data-design="liquid"] { --r: 24px; --r-sm: 16px; --r-btn: 999px; --card-bg: color-mix(in srgb, var(--surface) 62%, transparent); --card-border: 1px solid color-mix(in srgb, #fff 55%, transparent); --blur: saturate(160%) blur(22px);
  --shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 8px 30px rgba(20,40,40,.08); }
html[data-design="liquid"] body { background: radial-gradient(900px 700px at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), radial-gradient(800px 700px at 100% 30%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 60%), radial-gradient(700px 600px at 40% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), var(--bg); background-attachment: fixed; }
html[data-design="liquid"] .side { background: color-mix(in srgb, var(--surface) 55%, transparent); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); border-right-color: color-mix(in srgb, #fff 40%, transparent); }
html[data-design="liquid"] .side nav a { border-radius: 999px; }
html[data-design="liquid"] .btn { box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
html[data-design="liquid"] .btn.ghost { background: color-mix(in srgb, var(--surface) 50%, transparent); box-shadow: inset 0 1px 0 rgba(255,255,255,.6); backdrop-filter: blur(10px); }
html[data-design="liquid"] input, html[data-design="liquid"] select, html[data-design="liquid"] textarea { background: color-mix(in srgb, var(--surface) 70%, transparent); border-radius: 14px; }
html[data-design="liquid"] .hero { border-radius: 30px; }
html[data-design="liquid"] .search { background: color-mix(in srgb, var(--surface) 55%, transparent); backdrop-filter: blur(14px); }

/* Chrome Style: pulito, compatto, grigi Google, angoli piccoli */
html[data-design="chrome"] { --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --r: 8px; --r-sm: 6px; --r-btn: 6px; --shadow: none; --bg: #F1F3F4; --line: #DADCE0; --side-w: 232px; }
html[data-design="chrome"][data-mode="dark"], html[data-design="chrome"][data-mode="auto"] { }
@media (prefers-color-scheme: dark) { html[data-design="chrome"][data-mode="auto"] { --bg: #202124; --surface: #292A2D; --surface-2: #35363A; --line: #3C4043; } }
html[data-design="chrome"][data-mode="dark"] { --bg: #202124; --surface: #292A2D; --surface-2: #35363A; --line: #3C4043; }
html[data-design="chrome"] .side { background: var(--bg); border-right: 0; }
html[data-design="chrome"] .side nav a { border-radius: 0 999px 999px 0; margin-left: -12px; padding-left: 24px; font-weight: 500; }
html[data-design="chrome"] .top { background: var(--bg); }
html[data-design="chrome"] .search { border-radius: 8px; background: var(--surface-2); border-color: transparent; }
html[data-design="chrome"] h1 { font-weight: 500; font-size: 1.6rem; }
html[data-design="chrome"] .btn { font-weight: 600; }
html[data-design="chrome"] .hero { border-radius: 8px; box-shadow: none; }
html[data-design="chrome"] .kpi strong, html[data-design="chrome"] .big-num { font-weight: 600; }

/* Material Expressive (Material 3 Expressive): forme ampie, tipografia marcata, contenitori colorati */
html[data-design="expressive"] { --font: "Roboto Flex", "Manrope", system-ui, sans-serif; --r: 28px; --r-sm: 18px; --r-btn: 999px; --shadow: none; --card-border: 0;
  --bg: color-mix(in srgb, var(--accent) 7%, #FAFAF7); --card-bg: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
@media (prefers-color-scheme: dark) { html[data-design="expressive"][data-mode="auto"] { --bg: color-mix(in srgb, var(--accent) 8%, #0F1312); --card-bg: color-mix(in srgb, var(--accent) 9%, #181D1C); } }
html[data-design="expressive"][data-mode="dark"] { --bg: color-mix(in srgb, var(--accent) 8%, #0F1312); --card-bg: color-mix(in srgb, var(--accent) 9%, #181D1C); }
html[data-design="expressive"] h1 { font-weight: 900; font-size: 2.2rem; letter-spacing: -.03em; font-stretch: 110%; }
html[data-design="expressive"] h2 { font-weight: 800; font-size: 1.2rem; }
html[data-design="expressive"] .side { background: var(--bg); border: 0; }
html[data-design="expressive"] .side nav a { border-radius: 999px; padding: 11px 16px; }
html[data-design="expressive"] .side nav a.on { background: var(--accent); color: var(--on-accent); }
html[data-design="expressive"] .btn { padding: 11px 22px; font-weight: 800; }
html[data-design="expressive"] .btn.ghost { background: var(--accent-2-soft); border-color: transparent; }
html[data-design="expressive"] .kpi { background: var(--accent-soft); }
html[data-design="expressive"] .kpis .kpi:nth-child(2n) { background: var(--accent-2-soft); }
html[data-design="expressive"] .kpi strong, html[data-design="expressive"] .big-num { font-weight: 900; }
html[data-design="expressive"] .ic { border-radius: 50%; }
html[data-design="expressive"] .hero { border-radius: 36px 36px 36px 8px; }
html[data-design="expressive"] .bar { height: 12px; border-radius: 6px; }
html[data-design="expressive"] input, html[data-design="expressive"] select, html[data-design="expressive"] textarea { border-radius: 14px; background: var(--surface-2); border-color: transparent; }

/* Glassmorphism: pannelli traslucidi su sfondo sfumato */
html[data-design="glass"] { --r: 20px; --r-sm: 14px; --card-bg: rgba(255,255,255,.18); --card-border: 1px solid rgba(255,255,255,.35); --blur: blur(18px) saturate(140%);
  --text: #0E1A1F; --muted: rgba(14,26,31,.68); --line: rgba(255,255,255,.4); --surface: rgba(255,255,255,.55); --surface-2: rgba(255,255,255,.28); --shadow: 0 8px 32px rgba(10,30,40,.15); }
html[data-design="glass"] body { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 80%, #fff) 0%, color-mix(in srgb, var(--accent) 50%, var(--accent-2)) 55%, color-mix(in srgb, var(--accent-2) 75%, #fff) 100%); background-attachment: fixed; }
@media (prefers-color-scheme: dark) { html[data-design="glass"][data-mode="auto"] { --text: #F1F5F4; --muted: rgba(241,245,244,.7); --card-bg: rgba(20,28,32,.35); --surface: rgba(20,28,32,.6); --surface-2: rgba(255,255,255,.08); --line: rgba(255,255,255,.14); --card-border: 1px solid rgba(255,255,255,.14); }
  html[data-design="glass"][data-mode="auto"] body { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 55%, #05080a), color-mix(in srgb, var(--accent-2) 40%, #05080a)); } }
html[data-design="glass"][data-mode="dark"] { --text: #F1F5F4; --muted: rgba(241,245,244,.7); --card-bg: rgba(20,28,32,.35); --surface: rgba(20,28,32,.6); --surface-2: rgba(255,255,255,.08); --line: rgba(255,255,255,.14); --card-border: 1px solid rgba(255,255,255,.14); }
html[data-design="glass"][data-mode="dark"] body { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 55%, #05080a), color-mix(in srgb, var(--accent-2) 40%, #05080a)); background-attachment: fixed; }
html[data-design="glass"] .side { background: rgba(255,255,255,.14); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-right: 1px solid rgba(255,255,255,.3); }
html[data-design="glass"] .top { background: transparent; }
html[data-design="glass"] .side nav a.on { background: rgba(255,255,255,.35); color: var(--text); }
html[data-design="glass"] .btn { background: rgba(255,255,255,.85); color: #0E1A1F; }
html[data-design="glass"] .btn.ghost { background: rgba(255,255,255,.2); color: var(--text); border-color: rgba(255,255,255,.4); }
html[data-design="glass"] .hero { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.4); backdrop-filter: blur(18px); color: var(--text); box-shadow: var(--shadow); }
html[data-design="glass"] .hero .muted, html[data-design="glass"] .hero .delta, html[data-design="glass"] .hero-split, html[data-design="glass"] .hero-split b { color: var(--text); }
html[data-design="glass"] .notif-pop, html[data-design="glass"] details.pop .menu, html[data-design="glass"] .icon-pop .ip-box, html[data-design="glass"] .install { backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }

/* Gradient Accent: sfumature decise su azioni e titoli */
html[data-design="gradient"] { --grad: linear-gradient(120deg, var(--accent), var(--accent-2)); --r: 16px; }
html[data-design="gradient"] .btn:not(.ghost):not(.danger) { background: var(--grad); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent); }
html[data-design="gradient"] h1 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-design="gradient"] .side nav a.on { background: var(--grad); color: #fff; }
html[data-design="gradient"] .bar i { background: var(--grad); }
html[data-design="gradient"] .hero { background: linear-gradient(120deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 40%, var(--accent-2)) 60%, var(--accent-2) 100%); }
html[data-design="gradient"] .card { border-top: 3px solid transparent; border-image: var(--grad) 1; border-image-slice: 1 0 0 0; }
html[data-design="gradient"] .kpi strong { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-design="gradient"] .kpi strong.pos, html[data-design="gradient"] .kpi strong.neg { background: none; -webkit-background-clip: initial; background-clip: initial; }
html[data-design="gradient"] .kpi strong.pos { color: var(--pos); } html[data-design="gradient"] .kpi strong.neg { color: var(--neg); }
html[data-design="gradient"] .tabs a.on, html[data-design="gradient"] .pager a.on { background: var(--grad); color: #fff; border-color: transparent; }

/* ================================================================ RESPONSIVE */
@media (max-width: 1100px) {
  .cal-wrap { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow-lg); background: var(--surface); }
  html[data-design="glass"] .side, html[data-design="liquid"] .side { background: var(--surface); }
  body.side-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.side-open .scrim { opacity: 1; pointer-events: auto; }
  .only-m { display: inline-grid; }
  .add-top { display: none; }
  .content { padding-bottom: 96px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; align-items: center; }
  html[data-design="glass"] .bottom-nav, html[data-design="liquid"] .bottom-nav { background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: .68rem; font-weight: 700; background: none; border: 0; font-family: inherit; padding: 4px 10px; cursor: pointer; }
  .bottom-nav a.on { color: var(--accent); }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav .fab { width: 54px; height: 54px; border-radius: 18px; background: var(--accent); color: #fff; justify-content: center; margin-top: -26px; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 40%, transparent); }
  html[data-design="gradient"] .bottom-nav .fab { background: var(--grad); }
  html[data-design="expressive"] .bottom-nav .fab, html[data-design="liquid"] .bottom-nav .fab { border-radius: 50%; }
  .install { bottom: 90px; }
  .report-split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  html { font-size: 14.5px; }
  :root { --pad: 14px; --gap: 12px; }
  h1 { font-size: 1.45rem; }
  html[data-design="expressive"] h1 { font-size: 1.7rem; }
  .grid2 { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi strong { font-size: 1.1rem; }
  .big-num, .hero .big-num { font-size: 2rem; }
  .page-head { align-items: flex-start; }
  .page-head .actions { width: 100%; flex-wrap: wrap; }
  .search { max-width: none; }
  .cal-d { min-height: 58px; font-size: .64rem; padding: 4px; }
  .cal-d span { display: none; }
  .split-row { grid-template-columns: 1fr 1fr auto; }
  .split-row input[name="split_note[]"] { grid-column: 1 / 3; }
  .req { grid-template-columns: 1fr; }
  .filters > label { flex: 1 1 140px; }
  .row-link .run { display: none; }
  .auth-card { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .side, .top, .bottom-nav, .install, .actions, .filters, .tabs { display: none !important; } .card { box-shadow: none; break-inside: avoid; } body { background: #fff; } }
