/* dashboard/css/40-clienti.css — estratto da app.css (2026-07, split senza build). */
/* === Clienti tab redesign · sub-tabs + slide-in detail === */

/* Sub-tabs (Lista | Gruppi) sotto il titolo, fuori dal 40/60 */
.cli-subtabs { display: flex; padding: 0; border-bottom: 1px solid var(--line); background: var(--surface); margin-bottom: 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; position: sticky; top: 0; z-index: 20; }
.cli-subtabs::-webkit-scrollbar { display: none; }
.cli-subtab { padding: 12px 18px; border: none; border-bottom: 2px solid transparent; background: transparent; font-size: 14px; font-weight: 700; color: var(--ink-3); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: color .12s, border-color .12s; margin-bottom: -1px; white-space: nowrap; flex-shrink: 0; text-decoration: none; }
.cli-subtab:hover { color: var(--ink); }
.cli-subtab.active { color: var(--brand); border-bottom-color: var(--brand); }
.cli-subtab .chip-count { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-weight: 700; }
.cli-subtab.active .chip-count { background: var(--brand-soft); color: var(--brand); }
.cli-subtab .badge-n { font-size: 10px; padding: 2px 7px; border-radius: 999px; background: var(--danger); color: #fff; font-weight: 700; }
/* Label sub-tab responsive: piena su desktop, abbreviata su mobile (breakpoint = cli-sort-mobile) */
.cli-subtab .lbl-short { display: none; }
@media (max-width: 640px) {
  .cli-subtab .lbl-full { display: none; }
  .cli-subtab .lbl-short { display: inline; }
}

/* Cli views (Lista | Gruppi) · full-width */
.cli-view { display: none; }
.cli-view.active { display: block; padding-bottom: 24px; }
/* Promo sub-tab: respiro tra .cli-subtabs sticky e il primo titolo (era attaccato su mobile) */
.cli-view[data-promo-view].active { padding-top: 14px; }
/* Bonus-reg e Mostra-in-cassa: form a contenuto pieno → serve padding orizzontale di pagina (mkt-intro ce l'ha già: azzero per non duplicare) */
.cli-view[data-promo-view="bonus-reg"].active,
.cli-view[data-promo-view="bonus-compleanno"].active,
.cli-view[data-promo-view="cassa"].active { padding-left: var(--page-pad-x); padding-right: var(--page-pad-x); }
.cli-view[data-promo-view="bonus-reg"] .mkt-intro,
.cli-view[data-promo-view="bonus-compleanno"] .mkt-intro,
.cli-view[data-promo-view="cassa"] .mkt-intro { padding-left: 0; padding-right: 0; }
.cli-view[data-promo-view="bonus-reg"] .section-title,
.cli-view[data-promo-view="bonus-compleanno"] .section-title { padding-left: 0; padding-right: 0; }
.cli-view[data-promo-view="bonus-compleanno"] .u-note-inline-pad { margin-left: 0; margin-right: 0; }
.cli-view[data-promo-view="bonus-reg"] .metric-rows,
.cli-view[data-promo-view="bonus-compleanno"] .metric-rows { margin: 0; }
/* Il disclosure (storico bonus) ha margin orizzontale 18px pensato per pagine
   full-width: nel pane già paddato va a filo con titolo e card. */
.cli-view[data-promo-view="bonus-reg"] .reservations-disclosure { margin-left: 0; margin-right: 0; }
/* Pill range temporale dello Storico campagne (Promo · chip riusate da Fatture) */
.storico-chip-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 var(--page-pad-x) 14px; }

