/* Interventi: token di design e componenti condivisi dei mockup.
   Riferimento per il frontend: docs/mockup/linee-grafiche.md */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

/* ---------- Token ---------- */
:root {
  /* Marchio: blu petrolio (acqua, impianti) */
  --brand-50: #eaf4f8;
  --brand-100: #cfe6ef;
  --brand-200: #a3cfdf;
  --brand-500: #1683a8;
  --brand-600: #0e6f90;
  --brand-700: #0b5d7a;
  --brand-800: #094a62;
  --brand-900: #0a2f3e;

  /* Accento: ambra (energia, calore). Solo per dettagli e marchio, mai per testo su bianco */
  --accent-100: #fef3c7;
  --accent-400: #fbbf24;
  --accent-500: #f59e0b;
  --accent-700: #b45309;

  /* Neutri */
  --ink-900: #0f172a;
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;

  /* Stati */
  --ok: #16a34a;     --ok-bg: #dcfce7;     --ok-fg: #166534;
  --warn: #d97706;   --warn-bg: #fef3c7;   --warn-fg: #92400e;
  --err: #dc2626;    --err-bg: #fee2e2;    --err-fg: #b91c1c;
  --info: #0284c7;   --info-bg: #e0f2fe;   --info-fg: #075985;
  --draft-bg: #eef2f6; --draft-fg: #475569;

  /* Colori squadre e addetti (calendario): pieno per bordo e pallino, tinta per sfondo, scuro per testo */
  --t-nord: #2563eb;  --t-nord-bg: #dbeafe;  --t-nord-fg: #1e3a8a;
  --t-sud: #16a34a;   --t-sud-bg: #dcfce7;   --t-sud-fg: #14532d;
  --t-ele: #7c3aed;   --t-ele-bg: #ede9fe;   --t-ele-fg: #4c1d95;
  --t-cal: #ea580c;   --t-cal-bg: #ffedd5;   --t-cal-fg: #7c2d12;
  --t-sin: #0891b2;   --t-sin-bg: #cffafe;   --t-sin-fg: #164e63;

  /* Tipografia */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-base: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;

  /* Spaziature (base 4) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* Raggi e ombre */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 999px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --sh-2: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .05);
  --sh-3: 0 20px 40px rgba(15, 23, 42, .18), 0 6px 12px rgba(15, 23, 42, .08);
  --focus: 0 0 0 3px rgba(22, 131, 168, .35);

  /* Misure */
  --h-control: 40px;     /* ufficio */
  --h-control-t: 52px;   /* tablet: sopra il minimo touch di 44px */
  --sidebar-w: 248px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--ink-900);
  background: var(--bg);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.25; color: var(--ink-900); }
h1 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: var(--fs-xl); font-weight: 700; }
h3 { font-size: var(--fs-lg); font-weight: 700; }
p { margin: 0; }
a { color: var(--brand-700); text-underline-offset: 2px; }
.num, table td.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-600); }
.small { font-size: var(--fs-sm); }
.strong { font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }

.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 24px; height: 24px; }

