/* Nuova Marchisio — gestionale noleggio
   Identità: segnaletica stradale (blu, giallo cantiere) e la targa come elemento ricorrente.
   Nessuna dipendenza da internet: font di sistema (Bahnschrift per numeri e targhe su Windows). */

:root {
  --blue: #0a4c9e;
  --blue-d: #073a78;
  --blue-t: #e7eff9;
  --blue-m: #bcd3f0;
  --on-blue: #ffffff;
  --yellow: #f6b900;
  --yellow-t: #fff4cc;
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --ink: #1b2432;
  --ink-2: #435063;
  --muted: #667386;
  --line: #dde2e9;
  --line-2: #ebeef2;
  --ok: #146c43;
  --ok-t: #e2f3ea;
  --warn: #8f5400;
  --warn-t: #fff0d1;
  --bad: #b42318;
  --bad-t: #fde8e6;
  --r: 12px;
  --r-s: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-l: 0 12px 32px rgba(16, 24, 40, .16);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-d: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", var(--font);
  --rail: 244px;
}

[data-theme="dark"] {
  --blue: #6aa6f4;
  --blue-d: #9cc3f8;
  --blue-t: #182b47;
  --blue-m: #2c4a76;
  --on-blue: #08111f;
  --yellow-t: #3a2d07;
  --bg: #0e1520;
  --surface: #151f2d;
  --surface-2: #1a2636;
  --ink: #e8edf3;
  --ink-2: #bcc6d3;
  --muted: #8d9bad;
  --line: #28384d;
  --line-2: #203045;
  --ok: #55c78e;
  --ok-t: #12301f;
  --warn: #f2b653;
  --warn-t: #35270c;
  --bad: #ff8d80;
  --bad-t: #3b1714;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-l: 0 12px 32px rgba(0, 0, 0, .5);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-family: var(--font-d); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.sp { margin-left: auto; }
.hide { display: none !important; }

svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 16px; height: 16px; }
svg.i.l { width: 24px; height: 24px; }

/* ---------- struttura ---------- */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 40px; height: 28px; border-radius: 5px; background: var(--blue); color: var(--on-blue);
  font: 700 14px/28px var(--font-d); text-align: center; letter-spacing: .08em; position: relative;
}
.brand .logo::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; background: var(--yellow); border-radius: 2px; }
.brand b { display: block; font-size: 15px; line-height: 1.1; }
.brand span { font-size: 12px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border-radius: var(--r-s); color: var(--ink-2); font-weight: 520; min-height: 44px;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a.on { background: var(--blue-t); color: var(--blue-d); font-weight: 650; }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 3px 3px 0; background: var(--yellow); }
.nav .count { margin-left: auto; font: 600 12px var(--font-d); background: var(--bad); color: #fff; border-radius: 99px; padding: 1px 8px; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 14px; }
.user { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-t); color: var(--blue-d); display: grid; place-items: center; font-weight: 700; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 32px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-2);
}
.search-btn {
  flex: 1 1 auto; max-width: 520px; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 99px; color: var(--muted); cursor: pointer; font: inherit; text-align: left;
}
.search-btn:hover { border-color: var(--blue-m); }
kbd { font: 600 11px var(--font-d); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--muted); background: var(--surface-2); }

