/* Cucina · sistema visivo
   Strumento operativo: chiaro, sobrio, tutto a portata di pollice.
   Blu = azioni e selezione. Verde/ambra/rosso = solo stati. Crema = campo da compilare. */

:root {
  --bg: #F4F3EF;
  --surface: #FFFFFF;
  --surface-2: #FAF9F6;
  --line: #E4E1D9;
  --line-strong: #CFCAC0;
  --ink: #1B2430;
  --ink-2: #48525F;
  --ink-3: #6A7280;
  --primary: #1F3A5F;
  --primary-hover: #182E4C;
  --primary-soft: #E8EEF6;
  --primary-line: #B9C8DC;
  --ok: #1D7347;
  --ok-soft: #E3F1E8;
  --warn: #9A4D00;
  --warn-soft: #FCF0E0;
  --danger: #B0281C;
  --danger-soft: #FBE7E4;
  --field: #FFFCEF;
  --field-line: #DCD1AA;
  --focus: #2F6FBF;
  --radius: 12px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(27, 36, 48, .06), 0 6px 16px -8px rgba(27, 36, 48, .12);
  --shadow-up: 0 -1px 0 var(--line), 0 -8px 24px -16px rgba(27, 36, 48, .25);
  --nav-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.5 var(--font); color: var(--ink); background: var(--bg); font-variant-numeric: tabular-nums; }
::selection { background: #CFE0F5; color: var(--ink); }
a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.s { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- impaginazione */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--primary); color: #fff; padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; display: flex; align-items: center; gap: 12px; min-height: 56px; }
.topbar .indietro { color: #fff; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: -8px; border-radius: 10px; text-decoration: none; }
.topbar .indietro:hover { background: rgba(255, 255, 255, .12); }
.topbar .titolo { flex: 1; min-width: 0; }
.topbar .titolo strong { display: block; font-size: 1.0625rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .titolo span { display: block; font-size: .8125rem; color: #C9D6E8; }
.topbar .profilo { font-size: .8125rem; color: #C9D6E8; white-space: nowrap; }

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom, 0px)); }
main.largo { max-width: 1180px; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); box-shadow: var(--shadow-up); display: flex; padding-bottom: env(safe-area-inset-bottom, 0px); }
.nav a { flex: 1; min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); text-decoration: none; font-size: .75rem; font-weight: 600; letter-spacing: .01em; }
.nav a .ico { width: 24px; height: 24px; }
.nav a[aria-current="page"] { color: var(--primary); }
.nav a[aria-current="page"] .ico { stroke-width: 2.2; }
.nav .solo-largo { display: none; }
.nav .marchio { display: none; }

@media (min-width: 900px) {
  .app { padding-left: 232px; }
  .nav { top: 0; right: auto; width: 232px; flex-direction: column; padding: 16px 12px; gap: 2px; box-shadow: 1px 0 0 var(--line); background: var(--surface-2); }
  .nav .marchio { display: block; font-weight: 700; color: var(--primary); padding: 6px 12px 18px; font-size: .9375rem; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: .9375rem; font-weight: 500; color: var(--ink-2); }
  .nav a:hover { background: var(--primary-soft); color: var(--primary); }
  .nav a[aria-current="page"] { background: var(--primary-soft); font-weight: 600; }
  .nav .solo-largo { display: flex; }
  .nav .solo-stretto { display: none; }
  .nav .esci { margin-top: auto; }
  main { padding-bottom: 48px; }
  .topbar { padding-left: 24px; }
}

/* ---------------------------------------------------------------- tipografia e blocchi */
h1 { font-size: 1.375rem; line-height: 1.25; margin: 4px 0 4px; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 1.0625rem; line-height: 1.3; margin: 0 0 12px; color: var(--ink); }
h3 { font-size: .9375rem; margin: 20px 0 8px; color: var(--ink-2); }
p { margin: 0 0 12px; }
.sotto { color: var(--ink-2); margin: 0 0 16px; font-size: .9375rem; }
.piccolo { color: var(--ink-3); font-size: .8125rem; margin: 8px 0 0; }
.num, td.num { text-align: right; }

