/* Lillo · gestionale riparazioni. Sistema visivo: lo stesso dark a strati di eraktive_cms (docs/design/sistema.md
   di quel progetto), layout A «Registro» (docs/design/layouts/tre-layout.html). */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* superfici: sfondo < pannelli < elementi < elementi in rilievo */
  --bg: #0d0e15; --side: #11121b; --card: #161724; --el: #1d1f30; --el-2: #23253a;
  --line: #262839; --line-2: #30334a; --tick: #2a2c40;
  --text: #eef0f8; --text-2: #b1b4cc; --text-3: #8e91ad;
  /* accento blu acceso (unico) */
  --accent: #2f8cff; --accent-hi: #6cb0ff; --accent-ink: #a9d1ff; --accent-btn: #1a73f0; --accent-btn-hi: #2a82ff;
  --accent-ghost: #132648; --accent-rgb: 47, 140, 255; --brand: #22b8e8;
  /* stati */
  --good: #5fd99a; --good-bg: rgba(95, 217, 154, .12);
  --warn: #f3b95a; --warn-bg: rgba(243, 185, 90, .13);
  --bad: #ff8b8b; --bad-bg: rgba(255, 120, 120, .13);
  --sold: #b9a9ff; --sold-bg: rgba(140, 120, 246, .18); --sold-rgb: 185, 169, 255;
  /* sagome dei dispositivi */
  --sil-body: #3a3d52; --sil-screen: #1a1d33; --sil-ink: #07080d;
  --r: 14px;
  --font: "Geist", "Manrope", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font: 14px/1.4 var(--font); color: var(--text); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
::selection { background: rgba(var(--accent-rgb), .45); }
.num, td, .mono, .cnt, .badge-n { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-size: 12.5px; color: var(--text-2); letter-spacing: .02em; }
.muted { color: var(--text-3); }
.nw { white-space: nowrap; }
.r { text-align: right; }
.strong { font-weight: 600; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ shell */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 18px 14px 14px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; }
.logo .mk { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--accent-btn), var(--brand)); display: grid; place-items: center; color: #fff; }
.logo .mk .i { width: 18px; height: 18px; stroke-width: 2; }
.logo b { display: block; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.logo small { display: block; font-size: 11.5px; color: var(--text-3); }
.sec { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-weight: 500; }
.side nav a .i { width: 17px; height: 17px; }
.side nav a:hover { background: var(--el); color: var(--text); }
.side nav a.on { background: rgba(var(--accent-rgb), .16); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .28); color: var(--text); }
.side nav a.on .i { color: var(--accent-hi); }
.badge-n { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--el-2); color: var(--text-2); }
.badge-n.w { background: var(--warn-bg); color: var(--warn); }
.badge-n.g { background: var(--good-bg); color: var(--good); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; }
.who:hover, .who.on { background: var(--el); }
.who b { display: block; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; color: var(--text-3); font-size: 11.5px; }
.av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-btn), var(--brand)); display: grid; place-items: center;
  font-weight: 600; font-size: 12px; flex: none; color: #fff; }
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.x { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--el); display: grid; place-items: center; color: var(--text-2); flex: none; }
.x:hover { color: var(--text); border-color: #3b3e58; }

.maincol { min-width: 0; display: flex; flex-direction: column; }
.top { height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--side);
  position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin: 0; white-space: nowrap; }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; height: 38px; width: min(360px, 36vw); padding: 0 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--text-3); }
