/* MagazAIno — interfaccia pensata per volontari sul campo: testi grandi, pulsanti larghi, poche parole. */
:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface-2: #f1eee9;
  --text: #1f2328;
  --muted: #667085;
  --border: #e7e3dc;
  --accent: #d0212f;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--surface));
  --accent-text: color-mix(in srgb, var(--accent) 85%, #000);
  --ok: #1a7f37;
  --ok-soft: color-mix(in srgb, var(--ok) 12%, var(--surface));
  --warn: #b45309;
  --warn-soft: color-mix(in srgb, #f59e0b 16%, var(--surface));
  --danger: #c62828;
  --danger-soft: color-mix(in srgb, var(--danger) 11%, var(--surface));
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.16);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --tabbar-h: 68px;
  color-scheme: light dark;
}
:root[data-kind='disabili'] { --accent: #1565c0; }
:root[data-kind='anziani'] { --accent: #2e7d32; }
:root[data-kind='animali'] { --accent: #c2410c; }
:root[data-kind='altro'] { --accent: #5e35b1; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1c1c1e;
    --surface-2: #26262a;
    --text: #ececec;
    --muted: #a1a1aa;
    --border: #34343a;
    --accent-text: color-mix(in srgb, var(--accent) 55%, #fff);
    --ok: #3fb950;
    --warn: #f0a44b;
    --danger: #f87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.45 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0.4em 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.i { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.lead { font-size: 1.05rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- Avvio ---- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); font-weight: 600; }
.boot-logo { width: 64px; height: 64px; border-radius: 16px; background: url('/icons/icon.svg') center / cover; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.92); opacity: 0.7; } }

/* ---- Struttura ---- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 272px; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 40; overflow-y: auto; transform: translateX(-100%); transition: transform 0.2s ease;
}
.sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 35; }
.main-col { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 18px 16px calc(var(--tabbar-h) + 28px); outline: none; }
main.bare { max-width: 480px; padding: 28px 18px 48px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none;
  color: var(--muted); font: 600 0.72rem var(--font); text-decoration: none; position: relative; cursor: pointer;
}
.tabbar .i { width: 26px; height: 26px; }
.tabbar .active { color: var(--accent-text); }
.tabbar .fab-tab .fab { width: 56px; height: 56px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; margin-top: -22px; box-shadow: var(--shadow-lg); }
.tabbar .fab-tab .i { width: 30px; height: 30px; }
@media (min-width: 960px) {
  .sidebar { transform: none; }
  .main-col { margin-left: 272px; }
  .tabbar, .menu-btn { display: none !important; }
  main { padding: 24px 32px 48px; }
}

/* Barra laterale */
.side-org { padding: 18px 16px 12px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: url('/icons/icon.svg') center / cover; }
.brand b { color: var(--accent-text); }
.org-switch {
  margin-top: 14px; width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit;
}
.org-switch .name { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-switch .meta { font-size: 0.8rem; color: var(--muted); }
.nav { padding: 8px 10px 16px; flex: 1; }
.nav h4 { margin: 16px 10px 6px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--text);
  text-decoration: none; font-weight: 600;
}
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.nav .count { margin-left: auto; }
.side-foot { padding: 12px 16px 18px; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--muted); }
.side-foot a { color: var(--muted); }

/* Barra superiore */
.top-title { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-title small { display: block; font-weight: 500; color: var(--muted); font-size: 0.78rem; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; border: 0; background: transparent;
  color: var(--text); cursor: pointer; position: relative; flex: none; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .i { width: 24px; height: 24px; }
.dot {
  position: absolute; top: 4px; right: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--danger);
  color: #fff; font: 700 0.7rem/20px var(--font); text-align: center;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text);
  font-weight: 800; font-size: 0.9rem; flex: none;
}

/* ---- Intestazione pagina ---- */
.page-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .back { margin: -4px 0 0 -8px; }
.page-title { flex: 1; min-width: 200px; }
.page-title p { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Pulsanti ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 700 1rem var(--font); cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: transform 0.05s, background 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.btn.big { min-height: 60px; font-size: 1.1rem; border-radius: var(--radius); padding: 0 24px; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 0.9rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sticky-cta {
  position: sticky; bottom: calc(var(--tabbar-h) + 10px); z-index: 10; padding-top: 12px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
@media (min-width: 960px) { .sticky-cta { bottom: 12px; } }

/* ---- Card, riquadri, tile ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card, .section + .section { margin-top: 16px; }
.card h2 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h2 .i { color: var(--accent-text); }
.section { margin-top: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; min-height: 124px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; box-shadow: var(--shadow);
  transition: transform 0.08s, box-shadow 0.15s; cursor: pointer; font: inherit; text-align: left;
}
.tile:hover { box-shadow: var(--shadow-lg); }
.tile:active { transform: scale(0.98); }
.tile .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.tile .ico .i { width: 28px; height: 28px; }
.tile b { font-size: 1.1rem; }
.tile small { color: var(--muted); font-size: 0.85rem; margin-top: -6px; }
.tile.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tile.primary .ico { background: rgba(255, 255, 255, 0.2); color: #fff; }
.tile.primary small { color: rgba(255, 255, 255, 0.85); }
.tile .dot { top: 12px; right: 12px; }

.hello { margin-bottom: 18px; }
.hello h1 { font-size: 1.75rem; }
.hello p { color: var(--muted); }
.demo-banner {
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px;
  background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 0.9rem;
}

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 0.85rem; font-weight: 600; }

/* ---- Elenchi ---- */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--border); }
.li {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text); text-decoration: none; min-height: 60px;
  background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; font: inherit; text-align: left;
}
a.li:hover, button.li:hover { background: var(--surface-2); cursor: pointer; }
.li .title { font-weight: 650; }
.li .sub { color: var(--muted); font-size: 0.85rem; }
.li .end { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.li .qty { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.item-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; background: var(--surface-2); flex: none; }
.type-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.type-ico.in { background: var(--ok-soft); color: var(--ok); }
.type-ico.out { background: var(--accent-soft); color: var(--accent-text); }
.type-ico.move { background: var(--warn-soft); color: var(--warn); }

/* Badge e chip */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: 600 0.92rem var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed='true'], .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; }
.size {
  min-height: 64px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
  font: 800 1.15rem var(--font); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.size small { font: 600 0.72rem var(--font); color: var(--muted); }
.size.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.size:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Moduli ---- */
.field { display: block; margin-bottom: 14px; }
.field .label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.95rem; }
.hint { display: block; color: var(--muted); margin-top: 5px; font-size: 0.82rem; }
.input {
  width: 100%; min-height: 50px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font: 1rem var(--font);
}
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { min-height: 90px; resize: vertical; }
.search { position: relative; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 44px; min-height: 54px; font-size: 1.05rem; border-radius: 999px; }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle .track { flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--border); position: relative; transition: background 0.15s; margin-top: 2px; }
.toggle .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: var(--shadow); }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(20px); }
.toggle input:focus-visible + .track { outline: 3px solid var(--accent-soft); }
.toggle small { display: block; color: var(--muted); font-size: 0.85rem; }
.stepper { display: flex; align-items: stretch; gap: 8px; max-width: 280px; }
.stepper .step { width: 60px; min-height: 60px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.stepper .step .i { width: 26px; height: 26px; }
.stepper .input { text-align: center; font-size: 1.5rem; font-weight: 800; min-height: 60px; }
.pw-wrap { position: relative; }
.pw-wrap .icon-btn { position: absolute; right: 4px; top: 3px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font: 700 0.9rem var(--font); color: var(--muted); cursor: pointer; min-height: 40px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 12px 14px; font-weight: 700; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--accent-text); border-color: var(--accent); }

