:root { --bg:#f5f6f8; --card:#fff; --text:#1f2933; --muted:#6b7280; --line:#e2e5ea;
        --primary:#1d4ed8; --red:#c62828; --red-bg:#fdecea; --green:#2e7d32; }
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background:var(--bg); color:var(--text); font-size:15px; }
.topbar { display:flex; justify-content:space-between; align-items:center; padding:.6rem 1.5rem; background:#111827; color:#fff; }
.topbar a { color:#d1d5db; text-decoration:none; margin-right:1rem; }
.topbar a:hover { color:#fff; }
.topbar nav { display:flex; align-items:center; }
.brand { font-weight:600; }
.who { color:#9ca3af; margin-right:.75rem; }
.container { max-width:1200px; margin:1.5rem auto; padding:0 1.5rem; }
h1 { font-size:1.5rem; margin:0 0 1rem; }
h2 { font-size:1.1rem; margin:1.75rem 0 .6rem; }
.card { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:1.5rem; }
.narrow { max-width:380px; margin:3rem auto; }
.toolbar { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-bottom:1rem; }
.toolbar h1 { margin:0; }
.inline { display:inline; margin:0; }
.field { display:flex; flex-direction:column; margin-bottom:.9rem; flex:1; }
.field label { font-size:.85rem; color:var(--muted); margin-bottom:.25rem; }
.field input[type=text], .field input[type=password], .field input[type=number], .field input:not([type]) {
  padding:.5rem .6rem; border:1px solid var(--line); border-radius:6px; font-size:.95rem; }
.field.check { flex-direction:row; align-items:center; gap:.4rem; }
.field.check label { margin:0; color:var(--text); }
.has-error input { border-color:var(--red); }
.error { color:var(--red); font-size:.8rem; margin-top:.2rem; }
.row { display:flex; gap:1rem; }
fieldset { border:1px solid var(--line); border-radius:6px; margin:0 0 1.25rem; padding:1rem; }
legend { padding:0 .4rem; font-weight:600; }
.hint { color:var(--muted); font-size:.85rem; margin:-.4rem 0 .8rem; }
.btn { display:inline-block; padding:.45rem .9rem; border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--text); text-decoration:none; cursor:pointer; font-size:.9rem; }
.btn:hover { background:#f0f2f5; }
.btn-primary { background:var(--primary); border-color:var(--primary); color:#fff; }
.btn-primary:hover { background:#1e40af; }
.btn-danger { color:var(--red); border-color:#f3c1bd; }
.btn-small { padding:.25rem .6rem; font-size:.8rem; }
.alert { padding:.7rem 1rem; border-radius:6px; margin-bottom:1rem; border:1px solid; }
.alert-danger { background:var(--red-bg); border-color:#f3c1bd; color:var(--red); }
.alert-success { background:#e8f5e9; border-color:#c8e6c9; color:var(--green); }
.alert-info, .alert-warning { background:#fff8e1; border-color:#ffe082; color:#8a6d00; }
.grid { width:100%; border-collapse:collapse; background:var(--card); border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.grid th, .grid td { padding:.5rem .75rem; border-bottom:1px solid var(--line); text-align:left; }
.grid th { background:#f9fafb; font-size:.8rem; text-transform:uppercase; color:var(--muted); letter-spacing:.03em; }
.grid .num { text-align:right; font-variant-numeric:tabular-nums; }
.grid .empty { color:var(--muted); text-align:center; }
.grid .actions { white-space:nowrap; text-align:right; }
/* Trasmissioni in ritardo: evidenziate in rosso */
.grid-late { border-color:#f3c1bd; }
.grid-late th { background:var(--red-bg); color:var(--red); }
tr.late td { background:var(--red-bg); color:var(--red); font-weight:600; }
.title-late { color:var(--red); }
.count { display:inline-block; background:#e5e7eb; border-radius:999px; padding:0 .55rem; font-size:.8rem; margin-left:.3rem; }
.count-late { background:var(--red); color:#fff; }
.badge { display:inline-block; padding:.1rem .5rem; border-radius:999px; font-size:.75rem; background:#e5e7eb; }
.badge-green { background:#e8f5e9; color:var(--green); }
.badge-red { background:var(--red-bg); color:var(--red); }
