/* ============================================================================
   Gestionale Assistenza Tecnica — sistema di design
   Palette "banco officina": blu ardesia profondo + ambra (il colore delle
   spie/etichette di calibrazione sugli strumenti di misura fiscali).
   ============================================================================ */

:root {
  --bg: #EEF1F5;
  --surface: #FFFFFF;
  --surface-2: #F6F8FA;
  --ink: #16232E;
  --ink-muted: #5B6B7A;
  --ink-faint: #93A2B0;
  --border: #DCE3EA;
  --border-strong: #C3CDD6;

  --navy: #0F2A3D;
  --navy-2: #163A52;
  --navy-3: #1F4E6E;
  --amber: #E8A33D;
  --amber-dark: #B97A1E;
  --amber-ink: #4A3210;

  --success: #2F8F5B;
  --success-bg: #E6F4ED;
  --danger: #C0392B;
  --danger-bg: #FBEAE8;
  --info: #2E6E9E;
  --info-bg: #E8F1F8;
  --warn-bg: #FDF3E3;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 42, 61, 0.08);
  --shadow-md: 0 6px 20px rgba(15, 42, 61, 0.14);
  --shadow-lg: 0 16px 48px rgba(15, 42, 61, 0.22);

  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0 0 .5em; color: var(--navy); }
a { color: var(--navy-3); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border);
}
button:hover { border-color: var(--border-strong); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-2); }
.btn-accent { background: var(--amber); color: var(--amber-ink); border-color: var(--amber-dark); }
.btn-accent:hover { background: #efb256; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #eecac5; }
.btn-danger:hover { background: #f6dbd7; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: var(--radius); }

input, select, textarea {
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy-3); outline-offset: 0; border-color: var(--navy-3); }
label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 16px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; text-transform: none; font-weight: 500; color: var(--ink); }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.radio-opt { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink); text-transform: none; }
.radio-opt input { width: auto; }

/* ---- Login ---- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 15% -10%, #1a4a68 0%, transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, #0A1D2A 100%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px 28px;
}
.login-mark {
  width: 46px; height: 46px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; color: var(--amber-ink);
  margin-bottom: 16px; font-size: 18px;
}
.login-card h1 { font-size: 20px; margin-bottom: 2px; }
.login-sub { color: var(--ink-muted); font-size: 13px; margin-bottom: 22px; }
.login-error { background: var(--danger-bg); color: var(--danger); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; display: none; }
.login-card button[type="submit"] { width: 100%; margin-top: 6px; padding: 11px; font-size: 14.5px; }
.login-advanced { margin-top: 18px; font-size: 12px; color: var(--ink-faint); }
.login-advanced summary { cursor: pointer; }
.login-advanced input { margin-top: 8px; }
.login-demo { margin-top: 16px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 12px; color: var(--ink-muted); font-family: var(--font-mono); }

/* ---- App shell ---- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  flex-shrink: 0;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; }
.topbar-brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--amber); color: var(--amber-ink); display:flex; align-items:center; justify-content:center; font-family: var(--font-mono); font-size: 13px; }
.topbar-user { display: flex; align-items: center; gap: 14px; font-size: 13px; color: #C9D6E0; }
.topbar-user b { color: #fff; }

.menubar {
  background: var(--navy-2);
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 16px;
  border-bottom: 3px solid var(--amber);
}
.menubar button {
  background: rgba(255,255,255,.06);
  color: #E3EAF0;
  border: 1px solid rgba(255,255,255,.12);
}
.menubar button:hover { background: rgba(255,255,255,.14); }
.menubar button.active { background: var(--amber); color: var(--amber-ink); border-color: var(--amber-dark); }
.menubar .sep { width: 1px; background: rgba(255,255,255,.18); margin: 4px 6px; }

.menu-dropdown { position: relative; }
.menu-dropdown-popup {
  display: none; position: absolute; top: 100%; left: 0; margin-top: 4px; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.18); min-width: 170px;
}
.menu-dropdown-popup.open { display: block; }
.menu-dropdown-popup button {
  display: block; width: 100%; text-align: left; padding: 9px 14px;
  background: var(--surface); color: var(--ink); border: none; border-radius: 0;
  border-bottom: 1px solid var(--border);
}
.menu-dropdown-popup > button:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.menu-dropdown-popup > button:last-child, .menu-dropdown-popup > .menu-subdropdown:last-child > button {
  border-radius: 0 0 var(--radius) var(--radius);
}
.menu-dropdown-popup button:last-child { border-bottom: none; }
.menu-dropdown-popup button:hover { background: var(--surface-2); }

.menu-subdropdown { position: relative; }
.menu-subdropdown > button {
  display: block; width: 100%; text-align: left; padding: 9px 14px;
  background: var(--surface); color: var(--ink); border: none; border-radius: 0;
  border-bottom: 1px solid var(--border);
}
.menu-subdropdown:last-child > button { border-bottom: none; }
.menu-subdropdown:hover > button { background: var(--surface-2); }
.menu-subdropdown-popup {
  display: none; position: absolute; top: -1px; left: 100%; margin-left: 2px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.18); min-width: 170px; overflow: hidden;
}
.menu-subdropdown:hover > .menu-subdropdown-popup { display: block; }
.menu-subdropdown-popup button {
  display: block; width: 100%; text-align: left; padding: 9px 14px;
  background: var(--surface); color: var(--ink); border: none; border-radius: 0;
  border-bottom: 1px solid var(--border);
}
.menu-subdropdown-popup button:last-child { border-bottom: none; }
.menu-subdropdown-popup button:hover { background: var(--surface-2); }

/* layout "a scomparsa" (menu verticale): il flyout laterale non ha senso
   li' (poco spazio a destra), il sotto-menu si apre sotto invece che di
   lato, stesso trattamento del menu principale in quella modalita' */