.search:focus-within { border-color: var(--accent); }
.search input[type=search] { border: 0; background: none; outline: 0; flex: 1; min-width: 0; color: var(--text); padding: 0; min-height: 0; }
.search kbd { font: 500 11px var(--font); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }
#main { padding: 18px 24px 48px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ------------------------------------------------------------------ controlli */
.btn { height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--el); font-weight: 500; white-space: nowrap; color: var(--text); }
.btn:hover { border-color: #3b3e58; background: var(--el-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.pri { background: var(--accent-btn); border-color: transparent; color: #fff; }
.btn.pri:hover { background: var(--accent-btn-hi); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.sm .i { width: 14px; height: 14px; }
.btn.block { width: 100%; }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--el); }
.btn.good { background: var(--good-bg); border-color: rgba(95, 217, 154, .3); color: var(--good); }
.btn.warn { background: var(--warn-bg); border-color: rgba(243, 185, 90, .3); color: var(--warn); }
.btn.sold { background: var(--sold-bg); border-color: rgba(var(--sold-rgb), .3); color: var(--sold); }
.btn.da { background: rgba(var(--accent-rgb), .16); border-color: rgba(var(--accent-rgb), .35); color: var(--accent-ink); }
.btn.danger { background: none; border-color: rgba(255, 139, 139, .3); color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.sp-l { margin-left: auto; }
.lnk { color: var(--accent-ink); font-size: 12.5px; font-weight: 500; }
.lnk:hover { text-decoration: underline; }

input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=url], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; outline: 0; color: var(--text); min-height: 38px; }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input:disabled { color: var(--text-3); }
select { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e91ad' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.fm { display: flex; flex-direction: column; gap: 12px; }
.fm label, .form label, .rep-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.fm label small, .form label small { color: var(--text-3); font-weight: 400; }
.fm .err, .form .err, .rep-form .err { color: var(--bad); font-size: 12px; font-weight: 500; }
.invalid { border-color: var(--bad) !important; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form .wide { grid-column: 1 / -1; }
.check { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; font-size: 13.5px !important; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.hint { color: var(--text-3); font-size: 12.5px; margin: 0; }

/* ------------------------------------------------------------------ card e liste */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; min-width: 0; }
.card.flush { padding: 4px 8px 0; }
.ch { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 12px; }
.ch h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.ch .s { font-size: 12.5px; color: var(--text-3); }
.ch .r { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.narrow { max-width: 560px; display: flex; flex-direction: column; gap: 14px; }
.empty { color: var(--text-3); margin: 6px 0; }
.empty.big { padding: 40px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty.big p { margin: 0; color: var(--text-2); font-size: 14.5px; }

.income { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: center; padding: 20px 22px; margin-bottom: 14px;
  border-color: rgba(var(--sold-rgb), .26); background: linear-gradient(120deg, rgba(var(--sold-rgb), .09), transparent 60%), var(--card); }
.inc-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.inc-main .k { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sold); }
.inc-v { font-size: 46px; font-weight: 650; letter-spacing: -.035em; line-height: 1.05; }
.inc-v .c { font-size: .45em; color: var(--text-2); font-weight: 500; letter-spacing: 0; }
.inc-main .m { font-size: 12.5px; color: var(--text-3); }
.inc-split { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.inc-split a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; padding: 4px 6px; border-radius: 8px; }
.inc-split a:hover { background: var(--el); }
.inc-split .n { color: var(--text-2); font-weight: 500; }
.inc-split .n small { margin-left: 6px; color: var(--text-3); font-size: 11.5px; }
.inc-split .num { font-weight: 600; }
.inc-split .bar { grid-column: 1 / -1; height: 4px; border-radius: 3px; display: block; min-width: 4px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.kpi:hover { background: #191a29; }
.kpi .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.kpi .m { font-size: 12px; color: var(--text-3); }
.kpi.da { border-color: rgba(var(--accent-rgb), .28); } .kpi.att { border-color: rgba(243, 185, 90, .26); }
.kpi.rip { border-color: rgba(95, 217, 154, .24); } .kpi.ven { border-color: rgba(var(--sold-rgb), .26); }

.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); text-align: left; padding: 10px 8px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; }
table.wide { min-width: 1120px; }
tr.row { cursor: pointer; }
tr.row:hover td { background: var(--el); }
tr.row.sel td { background: var(--accent-ghost); }
tr.row.off td { opacity: .6; }
td.clip { max-width: 300px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.need { color: var(--warn); }
.dev { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dev b { font-weight: 500; display: block; white-space: nowrap; }
.dev small { color: var(--text-3); font-size: 12px; display: block; }
.act { display: block; overflow: hidden; text-overflow: ellipsis; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 8px 12px; color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--line); }
.pg { display: flex; gap: 6px; }

.mx td.c, .mx th.c { text-align: right; width: 14%; }
.mx tfoot td { color: var(--text-2); font-weight: 600; border-top: 1px solid var(--line-2); border-bottom: 0; }
.mx .t { font-weight: 600; }
.cell { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 3px 6px; border-radius: 7px; min-width: 40px; }
.cell:hover { background: var(--el-2); }
.cell .bar { display: block; height: 6px; border-radius: 3px; min-width: 2px; }
.cell.zero { color: var(--text-3); }
.cell.zero .bar { opacity: .3; }
.bar.da { background: var(--accent-hi); } .bar.att { background: var(--warn); } .bar.rip { background: var(--good); } .bar.ven { background: var(--sold); }

.wlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wlist a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; background: var(--el); border: 1px solid var(--line); }
.wlist a:hover { border-color: var(--line-2); }
.wlist .b { flex: 1; min-width: 0; }
.wlist b { display: block; font-weight: 500; font-size: 13.5px; }
.wlist .parts { display: block; color: var(--warn); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wlist .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* miniature: immagine del catalogo o sagoma */
.thumb { flex: none; display: grid; place-items: center; overflow: hidden; background: radial-gradient(120% 90% at 50% 20%, #23253a, #14151f);
  border: 1px solid var(--line); border-radius: 9px; width: 36px; height: 36px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.thumb .sil { width: 76%; height: 76%; }
.thumb.m { width: 56px; height: 56px; border-radius: 11px; }
.thumb.l { width: 96px; height: 96px; border-radius: 14px; }
.thumb.xl { width: 132px; height: 132px; border-radius: 16px; }

/* badge stato, tag, chip, segmenti */
.st { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st.da { color: var(--accent-ink); background: rgba(var(--accent-rgb), .18); }
.st.att { color: var(--warn); background: var(--warn-bg); }
.st.rip { color: var(--good); background: var(--good-bg); }
.st.ven { color: var(--sold); background: var(--sold-bg); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.da { background: var(--accent-hi); } .dot.att { background: var(--warn); } .dot.rip { background: var(--good); } .dot.ven { background: var(--sold); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--el-2); color: var(--text-2); white-space: nowrap; }
.tag .i { width: 12px; height: 12px; stroke-width: 2.4; }
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.acc { background: rgba(var(--accent-rgb), .18); color: var(--accent-ink); }

.filters { display: flex; flex-direction: column; gap: 10px; }
.frow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.fsearch { display: flex; align-items: center; gap: 8px; height: 38px; flex: 1 1 320px; max-width: 520px; padding: 0 12px; background: var(--card);
  border: 1px solid var(--line-2); border-radius: 10px; color: var(--text-3); }
.fsearch:focus-within { border-color: var(--accent); }
.fsearch input[type=search] { border: 0; background: none; padding: 0; min-height: 0; outline: 0; }
#nd-serial::placeholder { text-transform: none; }
.fsel { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.fsel select { width: auto; min-width: 120px; background-color: var(--card); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--el); color: var(--text-2); font-weight: 500;
  font-size: 12.5px; display: inline-flex; align-items: center; gap: 7px; }
.chip:hover { color: var(--text); }
.chip .cnt { color: var(--text-3); font-size: 11.5px; }
.chip.on { background: var(--accent-ghost); border-color: rgba(165, 154, 255, .6); color: var(--text); }
.chip.zero { opacity: .55; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.seg a, .seg button { border: 0; background: none; padding: 5px 11px; border-radius: 7px; color: var(--text-2); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.seg a:hover, .seg button:hover { color: var(--text); }
.seg .on { background: var(--el-2); color: var(--text); }
.seg .cnt { color: var(--text-3); font-size: 11.5px; margin-left: 2px; }

/* note */
.note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.note .i { margin-top: 1px; }
.note.info { background: rgba(var(--accent-rgb), .14); color: var(--accent-ink); }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.note.warn { background: var(--warn-bg); color: var(--warn); }

/* ------------------------------------------------------------------ drawer e modale */
.scrim { position: fixed; inset: 0; background: rgba(6, 7, 12, .6); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .18s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--card); border-left: 1px solid var(--line-2);
  box-shadow: -30px 0 60px -20px rgba(0, 0, 0, .6); z-index: 41; display: flex; flex-direction: column; transform: translateX(105%); transition: transform .22s ease; }
.drawer.on { transform: none; }
.dh { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.dh-t { flex: 1; min-width: 0; }
.dh h3 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.db { flex: 1; overflow-y: auto; padding: 16px 20px 28px; }
.mwrap { position: fixed; inset: 0; z-index: 42; display: grid; place-items: center; padding: 20px; pointer-events: none; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--card); border: 1px solid var(--line-2); border-radius: 16px;
  padding: 20px 22px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); opacity: 0; transform: translateY(8px); transition: opacity .16s, transform .16s; }
.mwrap.on { pointer-events: auto; }
.mwrap.on .modal { opacity: 1; transform: none; }
.mh { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.mh h3 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.01em; flex: 1; }
.mf { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* dettaglio scheda (drawer) */
.dt-head { display: flex; gap: 14px; align-items: center; }
.dt-head .meta { color: var(--text-3); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 4px; }
.dt-head h4 { margin: 3px 0 0; font-size: 16px; font-weight: 600; }
.dsec { margin-top: 18px; }
.dsec h5 { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.dsec h5 .lnk { margin-left: auto; text-transform: none; letter-spacing: 0; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kv > div { background: var(--el); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.kv > .wide { grid-column: 1 / -1; }
.ro-tag { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; font-weight: 500; white-space: nowrap; }
.kv .k { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.kv .v { font-size: 15px; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.batt { display: flex; gap: 2px; margin-top: 7px; }
.batt i { flex: 1; height: 5px; border-radius: 2px; background: var(--tick); }
.batt i.on.good { background: var(--good); } .batt i.on.warn { background: var(--warn); } .batt i.on.bad { background: var(--bad); }
.prob { background: var(--el); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text-2); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.parts-box { border-color: rgba(243, 185, 90, .35); }
.flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.flow .step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); font-weight: 500; }
.flow .d { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.flow .step.done { color: var(--text-2); } .flow .step.done .d { background: var(--text-3); border-color: var(--text-3); }
.flow .step.cur .d { border-color: currentColor; background: currentColor; }
.flow .step.cur.da { color: var(--accent-hi); } .flow .step.cur.att { color: var(--warn); } .flow .step.cur.rip { color: var(--good); } .flow .step.cur.ven { color: var(--sold); }
.flow .ln { width: 16px; height: 1px; background: var(--line-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-box { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--el); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.price-row { display: flex; gap: 8px; align-items: center; }
.price-row input { max-width: 170px; font-size: 15px; font-weight: 600; }
.saleval { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.saleval .c { font-size: .55em; color: var(--text-2); font-weight: 500; letter-spacing: 0; }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hist li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.hist li:last-child { border-bottom: 0; }
.hist small { color: var(--text-3); white-space: nowrap; }
.hist .by { grid-column: 1 / -1; color: var(--text-3); font-size: 11.5px; }
.dfoot { display: flex; gap: 8px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.facts { display: grid; gap: 8px; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--text-3); font-size: 12.5px; }
.facts dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }

/* nuova scheda / modello: anteprima dell'immagine */
.prev { display: flex; gap: 14px; align-items: center; padding: 12px; background: var(--el); border: 1px dashed var(--line-2); border-radius: 12px; margin-bottom: 14px; }
.prev b { display: block; font-weight: 500; }
.prev small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.imgbox { display: flex; gap: 14px; align-items: flex-start; }
.imgbox .side-acts { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.drop { border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 12px; color: var(--text-3); font-size: 12.5px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.drop:hover, .drop.on { border-color: var(--accent); color: var(--text-2); }
.drop input { display: none; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #1f2740; border: 1px solid var(--line-2); padding: 10px 16px;
  border-radius: 10px; z-index: 60; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; max-width: calc(100vw - 32px); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { color: var(--bad); }

/* ------------------------------------------------------------------ accesso */
.area-auth { display: grid; place-items: center; padding: 24px 16px; }
.auth { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 26px; width: min(460px, 100vw - 32px); position: relative; left: 50%; transform: translateX(-50%); }
.auth-logo img { width: 391px; max-width: 100%; height: auto; }
.auth-card { padding: 24px; }
.auth-card h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 4px; }
.auth-card h1:has(+ form) { margin-bottom: 16px; }
.lead { color: var(--text-2); margin: 0 0 16px; }
.lead.pre { white-space: pre-wrap; }
.err-code { font-size: 40px; font-weight: 600; color: var(--text-3); margin: 0; letter-spacing: -.03em; }
.auth-acts { margin-top: 12px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1200px) {
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; gap: 4px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .logo { padding: 0 8px 0 0; } .logo small, .sec, .side nav .lbl { display: none; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; } .who > span:last-child { display: none; }
  .top { padding: 0 16px; position: static; } #main { padding: 16px 16px 40px; }
  .search { display: none; } .top .btn.pri span { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .income { grid-template-columns: 1fr; gap: 14px; }
  .form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