/* Slide-in customer detail pane · mobile fullscreen, desktop pannello da destra */
.cust-pane { position: fixed; top: 0; right: 0; bottom: 0; width: 100%; background: var(--surface); transform: translateX(100%); transition: transform .3s ease; z-index: 40; overflow-y: auto; overflow-x: hidden; box-shadow: -12px 0 32px rgba(0,0,0,0.16); padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.cust-pane.open { transform: translateX(0); }
@media (min-width: 1024px) { .cust-pane { width: min(560px, 50vw); border-left: 1px solid var(--line); } }

.cust-pane-head { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 18px 12px; display: flex; align-items: center; gap: 12px; }
.cust-pane-head .back { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg); color: var(--ink); cursor: pointer; flex-shrink: 0; }
.cust-pane-head .back:hover { background: var(--line); }
.cust-pane-head .head-body { flex: 1; min-width: 0; }
.cust-pane-head h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin: 0; line-height: 1.2; }
.cust-pane-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.cust-pane-tabs { position: sticky; top: 64px; z-index: 4; background: var(--surface); padding: 10px 18px; border-bottom: 1px solid var(--line); }
.cust-pane-tabs .modal-tabs { margin-bottom: 0; }
.cust-pane-body { padding: 16px 18px calc(24px + 68px + env(safe-area-inset-bottom)); }
.cust-pane-body .section-title { padding-left: 0; padding-right: 0; }
.card-banner { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.card-banner-serial { font-size: 15px; font-weight: 700; font-family: 'SF Mono', ui-monospace, monospace; color: var(--ink); letter-spacing: 0.04em; }
.card-banner-meta { display: flex; gap: 18px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.card-banner-meta strong { color: var(--ink); font-weight: 700; }
.card-banner-link { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none; }
.card-banner-link:hover { text-decoration: underline; }
.cust-pane-empty { display: none; }

.cust-card.active-pane { background: var(--brand-soft); border-left: 3px solid var(--brand); }

/* Toolbar (pills + ricerca + Ordina) visibile solo nella sub-tab Lista */
body[data-cli-view="gruppi"] .clienti-toolbar,
body[data-cli-view="azioni"] .clienti-toolbar,
body[data-cli-view="ticket"] .clienti-toolbar { display: none; }

/* "Altri filtri": lista verticale (.chip-more-row), non pill — richiesta Andrea. */
/* Nella toolbar Clienti il chip sta a INIZIO riga (non a destra come nel
   layout d'origine del componente): il pannello ancorato right:0 usciva dal
   viewport a sinistra su mobile → ancora a sinistra + clamp alla finestra
   (18px = --page-pad-x per lato). */
.clienti-toolbar .chip-more-panel { right: auto; left: 0; max-width: calc(100vw - 36px); }
.chip-more-list { min-width: 210px; padding: 6px; gap: 2px; }
.chip-more-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; cursor: pointer; transition: background 120ms ease, color 120ms ease; }
.chip-more-row:hover { background: var(--bg); color: var(--ink); }
/* Riga di lista, non pill: qui l'acceso e' il fondo brand-soft (stesso trattamento
   di .colmenu-sort-row.is-active), non l'outline dei chip. */
.chip-more-row.is-on { background: var(--brand-soft); color: var(--brand); }
.chip-more-row .chip-count { padding: 1px 7px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 11px; font-weight: 700; line-height: 1.5; }
.chip-more-row:hover .chip-count { background: var(--brand-soft); color: var(--brand); }
.chip-more-row.is-on .chip-count { background: var(--surface); color: var(--brand); }

/* "Ordina" mobile: select nativo (picker OS, zero problemi iOS). Visibile solo su
   mobile; su desktop si ordina dagli header cliccabili. */
.cli-sort-mobile { display: flex; align-items: center; gap: 8px; }
.cli-sort-lbl { flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--ink-2); }
/* 14px/500: un gradino sopra i chip (13/600) senza peso da titolo — il 16/600
   originale sbilanciava la pill. Niente vincolo iOS ≥16px: il viewport della
   dashboard ha maximum-scale=1, l'auto-zoom al focus non esiste. */