.app-shell[data-layout="scomparsa"] .menu-subdropdown-popup {
  position: static; box-shadow: none; margin: 4px 0 4px 14px; border-radius: var(--radius-sm);
}

.content { flex: 1; padding: 20px; max-width: 1400px; margin: 0 auto; width: 100%; }

/* riga appena creata: evidenziata un istante, poi sfuma da sola */
@keyframes riga-evidenziata-fade {
  0% { background: var(--warn-bg, #FFF3CD); }
  70% { background: var(--warn-bg, #FFF3CD); }
  100% { background: transparent; }
}
tr.riga-evidenziata { animation: riga-evidenziata-fade 2.5s ease-out; }

/* ---- Riepiloghi (grafici contabilita') ---- */
.rp-griglia { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.rp-titolo { font-size: 14px; color: var(--navy); margin-bottom: 12px; }
.rp-nota { margin-top: 10px; }

/* ---- Menu a tessere (pagina #/menu) ---- */
.menuhome-gruppo { margin-bottom: 30px; }
.menuhome-titolo { font-size: 15px; color: var(--navy); margin-bottom: 12px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }
.menuhome-sottotitolo { font-size: 12.5px; color: var(--ink-muted); margin: 14px 0 8px 8px; text-transform: uppercase; letter-spacing: .03em; }
.menuhome-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.menuhome-griglia-piccola { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); margin-left: 8px; }
.menuhome-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 6px; padding: 18px 10px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .1s;
}
.menuhome-tile:hover { border-color: var(--amber); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.menuhome-icon { font-size: 26px; line-height: 1; }
.menuhome-label { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.menuhome-count {
  position: absolute; top: 8px; right: 8px; min-width: 20px; padding: 1px 6px; border-radius: 999px;
  background: var(--amber); color: var(--amber-ink); font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
}

/* ---- Tab (pagine con più sezioni selezionabili, es. Migrazione dati) ---- */
.menubar-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.menubar-tabs .tab-btn {
  background: transparent; border: none; border-bottom: 3px solid transparent;
  padding: 10px 16px; border-radius: 0; color: var(--ink-muted); font-weight: 600;
  margin-bottom: -2px;
}
.menubar-tabs .tab-btn:hover { color: var(--navy); background: var(--surface-2); }
.menubar-tabs .tab-btn.active { color: var(--navy); border-bottom-color: var(--amber); }

/* ============================================================================
   LAYOUT MENU ALTERNATIVI — scelti in Impostazioni > Aspetto, applicati con
   data-layout su .app-shell. Il default (nessun attributo, o "top") e' il
   comportamento originale definito sopra: menu orizzontale piatto, sempre
   visibile. Qui sotto le varianti.
   ============================================================================ */

/* overlay scuro dietro al menu quando aperto sopra il contenuto (scomparsa) */
.menu-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
.app-shell[data-layout="scomparsa"] .menu-backdrop.open { display: block; }

/* ---- Menu a tendina: ancora orizzontale in alto, ma raggruppato per
        categoria — un bottone per gruppo (Anagrafiche ▾, Magazzino ▾...),
        ciascuno apre un menu a tendina con le voci di quella categoria.
        Le pagine "fisse" (Planning, Vendita al banco, Impostazioni...) 
        restano bottoni diretti, senza tendina. ---- */
.app-shell[data-layout="tendina"] .menubar { flex-wrap: wrap; }
.app-shell[data-layout="tendina"] .menu-dropdown-popup { min-width: 210px; }

/* ---- Menu a scomparsa: pannello laterale nascosto di default (fuori
        schermo a sinistra), un bottone ☰ lo fa scorrere dentro ---- */
.app-shell[data-layout="scomparsa"] #btn-menu-toggle { display: inline-flex !important; }
.app-shell[data-layout="scomparsa"] .menubar {
  position: fixed; top: 0; bottom: 0; left: 0; width: 260px; z-index: 56;
  flex-direction: column; align-items: stretch; flex-wrap: nowrap;
  overflow-y: auto; transform: translateX(-100%); transition: transform .22s ease;
  box-shadow: var(--shadow-lg); border-bottom: none; border-right: 3px solid var(--amber);
  padding-top: 16px;
}
.app-shell[data-layout="scomparsa"] .menubar.open { transform: translateX(0); }
.app-shell[data-layout="scomparsa"] .menubar button { width: 100%; text-align: left; }
.app-shell[data-layout="scomparsa"] .menubar .sep { width: auto; height: 1px; margin: 6px 10px; }
.app-shell[data-layout="scomparsa"] .menu-dropdown-popup { position: static; box-shadow: none; margin: 4px 0 4px 14px; border-radius: var(--radius-sm); }

/* ============================================================================
   TEMI COLORE — scelti in Impostazioni > Aspetto, applicati con data-theme
   su <html>. Ridefiniscono solo i colori "di marchio" (navy/amber/info):
   sfondo, superfici, testo e semantici (successo/errore) restano identici
   in tutti i temi per non intaccare la leggibilita'.
   ============================================================================ */
html[data-theme="blu"] {
  --navy: #0B2F52; --navy-2: #123F6B; --navy-3: #1B5A93;
  --amber: #35A7DE; --amber-dark: #1D7FB0; --amber-ink: #06263B;
  --info: #1D7FB0; --info-bg: #E5F2FA;
}
html[data-theme="verde"] {
  --navy: #123324; --navy-2: #1B4A34; --navy-3: #256B49;
  --amber: #C9A227; --amber-dark: #9C7C17; --amber-ink: #3A2E05;
  --info: #2F8F5B; --info-bg: #E6F4ED;
}
html[data-theme="bordeaux"] {
  --navy: #3B1220; --navy-2: #551A2E; --navy-3: #74233E;
  --amber: #D9A441; --amber-dark: #AD7B22; --amber-ink: #3A2708;
  --info: #8A3A50; --info-bg: #F6E8EC;
}
/* ---- Temi "chiari": stesso principio, ma toni piu' tenui/luminosi. Il
   topbar resta comunque scuro abbastanza da leggere il testo bianco sopra
   (altrimenti diventerebbe illeggibile) — "piu' chiaro" qui significa un
   colore meno cupo/pesante, non uno sfondo quasi bianco. ---- */
html[data-theme="azzurro-chiaro"] {
  --navy: #3E7CA6; --navy-2: #4C8DB8; --navy-3: #5A9FCB;
  --amber: #F0B429; --amber-dark: #C98F0F; --amber-ink: #3A2B05;
  --info: #3E7CA6; --info-bg: #EAF4FA;
}
html[data-theme="grigio-chiaro"] {
  --navy: #5A6B7A; --navy-2: #6E7F8E; --navy-3: #8496A5;
  --amber: #E8A33D; --amber-dark: #C27F1F; --amber-ink: #3A2B05;
  --info: #5A6B7A; --info-bg: #EEF1F4;
}

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.page-header h2 { margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 16px 18px; }

/* ============================================================================
   Vista GRIGLIA dell'app interna (generic-table.js e documenti.js,
   funzione renderGriglia) — card cliccabili al posto della tabella elenco.
   ============================================================================ */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding: 2px; }
.doc-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px 18px; cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.doc-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--amber); }
.doc-card-titolo { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--navy); margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.doc-card-campi { display: flex; flex-direction: column; gap: 6px; }
.doc-card-campo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.doc-card-label { color: var(--ink-faint); flex-shrink: 0; }
.doc-card-valore { color: var(--ink); text-align: right; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-card-azioni { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }


/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 10px 12px; background: var(--surface-2);
  color: var(--ink-muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .col-actions { white-space: nowrap; text-align: right; width: 1%; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--ink-faint); }
.empty-state .big { font-size: 32px; margin-bottom: 8px; }

.mono-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 999px;
}
.mono-chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-green { background: var(--success); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--danger); }
.dot-gray { background: var(--ink-faint); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-warn { background: var(--warn-bg); color: var(--amber-dark); }
.badge-gray { background: var(--surface-2); color: var(--ink-muted); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 42, 61, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 100;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px; max-height: calc(100vh - 80px); display: flex; flex-direction: column;
}
.modal.modal-wide { max-width: 980px; }
.modal.modal-xwide { max-width: 1100px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { background: transparent; border: none; font-size: 20px; color: var(--ink-muted); padding: 4px 8px; }

/* ---- Toast ---- */
#toast-host { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); font-size: 13px; max-width: 340px; }
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }

/* ---- Dashboard / Planning ---- */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-grid-full { grid-template-columns: 1fr; }
.plan-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.plan-toolbar h3 { margin: 0; margin-right: auto; }
.plan-day { padding: 10px 16px; }
.plan-slot {
  display: flex; gap: 12px; padding: 10px 8px; border-left: 3px solid var(--amber);
  background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 8px;
}
.plan-slot .time { font-family: var(--font-mono); font-weight: 700; color: var(--navy); min-width: 46px; }
.plan-slot .who { font-size: 11.5px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .02em; }
.plan-slot .what { font-weight: 600; }
.plan-slot .where { font-size: 12.5px; color: var(--ink-muted); }
.widget-list { padding: 6px 16px 14px; }
.widget-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.widget-row:last-child { border-bottom: none; }

/* ---- Dashboard: riepilogo anagrafiche/documenti (al posto di "Sotto scorta
   minima" quando "nascondi magazzino" e' attivo, vedi dashboard.js) ---- */
.dash-riepilogo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 12px 16px 16px; }
@media (max-width: 900px) { .dash-riepilogo-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .dash-riepilogo-grid { grid-template-columns: 1fr; } }
.dash-mini-card { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.dash-mini-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--border); }
.dash-mini-header b { font-size: 15px; color: var(--navy); }
.dash-mini-card .widget-list { padding: 4px 10px 8px; }
.dash-mini-card .widget-row { font-size: 12px; padding: 5px 0; }

