/* Zero — mobile first. Nessuna dipendenza esterna. */
:root {
  --bg: #f4f5fa;
  --card: #ffffff;
  --card2: #f6f7fb;
  --line: #e6e8f0;
  --text: #111827;
  --muted: #5f6678;
  --faint: #9aa0b0;
  --accent: #4f46e5;
  --accent-2: #818cf8;
  --accent-soft: #ecebfd;
  --on-accent: #ffffff;
  --g1: #4f46e5;
  --g2: #9333ea;
  --ok: #15803d;
  --ok-soft: #e3f5e8;
  --warn: #b45309;
  --warn-soft: #fdf1df;
  --bad: #c2410c;
  --bad-strong: #dc2626;
  --bad-soft: #fde8e2;
  --info: #2563eb;
  --info-soft: #e5edfd;
  --idea: #7c3aed;
  --idea-soft: #efe8fd;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 4px 14px rgba(17, 24, 39, .05);
  --shadow-lg: 0 16px 48px rgba(17, 24, 39, .18);
  --glow: color-mix(in srgb, var(--g2) 14%, transparent);
  --r: 18px;
  --r-sm: 12px;
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0c12;
  --card: #14161f;
  --card2: #1b1e2a;
  --line: #262a38;
  --text: #eceef5;
  --muted: #9aa0b4;
  --faint: #6b7186;
  --accent: #a5b4fc;
  --accent-2: #6366f1;
  --accent-soft: #1f1d45;
  --on-accent: #0b0c12;
  --ok: #4ade80;
  --ok-soft: #12291c;
  --warn: #fbbf24;
  --warn-soft: #2e2510;
  --bad: #fb923c;
  --bad-strong: #f87171;
  --bad-soft: #341a12;
  --info: #60a5fa;
  --info-soft: #132239;
  --idea: #a78bfa;
  --idea-soft: #221a3b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .7);
  --glow: color-mix(in srgb, var(--g2) 22%, transparent);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: radial-gradient(900px 420px at 85% -120px, var(--glow), transparent 70%) no-repeat, var(--bg); color: var(--text); font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 750; letter-spacing: -.025em; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 6px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------------------------------------------------------------- layout */
.boot { display: grid; place-items: center; min-height: 100vh; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.shell { min-height: 100vh; }
.main { padding: calc(12px + var(--safe-t)) 14px calc(var(--tab-h) + 24px + var(--safe-b)); max-width: 1120px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; min-height: 40px; }
.topbar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .sub { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid var(--line);
}
.tabbar a, .tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none;
  color: var(--muted); font-size: 11px; font-weight: 550; cursor: pointer; -webkit-tap-highlight-color: transparent; position: relative;
}
.tabbar a.on { color: var(--accent); }
.tabbar a.on::before { content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, var(--g1), var(--g2)); }
.tabbar svg { width: 24px; height: 24px; }
.tabbar .plus span.ico { width: 48px; height: 48px; border-radius: 17px; background: linear-gradient(135deg, var(--g1), var(--g2)); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--g2) 70%, transparent); }
.tabbar .plus svg { width: 26px; height: 26px; }
.tabbar .badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--bad-strong); color: #fff; font-size: 10.5px; line-height: 17px; font-weight: 700; }

.side { display: none; }
@media (min-width: 900px) {
  .tabbar { display: none; }
  .side {
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: 228px; padding: 20px 12px; gap: 2px;
    background: var(--card); border-right: 1px solid var(--line); z-index: 30;
  }
  .side .brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; padding: 4px 10px 18px; }
  .side .brand img { width: 30px; height: 30px; }
  .side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 550; }
  .side a:hover { background: var(--card2); color: var(--text); }
  .side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
  .side svg { width: 20px; height: 20px; }
  .side .btn { margin: 0 0 14px; }
  .side .sep { flex: 1; }
  .main { padding: 26px 32px 40px; margin-left: 228px; }
  .shell.noside .main { margin-left: auto; }
}

/* ---------------------------------------------------------------- componenti */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card.pad { padding: 14px; }
.card + .card, .section + .section { margin-top: 12px; }
.section { margin-top: 20px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 2px 8px; }
.section-h h2 { font-size: 15px; text-transform: none; }
.section-h .count { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 6px; }