.cli-sort-mobile select { flex: 1; min-width: 0; height: 42px; border: 1px solid var(--line); border-radius: 999px; padding: 0 38px 0 14px; font-size: 14px; font-weight: 500; color: var(--ink); background-color: var(--surface); cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A93A4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.cli-sort-mobile select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
@media (min-width: 800px) { .cli-sort-mobile { display: none; } }

.cface { display: none; }
.cface.active { display: block; }

/* Stepper Azioni (Clienti → banner A4 + attivazione campagna) */
.az-stepper { max-width: 560px; margin: 0 auto; }
/* margin-right riserva lo spazio della .sheet-close (X assoluta: 32px + 16px right):
   senza, l'ultimo segmento della progress finisce sotto la X e ne rompe l'allineamento. */
.az-step-progress { display: flex; gap: 6px; margin: -4px 44px 12px 0; }
.az-step-progress > span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.az-step-progress > span.done { background: var(--brand); }
.az-step-num { font-size: 11px; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.az-step-ttl { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1.25; }
.az-step-sub { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin-top: 6px; margin-bottom: 16px; }
.az-step-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.az-step-actions > button { flex: 1; min-width: 120px; padding: 10px 14px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
/* Banner A4 preview */
.az-banner-preview { background: #fff; border: 2px dashed var(--line); border-radius: 12px; padding: 32px 28px; text-align: center; aspect-ratio: 1 / 1.414; max-height: 380px; margin: 0 auto; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 4px 16px rgba(0,0,0,0.05); }
.azb-content { display: flex; flex-direction: column; justify-content: center; flex: 1; }
.azb-headline { font-size: 32px; font-weight: 900; color: var(--brand); letter-spacing: -0.03em; line-height: 1.1; }
.azb-body { font-size: 15px; color: var(--ink); font-weight: 600; line-height: 1.4; margin-top: 12px; }
.azb-logo { padding-top: 14px; border-top: 1.5px solid var(--brand); display: flex; justify-content: center; }
.azb-logo img { max-width: 70%; height: 28px; object-fit: contain; }
.az-banner-edit { background: var(--bg); border-radius: 10px; padding: 12px 14px; margin-top: 14px; }
.az-banner-edit .abe-ttl { font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.az-banner-edit .abe-ttl small { font-weight: 500; color: var(--ink-3); font-size: 11px; }
.az-banner-edit .field { margin-bottom: 10px; }
.az-banner-edit .field:last-child { margin-bottom: 0; }
.az-banner-edit label { display: block; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.az-banner-edit input, .az-banner-edit textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; font-family: inherit; background: var(--surface); }
.az-banner-edit textarea { resize: vertical; min-height: 50px; }
.az-banner-edit .abe-hint { font-size: 11px; color: var(--ink-3); margin-top: 8px; line-height: 1.4; font-style: italic; }
/* (Campaign summary box ora usa .metric-rows/.metric-row di Promo direttamente) */
.az-done-ico { text-align: center; margin: 8px 0 16px; }
.az-done-ico svg { width: 56px; height: 56px; padding: 14px; border-radius: 50%; background: #E8F8EE; }

/* "Azioni in lavanderia" (ex "azioni dai dati cliente"): stessa struttura di
   "Azioni rapide" + Happy Hour — section-title al top + tile .create-alt-tile in
   .u-mx-18-mt-12, NIENTE riquadro. Prova storica reale (Parte 2): riga sotto il
   sub, resa solo se l'azione ha history_line (es. reactivate -> dormienti). */
.create-alt-tile .as-proof { font-size: 11px; font-weight: 700; color: var(--ink-2); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* Toolbar Clienti · SOLO pill filtri, nude sul fondo grigio come in Macchine
   e Ticket (niente card — Andrea 28/07); Ordina e Cerca vivono nella
   report-card della lista. */
.clienti-toolbar { padding: 12px var(--page-pad-x) 0; display: flex; flex-direction: column; gap: 10px; }
/* 2 filtri principali + "Altri filtri": stanno su una riga, niente scroll. */
.clienti-toolbar .filter-row { padding: 0; margin: 0; align-items: center; flex-wrap: wrap; gap: 6px; }
.cface-empty { text-align: center; padding: 48px 24px; color: var(--ink-3); }
.cface-empty .ttl { font-size: 16px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.cface-empty .sub { font-size: 13px; line-height: 1.5; }
/* "Mostra altri N" in fondo alla lista clienti (blocchi htmx). */
.cli-more { display: flex; justify-content: center; padding: 16px 0 8px; }

.cat-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 0 18px 8px; cursor: pointer; transition: border-color .12s; }
.cat-card:hover { border-color: var(--brand); }
.cat-card .cat-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cat-card .cat-body { flex: 1; min-width: 0; }
.cat-card .cat-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.cat-card .cat-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.cat-card .cat-count { font-size: 18px; font-weight: 800; color: var(--ink); margin-right: 4px; }
.cat-card .cat-settings { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink-3); }
.cat-card .cat-settings:hover { background: var(--bg); color: var(--brand); }

/* nowrap + .ttl restringibile: col wrap il flex spezzava la riga sulla larghezza
   NATURALE del titolo (prima di restringerlo), così i nomi/sub lunghi buttavano
   .head-actions sotto il blocco titolo. Il sub va a capo dentro .ttl, il bottone
   resta in alto a dx. */
.cat-detail-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; }
/* Back = bottone circolare col linguaggio dei bottoni del progetto (surface +
   bordo --line, hover come .btn-secondary): visibile e tappabile, non un
   chevron che galleggia sul fondo pagina. */
.cat-detail-head .back { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; flex-shrink: 0; transition: background .15s, border-color .15s; }
.cat-detail-head .back:hover { border-color: var(--ink-3); background: var(--bg); }
.cat-detail-head .back svg { width: 18px; height: 18px; }
.cat-detail-head .ttl { flex: 1 1 auto; min-width: 0; }
.cat-detail-head .ttl h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.cat-detail-head .ttl .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.cat-detail-head .settings-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--bg); color: var(--ink-2); cursor: pointer; }
.cat-detail-head .settings-btn:hover { background: var(--brand-soft); color: var(--brand); }
/* A dx dell'header resta SOLO l'azione di gestione (Configura gruppo):
   identità a sx, gestione a dx. align-self: start lo tiene sulla riga del nome
   (non centrato fra nome e sub) anche quando il sub va a capo. */
.cat-detail-head .head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; align-self: flex-start; flex-shrink: 0; }
/* Riga azioni marketing del gruppo, sotto l'header: CTA primario (Invia
   messaggio) + Attiva offerta. Su schermi stretti i bottoni si allargano.
   Più aria (Andrea 27/07): stacco verticale dall'header e pill più comodi,
   vale anche per i drill-down Promo che riusano queste classi. */
.cat-detail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 var(--page-pad-x); margin: 12px 0 16px; }
.cat-detail-actions .u-pill-md { font-size: 13px; padding: 10px 16px; }
@media (max-width: 640px) {
  .cat-detail-actions .btn-primary, .cat-detail-actions .btn-secondary { flex: 1; }
}
/* I bottoni secondari di questa vista (Configura, Attiva offerta) vivono
   DIRETTAMENTE sul fondo pagina (--bg): lo sfondo grigio di .btn-secondary li
   mimetizzava. Stesso linguaggio del .back qui sopra → surface (bianco) + bordo
   --line; l'hover scende a --bg per dare feedback. */
.cat-detail-head .head-actions .btn-secondary,
.cat-detail-actions .btn-secondary { background: var(--surface); }
.cat-detail-head .head-actions .btn-secondary:hover,
.cat-detail-actions .btn-secondary:hover { background: var(--bg); }
/* Descrizione custom del gruppo (da Configura gruppo); hidden se non impostata. */
.cat-detail-desc { padding: 0 var(--page-pad-x); margin: 4px 0 4px; font-size: 13px; color: var(--ink-2); line-height: 1.5; max-width: 640px; }

.cust-card.with-check { padding-left: 8px; }
.cust-card .check { width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 6px; display: none; align-items: center; justify-content: center; flex-shrink: 0; background: var(--surface); }
.cust-card.with-check .check { display: inline-flex; }
body[data-op-select="on"] [data-cli-view="lista"] .cust-card .check { display: inline-flex; }
/* Selettore a SINISTRA dell'avatar (come nei membri Gruppi): il .check è il
   primo figlio della card e in select-mode prende una colonna grid dedicata,
   che spanna le due righe su mobile. Da spento è display:none → non occupa
   traccia e valgono le aree di default (42-andamento.css). */
.cust-card > .check { grid-area: check; }
body[data-op-select="on"] [data-cli-view="lista"] .cust-card {
  padding-left: 8px;
  grid-template-columns: 22px 44px 1fr auto;
  grid-template-areas: "check av name balance" "check av details details";
}
@media (min-width: 800px) {
  body[data-op-select="on"] [data-cli-view="lista"] .cust-card {
    grid-template-columns: 22px 44px 1fr 56px 56px 56px 64px 116px 124px;
    grid-template-areas: "check av name email push sconto tipo balance visit";
  }
  /* Header riallineato alle card: stessa colonna check (vuota) davanti e
     stesso padding-left ridotto. */
  body[data-op-select="on"] [data-cli-view="lista"] .cust-table-head {
    grid-template-columns: 22px 44px 1fr 56px 56px 56px 64px 116px 124px;
    padding-left: 8px;
  }
  body[data-op-select="on"] [data-cli-view="lista"] .cust-table-head .cth-nome { grid-column: 1 / 4; }
}
.cust-card.selected { border-color: var(--brand); background: var(--brand-soft); }
.cust-card.selected .check { background: var(--brand); border-color: var(--brand); color: #fff; }
.cust-card.selected .check svg { display: block; }
.cust-card .check svg { display: none; width: 14px; height: 14px; stroke: #fff; stroke-width: 3; }

.bulk-bar { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); background: var(--surface); color: var(--ink); padding: 14px 18px 16px; margin: 16px 18px 0; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(15,20,25,0.12); display: none; z-index: 39; }
@media (min-width: 1024px) { .bulk-bar { bottom: 12px; margin: 16px 18px 12px; } }
.bulk-bar.active { display: block; }
.bulk-bar .bulk-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; }
.bulk-bar .bulk-count { font-weight: 700; color: var(--brand); }
.bulk-bar .bulk-clear { color: var(--ink-3); cursor: pointer; font-size: 12px; font-weight: 600; }
.bulk-bar .bulk-clear:hover { color: var(--ink); text-decoration: underline; }
.bulk-bar .bulk-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bulk-bar .bulk-action { padding: 12px 6px; background: var(--bg); color: var(--ink); border-radius: 10px; font-size: 12px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1px solid var(--line); cursor: pointer; line-height: 1.2; text-align: center; text-decoration: none; }
/* "Seleziona tutti" vive nella testata della report-card ma solo in modalita'
   selezione (body[data-op-select] via toggleOpSelectMode). Specificita' >
   .btn-secondary. */
.report-card [data-op-select-all] { display: none; }
body[data-op-select="on"] .report-card [data-op-select-all] { display: inline-flex; }
/* Avviso lista incompleta: solo in modalita' selezione — la selezione agisce
   sulle righe caricate, per "tutti" serve prima "Mostra altri". */
.op-select-hint { display: none; }
body[data-op-select="on"] .op-select-hint { display: block; }
/* Card di testata lista (proposta Andrea 28/07): h2 filtro+conteggio con
   Seleziona a destra, poi riga Scarica, Ordina (mobile) e Cerca.
   La search-bar è l'ultima riga della card → niente border-bottom, il bordo
   della card fa già da chiusura. */
.report-card .search-bar { border-bottom: 0; }
.report-card .report-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px 0; }
.report-card .report-actions .btn-secondary { color: var(--brand); }
.report-card .cli-sort-mobile { padding: 12px 16px 0; }
/* In selezione spariscono SOLO gli Scarica: download e selezione mai insieme
   (confondevano, Andrea 27/07) — i selezionati si scaricano dalla bulk-bar.
   Titolo, Seleziona/Esci e Cerca restano usabili. */
