/* App dell'operatore */
body { background: var(--carta); min-height: 100dvh; }
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

/* Testata della giornata: orologio grande su inchiostro, con i quattro colori del logo come filo */
.giornata {
  position: relative; overflow: hidden; color: #fff; background: var(--inchiostro);
  padding: calc(18px + env(safe-area-inset-top)) 22px 86px; border-radius: 0 0 34px 34px;
}
.giornata::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg, var(--cielo) 0 25%, var(--foglia) 25% 50%, var(--sole) 50% 75%, var(--arancio) 75%);
}
.giornata .su { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.giornata .chi { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.giornata .chi img { width: 38px; height: 38px; background: #fff; border-radius: 12px; padding: 4px; }
.giornata .chi small { display: block; font-weight: 450; opacity: .75; font-size: .82rem; }
.giornata .esci { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 999px; padding: 8px 14px; font-size: .85rem; }
.giornata .ora {
  font-size: clamp(4.2rem, 22vw, 6.2rem); font-weight: 760; letter-spacing: -0.045em; line-height: .9;
  margin-top: 26px; font-variant-numeric: tabular-nums;
}
.giornata .ora span { opacity: .55; }
.giornata .data { font-size: 1.1rem; opacity: .85; margin-top: 8px; text-transform: capitalize; }
.giornata .saluto { margin-top: 2px; font-size: 1.1rem; font-weight: 600; }

/* Il turno di oggi */
.turni { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.turno {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 12px;
  background: rgba(255,255,255,.1); font-size: .92rem;
}
.turno b { background: var(--sole); color: var(--inchiostro); border-radius: 8px; padding: 2px 7px; font-variant-numeric: tabular-nums; }
.turno.fatto { opacity: .55; text-decoration: line-through; }

/* Il pulsante: unico elemento forte della schermata */
.azione { display: grid; justify-items: center; margin-top: -74px; position: relative; z-index: 2; }
.timbra {
  --c: var(--ok);
  width: 196px; height: 196px; border-radius: 50%; border: 0; padding: 12px; position: relative;
  background: conic-gradient(var(--cielo) 0 25%, var(--foglia) 0 50%, var(--sole) 0 75%, var(--arancio) 0);
  box-shadow: 0 18px 40px rgba(27,31,94,.28); transition: transform .15s ease;
}
.timbra:active { transform: scale(.96); }
.timbra .dentro {
  width: 100%; height: 100%; border-radius: 50%; background: var(--c); color: #fff;
  display: grid; place-content: center; text-align: center; box-shadow: inset 0 0 0 6px #fff;
}
.timbra .dentro strong { font-size: 2.3rem; font-weight: 780; letter-spacing: -0.02em; line-height: 1; }
.timbra .dentro small { font-size: .95rem; opacity: .9; margin-top: 6px; }
.timbra.uscita { --c: var(--arancio); }
.timbra.attesa { animation: gira 1.6s linear infinite; }
.timbra.attesa .dentro { animation: gira 1.6s linear infinite reverse; }
@keyframes gira { to { transform: rotate(360deg); } }
.sotto-azione { margin-top: 14px; color: var(--testo-2); font-size: .95rem; text-align: center; padding: 0 24px; }
.sotto-azione button { background: none; border: 0; color: var(--inchiostro-2); text-decoration: underline; font-weight: 600; padding: 6px; }

.coda {
  margin: 16px 18px 0; padding: 12px 16px; border-radius: 14px; background: #FFF4D6; color: #6B4C00;
  display: flex; gap: 10px; align-items: center; font-size: .95rem;
}

/* Le altre voci: elenco tranquillo */
.voci { margin: 26px 16px 0; background: #fff; border-radius: 22px; box-shadow: var(--ombra); overflow: hidden; }
.voce {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; width: 100%;
  padding: 14px 16px; background: none; border: 0; text-align: left; border-bottom: 1px solid var(--linea);
}
.voce:last-child { border-bottom: 0; }
.voce .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.voce .ico svg { width: 24px; height: 24px; }
.voce strong { display: block; font-weight: 650; }
.voce small { color: var(--testo-2); font-size: .88rem; }
.voce .conta { background: var(--arancio); color: #fff; border-radius: 999px; min-width: 26px; padding: 2px 8px; text-align: center; font-weight: 700; font-size: .85rem; }
.voce .freccia { color: #B5BAD0; }

.whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 18px 16px 0;
  min-height: 54px; border-radius: 18px; background: #25D366; color: #073B1E; font-weight: 700; text-decoration: none;
}
.whatsapp svg { width: 24px; height: 24px; }

.piede { text-align: center; color: #9DA2C2; font-size: .8rem; margin-top: 18px; }

/* Pagine interne */
.pagina { padding: calc(14px + env(safe-area-inset-top)) 18px 24px; }
.testata { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.testata .indietro { width: 44px; height: 44px; border-radius: 14px; border: 0; background: #fff; box-shadow: var(--ombra); display: grid; place-items: center; }
.testata h1 { font-size: 1.6rem; font-weight: 750; }
.foglio { background: #fff; border-radius: 22px; padding: 20px; box-shadow: var(--ombra); margin-bottom: 16px; }
.foglio h2 { font-size: 1.15rem; margin-bottom: 12px; }
.nota-guida { color: var(--testo-2); font-size: .95rem; margin: 0 0 14px; }

/* Scelta sede */
.sedi-scelta { display: grid; gap: 8px; }
.sede-opz {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 14px 16px; border-radius: 16px;
  border: 2px solid var(--linea); background: #fff; text-align: left;
}
.sede-opz[aria-pressed="true"] { border-color: var(--ok); background: #F1F8EA; }
.sede-opz small { color: var(--testo-2); display: block; }
.sede-opz .orario { font-weight: 700; font-variant-numeric: tabular-nums; }
.cerca { margin: 10px 0; }

.interruttore { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.interruttore input { width: 52px; height: 30px; appearance: none; background: var(--linea); border-radius: 999px; position: relative; transition: background .2s; flex: none; }
.interruttore input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.interruttore input:checked { background: var(--ok); }
.interruttore input:checked::after { transform: translateX(22px); }

/* Firma */
.firma-area { position: relative; border: 2px dashed #C3C8DC; border-radius: 16px; background: #FCFCFE; touch-action: none; }
.firma-area canvas { display: block; width: 100%; height: 180px; }
.firma-area .vuota { position: absolute; inset: 0; display: grid; place-items: center; color: #A5AAC6; pointer-events: none; }
.firma-azioni { display: flex; justify-content: flex-end; margin-top: 6px; }
.firma-azioni button { background: none; border: 0; color: var(--testo-2); text-decoration: underline; }

/* Esito */
.esito { min-height: 100dvh; display: grid; place-content: center; justify-items: center; text-align: center; padding: 24px; color: #fff; }
.esito.entrata { background: var(--ok); }
.esito.uscita { background: var(--arancio); }
.esito.coda-locale { background: var(--inchiostro); }
.esito .spunta { width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; animation: entra-logo .5s cubic-bezier(.2,.9,.25,1.2) both; }
.esito .spunta svg { width: 64px; height: 64px; }
.esito h1 { font-size: 2.6rem; font-weight: 780; margin-top: 22px; }
.esito .grande { font-size: 4rem; font-weight: 760; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; margin-top: 10px; }
.esito p { font-size: 1.15rem; opacity: .92; margin: 10px 0 0; }

/* Elenchi */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { padding: 14px 0; border-bottom: 1px solid var(--linea); }
.lista li:last-child { border-bottom: 0; }
.lista .riga { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.lista small { color: var(--testo-2); }
.stato { display: inline-block; font-size: .8rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--linea); }
.stato.approvata { background: #E1F2D3; color: #2D6A1E; }
.stato.rifiutata { background: #FBE0DD; color: #9B2A21; }
.stato.richiesta { background: #FFF1C9; color: #6B4C00; }
.vuoto { color: var(--testo-2); text-align: center; padding: 22px 8px; }
.schede { display: flex; gap: 6px; background: #E7EAF3; padding: 4px; border-radius: 14px; margin-bottom: 14px; }
.schede button { flex: 1; border: 0; background: none; padding: 10px 6px; border-radius: 11px; font-weight: 650; color: var(--testo-2); }
.schede button[aria-selected="true"] { background: #fff; color: var(--inchiostro); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* Accesso e attivazione */
.benvenuto { min-height: 100dvh; display: grid; align-content: center; padding: 28px 24px; text-align: center; background: #fff; }
.benvenuto img { width: 132px; margin: 0 auto 18px; }
.benvenuto h1 { font-size: 2rem; font-weight: 760; }
.benvenuto p { color: var(--testo-2); margin: 10px auto 26px; max-width: 34ch; }
.benvenuto .btn { min-height: 58px; font-size: 1.1rem; }
.impronta { width: 26px; height: 26px; }

/* Schede a comparsa (installazione, notifiche) */
.velo { position: fixed; inset: 0; background: rgba(27,31,94,.45); z-index: 50; display: grid; align-items: end; animation: sale .25s ease both; }
.cassetto { background: #fff; border-radius: 26px 26px 0 0; padding: 24px 22px calc(24px + env(safe-area-inset-bottom)); max-width: 560px; width: 100%; margin: 0 auto; }
.cassetto h2 { font-size: 1.35rem; margin-bottom: 8px; }
.cassetto p { color: var(--testo-2); margin: 0 0 18px; }
.cassetto .passi { margin: 0 0 18px; padding-left: 20px; color: var(--testo); }
.cassetto .passi li { margin-bottom: 8px; }
.cassetto .pulsanti { display: grid; gap: 10px; }
