/* Ferrowine Experience — stile derivato da ferro.treelabagency.com (Bebas + Barlow, crema/bordeaux) */
@font-face { font-family: 'Bebas'; src: url('/assets/fonts/BebasNeue-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/assets/fonts/Barlow-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --bordeaux: #5c302c;
  --bordeaux-dark: #46211f;
  --bordeaux-deep: #3a1a18;
  --brown: #3b3323;
  --brown-2: #4a4437;
  --cream: #f0ead9;
  --paper: #f7f3ea;
  --sand: #ede7dc;
  --ocra: #d89a3d;
  --ink: #3b3323;
  --ink-soft: #7a715e;
  --line: #d8cfb8;
  --ok: #5a7d46;
  --warn: #b8862f;
  --err: #a33c2f;
  --radius: 20px;
  --shadow: 0 18px 44px rgba(30, 18, 12, .22);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--sand);
  color: var(--ink);
  font-size: 15px;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
h1, h2, h3 { font-family: 'Bebas', 'Barlow', sans-serif; font-weight: 400; letter-spacing: .6px; }
img { max-width: 100%; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.vuoto { color: var(--ink-soft); font-size: 14px; padding: 14px 0; text-align: center; }
[hidden] { display: none !important; }

/* ---------- marchio ufficiale Ferrowine ---------- */
.pub-top .logo img { height: 26px; display: block; }
.topbar .brand img { height: 21px; display: block; }
.login-logo { height: 34px; display: block; }

/* ---------- bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bordeaux); color: var(--cream); border: 1px solid var(--bordeaux);
  padding: 11px 22px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 14.5px;
  text-decoration: none; cursor: pointer; transition: filter .12s ease, background .12s ease;
}
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .55; cursor: default; filter: none; }
.btn-big { width: 100%; padding: 15px 22px; font-size: 16px; }
.btn-small { padding: 8px 16px; font-size: 13.5px; }
.btn-mini { padding: 5px 12px; font-size: 12.5px; border-radius: 999px; }
.btn-ghost { background: transparent; color: var(--bordeaux); border-color: var(--line); }
.btn-ghost:hover { background: rgba(92, 48, 44, .07); filter: none; }
.btn-cream { background: var(--cream); color: var(--brown); border-color: var(--cream); }
.btn-ghost.danger { color: var(--err); border-color: rgba(163, 60, 47, .35); }

/* ---------- pagine pubbliche ---------- */
body.pub {
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(216, 154, 61, .12), transparent 70%),
    var(--bordeaux-dark);
  color: var(--cream);
  display: flex; flex-direction: column;
}
.pub-top { display: flex; align-items: center; padding: 22px 26px; color: var(--cream); }
.pub-foot {
  margin-top: auto; padding: 28px 26px 34px; text-align: center;
  color: rgba(240, 234, 217, .5); font-size: 12.5px; line-height: 1.7;
}
.pub-foot-min { opacity: .7; }

.ev { padding: 6px 22px 40px; }
.ev-grid {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: 340px 1fr; gap: 40px; align-items: start;
}
.ev-poster { border-radius: var(--radius); display: block; box-shadow: var(--shadow); }
.ev-facts { margin-top: 22px; display: grid; gap: 16px; }
.fact { display: grid; gap: 3px; }
.fact-k { font-size: 11px; letter-spacing: 2.4px; text-transform: uppercase; color: rgba(240, 234, 217, .5); }
.fact-v { font-size: 15.5px; line-height: 1.5; color: var(--cream); font-weight: 500; }
.fact-min { color: rgba(240, 234, 217, .62); font-weight: 400; font-size: 14px; }
.fact-link { color: var(--ocra); font-size: 13.5px; }

.ev-title { font-size: 44px; line-height: 1.02; margin: 6px 0 10px; color: var(--cream); }
.ev-sub { margin: 0 0 14px; font-size: 17px; color: rgba(240, 234, 217, .75); }
.ev-descr { font-size: 15.5px; line-height: 1.72; color: rgba(240, 234, 217, .8); margin-bottom: 26px; max-width: 62ch; }

.card { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.form-title { font-size: 27px; margin: 0 0 18px; }
.form-foot { margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); text-align: center; }
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.fld { margin-bottom: 16px; }
.fld > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.fld > label span { color: var(--bordeaux); }
.fld > label .opt { color: var(--ink-soft); font-weight: 400; font-size: 12px; }
.fld input, .fld textarea, .fld select {
  width: 100%; font: inherit; font-size: 15.5px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  outline: none; transition: border-color .12s ease, box-shadow .12s ease;
}
.fld textarea { resize: vertical; }
.fld input:focus, .fld textarea:focus {
  border-color: var(--bordeaux); box-shadow: 0 0 0 3px rgba(92, 48, 44, .12);
}
.fld.ko input, .fld.ko textarea { border-color: var(--err); }
.fld-hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 5px; }
.fld-err { font-size: 12.5px; color: var(--err); margin-top: 5px; font-weight: 500; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fld-row .fld { margin-bottom: 16px; }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 62px;
  padding: 11px 18px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
  cursor: pointer; font-size: 15px; font-weight: 600; transition: all .12s ease;
}
.seg-item input:checked + span { background: var(--bordeaux); border-color: var(--bordeaux); color: var(--cream); }
.seg-item input:focus-visible + span { box-shadow: 0 0 0 3px rgba(92, 48, 44, .2); }