body[data-op-select="on"] #clientiListaSwap .report-card .report-actions { display: none; }
.bulk-bar .bulk-action:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.bulk-bar .bulk-action svg { width: 20px; height: 20px; color: var(--brand); stroke-width: 2; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 16px; font-family: inherit; font-weight: 500; transition: border-color 120ms ease, box-shadow 120ms ease; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
/* Select: nascondi chrome browser, applica chevron custom coerente con input style */
.field select { -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 38px; cursor: pointer; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238A93A4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px 14px; }
.field select:focus { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238C0014' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); }
.field textarea { min-height: 80px; resize: vertical; }
.field.half { max-width: calc(50% - 5px); }
/* Validazione: messaggio errore con stile nostro (sostituisce il bubble nativo del browser) */
.field-error { color: var(--danger); font-size: 12px; font-weight: 600; margin-top: 6px; padding-left: 2px; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"],
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.field.third { max-width: calc(33% - 5px); }
.field.wide { max-width: calc(70% - 5px); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.city-cap { grid-template-columns: 1fr 2fr; }
.field-inline { display: flex; gap: 8px; align-items: center; }
.field-prefix { display: flex; align-items: center; gap: 0; flex: 1; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding-left: 12px; transition: border-color 120ms ease, box-shadow 120ms ease; }
.field-prefix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field-prefix .prefix { font-size: 16px; font-weight: 600; color: var(--ink); flex-shrink: 0; }
.field-prefix input { border: none !important; background: none !important; box-shadow: none !important; padding-left: 4px; flex: 1; min-width: 0; }
.field.req label::after { content: ' *'; color: var(--danger); font-weight: 700; }
.field.is-err input, .field.is-err select { border-color: var(--danger); }
.field .field-err { color: var(--danger); font-size: 11px; margin-top: 4px; }
.field-suffix { display: flex; align-items: center; gap: 6px; }
.field-suffix input { flex: 1; }
.field-suffix .suffix { font-size: 16px; font-weight: 600; color: var(--ink-3); flex-shrink: 0; }

/* Form Happy Hour (planner solo cassa): i controlli stanno in <fieldset> (fuori da
   .field), quindi legend, righe checkbox e fasce orarie vanno stilati esplicitamente. */
.happy_hour_form fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.happy_hour_form legend { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; padding: 0; }
.happy_hour_form .field-row .field { margin-bottom: 0; }
.happy_hour_form .chk-row { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.happy_hour_form .chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; }
.happy_hour_form .chk-all { display: flex; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.happy_hour_form .chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
.happy_hour_form .chk input { width: auto; margin: 0; accent-color: var(--brand); flex-shrink: 0; }
.happy_hour_form .time-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.happy_hour_form .time-row:last-child { margin-bottom: 0; }
.happy_hour_form .time-row input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 16px; font-family: inherit; font-weight: 500; }
.happy_hour_form .time-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.happy_hour_form .time-row span { color: var(--ink-3); font-weight: 600; flex-shrink: 0; }
/* Header: titolo + badge "solo cassa" non devono finire sotto la X (assoluta top-right) */
.happy_hour_form h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-right: 44px; line-height: 1.25; margin-bottom: 20px; }
/* Date Dal/Al col calendario del progetto (.dt-field). NB: .field-row è display:flex
   (definizione globale che vince), quindi qui si ragiona in flex, non in grid: su
   mobile i due campi data (trigger largo con icona) si impilano a piena larghezza,
   da ≥480px stanno su due colonne uguali che si restringono (min-width:0 → niente
   overflow oltre il bordo del modale). */
.happy_hour_form .hh-dates { align-items: start; flex-wrap: wrap; }
.happy_hour_form .hh-dates .dt-field { flex: 1 1 100%; min-width: 0; }
@media (min-width: 480px) { .happy_hour_form .hh-dates .dt-field { flex: 1 1 0; } }
.happy_hour_form .hh-dates .dt-trigger { min-width: 0; width: 100%; }
/* iOS zooma sugli input con font < 16px: il testo data deve stare a 16px (e si legge meglio) */
.happy_hour_form .dt-trigger .dt-display { font-size: 16px; }
/* Dal/Al sono in fondo al modale scrollabile: apri il popover VERSO L'ALTO così
   non viene clippato dall'overflow del .sheet (solo desktop; su touch è display:none
   e si usa il picker OS nativo). */
.happy_hour_form .hh-dates .dt-popover { top: auto; bottom: calc(100% + 6px); }
/* la colonna Al allinea il popover a destra per non sforare il bordo del modale */
.happy_hour_form .hh-dates .dt-field:last-child .dt-popover { left: auto; right: 0; }
.cal-nav-row { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 18px; }
.cal-nav-btn { width: 30px; height: 30px; border-radius: 8px; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; color: var(--ink); cursor: pointer; text-decoration: none; }
.cal-nav-btn:hover { background: var(--line); }
.cal-nav-btn.u-disabled { opacity: .3; pointer-events: none; }
.cal-nav-label { font-size: 14px; font-weight: 700; text-transform: capitalize; min-width: 120px; text-align: center; }
.fatture-chip-row { padding: 8px var(--page-pad-x) 16px; }
.fatture-disclaimer { padding: 20px var(--page-pad-x) 12px; color: var(--ink-3); font-size: 16px; line-height: 1.6; }
.fattura-desc-input { border: none; border-bottom: 1px dashed var(--line); background: transparent; font-size: 13px; padding: 4px 2px; width: 100%; min-width: 280px; color: var(--ink); }
.fattura-desc-input:focus { border-bottom-color: var(--brand); outline: none; }
/* iOS zooma al focus se il font e' < 16px: su touch sale a 16px (come .dt-filter-input).
   Conta con l'autofocus sul primo campo, che altrimenti zooma all'apertura di Fatture.
   min-width piu' larga col font 16px: la descrizione tipo ("Servizi di lavanderia
   self-service") deve leggersi intera — un input non wrappa e il placeholder non
   scorre; la tabella scrolla gia' in orizzontale (mov-table-wrap). */
@media (hover: none) and (pointer: coarse) {
  .fattura-desc-input { font-size: 16px; min-width: 340px; }
}

/* Gestione detersivi — grid card con stato consumo (ok/warn/alarm/empty) */
.and-pane-head { padding: 14px var(--page-pad-x) 0; }
.and-pane-head h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 4px; }
.and-pane-head .and-pane-sub { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.detersivi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 14px var(--page-pad-x) 0; }
.detersivo-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: border-color 120ms ease, box-shadow 120ms ease; }
.detersivo-card--ok { border-color: var(--line); }
.detersivo-card--warn { border-color: #F5D9B5; background: linear-gradient(180deg, #FFFCF7 0%, var(--surface) 70%); }
.detersivo-card--alarm { border-color: #FCA5A5; background: linear-gradient(180deg, #FEF6F6 0%, var(--surface) 70%); box-shadow: 0 0 0 1px #FCA5A5; }
.detersivo-card--empty { opacity: 0.7; background: var(--bg); }
.detersivo-card .dc-head { display: flex; flex-direction: column; gap: 2px; position: relative; }
.detersivo-card .dc-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.detersivo-card .dc-desc { font-size: 12px; color: var(--ink-3); }
.detersivo-card .dc-badge { position: absolute; top: 0; right: 0; background: var(--danger); color: #fff; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; }
.detersivo-card .dc-body { display: flex; flex-direction: column; gap: 10px; }
.detersivo-card .dc-progress { display: flex; flex-direction: column; gap: 4px; }
.detersivo-card .dc-progress-bar { width: 100%; height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.detersivo-card .dc-progress-fill { height: 100%; background: var(--ok); border-radius: 999px; transition: width 200ms ease; }
.detersivo-card--warn .dc-progress-fill { background: var(--warn); }
.detersivo-card--alarm .dc-progress-fill { background: var(--danger); }
.detersivo-card .dc-progress-meta { display: flex; justify-content: space-between; font-size: 12px; }
.detersivo-card .dc-pct { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.detersivo-card--warn .dc-pct { color: var(--warn); }
.detersivo-card--alarm .dc-pct { color: var(--danger); }
.detersivo-card .dc-litri { color: var(--ink-3); }
.detersivo-card .dc-meta-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.detersivo-card .dc-meta-lbl { color: var(--ink-2); }
.detersivo-card .dc-meta-val { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.detersivo-card .dc-empty-note { font-size: 12px; color: var(--ink-3); font-style: italic; padding-top: 4px; }
.dc-stepper { display: inline-flex; align-items: center; gap: 4px; touch-action: manipulation; }
.dc-stepper .dc-step-btn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 1; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.dc-stepper .dc-step-btn:hover { border-color: var(--brand); color: var(--brand); }
.dc-stepper input { width: 44px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 8px; text-align: center; font-size: 16px; font-weight: 700; font-family: inherit; color: var(--ink); background: var(--surface); font-variant-numeric: tabular-nums; }
.dc-stepper input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
/* Variante modal macchina (minuti asciugatrice): bottoni 36px con glifo 20px ben
   visibile ma non ingombrante, input 16px per non zoomare su iOS al focus. */
.dc-stepper--lg { gap: 6px; }
.dc-stepper--lg .dc-step-btn { width: 40px; height: 40px; font-size: 22px; border-radius: 10px; }
.dc-stepper--lg input { width: 60px; height: 40px; font-size: 16px; }

/* LCS Password: campo type="text" mascherato come password SENZA essere un
   password field (così iOS Safari non propone "usa password sicura"/autofill).
   Fallback plaintext su browser senza -webkit-text-security (raro; il codice
   LCS non è segreto — si imposta fisicamente nell'LCS in lavanderia). */
.lcs-pw { -webkit-text-security: disc; }

/* Prices grid — modal macchina tab Prezzi: 2 gruppi (Cash · Loyalty card) con header brand */
.prices-grid { display: flex; flex-direction: column; gap: 12px; }
.prices-group { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.prices-group-head { padding: 10px 14px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.02em; text-align: center; }
.prices-group-head .prices-group-alias { display: inline-block; font-size: 11px; font-weight: 400; opacity: 0.78; margin-left: 4px; }
/* Slot table macro/sub alias (asciugatrice modal Macchina + Listini bulk) */
.slot-prices-table thead tr.slot-th-group th .macro-alias { display: block; font-size: 10px; font-weight: 400; color: rgba(255,255,255,0.78); text-transform: none; letter-spacing: 0; margin-top: 2px; }
.slot-prices-table thead tr.slot-th-sub th .sub-alias { display: block; font-size: 10px; font-weight: 400; color: var(--ink-3); text-transform: none; letter-spacing: 0; margin-top: 2px; opacity: 0.75; }
.slot-prices-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.prices-group-body { padding: 12px 14px 6px; }
.prices-group-body--3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.prices-group-body .field { margin-bottom: 6px; }
.prices-group-body .field label { text-align: center; }
.prices-group-body .field input { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 480px) {
  .prices-group-body--3col { grid-template-columns: 1fr; }
}
.dt-field.half { display: flex; }
.dt-field.half .dt-trigger { min-width: 0; width: 100%; }
.field-inline input { flex: 1; }

.radio-group { display: flex; gap: 8px; }
.radio-group label { flex: 1; padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; text-align: center; font-size: 13px; font-weight: 600; cursor: pointer; }
.radio-group input { display: none; }
.radio-group input:checked + label { background: var(--brand); color: #fff; border-color: var(--brand); }
.radio-group label small { display: block; font-size: 11px; font-weight: 500; opacity: 0.75; margin-top: 2px; }

.sheet-actions-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.sheet-action { padding: 14px 8px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; transition: border-color 120ms ease, background 120ms ease, transform 80ms ease; text-decoration: none; }
.sheet-action:hover { border-color: var(--brand); background: var(--brand-soft); }
.sheet-action:active { transform: scale(0.95); }
.sheet-action.brand:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.sheet-action.go:hover { background: #15803D; border-color: #15803D; }
.sheet-action.warn:hover { background: #B8721A; border-color: #B8721A; }
.sheet-action.stop:hover { background: #B91C1C; border-color: #B91C1C; }
.sheet-action.u-disabled { opacity: 0.45; cursor: not-allowed; }
.sheet-action.u-disabled:hover { border-color: var(--line); background: var(--surface); }
.sheet-action.u-disabled:active { transform: none; }
.sheet-action.go { background: var(--ok); color: #fff; border-color: var(--ok); }
.sheet-action.warn { background: var(--warn); color: #fff; border-color: var(--warn); }
.sheet-action.stop { background: var(--danger); color: #fff; border-color: var(--danger); }
.sheet-action.brand { background: var(--brand); color: #fff; border-color: var(--brand); }

.btn-primary { background: var(--brand); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; transition: background 120ms ease, transform 80ms ease; }
/* L'attributo hidden deve vincere sul display author dei bottoni (stessa
   trappola di .promo-row[hidden]: l'UA stylesheet perde contro la classe). */
.btn-primary[hidden], .btn-secondary[hidden] { display: none; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { transform: scale(0.97); }
.btn-secondary { background: var(--bg); color: var(--ink); padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 700; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; transition: background 120ms ease, border-color 120ms ease, transform 80ms ease; }
.btn-secondary:hover { background: var(--surface); border-color: var(--ink-3); }
.btn-secondary:active { transform: scale(0.97); }
.btn-danger { background: var(--danger); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; transition: background 120ms ease, transform 80ms ease; }
.btn-danger:hover { background: #B91C1C; }
.btn-danger:active { transform: scale(0.97); }
.btn-danger-ghost { width: 100%; margin-top: 12px; padding: 10px 12px; background: transparent; border: 1px solid #FCA5A5; color: var(--danger); border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .12s; }
.btn-danger-ghost:hover { background: #FEE2E2; }

.warn-note { margin-top: 12px; padding: 10px 12px; background: #FFF8DB; border: 1px solid #FCE4A0; border-radius: 10px; font-size: 12px; color: #8B6500; display: flex; gap: 8px; align-items: flex-start; }

