/* dashboard/css/42-andamento.css — estratto da app.css (2026-07, split senza build). */
/* ===== ANDAMENTO sub-tab ===== */
.chips { padding: 12px 18px 0; display: flex; gap: 6px; overflow-x: auto; flex-shrink: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; padding: 7px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
.chip:hover:not(.active):not(.chip-on) { border-color: var(--brand); color: var(--ink); }
.chip:active { transform: scale(0.96); }
/* Selezionato = pill outline brand (stessi valori di .hdr-action). Era nero pieno:
   fuori palette, e nella card Periodo confondibile col pill brand-soft del valore,
   che invece resta senza bordo. Il bordo c'e' gia' a 1px → nessuno shift di layout. */
.chip.active,
.chip.chip-on { background: var(--surface); color: var(--brand); border-color: var(--brand); font-weight: 700; }
/* Count come badge staccato dal nome (prima era testo inline → "sembrava parte del nome"). */
.chip .chip-count { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 11px; font-weight: 700; line-height: 1.5; vertical-align: baseline; }
.chip:not(.chip-on):not(.active):hover .chip-count { background: var(--brand-soft); color: var(--brand); }
.chip.active .chip-count,
.chip.chip-on .chip-count { background: var(--brand-soft); color: var(--brand); }
/* Punto 8 — popover "Altri filtri": summary = chip, panel assoluto coi filtri secondari. */
.chip-more { position: relative; flex-shrink: 0; }
/* NON impostare display:flex/inline-flex sul <summary>: rompe il toggle nativo del
   <details> su Safari/iOS. Il layout (testo+chevron) va su un wrapper interno. */
.chip-more > summary { list-style: none; cursor: pointer; }
.chip-more > summary::-webkit-details-marker { display: none; }
.chip-more > summary::marker { content: ""; }
.chip-more-inner { display: inline-flex; align-items: center; gap: 4px; }
/* iOS: il tap deve colpire il <summary>, non i suoi figli (toggle JS in app.js). */
.chip-more-inner, .chip-more-inner * { pointer-events: none; }
.chip-more .chip-more-chev { transition: transform 120ms ease; }
.chip-more[open] .chip-more-chev { transform: rotate(180deg); }
.chip-more-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-card); min-width: 190px; }
.chip-more-panel .chip { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.period-info { padding: 6px 18px 0; font-size: 11px; color: var(--ink-3); font-family: ui-monospace, monospace; }

.sub-chips { padding: 12px 18px 0; display: flex; gap: 6px; overflow-x: auto; flex-shrink: 0; }
.sub-chips::-webkit-scrollbar { display: none; }
.sub-chip { flex-shrink: 0; padding: 6px 12px; background: var(--surface); border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
.sub-chip:hover:not(.active) { border-color: var(--brand); color: var(--ink); }
.sub-chip:active { transform: scale(0.96); }
.sub-chip.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-soft); }

.kpi-banner { margin: 14px 18px 0; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; border-radius: 14px; padding: 16px 18px; box-shadow: 0 6px 16px rgba(140,0,20,0.25); }
.kpi-banner .label { font-size: 12px; opacity: 0.92; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-banner .big { font-size: 34px; font-weight: 800; margin: 4px 0 2px; letter-spacing: -0.02em; }
.kpi-banner .delta { font-size: 13px; opacity: 0.92; display: inline-flex; align-items: center; gap: 4px; }
.bars { display: flex; gap: 4px; align-items: flex-end; margin-top: 12px; height: 60px; }
.bar { flex: 1; background: rgba(255,255,255,0.3); border-radius: 3px 3px 0 0; }
.bar.peak { background: rgba(255,255,255,0.95); }

/* KPI banner · daily bars chart with tooltip */
.kpi-chart { margin-top: 14px; position: relative; }
.kpi-chart .chart-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; opacity: 0.85; margin-bottom: 6px; font-weight: 500; }
.kpi-chart .chart-head .chart-axis-label { font-variant-numeric: tabular-nums; }
.kpi-chart .chart-avg { font-size: 11px; opacity: 0.85; display: inline-flex; align-items: center; gap: 4px; }
.kpi-chart .chart-avg::before { content: ''; display: inline-block; width: 14px; height: 0; border-top: 1.5px dashed rgba(255,255,255,0.5); }