.page { padding: 28px 32px 80px; width: 100%; max-width: 1360px; }
.page-h { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-h .sub { color: var(--muted); margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 10px; font-size: 14px; }

/* ---------- bottoni e campi ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 14.5px var(--font); cursor: pointer; transition: background .12s, border-color .12s, transform .06s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--blue-m); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.btn-primary:hover { background: var(--blue-d); border-color: var(--blue-d); }
[data-theme="dark"] .btn-primary:hover { background: #86b7f7; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
[data-theme="dark"] .btn-ok { color: #08140d; }
.btn-ok:hover { filter: brightness(1.08); background: var(--ok); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-t); border-color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn.menu-btn { display: none; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn[disabled], .btn.off { opacity: .5; pointer-events: none; }
.btn-yellow { background: var(--yellow); border-color: var(--yellow); color: #231a00; }
.btn-yellow:hover { background: #ffc928; border-color: #ffc928; }

.input {
  width: 100%; min-height: 44px; padding: 9px 12px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-s); font: inherit; transition: border-color .12s, box-shadow .12s;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:hover { border-color: var(--blue-m); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-m); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.check { width: 20px; height: 20px; accent-color: var(--blue); }
.field label, label.lbl { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field .err, .err { color: var(--bad); font-size: 13px; margin-top: 4px; }
.field .hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

/* ---------- pannelli, pillole, targa ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.panel-b { padding: 16px 20px 20px; }
.panel.flush .panel-b { padding: 0; }
.divide > * + * { border-top: 1px solid var(--line-2); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 650;
  background: var(--surface-2); color: var(--ink-2); line-height: 1.6; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-t); color: var(--ok); }
.pill.warn { background: var(--warn-t); color: var(--warn); }
.pill.bad { background: var(--bad-t); color: var(--bad); }
.pill.info { background: var(--blue-t); color: var(--blue-d); }
.pill.nodot::before { display: none; }

.targa {
  display: inline-flex; align-items: stretch; background: #fff; color: #14181f; border: 2px solid #1a1f27; border-radius: 6px;
  font: 700 17px/1 var(--font-d); letter-spacing: .09em; overflow: hidden; white-space: nowrap; vertical-align: middle;
}
.targa::before {
  content: "I"; display: flex; align-items: flex-end; padding: 0 5px 3px; background: #0a4c9e; color: #fff; font-size: 9px; letter-spacing: 0;
}
.targa b { padding: 5px 9px 4px; font-weight: 700; }
.targa.sm { font-size: 13px; border-width: 1.5px; border-radius: 4px; }
.targa.sm b { padding: 3px 7px 2px; }
.targa.lg { font-size: 24px; border-radius: 8px; }
.targa.lg b { padding: 7px 13px 5px; }
.targa.lg::before { font-size: 11px; padding: 0 7px 5px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-weight: 560; cursor: pointer; font: inherit; font-weight: 560;
}
.chip:hover { border-color: var(--blue-m); text-decoration: none; }
.chip.on { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.chip .n { font: 600 12px var(--font-d); opacity: .75; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; font-size: 17px; }
.empty .btn { margin-top: 16px; }

/* ---------- tabelle ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr[data-href] { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl .t-main { font-weight: 600; color: var(--ink); }
.tbl-wrap { overflow-x: auto; }
.tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.tools .input { max-width: 340px; }

/* ---------- dashboard ---------- */
.hello h1 { font-size: 30px; }
.today { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; align-items: start; }
.todo { display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
.todo .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-t); color: var(--blue-d); flex: none; }
.todo.bad .ico { background: var(--bad-t); color: var(--bad); }
.todo.warn .ico { background: var(--warn-t); color: var(--warn); }
.todo .t { font-weight: 620; }
.todo .d { color: var(--muted); font-size: 13.5px; }
.todo .d a { white-space: nowrap; }
.allok { display: flex; align-items: center; gap: 14px; padding: 26px 22px; color: var(--ok); }
.allok svg { width: 32px; height: 32px; }
.allok b { font-size: 17px; color: var(--ink); display: block; }

.band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 20px; }
.band > div { padding: 18px 22px; }
.band > div + div { border-left: 1px solid var(--line-2); }
.band .lbl { color: var(--muted); font-size: 13.5px; }
.band .big { font: 700 30px/1.15 var(--font-d); margin-top: 2px; font-variant-numeric: tabular-nums; }
.band .delta { font-size: 13px; font-weight: 600; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--blue) calc(var(--p) * 1%), var(--blue-t) 0); display: grid; place-items: center; flex: none; }
.ring::before { content: ""; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); grid-area: 1 / 1; }
.ring span { grid-area: 1 / 1; font: 700 15px var(--font-d); }

.yard { background: var(--blue-t); border: 1px solid var(--blue-m); border-radius: var(--r); padding: 20px; margin-bottom: 20px; position: relative; }
.yard::before { content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 4px; background: repeating-linear-gradient(90deg, var(--yellow) 0 22px, transparent 22px 36px); border-radius: 0 0 3px 3px; opacity: .9; }
.yard-h { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; padding-top: 4px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.bay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px; }
.bay {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line);
  border-radius: var(--r-s); color: var(--ink); min-height: 112px; transition: box-shadow .12s, transform .12s;
}
.bay:hover { text-decoration: none; box-shadow: var(--shadow-l); transform: translateY(-2px); }
.bay .mod { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bay .st { font-size: 13.5px; font-weight: 600; margin-top: auto; }
.bay .who { font-weight: 500; font-size: 13px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bay.libero { border-left-color: var(--ok); } .bay.libero .st { color: var(--ok); }
.bay.noleggiato { border-left-color: var(--blue); } .bay.noleggiato .st { color: var(--blue-d); }
.bay.ritardo { border-left-color: var(--bad); background: var(--bad-t); } .bay.ritardo .st { color: var(--bad); }
.bay.fermo { border-left-color: var(--warn); } .bay.fermo .st { color: var(--warn); }
.bay.vendita { border-left-color: var(--muted); opacity: .85; } .bay.vendita .st { color: var(--muted); }
.bay .go { margin-top: 2px; }

.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-l { stroke: var(--line-2); stroke-width: 1; }
.chart .ax { fill: var(--muted); font: 12px var(--font); }
.chart .bar { fill: var(--blue-m); transition: fill .1s; }
.chart .bar.cur { fill: var(--blue); }
.chart .bar:hover, .chart .hit:hover + .bar { fill: var(--blue-d); }
.chart .hit { fill: transparent; cursor: default; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); padding: 6px 10px; border-radius: 8px; font-size: 13px; transform: translate(-50%, -110%); white-space: nowrap; z-index: 5; box-shadow: var(--shadow-l); }
.tip b { font-family: var(--font-d); }
.mini { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; font-size: 13.5px; }
.mini .tr { height: 8px; border-radius: 4px; background: var(--blue-t); overflow: hidden; }
.mini .tr i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }

/* ---------- flotta ---------- */
.fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.vcard { display: flex; flex-direction: column; gap: 12px; padding: 18px; color: var(--ink); }
.vcard:hover { text-decoration: none; border-color: var(--blue-m); box-shadow: var(--shadow-l); }
.vcard .meta { color: var(--muted); font-size: 13.5px; }
.vcard .foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-2); }
.price { font: 700 20px var(--font-d); }

/* ---------- procedura guidata ---------- */
.wiz { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.wstep { padding: 22px; }
.wstep + .wstep { margin-top: 16px; }
.wstep .wh { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.wstep .badge { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: var(--on-blue); display: grid; place-items: center; font: 700 15px var(--font-d); flex: none; }
.wstep.done .badge { background: var(--ok); color: #fff; }
.picker { position: relative; }
.picker .res { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: var(--shadow-l); max-height: 340px; overflow: auto; }
.res button { display: flex; flex-direction: column; align-items: flex-start; gap: 0; width: 100%; padding: 10px 14px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.res button:hover, .res button.act { background: var(--blue-t); }
.res .none { padding: 14px; color: var(--muted); }
.selected { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--ok); background: var(--ok-t); border-radius: var(--r-s); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 14px; max-height: 420px; overflow: auto; padding: 4px; margin-left: -4px; margin-right: -4px; }
.tile { position: relative; display: block; cursor: pointer; }
.tile input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tile .box { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 2px solid var(--line); border-radius: var(--r-s); background: var(--surface); transition: border-color .1s, background .1s; }
.tile:hover .box { border-color: var(--blue-m); }
.tile input:checked + .box { border-color: var(--blue); background: var(--blue-t); box-shadow: 0 0 0 3px var(--blue-m); }
.tile input:focus-visible + .box { outline: 2px solid var(--blue); outline-offset: 2px; }
.tile .mod { font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.tile .pr { font: 700 15px var(--font-d); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.summary { position: sticky; top: 84px; padding: 20px; }
.summary dl { margin: 0; }
.summary dt { color: var(--muted); font-size: 13px; }
.summary dd { margin: 0 0 12px; font-weight: 600; }
.summary .total { font: 700 34px/1.1 var(--font-d); }
.summary .btn { width: 100%; }

/* ---------- contratto ---------- */
.steps { display: flex; align-items: center; gap: 0; margin: 4px 0 0; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.step .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font: 700 12px var(--font-d); background: var(--surface); }
.step.done { color: var(--ok); } .step.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.now { color: var(--blue-d); } .step.now .dot { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 4px var(--blue-t); }
.step.off .dot { border-style: dashed; }
.step-line { width: 44px; height: 2px; background: var(--line); margin: 0 10px; }
.step-line.done { background: var(--ok); }
.hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 20px 22px; margin-bottom: 20px; }
.cl2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.chk { display: flex; gap: 14px; padding: 16px 20px; align-items: flex-start; }
.chk .mk { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); border: 2px solid var(--line); }
.chk.ok .mk { background: var(--ok); border-color: var(--ok); color: #fff; }
.chk.todo-b .mk { background: var(--yellow-t); border-color: var(--yellow); color: var(--warn); }
.kv { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 560; overflow-wrap: anywhere; }
.copy { opacity: .55; } .kv:hover .copy { opacity: 1; }
.timeline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.timeline .pt b { display: block; font: 700 18px var(--font-d); }
.timeline .bar { flex: 1 1 60px; height: 4px; background: var(--blue-m); border-radius: 2px; position: relative; min-width: 60px; }
.timeline .bar::after { content: ""; position: absolute; right: -2px; top: -4px; border: 6px solid transparent; border-left: 8px solid var(--blue-m); }
.money { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; }
.money .tot { font: 700 26px var(--font-d); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.alert { padding: 14px 18px; border-radius: var(--r-s); display: flex; gap: 12px; align-items: flex-start; }
.alert.bad { background: var(--bad-t); color: var(--bad); }
.alert.warn { background: var(--warn-t); color: var(--warn); }
.alert b { color: var(--ink); }

/* ---------- form ---------- */
.formwrap { max-width: 880px; }
.fgroup { padding: 22px; margin-bottom: 16px; }
.fgroup h2 { margin-bottom: 14px; font-size: 16px; }
.actions { display: flex; gap: 12px; align-items: center; position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(to top, var(--bg) 60%, transparent); }
.chkline { display: flex; align-items: center; gap: 10px; min-height: 44px; }
details.more { margin-top: 14px; }
details.more summary { cursor: pointer; color: var(--blue); font-weight: 600; min-height: 36px; display: flex; align-items: center; }

/* ---------- palette comandi, toast, login ---------- */
.pal { position: fixed; inset: 0; z-index: 100; background: rgba(10, 18, 30, .5); display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 0; }
.pal.open { display: flex; }
.pal-box { width: min(640px, 100%); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-l); overflow: hidden; border: 1px solid var(--line); }
.pal-in { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.pal-in input { flex: 1; min-height: 58px; border: 0; background: none; font: 17px var(--font); color: var(--ink); outline: none; }
.pal-list { max-height: 52vh; overflow: auto; padding: 8px; }
.pal-list .grp { padding: 10px 12px 4px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.pal-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-s); color: var(--ink); }
.pal-list a:hover, .pal-list a.act { background: var(--blue-t); text-decoration: none; }
.pal-list .sub { color: var(--muted); font-size: 13px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--ink); color: var(--surface); border-radius: 12px; box-shadow: var(--shadow-l); animation: tin .22s ease-out; }
.toast.error { background: var(--bad); color: #fff; }
.toast.success svg { color: #6fe0a3; }
@keyframes tin { from { transform: translateY(12px); opacity: 0; } }

.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--blue); color: var(--on-blue); display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; gap: 22px; position: relative; overflow: hidden; }
.login-art::before { content: ""; position: absolute; left: 0; right: 0; top: 34%; height: 6px; background: repeating-linear-gradient(90deg, var(--yellow) 0 56px, transparent 56px 96px); opacity: .9; }
.login-art h1 { font-size: 40px; max-width: 14ch; line-height: 1.1; }
.login-art p { max-width: 38ch; opacity: .85; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-form form { width: min(380px, 100%); }

/* ---------- adattamento ---------- */
@media (max-width: 1100px) {
  .today, .cols, .cl2, .wiz { grid-template-columns: 1fr; }
  .summary { position: static; }
  .band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band > div:nth-child(3) { border-left: 0; }
  .band > div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow-l); }
  .rail.open { transform: none; }
  .nav a.on::before { left: -14px; }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .page { padding: 20px 16px 80px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px; min-height: 220px; }
  .login-art h1 { font-size: 28px; }
  .kv { grid-template-columns: 120px 1fr auto; }
  .search-btn kbd { display: none; }
  .btn-new span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print { .rail, .topbar, .toasts, .pal { display: none !important; } .app { display: block; } }

/* ---- carburante a 10 tacche ---- */
.gauge { max-width: 440px; }
.gauge .ticks { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.gauge .tick { height: 38px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; padding: 0; transition: background .12s, border-color .12s, transform .08s; }
.gauge .tick:hover { border-color: var(--blue); }
.gauge .tick:active { transform: scale(.94); }
.gauge .tick.on { background: var(--blue); border-color: var(--blue); }
.gauge .tick:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.gauge .tick.on.low { background: #c1272d; border-color: #c1272d; }
.gauge .gl { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.gauge .gv { color: var(--ink); font-size: 14px; }
.fuelrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; }
.gmini { display: inline-flex; align-items: center; gap: 2px; }
.gmini .muted { margin-right: 6px; }
.gmini i { width: 9px; height: 14px; border-radius: 2px; border: 1.2px solid var(--line); display: inline-block; }
.gmini i.on { background: var(--blue); border-color: var(--blue); }

/* ---- logo aziendale ---- */
.brand .brand-logo { width: 84px; height: 84px; border-radius: 12px; background: #fff; border: 1px solid var(--line); object-fit: cover; flex: none; }
.brand { padding-bottom: 18px; }
.login-logo { width: 150px; height: 150px; border-radius: 18px; background: #fff; align-self: flex-start; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); position: relative; }
@media (max-width: 860px) { .login-logo { width: 96px; height: 96px; } }

.illim { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 12px 14px; border: 1.5px dashed var(--blue-m); background: var(--blue-t); border-radius: var(--r-s); cursor: pointer; }
.illim .check-wrap { display: inline-flex; }