/* ---------- Marchio ---------- */
.brand { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; color: inherit; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: linear-gradient(145deg, var(--brand-500), var(--brand-800));
  display: grid; place-items: center; position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.brand-mark svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark::after {
  content: ''; position: absolute; right: -3px; top: -3px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--accent-500); border: 2px solid var(--brand-900);
}
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--h-control); padding: 0 var(--s-4);
  border-radius: var(--r-md); border: 1px solid transparent;
  font: 600 var(--fs-md)/1 var(--font-sans); text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn-primary { background: var(--brand-700); color: #fff; }
.btn-primary:hover { background: var(--brand-800); }
.btn-secondary { background: var(--surface); color: var(--ink-800); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--ink-500); }
.btn-ghost { background: transparent; color: var(--ink-700); }
.btn-ghost:hover { background: var(--draft-bg); }
.btn-danger { background: var(--surface); color: var(--err-fg); border-color: #fca5a5; }
.btn-danger:hover { background: var(--err-bg); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-lg { height: var(--h-control-t); padding: 0 var(--s-6); font-size: var(--fs-lg); border-radius: var(--r-lg); }
.btn-xl { height: 64px; padding: 0 var(--s-8); font-size: 19px; border-radius: var(--r-lg); }
.btn-block { width: 100%; }
.icon-btn {
  width: var(--h-control); height: var(--h-control); padding: 0;
  display: inline-grid; place-items: center; border-radius: var(--r-md);
  border: 1px solid transparent; background: transparent; color: var(--ink-600); cursor: pointer;
}
.icon-btn:hover { background: var(--draft-bg); color: var(--ink-900); }
.icon-btn.t { width: 48px; height: 48px; }

/* ---------- Campi ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-700); }
.label .opt { font-weight: 400; color: var(--ink-500); }
.req { color: var(--err-fg); }
.input, .select, .textarea {
  width: 100%; height: var(--h-control); padding: 0 var(--s-3);
  font: 400 var(--fs-base)/1.4 var(--font-sans); color: var(--ink-900);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
}
.textarea { height: auto; min-height: 96px; padding: var(--s-3); resize: vertical; }
.select {
  appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: #8391a7; }
.input.is-invalid { border-color: var(--err); }
.hint { font-size: var(--fs-sm); color: var(--ink-600); }
.error-msg { font-size: var(--fs-sm); color: var(--err-fg); display: flex; gap: 6px; align-items: center; font-weight: 500; }
.input-icon { position: relative; }
.input-icon .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-500); pointer-events: none; }
.input-icon .input { padding-left: 40px; }
.check { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-md); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand-700); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* Controllo segmentato (scelte poche e frequenti al posto dei menu) */
.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--draft-bg); border-radius: var(--r-md); }
.seg button, .seg label {
  border: 0; background: transparent; border-radius: 8px; padding: 0 var(--s-4);
  height: 34px; font: 600 var(--fs-md)/1 var(--font-sans); color: var(--ink-600); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg .on { background: var(--surface); color: var(--ink-900); box-shadow: var(--sh-1); }

/* Scelte a pastiglia (tablet) */
.choices { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.choice {
  min-height: 48px; padding: 0 var(--s-5); border-radius: var(--r-full);
  border: 1.5px solid var(--line-strong); background: var(--surface);
  font: 600 var(--fs-base)/1 var(--font-sans); color: var(--ink-700);
  display: inline-flex; align-items: center; gap: var(--s-2); cursor: pointer;
}
.choice.on { border-color: var(--brand-700); background: var(--brand-50); color: var(--brand-800); }
.choice.on .i { color: var(--brand-700); }

/* ---------- Etichette di stato ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-bozza { background: var(--draft-bg); color: var(--draft-fg); }
.b-firmare { background: var(--warn-bg); color: var(--warn-fg); }
.b-firmato { background: var(--ok-bg); color: var(--ok-fg); }
.b-info { background: var(--info-bg); color: var(--info-fg); }
.b-err { background: var(--err-bg); color: var(--err-fg); }
.badge.lg { height: 32px; padding: 0 14px; font-size: var(--fs-md); }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.d-nord { background: var(--t-nord); } .d-sud { background: var(--t-sud); }
.d-ele { background: var(--t-ele); } .d-cal { background: var(--t-cal); } .d-sin { background: var(--t-sin); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; font-size: var(--fs-xs); font-weight: 700;
  background: var(--brand-100); color: var(--brand-800);
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatars { display: inline-flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatars .avatar:first-child { margin-left: 0; }

/* ---------- Schede, tabelle, avvisi ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-head { padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.card-body { padding: var(--s-5); }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-md); }
.table th {
  text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-600);
  text-transform: uppercase; letter-spacing: .04em; padding: 10px var(--s-4);
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px var(--s-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: #f6fafc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table a.cell-link { color: var(--ink-900); font-weight: 600; text-decoration: none; }
.table a.cell-link:hover { color: var(--brand-700); text-decoration: underline; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; }

.alert { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font-size: var(--fs-md); align-items: flex-start; }
.alert .i { margin-top: 1px; }
.alert-info { background: var(--info-bg); color: var(--info-fg); }
.alert-warn { background: var(--warn-bg); color: var(--warn-fg); }
.alert-err { background: var(--err-bg); color: var(--err-fg); }
.alert-ok { background: var(--ok-bg); color: var(--ok-fg); }

.empty { text-align: center; padding: var(--s-10); color: var(--ink-600); }

/* Segnaposto di testi da far scrivere (segnalati al PM) */
.placeholder-copy { }

/* ---------- Guscio ufficio ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--brand-900); color: #d6e4ea; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: var(--s-5) var(--s-3);
}
.sidebar .brand { padding: 0 var(--s-2) var(--s-5); color: #fff; }
.nav-group { margin-top: var(--s-4); }
.nav-title { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8fb0bf; padding: 0 var(--s-3) var(--s-2); }
.nav a {
  display: flex; align-items: center; gap: var(--s-3); height: 40px; padding: 0 var(--s-3);
  border-radius: var(--r-md); color: #d6e4ea; text-decoration: none; font-size: var(--fs-md); font-weight: 500;
  position: relative;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.nav a.active::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-500); }
.sidebar .nav { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--accent-500); color: var(--ink-900); border-radius: var(--r-full); padding: 1px 8px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: var(--s-4) var(--s-2) 0; display: flex; align-items: center; gap: var(--s-3); }
.sidebar-foot .who { flex: 1; min-width: 0; line-height: 1.3; }
.sidebar-foot .who b { display: block; color: #fff; font-size: var(--fs-md); }
.sidebar-foot .who span { font-size: var(--fs-xs); color: #9fbccb; }
.sidebar-foot .icon-btn { color: #b9cfd9; }
.sidebar-foot .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .avatar { background: var(--brand-600); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s-4); padding: 0 var(--s-8); position: sticky; top: 0; z-index: 20;
}
.topbar .search { width: 360px; }
.topbar .search .input { background: var(--surface-2); }
.content { padding: var(--s-6) var(--s-8) var(--s-10); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-5); }
.page-head p { color: var(--ink-600); margin-top: 4px; }
.crumbs { font-size: var(--fs-sm); color: var(--ink-600); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--ink-600); text-decoration: none; }
.crumbs a:hover { color: var(--brand-700); text-decoration: underline; }

.toolbar { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); }
.toolbar .input, .toolbar .select { width: auto; }
.tabs-filter { display: flex; gap: var(--s-1); padding: 0 var(--s-5); border-bottom: 1px solid var(--line); }
.tabs-filter a {
  display: inline-flex; align-items: center; gap: var(--s-2); height: 46px; padding: 0 var(--s-3);
  color: var(--ink-600); text-decoration: none; font-weight: 600; font-size: var(--fs-md);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs-filter a.on { color: var(--brand-800); border-color: var(--brand-700); }
.tabs-filter .n { font-size: var(--fs-xs); background: var(--draft-bg); color: var(--ink-700); border-radius: var(--r-full); padding: 1px 8px; }
.tabs-filter a.on .n { background: var(--brand-100); color: var(--brand-800); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line); font-size: var(--fs-md); color: var(--ink-600); }

/* Pannello laterale (dettaglio/modifica senza popup annidati) */
.drawer {
  position: fixed; top: 64px; right: 0; bottom: 0; width: 460px; background: var(--surface);
  box-shadow: var(--sh-3); display: flex; flex-direction: column; z-index: 40; border-left: 1px solid var(--line);
}
.drawer-head { padding: var(--s-5) var(--s-6); border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: var(--s-3); }
.drawer-body { flex: 1; overflow: auto; padding: var(--s-5) var(--s-6); display: flex; flex-direction: column; gap: var(--s-5); }
.drawer-foot { padding: var(--s-4) var(--s-6); border-top: 1px solid var(--line); display: flex; gap: var(--s-3); align-items: center; background: var(--surface-2); }
.section-title { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-600); text-transform: uppercase; letter-spacing: .06em; }

/* Finestra di conferma */
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 60; display: grid; place-items: center; }
.dialog { width: 440px; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-3); padding: var(--s-6); }
.dialog h2 { margin-bottom: var(--s-2); }
.dialog .actions { display: flex; justify-content: flex-end; gap: var(--s-3); margin-top: var(--s-6); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  background: var(--ink-900); color: #fff; border-radius: var(--r-lg); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-5);
  display: flex; align-items: center; gap: var(--s-4); box-shadow: var(--sh-3); font-size: var(--fs-md);
}
.toast .btn { height: 36px; background: rgba(255,255,255,.12); color: #fff; }

/* ---------- Guscio tablet ---------- */
body.tablet { background: #d9e1e8; font-size: var(--fs-lg); }
.device {
  width: 800px; min-height: 1280px; margin: 24px auto 48px; background: var(--bg);
  border-radius: 32px; border: 12px solid #10171d; box-shadow: 0 30px 60px rgba(15,23,42,.25);
  display: flex; flex-direction: column; position: relative; overflow: clip;
}
.device-caption { text-align: center; font-size: var(--fs-sm); color: var(--ink-600); margin-top: 20px; }
@media (max-width: 900px) {
  body.tablet { background: var(--bg); }
  .device { width: auto; margin: 0; border: 0; border-radius: 0; box-shadow: none; min-height: 100vh; }
  .device-caption { display: none; }
}
.statusbar { height: 28px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--s-5); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-700); background: var(--surface); }
.appbar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-5); min-height: 72px;
  position: sticky; top: 0; z-index: 10;
}
.appbar h1 { font-size: 22px; }
.appbar .sub { font-size: var(--fs-md); color: var(--ink-600); }
.t-content { flex: 1; padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }

.tabbar {
  position: sticky; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px var(--s-2) 10px;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 60px; border-radius: var(--r-lg); text-decoration: none; color: var(--ink-600);
  font-size: var(--fs-sm); font-weight: 600;
}
.tabbar a .i { width: 26px; height: 26px; }
.tabbar a.on { color: var(--brand-700); }
.tabbar a.on .pill { background: var(--brand-50); }
.tabbar .pill { width: 64px; height: 32px; border-radius: var(--r-full); display: grid; place-items: center; }

.actionbar {
  position: sticky; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line);
  padding: var(--s-3) var(--s-5) var(--s-4); display: flex; align-items: center; gap: var(--s-3);
  box-shadow: 0 -6px 16px rgba(15,23,42,.06);
}

/* Campi su tablet */
.tablet .input, .tablet .select { height: var(--h-control-t); font-size: var(--fs-lg); border-radius: var(--r-md); padding: 0 var(--s-4); }
.tablet .select { padding-right: 40px; }
.tablet .textarea { font-size: var(--fs-lg); min-height: 120px; padding: var(--s-4); }
.tablet .label { font-size: var(--fs-md); }
.tablet .btn { height: var(--h-control-t); font-size: var(--fs-base); border-radius: var(--r-md); padding: 0 var(--s-5); }
.tablet .btn-xl { height: 64px; font-size: 19px; }
.tablet .hint { font-size: var(--fs-md); }

