/* grafica di Enoha con i colori di «faro»: scritto dal compositore da interfaccia.palette_chiara/palette_scura (control-center/src/aspetto-colori.js); non si modifica a mano */
/* ═══════════════════════════════════════════════════════════════════════════
   theme-light.css — Tema CHIARO del gestionale.
   ───────────────────────────────────────────────────────────────────────────
   Si attiva SOLO con data-theme="light" sull'elemento <html>, impostato da
   public/js/init.js a partire da branding.theme della config runtime.
   Senza quell'attributo il file e' inerte: il tema scuro resta il default.

   Caricato per ULTIMO in index.html (dopo bundle/theme/main/faro-pro/
   owner-gate) per vincere sulla cascata senza riscrivere quei fogli.
   Per disattivarlo del tutto basta togliere il <link>.

   ── Come e' organizzato ────────────────────────────────────────────────────
   §1  Token — ribalta le variabili. Copre da solo la maggior parte della UI,
       perche' faro-pro.css deriva tutti i token del design system dai --fp-*.
   §2  Fondali — i gradient hardcoded che terrebbero nera la pagina.
   §3  Velature — rgba(255,255,255,x) invertite: su chiaro sparirebbero.
   §4  Overlay e modali.
   §5  Superfici hardcoded (fatturazione, registratore, planimetria).
   §6  Testi chiari rimasti tali.
   §7  Stati e categorie.
   §8  Ombre.

   NOTA sui nomi: nel tema scuro --nero e' lo sfondo e --crema il testo. Qui i
   RUOLI restano, i valori si invertono: --nero diventa chiaro, --crema scuro.
   I nomi sono storici, conta il ruolo.

   Contrasti verificati WCAG 2.1: tutte le combinazioni testo/sfondo >= AA.
   L'oro brand #D5B36F su bianco da' 2.00:1 (illeggibile), per questo nel
   tema chiaro diventa #1e40af (8.7:1) per accenti/denaro e #8a5a12 (oro
   brunito) dove il testo deve restare "oro".

   PALETTE: pagina #f5f8fd · superfici #ffffff / #f0f5fc · bordi #d5deea ·
   testo #0f1b2d · secondario #34435c · muted #5a6a84 · accento #1e40af ·
   successo #157a3f · warning #b45309 · pericolo #b91c1c · info #1d4ed8.
   Superfici di stato: fondi tenui (#e6f4ea/#fde8e8/#e8f0fe/#fff4d6) con
   testo scuro e bordo del colore pieno.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ §1 TOKEN ═══════════════════════════════════════════════════════════ */

:root[data-theme="light"] {

  /* ── faro-pro.css:4-79 — sorgente di tutti i token del design system.
        Ribaltare qui significa ribaltare a cascata --bg-*, --text-*,
        --border-*, --accent* senza toccare quel file. ─────────────────── */

  --fp-bg:        #faf7f2;   /* sfondo base pagina (near-white, velo azzurro) */
  --fp-canvas:    #f5eee4;   /* fascia centrale del gradient body (azzurro tenue) */
  --fp-surface:   #ffffff;   /* card / pannelli (bianco puro) */
  --fp-surface-2: #f8f4ed;   /* input / card elevata (azzurro tenue) */
  --fp-surface-3: #f2eadd;   /* hover / focus (azzurro piu carico) */

  --fp-line:        rgba(35, 27, 24, 0.12);
  --fp-line-strong: rgba(138, 24, 40, 0.34);

  --fp-text:   #231b18;
  --fp-text-2: #4d3f38;
  --fp-muted:  #76665a;
  --fp-dim:    #9c8b7d;

  /* Enfasi/denaro: blu profondo per coerenza "bianco + blu" (era oro). */
  --fp-gold:   #640517;
  --fp-gold-2: #500f16;

  --fp-bordeaux:   #8a1828;   /* ex rosso brand -> blu primario */
  --fp-bordeaux-2: #7c001c;   /* hover/forte -> blu-700 */

  --fp-green: #157a3f;
  --fp-rose:  #8a1828;
  /* Nel tema scuro --fp-blue/--fp-cyan non sono blu/ciano: valgono grigi
     caldi usati come testo tenue. Sul chiaro diventano slate scuri,
     altrimenti il corpo testo perde leggibilita. */
  --fp-blue:  #4d3f38;
  --fp-cyan:  #76665a;
  --fp-amber: #8a6410;

  --fp-shadow:      0 10px 28px rgba(35, 27, 24, 0.10);
  --fp-shadow-soft: 0 4px 12px rgba(35, 27, 24, 0.07);

  /* ── theme.css — token semantici (ridichiarati per i casi in cui
        faro-pro non e' caricato, es. pagine standalone). ──────────────── */

  --bg-0: #faf7f2;
  --bg-1: #ffffff;
  --bg-2: #f8f4ed;
  --bg-3: #f2eadd;

  --text-primary:   #231b18;
  --text-secondary: #4d3f38;
  --text-muted:     #76665a;
  --text-inverse:   #ffffff;

  --border-soft:   rgba(35, 27, 24, 0.12);
  --border-strong: rgba(138, 24, 40, 0.34);

  --accent:         #8a1828;
  --accent-hover:   #7c001c;
  --accent-2:       #640517;
  --accent-2-hover: #500f16;

  --success:    #157a3f;  --success-bg: rgba(21, 122, 63, 0.12);
  --warning:    #8a6410;  --warning-bg: rgba(138, 100, 16, 0.14);
  --danger:     #c62828;  --danger-bg:  rgba(198, 40, 40, 0.10);
  --info:       #1e5fd6;  --info-bg:    rgba(30, 95, 214, 0.10);

  /* Sfumature "rosso" storiche -> blu (accento brand, non danger). */
  --rosso-soft-08: rgba(138, 24, 40, 0.08);
  --rosso-soft-30: rgba(138, 24, 40, 0.30);
  --rosso-scuro:   #7c001c;
  --shadow-glow:   0 0 0 1px rgba(138, 24, 40, 0.42), 0 18px 44px rgba(100, 5, 23, 0.24);

  /* ── main.css — le 16 variabili storiche. ────────────────────────────── */

  --nero:   #faf7f2;
  --nero2:  #ffffff;
  --nero3:  #f8f4ed;
  --crema:  #231b18;
  --crema2: #4d3f38;
  --bordo:  #e8ddcd;
  --bordo2: #decbb2;
  --muted:  #76665a;

  --bordeaux: #8a1828;
  --bord2:    #7c001c;
  --blu2:     #8a1828;

  --tab-bg:     #ffffff;
  --tab-border: #e8ddcd;
  --tab-text:   #76665a;
  --tab-active: #8a1828;

  /* Accenti di sezione. */
  --menu-category-accent: #584239;
  --sala-accent:    #8a1828;
  --sala-choice:    #8a1828;
  --cr-accent:      #8a1828;
  --cr-accent-soft: rgba(138, 24, 40, 0.12);

  color-scheme: light;
}

/* ═══ §2 FONDALI ═════════════════════════════════════════════════════════ */
/* faro-pro.css:103-113 ha il gradient del body con colori hardcoded, e le
   pagine standalone (page-*.css) dipingono body con var(--nero)/#0…: senza
   questo override lo sfondo sotto il contenuto resta nero. Vale per TUTTE le
   pagine che caricano questo foglio (html[data-theme] è l'elemento root).   */

html[data-theme="light"],
:root[data-theme="light"] body,
:root[data-theme="light"] body.faro-pro-ui {
  background: #faf7f2;
  color: #231b18;
}

:root[data-theme="light"] .panel {
  background-image: none;
}

/* ═══ §3 VELATURE ════════════════════════════════════════════════════════ */
/* Bordi e separatori sono rgba(255,255,255,x): su fondo chiaro spariscono.
   Si invertono in nero traslucido mantenendo la stessa intensita' visiva.  */

:root[data-theme="light"] .comanda-product-card,
:root[data-theme="light"] .cr-cart-row,
:root[data-theme="light"] .cr-cart-card,
:root[data-theme="light"] .hub-card,
:root[data-theme="light"] .hub-btn,
:root[data-theme="light"] .stat-card,
:root[data-theme="light"] .modal-box,
:root[data-theme="light"] .cr-modal {
  border-color: rgba(35, 27, 24, 0.14);
}

/* Highlight 3D in cima ai tasti: inset bianco su chiaro non si vede. */
:root[data-theme="light"] .cr-register-key,
:root[data-theme="light"] .cr-keypad button,
:root[data-theme="light"] .cr-category-btn {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
              0 1px 2px rgba(35, 27, 24, 0.10);
}

/* Planimetria sala: la griglia era rgba(255,255,255,.03), invisibile
   sul chiaro (main.css:3564-3566). */
:root[data-theme="light"] .planimetria,
:root[data-theme="light"] .mappa-inner,
:root[data-theme="light"] .mappa-wrap {
  background-image:
    repeating-linear-gradient(0deg,  rgba(35, 27, 24, 0.06) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(35, 27, 24, 0.06) 0 1px, transparent 1px 40px);
  background-color: #f6f2eb;
}

/* ═══ §4 OVERLAY E MODALI ════════════════════════════════════════════════ */
/* Gli overlay quasi-neri su una UI chiara sono l'incoerenza piu' visibile.  */

:root[data-theme="light"] .modal-overlay,
:root[data-theme="light"] .cr-modal-overlay,
:root[data-theme="light"] .owner-gate-overlay {
  background: rgba(35, 27, 24, 0.42) !important;
}

:root[data-theme="light"] .modal-box,
:root[data-theme="light"] .cr-modal,
:root[data-theme="light"] .owner-gate-shell {
  background: #ffffff !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  box-shadow: 0 20px 60px rgba(35, 27, 24, 0.18) !important;
}

:root[data-theme="light"] .modal-title,
:root[data-theme="light"] .cr-modal-head,
:root[data-theme="light"] .owner-gate-head {
  color: var(--fp-text) !important;
}

/* Tastierino owner: i tasti numerici hanno un gradient nero (owner-gate.css:146)
   che sul guscio chiaro resta nero. Si portano a fondo chiaro + testo scuro. */
