/* A.I.S.A. Molise – stile dell'app (colori del prototipo) */
:root {
  --blu: #1F3A5F; --blu-scuro: #142842; --giallo: #F2B705;
  --sfondo: #F3F5F8; --carta: #fff; --testo: #1B2430; --tenue: #667085; --bordo: #E3E7ED;
  --ok: #1E8E4E; --ok-chiaro: #E6F4EC; --warn: #B7791F; --warn-chiaro: #FFF5DD; --bad: #C53030; --bad-chiaro: #FDECEC;
  --info-chiaro: #E8F0FA; --raggio: 14px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--testo); background: var(--sfondo); font-size: 16px; line-height: 1.4; -webkit-tap-highlight-color: transparent; }
a { color: var(--blu); }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.scheda h2 { margin-top: 0; }
h3 { font-size: 15px; margin: 14px 0 6px; }
/* L'app occupa tutto lo schermo: su iPhone (app installata) height:100% lasciava
   bande bianche sopra e sotto, quindi #app è fissato ai bordi dello schermo */
html { background: var(--blu); }
#app { position: fixed; top: 0; bottom: 0; left: 0; right: 0; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; background: var(--sfondo); }

/* Intestazione, contenuto, barra */
.testata { background: var(--carta); padding: calc(14px + env(safe-area-inset-top)) 16px 14px; border-bottom: 1px solid var(--bordo); flex-shrink: 0; }
.testata.scura { background: var(--blu); color: #fff; border: 0; }
.testata.scura a { color: #fff; }
.testata .sotto { font-size: 13px; opacity: .8; margin-top: 2px; }
.indietro { display: inline-block; font-size: 14px; text-decoration: none; margin-bottom: 6px; opacity: .9; }
.riga-titolo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.contenuto { flex: 1; overflow-y: auto; padding: 14px 14px calc(90px + env(safe-area-inset-bottom)); position: relative; -webkit-overflow-scrolling: touch; }
.wm::before { content: ''; position: fixed; inset: 0; background: url('../icons/logo.jpg') center 55% / min(70vw, 420px) no-repeat; opacity: .03; pointer-events: none; z-index: 0; }
.contenuto > * { position: relative; z-index: 1; }

/* Menu laterale (tendina) */
.btn-menu { width: 42px; height: 42px; margin-left: -8px; border: 0; border-radius: 10px; background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.btn-menu:active { background: rgba(255,255,255,.15); }
.velo { position: fixed; inset: 0; background: rgba(10,20,35,.45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.tendina { position: fixed; top: 0; bottom: 0; left: 0; width: min(84vw, 320px); background: var(--carta); z-index: 61; transform: translateX(-102%); transition: transform .22s ease; display: flex; flex-direction: column; box-shadow: 4px 0 24px rgba(0,0,0,.18); }
body.menu-aperto .velo { opacity: 1; pointer-events: auto; }
body.menu-aperto .tendina { transform: none; }
.tendina-testa { display: flex; align-items: center; gap: 12px; background: var(--blu); color: #fff; padding: calc(18px + env(safe-area-inset-top)) 14px 18px; }
.tendina-testa .sotto { font-size: 13px; opacity: .8; }
.logo-tondo.piccolo { width: 46px; height: 46px; }
.btn-icona.chiaro { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.tendina-voci { flex: 1; overflow-y: auto; padding: 8px 0 calc(16px + env(safe-area-inset-bottom)); }
.tendina-voci a { display: flex; align-items: center; gap: 14px; padding: 12px 20px; color: var(--testo); text-decoration: none; font-size: 15px; font-weight: 500; }
.tendina-voci a svg { color: var(--tenue); flex-shrink: 0; }
.tendina-voci a.attiva { background: var(--info-chiaro); color: var(--blu); font-weight: 700; box-shadow: inset 4px 0 0 var(--blu); }
.tendina-voci a.attiva svg { color: var(--blu); }
.tendina-voci a.pericolo, .tendina-voci a.pericolo svg { color: var(--bad); }
.tendina-sez { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tenue); padding: 16px 20px 6px; border-top: 1px solid var(--bordo); margin-top: 6px; }
.tendina-sez:first-child { border-top: 0; margin-top: 0; }

/* Mattoni */
.scheda { background: var(--carta); border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 14px; margin-bottom: 10px; }
.scheda.link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.link-semplice { text-decoration: none; color: inherit; }
.scheda.annullato, .annullato { opacity: .55; }
.bordo-warn { border-left: 4px solid var(--warn); }
.riquadro { background: var(--sfondo); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.pila { display: flex; flex-direction: column; gap: 10px; }
.riga { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.riga-spazio { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flex1 { flex: 1; min-width: 0; }
.griglia2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tenue { color: var(--tenue); }
.piccolo { font-size: 13px; }
.centro { text-align: center; }
.nascosto { display: none !important; }
.etich { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--tenue); }
.freccia { font-size: 22px; color: var(--tenue); }
.ok-testo { color: var(--ok); } .warn-testo { color: var(--warn); } .bad-testo { color: var(--bad); }
.dati div { font-size: 14px; } .dati span { display: block; font-size: 12px; color: var(--tenue); }
.nota { font-size: 13px; color: var(--tenue); margin: 0; }
.note { background: var(--warn-chiaro); border-radius: 10px; padding: 10px 12px; font-size: 14px; }

/* Riquadri colorati */
.box { border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; font-size: 14px; background: var(--info-chiaro); }
.box.ok { background: var(--ok-chiaro); } .box.warn { background: var(--warn-chiaro); } .box.bad { background: var(--bad-chiaro); }
.box.info { background: var(--info-chiaro); } .box.scuro { background: var(--blu); color: #fff; }
a.box { display: block; text-decoration: none; color: inherit; }
a.box.riga-spazio { display: flex; }
a.box.scuro { color: #fff; }
.blocco { display: block; margin-top: 2px; opacity: .85; }
.freccia.chiara { color: #fff; opacity: .8; }

/* Etichette */
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #EEF1F5; color: var(--tenue); white-space: nowrap; border: 0; font-family: inherit; }
.tag-ok { background: var(--ok-chiaro); color: var(--ok); } .tag-warn { background: var(--warn-chiaro); color: var(--warn); }
.tag-bad, .tag-urg { background: var(--bad-chiaro); color: var(--bad); }
.tag-fisso { background: var(--info-chiaro); color: var(--blu); }
.tag-file { cursor: pointer; background: var(--info-chiaro); color: var(--blu); }
.badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #fff; background: var(--warn); }
.badge.bad { background: var(--bad); }
.pallino-num { font-size: 12px; background: var(--bad); color: #fff; border-radius: 999px; padding: 1px 8px; }
.punto-blu { width: 9px; height: 9px; border-radius: 50%; background: #2F80ED; flex-shrink: 0; }

/* Pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--bordo); background: var(--carta); color: var(--testo); font: 600 15px var(--font); text-decoration: none; cursor: pointer; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primario { background: var(--blu); color: #fff; border-color: var(--blu); }
.btn.giallo { background: var(--giallo); color: var(--blu-scuro); border-color: var(--giallo); min-height: 38px; padding: 8px 14px; }
.btn.verde { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.wa { background: #25D366; color: #fff; border-color: #25D366; }
.btn.pericolo { color: var(--bad); border-color: #F1C4C4; }
.btn.avviso-btn { border-color: var(--warn); color: var(--warn); }
.btn.tratteggio { border-style: dashed; color: var(--blu); }
.btn.grande { width: 100%; min-height: 52px; font-size: 16px; }
.btn.piccolo { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn-testo { background: none; border: 0; color: var(--blu); font: 600 14px var(--font); cursor: pointer; padding: 6px 0; text-align: left; }
.btn-icona { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--bordo); background: var(--carta); font-size: 22px; cursor: pointer; color: var(--blu); }
.btn-x { width: 32px; height: 32px; border-radius: 8px; border: 0; background: var(--bad-chiaro); color: var(--bad); font-size: 18px; cursor: pointer; }
.link-centro { text-align: center; font-size: 14px; }

/* Campi */
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--tenue); }
input, select, textarea { font: 16px var(--font); color: var(--testo); padding: 11px 12px; border: 1px solid var(--bordo); border-radius: 10px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--giallo); border-color: var(--blu); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--blu); flex-shrink: 0; margin: 0; }
input[type=file] { padding: 9px; background: var(--sfondo); }
/* Safari su iPhone: i campi data/ora hanno una larghezza minima propria e
   un'altezza diversa, e uscivano dalla colonna sovrapponendosi al campo accanto */
.griglia2 > *, label { min-width: 0; }
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; height: 44px; line-height: 20px; text-align: left; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.maiuscolo { text-transform: uppercase; }
.num { width: 80px; flex: none; }
.cerca { margin-bottom: 10px; }
label.spunta { flex-direction: row; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; color: var(--testo); }
fieldset { border: 1px solid var(--bordo); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
legend { font-size: 13px; font-weight: 700; color: var(--tenue); padding: 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--testo); padding: 6px 10px; border: 1px solid var(--bordo); border-radius: 999px; background: #fff; cursor: pointer; }
.chip input { width: 16px; height: 16px; }
.chip:has(input:checked) { background: var(--info-chiaro); border-color: var(--blu); color: var(--blu); }

/* Righe requisiti / elenchi */
.req { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--bordo); text-decoration: none; color: inherit; font-size: 14px; }
.scheda > .req:first-of-type { border-top: 0; }
.ico { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.ico.ok { background: var(--ok); } .ico.bad { background: var(--bad); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--info-chiaro); color: var(--blu); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar.piccolo { width: 34px; height: 34px; font-size: 13px; }
.data-box { width: 52px; text-align: center; border-radius: 12px; background: var(--blu); color: #fff; padding: 6px 0; flex-shrink: 0; }
.data-box span { display: block; font-size: 11px; font-weight: 700; opacity: .85; }
.data-box strong { font-size: 20px; }
.data-box.chiaro { background: var(--info-chiaro); color: var(--blu); }
.gruppo { border-top: 1px solid var(--bordo); padding-top: 12px; margin-top: 12px; }
.gruppo.chiuso { opacity: .8; }
.barra-gruppo { display: flex; align-items: center; gap: 8px; }
.barretta { height: 7px; width: 90px; border-radius: 99px; background: #E9EDF2; overflow: hidden; display: inline-block; }
.barretta.flex1 { width: auto; }
.barretta i { display: block; height: 100%; background: var(--ok); }
.barretta i.warn { background: var(--warn); }

/* Comunicazioni */
.comunicazione { background: var(--carta); border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.comunicazione.urgente { border-left: 4px solid var(--bad); }
.testo-com { font-size: 14px; white-space: pre-line; margin-top: 6px; }

/* Calendario */
.cal-testa, .cal-griglia { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-testa { margin: 12px 0 6px; font-size: 11px; font-weight: 700; color: var(--tenue); }
.giorno { position: relative; aspect-ratio: 1; border: 0; border-radius: 10px; background: transparent; font: 500 15px var(--font); color: var(--testo); cursor: pointer; }
.giorno.sel { background: var(--blu); color: #fff; }
.giorno i { position: absolute; left: 50%; bottom: 5px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--warn); }
.giorno i.mio { background: var(--ok); }
.giorno.oggi:not(.sel) { box-shadow: inset 0 0 0 2px var(--blu); font-weight: 700; }
.mese-titolo { text-transform: capitalize; color: var(--testo); font-size: 16px; }
.cal-legenda { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.cal-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.punto { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.punto.warn { background: var(--warn); } .punto.ok { background: var(--ok); }

/* Schede (tab) */
.schede { display: flex; background: #E9EDF2; border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.schede > * { flex: 1; text-align: center; padding: 9px 6px; border-radius: 9px; border: 0; background: none; font: 600 14px var(--font); color: var(--tenue); text-decoration: none; cursor: pointer; }
.schede .sel { background: #fff; color: var(--blu); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* Home admin */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--carta); border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 14px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; min-height: 96px; }
.contatti { margin-bottom: 4px; }
.contatti-pc { margin-bottom: 10px; gap: 12px; }
.gruppo-form { display: flex; flex-direction: column; gap: 8px; }
details summary { cursor: pointer; font-weight: 600; }

/* Accesso */
.accesso { flex: 1; min-height: 100%; overflow-y: auto; background: var(--blu); }
.accesso-testa { display: flex; align-items: center; gap: 14px; padding: calc(28px + env(safe-area-inset-top)) 22px 24px; color: #fff; }
.logo-tondo { width: 64px; height: 64px; border-radius: 50%; background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-tondo img { width: 88%; height: 88%; object-fit: contain; }
.accesso-nome { font-size: 22px; font-weight: 800; }
.accesso .sotto { opacity: .8; font-size: 14px; }
.accesso-corpo { background: var(--carta); border-radius: 22px 22px 0 0; padding: 22px 18px calc(28px + env(safe-area-inset-bottom)); min-height: calc(100vh - 120px); display: flex; flex-direction: column; gap: 12px; }
.accesso-corpo ol { padding-left: 20px; font-size: 15px; }

/* Avvisi, caricamento, errori */
.avviso { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); max-width: min(92vw, 520px); background: var(--blu-scuro); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.avviso.visibile { opacity: 1; transform: translate(-50%, 0); }
.avviso.bad { background: var(--bad); }
.carica { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.rotella { width: 36px; height: 36px; border: 4px solid #D5DCE5; border-top-color: var(--blu); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.errore-pagina { padding: 40px 18px; display: flex; flex-direction: column; gap: 12px; }

/* Schermi grandi (PC) */
@media (min-width: 800px) {
  body { background: #E4E9F0; }
  #app { box-shadow: 0 0 40px rgba(20,40,66,.12); }
  .contenuto { padding: 20px 24px 32px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 380px) { .griglia2 { grid-template-columns: 1fr; } }

/* Mezzi, inventario, report */
.riepilogo { flex-wrap: nowrap; margin-bottom: 10px; }
.riepilogo .scheda { margin-bottom: 0; padding: 10px 6px; }
.riepilogo strong { font-size: 20px; }
.pulsante-scheda { font: inherit; cursor: pointer; }
.pulsante-box { display: block; width: 100%; text-align: left; border: 0; font: inherit; cursor: pointer; }
.pila-link { align-items: flex-start; }
.blocco-link { display: block; }
.mt6 { margin-top: 6px; }
.grande-num { font-size: 22px; }
.destra-testo { text-align: right; }
.data-stretta { width: 150px !important; flex: none; }
.num-dot { min-width: 28px; text-align: center; }
.btn-icona.piccolo { width: 34px; height: 34px; font-size: 18px; flex-shrink: 0; }
.griglia3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bordo-bad { border-left: 4px solid var(--bad); }
.tabella-scorri { overflow-x: auto; padding: 6px 10px; }
.tabella { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabella th { text-align: left; font-size: 11px; color: var(--tenue); letter-spacing: .05em; text-transform: uppercase; padding: 8px 6px; border-bottom: 1px solid var(--bordo); }
.tabella td { padding: 8px 6px; border-bottom: 1px solid var(--bordo); }
.tabella th:not(:first-child), .tabella td:not(:first-child) { text-align: right; }
.riga-bad td { color: var(--bad); }
label.spunta.riga-spazio { padding: 6px 0; border-top: 1px solid var(--bordo); }

/* Versioni da stampare / salvare in PDF */
.stampa { flex: 1; overflow-y: auto; background: #fff; padding: 16px 18px calc(30px + env(safe-area-inset-bottom)); color: #000; font-size: 14px; }
.stampa-barra { display: flex; gap: 8px; justify-content: space-between; padding-top: env(safe-area-inset-top); margin-bottom: 14px; }
.stampa-testa { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--blu); padding-bottom: 10px; margin-bottom: 12px; }
.stampa-testa img { width: 52px; height: 52px; object-fit: contain; }
.stampa-testa > div { flex: 1; }
.riservato { font-size: 11px; font-weight: 700; color: var(--bad); border: 1px solid var(--bad); padding: 3px 6px; border-radius: 4px; }
.stampa h1 { font-size: 19px; margin: 6px 0 10px; }
.stampa h2 { font-size: 15px; margin: 16px 0 6px; }
.stampa-tab { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.stampa-tab th, .stampa-tab td { border: 1px solid #C9D1DC; padding: 6px 8px; text-align: left; vertical-align: top; }
.stampa-tab th { background: #F1F4F8; width: 38%; font-weight: 600; }
.firme { display: flex; gap: 30px; margin-top: 40px; }
.firme div { flex: 1; border-top: 1px solid #000; padding-top: 4px; font-size: 12px; }
.stampa-piede { margin-top: 24px; font-size: 11px; color: #666; }
@media print {
  html, body { background: #fff; height: auto; }
  #app { position: static; max-width: none; box-shadow: none; display: block; }
  .stampa { overflow: visible; padding: 0; }
  .non-stampare, #avviso { display: none !important; }
  @page { margin: 14mm; }
}

/* PC: menu laterale sempre visibile, contenuto più largo */
@media (min-width: 1000px) {
  #app:has(.tendina) { max-width: none; left: 300px; margin: 0; box-shadow: none; }
  .tendina { transform: none; width: 300px; box-shadow: none; border-right: 1px solid var(--bordo); }
  .velo, .btn-menu, .tendina-testa .btn-icona { display: none; }
  .contenuto { padding: 24px 32px 40px; }
  .contenuto > * { max-width: 980px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .giorno { aspect-ratio: auto; height: 48px; }
  .stampa { max-width: 900px; }
}

/* Notifiche e bollettino */
.btn-menu { position: relative; }
.punto-menu { position: absolute; top: 8px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--giallo); border: 2px solid var(--blu); }
.tendina-voci a .pallino-num { margin-left: auto; }
.non-letta { background: #F4F8FE; }
.tag-arancio { background: #FFE8D6; color: #B4500F; }
.bollettino > div { display: flex; flex-direction: column; gap: 4px; }

/* Comunicazione */
.testo-com.anteprima { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.comunicazione { cursor: pointer; }
.com-titolo { font-size: 22px; margin: 4px 0; display: block; }
.com-testo { font-size: 18px; line-height: 1.55; white-space: pre-line; }
.allegato-foto { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--tenue); }
.allegato-foto img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 10px; background: var(--sfondo); }

/* Bollettino compatto: una riga sotto il calendario, al tocco la tabella a colori */
.boll-riga { background: var(--carta); border-radius: 12px; border: 1px solid #BFD6F4; margin: 8px 0 14px; overflow: hidden; }
.boll-testa { width: 100%; border: 0; background: transparent; font: inherit; color: inherit; display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; font-size: 14px; text-align: left; min-height: 44px; }
.boll-testa .tag { padding: 2px 8px; font-size: 12px; }
.boll-punto { width: 12px; height: 12px; border-radius: 6px; flex-shrink: 0; }
.boll-tit { font-weight: 700; white-space: nowrap; }
.boll-liv { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.boll-testa .freccia { margin-left: auto; transition: transform .2s; }
.boll-riga.aperto .boll-testa .freccia { transform: rotate(90deg); }
.boll-det { padding: 0 12px 12px; }
.boll-seg { display: flex; background: #EEF1F5; border-radius: 8px; padding: 2px; }
.boll-seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 13px; color: #3A4556; }
.boll-seg button.on { background: #fff; color: #142842; font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.boll-tab { display: grid; grid-template-columns: 1.9fr 1fr 1fr 1fr; gap: 4px 6px; align-items: center; font-size: 13px; }
.boll-tab.solo { grid-template-columns: 2fr 1fr; }
.boll-tab .th { font-size: 11px; font-weight: 700; color: var(--tenue); text-transform: uppercase; letter-spacing: .03em; }
.boll-tab .c { text-align: center; }
.boll-tab .zn { font-weight: 600; line-height: 1.25; padding: 2px 0; }
.boll-cella { height: 22px; border-radius: 5px; }
.boll-legenda { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--tenue); }
.boll-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
@media (max-width: 360px) { .boll-tit { display: none; } }

/* Finestra "Chiama" su computer: numero, Copia, QR code */
.velo-chiama { position: fixed; inset: 0; background: rgba(20,36,60,.45); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.finestra-chiama { background: var(--carta); border-radius: 16px; padding: 18px; width: min(340px, 100%); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.numero-grande { font-size: 26px; font-weight: 700; letter-spacing: .02em; text-align: center; user-select: all; }

/* Emergenze */
.voce-emergenza { background: #C92A2A !important; color: #fff !important; border-radius: 10px; margin: 8px 10px 4px; font-weight: 700; }
.voce-emergenza svg { stroke: #fff !important; }
.rosso-emergenza { background: #C92A2A; color: #fff; border: 0; font-weight: 700; }
.box-allerta { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--liv, #C92A2A); color: #fff; text-decoration: none; margin-bottom: 12px; box-shadow: 0 4px 14px rgba(201,42,42,.3); animation: pulsa 1.6s ease-in-out infinite; }
.box-allerta.risposto { animation: none; opacity: .92; }
.box-allerta .blocco { display: block; opacity: .92; }
@keyframes pulsa { 50% { box-shadow: 0 4px 22px rgba(201,42,42,.6); } }
.ico-allerta { width: 36px; height: 36px; border-radius: 18px; background: #fff; color: var(--liv, #C92A2A); font-weight: 900; font-size: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ico-allerta.grande { width: 60px; height: 60px; border-radius: 30px; font-size: 36px; }
.allerta-grande { background: var(--liv, #C92A2A); color: #fff; border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.allerta-grande h2 { color: #fff; margin: 0; font-size: 22px; }
.allerta-grande p { margin: 0; font-size: 17px; line-height: 1.45; }
.allerta-grande.piccola h2 { font-size: 18px; }
.grande-testo { font-size: 19px; }
.grande-si { background: #2B8A3E; color: #fff; border: 0; min-height: 56px; font-size: 17px; font-weight: 700; }
.grande-no { background: #fff; color: #C92A2A; border: 2px solid #C92A2A; min-height: 56px; font-size: 17px; font-weight: 700; }
.conta-allerta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.conta-allerta > div { background: var(--carta); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; }
.conta-allerta strong { font-size: 26px; }
.conta-allerta span { font-size: 12px; color: var(--tenue); text-align: center; }

/* "Da fare" dell'amministratore e pallini del menu */
.da-fare { gap: 2px; }
.voce-da-fare { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--linea, #E3E8EF); color: inherit; text-decoration: none; font-size: 15px; line-height: 1.35; min-height: 44px; }
.da-fare h2 + .voce-da-fare { border-top: 0; }
.pallino { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; background: var(--giallo, #F2B705); }
.pallino.bad { background: var(--bad, #C92A2A); }
.tutto-ok { color: var(--ok, #2B8A3E); font-weight: 600; padding: 6px 0; }
.pallino-sez.warn { background: var(--giallo, #F2B705); color: #142842; }
.pallino-sez.bad { background: var(--bad, #C92A2A); color: #fff; }
.voce-emergenza .in-corso { background: #fff; color: #C92A2A; font-size: 11px; font-weight: 800; }
.punto-menu.bad { background: var(--bad, #C92A2A); }
.link-nudo { color: inherit; text-decoration: none; }
.guida summary { cursor: pointer; padding: 6px 0; }
.guida ol { margin: 6px 0 4px; padding-left: 20px; line-height: 1.5; }