/* ---- Tabelle ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.t th, .t td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.t th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t tr:last-child td { border-bottom: 0; }
.t tr.low td { background: var(--danger-soft); }
.t input.input { min-height: 40px; padding: 6px 10px; width: 110px; text-align: right; }

/* ---- Avvisi ---- */
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); align-items: flex-start; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.danger { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--accent-soft); color: var(--accent-text); }
.alert p { margin: 2px 0 0; color: var(--text); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty > .i { width: 44px; height: 44px; margin-bottom: 8px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.loading { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 40px; color: var(--muted); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toasts { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px); transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); }
.toast {
  display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-radius: 14px; background: #1f2328; color: #fff; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: rise 0.2s ease-out;
}
.toast.err { background: var(--danger); }
.toast.warn { background: #92400e; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: 0.25s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---- Dialoghi ---- */
dialog.modal { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; margin: auto auto 0; color: var(--text); }
dialog.modal::backdrop { background: rgba(0, 0, 0, 0.4); }
.modal-inner { background: var(--surface); border-radius: 22px 22px 0 0; max-height: 92vh; display: flex; flex-direction: column; animation: sheet 0.22s ease-out; }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 6px 20px; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 8px 20px 16px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .btn { flex: 1; }
@media (min-width: 640px) {
  dialog.modal { width: min(560px, 94vw); margin: auto; }
  dialog.modal.wide { width: min(880px, 94vw); }
  .modal-inner { border-radius: 22px; }
  .modal-foot .btn { flex: none; }
}
.pick-list { max-height: 55vh; overflow-y: auto; margin: 10px -20px 0; border-top: 1px solid var(--border); }
.pick-list .li { border-radius: 0; }

/* ---- Accesso ---- */
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-brand .logo { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 20px; background: url('/icons/icon.svg') center / cover; box-shadow: var(--shadow-lg); }
.auth-brand h1 { font-size: 1.9rem; }
.auth-brand h1 b { color: var(--accent-text); }
.auth-brand p { color: var(--muted); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.social { display: grid; gap: 10px; }
.social .btn { justify-content: flex-start; padding-left: 16px; }
.social .mark { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-weight: 800; font-size: 0.8rem; color: #fff; }
.mark.google { background: #4285f4; }
.mark.microsoft { background: #2f2f2f; }
.mark.facebook { background: #1877f2; }
.mark.github { background: #24292f; }
.auth-foot { text-align: center; margin-top: 22px; color: var(--muted); font-size: 0.85rem; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 300px; margin: 18px auto 0; }
.pinpad button { height: 68px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font: 700 1.6rem var(--font); color: var(--text); cursor: pointer; }
.pinpad button:active { background: var(--accent-soft); }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 14px 0; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots span.on { background: var(--accent); border-color: var(--accent); }
.credits { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 26px; }

/* ---- Procedura guidata ---- */
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--border); }
.steps span.on { background: var(--accent); }
.cart-line { display: flex; gap: 12px; align-items: center; padding: 12px 14px; }
.cart-line .qty { font-size: 1.3rem; font-weight: 800; }
.success { text-align: center; padding: 30px 10px; }
.success .big-check { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 16px; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; animation: pop 0.35s ease-out; }
.success .big-check .i { width: 56px; height: 56px; stroke-width: 3; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

/* ---- Grafici ---- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font: 600 11px var(--font); }
.legend { display: flex; gap: 14px; font-size: 0.85rem; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 38%) 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 0.92rem; }
.bar-row .bar { height: 12px; border-radius: 6px; background: var(--accent); min-width: 2px; }
.bar-track { background: var(--surface-2); border-radius: 6px; }

/* ---- QR ed etichette ---- */
.qr-box svg { width: 100%; height: auto; display: block; }
.labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.label-card { border: 1px dashed var(--border); border-radius: 8px; padding: 8px; display: flex; gap: 8px; align-items: center; background: #fff; color: #000; break-inside: avoid; }
.label-card .qr-box { width: 90px; flex: none; }
.label-card b { font-size: 0.85rem; display: block; }
.label-card small { font-size: 0.7rem; color: #444; }
.scan-video { width: 100%; border-radius: var(--radius); background: #000; aspect-ratio: 3 / 4; object-fit: cover; }

/* ---- Documento stampabile ---- */
.doc-paper { background: #fff; color: #111; border-radius: var(--radius); padding: 28px; border: 1px solid var(--border); }
.doc-paper h2 { font-size: 1.3rem; }
.doc-paper table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.92rem; }
.doc-paper th, .doc-paper td { border-bottom: 1px solid #ddd; padding: 8px 6px; text-align: left; }
.doc-paper th { font-size: 0.75rem; text-transform: uppercase; color: #555; }
.doc-paper .num { text-align: right; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 2px solid #111; padding-bottom: 12px; }
.sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.sign div { border-top: 1px solid #555; padding-top: 6px; font-size: 0.8rem; color: #555; }
.print-only { display: none; }

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .tabbar, .no-print, #toasts, .page-head .page-actions, .sticky-cta { display: none !important; }
  .main-col { margin: 0 !important; }
  main { padding: 0 !important; max-width: none; }
  .print-only { display: block; }
  .doc-paper { border: 0; padding: 0; }
  .card { box-shadow: none; }
  .labels { gap: 0; }
  .label-card { border: 1px dashed #bbb; border-radius: 0; height: 36mm; }
  @page { margin: 12mm; }
}