.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; font-weight: 400 !important; }
.chk input { width: 19px; height: 19px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--bordeaux); }
.chk .req { color: var(--bordeaux); }

.box { border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.55; margin-bottom: 16px; }
.box-err { background: rgba(163, 60, 47, .1); color: #7d2b21; border: 1px solid rgba(163, 60, 47, .3); }
.box-warn { background: rgba(216, 154, 61, .14); border: 1px solid rgba(184, 134, 47, .35); color: #6d5218;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.box-chiuso { background: var(--paper); color: var(--ink); padding: 22px 24px; }
.box-chiuso strong { display: block; font-size: 17px; margin-bottom: 4px; }
.box-chiuso p { margin: 0; color: var(--ink-soft); }

/* ---------- conferma e pass ---------- */
.centro { padding: 10px 22px 40px; display: flex; justify-content: center; }
.ok-card { max-width: 520px; width: 100%; text-align: center; padding: 34px 30px; }
.ok-bollo {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--ok); color: #fff; font-size: 28px; line-height: 54px;
}
.ok-card h1 { font-size: 34px; margin: 0 0 8px; }
.ok-lead { margin: 0 0 6px; font-size: 16px; line-height: 1.6; }
.ok-mail { margin: 0 0 20px; font-size: 14px; color: var(--ink-soft); }
.ok-warn { color: var(--err); font-weight: 600; }
.riepilogo { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; text-align: left;
  margin: 18px 0 4px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.riepilogo dt { font-size: 11.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-soft); }
.riepilogo dd { margin: 0; font-size: 15px; font-weight: 600; }
.riepilogo .min { font-weight: 400; color: var(--ink-soft); font-size: 13.5px; }
.ok-nota { margin: 18px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); }
.ok-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: inline-block; }
.qr { width: 220px; height: 220px; margin: 0 auto; }
.qr svg, .pass-qr svg { width: 100%; height: 100%; display: block; }
.qr-cod { margin-top: 12px; }
.qr-cod span { display: block; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-soft); }
.qr-cod strong { font-size: 21px; letter-spacing: 3px; font-family: ui-monospace, Menlo, monospace; }
.qr-note { font-size: 13.5px; color: var(--ink-soft); margin: 14px 0 0; }

.pass { padding: 6px 18px 36px; display: flex; justify-content: center; }
.pass-card { background: var(--paper); color: var(--ink); border-radius: 24px; box-shadow: var(--shadow);
  max-width: 420px; width: 100%; padding: 26px 24px 24px; text-align: center; }
