/* Stile comune a tutte le pagine */
:root {
  --bg: #f4f2ee; --card: #fff; --ink: #1f2328; --muted: #6b7078; --line: #e2ded6;
  --accent: #1f5f8b; --accent-ink: #fff; --ok: #2e7d4f; --warn: #b26a00; --bad: #b3261e;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: .55em .9em; border-radius: 8px; }
button.primario { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
button.pericolo { color: var(--bad); border-color: #e7b9b5; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: .5em .6em;
  background: #fff; width: 100%; }
label { display: block; font-size: .85em; color: var(--muted); margin: .6em 0 .2em; }
h1, h2, h3 { margin: .2em 0 .5em; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.right { text-align: right; }
.prezzo { font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge { display: inline-block; font-size: .75em; padding: .1em .5em; border-radius: 999px;
  background: #e8eef3; color: var(--accent); }
.badge.warn { background: #fdf0dc; color: var(--warn); }
.badge.bad { background: #fbe4e2; color: var(--bad); }
.badge.ok { background: #e3f2e8; color: var(--ok); }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--accent); color: #fff;
  padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.topbar h1 { font-size: 1.1em; margin: 0; flex: 1; }
.topbar button { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.stato-rete { font-size: .8em; padding: .2em .6em; border-radius: 999px; background: rgba(255,255,255,.18); }
.stato-rete.offline { background: #ffd8a8; color: #5a3300; }
.contenitore { padding: 12px; max-width: 1200px; margin: 0 auto; }
.modale-sfondo { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex;
  align-items: flex-start; justify-content: center; z-index: 50; overflow: auto; padding: 4vh 10px; }
.modale { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; padding: 16px; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .8em; color: var(--muted); font-weight: 600; }
.stornata td { text-decoration: line-through; color: var(--muted); }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #222; color: #fff;
  padding: 10px 16px; border-radius: 8px; z-index: 100; max-width: 90vw; }
@media print {
  .no-print, .topbar { display: none !important; }
  .modale-sfondo { position: static; background: none; padding: 0; }
  .modale { max-width: none; padding: 0; }
}