.list { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); cursor: pointer;
  -webkit-tap-highlight-color: transparent; color: inherit; min-height: 60px;
}
.item:first-child { border-top: 0; }
.item:active { background: var(--card2); }
@media (hover: hover) { .item:hover { background: var(--card2); } }
.item .t { font-weight: 600; }
.item .s { font-size: 13px; color: var(--muted); }
.item .end { text-align: right; flex-shrink: 0; }
.item .act { flex-shrink: 0; }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; background: var(--accent-soft); color: var(--accent); }
.avatar.ok { background: var(--ok-soft); color: var(--ok); }
.avatar.warn { background: var(--warn-soft); color: var(--warn); }
.avatar.bad { background: var(--bad-soft); color: var(--bad); }
.avatar.off { background: var(--card2); color: var(--faint); }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--card2); color: var(--muted); white-space: nowrap; line-height: 18px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.idea { background: var(--idea-soft); color: var(--idea); }
.pill.acc { background: var(--accent-soft); color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; transition: transform .06s, background .15s; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 19px; height: 19px; flex-shrink: 0; }
.btn.primary { background: linear-gradient(135deg, var(--g1), var(--g2)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--g2) 60%, transparent); }
.btn.danger { color: var(--bad-strong); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { height: 34px; padding: 0 11px; border-radius: 9px; font-size: 13.5px; }
.btn.icon { width: 44px; padding: 0; }
.btn.icon.sm { width: 34px; }
.btn.block { width: 100%; }
.btn.lg { height: 52px; font-size: 16px; border-radius: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.wa { color: #128c4b; }
[data-theme="dark"] .btn.wa { color: #4ade80; }

.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.actions .btn { flex-direction: column; height: 64px; gap: 4px; font-size: 12.5px; padding: 0 4px; }
.actions .btn svg { width: 22px; height: 22px; }

/* input */
.field { display: block; }
.field > span.l { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 5px 2px; }
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); outline: none;
  transition: border-color .15s, box-shadow .15s; font-size: 16px; -webkit-appearance: none; appearance: none;
}
textarea.input { height: auto; min-height: 92px; padding: 11px 13px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-wrap .btn { position: absolute; right: 4px; top: 4px; height: 38px; width: 38px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.input-prefix .input { padding-left: 30px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 40px; height: 48px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.search .clear { position: absolute; right: 6px; top: 6px; height: 36px; width: 36px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.search .clear svg { position: static; transform: none; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex-shrink: 0; height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600;
  font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--text); -webkit-tap-highlight-color: transparent;
}
.chip .c { color: var(--muted); font-weight: 500; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.on .c { color: inherit; opacity: .75; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--card2); border-radius: 13px; border: 1px solid var(--line); }
.seg button { height: 42px; border: 0; border-radius: 10px; background: transparent; font-weight: 650; cursor: pointer; color: var(--muted); -webkit-tap-highlight-color: transparent; padding: 0 4px; }
.seg button small { display: block; font-size: 11px; font-weight: 500; margin-top: -2px; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.seg.big button { height: 56px; font-size: 17px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .tg { width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; flex-shrink: 0; transition: background .15s; }
.switch .tg::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + .tg { background: linear-gradient(135deg, var(--g1), var(--g2)); }
.switch input:checked + .tg::after { transform: translateX(18px); }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { padding: 12px 14px; }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.kpi .v { font-size: 23px; font-weight: 780; letter-spacing: -.03em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; color: var(--muted); margin-top: 1px; }
.kpi .d.up { color: var(--ok); }
.kpi .d.down { color: var(--bad); }

.insight { display: flex; gap: 10px; padding: 11px 13px; border-radius: 12px; font-size: 14px; align-items: flex-start; }
.insight svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.insight.ok { background: var(--ok-soft); color: var(--ok); }
.insight.info { background: var(--info-soft); color: var(--info); }
.insight.warn { background: var(--warn-soft); color: var(--warn); }
.insight.alert { background: var(--bad-soft); color: var(--bad); }
.insight.idea { background: var(--idea-soft); color: var(--idea); }
.insight .tx { color: var(--text); }
.insight + .insight { margin-top: 8px; }
a.insight { cursor: pointer; }

.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 6px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 550; overflow-wrap: anywhere; }

.score { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.score > div { text-align: center; }
.score .ring { width: 54px; height: 54px; margin: 0 auto 4px; }
.score .ring text { font-size: 15px; font-weight: 750; fill: var(--text); }
.score .lb { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.secret { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); }
.secret .val { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14.5px; overflow-wrap: anywhere; }
.secret .lab { font-size: 11.5px; color: var(--muted); display: block; font-family: var(--font); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--card2); color: var(--muted); }
.timeline .dot svg { width: 16px; height: 16px; }
.timeline .dot.ok { background: var(--ok-soft); color: var(--ok); }
.timeline .dot.acc { background: var(--accent-soft); color: var(--accent); }
.timeline .dot.info { background: var(--info-soft); color: var(--info); }
.timeline .dot.warn { background: var(--warn-soft); color: var(--warn); }
.timeline .dot.bad { background: var(--bad-soft); color: var(--bad); }
.timeline .when { font-size: 12px; color: var(--faint); }
.timeline .body { flex: 1; min-width: 0; white-space: pre-line; overflow-wrap: anywhere; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.bar { height: 8px; border-radius: 4px; background: var(--card2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad-strong); }

.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-size: 10.5px; fill: var(--muted); font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.tip { position: fixed; z-index: 90; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12.5px; padding: 6px 9px; border-radius: 8px; white-space: pre; box-shadow: var(--shadow-lg); }

/* sheet / dialog */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(8, 15, 20, .45); opacity: 0; transition: opacity .2s; }
.overlay.in { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 94vh; display: flex; flex-direction: column; background: var(--bg);
  border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg); transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.sheet.in { transform: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex-shrink: 0; }
.sheet .sh-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px 10px; flex-shrink: 0; }
.sheet .sh-head h2 { flex: 1; font-size: 18px; }
.sheet .sh-body { overflow-y: auto; padding: 4px 16px 16px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet .sh-foot { padding: 10px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--card); flex-shrink: 0; }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 560px; max-height: 88vh; border-radius: 20px; transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; }
  .sheet.in { transform: translate(-50%, -50%); opacity: 1; }
  .sheet .grab { display: none; }
  .sheet .sh-head { padding-top: 16px; }
  .sheet .sh-foot { border-radius: 0 0 20px 20px; padding-bottom: 14px; }
}

.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + 14px + var(--safe-b)); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 14px; }
@media (min-width: 900px) { .toast-wrap { bottom: 24px; } }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 550; box-shadow: var(--shadow-lg); max-width: 520px; display: flex; gap: 12px; align-items: center; pointer-events: auto; animation: tin .2s ease-out; }
.toast.err { background: var(--bad-strong); color: #fff; }
.toast button { border: 0; background: none; color: var(--accent-2); font-weight: 700; cursor: pointer; padding: 0; }
@keyframes tin { from { transform: translateY(12px); opacity: 0; } }

.summary { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); }
.summary .big { font-size: 20px; font-weight: 750; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; padding: 26px 22px; }
.login .logo { width: 56px; height: 56px; margin: 0 auto 12px; display: block; }
.login h1 { text-align: center; margin-bottom: 4px; }
.login p.sub { text-align: center; color: var(--muted); margin: 0 0 20px; }
.error { color: var(--bad-strong); font-size: 14px; font-weight: 550; }

