/* Backoffice dell'hotel (issue #73): stessi stili del backoffice di mybd (IO-Net/mybd, public/assets/admin.css, ramo
   main al 5/11/2026), senza le parti che qui non servono (anteprima del telefono, ricerca rapida, lingue, orari).
   Le aggiunte per il kiosk sono in fondo. Un solo tema (chiaro), colori espliciti. */
:root {
  --bg: #f4f6f8; --panel: #ffffff; --ink: #142836; --ink-2: #2c4255; --muted: #5d7183; --line: #e2e8ed; --soft: #eef2f5; --soft-2: #f7f9fa;
  --brand: #0b3c5d; --brand-soft: #e6eef4; --accent: #ff6b4a; --accent-soft: #ffede8; --accent-text: #c2410c;
  --ok: #13805b; --ok-soft: #e2f4ec; --warn: #a86400; --warn-soft: #fff3da; --bad: #b42318; --bad-soft: #fdecea;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif; --display: "Bricolage Grotesque", var(--sans);
  --r: 14px; --shadow: 0 1px 2px rgba(20, 40, 54, .05);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3, h4 { text-wrap: balance; }
code { font: 13px ui-monospace, Menlo, monospace; background: var(--soft); padding: 1px 5px; border-radius: 5px; }
.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Guscio ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 9px; padding: 16px 18px 8px; font: 800 18px var(--display); letter-spacing: -.01em; }
.brand i { width: 28px; height: 28px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-style: normal; font-size: 13.5px; letter-spacing: -.03em; }
.brand .only-m { margin-left: auto; }
.switch { position: relative; margin: 6px 12px 4px; }
.switch-btn { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft-2); }
.switch-btn:hover { border-color: #cdd7df; }
.switch-btn:focus-visible { outline: 2px solid var(--brand); }
.switch-btn .nm { flex: 1; min-width: 0; }
.switch-btn .nm b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch-btn .nm small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; }
.switch-btn[aria-expanded="true"] > .ico { transform: rotate(180deg); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; flex: none; }
.dot.off { background: #b6c2cc; }
.tlogo { --h: 210; width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; font: 800 13px var(--display);
  background: linear-gradient(150deg, hsl(var(--h) 70% 58%), hsl(calc(var(--h) + 40) 65% 42%)); }
.tlogo.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.switch-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(10, 30, 45, .4); padding: 6px; z-index: 40; }
.switch-pop input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; margin-bottom: 4px; }
.switch-list { max-height: 300px; overflow-y: auto; display: grid; gap: 1px; }
.switch-list button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 9px; font-size: 14px; }
.switch-list button:hover, .switch-list button:focus-visible { background: var(--soft); }
.switch-list button > span:not(.tlogo) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-list button small { color: var(--muted); }
.switch-list .ico { color: var(--ok); }
.switch-add { all: unset; cursor: pointer; box-sizing: border-box; width: 100%; display: block; padding: 9px 8px 7px; margin-top: 4px; border-top: 1px solid var(--line); font-weight: 800; color: var(--accent-text); font-size: 14px; }
.open-app { display: flex; align-items: center; gap: 6px; padding: 7px 4px 0; font-size: 13px; font-weight: 700; text-decoration: none; color: var(--muted); }
.open-app:hover { color: var(--brand); }
.open-app .ico { width: 15px; height: 15px; }
.search { all: unset; cursor: pointer; box-sizing: border-box; margin: 8px 12px 2px; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 14px; }
.search:hover { background: #e6ebef; }
.search span { flex: 1; }
.search .ico { width: 16px; height: 16px; }
kbd { font: 700 11px var(--sans); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
#nav { flex: 1; overflow-y: auto; padding: 4px 10px 14px; }
.grp { margin-top: 14px; }
.grp:first-child { margin-top: 8px; }
.grp > small { display: block; padding: 0 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.nav-i { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.nav-i:hover { background: var(--soft); }
.nav-i[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 800; }
.nav-i span { flex: 1; min-width: 0; }
.nav-i em { font-style: normal; font-size: 11px; font-weight: 800; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.me { border-top: 1px solid var(--line); padding: 10px 12px 10px 14px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; flex: none; }
.who { flex: 1; min-width: 0; font-size: 13.5px; }
.who b { display: block; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--muted); }
.main { overflow-y: auto; min-width: 0; }
.mtop, .scrim, .side .only-m { display: none; }
.page-wrap { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 1180px; padding: 26px 32px 80px; gap: 28px; }
.page-wrap.with-preview { grid-template-columns: minmax(0, 1fr) 330px; max-width: 1280px; }
.page { min-width: 0; display: grid; gap: 16px; align-content: start; }

/* ---------- Intestazione e blocchi ---------- */
.ph { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 4px; }
.ph > div:first-child { flex: 1; min-width: 240px; }
.ph h1 { margin: 0; font: 800 28px/1.1 var(--display); letter-spacing: -.015em; }
.ph p { margin: 6px 0 0; color: var(--muted); max-width: 64ch; }
.ph-act { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad, .pad { padding: 18px 20px; }
.card > h2, .card-h { margin: 0 0 4px; font: 800 18px var(--display); display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.card-h small, .card > h2 small { font: 500 13.5px var(--sans); color: var(--muted); }
.card .sub { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.sec-title { margin: 10px 0 -4px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; align-items: start; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sp { flex: 1; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.note { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; background: var(--brand-soft); color: var(--ink-2); padding: 10px 12px; border-radius: 10px; margin: 0; }
.note.warn { background: var(--warn-soft); color: #6e4300; }
.note .ico { margin-top: 1px; }
.err { color: var(--bad); font-weight: 600; margin: 0; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }

/* ---------- Campi ---------- */
.f { display: grid; gap: 6px; min-width: 0; }
.f > span:first-child { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.f input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=time]), .f select, .f textarea, .input {
  width: 100%; padding: 9px 11px; border: 1px solid #d5dee5; border-radius: 10px; background: #fff; transition: border-color .15s; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(11, 60, 93, .12); }
.f textarea { resize: vertical; line-height: 1.5; }
.f.wide { grid-column: 1 / -1; }
.f > .seg, .f > .days { justify-self: start; }
.f small.hint { font-size: 12.5px; }
.addr { display: flex; align-items: stretch; border: 1px solid #d5dee5; border-radius: 10px; overflow: hidden; background: #fff; }
.addr input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; min-width: 0; }
.addr b { display: flex; align-items: center; padding: 0 11px; background: var(--soft); color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }

/* Interruttore */
.tog { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; cursor: pointer; }
.tog input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.tog span { position: absolute; inset: 0; border-radius: 999px; background: #c6d1da; transition: background .15s; }
.tog span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.tog input:checked + span { background: var(--ok); }
.tog input:checked + span::after { transform: translateX(18px); }
.tog input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.tog input:disabled + span { opacity: .5; }
/* Scelta tra poche opzioni */
.seg { display: inline-flex; flex-wrap: wrap; background: var(--soft); padding: 3px; border-radius: 11px; gap: 2px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }

/* Pulsanti */
.btn { cursor: pointer; border: 1px solid #d5dee5; background: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 700; display: inline-flex; gap: 7px; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--soft-2); border-color: #c4cfd8; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: #0d4a72; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--soft); color: var(--ink); }
.btn.sm { padding: 5px 10px; font-size: 13.5px; border-radius: 9px; }
.btn.big { padding: 11px 18px; font-size: 15.5px; }
.btn .ico { width: 17px; height: 17px; }
.btn:disabled { opacity: .55; cursor: progress; }
.icon-btn { all: unset; cursor: pointer; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn:focus-visible { outline: 2px solid var(--brand); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.link { all: unset; cursor: pointer; color: var(--accent-text); font-weight: 700; font-size: 13px; }
.link:hover { text-decoration: underline; }

/* Etichette */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.off, .tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }

/* Elenchi */
.list { display: grid; }
.li { display: flex; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); min-width: 0; }
.li:first-child { border-top: 0; }
.li .tx { flex: 1; min-width: 0; }
.li .tx b { display: block; }
.li .tx small, .li .tx span { color: var(--muted); font-size: 13.5px; }
.li.off .tx, .li.off .thumb { opacity: .5; }
.li-act { display: flex; gap: 2px; align-items: center; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.tablewrap { overflow-x: auto; }

/* ---------- Finestre ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .55); color: var(--ink); }
dialog.wide { width: min(820px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(10, 22, 32, .45); }
dialog > form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
dialog header { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px 22px; border-bottom: 1px solid var(--line); }
dialog header h3 { margin: 0; flex: 1; font: 800 20px var(--display); }
.dlg-body { padding: 18px 22px; overflow-y: auto; display: grid; gap: 16px; }
dialog footer { display: flex; gap: 8px; align-items: center; padding: 12px 22px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
dialog.confirm { width: min(420px, calc(100vw - 24px)); }
dialog.confirm form { padding: 20px 22px 0; }
dialog.confirm p { margin: 0 0 6px; }
dialog.confirm footer { border: 0; padding: 12px 0 18px; }
.steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.steps li { flex: 1; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 8px; border-top: 4px solid var(--soft); }
.steps li i { width: 22px; height: 22px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-style: normal; font-size: 12px; }
.steps li.on { color: var(--ink); border-color: var(--accent); }
.steps li.on i { background: var(--accent); color: #fff; }
.steps li.done { border-color: var(--ok); }
.steps li.done i { background: var(--ok-soft); color: var(--ok); }
.drop { display: grid; place-items: center; text-align: center; min-height: 170px; border: 2px dashed #c8d3dc; border-radius: 14px; cursor: pointer; padding: 16px; background: var(--soft-2); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop span { display: grid; gap: 4px; justify-items: center; color: var(--muted); }
.drop b { color: var(--ink); }
.drop .ico { width: 28px; height: 28px; }
.drop img { max-height: 100px; max-width: 260px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.preset { cursor: pointer; display: grid; gap: 7px; padding: 10px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 13.5px; font-weight: 700; }
.preset input { position: absolute; opacity: 0; }
.preset:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sw4 { display: flex; height: 34px; border-radius: 8px; overflow: hidden; }
.sw4 i { flex: 1; }
.sw4 i:first-child { flex: 1.6; }

/* Messaggi e caricamento */
.flash { position: fixed; right: 20px; bottom: 20px; display: flex; gap: 8px; align-items: center; padding: 11px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; z-index: 100; max-width: min(440px, calc(100vw - 40px)); box-shadow: 0 14px 30px -12px rgba(0,0,0,.45); animation: up .2s ease-out; }
.flash.bad { background: var(--bad); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.loading { display: grid; place-items: center; padding: 40px; }
.loading span { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Accesso ---------- */
.login { max-width: 380px; margin: 12vh auto; padding: 26px; background: var(--panel); border-radius: 18px; border: 1px solid var(--line); display: grid; gap: 14px; box-shadow: 0 20px 50px -30px rgba(0,0,0,.3); }
.login .brand { padding: 0; }
.login h1 { margin: 0; font: 800 24px var(--display); }
.empty-start { max-width: 520px; margin: 14vh auto; text-align: center; padding: 0 16px; }
.empty-start h1 { font: 800 30px var(--display); margin: 0 0 8px; }
.empty-start p { color: var(--muted); margin: 0 0 18px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 22, 32, .4); z-index: 25; }
  .side .only-m { display: grid; }
  .mtop { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .mtop b { font: 800 16px var(--display); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .page-wrap { padding: 18px 16px 70px; }
  .ph h1 { font-size: 24px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .li { padding: 12px 14px; flex-wrap: wrap; }
  .flash { left: 16px; right: 16px; bottom: 16px; }
}

/* ---------- Aggiunte del kiosk ---------- */
.brand small { font: 700 12px var(--sans); color: var(--muted); letter-spacing: .02em; margin-left: 2px; }
.switch-btn { cursor: default; }
.stat b { display: block; font: 800 30px/1.1 var(--display); }
.stat span { color: var(--muted); font-size: 13.5px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.bars span { flex: 1; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 3px; }
tr.off td { color: var(--muted); }
tr.off td.t b { text-decoration: line-through; }
td small { color: var(--muted); font-size: 13px; }
input[type=range] { width: min(420px, 100%); accent-color: var(--brand); }
.checks.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; }
.qr { background: #fff; border-radius: 10px; padding: 6px; border: 1px solid var(--line); }
