/* =====================================================================
   RACE — Design system "Vetro"
   Vale solo per le pagine dello staff (tutto cio' che sta dentro .app-shell).
   Menu cliente, stato ordine e login mantengono ancora lo stile precedente.
   Due modalita': Cielo (chiaro) e Notte (scuro), scelte in html[data-theme].
   Regola: usare SOLO le variabili qui sotto, mai colori scritti a mano.
   ===================================================================== */

.app-shell, .auth-vetro {
  --font: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;

  /* Cielo */
  --bg: #F2F2F4;
  --surface: #FFFFFF;
  --surface-2: #F7F7F9;
  --surface-3: #EDEDF0;
  --ink: #141416;
  --muted: #6B6B73;
  --line: #E9E9ED;
  --field: #FFFFFF;
  --field-line: #DCDCE2;
  --nav-active: #E6E6EB;
  --side-bg: rgba(255, 255, 255, .62);
  --side-line: #E4E4E9;
  --accent: #141416;
  --accent-ink: #FFFFFF;
  --focus: rgba(20, 20, 22, .14);
  --shadow-card: 0 1px 2px rgba(20, 20, 22, .04), 0 10px 28px -14px rgba(20, 20, 22, .16);
  --shadow-btn: 0 0 0 1px rgba(20, 20, 22, .08);
  --st-new: #A9A9B2;     --st-new-bg: #F0F0F3;
  --st-prep: #C27C12;    --st-prep-bg: #FFF4E2;
  --st-ready: #218A4E;   --st-ready-bg: #E6F5EC;
  --st-served: #8E8E96;  --st-served-bg: #F0F0F3;
  --st-attn: #C4561C;    --st-attn-bg: #FFF0E6;
  --st-danger: #C23A30;  --st-danger-bg: #FDECEA;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;

  /* ponte con le variabili del vecchio foglio di stile */
  --paper: var(--bg);
  --brand: var(--accent);
  --brand-dark: var(--ink);
  --success: var(--st-ready);
  --warning: var(--st-prep);
  --danger: var(--st-danger);
  --shadow: var(--shadow-card);
  --radius: var(--r-lg);
  --radius-sm: var(--r-md);
}

html[data-theme="dark"]:has(.app-shell), html[data-theme="dark"]:has(.auth-vetro) { color-scheme: dark; }
html[data-theme="dark"] .app-shell .button-secondary, html[data-theme="dark"] .app-shell .icon-action, html[data-theme="dark"] .app-shell .station-tabs a:not(.active) { background: var(--surface-2); }
html[data-theme="dark"] .app-shell .card .button-secondary, html[data-theme="dark"] .app-shell .table-card .button-secondary, html[data-theme="dark"] .app-shell .request-alert .icon-action { background: var(--surface-3); }
html[data-theme="dark"] .app-shell, html[data-theme="dark"] .auth-vetro {
  /* Notte */
  --bg: #0E0E10;
  --surface: #1B1B1E;
  --surface-2: #202024;
  --surface-3: #2A2A2F;
  --ink: #F4F4F6;
  --muted: #9A9AA3;
  --line: #2A2A2F;
  --field: #141417;
  --field-line: #34343A;
  --nav-active: #232327;
  --side-bg: rgba(22, 22, 25, .78);
  --side-line: #232327;
  --accent: #F4F4F6;
  --accent-ink: #0E0E10;
  --focus: rgba(244, 244, 246, .18);
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, .04), 0 1px 2px rgba(0, 0, 0, .5), 0 14px 32px -16px rgba(0, 0, 0, .9);
  --shadow-btn: none;
  --st-new: #6A6A72;     --st-new-bg: #26262A;
  --st-prep: #F0AE45;    --st-prep-bg: #33291A;
  --st-ready: #4CC27A;   --st-ready-bg: #17291E;
  --st-served: #77777F;  --st-served-bg: #232327;
  --st-attn: #F08A52;    --st-attn-bg: #34231A;
  --st-danger: #F0766B;  --st-danger-bg: #36201E;
}

/* ---------- Base ---------- */
body:has(.app-shell) { background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
.app-shell { display: flex; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--font); }
.app-shell h1, .app-shell h2, .app-shell h3 { font-family: var(--font-display); color: var(--ink); }
.app-shell h1 { font-size: clamp(2rem, 3vw, 2.6rem); font-weight: 650; letter-spacing: -.025em; line-height: 1.08; }
.app-shell h2 { font-size: 1.45rem; font-weight: 650; letter-spacing: -.015em; }
.app-shell h3 { font-weight: 600; }
.app-shell .eyebrow { color: var(--muted); font-size: .8rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.app-shell .muted, .app-shell small { color: var(--muted); }
.app-shell code { background: var(--surface-2); color: var(--ink); }
.app-shell a { color: inherit; }

/* ---------- Barra laterale ---------- */
.sidebar { position: sticky; top: 0; flex: 0 0 248px; height: 100vh; box-sizing: border-box; display: flex; flex-direction: column; gap: 28px; padding: 28px 18px 20px; background: var(--side-bg); border-right: 1px solid var(--side-line); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 600; font-size: 15px; letter-spacing: .14em; }
.sidebar .brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--bg); font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); color: var(--muted); font-size: 14px; font-weight: 500; transition: background .15s ease, color .15s ease; }
.side-nav a svg { flex-shrink: 0; }
.side-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--nav-active) 60%, transparent); }
.side-nav a[aria-current="page"] { color: var(--ink); background: var(--nav-active); font-weight: 600; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.theme-switch { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 2px; padding: 3px; border-radius: 12px; background: var(--nav-active); }
.theme-switch button { display: flex; align-items: center; justify-content: center; gap: 5px; height: 32px; padding: 0 2px; white-space: nowrap; min-width: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 500; transition: background .15s ease, color .15s ease; }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--nav-active); }
.user-avatar { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 600; }
.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-meta strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 12px; color: var(--muted); }
.user-card form { margin: 0; }
.user-card .link-button { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.user-card .link-button:hover { color: var(--ink); }

/* ---------- Contenuto ---------- */
.app-shell .page-shell { flex: 1; min-width: 0; width: auto; max-width: 1440px; margin: 0; padding: 44px 48px 64px; }
.app-shell .page-heading { align-items: flex-end; margin-bottom: 32px; }
.app-shell .page-heading h1 { font-size: clamp(2rem, 3vw, 2.6rem); }
.app-shell .section-block { margin-top: 40px; }

/* Card e superfici */
.app-shell .card { background: var(--surface); border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 22px; }
.app-shell .metric-grid { gap: 14px; }
.app-shell .metric-card { align-content: start; gap: 10px; padding: 20px 22px; border: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.app-shell .metric-card span { color: var(--muted); font-size: 13px; font-weight: 500; }
.app-shell .metric-card strong { font-family: var(--font-display); font-size: 2rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.app-shell .metric-card small { color: var(--st-attn); }

/* Tavoli */
.app-shell .table-grid { gap: 16px; align-items: start; }
.app-shell .table-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; border: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.app-shell .table-card.needs-attention { border: 0; box-shadow: 0 0 0 1px color-mix(in srgb, var(--st-attn) 55%, transparent); }
.app-shell .table-card-head > div { display: flex; flex-direction: column; gap: 8px; }
.app-shell .table-label { display: block; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: none; line-height: 1; }
.app-shell .table-card h3 { font-size: 2.1rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.app-shell .table-meta { margin: 0; gap: 6px 18px; color: var(--muted); font-size: 13px; }
.app-shell .service-portions { display: flex; flex-direction: column; gap: 0; margin: 0; }
.app-shell .service-portions > .button { align-self: flex-start; margin-bottom: 8px; }
.app-shell .service-portions .status-item { padding: 10px 0; border-bottom: 0; border-top: 1px solid var(--line); }
.app-shell .assignment-row { padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.app-shell .assignment-row { flex-wrap: wrap; }
.app-shell .assignment-row .link-button { white-space: nowrap; }
.app-shell .assignment-row strong { color: var(--ink); font-weight: 500; }
.app-shell .warning-text { color: var(--st-attn); font-weight: 500; }
.app-shell .request-stack { margin: 0; gap: 8px; }
.app-shell .request-alert { padding: 12px 14px; border-radius: var(--r-md); background: var(--st-attn-bg); }
.app-shell .request-alert strong { color: var(--st-attn); font-weight: 600; white-space: nowrap; }
.app-shell .manual-payment-form { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.app-shell .manual-payment-form .form-caption { grid-column: 1 / -1; margin: 0 0 2px; color: var(--muted); font-size: 13px; font-weight: 500; }
.app-shell .manual-payment-form input, .app-shell .manual-payment-form select { min-height: 40px; font-size: 14px; }
.app-shell .manual-payment-form input { grid-column: 1 / -1; }
.app-shell .empty-state { border: 1.5px dashed var(--line); border-radius: var(--r-lg); color: var(--muted); background: transparent; }
.app-shell .form-hint { color: var(--muted); }

/* Stati */
.app-shell .status-pill { min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--st-new-bg); color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.app-shell .status-pill:first-letter { text-transform: uppercase; }
.app-shell .status-success, .app-shell .status-served, .app-shell .status-paid { background: var(--st-ready-bg); color: var(--st-ready); }
.app-shell .status-danger, .app-shell .status-cancelled, .app-shell .status-failed { background: var(--st-danger-bg); color: var(--st-danger); }
.app-shell .status-ready { background: var(--st-ready-bg); color: var(--st-ready); }
.app-shell .status-in_preparation { background: var(--st-prep-bg); color: var(--st-prep); }
.app-shell .status-new, .app-shell .status-received { background: var(--st-new-bg); color: var(--muted); }

/* Bottoni e campi */
.app-shell .button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; font-size: 14px; font-weight: 600; transition: transform .15s ease, opacity .15s ease, background .15s ease; }
.app-shell .button:hover { transform: none; opacity: .88; }
.app-shell .button:active { transform: scale(.98); }
.app-shell .button-primary { background: var(--accent); color: var(--accent-ink); }
.app-shell .button-primary:hover { background: var(--accent); }
.app-shell .button-secondary { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-btn); }
.app-shell .service-portions .button, .app-shell .status-item .button { min-height: 34px; padding: 0 14px; font-size: 12.5px; }
.app-shell .link-button { color: var(--ink); font-weight: 600; }
.app-shell .icon-action { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-btn); }
.app-shell .icon-button { background: var(--surface-2); color: var(--ink); }
.app-shell label { color: var(--muted); font-size: 13px; font-weight: 500; }
.app-shell input, .app-shell textarea, .app-shell select { border: 1px solid var(--field-line); border-radius: var(--r-sm); background: var(--field); color: var(--ink); }
.app-shell input:focus, .app-shell textarea:focus, .app-shell select:focus { outline: 3px solid var(--focus); border-color: var(--ink); }
.app-shell .alert { background: var(--surface-2); color: var(--ink); }
.app-shell .alert-danger { background: var(--st-danger-bg); color: var(--st-danger); }
.app-shell .success-panel { background: var(--st-ready-bg); color: var(--st-ready); }

/* Tabelle */
.app-shell .table-wrap { overflow: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.app-shell th, .app-shell td { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.app-shell th { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .02em; text-transform: none; }
.app-shell td { font-variant-numeric: tabular-nums; }

/* KDS */
body.kds-page:has(.app-shell) { background: var(--bg); }
.app-shell .station-tabs { gap: 6px; }
.app-shell .station-tabs a { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13.5px; font-weight: 500; box-shadow: none; }
.app-shell .station-tabs a:hover { color: var(--ink); }
.app-shell .station-tabs a.active { background: var(--accent); color: var(--accent-ink); }
.app-shell .kds-ticket { border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.app-shell .kds-ticket header { background: var(--surface-2); color: var(--ink); border-bottom: 1px solid var(--line); }
.app-shell .kds-ticket header span { color: var(--muted); }
.app-shell .kds-item { border-bottom: 1px solid var(--line); }
.app-shell .kds-item em { color: var(--st-danger); }
.app-shell .kds-action { background: var(--surface-2); color: var(--ink); }

/* Mappa tavoli */
.app-shell .floor-summary { border-radius: var(--r-lg); background: var(--surface); color: var(--muted); box-shadow: var(--shadow-card); }
.app-shell .floor-summary strong { color: var(--st-ready); font-weight: 600; }
.app-shell .floor-toolbar #floorSync { color: var(--muted); }
.app-shell .floor-scroll { border: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.app-shell .floor-canvas { background-image: radial-gradient(var(--line) 1px, transparent 1px); }
.app-shell .floor-reference { color: var(--muted); letter-spacing: .02em; font-size: .75rem; }
.app-shell .map-table { border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); box-shadow: none; }
.app-shell .map-table.occupied { border-color: var(--st-prep); background: var(--st-prep-bg); }
.app-shell .map-table.grouped { border-color: var(--muted); border-style: dashed; background: var(--surface-2); }
.app-shell .map-table.selected { outline: 2px solid var(--ink); outline-offset: 4px; }
.app-shell .table-select { color: var(--ink); }
.app-shell .table-select small { color: var(--muted); }
.app-shell .table-drag { border-color: var(--field-line); background: var(--surface); }
.app-shell .floor-actions { border-top-color: var(--line); }
.app-shell .floor-activity small, .app-shell .seat-assignment small { color: var(--muted); }
.app-shell .seat-table { border-color: var(--field-line); background: var(--surface-2); color: var(--ink); }
.app-shell .seat-person { border-color: var(--field-line); background: var(--surface-2); color: var(--ink); }
.app-shell .seat-person.vacant { background: transparent; color: var(--muted); }
.app-shell .seat-person:focus { outline: 2px solid var(--ink); }
.app-shell .seat-assignment { border-bottom-color: var(--line); }
.app-shell #seatDishes { background: var(--surface-2); }
.app-shell .dish-review { border-bottom-color: var(--line); }


/* ---------- Ritmo verticale e rifiniture (proporzioni e distanze) ---------- */
.app-shell .page-shell > * + * { margin-top: 16px; }
.app-shell .page-shell > .page-heading + * { margin-top: 0; }
.app-shell .page-shell > .section-block { margin-top: 40px; }
.app-shell .card > :first-child { margin-top: 0; }
.app-shell .card > :last-child { margin-bottom: 0; }
.app-shell .card p { line-height: 1.5; }
.app-shell .card h2 { margin-bottom: 12px; }
.app-shell .card .table-wrap { background: transparent; border-radius: 0; box-shadow: none; margin: 0 -22px; }
.app-shell .card .table-wrap th:first-child, .app-shell .card .table-wrap td:first-child { padding-left: 22px; }
.app-shell .card .table-wrap th:last-child, .app-shell .card .table-wrap td:last-child { padding-right: 22px; }
.app-shell .card .station-tabs { margin-bottom: 12px; }
.app-shell .card .form-hint { margin: 0 0 12px; }

/* Menu a tendina: stesso linguaggio dei pulsanti */
.app-shell select { appearance: none; -webkit-appearance: none; min-height: 40px; padding: 0 36px 0 14px; border: 1px solid var(--field-line); border-radius: var(--r-sm); background-color: var(--field); background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; color: var(--ink); font-size: 14px; font-weight: 500; }

/* Comande */
.app-shell .kds-heading { margin-bottom: 20px; }
.app-shell .kds-heading + .card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px; }
.app-shell .kds-heading + .card > strong { font-size: 15px; font-weight: 600; }
.app-shell .kds-heading + .card > p { flex-basis: 100%; order: 2; margin: 0; color: var(--muted); font-size: 13px; }
.app-shell .kds-heading + .card > .button { order: 1; min-height: 36px; font-size: 13px; }
.app-shell .kds-grid { margin-top: 20px; gap: 16px; }
.app-shell .kds-ticket > p { margin: 12px 16px 0; font-size: 13px; color: var(--muted); }

/* Mappa tavoli */
.app-shell .floor-summary { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 14px 20px; font-size: 14px; }
.app-shell .floor-toolbar { align-items: flex-end; gap: 10px; }
.app-shell .floor-toolbar label { min-width: 200px; }
.app-shell .floor-toolbar #floorSync { align-self: center; font-size: 12px; }
.app-shell .floor-layout { gap: 16px; margin-top: 16px; }
.app-shell .floor-layout > section > .form-hint { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; }
.app-shell .floor-activity { margin-top: 16px; }
.app-shell .floor-activity ul { margin: 0; padding-left: 1.1rem; }
.app-shell .floor-activity li { margin: 0 0 10px; }
.app-shell .floor-reference { top: 14px; left: 18px; }
.app-shell .floor-detail h2 { margin-bottom: 6px; }


/* ---------- Avvisi ---------- */
.app-shell .notice { margin-bottom: 16px; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-card); color: var(--ink); font-size: 14px; }
.app-shell .notice-ok { background: var(--st-ready-bg); color: var(--st-ready); box-shadow: none; }
.app-shell .notice-error { background: var(--st-danger-bg); color: var(--st-danger); box-shadow: none; }

/* ---------- Moduli ---------- */
.app-shell .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin-top: 16px; }
.app-shell .form-grid.single { grid-template-columns: minmax(0, 1fr); }
.app-shell .form-grid label { gap: 6px; }
.app-shell .form-grid input { min-height: 42px; font-size: 14px; }
.app-shell .form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; }
.app-shell .optional { color: var(--muted); font-weight: 400; opacity: .8; }
.app-shell .inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.app-shell .inline-form input { flex: 1 1 240px; min-height: 42px; }
.app-shell .button-danger { background: var(--st-danger-bg); color: var(--st-danger); }
.app-shell input:disabled, .app-shell select:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Personale ---------- */
.app-shell .staff-list { padding: 6px; }
.app-shell .staff-row { display: grid; grid-template-columns: 40px minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1.4fr) 104px 16px; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-md); transition: background .15s ease; }
.app-shell .staff-row + .staff-row { border-top: 1px solid var(--line); border-radius: 0 0 var(--r-md) var(--r-md); }
.app-shell .staff-row:hover { background: var(--surface-2); border-radius: var(--r-md); }
.app-shell .staff-row.is-inactive { opacity: .55; }
.app-shell .staff-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-3); color: var(--ink); font-size: 13px; font-weight: 600; }
.app-shell .staff-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-shell .staff-name strong { font-size: 15px; font-weight: 600; }
.app-shell .staff-name small { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-shell .staff-role { font-size: 14px; color: var(--muted); }
.app-shell .staff-perms { display: flex; flex-wrap: wrap; gap: 6px; }
.app-shell .staff-chevron { color: var(--muted); }
.app-shell .staff-state { justify-self: end; }
.app-shell .staff-form { margin-top: 16px; }
.app-shell .staff-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.app-shell .staff-detail-grid .form-actions { justify-content: flex-start; }
.app-shell .page-heading .eyebrow a { color: var(--muted); }
.app-shell .page-heading .eyebrow a:hover { color: var(--ink); }

/* Interruttori dei permessi */
.app-shell .perm-list { display: flex; flex-direction: column; margin-top: 8px; }
.app-shell .perm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.app-shell .perm-row:first-child { border-top: 0; }
.app-shell .perm-text { display: flex; flex-direction: column; gap: 2px; }
.app-shell .perm-text strong { color: var(--ink); font-size: 14px; font-weight: 600; }
.app-shell .perm-text small { font-size: 12.5px; font-weight: 400; }
.app-shell .perm-default { color: var(--st-attn); font-size: 12px; font-weight: 500; }
.app-shell .switch { appearance: none; -webkit-appearance: none; position: relative; width: 44px; min-height: 0; height: 26px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: var(--surface-3); cursor: pointer; transition: background .2s ease; }
.app-shell .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s ease; }
.app-shell .switch:checked { background: var(--st-ready); }
.app-shell .switch:checked::after { transform: translateX(18px); }
.app-shell .switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