.pass-head { border-bottom: 1px dashed var(--line); padding-bottom: 14px; margin-bottom: 18px; }
.pass-ev { font-family: 'Bebas'; font-size: 25px; line-height: 1.1; }
.pass-when { font-size: 14px; color: var(--ink-soft); margin-top: 3px; }
.pass-stato { border-radius: 999px; padding: 8px 16px; font-size: 13.5px; font-weight: 600; margin-bottom: 16px; display: inline-block; }
.pass-stato.usato { background: rgba(216, 154, 61, .18); color: #7a5a15; }
.pass-stato.ko { background: rgba(163, 60, 47, .12); color: var(--err); }
.pass-qr { width: 250px; height: 250px; margin: 0 auto; background: #fff; border-radius: 16px; padding: 10px; border: 1px solid var(--line); }
.pass-qr.spenta { opacity: .25; }
.pass-cod { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: 4px; margin: 14px 0 18px; }
.pass-dati { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; text-align: left; margin: 0 0 20px;
  border-top: 1px solid var(--line); padding-top: 16px; }
.pass-dati dt { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-soft); }
.pass-dati dd { margin: 0; font-size: 15px; font-weight: 600; }
.pass-dati .min { font-weight: 400; color: var(--ink-soft); font-size: 13.5px; }
.pass-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pass-note { font-size: 12.5px; color: var(--ink-soft); margin: 16px 0 0; }

/* ---------- login ---------- */
body.bare { background: var(--brown); color: var(--cream); }
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(52% 42% at 50% 34%, rgba(216, 154, 61, .16), transparent 70%); }
.login-inner { width: 100%; max-width: 360px; }
.login-tag { font-size: 11.5px; letter-spacing: 3.4px; text-transform: uppercase; color: rgba(240, 234, 217, .5); margin: 12px 0 34px; }
.login-form label { display: block; font-size: 12.5px; color: rgba(240, 234, 217, .6); margin: 14px 0 6px; }
.login-form input {
  width: 100%; font: inherit; font-size: 16px; color: var(--cream);
  background: rgba(240, 234, 217, .1); border: 1px solid rgba(240, 234, 217, .18);
  border-radius: 12px; padding: 12px 14px; outline: none;
}
.login-form input:focus { border-color: var(--ocra); background: rgba(240, 234, 217, .16); }
.login-form .btn { margin-top: 24px; width: 100%; }
.login-err { background: rgba(163, 60, 47, .22); border: 1px solid rgba(163, 60, 47, .4);
  color: #ffd9d2; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; }

/* ---------- admin ---------- */
body.adm { background: var(--sand); }
.topbar { background: var(--brown); color: var(--cream); display: flex; align-items: center; gap: 22px;
  padding: 0 20px; height: 58px; position: sticky; top: 0; z-index: 60; }
.topbar .brand { display: flex; align-items: center; text-decoration: none; color: var(--cream); }
.topbar nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.topbar nav a { color: var(--cream); text-decoration: none; padding: 8px 14px; border-radius: 999px;
  font-weight: 500; font-size: 14.5px; opacity: .82; white-space: nowrap; }
.topbar nav a.on, .topbar nav a:hover { background: rgba(240, 234, 217, .14); opacity: 1; }
.topbar nav a.scan-link { border: 1px solid rgba(240, 234, 217, .3); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.menu { position: relative; }
.menu-btn { background: transparent; border: 0; color: var(--cream); font: inherit; font-size: 14px; cursor: pointer; opacity: .9; }
.menu-drop { position: absolute; right: 0; top: 34px; background: var(--paper); border-radius: 14px;
  box-shadow: var(--shadow); padding: 6px; min-width: 190px; z-index: 70; }
.menu-drop a { display: block; padding: 9px 14px; border-radius: 9px; text-decoration: none; color: var(--ink); font-size: 14px; }
.menu-drop a:hover { background: var(--cream); }

.evbar { background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.evbar-form { display: flex; align-items: center; gap: 8px; }
.evbar-form label { font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink-soft); }
.evbar select, .mini-sel { font: inherit; font-size: 14px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); max-width: 60vw; }
.evbar-info { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.evbar-link { font-size: 13px; color: var(--bordeaux); }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }

.pill { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; padding: 3px 10px;
  border-radius: 999px; font-weight: 700; }
.pill-aperto { background: rgba(90, 125, 70, .16); color: #3f5c31; }
.pill-chiuso { background: rgba(163, 60, 47, .12); color: var(--err); }
.pill-bozza { background: rgba(122, 113, 94, .15); color: var(--ink-soft); }
.pill-in { background: rgba(90, 125, 70, .16); color: #3f5c31; }
.pill-admin { background: rgba(92, 48, 44, .12); color: var(--bordeaux); }
.pill-staff { background: rgba(122, 113, 94, .15); color: var(--ink-soft); }
.tag { font-size: 12px; background: var(--cream); border-radius: 6px; padding: 2px 7px; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--paper); border-radius: 16px; padding: 16px 18px; }
.kpi-k { font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--ink-soft); }
.kpi-v { display: block; font-family: 'Bebas'; font-size: 38px; line-height: 1.1; margin: 2px 0; }
.kpi-min { font-size: 12.5px; color: var(--ink-soft); }
.barra { height: 6px; background: var(--cream); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.barra span { display: block; height: 100%; background: var(--ok); }

.col2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 16px; }
.card-t { font-size: 21px; margin: 0 0 4px; }
.card-sub { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 16px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.card-form { margin-bottom: 16px; }

.graf { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-top: 8px; }
.graf-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 18px; }
.graf-bar { width: 100%; max-width: 34px; background: var(--bordeaux); border-radius: 6px 6px 0 0; }
.graf-x { font-size: 10.5px; color: var(--ink-soft); margin-top: 5px; }

.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.lista li:last-child { border-bottom: 0; }
.l-main { font-weight: 600; }
.l-min { font-size: 12.5px; color: var(--ink-soft); grid-column: 1; }
.l-ora { font-size: 12.5px; color: var(--ink-soft); grid-row: 1 / span 2; align-self: center; }

.pren-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.pren-sum { font-size: 14.5px; color: var(--ink-soft); }
.pren-sum strong { color: var(--ink); font-size: 17px; }
.pren-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.filtri { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filtri input[type=search], .filtri select { font: inherit; font-size: 14px; padding: 9px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.filtri input[type=search] { flex: 1; min-width: 220px; }

.tab-wrap { background: var(--paper); border-radius: 16px; overflow: auto; }
.tab { width: 100%; border-collapse: collapse; font-size: 14px; }
.tab th { text-align: left; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--ink-soft); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tab th a { text-decoration: none; }
.tab td { padding: 11px 14px; border-bottom: 1px solid var(--cream); vertical-align: top; }
.tab tr:last-child td { border-bottom: 0; }
.tab .c { text-align: center; }
.t-main { display: block; font-weight: 600; }
.t-min { display: block; font-size: 12.5px; color: var(--ink-soft); }
.riga-off { opacity: .5; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dot.ok { background: var(--ok); }
.dot.ko { background: var(--err); }
.pager { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 16px; justify-content: center; }
.pager a { padding: 6px 12px; border-radius: 8px; text-decoration: none; font-size: 13.5px; background: var(--paper); }
.pager a.on { background: var(--bordeaux); color: var(--cream); }

.ev-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ev-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.ev-card-img { width: 100%; height: 150px; object-fit: cover; object-position: center 22%; }
.ev-card-body { padding: 16px 18px 18px; }
.ev-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ev-card h2 { font-size: 22px; margin: 0 0 4px; }
.ev-card-num { display: flex; gap: 16px; margin: 12px 0; font-size: 13px; color: var(--ink-soft); }
.ev-card-num strong { color: var(--ink); font-size: 15px; }
.ev-card-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mini-sel { padding: 5px 10px; font-size: 12.5px; }

/* ---------- pannello laterale ---------- */
.drawer { position: fixed; inset: 0; z-index: 90; }
.drawer-bg { position: absolute; inset: 0; background: rgba(40, 26, 18, .45); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%);
  background: var(--paper); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 23px; }
.drawer-x { background: transparent; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink-soft); }
.drawer-body { padding: 18px 20px 34px; overflow: auto; }
.dr-qr { width: 170px; height: 170px; margin: 0 auto 8px; background: #fff; border-radius: 14px; padding: 8px; border: 1px solid var(--line); }
.dr-qr svg { width: 100%; height: 100%; display: block; }
.dr-cod { text-align: center; font-size: 18px; letter-spacing: 3px; }
.dr-stato { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 6px 0 16px; line-height: 1.6; }
.dr-form { display: grid; gap: 12px; }
.dr-form label { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.dr-form input, .dr-form textarea, .dr-form select {
  font: inherit; font-size: 15px; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; outline: none; width: 100%;
}
.dr-form input:focus, .dr-form textarea:focus, .dr-form select:focus { border-color: var(--bordeaux); }
.campo-nota { font-size: 11.5px; font-weight: 400; color: var(--ink-soft); }
.dr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* specificità alta invece di !important: così [hidden] continua a nascondere il campo */
.dr-form label.dr-chk { display: flex; align-items: center; gap: 9px; font-weight: 400; color: var(--ink); font-size: 14px; }
.dr-chk input { width: auto; accent-color: var(--bordeaux); }
.dr-azioni { display: grid; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.prova-mail { display: flex; gap: 8px; flex-wrap: wrap; }
.prova-mail input { flex: 1; min-width: 240px; font: inherit; font-size: 15px; padding: 11px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff; }

/* ---------- finestrella scelte (stampa contatti) ---------- */
.modalino { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modalino-bg { position: absolute; inset: 0; background: rgba(40, 26, 18, .45); }
.modalino-card { position: relative; background: var(--paper); border-radius: 20px; padding: 24px;
  width: min(470px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--shadow); }
.modalino-card h2 { margin: 0 0 4px; font-size: 24px; }
.modalino-card label { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.modalino-card select {
  font: inherit; font-size: 14.5px; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; outline: none; width: 100%;
}
.modalino-card select:focus { border-color: var(--bordeaux); }
.modalino-card label.dr-chk { display: flex; align-items: center; gap: 9px; font-weight: 400; color: var(--ink); font-size: 14px; margin-top: 12px; }
.scelte { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 12px; margin: 6px 0 14px; }
.scelte legend { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink-soft); padding: 0 6px; }
.modalino-card .scelta { display: flex; align-items: center; gap: 10px; padding: 5px 2px;
  cursor: pointer; font-size: 14.5px; font-weight: 400; color: var(--ink); }
.scelta input { width: 17px; height: 17px; accent-color: var(--bordeaux); }
.modalino-btns { display: flex; gap: 8px; margin-top: 20px; }
.modalino-btns .btn { flex: 1; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--brown); color: var(--cream); padding: 13px 22px; border-radius: 999px;
  font-size: 14.5px; box-shadow: var(--shadow); z-index: 200; max-width: 90vw; text-align: center; }
.toast.ko { background: var(--err); }
.toast.ok { background: var(--ok); }

/* ---------- check-in ---------- */
body.scan-body { background: #14100c; color: var(--cream); }
.scan { min-height: 100vh; display: flex; flex-direction: column; }
.scan-top { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: rgba(59, 51, 35, .9); }
.scan-ev { flex: 1; min-width: 0; }
.scan-ev-t { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-ev-d { font-size: 12px; opacity: .6; }
.scan-cnt { text-align: right; line-height: 1.15; }
.scan-cnt strong { font-family: 'Bebas'; font-size: 27px; }
.scan-cnt span { display: block; font-size: 11px; opacity: .6; }
.scan-out { font-size: 12.5px; opacity: .7; text-decoration: none; border: 1px solid rgba(240, 234, 217, .3);
  padding: 6px 12px; border-radius: 999px; }
.scan-sospeso { background: rgba(216, 154, 61, .16); color: #f0d9ac; font-size: 13.5px;
  line-height: 1.55; padding: 12px 16px; text-align: center; }
.scan-stage { position: relative; flex: 1; min-height: 320px; background: #000; overflow: hidden; }
.scan-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-mirino { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.scan-mirino span { width: min(66vw, 280px); aspect-ratio: 1; border: 3px solid rgba(240, 234, 217, .85); border-radius: 26px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
.scan-hint { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; font-size: 13.5px;
  color: rgba(240, 234, 217, .85); text-shadow: 0 1px 4px #000; padding: 0 20px; }
.scan-tools { display: flex; gap: 8px; padding: 14px 16px 22px; flex-wrap: wrap; justify-content: center; }
.scan-tools .btn-ghost { color: var(--cream); border-color: rgba(240, 234, 217, .3); }
.scan-evsel select { font: inherit; font-size: 13.5px; padding: 9px 14px; border-radius: 999px;
  background: transparent; color: var(--cream); border: 1px solid rgba(240, 234, 217, .3); max-width: 60vw; }
.scan-evsel option { color: #000; }

.scan-esito, .scan-manuale { position: fixed; inset: 0; z-index: 120; display: flex;
  align-items: center; justify-content: center; padding: 20px; background: rgba(10, 8, 6, .82); }
.esito-card, .man-card { background: var(--paper); color: var(--ink); border-radius: 24px;
  padding: 28px 24px; width: min(420px, 100%); text-align: center; box-shadow: var(--shadow); }
.esito-icona { width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 50%; color: #fff;
  font-size: 40px; line-height: 74px; background: var(--ink-soft); }
.esito-card.ok .esito-icona { background: var(--ok); }
.esito-card.warn .esito-icona { background: var(--warn); }
.esito-card.ko .esito-icona { background: var(--err); }
.esito-testo { font-family: 'Bebas'; font-size: 30px; line-height: 1.1; }
.esito-azienda { font-size: 19px; font-weight: 700; margin-top: 8px; }
.esito-ref { font-size: 14px; color: var(--ink-soft); }
.esito-persone { margin: 20px 0 6px; }
.esito-persone > span { display: block; font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; }
.stepper button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink); }
.stepper strong { font-family: 'Bebas'; font-size: 40px; min-width: 46px; }
.esito-btns { display: grid; gap: 8px; margin-top: 20px; }
.man-card { text-align: left; }
.man-card h2 { margin: 0 0 14px; font-size: 24px; }
.man-card input { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; }
#man-codice { text-transform: uppercase; letter-spacing: 2px; font-family: ui-monospace, Menlo, monospace; }
.man-sep { text-align: center; font-size: 12.5px; color: var(--ink-soft); margin: 16px 0 10px; }
.man-ris { max-height: 240px; overflow: auto; margin-bottom: 12px; }
.man-ris button { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; font: inherit; cursor: pointer; }
.man-ris .r-az { font-weight: 600; }
.man-ris .r-min { font-size: 12.5px; color: var(--ink-soft); }
.man-ris .r-in { color: var(--ok); font-weight: 600; }
.man-card .btn { width: 100%; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .ev-grid { grid-template-columns: 1fr; gap: 26px; }
  .ev-poster { max-width: 340px; }
  .ev-title { font-size: 36px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .col2 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 15px; }
  .ev { padding: 4px 16px 34px; }
  .card { padding: 20px 18px; }
  .fld-row, .dr-row { grid-template-columns: 1fr; }
  .topbar { gap: 12px; padding: 0 12px; }
  .topbar nav a { padding: 7px 10px; font-size: 13.5px; }
  main { padding: 18px 12px 50px; }
  .tab th, .tab td { padding: 9px 10px; }
  .kpi-v { font-size: 32px; }
  .ok-card { padding: 26px 20px; }
  .qr { width: 190px; height: 190px; }
}