.hint { font-size: 12.5px; color: var(--muted); margin: 4px 2px 0; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.menu .item svg { width: 21px; height: 21px; color: var(--muted); }
.ic { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -3px; }
.loading { display: grid; place-items: center; padding: 60px 0; }
.sticky-actions { position: sticky; top: 0; z-index: 20; padding: 8px 0; margin: -8px 0 4px; background: var(--bg); }
@media (min-width: 900px) { .two-col { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; } .two-col > * + * { margin-top: 0; } }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.prev-msg { white-space: pre-wrap; }
.item.danger { color: var(--bad-strong); }
.item.danger svg { color: var(--bad-strong) !important; }

/* aspetto dell'app */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.swatch.on { border-color: var(--accent); font-weight: 650; }
.swatch .dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .35); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* ---------------------------------------------------------------- dashboard */
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.topbar .theme-btn { border-radius: 50%; }

.hero {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 24px; padding: 18px 18px 14px; color: #fff;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--g2) 75%, transparent);
}
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(8px); }
.hero::before { width: 260px; height: 260px; right: -90px; top: -120px; background: radial-gradient(circle, rgba(255, 255, 255, .28), transparent 65%); }
.hero::after { width: 220px; height: 220px; left: -80px; bottom: -130px; background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 65%); }
.hero .lab { font-size: 13px; font-weight: 600; opacity: .85; }
.hero .big { font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.hero .sub { font-size: 13px; opacity: .85; }
.hero .delta { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: 12px; font-weight: 700; backdrop-filter: blur(6px); }
.hero .delta svg { width: 14px; height: 14px; }
.hero .prog { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .2); overflow: hidden; margin: 12px 0 6px; }
.hero .prog > i { display: block; height: 100%; border-radius: 4px; background: #fff; width: 0; transition: width 1.1s cubic-bezier(.2, .8, .2, 1); }
.hero .area { display: block; width: calc(100% + 36px); height: 74px; margin: 8px -18px 0; }
.hero .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .18); }
.hero .stats > a, .hero .stats > div { color: #fff; min-width: 0; }
.hero .stats .k { font-size: 11.5px; opacity: .8; font-weight: 600; }
.hero .stats .v { font-size: 17px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }

.todo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.todo > a {
  display: flex; flex-direction: column; gap: 8px; padding: 13px 12px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow); color: var(--text); transition: transform .12s; -webkit-tap-highlight-color: transparent;
}
.todo > a:active { transform: scale(.97); }
.todo .ti { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; }
.todo .ti svg { width: 19px; height: 19px; }
.todo .n { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.todo .l { font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.todo .bad .ti { background: var(--bad-soft); color: var(--bad-strong); }
.todo .warn .ti { background: var(--warn-soft); color: var(--warn); }
.todo .acc .ti { background: var(--accent-soft); color: var(--accent); }
.todo .zero .n { color: var(--faint); }
.allok { display: flex; align-items: center; gap: 12px; padding: 14px; }
.allok .ti { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); flex-shrink: 0; }

.kpi .ki { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.kpi .ki svg { width: 17px; height: 17px; }
a.kpi { color: inherit; display: block; }

.gauge { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.gauge svg { width: 104px; height: 104px; flex-shrink: 0; }
.gauge .gv { font-size: 22px; font-weight: 800; fill: var(--text); letter-spacing: -.03em; }
.gauge .gl { font-size: 10.5px; fill: var(--muted); font-weight: 600; }
.gauge circle.arc { transition: stroke-dasharray 1.2s cubic-bezier(.2, .8, .2, 1); }

.trend { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-top: 12px; }
.trend > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.trend .bw { flex: 1; min-height: 0; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.trend .b { width: 100%; max-width: 38px; border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, var(--accent) 22%, transparent); height: 0; transition: height .9s cubic-bezier(.2, .8, .2, 1); }
.trend .now .b { background: linear-gradient(180deg, var(--g2), var(--g1)); }
.trend .m { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.trend .now .m { color: var(--text); }
.trend .val { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.dash > * { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.dash > :nth-child(2) { animation-delay: .05s; }
.dash > :nth-child(3) { animation-delay: .1s; }
.dash > :nth-child(4) { animation-delay: .15s; }
.dash > :nth-child(5) { animation-delay: .2s; }
.dash > :nth-child(n+6) { animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  .dash > * { animation: none; }
  .hero .prog > i, .trend .b, .gauge circle.arc { transition: none; }
}
@media (min-width: 900px) {
  .hero { padding: 24px 26px 18px; }
  .hero .big { font-size: 54px; }
  .hero .area { width: calc(100% + 52px); margin: 8px -26px 0; height: 96px; }
  .dash-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: stretch; }
  .dash-top .todo { grid-template-columns: 1fr; }
  .dash-top .todo > a { flex-direction: row; align-items: center; }
  .dash-top .todo .l { flex: 1; }
}
.dash-top > * + * { margin-top: 12px; }
@media (min-width: 900px) { .dash-top > * + * { margin-top: 0; } }
