@font-face { font-family: Benzin; src: url(/static/brand/Benzin-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
:root {
  --rosso: #cc1421; --scuro: #18191a; --crema: #f8f4ee; --carta: #fff; --linea: #e4ddd3; --grigio: #6f6a64;
  --verde: #1f9d55; --arancio: #e08a00; --blu: #2f6fdf; --rossochiaro: #fdecee;
  --r: 12px; --barra: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--crema); color: #1d1d1b;
  padding-bottom: calc(var(--barra) + env(safe-area-inset-bottom) + 12px); }
a { color: var(--rosso); text-decoration: none; }
h1, h2, h3 { font-family: Benzin, system-ui, sans-serif; letter-spacing: .02em; line-height: 1.2; margin: .2em 0 .5em; }
h1 { font-size: 1.25rem; } h2 { font-size: 1.05rem; } h3 { font-size: .95rem; }
.testa { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  background: var(--scuro); color: var(--crema); padding: calc(env(safe-area-inset-top) + 8px) 14px 8px; }
.marchio { display: flex; align-items: center; gap: 8px; color: var(--crema); font-family: Benzin, sans-serif; font-size: .95rem; }
.marchio img { width: 30px; height: 30px; border-radius: 8px; }
.campanella { color: var(--crema); font-size: 1.2rem; position: relative; padding: 4px 8px; }
.campanella b { position: absolute; top: -2px; right: -2px; background: var(--rosso); color: #fff; font-size: .7rem; border-radius: 9px;
  min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.pagina { max-width: 980px; margin: 0 auto; padding: 14px; }
.barra { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--scuro); padding-bottom: env(safe-area-inset-bottom); height: calc(var(--barra) + env(safe-area-inset-bottom)); }
.barra a { color: #bdb6ad; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .7rem; gap: 2px; }
.barra a i { font-style: normal; font-size: 1.35rem; line-height: 1; }
.barra a.su { color: #fff; }
.barra a.scan i { background: var(--rosso); color: #fff; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  margin-top: -18px; box-shadow: 0 4px 14px rgba(204, 20, 33, .45); font-size: 1.5rem; }
.scheda { background: var(--carta); border: 1px solid var(--linea); border-radius: var(--r); padding: 14px; margin: 0 0 12px; }
.griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tasto-grande { display: flex; flex-direction: column; gap: 6px; background: var(--carta); border: 1px solid var(--linea); border-radius: var(--r);
  padding: 16px 12px; color: inherit; min-height: 92px; }
.tasto-grande b { font-family: Benzin, sans-serif; font-size: .9rem; }
.tasto-grande span { color: var(--grigio); font-size: .82rem; }
.tasto-grande.rosso { background: var(--rosso); color: #fff; border-color: var(--rosso); }
.tasto-grande.rosso span { color: #ffd9dc; }
.tasto-grande.scuro { background: var(--scuro); color: #fff; border-color: var(--scuro); }
.tasto-grande.scuro span { color: #bdb6ad; }
button, .bottone { appearance: none; border: 0; border-radius: 10px; background: var(--rosso); color: #fff; font: inherit; font-weight: 600;
  padding: 12px 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; }
button.chiaro, .bottone.chiaro { background: #efe8de; color: #1d1d1b; }
button.scuro, .bottone.scuro { background: var(--scuro); }
button.verde, .bottone.verde { background: var(--verde); }
button.piccolo, .bottone.piccolo { padding: 6px 10px; min-height: 34px; font-size: .85rem; }
button:disabled { opacity: .5; }
.pieno { width: 100%; }
label { display: block; font-size: .85rem; color: var(--grigio); margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 11px 12px; border: 1px solid #d6cdc1; border-radius: 10px; background: #fff; color: inherit; }
input[type=checkbox], input[type=radio] { width: auto; transform: scale(1.3); margin-right: 8px; }
textarea { min-height: 90px; }
.riga { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.riga > * { flex: 1 1 140px; }
.spunta { display: flex; align-items: flex-start; gap: 6px; color: inherit; font-size: .95rem; margin: 10px 0; }
.nota { border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: .92rem; }
.nota.ok { background: #e4f5ea; color: #145c33; }
.nota.ko { background: var(--rossochiaro); color: #8e0e18; }
.nota.info { background: #eaf0fd; color: #1c3f8a; }
.nota.attenzione { background: #fff3dc; color: #7a4a00; }
.chip { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 20px; background: #efe8de; color: #4b453f; white-space: nowrap; }
.chip.disponibile, .chip.ok, .chip.confermata, .chip.confermato, .chip.chiuso, .chip.approvato, .chip.controllato { background: #e4f5ea; color: #145c33; }
.chip.in_uso, .chip.in_corso, .chip.in_attesa, .chip.in_lettura, .chip.da_controllare, .chip.bozza { background: #eaf0fd; color: #1c3f8a; }
.chip.in_noleggio { background: #f1e7fb; color: #5a2a8c; }
.chip.in_riparazione, .chip.da_riprogrammare, .chip.in_ritardo, .chip.danno, .chip.mancante, .chip.da_approvare, .chip.chiuso_con_danni { background: #fff3dc; color: #7a4a00; }
.chip.dismesso, .chip.annullato, .chip.annullata, .chip.ceduta, .chip.rifiutato, .chip.errore { background: #eee; color: #777; }
.elenco { list-style: none; margin: 0; padding: 0; }
.elenco > li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.elenco > li:last-child { border-bottom: 0; }
.elenco .miniatura { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; background: #efe8de; flex: none; display: grid; place-items: center; color: #b3aaa0; font-size: 1.3rem; }
.elenco .corpo { flex: 1; min-width: 0; }
.elenco .corpo b { display: block; overflow: hidden; text-overflow: ellipsis; }
.elenco .corpo small { color: var(--grigio); }
.piccolo { font-size: .85rem; color: var(--grigio); }
.codice { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; background: #efe8de; padding: 1px 6px; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--linea); vertical-align: top; }
th { font-size: .78rem; color: var(--grigio); font-weight: 600; }
.tabella { overflow-x: auto; }
.azioni { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.foto-scheda { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.foto-scheda figure { margin: 0; flex: none; }
.foto-scheda img { height: 150px; border-radius: 10px; display: block; }
.foto-scheda figcaption { font-size: .72rem; color: var(--grigio); display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.cerca { display: flex; gap: 8px; margin-bottom: 12px; }
.cerca input { flex: 1; }
.schede-conti { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 4px; }
.schede-conti a { flex: none; background: var(--carta); border: 1px solid var(--linea); border-radius: 10px; padding: 8px 12px; color: inherit; font-size: .85rem; }
.schede-conti a b { display: block; font-size: 1.1rem; }
.schede-conti a.su { border-color: var(--rosso); box-shadow: inset 0 0 0 1px var(--rosso); }
/* scanner */
.scanner { position: relative; background: #000; border-radius: var(--r); overflow: hidden; aspect-ratio: 4/3; max-height: 55vh; width: 100%; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .mirino { position: absolute; inset: 18% 22%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.scanner .stato { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); font-size: .85rem; }
.scanner.lampo .mirino { border-color: #3ddc84; }
.scanner.errore .mirino { border-color: var(--rosso); }
.scanner-spento { display: grid; place-items: center; text-align: center; color: #ddd; padding: 20px; height: 100%; }
.lista-scan > li { align-items: flex-start; }
.lista-scan .q { width: 70px; flex: none; }
.lista-scan .togli { background: transparent; color: var(--grigio); min-height: 0; padding: 4px 8px; font-size: 1.2rem; }
.lista-scan .esiti { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.lista-scan .esiti label { margin: 0; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--linea); border-radius: 20px; padding: 4px 10px; font-size: .85rem; color: inherit; }
.lista-scan .esiti input { transform: none; margin: 0; }
.lista-scan .esiti label.su-ok { background: #e4f5ea; border-color: #9fd8b5; }
.lista-scan .esiti label.su-danno { background: #fff3dc; border-color: #f0c675; }
.lista-scan .esiti label.su-mancante { background: var(--rossochiaro); border-color: #f2a5ac; }
/* firma */
.firma { border: 2px dashed #cfc5b8; border-radius: var(--r); background: #fff; position: relative; touch-action: none; }
.firma canvas { width: 100%; height: 180px; display: block; }
.firma .cancella { position: absolute; top: 6px; right: 6px; }
.firma .suggerimento { position: absolute; left: 12px; bottom: 8px; color: #b8aea2; font-size: .8rem; pointer-events: none; }
/* agenda sala */
.giorno { margin-bottom: 14px; }
.giorno h3 { font-family: system-ui, sans-serif; font-size: .9rem; text-transform: capitalize; color: var(--grigio); margin: 0 0 6px; }
.giorno.oggi h3 { color: var(--rosso); }
.prenot { display: block; color: inherit; background: var(--carta); border: 1px solid var(--linea); border-left: 6px solid var(--blu); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.prenot small { color: var(--grigio); display: block; }
.vuoto { color: #aaa29a; font-size: .85rem; padding: 4px 0; }
.pallino { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
/* etichette */
.foglio { display: grid; gap: 2mm; background: #fff; padding: 4mm; }
.etichetta { border: 1px dashed #ccc; display: flex; align-items: center; gap: 2mm; padding: 1.5mm; overflow: hidden; page-break-inside: avoid; background: #fff; color: #000; }
.etichetta svg { flex: none; }
.etichetta .t { min-width: 0; line-height: 1.1; }
.etichetta .t b { font-family: ui-monospace, Menlo, monospace; display: block; }
.etichetta .t span { display: block; overflow: hidden; }
.foglio.piccola { grid-template-columns: repeat(5, 38mm); } .piccola .etichetta { height: 21mm; } .piccola svg { width: 18mm; height: 18mm; } .piccola .t { font-size: 6.5pt; } .piccola .t b { font-size: 8pt; }
.foglio.media { grid-template-columns: repeat(3, 63mm); } .media .etichetta { height: 34mm; } .media svg { width: 30mm; height: 30mm; } .media .t { font-size: 8pt; } .media .t b { font-size: 11pt; }
.foglio.grande { grid-template-columns: repeat(2, 95mm); } .grande .etichetta { height: 48mm; } .grande svg { width: 44mm; height: 44mm; } .grande .t { font-size: 10pt; } .grande .t b { font-size: 14pt; }
@media print {
  body { background: #fff; padding: 0; }
  .testa, .barra, .non-stampare, .nota { display: none !important; }
  .pagina { max-width: none; padding: 0; }
  .etichetta { border-color: transparent; }
  @page { size: A4; margin: 6mm; }
}
.carica { display: inline-block; width: 18px; height: 18px; border: 3px solid #ddd; border-top-color: var(--rosso); border-radius: 50%; animation: gira 1s linear infinite; vertical-align: middle; }
@keyframes gira { to { transform: rotate(360deg); } }
details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.dueColonne { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .dueColonne { grid-template-columns: 1fr 1fr; } }
.accesso { min-height: 100vh; display: grid; place-items: center; background: var(--scuro); padding: 20px; }
.accesso .scatola { background: var(--carta); border-radius: 16px; padding: 24px; width: 100%; max-width: 380px; }
.accesso .logo { text-align: center; margin-bottom: 16px; }
.accesso .logo img { width: 72px; height: 72px; border-radius: 16px; }
.codice-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-family: ui-monospace, monospace; }
.separatore { text-align: center; color: var(--grigio); font-size: .8rem; margin: 14px 0; }
.voce-scelta { border: 1px solid var(--linea); border-radius: 10px; padding: 8px; margin: 6px 0; display: flex; gap: 8px; align-items: center; }
.r-incerta { background: #fff8e8; }
.come { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #e08a00; color: #fff; padding: 6px 14px; font-size: .88rem; }
.come button { background: #fff; color: #7a4a00; }
.livelli { display: grid; grid-template-columns: 1fr; gap: 8px; }
.livello { border: 1px solid var(--linea); border-left: 6px solid var(--blu); border-radius: 10px; padding: 10px 12px; background: var(--carta); }
.livello b { font-family: Benzin, sans-serif; font-size: .9rem; }
.livello ul { margin: 6px 0 0; padding-left: 18px; font-size: .88rem; color: #3b3732; }
.livello.admin { border-left-color: var(--rosso); } .livello.capo_reparto { border-left-color: var(--arancio); }
.livello.operatore { border-left-color: var(--blu); } .livello.controllo { border-left-color: var(--verde); }
/* .piccolo (testo grigio) non deve scolorire i bottoni piccoli */
.bottone.piccolo, button.piccolo { color: #fff; }
.bottone.chiaro.piccolo, button.chiaro.piccolo { color: #1d1d1b; }
.come button.piccolo { color: #7a4a00; }