.bars-grid { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; align-items: flex-end; height: 64px; position: relative; }
.bars-grid::before { content: ''; position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255,255,255,0.35); pointer-events: none; }
.bars-grid:has(.bars-empty)::before { display: none; }
.bars-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; color: rgba(255,255,255,0.82); font-size: 13px; font-weight: 600; letter-spacing: 0.01em; padding: 8px 14px; }
.bars-empty .i { width: 20px; height: 20px; opacity: 0.78; flex-shrink: 0; }
.day-bar { padding: 0; border: none; background: rgba(255,255,255,0.42); border-radius: 2px; cursor: pointer; position: relative; min-height: 4px; transition: background 0.12s, transform 0.12s; align-self: flex-end; }
.day-bar:hover, .day-bar.pinned { background: #fff; transform: scaleY(1.04); transform-origin: bottom; }
.day-bar.peak { background: rgba(255,255,255,0.85); }
.day-bar.peak:hover, .day-bar.peak.pinned { background: #fff; }
.day-bar.today { box-shadow: inset 0 -2px 0 0 #FFD700; background: rgba(255,255,255,0.55); }
.day-bar.today:hover, .day-bar.today.pinned { background: #fff; }
.day-bar.holiday { background: rgba(255,255,255,0.22); }

.bar-tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: rgba(15,20,25,0.96); color: #fff; padding: 8px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; z-index: 20; transition: opacity 0.12s; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.bar-tip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: rgba(15,20,25,0.96); }
.bar-tip strong { display: block; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bar-tip small { display: block; font-size: 10px; opacity: 0.75; font-weight: 500; text-transform: capitalize; margin-top: 1px; }
.day-bar:hover .bar-tip, .day-bar.pinned .bar-tip { opacity: 1; }
.day-bar:focus { outline: 2px solid rgba(255,255,255,0.6); outline-offset: 1px; }
.day-bar:focus:not(:focus-visible) { outline: none; }

.bars-axis { display: flex; justify-content: space-between; font-size: 10px; opacity: 0.7; font-weight: 500; margin-top: 6px; padding: 0 2px; font-variant-numeric: tabular-nums; }

.bars-legend { display: flex; align-items: center; gap: 14px; font-size: 11px; opacity: 0.9; margin-top: 10px; flex-wrap: wrap; }
.bars-legend .lg-item { display: inline-flex; align-items: center; gap: 5px; }
.bars-legend .lg-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.bars-legend .lg-swatch.peak { background: rgba(255,255,255,0.85); }
.bars-legend .lg-swatch.today { background: rgba(255,255,255,0.55); box-shadow: inset 0 -2px 0 0 #FFD700; }
.bars-legend .lg-swatch.normal { background: rgba(255,255,255,0.42); }

@media (max-width: 720px) {
  .bars-legend { gap: 8px; font-size: 10px; }
  .bar-tip { white-space: normal; max-width: 160px; }
}

/* === Carosello grafico riepilogo: slide giornaliera + mensile, puntini === */
/* L'header (label/big/delta) sta DENTRO ogni slide: oltre a dare a ciascuna
   vista la sua statistica, fa da riserva verticale per i .bar-tip che
   sporgono sopra le barre alte (l'overflow del carosello clippa ai bordi). */
.kpi-chart-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; }
.kpi-chart-carousel::-webkit-scrollbar { display: none; }
.kpi-chart-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
/* Tooltip delle barre ai bordi: ancorati al bordo della slide (centrati
   sborderebbero dal clip orizzontale del carosello). width: max-content —
   ancorato con left/right lo shrink-to-fit misura il containing block (la
   barra, ~10px) e con white-space normal il testo collassa in colonna. */
.kpi-chart-slide .day-bar:nth-child(-n+4) .bar-tip { left: 0; transform: none; width: max-content; }
.kpi-chart-slide .day-bar:nth-child(-n+4) .bar-tip::after { left: 10px; transform: none; }
.kpi-chart-slide .day-bar:nth-last-child(-n+4) .bar-tip { left: auto; right: 0; transform: none; width: max-content; }
.kpi-chart-slide .day-bar:nth-last-child(-n+4) .bar-tip::after { left: auto; right: 10px; transform: none; }
/* Poche barre (vista Oggi/7 giorni): prime-4 e ultime-4 si sovrappongono e
   vincerebbe right: 0 — la barra unica al bordo sinistro spingerebbe il
   tooltip fuori dalla card. Nell'overlap ancora a sinistra. */
.kpi-chart-slide .day-bar:nth-child(-n+4):nth-last-child(-n+4) .bar-tip { left: 0; right: auto; }
.kpi-chart-slide .day-bar:nth-child(-n+4):nth-last-child(-n+4) .bar-tip::after { left: 10px; right: auto; }
.chart-note { font-size: 11px; opacity: 0.85; }
/* Slide mensile: flex invece della griglia fissa a 30 colonne — le barre
   riempiono la larghezza qualunque sia il numero di mesi disponibili. */
.bars-grid--months { display: flex; gap: 2px; justify-content: center; }
.bars-grid--months .day-bar { flex: 1 1 0; max-width: 48px; }
.kpi-chart-dots { display: flex; justify-content: center; gap: 7px; margin-top: 12px; }
.kc-dot { width: 7px; height: 7px; border-radius: 999px; border: 0; padding: 0; background: rgba(255,255,255,0.35); cursor: pointer; transition: width 140ms ease, background-color 140ms ease; }
.kc-dot.is-active { background: #fff; width: 18px; }

.metric-rows { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-card); margin: 10px 18px 0; overflow: hidden; }
.metric-row { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); gap: 10px; }
.metric-row:last-child { border-bottom: none; }
.metric-row .lbl { font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; flex-wrap: wrap; overflow-wrap: anywhere; }
.metric-row .val { font-size: 15px; font-weight: 700; }
/* Il controllo/valore a destra non si schiaccia quando la label (es. email lunga) cresce. */
.metric-row > .val,
.metric-row > .toggle-ios { flex-shrink: 0; }
/* VARIANTE testo (.metric-row--text): il .val e' una FRASE, non un valore
   corto → riga IMPILATA: label sopra (eyebrow) e testo sotto, tutto a
   sinistra, layout IDENTICO a qualsiasi lunghezza (decisione Andrea 27/07:
   mai lo stesso template con layout diversi in base al testo). Il default
   .metric-row resta per i VALORI corti (label sx · valore dx). Scelta della
   classe per SEMANTICA: "e' un valore o e' una frase?". Doppia classe +
   display:block: vince sulla regola globale `.metric-row .val` di
   44-tables.css (inline-flex/flex-end/right, per le righe pagamenti a
   colonne, che carica dopo). */
.metric-row.metric-row--text { display: block; }
.metric-row.metric-row--text .lbl { display: block; margin-bottom: 4px; }
.metric-row.metric-row--text > .val { display: block; text-align: left; font-weight: 600; overflow-wrap: anywhere; }

.list-row { padding: 14px 16px; display: flex; align-items: center; gap: 14px; background: var(--surface); border-bottom: 1px solid var(--line); cursor: pointer; transition: background 120ms ease; }
.list-row:hover { background: var(--bg); }
.list-row:active { background: var(--line); }
.list-row:last-child { border-bottom: none; }
.list-row .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.list-row .body { flex: 1; }
.list-row .ttl { font-size: 14px; font-weight: 600; }
.list-row .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.list-row .chevron { color: var(--ink-3); }

/* Clienti · Gruppi (sub-tab "Groups"). Stesso pattern di .list-row ma su <a>. */
/* Lista gruppi: niente riquadro bianco esterno (richiesta Andrea) — stesso pattern
   della Lista: eyebrow .section-title + righe .cat-card direttamente sul grigio
   (entrambi hanno già il gutter orizzontale page-pad-x). */
[data-cat-list] { margin: 0; }
.cat-row { padding: 14px 16px; display: flex; align-items: center; gap: 14px; background: var(--surface); border-bottom: 1px solid var(--line); cursor: pointer; color: inherit; text-decoration: none; transition: background 120ms ease; }
.cat-row:hover { background: var(--bg); text-decoration: none; }
.cat-row:active { background: var(--line); }
.cat-row:last-child { border-bottom: none; }
.cat-row-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cat-row-body { flex: 1; min-width: 0; }
.cat-row-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.cat-row-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.list-group { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-card); margin: 10px 18px 0; overflow: hidden; }
.list-group .list-row:last-child { border-bottom: none; }

.pill { font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pill.ok { background: #E8F8EE; color: var(--ok); }
.pill.warn { background: #FFF3E0; color: var(--warn); }
.pill.danger { background: #FCE4E4; color: var(--danger); }

/* Riga cliente = griglia "tabella". Mobile: card (nome a sx; saldo sopra, email+push+visita
   sotto a dx). Desktop (≥800px): 7 colonne allineate all'header .cust-table-head. */
.cust-card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-card); margin: 10px var(--page-pad-x) 0; padding: 14px; display: grid; grid-template-columns: 44px 1fr auto; grid-template-areas: "av name balance" "av details details"; column-gap: 12px; row-gap: 2px; align-items: center; cursor: pointer; }
/* Avatar: colonna propria che copre entrambe le righe → centrato verticalmente
   sull'intera card (come prima dell'estrazione dal blocco nome). */
.cust-cell-av { grid-area: av; display: flex; align-items: center; justify-content: center; }
.cust-cell-name { grid-area: name; display: flex; align-items: center; gap: 12px; min-width: 0; }
/* Mobile: la riga dettagli occupa la larghezza delle colonne nome+saldo (span, sotto
   l'avatar) → non riserva spazio accanto al nome, così nome+badge sulla riga 1
   arrivano fino al saldo. Il codice (meta-mobile) sta a sinistra sotto il nome,
   icone/Tipo/data a destra. Su desktop il wrapper diventa display:contents
   (vedi ≥800px) e le celle tornano colonne della tabella. */
.cust-cell-details { grid-area: details; display: flex; align-items: center; gap: 12px; min-width: 0; }
.cust-cell-details .meta-mobile { margin: 0 auto 0 0; }
.meta-desktop { display: none; }
.cust-cell-email { grid-area: email; justify-self: end; display: inline-flex; align-items: center; }
.cust-cell-push { grid-area: push; justify-self: end; display: inline-flex; align-items: center; }
.cust-cell-sconto { grid-area: sconto; justify-self: end; display: inline-flex; align-items: center; }
.cust-cell-tipo { grid-area: tipo; justify-self: end; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.cust-cell-visit { grid-area: visit; justify-self: end; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.cust-email { width: 18px; height: 18px; }
.cust-email.is-on { color: var(--brand); }
.cust-email.is-off { color: var(--line); }
.cust-push { width: 18px; height: 18px; }
.cust-push.is-on { color: var(--brand); }
.cust-push.is-off { color: var(--line); }
.cust-sconto { width: 18px; height: 18px; }
.cust-sconto.is-on { color: var(--brand); }
.cust-sconto.is-off { color: var(--line); }
.cust-table-head { display: none; }
.cth-sort { cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 3px; color: inherit; }
.cth-sort:hover { color: var(--brand); }
.cth-arrow { width: 12px; height: 12px; opacity: 0; transition: transform .12s ease; }
/* Idle (colonna ordinabile ma non ordinata): freccia ↕ sempre visibile, tenue,
   così è ovvio che si può ordinare. La colonna ordinata mostra ▲/▼ pieno. */
.cth-arrow-idle { opacity: .4; }
.cth-sort:hover .cth-arrow-idle { opacity: .7; }
.cth-sort.is-sorted { color: var(--ink); }
.cth-sort.is-sorted .cth-arrow { opacity: 1; }
.cth-sort.dir-asc .cth-arrow { transform: rotate(180deg); }
/* La tabella a 8 colonne (avatar + 7) richiede spazio: sotto 800px si resta sul
   layout a card (nome pieno), che regge fino a ~640px e oltre. Fra 641 e 799 la
   tabella schiacciava la colonna Cliente e il codice card andava a capo verticale. */
@media (min-width: 800px) {
  .cust-card { grid-template-columns: 44px 1fr 56px 56px 56px 64px 116px 124px; grid-template-areas: "av name email push sconto tipo balance visit"; row-gap: 0; column-gap: 8px; }
  /* Il wrapper mobile si dissolve: le celle tornano grid-item diretti e riprendono
     le loro grid-area (email/push/sconto/tipo/visit), allineate all'header. Il codice
     torna sotto il nome (meta-desktop); la copia mobile sparisce. */
  .cust-cell-details { display: contents; }
  .meta-desktop { display: block; }
  .meta-mobile { display: none; }
  .cust-cell-email { justify-self: center; }
  .cust-cell-push { justify-self: center; }
  .cust-cell-sconto { justify-self: center; }
  /* "Tipo N" = codice corto a lunghezza fissa → centrato (skill table-alignment),
     coerente con le colonne icona adiacenti. */
  .cust-cell-tipo { font-size: 13px; justify-self: center; }
  /* Ultima visita = etichette testuali ("oggi", "5 mag"), non numeri → allineate a
     sinistra (header + valore), coerente con la skill table-alignment. Saldo (valuta)
     resta a destra per il confronto delle grandezze. */
  .cust-cell-visit { font-size: 13px; justify-self: start; }
  .cust-table-head { display: grid; grid-template-columns: 44px 1fr 56px 56px 56px 64px 116px 124px; align-items: center; column-gap: 8px; padding: 6px 14px 2px; margin: 8px var(--page-pad-x) 0; }
  /* L'intestazione "Cliente" copre le due prime colonne del body (avatar + nome). */
  .cust-table-head .cth-nome { grid-column: 1 / 3; }
  .cust-table-head .cth { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
  .cust-table-head .cth-email { justify-self: center; }
  .cust-table-head .cth-push { justify-self: center; }
  .cust-table-head .cth-sconto { justify-self: center; }
  .cust-table-head .cth-tipo { justify-self: center; }
  .cust-table-head .cth-saldo { justify-self: end; }
  .cust-table-head .cth-ultima_visita { justify-self: start; }
}
.cust-card .av { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #FFD3DC, #FFAFC0); color: var(--brand-dark); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex-shrink: 0; }
.cust-card .info { flex: 1; min-width: 0; }
.cust-card .name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; min-width: 0; }
.cust-card .name .name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-card .name .badge { flex-shrink: 0; }
.badge { font-size: 10px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.badge.vip { background: #FFEEDB; color: #B45309; }
.badge.bb { background: #DCEAFE; color: #1E40AF; }
.badge.dormant { background: #F3F4F6; color: #6B7280; }
.cust-card .meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.cust-cell-balance { grid-area: balance; justify-self: end; font-size: 14px; font-weight: 800; color: var(--brand); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Card membro nel dettaglio Gruppo (renderCategoryMembers, app.js): NON è la riga
   della tabella Lista (no colonne push/visita) → layout flex semplice
   [check][avatar][nome+card][saldo], non la griglia di .cust-card. Riusa gli stili
   figli (.check/.av/.info/.name/.meta), sovrascrive solo il display. */
.cust-card.cust-card--member { display: flex; align-items: center; gap: 12px; }
.cust-card--member .info { flex: 1 1 auto; min-width: 0; }
.cust-card--member .balance { flex-shrink: 0; font-size: 14px; font-weight: 800; color: var(--brand); white-space: nowrap; font-variant-numeric: tabular-nums; }

.composer-channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.composer-channels input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.composer-channels label { position: relative; padding: 16px 12px; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-3); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: border-color 120ms ease, background 120ms ease, color 120ms ease; }
.composer-channels label:hover { border-color: var(--brand); color: var(--brand); }
.composer-channels label:active { transform: scale(0.97); }
.composer-channels input:checked + label { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.composer-channels input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.composer-channels .ch-check { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 999px; background: var(--brand); color: #fff; display: none; align-items: center; justify-content: center; }
.composer-channels .ch-check .i { width: 12px; height: 12px; stroke-width: 2.6; }
.composer-channels input:checked + label .ch-check { display: inline-flex; }
.segment-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.segment-tag { padding: 6px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.segment-tag.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.concept-note { margin: 30px 18px 24px; font-size: 11px; color: var(--ink-3); text-align: center; line-height: 1.5; }
.and-pane { display: none; }
.and-pane.active { display: block; }

/* ========== Riepilogo v4 (Andamento) ========== */
.kpi-hero-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px var(--page-pad-x) 0; }
.kpi-hero-card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-card); padding: 16px; }
.kpi-hero-card .kh-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 4px; }
.kpi-hero-card .kh-value { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.kpi-hero-card .kh-value.branded { color: var(--brand); }
.kpi-hero-card .kh-delta { display: inline-flex; align-items: center; gap: 3px; margin-top: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; line-height: 1.35; }
.kpi-hero-card .kh-delta.up { background: #E8F8EE; color: var(--ok-text); }
.kpi-hero-card .kh-delta.down { background: #FCE4E4; color: var(--danger); }
.kpi-hero-card .kh-delta.flat { background: var(--bg); color: var(--ink-3); }
.and-riepilogo .dual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px var(--page-pad-x) 0; }
.and-riepilogo .dual-grid .dt-card { margin: 0; overflow: hidden; }
.and-riepilogo .dual-grid .metric-rows { margin: 0; }
.and-riepilogo .dual-grid .dt-table th,
.and-riepilogo .dual-grid .dt-table td { white-space: normal; }
.and-riepilogo .dual-grid .dt-table .num { width: 1%; white-space: nowrap; }
.u-c-ink-3-fw { color: var(--ink-3); font-weight: 400; }
/* AdE pane: griglia 3 colonne fisse — allinea titolo|descrizione|valore su tutte le card */
.ade-rows .metric-row { display: grid; grid-template-columns: 28% 100px 1fr; gap: 4px 10px; align-items: center; }
.ade-rows .ade-title { font-size: 14px; color: var(--ink); }
.ade-rows .ade-desc { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.ade-rows .metric-row .val { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.ade-rows .metric-row .val strong { font-weight: 700; }
/* Riepilogo: prima colonna wrappabile (evita overflow tabella su mobile) + respiro dx */
.and-riepilogo .dt-table td:first-child { white-space: normal; }
.and-riepilogo .dt-table td:last-child,
.and-riepilogo .dt-table th:last-child { padding-right: 18px; }
/* Riepilogo: colonne fisse sulle tabelle a 3 colonne (Servizio, Pagamento, Ricariche) */
.and-riepilogo .dt-table.riepilogo-3col th:nth-child(2),
.and-riepilogo .dt-table.riepilogo-3col td:nth-child(2) { width: 100px; }
.and-riepilogo .dt-table.riepilogo-3col th:nth-child(3),
.and-riepilogo .dt-table.riepilogo-3col td:nth-child(3) { width: 50px; }
.and-riepilogo .row-total { border-top: 2px solid var(--line); }
.and-riepilogo .row-dim { opacity: 0.4; }
.and-riepilogo .row-bonus { opacity: 0.6; }
.and-riepilogo .mkt-active-list { padding: 0; margin: 10px var(--page-pad-x) 0; }
.kpi-hero-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) {
  .kpi-hero-row { grid-template-columns: 1fr 1fr; }
  .kpi-hero-row.cols-3 { grid-template-columns: 1fr; }
  .and-riepilogo .dual-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Bollette e tariffe (pane Consumi · F1 spec costi-utenze)
   ============================================================ */
/* Rimando dalla testata: la sezione sta in coda alla pagina e il salto
   d'ancora puo' non muovere nulla — il flash sulla card e' il feedback che
   il click e' arrivato (bolJumpTo nel partial). Outline, non box-shadow:
   .dt-card ha gia' --shadow-card. */
#bollette-tariffe { scroll-margin-top: 12px; }
.bol-flash { animation: bolFlash 1.4s ease-out 0.25s; }
@keyframes bolFlash {
  0%, 35% { outline: 2px solid var(--brand); outline-offset: 2px; }
  100% { outline: 2px solid transparent; outline-offset: 2px; }
}
.bol-tariffe { display: flex; gap: 20px; flex-wrap: wrap; }
.bol-tariffa { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.bol-tariffa .i { color: var(--brand); flex-shrink: 0; }
.bol-tariffa strong { font-variant-numeric: tabular-nums; margin-right: 6px; }

/* Form nel gmodal: tutte le label allineate allo stile del componente data
   condiviso (.dt-field > label): un solo stile di label nel form. */
.bol-form .sub-field { margin-top: 14px; }
.bol-form .sub-field > label { display: block; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; margin-bottom: 4px; }
/* SOLO figli diretti (>): una regola generica su input[type=text] colpirebbe
   gli input INTERNI di .dt-field (.dt-display) e .numfield — stesso pattern
   anti-inquinamento del wizard (≈1929). Metriche = .dt-trigger: 42px,
   radius 10, bg --bg, focus brand. */
.bol-form .sub-field > input, .bol-form .sub-field > select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; background: var(--bg); color: var(--ink); font-family: inherit; transition: border-color 120ms ease, background 120ms ease; }
.bol-form .sub-field > input:hover, .bol-form .sub-field > select:hover { border-color: var(--ink-3); background: var(--surface); }
.bol-form .sub-field > input:focus, .bol-form .sub-field > select:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.bol-form .sub-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .bol-form .sub-field-row { grid-template-columns: 1fr; } }

/* Campi data: componente .dt-field condiviso, a tutta larghezza della cella.
   Il popover del secondo non deve sbordare a destra del gm-card. */
.bol-form .sub-field .dt-field { width: 100%; }
.bol-form .sub-field .dt-field .dt-trigger { min-width: 0; width: 100%; }
.bol-form .sub-field-row > div:last-child .dt-popover { left: auto; right: 0; }

/* Importo/consumo: componente .numfield (suffisso nel box), stesse metriche
   degli altri campi (42px, radius 10, bg --bg). */
.bol-form .sub-field .numfield { display: inline-flex; align-items: center; gap: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 42px; cursor: text; width: 100%; max-width: 11rem; transition: border-color 120ms ease, background 120ms ease; }
.bol-form .sub-field .numfield:hover { border-color: var(--ink-3); background: var(--surface); }
.bol-form .sub-field .numfield:focus-within { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.bol-form .sub-field .numfield input { flex: 1 1 auto; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; box-shadow: none; padding: 0; font-weight: 700; font-size: 16px; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.bol-form .sub-field .numfield-suffix { color: var(--ink-3); font-size: 13px; font-weight: 700; flex-shrink: 0; }

.bol-estimated { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.bol-estimated input { width: 16px; height: 16px; accent-color: var(--brand); }

.bol-del-btn { background: none; border: 0; padding: 6px; cursor: pointer; color: var(--ink-3); border-radius: 6px; }
.bol-del-btn:hover { color: var(--danger); background: var(--bg); }

/* ============================================================
   Detersivi (sub-tab Andamento → Detersivi, spec 2026-07-31)
   ============================================================ */
/* Badge inline generici (stessa palette di .badge.vip/.dormant sopra, nomi
   onesti per un contesto che non è clienti). */
.badge.warn { background: #FFEEDB; color: #B45309; }
.badge.info { background: #F3F4F6; color: #6B7280; }

.det-del-btn { background: none; border: 0; padding: 6px; cursor: pointer; color: var(--ink-3); border-radius: 6px; }
.det-del-btn:hover { color: var(--danger); background: var(--bg); }

/* Form dei due modal (Conta magazzino, Registra acquisto): stessa gabbia di
   .bol-form (sub-field/sub-field-row/numfield, metriche 42px). */
.det-form .sub-field { margin-top: 14px; }
.det-form .sub-field > label { display: block; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; margin-bottom: 4px; }
.det-form .sub-field > input, .det-form .sub-field > select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; background: var(--bg); color: var(--ink); font-family: inherit; transition: border-color 120ms ease, background 120ms ease; }
.det-form .sub-field > input:hover, .det-form .sub-field > select:hover { border-color: var(--ink-3); background: var(--surface); }
.det-form .sub-field > input:focus, .det-form .sub-field > select:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.det-form .sub-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .det-form .sub-field-row { grid-template-columns: 1fr; } }
.det-form .sub-field .dt-field { width: 100%; }
.det-form .sub-field .dt-field .dt-trigger { min-width: 0; width: 100%; }
.det-form .sub-field .numfield { display: inline-flex; align-items: center; gap: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 42px; cursor: text; width: 100%; max-width: 11rem; transition: border-color 120ms ease, background 120ms ease; }
.det-form .sub-field .numfield:hover { border-color: var(--ink-3); background: var(--surface); }
.det-form .sub-field .numfield:focus-within { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.det-form .sub-field .numfield input { flex: 1 1 auto; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; box-shadow: none; padding: 0; font-weight: 700; font-size: 16px; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.det-form .sub-field .numfield-suffix { color: var(--ink-3); font-size: 13px; font-weight: 700; flex-shrink: 0; }

/* Griglia per-prodotto della Conta magazzino: numfield compatto dentro
   .listini-table, stesse metriche del modal Dispenser (34px). */
.det-form .listini-table .numfield { display: inline-flex; align-items: center; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; height: 34px; cursor: text; }
.det-form .listini-table .numfield:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 18%, transparent); }
.det-form .listini-table .numfield input { flex: 0 1 auto; width: 56px; min-width: 40px; border: 0; outline: 0; background: transparent; box-shadow: none; padding: 0; font-weight: 700; font-size: 16px; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.det-form .listini-table .numfield-suffix { color: var(--ink-3); font-size: 13px; font-weight: 700; flex-shrink: 0; }
.det-form .listini-table .col-machine { white-space: normal; min-width: 0; }
.det-form .listini-table .col-machine .model { white-space: normal; display: block; font-size: 12px; margin-top: 2px; color: var(--ink-3); }

/* F4 · upload PDF + estrazione assistita */
.bol-extract-note { margin-top: 6px; font-size: 12px; color: var(--brand); font-weight: 600; }

/* F3 · Costo per programma (riparto liv.2). La diagnostica collassata
   riusa .reservations-disclosure (componente canonico). */
.cpr-row { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr 44px auto; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.cpr-row:last-child, .cpr-more .cpr-row:last-child { border-bottom: 0; }
.cpr-name { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpr-bar { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.cpr-fill { height: 100%; border-radius: 999px; background: var(--brand); }
.cpr-pct { font-size: 12px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.cpr-cost { font-size: 13px; font-weight: 700; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; min-width: 90px; }
.cpr-has-sub { border-bottom: 0; padding-bottom: 2px; }
.cpr-sub { font-size: 12px; color: var(--ink-3); padding: 0 0 7px; border-bottom: 1px solid var(--line); }
.cpr-sub:last-child { border-bottom: 0; }
.cpr-more summary { padding: 8px 0; font-size: 12px; font-weight: 700; color: var(--brand); cursor: pointer; list-style: none; }
.cpr-more summary::-webkit-details-marker { display: none; }
@media (max-width: 480px) { .cpr-row { grid-template-columns: minmax(80px, 1fr) 1fr 38px auto; gap: 7px; } }

/* Corpo del disclosure diagnostica (pane Consumi): sfondo pagina, così le
   dt-card interne bianche tornano a staccare; respiro dopo l'ultima tabella.
   Scoped: gli altri reservations-disclosure restano com'erano. */
.reservations-disclosure .prog-diag-body { background: var(--bg); border-top: 1px solid var(--line); padding-bottom: 18px; }

/* ===== Scorte detersivi nel pane Consumi (striscia) + pallino sub-tab ===== */
/* Il pallino avvisa da OGNI tab che c'e' un RIORDINA o una conta vecchia. */
.cli-subtab .subtab-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-left: 5px; vertical-align: middle; }
/* Striscia: solo i prodotti sotto soglia, il dettaglio vive nel pane Detersivi. */
.scorte-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.scorte-strip-title { font-size: 14px; font-weight: 700; }
.scorte-strip-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.scorte-strip-row .name { flex: 1; min-width: 0; font-weight: 600; }
.scorte-strip-row .litri { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.scorte-strip-badge { background: var(--danger); color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; flex-shrink: 0; }
.scorte-strip-badge--warn { background: var(--warn); }
