:root {
  --bg: #f4f5f7; --card: #fff; --txt: #1f2733; --muted: #6b7684; --line: #e2e5ea;
  --pri: #1d5fa8; --pri-d: #164b86; --ok: #2f7d4f; --warn: #b7791f; --err: #b42318;
  --grey-row: #f0f0f0; --yellow: #fff7c2;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--txt); background: var(--bg); }
a { color: var(--pri); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 6px 0 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
h2 { font-size: 15px; margin: 4px 0 10px; } h3 { font-size: 14px; margin: 14px 0 6px; }
.top { display: flex; align-items: center; gap: 18px; background: #1b2a3d; color: #fff; padding: 0 18px; height: 50px; position: sticky; top: 0; z-index: 5; }
.top .brand { color: #fff; font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.top .brand .icona { width: 30px; height: 30px; }
.top .brand .logo { background: #fff; border-radius: 6px; padding: 3px 8px; display: flex; align-items: center; height: 34px; }
.top .brand .logo img { max-height: 28px; max-width: 150px; display: block; }
.top nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.top nav a { color: #c9d4e2; padding: 15px 10px; white-space: nowrap; } .top nav a.on, .top nav a:hover { color: #fff; background: #26405e; text-decoration: none; }
.top .who { color: #c9d4e2; font-size: 13px; white-space: nowrap; } .top .who a { color: #fff; }
main { max-width: 1400px; margin: 0 auto; padding: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .grid2 > .card { margin-bottom: 0; } .grid2 { margin-bottom: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .top .brand span:last-child { display: none; } }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); } .small { font-size: 12px; } .nowrap { white-space: nowrap; } .r { text-align: right; } .w30 { width: 30%; } .mono { font-family: ui-monospace, monospace; font-size: 12px; }
label { display: block; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
label input, label select, label textarea { display: block; width: 100%; margin-top: 3px; }
input, select, textarea { font: inherit; color: var(--txt); padding: 6px 8px; border: 1px solid #cfd5dd; border-radius: 6px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b9d3f2; border-color: var(--pri); }
input[type=color] { padding: 2px; width: 44px; height: 32px; }
input.small-in { width: 140px; }
label.chk { display: flex; align-items: center; gap: 6px; color: var(--txt); font-size: 13px; } label.chk input { width: auto; display: inline; margin: 0; }
.lbl { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .row3 .span2 { grid-column: span 2; }
.btn { display: inline-block; font: inherit; padding: 7px 14px; border-radius: 6px; border: 1px solid #c4ccd6; background: #fff; color: var(--txt); cursor: pointer; text-decoration: none !important; }
.btn:hover { background: #f0f3f7; } .btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; } .btn.primary:hover { background: var(--pri-d); }
.btn.danger { color: var(--err); border-color: #e8b4ae; } .btn.small { padding: 3px 9px; font-size: 12px; }
form.inline { display: inline; } .azioni { margin: 6px 0 18px; } .elimina { text-align: right; }
.filtri { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; } .filtri label.chk { margin: 0; } .filtri .grow { flex: 1; min-width: 200px; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; background: #e6f4ea; border: 1px solid #b7dfc3; white-space: pre-line; }
.flash.err { background: #fdecea; border-color: #f3b8b1; } .flash.info { background: #e8f1fb; border-color: #b9d3f2; }
table.t { width: 100%; border-collapse: collapse; background: #fff; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--line); padding: 7px 8px; position: sticky; top: 50px; background: #fff; }
table.t td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
table.t th.r, table.t td.r { text-align: right; }
table.lista { border: 1px solid var(--line); border-radius: 8px; }
tr[data-href] { cursor: pointer; } tr[data-href]:hover td { background: #f5f9ff; }
tr.spento td { background: var(--grey-row); color: #7a828c; } tr.passato td { color: #9aa3ad; }
tfoot td { font-weight: 600; background: #fafbfc; }
td.note { font-size: 12px; color: #444; max-width: 340px; } td.note.evid { background: var(--yellow) !important; }
.chip { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; margin: 1px 2px 1px 0; color: #fff; background: var(--c); white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.tagchk { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 3px 9px; border-radius: 14px; border: 1px solid var(--c); color: var(--c); font-size: 12px; cursor: pointer; }
.tagchk input { width: auto; margin: 0; display: inline; } .tagchk:has(input:checked) { background: var(--c); color: #fff; }
.stato { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.stato-attivo { background: #e6f4ea; color: var(--ok); } .stato-in_disdetta { background: #fff3dc; color: var(--warn); } .stato-cessato { background: #eceef1; color: #666; }
.ev { font-size: 11px; padding: 2px 7px; border-radius: 4px; background: #eef1f5; white-space: nowrap; }
.ev-gratuito { background: #e8f1fb; } .ev-scadenza, .ev-disdetta { background: #fdecea; color: var(--err); } .ev-cessazione { background: #fff3dc; color: var(--warn); }
.ev-fatturazione { background: #e6f4ea; color: var(--ok); } .ev-promemoria { background: #f2eafa; color: #6a3d9a; } .ev-rinnovo { background: #eef1f5; }
.kpi { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.kpi > div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; min-width: 150px; flex: 1; }
.kpi b { display: block; font-size: 22px; } .kpi span { color: var(--muted); font-size: 12px; } .kpi a { color: inherit; text-decoration: none; }
.kpi .warn { border-color: #f0d49a; background: #fffaf0; }
table.canoni input { width: 100%; } table.canoni input.anno { width: 80px; } table.canoni tr.nuova td { background: #f7fbff; }
table.t td input.imp { width: 110px; text-align: right; }
.login { max-width: 380px; margin: 70px auto; } .login h1 { font-size: 20px; justify-content: center; }
.login-logo { text-align: center; margin: 4px 0 10px; } .login-logo img { max-width: 240px; max-height: 90px; } .login-logo img.icona-grande { width: 84px; height: 84px; }
ul.compatta { columns: 2; margin: 0; padding-left: 18px; }