/* ---- Documento (list + insert) ---- */
.doc-header { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px; margin-bottom: 18px; padding: 16px; background: var(--surface-2); border-radius: var(--radius); }
/* ---- Righe documento: griglia compatta in stile Delphi DBGrid ---- */
.dbgrid-wrap { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: auto; max-height: 420px; }
table.dbgrid { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.dbgrid thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--navy); color: #fff; text-align: left;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .02em; font-weight: 700;
  padding: 5px 8px; border-right: 1px solid rgba(255,255,255,.14); white-space: nowrap;
}
table th.col-num { text-align: right; }
table td.col-num { text-align: right; font-family: var(--font-mono); }
table.dbgrid tbody td {
  padding: 3px 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
}
table.dbgrid tbody tr:nth-child(even) { background: var(--surface-2); }
table.dbgrid tbody tr:hover { background: var(--info-bg); }
table.dbgrid tbody td.col-actions { text-align: center; white-space: nowrap; }
table.dbgrid tbody td.col-actions button { padding: 1px 6px; line-height: 1.4; }
table.dbgrid tbody tr.empty-row td { text-align: center; color: var(--ink-muted); padding: 14px 8px; white-space: normal; }
/* Celle editabili in linea (click per modificare, come le celle di un DBGrid) */
table.dbgrid tbody td.editable { cursor: text; }
table.dbgrid tbody td.editable:hover { background: var(--warn-bg); outline: 1px dashed var(--amber-dark); outline-offset: -1px; }
table.dbgrid tbody td.editing { padding: 0; background: var(--surface); }
table.dbgrid tbody td.editing input,
table.dbgrid tbody td.editing select {
  width: 100%; box-sizing: border-box; font: inherit; padding: 3px 7px; margin: 0;
  border: 1.5px solid var(--info); border-radius: 0; outline: none; background: #fff;
}
.doc-lines-total { display: flex; justify-content: flex-end; gap: 26px; padding: 14px 4px 4px; font-size: 14px; }
.doc-lines-total b { font-family: var(--font-mono); }
.doc-status-strip { display: flex; gap: 8px; margin-bottom: 14px; }