@media (max-width: 1100px) {
  .app-shell .staff-detail-grid, .app-shell .form-grid { grid-template-columns: minmax(0, 1fr); }
  .app-shell .staff-row { grid-template-columns: 40px minmax(0, 1fr) auto 16px; }
  .app-shell .staff-role, .app-shell .staff-perms { display: none; }
}


/* ---------- Reparti e stampanti ---------- */
.app-shell .station-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.app-shell .station-card { display: flex; flex-direction: column; gap: 16px; }
.app-shell .station-card.is-inactive { opacity: .6; }
.app-shell .station-new { border: 1.5px dashed var(--field-line); box-shadow: none; background: transparent; }
.app-shell .station-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.app-shell .station-head h2 { margin: 0 0 4px; font-size: 1.3rem; }
.app-shell .station-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; color: var(--muted); font-size: 13px; }
.app-shell .station-card .notice { margin: 0; font-size: 13px; }
.app-shell .station-form { display: flex; flex-direction: column; gap: 14px; }
.app-shell .station-form .form-actions { justify-content: flex-start; }
.app-shell .segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin: 0; padding: 3px; border: 0; border-radius: 12px; background: var(--surface-3); }
.app-shell .mode-field { display: flex; flex-direction: column; gap: 6px; }
.app-shell .field-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.app-shell .segmented label { display: block; position: relative; cursor: pointer; }
.app-shell .segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.app-shell .segmented span { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 4px 6px; border-radius: 9px; color: var(--muted); font-size: 12.5px; font-weight: 500; text-align: center; line-height: 1.2; transition: background .15s ease, color .15s ease; }
.app-shell .segmented input:checked + span { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.app-shell .segmented input:focus-visible + span { outline: 3px solid var(--focus); }
.app-shell .printer-fields { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.app-shell .printer-fields[hidden], .app-shell .printer-address[hidden] { display: none; }
.app-shell .printer-connection { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.app-shell .radio-line { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; }
.app-shell .radio-line input { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.app-shell .printer-address { grid-template-columns: minmax(0, 1fr) 96px; margin-top: 0; }
.app-shell .printer-fields .form-hint { margin: 0; font-size: 12px; }
.app-shell .station-danger summary { color: var(--muted); font-size: 13px; cursor: pointer; }
.app-shell .station-danger[open] summary { margin-bottom: 10px; }
.app-shell .station-danger .grow { flex: 1 1 220px; }
.app-shell .section-heading-inline { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 8px; }
.app-shell .section-heading-inline h2, .app-shell .section-heading-inline .form-hint { margin: 0; }
.app-shell #prodotti .form-actions { margin-top: 16px; }
.app-shell #prodotti td select { max-width: 240px; }
.app-shell #computer-stampe { margin-top: 16px; }
.app-shell .agent-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.app-shell .agent-head .form-hint { max-width: 70ch; }
.app-shell .agent-seen { margin: 0 0 12px; font-size: 13px; }
.app-shell .code-box { display: flex; flex-direction: column; gap: 6px; }
.app-shell .code-box code { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: 14px; word-break: break-all; cursor: text; user-select: all; }
.app-shell .code-box span { color: var(--ink); font-size: 13px; }


/* ---------- Orologio, numeretti, schede ---------- */
.side-clock { display: flex; flex-direction: column; gap: 2px; margin-top: -12px; padding: 0 8px; }
.side-clock strong { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.side-clock span { color: var(--muted); font-size: 12.5px; }
.nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; border-radius: 999px; background: var(--st-danger); color: #FFFFFF; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nav-badge[hidden] { display: none; }
.app-shell .tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: -12px 0 20px; padding: 3px; width: fit-content; border-radius: 12px; background: var(--surface-3); }
.app-shell .tabs a { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 500; }
.app-shell .tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.app-shell .tab-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--st-danger); color: #FFFFFF; font-size: 11px; font-weight: 700; }
.app-shell .alert-card { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; padding: 14px 18px; border-radius: var(--r-lg); background: var(--st-attn-bg); color: var(--st-attn); font-size: 14px; }
.app-shell .alert-card span { color: var(--ink); font-size: 13px; }

/* ---------- Turni ---------- */
.app-shell .week-nav { display: flex; align-items: center; gap: 8px; }
.app-shell .week-title { min-width: 190px; text-align: center; font-weight: 600; font-size: 15px; }
.app-shell .button.icon-only { width: 40px; min-height: 40px; padding: 0; }
.app-shell .week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.app-shell .day-card { display: flex; flex-direction: column; gap: 10px; min-height: 220px; padding: 14px; }
.app-shell .day-card.is-today { box-shadow: 0 0 0 1.5px var(--ink), var(--shadow-card); }
.app-shell .day-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.app-shell .day-name { font-weight: 650; font-size: 15px; }
.app-shell .day-date { color: var(--muted); font-size: 13px; }
.app-shell .day-head .status-pill { margin-left: auto; min-height: 22px; font-size: 11px; }
.app-shell .day-summary { margin: 0; color: var(--muted); font-size: 12px; }
.app-shell .day-empty { margin: auto 0; color: var(--muted); font-size: 13px; text-align: center; }
.app-shell .shift-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.app-shell .shift-item { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); }
.app-shell .shift-item.is-mine { background: var(--st-ready-bg); }
.app-shell .shift-time { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.app-shell .shift-who { display: flex; flex-direction: column; min-width: 0; }
.app-shell .shift-who strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-shell .shift-who small { font-size: 11.5px; }
.app-shell .shift-item form { position: absolute; top: 4px; right: 4px; margin: 0; }
.app-shell .shift-remove { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); opacity: 0; transition: opacity .15s ease; }
.app-shell .shift-item:hover .shift-remove, .app-shell .shift-remove:focus-visible { opacity: 1; }
.app-shell .shift-remove:hover { background: var(--st-danger-bg); color: var(--st-danger); }
.app-shell .shift-tools { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.app-shell .span-2 { grid-column: span 2; }
.app-shell .hours-list { display: flex; flex-direction: column; margin: 0 0 16px; padding: 0; list-style: none; }
.app-shell .hours-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.app-shell .hours-list li:first-child { border-top: 0; }
.app-shell .hours-list strong { font-variant-numeric: tabular-nums; }

/* ---------- Magazzino ---------- */
.app-shell .inventory-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.app-shell .inventory-forms .span-all { grid-column: 1 / -1; }
.app-shell .form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.app-shell .form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.app-shell .check-line { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; font-weight: 500; }
.app-shell .check-line input { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.app-shell td small { display: block; margin-top: 2px; font-size: 12px; }
.app-shell td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-shell td.neg { color: var(--st-danger); }
.app-shell td.pos { color: var(--st-ready); }
.app-shell .stock-table tr.is-low td:first-child strong { color: var(--st-danger); }
.app-shell .row-action { text-align: right; }
.app-shell .row-action a { color: var(--ink); font-weight: 600; font-size: 13px; }
.app-shell .haccp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.app-shell .haccp-device { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); }
.app-shell .haccp-device.is-missing { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--st-attn) 60%, transparent); }
.app-shell .haccp-device.is-bad { box-shadow: inset 0 0 0 1.5px var(--st-danger); }
.app-shell .haccp-device header { display: flex; flex-direction: column; gap: 2px; }
.app-shell .haccp-device header small { font-size: 12px; }
.app-shell .haccp-last { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); }
.app-shell .haccp-temp { color: var(--ink); font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.app-shell .haccp-form { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px; }
.app-shell .haccp-form input { min-height: 40px; font-size: 14px; }
.app-shell .haccp-form .button { grid-column: 1 / -1; min-height: 38px; }
.app-shell .haccp-remove { margin: 0; }
.app-shell .haccp-remove .link-button { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.app-shell .balance-day { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 16px; }
.app-shell .balance-day label { min-width: 200px; }
.app-shell .balance-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.app-shell .metric-card.is-highlight { background: var(--accent); }
.app-shell .metric-card.is-highlight span, .app-shell .metric-card.is-highlight strong, .app-shell .metric-card.is-highlight small { color: var(--accent-ink); }

@media (max-width: 1200px) {
  .app-shell .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell .shift-tools, .app-shell .inventory-forms { grid-template-columns: minmax(0, 1fr); }
  .app-shell .form-grid.cols-3, .app-shell .form-grid.cols-4, .app-shell .balance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* ---------- Accesso ---------- */
body:has(.auth-vetro) { margin: 0; background: var(--bg, #F2F2F4); }
html[data-theme="dark"] body:has(.auth-vetro) { background: #0E0E10; }
.auth-vetro { display: flex; flex-direction: column; min-height: 100vh; box-sizing: border-box; padding: 24px 32px; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
.auth-vetro .auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-vetro .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: .14em; }
.auth-vetro .brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--bg); font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: 0; }
.auth-vetro .theme-switch { width: 260px; }
.auth-vetro .auth-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 48px 0; }
.auth-vetro .auth-intro { text-align: center; }
.auth-vetro .auth-intro h1 { margin: 0 0 8px; font-family: var(--font-display); font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 650; letter-spacing: -.03em; line-height: 1.05; color: var(--ink); }
.auth-vetro .auth-intro p { margin: 0; color: var(--muted); font-size: 16px; }
.auth-vetro .auth-box { width: min(400px, 100%); box-sizing: border-box; padding: 28px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-card); }
.auth-vetro .auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-vetro label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }
.auth-vetro input { box-sizing: border-box; width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--field-line); border-radius: 12px; background: var(--field); color: var(--ink); font: inherit; font-size: 15px; }
.auth-vetro input::placeholder { color: var(--muted); opacity: .7; }
.auth-vetro input:focus { outline: 3px solid var(--focus); border-color: var(--ink); }
.auth-vetro .password-field { position: relative; display: block; }
.auth-vetro .password-field input { padding-right: 88px; }
.auth-vetro .password-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.auth-vetro .button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 4px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity .15s ease, transform .15s ease; }
.auth-vetro .button:hover { opacity: .88; }
.auth-vetro .button:active { transform: scale(.98); }
.auth-vetro .button-block { width: 100%; }
.auth-vetro .notice { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.auth-vetro .notice-error { background: var(--st-danger-bg); color: var(--st-danger); }
.auth-vetro .auth-help { margin: 18px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.auth-vetro .auth-demo { width: min(400px, 100%); color: var(--muted); font-size: 13px; text-align: center; }
.auth-vetro .auth-demo summary { cursor: pointer; list-style: none; }
.auth-vetro .auth-demo summary::-webkit-details-marker { display: none; }
.auth-vetro .auth-demo summary::after { content: " ›"; }
.auth-vetro .auth-demo[open] summary::after { content: " ⌄"; }
.auth-vetro .auth-demo p { margin: 10px 0 0; line-height: 1.8; }
.auth-vetro code { padding: 2px 6px; border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 12.5px; }
.auth-vetro .auth-foot { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }
@media (max-width: 560px) {
  .auth-vetro { padding: 16px; }
  .auth-vetro .theme-switch { width: auto; }
  .auth-vetro .theme-switch button span { display: none; }
  .auth-vetro .auth-box { padding: 22px; }
}

/* ---------- Schermi piccoli: barra laterale diventa barra in alto ---------- */
@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar { position: sticky; z-index: 20; flex: none; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--side-line); }
  .side-nav { flex-direction: row; order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .side-nav a { height: 36px; white-space: nowrap; }
  .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .theme-switch button span { display: none; }
  .user-meta { display: none; }
  .app-shell .page-shell { padding: 24px 16px 48px; }
}

/* ---------- Scarti segnalati dal personale ---------- */
.app-shell .staff-waste-box { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 14px 18px; align-items: end; padding: 16px; border-radius: 16px; background: var(--surface-2); }
.app-shell .switch-line { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
.app-shell .switch-line span { display: grid; gap: 3px; }
.app-shell .switch-line strong { color: var(--ink); font-size: 14px; font-weight: 600; }
.app-shell .switch-line small { color: var(--muted); font-size: 12.5px; font-weight: 400; line-height: 1.4; }
.app-shell .form-grid .switch { min-height: 0; height: 26px; width: 44px; flex: none; }
.app-shell .waste-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.app-shell .waste-tile { position: relative; display: grid; gap: 4px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1.5px solid transparent; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.app-shell .waste-tile input { position: absolute; opacity: 0; pointer-events: none; }
.app-shell .waste-tile strong { color: var(--ink); font-size: 15px; font-weight: 600; }
.app-shell .waste-tile small { color: var(--muted); font-size: 12.5px; }
.app-shell .waste-tile:has(input:checked) { border-color: var(--ink); background: var(--surface); box-shadow: var(--shadow-card); }
.app-shell .waste-tile:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.app-shell .segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.app-shell .segmented label { display: inline-flex; flex-direction: row; align-items: center; padding: 9px 14px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; border: 1.5px solid transparent; }
.app-shell .segmented input { position: absolute; opacity: 0; pointer-events: none; }
.app-shell .segmented label:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.app-shell .segmented label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.app-shell .waste-step { margin-top: 22px; }
.app-shell .waste-step > h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
@media (max-width: 720px) { .app-shell .staff-waste-box { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Turni: colori, calendario del mese, pannello nuovo turno ---------- */
.app-shell .tone-blue { --tone: #2F7BF5; } .app-shell .tone-orange { --tone: #E8812B; } .app-shell .tone-green { --tone: #2E9D5B; }
.app-shell .tone-purple { --tone: #8A5CF0; } .app-shell .tone-pink { --tone: #E0558F; } .app-shell .tone-teal { --tone: #1F9FA6; }
.app-shell .tone-red { --tone: #E0503F; } .app-shell .tone-yellow { --tone: #C99A17; } .app-shell .tone-gray { --tone: #8E8E96; }
.app-shell .avatar { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--tone, #8E8E96) 18%, var(--surface)); color: var(--tone, var(--ink)); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }

.app-shell .day-card { gap: 8px; }
.app-shell .shift-item { flex-direction: row; align-items: center; gap: 9px; padding: 8px 9px 8px 8px; border-left: 3px solid var(--tone, var(--line)); border-radius: 6px var(--r-sm) var(--r-sm) 6px; }
.app-shell .shift-item .avatar { width: 28px; height: 28px; font-size: 11px; }
.app-shell .shift-who small { line-height: 1.35; }
.app-shell .shift-item .shift-time { font-size: 11.5px; }
.app-shell .day-add { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: auto; height: 34px; border: 1.5px dashed var(--line); border-radius: var(--r-sm); background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; opacity: .75; transition: opacity .15s ease, color .15s ease, border-color .15s ease, background .15s ease; }
.app-shell .day-card:hover .day-add, .app-shell .day-add:focus-visible { opacity: 1; }
.app-shell .day-add:hover { color: var(--ink); border-color: var(--muted); background: var(--surface-2); }
.app-shell .day-empty { margin: auto 0 0; }
.app-shell .page-heading .week-nav .button-primary { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }

.app-shell .shift-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.app-shell .hours-bars { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 18px; padding: 0; list-style: none; }
.app-shell .hours-bars li { display: grid; grid-template-columns: 30px minmax(90px, 1fr) minmax(60px, 1.2fr) auto; align-items: center; gap: 12px; font-size: 14px; }
.app-shell .hours-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-shell .hours-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.app-shell .hours-bar i { display: block; height: 100%; border-radius: inherit; background: var(--tone); }
.app-shell .hours-bars strong { font-variant-numeric: tabular-nums; font-size: 13.5px; }

.app-shell .round-button { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink); cursor: pointer; transition: background .15s ease; }
.app-shell .round-button:hover { background: var(--surface-3); }
.app-shell .round-button:focus-visible, .app-shell .mini-day:focus-visible, .app-shell .month-open:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.app-shell .month-head, .app-shell .month-full-head, .app-shell .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-shell .month-nav { display: flex; gap: 6px; }
.app-shell .mini-month { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.app-shell .mini-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; padding: 2px; border-radius: 12px; }
.app-shell .mini-row.is-selected { background: var(--surface-2); }
.app-shell .mini-names span { padding-bottom: 4px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-align: center; }
.app-shell .mini-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 40px; border-radius: 10px; color: var(--ink); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; text-decoration: none; transition: background .15s ease; }
.app-shell .mini-day:hover { background: var(--surface-3); }
.app-shell .mini-day.is-out { color: var(--muted); opacity: .45; }
.app-shell .mini-day.is-today .mini-num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin: -3px 0; border-radius: 50%; background: var(--ink); color: var(--surface); font-weight: 650; }
.app-shell .mini-dots { display: flex; gap: 2px; height: 5px; }
.app-shell .mini-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--tone); }
.app-shell .month-open { display: block; width: 100%; margin-top: 12px; padding: 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.app-shell .month-open:hover { background: var(--surface-2); }

html.has-dialog { overflow: hidden; }
.app-shell dialog { padding: 0; border: 0; color: var(--ink); background: var(--surface); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); }
.app-shell dialog::backdrop { background: rgba(10, 10, 12, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.app-shell dialog[open] { animation: sheet-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

.app-shell .month-full { width: calc(100vw - 48px); max-width: 1320px; height: calc(100vh - 48px); max-height: none; border-radius: 24px; }
.app-shell .month-full[open] { display: flex; flex-direction: column; }
.app-shell .month-full-head { padding: 22px 26px 14px; }
.app-shell .full-grid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 6px; padding: 0 20px 20px; min-height: 0; }
.app-shell .full-name { align-self: end; padding: 0 8px 4px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.app-shell .full-grid > .full-name:nth-child(-n+7) { grid-row: 1; }
.app-shell .full-grid { grid-template-rows: auto; }
.app-shell .full-day { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 0; padding: 8px; border-radius: 14px; background: var(--surface-2); overflow: hidden; transition: background .15s ease; }
.app-shell .full-day:hover { background: var(--surface-3); }
.app-shell .full-day.is-out { opacity: .45; }
.app-shell .full-day.is-today { box-shadow: inset 0 0 0 1.5px var(--ink); }
.app-shell .full-link { position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.app-shell .full-day-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.app-shell .full-num { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.app-shell .full-add { pointer-events: auto; display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; opacity: 0; transition: opacity .15s ease; }
.app-shell .full-day:hover .full-add, .app-shell .full-add:focus-visible { opacity: 1; }
.app-shell .full-list { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.app-shell .full-list li { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; }
.app-shell .full-list .avatar { width: 20px; height: 20px; font-size: 8.5px; }
.app-shell .full-person { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.app-shell .full-list small { font-size: 11px; font-variant-numeric: tabular-nums; }
.app-shell .full-more { color: var(--muted); font-size: 11.5px; padding-left: 26px; }

.app-shell .sheet { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border-radius: 24px; overflow: hidden; }
.app-shell .sheet[open] { display: flex; }
.app-shell .sheet-form { display: flex; flex-direction: column; width: 100%; max-height: calc(100vh - 48px); margin: 0; }
.app-shell .sheet-head { padding: 22px 24px 6px; align-items: flex-start; }
.app-shell .sheet-head p { margin: 2px 0 0; font-size: 14px; }
.app-shell .sheet-body { flex: 1; overflow-y: auto; padding: 6px 24px 16px; }
.app-shell .sheet-step { margin: 0; padding: 16px 0 0; border: 0; min-width: 0; }
.app-shell .sheet-step legend { padding: 0; margin-bottom: 10px; color: var(--ink); font-size: 14px; font-weight: 650; }
.app-shell .people-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.app-shell .person-tile { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid transparent; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.app-shell .person-tile input, .app-shell .chip input, .app-shell .day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.app-shell .person-text { display: flex; flex-direction: column; min-width: 0; }
.app-shell .person-text strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-shell .person-text small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-shell .person-tile .tick { position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: var(--surface); opacity: 0; transform: scale(.6); transition: opacity .15s ease, transform .15s ease; }
.app-shell .person-tile:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.app-shell .person-tile:has(input:checked) .tick { opacity: 1; transform: none; }
.app-shell .chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.app-shell .chip { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px; background: var(--surface-2); border: 1.5px solid transparent; color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.app-shell .slot-chip { flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 16px; border-radius: 14px; }
.app-shell .slot-chip strong { font-size: 13.5px; font-weight: 600; }
.app-shell .slot-chip small { font-size: 12px; font-variant-numeric: tabular-nums; }
.app-shell .area-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.app-shell .chip:has(input:checked), .app-shell .day-chip:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.app-shell .person-tile:has(input:focus-visible), .app-shell .chip:has(input:focus-visible), .app-shell .day-chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.app-shell .time-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.app-shell .time-pair[hidden], .app-shell .sheet-other[hidden] { display: none; }
.app-shell .sheet-other { width: 100%; margin-top: 10px; }
.app-shell .day-pick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.app-shell .day-chip { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0; border-radius: 14px; background: var(--surface-2); border: 1.5px solid transparent; cursor: pointer; }
.app-shell .day-chip small { font-size: 11.5px; }
.app-shell .day-chip strong { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.app-shell .sheet-step .form-hint { margin: 8px 0 0; }
.app-shell .note-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; padding: 0; border: 0; background: none; font: inherit; font-size: 13.5px; cursor: pointer; }
.app-shell .note-toggle[hidden] { display: none; }
.app-shell .sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.app-shell .sheet-summary { margin: 0; min-width: 0; color: var(--muted); font-size: 13.5px; }
.app-shell .sheet-foot .button { flex: none; }
.app-shell .sheet-foot .button:disabled { opacity: .4; cursor: not-allowed; }

@media (max-width: 1200px) { .app-shell .shift-tools { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .app-shell .sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .app-shell .month-full { width: 100vw; height: 100vh; max-width: 100vw; border-radius: 0; }
  .app-shell .full-list li span.full-person, .app-shell .full-list small { display: none; }
  .app-shell .day-pick { gap: 4px; }
}
.app-shell .shift-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 6px 8px; padding: 8px 10px 9px 9px; }
.app-shell .shift-item .avatar { width: 22px; height: 22px; font-size: 9px; }
.app-shell .shift-name { min-width: 0; padding-right: 18px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-shell .shift-meta { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.app-shell .shift-meta .shift-time { font-size: 12px; font-weight: 600; white-space: nowrap; }
.app-shell .shift-meta small { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-shell .sheet-step { padding-top: 20px; }
.app-shell .sheet-step:first-child { padding-top: 10px; }
.app-shell .sheet-step legend { float: left; width: 100%; margin-bottom: 10px; }
.app-shell .sheet-step legend ~ * { clear: both; }

/* ---------- Il mio locale ---------- */
.app-shell .business-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.app-shell .business-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.app-shell .business-side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
.app-shell .form-section { display: flex; align-items: baseline; gap: 8px; margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 650; }
.app-shell .business-form .form-section:first-of-type { margin-top: 14px; padding-top: 0; border-top: 0; }
.app-shell .form-section .optional { font-size: 12.5px; font-weight: 400; }
.app-shell .business-form .chip-row { margin-top: 14px; }
.app-shell .business-form textarea { width: 100%; min-height: 84px; padding: 10px 14px; font: inherit; font-size: 14px; line-height: 1.45; resize: vertical; box-sizing: border-box; }
.app-shell input.upper { text-transform: uppercase; }
.app-shell .card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-shell .pill-attn { background: var(--st-attn-bg); color: var(--st-attn); }
.app-shell .pill-neutral { background: var(--surface-2); color: var(--muted); }

.app-shell .hours-table { display: flex; flex-direction: column; margin-top: 14px; }
.app-shell .hours-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; align-items: start; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.app-shell .hours-row:first-child { border-top: 0; }
.app-shell .hours-day { display: flex; flex-direction: row; align-items: center; gap: 12px; min-height: 40px; cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.app-shell .hours-day .switch { min-height: 0; height: 26px; width: 44px; flex: none; }
.app-shell .hours-slots { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.app-shell .hours-closed { display: none; align-self: flex-start; min-height: 40px; line-height: 40px; color: var(--muted); font-size: 14px; }
.app-shell .hours-row.is-closed .hours-closed { display: block; }
.app-shell .hours-row.is-closed .hours-slot, .app-shell .hours-row.is-closed .hours-actions { display: none; }
.app-shell .hours-slot { display: grid; grid-template-columns: minmax(80px, 130px) 124px auto 124px 30px; align-items: center; gap: 8px; }
.app-shell .hours-slot[hidden] { display: none; }
.app-shell .hours-slot input { min-height: 40px; padding: 0 10px; font-size: 14px; font-variant-numeric: tabular-nums; box-sizing: border-box; width: 100%; }
.app-shell .hours-slot .slot-name { background: transparent; border-color: transparent; font-weight: 600; padding-left: 4px; }
.app-shell .hours-slot .slot-name:hover { border-color: var(--field-line); }
.app-shell .hours-slot .dash { color: var(--muted); }
.app-shell .slot-remove { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.app-shell .slot-remove:hover { background: var(--st-danger-bg); color: var(--st-danger); }
.app-shell .hours-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-top: 8px; }
.app-shell .hours-actions .link-button { display: inline-flex; align-items: center; gap: 4px; padding: 2px 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.app-shell .hours-actions .link-button[hidden] { display: none; }
.app-shell .hours-actions .muted-link { color: var(--muted); font-weight: 500; }
.app-shell .hours-actions .muted-link:hover { color: var(--ink); }
.app-shell .shift-offsets { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); }
.app-shell .shift-offsets p { display: flex; flex-direction: column; flex: 1 1 100%; margin: 0; font-size: 14px; }
.app-shell .shift-offsets small { font-size: 12.5px; }
.app-shell .shift-offsets label { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 13.5px; }
.app-shell .shift-offsets input { width: 60px; min-height: 36px; text-align: center; }
.app-shell .shift-offsets label span { color: var(--muted); }

.app-shell .closure-list { display: flex; flex-direction: column; margin: 12px 0 4px; padding: 0; list-style: none; }
.app-shell .closure-list li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.app-shell .closure-list li:first-child { border-top: 0; }
.app-shell .closure-dates { min-width: 150px; font-weight: 600; font-variant-numeric: tabular-nums; }
.app-shell .closure-note { flex: 1; color: var(--muted); }
.app-shell .closure-list form { margin: 0; }

.app-shell .google-preview { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; padding: 16px; border-radius: var(--r-md); background: var(--surface-2); }
.app-shell .g-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.app-shell .g-cat { color: var(--muted); font-size: 13.5px; }
.app-shell .g-status { margin-top: 6px; font-size: 13.5px; font-weight: 600; }
.app-shell .g-status.tone-ok { color: var(--st-ready); }
.app-shell .g-status.tone-attn { color: var(--st-attn); }
.app-shell .g-status.tone-danger { color: var(--st-danger); }
.app-shell .g-status.tone-muted { color: var(--muted); }
.app-shell .g-lines { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); list-style: none; font-size: 13.5px; }
.app-shell .g-lines li { display: flex; align-items: flex-start; gap: 10px; overflow-wrap: anywhere; }
.app-shell .g-lines svg { flex: none; margin-top: 2px; color: var(--muted); }
.app-shell .score { margin-top: 16px; }
.app-shell .score-head { display: flex; justify-content: space-between; font-size: 13.5px; }
.app-shell .score-bar { display: block; height: 8px; margin-top: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.app-shell .score-bar i { display: block; height: 100%; border-radius: inherit; background: var(--st-ready); }
.app-shell .score .form-hint { margin-top: 8px; }
.app-shell .google-connect h3 { margin: 0 0 6px; font-size: 16px; }
.app-shell .google-connect p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; }

/* Turni: giorni di chiusura */
.app-shell .day-card.is-closed { background: color-mix(in srgb, var(--surface) 55%, transparent); box-shadow: none; outline: 1.5px dashed var(--line); outline-offset: -1.5px; }
.app-shell .day-card.is-closed.is-today { outline-color: var(--ink); }
.app-shell .closed-pill { align-self: flex-start; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.app-shell .mini-day.is-closed .mini-num { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.app-shell .full-day.is-closed { background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, transparent 8px 16px); }
.app-shell .full-closed { position: relative; z-index: 1; color: var(--muted); font-size: 11.5px; pointer-events: none; }
.app-shell .sheet-closed-note { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--st-attn-bg); color: var(--st-attn); font-size: 13px; }
.app-shell .sheet-closed-note[hidden] { display: none; }
.app-shell .slot-chip .slot-hint { font-size: 11px; color: var(--muted); }

@media (max-width: 1200px) {
  .app-shell .business-layout { grid-template-columns: minmax(0, 1fr); }
  .app-shell .business-side { position: static; order: -1; }
}
@media (max-width: 720px) {
  .app-shell .hours-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .app-shell .hours-actions { flex-direction: row; justify-content: flex-start; gap: 16px; padding-top: 0; }
  .app-shell .hours-slot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr) 28px; }
}

/* ---------- Prendi comanda ---------- */
.app-shell .waiter-room { margin-bottom: 28px; }
.app-shell .waiter-room h2 { margin: 0 0 12px; font-size: 17px; }
.app-shell .waiter-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.app-shell .waiter-table { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 118px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); color: var(--ink); text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
.app-shell .waiter-table:hover { transform: translateY(-1px); }
.app-shell .waiter-table:active { transform: scale(.98); }
.app-shell .waiter-table:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.app-shell .waiter-table:not(.is-busy) { background: transparent; box-shadow: none; outline: 1.5px dashed var(--line); outline-offset: -1.5px; }
.app-shell .waiter-table.is-busy { border-left: 4px solid var(--st-attn); }
.app-shell .waiter-table.is-mine { border-left-color: var(--st-ready); }
.app-shell .waiter-table.is-paid { border-left-color: var(--muted); }
.app-shell .wt-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-shell .wt-name { font-family: var(--font-display); font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.app-shell .wt-ready { padding: 3px 8px; border-radius: 999px; background: var(--st-ready-bg); color: var(--st-ready); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.app-shell .wt-line { color: var(--muted); font-size: 13px; }
.app-shell .wt-total { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.app-shell .wt-who { margin-top: auto; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.app-shell .waiter-table.is-mine .wt-who { color: var(--st-ready); }
.app-shell .wt-open { margin-top: auto; font-size: 13px; font-weight: 600; }

.app-shell .pad-heading { margin-bottom: 20px; }
.app-shell .order-pad { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.app-shell .pad-menu { min-width: 0; }
.app-shell .pad-tools { position: sticky; top: 0; z-index: 3; display: flex; flex-direction: column; gap: 10px; padding: 8px 0 12px; background: var(--bg); }
.app-shell .pad-search { position: relative; display: flex; align-items: center; }
.app-shell .pad-search svg { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.app-shell .pad-search input { width: 100%; min-height: 46px; padding: 0 14px 0 40px; font-size: 15px; border-radius: 14px; box-sizing: border-box; }
.app-shell .pad-cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.app-shell .pad-cats::-webkit-scrollbar { display: none; }
.app-shell .pad-cats a { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; box-shadow: var(--shadow-btn); }
.app-shell .pad-category { scroll-margin-top: 120px; margin-bottom: 22px; }
.app-shell .pad-category[hidden] { display: none; }
.app-shell .pad-category h2 { margin: 6px 0 10px; font-size: 16px; color: var(--muted); font-weight: 600; }
.app-shell .pad-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.app-shell .pad-product { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 92px; padding: 14px; border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .1s ease, box-shadow .1s ease; }
.app-shell .pad-product[hidden] { display: none; }
.app-shell .pad-product:active { transform: scale(.97); }
.app-shell .pad-product:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.app-shell .pad-product.in-cart { box-shadow: 0 0 0 2px var(--ink), var(--shadow-card); }
.app-shell .pad-product:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; background: var(--surface-2); }
.app-shell .pp-name { font-size: 14.5px; font-weight: 600; line-height: 1.25; padding-right: 22px; }
.app-shell .pp-price { margin-top: auto; color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.app-shell .pp-mod { position: absolute; bottom: 12px; right: 12px; font-size: 11px; color: var(--muted); }
.app-shell .pp-qty { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--surface); font-size: 12.5px; font-weight: 700; box-sizing: border-box; }
.app-shell .pp-qty[hidden] { display: none; }

.app-shell .pad-ticket { position: sticky; top: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 32px); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.app-shell .ticket-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; }
.app-shell .ticket-head div { display: flex; flex-direction: column; }
.app-shell .ticket-head strong { font-family: var(--font-display); font-size: 20px; }
.app-shell .ticket-head small { font-size: 12.5px; }
.app-shell .ticket-close { display: none; }
.app-shell .ticket-covers { display: flex; align-items: center; justify-content: space-between; margin: 0 20px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.app-shell .stepper { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.app-shell .stepper button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 18px; font-weight: 600; line-height: 1; cursor: pointer; box-shadow: var(--shadow-btn); }
.app-shell .stepper output { min-width: 26px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.app-shell .stepper.small button { width: 26px; height: 26px; font-size: 15px; }
.app-shell .stepper.small output { min-width: 20px; font-size: 13.5px; }
.app-shell .ticket-lines { flex: 1; min-height: 80px; overflow-y: auto; padding: 8px 20px; }
.app-shell .ticket-empty { margin: 18px 0; font-size: 13.5px; text-align: center; }
.app-shell .ticket-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.app-shell .ticket-line:last-child { border-bottom: 0; }
.app-shell .tl-text { display: flex; flex-direction: column; min-width: 0; }
.app-shell .tl-text strong { font-size: 14px; font-weight: 600; }
.app-shell .tl-text small { font-size: 12px; }
.app-shell .tl-price { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.app-shell .ticket-note { display: flex; flex-direction: column; gap: 6px; margin: 4px 20px 0; font-size: 13px; }
.app-shell .ticket-note textarea { padding: 8px 12px; font: inherit; font-size: 13.5px; resize: none; }
.app-shell .ticket-sent { margin: 10px 20px 0; font-size: 13px; }
.app-shell .ticket-sent summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 0; }
.app-shell .ticket-sent ul { margin: 4px 0 0; padding: 0; list-style: none; max-height: 180px; overflow-y: auto; }
.app-shell .ticket-sent li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.app-shell .ticket-sent li small { display: block; }
.app-shell .sent-state { white-space: nowrap; }
.app-shell .sent-state.state-ready { color: var(--st-ready); font-weight: 600; }
.app-shell .ticket-foot { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.app-shell .ticket-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.app-shell .ticket-total strong { font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; }
.app-shell .ticket-foot .button { min-height: 50px; font-size: 15.5px; }
.app-shell .ticket-foot .button:disabled { opacity: .4; }
.app-shell .ticket-bar { display: none; }
.app-shell .mod-sheet .chip-row { gap: 8px; }

@media (max-width: 1000px) {
  .app-shell .order-pad { grid-template-columns: minmax(0, 1fr); }
  .app-shell .pad-ticket { position: fixed; inset: 0; z-index: 50; max-height: none; border-radius: 0; transform: translateY(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
  .app-shell .pad-ticket.is-open { transform: none; }
  .app-shell .ticket-close { display: inline-grid; }
  .app-shell .ticket-bar:not([hidden]) { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 20px; border: 0; border-radius: 18px; background: var(--ink); color: var(--surface); font: inherit; font-size: 15px; font-weight: 600; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .45); cursor: pointer; }
  .app-shell .pad-menu { padding-bottom: 90px; }
}
.app-shell .heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Asporto, domicilio, banco ---------- */
.app-shell .tag-sala { --chan: #2F7BF5; } .app-shell .tag-asporto { --chan: #E8812B; }
.app-shell .tag-domicilio { --chan: #8A5CF0; } .app-shell .tag-banco { --chan: #1F9FA6; }
.app-shell .channel-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: color-mix(in srgb, var(--chan, #8E8E96) 16%, transparent); color: var(--chan, var(--muted)); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.app-shell .channel-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.app-shell .channel-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); color: var(--ink); text-decoration: none; border-top: 4px solid var(--chan, var(--line)); transition: transform .12s ease; }
.app-shell .channel-tile:active { transform: scale(.98); }
.app-shell .channel-tile strong { font-family: var(--font-display); font-size: 20px; }
.app-shell .channel-tile small { font-size: 13px; }
.app-shell .channel-tile.tile-board { background: var(--surface-2); box-shadow: none; }

.app-shell .kds-ticket.channel-asporto, .app-shell .kds-ticket.channel-domicilio, .app-shell .kds-ticket.channel-banco { border-top: 4px solid var(--chan); }
.app-shell .kds-ticket.channel-asporto { --chan: #E8812B; } .app-shell .kds-ticket.channel-domicilio { --chan: #8A5CF0; } .app-shell .kds-ticket.channel-banco { --chan: #1F9FA6; }
.app-shell .kds-ticket .channel-tag { margin-right: 8px; }
.app-shell .kds-ticket.is-late { box-shadow: 0 0 0 2px var(--st-danger), var(--shadow-card); }
.app-shell .kds-scheduled { margin-top: 24px; padding: 18px 22px; border-radius: var(--r-lg); background: var(--surface-2); }
.app-shell .kds-scheduled h2 { margin: 0 0 10px; font-size: 16px; }
.app-shell .kds-scheduled h2 .muted { font-size: 13px; font-weight: 400; }
.app-shell .kds-scheduled ul { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.app-shell .kds-scheduled li { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; opacity: .8; }
.app-shell .kds-scheduled li:first-child { border-top: 0; }
.app-shell .kds-scheduled time { font-weight: 600; font-variant-numeric: tabular-nums; }

.app-shell .ticket-customer { display: flex; flex-direction: column; gap: 10px; margin: 0 20px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); max-height: 46vh; overflow-y: auto; }
.app-shell .ticket-customer label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; }
.app-shell .ticket-customer input:not([type="radio"]) { min-height: 40px; padding: 0 12px; font-size: 14px; box-sizing: border-box; width: 100%; }
.app-shell .cust-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.app-shell .cust-label { margin: 4px 0 0; font-size: 13px; font-weight: 600; }
.app-shell .ticket-customer .chip-row { gap: 6px; }
.app-shell .ticket-customer .chip { padding: 7px 12px; font-size: 13px; }
.app-shell .time-chip { flex-direction: column; align-items: flex-start; gap: 0; border-radius: 12px !important; }
.app-shell .time-chip strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.app-shell .time-chip small { font-size: 11px; color: var(--muted); }
.app-shell .time-chip.is-full { opacity: .45; cursor: not-allowed; }
.app-shell .ticket-error { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--st-danger-bg); color: var(--st-danger); font-size: 13px; line-height: 1.4; }
.app-shell .ticket-error[hidden] { display: none; }

.app-shell .board-filter { margin-bottom: 16px; }
.app-shell .board-filter .count { margin-left: 4px; color: var(--muted); font-size: 12px; }
.app-shell .board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: start; }
.app-shell .board-card { display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--chan, var(--line)); }
.app-shell .board-card[hidden] { display: none; }
.app-shell .board-card[data-channel="asporto"] { --chan: #E8812B; } .app-shell .board-card[data-channel="domicilio"] { --chan: #8A5CF0; } .app-shell .board-card[data-channel="banco"] { --chan: #1F9FA6; }
.app-shell .board-card.is-late { box-shadow: 0 0 0 2px var(--st-danger), var(--shadow-card); }
.app-shell .board-card.state-pronto { box-shadow: 0 0 0 2px var(--st-ready), var(--shadow-card); }
.app-shell .board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.app-shell .board-number { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.app-shell .board-number .channel-tag { --chan: inherit; }
.app-shell .board-number strong { font-family: var(--font-display); font-size: 30px; line-height: 1; letter-spacing: -.02em; }
.app-shell .board-time { display: flex; flex-direction: column; align-items: flex-end; }
.app-shell .board-time strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.app-shell .board-time small { font-size: 12px; }
.app-shell .board-card.is-late .board-time small { color: var(--st-danger); font-weight: 600; }
.app-shell .board-who { margin: 0; font-size: 14.5px; font-weight: 600; }
.app-shell .board-who a { color: var(--ink); font-weight: 500; }
.app-shell .board-address { margin: 0; font-size: 13.5px; }
.app-shell .board-address small { display: block; }
.app-shell .board-state { align-self: flex-start; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); }
.app-shell .state-pronto .board-state { background: var(--st-ready-bg); color: var(--st-ready); }
.app-shell .state-in_cucina .board-state { background: var(--st-attn-bg); color: var(--st-attn); }
.app-shell .board-items { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.app-shell .board-items li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.app-shell .board-items li.st-ready small { color: var(--st-ready); font-weight: 600; }
.app-shell .board-money { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); }
.app-shell .board-money strong { color: var(--ink); font-size: 14px; }
.app-shell .board-money strong.paid { color: var(--st-ready); }
.app-shell .board-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.app-shell .board-pay-label { width: 100%; font-size: 12.5px; color: var(--muted); }
.app-shell .board-actions .button { flex: 1; min-height: 40px; }

@media (max-width: 900px) { .app-shell .channel-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.app-shell .pad-ticket { overflow-y: auto; }
.app-shell .ticket-customer { max-height: none; overflow: visible; }
.app-shell .ticket-lines { flex: none; overflow: visible; }

/* ---------- Richieste dei tavoli (campanella) ---------- */
.side-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-top: -12px; }
.side-top .side-clock { margin-top: 0; }
.notify-bell { position: relative; display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--nav-active); color: var(--ink); cursor: pointer; transition: background .15s ease; }
.notify-bell:hover { background: color-mix(in srgb, var(--nav-active) 70%, var(--ink) 8%); }
.notify-bell:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.notify-bell.has-new { background: var(--st-danger-bg); color: var(--st-danger); animation: bell-ring 1.6s ease-in-out infinite; }
@keyframes bell-ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-10deg); } 85% { transform: rotate(9deg); } 92% { transform: rotate(-5deg); } }
@media (prefers-reduced-motion: reduce) { .notify-bell.has-new { animation: none; } }
.notify-badge { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--st-danger); color: #FFFFFF; font-size: 11.5px; font-weight: 700; box-sizing: border-box; box-shadow: 0 0 0 2px var(--side-bg, var(--bg)); }
.notify-badge[hidden] { display: none; }
.app-shell .notify-panel { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 640px); border-radius: 20px; background: var(--surface); box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .4), 0 0 0 1px var(--line); overflow: hidden; animation: sheet-in .22s cubic-bezier(.2, .8, .2, 1); }
.app-shell .notify-panel[hidden] { display: none; }
.app-shell .notify-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.app-shell .notify-panel header div { display: flex; flex-direction: column; }
.app-shell .notify-panel header strong { font-size: 15px; }
.app-shell .notify-panel header small { font-size: 12px; }
.app-shell .notify-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; overflow-y: auto; }
.app-shell .notify-empty { margin: 16px 0; color: var(--muted); font-size: 13.5px; text-align: center; }
.app-shell .notify-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border-left: 4px solid var(--st-attn); }
.app-shell .notify-item.is-mine { border-left-color: var(--st-danger); background: var(--st-danger-bg); }
.app-shell .notify-item.is-taken { border-left-color: var(--st-ready); background: var(--surface-2); opacity: .9; }
.app-shell .ni-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.app-shell .ni-table { font-family: var(--font-display); font-size: 18px; }
.app-shell .ni-age { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.app-shell .ni-label { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.app-shell .ni-note { margin: 0; font-size: 13px; color: var(--ink); }
.app-shell .ni-note[hidden] { display: none; }
.app-shell .ni-who { margin: 0; font-size: 12.5px; color: var(--muted); }
.app-shell .notify-item.is-mine .ni-who { color: var(--st-danger); font-weight: 600; }
.app-shell .ni-actions { display: flex; gap: 8px; margin-top: 6px; }
.app-shell .ni-actions:empty { display: none; }
.app-shell .ni-actions .button { flex: 1; min-height: 38px; }
@media (max-width: 900px) {
  .side-top { margin-top: 0; }
  .app-shell .notify-panel { left: 12px; right: 12px; bottom: 12px; width: auto; }
}
.qty-count { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Menu: modifica prodotti ---------- */
.app-shell .menu-cat { margin-bottom: 16px; padding: 18px 20px; }
.app-shell .menu-cat.is-hidden { opacity: .6; }
.app-shell .menu-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.app-shell .menu-cat-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.app-shell .menu-cat-title h2 { margin: 0; font-size: 20px; }
.app-shell .menu-cat-title .muted { font-size: 13px; }
.app-shell .menu-cat-actions { display: flex; align-items: center; gap: 6px; }
.app-shell .menu-cat-actions form { margin: 0; }
.app-shell .menu-cat-actions .link-button { padding: 6px 8px; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.app-shell .menu-cat-actions .muted-link { color: var(--muted); font-weight: 500; }
.app-shell .round-button:disabled { opacity: .3; cursor: default; }
.app-shell .round-button.small { width: 28px; height: 28px; }
.app-shell .menu-rows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.app-shell .menu-row { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); transition: background .4s ease; }
.app-shell .menu-row:first-child { border-top: 0; }
.app-shell .menu-row.is-off .mr-name strong, .app-shell .menu-row.is-off .mr-price { color: var(--muted); }
.app-shell .menu-row.is-flash { background: var(--st-ready-bg); border-radius: 12px; }
.app-shell .menu-row-main { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; padding: 12px 8px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.app-shell .menu-row-main:hover { background: var(--surface-2); }
.app-shell .menu-row-main:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.app-shell .mr-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-shell .mr-name strong { font-size: 15px; font-weight: 600; }
.app-shell .mr-name small { font-size: 12.5px; line-height: 1.4; }
.app-shell .mr-meta { color: var(--muted); }
.app-shell .mr-price { flex: none; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.app-shell .mr-move { display: flex; gap: 4px; }
.app-shell .mr-move form { margin: 0; }
.app-shell .menu-empty { padding: 12px 8px; font-size: 13.5px; }
.app-shell .menu-add { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 8px; height: 42px; border: 1.5px dashed var(--line); border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.app-shell .menu-add:hover { color: var(--ink); border-color: var(--muted); background: var(--surface-2); }
.app-shell .newcat-form { display: flex; align-items: flex-end; gap: 12px; margin: 0; }
.app-shell .newcat-form label { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.app-shell .newcat-form input { min-height: 42px; padding: 0 12px; }
.app-shell .product-sheet { width: min(640px, calc(100vw - 32px)); }
.app-shell .product-sheet textarea { width: 100%; padding: 10px 12px; font: inherit; font-size: 14px; resize: vertical; box-sizing: border-box; }
.app-shell .product-sheet .form-grid { margin-top: 6px; }
.app-shell .product-sheet [data-new-category][hidden] { display: none; }
.app-shell .mod-rows { display: flex; flex-direction: column; gap: 8px; }
.app-shell .mod-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 30px; align-items: center; gap: 8px; }
.app-shell .mod-row input { min-height: 40px; padding: 0 12px; box-sizing: border-box; width: 100%; }
.app-shell .mod-price { position: relative; display: flex; align-items: center; }
.app-shell .mod-price span { position: absolute; left: 10px; color: var(--muted); font-size: 13px; pointer-events: none; }
.app-shell .mod-price input { padding-left: 36px; }
.app-shell .product-active { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.app-shell .product-active .switch { min-height: 0; height: 26px; width: 44px; flex: none; }
.app-shell .sheet-foot .danger-link { padding: 0; border: 0; background: none; color: var(--st-danger); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.app-shell .sheet-foot .danger-link[hidden] { display: none; }
.app-shell .rename-field { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 13px; }
.app-shell .rename-field input { min-height: 42px; padding: 0 12px; }
@media (max-width: 720px) { .app-shell .mod-row { grid-template-columns: minmax(0, 1fr) 100px 28px; } .app-shell .mr-move { display: none; } }
.app-shell .heading-actions .button, .app-shell .heading-actions button.button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
@media (min-width: 1101px) { .app-shell .heading-actions { flex-wrap: nowrap; } }

/* ---------- Aspetto per i clienti ---------- */
.app-shell .brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; align-items: start; margin-top: 12px; }
.app-shell .brand-controls { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.app-shell .brand-block { display: flex; flex-direction: column; gap: 8px; }
.app-shell .brand-label { margin: 0; font-size: 14px; font-weight: 650; color: var(--ink); }
.app-shell .brand-logo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.app-shell .brand-logo-box { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--surface-2); overflow: hidden; font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--muted); }
.app-shell .brand-logo-box img { width: 100%; height: 100%; object-fit: contain; }
.app-shell .brand-upload { cursor: pointer; }
.app-shell .swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.app-shell .swatch { position: relative; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--sw); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.app-shell .swatch.is-on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.app-shell .swatch.custom { display: grid; place-items: center; background: conic-gradient(#E0503F, #E8812B, #C99A17, #2E9D5B, #1F9FA6, #2F7BF5, #8A5CF0, #E0558F, #E0503F); overflow: hidden; }
.app-shell .swatch.custom input { width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.app-shell .font-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.app-shell .font-tile, .app-shell .bg-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid transparent; cursor: pointer; }
.app-shell .font-tile input, .app-shell .bg-tile input { position: absolute; opacity: 0; pointer-events: none; }
.app-shell .font-tile:has(input:checked), .app-shell .bg-tile:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.app-shell .font-tile:has(input:focus-visible), .app-shell .bg-tile:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.app-shell .ft-sample { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.app-shell .ft-name { font-size: 12.5px; color: var(--muted); }
.app-shell .bg-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.app-shell .bg-tile { flex-direction: row; justify-content: flex-start; gap: 10px; font-size: 13.5px; font-weight: 600; }
.app-shell .bg-sample { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.app-shell .bg-sample i { width: 16px; height: 12px; border-radius: 4px; }
.app-shell .brand-welcome input { min-height: 42px; padding: 0 12px; }
.app-shell .phone { position: sticky; top: 20px; width: 250px; height: 500px; border-radius: 34px; padding: 10px; background: #1D1D1F; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .5); }
.app-shell .phone > * { font-family: var(--p-body); }
.app-shell .phone-hero { display: flex; align-items: center; gap: 10px; padding: 26px 14px 26px; border-radius: 26px 26px 0 0; background: var(--p-accent); color: var(--p-on); }
.app-shell .phone-hero strong { display: block; font-family: var(--p-head); font-size: 16px; line-height: 1.15; }
.app-shell .phone-hero small { display: block; font-size: 10.5px; opacity: .8; }
.app-shell .phone-logo { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--p-surface); color: var(--p-accent); font-family: var(--p-head); font-weight: 700; overflow: hidden; }
.app-shell .phone-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.app-shell .phone-body { position: relative; height: calc(100% - 88px); margin-top: -14px; padding: 16px 12px; border-radius: 16px 16px 26px 26px; background: var(--p-bg); color: var(--p-ink); }
.app-shell .phone-cat { margin: 0 0 8px; font-family: var(--p-head); font-size: 15px; font-weight: 700; color: var(--p-ink); }
.app-shell .phone-card { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 8px; padding: 10px; border-radius: 13px; background: var(--p-surface); box-shadow: 0 4px 12px -8px rgba(0, 0, 0, .3); }
.app-shell .phone-card div { flex: 1; min-width: 0; }
.app-shell .phone-card b { display: block; font-family: var(--p-head); font-size: 12.5px; color: var(--p-ink); }
.app-shell .phone-card small { display: block; color: var(--p-muted); font-size: 9.5px; }
.app-shell .phone-card em { display: block; margin-top: 4px; font-style: normal; font-size: 11px; font-weight: 700; color: var(--p-ink); }
.app-shell .phone-add { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--p-accent); color: var(--p-on); font-weight: 700; }
.app-shell .phone-bar { position: absolute; left: 10px; right: 10px; bottom: 12px; display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 13px; background: var(--p-accent); color: var(--p-on); font-size: 11px; font-weight: 700; }
.app-shell .phone-bar span { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--p-on); color: var(--p-accent); }
.app-shell .phone-bar b { margin-left: auto; }
@media (max-width: 900px) { .app-shell .brand-grid { grid-template-columns: minmax(0, 1fr); } .app-shell .phone { position: static; margin: 0 auto; } }
.app-shell .brand-logo-box.is-loading { opacity: .5; animation: brand-pulse 1s ease-in-out infinite alternate; }
@keyframes brand-pulse { to { opacity: .25; } }

/* ---------- Vetrina (titolare) ---------- */
.app-shell .sc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.app-shell .sc-main, .app-shell .sc-side { display: grid; gap: 16px; min-width: 0; }
.app-shell .sc-list { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 8px; }
.app-shell .sc-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); }
.app-shell .sc-item > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.app-shell .sc-item small { color: var(--muted); font-size: 12.5px; }
.app-shell .sc-item.is-off { opacity: .55; }
.app-shell .sc-pill { flex: none; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: capitalize; }
.app-shell .sc-pill.state-in-corso { background: var(--st-ready-bg); color: var(--st-ready); }
.app-shell .sc-pill.state-in-programma { background: var(--st-prep-bg); color: var(--st-prep); }
.app-shell .sc-form { display: grid; gap: 12px; margin-top: 8px; }
.app-shell .sc-form .button { justify-self: start; }
.app-shell .sc-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.app-shell .chip-button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.app-shell .chip-button.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.app-shell .sc-rising { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin: 6px 0 14px; }
.app-shell .sc-rising > div { display: grid; gap: 2px; padding: 12px; border-radius: var(--r-md); background: var(--st-ready-bg); }
.app-shell .sc-rising small { color: var(--muted); font-size: 12.5px; }
.app-shell .sc-up { color: var(--st-ready); font-size: 12px; }
.app-shell .sc-rank { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.app-shell .sc-rank li { display: grid; grid-template-columns: 26px minmax(0, 1.4fr) minmax(60px, 1fr) 40px 56px; align-items: center; gap: 10px; font-size: 14px; }
.app-shell .sc-rank-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); font-size: 12px; font-weight: 700; }
.app-shell .sc-rank li:first-child .sc-rank-n { background: #F5B301; color: #111; }
.app-shell .sc-rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.app-shell .sc-bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.app-shell .sc-bar span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.app-shell .sc-rank-qty { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.app-shell .sc-trend { text-align: right; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.app-shell .sc-trend.trend-su, .app-shell .sc-trend.trend-nuovo { color: var(--st-ready); }
.app-shell .sc-trend.trend-giu { color: var(--st-danger); }
.app-shell .sc-check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.app-shell .sc-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.app-shell .sc-inline { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.app-shell .sc-moments { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.app-shell .sc-moment { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid transparent; }
.app-shell .sc-moment.is-on { border-color: var(--accent); }
.app-shell .sc-times { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.app-shell .sc-times input { width: 100%; min-width: 0; }
.app-shell .sc-matrix { width: 100%; border-collapse: collapse; font-size: 14px; }
.app-shell .sc-matrix th, .app-shell .sc-matrix td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.app-shell .sc-matrix th[scope="row"], .app-shell .sc-matrix thead th:first-child { text-align: left; font-weight: 600; }
.app-shell .sc-matrix thead th { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.app-shell .sc-matrix input { width: 18px; height: 18px; accent-color: var(--accent); }
.app-shell .sc-cover { display: grid; place-items: center; aspect-ratio: 16 / 10; margin: 10px 0; border-radius: var(--r-md); background: var(--surface-2) center / cover no-repeat; color: var(--muted); font-size: 13px; }
.app-shell .sc-cover-actions { display: flex; gap: 8px; }
.app-shell .sc-day { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); line-height: 1; }
.app-shell .sc-day small { font-size: 10px; text-transform: uppercase; color: inherit !important; }
.app-shell .sc-score { display: flex; align-items: center; gap: 14px; margin: 8px 0 12px; }
.app-shell .sc-score > strong { font-family: var(--font-display); font-size: 40px; line-height: 1; }
.app-shell .sc-score > div { display: grid; gap: 2px; }
.app-shell .sc-score small { color: var(--muted); font-size: 12.5px; }
.app-shell .sc-stars { position: relative; display: inline-block; color: var(--surface-3); font-size: 18px; letter-spacing: 2px; }
.app-shell .sc-stars::before { content: "★★★★★"; position: absolute; inset: 0; width: var(--v); overflow: hidden; color: #F5B301; white-space: nowrap; }
.app-shell .sc-reviews { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; max-height: 360px; overflow-y: auto; }
.app-shell .sc-reviews li { padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); }
.app-shell .sc-reviews p { margin: 4px 0; font-size: 14px; white-space: pre-line; }
.app-shell .sc-reviews small { color: var(--muted); font-size: 12px; }
.app-shell .sc-r-stars { color: #F5B301; letter-spacing: 1px; }
.app-shell .sc-r-stars span { color: var(--surface-3); }
@media (max-width: 1100px) { .app-shell .sc-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .app-shell .sc-rank li { grid-template-columns: 24px minmax(0, 1fr) 36px 50px; } .app-shell .sc-bar { display: none; } }

/* ---------- Editor menu: foto, calorie, allergeni ---------- */
.app-shell .photo-field { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.app-shell .photo-field > div { display: grid; gap: 4px; min-width: 0; }
.app-shell .photo-thumb { display: grid; place-items: center; flex: none; width: 84px; height: 64px; border-radius: 12px; background: var(--surface-3); color: var(--muted); overflow: hidden; }
.app-shell .photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.app-shell .photo-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.app-shell .photo-actions .button.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.app-shell .chip-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.app-shell .chip-check { position: relative; cursor: pointer; }
.app-shell .chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.app-shell .chip-check span { display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink); }
.app-shell .chip-check input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.app-shell .chip-check input:focus-visible + span { outline: 3px solid var(--focus); }
.app-shell .mr-photo { flex: none; width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.app-shell .sc-moments { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.app-shell .sc-times { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.app-shell .sc-times input { min-width: 0; width: 100%; padding-left: 8px; padding-right: 4px; font-size: 14px; }
.app-shell .sc-check .muted { font-size: 12.5px; }
.app-shell .brand-picked { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.app-shell .brand-picked strong { color: var(--ink); font-weight: 600; }
.app-shell .brand-picked-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.app-shell .brand-warn { color: var(--st-attn); }
.app-shell .brand-warn[hidden] { display: none; }

/* ---------- Vetrina: schede recensioni/suggerimenti/foto ---------- */
.app-shell .sc-tabs { display: flex; gap: 4px; padding: 4px; margin: 8px 0 14px; border-radius: 14px; background: var(--surface-2); overflow-x: auto; }
.app-shell .sc-tabs button { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.app-shell .sc-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.app-shell .sc-tabs button span { font-size: 12px; color: var(--muted); }
.app-shell .sc-tabs .sc-new { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--st-attn); color: #fff !important; font-weight: 700; }
.app-shell .sc-tab[hidden] { display: none; }
.app-shell .sc-rev-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-shell .sc-rev-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-shell .sc-reviews li.is-off { opacity: .55; }
.app-shell .sc-reviews li.is-read { opacity: .65; }
.app-shell .sc-pill.area { text-transform: none; background: var(--accent); color: var(--accent-ink); }
.app-shell .link-button { border: 0; background: none; padding: 0; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.app-shell .sc-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.app-shell .sc-photo { margin: 0; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); border: 2px solid transparent; }
.app-shell .sc-photo.is-pending { border-color: var(--st-attn); }
.app-shell .sc-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.app-shell .sc-photo figcaption { display: grid; gap: 6px; padding: 10px; }
.app-shell .sc-photo small { color: var(--muted); font-size: 12px; }
.app-shell .sc-photo-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.app-shell .button.small { min-height: 32px; padding: 0 12px; font-size: 13px; }

/* ---------- Prenotazioni (personale) ---------- */
.app-shell .rv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.app-shell .rv-main, .app-shell .rv-side { display: grid; gap: 16px; min-width: 0; }
.app-shell .rv-daybar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.app-shell .rv-daybar .round-button { display: grid; place-items: center; width: 38px; height: 38px; font-size: 22px; text-decoration: none; color: var(--ink); }
.app-shell .rv-dayform input { min-height: 38px; }
.app-shell .rv-daytitle { flex: 1; font-size: 16px; }
.app-shell .rv-kpis { display: flex; gap: 14px; width: 100%; color: var(--muted); font-size: 13.5px; }
.app-shell .rv-kpis strong { color: var(--ink); font-size: 18px; margin-right: 2px; }
.app-shell .rv-kpis .rv-attn strong { color: var(--st-attn); }
.app-shell .rv-list, .app-shell .rv-pending { display: grid; gap: 8px; }
.app-shell .rv-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "time who table" "time actions actions"; align-items: center; gap: 6px 12px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.app-shell .rv-card.is-pending { background: var(--st-attn-bg); }
.app-shell .rv-card.status-arrivati { opacity: .6; }
.app-shell .rv-card.status-rifiutata, .app-shell .rv-card.status-annullata, .app-shell .rv-card.status-non_venuti { opacity: .45; }
.app-shell .rv-time { grid-area: time; font-family: var(--font-display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.app-shell .rv-who { grid-area: who; display: grid; gap: 2px; font-size: 15px; }
.app-shell .rv-who small { color: var(--muted); font-size: 12.5px; }
.app-shell .rv-who a { color: inherit; }
.app-shell .rv-table { grid-area: table; }
.app-shell .rv-table input { width: 90px; min-height: 34px; text-align: center; }
.app-shell .rv-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 6px; }
.app-shell .rv-pending .rv-card { grid-template-areas: "time who who" "time actions actions"; }
.app-shell .rv-pill { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 700; }
.app-shell .rv-card.status-confermata .rv-pill { background: var(--st-ready-bg); color: var(--st-ready); }
.app-shell .rv-link { display: flex; gap: 6px; margin: 6px 0 10px; }
.app-shell .rv-link input { flex: 1; min-width: 0; font-size: 13px; }
@media (max-width: 1100px) { .app-shell .rv-layout { grid-template-columns: minmax(0, 1fr); } }
.app-shell .rv-who { display: block; line-height: 1.35; }
.app-shell .rv-who small { display: block; margin-top: 2px; }
.app-shell .rv-daytitle { flex: 1 1 auto; }
.app-shell .pair-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.app-shell .pair-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.app-shell .pair-chip button { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(255,255,255,.2); color: inherit; cursor: pointer; font-size: 15px; line-height: 1; }
.app-shell .pair-add { display: flex; gap: 8px; }
.app-shell .pair-add select { flex: 1; min-width: 0; }

/* Interruttore (al posto della casella) per le impostazioni sì/no */
.app-shell .sc-check { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); font-size: 14px; font-weight: 600; color: var(--ink); }
.app-shell .sc-check input[type="checkbox"] { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 46px; height: 28px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 999px; background: var(--surface-3); cursor: pointer; transition: background .18s ease; box-shadow: inset 0 0 0 1px var(--line); }
.app-shell .sc-check input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .18s ease; }
.app-shell .sc-check input[type="checkbox"]:checked { background: var(--st-ready); box-shadow: none; }
.app-shell .sc-check input[type="checkbox"]:checked::after { transform: translateX(18px); }
.app-shell .sc-check input[type="checkbox"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.app-shell .menu-row-main .mr-name { flex: 1; min-width: 0; }
.app-shell .menu-row-main .mr-photo + .mr-name { margin-left: -4px; }

/* ---------- Prenotazioni: calendario del mese e richieste ---------- */
.app-shell .rv-month-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.app-shell .rv-month-head h2 { margin: 0; min-width: 170px; text-align: center; }
.app-shell .rv-month-head .round-button { display: grid; place-items: center; width: 36px; height: 36px; font-size: 22px; text-decoration: none; color: var(--ink); }
.app-shell .rv-month-total { margin-left: auto; font-size: 13px; }
.app-shell .rv-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.app-shell .rv-cal-dow { text-align: center; color: var(--muted); font-size: 12px; font-weight: 600; padding-bottom: 2px; }
.app-shell .rv-cal-day { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 74px; padding: 8px; border-radius: 12px; background: var(--surface-2); color: var(--ink); text-decoration: none; border: 2px solid transparent; transition: background .15s ease; }
.app-shell .rv-cal-day:hover { background: var(--surface-3); }
.app-shell .rv-cal-day.is-out { opacity: .35; }
.app-shell .rv-cal-day.is-closed { background: transparent; border: 1px dashed var(--line); }
.app-shell .rv-cal-day.is-today .rv-cal-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.app-shell .rv-cal-day.is-selected { border-color: var(--accent); }
.app-shell .rv-cal-num { font-weight: 700; font-size: 14px; }
.app-shell .rv-cal-covers { font-size: 13px; font-weight: 700; color: var(--st-ready); }
.app-shell .rv-cal-covers small { font-weight: 500; color: var(--muted); }
.app-shell .rv-cal-pending { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--st-attn); color: #fff; font-size: 11.5px; font-weight: 700; }
.app-shell .rv-cal-closed { font-size: 11px; color: var(--muted); }
.app-shell .rv-legend { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.app-shell .rv-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.app-shell .rv-dot.pending { background: var(--st-attn); }
.app-shell .rv-dot.covers { background: var(--st-ready); }
.app-shell .rv-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; margin-left: 6px; border-radius: 999px; background: var(--st-attn); color: #fff; font-size: 13px; vertical-align: middle; }
.app-shell .rv-inbox-list { display: grid; gap: 8px; }
.app-shell .rv-req { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 6px 10px; padding: 12px; border-radius: var(--r-md); background: var(--st-attn-bg); }
.app-shell .rv-req-when { display: grid; line-height: 1.2; }
.app-shell .rv-req-when strong { font-family: var(--font-display); font-size: 20px; }
.app-shell .rv-req-when small { color: var(--muted); font-size: 11.5px; }
.app-shell .rv-req-who small { display: block; color: var(--muted); font-size: 12.5px; }
.app-shell .rv-req-who a { color: inherit; }
.app-shell .rv-req .rv-actions { grid-column: 1 / -1; }
.app-shell .rv-daybar .rv-daytitle { text-align: center; }
@media (max-width: 640px) { .app-shell .rv-cal-day { min-height: 56px; padding: 5px; } .app-shell .rv-cal-covers small { display: none; } .app-shell .rv-month-total { display: none; } }
/* Annulla piatto */
.app-shell .icon-cancel { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; margin-left: 6px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--st-danger); font-size: 13px; font-weight: 700; cursor: pointer; }
.app-shell .icon-cancel:hover { background: var(--st-danger-bg); border-color: var(--st-danger); }
.app-shell .icon-cancel:disabled { opacity: .4; }

/* ---------- QR dei tavoli ---------- */
.app-shell .heading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.app-shell .notice-warn { background: var(--st-attn-bg); color: var(--ink); border: 1px solid color-mix(in srgb, var(--st-attn) 40%, transparent); }
.app-shell .qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.app-shell .qr-card { display: grid; gap: 10px; }
.app-shell .qr-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.app-shell .qr-card h2 { margin: 0; }
.app-shell .qr-card .eyebrow { margin: 0; }
.app-shell .qr-pick { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.app-shell .qr-img { justify-self: center; width: 180px; height: 180px; padding: 8px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-card); }
.app-shell .qr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.app-shell .qr-actions form { margin-left: auto; }
.app-shell .qr-printbar { position: sticky; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.app-shell .qr-printbar[hidden] { display: none; }

.qr-sheet { background: #fff; color: #111; min-height: 100vh; padding: 16px; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; }
.qr-sheet-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 190mm; margin: 0 auto 16px; padding: 12px 16px; border-radius: 14px; background: #f2f2f4; font-size: 14px; }
.qr-sheet-bar .button { margin-left: auto; }
.qr-tents { display: grid; grid-template-columns: repeat(2, 90mm); justify-content: center; gap: 6mm; }
.qr-tent { display: flex; flex-direction: column; align-items: center; justify-content: space-between; height: 125mm; padding: 7mm 6mm; border: 1px dashed #bbb; border-radius: 4mm; text-align: center; break-inside: avoid; page-break-inside: avoid; }
.qr-tent-head { display: flex; align-items: center; gap: 3mm; font-size: 15pt; }
.qr-tent-head img { width: 12mm; height: 12mm; object-fit: contain; }
.qr-tent-table { margin: 2mm 0 0; padding: 1.5mm 6mm; border-radius: 99px; background: var(--acc); color: var(--on); font-size: 13pt; }
.qr-tent-table b { font-size: 16pt; }
.qr-tent-code { width: 62mm; height: 62mm; image-rendering: pixelated; }
.qr-tent-call { margin: 0; font-size: 10.5pt; line-height: 1.35; color: #333; }
@media print {
  .no-print { display: none !important; }
  .qr-sheet { padding: 0; }
  @page { size: A4; margin: 10mm; }
}
.app-shell .table-waiter { display: block; margin-top: 3px; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--ink); opacity: .85; }
.app-shell .table-owner { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }

/* ---------- Andamento sala ---------- */
.app-shell .seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.app-shell .seg a { padding: 7px 12px; border-radius: 9px; color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.app-shell .seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.app-shell .ins-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.app-shell .ins-kpi { display: grid; gap: 4px; }
.app-shell .ins-kpi span { color: var(--muted); font-size: 13px; }
.app-shell .ins-kpi strong { font-family: var(--font-display); font-size: 30px; line-height: 1.1; }
.app-shell .ins-kpi small { color: var(--muted); font-size: 12.5px; }
.app-shell .ins-kpi.is-warn strong { color: var(--st-attn); }
.app-shell .ins-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.app-shell .ins-table th[scope="row"] { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.app-shell .ins-table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.app-shell .ins-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.app-shell .ins-bar { display: inline-block; width: 60px; height: 6px; margin-right: 8px; border-radius: 3px; background: var(--surface-3); vertical-align: middle; overflow: hidden; }
.app-shell .ins-bar span { display: block; height: 100%; background: var(--st-ready); }
.app-shell .ins-live { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.app-shell .ins-live li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); }
.app-shell .ins-live li.is-long { background: var(--st-attn-bg); }
.app-shell .ins-live-table { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.app-shell .ins-live-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .ins-live-who em { color: var(--st-attn); font-style: normal; }
.app-shell .ins-live-time { color: var(--muted); font-size: 12.5px; }
@media (max-width: 1100px) { .app-shell .ins-layout { grid-template-columns: minmax(0, 1fr); } }
.app-shell .seg a { white-space: nowrap; }
.app-shell .ins-people { display: grid; gap: 10px; margin-bottom: 10px; }
.app-shell .ins-person { padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.app-shell .ins-person header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.app-shell .ins-person header strong { font-size: 16px; }
.app-shell .ins-rev { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-shell .ins-person dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.app-shell .ins-person dl div { padding: 8px 10px; border-radius: 10px; background: var(--surface); }
.app-shell .ins-person dt { color: var(--muted); font-size: 11.5px; }
.app-shell .ins-person dd { margin: 2px 0 0; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.app-shell .ins-live li { grid-template-columns: 40px minmax(0, 1fr); }
.app-shell .ins-live-time { grid-column: 2; }
@media (max-width: 640px) { .app-shell .ins-person dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Colori per momento della giornata */
.app-shell .mood-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.app-shell .mood-strip[hidden], .app-shell .bg-tiles[hidden], .app-shell [data-mood-hint][hidden] { display: none; }
.app-shell .mood-card { display: grid; gap: 2px; padding: 10px; border-radius: 14px; background: var(--m-bg); color: var(--m-ink); border: 2px solid transparent; }
.app-shell .mood-card.is-now { border-color: var(--m-acc); }
.app-shell .mood-card strong { font-size: 13.5px; color: var(--m-ink); }
.app-shell .mood-card small { font-size: 11px; color: var(--m-ink); opacity: .7; line-height: 1.25; }
.app-shell .mood-card em { font-style: normal; font-weight: 700; opacity: 1; }
.app-shell .mood-sample { display: flex; align-items: center; justify-content: space-between; height: 34px; margin-bottom: 6px; padding: 0 6px; border-radius: 9px; background: var(--m-surface); }
.app-shell .mood-sample i { width: 50%; height: 6px; border-radius: 3px; background: var(--m-ink); opacity: .35; }
.app-shell .mood-sample b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--m-acc); color: var(--m-on); font-size: 14px; }
@media (max-width: 640px) { .app-shell .mood-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.app-shell .mood-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app-shell .mood-card { min-width: 0; }
/* Chiudi tavolo */
.app-shell .close-panel { margin-bottom: 16px; }
.app-shell .close-panel summary { cursor: pointer; font-weight: 700; font-size: 16px; }
.app-shell .close-panel p { margin: 10px 0; }
.app-shell .close-force { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.app-shell .close-force label { flex: 1; min-width: 220px; }
.app-shell .button-danger { background: var(--st-danger); color: #fff; border-color: var(--st-danger); }

/* ===== Ritaglio foto (logo, copertina, piatti) ===== */
.crop-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 18px; border: 0; border-radius: 20px; background: var(--surface, #fff); color: var(--ink, #111); box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: auto; }
.crop-dialog::backdrop { background: rgba(10,10,14,.6); backdrop-filter: blur(4px); }
.crop-head { display: grid; gap: 3px; margin-bottom: 12px; }
.crop-head strong { font-size: 17px; }
.crop-head span { font-size: 13px; opacity: .7; }
.crop-stage { position: relative; width: 100%; max-height: 60vh; overflow: hidden; border-radius: 14px; background: #1b1b1f repeating-conic-gradient(#26262b 0 25%, #1b1b1f 0 50%) 0 0 / 20px 20px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.9); background:
  linear-gradient(90deg, transparent calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% - .5px) calc(33.33% + .5px), transparent calc(33.33% + .5px) calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% - .5px) calc(66.66% + .5px), transparent calc(66.66% + .5px)),
  linear-gradient(180deg, transparent calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% - .5px) calc(33.33% + .5px), transparent calc(33.33% + .5px) calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% - .5px) calc(66.66% + .5px), transparent calc(66.66% + .5px)); }
.crop-zoom { display: flex; align-items: center; gap: 10px; margin: 14px 4px 4px; font-size: 20px; font-weight: 700; }
.crop-zoom input { flex: 1; accent-color: var(--accent, #8A3F2B); }
.crop-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
@media (max-width: 480px) { .crop-actions .button { flex: 1 1 auto; } .crop-actions [data-crop-ok] { flex-basis: 100%; order: -1; } }

/* ===== Adesso in sala: turni e passaggio dei tavoli ===== */
.app-shell .ins-now h3.ins-sub { margin: 14px 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.app-shell .ins-now h2 + h3.ins-sub { margin-top: 4px; }
.app-shell .ins-shift { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.app-shell .ins-shift li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-md); background: var(--surface-2); }
.app-shell .ins-shift li.is-ending { box-shadow: inset 3px 0 0 var(--st-attn); }
.app-shell .ins-shift strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .ins-shift small { display: block; color: var(--muted); font-size: 12px; }
.app-shell .ins-count { font-family: var(--font-display); font-size: 18px; font-weight: 700; text-align: right; line-height: 1; }
.app-shell .ins-count small { display: block; font-family: inherit; font-size: 10.5px; font-weight: 600; }
.app-shell .ins-later { margin: 8px 2px 0; color: var(--muted); font-size: 12.5px; }
.app-shell .ins-later span { color: var(--ink); font-weight: 600; }
.app-shell .ins-now .ins-live li { grid-template-columns: 40px minmax(0, 1fr); align-items: start; }
.app-shell .ins-live-body { display: grid; gap: 3px; min-width: 0; }
.app-shell .ins-live li.is-slow { box-shadow: inset 3px 0 0 var(--st-attn); }
.app-shell .ins-live-warn { color: var(--st-attn); font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.app-shell .ins-live-body > .button { justify-self: start; margin-top: 4px; }
.app-shell .ins-pass { display: flex; gap: 6px; margin-top: 4px; }
.app-shell .ins-pass select { flex: 1; min-width: 0; height: 34px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line, var(--surface-3)); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.app-shell .muted.small { font-size: 13px; }
.app-shell .ins-now .ins-live-body > * { grid-column: 1; }
.app-shell .ins-now .ins-pass .button { flex: none; }

/* ===== Scelte del cliente nel pannello del piatto (Cottura, Componi il tuo panino...) ===== */
.app-shell .opt-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.app-shell .opt-groups { display: grid; gap: 10px; }
.app-shell .opt-group { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.app-shell .opt-group-head { display: flex; align-items: center; gap: 6px; }
.app-shell .opt-group-head [data-g-name] { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; font-weight: 700; }
.app-shell .opt-group-tools { display: flex; gap: 2px; }
.app-shell .opt-group-tools .slot-remove { font-weight: 700; }
.app-shell .opt-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.app-shell .opt-rule select { flex: 1 1 200px; min-height: 38px; }
.app-shell .opt-n { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.app-shell .opt-n[hidden] { display: none; }
.app-shell .opt-n input { width: 64px; min-height: 38px; padding: 0 8px; }
.app-shell .opt-list { display: flex; flex-direction: column; gap: 6px; }
.app-shell .opt-group > .note-toggle { justify-self: start; }

/* Scelte del piatto nel blocchetto del cameriere */
.app-shell .opt-host { display: grid; gap: 10px; }
.app-shell .opt-host .opt-g { padding: 10px; border-radius: var(--r-md); background: var(--surface-2); border: 2px solid transparent; }
.app-shell .opt-host .opt-g-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.app-shell .opt-host .opt-step { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); font-weight: 800; font-size: 12px; }
.app-shell .opt-host .opt-g.is-done .opt-step { background: var(--accent); color: var(--accent-ink); }
.app-shell .opt-host .opt-g-title { display: grid; flex: 1; }
.app-shell .opt-host .opt-g-title small { color: var(--muted); font-size: 12px; }
.app-shell .opt-host .opt-g.is-required.is-missing-now .opt-g-title small { color: var(--st-attn); font-weight: 700; }
.app-shell .opt-host .opt-g-state { font-weight: 800; color: var(--st-ready); }
.app-shell .opt-host .opt-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.app-shell .opt-host .opt-c { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); cursor: pointer; font-weight: 600; }
.app-shell .opt-host .opt-c:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.app-shell .opt-host .opt-c input { margin: 0; accent-color: var(--accent); }
.app-shell .opt-host .opt-c strong { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.app-shell .opt-host .opt-c.is-off { opacity: .45; }
.app-shell .opt-host .opt-g.is-flash { border-color: var(--st-attn); }
.app-shell .pp-mod.is-req { color: var(--st-attn); }

/* Comande: vista "Tutti i reparti" (etichetta del reparto su ogni piatto) */
.app-shell .kds-station { display: inline-block; margin: 0 6px 2px 0; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; vertical-align: middle; }
.app-shell .ins-unassigned { margin-top: 6px; font-size: 13px; }
.app-shell .ins-unassigned summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.app-shell .ins-unassigned ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.app-shell .ins-unassigned li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.app-shell .ins-unassigned li span, .app-shell .ins-unassigned em { color: var(--muted); font-style: normal; }
.app-shell .ins-unassigned a { color: var(--st-attn); font-weight: 600; }

/* ===== Il mio locale: telefono con il menu vero (anteprima dentro la cornice) ===== */
.app-shell .phone-wrap { position: sticky; top: 20px; display: grid; justify-items: center; gap: 10px; align-self: start; }
.app-shell .phone-wrap .phone { position: relative; top: auto; width: 290px; height: 590px; padding: 11px; border-radius: 44px; background: #111113; box-shadow: 0 0 0 1.5px #3a3a3f inset, 0 30px 60px -24px rgba(0, 0, 0, .55); }
.app-shell .phone-wrap .phone::before { content: ""; position: absolute; top: 20px; left: 50%; z-index: 2; width: 84px; height: 24px; border-radius: 14px; background: #000; transform: translateX(-50%); }
.app-shell .phone-screen { position: relative; width: 268px; height: 568px; overflow: hidden; border-radius: 34px; background: #fff; }
.app-shell .phone-screen iframe { position: absolute; top: 0; left: 0; width: 390px; height: 826px; border: 0; transform: scale(.6872); transform-origin: 0 0; }
.app-shell .phone-caption { max-width: 290px; margin: 0; color: var(--muted); font-size: 12.5px; text-align: center; line-height: 1.45; }
.app-shell .mood-card { cursor: pointer; }
.app-shell .mood-card.is-previewed { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 900px) { .app-shell .phone-wrap { position: static; margin: 0 auto; } }
.app-shell .brand-grid { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 900px) { .app-shell .brand-grid { grid-template-columns: minmax(0, 1fr); } }

/* Scelte del piatto nel blocchetto del cameriere (markup opt-ui, tutte le scelte visibili) */
.app-shell .opt-host .opt-ui { display: grid; gap: 12px; }
.app-shell .opt-host .opt-in { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; pointer-events: none; }
.app-shell .opt-host .opt-g { display: grid; gap: 8px; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); border: 2px solid transparent; }
.app-shell .opt-host .opt-g-head { display: grid; gap: 1px; }
.app-shell .opt-host .opt-g-line { display: flex; align-items: center; gap: 8px; }
.app-shell .opt-host .opt-g-name { font-size: 15px; }
.app-shell .opt-host .opt-badge { padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; }
.app-shell .opt-host .opt-badge.is-req { background: var(--st-attn-bg); color: var(--st-attn); }
.app-shell .opt-host .opt-g.is-done .opt-badge.is-req { background: var(--st-ready-bg, var(--surface-3)); color: var(--st-ready); }
.app-shell .opt-host .opt-g-hint { color: var(--muted); font-size: 12px; }
.app-shell .opt-host .opt-tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.app-shell .opt-host .opt-tile { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; margin: 0; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.app-shell .opt-host .opt-tile.is-on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.app-shell .opt-host .opt-tile.is-on .opt-price { color: inherit; opacity: .85; }
.app-shell .opt-host .opt-price { color: var(--muted); font-size: 12.5px; }
.app-shell .opt-host .opt-tick { display: none; }
.app-shell .opt-host .opt-tile.is-off { opacity: .45; }
.app-shell .opt-host .opt-g.is-flash { border-color: var(--st-attn); }

/* ===== Turni: scheda veloce della persona ===== */
.app-shell [data-person] { cursor: pointer; }
.app-shell .shift-item[data-person]:hover, .app-shell .hours-bars li.is-clickable:hover { background: var(--surface-2); }
.app-shell .person-sheet { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; overflow: auto; }
.app-shell .pc { display: grid; gap: 16px; padding: 20px; }
.app-shell .pc-head { display: flex; align-items: center; gap: 14px; }
.app-shell .pc-avatar { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 18px; font-weight: 800; }
.app-shell .pc-who { flex: 1; min-width: 0; }
.app-shell .pc-who h2 { margin: 0; font-size: 21px; }
.app-shell .pc-who p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.app-shell .pc-contacts { display: flex; flex-wrap: wrap; gap: 8px; }
.app-shell .pc-contact { display: flex; align-items: center; gap: 10px; flex: 1 1 140px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink); text-decoration: none; }
.app-shell .pc-contact:hover { background: var(--surface-3); }
.app-shell .pc-contact span:first-child { font-size: 18px; }
.app-shell .pc-contact small { display: block; color: var(--muted); font-size: 11.5px; }
.app-shell .pc-contact b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.app-shell .pc-missing { margin: 0; color: var(--muted); font-size: 13px; }
.app-shell .pc-block h3 { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.app-shell .pc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.app-shell .pc-stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.app-shell .pc-stats div { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.app-shell .pc-stats small { display: block; color: var(--muted); font-size: 11px; line-height: 1.25; }
.app-shell .pc-stats b { display: block; margin-top: 2px; font-size: 16px; font-variant-numeric: tabular-nums; }
.app-shell .pc-shifts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.app-shell .pc-shifts li { display: grid; grid-template-columns: 76px auto minmax(0, 1fr); align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); }
.app-shell .pc-shifts li.is-today { box-shadow: inset 3px 0 0 var(--accent); }
.app-shell .pc-day { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: capitalize; }
.app-shell .pc-shifts small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .pc-now { margin: 8px 0 0; font-size: 13px; }
.app-shell .pc-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (max-width: 520px) { .app-shell .pc-stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.app-shell [data-category-other][hidden] { display: none; }
.app-shell .advisor-form { display: grid; gap: 14px; }
.app-shell .advisor-form textarea { width: 100%; min-height: 84px; padding: 10px 14px; font: inherit; font-size: 14px; line-height: 1.45; box-sizing: border-box; }
.app-shell .advisor-ai { display: grid; gap: 8px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.app-shell .advisor-ai-title { margin: 0; }
.app-shell .advisor-key-ok { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13.5px; }
.app-shell [data-mail-custom][hidden] { display: none; }
.app-shell .mail-help { font-size: 13.5px; }
.app-shell .mail-help summary { cursor: pointer; font-weight: 600; }
.app-shell .mail-help ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.6; }

/* ===== Cassa ===== */
.app-shell .cassa-kpis .ins-kpi strong { font-variant-numeric: tabular-nums; }
.app-shell .cassa-methods { display: grid; gap: 2px; font-size: 13.5px; }
.app-shell .cassa-methods b { font-variant-numeric: tabular-nums; }
.app-shell .section-title { margin: 18px 0 10px; font-size: 18px; }
.app-shell .cassa-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.app-shell .cassa-tables > .section-title, .app-shell .cassa-tables > .empty-state { grid-column: 1 / -1; }
.app-shell .cassa-table { display: grid; gap: 10px; align-content: start; }
.app-shell .cassa-table.is-asking { box-shadow: inset 4px 0 0 var(--st-attn), var(--shadow-card, none); }
.app-shell .cassa-table.is-paid { opacity: .9; }
.app-shell .cassa-table-head { display: flex; justify-content: space-between; gap: 10px; }
.app-shell .cassa-table-head h3 { margin: 0; font-size: 18px; }
.app-shell .cassa-due { display: grid; justify-items: end; text-align: right; }
.app-shell .cassa-due strong { font-family: var(--font-display); font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.app-shell .cassa-due small { color: var(--muted); font-size: 11.5px; }
.app-shell .cassa-note { margin: 0; color: var(--st-attn); font-size: 13px; font-weight: 600; }
.app-shell .cassa-ask { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--st-attn-bg); }
.app-shell .cassa-ask > div { flex: 1; display: grid; }
.app-shell .cassa-ask small { color: var(--muted); font-size: 12.5px; }
.app-shell .cassa-ask-icon { font-size: 20px; }
.app-shell .cassa-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.app-shell .cassa-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
@media (max-width: 900px) { .app-shell .cassa-bottom { grid-template-columns: minmax(0, 1fr); } }
.app-shell .cassa-log, .app-shell .cassa-tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.app-shell .cassa-log li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.app-shell .cassa-log-time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.app-shell .cassa-log-what { display: grid; min-width: 0; }
.app-shell .cassa-log-what small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .cassa-log-amount { display: grid; justify-items: end; font-weight: 700; font-variant-numeric: tabular-nums; }
.app-shell .cassa-log-amount small { color: var(--st-ready); font-size: 11.5px; font-weight: 600; }
.app-shell .cassa-tips li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.app-shell .cassa-tips li > span:nth-child(2) { display: grid; min-width: 0; }
.app-shell .cassa-tips small { color: var(--muted); font-size: 12px; }
.app-shell .cassa-tips strong { font-variant-numeric: tabular-nums; }
.app-shell .cassa-tips-total { margin: 10px 2px 0; }
.app-shell .cassa-sheet { width: min(560px, calc(100vw - 20px)); }
/* Cassa: tastierino numerico per iPad */
.app-shell .cassa-sheet.has-pad { width: min(940px, calc(100vw - 20px)); }
.app-shell .cassa-sheet [data-pad-target] { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.app-shell .cassa-sheet .is-pad-target { outline: 3px solid var(--accent); outline-offset: 1px; }
.app-shell .cassa-body { display: grid; gap: 18px; }
.app-shell .cassa-fields { min-width: 0; }
.app-shell .cassa-pad { display: grid; gap: 10px; align-content: start; padding: 14px; border-radius: 18px; background: rgba(127,127,127,.08); border: 1px solid rgba(127,127,127,.18); }
.app-shell .cassa-pad-label { margin: 0; font-size: 14px; opacity: .8; }
.app-shell .cassa-pad-display { display: block; padding: 12px 14px; border-radius: 12px; background: var(--surface, #fff); border: 1px solid rgba(127,127,127,.25); font-size: 30px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.app-shell .cassa-pad-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.app-shell .pad-key { min-height: 62px; border-radius: 14px; border: 1px solid rgba(127,127,127,.25); background: var(--surface, #fff); color: inherit; font-size: 26px; font-weight: 700; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.app-shell .pad-key:active { transform: scale(.96); background: rgba(127,127,127,.18); }
.app-shell .pad-key.is-soft { font-size: 22px; opacity: .85; }
.app-shell .pad-key.is-next { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-size: 18px; white-space: nowrap; padding: 0 4px; }
.app-shell .cassa-pad-hint { margin: 0; font-size: 13px; opacity: .7; }
@media (min-width: 720px) {
  .app-shell .cassa-body { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .app-shell .cassa-pad { position: sticky; top: 0; }
}
@media (max-width: 719px) { .app-shell .cassa-pad { display: none; } } /* sul telefono si usa la tastiera del telefono */
.app-shell .seg-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.app-shell .cassa-items { display: grid; gap: 4px; max-height: 240px; overflow-y: auto; margin-bottom: 10px; }
.app-shell .cassa-item { display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink); cursor: pointer; }
.app-shell .cassa-item input { width: 18px; height: 18px; min-height: 0; }
.app-shell .cassa-item small { display: block; color: var(--muted); font-size: 12px; }
.app-shell .cassa-item b { font-variant-numeric: tabular-nums; }
.app-shell .cassa-amount input, .app-shell .cassa-sheet input[inputmode="decimal"] { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.app-shell .cassa-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.app-shell .cassa-change { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--st-ready-bg, var(--surface-2)); color: var(--st-ready); font-size: 18px; font-weight: 800; }
.app-shell .cassa-change.is-short { background: var(--st-attn-bg); color: var(--st-attn); }
.app-shell [data-cash-box][hidden], .app-shell .cassa-sheet [data-split-box][hidden] { display: none; }
.app-shell .cassa-equal label { display: flex; align-items: center; gap: 8px; }
.app-shell .cassa-equal input { width: 80px; }

/* Vetrina: nascondi con motivo */
.sc-hide { display: inline-block; position: relative; }
.sc-hide > summary { list-style: none; cursor: pointer; }
.sc-hide > summary::-webkit-details-marker { display: none; }
.sc-hide[open] > summary { opacity: .6; }
.sc-hide-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: 12px; background: var(--surface, rgba(255,255,255,.6)); }
.sc-hide-form label { display: grid; gap: 4px; font-size: 12.5px; }
.sc-hide-form select { min-width: 210px; }
.sc-reviews li.is-off > p { opacity: .55; text-decoration: line-through; }

/* Il mio locale: menu in altre lingue */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 12px 0; }
.lang-card { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: 14px; background: var(--surface, rgba(255,255,255,.5)); }
.lang-card.is-on { border-color: color-mix(in srgb, var(--accent, #0b6e6e) 45%, transparent); }
.lang-flag { font-size: 18px; }
.lang-meter { height: 6px; border-radius: 99px; background: var(--line, rgba(0,0,0,.1)); overflow: hidden; }
.lang-meter span { display: block; height: 100%; background: var(--accent, #0b6e6e); border-radius: inherit; }
.lang-run { margin-top: 6px; }
.tr-list { display: grid; gap: 0; }
.tr-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); }
.tr-row:last-child { border-bottom: 0; }
.tr-src small, .tr-dst small { color: var(--muted); font-size: 12px; }
.tr-src p { margin: 4px 0 0; color: var(--ink); }
.tr-dst { display: grid; gap: 4px; }
.tr-row.is-manual .tr-dst small { color: var(--accent, #0b6e6e); font-weight: 600; }
.tr-row.is-todo .tr-dst input, .tr-row.is-todo .tr-dst textarea { border-style: dashed; }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0 4px; background: linear-gradient(transparent, var(--surface-strong, rgba(255,255,255,.95)) 30%); }
@media (max-width: 700px) { .tr-row { grid-template-columns: 1fr; gap: 6px; } }

/* ---------------- Console RACE e assistenza */
.console-tag { margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft, rgba(0,0,0,.08)); color: var(--accent, var(--ink)); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.app-shell .ins-kpi.is-alert strong { color: var(--st-danger); }
.console-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.console-grid > div, .console-grid > aside { display: grid; gap: 16px; }
@media (max-width: 1000px) { .console-grid { grid-template-columns: 1fr; } }
.console-search input { min-width: 240px; }
.table-scroll { overflow-x: auto; }
.console-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.console-table th { text-align: left; padding: 8px 10px; color: var(--muted); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.console-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.console-table tr:last-child td { border-bottom: 0; }
.console-link { display: grid; gap: 2px; color: var(--ink); text-decoration: none; }
.console-link small { color: var(--muted); font-size: 12px; }
.console-link:hover strong { text-decoration: underline; }
.health { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.health-attivo { background: var(--st-ready-bg); color: var(--st-ready); }
.health-fermo { background: var(--st-attn-bg); color: var(--ink); }
.health-sospeso { background: var(--st-danger-bg); color: var(--st-danger); }
.console-chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 6px 0; }
.console-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.console-bar i { display: block; width: 100%; height: max(2px, var(--h)); border-radius: 4px 4px 0 0; background: var(--accent, #0b6e6e); opacity: .85; }
.console-bar:hover i { opacity: 1; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 10px 0; }
.module-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--surface); }
.module-card span { display: grid; gap: 3px; }
.module-card strong { font-size: 14px; color: var(--ink); }
.module-card small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.module-card:not(.is-on) { opacity: .75; }
.console-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.console-list li, .console-list li a { display: grid; gap: 2px; padding: 8px 0; color: var(--ink); text-decoration: none; }
.console-list small { color: var(--muted); font-size: 12px; }
.console-log { list-style: none; margin: 0; padding: 0; display: grid; }
.console-log li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.console-log li:last-child { border-bottom: 0; }
.console-log li > span:first-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.console-log small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-word; }
.console-owner { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.console-owner small { color: var(--muted); font-size: 12px; }
.console-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; }
.ticket-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ticket-list a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; background: var(--surface); }
.ticket-list li.is-new a { border-color: var(--accent, #0b6e6e); }
.ticket-main { display: grid; gap: 2px; min-width: 0; }
.ticket-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-main small { color: var(--muted); font-size: 12px; }
.ticket-state { flex: none; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ticket-state.state-aperto { background: var(--st-attn-bg); color: var(--ink); }
.ticket-state.state-risposto { background: var(--st-ready-bg); color: var(--st-ready); }
.ticket-state.state-risolto { background: var(--surface-2); color: var(--muted); }
.sup-card { display: grid; gap: 14px; }
.sup-chat { display: grid; gap: 10px; max-height: 62vh; overflow-y: auto; padding: 4px 2px; }
.sup-msg { max-width: min(640px, 88%); padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); color: var(--ink); }
.sup-msg.is-me { justify-self: end; border-radius: 16px 16px 4px 16px; background: color-mix(in srgb, var(--accent, #0b6e6e) 14%, var(--surface)); }
.sup-msg.from-ai { background: color-mix(in srgb, #7c5cff 10%, var(--surface)); }
.sup-msg.from-sistema { justify-self: center; max-width: 90%; background: transparent; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; text-align: center; border-radius: 12px; }
.sup-msg header { display: flex; gap: 8px; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.sup-msg header time { font-weight: 500; }
.sup-msg p { margin: 0; white-space: pre-wrap; line-height: 1.45; }
.sup-action { display: grid; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.sup-action strong { font-size: 13.5px; }
.sup-action small { color: var(--muted); font-size: 12px; }
.sup-action.state-applicata { border-color: var(--st-ready); }
.sup-action-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sup-typing { justify-self: start; color: var(--muted); font-size: 13px; font-style: italic; margin: 0; }
.sup-reply { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.sup-reply-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.race-support-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px 16px; border-radius: 14px; background: #7c5cff; color: #fff; font-size: 14px; box-shadow: var(--shadow-card); }
.race-support-banner .button { background: #fff; color: #3b2a99; border: 0; }
.nav-support { margin-top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Console: verifica in due passaggi */
.twofa-steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 10px; font-size: 14px; line-height: 1.45; }
.twofa-qr { display: block; margin: 10px 0 6px; border-radius: 12px; background: #fff; padding: 6px; image-rendering: pixelated; }
.twofa-secret { display: inline-block; margin-top: 4px; padding: 3px 6px; border-radius: 6px; background: var(--surface-2); font-size: 13px; letter-spacing: .05em; word-break: break-all; }
.twofa-code { font-size: 24px !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

/* Console RACE: moduli ordinati, anagrafica, rendiconto */
.app-shell .stack-form { display: grid; gap: 14px; }
.app-shell .stack-form > .button { justify-self: start; }
.app-shell .stack-form label > span:first-child { color: var(--muted); font-size: 13px; font-weight: 500; }
.app-shell label > span:first-child .optional { margin-left: 4px; }
.module-card .module-text { flex: 1 1 auto; min-width: 0; }
.module-card .switch { flex: none; }
.console-jump { display: flex; flex-wrap: wrap; gap: 6px; }
.console-jump a { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.console-jump a:hover { background: var(--surface-3, var(--surface-2)); }
.console-sub { margin: 10px 0 0; font-size: 15px; }
.ref-list { display: grid; gap: 10px; }
.ref-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
@media (max-width: 900px) { .ref-row { grid-template-columns: 1fr 1fr; } }
.addr-row { display: grid; grid-template-columns: 120px 1fr 80px; gap: 12px; }
.addr-row label { display: grid; gap: 6px; }
.pay-state { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pay-pagato { background: var(--st-ready-bg); color: var(--st-ready); }
.pay-ritardo { background: var(--st-danger-bg); color: var(--st-danger); }
.pay-da_pagare { background: var(--st-attn-bg); color: var(--ink); }
.pay-row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pay-row form { flex: none; }
.app-shell .ins-kpi small a { color: inherit; }
/* Prova gratuita */
.health-prova { background: color-mix(in srgb, #7c5cff 16%, transparent); color: #6a4cf0; }
.trial-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, #f5b400 16%, var(--surface)); border: 1px solid color-mix(in srgb, #f5b400 45%, transparent); color: var(--ink); font-size: 14px; }
.trial-box { display: grid; gap: 12px; padding: 14px; border-radius: 14px; border: 1px dashed color-mix(in srgb, #f5b400 55%, var(--line)); }

/* Il mio locale: ordine del menu laterale */
.app-shell .nav-order-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.app-shell .nav-order-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 10px 6px 6px; border-radius: var(--r-sm, 12px); background: var(--surface-2); border: 1px solid transparent; }
.app-shell .nav-order-item.is-off { opacity: .6; }
.app-shell .nav-order-item.is-dragging { background: var(--surface); border-color: var(--accent); box-shadow: 0 10px 28px rgba(0,0,0,.14); position: relative; z-index: 2; }
.app-shell .nav-order-list.is-sorting { user-select: none; -webkit-user-select: none; }
.app-shell .nav-order-grip { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; font-size: 20px; color: var(--muted); cursor: grab; touch-action: none; }
.app-shell .nav-order-list.is-sorting .nav-order-grip { cursor: grabbing; }
.app-shell .nav-order-name { flex: 1; min-width: 0; font-weight: 600; }
.app-shell .nav-order-name small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.app-shell .nav-order-moves { display: flex; gap: 6px; }

/* Console: richieste di prova dal sito */
.lead-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.lead-filters .chip-button { text-decoration: none; }
.lead-list { display: grid; gap: 14px; }
.lead-card.is-new { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.lead-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.lead-head h2 { margin: 0; }
.lead-head p { margin: 4px 0 0; }
.lead-body { display: grid; gap: 8px; margin: 12px 0; }
.lead-contact { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; align-items: baseline; }
.lead-mods { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); }
.chip-static { display: inline-flex; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 13px; }
.lead-msg { margin: 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; white-space: pre-line; }
.lead-form { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 10px 14px; align-items: end; }
.lead-form .form-actions { grid-column: 1 / -1; margin: 0; }
@media (max-width: 640px) { .lead-form { grid-template-columns: 1fr; } }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; }

/* iPad/Safari: pagina e barra laterale sempre a tutta altezza, niente pagine che scappano di lato */
html:has(.app-shell), html:has(.app-shell) body { background: #F2F2F4; }
html[data-theme="dark"]:has(.app-shell), html[data-theme="dark"]:has(.app-shell) body { background: #0E0E10; }
.app-shell { min-height: 100vh; min-height: 100dvh; }
@media (min-width: 901px) {
  .sidebar { height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
}
.app-shell .page-shell { overflow-x: clip; }
.app-shell .kds-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.app-shell .card-title-row { flex-wrap: wrap; }
.app-shell .card-title-row .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }

/* Cassa: apertura e chiusura (turni di cassa) */
.app-shell .cassa-shift { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-bottom: 16px; }
.app-shell .cassa-shift-state { display: flex; align-items: center; gap: 12px; flex: 1 1 260px; }
.app-shell .cassa-shift-state > div { display: grid; gap: 2px; }
.app-shell .cassa-shift-state small { color: var(--muted); }
.app-shell .cassa-shift-dot { width: 12px; height: 12px; border-radius: 50%; background: #2BA868; box-shadow: 0 0 0 5px color-mix(in srgb, #2BA868 18%, transparent); flex: none; }
.app-shell .cassa-shift.is-closed .cassa-shift-dot { background: #E0533D; box-shadow: 0 0 0 5px color-mix(in srgb, #E0533D 18%, transparent); }
.app-shell .cassa-shift.is-closed { border: 1px solid color-mix(in srgb, #E0533D 30%, transparent); }
.app-shell .cassa-shift-nums { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.app-shell .cassa-shift-nums span { display: grid; gap: 1px; }
.app-shell .cassa-shift-nums small { color: var(--muted); font-size: 12px; }
.app-shell .cassa-shift-nums b { font-size: 18px; font-variant-numeric: tabular-nums; }
.app-shell .cassa-open-sheet { width: min(480px, calc(100vw - 20px)); }
.app-shell .cassa-open-sheet .sheet-body { display: grid; gap: 14px; }
.app-shell .cassa-recap { margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); }
.app-shell .cassa-recap summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; font-weight: 600; list-style: none; }
.app-shell .cassa-recap summary::-webkit-details-marker { display: none; }
.app-shell .cassa-recap [data-recap-list] { display: grid; gap: 4px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.app-shell .cassa-recap p { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 4px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.app-shell .cassa-recap p span { display: grid; }
.app-shell .cassa-recap p small { color: var(--muted); font-size: 12px; }
.app-shell .cassa-recap p b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-shell .cassa-recap p.is-paid { color: var(--muted); }
.app-shell .cassa-recap p.is-total { border-bottom: 0; font-weight: 700; font-size: 15px; }
.app-shell .cassa-log-amount.is-short { color: #D23A2A; }
.app-shell .cassa-log-amount.is-over { color: #B7791F; }
.app-shell .cassa-closures { margin-top: 16px; }
.app-shell .close-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.app-shell .close-recap h3 { margin: 18px 0 6px; font-size: 15px; }
.app-shell .close-lines, .app-shell .close-cuts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.app-shell .close-lines li, .app-shell .close-cuts li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.app-shell .close-lines li span { display: grid; }
.app-shell .close-lines small { color: var(--muted); font-size: 12px; }
.app-shell .close-lines b, .app-shell .close-cuts b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-shell .close-lines li.is-total { font-weight: 700; font-size: 16px; border-bottom-width: 2px; }
.app-shell .close-count { display: grid; gap: 14px; }
.app-shell .count-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.app-shell .count-head { grid-column: 1 / -1; margin: 6px 0 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.app-shell .count-cell { display: grid; gap: 4px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.app-shell .count-cell input { min-height: 44px; font-size: 18px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.app-shell .close-diff, .app-shell .close-verdict { padding: 12px 16px; border-radius: 14px; font-weight: 700; }
.app-shell .close-verdict { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 16px; font-size: 18px; }
.app-shell .close-verdict span { font-weight: 500; font-size: 14px; color: var(--muted); }
.app-shell .is-ok.close-diff, .app-shell .is-ok.close-verdict { background: var(--st-ready-bg); color: var(--st-ready); }
.app-shell .is-short.close-diff, .app-shell .is-short.close-verdict { background: var(--st-danger-bg); color: var(--st-danger); }
.app-shell .is-over.close-diff, .app-shell .is-over.close-verdict { background: var(--st-prep-bg); color: var(--st-prep); }
.app-shell .close-take { display: block; padding: 12px 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) { .app-shell .close-layout { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .app-shell .count-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print {
  .sidebar, .no-print, .notify-panel, .trial-banner { display: none !important; }
  .app-shell, html:has(.app-shell) body { background: #fff !important; color: #000; }
  .app-shell .page-shell { padding: 0; max-width: none; }
  .app-shell .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .app-shell .close-layout { grid-template-columns: 1fr 1fr; }
}

/* Console: Osservatorio */
.obs-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; margin-bottom: 16px; }
.obs-filters label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.obs-filter-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.obs-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.obs-kpi { display: grid; gap: 4px; }
.obs-kpi span { font-size: 13px; color: var(--muted); }
.obs-kpi strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.obs-kpi small { color: var(--muted); font-size: 12px; }
.obs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.obs-grid h3 { margin: 18px 0 8px; font-size: 15px; }
.obs-bars { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.obs-bars li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 56px; gap: 10px; align-items: center; font-size: 14px; }
.obs-bar-label { display: grid; min-width: 0; overflow-wrap: anywhere; }
.obs-bar-label small { color: var(--muted); font-size: 11.5px; }
.obs-bar { height: 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.obs-bar i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, #FF8A5B, #E5452A); }
.obs-bars b { text-align: right; font-variant-numeric: tabular-nums; }
.obs-heat { display: grid; gap: 4px; margin-top: 12px; overflow-x: auto; }
.obs-heat-row { display: grid; grid-template-columns: 44px repeat(14, minmax(22px, 1fr)); gap: 4px; align-items: center; }
.obs-heat-row > span { font-size: 12px; color: var(--muted); text-align: center; }
.obs-heat-row > span:first-child { text-align: left; font-weight: 600; }
.obs-heat-row i { height: 26px; border-radius: 6px; background: var(--surface-2); }
.obs-heat-row i.lvl-1 { background: color-mix(in srgb, #E5452A 25%, var(--surface-2)); }
.obs-heat-row i.lvl-2 { background: color-mix(in srgb, #E5452A 50%, var(--surface-2)); }
.obs-heat-row i.lvl-3 { background: color-mix(in srgb, #E5452A 75%, var(--surface-2)); }
.obs-heat-row i.lvl-4 { background: #E5452A; }
.obs-trend { display: flex; align-items: flex-end; gap: 3px; height: 80px; margin-top: 18px; }
.obs-trend i { flex: 1; min-width: 3px; border-radius: 4px 4px 1px 1px; background: color-mix(in srgb, #E5452A 70%, transparent); }
.obs-table { width: 100%; font-size: 14px; }
.obs-table td, .obs-table th { padding: 8px 6px; text-align: left; }
.obs-table tr.is-thin td { color: var(--muted); }
.obs-privacy { margin-top: 16px; }
@media (max-width: 1000px) { .obs-grid, .obs-filters { grid-template-columns: 1fr; } }

/* ------------------------------------------------ Console: commerciali e preventivi */
.sales-link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px 16px; align-items: center; margin-bottom: 16px; }
.sales-link > div { display: grid; gap: 2px; }
.sales-link small { color: var(--muted); }
.sales-link input { width: 100%; font-family: ui-monospace, monospace; font-size: 13px; cursor: copy; }
.sales-link .status-pill { grid-column: 1 / -1; justify-self: start; }
[data-select-all].is-copied { outline: 2px solid var(--success, #1f8a5b); }
.sales-lead { padding: 16px 0; border-bottom: 1px solid var(--line); }
.sales-lead:last-child { border-bottom: 0; }
.sales-add { margin-top: 14px; }
.sales-add summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.sales-add form { margin-top: 10px; }
.lead-assign { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.lead-assign label { flex: 1 1 220px; }
.quote-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.quote-total { position: sticky; top: 16px; display: grid; gap: 8px; }
.quote-total p { margin: 0; }
.quote-total input[readonly] { width: 100%; font-size: 13px; cursor: copy; }
.quote-list { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.quote-final { font-size: 30px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.quote-warn { padding: 8px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, #d97706 14%, transparent); color: #b45309; }
.quote-warn[hidden] { display: none; }
.quote-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 14px 0; }
.quote-mod { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.quote-mod span { display: grid; gap: 2px; }
.quote-mod small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.quote-mod em { font-style: normal; font-size: 13px; font-weight: 650; white-space: nowrap; }
.quote-mod.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.quote-state { font-weight: 600; }
.quote-state.st-da_approvare { color: #b45309; }
.quote-state.st-approvato { color: #2563eb; }
.quote-state.st-accettato { color: #1f8a5b; }
.quote-state.st-rifiutato, .quote-state.st-perso { color: #b91c1c; }
.discount-card { margin-bottom: 14px; }
.discount-card p { margin: 10px 0; }
.discount-big { font-size: 30px; font-weight: 800; color: #b45309; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .quote-layout, .sales-link { grid-template-columns: 1fr; } .quote-total { position: static; } }
