/* BetReport — colori Notte & Lime.
   Verde e rosso restano sempre per importi positivi e negativi. */
:root {
  --bg: #eef0f4; --panel: #fff; --ink: #0b1220; --muted: #667085; --line: #e3e7ee; --soft: #f1f3f7;
  --primary: #c6f36b; --primary-ink: #0b1220; --primary-hover: #b8ea52;
  --side-bg: #0b1220; --side-ink: #e8ecf4; --side-muted: #8e98ad; --side-line: #1d2638; --side-hover: #151e30;
  --side-active-bg: #c6f36b; --side-active-ink: #0b1220;
  --auth-bg: #0b1220; --auth-ink: #f3f5f9; --auth-muted: #8e98ad; --auth-alt-bg: #1a2335; --auth-alt-ink: #f3f5f9;
  --logo-bg: #c6f36b; --logo-fg: #0b1220; --logo-dot: #0b1220;
  --word-a: currentColor; --word-b: #c6f36b; --word-b-light: #5a8a00;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-logo: "Space Grotesk", "Inter", system-ui, sans-serif;
}
:root {
  --pos: #16a34a; --pos-soft: #e6f6ec;
  --neg: #e5383b; --neg-soft: #fdeaea;
  --radius: 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; -webkit-tap-highlight-color: transparent; font-family: var(--font-ui); }
.hidden { display: none !important; }
h1 { font-size: 24px; margin: 0; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }

/* ------------------------------------------------ logo: simbolo "b" con punto + nome */
.logo-bet { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.logo-bet svg { width: 32px; height: 32px; display: block; flex: none; }
.lm-bg { fill: var(--logo-bg); } .lm-fg { fill: var(--logo-fg); } .lm-st { stroke: var(--logo-fg); fill: none; } .lm-dot { fill: var(--logo-dot); }
.logo-bet span { font-family: var(--font-logo); font-size: 21px; font-weight: 700; letter-spacing: -.035em; line-height: 1; }
.logo-bet b { color: var(--word-a); font-weight: 700; }
.logo-bet em { color: var(--word-b-light); font-style: normal; font-weight: 500; }
.logo-bet.grande { flex-direction: column; gap: 20px; color: var(--auth-ink); }
.logo-bet.grande svg { width: 96px; height: 96px; filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .18)); }
.logo-bet.grande span { font-size: 56px; letter-spacing: -.05em; }
.logo-bet.grande em { color: var(--word-b); }