.card, .scheda { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; box-shadow: var(--shadow); }
.card > :last-child, .scheda > :last-child { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.sezione { margin: 28px 0 10px; font-size: .8125rem; font-weight: 700; color: var(--ink-3); letter-spacing: .02em; }
.stretta { max-width: 420px; margin: 40px auto; }

/* ---------------------------------------------------------------- avvisi */
.alert, .avviso, .errore { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-s); margin: 0 0 16px; font-size: .9375rem; border: 1px solid transparent; }
.alert .ico { margin-top: 1px; }
.alert.ok, .avviso { background: var(--ok-soft); color: #154F31; border-color: #BFDCCB; }
.alert.warn { background: var(--warn-soft); color: #6E3800; border-color: #EBCFA6; }
.alert.danger, .errore { background: var(--danger-soft); color: #8A1F15; border-color: #F0C2BC; font-weight: 600; }
.alert.info { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-line); }
.evidenza-testo { color: var(--warn); font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 50; transform: translate(-50%, 0); width: max-content; max-width: min(92vw, 520px); display: flex; gap: 10px; align-items: center; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .25); font-size: .9375rem; transition: opacity .2s ease-out, transform .2s ease-out; }
.toast .ico { color: #8FD3A8; }
.toast.via { opacity: 0; transform: translate(-50%, 8px); }
@media (min-width: 900px) { .toast { bottom: 24px; left: calc(50% + 116px); } }
.coda { position: sticky; top: 56px; z-index: 15; background: var(--warn-soft); color: var(--warn); padding: 8px 16px; text-align: center; font-weight: 600; font-size: .875rem; border-bottom: 1px solid #EBCFA6; }

/* ---------------------------------------------------------------- chip di stato */
.chip, .badge, .etichetta { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: #BFDCCB; }
.chip.warn, .etichetta { background: var(--warn-soft); color: var(--warn); border-color: #EBCFA6; }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: #F0C2BC; }
.chip.info { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-line); }

/* ---------------------------------------------------------------- elenchi toccabili */
.lista, .piatti { list-style: none; margin: 0; padding: 0; }
.lista > li + li, .piatti > li + li { margin-top: 8px; }
.voce, .piatto { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 2px 12px; min-height: 64px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: border-color .15s ease-out, background-color .15s ease-out; }
a.voce:hover, a.piatto:hover { border-color: var(--primary-line); background: #FCFDFF; text-decoration: none; }
a.voce:active, a.piatto:active { background: var(--primary-soft); }
.voce .ico-box { grid-row: span 2; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.voce .ico-box.ok { background: var(--ok-soft); color: var(--ok); }
.voce .ico-box.warn { background: var(--warn-soft); color: var(--warn); }
.voce .ico-box.danger { background: var(--danger-soft); color: var(--danger); }
.voce .t { grid-column: 2; font-weight: 600; line-height: 1.3; }
.voce .d { grid-column: 2; font-size: .8125rem; color: var(--ink-2); line-height: 1.35; }
.voce .fine { grid-column: 3; grid-row: 1 / span 2; }
.voce .vai { grid-column: 4; grid-row: 1 / span 2; color: var(--ink-3); }
.voce button.fine { min-height: 40px; }
.voce.senza-icona { grid-template-columns: 1fr auto auto; }
.voce.senza-icona .t, .voce.senza-icona .d { grid-column: 1; }
.voce.senza-icona .fine { grid-column: 2; }
.voce.senza-icona .vai { grid-column: 3; }
form.voce { margin: 0; }
.piatto { grid-template-columns: 1fr auto; }
.piatto .ruolo { grid-column: 1; font-size: .75rem; color: var(--ink-3); font-weight: 600; }
.piatto .nome { grid-column: 1; font-weight: 600; }
.piatto .badge, .piatto .badge-pulsante { grid-column: 2; grid-row: 1 / span 2; }
.stato-fatto { border-color: #BFDCCB; }
.stato-fatto .badge { background: var(--ok-soft); color: var(--ok); border-color: #BFDCCB; }
.stato-iniziato .badge { background: var(--warn-soft); color: var(--warn); border-color: #EBCFA6; }
.stato-confermato .badge { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-line); }

/* ---------------------------------------------------------------- pulsanti */
button, .btn, .pulsante-link { font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--surface); color: var(--primary); cursor: pointer; text-decoration: none; transition: background-color .15s ease-out, border-color .15s ease-out, transform .1s ease-out; }
button:hover, .btn:hover, .pulsante-link:hover { border-color: var(--primary-line); background: #FBFCFE; text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
button.primario, .btn.primario, .pulsante-link { background: var(--primary); color: #fff; border-color: var(--primary); }
button.primario:hover, .btn.primario:hover, .pulsante-link:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.pulsante-link.chiaro, .btn.chiaro { background: var(--surface); color: var(--primary); border-color: var(--line-strong); }
button.pericolo, .btn.pericolo { color: var(--danger); border-color: #F0C2BC; }
button.pericolo:hover { background: var(--danger-soft); }
button.largo, .btn.largo { width: 100%; min-height: 54px; font-size: 1.0625rem; }
button.piccolo, .btn.piccolo { min-height: 36px; padding: 0 12px; font-size: .875rem; }
button.scelto { background: var(--primary-soft); border-color: var(--primary); }
button.scelto-nc { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.badge-pulsante { min-height: 40px; }
button[aria-busy="true"] { position: relative; color: transparent !important; }
button[aria-busy="true"]::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.pulsanti { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.pulsanti > * { flex: 1 1 140px; }
.azioni { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); z-index: 10; margin: 16px -16px 0; padding: 12px 16px; background: rgba(244, 243, 239, .95); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); border-top: 1px solid var(--line); display: flex; gap: 8px; }
.azioni > * { flex: 1; }
.azioni .principale { flex: 2; }
@media (min-width: 900px) { .azioni { bottom: 12px; margin: 16px 0 0; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); } }

/* ---------------------------------------------------------------- campi */
label { display: block; margin: 0 0 12px; font-size: .875rem; font-weight: 600; color: var(--ink-2); }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); width: 100%; min-height: 48px; padding: 10px 12px; margin-top: 6px; border: 1px solid var(--field-line); border-radius: var(--radius-s); background: var(--field); transition: border-color .15s ease-out, box-shadow .15s ease-out; }
select { background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236A7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; border-color: var(--line-strong); appearance: none; -webkit-appearance: none; padding-right: 40px; }
input::placeholder, textarea::placeholder { color: #80868F; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(47, 111, 191, .2); }
input[type="file"] { background: var(--surface); padding: 10px; border-style: dashed; border-color: var(--line-strong); }
input[readonly], textarea[readonly] { background: var(--surface-2); border-color: var(--line); }
input[inputmode="decimal"], input[inputmode="numeric"] { text-align: right; font-size: 1.0625rem; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
textarea { min-height: 120px; line-height: 1.45; }
.griglia, .griglia4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; align-items: end; }
.griglia2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.griglia4 button { margin: 0 0 12px; }
.tutta { grid-column: 1 / -1; }

.seg, .avanzi { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.seg legend, .avanzi legend { width: 100%; font-size: .875rem; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.pulsante { display: inline-flex; margin: 0; position: relative; }
.pulsante input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; min-height: 0; }
.pulsante span { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 76px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .9375rem; cursor: pointer; transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out; }
.pulsante input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.pulsante input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.spunta { display: inline-flex; align-items: center; gap: 10px; margin: 0; min-height: 44px; font-weight: 600; color: var(--ink); cursor: pointer; }
.spunta input { width: 24px; height: 24px; margin: 0; accent-color: var(--primary); }

.stepper { display: grid; grid-template-columns: 48px minmax(64px, 1fr) 48px; align-items: stretch; border: 1px solid var(--field-line); border-radius: var(--radius-s); background: var(--field); overflow: hidden; }
.stepper button { min-height: 48px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--primary); }
.stepper button:hover { background: var(--primary-soft); }
.stepper input { margin: 0; border: 0; border-left: 1px solid var(--field-line); border-right: 1px solid var(--field-line); border-radius: 0; background: transparent; text-align: center; font-weight: 600; min-width: 0; }
.stepper input:focus { box-shadow: inset 0 0 0 2px var(--focus); }

/* ---------------------------------------------------------------- righe di inserimento */
.ingr { display: grid; grid-template-columns: 1fr 180px; gap: 8px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ingr:last-of-type { border-bottom: 0; }
.ingr-nome { font-weight: 600; }
.ingr-nome input { font-weight: 400; margin: 0; }
.rif { display: block; font-weight: 400; font-size: .8125rem; color: var(--ink-3); margin-top: 2px; }
.ingr-peso { display: grid; grid-template-columns: 1fr 72px; gap: 6px; }
.ingr-peso input, .ingr-peso select { margin: 0; }
.ingr-peso.due { grid-template-columns: 1fr 1fr; }
.riga-ordine { display: grid; grid-template-columns: minmax(0, 1fr) 168px; gap: 8px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.riga-ordine:last-of-type { border-bottom: 0; }
.riga-ordine .motivo { grid-column: 1 / -1; margin: 0; min-height: 42px; background: var(--surface); border-color: var(--line); font-size: .9375rem; }
.riga-ordine .ingr-peso { grid-template-columns: 1fr auto; align-items: center; }
.udo { font-size: .8125rem; color: var(--ink-3); min-width: 34px; }

.consegna-riga { padding: 14px 0; border-bottom: 1px solid var(--line); transition: background-color .15s ease-out; }
.consegna-riga:last-of-type { border-bottom: 0; }
.consegna-riga .testa { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.consegna-riga .nome { font-weight: 600; }
.consegna-riga .ordinato { font-size: .8125rem; color: var(--ink-3); white-space: nowrap; }
.consegna-riga .corpo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; margin-top: 10px; }
.consegna-riga .rapidi { display: flex; gap: 6px; }
.consegna-riga .nota { margin: 8px 0 0; min-height: 42px; background: var(--surface); border-color: var(--line); font-size: .9375rem; }
.consegna-riga.diversa { background: var(--warn-soft); margin: 0 -16px; padding: 14px 16px; }
.consegna-riga.nc { background: var(--danger-soft); margin: 0 -16px; padding: 14px 16px; }
.letto { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--ok); font-weight: 600; margin-top: 4px; }
@media (max-width: 420px) { .consegna-riga .corpo { grid-template-columns: 1fr; } .consegna-riga .rapidi > * { flex: 1; } }

.riga-ddt { padding: 14px 0; border-bottom: 1px solid var(--line); }
.riga-ddt label { margin: 6px 0; }
.riga-ddt.dubbia { background: var(--warn-soft); margin: 0 -16px; padding: 14px 16px; }
.letta { font-size: .8125rem; color: var(--ink-2); }
.tre { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.anteprima { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-s); margin-top: 12px; }
.foto-ddt { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; }
.foto-ddt img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.carica { position: relative; display: grid; place-items: center; text-align: center; gap: 4px; padding: 20px 16px; margin: 0; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2); cursor: pointer; font-weight: 400; transition: border-color .15s ease-out, background-color .15s ease-out; }
.carica:hover { border-color: var(--primary-line); background: #FCFDFF; }
.carica strong { color: var(--primary); font-size: 1rem; }
.carica .ico { width: 32px; height: 32px; color: var(--primary); }
.carica input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.carica:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.carica .scelto-file { font-size: .8125rem; color: var(--ok); font-weight: 600; }

/* ---------------------------------------------------------------- giorno (cucina) */
.giorno { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; margin-bottom: 16px; }
.giorno > div { text-align: center; }
.giorno h1 { margin: 0; font-size: 1.25rem; }
.giorno .sotto { margin: 2px 0 0; font-size: .875rem; }
.freccia { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--primary); text-decoration: none; }
.freccia:hover { border-color: var(--primary-line); }

.saluto { margin-bottom: 20px; }
.saluto h1 { margin-bottom: 2px; }
.vuoto { text-align: center; padding: 24px 16px; color: var(--ink-2); }
.vuoto .ico { width: 36px; height: 36px; color: var(--ok); margin-bottom: 6px; }
.vuoto strong { display: block; color: var(--ink); font-size: 1.0625rem; margin-bottom: 4px; }

/* ---------------------------------------------------------------- tabelle */
.tabella, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: .875rem; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .75rem; font-weight: 700; color: var(--ink-3); letter-spacing: .02em; background: var(--surface-2); }
tbody tr:hover td { background: #FBFAF7; }
td.evidenza { color: var(--warn); font-weight: 700; }
tr.totale td { font-weight: 700; border-top: 2px solid var(--ink); }
.tabella.larga table { font-size: .8125rem; }
table.spese td, table.spese th { white-space: nowrap; }
table.spese th:first-child, table.spese td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.spese tr.gruppo td { background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: .75rem; letter-spacing: .02em; }
table.spese tr.sub td { font-weight: 700; background: var(--surface-2); }
table.spese .storico { color: var(--ink-2); }
table.spese .ddt { display: block; font-size: .7rem; color: var(--ink-3); }
table.spese .nota { display: block; font-size: .7rem; color: var(--warn); max-width: 110px; overflow: hidden; text-overflow: ellipsis; }

details.card summary, details.scheda summary { cursor: pointer; color: var(--primary); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.fornitore { padding: 12px 0; border-bottom: 1px solid var(--line); }
.giorni { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.giorni .pulsante span { min-width: 52px; padding: 0 10px; min-height: 40px; }
.riga { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; align-items: center; margin: 8px 0; }
.riga input { margin: 0; }

@media (max-width: 520px) {
  .ingr { grid-template-columns: 1fr; }
  .riga-ordine { grid-template-columns: minmax(0, 1fr) 148px; }
  .stepper { grid-template-columns: 42px minmax(0, 1fr) 42px; }
  .riga { grid-template-columns: 1fr; }
  .griglia2 { grid-template-columns: 1fr; }
  h1 { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.divisore { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.spazio-sopra { margin-top: 20px; }
.spazio-sopra-s { margin-top: 12px; }

/* tabelle che sul telefono diventano schede */
@media (max-width: 640px) {
  table.schede, table.schede tbody, table.schede tr, table.schede td { display: block; width: 100%; }
  table.schede thead { display: none; }
  table.schede tr { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
  table.schede td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.schede td::before { content: attr(data-etichetta); color: var(--ink-3); font-size: .8125rem; font-weight: 600; text-align: left; flex: none; }
  table.schede td.intera { display: block; text-align: left; font-weight: 600; }
  table.schede td.intera::before { content: none; }
  table.schede td select { margin: 0; max-width: 62%; }
  table.schede tbody tr:hover td { background: transparent; }
  .tabella:has(table.schede) { margin: 0; padding: 0; overflow: visible; }
}

/* pulsante Segnala nella barra in alto */
.topbar .segnala { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; text-decoration: none; font-size: .875rem; font-weight: 600; }
.topbar .segnala:hover { background: rgba(255, 255, 255, .24); }
.topbar .segnala .ico { width: 20px; height: 20px; }
@media (max-width: 420px) { .topbar .profilo { display: none; } }
.card ol, .card ul:not(.lista) { margin: 0; padding-left: 22px; }
.card ol li, .card ul:not(.lista) li { margin-bottom: 8px; }