.t-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-1); }
.t-card-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); }
.t-card-head h2 { font-size: 19px; flex: 1; }
.t-card-head .stepn { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-50); color: var(--brand-800); font-weight: 700; font-size: var(--fs-md); display: grid; place-items: center; flex: none; }
.t-card-head .stepn.done { background: var(--ok); color: #fff; }
.t-card-body { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); }

/* Contatore + / - */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); overflow: hidden; height: var(--h-control-t); }
.stepper button { width: 48px; height: 100%; border: 0; background: var(--surface-2); color: var(--ink-700); cursor: pointer; display: grid; place-items: center; }
.stepper button:hover { background: var(--draft-bg); }
.stepper input { width: 64px; height: 100%; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font: 600 var(--fs-lg) var(--font-sans); font-variant-numeric: tabular-nums; color: var(--ink-900); }

/* ---------- Varie ---------- */
.kbd { font: 600 11px var(--font-sans); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: var(--ink-600); background: var(--surface); }
.divider { height: 1px; background: var(--line); }
.thumb {
  aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; position: relative;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8); display: grid; place-items: center; color: #fff;
}
.thumb .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; font-size: var(--fs-xs); background: linear-gradient(transparent, rgba(0,0,0,.6)); color: #fff; font-weight: 500; }
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--r-lg); padding: var(--s-5); text-align: center; color: var(--ink-600); background: var(--surface-2); font-size: var(--fs-md); }
.file-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); font-size: var(--fs-md); }
.file-ico { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; }
.file-ico.pdf { background: #fee2e2; color: #b91c1c; }
.file-ico.img { background: #e0f2fe; color: #075985; }