/* ---- Vendita al banco (touch) ---- */
.pos-shell { display: grid; grid-template-columns: 1fr 240px 360px; gap: 16px; height: calc(100vh - 170px); }
@media (max-width: 1180px) { .pos-shell { grid-template-columns: 1fr 360px; } .pos-side { grid-column: 1 / -1; flex-direction: row; } .pos-side .card { flex: 1; } }
@media (max-width: 980px) { .pos-shell { grid-template-columns: 1fr; height: auto; } .pos-side { flex-direction: column; } }
.pos-side { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.pos-search { padding: 12px; }
.pos-search input { font-size: 18px; padding: 14px 16px; }
.pos-cat-nav { display: flex; align-items: center; gap: 4px; }
.pos-cat-nav select { flex: 1; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 12px; overflow-y: auto; flex: 1; }
.pos-grid-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); }
.pos-tile {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 14px 10px; text-align: left; min-height: 92px; display: flex; flex-direction: column; justify-content: space-between;
  font-size: 13px;
}
.pos-tile:active { transform: scale(.96); border-color: var(--amber); }
.pos-tile.pos-tile-promo { border-color: var(--amber); background: var(--warn-bg); }
.pos-tile .name { font-weight: 700; color: var(--navy); }
.pos-tile .price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pos-tile .price { font-family: var(--font-mono); font-size: 15px; color: var(--amber-dark); font-weight: 700; }
.pos-tile .price-old { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); text-decoration: line-through; }
.promo-badge { display: inline-block; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.pos-keypad-card { flex-shrink: 0; }
.pos-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pos-keypad button { padding: 14px 0; font-size: 18px; font-weight: 700; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; }
.pos-keypad button:active { transform: scale(.95); }
.pos-keypad button.wide { grid-column: span 1.5; }
.pos-keypad button[data-key="clear"] { grid-column: span 1.5; background: var(--danger-bg); color: var(--danger); }
.pos-keypad button[data-key="ok"] { grid-column: span 1.5; background: var(--amber); color: var(--amber-ink); }
.pos-cart { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.pos-cart-head { padding: 14px 16px; background: var(--navy); color: #fff; }
.pos-cart-items { flex: 1; overflow-y: auto; padding: 8px 12px; }
.pos-cart-line { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pos-cart-line .row1 { display: flex; align-items: center; gap: 8px; }
.pos-cart-line .row2 { display: flex; align-items: center; gap: 8px; padding-left: 2px; }
.pos-cart-line .row2 label { margin: 0; text-transform: none; font-size: 11px; font-weight: 500; white-space: nowrap; }
.pos-cart-line .row2 input { width: 72px; padding: 4px 6px; font-size: 12.5px; }
.pos-cart-line .desc { flex: 1; font-size: 13px; }
.pos-cart-line .qty-ctl { display: flex; align-items: center; gap: 4px; }
.pos-cart-line .qty-ctl button { padding: 2px 8px; }
.pos-cart-total { padding: 16px; border-top: 2px solid var(--border); }
.pos-cart-total .grand { display: flex; justify-content: space-between; font-size: 22px; font-weight: 700; font-family: var(--font-mono); color: var(--navy); margin-bottom: 12px; }
.pos-cart-total button { width: 100%; }

/* ---- Import ---- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 40px 20px; text-align: center; color: var(--ink-muted); background: var(--surface-2);
  cursor: pointer;
}
.dropzone.drag { border-color: var(--amber); background: var(--warn-bg); color: var(--amber-ink); }
.dropzone input { display: none; }

/* ---- Impostazioni ---- */
.settings-entity { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; background: var(--surface); }
.settings-entity summary { padding: 12px 16px; cursor: pointer; font-weight: 700; color: var(--navy); list-style: none; display: flex; justify-content: space-between; }
.settings-entity summary::-webkit-details-marker { display: none; }
.settings-fields { padding: 4px 16px 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 6px 14px; }

.text-muted { color: var(--ink-muted); }
.text-mono { font-family: var(--font-mono); }
.small { font-size: 12px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--navy); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Bottoni: gruppi separati visivamente ---- */
.btn-group { display: flex; gap: 6px; align-items: center; }
.btn-group + .btn-group { padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--border); }

/* ---- Etichette ---- */
.etichette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

.variante-grid { border-collapse: collapse; }
.variante-grid th, .variante-grid td { border: 1px solid var(--border); text-align: center; padding: 6px 10px; }
.variante-cell { cursor: pointer; font-weight: 700; transition: background 0.1s; }
.variante-cell:hover { background: var(--surface-2); }
.variante-cell.has-stock { background: #eafaf0; color: var(--success); }
.variante-cell.no-stock { background: #fff8e8; color: #b8860b; }
.variante-cell.missing { color: var(--ink-muted); font-weight: 400; }
.color-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--border); margin-right: 6px; vertical-align: middle; }
.matricole-wrap select, .matricole-wrap input { padding: 5px 8px; }
.etichetta-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.etichetta-card .desc { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.etichetta-card svg { width: 100%; height: auto; }
.etichetta-card .ctl { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.etichetta-card .ctl input { width: 60px; }

#print-area { display: none; }
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { display: block; position: absolute; top: 0; left: 0; width: 100%; }
  .print-label {
    display: inline-block; position: relative; width: 45mm; margin: 1mm; border: 1px dashed #999;
    box-sizing: border-box; page-break-inside: avoid; font-family: sans-serif; overflow: hidden;
  }
  /* posizione ed eventuali dimensioni sono impostate inline (in mm) dal
     modello etichetta scelto: qui restano solo le regole tipografiche */
  .print-label .desc { font-size: 9px; font-weight: 700; white-space: nowrap; }
  .print-label .price { font-size: 11px; font-weight: 700; }
}

/* ============================================================================
   LANDING PUBBLICA (index.html) — vetrina + acquisto piani. Riusa la stessa
   identità (navy/amber, Space Grotesk/Inter/JetBrains Mono) dell'app: è la
   porta d'ingresso dello stesso prodotto, non un brand a parte. Il segno
   distintivo è la card prezzo in stile "scontrino" (bordo strappato,
   monospace, righe a puntini): coerente col fatto che il prodotto stesso
   stampa scontrini e fatture.
   ============================================================================ */
body.landing { background: var(--bg); }

.lp-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 20; background: rgba(238,241,245,.9); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
.lp-nav + .lp-hero { margin-top: 64px; } /* compensa lo spazio che .lp-nav non occupa piu' nel flusso, ora che e' fixed — si applica SOLO se .lp-nav e' davvero presente prima (avvia-demo.html, senza menu, non e' toccata) */
.lp-nav-inner { max-width: 1080px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; position: relative; }
.lp-brand { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--navy); display: flex; align-items: center; gap: 10px; }
.lp-brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--amber), var(--amber-dark)); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 12px; color: var(--amber-ink); }
.lp-nav-toggle { display: none; background: transparent; border: none; font-size: 22px; line-height: 1; color: var(--navy); cursor: pointer; padding: 4px 8px; }
.lp-nav-links { display: flex; align-items: center; gap: 16px; font-size: 13.5px; }
.lp-nav-links a { color: var(--ink-muted); }
.lp-nav-links a:hover { color: var(--navy); }
.lp-nav-login { font-weight: 700; color: var(--navy) !important; }