:root[data-theme="light"] .owner-gate-key {
  background: #faf7f2 !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border-color: rgba(35, 27, 24, 0.18) !important;
}
:root[data-theme="light"] .owner-gate-key:hover { border-color: rgba(138, 24, 40, 0.55) !important; }
:root[data-theme="light"] .owner-gate-key:active { background: #ede3d5 !important; }
:root[data-theme="light"] .owner-gate-key--utility { color: var(--fp-text-2) !important; }
/* Display PIN: era rgba(0,0,0,.3) (grigio sporco sul chiaro). */
:root[data-theme="light"] .owner-gate-pin-display {
  background: #f8f4ed !important;
  border: 1px solid rgba(35, 27, 24, 0.14) !important;
}

/* ═══ RESOCONTO SERATA (owner-gate report) ═══════════════════════════════
   La vista .owner-gate-shell--report usa testo chiaro/crema (tema scuro) che
   sul guscio bianco spariva (contrasto ~1.0-2.5:1). Qui si scurisce tutto. */
/* Kicker "ACCESSO RISERVATO": usa var(--og-gold)=#d5b36f ridefinita sull'overlay
   (le CSS var locali vincono sull'ereditarietà da :root) → override diretto. */
:root[data-theme="light"] .owner-gate-kicker { color: #640517 !important; }
:root[data-theme="light"] .owner-gate-title,
:root[data-theme="light"] .owner-report-kpi strong,
:root[data-theme="light"] .owner-report-section__head h3 { color: var(--fp-text) !important; }
:root[data-theme="light"] .owner-gate-subtitle,
:root[data-theme="light"] .owner-report-toolbar,
:root[data-theme="light"] .owner-report-kpi span,
:root[data-theme="light"] .owner-report-kpi small,
:root[data-theme="light"] .owner-report-section__head span,
:root[data-theme="light"] .owner-report-table td::before { color: var(--fp-muted) !important; }
:root[data-theme="light"] .owner-gate-close,
:root[data-theme="light"] .owner-gate-back,
:root[data-theme="light"] .owner-gate-refresh { color: var(--fp-text) !important; }
:root[data-theme="light"] .owner-report-table th { color: var(--fp-text-2) !important; }
:root[data-theme="light"] .owner-report-table td {
  color: var(--fp-text) !important;
  border-top-color: rgba(35, 27, 24, 0.10) !important;
}
:root[data-theme="light"] .owner-report-table td.is-money { color: #640517 !important; }
:root[data-theme="light"] .owner-report-table td.is-danger,
:root[data-theme="light"] .owner-report-badge.is-danger { color: #c62828 !important; }
:root[data-theme="light"] .owner-report-badge.is-good { color: #1f7a45 !important; }
:root[data-theme="light"] .owner-report-badge { color: var(--fp-text) !important; }
:root[data-theme="light"] .owner-report-alert { color: var(--fp-text) !important; }

/* Pulsante "Storna scontrino" nel Resoconto serata */
:root[data-theme="light"] .owner-report-storna {
  color: #640517 !important;
  border-color: rgba(138, 24, 40, 0.40) !important;
}
:root[data-theme="light"] .owner-report-storna:hover { border-color: #640517 !important; }

/* Selezione tavoli (codice chiusura senza fiscale): card con testo chiaro. */
:root[data-theme="light"] .owner-gate-table-card__name { color: var(--fp-text) !important; }
:root[data-theme="light"] .owner-gate-table-card__meta { color: var(--fp-muted) !important; }
:root[data-theme="light"] .owner-gate-table-card__total { color: #640517 !important; }

/* ═══ REGIA (dashboard owner) ════════════════════════════════════════════
   faro-pro.css dipinge le card della Regia con fondi quasi neri hardcoded
   (rgba(17,16,20,.9x) !important) e bordi bianchi (invisibili sul chiaro).
   Qui si portano a card chiare con testo scuro; i valori con colori troppo
   chiari (oro/ambra/lime) vengono scuriti per restare leggibili su bianco. */
:root[data-theme="light"] .dash-card,
:root[data-theme="light"] .faro-dashboard-modal .dash-card,
:root[data-theme="light"] .faro-brief,
:root[data-theme="light"] .faro-dashboard-hero,
:root[data-theme="light"] .faro-dashboard-focus {
  background: #ffffff !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border-color: rgba(35, 27, 24, 0.14) !important;
}
:root[data-theme="light"] .faro-brief-item,
:root[data-theme="light"] .faro-brief__head {
  background: #faf7f2 !important;
  background-image: none !important;
}
:root[data-theme="light"] .dash-label,
:root[data-theme="light"] .faro-kicker,
:root[data-theme="light"] .faro-brief-item span,
:root[data-theme="light"] .faro-dashboard-hero span,
:root[data-theme="light"] .faro-dashboard-focus span { color: var(--fp-muted) !important; }
:root[data-theme="light"] .faro-brief__head h3,
:root[data-theme="light"] .faro-brief-item strong,
:root[data-theme="light"] .faro-dashboard-hero strong,
:root[data-theme="light"] .faro-dashboard-focus strong { color: var(--fp-text) !important; }
/* Valori/etichette con colori CHIARI inline (dashboard.js) → tinte scure
   leggibili su card bianche. Selettore ampio: alcuni sono su <span> semplici,
   non solo su .dash-val. Coperti tutti i colori usati nel modulo Regia. */
:root[data-theme="light"] #modal-dashboard [style*="D5B36F"],
:root[data-theme="light"] #modal-dashboard [style*="F0D79C"],
:root[data-theme="light"] #modal-dashboard [style*="f0d79c"],
:root[data-theme="light"] #modal-dashboard [style*="e8c870"],
:root[data-theme="light"] #modal-dashboard [style*="fbbf24"] { color: #640517 !important; }
:root[data-theme="light"] #modal-dashboard [style*="a3e635"] { color: #4d7c0f !important; }
:root[data-theme="light"] #modal-dashboard [style*="f87171"] { color: #c62828 !important; }
:root[data-theme="light"] #modal-dashboard [style*="86efac"],
:root[data-theme="light"] #modal-dashboard [style*="3FAE6B"],
:root[data-theme="light"] #modal-dashboard [style*="3fae6b"] { color: #1f7a45 !important; }

/* Banner "food cost critici": testo rosso chiaro #f87171 inline (~2.4:1 sul
   chiaro) → rosso brand scuro leggibile. */
:root[data-theme="light"] #allerte-fc-badge {
  background: rgba(198, 40, 40, 0.10) !important;
  border-color: rgba(198, 40, 40, 0.45) !important;
  color: #c62828 !important;
}

/* Display Cassa Veloce: etichetta e simbolo € erano troppo tenui sul chiaro. */
:root[data-theme="light"] .cr-register-display #cr-price-label,
:root[data-theme="light"] .cr-register-display small,
:root[data-theme="light"] #cr-price-hint {
  color: var(--fp-text-2) !important;
}
:root[data-theme="light"] .cr-register-display b { color: #640517 !important; }

/* ═══ §5 SUPERFICI HARDCODED ═════════════════════════════════════════════ */

/* Fatturazione cliente (faro-pro.css:82-101): il blocco meno tematizzato,
   ~90 colori scritti a mano in 20 righe minificate. Si copre per famiglia
   invece che regola per regola. */
:root[data-theme="light"] .fc-layout,
:root[data-theme="light"] .fc-hero,
:root[data-theme="light"] .fc-card,
:root[data-theme="light"] .fc-client-card,
:root[data-theme="light"] .fc-client-list,
:root[data-theme="light"] .fc-draft-list,
:root[data-theme="light"] .fc-draft-row,
:root[data-theme="light"] .fc-document-detail,
:root[data-theme="light"] .fc-document-rows,
:root[data-theme="light"] .fc-form-grid,
:root[data-theme="light"] .fc-config,
:root[data-theme="light"] .fc-payment,
:root[data-theme="light"] .fc-discount,
:root[data-theme="light"] .fc-actions,
:root[data-theme="light"] .fc-empty,
:root[data-theme="light"] .fc-kicker {
  background-color: #ffffff !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border-color: rgba(35, 27, 24, 0.14) !important;
}

/* Registratore cassa rapida (main.css:4367-4660): display e tasti neri. */
:root[data-theme="light"] .cr-sale-shell,
:root[data-theme="light"] .cr-register-column,
:root[data-theme="light"] .cr-register-keypad {
  background: #f8f4ed !important;
  background-image: none !important;
  box-shadow: inset 0 0 20px rgba(35, 27, 24, 0.06) !important;
}
:root[data-theme="light"] .cr-register-display {
  background: #ffffff !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border: 1px solid rgba(35, 27, 24, 0.16) !important;
}
:root[data-theme="light"] .cr-register-title,
:root[data-theme="light"] .cr-register-tip {
  color: var(--fp-text-2) !important;
}
:root[data-theme="light"] .cr-register-key,
:root[data-theme="light"] .cr-keypad button,
:root[data-theme="light"] .cr-key-back,
:root[data-theme="light"] .cr-key-clear,
:root[data-theme="light"] .cr-key-cancel {
  background: #ffffff !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border: 1px solid rgba(35, 27, 24, 0.16) !important;
}
:root[data-theme="light"] .cr-register-key:active,
:root[data-theme="light"] .cr-keypad button:active {
  background: #ede3d5 !important;
}

/* Pulsanti pagamento (main.css:2882-2883). */
:root[data-theme="light"] .cr-cash,
:root[data-theme="light"] .cr-card {
  background-image: none !important;
  background-color: #ffffff !important;
  color: var(--fp-text) !important;
  border: 1px solid rgba(35, 27, 24, 0.18) !important;
}

/* ═══ §6 TESTI CHIARI RIMASTI ════════════════════════════════════════════ */
/* main.css ha 28 `color:#fff` su elementi il cui sfondo ora e' chiaro.
   Si riportano al testo scuro, tranne dove il fondo resta scuro/colorato.  */

:root[data-theme="light"] .panel,
:root[data-theme="light"] .menu-header,
:root[data-theme="light"] .header-mappa,
:root[data-theme="light"] .comanda-product-card,
:root[data-theme="light"] .cr-cart-row,
:root[data-theme="light"] .stat-card,
:root[data-theme="light"] .hub-card {
  color: var(--fp-text);
}

/* Il testo bianco resta bianco solo sopra superfici piene di brand. */
:root[data-theme="light"] .cr-cart-btn:active,
:root[data-theme="light"] .tab-btn.active,
:root[data-theme="light"] .header-sq-btn.active {
  color: #ffffff;
}

/* Titoli in oro chiaro (main.css:976,1072,1542,1870,1921): sul chiaro
   passano all'oro brunito. */
:root[data-theme="light"] .menu-header h2,
:root[data-theme="light"] .modal-title {
  color: var(--fp-gold);
}

/* owner-gate.css: meta' dei colori del file e' testo crema/grigio chiaro. */
:root[data-theme="light"] .owner-gate-shell,
:root[data-theme="light"] .owner-gate-head,
:root[data-theme="light"] .owner-gate-body,
:root[data-theme="light"] .owner-gate-table-card,
:root[data-theme="light"] .owner-gate-empty,
:root[data-theme="light"] .owner-report-toolbar {
  color: var(--fp-text) !important;
}
:root[data-theme="light"] .owner-gate-table-card,
:root[data-theme="light"] .owner-report-toolbar {
  background: #f8f4ed !important;
  background-image: none !important;
  border-color: rgba(35, 27, 24, 0.14) !important;
}
:root[data-theme="light"] .owner-gate-error {
  color: #b91c1c !important;
}

/* ═══ §7 STATI E CATEGORIE ═══════════════════════════════════════════════ */
/* I colori di stato erano tarati sul fondo scuro (contrasto 1.5-2.5:1 sul
   bianco). Qui si scuriscono mantenendo la stessa semantica cromatica.     */

:root[data-theme="light"] .stat-card.verde  { color: #15803d; }
:root[data-theme="light"] .stat-card.rosso  { color: #b91c1c; }
:root[data-theme="light"] .stat-card.giallo { color: #a16207; }
:root[data-theme="light"] .stat-card.blu    { color: #3a55a0; }

/* Categorie menu (main.css:1054-1093): 27 colori in 9 righe, pensati come
   fondi scuri saturi. Sul chiaro diventano tinte tenui con testo scuro,
   conservando la distinzione cromatica fra categorie.                      */
:root[data-theme="light"] .item-cucina,
:root[data-theme="light"] .item-food,
:root[data-theme="light"] .item-bevande,
:root[data-theme="light"] .item-acqua,
:root[data-theme="light"] .item-iba,
:root[data-theme="light"] .item-drinklist,
:root[data-theme="light"] .item-spirit,
:root[data-theme="light"] .item-birre,
:root[data-theme="light"] .item-beer,
:root[data-theme="light"] .item-bianchi,
:root[data-theme="light"] .item-bollicine,
:root[data-theme="light"] .item-rossi,
:root[data-theme="light"] .item-wine {
  color: var(--fp-text) !important;
  border-color: rgba(35, 27, 24, 0.16) !important;
}
:root[data-theme="light"] .item-cucina,
:root[data-theme="light"] .item-food      { background: #eef4ee !important; }
:root[data-theme="light"] .item-bevande,
:root[data-theme="light"] .item-acqua     { background: #f3efe8 !important; }
:root[data-theme="light"] .item-iba       { background: #f3eef6 !important; }
:root[data-theme="light"] .item-drinklist,
:root[data-theme="light"] .item-spirit    { background: #f6f0ea !important; }
:root[data-theme="light"] .item-birre,
:root[data-theme="light"] .item-beer      { background: #f8f2e2 !important; }
:root[data-theme="light"] .item-bianchi   { background: #f7f4e6 !important; }
:root[data-theme="light"] .item-bollicine { background: #f5f1e4 !important; }
:root[data-theme="light"] .item-rossi,
:root[data-theme="light"] .item-wine      { background: #f6ebec !important; }

/* Prodotto esaurito: deve restare distinguibile anche sul chiaro. */
:root[data-theme="light"] .item-esaurito {
  background: #f0ece6 !important;
  color: #8b8189 !important;
}

/* ═══ §8 OMBRE ═══════════════════════════════════════════════════════════ */
/* Le ombre del tema scuro arrivano a rgba(0,0,0,.8): sul chiaro sono
   macchie. Si riportano a valori tenui.                                    */

:root[data-theme="light"] .toast,
:root[data-theme="light"] .hub-card,
:root[data-theme="light"] .stat-card,
:root[data-theme="light"] .comanda-product-card,
:root[data-theme="light"] .cr-cart-card {
  box-shadow: 0 4px 14px rgba(35, 27, 24, 0.10);
}

/* ═══ §9 GRADIENT SCURI HARDCODED (faro-pro.css) ═════════════════════════
   faro-pro.css dipinge header, barra inferiore, card tavoli, pannelli hub e
   login-box con gradient QUASI NERI marcati `!important`. Il §6 sopra aveva
   già portato il TESTO allo scuro, ma senza ribaltare anche questi FONDI il
   risultato era testo scuro su fondo nero = illeggibile. Qui si ribaltano i
   fondi (serve `!important` per battere quelli di faro-pro) e il nero sparisce.
   Riferimenti riga faro-pro.css: header 268, tavolo 823-865, hub-card 949,
   tab-bar 1063, menu-header 1119, login-box 182.                            */

/* ── Barra superiore (header planimetria) e testata comanda ───────────────
   Il logo è un PNG chiaro: su fondo chiaro sparirebbe → lo si scurisce con un
   filtro così resta leggibile senza reintrodurre una barra nera.            */
:root[data-theme="light"] .header-mappa,
:root[data-theme="light"] .menu-header,
:root[data-theme="light"] .header,
:root[data-theme="light"] .top-bar {
  background: #f8f4ed !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border-bottom: 1px solid rgba(35, 27, 24, 0.14) !important;
  box-shadow: 0 2px 10px rgba(35, 27, 24, 0.06) !important;
}
:root[data-theme="light"] .faro-brand-logo,
:root[data-theme="light"] #faro-brand-logo-main,
:root[data-theme="light"] #faro-brand-logo {
  /* Nel tema scuro il logo usa mix-blend-mode:screen (glow su fondo nero):
     su fondo chiaro rende trasparenti i pixel scuri → logo invisibile.
     Va riportato a `normal` perché il filtro sotto abbia effetto. */
  mix-blend-mode: normal !important;
  /* Logo PNG chiaro → bordeaux brand SCURO e leggibile su crema.
     brightness(0) azzera a nero, poi lo si ricolora; il brightness(0.55)
     finale garantisce che resti scuro (le ricette senza freno finale lo
     lasciavano lavato/quasi invisibile). */
  filter: brightness(0) saturate(100%) invert(14%) sepia(93%)
          saturate(3200%) hue-rotate(332deg) brightness(0.55) contrast(1.1) !important;
}

/* Bottone "schermo intero" (e altri quadrati header) restati scuri. */
:root[data-theme="light"] #fullscreen-toggle,
:root[data-theme="light"] .fullscreen-toggle,
:root[data-theme="light"] .header-sq-btn:not(.active) {
  background: #ffffff !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border: 1px solid rgba(35, 27, 24, 0.16) !important;
}

/* ── Barra di navigazione inferiore ───────────────────────────────────── */
:root[data-theme="light"] .tab-bar {
  background: #f8f4ed !important;
  background-image: none !important;
  border-top: 1px solid rgba(35, 27, 24, 0.14) !important;
  box-shadow: 0 -2px 10px rgba(35, 27, 24, 0.06) !important;
}
:root[data-theme="light"] .tab-btn:not(.active) {
  color: var(--fp-text-2) !important;
}

/* ── Schermata di login (fondo, box, campi) ───────────────────────────── */
:root[data-theme="light"] #login-screen {
  background: linear-gradient(180deg, #faf7f2 0%, #f2eadd 55%, #faf7f2 100%) !important;
}
:root[data-theme="light"] .login-box {
  background: #ffffff !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border: 1px solid rgba(35, 27, 24, 0.14) !important;
  box-shadow: 0 20px 60px rgba(35, 27, 24, 0.16) !important;
}
:root[data-theme="light"] .cassa-input,
:root[data-theme="light"] #login-user,
:root[data-theme="light"] #login-pass {
  background: #f8f4ed !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border: 1px solid rgba(35, 27, 24, 0.16) !important;
}
:root[data-theme="light"] .cassa-input::placeholder { color: var(--fp-muted) !important; }

/* ── Pannelli hub (Nuovo Asporto, Uscita di Cassa, HACCP, …) ──────────────
   Fondo chiaro, il bordo-accento sinistro colorato resta com'è.            */
:root[data-theme="light"] .hub-card {
  background: #ffffff !important;
  background-image: none !important;
  color: var(--fp-text) !important;
}
:root[data-theme="light"] .hub-btn {
  background: #faf7f2 !important;
  background-image: none !important;
  color: var(--fp-text) !important;
}
:root[data-theme="light"] .hub-btn:hover {
  background: #f2eadd !important;
}
:root[data-theme="light"] .hub-btn-label { color: var(--fp-text) !important; }
:root[data-theme="light"] .hub-btn-desc  { color: var(--fp-muted) !important; }

/* ── Card tavoli — un colore chiaro per stato, testo scuro leggibile ──────
   Si conserva la SEMANTICA del colore (verde=libero, oro=prenotato,
   rosso=occupato, ambra=conto aperto, grigio=staff) ma su tinte chiare.    */
:root[data-theme="light"] .tavolo {
  background: #ffffff !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border: 1px solid rgba(35, 27, 24, 0.16) !important;
}
:root[data-theme="light"] .tavolo.libero {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
}
:root[data-theme="light"] .tavolo.attesa,
:root[data-theme="light"] .tavolo.prenotato {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
}
:root[data-theme="light"] .tavolo.occupato {
  background: #f7eee1 !important;
  border-color: #8a1828 !important;
}
:root[data-theme="light"] .tavolo.occupato.conto-aperto {
  background: #ffe9c2 !important;
  border-color: #b45309 !important;
}
:root[data-theme="light"] .tavolo.occupato.staff {
  background: #f1eeea !important;
  border-color: #76665a !important;
}
:root[data-theme="light"] .tavolo .t-num,
:root[data-theme="light"] .tavolo .t-nome,
:root[data-theme="light"] .tavolo .t-info { color: var(--fp-text) !important; }
:root[data-theme="light"] .tavolo.occupato .t-tot { color: #640517 !important; }

/* ── /direzione: isole scure hardcoded di page-direzione.css (solo LIGHT) ── */
:root[data-theme="light"] .hero-card {
  background: linear-gradient(155deg, #ffffff, #f8f4ed) !important;
  color: var(--fp-text) !important;
  border: 1px solid var(--fp-line) !important;
}
:root[data-theme="light"] .rep .tag-a {
  background: rgba(21, 122, 63, 0.12) !important; color: #157a3f !important;
  border: 1px solid rgba(21, 122, 63, 0.35) !important;
}
:root[data-theme="light"] .rep .tag-c {
  background: var(--bg-2) !important; color: var(--fp-muted) !important;
  border: 1px solid var(--fp-line) !important;
}
:root[data-theme="light"] .rep .tag-cucina {
  background: rgba(138, 24, 40, 0.12) !important; color: #640517 !important;
  border: 1px solid rgba(138, 24, 40, 0.34) !important;
}

/* ── Cassa Veloce: catalogo, prodotti, display prezzo e scontrino vuoto ────
   main.css dipinge queste superfici con fondi quasi neri hardcoded (non da
   variabile), quindi il ribaltamento dei token non le tocca. Il testo usa già
   var(--crema)=scuro: basta schiarire i fondi e torna tutto leggibile.       */
:root[data-theme="light"] .cr-catalog-column {
  background: #ffffff !important;
  background-image: none !important;
  border-color: rgba(35, 27, 24, 0.14) !important;
}
:root[data-theme="light"] .cr-product-btn {
  background: #faf7f2 !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border-color: #d9cdbd !important;
}
:root[data-theme="light"] .cr-product-btn:hover {
  background: #f2eadd !important;
}
:root[data-theme="light"] .cr-product-price { color: #640517 !important; }
/* Display digitale "TOTALE VENDITA" */
:root[data-theme="light"] #cr-price-input {
  background: #f8f4ed !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border: 1px solid rgba(35, 27, 24, 0.16) !important;
}
/* Scontrino vuoto */
:root[data-theme="light"] .cr-cart-card.is-empty,
:root[data-theme="light"] .cr-cart-card.is-empty .cr-cart-empty {
  background: #ffffff !important;
  background-image: none !important;
}

/* Riquadri numerici "display" scuri (coperti tavolo, % sconto): stesso fondo
   quasi nero hardcoded degli input cassa → li si porta a stile chiaro. */
:root[data-theme="light"] #coperti-input,
:root[data-theme="light"] #table-discount-percent {
  background: #f8f4ed !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border: 1px solid rgba(35, 27, 24, 0.16) !important;
}

/* ═══ §10 COMANDA (presa ordini al tavolo) ═══════════════════════════════
   Entrando nel tavolo per ordinare, main.css dipinge testata categorie,
   ricerca, box "ordinato", barra invia e i pannelli sezione con fondi quasi
   neri/grigi hardcoded (rgba(10,8,16), #0c0a10, var(--nero) sovrascritto,
   #1a0c0c…). Il testo è già scuro nel tema chiaro: basta schiarire i fondi. */

/* Testata sticky: filtro categorie + barra ricerca */
:root[data-theme="light"] #menu-sticky-head,
:root[data-theme="light"] #menu #search-bar,
:root[data-theme="light"] .search-bar,
:root[data-theme="light"] .menu-category-filter-wrap {
  background: #f8f4ed !important;
  background-image: none !important;
  border-color: rgba(35, 27, 24, 0.14) !important;
  box-shadow: 0 6px 16px rgba(35, 27, 24, 0.07) !important;
}
:root[data-theme="light"] #search-input,
:root[data-theme="light"] .search-bar input {
  background: #ffffff !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border: 1px solid rgba(35, 27, 24, 0.16) !important;
}
:root[data-theme="light"] .search-bar input::placeholder { color: var(--fp-muted) !important; }

/* Box carrello COMANDA, "ORDINATO/inviato", storico, righe/totale cassa.
   faro-pro.css:1235 li raggruppa con background rgba(17,16,20,.92)!important:
   qui li si riporta al chiaro (il testo interno è già scuro). */
:root[data-theme="light"] .cart-box,
:root[data-theme="light"] .sent-box,
:root[data-theme="light"] .storico-box,
:root[data-theme="light"] .cr-cart-rows,
:root[data-theme="light"] .cr-total {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid rgba(35, 27, 24, 0.14) !important;
  color: var(--fp-text) !important;
}
/* Pulsanti quantità +/−: faro-pro.css:1262 li rende bianco-trasparente su nero
   (border bianco invisibile su chiaro) → fondo tenue + bordo scuro visibile. */
:root[data-theme="light"] .qty-btn {
  background: #f2eadd !important;
  border: 1px solid rgba(35, 27, 24, 0.22) !important;
  color: var(--fp-text) !important;
}
:root[data-theme="light"] .qty-btn:active { background: #ede3d5 !important; }
:root[data-theme="light"] .cart-nome,
:root[data-theme="light"] .qty-num { color: var(--fp-text) !important; }

/* Barra inferiore (dietro INVIA COMANDA); il bottone resta accento oro/rosso */
:root[data-theme="light"] .bottom-bar {
  background: #f8f4ed !important;
  background-image: none !important;
  border-top: 1px solid rgba(35, 27, 24, 0.14) !important;
  box-shadow: 0 -2px 10px rgba(35, 27, 24, 0.06) !important;
}

/* Pannelli sezione (colonna cucina/bar) e loro intestazioni */
:root[data-theme="light"] .split-section,
:root[data-theme="light"] #split-cucina,
:root[data-theme="light"] #split-bar,
:root[data-theme="light"] .split-col {
  background: #ffffff !important;
  background-image: none !important;
}
/* La griglia interna ha un velo scuro rgba(8,8,11,.34) che sul bianco diventa
   grigio: va reso trasparente (ambito #menu per non toccare altre griglie). */
:root[data-theme="light"] #menu .split-grid,
:root[data-theme="light"] #menu .item-grid,
:root[data-theme="light"] #menu #grid-cucina,
:root[data-theme="light"] #menu #grid-bar {
  background: transparent !important;
  background-image: none !important;
}
:root[data-theme="light"] .split-hdr,
:root[data-theme="light"] .split-hdr--cucina,
:root[data-theme="light"] .split-hdr--bar {
  background: #f2eadd !important;
  background-image: none !important;
  border-color: rgba(35, 27, 24, 0.14) !important;
  color: var(--fp-text) !important;
}

/* Tessere prodotto della comanda: via il grigio, fondo chiaro + testo scuro.
   Ambito ristretto a #menu per non toccare altre griglie .item dell'app.    */
:root[data-theme="light"] #menu .comanda-product-card__main,
:root[data-theme="light"] #menu .prods-flat .item,
:root[data-theme="light"] #menu .split-grid .item {
  background: #faf7f2 !important;
  background-image: none !important;
  color: var(--fp-text) !important;
  border-color: rgba(35, 27, 24, 0.16) !important;
}
:root[data-theme="light"] #menu .comanda-product-card__main:active,
:root[data-theme="light"] #menu .prods-flat .item:active { background: #f2eadd !important; }
:root[data-theme="light"] #menu .comanda-product-card__name { color: var(--fp-text) !important; }
:root[data-theme="light"] #menu .comanda-product-card__price { color: #640517 !important; opacity: 1 !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   §11  RESIDUI — chiusura dei punti ancora illeggibili in tema chiaro.
   Fonte: audit automatico (Playwright) su 30 schermate che misura il contrasto
   WCAG di ogni testo visibile. Qui stanno SOLO le coppie rimaste sotto 3:1.
   Regola d'ingaggio: !important perche' molti di questi colori arrivano da
   style="" inline nel markup o nei template JS, che altrimenti vincono sempre.
   Palette: fondo #f5f8fd · superfici #ffffff/#f0f5fc · bordi #d5deea ·
   testo #0f1b2d · secondario #34435c · accento #1e40af · ok #157a3f ·
   warning #b45309 · pericolo #b91c1c.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Token del branding cliente: customer-theme.css e' caricato DOPO questo file
   e rimette i valori scuri. Qui vincono per specificita' (:root[data-theme]). */
:root[data-theme="light"] {
  --surface:    #ffffff;
  --background: #faf7f2;
  --text:       #231b18;
  --primary:    #640517;
  /* KDS (page-cucina.css): fondi di stato tenui al posto dei verdi/rossi scuri */
  --verde-bg:  #e6f4ea;
  --giallo-bg: #fff4d6;
  --rosso-bg:  #fde8e8;
  --verde:     #157a3f;
  --giallo:    #b45309;
  --rosso:     #b91c1c;
  --cucina-col:#b45309;
}

/* ── Testi rossi/verdi "da tema scuro" su fondo bianco ─────────────────── */
:root[data-theme="light"] .scorta-esaurito,
:root[data-theme="light"] .sent-info button,
:root[data-theme="light"] .spese-item button { color: #b91c1c !important; }
:root[data-theme="light"] .tavolo.libero .t-stato { color: #0f5c30 !important; }
:root[data-theme="light"] .t-cam,
:root[data-theme="light"] .t-coperti { color: #4d3f38 !important; }

/* ── Pastiglie contatore: erano nere semitrasparenti su bottone chiaro ─── */
:root[data-theme="light"] .menu-category-filter-count,
:root[data-theme="light"] .sala-filter-count {
  background: rgba(35, 27, 24, 0.08) !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] .sala-filter-count strong { color: #231b18 !important; }
:root[data-theme="light"] .sale-filter-wrap { background: #ffffff !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .sale-filter-kicker,
:root[data-theme="light"] .sale-filter-help { color: #4d3f38 !important; }

/* ── Agenda prenotazioni: il calendario restava nero ───────────────────── */
:root[data-theme="light"] .cal-day {
  background: #ffffff !important;
  color: #231b18 !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .cal-day.has-prenotazioni { background: #f7eee1 !important; border-color: #7c001c !important; }
:root[data-theme="light"] .cal-day.has-evento       { background: #ede9fe !important; border-color: #6d28d9 !important; }
:root[data-theme="light"] .cal-day.selected         { background: #ede3d5 !important; border-color: #640517 !important; }
:root[data-theme="light"] .cal-nav { background: #ffffff !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .cal-month,
:root[data-theme="light"] .cal-nav button { color: #231b18 !important; }
:root[data-theme="light"] #pren-giorno-titolo { color: #231b18 !important; }

/* ── Pulsanti primari: il fondo oro diventa blu, il testo deve schiarire ── */
:root[data-theme="light"] .btn-cassa,
:root[data-theme="light"] .btn-invia,
:root[data-theme="light"] .modal-confirm,
:root[data-theme="light"] .login-submit,
:root[data-theme="light"] .faro-btn--primary,
:root[data-theme="light"] .btn-cassa span,
:root[data-theme="light"] .btn-invia span,
:root[data-theme="light"] .modal-confirm span,
:root[data-theme="light"] #btn-invia-label { color: #ffffff !important; }

/* ── Barra "Indietro" e pulsanti di pannello ───────────────────────────── */
:root[data-theme="light"] .faro-back-btn,
:root[data-theme="light"] .haccp-btn {
  background: #ffffff !important;
  color: #231b18 !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .faro-back-btn > span[aria-hidden="true"] { color: #640517 !important; }

/* ── Modale Cassa: totale, sconto, anteprima ───────────────────────────── */
:root[data-theme="light"] #cassa-tot-orig,
:root[data-theme="light"] [style*="ECD3A0" i] { color: #500f16 !important; }
:root[data-theme="light"] .faro-discount-preview { background: #f8f4ed !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .faro-discount-preview > div { background: #ffffff !important; }
:root[data-theme="light"] .faro-discount-preview span { color: #4d3f38 !important; }
:root[data-theme="light"] .faro-discount-preview strong { color: #231b18 !important; }
:root[data-theme="light"] .faro-discount-preview .faro-discount-preview-total { background: #f7eee1 !important; border-color: #7c001c !important; }
:root[data-theme="light"] .faro-discount-preview-total strong { color: #500f16 !important; }
:root[data-theme="light"] .faro-discount-reset { background: #fde8e8 !important; color: #b91c1c !important; border-color: #b91c1c !important; }
:root[data-theme="light"] .faro-discount-mode button.active,
:root[data-theme="light"] .faro-discount-scope button.active,
:root[data-theme="light"] .table-discount-presets button.selected,
:root[data-theme="light"] .table-discount-scopes button.selected {
  background: #640517 !important;
  color: #ffffff !important;
  border-color: #500f16 !important;
}
:root[data-theme="light"] .faro-discount-presets button { color: #640517 !important; }
:root[data-theme="light"] .faro-discount-input-wrap { background: #ffffff !important; }
:root[data-theme="light"] #cassa-sconto-input-prefix { color: #640517 !important; }
:root[data-theme="light"] #cassa-riepilogo-sconto,
:root[data-theme="light"] #table-discount-summary { color: #4d3f38 !important; }
:root[data-theme="light"] .table-discount-card__head label span { color: #640517 !important; }

/* ── Card e badge del pannello Gestione ────────────────────────────────── */
:root[data-theme="light"] .hub-card-header > div,
:root[data-theme="light"] .hub-card-icon { background: #f7eee1 !important; color: #500f16 !important; }
:root[data-theme="light"] #allerte-fc-badge { background: #fde8e8 !important; color: #b91c1c !important; border-color: #b91c1c !important; }
:root[data-theme="light"] .aruba-sync-card { background: #ffffff !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .aruba-sync-card__title { color: #231b18 !important; }
:root[data-theme="light"] .aruba-sync-card__sub,
:root[data-theme="light"] .aruba-sync-card__status,
:root[data-theme="light"] .t-mute { color: #4d3f38 !important; }

/* ── Campi di inserimento: molti hanno fondo scuro nello style inline ──── */
:root[data-theme="light"] input[type="text"],
:root[data-theme="light"] input[type="number"],
:root[data-theme="light"] input[type="date"],
:root[data-theme="light"] input[type="time"],
:root[data-theme="light"] input[type="password"],
:root[data-theme="light"] input[type="search"],
:root[data-theme="light"] input[type="tel"],
:root[data-theme="light"] input[type="email"],
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background: #ffffff !important;
  color: #231b18 !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] input::placeholder,
:root[data-theme="light"] textarea::placeholder { color: #76665a !important; }

/* ── Colori accesi scritti a mano nei template JS/HTML ─────────────────── */
:root[data-theme="light"] [style*="color:#4ade80" i],
:root[data-theme="light"] [style*="color: #4ade80" i],
:root[data-theme="light"] [style*="color:#6ee7a0" i],
:root[data-theme="light"] [style*="color: #6ee7a0" i],
:root[data-theme="light"] [style*="color:#6ee7b7" i],
:root[data-theme="light"] [style*="color: #6ee7b7" i] { color: #0f5c30 !important; }
:root[data-theme="light"] [style*="color:#fbbf24" i],
:root[data-theme="light"] [style*="color: #fbbf24" i] { color: #b45309 !important; }
:root[data-theme="light"] [style*="color:#f87171" i],
:root[data-theme="light"] [style*="color: #f87171" i] { color: #b91c1c !important; }
:root[data-theme="light"] [style*="color:#c4b5fd" i],
:root[data-theme="light"] [style*="color: #c4b5fd" i] { color: #5b21b6 !important; }
:root[data-theme="light"] [style*="color:#9FCF9C" i],
:root[data-theme="light"] [style*="color: #9FCF9C" i] { color: #0f5c30 !important; }
:root[data-theme="light"] [style*="color:#A8C0D4" i],
:root[data-theme="light"] [style*="color: #A8C0D4" i] { color: #500f16 !important; }
/* riquadri verdi scuri scritti inline (inventario, scorte, senza fiscale) */
:root[data-theme="light"] [style*="#0f2a1a" i],
:root[data-theme="light"] [style*="#0a1a14" i],
:root[data-theme="light"] [style*="#064e3b" i] {
  background: #e6f4ea !important;
  color: #0f5c30 !important;
  border-color: #157a3f !important;
}

/* ── KDS cucina/attese: testate di card e pulsanti "pronto" ────────────── */
:root[data-theme="light"] .card-tavolo,
:root[data-theme="light"] .card-coperti,
:root[data-theme="light"] .card-max-wait strong { color: #231b18 !important; }
:root[data-theme="light"] .card-cam,
:root[data-theme="light"] .card-max-wait small { color: #4d3f38 !important; }
:root[data-theme="light"] .portata-ready { background: #e6f4ea !important; color: #0f5c30 !important; border-color: #157a3f !important; }
:root[data-theme="light"] .portata-ready.is-bar { background: #f7eee1 !important; color: #500f16 !important; border-color: #7c001c !important; }
:root[data-theme="light"] .item-done-btn { background: #f8f4ed !important; color: #0f5c30 !important; border-color: #157a3f !important; }
/* il lampeggio del ritardo resta, ma fra due rossi chiari */
@keyframes flash-bg-light { 0%, 100% { background: #fde8e8; } 50% { background: #f8c9c9; } }
:root[data-theme="light"] .comanda-card.rosso .card-header { animation-name: flash-bg-light !important; }

/* ── Ultimi residui (secondo giro di audit) ────────────────────────────── */
/* Filtro sale: il bottone attivo era bianco su bianco */
:root[data-theme="light"] .sala-filter-btn.active,
:root[data-theme="light"] .sale-filter .sala-filter-btn.active {
  background: #640517 !important;
  border-color: #500f16 !important;
}
:root[data-theme="light"] .sala-filter-btn.active .sala-filter-label { color: #ffffff !important; }
:root[data-theme="light"] .sala-filter-btn.active .sala-filter-count {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
}
/* Pulsante "Imposta evento" e badge di sincronizzazione in errore */
:root[data-theme="light"] .evento-empty__btn { color: #5b21b6 !important; border-color: #5b21b6 !important; }
:root[data-theme="light"] .aruba-sync-badge--err { color: #b91c1c !important; }
/* Rosa "coperto" dei KPI di Direzione: scritto inline da page-report.js */
:root[data-theme="light"] [style*="#F0A0AD" i],
:root[data-theme="light"] [style*="#F0A0AD" i] .kpi-val { color: #a3184a !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   §12  PRENOTAZIONI, EVENTI E SCHEDE — il caso segnalato dall'utente:
   "nel calendario delle prenotazioni una prenotazione inserita e' illeggibile".
   Due cause distinte, entrambe invisibili a un audit su archivio vuoto:
   1) faro-pro.css:1501-1513 forza .pren-card / .evento-card e le altre schede a
      background rgba(17,16,20,.92) !important — fondo NERO — mentre il testo usa
      var(--text-primary), che nel tema chiaro e' scuro: scritta scura su nero.
   2) l'ora e il badge tavolo usano --brass-300 (#F0D79C), un oro chiarissimo
      pensato per il fondo nero: su bianco e' praticamente invisibile.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Token ottone: 8 usi su 9 sono testo, quindi vanno scuriti; i --brass-700 sono
   solo bordi e restano tenui. L'unico uso come sfondo (.compare-bar) e' coperto sotto. */
:root[data-theme="light"] {
  --brass-300: #8a5a12;
  --brass-400: #8a5a12;
  --brass-500: #7a4f10;
  --brass-700: #c9a86a;
}

/* Schede su fondo chiaro (prenotazioni, eventi, dashboard, magazzino, categorie) */
:root[data-theme="light"] .pren-card,
:root[data-theme="light"] .pren-list,
:root[data-theme="light"] .pren-empty,
:root[data-theme="light"] .evento-card,
:root[data-theme="light"] .evento-empty,
:root[data-theme="light"] .dash-card,
:root[data-theme="light"] .giornata-card,
:root[data-theme="light"] .mag-item,
:root[data-theme="light"] .cat-item {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .pren-card:hover,
:root[data-theme="light"] .mag-item:hover,
:root[data-theme="light"] .cat-item:hover { border-color: #7c001c !important; }

/* Testi delle schede prenotazione */
:root[data-theme="light"] .pren-card__nome,
:root[data-theme="light"] .evento-card__title { color: #231b18 !important; }
:root[data-theme="light"] .pren-card__note,
:root[data-theme="light"] .evento-card__desc { color: #4d3f38 !important; }
:root[data-theme="light"] .pren-card__ora,
:root[data-theme="light"] .pren-banner__ora { color: #500f16 !important; }
:root[data-theme="light"] .pren-card__persone,
:root[data-theme="light"] .pren-alert__label,
:root[data-theme="light"] .pren-banner__cop,
:root[data-theme="light"] .pren-banner__title { color: #34435c !important; }
:root[data-theme="light"] .pren-card__tavolo,
:root[data-theme="light"] .pren-banner__tav {
  background: #fff4d6 !important;
  color: #7a4f10 !important;
  border-color: #b08a3c !important;
}
:root[data-theme="light"] .pren-card__tel { color: #640517 !important; }
:root[data-theme="light"] .evento-card__kicker { color: #5b21b6 !important; }

/* Banner "Prenotazioni oggi" sulla mappa tavoli */
:root[data-theme="light"] .pren-banner {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .pren-banner__chip {
  background: #f8f4ed !important;
  border-color: #e4dcd0 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] .pren-banner__nome { color: #231b18 !important; }
:root[data-theme="light"] .pren-banner__count,
:root[data-theme="light"] .pren-banner__totale {
  background: #f7eee1 !important;
  color: #500f16 !important;
  border-color: #7c001c !important;
}

/* Totale coperti, pulsanti riga e interruttore avviso */
:root[data-theme="light"] .pren-totale {
  background: #f8f4ed !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .pren-totale__label { color: #4d3f38 !important; }
:root[data-theme="light"] .pren-totale__val { color: #500f16 !important; }
:root[data-theme="light"] .pren-btn {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] .pren-btn--del:hover { color: #b91c1c !important; border-color: #b91c1c !important; }
:root[data-theme="light"] .pren-btn--edit:hover { color: #640517 !important; border-color: #640517 !important; }
:root[data-theme="light"] .slider { background: #dcd1c3 !important; }
:root[data-theme="light"] .switch input:checked + .slider { background: #157a3f !important; }
:root[data-theme="light"] .cal-dot { background: #7c001c !important; }
:root[data-theme="light"] .cal-dot-evento { background: #6d28d9 !important; }

/* Barra "Ricavi" del P&L: gradient con testo scuro sopra, ora schiarito */
:root[data-theme="light"] .compare-bar,
:root[data-theme="light"] .compare-bar.ricavi,
:root[data-theme="light"] .compare-bar.costi { color: #ffffff !important; }

/* ── Ultimi effetti del ribaltamento dell'ottone (usato anche come SFONDO) ── */
/* Bottone vista attivo e selettore modalita' conto separato: fondo oro brunito,
   quindi il testo deve schiarire. Serve !important perche' main.css:551 e lo
   stile inline di cassa.js:744 arrivano dopo per specificita'/inline. */
:root[data-theme="light"] .header-sq-btn.active,
:root[data-theme="light"] .header-sq-btn.active svg,
:root[data-theme="light"] #sep-modalita-bar [aria-selected="true"] { color: #ffffff !important; }
/* Etichetta "evento" della scheda giornata (nome reale: __eyebrow) */
:root[data-theme="light"] .evento-card__eyebrow { color: #5b21b6 !important; }
/* Badge di stato della card Sync PEC/Aruba: fondo scuro residuo */
:root[data-theme="light"] .aruba-sync-card__badge {
  background: #f8f4ed !important;
  color: #500f16 !important;
  border-color: #e4dcd0 !important;
}

/* ═══ §AREA sala-tavoli — INIZIO ═══ */
/* Login, tab TAVOLI (home) e tutto ciò che si apre dalla sala: mappa tavoli,
   planimetria, menu azioni del tavolo, storico, coperti, trasferimento, sale,
   uscita di cassa, toast. Ogni selettore parte da :root[data-theme="light"],
   quindi il tema scuro resta identico. Palette del tema chiaro (vedi testata). */

/* ── Login: messaggio di errore e riga di stato ─────────────────────────── */
/* faro-pro.css:246 dipinge .login-error rosa chiaro (#ffc1ca) su rosa tenue. */
:root[data-theme="light"] #login-err {
  background: #fde8e8 !important;
  border: 1px solid #b91c1c !important;
  color: #b91c1c !important;
}
/* #login-debug: auth.js scrive il colore in el.style.color, che il browser
   serializza come rgb(): il primo canale basta a riconoscere lo stato
   (251 = #fbbf24 avviso, 213 = #D5B36F attesa, 74 = #4ade80 ok,
   248 = #f87171 errore; 181 = #B5ADC6 neutro resta sul colore di base). */
:root[data-theme="light"] #login-debug:not(:empty) {
  background: #f8f4ed !important;
  border: 1px solid #e4dcd0 !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] #login-debug[style*="rgb(251"] {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #login-debug[style*="rgb(213"] { color: #8a5a12 !important; }
:root[data-theme="light"] #login-debug[style*="rgb(74"] {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  color: #0f5c30 !important;
}
:root[data-theme="light"] #login-debug[style*="rgb(248"] {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}

/* ── Modal "Reset password" ─────────────────────────────────────────────── */
/* auth.js scrive il riquadro esito con fondi scuri (#3a1f1f = rgb(58..),
   #1f3a1f = rgb(31..)) e testo pastello: diventano superfici di stato chiare. */
:root[data-theme="light"] #reset-msg[style*="rgb(58"],
:root[data-theme="light"] #reset-msg[style*="3a1f1f" i] {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
:root[data-theme="light"] #reset-msg[style*="rgb(31"],
:root[data-theme="light"] #reset-msg[style*="1f3a1f" i] {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  color: #0f5c30 !important;
}
/* "Invia richiesta" è l'azione primaria (inline var(--bordeaux) + #fff), ma la
   regola chiara di .hub-btn la appiattiva a tasto grigio come "Annulla". */
:root[data-theme="light"] #modal-richiedi-reset .hub-btn {
  border: 1px solid #e4dcd0 !important;
}
:root[data-theme="light"] #btn-richiedi-reset {
  background: #7c001c !important;
  border-color: #7c001c !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #btn-richiedi-reset:hover { background: #640517 !important; }

/* ── Banner "Prenotazioni oggi": prenotazioni già passate ───────────────── */
/* bundle.css:3823 le spegne con opacity .45: testo a 2,1-2,9:1. Restano
   attenuate (fondo e testo grigio-ardesia, bordo tratteggiato) ma leggibili. */
:root[data-theme="light"] .pren-banner__chip.is-passata {
  opacity: 1 !important;
  background: #faf7f2 !important;
  border: 1px dashed #e4dcd0 !important;
}
:root[data-theme="light"] .pren-banner__chip.is-passata .pren-banner__ora,
:root[data-theme="light"] .pren-banner__chip.is-passata .pren-banner__nome,
:root[data-theme="light"] .pren-banner__chip.is-passata .pren-banner__cop { color: #76665a !important; }
:root[data-theme="light"] .pren-banner__chip.is-passata .pren-banner__tav {
  background: #f8f4ed !important;
  border-color: #e4dcd0 !important;
  color: #76665a !important;
}

/* ── Filtro "Sale operative": contatore del filtro attivo ───────────────── */
/* theme-light.css:845 scurisce lo <strong> anche sul bottone attivo (blu). */
:root[data-theme="light"] .sala-filter-btn.active .sala-filter-count strong { color: #ffffff !important; }

/* ── Card tavolo: badge cameriere e "×" svuota ──────────────────────────── */
/* bundle.css:3069 e 3096 usano veli neri rgba(0,0,0,.3/.4): sulla card chiara
   diventavano pastiglie grigio-marrone (e la × un bottone nero). */
:root[data-theme="light"] .tavolo .t-cam {
  background: #ffffff !important;
  border: 1px solid #e4dcd0;
  color: #4d3f38 !important;
}
:root[data-theme="light"] .tavolo .lbl-svuota-tavolo {
  background: #ffffff !important;
  border: 1px solid #b91c1c !important;
  color: #b91c1c !important;
}
:root[data-theme="light"] .tavolo .lbl-svuota-tavolo:hover { background: #fde8e8 !important; }
/* Stato della card ("In servizio", "Conto aperto", "Aperto 1g", "Staff"):
   bundle.css:3031 usa --text-secondary, che sui fondi ambra/grigi delle card
   asporto scendeva a 4,4:1. Il verde di "Libero" (regola esistente) resta. */
:root[data-theme="light"] .tavolo .t-stato { color: #4d3f38 !important; }
/* faro-pro.css:922 mette la × in alto a sinistra, sopra la "T" di "Tavolo N"
   (card "In attesa"): il nome si sposta a destra quanto basta a non coprirlo. */
:root[data-theme="light"] .tavolo.attesa .lbl-svuota-tavolo ~ .t-num { padding-left: 28px !important; }

/* ── Planimetria ────────────────────────────────────────────────────────── */
/* main.css:3569-3627: tavoli su fondi quasi neri (#16202e, #40340f, #172554,
   #33290f), barra di scelta rgba(10,8,16,.96), tasti attivi oro chiaro.
   Stati come nella griglia: fondi tenui, testo scuro, bordo del colore pieno. */
:root[data-theme="light"] .plan-tavolo {
  color: #231b18 !important;
  box-shadow: 0 3px 8px rgba(35, 27, 24, 0.14) !important;
}
:root[data-theme="light"] .plan-st-libero    { background: #e6f4ea !important; border-color: #157a3f !important; }
:root[data-theme="light"] .plan-st-attesa    { background: #fff4d6 !important; border-color: #b45309 !important; }
:root[data-theme="light"] .plan-st-occupato  { background: #f7eee1 !important; border-color: #7c001c !important; }
:root[data-theme="light"] .plan-st-prenotato { background: #fff4d6 !important; border-color: #8a5a12 !important; }
:root[data-theme="light"] .plan-info { opacity: 1 !important; color: #34435c !important; }
/* Taglia "s" (36-44 px): "€ 709.00" usciva dalla forma e finiva sul bordo.
   La forma si allarga al contenuto invece di tagliarlo. */
:root[data-theme="light"] .plan-tavolo.plan-sz-s {
  min-width: max-content;
  padding: 0 5px;
}
:root[data-theme="light"] .plan-selected,
:root[data-theme="light"] .plan-join-pick { outline-color: #7c001c !important; }
:root[data-theme="light"] .planimetria.plan-edit { border-color: #7c001c !important; }
:root[data-theme="light"] .plan-picker {
  background: #ffffff !important;
  border: 1px solid #7c001c !important;
  box-shadow: 0 10px 24px rgba(35, 27, 24, 0.18) !important;
}
:root[data-theme="light"] .plan-picker-lbl { color: #231b18 !important; }
:root[data-theme="light"] .plan-picker-sep { color: #76665a !important; }
:root[data-theme="light"] .plan-pick-btn,
:root[data-theme="light"] .plan-sala-chip {
  background: #f8f4ed !important;
  border: 1px solid #e4dcd0 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] .plan-pick-btn.active,
:root[data-theme="light"] .plan-sala-chip.active {
  background: #7c001c !important;
  border-color: #7c001c !important;
  color: #ffffff !important;
}
:root[data-theme="light"] .plan-empty { color: #76665a !important; }
/* Tasto "Disponi": planimetria.js ci scrive "✎ Disponi" / "✓ Fatto" ma il
   tasto è un quadrato da icona (main.css:542): il testo usciva dal bordo e
   finiva bianco sulla testata chiara. Qui si allarga al contenuto. */
:root[data-theme="light"] #btn-plan-edit {
  width: auto !important;
  min-width: 44px;
  padding: 0 10px !important;
  white-space: nowrap;
  font-size: 0.85rem;
}
/* In modifica: stesso oro brunito del tasto vista attivo. */
:root[data-theme="light"] #btn-plan-edit.active {
  background: #8a5a12 !important;
  border-color: #8a5a12 !important;
  color: #ffffff !important;
}

/* ── Menu azioni del tavolo ─────────────────────────────────────────────── */
/* faro-pro.css:1198 dipinge .action-btn/.btn-sep con fondo e bordo bianchi
   traslucidi (!important): sul chiaro i tasti diventavano testo nudo senza
   contorno. Si ridà a ciascuno una superficie col colore della sua funzione. */
:root[data-theme="light"] #azioni-tavolo-wrap .action-btn:not(.btn-cassa) {
  background: #ffffff !important;
  border: 1px solid #e4dcd0 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #azioni-tavolo-wrap .btn-sep {
  background: #f7eee1 !important;
  border-color: #7c001c !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #azioni-tavolo-wrap .action-btn[onclick^="apriTrasferisci"] {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
}
:root[data-theme="light"] #azioni-tavolo-wrap .action-btn[onclick^="convertiContoAperto"] {
  background: #fff4d6 !important;
  border-color: #8a5a12 !important;
}
:root[data-theme="light"] #btn-svuota-tavolo-view {
  background: #f8f4ed !important;
  border-color: #76665a !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] #azioni-tavolo-wrap .action-btn[onclick^="eliminaTavoloSenzaTraccia"] {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
/* Ingranaggio aperto: main.css:2918 lo riempie di blu, ma l'icona è un'emoji
   grigia: resta un fondo tenue "premuto" col bordo blu. */
:root[data-theme="light"] .toggle-azioni-btn.open {
  background: #f2eadd !important;
  border-color: #7c001c !important;
}

/* Testata del tavolo: il badge coperti/sconto (cliccabile) aveva fondo e bordo
   bianchi traslucidi (faro-pro.css:1167), invisibili; su telefono il titolo a
   riga singola con ellissi (bundle.css:3233) nascondeva proprio lo sconto
   ("· 2 cop. · −10% FOOD"): si va a capo, al massimo su due righe. */
:root[data-theme="light"] #t-coperti-badge {
  background: #f8f4ed !important;
  border: 1px solid #e4dcd0 !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] #t-coperti-badge {
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
:root[data-theme="light"] #menu .tavolo-title {
  white-space: normal !important;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.35;
}

/* ── Storico di oggi: righe annullate ───────────────────────────────────── */
/* main.css:1037 opacity .5 + faro-pro: il testo barrato scendeva a 1,7:1.
   Resta barrato (è l'informazione), ma pieno. */
/* main.css:1018 spegne tutto il riquadro (opacity .75): anche le righe valide
   scendevano sotto soglia. */
:root[data-theme="light"] #storico-list { opacity: 1 !important; }
:root[data-theme="light"] #storico-list .storico-annullato { opacity: 1 !important; }
:root[data-theme="light"] #storico-list .storico-annullato > span:first-child { color: #76665a !important; }
:root[data-theme="light"] #storico-list .storico-row { border-bottom-color: #e4dcd0 !important; }

/* ── Modal Trasferisci / Unisci ─────────────────────────────────────────── */
/* Nome del tavolo di partenza scritto in bianco inline (index.html). */
:root[data-theme="light"] #trasf-from { color: #231b18 !important; }
/* Destinazione scelta: fondo blu pieno, il testo deve restare bianco. */
:root[data-theme="light"] #trasf-grid .cop-btn.sel {
  background: #7c001c !important;
  border-color: #640517 !important;
  color: #ffffff !important;
}
/* "Sposta / Unisci": inline fondo #78350f e testo crema -> oro brunito pieno. */
:root[data-theme="light"] #modal-trasferisci .modal-confirm {
  background: #8a5a12 !important;
  background-image: none !important;
  border-color: #8a5a12 !important;
  color: #ffffff !important;
}

/* ── Pulsanti "Annulla/Salta/Azzera" delle modali di sala ───────────────── */
/* Senza bordo né fondo sul bianco non sembravano più pulsanti. */
:root[data-theme="light"] #modal-coperti .modal-cancel,
:root[data-theme="light"] #modal-spesa .modal-cancel,
:root[data-theme="light"] #modal-trasferisci .modal-cancel,
:root[data-theme="light"] #modal-sale .modal-cancel {
  background: #ffffff !important;
  border: 1px solid #e4dcd0 !important;
  color: #231b18 !important;
}

/* ── Modal coperti: errore della percentuale di sconto ──────────────────── */
/* theme-light.css:905 forza #table-discount-summary a #34435c anche nello
   stato .is-error, che così non si distingueva più dal testo normale. */
:root[data-theme="light"] #table-discount-summary.is-error { color: #b91c1c !important; }

/* ── Modal "Sale e tavoli" ──────────────────────────────────────────────── */
/* main.css:5820/5865/5902: "+ Nuova" oro chiaro, "Elimina" rosso chiaro e
   nota capienza oro chiaro su fondo bianco (1,1-2,5:1). */
:root[data-theme="light"] .sale-new-btn {
  background: #f7eee1 !important;
  border-color: #7c001c !important;
  color: #640517 !important;
}
:root[data-theme="light"] .sala-admin-actions button {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] .sala-admin-actions .is-danger {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
:root[data-theme="light"] .sale-capacity-note { color: #4d3f38 !important; }
:root[data-theme="light"] .sale-capacity-note.is-full,
:root[data-theme="light"] .sale-admin-empty.is-error { color: #b91c1c !important; }
:root[data-theme="light"] .sala-color-choice { background: #ffffff !important; border-color: #e4dcd0; }

/* ── Barra di navigazione inferiore: tab attivo ─────────────────────────── */
/* faro-pro.css:1094 lo segnala con una velatura oro .16 che sul chiaro
   diventa un beige appena percettibile, con lo stesso testo dei tab inattivi.
   Qui: fondo azzurro, bordo e testo blu (icona inclusa, currentColor). */
:root[data-theme="light"] .tab-bar .tab-btn.active {
  background: #f2eadd !important;
  border-color: #7c001c !important;
  color: #640517 !important;
}
:root[data-theme="light"] .tab-bar .tab-btn.active .tab-ico { filter: none !important; }

/* ── Indicatori di connessione ──────────────────────────────────────────── */
/* Badge "⏳ N in coda" (comande in attesa di rete, index.html inline
   #c47a20 + testo bianco = 3:1): oro brunito pieno, testo bianco. Il banner
   "Connessione persa" (utils.js, #991b1b + bianco) è già leggibile. */
:root[data-theme="light"] #offline-queue-badge { background: #8a5a12 !important; color: #ffffff !important; }

/* ── Toast ──────────────────────────────────────────────────────────────── */
/* main.css:1646-1660: fondi quasi neri (#064e3b, #450a0a, #2d1900, #1e1b4b)
   con ombra nera .7: isole scure sull'interfaccia chiara. Diventano fondi
   pieni del colore di stato con testo bianco. */
:root[data-theme="light"] .toast { color: #ffffff !important; }
:root[data-theme="light"] .toast-ok   { background: #157a3f !important; border-color: #0f5c30 !important; }
:root[data-theme="light"] .toast-err  { background: #b91c1c !important; border-color: #991b1b !important; }
:root[data-theme="light"] .toast-warn { background: #8a5a12 !important; border-color: #7a4f10 !important; }
:root[data-theme="light"] .toast-info { background: #1d4ed8 !important; border-color: #1e40af !important; }
/* ══ Revisione avversaria (stati non coperti dal primo giro) ══════════════ */

/* ── Card tavolo con sale NON configurate: badge "Da assegnare" ─────────── */
/* Con /api/sale vuota (installazione nuova, sale eliminate) la mappa non si
   divide in sezioni e ogni card mostra il badge di sala: main.css:5687 lo
   scrive #A8B0BD, 1,9:1 sulle card azzurre e ambra. Il pallino resta del
   colore della sala, il testo diventa ardesia. */
:root[data-theme="light"] .tavolo .t-sala-badge,
:root[data-theme="light"] .tavolo .t-sala-badge.is-unassigned { color: #4d3f38 !important; }
/* Il badge (in cima, centrato) finiva sotto la pastiglia del cameriere, che è
   assoluta in alto a destra e larga fino al 60%: con un cameriere si sposta
   sotto la pastiglia. */
:root[data-theme="light"] .tavolo:has(> .t-cam) > .t-sala-badge { margin-top: 16px !important; }

/* ── Mappa vuota: "Nessun tavolo configurato" ───────────────────────────── */
/* .sale-map-empty non ha stili in nessun foglio: nella griglia a 5 colonne
   titolo e istruzione finivano incollati in una colonna stretta
   ("configuratoCrea una sala…"). Diventa un riquadro a tutta larghezza. */
:root[data-theme="light"] #grid-tavoli .sale-map-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 16px;
  text-align: center;
  background: #ffffff;
  border: 1px dashed #e4dcd0;
  border-radius: 12px;
  color: #76665a;
}
:root[data-theme="light"] #grid-tavoli .sale-map-empty strong { color: #231b18; font-size: 0.95rem; }
/* "Nessun ordine d'asporto in corso": inline grid-column span 3 su una griglia
   a 5 colonne, restava spostato a sinistra. */
:root[data-theme="light"] #grid-asporto > div[style*="span 3"] { grid-column: 1 / -1 !important; }

/* ── Modal Sale: tasto e campo disabilitati ─────────────────────────────── */
/* Con l'API sale assente o i 99 posti tecnici esauriti sale.js disabilita
   "Crea sala" e il campo del numero di tavoli, e durante il salvataggio il
   tasto mostra "Salvataggio…": nessun foglio ha uno stile :disabled per
   .modal-confirm, quindi restava blu pieno, identico a quello attivo. */
:root[data-theme="light"] #modal-sale .modal-confirm:disabled {
  background: #ece7df !important;
  background-image: none !important;
  border-color: #e4dcd0 !important;
  color: #4d3f38 !important;
  box-shadow: none !important;
  cursor: not-allowed;
}
:root[data-theme="light"] #modal-sale input:disabled {
  background: #f8f4ed !important;
  border-style: dashed !important;
  color: #76665a !important;
  cursor: not-allowed;
}

/* ── Testata della mappa su tablet e telefono ───────────────────────────── */
/* faro-pro.css:259 divide la testata in 1fr auto 1fr: su telefono le colonne
   laterali sono di ~110 px ma i gruppi di tasti ne occupano 148 (sinistra) e
   186-306 (destra), quindi i tasti di destra coprivano aggiorna, tema e logo,
   e in planimetria il testo "✓ Fatto" finiva sotto il logo. Sotto 900 px le
   colonne laterali seguono il contenuto e il logo si restringe; sotto 560 px
   i controlli della mappa scendono in una seconda riga (il logo resta
   visibile e toccabile: il triplo tap apre il tastierino del titolare). */
@media (max-width: 900px) {
  :root[data-theme="light"] .header-mappa { grid-template-columns: auto minmax(0, 1fr) auto !important; }
  :root[data-theme="light"] .header-mappa .brand-lockup img { max-width: 100%; }
}
@media (max-width: 560px) {
  :root[data-theme="light"] .header-mappa {
    grid-template-areas: "hsx hlogo hfull" "hctrl hctrl hctrl";
    row-gap: 8px !important;
    column-gap: 8px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  :root[data-theme="light"] .header-mappa .header-left { grid-area: hsx; gap: 6px; }
  :root[data-theme="light"] .header-mappa .brand-lockup { grid-area: hlogo; }
  :root[data-theme="light"] .header-mappa .header-right { display: contents; }
  :root[data-theme="light"] .header-mappa #fullscreen-toggle { grid-area: hfull; }
  :root[data-theme="light"] .header-mappa #header-tavoli-ctrl {
    grid-area: hctrl;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  :root[data-theme="light"] .header-mappa .brand-lockup img {
    width: auto !important;
    max-width: 100%;
    max-height: 40px;
  }
}

/* ── Titolo del tavolo su telefono ──────────────────────────────────────── */
/* Col titolo a due righe il badge coperti/sconto finiva troncato quando la
   sala ha un nome lungo ("Tavolo 102 · Dehors Terrazza sul Mare – Lato
   Scogliera Nord · 40…"): lo sconto "−10% FOOD" spariva del tutto e
   "· 2 cop." si spezzava in due pastiglie. Su telefono il badge va su una
   riga sua, sempre intera; si accorcia solo il nome. */
@media (max-width: 640px) {
  :root[data-theme="light"] #menu .tavolo-title {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    -webkit-line-clamp: unset;
    overflow: visible;
  }
  :root[data-theme="light"] #menu #t-id {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    max-width: 100%;
    text-align: center;
  }
  :root[data-theme="light"] #menu #t-coperti-badge {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }
  :root[data-theme="light"] #menu #t-coperti-badge:empty { display: none; }
}
/* ═══ §AREA sala-tavoli — FINE ═══ */

/* ═══ §AREA comanda-menu — INIZIO ═══ */
/* Presa comanda al tavolo (anche asporto, conto aperto, staff) e gestione
   menu in sala. Fonte: audit a pixel sugli shots di work/comanda-menu.
   Regola d'ingaggio: molti colori arrivano da style="" scritti dai template
   JS (ordini.js, carrello.js, uscite.js, menu-admin.js), quindi servono
   !important e, a volte, selettori per attributo. Palette del tema chiaro. */

/* ── Testata tavolo: pulsanti azione (⚙️) ─────────────────────────────────
   faro-pro.css dà a .action-btn fondo e bordo bianchi traslucidi: sul chiaro
   i pulsanti Conto separato / Trasferisci / Conto aperto / Elimina sparivano
   (sembravano testo semplice). Cassa resta il pulsante pieno blu. */
:root[data-theme="light"] #azioni-tavolo-wrap .action-btn:not(.btn-cassa) {
  background: #ffffff !important;
  border: 1px solid #d7ccbe !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] #azioni-tavolo-wrap .action-btn[onclick^="eliminaTavolo"] {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
:root[data-theme="light"] #t-coperti-badge {
  border-color: #e4dcd0 !important;
  background: #ffffff !important;
  color: #4d3f38 !important;
}

/* ── ORDINATO: righe inviate ─────────────────────────────────────────────── */
/* Ristampa Cucina / Bar: fondi quasi neri scritti inline da ordini.js */
:root[data-theme="light"] #sent-list button[onclick^="ristampaComanda"] {
  background: #ffffff !important;
  border: 1px solid #640517 !important;
  color: #640517 !important;
}
:root[data-theme="light"] #sent-list button[onclick="ristampaComanda('cucina')"] {
  border-color: #b45309 !important;
  color: #b45309 !important;
}
/* Etichette reparto: "bar" era oro chiarissimo su crema (1.3:1) */
:root[data-theme="light"] #menu .tag-rep.tag-cucina {
  background: #fff4d6 !important;
  border: 1px solid #b45309 !important;
  color: #8a5a12 !important;
}
:root[data-theme="light"] #menu .tag-rep.tag-sala {
  background: #f7eee1 !important;
  border: 1px solid #7c001c !important;
  color: #7c001c !important;
}
/* riga "servizio" coperti (inline oro) */
:root[data-theme="light"] #menu .tag-rep.tag-sala[style*="F0D79C" i] {
  background: #fff4d6 !important;
  border-color: #8a5a12 !important;
  color: #8a5a12 !important;
}
:root[data-theme="light"] #sent-list .sent-row span[style*="F0D79C" i] {
  border-color: #8a5a12 !important;
  color: #8a5a12 !important;
}
/* Timer di attesa: fondi scuri → superfici di stato tenui */
:root[data-theme="light"] #menu .timer-verde {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  color: #157a3f !important;
}
:root[data-theme="light"] #menu .timer-giallo {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #8a5a12 !important;
}
:root[data-theme="light"] #menu .timer-rosso {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
  /* il lampeggio passava per opacity .5: resta, ma solo sul bordo */
  animation: cm-timer-rosso-light 1.5s infinite !important;
}
@keyframes cm-timer-rosso-light {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0); }
  50%      { box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.45); }
}
/* Uscita già partita (USCITA n · ora) e in attesa (IN ATTESA · Un) */
:root[data-theme="light"] #menu .uscita-sent-badge {
  background: #f8f4ed !important;
  border-color: #76665a !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] #menu .uscita-sent-badge[style*="fbbf24" i] {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #8a5a12 !important;
}
/* Pezzi da annullare (−N) e aggiunte locali (+N) scritti inline */
:root[data-theme="light"] #sent-list span[style*="#991b1b" i] {
  background: #b91c1c !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #sent-list span[style*="#60a070" i] {
  color: #157a3f !important;
}
/* Riga con annullo in sospeso: ordini.js la sbiadiva con opacity inline
   (fino a .35) rendendola illeggibile. Sul chiaro resta piena e si segnala
   con un fondo rosso tenue; se l'annullo è totale il nome è barrato. */
:root[data-theme="light"] #sent-list .sent-row[style*="opacity:0."] {
  opacity: 1 !important;
  background: #fde8e8 !important;
  box-shadow: inset 3px 0 0 #b91c1c;
  padding-left: 6px;
}
:root[data-theme="light"] #sent-list .sent-row[style*="opacity:0.35"] .sent-nome,
:root[data-theme="light"] #sent-list .sent-row[style*="opacity:0.35"] .sent-prezzo {
  text-decoration: line-through;
}
:root[data-theme="light"] #sent-list .sent-prezzo { color: #4d3f38 !important; }
/* barra "Conferma annullamento" (inline #7f1d1d / #fca5a5) */
:root[data-theme="light"] #void-btn {
  background: #b91c1c !important;
  border-color: #991b1b !important;
  color: #ffffff !important;
}

/* Storico di oggi: main.css sbiadisce l'intero box (opacity .75) e la riga
   annullata (opacity .5 + rosso chiaro) */
:root[data-theme="light"] #storico-list.storico-box { opacity: 1 !important; }
:root[data-theme="light"] #storico-list .storico-annullato {
  opacity: 1 !important;
  color: #76665a !important;
}
:root[data-theme="light"] #storico-list .storico-row { color: #4d3f38 !important; }
:root[data-theme="light"] #storico-list .storico-annullato span[style] { color: #b91c1c !important; }

/* ── COMANDA: carrello in preparazione ───────────────────────────────────── */
:root[data-theme="light"] #cart .cart-nota-badge { color: #b45309 !important; }
:root[data-theme="light"] #cart .uscita-cart-badge {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #8a5a12 !important;
}
:root[data-theme="light"] #cart .uscita-cart-badge--immediate {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  color: #157a3f !important;
}
:root[data-theme="light"] #cart .uscita-cart-picker { border-top-color: #e4dcd0 !important; }
:root[data-theme="light"] #cart .uscita-cart-picker__label { color: #76665a !important; }
:root[data-theme="light"] #cart .uscita-cart-picker__button {
  background: #ffffff !important;
  border-color: #d7ccbe !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] #cart .uscita-cart-picker__button.is-released:not(.is-active) {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
:root[data-theme="light"] #cart .uscita-cart-picker__button.is-active {
  background: #8a5a12 !important;
  border-color: #8a5a12 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
/* ✕ svuota carrello: bordo bianco traslucido invisibile */
:root[data-theme="light"] #menu .bottom-bar .btn-clear {
  background: #ffffff !important;
  border: 1px solid #d7ccbe !important;
  color: #b91c1c !important;
}
/* contatore sul tasto Invia (pallino) */
:root[data-theme="light"] #offline-queue-badge {
  background: #b45309 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #btn-invia-comanda .cart-badge {
  background: #ffffff !important;
  color: #500f16 !important;
}

/* ── Griglia menu ────────────────────────────────────────────────────────── */
/* Titoli sottocategoria (livello 2) e gruppi livello 3: opacity .85/.7 */
:root[data-theme="light"] #menu .flat-subhdr {
  opacity: 1 !important;
  color: #231b18 !important;
  border-bottom-color: #e4dcd0 !important;
}
:root[data-theme="light"] #menu .flat-sub2hdr {
  opacity: 1 !important;
  color: #4d3f38 !important;
  border-top-color: #f2eadd !important;
}
/* Scorte sotto il nome: verde chiaro con opacity .6–.9 → toni pieni */
:root[data-theme="light"] #menu .scorta-badge { opacity: 1 !important; }
:root[data-theme="light"] #menu .scorta-ok { color: #157a3f !important; }
:root[data-theme="light"] #menu .scorta-ok[style*="opacity"] { color: #4d3f38 !important; }
:root[data-theme="light"] #menu .scorta-warn { color: #b45309 !important; }
:root[data-theme="light"] #menu .scorta-esaurito {
  display: inline-block;
  margin: 4px auto 0;
  padding: 1px 6px;
  border: 1px solid #b91c1c;
  border-radius: 4px;
  background: #fde8e8;
  color: #b91c1c !important;
}
/* Piatto esaurito: resta ordinabile (avviso, non blocco), quindi il testo
   deve restare leggibile. Via opacity .65 e grayscale: il fondo grigio e il
   bordo tratteggiato bastano a distinguerlo. */
:root[data-theme="light"] #menu .comanda-product-card__main.item-esaurito {
  opacity: 1 !important;
  filter: none !important;
  background: #f3f0ec !important;
  border-style: dashed !important;
  border-color: #a19387 !important;
}
:root[data-theme="light"] #menu .item-esaurito .comanda-product-card__name,
:root[data-theme="light"] #menu .item-esaurito .comanda-product-card__price { color: #4d3f38 !important; }
/* Tasti uscita 1/2/3 sulla card: cerchi marrone scuro → bianco + oro brunito */
:root[data-theme="light"] #menu .comanda-product-card__uscite button {
  background: #ffffff !important;
  border-color: #8a5a12 !important;
  color: #8a5a12 !important;
}
:root[data-theme="light"] #menu .comanda-product-card__uscite button.is-released {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
:root[data-theme="light"] #menu .comanda-product-card__uscite button:active {
  background: #8a5a12 !important;
  color: #ffffff !important;
}
/* Tasto "i" allergeni: disco nero → bianco con bordo info */
:root[data-theme="light"] #menu .comanda-product-card__info {
  background: #ffffff !important;
  border-color: #1d4ed8 !important;
  color: #1d4ed8 !important;
}

/* ── Fuori menu: scelta reparto e uscita (overlay creato da carrello.js) ── */
:root[data-theme="light"] .fuori-menu-picker-overlay { background: rgba(35, 27, 24, 0.42) !important; }
:root[data-theme="light"] .fuori-menu-picker {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  box-shadow: 0 24px 60px rgba(35, 27, 24, 0.22) !important;
  color: #231b18 !important;
}
:root[data-theme="light"] .fuori-menu-picker__head { border-bottom-color: #e4dcd0 !important; }
:root[data-theme="light"] .fuori-menu-picker__head > span,
:root[data-theme="light"] .fuori-menu-picker__label { color: #8a5a12 !important; }
:root[data-theme="light"] .fuori-menu-picker__head > strong { color: #231b18 !important; }
:root[data-theme="light"] .fuori-menu-picker__head > small { color: #640517 !important; }
:root[data-theme="light"] .fuori-menu-picker__reparti button,
:root[data-theme="light"] .fuori-menu-picker__uscite button,
:root[data-theme="light"] .fuori-menu-picker__actions .fuori-menu-picker__cancel {
  background: #f8f4ed !important;
  border-color: #d7ccbe !important;
  color: #231b18 !important;
}
:root[data-theme="light"] .fuori-menu-picker__reparti button.is-active,
:root[data-theme="light"] .fuori-menu-picker__uscite button.is-active {
  background: #640517 !important;
  border-color: #500f16 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
:root[data-theme="light"] .fuori-menu-picker__uscite button.is-released:not(.is-active) {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
:root[data-theme="light"] .fuori-menu-picker__help { color: #76665a !important; }
:root[data-theme="light"] .fuori-menu-picker__summary {
  background: #f8f4ed !important;
  border-color: #e4dcd0 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] .fuori-menu-picker__actions .fuori-menu-picker__confirm {
  background: #157a3f !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
/* AGGIUNGI disabilitato finché non si sceglie il reparto */
:root[data-theme="light"] .fuori-menu-picker__actions .fuori-menu-picker__confirm:disabled {
  opacity: 1 !important;
  filter: none !important;
  background: #f2eadd !important;
  border-color: #d7ccbe !important;
  color: #76665a !important;
}

/* ── Modale varianti / note ──────────────────────────────────────────────── */
/* variante scelta: fondo var(--bordeaux)=blu pieno, il sovrapprezzo inline
   #fbbf24 (portato a #b45309 dal §11) diventava marrone su blu */
:root[data-theme="light"] #var-grid-bottoni button[style*="var(--bordeaux)"] span { color: #ffffff !important; }
:root[data-theme="light"] #var-grid-bottoni button[style*="var(--nero3)"] { color: #4d3f38 !important; }
:root[data-theme="light"] #var-nome-prodotto { color: #231b18 !important; }

/* ── Info prodotto (allergeni) ───────────────────────────────────────────── */
/* modal-box con fondo #1c080d inline (reso bianco dal §4) ma nome #fff
   inline: bianco su bianco. Riquadro allergeni rgba(0,0,0,.5) → grigio. */
:root[data-theme="light"] #modal-info-piatto .modal-box { border-color: #d5deea !important; }
:root[data-theme="light"] #info-piatto-nome { color: #0f1b2d !important; }
:root[data-theme="light"] #info-piatto-allergeni {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #0f1b2d !important;
}
:root[data-theme="light"] #info-piatto-allergeni > b { color: #8a5a12 !important; }
:root[data-theme="light"] #info-piatto-allergeni span[style*="background"] {
  background: #ffffff !important;
  border: 1px solid #b45309 !important;
  color: #0f1b2d !important;
}
:root[data-theme="light"] #info-piatto-allergeni > span { color: #5a6a84 !important; }

/* ── Toast (esito invio, stampa fallita, errori) ─────────────────────────────
   main.css li dipinge con fondi quasi neri: sul chiaro diventano fondi pieni
   del colore di stato con testo bianco (palette). */
:root[data-theme="light"] #toast-container .toast {
  color: #ffffff !important;
  box-shadow: 0 8px 22px rgba(35, 27, 24, 0.22) !important;
}
:root[data-theme="light"] #toast-container .toast-ok   { background: #157a3f !important; border-color: #0f5c30 !important; }
:root[data-theme="light"] #toast-container .toast-err  { background: #b91c1c !important; border-color: #991b1b !important; }
:root[data-theme="light"] #toast-container .toast-warn { background: #b45309 !important; border-color: #8a5a12 !important; }
:root[data-theme="light"] #toast-container .toast-info { background: #1d4ed8 !important; border-color: #1e3a8a !important; }

/* ── Salva fuori menu nel menu fisso (sfm) ───────────────────────────────── */
:root[data-theme="light"] #sfm-stat-fc { color: #8a5a12 !important; }
:root[data-theme="light"] #modal-salva-fuorimenu .modal-title { color: #5b21b6 !important; }
:root[data-theme="light"] #modal-salva-fuorimenu button[onclick^="sfmAddIngrediente"] {
  background: #7c001c !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #modal-salva-fuorimenu .modal-confirm {
  background: #157a3f !important;
  border-color: #157a3f !important;
}

/* ── Gestione menu: lista prodotti (modal-lista-menu) ────────────────────── */
:root[data-theme="light"] #modal-lista-menu .menu-list-tools { background: #ffffff !important; }
:root[data-theme="light"] #modal-lista-menu .menu-list-tools button {
  background: #157a3f !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #modal-lista-menu .menu-edit-row { border-color: #e4dcd0 !important; }
:root[data-theme="light"] #modal-lista-menu .menu-row-path { color: #8a5a12 !important; }
:root[data-theme="light"] #modal-lista-menu .menu-row-desc { color: #76665a !important; }
:root[data-theme="light"] #modal-lista-menu .menu-row-meta { color: #4d3f38 !important; }
:root[data-theme="light"] #modal-lista-menu .menu-status-badge--off {
  background: #fde8e8 !important;
  border: 1px solid #b91c1c !important;
  color: #b91c1c !important;
}
:root[data-theme="light"] #modal-lista-menu .menu-row-stock {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #8a5a12 !important;
}
:root[data-theme="light"] #modal-lista-menu .menu-row-stock--on {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  color: #157a3f !important;
}
:root[data-theme="light"] #modal-lista-menu .menu-row-edit {
  background: #f7eee1 !important;
  border-color: #7c001c !important;
  color: #500f16 !important;
}
:root[data-theme="light"] #modal-lista-menu .menu-row-delete {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}

/* ── Scheda prodotto (modal-menu): sezioni, ricetta, quantità ──────────────
   main.css:1880-2200 dipinge barra passi, sezioni, box foto, distinta base,
   lista ricetta, pannello quantità e barra azioni con fondi quasi neri. */
:root[data-theme="light"] #modal-menu .menu-stepbar {
  background: #ffffff !important;
  border-bottom-color: #e4dcd0 !important;
}
:root[data-theme="light"] #modal-menu .menu-stepbar button {
  background: #f8f4ed !important;
  border-color: #d7ccbe !important;
  color: #500f16 !important;
}
:root[data-theme="light"] #modal-menu .menu-edit-section {
  background: #faf7f2 !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #modal-menu .menu-edit-section-head > span {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #8a5a12 !important;
}
:root[data-theme="light"] #modal-menu .menu-photo-box,
:root[data-theme="light"] #modal-menu .menu-db-wrapper {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #modal-menu .menu-db-toggle { color: #b45309 !important; }
/* sorgente ingredienti attiva: menu-admin.js scrive #2a1520 via .style (serializzato in rgb) */
:root[data-theme="light"] #modal-menu .menu-source-toggle button[style*="rgb(42"],
:root[data-theme="light"] #modal-menu .menu-source-toggle button[style*="#2a1520" i] {
  background: #640517 !important;
  border-color: #500f16 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #modal-menu .menu-source-toggle button { color: #4d3f38 !important; }
:root[data-theme="light"] #modal-menu .menu-ingredient-results,
:root[data-theme="light"] #modal-menu .menu-recipe-list {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #nm-lista-ing-scroll [style*="color:var(--muted)"] { color: #4d3f38 !important; }
:root[data-theme="light"] #modal-menu .menu-ingredient-results [style*="#1a1040" i] {
  background: #ede9fe !important;
  color: #5b21b6 !important;
}
:root[data-theme="light"] #modal-menu .menu-qty-panel {
  background: #f8f4ed !important;
  border-color: #d7ccbe !important;
}
:root[data-theme="light"] #modal-menu .menu-qty-title { color: #b45309 !important; }
:root[data-theme="light"] #modal-menu .menu-qty-title b { color: #231b18 !important; }
:root[data-theme="light"] #modal-menu .menu-qty-row button {
  background: #ffffff !important;
  border-color: #d7ccbe !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #modal-menu .menu-qty-row span { color: #4d3f38 !important; }
:root[data-theme="light"] #modal-menu .menu-qty-label { color: #4d3f38 !important; }
:root[data-theme="light"] #nm-qty-quicks button {
  background: #ffffff !important;
  border-color: #d7ccbe !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] #nm-qty-quicks button span { color: #76665a !important; }
:root[data-theme="light"] #modal-menu .menu-qty-actions button { color: #4d3f38 !important; border-color: #d7ccbe !important; }
:root[data-theme="light"] #modal-menu .menu-qty-actions button:last-child {
  background: #157a3f !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #modal-menu .menu-recipe-head,
:root[data-theme="light"] #modal-menu .menu-recipe-cost span { color: #4d3f38 !important; }
:root[data-theme="light"] #modal-menu .menu-recipe-cost b { color: #b91c1c !important; }
:root[data-theme="light"] #modal-menu .menu-cost-stat { color: #8a5a12 !important; }
:root[data-theme="light"] #modal-menu .menu-editor-actions {
  background: #ffffff !important;
  border-top: 1px solid #e4dcd0 !important;
}
:root[data-theme="light"] #modal-menu .menu-editor-actions .modal-cancel {
  background: #ffffff !important;
  border-color: #d7ccbe !important;
  color: #4d3f38 !important;
}
/* Allergeni: scelto = fondo #3a1a1a inline, non scelto = opacity .5 */
:root[data-theme="light"] #nm-allergeni-grid button {
  opacity: 1 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #nm-allergeni-grid button[data-attivo="0"] {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  color: #76665a !important;
}
:root[data-theme="light"] #nm-allergeni-grid button[data-attivo="1"] {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  font-weight: 700;
}
:root[data-theme="light"] #nm-allergeni-grid button[data-attivo="1"][style*="#1a3a1a" i],
:root[data-theme="light"] #nm-allergeni-grid button[data-attivo="1"][style*="rgb(26"] {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
}
/* ── Revisione avversaria: tab MENU → Struttura (Gestione Categorie,
   Modifica categoria, Gestione Varianti) e foto della scheda prodotto ────
   Le regole della scheda prodotto erano limitate a #modal-menu: la stessa
   .menu-edit-section nelle modali categoria/varianti restava col velo scuro
   rgba(10,8,14,.45) di main.css, reso grigio #919092 dal fondo bianco, e le
   etichette #5a6a84 scendevano a 1.7:1. Nella lista categorie il percorso
   era oro #D5B36F (2:1) e i pulsanti Modifica / × restavano navy e bordeaux
   pieni (main.css .cat-admin-edit, .cat-admin-delete, .variante-del). */
:root[data-theme="light"] #modal-edit-categoria .menu-edit-section,
:root[data-theme="light"] #modal-admin-varianti .menu-edit-section {
  background: #faf7f2 !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #modal-edit-categoria .menu-edit-section-head > span,
:root[data-theme="light"] #modal-admin-varianti .menu-edit-section-head > span {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #8a5a12 !important;
}
:root[data-theme="light"] #lista-admin-categorie .cat-admin-row,
:root[data-theme="light"] #lista-admin-varianti .variante-row { border-bottom-color: #e4dcd0 !important; }
:root[data-theme="light"] #lista-admin-categorie .cat-admin-path { color: #8a5a12 !important; }
:root[data-theme="light"] #lista-admin-categorie .cat-admin-edit {
  background: #f7eee1 !important;
  border-color: #7c001c !important;
  color: #500f16 !important;
}
:root[data-theme="light"] #lista-admin-categorie .cat-admin-delete,
:root[data-theme="light"] #lista-admin-varianti .variante-del {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
/* Scheda prodotto con foto: "Rimuovi foto" era #f87171 su bianco (2.8:1) */
:root[data-theme="light"] #nm-foto-preview button {
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
/* ── Seconda revisione: card BAR con allergeni (tasto "i" senza tasti
   uscita). Il disco "i" è assoluto in alto a destra e il corpo della card
   non gli riserva spazio: sul chiaro il disco bianco pieno copriva parole
   del nome ("Negroni Sbagliat[i]", "Falanghina del S[i]", "Fiano di
   Avellino D[i]"), a 1280 e ancor più a 390 px. Come per le card cucina
   (riga dei tasti uscita in alto) il nome scende sotto la riga del disco. */
:root[data-theme="light"] #menu .comanda-product-card--has-info:not(.comanda-product-card--uscite) .comanda-product-card__main {
  min-height: 88px !important;
  padding-top: 45px !important;
}
/* ═══ §AREA comanda-menu — FINE ═══ */

/* ═══ §AREA cassa-conto — INIZIO ═══ */
/* Incasso: conto del tavolo, sconto, conto separato e quote, senza fiscale,
   fattura cliente, cassa rapida, chiusura cassa, storico conti, coda storni,
   rettifiche. Solo tema chiaro: ogni selettore parte da :root[data-theme=light].
   Palette: pagina #f5f8fd, superfici #ffffff/#f0f5fc/#e2ecf9, bordi #d5deea,
   testo #0f1b2d/#34435c/#5a6a84, accento #1e40af, primario #2563eb/#1d4ed8,
   successo #157a3f su #e6f4ea, warning #b45309 su #fff4d6, pericolo #b91c1c
   su #fde8e8, info #1d4ed8 su #e8f0fe, oro brunito #8a5a12. */

/* ── Toast (condiviso): erano pastiglie quasi nere (main.css:1646-1661) ── */
:root[data-theme="light"] #toast-container .toast {
  color: #231b18 !important;
  background-image: none !important;
  border-width: 1px 1px 1px 5px !important;
  border-style: solid !important;
  box-shadow: 0 6px 20px rgba(35, 27, 24, 0.16) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme="light"] #toast-container .toast-ok { background: #e6f4ea !important; border-color: #157a3f !important; }
:root[data-theme="light"] #toast-container .toast-err { background: #fde8e8 !important; border-color: #b91c1c !important; }
:root[data-theme="light"] #toast-container .toast-warn { background: #fff4d6 !important; border-color: #b45309 !important; }
:root[data-theme="light"] #toast-container .toast-info { background: #e8f0fe !important; border-color: #1d4ed8 !important; }

/* ── Modal CASSA: card sconto (gradient verso il nero di faro-pro.css:3525) ── */
:root[data-theme="light"] .faro-discount-card {
  background: #f8f4ed !important;
  background-image: none !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .faro-discount-card__head .faro-kicker { color: #4d3f38 !important; }
:root[data-theme="light"] .faro-discount-input-label,
:root[data-theme="light"] #cassa-sconto-input-label { color: #4d3f38 !important; }
:root[data-theme="light"] .faro-discount-input-wrap { border-color: #d0c2b2 !important; }
:root[data-theme="light"] .faro-discount-mode button,
:root[data-theme="light"] .faro-discount-scope button,
:root[data-theme="light"] .faro-discount-presets button,
:root[data-theme="light"] .faro-discount-keypad button {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #ded2c3 !important;
}
:root[data-theme="light"] .faro-discount-mode button:not(.active),
:root[data-theme="light"] .faro-discount-scope button:not(.active),
:root[data-theme="light"] .faro-discount-keypad button { color: #231b18 !important; }
:root[data-theme="light"] .faro-discount-mode button.active,
:root[data-theme="light"] .faro-discount-scope button.active {
  background: #640517 !important;
  color: #ffffff !important;
  border-color: #500f16 !important;
}
:root[data-theme="light"] .faro-discount-keypad button:active,
:root[data-theme="light"] .faro-discount-presets button:active { background: #ede3d5 !important; }
/* "Rimuovi" disabilitato (nessuno sconto): opacita' .38 su rosa → illeggibile */
:root[data-theme="light"] .faro-discount-reset:disabled {
  opacity: 1 !important;
  background: #f8f4ed !important;
  color: #76665a !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #cassa-riepilogo-sconto,
:root[data-theme="light"] #cr-discount-preview-message { color: #4d3f38 !important; }
/* Bottoni azione del modal (hub-btn con fondo scuro residuo) */
:root[data-theme="light"] #modal-cassa .hub-btn:not(#btn-chiudi-conto-fiscale):not(#btn-senza-fiscale) {
  background: #ffffff !important;
  background-image: none !important;
  color: #231b18 !important;
  border-color: #d0c2b2 !important;
}
:root[data-theme="light"] #modal-cassa .hub-btn:not(#btn-chiudi-conto-fiscale):not(#btn-senza-fiscale) .hub-btn-label { color: #231b18 !important; }
/* Chiudi Conto: gradient oro chiaro inline → blu pieno, testo bianco */
:root[data-theme="light"] #btn-chiudi-conto-fiscale {
  background: #640517 !important;
  background-image: none !important;
  border-color: #500f16 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #btn-chiudi-conto-fiscale .hub-btn-label { color: #ffffff !important; }
/* Chiudi senza fiscale (owner-gate): gradient bordeaux inline → rosso pieno */
:root[data-theme="light"] #btn-senza-fiscale {
  background: #b91c1c !important;
  background-image: none !important;
  border-color: #7f1d1d !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #btn-senza-fiscale .hub-btn-label { color: #ffffff !important; }
/* Pulsanti rapidi "Tutto contanti / Tutto carta": fondo inline quasi trasparente */
:root[data-theme="light"] #modal-cassa button[onclick^="quickPay"] {
  background: #ffffff !important;
  border-color: #d0c2b2 !important;
}

/* ── CONTO SEPARATO (modal-separato, template di cassa.js) ─────────────── */
/* Righe non selezionate: opacity .5 inline + grigi → testo sotto 2.1:1 */
:root[data-theme="light"] #sep-list > div[style*="opacity:0.5"] { opacity: 0.82 !important; }
:root[data-theme="light"] #sep-list span[style*="color:var(--muted)"] { color: #4d3f38 !important; }
:root[data-theme="light"] #sep-list span[style*="color:#c89aee" i] { color: #5b21b6 !important; }
:root[data-theme="light"] #sep-list button[style*="color:#4ade80" i] {
  color: #0f5c30 !important;
  border-color: #157a3f !important;
  background: #ffffff !important;
}
/* Sconto (€ finale) in arancio chiaro #f59e0b */
:root[data-theme="light"] #modal-separato [style*="color: #f59e0b" i],
:root[data-theme="light"] #modal-separato [style*="color:#f59e0b" i],
:root[data-theme="light"] #sep-riepilogo-sconto { color: #b45309 !important; }
:root[data-theme="light"] #modal-separato label[style*="#D5B36F" i] { color: #4d3f38 !important; }
/* riquadro dello sconto: fondo var(--nero3) inline; #b45309 ci arriva a 4.48 */
:root[data-theme="light"] #modal-separato div:has(> #sep-input-sconto) {
  background: #fff4d6 !important;
  border: 1px solid #e3c27a;
}
/* Testi in oro chiaro #F0D79C (quote, resto, esito) */
:root[data-theme="light"] #modal-separato [style*="color:#F0D79C" i],
:root[data-theme="light"] #sep-quota-esito { color: #8a5a12 !important; }
:root[data-theme="light"] #sep-quota-esito strong[style*="color:#4ade80" i] { color: #0f5c30 !important; }
/* Avviso "promemoria non fiscale": fondo bordeaux trasparente + testo crema */
:root[data-theme="light"] #sep-quota-nofisc {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #7f1d1d !important;
}
:root[data-theme="light"] #sep-quota-riepilogo { background: #f8f4ed !important; border-color: #e4dcd0 !important; color: #231b18 !important; }
/* Card "e il resto?" e "hanno pagato tutti": bordo oro chiaro invisibile */
:root[data-theme="light"] #sep-quota-resto,
:root[data-theme="light"] #sep-quota-domanda {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #sep-quota-domanda button[onclick="sepAltroPagante()"] {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  color: #0f5c30 !important;
}
:root[data-theme="light"] #sep-quota-domanda button[onclick="sepAbbuonaResiduo()"],
:root[data-theme="light"] #sep-quota-uscita-btn {
  background: #ffffff !important;
  border-color: #d0c2b2 !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] #sep-quota-uscita-link { color: #4d3f38 !important; }
/* Scelte del resto: stato attivo = fondo oro brunito con testo #211B20 inline */
:root[data-theme="light"] #sep-quota-resto button {
  background: #ffffff !important;
  color: #4d3f38 !important;
  border-color: #d0c2b2 !important;
}
:root[data-theme="light"] #sep-quota-resto button[style*="accento-oro"] {
  color: #8a5a12 !important;
  border-color: #8a5a12 !important;
}
:root[data-theme="light"] #sep-quota-resto button[style*="background: var(--accento-oro)"] {
  background: #8a5a12 !important;
  color: #ffffff !important;
  border-color: #6b440c !important;
}
/* Scorciatoie importo (piano, tutto il resto) */
:root[data-theme="light"] #sep-quota-scorciatoie button {
  background: #ffffff !important;
  border-color: #d0c2b2 !important;
  color: #500f16 !important;
}
/* Barra modalita' (pietanza / persona / importo): tab non attive */
:root[data-theme="light"] #sep-modalita-bar [data-sep-mod]:not([aria-selected="true"]) {
  background: #ffffff !important;
  color: #4d3f38 !important;
  border-color: #ded2c3 !important;
}
:root[data-theme="light"] #sep-modalita-bar [aria-selected="true"] {
  background: #8a5a12 !important;
  border-color: #6b440c !important;
}
/* "Stampa Preconto": fondo inline #211B20 */
:root[data-theme="light"] #modal-separato button[onclick="inviaContoSeparato('PRECONTO')"] {
  background: #ffffff !important;
  color: #500f16 !important;
  border: 1px solid #7c001c !important;
}
/* Tasti rapidi "Tutto contanti / Tutto carta" (CONTO_LARGO_PC_V1): come quelli
   del conto; il testo lo scuriscono gia' le regole su #9FCF9C e #A8C0D4.
   Acceso = aria-pressed, impostato da cassa.js. */
:root[data-theme="light"] #modal-separato button[data-sep-quick] {
  background: #ffffff !important;
  border-color: #d0c2b2 !important;
}
:root[data-theme="light"] #modal-separato button[data-sep-quick="contanti"][aria-pressed="true"] {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  box-shadow: inset 0 0 0 1px #157a3f !important;
}
:root[data-theme="light"] #modal-separato button[data-sep-quick="carta"][aria-pressed="true"] {
  background: #e2ecf9 !important;
  border-color: #1d4ed8 !important;
  box-shadow: inset 0 0 0 1px #1d4ed8 !important;
}
/* Conto su PC: netto "DA PAGARE" ripetuto nel riquadro del totale (oro chiaro
   nel tema scuro, desktop-fill.css). */
:root[data-theme="light"] #modal-cassa .cassa-tot-netto strong { color: #500f16 !important; }

/* ── STORICO DI OGGI del tavolo: riga annullata a opacita' .38 ─────────── */
:root[data-theme="light"] #storico-list { opacity: 1 !important; }
:root[data-theme="light"] #storico-list .storico-row { color: #4d3f38 !important; }
:root[data-theme="light"] #storico-list .storico-annullato { opacity: 1 !important; }
:root[data-theme="light"] #storico-list .storico-annullato > span:first-child { color: #76665a !important; }
:root[data-theme="light"] #storico-list .storico-annullato > span[style*="#f87171" i] { color: #b91c1c !important; }

/* ── OWNER-GATE: tastierino PIN e scelta tavolo senza fiscale ──────────── */
:root[data-theme="light"] #owner-gate-submit:disabled {
  opacity: 1 !important;
  background: #f2eadd !important;
  background-image: none !important;
  color: #76665a !important;
  border-color: #ded2c3 !important;
}

/* ── FATTURA CLIENTE (tab FATTURA, faro-pro.css:82-101) ────────────────── */
:root[data-theme="light"] .fc-shell { color: #231b18 !important; }
:root[data-theme="light"] .fc-hero p,
:root[data-theme="light"] .fc-alert span,
:root[data-theme="light"] .fc-config > summary small,
:root[data-theme="light"] .fc-document-detail > p,
:root[data-theme="light"] .fc-discount small,
:root[data-theme="light"] .fc-discount label,
:root[data-theme="light"] .fc-split label,
:root[data-theme="light"] .fc-split small,
:root[data-theme="light"] .fc-form-grid label,
:root[data-theme="light"] .fc-status { color: #34435c !important; }
:root[data-theme="light"] .fc-kicker,
:root[data-theme="light"] .fc-step span { color: #640517 !important; }
:root[data-theme="light"] .fc-hero {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #e4dcd0 !important;
  box-shadow: 0 8px 24px rgba(35, 27, 24, 0.08) !important;
}
:root[data-theme="light"] .fc-provider { background: #fff4d6 !important; border-color: #b45309 !important; color: #7a4a06 !important; }
:root[data-theme="light"] .fc-provider i { background: #b45309 !important; box-shadow: none !important; }
:root[data-theme="light"] .fc-provider.ready { background: #e6f4ea !important; border-color: #157a3f !important; color: #0f5c30 !important; }
:root[data-theme="light"] .fc-provider.ready i { background: #157a3f !important; }
:root[data-theme="light"] .fc-provider.off { background: #f8f4ed !important; border-color: #ded2c3 !important; color: #4d3f38 !important; }
:root[data-theme="light"] .fc-provider.off i { background: #76665a !important; }
:root[data-theme="light"] .fc-alert {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
}
:root[data-theme="light"] .fc-alert strong { color: #7a4a06 !important; }
:root[data-theme="light"] .fc-alert.danger { background: #fde8e8 !important; border-color: #b91c1c !important; }
:root[data-theme="light"] .fc-alert.danger strong { color: #991b1b !important; }
:root[data-theme="light"] .fc-alert.danger span { color: #34435c !important; }
:root[data-theme="light"] .fc-card,
:root[data-theme="light"] .fc-config {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .fc-config > summary span,
:root[data-theme="light"] .fc-step h3 { color: #231b18 !important; }
:root[data-theme="light"] .fc-step > button,
:root[data-theme="light"] .fc-btn.secondary {
  background: #ffffff !important;
  color: #500f16 !important;
  border: 1px solid #d0c2b2 !important;
}
:root[data-theme="light"] .fc-btn.primary {
  background: #640517 !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 1px solid #500f16 !important;
}
:root[data-theme="light"] .fc-btn.danger {
  background: #fde8e8 !important;
  color: #b91c1c !important;
  border: 1px solid #b91c1c !important;
}
/* Tavoli aperti e anagrafiche: card #17171c */
:root[data-theme="light"] .fc-table-card,
:root[data-theme="light"] .fc-client-card {
  background: #ffffff !important;
  background-image: none !important;
  color: #231b18 !important;
  border-color: #ded2c3 !important;
}
:root[data-theme="light"] .fc-table-card span,
:root[data-theme="light"] .fc-client-card strong { color: #231b18 !important; }
:root[data-theme="light"] .fc-table-card strong { color: #640517 !important; }
:root[data-theme="light"] .fc-table-card small,
:root[data-theme="light"] .fc-client-card small,
:root[data-theme="light"] .fc-client-card span { color: #4d3f38 !important; }
:root[data-theme="light"] .fc-table-card em { background: #fff4d6 !important; color: #7a4a06 !important; border: 1px solid #b45309; }
:root[data-theme="light"] .fc-table-card.selected,
:root[data-theme="light"] .fc-client-card.selected,
:root[data-theme="light"] .fc-draft-row.selected {
  background: #f7eee1 !important;
  border-color: #7c001c !important;
  box-shadow: 0 0 0 2px rgba(124, 0, 28, 0.18) !important;
}
/* Campi (senza attributo type: sfuggono alla regola generale degli input) */
:root[data-theme="light"] .fc-search input,
:root[data-theme="light"] .fc-form-grid input,
:root[data-theme="light"] .fc-form-grid textarea,
:root[data-theme="light"] .fc-split input,
:root[data-theme="light"] .fc-discount input,
:root[data-theme="light"] .fc-reconcile input {
  background: #ffffff !important;
  color: #231b18 !important;
  border: 1px solid #d0c2b2 !important;
}
:root[data-theme="light"] .fc-form-grid input[readonly] { background: #f8f4ed !important; color: #4d3f38 !important; }
:root[data-theme="light"] .fc-search input::placeholder,
:root[data-theme="light"] .fc-form-grid input::placeholder,
:root[data-theme="light"] .fc-form-grid textarea::placeholder,
:root[data-theme="light"] .fc-reconcile input::placeholder { color: #76665a !important; }
:root[data-theme="light"] .fc-split input:disabled,
:root[data-theme="light"] .fc-discount input:disabled {
  opacity: 1 !important;
  background: #f8f4ed !important;
  color: #4d3f38 !important;
}
/* Archivio documenti e stati */
:root[data-theme="light"] .fc-draft-row {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] .fc-draft-row strong,
:root[data-theme="light"] .fc-draft-row b { color: #231b18 !important; }
:root[data-theme="light"] .fc-draft-list small { color: #4d3f38 !important; }
:root[data-theme="light"] .fc-state { color: #8a5a12 !important; font-weight: 900; }
:root[data-theme="light"] .fc-state.preparata,
:root[data-theme="light"] .fc-state.non_avviata { color: #640517 !important; }
:root[data-theme="light"] .fc-state.chiusa,
:root[data-theme="light"] .fc-state.documento_emesso { color: #157a3f !important; }
:root[data-theme="light"] .fc-state.errore_ambiguo,
:root[data-theme="light"] .fc-state.errore_retry,
:root[data-theme="light"] .fc-state.in_emissione { color: #b91c1c !important; }
:root[data-theme="light"] .fc-state.annullata { color: #76665a !important; }
:root[data-theme="light"] .fc-empty { color: #4d3f38 !important; border-color: #d0c2b2 !important; }
/* Riepilogo, pagamento, dettaglio */
:root[data-theme="light"] .fc-summary > div { background: #f8f4ed !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .fc-summary span,
:root[data-theme="light"] .fc-xml-info span { color: #34435c !important; }
:root[data-theme="light"] .fc-summary strong,
:root[data-theme="light"] .fc-discount strong { color: #500f16 !important; }
:root[data-theme="light"] .fc-payment { background: #f8f4ed !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .fc-payment-methods button {
  background: #ffffff !important;
  color: #231b18 !important;
  border-color: #d0c2b2 !important;
}
:root[data-theme="light"] .fc-payment-methods button.selected {
  background: #640517 !important;
  color: #ffffff !important;
  border-color: #500f16 !important;
}
:root[data-theme="light"] .fc-payment-methods button:disabled { opacity: 1 !important; background: #f8f4ed !important; color: #76665a !important; }
:root[data-theme="light"] .fc-payment-methods button.selected:disabled { background: #640517 !important; color: #ffffff !important; opacity: 0.85 !important; }
/* sotto-blocchi che la regola generale .fc-actions/.fc-discount dipinge di bianco
   dentro riquadri colorati: devono prendere il fondo del riquadro */
:root[data-theme="light"] .fc-reconcile .fc-actions,
:root[data-theme="light"] .fc-payment .fc-discount { background: transparent !important; }
:root[data-theme="light"] .fc-payment-note { color: #7a4a06 !important; }
:root[data-theme="light"] .fc-done { color: #157a3f !important; }
:root[data-theme="light"] .fc-danger,
:root[data-theme="light"] .fc-status.error { color: #b91c1c !important; }
:root[data-theme="light"] .fc-status.ok { color: #157a3f !important; }
:root[data-theme="light"] .fc-xml-info { background: #e6f4ea !important; border-color: #157a3f !important; }
:root[data-theme="light"] .fc-xml-info strong { color: #0f1b2d !important; }
:root[data-theme="light"] .fc-xml-info small { color: #34435c !important; }
:root[data-theme="light"] .fc-document-detail { background: #ffffff !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .fc-document-detail > summary { color: #500f16 !important; }
:root[data-theme="light"] .fc-document-detail b { color: #231b18 !important; }
:root[data-theme="light"] .fc-document-rows { border-top-color: #e4dcd0 !important; }
:root[data-theme="light"] .fc-document-rows > div { border-bottom-color: #f2eadd !important; }
:root[data-theme="light"] .fc-document-rows small { color: #4d3f38 !important; }
:root[data-theme="light"] .fc-document-rows strong { color: #500f16 !important; }
:root[data-theme="light"] .fc-reconcile { background: #fde8e8 !important; border-color: #b91c1c !important; }
:root[data-theme="light"] .fc-reconcile > strong { color: #991b1b !important; }
:root[data-theme="light"] .fc-reconcile > p { color: #4d3f38 !important; }

/* ── CASSA RAPIDA (tab CASSA, main.css:2860-2900 e 4360-5560) ──────────── */
:root[data-theme="light"] .cr-tab-btn {
  background: #ffffff !important;
  color: #4d3f38 !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .cr-tab-btn.active {
  background: #f7eee1 !important;
  color: #500f16 !important;
  border-color: #7c001c !important;
}
/* Scontrino corrente: card rgba(10,8,16,.68) → bianca */
:root[data-theme="light"] .cr-cart-card {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .cr-cart-card-head,
:root[data-theme="light"] .cr-total-row small { color: #4d3f38 !important; }
:root[data-theme="light"] .cr-total-row strong { color: #231b18 !important; }
:root[data-theme="light"] .cr-cart-rows { border-color: #e4dcd0 !important; }
:root[data-theme="light"] .cr-cart-line span { color: #640517 !important; }
:root[data-theme="light"] .cr-cart-detail { color: #4d3f38 !important; }
:root[data-theme="light"] .cr-cart-note { color: #9d174d !important; }
:root[data-theme="light"] .cr-cart-card .cr-plus { color: #157a3f !important; border-color: #157a3f !important; }
:root[data-theme="light"] .cr-cart-btn { color: #640517 !important; border-color: #7c001c !important; }
:root[data-theme="light"] .cr-cart-row.is-pending {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  box-shadow: inset 3px 0 #b45309 !important;
}
:root[data-theme="light"] .cr-cart-row.is-pending .cr-cart-line span,
:root[data-theme="light"] .cr-cart-row.is-pending .cr-cart-detail { color: #7a4a06 !important; }
:root[data-theme="light"] .cr-discount-label { color: #b91c1c !important; }
:root[data-theme="light"] .cr-cart-actions button,
:root[data-theme="light"] .cr-order-buttons button {
  background: #ffffff !important;
  color: #4d3f38 !important;
  border-color: #d0c2b2 !important;
}
:root[data-theme="light"] .cr-cart-actions .danger,
:root[data-theme="light"] .cr-mini-btn.danger { color: #b91c1c !important; border-color: #b91c1c !important; }
:root[data-theme="light"] .cr-mini-btn.success { color: #157a3f !important; border-color: #157a3f !important; }
/* Pulsanti disabilitati (vendita bloccata, riga da prezzare): opacita' .42-.45
   su testo gia' tenue → sotto 3:1. Qui restano "spenti" ma leggibili. */
:root[data-theme="light"] #tab-cassa-content button:disabled {
  opacity: 0.62 !important;
}
:root[data-theme="light"] #tab-cassa-content button:disabled:not(.active),
:root[data-theme="light"] #tab-cassa-content button:disabled:not(.active) span { color: #231b18 !important; }
:root[data-theme="light"] #tab-cassa-content .cr-category-btn.active:disabled { opacity: 0.8 !important; }
:root[data-theme="light"] #tab-cassa-content .cr-register-confirm:disabled {
  background: #f2eadd !important;
  background-image: none !important;
  border-color: #d0c2b2 !important;
  opacity: 1 !important;
  color: #76665a !important;
}
:root[data-theme="light"] .cr-register-display,
:root[data-theme="light"] .cr-register-display.is-input {
  box-shadow: none !important;
  border-color: #d0c2b2 !important;
}
:root[data-theme="light"] .cr-register-display.is-input { border-color: #7c001c !important; }
:root[data-theme="light"] .cr-register-display input { text-shadow: none !important; }
:root[data-theme="light"] .cr-register-confirm:not(:disabled) {
  background: #640517 !important;
  background-image: none !important;
  color: #ffffff !important;
}
/* Reparti manuali: sottotitolo colorato col colore del tasto, troppo chiaro */
:root[data-theme="light"] .cr-dept-btn {
  background: #ffffff !important;
  background-image: none !important;
}
:root[data-theme="light"] .cr-dept-name { color: #231b18 !important; }
:root[data-theme="light"] .cr-dept-meta { color: #4d3f38 !important; }
:root[data-theme="light"] .cr-color-rosso .cr-dept-meta { color: #b91c1c !important; }
:root[data-theme="light"] .cr-color-oro .cr-dept-meta { color: #8a5a12 !important; }
:root[data-theme="light"] .cr-color-verde .cr-dept-meta { color: #157a3f !important; }
:root[data-theme="light"] .cr-color-blu .cr-dept-meta { color: #1d4ed8 !important; }
:root[data-theme="light"] .cr-color-viola .cr-dept-meta { color: #5b21b6 !important; }
:root[data-theme="light"] .cr-color-grigio .cr-dept-meta { color: #4d3f38 !important; }
:root[data-theme="light"] .cr-product-family { color: #4d3f38 !important; }
:root[data-theme="light"] .cr-link-btn { background: #ffffff !important; color: #500f16 !important; border-color: #d0c2b2 !important; }
:root[data-theme="light"] .cr-category-btn:not(.active) { background: #f7eee1 !important; color: #500f16 !important; border-color: #ded2c3 !important; }
:root[data-theme="light"] .cr-category-btn.active { background: #640517 !important; background-image: none !important; color: #ffffff !important; border-color: #500f16 !important; }
:root[data-theme="light"] .cr-eyebrow,
:root[data-theme="light"] .cr-catalog-section-head > small,
:root[data-theme="light"] .cr-register-tip { color: #4d3f38 !important; }
/* Avvisi fiscali (DOCUMENTO EMESSO / ESITO INCERTO / RIPROVA / REGISTRATO) */
:root[data-theme="light"] .cr-fiscal-alert { background: #ffffff !important; background-image: none !important; color: #0f1b2d !important; }
:root[data-theme="light"] .cr-fiscal-alert > p,
:root[data-theme="light"] .cr-fiscal-meta,
:root[data-theme="light"] .cr-fiscal-request { color: #34435c !important; }
:root[data-theme="light"] .cr-fiscal-request code { color: #231b18 !important; }
:root[data-theme="light"] .cr-fiscal-alert-danger { background: #fde8e8 !important; border-color: #b91c1c !important; box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12) !important; }
:root[data-theme="light"] .cr-fiscal-alert-danger > strong { color: #991b1b !important; }
:root[data-theme="light"] .cr-fiscal-alert-retry { background: #fff4d6 !important; border-color: #b45309 !important; }
:root[data-theme="light"] .cr-fiscal-alert-retry > strong { color: #7a4a06 !important; }
:root[data-theme="light"] .cr-fiscal-alert-progress { background: #e8f0fe !important; border-color: #1d4ed8 !important; color: #1e3a8a !important; }
:root[data-theme="light"] .cr-fiscal-alert-success { background: #e6f4ea !important; border-color: #157a3f !important; }
:root[data-theme="light"] .cr-fiscal-alert-success > strong { color: #0f5c30 !important; }
:root[data-theme="light"] .cr-fiscal-help,
:root[data-theme="light"] .cr-fiscal-server-message { color: #991b1b !important; }
/* Stato vuoto/errore, storico e configurazione reparti */
:root[data-theme="light"] .cr-empty-state { background: #ffffff !important; color: #231b18 !important; border-color: #d0c2b2 !important; }
:root[data-theme="light"] .cr-error-state { background: #fde8e8 !important; border-color: #b91c1c !important; }
:root[data-theme="light"] .cr-empty-state p,
:root[data-theme="light"] .cr-empty-state .cr-empty-icon { color: #4d3f38 !important; }
:root[data-theme="light"] .cr-storico-meta,
:root[data-theme="light"] .cr-config-info span,
:root[data-theme="light"] .cr-config-head p { color: #34435c !important; }
:root[data-theme="light"] .cr-storico-tot { color: #640517 !important; }
:root[data-theme="light"] .cr-storico-storno { background: #fff4d6 !important; color: #b45309 !important; border-color: #b45309 !important; }
:root[data-theme="light"] .cr-config-head { background: #ffffff !important; background-image: none !important; }
:root[data-theme="light"] .cr-config-row { background: #ffffff !important; border-color: #e4dcd0 !important; }
/* reparto disattivato: opacita' .62 su tutta la riga (anche su "Riattiva");
   lo stato spento resta visibile con fondo tenue e bordo tratteggiato */
:root[data-theme="light"] .cr-config-row.is-off {
  opacity: 1 !important;
  background: #f8f4ed !important;
  border-style: dashed !important;
  border-color: #d0c2b2 !important;
}
:root[data-theme="light"] .cr-config-row.is-off .cr-config-info strong { color: #5a6a84 !important; }
:root[data-theme="light"] .cr-mini-btn,
:root[data-theme="light"] .cr-secondary-btn { background: #ffffff !important; color: #500f16 !important; border-color: #d0c2b2 !important; }
:root[data-theme="light"] .cr-primary-btn { background: #640517 !important; background-image: none !important; color: #ffffff !important; border-color: #500f16 !important; }
:root[data-theme="light"] .cr-primary-btn:disabled,
:root[data-theme="light"] .cr-secondary-btn:disabled,
:root[data-theme="light"] .cr-mini-btn:disabled {
  opacity: 1 !important;
  background: #f2eadd !important;
  color: #76665a !important;
  border-color: #ded2c3 !important;
}
/* Modali cassa rapida (sconto, riga, reparto) */
:root[data-theme="light"] .cr-modal-head p,
:root[data-theme="light"] .cr-option-panel label,
:root[data-theme="light"] .cr-form-grid label,
:root[data-theme="light"] .cr-form-grid legend,
:root[data-theme="light"] .cr-form-grid small,
:root[data-theme="light"] .cr-price-field > span { color: #4d3f38 !important; }
:root[data-theme="light"] .cr-modal-close { color: #231b18 !important; }
:root[data-theme="light"] .cr-price-field > div { background: #ffffff !important; border-color: #d0c2b2 !important; color: #640517 !important; }
:root[data-theme="light"] .cr-option-panel { background: #f8f4ed !important; border-color: #e4dcd0 !important; }

/* ── STORICO CONTI (storico-conti.js: stili inline) ─────────────────────── */
/* "Cerca": pulsante primario inline (var(--bordeaux)) che la regola generale
   .haccp-btn rende bianco come un secondario */
:root[data-theme="light"] #tab-storico-conti label { color: #4d3f38 !important; }
:root[data-theme="light"] #tab-storico-conti button[onclick="cercaStoricoConti()"] {
  background: #640517 !important;
  color: #ffffff !important;
  border-color: #500f16 !important;
}
:root[data-theme="light"] #sc-risultati [style*="color:#D5B36F" i] { color: #8a5a12 !important; }
:root[data-theme="light"] #sc-risultati .sc-row { background: #ffffff; }
:root[data-theme="light"] #sc-risultati .sc-row > button[style*="#b45309"] {
  background: #ffffff !important;
  border-color: #b45309 !important;
  color: #b45309 !important;
}
:root[data-theme="light"] #sc-risultati .sc-row > button[style*="#991b1b"] {
  background: #ffffff !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}

/* ── RESOCONTO SERATA: tabelle (documenti, storni) e sezioni ───────────── */
:root[data-theme="light"] #owner-gate-overlay .owner-report-section {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #owner-gate-overlay .owner-report-section__head { border-bottom-color: #e4dcd0 !important; }
:root[data-theme="light"] #owner-gate-overlay .owner-report-section__head span { color: #4d3f38 !important; }
:root[data-theme="light"] #owner-gate-overlay .owner-report-table th {
  background: #f8f4ed !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] #owner-gate-overlay .owner-report-badge { background: #f8f4ed !important; color: #231b18 !important; border: 1px solid #ded2c3; }
:root[data-theme="light"] #owner-gate-overlay .owner-report-badge.is-good { background: #e6f4ea !important; color: #0f5c30 !important; border-color: #157a3f; }
:root[data-theme="light"] #owner-gate-overlay .owner-report-badge.is-danger { background: #fde8e8 !important; color: #991b1b !important; border-color: #b91c1c; }
:root[data-theme="light"] #owner-gate-overlay .owner-report-kpi span,
:root[data-theme="light"] #owner-gate-overlay .owner-report-kpi small,
:root[data-theme="light"] #owner-gate-overlay .owner-gate-subtitle { color: #4d3f38 !important; }

/* ── REVISIONE: stati non coperti dal primo giro ───────────────────────── */
/* Messaggio d'errore dello sconto (cassa e cassa rapida): la regola #34435c
   qui sopra lo rendeva grigio come i messaggi normali. Torna rosso. */
:root[data-theme="light"] #cassa-riepilogo-sconto.is-error,
:root[data-theme="light"] #cr-discount-preview-message.is-error { color: #b91c1c !important; }
/* Tastierino PIN (senza fiscale, resoconto): esito della verifica.
   owner-gate.css:127-135 → #a99fa3 / #ff9aa8 / #8dd5a0 su bianco (1.7-2.6:1). */
:root[data-theme="light"] #owner-gate-overlay .owner-gate-pin-status { color: #4d3f38 !important; }
:root[data-theme="light"] #owner-gate-overlay .owner-gate-pin-status.is-error { color: #b91c1c !important; font-weight: 700; }
:root[data-theme="light"] #owner-gate-overlay .owner-gate-pin-status.is-ok { color: #0f5c30 !important; font-weight: 700; }
/* Tasti bloccati durante la verifica: opacita' .45 (owner-gate.css:171) → 2.3-2.9:1 */
:root[data-theme="light"] #owner-gate-overlay .owner-gate-key:disabled {
  opacity: 1 !important;
  background: #f5f1eb !important;
  color: #76665a !important;
  border-color: #e4dcd0 !important;
}
/* Puntini delle cifre digitate: oro chiaro su #f0f5fc (1.3:1), unico riscontro
   di quante cifre sono state battute. */
:root[data-theme="light"] #owner-gate-overlay .owner-gate-pin-dot { border-color: #76665a !important; }
:root[data-theme="light"] #owner-gate-overlay .owner-gate-pin-dot.is-filled {
  background: #640517 !important;
  border-color: #640517 !important;
  box-shadow: none !important;
}
/* "Carico i tavoli aperti…" / "Preparo il resoconto…": #b9adb0 su bianco (2.2:1);
   bordi tratteggiati oro .24 invisibili; l'errore prende il suo riquadro. */
:root[data-theme="light"] #owner-gate-overlay .owner-gate-loading { color: #4d3f38 !important; }
:root[data-theme="light"] #owner-gate-overlay .owner-gate-loading,
:root[data-theme="light"] #owner-gate-overlay .owner-gate-empty { border-color: #d0c2b2 !important; }
:root[data-theme="light"] #owner-gate-overlay .owner-gate-error {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
}
/* ═══ §AREA cassa-conto — FINE ═══ */

/* ═══ §AREA prenotazioni-eventi-attese — INIZIO ═══ */
/* Agenda prenotazioni, richieste dal sito, eventi (calendario ed esterni),
   monitor attese (/attese.html). Solo tema chiaro: ogni selettore parte da
   :root[data-theme="light"], il tema scuro resta identico per costruzione.  */

/* ── Agenda: frecce del mese (al passaggio il fondo diventava quasi nero) ── */
:root[data-theme="light"] #view-prenotazioni .cal-nav button {
  background: #f8f4ed !important;
  border-color: #e4dcd0 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #view-prenotazioni .cal-nav button:hover,
:root[data-theme="light"] #view-prenotazioni .cal-nav button:focus-visible {
  background: #f2eadd !important;
  border-color: #640517 !important;
  color: #640517 !important;
}

/* ── Agenda: stato vuoto, suggerimento del campo tavolo, rimuovi evento ─── */
:root[data-theme="light"] #lista-prenotazioni .pren-empty { color: #76665a !important; }
:root[data-theme="light"] #pren-tavolo-hint { color: #76665a !important; }
:root[data-theme="light"] #modal-evento button[onclick^="cancellaEvento"] {
  color: #b91c1c !important;
  border-color: #b91c1c !important;
  background: #ffffff !important;
}

/* ── Agenda: nomi lunghissimi (fino a 80 caratteri salvati) troncati con "…"
   nella scheda: nella lista del giorno si va a capo, così si leggono interi ── */
:root[data-theme="light"] #lista-prenotazioni .pren-card__nome {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
}
/* pallino dell'etichetta "Serata speciale": era quasi nero */
:root[data-theme="light"] .evento-card__eyebrow .dot { background: #6d28d9 !important; }

/* ── Pulsanti con significato (erano verde/rosso scuro, poi resi tutti neutri
   dalla regola generica .haccp-btn): aggiungi = verde pieno, elimina = rosso ── */
:root[data-theme="light"] #view-prenotazioni button[onclick="apriModalNuovaPrenotazione()"],
:root[data-theme="light"] #ev-vista-lista button[onclick="evNuovoEvento()"],
:root[data-theme="light"] #ev-modal-evento button[onclick^="evSalvaEvento"] {
  background: #157a3f !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #ev-vista-dettaglio button[onclick="evEliminaEvento()"] {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}

/* ── Banner "Prenotazioni oggi": le prenotazioni già passate erano rese con
   opacity .45 → testo a 2,1–2,9:1. Restano distinguibili (fondo più tenue e
   bordo tratteggiato) ma leggibili.                                         */
:root[data-theme="light"] .pren-banner__chip.is-passata {
  opacity: 1 !important;
  background: #faf7f2 !important;
  border-style: dashed !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .pren-banner__chip.is-passata .pren-banner__ora,
:root[data-theme="light"] .pren-banner__chip.is-passata .pren-banner__nome,
:root[data-theme="light"] .pren-banner__chip.is-passata .pren-banner__cop { color: #76665a !important; }
:root[data-theme="light"] .pren-banner__chip.is-passata .pren-banner__tav {
  color: #4d3f38 !important;
  background: #f8f4ed !important;
  border-color: #e4dcd0 !important;
}

/* su telefono le pillole con il tavolo uscivano dal riquadro e il nome della
   sala veniva tagliato: l'etichetta del tavolo può scendere sulla riga sotto
   (il nome del cliente resta su una riga, com'era) */
:root[data-theme="light"] .pren-banner__chip {
  max-width: 100% !important;
  flex-wrap: wrap !important;
  border-radius: 14px !important;
}
:root[data-theme="light"] .pren-banner__tav {
  max-width: 100% !important;
  white-space: normal !important;
}

/* ── Mappa tavoli (dove compare il tavolo prenotato): pastiglia cameriere,
   "×" svuota tavolo (quadratino quasi nero) e contatore del filtro attivo ── */
:root[data-theme="light"] .tavolo .t-cam { background: rgba(35, 27, 24, 0.08) !important; }
/* stato del tavolo ("Prenotato", "In servizio", "Conto aperto"): il grigio
   #5a6a84 scendeva a 4,2–4,4:1 sulle tinte ambra/azzurre delle card */
:root[data-theme="light"] .tavolo .t-stato { color: #4d3f38 !important; }
:root[data-theme="light"] .tavolo .lbl-svuota-tavolo {
  background: #ffffff !important;
  color: #b91c1c !important;
  border: 1px solid #e4dcd0 !important;
}
:root[data-theme="light"] .sala-filter-btn.active .sala-filter-count strong { color: #ffffff !important; }

/* ── Planimetria: i tavoli erano dischi quasi neri (#16202e, #40340f, #172554,
   #33290f) con testo scuro. Stesse tinte della griglia; il bordo resta quello
   della sala (inline). Il prenotato ha il bordo tratteggiato per distinguerlo
   dal tavolo "in attesa" che ha la stessa tinta ambra.                       */
:root[data-theme="light"] .plan-tavolo {
  background: #ffffff !important;
  color: #231b18 !important;
  box-shadow: 0 2px 8px rgba(35, 27, 24, 0.14) !important;
}
:root[data-theme="light"] .plan-tavolo.plan-st-libero    { background: #e6f4ea !important; }
:root[data-theme="light"] .plan-tavolo.plan-st-attesa    { background: #fff4d6 !important; }
:root[data-theme="light"] .plan-tavolo.plan-st-occupato  { background: #f7eee1 !important; }
:root[data-theme="light"] .plan-tavolo.plan-st-prenotato { background: #fff4d6 !important; border-style: dashed !important; }
:root[data-theme="light"] .plan-tavolo .plan-num,
:root[data-theme="light"] .plan-tavolo .plan-info { color: #0f1b2d !important; opacity: 1 !important; }
:root[data-theme="light"] .plan-picker {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  box-shadow: 0 6px 18px rgba(35, 27, 24, 0.14) !important;
}

/* ── Toast (conferme, errori di validazione, avviso prenotazione imminente):
   erano pannelli quasi neri. Diventano superfici di stato tenui con testo
   scuro e bordo del colore pieno.                                           */
/* il contenitore dei toast (z-index 600) finiva SOTTO il velo scuro del form
   eventi (z-index 9999): l'errore "Nome obbligatorio" era oscurato */
:root[data-theme="light"] #toast-container { z-index: 10050 !important; }
:root[data-theme="light"] #toast-container .toast {
  color: #231b18 !important;
  background: #ffffff !important;
  border: 1px solid #e4dcd0 !important;
  border-left-width: 5px !important;
}
:root[data-theme="light"] #toast-container .toast-ok   { background: #e6f4ea !important; border-color: #157a3f !important; }
:root[data-theme="light"] #toast-container .toast-err  { background: #fde8e8 !important; border-color: #b91c1c !important; }
:root[data-theme="light"] #toast-container .toast-warn { background: #fff4d6 !important; border-color: #b45309 !important; }
:root[data-theme="light"] #toast-container .toast-info { background: #e8f0fe !important; border-color: #1d4ed8 !important; }

/* ── Richieste dal sito (modal-landing-richieste) ─────────────────────── */
:root[data-theme="light"] #modal-landing-richieste .landing-request-card {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #b45309 !important;
}
:root[data-theme="light"] #modal-landing-richieste .landing-request-card.is-event {
  background: #f8f4ed !important;
  border-color: #6d28d9 !important;
}
:root[data-theme="light"] #modal-landing-richieste .landing-request-card__main strong { color: #231b18 !important; }
:root[data-theme="light"] #modal-landing-richieste .landing-request-card__main div { color: #231b18 !important; }
:root[data-theme="light"] #modal-landing-richieste .landing-request-card__main small,
:root[data-theme="light"] #modal-landing-richieste .landing-request-card__main p { color: #4d3f38 !important; }
:root[data-theme="light"] #modal-landing-richieste .landing-request-kind {
  color: #5b21b6 !important;
  background: #ffffff !important;
  border-color: #6d28d9 !important;
}
:root[data-theme="light"] #modal-landing-richieste .landing-request-card__actions button.is-ok {
  background: #157a3f !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #modal-landing-richieste .landing-request-card__actions button.is-danger {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
:root[data-theme="light"] #modal-landing-richieste .landing-request-empty {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
}
:root[data-theme="light"] #modal-landing-richieste .landing-request-empty strong { color: #157a3f !important; }
:root[data-theme="light"] #modal-landing-richieste .landing-request-empty span { color: #4d3f38 !important; }
/* storico e messaggi scritti inline da landing-admin.js */
:root[data-theme="light"] #landing-richieste-storico [style*="color:#fca5a5" i] { color: #b91c1c !important; }
:root[data-theme="light"] #landing-richieste-storico [style*="color:#4ade80" i] { color: #157a3f !important; }
:root[data-theme="light"] #landing-richieste-pending [style*="color:#f99" i] { color: #b91c1c !important; }

/* ── Eventi esterni (tab EVENTI) ────────────────────────────────────────── */
/* totale dell'evento in lista: verde menta su bianco → colore del denaro */
:root[data-theme="light"] #ev-lista [style*="color:#a7f3d0" i] { color: #640517 !important; }
/* "×" elimina tavolo: style scritto da JS, il browser lo normalizza in rgb() */
:root[data-theme="light"] #ev-tavoli .tavolo > span[title="Elimina"] { color: #b91c1c !important; }
:root[data-theme="light"] #ev-dettaglio-head > div { color: #4d3f38 !important; }

/* ── Serate del sito con posti (Contenuti del sito → Serate ed eventi): è
   l'unico punto della gestione dove si impostano capienza, "posti non
   limitati", locandina. I riquadri pieghevoli erano quasi neri.             */
/* riepilogo in cima (Stato / Foto / Promo / Serate): pannello quasi nero */
:root[data-theme="light"] #landing-config-body .landing-admin-snap {
  background: #f8f4ed !important;
  background-image: none !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #landing-config-body .landing-admin-snap__card { background: #ffffff !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] #landing-config-body .landing-admin-snap__card.is-ok { border-color: #157a3f !important; }
:root[data-theme="light"] #landing-config-body .landing-admin-snap__card.is-warn { border-color: #b45309 !important; }
:root[data-theme="light"] #landing-config-body .landing-admin-snap__head strong,
:root[data-theme="light"] #landing-config-body .landing-admin-snap__card strong { color: #231b18 !important; }
:root[data-theme="light"] #landing-config-body .landing-admin-snap__head span,
:root[data-theme="light"] #landing-config-body .landing-admin-snap__card span,
:root[data-theme="light"] #landing-config-body .landing-admin-snap__card small { color: #4d3f38 !important; }
:root[data-theme="light"] #landing-config-body .landing-admin-fold {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #landing-config-body .landing-admin-fold__body { border-top-color: #e4dcd0 !important; }
:root[data-theme="light"] #landing-config-body .landing-admin-fold > summary strong { color: #231b18 !important; }
:root[data-theme="light"] #landing-config-body .landing-admin-fold > summary small { color: #76665a !important; }
:root[data-theme="light"] #landing-config-body .landing-admin-fold > summary b {
  color: #640517 !important;
  background: #f8f4ed !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #landing-config-body .landing-admin-action-row {
  background: #f8f4ed !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #landing-config-body .landing-admin-action-row strong { color: #231b18 !important; }
:root[data-theme="light"] #landing-config-body .landing-admin-action-row small { color: #4d3f38 !important; }
:root[data-theme="light"] #landing-config-body .landing-admin-action-row button,
:root[data-theme="light"] #landing-config-body .landing-admin-add-btn {
  background: #f7eee1 !important;
  border-color: #7c001c !important;
  color: #640517 !important;
}
/* editor delle serate: stato "pronto" verde menta, pulsanti verde/rosso scuri */
:root[data-theme="light"] #lc-eventi-list [style*="color:#86efac" i] {
  color: #157a3f !important;
  background: #e6f4ea !important;
  border-color: #157a3f !important;
}
:root[data-theme="light"] #lc-eventi-list button[onclick^="selezionaLocandinaEvento"] {
  background: #157a3f !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #lc-eventi-list button[onclick^="rimuoviEvento"] {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}

/* ── Monitor attese (/attese.html): la pagina usa i token chiari ma le card
   dei tavoli, le uscite, gli avvisi e i pulsanti avevano fondi scuri fissi
   in page-attese.css. Mappatura: libero=verde, aperto=ambra, in servizio=blu,
   uscita pronta=blu con bordo verde.                                         */
:root[data-theme="light"] .attese-header {
  background: #ffffff !important;
  border-bottom-color: #e4dcd0 !important;
  box-shadow: 0 4px 14px rgba(35, 27, 24, 0.08) !important;
}
:root[data-theme="light"] .attese-header__brand h1 {
  background: none !important;
  color: #231b18 !important;
  -webkit-text-fill-color: #231b18 !important;
}
:root[data-theme="light"] .attese-icon-button {
  background: #f8f4ed !important;
  border-color: #e4dcd0 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] .attese-fullscreen.is-fullscreen {
  background: #7c001c !important;
  border-color: #7c001c !important;
  color: #ffffff !important;
}
:root[data-theme="light"] .attese-icon-button:focus-visible,
:root[data-theme="light"] .attese-room-filter button:focus-visible,
:root[data-theme="light"] .attese-table-card:focus-visible,
:root[data-theme="light"] .attese-detail-back:focus-visible,
:root[data-theme="light"] .attese-exit-panel button:focus-visible { outline-color: #7c001c !important; }

/* avvisi fissi in alto e stato della connessione */
:root[data-theme="light"] .attese-alert,
:root[data-theme="light"] .attese-connection {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #0f1b2d !important;
  box-shadow: 0 6px 18px rgba(15, 27, 45, 0.12) !important;
}
:root[data-theme="light"] .attese-alert.is-danger,
:root[data-theme="light"] .attese-connection.is-error {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #0f1b2d !important;
}

/* barra filtri sale: il filtro attivo era bianco su rosa pallido */
:root[data-theme="light"] .attese-map-toolbar { background: #ffffff !important; border-bottom-color: #e4dcd0 !important; }
:root[data-theme="light"] .attese-room-filter button {
  background: #f8f4ed !important;
  border-color: #e4dcd0 !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] .attese-room-filter button.is-active {
  background: #640517 !important;
  border-color: #500f16 !important;
  color: #ffffff !important;
  box-shadow: inset 0 -4px 0 var(--filter-color, #8a1828) !important;
}

/* card dei tavoli */
:root[data-theme="light"] button.attese-table-card {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #e4dcd0 !important;
  color: #231b18 !important;
  box-shadow: 0 2px 8px rgba(35, 27, 24, 0.06) !important;
}
:root[data-theme="light"] button.attese-table-card.is-free { background: #e6f4ea !important; border-color: #157a3f !important; }
:root[data-theme="light"] button.attese-table-card.is-open { background: #fff4d6 !important; border-color: #b45309 !important; }
:root[data-theme="light"] button.attese-table-card.is-service { background: #f7eee1 !important; border-color: #7c001c !important; }
:root[data-theme="light"] button.attese-table-card.is-pending {
  background: #f7eee1 !important;
  border-color: #157a3f !important;
  box-shadow: inset 0 0 0 2px #157a3f, 0 4px 12px rgba(35, 27, 24, 0.10) !important;
}
:root[data-theme="light"] .attese-table-card__number { color: #231b18 !important; }
:root[data-theme="light"] .attese-table-card__status,
:root[data-theme="light"] .attese-table-card__meta { color: #4d3f38 !important; }
:root[data-theme="light"] .attese-table-card.is-pending .attese-table-card__status { color: #157a3f !important; }
:root[data-theme="light"] .attese-table-card.is-free .attese-table-card__status i { background: #157a3f !important; }
:root[data-theme="light"] .attese-table-card.is-open .attese-table-card__status i { background: #b45309 !important; }
:root[data-theme="light"] .attese-table-card.is-service .attese-table-card__status i { background: #7c001c !important; }
:root[data-theme="light"] .attese-table-card.is-pending .attese-table-card__status i {
  background: #157a3f !important;
  box-shadow: 0 0 0 3px rgba(21, 122, 63, 0.18) !important;
}

/* dettaglio del tavolo: testata, stato, pannelli uscita */
:root[data-theme="light"] button.attese-detail-back {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] .attese-detail-heading p { color: #4d3f38 !important; }
:root[data-theme="light"] .attese-detail-status { color: #b91c1c !important; }
:root[data-theme="light"] .attese-detail-status.is-info { color: #1d4ed8 !important; }
:root[data-theme="light"] .attese-exit-panel {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  box-shadow: 0 4px 14px rgba(35, 27, 24, 0.08) !important;
}
:root[data-theme="light"] .attese-exit-panel.is-ready,
:root[data-theme="light"] .attese-exit-panel.is-confirming { border-color: #157a3f !important; }
:root[data-theme="light"] .attese-exit-panel.is-locked { border-color: #b45309 !important; }
:root[data-theme="light"] .attese-exit-panel.is-confirmed { border-color: #7c001c !important; }
:root[data-theme="light"] .attese-exit-header { background: #faf7f2 !important; border-bottom-color: #e4dcd0 !important; }
:root[data-theme="light"] .attese-exit-number { color: #4d3f38 !important; }
:root[data-theme="light"] .attese-exit-panel.is-ready .attese-exit-number { color: #157a3f !important; }
:root[data-theme="light"] .attese-item { background: #f8f4ed !important; }
:root[data-theme="light"] .attese-item__quantity,
:root[data-theme="light"] .attese-item__name { color: #231b18 !important; }
:root[data-theme="light"] .attese-item__department { color: #76665a !important; }
:root[data-theme="light"] .attese-item__note { color: #8a5a12 !important; }

/* pulsanti VIA e conferma in linea */
:root[data-theme="light"] button.attese-via-button,
:root[data-theme="light"] button.attese-confirm-button {
  background: #157a3f !important;
  background-image: none !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
:root[data-theme="light"] button.attese-via-button:disabled {
  background: #faf7f2 !important;
  border-color: #e4dcd0 !important;
  color: #76665a !important;
}
:root[data-theme="light"] button.attese-cancel-button {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] .attese-inline-confirm {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
}
:root[data-theme="light"] .attese-inline-confirm p { color: #231b18 !important; }

/* stati pieni (caricamento, errore, permesso, vuoto) */
:root[data-theme="light"] .attese-state { color: #4d3f38 !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .attese-state h2 { color: #231b18 !important; }
:root[data-theme="light"] .attese-state p { color: #76665a !important; }
:root[data-theme="light"] .attese-state__action {
  background: #7c001c !important;
  border-color: #7c001c !important;
  color: #ffffff !important;
}

/* toast del monitor */
:root[data-theme="light"] .attese-toast {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  color: #231b18 !important;
  box-shadow: 0 6px 18px rgba(35, 27, 24, 0.14) !important;
}
:root[data-theme="light"] .attese-toast.is-warning {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #231b18 !important;
}

/* ── Revisione: stati mancanti ─────────────────────────────────────────── */
/* Monitor attese, VIA in volo: page-attese.css porta i pulsanti disabilitati
   a opacity .55, e "Invio in corso..." (bianco su verde sbiadito) scendeva a
   1,7:1. Restano riconoscibili come "in attesa" con fondo tenue e testo pieno. */
:root[data-theme="light"] button.attese-confirm-button:disabled {
  opacity: 1 !important;
  background: #e6f4ea !important;
  background-image: none !important;
  border-color: #157a3f !important;
  color: #157a3f !important;
}
:root[data-theme="light"] button.attese-cancel-button:disabled {
  opacity: 1 !important;
  background: #faf7f2 !important;
  border-color: #e4dcd0 !important;
  color: #76665a !important;
}
/* Serate del sito, messaggio sotto "Carica locandina" (file non immagine,
   file troppo grande, caricamento rifiutato, rete): landing-admin.js lo colora
   con var(--bordeaux-200), azzurro pallido pensato per il fondo scuro (1,6:1). */
:root[data-theme="light"] #lc-eventi-list small[id$="-foto-msg"][style*="bordeaux-200"] { color: #b91c1c !important; }
/* ═══ §AREA prenotazioni-eventi-attese — FINE ═══ */

/* ═══ §AREA gestione-magazzino-menu — INIZIO ═══ */
/* Hub GESTIONE: editor prodotto, lista menu, categorie, varianti, magazzino
   (inventario, scarti, normalizza, nomi menu, troncati), fatture XML,
   confronto fornitori, ordini fornitori, allerte food cost.
   Metodo: si schiariscono i FONDI scuri rimasti (main.css e stili inline dei
   template JS) e si scuriscono i testi pensati per il nero. Gli stili inline
   scritti via element.style arrivano serializzati come rgb(): per questo
   accanto al valore esadecimale compare anche la forma rgb(...).
   Palette: superfici #ffffff/#f0f5fc/#e2ecf9, bordi #d5deea, testo #0f1b2d,
   secondario #34435c, muted #5a6a84, accento #1e40af, successo #157a3f su
   #e6f4ea, warning #b45309 su #fff4d6, pericolo #b91c1c su #fde8e8, info
   #1d4ed8 su #e8f0fe, viola #5b21b6/#6d28d9, oro brunito #8a5a12. */

/* ── 0. Campi a fuoco nei pannelli dell'area ─────────────────────────────
   faro-pro.css:1416 applica a ogni campo a fuoco var(--shadow-glow), che nel
   tema chiaro contiene un'ombra blu 0 18px 44px: scurisce di un quarto le
   didascalie subito sotto il campo (4.0-4.4:1). Qui resta solo l'anello. */
:root[data-theme="light"] #modal-menu :is(input, select, textarea):focus,
:root[data-theme="light"] #modal-lista-menu input:focus,
:root[data-theme="light"] #modal-categorie input:focus,
:root[data-theme="light"] #modal-edit-categoria input:focus,
:root[data-theme="light"] #modal-admin-varianti :is(input, select):focus,
:root[data-theme="light"] #modal-magazzino :is(input, select):focus,
:root[data-theme="light"] #mag-quick-overlay input:focus,
:root[data-theme="light"] #inv-overlay input:focus,
:root[data-theme="light"] #troncati-overlay input:focus,
:root[data-theme="light"] #tab-fatture :is(input, select):focus,
:root[data-theme="light"] #modal-ordini-fornitori input:focus,
:root[data-theme="light"] #tab-allerte-fc :is(input, select):focus {
  border-color: #8a1828 !important;
  box-shadow: 0 0 0 3px rgba(138, 24, 40, 0.25) !important;
}

/* ── 0b. Testata delle card dell'hub ─────────────────────────────────────
   La regola §11 ".hub-card-header > div" (pensata per l'avatar del Profilo)
   colora di azzurro anche il blocco titolo/sottotitolo delle card: sembra
   testo selezionato. Nelle schermate dell'area il blocco torna trasparente. */
:root[data-theme="light"] #tab-admin .hub-card-header > div:not(.hub-card-icon),
:root[data-theme="light"] #tab-menu .hub-card-header > div:not(.hub-card-icon),
:root[data-theme="light"] #tab-fatture .hub-card-header > div:not(.hub-card-icon) {
  background: transparent !important;
}

/* ── 1. Editor prodotto (main.css:1851-2200, modal-menu) ────────────────── */
:root[data-theme="light"] #modal-menu .menu-editor-head { border-bottom-color: #e4dcd0 !important; }
:root[data-theme="light"] #modal-menu #modal-menu-title { color: #640517 !important; }
/* in modifica il titolo era oro acceso (#fbbf24 via element.style) */
:root[data-theme="light"] #modal-menu #modal-menu-title[style*="rgb(251, 191, 36)"] { color: #b45309 !important; }
:root[data-theme="light"] .menu-stepbar {
  background: rgba(255, 255, 255, 0.97) !important;
  border-bottom-color: #e4dcd0 !important;
}
:root[data-theme="light"] .menu-stepbar button {
  background: #f8f4ed !important;
  border-color: #e4dcd0 !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] .menu-edit-section {
  background: #faf7f2 !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .menu-edit-section-head > span {
  background: #f7eee1 !important;
  border-color: #7c001c !important;
  color: #640517 !important;
}
:root[data-theme="light"] .menu-edit-section-head b { color: #231b18 !important; }
:root[data-theme="light"] .menu-edit-section-head small,
:root[data-theme="light"] .menu-editor-subtitle,
:root[data-theme="light"] .menu-help-text,
:root[data-theme="light"] .menu-photo-label,
:root[data-theme="light"] .menu-recipe-head,
:root[data-theme="light"] .menu-recipe-cost span,
:root[data-theme="light"] .menu-qty-row span { color: #76665a !important; }
:root[data-theme="light"] .menu-qty-label { color: #4d3f38 !important; }
/* messaggio d'errore delle soglie KDS (element.style.color = #f87171) */
:root[data-theme="light"] #nm-kds-soglie-help[style*="rgb(248, 113, 113)"] { color: #b91c1c !important; }
/* allergeni: spenti = opacità 0.5 (testo slavato 2.9:1) → opachi e muted;
   accesi = fondo scuro #3a1a1a/#1a3a1a → fondi tenui di stato */
:root[data-theme="light"] #nm-allergeni-grid button {
  opacity: 1 !important;
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  color: #76665a !important;
}
:root[data-theme="light"] #nm-allergeni-grid button[data-attivo="1"] {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #231b18 !important;
  font-weight: 700;
}
:root[data-theme="light"] #nm-allergeni-grid button[data-attivo="1"][style*="#1a3a1a" i],
:root[data-theme="light"] #nm-allergeni-grid button[data-attivo="1"][style*="rgb(26, 58, 26)"] {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
}
/* foto piatto */
:root[data-theme="light"] .menu-photo-box {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .menu-photo-preview button {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
:root[data-theme="light"] .menu-photo-upload {
  background: #f7eee1 !important;
  border-color: #7c001c !important;
  color: #640517 !important;
}
/* distinta base */
:root[data-theme="light"] .menu-db-wrapper {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .menu-db-toggle { color: #b45309 !important; }
:root[data-theme="light"] .menu-source-toggle button {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  color: #4d3f38 !important;
}
/* sorgente attiva: element.style background #2a1520 / bordo #8a1828 */
:root[data-theme="light"] .menu-source-toggle button[style*="rgb(42, 21, 32)"] {
  background: #640517 !important;
  border-color: #640517 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] .menu-ingredient-results,
:root[data-theme="light"] .menu-recipe-list {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #nm-lista-ing-scroll > div,
:root[data-theme="light"] #nm-lista-ing > div { border-bottom-color: #f2eadd !important; }
/* icona "piatto del menu" su tessera viola scura */
:root[data-theme="light"] #nm-lista-ing-scroll [style*="#1a1040" i] {
  background: #ede9fe !important;
  color: #5b21b6 !important;
}
:root[data-theme="light"] #nm-lista-ing-scroll [style*="color:#F0A0AD" i] { color: #5b21b6 !important; }
:root[data-theme="light"] .menu-qty-panel {
  background: #f8f4ed !important;
  border-color: #7c001c !important;
}
:root[data-theme="light"] .menu-qty-title { color: #b45309 !important; }
:root[data-theme="light"] .menu-qty-title b { color: #231b18 !important; }
:root[data-theme="light"] .menu-qty-row button {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] .menu-qty-row input { color: #b45309 !important; }
/* quantità rapide: tessere #0a080e con didascalia #8a8090 */
:root[data-theme="light"] #nm-qty-quicks button {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  color: #76665a !important;
}
:root[data-theme="light"] #nm-qty-quicks button span { color: #76665a !important; }
:root[data-theme="light"] #nm-qty-quicks button b { color: #b45309 !important; }
:root[data-theme="light"] .menu-qty-actions button {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  color: #4d3f38 !important;
}
:root[data-theme="light"] .menu-qty-actions button:last-child {
  background: #157a3f !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
:root[data-theme="light"] .menu-recipe-cost { border-top-color: #e4dcd0 !important; }
:root[data-theme="light"] .menu-recipe-cost b { color: #b91c1c !important; }
:root[data-theme="light"] #nm-lista-ing [style*="color:#6ee7a0" i],
:root[data-theme="light"] #nm-lista-ing [style*="color:#4ade80" i] { color: #157a3f !important; }
/* prezzo, prezzo consigliato e food cost */
:root[data-theme="light"] .menu-price-input { color: #157a3f !important; }
:root[data-theme="light"] .menu-cost-stat { color: #8a5a12 !important; }
:root[data-theme="light"] #nm-prezzo-suggerito > div { border-color: #e4dcd0 !important; background-color: #ffffff !important; }
:root[data-theme="light"] #nm-prezzo-suggerito > div[style*="#8a1828"] {
  background-color: #fde8e8 !important;
  border-color: #b91c1c !important;
}
:root[data-theme="light"] #nm-prezzo-suggerito > div[style*="#1a5a30"] {
  background-color: #e6f4ea !important;
  border-color: #157a3f !important;
}
:root[data-theme="light"] #nm-prezzo-suggerito [style*="color:var(--muted)"] { color: #4d3f38 !important; }
:root[data-theme="light"] #nm-prezzo-suggerito b { color: #231b18 !important; }
:root[data-theme="light"] #nm-prezzo-suggerito [style*="color:#6ee7a0" i] { color: #157a3f !important; }
:root[data-theme="light"] #nm-prezzo-suggerito button[style] {
  background: #157a3f !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #nm-stat-costo [style*="color:#f87171" i] { color: #b91c1c !important; }
:root[data-theme="light"] #nm-stat-costo [style*="color:#fbbf24" i] { color: #b45309 !important; }
:root[data-theme="light"] #nm-stat-costo [style*="color:#4ade80" i] { color: #157a3f !important; }
/* barra azioni in fondo (sticky) */
:root[data-theme="light"] .menu-editor-actions {
  background: rgba(255, 255, 255, 0.97) !important;
  border-top-color: #e4dcd0 !important;
}
:root[data-theme="light"] .menu-save-btn {
  background: #157a3f !important;
  background-image: none !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}

/* ── 2. Lista menu, categorie, varianti ─────────────────────────────────── */
:root[data-theme="light"] .menu-list-tools { background: #ffffff !important; }
:root[data-theme="light"] .menu-list-tools button {
  background: #157a3f !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
:root[data-theme="light"] .menu-edit-row,
:root[data-theme="light"] .cat-admin-row,
:root[data-theme="light"] .variante-row { border-bottom-color: #e4dcd0 !important; }
:root[data-theme="light"] .menu-row-title,
:root[data-theme="light"] .cat-admin-macro,
:root[data-theme="light"] .variante-name { color: #231b18 !important; }
:root[data-theme="light"] .menu-row-meta,
:root[data-theme="light"] .variante-meta { color: #76665a !important; }
:root[data-theme="light"] .menu-row-path,
:root[data-theme="light"] .cat-admin-path { color: #8a5a12 !important; }
:root[data-theme="light"] .menu-row-desc { color: #4d3f38 !important; }
:root[data-theme="light"] .menu-row-meta [style*="color:#f87171" i] { color: #b91c1c !important; }
:root[data-theme="light"] .menu-row-meta [style*="color:#fbbf24" i] { color: #b45309 !important; }
:root[data-theme="light"] .menu-row-meta [style*="color:#4ade80" i] { color: #157a3f !important; }
:root[data-theme="light"] .menu-status-badge--off {
  background: #fde8e8 !important;
  color: #b91c1c !important;
  border: 1px solid #b91c1c;
}
:root[data-theme="light"] .menu-row-stock {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] .menu-row-stock--on {
  background: #ffffff !important;
  border-color: #157a3f !important;
  color: #157a3f !important;
}
:root[data-theme="light"] .menu-row-edit,
:root[data-theme="light"] .cat-admin-edit {
  background: #f7eee1 !important;
  border-color: #7c001c !important;
  color: #640517 !important;
}
:root[data-theme="light"] .menu-row-delete,
:root[data-theme="light"] .cat-admin-delete,
:root[data-theme="light"] .variante-del {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
/* titoli dei modali in oro chiaro inline (#9ca3af, #F0D79C, #c4b5fd) */
:root[data-theme="light"] #modal-categorie .modal-title,
:root[data-theme="light"] #modal-edit-categoria .modal-title,
:root[data-theme="light"] #modal-lista-menu .modal-title { color: #640517 !important; }
:root[data-theme="light"] #modal-admin-varianti .modal-title { color: #5b21b6 !important; }

/* ── 3. Magazzino (modal-magazzino e overlay creati da magazzino.js) ────── */
/* nome articolo scritto bianco (#fff) se non sotto scorta */
:root[data-theme="light"] #lista-magazzino [style*="color:#fff" i],
:root[data-theme="light"] #lista-scarti [style*="color:#fff" i] { color: #231b18 !important; }
/* pulsanti riga su fondi quasi neri #111014 / #0b0a0a */
:root[data-theme="light"] #lista-magazzino button[style*="#D5B36F" i] {
  background: #ffffff !important;
  border-color: #8a5a12 !important;
  color: #8a5a12 !important;
}
:root[data-theme="light"] #lista-magazzino button[style*="#d97706" i] {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #lista-magazzino button[style*="#991b1b" i],
:root[data-theme="light"] #lista-scarti button[style*="#991b1b" i] {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
/* riepilogo scarti: box #2a0c12 con etichetta #D9D2C2 */
:root[data-theme="light"] #lista-scarti > div[style*="#2a0c12" i] {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
}
:root[data-theme="light"] #lista-scarti [style*="color:#D9D2C2" i] { color: #4d3f38 !important; }
/* banner Normalizza (#1a1408) e pulsante "Fondi nel tenuto" (#2a1520) */
:root[data-theme="light"] #view-mag-normalizza > div[style*="#1a1408" i] {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #lista-duplicati button[style*="#2a1520" i] {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
:root[data-theme="light"] #lista-duplicati > div { border-color: #e4dcd0 !important; }
/* overlay quasi neri (rgba(4,3,6,.92) / rgba(0,0,0,.7) / rgba(0,0,0,.85)) */
:root[data-theme="light"] #mag-quick-overlay,
:root[data-theme="light"] #mag-notif-overlay,
:root[data-theme="light"] #troncati-overlay { background: rgba(35, 27, 24, 0.42) !important; }
:root[data-theme="light"] #mag-quick-overlay .modal-title { color: #640517 !important; }
:root[data-theme="light"] #mag-quick-overlay #mag-quick-ok {
  background: #157a3f !important;
  background-image: none !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #mag-quick-overlay #mag-quick-ok[style*="#2a0c12" i] {
  background: #b45309 !important;
  border-color: #b45309 !important;
}
:root[data-theme="light"] #mag-quick-overlay [data-cat] {
  background: #f8f4ed !important;
  border-color: #e4dcd0 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #mag-notif-overlay > div {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  box-shadow: 0 20px 60px rgba(35, 27, 24, 0.18);
}
:root[data-theme="light"] #mag-notif-overlay label { border-bottom-color: #e4dcd0 !important; }
/* inventario a terra */
:root[data-theme="light"] #inv-overlay [style*="color:#e0d6c8" i] { color: #4d3f38 !important; }
:root[data-theme="light"] #inv-overlay button[style*="#D5B36F" i] {
  border-color: #8a5a12 !important;
  color: #8a5a12 !important;
}
:root[data-theme="light"] #inv-overlay button[style*="#991b1b" i] {
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
:root[data-theme="light"] #inv-overlay [style*="rgba(74,64,96,0.3)"] { border-bottom-color: #f2eadd !important; }
/* articoli troncati */
:root[data-theme="light"] #troncati-box {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  box-shadow: 0 20px 60px rgba(35, 27, 24, 0.18);
}

/* ── 4. Fatture XML (tab-fatture) ───────────────────────────────────────── */
:root[data-theme="light"] .aruba-sync-badge--ok {
  background: #e6f4ea !important;
  color: #231b18 !important;
  border-color: #157a3f !important;
}
/* pulsante "Sync ora" PEC: pillola verde quasi nera (main.css:3879) */
:root[data-theme="light"] #tab-fatture .aruba-sync-card__btn:not(.aruba-sync-card__btn--ghost) {
  background: #157a3f !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #tab-fatture .aruba-sync-card__btn--ghost {
  background: #ffffff !important;
  border-color: #e4dcd0 !important;
  color: #640517 !important;
}
:root[data-theme="light"] #tab-fatture .aruba-sync-card__ico { color: #8a5a12 !important; }
:root[data-theme="light"] .aruba-sync-badge--err {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
}
/* esito upload XML/ZIP ed errori di analisi: --red nel tema chiaro vale
   #1d4ed8 (blu brand, faro-pro.css:73), un errore scritto in blu */
:root[data-theme="light"] #xml-upload-status[style*="var(--red)"],
:root[data-theme="light"] #xml-upload-status[style*="rgb(248, 113, 113)"],
:root[data-theme="light"] #tab-fatture [style*="color:var(--red)"] { color: #b91c1c !important; }
:root[data-theme="light"] #xml-upload-status[style*="var(--green)"],
:root[data-theme="light"] #xml-upload-status[style*="rgb(74, 222, 128)"] { color: #157a3f !important; }
:root[data-theme="light"] #xml-upload-status[style*="rgb(213, 179, 111)"] { color: #8a5a12 !important; }
/* stato di "Carica tutte"/"Ricalcola FC" colorato via element.style */
:root[data-theme="light"] #carica-tutte-status[style*="rgb(74, 222, 128)"] { color: #157a3f !important; }
:root[data-theme="light"] #carica-tutte-status[style*="rgb(213, 179, 111)"] { color: #8a5a12 !important; }
:root[data-theme="light"] #carica-tutte-status[style*="rgb(248, 113, 113)"] { color: #b91c1c !important; }
:root[data-theme="light"] #carica-tutte-status[style*="rgb(251, 191, 36)"] { color: #b45309 !important; }
/* pulsante Verifica AI (#1a1040 viola scuro) */
:root[data-theme="light"] #btn-verifica-ai {
  background: #ede9fe !important;
  border-color: #6d28d9 !important;
  color: #5b21b6 !important;
}
/* anteprima righe XML: tinte scure dei badge → fondi tenui di stato */
:root[data-theme="light"] #tab-fatture-scroll [style*="#2a1a00" i],
:root[data-theme="light"] #tab-fatture-scroll [style*="#2a1500" i],
:root[data-theme="light"] #tab-fatture-scroll [style*="#2a2010" i],
:root[data-theme="light"] #tab-fatture-scroll [style*="#2a1f0f" i],
:root[data-theme="light"] #tab-fatture-scroll [style*="#2a1408" i],
:root[data-theme="light"] #tab-fatture-scroll [style*="#1a1a00" i] {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #tab-fatture-scroll [style*="#211B20" i] {
  background: #fff4d6 !important;
  border-color: #8a5a12 !important;
  color: #8a5a12 !important;
}
:root[data-theme="light"] #tab-fatture-scroll [style*="#1a2010" i] {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #tab-fatture-scroll [style*="#2a0c12" i] {
  background: #fde8e8 !important;
  border-color: #b91c1c !important;
  color: #b91c1c !important;
}
:root[data-theme="light"] #tab-fatture-scroll [style*="#1a1030" i],
:root[data-theme="light"] #tab-fatture-scroll [style*="#1a1020" i] {
  background: #ede9fe !important;
  border-color: #6d28d9 !important;
  color: #5b21b6 !important;
}
:root[data-theme="light"] #tab-fatture-scroll [style*="color:#fbbf24" i] { color: #b45309 !important; }
:root[data-theme="light"] #tab-fatture-scroll [style*="color:#86efac" i],
:root[data-theme="light"] #tab-fatture-scroll [style*="color:#4ade80" i],
:root[data-theme="light"] #tab-fatture-scroll [style*="color:#6ee7a0" i] { color: #157a3f !important; }
:root[data-theme="light"] #tab-fatture-scroll [style*="color:#e2e25a" i] { color: #b45309 !important; }
:root[data-theme="light"] #tab-fatture-scroll [style*="color:#F0A0AD" i] { color: #5b21b6 !important; }
:root[data-theme="light"] #tab-fatture-scroll [style*="color:#D5B36F" i] { color: #8a5a12 !important; }
/* testi colorati dentro le tinte di stato (riga cassa, conversione): scuri,
   il colore resta sul bordo del riquadro */
:root[data-theme="light"] #tab-fatture-scroll :is([style*="#2a1500" i], [style*="#1a2010" i]) > span[style*="color:" i] { color: #231b18 !important; }
/* badge/pulsanti su tinta verde #0f2a1a (sconto applicato, pagata, carica):
   la regola §11 li porta a #e6f4ea, qui il testo resta scuro */
:root[data-theme="light"] #tab-fatture-scroll [style*="#0f2a1a" i][style*="color:" i] { color: #231b18 !important; }
:root[data-theme="light"] #tab-fatture-scroll [style*="color:#fff;" i] { color: #231b18 !important; }
:root[data-theme="light"] #tab-fatture-scroll [style*="color:#f87171" i] { color: #b91c1c !important; }
:root[data-theme="light"] #tab-fatture-scroll [style*="color:var(--muted)"] { color: #4d3f38 !important; }
/* campo nome con alias applicato (senza type: il rimappaggio degli input
   non lo raggiunge) */
:root[data-theme="light"] #tab-fatture-scroll input:not([type]) {
  background: #ffffff !important;
  color: #231b18 !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #tab-fatture-scroll input:not([type])[style*="#0f2a1a" i] {
  background: #e6f4ea !important;
  color: #231b18 !important;
  border-color: #157a3f !important;
}
:root[data-theme="light"] #tab-fatture-scroll > div[style*="#D5B36F" i] { border-color: #8a5a12 !important; }
/* correzioni AI */
:root[data-theme="light"] #ai-correzioni-box [style*="color:#D5B36F" i] { color: #8a5a12 !important; }
:root[data-theme="light"] #ai-correzioni-box [style*="color:#4ade80" i],
:root[data-theme="light"] #ai-correzioni-box [style*="color:#6ee7a0" i] { color: #157a3f !important; }
:root[data-theme="light"] #ai-correzioni-box button[style*="#0f2a1a" i],
:root[data-theme="light"] #ai-correzioni-box button[style*="rgb(26, 58, 26)"] {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  color: #231b18 !important;
}
/* modale "classifica prodotti dubbi": colori delle 4 categorie (cssText →
   rgb) e scelta evidenziata con fondo pieno */
:root[data-theme="light"] #modal-classifica-prodotti .modal-title { color: #640517 !important; }
:root[data-theme="light"] #classif-list > div { background: #faf7f2 !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] #classif-list button { background: #ffffff !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] #classif-list button[style*="color: rgb(213, 179, 111)"] { color: #8a5a12 !important; }
:root[data-theme="light"] #classif-list button[style*="color: rgb(22, 163, 74)"] { color: #157a3f !important; }
:root[data-theme="light"] #classif-list button[style*="color: rgb(240, 160, 173)"] { color: #6d28d9 !important; }
:root[data-theme="light"] #classif-list button[style*="color: rgb(185, 28, 28)"] { color: #b91c1c !important; }
:root[data-theme="light"] #classif-list button[style*="border-color: rgb(213, 179, 111)"] { background: #8a5a12 !important; border-color: #8a5a12 !important; color: #ffffff !important; }
:root[data-theme="light"] #classif-list button[style*="border-color: rgb(22, 163, 74)"] { background: #157a3f !important; border-color: #157a3f !important; color: #ffffff !important; }
:root[data-theme="light"] #classif-list button[style*="border-color: rgb(240, 160, 173)"] { background: #6d28d9 !important; border-color: #6d28d9 !important; color: #ffffff !important; }
:root[data-theme="light"] #classif-list button[style*="border-color: rgb(185, 28, 28)"] { background: #b91c1c !important; border-color: #b91c1c !important; color: #ffffff !important; }
:root[data-theme="light"] #btn-salva-classif:not(:disabled) {
  background: #640517 !important;
  border-color: #640517 !important;
}
:root[data-theme="light"] #btn-salva-classif:not(:disabled),
:root[data-theme="light"] #btn-salva-classif:not(:disabled) * { color: #ffffff !important; }

/* ── 5. Ordini fornitori (modal-ordini-fornitori) ───────────────────────── */
:root[data-theme="light"] #modal-ordini-fornitori .modal-title { color: #8a5a12 !important; }
:root[data-theme="light"] #ord-scorte-count { background: #b91c1c !important; color: #ffffff !important; }
:root[data-theme="light"] #ord-carrello-count { background: #8a5a12 !important; color: #ffffff !important; }
:root[data-theme="light"] #ord-tab-content [style*="#7a4a18" i],
:root[data-theme="light"] #ord-tab-content [style*="#4a3818" i] {
  background: #fff4d6 !important;
  color: #231b18 !important;
  box-shadow: inset 0 0 0 1px #b45309;
}
:root[data-theme="light"] #ord-tab-content [style*="#184a7a" i] {
  background: #f7eee1 !important;
  color: #7c001c !important;
  box-shadow: inset 0 0 0 1px #7c001c;
}
:root[data-theme="light"] #ord-tab-content button[style*="#1a3a1a" i] {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  color: #231b18 !important;
}
/* "Ordina": fondo var(--accent) (blu nel tema chiaro) con testo nero */
:root[data-theme="light"] #ord-tab-content button[style*="var(--accent" i] {
  background: #640517 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #ord-tab-content [style*="color:#4ade80" i] { color: #157a3f !important; }
/* didascalia sotto la ricerca: col campo a fuoco l'alone blu la sbiadiva */
:root[data-theme="light"] #ord-search + div { color: #4d3f38 !important; }

/* ── 6. Allerte food cost (tab-allerte-fc a tutto schermo) ──────────────── */
/* apriAllerteFoodCost() scrive background #0a0810 sul pannello */
:root[data-theme="light"] #tab-allerte-fc[style*="rgb(10, 8, 16)"] { background: #faf7f2 !important; }
:root[data-theme="light"] #tab-allerte-fc h2 { color: #b45309 !important; }
:root[data-theme="light"] #allerte-fc-content [style*="color:#8a8090" i] { color: #76665a !important; }
:root[data-theme="light"] #allerte-fc-content [style*="rgba(74,64,96,0.3)"] { border-top-color: #f2eadd !important; }
/* modalità Listino (#8a1828) / Scontato (#1a5a30 + #6ee7a0) attiva */
:root[data-theme="light"] #allerte-fc-content button[style*="background:#8a1828" i] {
  background: #640517 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #allerte-fc-content button[style*="background:#1a5a30" i] {
  background: #157a3f !important;
  color: #ffffff !important;
}
/* "Soglie target" aperto (#2a1520) */
:root[data-theme="light"] #allerte-fc-content button[style*="background:#2a1520" i] {
  background: #f7eee1 !important;
  border-color: #7c001c !important;
  color: #640517 !important;
}
:root[data-theme="light"] #allerte-fc-content button[style*="#0f2a1a" i] {
  background: #157a3f !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
/* podio della classifica margine (#2a2008 oro, #1a1a1a argento, #2a1a08 bronzo) */
:root[data-theme="light"] #allerte-fc-content [style*="background:#2a2008" i] { background: #fff4d6 !important; color: #8a5a12 !important; }
:root[data-theme="light"] #allerte-fc-content [style*="background:#1a1a1a" i] { background: #f2eadd !important; color: #4d3f38 !important; }
:root[data-theme="light"] #allerte-fc-content [style*="background:#2a1a08" i] { background: #fde8e8 !important; color: #b91c1c !important; }
/* ricerca classifica: campo #0a080e con testo verde acceso */
:root[data-theme="light"] #classifica-ricerca { color: #231b18 !important; }
/* fasce soglie: etichette colorate su bianco */
:root[data-theme="light"] #allerte-fc-content [style*="color:#6ee7a0" i],
:root[data-theme="light"] #allerte-fc-content [style*="color:#4ade80" i] { color: #157a3f !important; }

/* ── 7. Revisione avversaria: toast, stati "in corso", rami rari ─────────── */
/* Errori degli ordini fornitori: ordini-fornitori.js chiama toast(msg, true),
   quindi la classe diventa "toast-true", che main.css non definisce. Il
   toast resta senza fondo: testo bianco sulla pagina chiara, 1.07:1. Qui
   prende l'aspetto di un errore. */
:root[data-theme="light"] #toast-container .toast-true {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
}
/* I toast (z-index 600) finivano sotto i pannelli a schermo intero
   dell'area: allerte food cost e inventario (z-index 9999), articoli
   troncati (10000), classifica prodotti dubbi (99999). Nelle allerte e
   nell'inventario, che hanno un fondo pieno, messaggi come «Piatto
   ignorato», «Soglie salvate» o «Spostato in…» non comparivano. Negli altri
   pannelli restavano velati dal fondo scuro. */
:root[data-theme="light"] #toast-container { z-index: 100000 !important; }
/* «Sync ora» durante la sincronizzazione: bundle.css mette opacità 0.6 su
   :disabled e .is-loading. Sul verde pieno il bianco scende a 1.82:1.
   Il pulsante torna opaco e l'attesa si vede dal fondo tenue. */
:root[data-theme="light"] #tab-fatture .aruba-sync-card__btn:is(:disabled, .is-loading) {
  opacity: 1 !important;
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  color: #157a3f !important;
  cursor: progress;
}
:root[data-theme="light"] #tab-fatture .aruba-sync-card__btn.aruba-sync-card__btn--ghost:is(:disabled, .is-loading) {
  background: #f8f4ed !important;
  border-color: #e4dcd0 !important;
  color: #76665a !important;
}
/* Card «Costo fisso riconosciuto»: la riga delle tasse alcool (#e2e25a,
   portato a #b45309) sul viola tenue #ede9fe era a 4.23:1. */
:root[data-theme="light"] #tab-fatture-scroll [style*="#1a1020" i] [style*="color:#e2e25a" i] { color: #4d3f38 !important; }
/* Tab Fatture: stato dell'upload, blocco Lista / Carica tutte / elenco XML
   e riepilogo dell'anteprima («N righe — Totale stimato») stanno sul fondo
   a quadretti della pagina (.mappa-inner), senza card. Sulle righe della
   griglia (#e1e6ee) il verde #157a3f scende a 4.31:1, il muted #5a6a84 dei
   nomi file a 4.38:1 e l'arancio #b45309 di «Nessun file XML trovato» a
   3.97:1: il risultato dipendeva dallo scorrimento. Fondo pieno bianco. */
:root[data-theme="light"] #xml-lista-wrap {
  background: #ffffff;
  border: 1px solid #e4dcd0;
  border-radius: 12px;
  padding: 10px;
}
:root[data-theme="light"] #xml-upload-status:not(:empty),
:root[data-theme="light"] #tab-fatture-scroll > .sezione + div[style*="font-size:0.72rem"] {
  background: #ffffff;
  border: 1px solid #e4dcd0;
  border-radius: 8px;
  padding: 6px 10px;
}

/* ── 8. Telefono (≤600px): testi schiacciati o coperti dal layout ───────── */
/* Difetti di impaginazione presenti anche nel tema scuro (layout inline del
   JS, non colori). Qui si correggono solo per il tema chiaro: per lo scuro
   servono le stesse regole senza prefisso, in main.css. */
@media (max-width: 600px) {
  /* Tab Fatture, riga Lista / Carica tutte / Solo spese / Ricalcola FC:
     4 colonne da 85px con la griglia icona+testo di faro-pro.css lasciano
     all'etichetta 15px, e il testo si spezza lettera per lettera
     («Li s…», «C a…»). Icona sopra, etichetta sotto a tutta larghezza. */
  :root[data-theme="light"] #xml-lista-wrap > .hub-card-grid > .hub-btn {
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: center !important;
    align-content: center !important;
    row-gap: 4px !important;
    padding: 8px 4px !important;
    text-align: center !important;
  }
  :root[data-theme="light"] #xml-lista-wrap > .hub-card-grid > .hub-btn .hub-btn-ico {
    grid-row: auto !important;
    width: 26px !important;
    height: 26px !important;
  }
  :root[data-theme="light"] #xml-lista-wrap > .hub-card-grid > .hub-btn .hub-btn-label {
    font-size: 11.5px !important;
    line-height: 1.15 !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  /* Magazzino, righe articolo: la colonna destra (quantità + 3 pulsanti) non
     si restringe e il nome resta in ~70px. Le parole lunghe finivano sotto
     il pulsante «📲 tutti» e una quantità come 9.920000000000002 PZ si
     sovrapponeva al nome. Nome su tutta la riga, quantità e pulsanti sotto. */
  :root[data-theme="light"] #lista-magazzino > div { flex-wrap: wrap !important; row-gap: 6px !important; }
  :root[data-theme="light"] #lista-magazzino > div > div:first-child { flex: 1 1 100% !important; overflow-wrap: anywhere; }
  :root[data-theme="light"] #lista-magazzino > div > div:last-child {
    flex: 1 1 100% !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  :root[data-theme="light"] #lista-magazzino > div > div:last-child > div:first-child { overflow-wrap: anywhere; min-width: 0; }

  /* Inventario, categoria aperta: il nome (nowrap + ellipsis) cede tutto lo
     spazio a quantità, valore e pulsanti. Con quantità lunghe (9.999999999999998 Kg)
     arriva a 0px e sparisce. Nome sulla prima riga, il resto sotto. */
  :root[data-theme="light"] #inv-wrap .inv-cat > div + div > div { flex-wrap: wrap !important; row-gap: 4px !important; }
  :root[data-theme="light"] #inv-wrap .inv-cat > div + div > div > div:first-child {
    flex: 1 1 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: anywhere;
  }
  :root[data-theme="light"] #inv-wrap .inv-cat > div + div > div > div:nth-child(2) { margin-left: auto !important; }

  /* Distinta base dell'editor prodotto: quantità, costo e ✕ lasciano al
     nome dell'ingrediente pochi pixel e il testo va in colonna, una lettera
     per riga («R I C C I O L A…»). Icona e nome sulla prima riga. */
  :root[data-theme="light"] #nm-lista-ing > div { flex-wrap: wrap !important; row-gap: 2px !important; }
  :root[data-theme="light"] #nm-lista-ing > div > div:nth-child(2) { flex: 1 1 calc(100% - 28px) !important; }
  :root[data-theme="light"] #nm-lista-ing > div > div:nth-child(3) { margin-left: auto !important; }

  /* Allerte food cost, pannello Soglie target: 4 fasce in ~70px ciascuna e
     il padding dei campi di faro-pro.css (14px per lato) lasciano al valore
     0-12px: i numeri non si vedono e la colonna LUXURY esce dalla card.
     Due fasce per riga e padding ridotto. */
  :root[data-theme="light"] #allerte-fc-content [style*="grid-template-columns:repeat(4,1fr)"]:has(input) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  :root[data-theme="light"] #allerte-fc-content [style*="grid-template-columns:repeat(4,1fr)"]:has(input) input {
    min-width: 0 !important;
    padding: 4px 6px !important;
  }
}
/* ═══ §AREA gestione-magazzino-menu — FINE ═══ */

/* ═══ §AREA gestione-team-marketing — INIZIO ═══ */
/* Hub GESTIONE: team (camerieri, permessi, attivita', codici), log accessi,
   reset password, mansioni e profilo, notifiche WhatsApp, marketing (hub,
   anteprime, locandina, clienti, contatti WA, giocatori), sito clienti
   (contenuti, galleria, statistiche), Staff Arena, musica, owner gate.
   Quasi tutti i colori arrivano da style="" scritti dai template JS con fondi
   quasi neri pensati per il tema scuro: si battono con !important su
   selettori d'attributo limitati ai contenitori dell'area. Ogni selettore
   parte da :root[data-theme="light"], quindi il tema scuro resta identico. */

/* ── HUB: testate delle card ─────────────────────────────────────────────
   La regola esistente .hub-card-header > div (§11) tinge d'azzurro anche il
   blocco titolo/sottotitolo: sembra una selezione di testo. Resta solo sulla
   pastiglia dell'avatar del profilo (cerchio). Stessa correzione dell'area
   gestione-magazzino-menu per #tab-admin; qui anche Mansioni e Profilo. */
:root[data-theme="light"] #tab-admin .hub-card-header > div:not([style*="border-radius:50%"]),
:root[data-theme="light"] #tab-radar .hub-card-header > div:not([style*="border-radius:50%"]),
:root[data-theme="light"] #tab-profilo .hub-card-header > div:not([style*="border-radius:50%"]) {
  background: transparent !important;
}

/* ── TEAM: elenco camerieri (camerieri.js) ─────────────────────────────── */
:root[data-theme="light"] #lista-camerieri div[style*="color:#fff"] { color: #231b18 !important; }
:root[data-theme="light"] #lista-camerieri button[style*="background:#052e16"] {
  background: #e6f4ea !important; color: #0f5c30 !important; border-color: #157a3f !important;
}
:root[data-theme="light"] #lista-camerieri button[style*="background:#1c1924"] {
  background: #f8f4ed !important; color: #4d3f38 !important; border-color: #decbb2 !important;
}
:root[data-theme="light"] #lista-camerieri button[style*="background:#2A1218"] {
  background: #ffffff !important; color: #640517 !important; border-color: #7c001c !important;
}
:root[data-theme="light"] #lista-camerieri button[style*="background:#0a1f1a"] {
  background: #ffffff !important; color: #231b18 !important; border-color: #decbb2 !important;
}
:root[data-theme="light"] #lista-camerieri button[style*="border:1px solid #d97706"] {
  background: #ffffff !important; color: #b45309 !important; border-color: #b45309 !important;
}
:root[data-theme="light"] #lista-camerieri button[style*="background:#211B20"] {
  background: #fff4d6 !important; color: #8a5a12 !important; border-color: #8a5a12 !important;
}
:root[data-theme="light"] #lista-camerieri button[style*="border:1px solid #991b1b"] {
  background: #ffffff !important; color: #b91c1c !important; border-color: #b91c1c !important;
}
/* riga ADMIN: velo nero 30% → superficie tenue */
:root[data-theme="light"] #lista-camerieri div[style*="background:rgba(0"] { background: #f8f4ed !important; }
:root[data-theme="light"] #lista-camerieri span[style*="color:#f59e0b"] { color: #8a5a12 !important; }
:root[data-theme="light"] #lista-camerieri div[style*="background:rgba(0"] > span { color: #4d3f38 !important; }

/* Codice di attivazione mostrato una volta (camerieri.js mostraCodiceAttivazione) */
:root[data-theme="light"] #codice-att-value { color: #500f16 !important; background: #f7eee1 !important; border-color: #7c001c !important; }
:root[data-theme="light"] #modal-codice-attivazione .hub-btn[style*="bordeaux"] {
  background: #7c001c !important; border-color: #640517 !important; color: #ffffff !important;
}

/* ── TEAM: permessi avanzati (overlay #modal-permessi-avanzati, fondo #1a1520) ── */
:root[data-theme="light"] #modal-permessi-avanzati { background: rgba(35, 27, 24, 0.42) !important; }
:root[data-theme="light"] #modal-permessi-avanzati > div {
  background: #ffffff !important; border-color: #e4dcd0 !important; color: #231b18 !important;
  box-shadow: 0 20px 60px rgba(35, 27, 24, 0.18);
}
:root[data-theme="light"] #modal-permessi-avanzati > div > div[style*="border-bottom:1px solid #333"] { border-bottom-color: #e4dcd0 !important; }
:root[data-theme="light"] #modal-permessi-avanzati h2 { color: #640517 !important; }
:root[data-theme="light"] #modal-permessi-avanzati div[style*="background:rgba(255"] {
  background: #faf7f2 !important; border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #modal-permessi-avanzati div[style*="color:#ffd700"] { color: #8a5a12 !important; }
:root[data-theme="light"] #modal-permessi-avanzati label { color: #231b18 !important; }
:root[data-theme="light"] #modal-permessi-avanzati button[onclick^="permessiTuttiOn"] { background: #157a3f !important; color: #ffffff !important; }
:root[data-theme="light"] #modal-permessi-avanzati button[onclick^="permessiTuttiOff"] { background: #b91c1c !important; color: #ffffff !important; }
:root[data-theme="light"] #modal-permessi-avanzati button[onclick^="chiudiPermessiAvanzati"] {
  background: #ffffff !important; color: #231b18 !important; border: 1px solid #decbb2 !important;
}
/* riquadri di stato: sola lettura / utente ADMIN (warning), salvataggio automatico (info) */
:root[data-theme="light"] #modal-permessi-avanzati div[style*="background:rgba(251"],
:root[data-theme="light"] #modal-permessi-avanzati div[style*="background:rgba(245"] {
  background: #fff4d6 !important; border-color: #b45309 !important; color: #231b18 !important;
}
:root[data-theme="light"] #modal-permessi-avanzati div[style*="background:rgba(213"] {
  background: #f7eee1 !important; border: 1px solid #7c001c !important; color: #231b18 !important;
}
/* messaggio di salvataggio: colori scritti da setPermessiStatus() */
:root[data-theme="light"] #permessi-save-state[style*="rgb(134"] { color: #0f5c30 !important; }
:root[data-theme="light"] #permessi-save-state[style*="rgb(251"] { color: #b45309 !important; }
:root[data-theme="light"] #permessi-save-state[style*="rgb(252"] { color: #b91c1c !important; }
:root[data-theme="light"] #permessi-save-state[style*="rgb(240"] { color: #8a5a12 !important; }

/* ── TEAM: attivita' del cameriere (overlay #modal-attivita-cam) ───────── */
:root[data-theme="light"] #modal-attivita-cam { background: rgba(35, 27, 24, 0.42) !important; }
:root[data-theme="light"] #modal-attivita-cam button[style*="background:#2a0c12"] {
  background: #ffffff !important; color: #231b18 !important; border-color: #decbb2 !important;
}

/* ── LOG ACCESSI (auth-log-admin.js) ───────────────────────────────────── */
:root[data-theme="light"] #auth-log-content span[style*="background:#059669"] { background: #157a3f !important; }
/* riquadri "sospetti" (rosso scuro) e "nessun sospetto" (verde scuro) */
:root[data-theme="light"] #auth-log-sospetti-wrap div[style*="background:#3a1f1f"] {
  background: #fde8e8 !important; border-color: #b91c1c !important;
}
:root[data-theme="light"] #auth-log-sospetti-wrap div[style*="color:#fca5a5"] { color: #991b1b !important; }
:root[data-theme="light"] #auth-log-sospetti-wrap ul[style*="color:#fecaca"] { color: #231b18 !important; }
:root[data-theme="light"] #auth-log-sospetti-wrap div[style*="background:#1f3a1f"],
:root[data-theme="light"] #reset-richieste-pending div[style*="background:#1f3a1f"] {
  background: #e6f4ea !important; border-color: #157a3f !important; color: #0f5c30 !important;
}

/* ── RESET PASSWORD (reset-richieste-admin.js) ─────────────────────────── */
:root[data-theme="light"] #reset-richieste-pending > div[style*="background:#0b0a0a"] {
  background: #fff4d6 !important; border-color: #b45309 !important;
}
:root[data-theme="light"] #reset-richieste-pending div[style*="color:#fbbf24"] { color: #231b18 !important; }
:root[data-theme="light"] #reset-richieste-pending div[style*="color:var(--muted)"] { color: #4d3f38 !important; }
:root[data-theme="light"] #reset-richieste-pending button[style*="background:#052e16"] {
  background: #157a3f !important; border-color: #0f5c30 !important; color: #ffffff !important;
}
:root[data-theme="light"] #reset-richieste-pending button[style*="background:#0b0a0a"] {
  background: #ffffff !important; border-color: #b91c1c !important; color: #b91c1c !important;
}
:root[data-theme="light"] #reset-richieste-storico td[style*="color:#F0D79C"] { color: #8a5a12 !important; }

/* ── MANSIONI del profilo (init.js caricaMieMansioni) ──────────────────── */
/* completate: opacity .5 inline rendeva illeggibile tutto; restano barrate e grigie */
:root[data-theme="light"] #mansioni-lista > div[style*="opacity:0.5"] { opacity: 1 !important; }
:root[data-theme="light"] #mansioni-lista div[style*="color:#D5B36F"] { color: #8a5a12 !important; }
/* Mansioni admin: campo XP largo 70px, il valore a 3 cifre veniva tagliato */
:root[data-theme="light"] #mans-xp { width: 92px !important; }

/* ── NOTIFICHE WHATSAPP (notifiche-admin.js) ───────────────────────────── */
:root[data-theme="light"] #modal-notifiche-wpp .cwpp-summary-card,
:root[data-theme="light"] #modal-notifiche-wpp .cwpp-panel,
:root[data-theme="light"] #modal-notifiche-wpp .cwpp-fallback { border-color: #e4dcd0; }
:root[data-theme="light"] #modal-notifiche-wpp .cwpp-summary-card.is-ok { border-color: #157a3f !important; background: #e6f4ea !important; }
:root[data-theme="light"] #modal-notifiche-wpp .cwpp-summary-card.is-warn { border-color: #7c001c !important; background: #f7eee1 !important; }
:root[data-theme="light"] #modal-notifiche-wpp .cwpp-recipient { border-top-color: #e4dcd0 !important; }
:root[data-theme="light"] #wpp-qr-img { border-color: #e4dcd0 !important; }
/* esiti scritti da JS con el.style.color (attributo in rgb) */
:root[data-theme="light"] #wpp-notif-status[style*="rgb(74"],
:root[data-theme="light"] #wpp-mittente-status[style*="rgb(74"],
:root[data-theme="light"] #wpp-testmode-status[style*="rgb(74"],
:root[data-theme="light"] #wpp-tpleditor-list [data-status][style*="rgb(74"] { color: #0f5c30 !important; }
:root[data-theme="light"] #wpp-notif-status[style*="rgb(248"],
:root[data-theme="light"] #wpp-mittente-status[style*="rgb(248"],
:root[data-theme="light"] #wpp-testmode-status[style*="rgb(248"],
:root[data-theme="light"] #wpp-tpleditor-list [data-status][style*="rgb(248"] { color: #b91c1c !important; }
:root[data-theme="light"] #wpp-testmode-status[style*="rgb(251"],
:root[data-theme="light"] #wpp-tpleditor-list [data-status][style*="rgb(251"] { color: #8a5a12 !important; }
/* destinatari: interruttori per tipo di notifica (spento = rosso scuro) */
:root[data-theme="light"] #wpp-dest-lista button[style*="background:#2a1010"] {
  background: #fde8e8 !important; color: #b91c1c !important; box-shadow: inset 0 0 0 1px #b91c1c;
}
:root[data-theme="light"] #wpp-dest-lista button[style*="background:#0f2a1a"] { box-shadow: inset 0 0 0 1px #157a3f; }
:root[data-theme="light"] #wpp-dest-lista button[onclick^="rimuoviDestinatario"] { border-color: #b91c1c !important; color: #b91c1c !important; }
/* opzioni avanzate: titoli oro, pulsanti e anteprima in stile terminale */
:root[data-theme="light"] #wpp-testrunner-box b[style*="color:#F0D79C"] { color: #8a5a12 !important; }
:root[data-theme="light"] #wpp-testrunner-list button[style*="background:#0f1a2a"] {
  background: #ffffff !important; border-color: #8a5a12 !important; color: #8a5a12 !important;
}
:root[data-theme="light"] #wpp-testrunner-anteprima {
  background: #f8f4ed !important; border-color: #e4dcd0 !important; color: #231b18 !important;
}
:root[data-theme="light"] #wpp-testrunner-anteprima[style*="rgb(248"] { color: #b91c1c !important; }
:root[data-theme="light"] #wpp-tpleditor-list span[style*="background:#1a3a1a"] { background: #e6f4ea !important; color: #0f5c30 !important; }
:root[data-theme="light"] #wpp-tpleditor-list button[style*="background:#1a3a1a"] {
  background: #157a3f !important; border-color: #0f5c30 !important; color: #ffffff !important;
}
:root[data-theme="light"] #wpp-tpleditor-list button[style*="background:#2a1a0c"] {
  background: #ffffff !important; border-color: #8a5a12 !important; color: #8a5a12 !important;
}

/* ── MARKETING (page-marketing.js) ─────────────────────────────────────── */
/* apriMarketing() scrive style.background="#0a0810" sul pannello: pagina scura */
:root[data-theme="light"] #tab-marketing { background: #faf7f2 !important; }
:root[data-theme="light"] .faro-mkt-hero,
:root[data-theme="light"] .cwpp-hero {
  background: #ffffff !important; background-image: none !important; border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .faro-mkt-metric,
:root[data-theme="light"] .faro-mkt-section,
:root[data-theme="light"] .faro-mkt-mini-panel,
:root[data-theme="light"] .faro-mkt-action,
:root[data-theme="light"] .faro-mkt-campaign,
:root[data-theme="light"] .faro-mkt-segments button,
:root[data-theme="light"] .cwpp-panel,
:root[data-theme="light"] .cwpp-fallback,
:root[data-theme="light"] .cwpp-list,
:root[data-theme="light"] .cwpp-status-line {
  background: #ffffff !important; border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .faro-mkt-status,
:root[data-theme="light"] .cwpp-status-card { background: #faf7f2 !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .faro-mkt-status.is-ok,
:root[data-theme="light"] .cwpp-status-card.is-ok { background: #e6f4ea !important; border-color: #157a3f !important; }
:root[data-theme="light"] .faro-mkt-status.is-warn,
:root[data-theme="light"] .cwpp-status-card.is-warn { background: #f7eee1 !important; border-color: #7c001c !important; }
:root[data-theme="light"] .faro-mkt-status button,
:root[data-theme="light"] .faro-mkt-inline button,
:root[data-theme="light"] .faro-mkt-ghost,
:root[data-theme="light"] .cwpp-primary {
  background: #7c001c !important; border-color: #640517 !important; color: #ffffff !important;
}
:root[data-theme="light"] .cwpp-primary:disabled {
  background: #f2eadd !important; border-color: #ded2c3 !important; color: #76665a !important; opacity: 1 !important;
}
:root[data-theme="light"] .faro-mkt-ghost {
  background: #ffffff !important; color: #640517 !important; border-color: #7c001c !important;
}
:root[data-theme="light"] .cwpp-secondary { background: #ffffff !important; border-color: #decbb2 !important; color: #231b18 !important; }
/* azione principale "Locandina evento": blu pieno, testo bianco */
:root[data-theme="light"] .faro-mkt-action.is-primary {
  background: #640517 !important; background-image: none !important; border-color: #500f16 !important;
}
:root[data-theme="light"] .faro-mkt-action.is-primary,
:root[data-theme="light"] .faro-mkt-action.is-primary strong,
:root[data-theme="light"] .faro-mkt-action.is-primary small,
:root[data-theme="light"] .faro-mkt-action.is-primary b { color: #ffffff !important; }
:root[data-theme="light"] .faro-mkt-campaign.is-attn { background: #f7eee1 !important; border-color: #7c001c !important; }
:root[data-theme="light"] .faro-mkt-campaign.is-good { background: #e6f4ea !important; border-color: #157a3f !important; }
:root[data-theme="light"] .faro-mkt-notice { background: #fff4d6 !important; border-color: #b45309 !important; color: #231b18 !important; }
:root[data-theme="light"] .faro-mkt-kpi-row,
:root[data-theme="light"] .faro-mkt-queue-row,
:root[data-theme="light"] .faro-mkt-feedback-row,
:root[data-theme="light"] .cwpp-row { border-bottom-color: #e4dcd0 !important; }
:root[data-theme="light"] .faro-mkt-media-preview button { background: #fde8e8 !important; border-color: #b91c1c !important; color: #b91c1c !important; }
:root[data-theme="light"] .cwpp-badge.is-ok { background: #e6f4ea !important; color: #0f5c30 !important; }
:root[data-theme="light"] .cwpp-consenso { background: #fff4d6 !important; border-color: #b45309 !important; color: #231b18 !important; }
/* overlay a tutto schermo creati da JS (anteprima campagna, locandina, contatti) */
:root[data-theme="light"] #mkt-anteprima-ov,
:root[data-theme="light"] #locandina-ov,
:root[data-theme="light"] #loc-anteprima-ov,
:root[data-theme="light"] #cwpp-ov { background: rgba(35, 27, 24, 0.42) !important; }
:root[data-theme="light"] #loc-upload-zone img,
:root[data-theme="light"] #loc-anteprima-ov img { background: #f8f4ed !important; }
:root[data-theme="light"] #loc-upload-zone button[onclick^="locRimuoviFile"] { background: #ffffff !important; color: #b91c1c !important; border-color: #b91c1c !important; }
:root[data-theme="light"] #loc-cap-count { color: #4d3f38 !important; }
/* "rimandati: budget giornaliero" e conteggio oltre il budget: oro chiaro */
:root[data-theme="light"] #mkt-anteprima-ov span[style*="color:#D9BC82"],
:root[data-theme="light"] #loc-anteprima-ov span[style*="color:#D9BC82"],
:root[data-theme="light"] #loc-count[style*="rgb(217"] { color: #8a5a12 !important; }

/* pulsanti primari blu con bordo var(--rosso) (= rosso pericolo nel tema chiaro) */
:root[data-theme="light"] #tab-marketing button[style*="border:1px solid var(--rosso)"],
:root[data-theme="light"] #mkt-anteprima-ov button[style*="border:1px solid var(--rosso)"],
:root[data-theme="light"] #locandina-ov button[style*="border:1px solid var(--rosso)"],
:root[data-theme="light"] #loc-anteprima-ov button[style*="border:1px solid var(--rosso)"],
:root[data-theme="light"] #locandina-ov .loc-fbtn.on { border-color: #640517 !important; }

/* ── GIOCATORI (giocatori-admin.js, overlay su #tab-radar) ─────────────── */
:root[data-theme="light"] #tab-radar { background: #faf7f2 !important; }
:root[data-theme="light"] #radar-content [style*="color:#D9BC82"],
:root[data-theme="light"] #radar-content b[style*="color:#D5B36F"] { color: #8a5a12 !important; }
:root[data-theme="light"] #radar-content button[style*="color:#6a9ade"] { color: #640517 !important; border-color: #7c001c !important; background: #ffffff !important; }
:root[data-theme="light"] #radar-content button[style*="color:#ff8090"] { color: #b91c1c !important; border-color: #b91c1c !important; background: #ffffff !important; }
:root[data-theme="light"] #radar-content button[style*="color:#D9BC82"] { border-color: #8a5a12 !important; background: #ffffff !important; }
:root[data-theme="light"] #radar-content button[style*="color:#6ee7a0"] { border-color: #157a3f !important; background: #ffffff !important; }
/* giocatore disattivato: opacity .5 su tutta la scheda; resta segnato dal
   bordo rosso e dall'etichetta "(off)" */
:root[data-theme="light"] #radar-content div[style*="solid rgba(255"] { opacity: 1 !important; border-color: #b91c1c !important; }

/* binario della barra "prossimo premio": velo bianco invisibile sul chiaro */
:root[data-theme="light"] #radar-content div[style*="height:4px;margin-top:2px"] { background: #f2eadd !important; }

/* ── SITO CLIENTI: contenuti, galleria, statistiche (landing-admin.js) ── */
:root[data-theme="light"] .landing-admin-snap {
  background: #f8f4ed !important; background-image: none !important; border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .landing-admin-snap__card { background: #ffffff !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .landing-admin-snap__card.is-ok { border-color: #157a3f !important; }
:root[data-theme="light"] .landing-admin-snap__card.is-warn { border-color: #b45309 !important; }
:root[data-theme="light"] .landing-admin-snap__card span,
:root[data-theme="light"] .landing-admin-snap__card small { color: #4d3f38 !important; }
/* sottotitolo della testata: muted su azzurro tenue resta a 5:1, ma durante la
   comparsa animata (opacity < 1) scende sotto 4.5 al telefono */
:root[data-theme="light"] .landing-admin-snap__head span { color: #4d3f38 !important; }
:root[data-theme="light"] .landing-admin-fold,
:root[data-theme="light"] .landing-stats-section { background: #ffffff !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .landing-admin-fold > summary b { color: #640517 !important; background: #f8f4ed !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .landing-admin-action-row,
:root[data-theme="light"] .landing-stats-metric,
:root[data-theme="light"] .landing-stats-list { background: #f8f4ed !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .landing-admin-action-row button,
:root[data-theme="light"] .landing-admin-add-btn {
  background: #f7eee1 !important; border-color: #7c001c !important; color: #640517 !important;
}
:root[data-theme="light"] .landing-stats-empty { border-color: #decbb2 !important; }
/* pulsanti "salva / carica" verdi scuri e "rimuovi / svuota" rossi scuri scritti inline */
:root[data-theme="light"] #lc-save-btn,
:root[data-theme="light"] #landing-config-body button[style*="background:#0c3d23"],
:root[data-theme="light"] #landing-gallery-body button[style*="background:#0c3d23"] {
  background: #157a3f !important; border-color: #0f5c30 !important; color: #ffffff !important;
}
:root[data-theme="light"] #landing-config-body button[style*="background:#3a0d0d"],
:root[data-theme="light"] #landing-gallery-body button[style*="background:#3a0d0d"] {
  background: #fde8e8 !important; border-color: #b91c1c !important; color: #b91c1c !important;
}
/* stato dell'evento: "pronto" (verde chiaro) / avvisi (ambra chiaro) */
:root[data-theme="light"] #lc-eventi-list span[style*="color:#86efac"] { background: #e6f4ea !important; border-color: #157a3f !important; color: #157a3f !important; }
:root[data-theme="light"] #lc-eventi-list span[style*="color:#fbbf24"] { background: #fff4d6 !important; border-color: #b45309 !important; color: #8a5a12 !important; }
:root[data-theme="light"] #landing-config-body [style*="color:#f99"],
:root[data-theme="light"] #landing-stats-body [style*="color:#f99"],
:root[data-theme="light"] #landing-gallery-body [style*="color:#f99"] { color: #b91c1c !important; }

/* ── STAFF ARENA (/arena, page-gamification.js) ────────────────────────── */
/* overlay che ospita l'iframe /arena: fondo #07060a inline (lampo nero al caricamento) */
:root[data-theme="light"] #gamification-overlay { background: #faf7f2 !important; }
/* colori di livello (COLORI_LVL, pastello per il fondo scuro) scritti inline
   come color: nel podio, nella classifica e nel profilo */
:root[data-theme="light"] #podio-container [style*="color:#5DCAA5"],
:root[data-theme="light"] #classifica-list [style*="color:#5DCAA5"],
:root[data-theme="light"] #profilo-content [style*="color:#5DCAA5"] { color: #157a3f !important; }
:root[data-theme="light"] #podio-container [style*="color:#85B7EB"],
:root[data-theme="light"] #classifica-list [style*="color:#85B7EB"],
:root[data-theme="light"] #profilo-content [style*="color:#85B7EB"] { color: #7c001c !important; }
:root[data-theme="light"] #podio-container [style*="color:#AFA9EC"],
:root[data-theme="light"] #classifica-list [style*="color:#AFA9EC"],
:root[data-theme="light"] #profilo-content [style*="color:#AFA9EC"] { color: #5b21b6 !important; }
:root[data-theme="light"] #podio-container [style*="color:#EF9F27"],
:root[data-theme="light"] #classifica-list [style*="color:#EF9F27"],
:root[data-theme="light"] #profilo-content [style*="color:#EF9F27"] { color: #b45309 !important; }
:root[data-theme="light"] #podio-container [style*="color:#F0997B"],
:root[data-theme="light"] #classifica-list [style*="color:#F0997B"],
:root[data-theme="light"] #profilo-content [style*="color:#F0997B"] { color: #8a5a12 !important; }
:root[data-theme="light"] #podio-container [style*="color:#ED93B1"],
:root[data-theme="light"] #classifica-list [style*="color:#ED93B1"],
:root[data-theme="light"] #profilo-content [style*="color:#ED93B1"] { color: #6d28d9 !important; }
:root[data-theme="light"] #classifica-list span[style*="color:#a78bfa"] { color: #5b21b6 !important; background: #ede9fe !important; }
/* achievement: sbloccato (viola scuro inline) e bloccato (opacity .3) */
:root[data-theme="light"] #profilo-content .badge:not(.locked) {
  background: #ede9fe !important; border-color: #6d28d9 !important; color: #5b21b6 !important;
}
:root[data-theme="light"] #profilo-content .badge.locked {
  opacity: 1 !important; background: #faf7f2 !important; border-style: dashed !important;
  border-color: #decbb2 !important; color: #76665a !important;
}

/* ── MUSICA (musica-admin.js, stile iniettato) ─────────────────────────── */
:root[data-theme="light"] #modal-musica .mp-tab.active,
:root[data-theme="light"] #modal-musica .mp-eq-preset.active { color: #ffffff !important; }
:root[data-theme="light"] #mp-status a[style*="color:#D5B36F"] { color: #8a5a12 !important; }

/* ── OWNER GATE: tastierino, esito PIN, resoconto serata, regia ────────── */
:root[data-theme="light"] #owner-gate-submit:disabled {
  opacity: 1 !important; background: #f2eadd !important; background-image: none !important;
  color: #76665a !important; border-color: #ded2c3 !important;
}
:root[data-theme="light"] .owner-gate-pin-status.is-error { color: #b91c1c !important; }
:root[data-theme="light"] .owner-gate-pin-status.is-ok { color: #0f5c30 !important; }
:root[data-theme="light"] #owner-gate-overlay .owner-report-section { background: #ffffff !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] #owner-gate-overlay .owner-report-section__head span { color: #4d3f38 !important; }
:root[data-theme="light"] #owner-gate-overlay .owner-report-table th { background: #f8f4ed !important; color: #4d3f38 !important; }
:root[data-theme="light"] #owner-gate-overlay .owner-report-badge { background: #f8f4ed !important; color: #231b18 !important; border: 1px solid #ded2c3; }
:root[data-theme="light"] #owner-gate-overlay .owner-report-badge.is-good { background: #e6f4ea !important; color: #0f5c30 !important; border-color: #157a3f; }
:root[data-theme="light"] #owner-gate-overlay .owner-report-badge.is-danger { background: #fde8e8 !important; color: #991b1b !important; border-color: #b91c1c; }
:root[data-theme="light"] #owner-gate-overlay .owner-report-kpi span,
:root[data-theme="light"] #owner-gate-overlay .owner-report-kpi small,
:root[data-theme="light"] #owner-gate-overlay .owner-gate-subtitle { color: #4d3f38 !important; }
/* Regia: azione "Recupera conti aperti" rosa chiaro su velo blu */
:root[data-theme="light"] #modal-dashboard .faro-command-next__action.is-attn { color: #500f16 !important; background: #f7eee1 !important; border-color: #7c001c !important; }
:root[data-theme="light"] #modal-dashboard .faro-command-next__action.is-good { color: #0f5c30 !important; background: #e6f4ea !important; border-color: #157a3f !important; }
:root[data-theme="light"] #modal-dashboard .faro-command-next__action { border-color: #decbb2; background: #faf7f2; }
/* ── FATTURAZIONE CLIENTE (tab-fatturazione, fatturazione-cliente.js) ─────
   faro-pro.css:82-101 scrive a mano fondi quasi neri e testi oro/pastello.
   La regola esistente di §5 rende bianche le superfici principali ma lascia
   scuri tessere tavolo, campi, pulsanti e i testi colorati: qui si completa
   la famiglia, stato per stato (bozza, XML pronto, RCH emesso, chiusa, da
   riprovare, da verificare, annullata). */
/* §5 dipinge di bianco anche i contenitori di layout (.fc-layout, .fc-actions):
   fra le colonne e sotto la colonna corta resta un blocco bianco sul fondo
   pagina, dentro il riquadro rosa di riconciliazione una fascia bianca, e in
   fondo alla configurazione il riquadro copre l'angolo arrotondato. */
:root[data-theme="light"] .fc-layout,
:root[data-theme="light"] .fc-actions,
:root[data-theme="light"] .fc-form-grid,
:root[data-theme="light"] .fc-discount,
:root[data-theme="light"] .fc-kicker { background-color: transparent !important; }
:root[data-theme="light"] .fc-hero { box-shadow: 0 10px 28px rgba(35, 27, 24, 0.08) !important; }
:root[data-theme="light"] .fc-kicker,
:root[data-theme="light"] .fc-step span { color: #8a5a12 !important; }
/* pastiglie di stato del provider */
:root[data-theme="light"] .fc-provider { background: #fff4d6 !important; border-color: #b45309 !important; color: #231b18 !important; }
:root[data-theme="light"] .fc-provider i { background: #b45309 !important; box-shadow: none !important; }
:root[data-theme="light"] .fc-provider.ready { background: #e6f4ea !important; border-color: #157a3f !important; color: #231b18 !important; }
:root[data-theme="light"] .fc-provider.ready i { background: #157a3f !important; }
:root[data-theme="light"] .fc-provider.off { background: #f8f4ed !important; border-color: #e4dcd0 !important; color: #4d3f38 !important; }
:root[data-theme="light"] .fc-provider.off i { background: #76665a !important; }
/* avvisi */
:root[data-theme="light"] .fc-alert { background: #fff4d6 !important; border-color: #b45309 !important; }
:root[data-theme="light"] .fc-alert strong { color: #8a5a12 !important; }
:root[data-theme="light"] .fc-alert span { color: #34435c !important; }
:root[data-theme="light"] .fc-alert.danger { background: #fde8e8 !important; border-color: #b91c1c !important; }
:root[data-theme="light"] .fc-alert.danger strong { color: #b91c1c !important; }
/* configurazione fiscale (details) */
:root[data-theme="light"] .fc-config > summary span { color: #231b18 !important; }
:root[data-theme="light"] .fc-config > summary small { color: #76665a !important; }
/* pulsanti di testata dei passi (Aggiorna, Nuova) */
:root[data-theme="light"] .fc-step > button {
  background: #ffffff !important; color: #231b18 !important; border-color: #e4dcd0 !important;
}
/* tessere tavolo e anagrafiche */
:root[data-theme="light"] .fc-table-card {
  background: #ffffff !important; color: #231b18 !important; border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .fc-table-card strong { color: #640517 !important; }
:root[data-theme="light"] .fc-table-card small,
:root[data-theme="light"] .fc-client-card small,
:root[data-theme="light"] .fc-client-card span { color: #76665a !important; }
:root[data-theme="light"] .fc-table-card em { background: #fff4d6 !important; color: #8a5a12 !important; }
:root[data-theme="light"] .fc-table-card.selected,
:root[data-theme="light"] .fc-client-card.selected {
  background: #f7eee1 !important; border-color: #8a1828 !important; box-shadow: 0 0 0 2px rgba(138, 24, 40, 0.2) !important;
}
/* campi: fatturazione-cliente.js crea gli input senza type, quindi la regola
   generica sui campi non li raggiunge */
:root[data-theme="light"] .fc-shell input,
:root[data-theme="light"] .fc-shell textarea {
  background: #f8f4ed !important; color: #231b18 !important; border: 1px solid #e4dcd0 !important;
}
:root[data-theme="light"] .fc-shell input::placeholder,
:root[data-theme="light"] .fc-shell textarea::placeholder { color: #76665a !important; }
:root[data-theme="light"] .fc-shell input:focus,
:root[data-theme="light"] .fc-shell textarea:focus { border-color: #8a1828 !important; background: #ffffff !important; }
:root[data-theme="light"] .fc-form-grid label,
:root[data-theme="light"] .fc-discount label,
:root[data-theme="light"] .fc-split label { color: #4d3f38 !important; }
/* pulsanti */
:root[data-theme="light"] .fc-btn.primary {
  background: #7c001c !important; background-image: none !important; border-color: #7c001c !important; color: #ffffff !important;
}
:root[data-theme="light"] .fc-btn.secondary {
  background: #ffffff !important; background-image: none !important; border-color: #e4dcd0 !important; color: #231b18 !important;
}
:root[data-theme="light"] .fc-btn.danger {
  background: #fde8e8 !important; background-image: none !important; border-color: #b91c1c !important; color: #b91c1c !important;
}
:root[data-theme="light"] .fc-status { color: #4d3f38 !important; }
:root[data-theme="light"] .fc-status.ok { color: #157a3f !important; }
:root[data-theme="light"] .fc-status.error { color: #b91c1c !important; }
:root[data-theme="light"] .fc-done { color: #157a3f !important; }
:root[data-theme="light"] .fc-danger { color: #b91c1c !important; }
/* archivio documenti: righe e stato come pastiglia tenue */
:root[data-theme="light"] .fc-draft-row.selected { background: #f7eee1 !important; border-color: #8a1828 !important; }
:root[data-theme="light"] .fc-draft-list small { color: #76665a !important; }
:root[data-theme="light"] .fc-draft-row > .fc-state {
  justify-self: start; padding: 2px 6px; border-radius: 999px; border: 1px solid currentColor;
  background: #fff4d6 !important; color: #8a5a12 !important;
}
:root[data-theme="light"] .fc-draft-row > .fc-state.non_avviata,
:root[data-theme="light"] .fc-draft-row > .fc-state.annullata { background: #f8f4ed !important; color: #4d3f38 !important; }
:root[data-theme="light"] .fc-draft-row > .fc-state.preparata { background: #f7eee1 !important; color: #7c001c !important; }
:root[data-theme="light"] .fc-draft-row > .fc-state.chiusa { background: #e6f4ea !important; color: #157a3f !important; }
:root[data-theme="light"] .fc-draft-row > .fc-state.errore_retry { background: #fff4d6 !important; color: #b45309 !important; }
:root[data-theme="light"] .fc-draft-row > .fc-state.errore_ambiguo { background: #fde8e8 !important; color: #b91c1c !important; }
/* riepilogo, pagamento, sconto, quote */
:root[data-theme="light"] .fc-summary > div { background: #f8f4ed !important; border-color: #e4dcd0 !important; }
:root[data-theme="light"] .fc-summary span,
:root[data-theme="light"] .fc-xml-info span { color: #5a6a84 !important; }
:root[data-theme="light"] .fc-summary strong { color: #231b18 !important; }
:root[data-theme="light"] .fc-payment-methods button {
  background: #ffffff !important; color: #231b18 !important; border-color: #e4dcd0 !important;
}
:root[data-theme="light"] .fc-payment-methods button.selected {
  background: #7c001c !important; color: #ffffff !important; border-color: #7c001c !important;
}
:root[data-theme="light"] .fc-discount small { color: #4d3f38 !important; }
:root[data-theme="light"] .fc-discount strong { color: #640517 !important; }
:root[data-theme="light"] .fc-split small { color: #76665a !important; }
:root[data-theme="light"] .fc-payment-note { color: #8a5a12 !important; }
/* file XML generato */
:root[data-theme="light"] .fc-xml-info { background: #e6f4ea !important; border-color: #157a3f !important; }
:root[data-theme="light"] .fc-xml-info strong { color: #0f1b2d !important; }
:root[data-theme="light"] .fc-xml-info small { color: #34435c !important; }
/* dettaglio congelato del documento */
:root[data-theme="light"] .fc-document-detail > summary { color: #640517 !important; }
:root[data-theme="light"] .fc-document-detail > p { color: #4d3f38 !important; }
:root[data-theme="light"] .fc-document-rows { border-top-color: #e4dcd0 !important; }
:root[data-theme="light"] .fc-document-rows > div { border-bottom-color: #f2eadd !important; }
:root[data-theme="light"] .fc-document-rows small { color: #76665a !important; }
:root[data-theme="light"] .fc-document-rows strong { color: #640517 !important; }
/* risoluzione amministrativa (bozza da verificare) */
:root[data-theme="light"] .fc-reconcile { background: #fde8e8 !important; border-color: #b91c1c !important; }
:root[data-theme="light"] .fc-reconcile > strong { color: #b91c1c !important; }
:root[data-theme="light"] .fc-reconcile > p { color: #4d3f38 !important; }
:root[data-theme="light"] .fc-reconcile input { background: #ffffff !important; border-color: #b91c1c !important; }
:root[data-theme="light"] .fc-reconcile .fc-btn.danger { background: #ffffff !important; }
/* ── REVISIONE: stati che il primo giro non raggiungeva ─────────────────── */
/* Team in sola lettura (responsabile con p_staff_gestione ma non admin): il
   pulsante del codice e il campo password arrivano spenti con opacity .55
   inline. Restano riconoscibili come non disponibili dal fondo e dal colore
   tenui, senza velatura che li rende illeggibili. */
:root[data-theme="light"] #lista-camerieri button[style*="background:#211B20"]:disabled {
  opacity: 1 !important; background: #f8f4ed !important; color: #76665a !important; border-color: #ded2c3 !important;
}
:root[data-theme="light"] #cam-edit-pass:disabled {
  opacity: 1 !important; background: #f8f4ed !important; border-color: #ded2c3 !important; cursor: not-allowed;
}

/* Sito clienti: esiti dei caricamenti scritti con el.style.color. Il token
   --bordeaux-200 vale #bcd0ec (azzurro chiaro) in entrambi i temi: sul bianco
   l'errore spariva. L'avviso "ZIP troppo grande" usa #fbbf24, che il browser
   serializza in rgb() e quindi sfugge alla regola globale color:#fbbf24. */
:root[data-theme="light"] #lc-gallery-msg[style*="bordeaux-200"],
:root[data-theme="light"] #lc-eventi-list small[style*="bordeaux-200"] { color: #b91c1c !important; }
:root[data-theme="light"] #lc-gallery-msg[style*="rgb(251"] { color: #b45309 !important; }
/* galleria oltre 24 foto: freccia della pagina non disponibile (opacity .4 inline) */
:root[data-theme="light"] #landing-gallery-body button[disabled] {
  opacity: 1 !important; background: #f8f4ed !important; color: #76665a !important; border-color: #e4dcd0 !important;
}

/* Giocatori, profilo dettagliato: "spesa stimata" oro #D5B36F anche fuori
   dai <b>; premi non ancora raggiunti velati a opacity .4 inline. */
:root[data-theme="light"] #radar-content div[style*="color:#D5B36F"] { color: #8a5a12 !important; }
:root[data-theme="light"] #radar-content div[style*="opacity:.4"] { opacity: 1 !important; border: 1px dashed #ded2c3; }

/* Owner gate: messaggi d'attesa (verifica del PIN, caricamento di resoconto e
   regia) in grigio rosato #a99fa3 / #b9adb0, e tasti spenti durante la
   verifica (opacity .45). Esito errato/ok restano quelli di .is-error/.is-ok. */
:root[data-theme="light"] #owner-gate-overlay .owner-gate-loading { color: #4d3f38 !important; }
:root[data-theme="light"] .owner-gate-pin-status { color: #4d3f38 !important; }
:root[data-theme="light"] #owner-gate-overlay .owner-gate-key:disabled {
  opacity: 1 !important; background: #f8f4ed !important; color: #76665a !important;
}
/* Locandina, elenco destinatari: la regola generica label (maiuscoletto
   grigio) spegne anche i nomi dei clienti; al telefono, scorrendo l'elenco,
   il nome sulla riga di separazione scende a 4.1. I nomi tornano testo pieno,
   il telefono resta grigio (color inline). */
:root[data-theme="light"] #loc-lista label { color: #231b18 !important; }
/* ═══ §AREA gestione-team-marketing — FINE ═══ */

/* ═══ §AREA cucina-haccp — INIZIO ═══ */
/* Pagine /cucina (KDS, page-cucina.css) e /haccp (stili inline in haccp.html).
   Tutti i selettori sono sotto :root[data-theme="light"]: il tema scuro non cambia.
   Misure: audit Playwright con fondo letto dai pixel, KDS con eta' del seed. */

/* ── KDS · note dei piatti ────────────────────────────────────────────────
   page-cucina.css (bacheca TV/tablet) scrive le note in #ffd66b, giallo
   pensato per il fondo nero: sul chiaro 1.3:1, cioe' allergie e varianti
   invisibili. Diventano oro brunito, leggibile anche sui gruppi in attesa. */
:root[data-theme="light"] #kds-grid .item-nota,
:root[data-theme="light"] #kds-grid .portata-group.is-waiting-via .item-nota {
  color: #8a5a12 !important;
}

/* ── KDS · uscite trattenute (ATTESA VIA) ─────────────────────────────────
   Il fondo era un grigio medio (color-mix con #17191e) e il badge #c7c9cf su
   grigio (1.3:1). Ora superficie azzurra piu' carica + filetto ardesia. */
:root[data-theme="light"] #kds-grid .portata-group.is-waiting-via {
  background: #f2eadd !important;
  border-color: #dcd1c3 !important;
  border-left-color: #76665a !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #kds-grid .portata-flow-badge {
  background: #ffffff !important;
  border-color: #76665a !important;
  color: #4d3f38 !important;
}
/* spunta disabilitata (uscita in attesa o salvataggio in corso): grigio
   pieno invece dell'opacita' .45 che la rendeva un fantasma */
:root[data-theme="light"] #kds-grid .item-done-btn:disabled { opacity: 1 !important; }
:root[data-theme="light"] #kds-grid .portata-group.is-waiting-via .item-done-btn,
:root[data-theme="light"] #kds-grid .item-done-btn:disabled {
  color: #76665a !important;
  border-color: #dcd1c3 !important;
}
:root[data-theme="light"][data-kds-view="tv"] #kds-grid .item-done-btn:disabled > span,
:root[data-theme="light"][data-kds-view="tv"] #kds-grid .portata-group.is-waiting-via .item-done-btn > span {
  background: #ffffff !important;
  border-color: #9c8b7d !important;
  color: #76665a !important;
}
/* spunta attiva della riga (bacheca TV): verde piu' scuro sul verde tenue */
:root[data-theme="light"][data-kds-view="tv"] #kds-grid .portata-items .item-done-btn:not(:disabled) > span {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  color: #0f5c30 !important;
}
/* salvataggio in corso: niente velatura al 60% sul testo (timer e ATTESA
   scendevano a 2.4:1), il bordo tratteggiato dice "sto salvando" */
:root[data-theme="light"] #kds-grid .portata-group.is-pending,
:root[data-theme="light"] #kds-grid .comanda-card.is-pending { opacity: 1 !important; }
:root[data-theme="light"] #kds-grid .portata-group.is-pending { border-style: dashed !important; }
:root[data-theme="light"] #kds-grid .portata-ready:disabled {
  opacity: 1 !important;
  background: #ffffff !important;
  border-color: #9c8b7d !important;
  color: #76665a !important;
}
:root[data-theme="light"] #kds-grid .portata-items .item-row.is-item-pending { background: #e6f4ea !important; }

/* ── KDS · etichette reparto nella vista TUTTO ───────────────────────────
   .rep-cucina era #ffaa60 su marrone #3a1808, .rep-bar ottone #F0D79C. */
:root[data-theme="light"] #kds-grid .item-rep.rep-cucina {
  background: #fff4d6 !important;
  color: #7a4f10 !important;
  border: 1px solid #b45309 !important;
}
:root[data-theme="light"] #kds-grid .item-rep.rep-sala,
:root[data-theme="light"] #kds-grid .item-rep.rep-bar {
  background: #f7eee1 !important;
  color: #500f16 !important;
  border: 1px solid #7c001c !important;
}

/* ── KDS · pulsanti VIA / CONFERMA / annulla ─────────────────────────────
   Erano pieni scuri (#5d3500, #075a32, #272a31) con testo chiaro. */
:root[data-theme="light"] #kds-grid .portata-via {
  background: #8a5a12 !important;
  border-color: #7a4f10 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #kds-grid .portata-via:hover { background: #7a4f10 !important; }
:root[data-theme="light"] #kds-grid .portata-via.is-checking,
:root[data-theme="light"] #kds-grid .portata-via.is-sending { opacity: 1 !important; }
:root[data-theme="light"] #kds-grid .portata-via.is-sending {
  background: #157a3f !important;
  border-color: #0f5c30 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #kds-grid .portata-via-confirm {
  background: #157a3f !important;
  border-color: #0f5c30 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] #kds-grid .portata-via-confirm:hover { background: #0f5c30 !important; }
:root[data-theme="light"] #kds-grid .portata-via-cancel {
  background: #ffffff !important;
  border-color: #76665a !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #kds-grid .portata-via-cancel:hover { background: #f8f4ed !important; }
:root[data-theme="light"] #kds-grid .portata-via:focus-visible,
:root[data-theme="light"] #kds-grid .portata-via-confirm:focus-visible,
:root[data-theme="light"] #kds-grid .portata-via-cancel:focus-visible { outline-color: #7c001c !important; }

/* ── KDS · testata: audio attivo, schermo intero, lampeggio ritardo ─────── */
:root[data-theme="light"] #kds-header .kds-audio-btn.is-on,
:root[data-theme="light"] #kds-header .kds-fullscreen-btn[aria-pressed="true"] {
  background: #e6f4ea !important;
  border-color: #157a3f !important;
  color: #0f5c30 !important;
}
:root[data-theme="light"] #kds-header .kds-audio-btn.needs-unlock {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #7a4f10 !important;
}
/* il lampeggio "ritardo rosso" dipingeva la testata di #21070b (quasi nero):
   schede e pulsanti scuri su fondo scuro. Ora rosso tenue + filetto pieno. */
:root[data-theme="light"] #kds-header.kds-alert-rosso {
  background: #fde8e8 !important;
  border-bottom-color: #b91c1c !important;
}
:root[data-theme="light"] #kds-header.kds-alert-giallo { border-bottom-color: #b45309 !important; }
:root[data-theme="light"] #kds-header.kds-alert-arrivo { border-bottom-color: #157a3f !important; }
:root[data-theme="light"] #kds-header .kds-tab.bar.active { color: #7c001c !important; border-color: #7c001c !important; }

/* ── KDS · stato vuoto: la spunta era al 30% (1.5:1) ──────────────────── */
:root[data-theme="light"] #kds-grid .empty-state .empty-icon { opacity: 1 !important; color: #157a3f !important; }
:root[data-theme="light"] #kds-grid .empty-state .empty-msg { color: #4d3f38 !important; }

/* ── KDS · report ritardi ─────────────────────────────────────────────── */
:root[data-theme="light"] #kds-report-modal .kds-modal__backdrop { background: rgba(35, 27, 24, 0.42) !important; }
/* data e reparto: color-scheme dark rendeva bianche le icone native */
:root[data-theme="light"] #kds-report-modal .kds-report__toolbar input,
:root[data-theme="light"] #kds-report-modal .kds-report__toolbar select { color-scheme: light !important; }
/* Esporta CSV / Stampa disabilitati (in caricamento o dopo un errore) */
:root[data-theme="light"] #kds-report-modal .faro-btn:disabled {
  opacity: 1 !important;
  color: #76665a !important;
  border-color: #e4dcd0 !important;
}
:root[data-theme="light"] #kds-report-modal .kds-kpi.is-verde { border-color: #157a3f !important; }
:root[data-theme="light"] #kds-report-modal .kds-kpi.is-giallo { border-color: #b45309 !important; }
:root[data-theme="light"] #kds-report-modal .kds-kpi.is-rosso { border-color: #b91c1c !important; }
:root[data-theme="light"] #kds-report-modal .report-level.verde,
:root[data-theme="light"] #kds-report-modal .report-status.completata { background: #e6f4ea !important; color: #0f5c30 !important; }
:root[data-theme="light"] #kds-report-modal .report-level.giallo,
:root[data-theme="light"] #kds-report-modal .report-status.attesa { background: #fff4d6 !important; color: #7a4f10 !important; }
:root[data-theme="light"] #kds-report-modal .report-level.rosso,
:root[data-theme="light"] #kds-report-modal .report-level.non_evasa,
:root[data-theme="light"] #kds-report-modal .report-status.non_evasa { background: #fde8e8 !important; color: #b91c1c !important; }

/* ═══ HACCP (/haccp) ═════════════════════════════════════════════════════ */

/* Titolo "HACCP": bundle.css lo scrive in gradiente crema→ottone ritagliato
   sul testo (quasi bianco sul chiaro); logo PNG crema invisibile. */
:root[data-theme="light"] body:has(#tab-dash) .header h1 {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: #231b18 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] body:has(#tab-dash) .header h1 img {
  filter: brightness(0) saturate(100%) invert(14%) sepia(93%)
          saturate(3200%) hue-rotate(332deg) brightness(0.55) contrast(1.1) !important;
}

/* Pulsanti primari "Avanti →": gradiente ottone con testo #2A1C08 (2.4:1) */
:root[data-theme="light"] body:has(#tab-dash) .btn-primary {
  background: #7c001c !important;
  color: #ffffff !important;
  border: 1px solid #7c001c !important;
  box-shadow: none !important;
}
:root[data-theme="light"] body:has(#tab-dash) .btn-primary:hover { background: #640517 !important; }
/* "Salva" formazione: oro #c9a24a fuori palette → primario */
:root[data-theme="light"] #tab-formazione button[onclick^="salvaFormazione"] {
  background: #7c001c !important;
  border-color: #7c001c !important;
  color: #ffffff !important;
}

/* Overlay delle modali (smaltimento, scheda ASL, modifica): nero .6-.92 */
:root[data-theme="light"] #smaltModal,
:root[data-theme="light"] #modal-scheda-asl,
:root[data-theme="light"] #modal-edit-prep { background: rgba(35, 27, 24, 0.42) !important; }

/* Dashboard: "✓ Smaltita" pastello fuori palette, "✓ Conferma" nero su verde */
:root[data-theme="light"] #dash-scadute-section button[onclick^="smaltisciPreparazione"],
:root[data-theme="light"] #smaltModal button[onclick^="confermaSmaltimento"] {
  background: #157a3f !important;
  color: #ffffff !important;
  border: 1px solid #0f5c30 !important;
  box-shadow: none !important;
}
/* Semaforo compliance: fondo = colore acceso al 10% → fondi tenui di stato */
:root[data-theme="light"] #dash-compliance > div[style*="#f87171" i] { background: #fde8e8 !important; border-color: #b91c1c !important; }
:root[data-theme="light"] #dash-compliance > div[style*="#fbbf24" i] { background: #fff4d6 !important; border-color: #b45309 !important; }
:root[data-theme="light"] #dash-compliance > div[style*="#fbbf24" i] > div:first-child { color: #7a4f10 !important; }
:root[data-theme="light"] #dash-compliance > div[style*="#4ade80" i] { background: #e6f4ea !important; border-color: #157a3f !important; }

/* Banner "⏳ Da registrare oggi / Da fare / attestati scaduti": giallo 12% */
:root[data-theme="light"] #temp-punti > div[style*="rgba(251" i],
:root[data-theme="light"] #pul-aree > div[style*="rgba(251" i],
:root[data-theme="light"] #form-lista > div[style*="rgba(251" i] {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #7a4f10 !important;
}

/* Archivio: quattro pulsanti con fondi scuri inline (#1a2a3a, #3a1a20,
   #2a1a3a, #1a3a20). La regola §11 su color:#6ee7a0 scuriva il testo di
   "Ristampa" lasciando il fondo verde scuro: 1.55:1. */
:root[data-theme="light"] #arch-list button[onclick^="apriModalEditPrep"] {
  background: #f7eee1 !important; border-color: #7c001c !important; color: #7c001c !important;
}
:root[data-theme="light"] #arch-list button[onclick^="eliminaPrep"] {
  background: #fde8e8 !important; border-color: #b91c1c !important; color: #b91c1c !important;
}
:root[data-theme="light"] #arch-list button[onclick^="mostraSchedaAsl"] {
  background: #ede9fe !important; border-color: #6d28d9 !important; color: #5b21b6 !important;
}
:root[data-theme="light"] #arch-list button[onclick^="ristampaEtichetta"] {
  background: #e6f4ea !important; border-color: #157a3f !important; color: #0f5c30 !important;
}

/* Modale modifica: "+ Lotto manuale" #90b0e0 su azzurro (2.0:1). Con la pagina di
   Faro (HACCP_FARO_PORTING 12/10/2026) il pulsante apre il modulo: apriLottoManuale. */
:root[data-theme="light"] #modal-edit-prep button[onclick^="apriLottoManuale"] {
  background: #f7eee1 !important; border-color: #7c001c !important; color: #7c001c !important;
}
/* Scheda ASL: allergeni #d97706 su bianco (3.2:1), stampa verde bosco */
:root[data-theme="light"] #scheda-asl-content [style*="#d97706" i] { color: #b45309 !important; }
:root[data-theme="light"] #modal-scheda-asl .btn-stampa {
  background: #157a3f !important; border-color: #0f5c30 !important; color: #ffffff !important;
}

/* Righe di pulsanti in flex dove un .btn senza flex resta width:100% e
   schiaccia il vicino a pochi pixel: "✓ Conferma" (smaltimento) e
   "💾 Salva template" (con "Elimina" visibile) finivano col testo bianco
   fuori dal bottone, sul fondo chiaro = invisibile. */
:root[data-theme="light"] #smaltModal button[onclick^="chiudiSmaltimento"],
:root[data-theme="light"] #bar-edit-elimina-btn {
  width: auto !important;
  flex: 0 0 auto !important;
}
/* Bar: "🗑 Elimina" rosso su rosa 15% (4.2:1) */
:root[data-theme="light"] #bar-edit-elimina-btn {
  background: #fde8e8 !important; border-color: #b91c1c !important; color: #b91c1c !important;
}
/* Stampante etichetta attiva: verde su verde 20% (4.2:1) */
:root[data-theme="light"] #label-printer-options .printer-btn.active {
  background: #e6f4ea !important; border-color: #157a3f !important; color: #0f5c30 !important;
}
/* Scheda ASL senza ingredienti: "Nessun ingrediente registrato per questa
   preparazione." e' scritto inline in #999 sul bianco della scheda (2.85:1).
   Diventa testo terziario della palette (5.4:1), corsivo invariato. */
:root[data-theme="light"] #scheda-asl-content [style*="color:#999" i] { color: #76665a !important; }
/* Bar, preparazione da template a 390px: il campo "Volume (ml)" ha flex:1
   ma la larghezza minima nativa dell'input, quindi "≈ 10 drink da 100ml"
   viene schiacciato a una lettera per riga e spinto 28px fuori schermo
   (pagina con scroll orizzontale). Il campo puo' restringersi, la stima
   resta su una riga. Stesso difetto nel tema scuro (layout inline). */
:root[data-theme="light"] #bar-volume { min-width: 0 !important; }
:root[data-theme="light"] #bar-volume + span { flex: 0 0 auto !important; white-space: nowrap !important; }
/* Bar, modifica/nuovo template a 390px. (1) Le righe ingrediente hanno il
   nome con la larghezza minima nativa dell'input: la "✕" esce dalla card e
   15px fuori schermo. (2) Con "🗑 Elimina" visibile, "Annulla" e
   "💾 Salva template" hanno .btn width:100% e si restringono alla pari:
   il testo bianco di "Salva template" esce dal verde e resta tagliato sul
   fondo chiaro. Ora i pulsanti hanno la larghezza del testo e, se non
   stanno su una riga, "Salva template" va a capo a tutta larghezza. */
:root[data-theme="light"] #tab-bar .bar-ing-row input[data-ing-nome] { min-width: 0 !important; }
:root[data-theme="light"] #tab-bar div:has(> #bar-edit-elimina-btn) { flex-wrap: wrap !important; }
:root[data-theme="light"] #tab-bar div:has(> #bar-edit-elimina-btn) > .btn { width: auto !important; white-space: nowrap !important; }
:root[data-theme="light"] #tab-bar div:has(> #bar-edit-elimina-btn) > .btn-green { flex: 2 1 auto !important; }
/* HACCP di Faro (foto dei lotti v120, consegne e attesa fattura v121): colori di
   classe pensati per il fondo scuro, illeggibili sul bianco (1,5-2,8:1). */
:root[data-theme="light"] .consegna-opz.attesa { color: #7a4f10 !important; }
:root[data-theme="light"] .attesa-riga.vecchio .det { color: #b91c1c !important; }
:root[data-theme="light"] .foto-riprova { background: #fff4d6 !important; border-color: #b45309 !important; color: #7a4f10 !important; }
:root[data-theme="light"] .foto-riuso.on { background: #e6f4ea !important; border-color: #157a3f !important; color: #0f5c30 !important; }
:root[data-theme="light"] #modal-collega { background: rgba(35, 27, 24, 0.42) !important; }
/* ═══ §AREA cucina-haccp — FINE ═══ */

/* ═══ §AREA direzione-report-altre — INIZIO ═══ */
/* Pagina /direzione (tab Andamento, Giorno, Prodotti, P&L, Personale, Costi
   fissi, Spese, Sistema), /costi.html e /report.html standalone, /account
   (area cliente), /arena (Staff Arena), /builder.html.
   Ogni regola e' limitata alla sua pagina con body:has(...) o :root:has(...):
   #pl-hero = Direzione + Costi standalone, #dir-toolbar = solo Direzione,
   #tab-analisi = solo Costi standalone, aside.sb = Report standalone,
   #view-dashboard = Account, #view-classifica = Arena,
   header.app-header = Builder. */

/* ── Token di bundle.css non ribaltati sulle pagine che non caricano
      page-direzione.css (Costi e Report standalone, Account, Arena).
      Stessi valori del blocco chiaro di page-direzione.css. ── */
:root[data-theme="light"]:has(#tab-analisi),
:root[data-theme="light"]:has(aside.sb),
:root[data-theme="light"]:has(#view-dashboard),
:root[data-theme="light"]:has(#view-classifica) {
  --text-tertiary: #76665a;
  --accento-oro: #640517;
  --brass-400: #8a5a12;
  --bordeaux-300: #7c001c;
  --success-500: #157a3f;
  --danger-light: #b91c1c;
  --bg-canvas: #faf7f2;
  --bg-surface: #ffffff;
  --bg-elevated: #f8f4ed;
  --bg-sunken: #f8f4ed;
}
/* Alias di pagina di page-costi.css / page-report.css (puntano a token oro
   o pastello del tema scuro). */
:root[data-theme="light"]:has(#tab-analisi),
:root[data-theme="light"]:has(aside.sb) {
  --blue: #7c001c;
  --purple: #6d28d9;
  --yellow: #8a5a12;
  --gold: #8a5a12;
  --orange: #b45309;
  --green: #157a3f;
  --red: #b91c1c;
  --muted: #76665a;
  --warning: #b45309;
  --success: #157a3f;
  --danger: #b91c1c;
}

/* ═══ DIREZIONE + COSTI — pulsanti ═══════════════════════════════════════ */
/* bundle.css:4018 dipinge .btn-primary con il gradient oro premium e testo
   quasi nero (!important): su oro brunito il contrasto e' 2.4:1. */
:root[data-theme="light"] body:has(#pl-hero) .btn-primary {
  background: #7c001c !important;
  background-image: none !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(124, 0, 28, 0.22) !important;
}
:root[data-theme="light"] body:has(#pl-hero) .btn-primary:hover {
  background: #640517 !important;
  filter: none !important;
}
/* Costi standalone: .btn-danger di page-costi.css e' pieno rosso con testo
   bianco, ma il bundle lo rende trasparente con testo rosa #f87171. */
:root[data-theme="light"] body:has(#tab-analisi) .btn-danger {
  background: #ffffff !important;
  border: 1px solid #b91c1c !important;
  color: #b91c1c !important;
}
/* Costi standalone: titolo "COSTI & P&L" con testo a gradiente oro del bundle */
:root[data-theme="light"] body:has(#tab-analisi) .header h1,
:root[data-theme="light"] body:has(#tab-analisi) .header h1 span {
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  color: #231b18 !important;
}
:root[data-theme="light"] body:has(#tab-analisi) .header h1 span { color: #640517 !important; }

/* ═══ P&L ════════════════════════════════════════════════════════════════ */
/* Waterfall: importi positivi con #6a8fd8 inline (page-costi.js) = 3.2:1 */
:root[data-theme="light"] body:has(#pl-hero) .wf-val[style*="#6a8fd8" i] { color: #640517 !important; }
/* Pillola margine: fondo verde traslucido sopra il gradient della hero
   (#dce9e6) portava il verde a 4.3:1. Fondo tenuto pieno. */
:root[data-theme="light"] body:has(#pl-hero) .hero-margin.pos {
  background: #e6f4ea !important;
  color: #157a3f !important;
  box-shadow: inset 0 0 0 1px rgba(21, 122, 63, 0.35);
}
:root[data-theme="light"] body:has(#pl-hero) .hero-margin.neg {
  background: #fde8e8 !important;
  color: #b91c1c !important;
  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.35);
}
/* Stato ROSSO (food cost > 35%, prime cost > 65%, "Da pagare", utile
   negativo): page-direzione.css e page-costi.css lo dipingono con
   --rosso-scuro / --rosso-primario / --bord2, cioe' il rosso del brand, che
   il tema chiaro ribalta sul blu primario. Risultato: 39% di food cost
   mostrato blu come i ricavi, indistinguibile da un valore buono.
   Nel tema chiaro lo stato rosso torna rosso pericolo. */
:root[data-theme="light"] body:has(#pl-hero) .kpi.red .kpi-value { color: #b91c1c !important; }
:root[data-theme="light"] body:has(#pl-hero) .kpi.red::after { background: #b91c1c !important; }
:root[data-theme="light"] body:has(#pl-hero) .kpi-target-fill[style*="--bord2"] { background: #b91c1c !important; }
:root[data-theme="light"] body:has(#pl-hero) .hero-card.negative::before {
  background: linear-gradient(90deg, transparent, #b91c1c, transparent) !important;
}
:root[data-theme="light"] body:has(#pl-hero) .badge-red {
  background: #fde8e8 !important;
  color: #b91c1c !important;
  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.45);
}
:root[data-theme="light"] body:has(#pl-hero) .text-red { color: #b91c1c !important; }
/* Waterfall: "= Utile Netto" negativo scritto con var(--bord2) inline */
:root[data-theme="light"] body:has(#pl-hero) .wf-val[style*="--bord2"] { color: #b91c1c !important; }
/* Costi del mese: il pulsante "segna pagato" (💳) e' un .btn-danger con
   background:var(--verde) inline, ma il bundle forza .btn-danger trasparente
   con bordo rosso: nel tema chiaro era identico al cestino accanto. */
:root[data-theme="light"] body:has(#pl-hero) .btn-danger[style*="--verde"] {
  background: #e6f4ea !important;
  border: 1px solid #157a3f !important;
  color: #157a3f !important;
}
/* Telefono: i KPI in JetBrains Mono a --fs-2xl non stanno nelle card a due
   colonne e le cifre vengono tagliate ("37.784,0"). Corpo ridotto e a capo
   consentito (stesso difetto nel tema scuro: va portato in page-direzione.css
   e page-costi.css). */
@media (max-width: 520px) {
  :root[data-theme="light"] body:has(#pl-hero) .kpi-value {
    font-size: clamp(1.15rem, 5.4vw, 1.6rem) !important;
    overflow-wrap: anywhere;
  }
}
/* Messaggio d'errore dentro le tab (mostraErroreTab): var(--bord2) nel tema
   chiaro e' il blu primario, l'errore deve essere rosso. */
:root[data-theme="light"] body:has(#pl-hero) .empty-state[style*="--bord2"] { color: #b91c1c !important; }
/* Costi standalone: barra "Costi" del confronto (page-costi.css la dipinge
   con il rosso-brand, che nel tema chiaro e' blu come i ricavi). */
:root[data-theme="light"] body:has(#tab-analisi) .compare-bar.ricavi { background: linear-gradient(90deg, #640517, #8a1828) !important; color: #ffffff !important; }
:root[data-theme="light"] body:has(#tab-analisi) .compare-bar.costi { background: linear-gradient(90deg, #b91c1c, #dc2626) !important; color: #ffffff !important; }

/* ═══ REPORT (tab Andamento/Giorno/Prodotti di Direzione + report.html) ═══ */
/* Documento stornato: la riga e' a opacity .55 inline (page-report.js), che
   porta ogni colore sotto 3:1. Si tiene barrata, a piena opacita', in grigio;
   l'etichetta "STORNATO" resta rossa. */
:root[data-theme="light"] #mc-giorno tr[style*="line-through"],
:root[data-theme="light"] #mc tr[style*="line-through"] { opacity: 1 !important; }
:root[data-theme="light"] #mc-giorno tr[style*="line-through"] > td,
:root[data-theme="light"] #mc tr[style*="line-through"] > td { color: #76665a !important; }
:root[data-theme="light"] #mc-giorno tr[style*="line-through"] span[style*="--red"],
:root[data-theme="light"] #mc tr[style*="line-through"] span[style*="--red"] { color: #b91c1c !important; }

/* Heatmap ora x giorno: fondo bordeaux con alfa variabile inline
   (rgba(143,20,39,.15..1)). page-direzione.css:1242 mette testo scuro su
   tutte le celle: sulle celle intense scende a 1.9:1. Soglie calcolate:
   testo scuro fino ad alfa .6 (>= 4.8:1), bianco da .7 (>= 4.6:1); la
   fascia .6x viene fissata ad alfa .6 (a .65-.69 nessun colore arriva a 4.5). */
:root[data-theme="light"] .hm-cell[style*="rgba(143,20,39,0.6"] {
  background: rgba(143, 20, 39, 0.6) !important;
  color: #231b18 !important;
}
:root[data-theme="light"] .hm-cell[style*="rgba(143,20,39,0.7"],
:root[data-theme="light"] .hm-cell[style*="rgba(143,20,39,0.8"],
:root[data-theme="light"] .hm-cell[style*="rgba(143,20,39,0.9"],
:root[data-theme="light"] .hm-cell[style*="rgba(143,20,39,1)"] { color: #ffffff !important; }
/* celle senza vendite: velo bianco al 6% invisibile sul bianco */
:root[data-theme="light"] .hm-cell[style*="rgba(255,255,255,.06)"] { background: #f8f4ed !important; }
/* report.html non carica page-direzione.css: stesse regole per le celle
   deboli (testo bianco al 50%) */
:root[data-theme="light"] body:has(aside.sb) .hm-cell { color: #231b18; }

/* ═══ SISTEMA — stato operativo ═════════════════════════════════════════ */
/* Le schede OK/attenzione differivano solo per un bordo al 35%: nel tema
   chiaro diventano superfici di stato (fondo tenue + bordo pieno). */
:root[data-theme="light"] .ops-snap__card.is-ok { background: #e6f4ea !important; border-color: #157a3f !important; }
:root[data-theme="light"] .ops-snap__card.is-warn { background: #fff4d6 !important; border-color: #b45309 !important; }
:root[data-theme="light"] .ops-snap__card span,
:root[data-theme="light"] .ops-snap__card small { color: #4d3f38 !important; }
:root[data-theme="light"] .ops-badge--ok { background: #e6f4ea !important; color: #157a3f !important; box-shadow: inset 0 0 0 1px #157a3f; }
:root[data-theme="light"] .ops-badge--warn { background: #fff4d6 !important; color: #b45309 !important; box-shadow: inset 0 0 0 1px #b45309; }
:root[data-theme="light"] .ops-badge--ko { background: #fde8e8 !important; color: #b91c1c !important; box-shadow: inset 0 0 0 1px #b91c1c; }
:root[data-theme="light"] #ops-content .loading[style*="--danger"] { color: #b91c1c !important; }

/* ═══ REPORT STANDALONE (report.html) ═══════════════════════════════════ */
/* Logo bianco con mix-blend-mode:screen: sul chiaro sparisce del tutto. */
:root[data-theme="light"] body:has(aside.sb) .sb-logo {
  mix-blend-mode: normal !important;
  filter: brightness(0) !important;
  opacity: 0.85;
}
/* Etichette reparto/ABC: fondi quasi neri hardcoded in page-report.css */
:root[data-theme="light"] body:has(aside.sb) .tag-cucina { background: #f7eee1 !important; color: #640517 !important; border-color: #7c001c !important; }
:root[data-theme="light"] body:has(aside.sb) .tag-sala,
:root[data-theme="light"] body:has(aside.sb) .tag-b { background: #fff4d6 !important; color: #8a5a12 !important; border-color: #8a5a12 !important; }
:root[data-theme="light"] body:has(aside.sb) .tag-a { background: #e6f4ea !important; color: #157a3f !important; border-color: #157a3f !important; }
:root[data-theme="light"] body:has(aside.sb) .tag-c { background: #f8f4ed !important; color: #76665a !important; border-color: #e4dcd0 !important; }
/* Giorno selezionato nel calendario: fondo blu, importo verde (1.05:1) */
:root[data-theme="light"] body:has(aside.sb) .cal-d.sel .ci { color: #ffffff !important; }
:root[data-theme="light"] body:has(aside.sb) .cal-d.ok { border-color: rgba(138, 24, 40, 0.35) !important; }

/* ═══ ACCOUNT (area cliente /account) ═══════════════════════════════════ */
/* Logo bianco (filter brightness 1.3) invisibile sul chiaro */
:root[data-theme="light"] .account-logo { filter: brightness(0) !important; opacity: 0.85; }
/* Pulsante "Riscatta": fondo blu (--accent-2) con testo scuro inline */
:root[data-theme="light"] #dash-content button[onclick="riscattaCodice()"] { color: #ffffff !important; flex-shrink: 0; }
/* Telefono: il campo codice (flex:1 ma min-width automatico) schiaccia il
   pulsante e "Riscatta" esce dal fondo blu: bianco sul bianco della card. */
:root[data-theme="light"] #dash-content #dash-codice { min-width: 0; }
/* Esito del riscatto: rosso/verde pastello inline (#f87171 / #4ade80) */
:root[data-theme="light"] #dash-codice-msg[style*="rgb(248, 113, 113)"] { color: #b91c1c !important; }
:root[data-theme="light"] #dash-codice-msg[style*="rgb(74, 222, 128)"] { color: #157a3f !important; }
/* Giochi non disponibili (opacity .35) o crediti insufficienti (.5): la
   dissolvenza portava nomi e costi sotto 2:1. Restano attenuati (.8) ma con
   testi scuri; il costo in FaroCoin rosa diventa rosso pieno. */
:root[data-theme="light"] #dash-content .dash-game[style*="opacity"] { opacity: 0.85 !important; border: 1px dashed #76665a !important; }
:root[data-theme="light"] #dash-content .dash-game[style*="opacity"] .dash-game-desc { color: #4d3f38 !important; }
:root[data-theme="light"] #dash-content .dash-game-fc[style*="#f87171" i] { color: #b91c1c !important; }
:root[data-theme="light"] #dash-content .dash-game-fc[style*="#4ade80" i] { color: #157a3f !important; }
:root[data-theme="light"] #dash-content .dash-game[style*="rgba(212,168,85"] { border-color: #8a5a12 !important; }

/* ═══ ARENA (gamification staff /arena) ═════════════════════════════════ */
/* Colori di livello pastello inline (COLORI_LVL di page-gamification.js)
   sotto 2:1 sul bianco: ricondotti alla palette, uno per livello. */
:root[data-theme="light"] body:has(#view-classifica) [style*="color:#5DCAA5" i] { color: #157a3f !important; }
:root[data-theme="light"] body:has(#view-classifica) [style*="color:#85B7EB" i] { color: #7c001c !important; }
:root[data-theme="light"] body:has(#view-classifica) [style*="color:#AFA9EC" i] { color: #6d28d9 !important; }
:root[data-theme="light"] body:has(#view-classifica) [style*="color:#EF9F27" i] { color: #8a5a12 !important; }
:root[data-theme="light"] body:has(#view-classifica) [style*="color:#F0997B" i] { color: #b45309 !important; }
:root[data-theme="light"] body:has(#view-classifica) [style*="color:#ED93B1" i] { color: #b91c1c !important; }
:root[data-theme="light"] body:has(#view-classifica) .bar-fill[style*="#5DCAA5" i] { background: #157a3f !important; }
:root[data-theme="light"] body:has(#view-classifica) .bar-fill[style*="#85B7EB" i] { background: #7c001c !important; }
:root[data-theme="light"] body:has(#view-classifica) .bar-fill[style*="#AFA9EC" i] { background: #6d28d9 !important; }
:root[data-theme="light"] body:has(#view-classifica) .bar-fill[style*="#EF9F27" i] { background: #8a5a12 !important; }
:root[data-theme="light"] body:has(#view-classifica) .bar-fill[style*="#F0997B" i] { background: #b45309 !important; }
:root[data-theme="light"] body:has(#view-classifica) .bar-fill[style*="#ED93B1" i] { background: #b91c1c !important; }
/* Tab: showTab() cambia .active ma non aria-selected, e bundle.css sottolinea
   [aria-selected="true"]: "Classifica" restava segnata come attiva. */
:root[data-theme="light"] body:has(#view-classifica) .tabs .tab:not(.active) { border-bottom-color: transparent !important; color: #4d3f38 !important; }
/* Badge ruolo (sala/bar/cucina): viola chiaro #a78bfa inline */
:root[data-theme="light"] body:has(#view-classifica) span[style*="#a78bfa" i] { color: #5b21b6 !important; background: #ede9fe !important; }
/* Achievement sbloccati: fondo quasi nero #1a1030 inline con testo lilla */
:root[data-theme="light"] #profilo-content .badge[style*="#1a1030" i] {
  background: #ede9fe !important;
  border-color: #6d28d9 !important;
  color: #5b21b6 !important;
}
/* Achievement da sbloccare: opacity .3 (page-gamification.css) = 1.5:1.
   Restano attenuati ma leggibili. */
:root[data-theme="light"] #profilo-content .badge.locked {
  opacity: 0.8 !important;
  color: #4d3f38 !important;
  border-style: dashed !important;
}

/* ═══ BUILDER (/builder.html, console white-label) ══════════════════════ */
/* Ha token propri nel <style> della pagina (--bg #181219, --surface-2/3,
   --text-2, --muted, bordi oro) e un header a gradient scuro hardcoded. */
:root[data-theme="light"]:has(header.app-header) {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f8f4ed;
  --surface-3: #f2eadd;
  --border: #e4dcd0;
  --border-strong: #decbb2;
  --text: #231b18;
  --text-2: #4d3f38;
  --muted: #76665a;
  --muted-2: #76665a;
  --primary: #7c001c;
  --primary-hover: #640517;
  --accent: #640517;
  --accent-2: #500f16;
  --success: #157a3f;
  --success-bg: #e6f4ea;
  --warning: #b45309;
  --warning-bg: #fff4d6;
  --danger: #b91c1c;
  --danger-bg: #fde8e8;
  --info: #1d4ed8;
  --info-bg: #e8f0fe;
  --shadow-md: 0 4px 14px rgba(35, 27, 24, 0.10);
  --shadow-lg: 0 12px 32px rgba(35, 27, 24, 0.14);
}
:root[data-theme="light"] body > header.app-header {
  background: #ffffff !important;
  background-image: none !important;
  color: #231b18 !important;
}
:root[data-theme="light"] body > header.app-header .app-brand .badge { color: #ffffff !important; }
/* Icona decorativa dello stato vuoto: opacity .4 sul chiaro quasi invisibile */
:root[data-theme="light"] body:has(header.app-header) .empty-state .icon-big { opacity: 0.75 !important; }
/* Tab dell'editor cliente: la regola generica .tab-btn.active di questo file
   (testo bianco, pensata per le tab a fondo pieno di index.html) qui cade su
   una tab trasparente: testo bianco sul bianco. */
:root[data-theme="light"] body:has(header.app-header) #tabs-bar .tab-btn.active {
  background: transparent !important;
  color: #640517 !important;
  border-bottom-color: #7c001c !important;
}
:root[data-theme="light"] body:has(header.app-header) #tabs-bar .tab-btn[disabled] { opacity: 0.7 !important; }
/* Pulsanti disabilitati (Build, Genera license...) a opacity .45: sotto 3:1
   (bianco su verde dissolto = 2.3:1). Nel tema chiaro restano pieni, con un
   aspetto "spento" esplicito: fondo grigio-azzurro, testo muted, bordo. */
:root[data-theme="light"] body:has(header.app-header) .btn:disabled {
  opacity: 1 !important;
  background: #f2eadd !important;
  color: #76665a !important;
  border-color: #e4dcd0 !important;
  box-shadow: none !important;
}
/* theme-toggle.js non trova un contenitore noto nell'header del Builder e
   fissa il bottone del tema in alto a destra, sopra "⚙ Build": si lascia
   lo spazio (38px + margine). */
:root[data-theme="light"] body > header.app-header #header-actions { margin-right: 50px; }
/* Telefono: la briciola dell'header (header alto 60px, colonna 1fr) va a
   capo parola per parola ed esce sopra "+ Nuovo cliente". Una riga, con
   i puntini. (Il Builder resta una console da desktop: la sidebar fissa da
   300px lascia al contenuto meno di 100px, uguale nel tema scuro.) */
@media (max-width: 700px) {
  :root[data-theme="light"] body > header.app-header .crumb {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}
/* Anteprima del brand: suggerimento a opacity .7 (4.2:1 sul fondo scelto) */
:root[data-theme="light"] #preview-area .prv-hint { opacity: 1 !important; }
/* Didascalie della palette: muted a opacity .8 */
:root[data-theme="light"] body:has(header.app-header) .palette-cell .pal-desc { opacity: 1 !important; color: #76665a !important; }
/* Riepilogo fatturazione e box trial (solo con un cliente salvato: non
   raggiungibili nel build Enoha, che non ha le API /api/builder) */
:root[data-theme="light"] body:has(header.app-header) .fatt-summary .cell.green .val { color: #157a3f !important; }
:root[data-theme="light"] body:has(header.app-header) .fatt-summary .cell.red .val { color: #b91c1c !important; }
:root[data-theme="light"] body:has(header.app-header) .trial-url-box { background: #e6f4ea !important; border-color: #157a3f !important; }
:root[data-theme="light"] body:has(header.app-header) .trial-url-box .trial-label { color: #157a3f !important; }
:root[data-theme="light"] body:has(header.app-header) .trial-url-row input { background: #ffffff !important; color: #231b18 !important; border-color: #157a3f !important; }
/* ── Revisione (shots-verifica.js) ─────────────────────────────────────── */
/* Focus da tastiera: bundle.css:4005 disegna un anello oro al 65%
   (rgba(201,168,106,.65)) con !important: sul bianco e' 1.6:1, sotto il
   3:1 richiesto a un indicatore di focus. Nel tema chiaro diventa blu
   primario (6.7:1). Solo le pagine di quest'area: il difetto e' globale. */
:root[data-theme="light"] body:has(#pl-hero) :focus-visible,
:root[data-theme="light"] body:has(aside.sb) :focus-visible,
:root[data-theme="light"] body:has(#view-dashboard) :focus-visible,
:root[data-theme="light"] body:has(#view-classifica) :focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #7c001c !important;
}
/* Costi fissi: la voce disattivata e' una riga a opacity .4 inline
   (page-costi.js caricaCostiFissi): nome, note, badge e cestino fra 1.7 e
   2.5:1. Resta distinta (fondo tenue, testi attenuati, badge "Off") ma
   leggibile. Vale per Direzione e per costi.html. */
:root[data-theme="light"] body:has(#pl-hero) #tbl-fissi tr[style*="opacity"] { opacity: 1 !important; }
:root[data-theme="light"] body:has(#pl-hero) #tbl-fissi tr[style*="opacity"] > td {
  background: #f8f4ed !important;
  color: #76665a !important;
}
:root[data-theme="light"] body:has(#pl-hero) #tbl-fissi tr[style*="opacity"] strong { color: #4d3f38 !important; }
:root[data-theme="light"] body:has(#pl-hero) #tbl-fissi tr[style*="opacity"] .text-muted { color: #76665a !important; }
/* Account: costo di un gioco "Non disponibile stasera" in var(--testo-muted)
   dentro la card a opacity .85 (3.7:1); data dei feedback lasciati a
   opacity .6 (2.4:1). */
:root[data-theme="light"] #dash-content .dash-game[style*="opacity"] .dash-game-fc[style*="testo-muted"] { color: #4d3f38 !important; }
:root[data-theme="light"] #dash-content .dash-fb-date { opacity: 1 !important; color: #76665a !important; }
/* Builder con clienti caricati (misurato con le API /api/builder simulate). */
/* "Aggiorna tutti" nel banner build obsoleti: testo quasi nero su
   --warning #b45309 (3.5:1) */
:root[data-theme="light"] body:has(header.app-header) .sidebar-banner button { color: #ffffff !important; }
/* Cliente selezionato: velo bordeaux del tema scuro, didascalia 4.48:1 */
:root[data-theme="light"] body:has(header.app-header) .cliente-card.active {
  background: #f7eee1 !important;
  border-color: #7c001c !important;
}
:root[data-theme="light"] body:has(header.app-header) .cliente-card.active .cliente-card-meta { color: #4d3f38 !important; }
/* ID cliente in sola lettura a opacity .6 (4.47:1) */
:root[data-theme="light"] body:has(header.app-header) .field input[readonly] {
  opacity: 1 !important;
  color: #4d3f38 !important;
  background: #f8f4ed !important;
  border-style: dashed !important;
}
/* Funzionalita': stato "Nascosta" muted su superficie, in riga attenuata */
:root[data-theme="light"] body:has(header.app-header) .feature-status.hidden { color: #4d3f38 !important; }
/* Moduli CORE: riga a opacity .65 e etichetta quasi nera sul blu (2.8:1) */
:root[data-theme="light"] body:has(header.app-header) .module-row.core { opacity: 1 !important; }
:root[data-theme="light"] body:has(header.app-header) .module-row .module-tag.core { color: #ffffff !important; }
/* ═══ §AREA direzione-report-altre — FINE ═══ */

/* ═══ §AREA integrazione — INIZIO ═══ */
/* Chiusura dell'audit dopo l'unione delle otto sezioni: regressioni emerse
   dal replay sul CSS unito, conflitti fra sezioni sullo stesso componente,
   lacune di copertura e correzioni globali segnalate da piu' aree.
   Criterio sui conflitti: per un componente vince il disegno dell'area che
   ne e' proprietaria (card tavolo, planimetria e azioni del tavolo: sala);
   per i toast di index.html resta lo stile tenue gia' in vigore (cassa-conto
   e prenotazioni, identici): fondo di stato chiaro, testo #0f1b2d, filetto
   sinistro di 5px. Le regole a fondo pieno di sala-tavoli e comanda-menu
   restano nel file ma sono sovrascritte: nessuna nuova regola sui toast di
   #toast-container. */

/* ── I1. Toast del Builder (regressione A2/A3) ────────────────────────────
   La regola generica ".toast {color:#fff}" di sala-tavoli colpisce anche i
   toast di builder.html, che hanno fondo bianco var(--surface) e il colore
   di stato sul testo: il messaggio spariva (1:1). Qui il colore torna quello
   dello stato, con la specificita' dell'id che supera la regola generica. */
:root[data-theme="light"] #toast-stack .toast { color: #157a3f !important; border-color: #157a3f !important; }
:root[data-theme="light"] #toast-stack .toast.error { color: #b91c1c !important; border-color: #b91c1c !important; }
:root[data-theme="light"] #toast-stack .toast.info { color: #1d4ed8 !important; border-color: #1d4ed8 !important; }

/* ── I2. Mansioni, griglia "Assegna turno": XP della mansione (A1) ────────
   #b45309 della regola generica su #fbbf24 passa di un soffio (4,58 sul
   fondo #f0f5fc dell'etichetta): oro brunito per avere margine (5,4:1). */
:root[data-theme="light"] #mans-assign-grid span[style*="color:#fbbf24" i] { color: #8a5a12 !important; }

/* ── I3. Badge coperti vuoto nella testata del tavolo ─────────────────────
   Sala-tavoli lo nasconde solo nella media query del telefono; su desktop
   il tavolo di un evento (senza coperti) mostrava un quadratino bianco. */
:root[data-theme="light"] #t-coperti-badge:empty { display: none !important; }

/* ── I4. Menu azioni del tavolo: colore per funzione ──────────────────────
   La regola di comanda-menu "#azioni-tavolo-wrap .action-btn:not(.btn-cassa)"
   ha la stessa specificita' di quelle di sala-tavoli ed e' scritta dopo:
   Conto separato, Trasferisci e Conto aperto diventavano tasti bianchi.
   Il :not(.btn-cassa) in piu' alza la specificita' sopra entrambe. */
:root[data-theme="light"] #azioni-tavolo-wrap .action-btn.btn-sep:not(.btn-cassa) {
  background: #f7eee1 !important;
  border-color: #7c001c !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #azioni-tavolo-wrap .action-btn[onclick^="apriTrasferisci"]:not(.btn-cassa) {
  background: #fff4d6 !important;
  border-color: #b45309 !important;
  color: #231b18 !important;
}
:root[data-theme="light"] #azioni-tavolo-wrap .action-btn[onclick^="convertiContoAperto"]:not(.btn-cassa) {
  background: #fff4d6 !important;
  border-color: #8a5a12 !important;
  color: #231b18 !important;
}

/* ── I5. Card tavolo: pastiglia cameriere e "×" svuota ────────────────────
   La sezione prenotazioni ridefinisce i due elementi (pastiglia grigia senza
   bordo, × con bordo grigio). Si torna al disegno di sala-tavoli: pastiglia
   bianca bordata, leggibile su tutte le tinte di stato, e × con il bordo
   rosso che la fa riconoscere come tasto di cancellazione. */
:root[data-theme="light"] #grid-tavoli .tavolo .t-cam {
  background: #ffffff !important;
  border: 1px solid #e4dcd0 !important;
}
:root[data-theme="light"] #grid-tavoli .tavolo .lbl-svuota-tavolo { border-color: #b91c1c !important; }

/* ── I6. Prenotato distinguibile da "in attesa" (D) ───────────────────────
   Stessa tinta e stesso bordo (theme-light.css §9): in griglia il prenotato
   si riconosceva solo dal testo. Bordo tratteggiato oro brunito, come in
   planimetria; il padding compensa il pixel di bordo in piu'. */
:root[data-theme="light"] .tavolo.prenotato {
  border: 2px dashed #8a5a12 !important;
  padding: 11px 9px !important;
}

/* ── I7. Planimetria: barra di scelta ─────────────────────────────────────
   Prenotazioni porta il bordo a #d5deea; si torna al blu di sala-tavoli,
   che separa la barra dal canvas chiaro. */
:root[data-theme="light"] body .plan-picker { border-color: #7c001c !important; }

/* ── I8. Hub Gestione vuoto (lacuna T1) ───────────────────────────────────
   .empty-state usa --text-tertiary, che su index.html resta #968C84:
   2,95:1 sulla griglia di .mappa-inner. */
:root[data-theme="light"] #hub-empty-state { color: #4d3f38 !important; }

/* ── I9. Tasto del tema (lacune N1, N2) ───────────────────────────────────
   N2: la 🌙 e' un'emoji gialla, che il colore del testo non cambia: sul fondo
   chiaro del tasto era a 1,41:1. Il tasto diventa blu notte (#1e40af): la
   luna gialla ci sta a 5,9:1 e il tasto dice anche dove porta.
   N1: su /attese.html il tasto finisce in posizione fissa sopra il pulsante
   "schermo intero"; le azioni della testata si spostano a sinistra quanto
   basta. Nel tema scuro resta il problema: va corretto in theme-toggle.js,
   aggiungendo .attese-header__actions ai contenitori noti. */
:root[data-theme="light"] .faro-theme-toggle {
  background: #640517 !important;
  border-color: #500f16 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] .faro-theme-toggle:hover { background: #500f16 !important; }
:root[data-theme="light"] body:has(> .faro-theme-toggle--fixed) .attese-header__actions { margin-right: 56px; }
/* Stesso tasto fisso su /haccp: copriva la fine del titolo "HACCP" in alto
   a destra (col tasto chiaro non si notava, col blu si'). */
:root[data-theme="light"] body:has(> .faro-theme-toggle--fixed) > header.header { padding-right: 64px !important; }
/* Report (/report.html): copriva l'indicatore "live" della testata. Builder
   a 390px: la didascalia della testata finiva sotto il tasto; qui si ferma
   prima e va con i puntini. */
:root[data-theme="light"] body:has(> .faro-theme-toggle--fixed):has(aside.sb) .main > .mh { padding-right: 70px !important; }
:root[data-theme="light"] body:has(> .faro-theme-toggle--fixed) header.app-header { padding-right: 64px !important; }
:root[data-theme="light"] body:has(> .faro-theme-toggle--fixed) header.app-header .crumb { overflow: hidden; }
:root[data-theme="light"] body:has(> .faro-theme-toggle--fixed) header.app-header .crumb-meta {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── I10. Bordi dei campi (lacuna N3) ─────────────────────────────────────
   #d5deea da' 1,2-1,4:1 sui fondi della pagina: il campo non si vede. Si usa
   il muted #5a6a84 (4,9-5,5:1). Stesso elenco della regola §11 (select
   compresi, cosi' tutti i campi hanno lo stesso bordo), esclusi quelli a fuoco (restano col loro anello). La specificita' supera
   quella delle regole di area del tipo ".contenitore input": quella con un
   significato (riconciliazione fattura in rosso) e' ribadita sotto. */
:root[data-theme="light"] :is(input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="password"], input[type="search"], input[type="tel"], input[type="email"], select, textarea):not(:focus) {
  border-color: #76665a !important;
}
:root[data-theme="light"] .fc-reconcile input:not(:focus) { border-color: #b91c1c !important; }
:root[data-theme="light"] body:has(header.app-header) .trial-url-row input:not(:focus) { border-color: #157a3f !important; }

/* ── G1. --red nel tema chiaro (globale) ──────────────────────────────────
   faro-pro.css:73 "--red: var(--fp-bordeaux-2)" vale #1d4ed8: gli errori di
   fatture.js (e di ogni stile scritto in var(--red)) uscivano blu. Tutti gli
   usi di var(--red) nelle pagine col tema chiaro sono stati di pericolo.
   Non si toccano --rosso-primario/--rosso-scuro/--bord2: su index.html sono
   usati solo come accento di brand (tab attiva, primari, conferme, selezione)
   e gli usi "pericolo" di Direzione/Costi sono gia' coperti in quell'area. */
:root[data-theme="light"] { --red: #b91c1c; }

/* ── G2. --shadow-glow (globale) ──────────────────────────────────────────
   Usato solo per campi e controlli a fuoco: l'ombra spostata di 18px
   scuriva le didascalie sotto il campo (4,0-4,4:1). Resta l'anello. */
:root[data-theme="light"] { --shadow-glow: 0 0 0 3px rgba(138, 24, 40, 0.25); }

/* ── G3. Testata delle card dell'hub (globale) ────────────────────────────
   ".hub-card-header > div" (§11) serviva per l'avatar del Profilo (cerchio
   con fondo inline) ma tingeva d'azzurro anche il blocco titolo. Tre aree
   l'avevano corretto per i propri pannelli; qui vale per tutti. */
:root[data-theme="light"] .hub-card-header > div:not(.hub-card-icon):not([style*="border-radius:50%"]) { background: transparent !important; }

/* ── G4. Colori accesi scritti via CSSOM (globale) ────────────────────────
   Le regole §11 [style*="color:#xxxxxx"] non vedono gli stili impostati con
   el.style.color: il browser li serializza come "color: rgb(r, g, b)".
   Si prende la dichiarazione all'inizio o dopo "; " (non background-color
   o border-color). :where() tiene la specificita' sotto le correzioni di
   area, che restano valide. */
:root[data-theme="light"] :where([style^="color: rgb(74, 222, 128)"], [style*="; color: rgb(74, 222, 128)"],
  [style^="color: rgb(110, 231, 160)"], [style*="; color: rgb(110, 231, 160)"],
  [style^="color: rgb(110, 231, 183)"], [style*="; color: rgb(110, 231, 183)"],
  [style^="color: rgb(159, 207, 156)"], [style*="; color: rgb(159, 207, 156)"]) { color: #0f5c30 !important; }
:root[data-theme="light"] :where([style^="color: rgb(251, 191, 36)"], [style*="; color: rgb(251, 191, 36)"]) { color: #b45309 !important; }
:root[data-theme="light"] :where([style^="color: rgb(248, 113, 113)"], [style*="; color: rgb(248, 113, 113)"]) { color: #b91c1c !important; }
:root[data-theme="light"] :where([style^="color: rgb(196, 181, 253)"], [style*="; color: rgb(196, 181, 253)"]) { color: #5b21b6 !important; }
:root[data-theme="light"] :where([style^="color: rgb(168, 192, 212)"], [style*="; color: rgb(168, 192, 212)"]) { color: #500f16 !important; }

/* ── G5. .haccp-btn e azioni primarie colorate ────────────────────────────
   La regola §11 rende bianco ogni .haccp-btn. Le aree hanno ripristinato i
   propri; resta "Invia ordini a tutti i fornitori" (verde inline). */
:root[data-theme="light"] .haccp-btn[onclick="ordiniInvia()"] {
  background: #157a3f !important;
  border-color: #157a3f !important;
  color: #ffffff !important;
}
/* ═══ §AREA integrazione — FINE ═══ */