/* ------------------------------------------------ layout */
#app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--side-bg); color: var(--side-ink); border-right: 1px solid var(--side-line); display: flex; flex-direction: column; padding: 22px 12px; position: sticky; top: 0; height: 100vh; }
.side .logo-bet { color: var(--side-ink); }
.side .logo-bet em { color: var(--word-b); }
.brand.logo-bet { padding: 0 8px 28px; }
nav a { display: block; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--side-muted); text-decoration: none; margin-bottom: 2px; font-weight: 500; }
nav a:hover { background: var(--side-hover); color: var(--side-ink); }
nav a.active { background: var(--side-active-bg); color: var(--side-active-ink); font-weight: 650; }
.me { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--side-line); font-size: 13px; }
.me .small { color: var(--side-muted); }
.me .link { color: var(--side-muted); display: block; margin-top: 6px; padding: 0; }
.me .link:hover { color: var(--side-ink); }
main { padding: 28px 32px 60px; min-width: 0; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.head .grow { flex: 1; }

/* ------------------------------------------------ cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 17px; }
.stat .k { color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.stat .v { font-size: 23px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--muted); font-size: 12px; margin-top: 3px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }

/* ------------------------------------------------ tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--panel); position: sticky; top: 0; }
tbody tr:hover { background: var(--soft); }
tr.clickable { cursor: pointer; }
tfoot td { font-weight: 700; border-top: 1px solid var(--ink); }
td.actions { white-space: nowrap; text-align: right; }
.empty { color: var(--muted); padding: 26px; text-align: center; }

/* ------------------------------------------------ badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--muted); }
.badge.aperta { background: var(--soft); color: var(--ink); }
.badge.vinta { background: var(--pos-soft); color: var(--pos); }
.badge.persa { background: var(--neg-soft); color: var(--neg); }
.badge.rimborsata { background: var(--soft); color: var(--muted); }
.badge.annullata { text-decoration: line-through; }
.badge.chiusa { background: var(--ink); color: var(--panel); }

/* ------------------------------------------------ forms */
input, select, textarea, button { font: inherit; }
input, select, textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--soft); }
label { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
label > input, label > select, label > textarea, label > .pw { margin-top: 6px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
label.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); flex: none; }
.grid { display: grid; gap: 10px 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.grid .span2 { grid-column: span 2; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; }
button { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 9px 15px; cursor: pointer; color: var(--ink); white-space: nowrap; font-weight: 500; transition: background .15s, transform .1s; }
button:hover { background: var(--soft); }
button:active { transform: scale(.98); }
button:disabled { opacity: .6; cursor: default; }
button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 650; }
button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.big { padding: 13px 18px; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; }
button.danger { color: var(--neg); }
button.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
button.link { background: none; border: none; color: var(--ink); padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.week-nav { display: flex; align-items: center; gap: 6px; }
.week-nav .lbl { min-width: 190px; text-align: center; font-weight: 600; }

/* ------------------------------------------------ foto schedine */
.thumb { width: 36px; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: none; display: block; }
.schedina-in { display: flex; gap: 8px; align-items: flex-start; min-width: 150px; }
.descr { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--muted); }
.esito { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.foto-box { display: flex; gap: 14px; align-items: flex-start; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 14px; }
.foto-box img { width: 110px; max-height: 160px; object-fit: contain; border-radius: 6px; background: #fff; }
button.win { color: var(--pos); border-color: #b5dcc3; font-weight: 600; }
button.win:hover { background: var(--pos-soft); }
button.lose { color: var(--neg); border-color: #f2bcb6; font-weight: 600; }
button.lose:hover { background: var(--neg-soft); }
.loading { display: flex; align-items: center; gap: 12px; padding: 20px 0; color: var(--muted); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
.spinner.sm { width: 15px; height: 15px; border-color: rgba(127, 127, 127, .35); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------ esito automatico */
.proposta { margin-top: 6px; padding: 7px 9px; border-radius: 8px; background: var(--soft); }
.proposta.si { background: var(--pos-soft); } .proposta.no { background: var(--neg-soft); }
.badge.ritardo { background: var(--soft); color: var(--ink); }
.eventi-letti { margin-top: 12px; font-size: 13px; }
.eventi-letti summary { cursor: pointer; color: var(--muted); }
.eventi-letti td { padding: 4px 6px; }

/* ------------------------------------------------ report */
.seg { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: none; background: none; padding: 6px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--ink); color: var(--panel); }
.week-nav input[type="month"], .week-nav select { width: auto; padding: 7px 9px; }
.barra { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--soft); margin-bottom: 14px; gap: 2px; }
.barra span { min-width: 4px; }
.b-perse { background: var(--primary); } .b-vinte { background: var(--ink); } .b-rimb { background: #9aa4b6; } .b-aperte { background: var(--line); }
.legenda td { padding: 7px 4px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
table.mesi tr.clickable:hover td:first-child b { text-decoration: underline; }

/* ------------------------------------------------ avvisi in alto (messaggi del gestore, scadenza, sola lettura) */
.colonna { min-width: 0; }
#banner:empty { display: none; }
#banner { padding: 18px 32px 0; display: grid; gap: 8px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #f3fbe2; border: 1px solid #d9f2a8; border-radius: 12px; padding: 11px 14px; font-size: 13.5px; line-height: 1.4; }
.banner .grow { flex: 1; }
.banner.importante { background: #fdf3dc; border-color: #f3d48c; }
.banner.scuro { background: var(--ink); border-color: var(--ink); color: #fff; }
.banner.scuro button { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
@media (max-width: 900px) { #banner { padding: 12px 12px 0; } }

/* ------------------------------------------------ guida, domande frequenti, assistente, messaggi al gestore */
nav a .conta { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: var(--neg); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.seg .conta { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--neg); color: #fff; font-size: 11px; }
.tabs-guida { flex-wrap: wrap; }
.guida-indice { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.guida-indice a { padding: 7px 13px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 13px; }
.guida-indice a:hover { border-color: var(--ink); }
.guida-sez { scroll-margin-top: 80px; }
.guida-sez h2 { font-size: 18px; margin-bottom: 4px; }
.guida-sez > p { margin: 0 0 12px; line-height: 1.5; }
.guida-sez dl { margin: 0; display: grid; gap: 10px; }
.guida-sez dt { font-weight: 650; }
.guida-sez dd { margin: 2px 0 0; color: #3c4557; line-height: 1.5; }
.aiuto-fondo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aiuto-fondo .grow { flex: 1; }
.faq-cat { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 6px; }
details.faq { border-bottom: 1px solid var(--line); }
details.faq summary { cursor: pointer; padding: 12px 2px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 18px; line-height: 1; }
details.faq[open] summary::after { content: "−"; }
details.faq p { margin: 0 2px 14px; line-height: 1.55; color: #3c4557; }
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; flex-direction: column; gap: 10px; min-height: 240px; max-height: 55vh; overflow-y: auto; padding: 4px; }
.bolla { max-width: 82%; padding: 10px 13px; border-radius: 14px; line-height: 1.5; font-size: 14px; }
.bolla.assistente { background: var(--soft); align-self: flex-start; border-bottom-left-radius: 4px; }
.bolla.utente { background: var(--ink); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bolla.utente .muted { color: #aab3c5; }
.bolla.errore { background: var(--neg-soft); color: var(--neg); }
.bolla.attesa { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.chat-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-scrivi { display: flex; gap: 8px; align-items: flex-end; }
.chat-scrivi textarea { resize: none; min-height: 42px; }
.richiesta-ass { border-bottom: 1px solid var(--line); padding: 10px 0; }
.richiesta-ass summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.thread { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
@media (max-width: 640px) { .bolla { max-width: 92%; } .tabs-guida button { padding: 6px 9px; font-size: 12.5px; } }

/* ------------------------------------------------ giornaliero e resoconto: clienti in perdita / in vincita */
.schema .card { border-top: 4px solid var(--line); }
.schema .perdita { border-top-color: var(--neg); }
.schema .vincita { border-top-color: var(--pos); }
.schema-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.schema-head h2 { margin: 0; }
.importo-schema { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.schema-head .importo-schema { font-size: 20px; }
.schema td { padding: 9px 4px; }
.avviso-aperte { border-color: #f3d48c; background: #fdf3dc; }
.solo-stampa { display: none; }
@media (max-width: 700px) { .lbl-giorno { display: none; } }
@media print { .solo-stampa { display: block; } .schema { grid-template-columns: 1fr 1fr !important; } }
@media (max-width: 1100px) and (min-width: 701px) { .cols.schema { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------ menu in fondo: chat, profilo, esci */
.nav-fondo { display: grid; gap: 2px; margin: 0 -10px 12px; }
.nav-fondo a { display: block; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--side-muted); text-decoration: none; font-weight: 500; }
.nav-fondo a:hover { background: var(--side-hover); color: var(--side-ink); }
.nav-fondo a.active { background: var(--side-active-bg); color: var(--side-active-ink); font-weight: 650; }
.nav-fondo .conta { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: var(--neg); color: #fff; font-size: 11px; font-weight: 700; }
.nav-fondo .esci { text-align: left; padding: 10px 12px; color: var(--side-muted); text-decoration: none; }
.nav-fondo .esci:hover { color: var(--side-ink); }
@media (max-width: 900px) {
  .nav-fondo { display: flex; align-items: center; gap: 4px; margin: 0; }
  .nav-fondo a, .nav-fondo .esci { padding: 6px 9px; font-size: 13px; }
}
/* carica giocata: scelta tra fotocamera, libreria e file */
.scelta-foto { display: grid; gap: 10px; }
.scelta-foto button { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: 12px; white-space: normal; }
.scelta-foto button b { font-size: 16px; }
.scelta-foto button span { color: var(--muted); font-size: 13px; }
.scelta-foto button:hover { border-color: var(--ink); }
/* profilo */
.profilo { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 18px; }
.riga-prof { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.riga-prof:last-of-type { border-bottom: none; }
.riga-prof span { color: var(--muted); }
.riga-prof b { text-align: right; font-weight: 600; word-break: break-word; }
/* gestione: operatori in evidenza */
.operatori-box { border: 2px solid var(--primary); }
.operatori-box .spiega { background: #f3fbe2; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; line-height: 1.55; font-size: 13.5px; }
.operatori-box .spiega ol { margin: 8px 0 0; padding-left: 20px; }

/* ------------------------------------------------ dialog */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(560px, 94vw); background: var(--panel); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .18); }
dialog.wide { width: min(1000px, 96vw); }
dialog::backdrop { background: rgba(10, 15, 25, .4); }
dialog form { padding: 22px; }
dialog h2 { font-size: 18px; }
dialog .foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
dialog .foot .grow { flex: 1; }

/* ------------------------------------------------ prima pagina, accesso e registrazione */
.auth { min-height: 100vh; min-height: 100dvh; background: var(--auth-bg); color: var(--auth-ink); display: grid; place-items: center; padding: 24px 16px; }
.benvenuto { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; width: 100%; max-width: 380px; animation: entra .45s ease-out; }
.benvenuto > p { margin: 0 0 22px; font-size: 15px; color: var(--auth-muted); }
.scelte { display: grid; gap: 12px; width: 100%; }
.scelte button { letter-spacing: .1em; padding: 16px; font-weight: 650; }
.scelte button:not(.primary) { background: var(--auth-alt-bg); border-color: var(--auth-alt-bg); color: var(--auth-alt-ink); }
.scelte button:not(.primary):hover { filter: brightness(1.06); }
@keyframes entra { from { opacity: 0; transform: translateY(12px); } }
.auth-box { width: 100%; max-width: 400px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 18px 26px 26px; box-shadow: 0 24px 60px rgba(0, 0, 0, .12); animation: entra .25s ease-out; }
.auth-box > .logo-bet { justify-content: center; margin: 8px 0 18px; }
.auth-box .indietro { color: var(--muted); text-decoration: none; }
.auth-box .indietro:hover { color: var(--ink); }
.auth-box form { display: grid; gap: 14px; }
.auth-box p { margin: 0; line-height: 1.5; }
.auth-title { font-size: 22px; margin: 0 0 16px; font-weight: 700; text-align: center; letter-spacing: -.02em; }
.auth-box input { padding: 12px 13px; font-size: 16px; }
.auth-box button.big { letter-spacing: .08em; }
.auth-box button.link.center { justify-self: center; color: var(--muted); }
.auth-box button.link.center:hover { color: var(--ink); }
.auth .avviso { background: var(--soft); color: var(--ink); border-radius: 10px; padding: 11px 13px; font-size: 13px; line-height: 1.4; border-left: 3px solid var(--ink); }
.auth .err { color: var(--neg); font-size: 13.5px; min-height: 18px; margin-bottom: -6px; font-weight: 500; }
.auth .err:empty { min-height: 0; margin: 0; }
.attesa { display: flex; align-items: center; justify-content: center; gap: 12px; background: #fdf3dc; color: #8a5a00; border-radius: 12px; padding: 14px; font-size: 16px; }
.attesa .spinner { border-color: #f3d48c; border-top-color: #b7791f; }
.scuoti { animation: scuoti .35s; }
@keyframes scuoti { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ------------------------------------------------ messaggi */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 11px 18px; border-radius: 12px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 100; max-width: 80vw; }
#toast.show { opacity: 1; }
#toast[popover] { inset: auto auto 20px 50%; margin: 0; border: none; overflow: visible; }
button.danger-fill { background: var(--neg); border-color: var(--neg); color: #fff; font-weight: 600; }
#toast.err { background: var(--neg); color: #fff; }

/* ------------------------------------------------ tablet e telefono */
@media (max-width: 900px) {
  /* menu in basso come le app del telefono */
  #app { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); border-right: none; border-bottom: 1px solid var(--side-line); }
  .brand.logo-bet { padding: 0; }
  .brand.logo-bet svg { width: 28px; height: 28px; }
  .brand.logo-bet span { font-size: 19px; }
  nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; overflow-x: auto; background: var(--side-bg); border-top: 1px solid var(--side-line); padding: 6px 6px max(6px, env(safe-area-inset-bottom)); scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { flex: 1 0 auto; text-align: center; margin: 0; padding: 9px 11px; font-size: 12.5px; }
  .me { margin: 0 0 0 auto; border: none; padding: 0; display: flex; gap: 12px; align-items: center; }
  .me .link { margin: 0; }
  .me #me-name .small { display: none; }
  main { padding: 18px 12px 90px; }
  .col-tipo { display: none; }
  dialog form { padding: 16px; }
  .grid .span2 { grid-column: 1 / -1; }
}

@media print {
  .side, .no-print, button { display: none !important; }
  #app { display: block; }
  main { padding: 0; }
  .card, .stat { border-color: #999; }
}

/* ------------------------------------------------ telefono: ogni giocata diventa una scheda */
.mlbl { display: none; }
@media (max-width: 640px) {
  h1 { font-size: 21px; }
  .logo-bet.grande svg { width: 80px; height: 80px; }
  .logo-bet.grande span { font-size: 46px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px 13px; }
  .stat .v { font-size: 18px; }
  .me #me-name { display: none; }
  .week-nav .lbl { min-width: 0; font-size: 13px; }
  table.giocate thead { display: none; }
  table.giocate, table.giocate tbody { display: block; }
  table.giocate tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; padding: 14px 4px; border-bottom: 1px solid var(--line);
    grid-template-areas: "sched sched" "data cli" "imp pot" "stato vin" "act act"; }
  table.giocate td { display: block; border: none; padding: 0; }
  table.giocate td.col-tipo { display: none; }
  table.giocate .c-data { grid-area: data; } table.giocate .c-cli { grid-area: cli; text-align: right; }
  table.giocate .c-sched { grid-area: sched; } table.giocate .c-imp { grid-area: imp; text-align: left; }
  table.giocate .c-pot { grid-area: pot; } table.giocate .c-stato { grid-area: stato; }
  table.giocate .c-vin { grid-area: vin; } table.giocate .c-act { grid-area: act; text-align: right; }
  table.giocate .mlbl { display: inline; color: var(--muted); font-size: 12px; }
  .esito button { padding: 9px 16px; font-size: 14px; }
}

/* ================================================================ UPGRADE INTERFACCIA INTERNA
   Nuovi colori e caratteri per il gestionale (la pagina di accesso resta com'è).
   Menu laterale a bottoni con piccole icone; schede, tabelle e pulsanti più curati. */
#app, #dlg {
  --bg: #f3f4f9; --panel: #fff; --ink: #0f172a; --muted: #6b7280; --line: #e6e8f0; --soft: #f4f6fb;
  --primary: #0f172a; --primary-ink: #fff; --primary-hover: #1e293b;
  --accent: #c6f36b; --accent-ink: #0f172a;
  --radius: 18px;
  --ombra: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --font-ui: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-titoli: "Space Grotesk", "Plus Jakarta Sans", system-ui, sans-serif;
  font-family: var(--font-ui);
}
#app { background: var(--bg); }
#app h1 { font-family: var(--font-titoli); font-size: 30px; font-weight: 700; letter-spacing: -.035em; }
#app h2, #dlg h2 { font-family: var(--font-titoli); font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
#app main { padding: 32px 36px 64px; }

/* --- menu laterale: ogni voce è un bottone */
#app .side { background: linear-gradient(180deg, #111a2e 0%, #0b1120 100%); border-right: none; padding: 24px 14px 18px; }
#app .brand.logo-bet { padding: 0 6px 26px; }
#app nav a, #app .nav-fondo a, #app .nav-fondo .esci {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; margin-bottom: 6px; border-radius: 13px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07);
  color: #c9d1e0; font-weight: 600; font-size: 14px; text-decoration: none; transition: background .15s, transform .15s, border-color .15s;
}
#app nav a:hover, #app .nav-fondo a:hover, #app .nav-fondo .esci:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .14); color: #fff; transform: translateX(2px); }
#app nav a.active, #app .nav-fondo a.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px rgba(198, 243, 107, .22); transform: none; }
#app .nav-fondo { margin: 0 0 14px; gap: 0; }
#app .nav-fondo .esci { width: 100%; color: #fca5a5; }
#app .me { border-top: 1px solid rgba(255, 255, 255, .08); padding: 14px 0 0; }
#app #me-name { padding: 0 4px; font-size: 13px; color: #e5e9f2; }
#app #me-name .small { color: #8d97ab; }
/* icone a linea, dello stesso colore della scritta */
#app nav a::before, #app .nav-fondo a::before, #app .nav-fondo .esci::before {
  content: ""; width: 18px; height: 18px; flex: none; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
}
#app [data-view="cruscotto"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5 9.5V21h14V9.5'/%3E%3C/svg%3E"); }
#app [data-view="clienti"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c0-3.6 2.9-6 6.5-6s6.5 2.4 6.5 6'/%3E%3Cpath d='M16 4.5a3.5 3.5 0 0 1 0 7'/%3E%3Cpath d='M18 14.3c2.1.7 3.5 2.8 3.5 5.7'/%3E%3C/svg%3E"); }
#app [data-view="giocate"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16v5a3 3 0 0 0 0 6v5H4v-5a3 3 0 0 0 0-6z'/%3E%3Cpath d='M10 8v8'/%3E%3C/svg%3E"); }
#app [data-view="giornaliero"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3Ccircle cx='12' cy='15' r='1.6' fill='black'/%3E%3C/svg%3E"); }
#app [data-view="settimana"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4M7.5 14.5h9'/%3E%3C/svg%3E"); }
#app [data-view="report"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E"); }
#app [data-view="admin"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0'/%3E%3Ccircle cx='16' cy='6' r='2'/%3E%3Ccircle cx='10' cy='12' r='2'/%3E%3Ccircle cx='18' cy='18' r='2'/%3E%3C/svg%3E"); }
#app [data-view="fatture"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2.5h9l4 4V21.5H6z'/%3E%3Cpath d='M14.5 2.5V7H19M9.5 12h6M9.5 16h6'/%3E%3C/svg%3E"); }
#app [data-view="guida"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.6 9.3a2.5 2.5 0 1 1 3.4 2.4c-.7.3-1 .9-1 1.6v.4'/%3E%3Ccircle cx='12' cy='17' r='.6' fill='black'/%3E%3C/svg%3E"); }
#app [data-view="chat"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3C/svg%3E"); }
#app [data-view="profilo"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 3.6-7 8-7s8 3 8 7'/%3E%3C/svg%3E"); }
#app .nav-fondo .esci { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h5v16h-5M10 8l-4 4 4 4M6 12h10'/%3E%3C/svg%3E"); }
#app nav a .conta, #app .nav-fondo .conta { margin-left: auto; }

/* --- schede, numeri e tabelle */
#app .card, #app .stat { border: 1px solid transparent; box-shadow: var(--ombra); }
#app .card { padding: 20px 22px; }
#app .stats { gap: 14px; margin-bottom: 22px; }
#app .stat { padding: 18px 20px; position: relative; overflow: hidden; }
#app .stat::after { content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); opacity: .9; }
#app .stat .k { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 9px; }
#app .stat .v { font-family: var(--font-titoli); font-size: 28px; letter-spacing: -.035em; }
#app th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--soft); }
#app thead th:first-child { border-top-left-radius: 10px; } #app thead th:last-child { border-top-right-radius: 10px; }
#app th, #app td { border-bottom-color: #eef0f5; }
#app tbody tr:hover { background: #f8f9fd; }
#app tfoot td { border-top: 2px solid var(--ink); }

/* --- pulsanti e campi */
#app button, #dlg button { border-radius: 12px; font-weight: 600; border-color: var(--line); }
#app button.primary, #dlg button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 16px rgba(15, 23, 42, .18); }
#app button.primary:hover, #dlg button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
#app .head button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px rgba(198, 243, 107, .35); }
#app .head button.primary:hover { filter: brightness(.96); }
#app input, #app select, #app textarea, #dlg input, #dlg select, #dlg textarea { border-radius: 12px; border-color: var(--line); background: #fff; }
#app input:focus, #app select:focus, #app textarea:focus, #dlg input:focus, #dlg select:focus, #dlg textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(198, 243, 107, .45); }
#app .seg { background: #fff; border-color: var(--line); border-radius: 13px; box-shadow: var(--ombra); }
#app .seg button { border-radius: 10px; }
#app .seg button.on { background: var(--ink); color: #fff; }
#app .week-nav button { border-radius: 11px; }
#app .badge { padding: 4px 10px; }
#dlg { border-radius: 22px; }
#dlg form { padding: 24px 26px; }

/* --- telefono: il menu in basso resta una barra, con i bottoni compatti */
@media (max-width: 900px) {
  #app main { padding: 18px 12px 96px; }
  #app h1 { font-size: 24px; }
  #app nav { background: #0b1120; border-top: 1px solid rgba(255, 255, 255, .08); gap: 4px; }
  #app nav a { flex-direction: column; gap: 3px; margin: 0; padding: 7px 10px; font-size: 11px; background: none; border: none; color: #9aa4b8; transform: none; }
  #app nav a::before { width: 20px; height: 20px; }
  #app nav a.active { background: rgba(198, 243, 107, .14); color: var(--accent); box-shadow: none; }
  #app .nav-fondo { margin: 0; }
  #app .nav-fondo a, #app .nav-fondo .esci { margin: 0; padding: 6px 9px; font-size: 12.5px; gap: 6px; }
  #app .nav-fondo a::before, #app .nav-fondo .esci::before { width: 15px; height: 15px; }
  #app .me { border-top: none; padding: 0; }
  #app .stat .v { font-size: 21px; }
}
@media print { #app .card, #app .stat { box-shadow: none; } #app .stat::after { display: none; } }
#app .schema .card { border-top: 4px solid var(--line); }
#app .schema .perdita { border-top-color: var(--neg); }
#app .schema .vincita { border-top-color: var(--pos); }
#app .operatori-box { border: 2px solid var(--accent); }

/* ================================================================ TEMA SCURO DELL'INTERNO (predefinito; con html.chiaro torna il tema chiaro)
   Sfondo blu notte, schede scure, lime come colore di risalto. Verde e rosso più luminosi per leggerli bene sullo scuro. */
html:not(.chiaro) #app, html:not(.chiaro) #dlg {
  --bg: #0a0f1c; --panel: #121a2b; --ink: #e9edf5; --muted: #8f9bb3; --line: #223049; --soft: #18223a;
  --primary: #c6f36b; --primary-ink: #0a0f1c; --primary-hover: #b6e84f;
  --pos: #4ade80; --pos-soft: rgba(74, 222, 128, .13);
  --neg: #f87171; --neg-soft: rgba(248, 113, 113, .13);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .12);
  --ombra: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .35);
  color: var(--ink); color-scheme: dark;
}
html:not(.chiaro) #app { background: radial-gradient(1200px 600px at 100% -10%, rgba(198, 243, 107, .06), transparent 60%), var(--bg); background-attachment: fixed; }
html:not(.chiaro) #app .side { background: #070b15; border-right: 1px solid #172036; }
html:not(.chiaro) #app .card, html:not(.chiaro) #app .stat { background: var(--panel); border: 1px solid var(--line); }
html:not(.chiaro) #app th { background: #0f1626; color: var(--muted); }
html:not(.chiaro) #app th, html:not(.chiaro) #app td { border-bottom-color: #1c2740; }
html:not(.chiaro) #app tbody tr:hover { background: #162038; }
html:not(.chiaro) #app tfoot td { border-top-color: var(--line); background: #0f1626; }
html:not(.chiaro) #app a { color: var(--ink); }
html:not(.chiaro) #app .muted, html:not(.chiaro) #dlg .muted { color: var(--muted); }

/* pulsanti e campi */
html:not(.chiaro) #app button, html:not(.chiaro) #dlg button { background: #18223a; border-color: #2a3a58; color: var(--ink); }
html:not(.chiaro) #app button:hover, html:not(.chiaro) #dlg button:hover { background: #1f2b47; }
html:not(.chiaro) #app button.primary, html:not(.chiaro) #dlg button.primary, html:not(.chiaro) #app .head button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 8px 22px rgba(198, 243, 107, .18); }
html:not(.chiaro) #app button.primary:hover, html:not(.chiaro) #dlg button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
html:not(.chiaro) #app button.link, html:not(.chiaro) #dlg button.link { background: none; border: none; color: var(--ink); }
html:not(.chiaro) #app button.danger, html:not(.chiaro) #dlg button.danger { color: var(--neg); }
html:not(.chiaro) #app button.danger-fill, html:not(.chiaro) #dlg button.danger-fill { background: #dc2626; border-color: #dc2626; color: #fff; }
html:not(.chiaro) #app button.win, html:not(.chiaro) #dlg button.win { color: var(--pos); border-color: rgba(74, 222, 128, .45); background: transparent; }
html:not(.chiaro) #app button.win:hover { background: var(--pos-soft); }
html:not(.chiaro) #app button.lose, html:not(.chiaro) #dlg button.lose { color: var(--neg); border-color: rgba(248, 113, 113, .45); background: transparent; }
html:not(.chiaro) #app button.lose:hover { background: var(--neg-soft); }
html:not(.chiaro) #app input, html:not(.chiaro) #app select, html:not(.chiaro) #app textarea, html:not(.chiaro) #dlg input, html:not(.chiaro) #dlg select, html:not(.chiaro) #dlg textarea { background: #0d1424; border-color: #2a3a58; color: var(--ink); }
html:not(.chiaro) #app input::placeholder, html:not(.chiaro) #app textarea::placeholder, html:not(.chiaro) #dlg input::placeholder, html:not(.chiaro) #dlg textarea::placeholder { color: #66728a; }
html:not(.chiaro) #app input:focus, html:not(.chiaro) #app select:focus, html:not(.chiaro) #app textarea:focus, html:not(.chiaro) #dlg input:focus, html:not(.chiaro) #dlg select:focus, html:not(.chiaro) #dlg textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(198, 243, 107, .18); }
html:not(.chiaro) #app .seg { background: #0d1424; border-color: var(--line); box-shadow: none; }
html:not(.chiaro) #app .seg button { background: none; border: none; color: var(--muted); }
html:not(.chiaro) #app .seg button.on { background: var(--primary); color: var(--primary-ink); }
html:not(.chiaro) #app .week-nav .lbl { color: var(--ink); }

/* etichette di stato */
html:not(.chiaro) #app .badge, html:not(.chiaro) #dlg .badge { background: #1c2740; color: var(--muted); }
html:not(.chiaro) #app .badge.aperta, html:not(.chiaro) #dlg .badge.aperta { background: #24324f; color: #dbe3f2; }
html:not(.chiaro) #app .badge.vinta, html:not(.chiaro) #app .badge.attiva, html:not(.chiaro) #dlg .badge.vinta { background: var(--pos-soft); color: var(--pos); }
html:not(.chiaro) #app .badge.persa, html:not(.chiaro) #app .badge.bloccata, html:not(.chiaro) #app .badge.rifiutata, html:not(.chiaro) #dlg .badge.persa { background: var(--neg-soft); color: var(--neg); }
html:not(.chiaro) #app .badge.in_attesa, html:not(.chiaro) #app .badge.ritardo { background: var(--warn-soft); color: var(--warn); }
html:not(.chiaro) #app .badge.chiusa { background: var(--primary); color: var(--primary-ink); }

/* riquadri che prima erano chiari */
html:not(.chiaro) #app .banner { background: rgba(198, 243, 107, .08); border-color: rgba(198, 243, 107, .25); color: var(--ink); }
html:not(.chiaro) #app .banner.importante, html:not(.chiaro) #app .avviso-aperte { background: var(--warn-soft); border-color: rgba(251, 191, 36, .35); color: var(--ink); }
html:not(.chiaro) #app .banner.scuro { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
html:not(.chiaro) #app .banner.scuro button { background: var(--primary-ink); border-color: var(--primary-ink); color: var(--primary); }
html:not(.chiaro) #app .operatori-box .spiega { background: rgba(198, 243, 107, .07); color: var(--ink); }
html:not(.chiaro) #app .proposta { background: #18223a; } html:not(.chiaro) #app .proposta.si { background: var(--pos-soft); } html:not(.chiaro) #app .proposta.no { background: var(--neg-soft); }
html:not(.chiaro) #app .foto-box, html:not(.chiaro) #dlg .foto-box { background: #0d1424; border-color: var(--line); }
html:not(.chiaro) #app .guida-sez dd, html:not(.chiaro) #app details.faq p { color: #b7c0d2; }
html:not(.chiaro) #app .guida-indice a { background: var(--panel); border-color: var(--line); color: var(--ink); }
html:not(.chiaro) #app .guida-indice a:hover { border-color: var(--primary); }
html:not(.chiaro) #app .bolla.assistente { background: #1a2540; color: var(--ink); }
html:not(.chiaro) #app .bolla.utente { background: var(--primary); color: var(--primary-ink); }
html:not(.chiaro) #app .bolla.utente .muted { color: #3b4a1a; }
html:not(.chiaro) #app .b-vinte { background: #e9edf5; } html:not(.chiaro) #app .b-rimb { background: #5b6680; } html:not(.chiaro) #app .b-aperte { background: #2a3a58; }
html:not(.chiaro) #app .riga-prof { border-bottom-color: var(--line); }
html:not(.chiaro) #app .empty { color: var(--muted); }

/* finestre */
html:not(.chiaro) #dlg { background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
html:not(.chiaro) #dlg::backdrop { background: rgba(2, 6, 15, .7); }
html:not(.chiaro) #dlg table th { background: #0f1626; color: var(--muted); }
html:not(.chiaro) #dlg th, html:not(.chiaro) #dlg td { border-bottom-color: #1c2740; }
html:not(.chiaro) #dlg .scelta-foto button span { color: var(--muted); }
html:not(.chiaro) #dlg .scelta-foto button:hover { border-color: var(--primary); }
html:not(.chiaro) #toast { background: var(--primary); color: var(--primary-ink); }

/* pannello del gestore */
html:not(.chiaro) #app .sala { background: var(--panel); border-color: var(--line); }
html:not(.chiaro) #app .sala.in_attesa { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
html:not(.chiaro) #app .richiesta, html:not(.chiaro) #app .avviso-riga { background: var(--panel); border-color: var(--line); color: var(--ink); }
html:not(.chiaro) #app .richiesta { background: var(--warn-soft); }
html:not(.chiaro) #app .msg-utente .bolla.loro { background: #1a2540; }
html:not(.chiaro) #app .msg-utente .bolla.mia { background: var(--primary); color: var(--primary-ink); }
html:not(.chiaro) #app .msg-utente .bolla.mia .muted { color: #3b4a1a; }
html:not(.chiaro) #app .g-gioc { fill: #3a4a6a; background: #3a4a6a; }
html:not(.chiaro) #app .grafico text { fill: var(--muted); }

@media (max-width: 900px) { html:not(.chiaro) #app nav { background: #070b15; } }
@media print {
  html:not(.chiaro) #app, html:not(.chiaro) #app .card, html:not(.chiaro) #app .stat { background: #fff !important; color: #000 !important; }
  html:not(.chiaro) #app th { background: #f2f2f2 !important; color: #333 !important; }
}

/* ------------------------------------------------ bottone per cambiare tema, in fondo al menu */
#app .tema-btn { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 13px; margin-bottom: 6px; border-radius: 13px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); color: #c9d1e0; font-weight: 600; font-size: 14px; text-decoration: none; text-align: left; box-shadow: none; }
#app .tema-btn:hover { background: rgba(255, 255, 255, .09); color: #fff; }
#app .tema-btn::before { content: ""; width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4.5'/%3E%3Cpath d='M12 2v2.5M12 19.5V22M2 12h2.5M19.5 12H22M4.9 4.9l1.8 1.8M17.3 17.3l1.8 1.8M4.9 19.1l1.8-1.8M17.3 6.7l1.8-1.8'/%3E%3C/svg%3E"); }
html.chiaro #app .tema-btn::before { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z'/%3E%3C/svg%3E"); }
@media (max-width: 900px) {
  #app .tema-btn { width: auto; margin: 0; padding: 6px 9px; gap: 0; }
  #app .tema-btn span { display: none; }
  #app .tema-btn::before { width: 16px; height: 16px; }
}
@media (max-width: 440px) { #app .brand.logo-bet span { display: none; } #app .nav-fondo a, #app .nav-fondo .esci { padding: 6px 8px; } }

/* ================================================================ prima configurazione, tour guidato, preferenze */
#setup { position: fixed; inset: 0; z-index: 200; background: rgba(5, 9, 18, .92); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px 14px; overflow-y: auto; }
.setup-box { width: 100%; max-width: 560px; background: #121a2b; color: #e9edf5; border: 1px solid #223049; border-radius: 22px; padding: 24px 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; }
.setup-box .muted { color: #8f9bb3; }
.setup-box h2 { font-family: "Space Grotesk", sans-serif; font-size: 24px; margin: 6px 0 8px; letter-spacing: -.02em; }
.setup-box p { line-height: 1.55; margin: 0 0 14px; }
.setup-logo { color: #e9edf5; margin-bottom: 14px; }
.setup-logo em { color: #c6f36b; }
.setup-passi { display: flex; gap: 8px; margin-bottom: 14px; }
.setup-passi span { flex: 1; text-align: center; padding: 7px; border-radius: 10px; background: #18223a; color: #8f9bb3; font-size: 12.5px; font-weight: 700; }
.setup-passi span.on { background: #c6f36b; color: #0a0f1c; } .setup-passi span.fatto { color: #c6f36b; }
.setup-box form { display: grid; gap: 12px; }
.setup-box label { color: #8f9bb3; }
.setup-box input, .setup-box select { background: #0d1424; border: 1px solid #2a3a58; color: #e9edf5; border-radius: 12px; padding: 11px 12px; font-size: 15px; color-scheme: dark; }
.setup-box input:focus, .setup-box select:focus { border-color: #c6f36b; box-shadow: 0 0 0 4px rgba(198, 243, 107, .18); outline: none; }
.setup-box button { background: #18223a; border: 1px solid #2a3a58; color: #e9edf5; border-radius: 12px; }
.setup-box button.primary { background: #c6f36b; border-color: #c6f36b; color: #0a0f1c; }
.setup-box button.link { background: none; border: none; color: #8f9bb3; }
.setup-box .err { color: #f87171; min-height: 0; }
.setup-foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; } .setup-foot .grow { flex: 1; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .duo { grid-template-columns: 1fr; } }
.sett-box { display: grid; gap: 10px; background: rgba(198, 243, 107, .06); border: 1px solid rgba(198, 243, 107, .22); border-radius: 14px; padding: 14px; }
.sett-riga { display: grid; grid-template-columns: 80px 1fr 120px; gap: 10px; align-items: center; }
.sett-riga select, .sett-riga input { width: 100%; }
.sett-preset { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sett-riassunto { margin: 2px 0 0 !important; font-size: 14px; }
@media (max-width: 520px) { .sett-riga { grid-template-columns: 1fr 1fr; } .sett-riga b { grid-column: 1 / -1; } }
html.chiaro #dlg .sett-box { background: #f6fbe9; border-color: #d9f2a8; }

#tour { position: fixed; inset: 0; z-index: 150; pointer-events: none; }
#tour.senza { background: rgba(5, 9, 18, .72); }
.tour-buco { position: fixed; border-radius: 14px; box-shadow: 0 0 0 4px #c6f36b, 0 0 0 9999px rgba(5, 9, 18, .72); transition: all .25s ease; }
.tour-card { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); width: min(460px, calc(100vw - 24px)); pointer-events: auto;
  background: #121a2b; color: #e9edf5; border: 1px solid #2a3a58; border-radius: 20px; padding: 18px 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; }
#tour.senza .tour-card { bottom: auto; top: 50%; transform: translate(-50%, -50%); }
.tour-num { font-size: 12px; font-weight: 700; color: #c6f36b; letter-spacing: .05em; text-transform: uppercase; }
.tour-card h3 { font-family: "Space Grotesk", sans-serif; font-size: 21px; margin: 4px 0 6px; }
.tour-card p { margin: 0 0 14px; line-height: 1.55; color: #c9d1e0; }
.tour-foot { display: flex; align-items: center; gap: 8px; } .tour-foot .grow { flex: 1; }
.tour-card button { background: #18223a; border: 1px solid #2a3a58; color: #e9edf5; border-radius: 12px; padding: 9px 15px; font-weight: 600; }
.tour-card button.primary { background: #c6f36b; border-color: #c6f36b; color: #0a0f1c; }
.tour-card button.link { background: none; border: none; color: #8f9bb3; padding: 0; }
@media (max-width: 900px) { .tour-card { bottom: 96px; } }

.pref { display: flex; align-items: center; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.pref:last-child { border-bottom: none; }
.pref > div:first-child { flex: 1; } .pref b { font-weight: 700; } .pref .small { margin-top: 3px; line-height: 1.45; }
.pref-az { flex: none; }
.interruttore { position: relative; display: inline-block; width: 46px; height: 26px; }
.interruttore input { opacity: 0; width: 0; height: 0; position: absolute; }
.interruttore span { position: absolute; inset: 0; border-radius: 99px; background: #3a4a6a; transition: background .2s; cursor: pointer; }
.interruttore span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.interruttore input:checked + span { background: #84cc16; }
.interruttore input:checked + span::after { transform: translateX(20px); }

/* TELEFONO: campi a 16px, così l iPhone non ingrandisce la pagina quando si scrive (e non la lascia decentrata) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; }
@media (max-width: 900px) { input, select, textarea { font-size: 16px !important; } }
@media (max-width: 900px) { .card:has(> table) { overflow-x: auto; -webkit-overflow-scrolling: touch; } .cols > * { min-width: 0; } }
@media (max-width: 900px) { #app aside.side { padding: 12px 12px !important; align-items: center; } #app aside.side .brand { padding: 0 !important; margin: 0 !important; } #app aside.side .brand svg { width: 34px; height: 34px; } }
#app .esito .controlla { border-color: rgba(198,243,107,.45); color: var(--lime, #c6f36b); }
html.chiaro #app .esito .controlla { color: #3f6212; border-color: #a3c95a; }

/* chiusura di cassa giornaliera */
.ch-cols { margin-bottom: 18px; }
.ch-cols .card h2, .ch-conto h2 { margin-top: 0; }
.ch-cols label, .ch-conto label { display: block; margin: 8px 0; }
.ch-cols label input, .ch-conto label input { display: block; width: 100%; margin-top: 4px; }
.ch-cols input[readonly] { opacity: .7; cursor: not-allowed; }
.ch-riga { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line, rgba(127,127,127,.15)); }
.ch-riga.tot { font-size: 1.05em; }
.ch-riga.tot span { font-weight: 600; }
.ch-conto { max-width: 560px; }
.ch-esito { font-size: 1.15em; font-weight: 700; margin: 12px 0 4px; }
.ch-avviso { border-color: var(--accent) !important; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#app [data-view="chiusura"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2.5'/%3E%3Cpath d='M7 7V5.5A1.5 1.5 0 0 1 8.5 4h7A1.5 1.5 0 0 1 17 5.5V7M3 12h18'/%3E%3Ccircle cx='12' cy='12' r='1.6' fill='black'/%3E%3C/svg%3E"); }
.ch-pagato { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; margin: 8px 0; align-items: center; }
#ch-pagato-add { margin: 6px 0 4px; }

/* le mie sale */
.mie-sale { display: grid; gap: 12px; margin: 14px 0 18px; }
.sala-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0; }
.sala-card.corrente { border-color: var(--lime, #c6f36b); }
.sala-info { flex: 1 1 240px; min-width: 0; }
.sala-nome { font-weight: 700; font-size: 1.08em; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sala-azioni { display: flex; gap: 8px; flex-wrap: wrap; }
#collega label { display: block; margin: 10px 0; }
#collega label input { display: block; width: 100%; margin-top: 4px; }
#app [data-view="sale"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 8 6l5 4.5V20H3z'/%3E%3Cpath d='M13 12l4-3.5 4 3.5V20h-8'/%3E%3Cpath d='M7 20v-4h2v4'/%3E%3C/svg%3E"); }
.nav-fondo .lbl-corto { display: none; }
@media (max-width: 900px) { .nav-fondo .lbl-lungo { display: none; } .nav-fondo .lbl-corto { display: inline; } .nav-fondo a { white-space: nowrap; } }