/* Sotto i 1080px (soglia scelta dopo aver misurato la larghezza minima
   reale necessaria alle 9-10 voci del menu, ~1035px, con un margine di
   sicurezza) le voci non ci stanno piu' su una riga sola: si passa a un
   bottone "hamburger" che apre l'elenco a tendina sotto la barra, invece
   di lasciarle tagliate/accavallate. Sotto questa soglia il contenitore
   .lp-nav-inner (max-width:1080px) si restringe 1:1 con la finestra,
   quindi il problema si presenta identico su tablet e su una finestra
   desktop qualunque piu' stretta di cosi'. */
@media (max-width: 1080px) {
  .lp-nav-toggle { display: block; }
  .lp-nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 8px 24px 14px;
    display: none;
  }
  .lp-nav-links.open { display: flex; }
  .lp-nav-links a { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .lp-nav-links a:last-child { border-bottom: none; }
}

.lp-hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at 15% -10%, #1a4a68 0%, transparent 60%), var(--navy);
  color: #fff; padding: 76px 24px 90px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center;
}
.lp-hero-inner { max-width: 620px; }
.lp-hero-eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); margin-bottom: 14px; }
.lp-hero h1 { font-family: var(--font-display); font-size: 40px; line-height: 1.14; font-weight: 700; margin-bottom: 18px; letter-spacing: -.01em; color: #fff; }
.lp-hero-sub { font-size: 15.5px; line-height: 1.6; color: rgba(255,255,255,.82); max-width: 540px; margin-bottom: 30px; }
.lp-hero-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.lp-hero-login { color: rgba(255,255,255,.85); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }
.lp-hero-receipt { display: flex; justify-content: center; }
.lp-mini-receipt {
  background: #FDFBF6; color: var(--ink); width: 240px; padding: 18px 18px 22px;
  font-family: var(--font-mono); font-size: 12px; box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
}
.lp-mini-receipt::after {
  content: ''; display: block; height: 14px; margin: 10px -18px -22px;
  background: linear-gradient(-45deg, var(--bg) 7px, transparent 0), linear-gradient(45deg, var(--bg) 7px, transparent 0);
  background-size: 14px 14px; background-repeat: repeat-x; background-position: bottom;
}
.mr-line.mr-head { font-weight: 700; letter-spacing: .03em; border-bottom: 1px dashed var(--border-strong); padding-bottom: 8px; margin-bottom: 8px; }
.mr-dots { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; color: var(--ink-muted); }
.mr-dots b { color: var(--success); }
.mr-total { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border-strong); font-weight: 700; color: var(--navy); }

