/* IRMAP LOGISTICS – foglio di stile unico, nessuna dipendenza esterna.
   Identità: blu notte di IRMAP e giallo segnaletica. Il giallo vuol dire "adesso"
   (la tappa in corso, oggi, l'azione da fare sul posto) e non compare altrove.
   Orari e numeri di tappa sono in Barlow Condensed, come la segnaletica stradale;
   tutto il resto in Atkinson Hyperlegible Next, leggibile all'aperto.
   Lo stato è sempre testo e icona, mai solo colore. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 800; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed/barlow-condensed-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed/barlow-condensed-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --night: #0f2540;
  --night-2: #1b3a5d;
  --night-text: #c9d6e6;
  --blue: #1e56a0;
  --blue-press: #164380;
  --blue-soft: #e4edf9;
  --signal: #ffc61a;
  --signal-press: #f0b400;
  --signal-ink: #3a2c00;
  --signal-soft: #fff4c7;
  --paper: #eceff3;
  --surface: #ffffff;
  --ink: #13202f;
  --muted: #5a6878;
  --line: #d6dce4;
  --line-strong: #9aa7b5;
  --k-delivery: #1e56a0;
  --k-pickup: #0b7a60;
  --k-other: #5a6878;
  --ok: #1d7a46;
  --ok-soft: #e2f2e8;
  --bad: #b3261e;
  --bad-soft: #fbe7e5;
  --demo: #6b4fa0;
  --focus: #2f7be5;
  --radius: 12px;
  --radius-small: 8px;
  --gutter: 16px;
  --nav-height: 66px;
  --font: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-press); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Struttura ---------- */
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip-link:focus { left: 8px; }
.app { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px var(--gutter); background: var(--night); color: #fff;
}
.topbar a { color: #fff; }
.brand, .nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 1.05rem; letter-spacing: .01em; }
.brand b, .nav-brand b { font-weight: 800; }
.topbar .spacer { flex: 1; }
.env-badge { border: 1px solid rgba(255,255,255,.45); color: var(--night-text); border-radius: 999px; padding: 0 10px; font-size: .78rem; font-weight: 600; }
.netstate { font-size: .85rem; }
.netstate[data-state="offline"] { background: var(--bad); color: #fff; padding: 2px 10px; border-radius: 999px; }
.main { padding: var(--gutter); padding-bottom: calc(var(--nav-height) + 32px); max-width: 1200px; margin: 0 auto; }

/* Barra della modalità consegna: sempre visibile, uscita con un tocco */
.modebar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 8px var(--gutter); background: var(--night); color: #fff; border-bottom: 4px solid var(--signal);
}
.modebar form { margin-left: auto; }
.modebar-title { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.05rem; }
.modebar-title .icon { color: var(--signal); width: 26px; height: 26px; }
.modebar-exit { min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 2px solid rgba(255,255,255,.6);
  background: transparent; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.modebar-exit:hover { background: var(--night-2); }

/* Navigazione: barra in basso su telefono, colonna blu notte su schermi larghi */
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: var(--nav-height);
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); display: flex; }
.nav > a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: .76rem; font-weight: 700; min-width: 0; position: relative; }
.nav > a .icon { width: 25px; height: 25px; }
.nav > a[aria-current="page"] { color: var(--night); }
.nav > a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--night); }
.nav .desktop-only, .nav .nav-brand, .nav .nav-foot { display: none; }

