/* BnB Manager — foglio di stile unico per pannello host e portale ospite */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --line: #e3e8ef;
  --line-strong: #cbd3df;
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #7c8698;
  --brand: #1a66ff;
  --brand-ink: #0f4fd6;
  --brand-soft: #e6efff;
  --ok: #1f7a4d;      --ok-soft: #e2f2e8;
  --info: #1d5fa8;    --info-soft: #e3edf9;
  --warn: #9a5b00;    --warn-soft: #fbefd6;
  --danger: #b42318;  --danger-soft: #fbe7e4;
  --sim: #6b4fa0;     --sim-soft: #efe9f8;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(17 24 39 / .04), 0 2px 10px rgb(17 24 39 / .04);
  --shadow-lg: 0 12px 40px rgb(17 24 39 / .18);
  --btn-line: #2b3445;
  --cw: 46px; /* larghezza di un giorno nel calendario */
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.015em; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.ic { flex: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ── Struttura ── */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); color: var(--ink-2); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; color: var(--ink); font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 99px; color: inherit; text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.nav .count { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 99px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); padding: 16px 12px 6px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 650; font-size: 12px; flex: none; }
.sidebar-foot .who { min-width: 0; flex: 1; line-height: 1.25; }
.sidebar-foot .who b { display: block; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who span { font-size: 12px; color: var(--ink-3); }

.main { min-width: 0; padding: 26px 32px 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--ink-2); margin-top: 3px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-bar { background: var(--sim-soft); color: #4a3475; border: 1px solid #dccff0; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 18px; display: flex; gap: 8px; align-items: center; }
.mobile-top { display: none; }

/* ── Elementi base ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-body { padding: 16px; }
.grid { display: grid; gap: 16px; }
.grid > *, .stack > * { min-width: 0; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--btn-line); background: var(--surface); font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn-dark { background: #111827; border-color: #111827; color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; }
.btn-dark.is-busy::after { border-color: #fff; border-top-color: transparent; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1c13; border-color: #8f1c13; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid #9aa5b5; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-primary.is-busy::after, .btn-danger.is-busy::after { border-color: #fff; border-top-color: transparent; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 50%; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: #eef1f6; color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef1f6; color: var(--ink-2); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-sim { background: var(--sim-soft); color: var(--sim); }
.chan { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chan i { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
textarea.input { height: auto; padding: 9px 11px; resize: vertical; min-height: 84px; line-height: 1.45; }
.input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 13px; background: #fff; }
.chips input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chips input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-top: 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 550; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--brand); border-bottom-color: var(--brand); }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr[data-open] { cursor: pointer; }
.table tbody tr[data-open]:hover { background: var(--surface-2); }
.table .r { text-align: right; }
.table td strong { font-weight: 600; }
.sub { color: var(--ink-3); font-size: 12.5px; }

.empty { padding: 36px 20px; text-align: center; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }
.loading { display: grid; place-items: center; padding: 60px; }
.loading span { width: 22px; height: 22px; border: 2.5px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }

/* ── Dashboard ── */
.stat { padding: 16px; }
.stat .label { color: var(--ink-2); font-size: 12.5px; font-weight: 550; }
.stat .value { font-size: 27px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.todo { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.todo a { display: flex; align-items: center; gap: 9px; padding: 9px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--ink); font-weight: 550; }
.todo a:hover { border-color: var(--brand); }
.todo b { background: var(--brand); color: #fff; border-radius: 99px; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; font-size: 12px; }
.todo a.warn b { background: var(--danger); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.occ { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; align-items: end; height: 120px; padding-top: 8px; }
.occ div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 5px; }
.occ i { display: block; width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.occ .we i { background: #7aa7ff; }
.occ small { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bars .track { height: 7px; background: #eef1f6; border-radius: 99px; overflow: hidden; margin-top: 5px; }
.bars .track i { display: block; height: 100%; border-radius: 99px; }

/* ── Calendario (planning) ── */
.cal { overflow-x: auto; }
.cal-inner { min-width: max-content; }
.cal-row { display: flex; border-bottom: 1px solid var(--line); }
.cal-row:last-child { border-bottom: 0; }
.cal-room { width: 180px; flex: none; padding: 10px 14px; border-right: 1px solid var(--line); background: var(--surface); position: sticky; left: 0; z-index: 3; }
.cal-room b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-head .cal-room { background: var(--surface-2); display: flex; align-items: flex-end; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.cal-days { display: flex; position: relative; }
.cal-day { width: var(--cw); flex: none; border-right: 1px solid #edf0f5; text-align: center; }
.cal-head .cal-day { padding: 7px 0; background: var(--surface-2); font-size: 11px; color: var(--ink-3); line-height: 1.3; text-transform: capitalize; }
.cal-head .cal-day b { display: block; font-size: 14px; color: var(--ink); font-weight: 600; }
.cal-day.we { background: #f7f9fc; }
.cal-head .cal-day.today { background: var(--brand-soft); }
.cal-head .cal-day.today b { color: var(--brand); }
.cal-row:not(.cal-head) .cal-day { min-height: 52px; cursor: pointer; border: 0; border-right: 1px solid #edf0f5; padding: 0; background: transparent; }
.cal-row:not(.cal-head) .cal-day.we { background: #f7f9fc; }
.cal-row:not(.cal-head) .cal-day.today { background: #eef4ff; }
.cal-row:not(.cal-head) .cal-day:hover { background: var(--brand-soft); }
.cal-bk { position: absolute; top: 8px; height: 36px; border-radius: 7px; padding: 0 9px; display: flex; align-items: center; gap: 6px; color: #fff; font-size: 12.5px; font-weight: 600; overflow: hidden; white-space: nowrap; cursor: pointer; border: 0; z-index: 2; box-shadow: 0 1px 2px rgb(0 0 0 / .18); text-align: left; }
.cal-bk span { overflow: hidden; text-overflow: ellipsis; }
.cal-bk:hover { filter: brightness(1.08); }
.cal-bk.blocked { background: repeating-linear-gradient(135deg, #d8d4ca 0 7px, #c9c4b8 7px 14px); color: #45413a; box-shadow: none; }
.cal-bk.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bk.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-bk .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; flex: none; }
.cal-bk .dot.open { background: transparent; border: 1.5px solid #fff; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }

/* ── Prezzi ── */
.month-pill { display: inline-flex; align-items: center; gap: 2px; height: 36px; border: 1px solid var(--btn-line); border-radius: 99px; padding: 0 4px; background: #fff; }
.month-pill span { display: inline-flex; align-items: center; gap: 8px; padding: 0 8px; font-weight: 550; text-transform: capitalize; min-width: 150px; justify-content: center; }
.month-pill .icon-btn { width: 28px; height: 28px; border-radius: 50%; }
.pr-scroll { overflow-x: auto; padding-bottom: 8px; }
.pr { display: flex; flex-direction: column; gap: 14px; min-width: max-content; }
.pr-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.pr-row { display: flex; }
.pr-row + .pr-row { border-top: 1px solid var(--line); }
.pr-lbl { width: 200px; flex: none; position: sticky; left: 0; z-index: 2; background: #fff; padding: 0 10px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-right: 1px solid var(--line); font-size: 13.5px; }
.pr-head .pr-lbl { height: 36px; border-top-left-radius: 8px; font-weight: 600; }
.pr-lbl.tint { background: #edf1f8; }
.pr-row:last-child .pr-lbl { border-bottom-left-radius: 8px; }
.pr-expand { border: 0; background: none; padding: 6px 0; cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 500; flex: 1; justify-content: space-between; text-align: left; }
.pr-expand .ic { transition: transform .15s; color: var(--ink-2); }
.pr-expand[aria-expanded=true] .ic { transform: rotate(90deg); }
.pr-icons { display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
.pr-day { width: 72px; flex: none; height: 36px; display: grid; place-items: center; font-size: 12.5px; color: var(--ink-3); position: relative; font-variant-numeric: tabular-nums; }
.pr-day.we { color: var(--brand); font-weight: 600; }
.pr-day.today { color: var(--ink); font-weight: 700; }
.pr-av { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; }
.pr-av.free { background: #9df0cd; } .pr-av.booked { background: #f8b8c0; } .pr-av.closed { background: #b4bcc8; }
.pr-cell { width: 72px; flex: none; padding: 7px 0; display: flex; flex-direction: column; gap: 7px; align-items: center; justify-content: center; border-right: 1px solid #f0f3f7; }
input.pill { width: 58px; height: 23px; border: 1px solid var(--btn-line); border-radius: 99px; text-align: center; font-size: 12.5px; background: #fff; padding: 0 4px; font-variant-numeric: tabular-nums; }
input.pill:hover { border-color: var(--brand); }
input.pill:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input.pill.custom { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 650; }
.pr-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; color: var(--ink-2); }
.pr-legend i { display: inline-block; width: 22px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.chipbox { display: flex; gap: 8px; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px; background: #fff; }
.chipbox .chips { flex: 1; }
.chipbox > button { border: 0; border-left: 1px solid var(--line); background: none; padding: 0 4px 0 10px; color: var(--ink-2); cursor: pointer; font-size: 13px; }
.chipbox > button:hover { color: var(--brand); }
.chipbox .chips span { height: 28px; border-radius: 4px; border-color: var(--line); background: var(--surface-2); color: var(--ink-3); }
.chipbox .chips input:checked + span { background: #fff; border-color: var(--btn-line); color: var(--ink); }
.sync-note { margin-top: 16px; color: var(--ink-2); font-size: 13.5px; }
.panel-form { display: flex; flex-direction: column; gap: 16px; }
.panel-form .input { height: 44px; border-radius: 4px; }
.panel-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.panel-actions .btn { height: 40px; padding: 0 22px; }

/* ── Canali ── */
.chan-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.chan-card .logo { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kv div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
.kv span { display: block; font-size: 11.5px; color: var(--ink-3); }
.kv b { font-weight: 650; font-size: 15px; font-variant-numeric: tabular-nums; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; z-index: 1; }
.switch i { position: absolute; inset: 0; background: #cbd3df; border-radius: 99px; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── Messaggi ── */
.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr); height: calc(100vh - 150px); min-height: 460px; overflow: hidden; }
.threads { border-right: 1px solid var(--line); overflow-y: auto; }
.thread { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 13px 16px; cursor: pointer; }
.thread:hover { background: var(--surface-2); }
.thread.active { background: var(--brand-soft); }
.thread .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.thread b { font-weight: 600; }
.thread.unread b::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-left: 7px; }
.thread p { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 3px 0 5px; }
.chat { display: flex; flex-direction: column; min-height: 0; }
.chat-head { padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.msg { max-width: min(72%, 560px); padding: 9px 13px; border-radius: 13px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.out { align-self: flex-end; background: var(--brand); border-color: var(--brand); color: #fff; }
.msg small { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }
.chat-form { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { min-height: 42px; height: 42px; max-height: 160px; }
.chat-form select { width: 170px; flex: none; }

/* ── Check-in ── */
.steps { display: flex; gap: 5px; }
.steps i { width: 22px; height: 6px; border-radius: 99px; background: #e3e8ef; }
.steps i.on { background: var(--ok); }
.steps i.na { background: transparent; border: 1px dashed var(--line-strong); }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 7px 12px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.section { padding: 16px 0; border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; padding-top: 0; }
.section > h3 { margin-bottom: 10px; text-transform: uppercase; letter-spacing: .05em; font-size: 11.5px; color: var(--ink-3); }
.docs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.doc { width: 132px; }
.doc button { width: 132px; height: 92px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); padding: 0; overflow: hidden; cursor: zoom-in; display: grid; place-items: center; color: var(--ink-3); }
.doc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 4px; text-align: center; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-size: 12.5px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 650; letter-spacing: .12em; font-size: 15px; }
.batt { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.batt i { width: 30px; height: 12px; border: 1.5px solid var(--ink-3); border-radius: 3px; position: relative; display: block; }
.batt i::before { content: ""; position: absolute; inset: 1.5px; width: var(--lvl); max-width: calc(100% - 3px); background: var(--ok); border-radius: 1px; }
.batt.low i::before { background: var(--danger); }
.batt.low { color: var(--danger); font-weight: 600; }

/* ── Overlay ── */
.overlay { position: fixed; inset: 0; background: rgb(17 24 39 / .35); z-index: 50; display: flex; }
.overlay.is-modal { align-items: flex-start; justify-content: center; padding: 7vh 16px 16px; overflow-y: auto; }
.overlay.is-drawer { justify-content: flex-end; }
.overlay-panel { background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.is-modal .overlay-panel { width: 100%; max-width: 520px; border-radius: 14px; }
.is-modal .overlay-panel.wide { max-width: 760px; }
.is-drawer .overlay-panel { width: 100%; max-width: 560px; height: 100%; animation: slide .18s ease-out; }
.is-drawer .overlay-panel.wide { max-width: 720px; }
.overlay-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--line); }
.overlay-head h2 { font-size: 16px; }
.overlay-body { padding: 20px; overflow-y: auto; flex: 1; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #111827; color: #fff; padding: 10px 16px; border-radius: 9px; box-shadow: var(--shadow-lg); font-weight: 500; }
.toast-danger { background: var(--danger); }

/* ── Login ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; padding: 30px 28px; }
.login-card .brand { padding: 0 0 22px; font-size: 17px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.login-note { margin-top: 18px; display: flex; gap: 8px; align-items: center; color: var(--ink-3); font-size: 12.5px; }

/* ── Portale ospite ── */
.guest { max-width: 620px; margin: 0 auto; padding: 20px 16px 60px; }
.guest-head { padding: 8px 0 18px; }
.guest-head .where { color: var(--ink-2); margin-top: 4px; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-bottom: 16px; }
.summary div { padding: 12px 14px; border-right: 1px solid var(--line); }
.summary div:last-child { border-right: 0; }
.summary span { display: block; font-size: 12px; color: var(--ink-3); }
.summary b { font-weight: 650; }
.gstep { margin-bottom: 12px; }
.gstep > header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; width: 100%; border: 0; background: none; text-align: left; }
.gstep .n { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: none; color: var(--ink-2); }
.gstep.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.gstep .t { flex: 1; font-weight: 650; font-size: 15px; }
.gstep .body { padding: 4px 16px 18px; }
.gstep.locked > header { opacity: .5; cursor: default; }
.person { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: var(--surface-2); }
.person h3 { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.upload { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.upload label { border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 14px 8px; text-align: center; cursor: pointer; font-size: 13px; background: #fff; display: flex; flex-direction: column; gap: 4px; align-items: center; color: var(--ink-2); }
.upload label:hover { border-color: var(--brand); }
.upload label.ok { border-style: solid; border-color: var(--ok); background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload label:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.rules { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px; max-height: 240px; overflow-y: auto; font-size: 13.5px; margin-bottom: 14px; }
.otp { letter-spacing: .4em; font-size: 20px; text-align: center; font-weight: 650; height: 48px; max-width: 220px; }
.notice { border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; display: flex; gap: 12px; align-items: flex-start; }
.notice.ok { background: var(--ok-soft); color: #14553a; }
.notice.info { background: var(--info-soft); color: #174a82; }
.notice.danger { background: var(--danger-soft); color: #8f1c13; }
.notice.sim { background: var(--sim-soft); color: #4a3475; }
.access { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); gap: 12px; }
.access:last-child { border-bottom: 0; }
.access .code { font-size: 24px; }

/* ── Responsive ── */
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 40; width: 250px; transform: translateX(-100%); transition: transform .18s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .mobile-top { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 650; position: sticky; top: 0; z-index: 30; }
  .main { padding: 18px 16px 48px; }
  .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox .threads { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .inbox .chat { height: 70vh; }
  .cal-room { width: 120px; padding: 10px; }
  .pr-lbl { width: 138px; }
  .chat-form { flex-wrap: wrap; } .chat-form select { width: 100%; }
}
@media (max-width: 560px) {
  .cols-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 110px 1fr; }
  .kv { grid-template-columns: 1fr 1fr 1fr; }
  .stat .value { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition: none !important; } }