.lp-section { max-width: 1080px; margin: 0 auto; padding: 72px 24px; }
.lp-section-alt { background: var(--surface); border-radius: var(--radius-lg); }
.lp-h2 { font-family: var(--font-display); font-size: 28px; text-align: center; color: var(--navy); margin-bottom: 8px; }
.lp-h2-sub { text-align: center; color: var(--ink-muted); max-width: 560px; margin: 0 auto 40px; font-size: 14px; line-height: 1.6; }

.lp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.lp-feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.lp-feature-num { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--amber-dark); font-weight: 700; margin-bottom: 10px; }
.lp-feature h3 { font-size: 15.5px; margin-bottom: 8px; color: var(--navy); }
.lp-feature p { font-size: 13.5px; color: var(--ink-muted); line-height: 1.55; }
.lp-feature-keywords { font-size: 11.5px; color: var(--ink-faint); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-style: italic; }

/* ---- Card prezzo "scontrino" (il segno distintivo della pagina) ---- */
.lp-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; max-width: 720px; margin: 0 auto; }
.lp-plan-skeleton { text-align: center; color: var(--ink-muted); grid-column: 1/-1; padding: 30px; }
.lp-receipt {
  background: #FDFBF6; color: var(--ink); padding: 26px 24px 30px; position: relative;
  box-shadow: var(--shadow-md); font-family: var(--font-body);
}
.lp-receipt::before, .lp-receipt::after {
  content: ''; display: block; height: 12px; position: absolute; left: 0; right: 0;
  background: linear-gradient(-45deg, var(--surface-2) 6px, transparent 0), linear-gradient(45deg, var(--surface-2) 6px, transparent 0);
  background-size: 12px 12px; background-repeat: repeat-x;
}
.lp-receipt::before { top: -1px; background-position: top; transform: rotate(180deg); }
.lp-receipt::after { bottom: -1px; background-position: bottom; }
.lp-receipt.is-offerta { outline: 2px solid var(--amber); outline-offset: 4px; }
.lp-receipt .mr-head { font-family: var(--font-mono); font-size: 13px; text-align: center; border-bottom: 1px dashed var(--border-strong); padding-bottom: 10px; margin-bottom: 10px; color: var(--navy); }
.lp-receipt-desc { font-size: 13px; color: var(--ink-muted); text-align: center; margin-bottom: 16px; min-height: 34px; }
.lp-receipt-price { text-align: center; margin-bottom: 14px; }
.lp-receipt-price-num { font-family: var(--font-mono); font-size: 36px; font-weight: 700; color: var(--navy); }
.lp-receipt-price-iva { display: block; font-size: 11.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.lp-countdown { margin-bottom: 18px; }
.lp-countdown-bar { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.lp-countdown-fill { height: 100%; background: var(--amber); }
.lp-countdown-label { font-size: 11.5px; color: var(--ink-muted); text-align: center; font-family: var(--font-mono); }
.lp-countdown-label b { color: var(--amber-dark); }
.lp-countdown-finita { margin-bottom: 18px; }
.lp-receipt-cta { width: 100%; }

.lp-footer { text-align: center; padding: 30px 24px 50px; color: var(--ink-faint); font-size: 12.5px; }
.lp-footer a { color: var(--ink-muted); }

@media (max-width: 860px) {
  .lp-hero { grid-template-columns: 1fr; padding: 56px 20px 70px; }
  .lp-hero h1 { font-size: 30px; }
  .lp-hero-receipt { order: -1; }
}

/* ---- Modale acquisto ---- */
.lp-modal-backdrop { position: fixed; inset: 0; background: rgba(15,42,61,.55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.lp-modal-backdrop.open { display: flex; }
.lp-modal { position: relative; width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 28px 26px; }
.lp-modal-close { position: absolute; top: 14px; right: 14px; background: transparent; border: none; font-size: 15px; color: var(--ink-muted); cursor: pointer; }
.lp-modal h3 { font-size: 18px; color: var(--navy); margin-bottom: 4px; }
.lp-modal-price { font-family: var(--font-mono); color: var(--ink-muted); font-size: 13px; margin-bottom: 18px; }
.lp-modal button[type="submit"] { width: 100%; margin-top: 6px; }
.lp-modal-note { font-size: 11.5px; color: var(--ink-faint); text-align: center; margin-top: 10px; }

/* ---- Login clienti: link di ritorno alla landing ---- */
.login-back { text-align: center; margin-top: 16px; font-size: 12.5px; }
.login-back a { color: var(--ink-muted); }

/* ---- Esito pagamento (pagamento-ok.html / pagamento-annullato.html) ---- */
.pay-result { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.pay-result-card { max-width: 440px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 40px 32px; }
.pay-result-icon { font-size: 40px; margin-bottom: 14px; }
.pay-result-card h1 { font-size: 20px; color: var(--navy); margin-bottom: 10px; }
.pay-result-card p { color: var(--ink-muted); font-size: 14px; line-height: 1.6; margin-bottom: 22px; }

/* Posizione video YouTube nelle pagine versione/modulo — proporzioni 16:9
   mantenute a qualunque larghezza (trucco padding-bottom), cosi' non serve
   sapere l'altezza esatta in anticipo. Finche' non c'e' un video vero, resta
   un riquadro segnaposto con la scritta "Video in arrivo" invece di uno
   spazio vuoto scomodo o rotto. */
.lp-video-wrap { max-width: 860px; margin: 32px auto 0; }
.lp-video-frame { position: relative; width: 100%; padding-bottom: 56.25%; background: var(--surface-2, #eef1f4); border-radius: var(--radius-lg); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.lp-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.lp-video-placeholder { color: var(--ink-muted); font-size: 14px; text-align: center; padding: 20px; }
.lp-video-placeholder .lp-video-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.lp-nav-links a.lp-nav-active { color: var(--navy); font-weight: 600; }

/* ============================================================================
   FAQ pubbliche (faq.html) — accordion con <details>/<summary> native, niente
   JS per aprire/chiudere: piu' leggero e funziona anche senza JavaScript
   (il JS qui serve solo a POPOLARE il contenuto dal database, non a
   gestire l'interazione apri/chiudi).
   ============================================================================ */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; background: var(--surface); overflow: hidden; }
.faq-question {
  padding: 16px 20px; cursor: pointer; font-weight: 600; color: var(--navy);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 14.5px;
}
.faq-question h2 { font: inherit; color: inherit; margin: 0; }
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: '+'; font-family: var(--font-mono); font-size: 18px; color: var(--amber-dark);
  flex-shrink: 0; transition: transform .15s ease;
}
.faq-item[open] .faq-question::after { transform: rotate(45deg); }
.faq-item[open] .faq-question { border-bottom: 1px solid var(--border); }
.faq-answer { padding: 14px 20px 18px; color: var(--ink-muted); font-size: 13.5px; line-height: 1.65; }

/* ============================================================================
   Download pubblici (download.html) — righe con descrizione/data a
   sinistra, bottone di scarico a destra. Classi dedicate (non riusa
   .faq-item) per non ereditare l'icona "+" decorativa dell'accordion.
   ============================================================================ */
.download-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 16px 20px; margin-bottom: 10px;
}
.download-item-titolo { font-weight: 600; color: var(--navy); font-size: 14.5px; margin-bottom: 3px; }
.download-item-data { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); }

/* ============================================================================
   Blog (blog.html + articoli) — card nell'indice, corpo testo leggibile
   negli articoli. Niente framework di terze parti per il testo lungo:
   solo una larghezza massima comoda da leggere e un'interlinea generosa.
   ============================================================================ */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.blog-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-decoration: none; transition: box-shadow .15s ease, transform .15s ease; }
.blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.blog-card:hover h2 { text-decoration: underline; }
.blog-card-eyebrow { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--amber-dark); font-weight: 700; margin-bottom: 10px; }
.blog-card h2 { font-size: 16.5px; color: var(--navy); margin-bottom: 8px; line-height: 1.35; }
.blog-card p { font-size: 13.5px; color: var(--ink-muted); line-height: 1.55; margin: 0; }
.blog-card-data { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); margin-top: 14px; display: block; }

.article-body { max-width: 680px; margin: 0 auto; }
.article-body h2 { font-size: 22px; color: var(--navy); margin: 34px 0 14px; }
.article-body h3 { font-size: 17px; color: var(--navy); margin: 26px 0 10px; }
.article-body p { font-size: 15px; line-height: 1.75; color: var(--ink); margin-bottom: 18px; }
.article-body ul, .article-body ol { margin: 0 0 18px 22px; font-size: 15px; line-height: 1.75; color: var(--ink); }
.article-body li { margin-bottom: 6px; }
.article-meta { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); margin-bottom: 8px; }
.article-back { display: inline-block; margin-top: 36px; font-size: 13.5px; }