@media (min-width: 960px) {
  body { font-size: 16px; }
  .app { display: grid; grid-template-columns: 248px 1fr; grid-template-rows: auto 1fr;
    background: linear-gradient(to right, var(--night) 248px, transparent 248px); }
  .topbar { display: none; }
  .modebar { grid-column: 1 / -1; }
  .nav { position: sticky; top: 0; height: 100vh; flex-direction: column; border-top: 0; padding: 18px 14px; gap: 2px;
    background: var(--night); color: #fff; }
  .is-delivery .nav { top: 60px; height: calc(100vh - 60px); }
  .nav .nav-brand { display: flex; flex: none; flex-direction: row; justify-content: flex-start; align-items: center; gap: 10px;
    color: #fff; padding: 4px 10px 22px; font-size: 1.12rem; font-weight: 600; }
  .nav .nav-brand img { width: 30px; height: 30px; }
  .nav > a:not(.nav-brand) { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px;
    border-radius: var(--radius-small); font-size: .98rem; font-weight: 600; color: var(--night-text); }
  .nav > a:not(.nav-brand):hover { background: var(--night-2); color: #fff; }
  .nav > a[aria-current="page"] { background: var(--night-2); color: #fff; }
  .nav > a[aria-current="page"]::before { top: 8px; bottom: 8px; left: 0; right: auto; width: 4px; height: auto; border-radius: 0 3px 3px 0; background: #fff; }
  .nav .desktop-only { display: flex; }
  .nav .nav-foot { display: grid; gap: 10px; margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--night-2); }
  .nav-mode { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 12px; border-radius: var(--radius-small);
    border: 2px solid var(--signal); background: transparent; color: var(--signal); font: inherit; font-weight: 800; cursor: pointer; }
  .nav-mode:hover { background: var(--signal); color: var(--signal-ink); }
  .nav-user { display: flex; align-items: center; gap: 8px; color: var(--night-text); font-size: .92rem; overflow-wrap: anywhere; }
  .nav-foot .env-badge { justify-self: start; }
  .main { padding: 28px 36px 56px; width: 100%; }
}

/* ---------- Pulsanti ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 10px 18px; border-radius: var(--radius-small); border: 2px solid var(--blue); background: var(--surface);
  color: var(--blue); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { background: var(--blue-soft); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-press); border-color: var(--blue-press); }
.btn.quiet { border-color: var(--line-strong); color: var(--ink); }
.btn.quiet:hover { background: #f4f6f9; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.go { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.btn.go:hover { background: var(--signal-press); border-color: var(--signal-press); color: var(--signal-ink); }
.btn.big { min-height: 58px; font-size: 1.12rem; padding: 12px 22px; }
.btn.on-dark { background: transparent; border-color: rgba(255,255,255,.55); color: #fff; }
.btn.on-dark:hover { background: var(--night-2); color: #fff; }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: .92rem; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.is-busy::after { content: "…"; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.stack > .btn, .actions.stack > form { flex: 1 1 200px; }
.actions.stack > form .btn { width: 100%; }
.fab { position: fixed; right: 16px; bottom: calc(var(--nav-height) + 16px); z-index: 25; border-radius: 999px;
  min-height: 56px; padding: 12px 22px; box-shadow: 0 6px 18px rgba(15, 37, 64, .32); }
@media (min-width: 960px) { .fab { position: static; box-shadow: none; border-radius: var(--radius-small); } }

/* ---------- Messaggi ---------- */
.messages { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.messages li { border-left: 6px solid var(--blue); background: var(--surface); padding: 10px 14px;
  border-radius: var(--radius-small); display: flex; gap: 10px; align-items: flex-start; }
.messages .success { border-color: var(--ok); }
.messages .warning { border-color: var(--signal-press); background: var(--signal-soft); }
.messages .error { border-color: var(--bad); background: var(--bad-soft); }
.banner { border: 2px solid var(--line-strong); background: var(--surface); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 14px; display: flex; gap: 10px; align-items: flex-start; }
.banner.warn { border-color: var(--signal-press); background: var(--signal-soft); }
.banner.bad { border-color: var(--bad); background: var(--bad-soft); }
.banner .icon { flex: none; margin-top: 2px; }
.banner ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- Intestazioni di pagina ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 20px; }
.page-head h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 2.3rem; letter-spacing: 0; line-height: 1; }
.page-head .lede { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }

/* ---------- Oggi (pianificazione) ---------- */
.day-hero { display: grid; gap: 6px; margin: 2px 0 24px; }
.day-hero-date { display: grid; }
.day-hero-weekday { font-weight: 700; color: var(--muted); font-size: 1.02rem; }
.day-hero-day { font-family: var(--display); font-weight: 700; font-size: 3.4rem; line-height: .95; color: var(--night); }
.day-hero-summary { color: var(--muted); margin: 2px 0 6px; }
.day-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.day-hero-actions .btn { min-height: 56px; }
.day-hero-actions form .btn { width: 100%; }
@media (min-width: 960px) {
  .day-hero { grid-template-columns: 1fr auto; align-items: end; column-gap: 24px; }
  .day-hero-date, .day-hero-summary { grid-column: 1; }
  .day-hero-actions { grid-column: 2; grid-row: 1 / span 2; align-self: end; }
  .day-hero-day { font-size: 4.2rem; }
}
.today-grid { display: grid; gap: 8px; }
@media (min-width: 1100px) { .today-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; } }
.dash-side h2 { font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: 0; margin-bottom: 12px; }
.side-block { margin-bottom: 20px; }
.side-block h3 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.count { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--muted); }

/* ---------- Sezioni ---------- */
.section { margin: 0 0 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: 0; line-height: 1.05; }
.section-head a { font-weight: 700; font-size: .95rem; }
.section-note { color: var(--muted); margin: -4px 0 10px; }
.day-heading { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 8px; }
.day-heading .d { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.day-heading .m { color: var(--muted); font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel + .panel, .act-side > * + * { margin-top: 16px; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.empty { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 18px; color: var(--muted); }
.empty p:last-child { margin: 0; }
.empty.big { padding: 28px 22px; text-align: center; background: var(--surface); }
.empty.big strong { color: var(--ink); font-size: 1.15rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Righe attività: un tabellone, non una pila di schede ---------- */
.tags { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tag { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 0 14px; padding: 14px 16px 14px 0;
  color: inherit; text-decoration: none; border-left: 5px solid var(--k-delivery); position: relative; }
.tag + .tag { border-top: 1px solid var(--line); }
.tag:hover { background: #f6f8fb; }
.tag.kind-pickup { border-left-color: var(--k-pickup); }
.tag.kind-other { border-left-color: var(--k-other); }
.tag-time { display: grid; align-content: start; justify-items: end; text-align: right; line-height: 1; padding-top: 2px; }
.tag-date { font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; white-space: nowrap; }
.tag-pre { font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.tag-t { font-family: var(--display); font-weight: 700; font-size: 1.7rem; color: var(--night); }
.tag-t2 { font-family: var(--display); font-weight: 600; font-size: 1.2rem; color: var(--muted); margin-top: 4px; }
.tag-body { display: grid; gap: 3px; min-width: 0; }
.tag-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tag-kind { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: .88rem; color: var(--k-delivery); }
.kind-pickup .tag-kind { color: var(--k-pickup); }
.kind-other .tag-kind { color: var(--k-other); }
.tag-kind .icon { width: 18px; height: 18px; }
.tag-code { font-size: .82rem; color: var(--muted); font-weight: 600; }
.tag-top .badge.s-draft, .tag-top .badge.s-confirmed, .tag-top .badge.s-in_progress,
.tag-top .badge.s-completed, .tag-top .badge.s-cancelled { margin-left: auto; }
.tag-who { font-weight: 800; font-size: 1.08rem; overflow-wrap: anywhere; line-height: 1.25; }
.tag-where, .tag-meta { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.tag-goods { font-size: .92rem; }
.tag-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tag-meta .icon { width: 16px; height: 16px; }
.tag-sep { width: 10px; }
.tag.status-draft { background-image: repeating-linear-gradient(135deg, transparent 0 10px, rgba(90, 104, 120, .05) 10px 20px); }
.tag.status-draft { border-left-style: dashed; }
.tag.status-cancelled .tag-who, .tag.status-cancelled .tag-t { text-decoration: line-through; color: var(--muted); }
.tag.status-completed .tag-t, .tag.status-completed .tag-who { color: var(--muted); }
.tag.status-in_progress { background: var(--signal-soft); }
.tag.status-in_progress::after { content: ""; position: absolute; left: -5px; top: 0; bottom: 0; width: 5px; background: var(--signal); }
.tag.compact { grid-template-columns: 74px minmax(0, 1fr); gap: 0 10px; padding: 10px 12px 10px 0; }
.tag.compact .tag-date { white-space: normal; font-size: .74rem; }
.tag.compact .tag-code { display: none; }
.tag.compact .tag-t { font-size: 1.3rem; }
.tag.compact .tag-t2 { display: none; }
.tag.compact .tag-who { font-size: 1rem; }
@media (max-width: 600px) {
  .tag:not(.compact) .tag-goods, .tag:not(.compact) .tag-code { display: none; }
}
@media (max-width: 420px) {
  .tag { grid-template-columns: 64px minmax(0, 1fr); gap: 0 12px; }
  .tag-t { font-size: 1.45rem; }
}

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 6px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); white-space: nowrap; }
.badge .icon { width: 15px; height: 15px; }
.badge.s-draft { border-style: dashed; color: var(--muted); }
.badge.s-confirmed { border-color: var(--blue); color: var(--blue); }
.badge.s-in_progress { border-color: var(--signal-press); background: var(--signal); color: var(--signal-ink); }
.badge.s-completed { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.badge.s-cancelled { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.badge.demo { border-color: var(--demo); color: var(--demo); }
.badge.warn { border-color: var(--signal-press); background: var(--signal-soft); color: var(--signal-ink); }
.badge.ok { border-color: var(--ok); color: var(--ok); }

/* ---------- Modalità consegna: il giro ---------- */
.giro-head { display: grid; gap: 2px; margin: 4px 0 18px; }
.giro-weekday { font-weight: 700; color: var(--muted); }
.giro-day { font-family: var(--display); font-weight: 700; font-size: 3rem; line-height: .95; color: var(--night); }
.giro-summary { color: var(--muted); margin: 6px 0 10px; }
.progress { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.progress li { flex: 1; height: 10px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line-strong); }
.progress li.p-completed { background: var(--ok); border-color: var(--ok); }
.progress li.p-in_progress, .progress li.is-next { background: var(--signal); border-color: var(--signal-press); }

.next { background: var(--night); color: #fff; border-radius: 18px; padding: 20px 18px 18px; margin: 0 0 28px;
  box-shadow: 0 10px 30px rgba(15, 37, 64, .28); display: grid; gap: 8px; }
.next-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.next-num { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--signal);
  color: var(--signal-ink); font-family: var(--display); font-weight: 700; font-size: 1.7rem; flex: none; }
.next-num .icon { width: 24px; height: 24px; }
.next-label { margin: 0; font-size: 1.02rem; font-weight: 700; color: var(--night-text); letter-spacing: 0; }
.next-kind { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; padding: 4px 12px; border-radius: 999px;
  background: var(--k-delivery); color: #fff; }
.next-kind.kind-pickup { background: var(--k-pickup); }
.next-kind.kind-other { background: var(--k-other); }
.next-time { font-family: var(--display); font-weight: 700; font-size: 3.4rem; line-height: 1; margin: 6px 0 0; color: #fff; }
.next-time .pre { font-size: 1.4rem; color: var(--night-text); font-weight: 600; }
.next-time .sep { color: var(--night-text); padding: 0 .06em; }
.next-time.none { font-size: 2rem; color: var(--night-text); }
.next-who { font-size: 1.35rem; font-weight: 800; margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
.next-where { margin: 0; color: var(--night-text); }
.next-where strong { color: #fff; }
.next-access { margin: 4px 0 0; padding: 10px 12px; border-left: 5px solid var(--signal); background: var(--night-2); border-radius: var(--radius-small); }
.next-goods { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; color: var(--night-text); }
.next-goods b { color: #fff; }
.next-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.next-actions > .wide, .next-actions > :last-child:nth-child(odd):not(.half) { grid-column: 1 / -1; }
.next-actions form .btn { width: 100%; }
.next-actions .call { flex-direction: row; }
.next-actions .call span { display: grid; text-align: left; line-height: 1.2; }
.next-actions .call small { font-weight: 600; font-size: .8rem; color: var(--night-text); overflow-wrap: anywhere; }
.next .badge.demo { border-color: #c9b8ea; color: #e5dbf7; background: transparent; }
@media (min-width: 760px) { .next { padding: 26px 28px 24px; } .next-time { font-size: 4.2rem; } }

.stops { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stop + .stop { border-top: 1px solid var(--line); }
.stop a { display: grid; grid-template-columns: 40px 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px;
  color: inherit; text-decoration: none; }
.stop a:hover { background: #f6f8fb; }
.stop-num { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--night);
  font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--night); }
.stop.is-next .stop-num { background: var(--signal); border-color: var(--signal-press); color: var(--signal-ink); }
.stop.s-completed .stop-num { border-color: var(--ok); color: var(--ok); }
.stop-num .icon { width: 22px; height: 22px; }
.stop-time { font-family: var(--display); font-weight: 700; font-size: 1.45rem; color: var(--night); line-height: 1; }
.stop-time small { font-family: var(--font); font-size: .78rem; font-weight: 600; color: var(--muted); }
.stop-body { display: grid; min-width: 0; }
.stop-who { font-weight: 800; overflow-wrap: anywhere; }
.stop-where { color: var(--muted); font-size: .9rem; display: flex; gap: 5px; align-items: center; }
.stop-where .icon { width: 16px; height: 16px; }
.stop.s-completed .stop-who, .stop.s-completed .stop-time { color: var(--muted); }
@media (max-width: 520px) {
  .stop a { grid-template-columns: 36px 56px minmax(0, 1fr); }
  .stop a .badge { grid-column: 3; justify-self: start; }
}

/* ---------- Scheda attività ---------- */
.act-head { display: grid; gap: 6px; margin: 2px 0 20px; }
.act-head-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.act-kind { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--k-delivery); }
.act-head.kind-pickup .act-kind { color: var(--k-pickup); }
.act-head.kind-other .act-kind { color: var(--k-other); }
.act-code { color: var(--muted); font-weight: 600; }
.act-head h1 { margin: 2px 0 0; font-size: 1.9rem; overflow-wrap: anywhere; }
.act-when { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.act-date { font-weight: 700; color: var(--muted); }
.act-time { font-family: var(--display); font-weight: 700; font-size: 2.2rem; line-height: 1; color: var(--night); }
.act-grid { display: grid; gap: 16px; }
@media (min-width: 1000px) { .act-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; } }
.where-card { margin-bottom: 22px; }
.where-card h2 { font-size: 1rem; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.where-name { font-size: 1.3rem; font-weight: 800; margin: 0; }
.where-addr { margin: 0 0 12px; }
.where-card .actions .btn.go { flex: 1 1 220px; }
.access { border-left: 6px solid var(--signal); background: var(--signal-soft); padding: 10px 14px; border-radius: var(--radius-small); margin: 0 0 14px; }
.who-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 16px;
  padding-top: 14px; border-top: 1px solid var(--line); }
.who-line p { margin: 0; }
.goods { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.goods li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px 16px; align-items: baseline; }
.goods li + li { border-top: 1px solid var(--line); }
.goods-qty { font-family: var(--display); font-weight: 700; font-size: 1.6rem; line-height: 1; text-align: right; color: var(--night); }
.goods-qty small { font-family: var(--font); font-size: .8rem; font-weight: 700; color: var(--muted); margin-left: 4px; }
.goods-desc { font-weight: 700; display: grid; overflow-wrap: anywhere; }
.goods-desc small { font-weight: 400; color: var(--muted); font-size: .85rem; }
.action-bar { display: grid; gap: 12px; }
.action-bar.delivery { position: sticky; bottom: calc(var(--nav-height) + 8px); z-index: 15; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 22px 0; box-shadow: 0 -6px 20px rgba(15,37,64,.12); }
.action-bar.delivery > form .btn.big, .action-bar.delivery .complete .btn.big { width: 100%; }
@media (min-width: 960px) { .action-bar.delivery { position: static; box-shadow: none; } }
.outcomes { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; background: none; }
.outcomes legend { font-weight: 800; margin-bottom: 8px; padding: 0; }
.outcome { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 2px solid var(--line-strong);
  border-radius: var(--radius-small); cursor: pointer; font-weight: 700; background: var(--surface); }
.outcome input { width: 22px; height: 22px; margin: 0; accent-color: var(--night); }
.outcome:has(input:checked) { border-color: var(--night); background: var(--blue-soft); }
details.more, details.reason { border: 1px solid var(--line); border-radius: var(--radius-small); padding: 8px 12px; background: var(--surface); }
details.more summary, details.reason summary { cursor: pointer; font-weight: 700; min-height: 36px; display: flex; align-items: center; }
details.more[open], details.reason[open] { padding-bottom: 12px; }
details.more .actions { margin: 8px 0 12px; }
details.more details.reason { margin-top: 8px; }

/* ---------- Tabelle ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; min-width: 560px; }
table.data th, table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: .85rem; color: var(--muted); font-weight: 700; background: #f6f8fb; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; }
table.data tr.inactive td { color: var(--muted); }
.goods-table { width: 100%; border-collapse: collapse; }
.goods-table th, .goods-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.goods-table td.num, .goods-table th.num { text-align: right; white-space: nowrap; }
.cards { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card { padding: 12px 16px; display: grid; gap: 4px; }
.card + .card { border-top: 1px solid var(--line); }
.card .title { font-weight: 800; }
.card.inactive { color: var(--muted); }

/* ---------- Moduli ---------- */
.form { display: grid; gap: 16px; }
.form .row { display: grid; gap: 16px; }
@media (min-width: 760px) { .form .row.two { grid-template-columns: 1fr 1fr; } .form .row.three { grid-template-columns: 1fr 1fr 1fr; } }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field label, .field .label { font-weight: 700; }
.field .help { color: var(--muted); font-size: .88rem; }
.field .errorlist { list-style: none; padding: 0; margin: 0; color: var(--bad); font-weight: 700; font-size: .92rem; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=search],
input[type=number], input[type=tel], select, textarea {
  width: 100%; min-height: 50px; padding: 10px 12px; border: 2px solid var(--line-strong); border-radius: var(--radius-small);
  background: var(--surface); color: var(--ink); font: inherit; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 3px solid rgba(47, 123, 229, .25); outline-offset: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--night); }
.form-errors { border: 2px solid var(--bad); background: var(--bad-soft); border-radius: var(--radius-small); padding: 10px 14px; }
.form-errors ul { margin: 0; padding-left: 18px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; margin: 0; background: var(--surface); }
legend { font-weight: 800; padding: 0 6px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
details.form-more { padding: 12px 16px; }
details.form-more[open] summary { margin-bottom: 10px; }
.lines { display: grid; gap: 12px; }
.line { border: 1px solid var(--line); border-radius: var(--radius-small); padding: 12px; display: grid; gap: 10px; background: #f8fafc; }
.line .line-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.line .line-grid { display: grid; gap: 10px; }
@media (min-width: 760px) { .line .line-grid { grid-template-columns: 1fr 2.6fr .9fr .9fr; } }
.line.is-removed { opacity: .5; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 16px; }
.filters .field { flex: 1 1 160px; }
.filters .btn { flex: none; }

/* ---------- Agenda ---------- */
.agenda-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.agenda-bar .title { font-family: var(--display); font-weight: 700; font-size: 1.7rem; margin: 0 8px 0 0; line-height: 1; }
.segmented { display: inline-flex; border: 2px solid var(--night); border-radius: var(--radius-small); overflow: hidden; }
.segmented a { padding: 8px 12px; text-decoration: none; color: var(--night); font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.segmented a + a { border-left: 2px solid var(--night); }
.segmented a[aria-current="true"] { background: var(--night); color: #fff; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.month .wd { background: #f6f8fb; padding: 6px 8px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.month .cell { background: var(--surface); min-height: 116px; padding: 6px; display: grid; align-content: start; gap: 4px; }
.month .cell.out { background: #f4f6f9; color: var(--muted); }
.month .cell .num { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-weight: 700; font-size: 1.15rem; text-decoration: none; color: inherit; }
.month .cell.today .num span:first-child { background: var(--signal); color: var(--signal-ink); border-radius: 6px; padding: 0 7px; }
.month .chip { display: block; font-size: .8rem; line-height: 1.25; padding: 3px 6px; border-radius: 5px; background: var(--blue-soft);
  border-left: 4px solid var(--k-delivery); color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month .chip.kind-pickup { border-left-color: var(--k-pickup); background: #e1f3ee; }
.month .chip.kind-other { border-left-color: var(--k-other); background: #eef1f4; }
.month .chip.status-draft { background: transparent; border: 1px dashed var(--line-strong); border-left-width: 4px; }
.month .chip.status-cancelled { text-decoration: line-through; color: var(--muted); background: #f3f4f6; }
.month .chip.status-in_progress { background: var(--signal-soft); }
.month .count { display: none; }
@media (max-width: 700px) {
  .month .cell { min-height: 64px; }
  .month .chip { display: none; }
  .month .count { display: inline-block; font-family: var(--font); font-size: .78rem; font-weight: 700; background: var(--night); color: #fff; border-radius: 999px; padding: 0 7px; }
  .month .wd { padding: 4px; text-align: center; }
}
.week { display: grid; gap: 12px; }
@media (min-width: 1100px) {
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  .week .day { min-height: 320px; }
}
.week .day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; display: grid; align-content: start; gap: 8px; }
.week .day.weekend { background: #f6f8fb; }
.week .day.today { border: 2px solid var(--signal-press); box-shadow: inset 0 4px 0 var(--signal); }
.week .day-title { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; text-decoration: none; color: inherit; }
.week .none { color: var(--muted); font-size: .85rem; }
.chip-item { display: grid; gap: 2px; padding: 8px 8px 8px 10px; border: 1px solid var(--line); border-left: 5px solid var(--k-delivery);
  border-radius: var(--radius-small); background: var(--surface); color: inherit; text-decoration: none; font-size: .9rem; min-width: 0; }
.chip-item:hover { border-color: var(--line-strong); }
.chip-item.kind-pickup { border-left-color: var(--k-pickup); }
.chip-item.kind-other { border-left-color: var(--k-other); }
.chip-item.status-draft { border-style: dashed; border-left-style: solid; }
.chip-item.status-cancelled .chip-who, .chip-item.status-cancelled .chip-when { text-decoration: line-through; color: var(--muted); }
.chip-item.status-in_progress { background: var(--signal-soft); }
.chip-item .chip-when { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--night); }
.chip-item .chip-kind { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); font-size: .82rem; font-weight: 700; }
.chip-item .chip-kind .icon { width: 16px; height: 16px; }
.chip-item .chip-who { font-weight: 800; overflow-wrap: anywhere; line-height: 1.25; }
.chip-item .badge { justify-self: start; font-size: .75rem; white-space: normal; }

/* ---------- Accesso ---------- */
.login-page { background: var(--night); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 420px; background: var(--surface); border-radius: 18px; padding: 30px 26px; border-top: 6px solid var(--signal); }
.login .brand { color: var(--night); margin-bottom: 22px; font-size: 1.2rem; }
.login .brand img { width: 36px; height: 36px; }
.login h1 { font-family: var(--display); font-weight: 700; font-size: 2.4rem; letter-spacing: 0; margin-bottom: 6px; }
.login .btn.primary { width: 100%; background: var(--night); border-color: var(--night); }
.login .btn.primary:hover { background: var(--night-2); border-color: var(--night-2); }

/* ---------- Menu Altro, storico, conflitti ---------- */
.menu-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.menu-list li + li { border-top: 1px solid var(--line); }
.menu-list a, .menu-list button { display: flex; gap: 14px; align-items: center; padding: 14px 16px; text-decoration: none; color: var(--ink);
  font: inherit; font-weight: 700; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; min-height: 58px; }
.menu-list a:hover, .menu-list button:hover { background: #f6f8fb; }
.menu-list .hint { display: block; font-weight: 400; color: var(--muted); font-size: .88rem; }
.menu-list .icon { width: 24px; height: 24px; color: var(--night); }
.menu-list .go-item { color: var(--signal-ink); background: var(--signal-soft); }
.menu-list .go-item .icon { color: var(--signal-ink); }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.history li { border-left: 3px solid var(--line-strong); padding: 2px 0 2px 12px; }
.history .when { color: var(--muted); font-size: .85rem; }
.history .changes { font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }
.conflict { border: 2px solid var(--signal-press); background: var(--signal-soft); border-radius: var(--radius); padding: 12px 14px; }
.conflict table { width: 100%; border-collapse: collapse; background: var(--surface); }
.conflict th, .conflict td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 16px 0; }

/* ---------- Documenti di trasporto ----------
   Il numero è il protagonista: in Barlow come la segnaletica, grande come un timbro.
   La bozza non ha numero e lo dice con un riquadro tratteggiato; l'annullato è barrato in rosso.
   Il foglio ricalca l'ordine del PDF (parti, luoghi, causale, beni, trasporto). */
.tag.doc-row .tag-t { font-size: 1.6rem; }
.tag.doc-row .tag-t2 { font-size: 1.05rem; margin-top: 2px; }
.doc-draft-label { border: 1.5px dashed var(--line-strong); border-radius: 6px; padding: 1px 6px; margin-top: 2px; }
.new-series { margin-top: 32px; }
.doc-head { display: grid; gap: 4px; margin: 2px 0 18px; }
.doc-head-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.doc-type { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--night); }
.doc-number { display: flex; align-items: baseline; gap: 4px; margin: 6px 0 0; font-family: var(--display); color: var(--night); line-height: .95; }
.doc-number .n-pre { font-size: 1.4rem; font-weight: 600; color: var(--muted); margin-right: 4px; }
.doc-number .n { font-size: 3.6rem; font-weight: 700; }
.doc-number .n-year { font-size: 2rem; font-weight: 600; color: var(--muted); }
.doc-number.is-draft { width: fit-content; font-size: 1.7rem; font-weight: 600; color: var(--muted);
  border: 2px dashed var(--line-strong); border-radius: var(--radius-small); padding: 6px 14px 4px; }
.doc-head.status-cancelled .n, .doc-head.status-cancelled .n-year { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 3px; }
.doc-sub { margin: 4px 0 0; font-size: 1.2rem; font-weight: 800; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; overflow-wrap: anywhere; }
.doc-date { font-size: 1rem; font-weight: 600; color: var(--muted); }
.doc-grid { display: grid; gap: 16px; grid-template-areas: "actions" "sheet" "side"; }
.doc-actions { grid-area: actions; display: grid; gap: 12px; align-content: start; }
.doc-actions p { margin: 0; }
.doc-sheet { grid-area: sheet; min-width: 0; }
.doc-side { grid-area: side; min-width: 0; }
.doc-side > * + * { margin-top: 16px; }
@media (min-width: 960px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "sheet actions" "sheet side"; align-items: start; }
}
.doc-sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sheet-parties { display: grid; }
@media (min-width: 700px) {
  .sheet-parties { grid-template-columns: 1fr 1fr; }
  .sheet-parties > .sheet-box + .sheet-box { border-left: 1px solid var(--line); }
}
.sheet-box { padding: 14px 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.sheet-box h2, .sheet-title { font-family: var(--font); font-size: .85rem; font-weight: 700; color: var(--muted); letter-spacing: 0; margin: 0 0 4px; }
.sheet-title { padding: 14px 18px 8px; }
.sheet-box p { margin: 0; overflow-wrap: anywhere; }
.sheet-box p + p { margin-top: 4px; }
.party-name, .sheet-strong { font-weight: 800; font-size: 1.08rem; }
.sheet-goods { border-bottom: 1px solid var(--line); }
.sheet-goods .goods { border: 0; border-radius: 0; border-top: 1px solid var(--line); }
.doc-sheet > :last-child { border-bottom: 0; }
.blank { color: var(--muted); font-style: italic; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px 16px; border: 2px solid var(--line-strong);
  border-radius: var(--radius-small); cursor: pointer; font-weight: 700; background: var(--surface); }
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--night); }
.choice:has(input:checked) { border-color: var(--night); background: var(--blue-soft); }
.doc-box h2 { font-size: 1.1rem; margin-bottom: 10px; }
.doc-box form + p, .doc-box ul + form { margin-top: 10px; }
.doc-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.doc-links li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.doc-links a.doc-n { font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: var(--night); text-decoration: none; }
.doc-links a.doc-n:hover { text-decoration: underline; }
.doc-links .status-cancelled a.doc-n { color: var(--muted); text-decoration: line-through; }
.doc-links .btn { margin-left: auto; }
.series-list { display: grid; gap: 16px; }
.series.is-off { background: #f6f8fb; }
.series-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.series-head h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: 0; }
.series-head p { margin: 2px 0 0; }
.counters { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-small); }
.counters li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2px 14px; padding: 10px 14px; align-items: baseline; }
.counters li + li { border-top: 1px solid var(--line); }
.counter-year { font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--night); grid-row: span 2; }
.counter-next strong { font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: var(--night); }
.counter-note { overflow-wrap: anywhere; }
.series details.reason { margin-top: 4px; }
.series details.reason .form { margin-top: 10px; }


/* ---------- Documenti ricevuti e richieste via email ----------
   Lo stato del DDT del cliente è una riga di testo con icona; le foto sono miniature cliccabili.
   Nessun giallo qui: non è "adesso", è archivio. */
.doc-box-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; margin-bottom: 4px; }
.doc-box-head h2 { margin: 0; }
.doc-box-sub { font-size: 1rem; margin: 16px 0 8px; }
.doc-box > p { margin: 0 0 12px; }
.doc-box .actions { margin: 4px 0 12px; }
.ddt-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.ddt-state .icon { width: 20px; height: 20px; }
.ddt-state.state-ricevuto { color: var(--ok); }
.ddt-state.state-richiesto { color: var(--blue); }
.ddt-state.state-mancante { color: var(--bad); }
.ddt-state.state-atteso { color: var(--muted); }
.att-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.att { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: start; }
.att-thumb { width: 76px; height: 76px; border: 1px solid var(--line); border-radius: var(--radius-small); overflow: hidden;
  display: grid; place-items: center; align-content: center; gap: 2px; background: #f6f8fb; color: var(--night); text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: .95rem; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-thumb .icon { width: 26px; height: 26px; }
.att-body { display: grid; gap: 2px; min-width: 0; }
.att-title { font-weight: 800; overflow-wrap: anywhere; }
.att-body details.reason { margin-top: 6px; padding: 4px 10px; }
.upload { display: grid; gap: 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius-small); padding: 12px; margin: 0 0 12px; }
.upload p { margin: 0; }
.upload-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.upload-pick .btn { flex: 1 1 160px; cursor: pointer; }
.upload-pick .btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.upload-after { display: grid; gap: 10px; }
.upload.js-upload:not(.is-ready) .upload-after { display: none; }
.upload-chosen { display: flex; align-items: center; gap: 10px; font-weight: 700; overflow-wrap: anywhere; }
.upload-chosen img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.receipt-link { margin: 12px 0 0; }
.receipt-link a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.receipt-link .icon { width: 18px; height: 18px; }
.mail-log { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.mail-log li { border-left: 3px solid var(--line-strong); padding: 2px 0 2px 12px; display: grid; gap: 4px; }
.mail-log p { margin: 0; }
.mail-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; align-items: center; overflow-wrap: anywhere; }
.mail-what { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.mail-what > span { overflow-wrap: anywhere; }
.mail-what .icon { margin-top: 3px; flex: none; }
.mail-head .icon { width: 18px; height: 18px; color: var(--muted); }
.mail-form textarea { font-family: var(--font); line-height: 1.45; }

/* ---------- Compilazione con l'anagrafica ----------
   Stesso schema in tutti i moduli: casella con la freccia dell'elenco, si scrive per cercare o si apre
   l'elenco. Se la voce non c'è, i suoi dati si compilano nel riquadro tratteggiato e si salvano con il modulo. */
.combo { position: relative; }
.combo > input, .combo > textarea { padding-right: 48px; }
.combo-toggle { position: absolute; top: 2px; right: 2px; bottom: 2px; width: 44px; border: 0; border-left: 1px solid var(--line);
  border-radius: 0 6px 6px 0; background: #f6f8fb; color: var(--night); cursor: pointer; display: grid; place-items: center; }
.combo-area .combo-toggle { bottom: auto; height: 42px; border-bottom: 1px solid var(--line); border-radius: 0 6px 0 6px; }
.combo-toggle:hover { background: var(--blue-soft); }
.combo-toggle .icon { width: 20px; height: 20px; }
.combo-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none;
  max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-small);
  box-shadow: 0 12px 28px rgba(15, 37, 64, .18); }
.combo-opt { display: grid; gap: 1px; padding: 9px 12px; cursor: pointer; }
.combo-opt + .combo-opt { border-top: 1px solid #edf0f4; }
.combo-opt.is-active, .combo-opt:hover { background: var(--blue-soft); }
.combo-main { font-weight: 700; overflow-wrap: anywhere; }
.combo-hint { font-size: .86rem; color: var(--muted); overflow-wrap: anywhere; }
.combo-empty { padding: 9px 12px; color: var(--muted); font-size: .92rem; }
.line-link { margin: 2px 0 0; font-size: .86rem; color: var(--ok); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.line-link.is-free { color: var(--muted); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }
.new-record { display: grid; gap: 10px; padding: 12px 14px; border: 1px dashed var(--blue); border-radius: var(--radius-small);
  background: var(--blue-soft); }
.new-record[hidden] { display: none; }
fieldset > .new-record { margin: 10px 0 12px; }
.new-record > p { margin: 0; }
.new-record-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--blue); }
.new-record-title .icon { width: 18px; height: 18px; }
.new-record input, .new-record textarea { background: var(--surface); }
.new-record.compact { gap: 2px; padding: 8px 12px; }
.needed-tag { display: inline-block; margin-left: 4px; padding: 0 8px; border: 1px solid var(--signal-press); border-radius: 999px;
  background: var(--signal-soft); color: var(--signal-ink); font-size: .78rem; font-weight: 700; vertical-align: 1px; }
.field.is-needed input, .field.is-needed textarea, .field.is-needed select { border-color: var(--signal-press); background: #fffbea; }
.field.is-needed .choice-row { outline: 2px solid var(--signal-press); outline-offset: 4px; border-radius: var(--radius-small); }
fieldset.is-needed { border-color: var(--signal-press); }
details.force-issue { border: 1px solid var(--bad); border-radius: var(--radius-small); padding: 8px 12px; background: var(--surface); }
details.force-issue summary { cursor: pointer; font-weight: 700; color: var(--bad); min-height: 36px; display: flex; align-items: center; gap: 8px; }
details.force-issue summary .icon { width: 18px; height: 18px; flex: none; }
details.force-issue[open] { padding-bottom: 12px; }
details.force-issue .form { margin-top: 6px; gap: 12px; }
.logo-preview { display: grid; gap: 6px; justify-items: start; }
.logo-preview img { max-width: min(260px, 100%); height: auto; padding: 8px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-small); }

/* ---------- Firma sul telefono (ricevute interne di ritiro e consegna) ---------- */
.back-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; margin: 0 0 10px; text-decoration: none; }
.back-link .icon { width: 20px; height: 20px; }
.btn.wide { width: 100%; }
.sign-page { max-width: 720px; margin: 0 auto; }
.sign-head { margin: 0 0 16px; }
.sign-head h1 { margin: 0 0 4px; font-size: 1.9rem; }
.sign-page.kind-pickup .sign-head h1 { color: var(--k-pickup); }
.sign-page.kind-delivery .sign-head h1 { color: var(--k-delivery); }
.sign-sub { margin: 0; display: grid; }
.sign-sub span { color: var(--muted); }
.sign-form { gap: 14px; }
.sign-step { display: grid; gap: 14px; }
.sign-step[hidden] { display: none; }
.sign-recap h2 { font-size: 1.05rem; margin: 0 0 10px; }
.goods.compact li { padding: 8px 12px; grid-template-columns: 78px minmax(0, 1fr); }
.goods.compact .goods-qty { font-size: 1.3rem; }
.sign-ddt { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; }
.sign-ddt .icon { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.sign-ddt.warn { color: #6b5100; }
.step-title { font-size: 1.15rem; margin: 6px 0 0; }
.sign-names { display: grid; gap: 14px; }
@media (min-width: 560px) { .sign-names { grid-template-columns: 1fr 1fr; } }
.field-msg { margin: 0; color: var(--bad); font-weight: 700; font-size: .92rem; }
.sign-who { margin: 0; font-size: 1.35rem; }
.sign-who span { font-family: var(--display); font-size: 1.6rem; }
.sign-declaration { margin: 0; color: var(--muted); }
.sign-pad { position: relative; }
.sign-pad canvas { display: block; width: 100%; aspect-ratio: 5 / 2; background: #fff; border: 2px solid var(--line-strong);
  border-radius: var(--radius); touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.sign-pad canvas:focus-visible { outline: 3px solid var(--focus); }
.sign-placeholder { position: absolute; left: 0; right: 0; top: 34%; margin: 0; text-align: center; color: #9aa7b5;
  font-family: var(--display); font-size: 1.7rem; pointer-events: none; }
.sign-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.sign-tools .btn { flex: 1 1 160px; }
.sign-foot { margin: 0; text-align: center; }
/* Durante la firma: niente barre o menu, tutto lo spazio al riquadro. */
body.is-signing .nav, body.is-signing .modebar, body.is-signing .topbar, body.is-signing .back-link,
body.is-signing .sign-head { display: none; }
body.is-signing .main { padding-bottom: 24px; }
@media (orientation: landscape) and (max-height: 520px) {
  body.is-signing .sign-declaration, body.is-signing .sign-foot { display: none; }
  body.is-signing .sign-pad canvas { width: auto; height: 62vh; max-width: 100%; margin: 0 auto; }
}

.sign-box h2 { font-size: 1.1rem; }
.sign-box > .btn.big { margin: 6px 0 8px; }
.sign-box > p { margin: 0 0 8px; }
.sign-figure { margin: 8px 0 12px; }
.sign-svg { display: block; width: 100%; max-width: 360px; aspect-ratio: 5 / 2; color: #1c3f8c; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-small); }
.sign-figure figcaption { margin-top: 6px; }
dl.facts.compact { gap: 4px 12px; margin: 0 0 10px; font-size: .95rem; }
.voided { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.voided li span { display: block; }

/* ---------- Segnalazioni ---------- */
.bug-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,.55); color: #fff; text-decoration: none; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.bug-btn .icon { width: 18px; height: 18px; color: var(--signal); }
.bug-btn:hover { background: var(--night-2); }
.modebar .bug-btn { margin-left: auto; }
.modebar .bug-btn + form { margin-left: 8px; }
@media (max-width: 420px) { .topbar .bug-btn span { display: none; } .topbar .bug-btn { padding: 4px 9px; } }
.report-page { max-width: 760px; }
.report-form { gap: 18px; }
.severity-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.severity-pick legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.choice.sev-blocca:has(input:checked) { border-color: var(--bad); background: var(--bad-soft); }
.choice.sev-idea:has(input:checked) { border-color: var(--blue); }
.report-where code, .report-row code { font-size: .85rem; }
.seg-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.seg-tabs a { padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); text-decoration: none; color: var(--ink); font-weight: 700; }
.seg-tabs a[aria-current="page"] { background: var(--night); border-color: var(--night); color: #fff; }
.seg-tabs .count { font-weight: 800; margin-left: 4px; }
.report-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.report-row a { display: grid; gap: 4px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line);
  border-left: 5px solid var(--line-strong); border-radius: var(--radius-small); text-decoration: none; color: var(--ink); }
.report-row.sev-blocca a { border-left-color: var(--bad); }
.report-row.sev-fastidio a { border-left-color: var(--signal-press); }
.report-row.sev-idea a { border-left-color: var(--blue); }
.report-row a:hover { border-color: var(--line-strong); }
.report-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.report-code { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.report-title { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.report-meta { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.sev-badge { display: inline-flex; padding: 1px 9px; border-radius: 999px; font-size: .8rem; font-weight: 800; border: 1.5px solid var(--line-strong); color: var(--muted); }
.sev-badge.sev-blocca { border-color: var(--bad); color: #fff; background: var(--bad); }
.sev-badge.sev-fastidio { border-color: var(--signal-press); background: var(--signal-soft); color: var(--signal-ink); }
.sev-badge.sev-idea { border-color: var(--blue); color: var(--blue); }
.badge.rs-nuova { border-color: var(--blue); color: var(--blue); }
.badge.rs-in_lavorazione { border-color: var(--signal-press); background: var(--signal); color: var(--signal-ink); }
.badge.rs-risolta { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.badge.rs-chiusa { border-style: dashed; color: var(--muted); }
.report-head { margin: 0 0 18px; }
.report-head h1 { margin: 6px 0 0; font-size: 1.7rem; overflow-wrap: anywhere; }
.report-images { display: flex; flex-wrap: wrap; gap: 10px; }
.report-images img { display: block; max-width: 220px; max-height: 260px; width: auto; height: auto; border: 1px solid var(--line); border-radius: var(--radius-small); background: #fff; }
.plain-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; overflow-wrap: anywhere; }
pre.trace { background: #0f2540; color: #e4edf9; padding: 14px; border-radius: var(--radius-small); overflow: auto; font-size: .8rem; line-height: 1.4; max-height: 480px; white-space: pre; }

/* ---------- Posta in arrivo ---------- */
.ai-meter { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-small); padding: 10px 14px; margin: 0 0 14px; }
.ai-meter p { margin: 0; }
.ai-meter p + p { margin-top: 4px; }
.ai-meter.is-off { border-color: var(--signal-press); background: var(--signal-soft); }
.conn-line { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; }
.conn-line .icon { flex: none; margin-top: 3px; color: var(--ok); }
.mail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mail-row a { display: grid; gap: 4px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-small); text-decoration: none; color: var(--ink); }
.mail-row a:hover { border-color: var(--line-strong); }
.mail-row.is-bulk a { opacity: .75; }
.mail-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.mail-from { font-weight: 800; overflow-wrap: anywhere; }
.mail-when { margin-left: auto; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.mail-subject { font-weight: 600; overflow-wrap: anywhere; }
.mail-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; border: 1.5px solid var(--line-strong);
  font-size: .82rem; font-weight: 700; color: var(--ink); background: var(--surface); }
.mchip .icon { width: 14px; height: 14px; }
.mchip.quiet { color: var(--muted); border-style: dashed; }
.mchip.cust { border-color: var(--night-2); color: var(--night); }
.mchip.kind-delivery { border-color: var(--k-delivery); color: var(--k-delivery); }
.mchip.kind-pickup { border-color: var(--k-pickup); color: var(--k-pickup); }
.mchip.src { border-color: var(--blue-soft); background: var(--blue-soft); color: var(--blue); }
.mchip.demo { border-color: var(--demo); color: var(--demo); }
.inbox-head { margin: 0 0 18px; }
.inbox-head h1 { margin: 6px 0; font-size: 1.6rem; overflow-wrap: anywhere; }
.mail-meta { margin: 2px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; overflow-wrap: anywhere; }
.mail-meta .icon { width: 18px; height: 18px; }
.badge.ms-da_vedere { border-color: var(--blue); color: var(--blue); }
.badge.ms-gestita { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.badge.ms-ignorata { border-style: dashed; color: var(--muted); }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-small); padding: 14px 16px; font-size: .95rem; line-height: 1.55; max-height: 70vh; overflow-y: auto; }
.mail-text mark { background: #fff1a8; color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: 0 0 0 1px #f0d75a; }
.proposal-box .section-head { display: flex; align-items: center; gap: 10px; }
.proposal-class { margin: 0 0 10px; color: var(--muted); }
.proposal { border-left: 5px solid var(--line-strong); margin-bottom: 12px; }
.proposal.kind-delivery { border-left-color: var(--k-delivery); }
.proposal.kind-pickup { border-left-color: var(--k-pickup); }
.proposal h3 { margin: 0 0 10px; font-size: 1.1rem; }
.proposal .quote { display: block; color: var(--muted); font-size: .88rem; }
.proposal .note { display: block; color: #6b5100; }
.exceptions { border-color: var(--signal-press); background: var(--signal-soft); }
.exceptions h3 { margin: 0 0 6px; font-size: 1rem; }
.cand-list, .attach-list, .readings { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.cand-list li, .attach-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.attach-list a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; overflow-wrap: anywhere; }
.readings li span { display: block; }
.checklist { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.checklist li { padding-left: 26px; position: relative; overflow-wrap: anywhere; }
.checklist li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.checklist li.ok::before { content: "✓"; color: var(--ok); }
.checklist li.todo::before { content: "○"; color: var(--bad); }
.checklist li.info::before { content: "→"; color: var(--blue); }
.severity-pick, .severity-pick .choice-row { background: none; }

/* ---------- Stampa e invio del DDT ---------- */
.print-frame { position: fixed; right: 0; bottom: 0; width: 2px; height: 2px; border: 0; opacity: 0; pointer-events: none; }
.doc-actions { margin-top: .75rem; }
.print-hint { margin: .5rem 0 0; }
.attach-chip { display: inline-flex; align-items: center; gap: .4rem; margin: .75rem 0 0; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .9rem; }
.attach-chip .icon { width: 1rem; height: 1rem; }
.ddt-check { margin: 0 0 1rem; }
.ddt-check h2 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; font-size: 1.1rem; }
.ddt-check-list { list-style: none; margin: 0; padding: 0; }
.stop-ddt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.stop-ddt:first-child { border-top: 0; }
.stop-ddt .actions { display: flex; gap: .5rem; margin: 0; }
.stop-ddt.is-missing { color: var(--bad); }
.stop-ddt.is-missing .icon { margin-right: .3rem; }

/* ---------- Richieste dei clienti: pagina pubblica del link personale ---------- */
body.portal { background: var(--paper); }
.portal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  padding: 14px var(--gutter); background: var(--night); color: #fff; }
.portal-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.4rem; font-weight: 700; }
.portal-for { color: var(--night-text); }
.portal-for strong { color: #fff; }
.portal-main { max-width: 760px; margin: 0 auto; padding: 22px var(--gutter) 36px; display: grid; gap: 20px; }
.portal-intro h1 { font-family: var(--display); font-weight: 700; font-size: 2.2rem; line-height: 1; margin: 0 0 8px; }
.portal-intro .lede { margin: 0; }
.portal-form { gap: 14px; }
.pf-step legend { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.pf-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--signal);
  color: var(--signal-ink); font-weight: 800; font-size: .95rem; }
.req { color: var(--bad); }
.choice-stack { display: grid; gap: 8px; }
.choice-stack .choice { width: 100%; }
.big-choice { min-height: 58px; font-size: 1.05rem; }
.pf-step > .field, .pf-step > .row, .pf-step > .choice-row { margin-top: 12px; }
.pf-other { margin-top: 12px; display: grid; gap: 12px; }
.pf-other[hidden], [data-custom-time][hidden], [data-ddt-upload][hidden], .pf-line[hidden] { display: none; }
.pf-lines { display: grid; gap: 12px; margin-bottom: 12px; }
.pf-line { display: grid; grid-template-columns: minmax(0, 1fr) 96px 128px; gap: 8px; align-items: end; }
.pf-line + .pf-line { border-top: 1px dashed var(--line-strong); padding-top: 12px; }
@media (max-width: 560px) { .pf-line { grid-template-columns: 1fr 1fr; } .pf-desc { grid-column: 1 / -1; } }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.portal-sent { background: var(--ok-soft); border: 2px solid var(--ok); border-radius: var(--radius); padding: 18px 20px; }
.portal-sent h1 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-family: var(--display); font-weight: 700;
  font-size: 1.9rem; color: var(--ok); }
.portal-sent p { margin: 0 0 8px; }
.portal-req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.portal-req-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line-strong); border-radius: var(--radius-small); }
.portal-req-list li.pr-accettata { border-left-color: var(--ok); }
.portal-req-list li.pr-rifiutata { border-left-color: var(--bad); }
.portal-req-list .pr-main span { display: block; }
.portal-req-list .pr-status { font-weight: 700; text-align: right; }
.portal-req-list form { grid-column: 1 / -1; }
.portal-foot { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter) 32px; color: var(--muted); font-size: .92rem; }
.portal-foot p { margin: 0 0 6px; }

/* ---------- Richieste dei clienti: lato ufficio ---------- */
.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.req-row a { display: grid; gap: 4px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line);
  border-left: 5px solid var(--blue); border-radius: var(--radius-small); text-decoration: none; color: var(--ink); }
.req-row.kind-pickup a { border-left-color: var(--k-pickup); }
.req-row .req-top { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.req-row .req-code { font-weight: 800; }
.link-box { display: grid; gap: 10px; }
.link-url { width: 100%; font-family: inherit; font-size: .95rem; padding: 10px 12px; border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-small); background: var(--surface); }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.link-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); }
.link-list li.is-off { opacity: .6; }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px;
  background: var(--signal); color: var(--signal-ink); font-size: .78rem; font-weight: 800; }

/* ---------- 0.9: scopo del trasporto, rientri, materiale fuori, archivio ---------- */
.purpose-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: .82rem;
  font-weight: 700; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); white-space: nowrap; }
.purpose-chip .icon { width: 14px; height: 14px; }
.purpose-chip.p-noleggio { border-color: var(--blue); color: var(--blue-press); background: var(--blue-soft); }
.purpose-chip.p-uso { border-color: var(--k-pickup); color: var(--k-pickup); background: var(--ok-soft); }
.purpose-chip.p-spostamento { color: var(--muted); }
.purpose-chip.p-vendita, .purpose-chip.p-corriere { border-color: var(--signal-press); color: var(--signal-ink); background: var(--signal-soft); }
.return-card.is-late, .out-item.is-late { border-left: 5px solid var(--bad); }
.return-date-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 12px; }
.return-date-form .field { margin: 0; }
.out-list, .archive-list, .due-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.out-item, .archive-item { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--k-delivery);
  border-radius: var(--radius-small); padding: 12px 14px; }
.archive-item.kind-pickup { border-left-color: var(--k-pickup); }
.archive-item.kind-other { border-left-color: var(--k-other); }
.archive-item.has-missing { border-left-color: var(--bad); }
.out-head, .archive-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.out-head strong, .archive-who { font-size: 1.02rem; }
.out-return { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.out-item.is-late .out-return { color: var(--bad); }
.out-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.archive-docs { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.archive-docs li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.archive-docs .icon { width: 18px; height: 18px; flex: none; }
.archive-missing { color: var(--bad); font-weight: 700; }
.archive-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; }
.archive-nav .month-title { margin: 0; font-family: var(--display); font-size: 1.6rem; }
.due-list li { display: grid; gap: 2px; }
.simple-table { width: 100%; border-collapse: collapse; }
.simple-table th, .simple-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.simple-table .num { text-align: right; white-space: nowrap; }
.check-field { align-self: end; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.inline-form .field { margin: 0; flex: 1 1 220px; }
.pf-line-mat { grid-template-columns: minmax(0, 1fr) 96px; }
.pf-line-mat .pf-other-desc { grid-column: 1 / -1; }
@media (max-width: 560px) { .pf-line-mat { grid-template-columns: minmax(0, 1fr) 88px; } .pf-line-mat .pf-desc { grid-column: auto; } }
.return-date-form input[type=date] { width: auto; min-width: 170px; max-width: 220px; }
.return-date-form .field { flex: 0 1 auto; }
.out-actions .return-date-form { margin-top: 0; }
fieldset > .field + .field, fieldset > .field + .help { margin-top: 14px; }
