:root {
  --bg: #f3f5f8; --surface: #fff; --ink: #0f1b2d; --muted: #64748b; --line: #e4e8ee;
  --navy: #0f1b2d; --navy-2: #172640; --accent: #10b5a0; --accent-d: #0b8f7e;
  --ok: #22c55e; --warn: #f5b82e; --crit: #ef4444; --off: #94a3b8;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45; }
a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }

/* layout */
.side { position: fixed; inset: 0 auto 0 0; width: 210px; overflow-y: auto; background: var(--navy); color: #cbd5e1;
  display: flex; flex-direction: column; padding: 18px 12px; }
.brand { color: #fff; font-size: 1.35rem; font-weight: 300; padding: 4px 10px 18px; letter-spacing: .5px; }
.brand b { color: var(--accent); font-weight: 700; }
.brand:hover { text-decoration: none; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav a { color: #cbd5e1; padding: 8px 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.side nav a:hover { background: var(--navy-2); text-decoration: none; }
.side nav a.on { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.badge { background: var(--crit); color: #fff; border-radius: 99px; font-size: .72rem; padding: 1px 7px; font-weight: 600; }
.side-foot { padding: 10px; font-size: .82rem; color: #8193ad; border-top: 1px solid var(--navy-2); }
.side-foot button { background: none; border: 0; color: #8193ad; padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
main { margin-left: 210px; padding: 26px 32px 60px; max-width: 1180px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
h1 { font-size: 1.5rem; font-weight: 650; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 12px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .9em; }

/* componenti */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.cols { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; border-left: 4px solid var(--off); }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat.ok { border-left-color: var(--ok); } .stat.warn { border-left-color: var(--warn); }
.stat.crit { border-left-color: var(--crit); } .stat.off { border-left-color: var(--off); }

.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.vcard { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--off); border-radius: var(--radius);
  padding: 14px 16px; color: inherit; display: block; }
.vcard:hover { text-decoration: none; box-shadow: 0 2px 10px rgba(15,27,45,.08); }
.vcard.ok { border-left-color: var(--ok); } .vcard.warn { border-left-color: var(--warn); }
.vcard.crit { border-left-color: var(--crit); } .vcard.off { border-left-color: var(--off); background: #f8fafc; }
.vcard .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vcard .code { font-size: 1.15rem; font-weight: 700; }
.vcard .meta { color: var(--muted); font-size: .88rem; margin-top: 2px; display: flex; justify-content: space-between; }
.vcard .why { margin-top: 8px; font-size: .82rem; color: #475569; }
.vcard .why div::before { content: "•"; margin-right: 6px; color: var(--off); }

.pill { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .6px; padding: 3px 9px; border-radius: 99px; background: #e2e8f0; color: #475569; }
.pill.ok { background: #dcfce7; color: #15803d; } .pill.warn { background: #fef3c7; color: #a16207; }
.pill.crit { background: #fee2e2; color: #b91c1c; } .pill.off { background: #e2e8f0; color: #64748b; }
/* AdBlue = blu; carburante = giallo scuro (diverso da «attenzione», giallo chiaro, e da guasto, rosso).
   Tinto = livello grave/in avvertenza; pieno (.urgent) = gravissimo/critico */
.pill.adblue { background: #dbeafe; color: #1d4ed8; box-shadow: inset 0 0 0 1px #93c5fd; }
.pill.adblue.urgent { background: #1d4ed8; color: #fff; box-shadow: none; }
.pill.fuel { background: #f3d36b; color: #5f3d00; box-shadow: inset 0 0 0 1px #b8860b; }
.pill.fuel.urgent { background: #a16207; color: #fff; box-shadow: none; }
.dot.adblue { background: #1d4ed8; }
.grp-adblue { color: #1d4ed8; } .grp-fuel { color: #8a5a00; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dim { opacity: .55; }
.tablewrap { overflow-x: auto; }

.bar { height: 7px; background: #e8ecf1; border-radius: 99px; overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.warn i { background: var(--warn); } .bar.crit i { background: var(--crit); }

/* form */
label { display: block; font-size: .82rem; font-weight: 600; color: #334155; margin-bottom: 4px; }
input, select { width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: 2px solid rgba(16,181,160,.35); border-color: var(--accent); }
.field { margin-bottom: 14px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.form { max-width: 520px; }
.inline { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.inline .field { margin: 0; }
.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--accent-d); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #cbd5e1; }
.btn.ghost:hover { background: #f1f5f9; }
.btn.danger { background: #fff; color: #b91c1c; border: 1px solid #fecaca; }
.btn.sm { padding: 5px 11px; font-size: .85rem; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { background: #ecfdf9; border: 1px dashed var(--accent); color: var(--accent-d); border-radius: 99px; padding: 3px 11px; font-size: .8rem; cursor: pointer; font-family: ui-monospace, Consolas, monospace; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .92rem; }
.flash.ok { background: #dcfce7; color: #166534; } .flash.err { background: #fee2e2; color: #991b1b; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.chart { margin-bottom: 14px; }
.chart svg { width: 100%; height: 90px; background: #f8fafc; border-radius: 8px; }
.chart polyline { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.chart .lbl { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--navy); }
.auth .box { background: #fff; border-radius: 14px; padding: 30px; width: 100%; max-width: 380px; }
.auth .brand { color: var(--ink); padding: 0 0 14px; font-size: 1.6rem; display: block; }

@media (max-width: 900px) {
  .side { position: static; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; gap: 6px; }
  .brand { padding: 0 10px; } .side nav { flex-direction: row; flex-wrap: wrap; } .navlabel { display: none; }
  .side-foot { width: 100%; border-top: 0; padding: 4px 10px; }
  main { margin-left: 0; padding: 18px 14px 50px; }
  .cols, .g2, .g3 { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2, 1fr); }
}
@media print {
  .side, .no-print, .btn, form.filters { display: none !important; }
  main { margin: 0; padding: 0; max-width: none; } body { background: #fff; }
  .card { border: 0; padding: 0; }
}
h2 .pill { margin-left: 8px; vertical-align: 2px; }

/* menu: sezioni, piè di pagina con sviluppatore */
.navlabel { font-size: .68rem; letter-spacing: .8px; text-transform: uppercase; color: #6f819c; padding: 16px 10px 4px; }
.navlabel small { text-transform: none; letter-spacing: 0; opacity: .85; }
.side-foot .co { color: #b6c3d6; margin-bottom: 4px; }
.side-foot a { color: #9fb0c8; }
.dev { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--navy-2); font-size: .74rem; line-height: 1.55; color: #7d8fa9; }
.dev b { color: #cbd5e1; }

/* interruttore Schede / Riquadri */
.seg { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; background: #fff; }
.seg a { padding: 6px 15px; color: var(--ink); font-size: .88rem; }
.seg a:hover { background: #eef2f6; text-decoration: none; }
.seg a.on, .seg a.on:hover { background: var(--navy); color: #fff; }

/* dashboard a riquadri */
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.totals .card { margin-bottom: 14px; }
.tstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tstats b { display: block; font-size: 1.45rem; line-height: 1.15; }
.tstats span { color: var(--muted); font-size: .8rem; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: .88rem; margin: 4px 0 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--off); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.crit { background: var(--crit); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-height: 160px; padding: 14px 16px;
  border-radius: 12px; border: 2px solid #aeb9c7; background: #eef1f5; color: var(--ink); transition: transform .12s, box-shadow .12s; }
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,27,45,.14); }
.tile.ok { background: #e7f8ee; border-color: var(--ok); }
.tile.warn { background: #fff6dc; border-color: var(--warn); }
.tile.crit { background: #fde8e8; border-color: var(--crit); }
.tile.off { background: #eef1f5; border-color: #aeb9c7; }
.tile .plate { font-size: 1.4rem; font-weight: 800; letter-spacing: 1px; line-height: 1.15; }
.tile .tcode { font-size: .82rem; color: var(--muted); }
.tile .tdrv { display: flex; flex-direction: column; font-size: .78rem; line-height: 1.35; }
.tile .tdrv b { font-size: 1.02rem; }
.tile .tfoot { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: #475569; }
.tile .tnote { font-size: .76rem; color: #64748b; margin-top: -4px; }
@media (max-width: 900px) { .totals { grid-template-columns: 1fr; } .tstats { grid-template-columns: repeat(2, 1fr); } }
.tile .tfoot span:last-child { white-space: nowrap; }

/* ---------------- Officina (schermo intero) ---------------- */
body.kiosk { min-height: 100vh; display: flex; flex-direction: column; }
.khead { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 22px;
  background: var(--navy); color: #fff; flex-wrap: wrap; }
.khead h1 { color: #fff; font-size: 1.35rem; }
.khead .kl, .khead .kr { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.kbrand { color: #fff; font-size: 1.3rem; font-weight: 300; letter-spacing: .5px; }
.kbrand b { color: var(--accent); }
.kbrand:hover { text-decoration: none; }
.clock { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 4ch; }
.khead .btn.ghost { background: transparent; color: #fff; border-color: #3b4f70; }
.khead .btn.ghost:hover { background: var(--navy-2); }
.khead .btn:not(.ghost) { background: var(--accent); }
.kcounts { display: flex; gap: 14px; font-size: 1.1rem; font-weight: 700; }
.kcounts .dot { width: 14px; height: 14px; }
.kflash { margin: 12px 22px 0; }
.kmain { flex: 1; margin-left: 0; max-width: none; padding: 10px 12px 12px; display: flex; flex-direction: column; }

.kgrid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); grid-auto-rows: 104px; align-content: start; }
.ktile { display: flex; flex-direction: column; justify-content: space-between; gap: 3px; padding: 7px 10px 6px;
  border-radius: 10px; border: 2px solid transparent; color: #fff; transition: transform .12s, box-shadow .12s; overflow: hidden; }
.ktile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,27,45,.28); }
.ktile.crit { background: #dc2626; border-color: #991b1b; }
.ktile.warn { background: #f5b301; border-color: #b45309; color: #1f1300; }
.ktile.ok { background: #16a34a; border-color: #166534; }
.ktile.off { background: #cbd5e1; border-color: #94a3b8; color: #1e293b; }
.ktop { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kplate { font-size: 1.15rem; font-weight: 800; letter-spacing: .5px; line-height: 1.1; }
.kcode { font-size: .72rem; opacity: .8; line-height: 1.1; }
.ktile .pill { font-size: .62rem; padding: 2px 7px; background: rgba(255,255,255,.28); color: inherit; border: 1px solid rgba(255,255,255,.55); }
.ktile.warn .pill, .ktile.off .pill { background: rgba(0,0,0,.08); border-color: rgba(0,0,0,.25); }
.kprob { font-size: .78rem; line-height: 1.2; font-weight: 600; overflow: hidden; }
.kprob > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kprob .more, .kprob .ok-line { font-weight: 500; opacity: .85; }
.kinfo { display: flex; justify-content: space-between; gap: 6px; font-size: .68rem; opacity: .85; white-space: nowrap; overflow: hidden; }

.kdetail { display: flex; flex-direction: column; gap: 4px; max-width: 1500px; width: 100%; margin: 0 auto; }
.kstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kstrip > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.kstrip span { display: block; color: var(--muted); font-size: .82rem; }
.kstrip b { font-size: 1.45rem; }
.kactions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.abtn { border: 0; border-radius: 14px; padding: 22px 16px; font: inherit; font-size: 1.25rem; font-weight: 700; color: #fff;
  cursor: pointer; background: var(--navy); }
.abtn:hover { filter: brightness(1.12); }
.abtn.olio { background: #b45309; } .abtn.gomme { background: #1d4ed8; }
.abtn.freni { background: #7c3aed; } .abtn.risolto { background: var(--accent-d); }
.lockbox { background: #fff; border: 1px dashed #cbd5e1; border-radius: 12px; padding: 16px 20px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.kcols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.erow { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.erow:last-child { border-bottom: 0; }

dialog.kdlg { border: 0; border-radius: 16px; padding: 24px 26px; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(15,27,45,.35); }
dialog.kdlg::backdrop { background: rgba(15,27,45,.55); }
dialog.kdlg h2 { font-size: 1.25rem; margin-bottom: 10px; }
.pickgrid { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 16px; }
.pick { margin: 0; cursor: pointer; }
.pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.pick span { display: inline-block; padding: 9px 14px; border: 1px solid #cbd5e1; border-radius: 99px; font-size: .95rem; font-weight: 500; background: #fff; }
.pick input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.pick input:focus-visible + span { outline: 2px solid var(--accent-d); }
.dlgbtns { display: flex; gap: 10px; margin-top: 8px; }
@media (max-width: 900px) { .kcols { grid-template-columns: 1fr; } .kgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

td .small { overflow-wrap: anywhere; }
.ktotals { display: flex; gap: 18px; font-size: .85rem; color: #cbd5e1; flex-wrap: wrap; }
.ktotals b { color: #fff; }
.kgrid.tall { grid-auto-rows: 124px; }
/* carburante basso / quasi finito (solo Riquadri): rosa, con il bordo del colore di stato */
.ktile.fuel { background: #f472b6; color: #3b0a24; }
.ktile.fuel.crit { border-color: #991b1b; } .ktile.fuel.warn { border-color: #b45309; }
.ktile.fuel.ok { border-color: #166534; } .ktile.fuel.off { border-color: #94a3b8; }
.ktile.fuel .pill { background: rgba(255,255,255,.45); border-color: rgba(0,0,0,.2); }
.dot.fuel { background: #f472b6; }

/* ---------------- Backup (Impostazioni) ---------------- */
.bkstatus { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 16px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; }
.bkstatus > div { flex: 1; min-width: 180px; }
.bkerr { color: #b91c1c; font-weight: 600; }
.pick-line { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.pick-line input { width: auto; }
.bkactions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.devbox { margin-top: 16px; padding: 14px 18px; border: 2px solid var(--accent); border-radius: 12px; background: #f0fdfa; }
.devbox ol { line-height: 1.8; }
.devcode { font-size: 1.4rem; font-weight: 800; letter-spacing: 3px; font-family: monospace; background: #fff; border: 1px solid var(--line); padding: 2px 10px; border-radius: 8px; }

/* ---------------- Stile di guida ---------------- */
.score { display: inline-block; min-width: 44px; padding: 3px 10px; border-radius: 99px; font-weight: 800; text-align: center; color: #fff; }
.score.good { background: #16a34a; } .score.mid { background: #f5b301; color: #1f1300; } .score.bad { background: #dc2626; }

/* menu a gruppi con sottomenu */
.side nav details.grp { border-bottom: 1px solid var(--navy-2); padding: 2px 0 6px; }
.side nav details.grp > summary { list-style: none; cursor: pointer; font-size: .68rem; letter-spacing: .8px; text-transform: uppercase;
  color: #8ea0ba; padding: 12px 10px 6px; display: flex; justify-content: space-between; user-select: none; }
.side nav details.grp > summary::-webkit-details-marker { display: none; }
.side nav details.grp > summary::after { content: "▸"; transition: transform .15s; }
.side nav details.grp[open] > summary::after { transform: rotate(90deg); }
.grpbody { display: flex; flex-direction: column; gap: 2px; }
.side nav .sub { display: flex; flex-direction: column; margin: 0 0 4px 14px; border-left: 1px solid var(--navy-2); }
.side nav .sub a { padding: 5px 10px; font-size: .86rem; border-radius: 6px; color: #aebbd0; }
.side nav .sub a.on { color: #fff; background: transparent; box-shadow: none; font-weight: 600; }
.side nav .dis { padding: 8px 10px; color: #5b6b84; display: flex; justify-content: space-between; cursor: not-allowed; }
.side nav .dis .lock { font-style: normal; font-size: .7rem; opacity: .7; }
.side-foot .btn.sm { display: inline-block; margin-bottom: 6px; color: #fff; }
.set-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

/* Dashboard (riquadri nel layout normale, con menu laterale) */
.dsum { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line, #e2e8f0); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }
.dcounts { display: flex; gap: 18px; flex-wrap: wrap; font-size: .92rem; }
.dcounts b { font-size: 1.05rem; margin-right: 3px; }
.dtot { font-size: .86rem; } .dtot b { color: var(--ink); }
main .kgrid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }

/* Dashboard: riquadri compatti (colore fisso) con indicatori digitali; la situazione è solo nel semaforo */
main.wide { max-width: none; }
.dgrid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: 142px; }
.dtile { display: flex; flex-direction: column; justify-content: space-between; gap: 3px; padding: 8px 8px 7px; border-radius: 10px;
  background: #fff; border: 1px solid #cdd6e2; box-shadow: 0 1px 2px rgba(15,27,45,.06); color: var(--ink); overflow: hidden; }
.dtile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,27,45,.18); border-color: #94a3b8; }
.dplate { font-size: 1.2rem; font-weight: 800; letter-spacing: .5px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dgauges { display: flex; flex-direction: column; gap: 3px; }
.gauge { display: flex; align-items: center; gap: 5px; background: #0f1b2d; border-radius: 5px; padding: 2px 6px; color: #cbd5e1;
  font-size: .62rem; font-weight: 700; letter-spacing: .3px; }
.gauge .gl { width: 41px; text-transform: uppercase; opacity: .9; }
.gauge .gs { flex: 1; display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.gauge .gs i { height: 8px; border-radius: 1px; background: #2a3b58; }
.gauge.ok .gs i.on { background: #22c55e; box-shadow: 0 0 4px #22c55e99; }
.gauge.warn .gs i.on { background: #f59e0b; box-shadow: 0 0 4px #f59e0b99; }
.gauge.crit .gs i.on { background: #ef4444; box-shadow: 0 0 5px #ef4444cc; }
.gauge.blue.ok .gs i.on { background: #38bdf8; box-shadow: 0 0 4px #38bdf899; }
.gauge .gv { width: 28px; text-align: right; color: #fff; font-size: .72rem; }
.ddrv { font-size: .74rem; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbot { display: flex; justify-content: space-between; align-items: flex-end; }
.dkm { font-size: .72rem; color: #475569; } .dkm b { font-size: .95rem; color: var(--ink); }
.tl { display: inline-flex; gap: 4px; background: #0f1b2d; padding: 4px 6px; border-radius: 99px; }
.tl i { width: 11px; height: 11px; border-radius: 50%; background: #2a3b58; }
.tl .r.on { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.tl .y.on { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }
.tl .g.on { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.tl .y.blink, .dot.blink { animation: tlblink 1s steps(1, end) infinite; }
@keyframes tlblink { 50% { background: #2a3b58; box-shadow: none; } }
.dot.warn.blink { animation-name: dotblink; } @keyframes dotblink { 50% { opacity: .2; } }
.dcounts .dot { margin-right: 5px; }

/* menu laterale: contrasto alto (testo chiaro su blu notte, voce attiva ben evidente) */
.side { background: #0e1a2e; color: #e8eef8; }
.brand { color: #fff; }
.side nav a { color: #e8eef8; font-weight: 500; }
.side nav a:hover { background: #22395c; color: #fff; }
.side nav a.on { background: #234676; color: #fff; font-weight: 700; box-shadow: inset 4px 0 0 #2dd4bf; }
.side nav small, .side nav a small.muted { color: #9fb6d6; }
.side nav details.grp { border-bottom: 1px solid #2a4066; }
.side nav details.grp > summary { color: #a9c0e0; font-weight: 700; font-size: .72rem; letter-spacing: 1px; }
.side nav details.grp > summary:hover { color: #fff; }
.side nav .sub { border-left: 2px solid #35507c; }
.side nav .sub a { color: #d3e0f2; font-size: .88rem; }
.side nav .sub a:hover { background: #22395c; color: #fff; }
.side nav .sub a.on { color: #fff; background: #1c3a66; font-weight: 700; box-shadow: inset 3px 0 0 #2dd4bf; }
.side nav .dis { color: #8aa0c0; }
.side-foot { color: #c3d1e6; border-top: 1px solid #2a4066; }
.side-foot .co { color: #e8eef8; font-weight: 600; }
.side-foot a, .side-foot button { color: #d3e0f2; }
.side-foot .btn.sm { color: #04211e; background: #2dd4bf; }
.dev { color: #aebfd8; border-top: 1px solid #2a4066; }
.dev b { color: #e8eef8; }
.dev a { color: #d3e0f2; }
.badge { background: #ef4444; color: #fff; }

/* riquadri grigio-azzurro tenue (riposante), testo blu notte */
.dtile { background: #dfe6ef; border: 1px solid #b7c4d6; color: #1c2940; box-shadow: 0 1px 2px rgba(15,27,45,.08); }
.dtile:hover { border-color: #8196b3; box-shadow: 0 6px 16px rgba(15,27,45,.18); }
.ddrv { color: #2b3b55; }
.dkm { color: #34445e; line-height: 1.25; } .dkm b { color: #1c2940; }
.dupd { font-size: .68rem; color: #46587a; font-weight: 600; }
.gauge.na .gv { color: #8aa0c0; }

/* marchio FleetOBD: font Exo 2 ExtraBold Italic (SIL OFL, incluso nel programma: nessuna connessione a internet) */
@font-face { font-family: "Exo 2"; font-style: italic; font-weight: 800; font-display: swap; src: url("fonts/exo-2-latin-800-italic.woff2") format("woff2"); }
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-ico { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 2px 6px rgba(16,181,160,.45)); }
.logo-txt { font-family: "Exo 2", "Segoe UI", system-ui, sans-serif; font-style: italic; font-weight: 800; font-size: 1.95rem; line-height: 1;
  letter-spacing: .3px; color: #fff; }
.logo-txt b { color: #2dd4bf; font-weight: 800; }
.logo.sm .logo-ico { width: 26px; height: 26px; } .logo.sm .logo-txt { font-size: 1.45rem; }
.logo.lg .logo-ico { width: 46px; height: 46px; } .logo.lg .logo-txt { font-size: 2.4rem; }
.logo.dark .logo-txt { color: var(--ink); } .logo.dark .logo-txt b { color: #0b9c89; }
.side .brand { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 2px 8px 16px; margin-bottom: 4px;
  border-bottom: 1px solid #2a4066; font-size: inherit; font-weight: inherit; }
.side .brand .tagline { font-size: .62rem; letter-spacing: 2.4px; text-transform: uppercase; color: #a9c0e0; font-weight: 600; padding-left: 48px; }
.auth .brand { padding: 0 0 18px; display: block; text-align: center; }
.auth .brand .logo { justify-content: center; }
.kbrand { display: inline-flex; align-items: center; }

/* Officina: i veicoli OK hanno un riquadro neutro (schermo meno carico); solo la sigla OK è verde.
   I riquadri gialli e rossi restano a colori pieni per far risaltare i problemi. */
.ktile.ok { background: #dfe6ef; border-color: #b7c4d6; color: #1c2940; }
.ktile.ok .pill { background: #16a34a; border-color: #15803d; color: #fff; }
.ktile.ok .kprob .ok-line, .ktile.ok .kinfo { color: #34445e; }

/* intestazioni dei gruppi nella tabella Avvisi */
tr.grp td { background: #f1f5f9; padding-top: 8px; padding-bottom: 8px; border-top: 2px solid #e2e8f0; }

/* livello dei messaggi WhatsApp (1 = primo avviso, 3 = ultimo) */
.pill.lvl { min-width: 22px; text-align: center; padding: 3px 8px; }
.pill.lvl1 { background: #dbeafe; color: #1d4ed8; } .pill.lvl2 { background: #fde68a; color: #92400e; } .pill.lvl3 { background: #dc2626; color: #fff; }
.btn.wa { background: #1fa855; color: #fff; border-color: #1fa855; } .btn.wa:hover { background: #17874a; }
.lvlpick { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer; }
textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; box-sizing: border-box; }

/* Dashboard: veicoli «appena arrivati» in cima, separati da una linea */
.dsep { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; font-size: .78rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #0e7f70; }
.dsep::after { content: ""; flex: 1; height: 2px; background: #10b5a0; border-radius: 2px; }
.dsep.rest { color: #64748b; margin-top: 18px; }
.dsep.rest::after { background: #94a3b8; }
.dtile.new { border: 2px solid #10b5a0; position: relative; overflow: visible; }
.dnew { position: absolute; top: -10px; left: 10px; z-index: 2; padding: 1px 8px; border-radius: 99px; background: #10b5a0; color: #fff; font-size: .62rem; font-weight: 800; letter-spacing: .5px; line-height: 1.6; box-shadow: 0 1px 3px rgba(15,27,45,.3); }

/* turno con badge non assegnato: link per registrare subito l'autista */
a.newdrv { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
a.newdrv:hover { text-decoration: none; }
a.newdrv:hover .newdrv-plus { background: #0e7f70; }
.newdrv-plus { background: #10b5a0; color: #fff; border-radius: 99px; padding: 0 8px; font-size: .72rem; font-weight: 700; line-height: 1.6; }

/* ---------- pneumatici ---------- */
.tywrap { display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: center; }
.tydiag { width: 100%; max-width: 230px; height: auto; display: block; margin: 0 auto; }
.tydiag .tybody { fill: #e6ecf3; stroke: #94a3b8; stroke-width: 2; }
.tydiag .tycab { fill: #cfd8e3; }
.tydiag .tyaxle { stroke: #94a3b8; stroke-width: 4; stroke-linecap: round; }
.tydiag .tytxt { fill: #64748b; font: 700 9px system-ui, sans-serif; letter-spacing: 1.5px; }
.tydiag .tytxt.big { font-size: 13px; letter-spacing: 1px; fill: #475569; }
.tydiag .tyre .tybase { fill: #8795a8; stroke: #0f172a; stroke-width: 1.5; transition: fill .12s; }
.tydiag .tyre .tyfill { fill: #64748b; transition: height .3s, y .3s; }
.tydiag .tyre.ty-ok .tyfill { fill: #22a55b; }
.tydiag .tyre.ty-warn .tyfill { fill: #e5b80b; }
.tydiag .tyre.ty-crit .tyfill { fill: #dc2626; }
.tydiag .tyre.ty-crit .tybase { stroke: #dc2626; stroke-width: 2.5; }
.tydiag .tyre.ty-na .tybase { fill: #000; stroke: #000; }
.tydiag .tyre.ty-na .tytread { stroke: #262626; }
.tydiag .typct { fill: #fff; font: 800 9.5px system-ui, sans-serif; stroke: #0f172a; stroke-width: 2.4px; paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
.typill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #fff; background: #64748b; }
.typill.ty-ok { background: #22a55b; } .typill.ty-warn { background: #e5b80b; color: #3b2f00; }
.typill.ty-crit { background: #dc2626; } .typill.ty-na { background: #000; }
.tylegend { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 2px; }
.tydiag .tytread { stroke: #6b7a8f; stroke-width: 2; fill: none; stroke-linecap: round; }
.tydiag .tycheck { stroke: #fff; stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; display: none; }
.tydiag.sel .tyre { cursor: pointer; outline: none; }
.tydiag.sel .tyre:hover .tybase, .tydiag.sel .tyre:focus .tybase { fill: #a3b0c2; stroke: #10b5a0; stroke-width: 3; }
.tydiag .tyre.on .tybase { fill: #10b5a0; stroke: #0b7f70; }
.tydiag .tyre.on .tyfill { opacity: .55; }
.tydiag .tyre.on .tytread { stroke: #0b7f70; }
.tydiag .tyre.on .tycheck { display: block; }
.tysel { display: grid; grid-template-columns: 200px 1fr; gap: 14px; align-items: center; margin: 6px 0 12px; }
.tybtns { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.tybtns .btn { text-align: center; }
.tycount { margin-top: 4px; min-height: 2.4em; }
@media (max-width: 720px) { .tywrap, .tysel { grid-template-columns: 1fr; } }
.tyuse td { background: #f0fdf9; }
.tycard td.num { white-space: nowrap; }

.oilbar { height: 8px; border-radius: 99px; background: #e2e8f0; overflow: hidden; margin-bottom: 3px; }
.oilbar i { display: block; height: 100%; background: #10b5a0; }
.oilbar.soon i { background: #f59e0b; }
.oilbar.over i { background: #ef4444; }
.oilneg { color: #b91c1c; }
