/* Ordini Hub — stile PWA, mobile-first */
:root {
  --bg: #f3f4f8; --surface: #ffffff; --surface-2: #f8f9fc; --line: #e4e6ee;
  --text: #16181f; --muted: #5f667a; --faint: #9aa1b4;
  --primary: #4f46e5; --primary-ink: #ffffff; --primary-soft: #eef0ff;
  --danger: #dc2626; --ok: #16a34a; --warn: #b45309;
  --shadow: 0 1px 2px rgba(20,24,40,.06), 0 4px 14px rgba(20,24,40,.05);
  --radius: 14px; --nav-h: 60px; --top-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117; --surface: #181b25; --surface-2: #1f2331; --line: #2a2f40;
    --text: #eceef5; --muted: #a2a8bb; --faint: #6b7286;
    --primary: #818cf8; --primary-ink: #0f1117; --primary-soft: #23264a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1117; --surface: #181b25; --surface-2: #1f2331; --line: #2a2f40;
  --text: #eceef5; --muted: #a2a8bb; --faint: #6b7286;
  --primary: #818cf8; --primary-ink: #0f1117; --primary-soft: #23264a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; overscroll-behavior-y: contain; }
a { color: var(--primary); text-decoration: none; }
button { font: inherit; }
input, select, textarea { font: inherit; color: var(--text); }
.boot { padding: 40px 16px; text-align: center; color: var(--muted); }
.hidden { display: none !important; }

/* ---- struttura ---- */
.top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding-top: var(--safe-t); }
.top__row { height: var(--top-h); display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px; }
.top__title { flex: 1; font-weight: 700; font-size: 18px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.top__sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.iconbtn { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 12px; color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.iconbtn:active { background: var(--surface-2); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn.is-spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge { position: absolute; top: 5px; right: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
main { padding: 12px 16px calc(var(--nav-h) + var(--safe-b) + 24px); max-width: 860px; margin: 0 auto; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); 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: 2px; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; }
.nav a svg { width: 24px; height: 24px; }
.nav a.is-active { color: var(--primary); }
.nav .badge { top: 6px; right: calc(50% - 22px); }

/* ---- login ---- */
.login { max-width: 360px; margin: 12vh auto 0; padding: 0 16px; }
.login__logo { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 16px; display: block; }
.login h1 { text-align: center; font-size: 22px; margin: 0 0 4px; }
.login p { text-align: center; color: var(--muted); margin: 0 0 24px; }

/* ---- form ---- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field .help { font-size: 12px; color: var(--faint); margin-top: 4px; }
.input, .select, .textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); outline: none; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.textarea { min-height: 90px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239aa1b4' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; cursor: pointer; background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--primary { background: var(--primary); color: var(--primary-ink); }
.btn--outline { background: transparent; border-color: var(--line); }
.btn--danger { background: transparent; border-color: var(--line); color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn svg { width: 18px; height: 18px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.msg { padding: 12px 14px; border-radius: 12px; font-size: 14px; margin: 12px 0; }
.msg--err { background: #fee2e2; color: #991b1b; }
.msg--ok { background: #dcfce7; color: #166534; }
.msg--warn { background: #fef3c7; color: #92400e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg--err { background: #3b1111; color: #fca5a5; } :root:not([data-theme="light"]) .msg--ok { background: #0f2e1a; color: #86efac; } :root:not([data-theme="light"]) .msg--warn { background: #3a2a06; color: #fcd34d; } }

/* ---- filtri ---- */
.search { position: relative; margin-bottom: 10px; }
.search .input { padding-left: 42px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--faint); pointer-events: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .n { font-weight: 500; opacity: .75; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }

/* ---- lista ordini: raggruppata per giorno, ora sempre a sinistra ---- */
.filters { display: flex; gap: 8px; margin-bottom: 8px; }
.filters .search { flex: 1 1 auto; min-width: 0; margin: 0; }
.select--store { flex: 0 1 42%; min-width: 0; width: auto; font-weight: 600; font-size: 14px; color: var(--muted); text-overflow: ellipsis; }
.day { margin-top: 18px; }
.day:first-child { margin-top: 6px; }
.day__hd { position: sticky; top: calc(var(--top-h) + var(--safe-t)); z-index: 5; display: flex; align-items: baseline; gap: 8px; margin: 0 -16px; padding: 10px 16px 8px; background: var(--bg); font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.day__t::first-letter { text-transform: uppercase; }
.day__d { font-size: 13px; font-weight: 500; color: var(--muted); }
.day__n { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.day__list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ord { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; color: inherit; border-top: 1px solid var(--line); min-height: 64px; transition: background .15s; }
.ord:first-child { border-top: 0; }
.ord:active { background: var(--surface-2); }
@media (hover: hover) { .ord:hover { background: var(--surface-2); } }
.ord:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ord__time { font-size: 14px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ord__main { min-width: 0; }
.ord__name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ord__cust { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ord__new { flex: 0 0 auto; font-size: 11px; font-weight: 800; color: var(--primary-ink); background: var(--primary); padding: 1px 7px; border-radius: 999px; }
.ord__sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 13px; color: var(--muted); min-width: 0; white-space: nowrap; }
.ord__sub .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.ord__store { overflow: hidden; text-overflow: ellipsis; }
.ord__num { flex: 0 0 auto; color: var(--faint); font-variant-numeric: tabular-nums; }
.ord__num::before { content: "·"; margin-right: 6px; }
.ord__side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.ord__total { font-weight: 800; font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ord__st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.ord__st .dot { width: 7px; height: 7px; border-radius: 50%; }
.ord.is-new { background: var(--primary-soft); }
.ord.is-new .ord__time { color: var(--primary); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty svg { width: 48px; height: 48px; color: var(--faint); margin-bottom: 8px; }
.more { display: flex; justify-content: center; padding: 16px 0; }

/* ---- riepilogo (una riga sola) ---- */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; }
.summary:empty { display: none; }
.summary > div { padding: 10px 12px; border-left: 1px solid var(--line); min-width: 0; }
.summary > div:first-child { border-left: 0; }
.summary small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.summary b { display: block; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary span { display: block; font-size: 12px; color: var(--muted); }

/* ---- dettaglio ordine ---- */
.sect { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.sect h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hd__num { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.hd__meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hd__total { font-size: 22px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin-top: 12px; }
.actions .btn { flex-direction: column; gap: 4px; min-height: 60px; font-size: 12px; padding: 8px 6px; }
.actions .btn svg { width: 22px; height: 22px; }
.kv { display: grid; grid-template-columns: minmax(90px, 32%) 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); margin: 0; }
.kv dd { margin: 0; word-break: break-word; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.items li:first-child { border-top: 0; padding-top: 0; }
.items img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex: 0 0 auto; }
.items .thumb { width: 52px; height: 52px; border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--faint); flex: 0 0 auto; }
.items .it { flex: 1; min-width: 0; }
.items .it b { display: block; font-size: 14px; }
.items .it small { display: block; color: var(--muted); font-size: 12px; }
.items .it .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.items .it .files a { display: inline-block; margin: 4px 6px 0 0; font-size: 12px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 8px; }
.items .amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.items .amt b { display: block; }
.items .amt small { color: var(--muted); font-size: 12px; }
.totals { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; padding: 2px 0; color: var(--muted); }
.totals div.grand { color: var(--text); font-weight: 800; font-size: 16px; margin-top: 4px; }
.note { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 8px; white-space: pre-wrap; }
.note small { display: block; color: var(--faint); font-size: 11px; margin-top: 4px; }
.status-form { display: flex; gap: 8px; align-items: center; }
.status-form .select { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin: 8px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }

/* ---- negozi ---- */
.store { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; color: inherit; margin-bottom: 10px; }
.store__ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 18px; flex: 0 0 auto; }
.store__body { flex: 1; min-width: 0; }
.store__name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.store--old { opacity: .62; border: 1px dashed var(--muted); }
.store__sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store__err { font-size: 12px; color: var(--danger); margin-top: 2px; white-space: normal; }
.store__n { text-align: right; font-size: 12px; color: var(--muted); }
.store__n b { display: block; font-size: 16px; color: var(--text); }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.colors button.is-active { border-color: var(--text); }
.tag { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }

/* ---- altro / impostazioni ---- */
.menu a, .menu button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; color: var(--text); cursor: pointer; font-weight: 600; }
.menu { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.menu > :last-child { border-bottom: 0; }
.menu small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.menu svg { width: 22px; height: 22px; color: var(--muted); flex: 0 0 auto; }
.menu .grow { flex: 1; }
.switch { position: relative; width: 46px; height: 28px; border-radius: 14px; background: var(--line); flex: 0 0 auto; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch.is-on { background: var(--ok); }
.switch.is-on::after { transform: translateX(18px); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

/* ---- toast e allarme ---- */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 50; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); animation: up .2s ease-out; }
.toast--err { background: var(--danger); color: #fff; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }
.alarm { position: fixed; inset: 0; z-index: 60; background: rgba(79,70,229,.96); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { background: rgba(79,70,229,.96); } to { background: rgba(220,38,38,.96); } }
.alarm h2 { font-size: 28px; margin: 12px 0 4px; }
.alarm p { font-size: 16px; opacity: .9; margin: 0 0 24px; }
.alarm .btn { background: #fff; color: #1e1b4b; min-width: 200px; }
.alarm ul { list-style: none; padding: 0; margin: 0 0 20px; font-size: 15px; }
@media (min-width: 720px) {
  .top__row { padding: 0 24px; }
  .ord { grid-template-columns: 54px minmax(0, 1fr) auto; padding: 12px 18px; }
}
.print-only { display: none; }
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-2: #f3f4f6; --line: #d1d5db; --text: #000; --muted: #374151; --faint: #6b7280; --shadow: none; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .top, .nav, .toast, .alarm, .no-print { display: none !important; }
  .print-only { display: block; }
  main { padding: 0; max-width: none; }
  .sect { box-shadow: none; border: 1px solid #d1d5db; break-inside: avoid; padding: 10px 12px; margin-bottom: 8px; }
  .items li { break-inside: avoid; }
  .pill { color: #000 !important; background: none !important; border: 1px solid #000; }
  a { color: #000; }
  .print-foot { font-size: 9pt; color: #6b7280; text-align: right; margin-top: 8px; }
  @page { margin: 12mm; }
}
::selection { background: var(--primary); color: var(--primary-ink); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .alarm { animation: none; } .toast { animation: none; } .iconbtn.is-spinning svg { animation-duration: 2s; } }
.card__store { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.card__store .dot { width: 9px; height: 9px; border-radius: 50%; }

/* ---- 08/10/2026: come il pannello ordini di citygraph.it (schede, badge Pagamento/Evasione, stampa multipla) ---- */
.tabs { display: flex; gap: 2px; overflow-x: auto; margin: 2px -16px 4px; padding: 0 16px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 12px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--text); }
.tab__n { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.tab.is-active .tab__n { background: var(--text); color: var(--bg); }
.tab__n.is-hot, .tab.is-active .tab__n.is-hot { background: var(--danger); color: #fff; }
.ordw { display: flex; align-items: stretch; border-top: 1px solid var(--line); }
.ordw:first-child { border-top: 0; }
.ordw .ord { flex: 1; min-width: 0; border-top: 0; padding-left: 4px; }
.ordw.is-sel, .ordw.is-sel .ord { background: var(--primary-soft); }
.ord__sel { display: flex; align-items: center; justify-content: center; width: 44px; flex: 0 0 auto; cursor: pointer; }
.ord__sel input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.ord__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; }
.ord__pz { font-size: 12px; color: var(--faint); }
.ord__note { margin-top: 6px; padding: 3px 8px; border-radius: 6px; background: #fef9c3; color: #422006; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ord__pm { font-size: 12px; color: var(--muted); white-space: nowrap; }
.st { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.st i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st--ok { background: #ccfbf1; color: #115e59; }
.st--wait { background: #fef3c7; color: #78350f; }
.st--work { background: #e0e7ff; color: #3730a3; }
.st--go { background: #1e1b4b; color: #fff; }
.st--off { background: var(--surface-2); color: var(--muted); }
.st--hot { background: var(--danger); color: #fff; }
.selbar { position: fixed; left: 8px; right: 8px; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); z-index: 30; max-width: 844px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 14px; background: var(--text); color: var(--bg); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.selbar__n { margin-right: auto; padding-left: 4px; font-weight: 700; font-size: 14px; }
.selbar .btn { background: var(--bg); color: var(--text); }
.selbar .btn--ghost { background: transparent; color: var(--bg); border-color: currentColor; }
#printArea { display: none; }
.pp { font: 13px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #111; }
.pp__hd { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #111; padding-bottom: 10px; }
.pp__store { font-size: 20px; font-weight: 800; }
.pp__r { text-align: right; }
.pp__num { font: 800 18px ui-monospace, Menlo, monospace; }
.pp__small { font-size: 11px; color: #555; }
.pp h4 { margin: 16px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #555; }
.pp__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.pp__box { border: 1px solid #ccc; border-radius: 6px; padding: 8px 10px; }
.pp__box h4 { margin-top: 0; }
.pp__t, .pp__tot { width: 100%; border-collapse: collapse; }
.pp__t th, .pp__t td { padding: 6px 5px; border-bottom: 1px solid #ddd; text-align: left; vertical-align: top; }
.pp__t th { font-size: 10px; text-transform: uppercase; color: #555; }
.pp .q { width: 48px; text-align: center; font-weight: 700; }
.pp .n { text-align: right; white-space: nowrap; }
.pp .chk { width: 44px; text-align: center; font-size: 18px; }
.pp__pers { font-size: 11px; color: #333; margin-top: 3px; }
.pp__url { word-break: break-all; }
.pp__tot { max-width: 300px; margin: 8px 0 0 auto; }
.pp__tot td { padding: 3px 5px; }
.pp__tot .big td { border-top: 2px solid #111; font-size: 15px; font-weight: 800; padding-top: 6px; }
.pp__notes { margin: 0; padding-left: 18px; font-size: 12px; }
.pp__firma { margin-top: 32px; display: flex; justify-content: space-between; font-size: 11px; color: #555; }
.pp__firma div { width: 45%; border-top: 1px solid #999; padding-top: 5px; }
@media print {
  body.printing > :not(#printArea) { display: none !important; }
  body.printing #printArea { display: block; }
  .pp { break-after: page; }
  .pp:last-child { break-after: auto; }
  .pp__box, .pp__t tr { break-inside: avoid; }
}
main:has(.selbar:not(.hidden)) { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 96px); }
.pp th.chk { font-size: 10px; }
@media (max-width: 480px) { .selbar .btn svg { display: none; } .selbar .btn { padding: 6px 10px; } .selbar__n { font-size: 13px; } }
.funz { margin: 0; font-size: 14px; }
.funz dt { font-weight: 700; margin-top: 10px; }
.funz dt:first-child { margin-top: 0; }
.funz dd { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.novita { position: fixed; inset: 0; z-index: 55; background: rgba(15,17,23,.55); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.novita__box { width: 100%; max-width: 420px; background: var(--surface); color: var(--text); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); margin-bottom: calc(var(--safe-b) + 8px); }
.novita__box h2 { margin: 0 0 10px; font-size: 19px; }
.novita__box ul { margin: 0 0 16px; padding-left: 20px; font-size: 14px; }
.novita__box li { margin: 4px 0; }
@media (min-width: 600px) { .novita { align-items: center; } }
/* 08/10/2026: note veloci, copia pagamento, elimina ordine */
.sect__help { margin: -4px 0 10px; font-size: 13px; color: var(--muted); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.qchip { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.qchip:active { background: var(--primary-soft); border-color: var(--primary); }
.sect--danger { border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.sect--danger h3 { color: var(--danger); }
.btn--danger-solid { background: var(--danger); color: #fff; }

/* 08/10/2026 fornitori e spedizione nel dettaglio ordine */
.forn { border-top: 1px solid var(--line, #e5e7eb); padding: 10px 0; }
.forn:first-of-type { border-top: 0; }
.forn__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.forn__out:not(:empty) { margin-top: 8px; }
.forn__out ul { margin: 6px 0 0 18px; padding: 0; }
.forn__out details { margin-top: 6px; }
/* 09/10/2026: ritiro da Capaldo con Shipping Agency */
.ritiro__fasi { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.ritiro__fasi li { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 8px 10px; font-size: 14px; color: var(--muted); }
.ritiro__fasi li.ok { border-color: #86efac; color: inherit; font-weight: 600; }
.ritiro__fasi small { display: block; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.ritiro__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 10px; margin-top: 8px; }
.ritiro__row { margin: 10px 0; }
#ritiroBox details summary { cursor: pointer; font-weight: 600; margin: 6px 0; }
/* 12/10/2026: spedizione per ordine (MySmartCourier / spedizioniere via email) */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.seg__btn { min-height: 56px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.seg__btn small { color: var(--muted); font-size: 12px; }
.seg__btn.is-on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.seg__btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ship__dest { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; margin: 8px 0; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.ship__dest b { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.ship__wide { grid-column: 1 / -1; }
.ship__file { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.ship__btns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ship__det summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
#shipBox .forn:first-of-type { border-top: 1px solid var(--line, #e5e7eb); }
