:root {
  color-scheme: light;
  --ink: #1d2738;
  --muted: #788397;
  --line: #e8ecf2;
  --surface: #fff;
  --canvas: #f5f7fb;
  --blue: #4263eb;
  --blue-dark: #3151d5;
  --green: #14835e;
  --red: #c64b4b;
  --shadow: 0 8px 26px rgb(23 39 75 / 5%);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "Segoe UI", Arial, sans-serif; font-size: 14px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; display: flex; width: 248px; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); padding: 27px 17px 18px; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 7px 42px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: #e9edff; color: var(--blue); font-family: "Segoe UI", Arial, sans-serif; font-size: 23px; font-weight: 800; }
.brand strong, .brand small, .profile strong, .profile small, .demo-side-card strong, .demo-side-card small { display: block; }
.brand strong { font-family: Manrope, sans-serif; font-size: 16px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.nav-label, .eyebrow { color: #929caf; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; }
.nav-label { padding: 0 12px; }
.main-nav { display: grid; gap: 5px; margin-top: 12px; }
.nav-item { display: flex; min-height: 43px; align-items: center; gap: 12px; border: 0; border-radius: 8px; background: transparent; padding: 0 12px; color: #606d81; text-align: left; }
.nav-item > span:first-child { width: 18px; color: #8792a5; font-size: 17px; text-align: center; }
.nav-item:hover { background: #f5f7fb; }
.nav-item.active { background: #edf0ff; color: var(--blue); font-weight: 700; }
.nav-item.active > span:first-child { color: var(--blue); }
.nav-count { margin-left: auto; border-radius: 20px; background: #f0f2f6; padding: 3px 8px; color: #79859a; font-size: 11px; }
.sidebar-bottom { margin-top: auto; }
.demo-side-card { display: flex; align-items: flex-start; gap: 10px; border: 1px solid #e6eaff; border-radius: 9px; background: #f7f8ff; padding: 12px 10px; }
.demo-side-card strong { font-size: 12px; }
.demo-side-card small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.live-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #8b75ed; }
.demo-side-card .live-dot { margin-top: 4px; }
.profile { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); margin-top: 17px; padding: 16px 3px 0; }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #fbe9dd; color: #a55c32; font-size: 11px; font-weight: 700; }
.profile strong { font-size: 11px; }
.profile small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.main-content { max-width: 1600px; min-height: 100vh; margin-left: 248px; padding: 0 35px; }
.topbar { display: flex; min-height: 67px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.breadcrumb { color: #8b95a6; font-size: 12px; }
.breadcrumb span { margin: 0 8px; color: #c4cad4; }
.breadcrumb strong { color: #435066; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 17px; }
.demo-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e7e3ff; border-radius: 20px; background: #f5f3ff; padding: 5px 9px; color: #6853ce; font-size: 9px; font-weight: 700; letter-spacing: .5px; }
.date-label { color: var(--muted); font-size: 11px; }
.demo-banner { display: flex; align-items: center; gap: 12px; border: 1px solid #eee6ff; border-radius: 9px; background: #faf8ff; margin-top: 22px; padding: 13px 15px; }
.banner-icon { display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; border: 1px solid #dcd4ff; border-radius: 50%; color: #7259d3; font-family: Georgia, serif; font-weight: 700; }
.demo-banner strong, .demo-banner span:not(.banner-icon) { display: block; }
.demo-banner strong { color: #55458d; font-size: 12px; }
.demo-banner div span { margin-top: 3px; color: #77718d; font-size: 11px; }
.view { display: none; padding-top: 31px; }
.view.active { display: block; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 7px; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: "Segoe UI", Arial, sans-serif; }
h1 { margin-bottom: 5px; font-size: 27px; letter-spacing: -.7px; }
.page-subtitle { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.button { display: inline-flex; min-height: 37px; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 7px; padding: 0 13px; font-size: 11px; font-weight: 600; transition: background .15s, transform .15s; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { border-color: #e2e7ef; background: #fff; color: #4f5c70; }
.button-secondary:hover { background: #f8f9fc; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 19px; }
.stat-card { display: flex; min-height: 112px; align-items: flex-start; gap: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 17px 15px; box-shadow: var(--shadow); }
.stat-icon { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border-radius: 9px; font-size: 17px; }
.icon-blue { background: #eef1ff; color: #596ee6; }
.icon-green { background: #e8f7f0; color: #22966f; }
.icon-purple { background: #f2edff; color: #8465d6; }
.icon-orange { background: #fff2e8; color: #db8a4c; }
.stat-label { display: block; margin: 1px 0 5px; color: #768195; font-size: 10px; }
.stat-card strong { display: block; font-family: "Segoe UI", Arial, sans-serif; font-size: 23px; line-height: 1.1; }
.stat-card small { display: block; margin-top: 5px; color: #99a2b1; font-size: 9px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(290px, .85fr); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.content-grid > .panel { padding: 19px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.panel-heading h2 { margin: 0; font-size: 14px; letter-spacing: -.2px; }
.panel-heading p { margin: 4px 0 0; color: #929bad; font-size: 10px; line-height: 1.5; }
.text-button { border: 0; background: transparent; color: var(--blue); font-size: 10px; font-weight: 600; white-space: nowrap; }
.text-button:hover { color: var(--blue-dark); }
.door-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.preview-door { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #edf0f4; border-radius: 7px; padding: 10px; }
.preview-door strong { display: block; overflow: hidden; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.preview-door small { display: block; margin-top: 4px; color: #969faf; font-size: 9px; }
.status { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 4px 7px; font-size: 9px; font-weight: 600; white-space: nowrap; }
.status::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status.closed, .status.free { background: #eaf7f0; color: #23805d; }
.status.open { background: #fff0e8; color: #c4783e; }
.status.occupied { background: #fff0ed; color: #bd6254; }
.room-preview { display: grid; gap: 0; }
.room-row { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #f0f2f5; padding: 11px 1px; }
.room-row:last-child { border-bottom: 0; }
.room-row strong { font-size: 11px; font-weight: 600; }
.room-row small { display: block; margin-top: 3px; color: #9aa3b0; font-size: 9px; }
.controller-note { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin: -4px 0 15px; padding: 11px 13px; color: #788397; font-size: 10px; }
.controller-note strong { margin-right: 5px; color: #465267; font-size: 10px; }
.controller-note span { border-left: 1px solid #e5e9ef; padding-left: 10px; }
.door-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.door-card, .room-card { border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 14px; box-shadow: var(--shadow); }
.door-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.door-card h3, .room-card h3 { margin: 0; font-family: "Segoe UI", Arial, sans-serif; font-size: 12px; }
.door-card p, .room-card p { margin: 5px 0 0; color: #929cad; font-size: 9px; }
.door-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #f0f2f5; margin-top: 15px; padding-top: 12px; }
.mini-label { color: #a0a8b5; font-size: 9px; }
.small-button { min-height: 28px; border: 1px solid #e2e7ef; border-radius: 6px; background: #fff; padding: 0 9px; color: #536176; font-size: 9px; font-weight: 600; }
.small-button:hover { border-color: #cfd7e5; background: #f8f9fc; }
.small-button:disabled { cursor: default; opacity: .55; }
.room-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.room-card { padding: 17px; }
.room-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.room-symbol { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 8px; background: #f0f2ff; color: #6476dc; font-size: 16px; }
.room-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #f0f2f5; margin-top: 18px; padding-top: 12px; }
.subtle-count { color: #7d8799; font-size: 11px; }
.security-note { display: flex; align-items: flex-start; gap: 10px; border: 1px solid #f4e4cc; border-radius: 8px; background: #fffaf1; margin: -5px 0 14px; padding: 11px 13px; color: #796744; }
.security-note > span { display: grid; width: 18px; height: 18px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #fff0d4; color: #a37324; font-size: 11px; font-weight: 700; }
.security-note p { margin: 2px 0 0; font-size: 10px; line-height: 1.5; }
.table-panel { padding: 18px 19px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { border-bottom: 1px solid var(--line); padding: 10px 9px; color: #939cad; font-size: 9px; font-weight: 600; white-space: nowrap; }
td { border-bottom: 1px solid #f0f2f5; padding: 12px 9px; color: #586579; font-size: 10px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: #354156; font-size: 10px; font-weight: 600; }
.credential-type { display: inline-flex; align-items: center; gap: 6px; }
.credential-type span { color: #717de0; font-size: 14px; }
.access-cell { max-width: 260px; color: #7e899a; line-height: 1.6; }
.table-action { border: 0; background: transparent; color: #b15c54; font-size: 10px; }
.table-action:hover { text-decoration: underline; }
.event-kind { display: inline-flex; align-items: center; gap: 6px; }
.event-kind::before { width: 6px; height: 6px; border-radius: 50%; background: #8b75ed; content: ""; }
.event-kind.room::before { background: #37a981; }
.event-kind.credential::before { background: #da9a53; }
.empty-state { padding: 30px 12px; color: #98a1b0; font-size: 11px; text-align: center; }
.hidden { display: none !important; }
.footer-note { padding: 30px 0 20px; color: #a0a8b5; font-size: 9px; text-align: center; }
dialog { width: min(460px, calc(100% - 28px)); max-height: min(90vh, 760px); overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 0; box-shadow: 0 25px 80px rgb(24 37 64 / 22%); }
dialog::backdrop { background: rgb(25 34 52 / 42%); backdrop-filter: blur(2px); }
dialog form { padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.dialog-heading h2 { margin: 0; font-size: 19px; }
.icon-button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #7c8798; font-size: 20px; line-height: 1; }
.dialog-help { margin: 12px 0 17px; color: #858fa0; font-size: 10px; line-height: 1.5; }
dialog label { display: grid; gap: 6px; margin: 12px 0; color: #536075; font-size: 10px; font-weight: 600; }
dialog input, dialog select { width: 100%; min-height: 37px; border: 1px solid #dfe4ec; border-radius: 6px; outline: 0; background: #fff; padding: 0 10px; color: #39465b; font-size: 11px; }
dialog input:focus, dialog select:focus { border-color: #8595f0; box-shadow: 0 0 0 3px #edf0ff; }
dialog input::placeholder { color: #b0b7c2; }
fieldset { border: 1px solid #e6eaf0; border-radius: 7px; margin: 14px 0; padding: 10px; }
legend { padding: 0 4px; color: #536075; font-size: 10px; font-weight: 600; }
.access-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.access-options label { display: flex; align-items: center; gap: 6px; margin: 2px 0; font-size: 9px; font-weight: 400; }
.access-options input { width: 14px; min-height: 14px; accent-color: var(--blue); }
.form-error { min-height: 16px; color: #b64444; font-size: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.toast { position: fixed; right: 24px; bottom: 22px; z-index: 5; max-width: min(360px, calc(100% - 36px)); transform: translateY(10px); border-radius: 8px; background: #263248; padding: 12px 15px; color: #fff; font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.visible { transform: translateY(0); opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

/* Pannello reale */
.status.neutral { background: #f0f2f6; color: #79859a; }
.status.neutral::before { display: none; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d5efe3; border-radius: 20px; background: #eef9f3; padding: 5px 9px; color: #23805d; font-size: 10px; font-weight: 700; }
.live-pill .live-dot, .board-card.online .live-dot { background: #23a26f; }
.live-pill.warning { border-color: #f6dccb; background: #fff4ec; color: #b76a33; }
.live-pill.warning .live-dot, .board-card.offline .live-dot { background: #d9783a; }
.board-list { display: grid; gap: 7px; }
.board-card { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; padding: 10px; }
.board-card .live-dot { margin-top: 4px; }
.board-card strong, .board-card small { display: block; }
.board-card strong { font-size: 11px; }
.board-card small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.board-card.offline small { color: #b76a33; }
.profile { flex-wrap: nowrap; }
.logout-form { margin-left: auto; }
.small-button.primary { border-color: var(--blue); background: var(--blue); color: #fff; }
.small-button.primary:hover { background: var(--blue-dark); }
.small-button.primary:disabled { border-color: #c9d0f5; background: #c9d0f5; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.search-input, .filters select, .filters input { min-height: 34px; border: 1px solid #dfe4ec; border-radius: 6px; background: #fff; padding: 0 10px; color: #39465b; font-size: 11px; }
.search-input { width: min(240px, 100%); }
.filters { flex-wrap: wrap; justify-content: flex-start; }
.cell-sub { display: block; margin-top: 4px; color: #98a1b0; font-size: 9px; }
.row-actions { white-space: nowrap; text-align: right; }
.table-action.edit { color: var(--blue); }
.event-kind.error::before { background: var(--red); }
.load-more { display: flex; justify-content: center; padding: 14px 0 18px; }
.toast.error { background: #8f2f2f; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }
.input-row .button { white-space: nowrap; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
dialog label.check { display: flex; align-items: center; gap: 8px; }
dialog label.check input { width: 15px; min-height: 15px; accent-color: var(--blue); }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 16px; }
.login-box { width: min(380px, 100%); border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 28px; box-shadow: var(--shadow); }
.login-box .brand { margin: 0 0 26px; }
.login-box label { display: grid; gap: 6px; margin: 14px 0; color: #536075; font-size: 11px; font-weight: 600; }
.login-box input { min-height: 40px; border: 1px solid #dfe4ec; border-radius: 6px; padding: 0 10px; font-size: 13px; }
.login-box input:focus { border-color: #8595f0; outline: 0; box-shadow: 0 0 0 3px #edf0ff; }
.login-box .button { width: 100%; min-height: 40px; margin-top: 8px; font-size: 12px; }
.login-box .form-error { margin-top: 4px; font-size: 11px; }
@media (max-width: 470px) { .two-cols { grid-template-columns: 1fr; } }

@media (min-width: 1500px) {
  .main-content { margin: 0 auto; padding: 0 44px 0 292px; }
}
@media (max-width: 1100px) {
  .sidebar { width: 210px; }
  .main-content { margin-left: 210px; padding: 0 22px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .door-grid, .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: sticky; inset: 0 0 auto; width: 100%; height: auto; padding: 10px 14px 8px; }
  .brand { margin: 0 0 9px; }
  .brand-mark { width: 34px; height: 34px; font-size: 19px; }
  .nav-label, .sidebar-bottom { display: none; }
  .main-nav { display: flex; overflow-x: auto; gap: 4px; margin: 0 -3px; padding-bottom: 1px; scrollbar-width: thin; }
  .nav-item { min-height: 36px; flex: 0 0 auto; gap: 6px; padding: 0 9px; font-size: 10px; }
  .nav-item > span:first-child { width: auto; font-size: 13px; }
  .nav-count { display: none; }
  .main-content { margin: 0; padding: 0 14px; }
  .topbar { min-height: 50px; }
  .date-label { display: none; }
  .demo-banner { margin-top: 13px; padding: 10px; }
  .view { padding-top: 23px; }
  .page-heading { align-items: flex-start; }
  h1 { font-size: 23px; }
  .page-heading > .button { margin-top: 5px; }
  .content-grid { grid-template-columns: 1fr; }
  .door-grid, .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controller-note { align-items: flex-start; }
  .controller-note strong { flex-basis: 100%; }
  .controller-note span { padding-left: 0; border: 0; }
  .table-panel { padding: 14px 12px 0; }
}
@media (max-width: 470px) {
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 100px; gap: 8px; padding: 12px 9px; }
  .stat-icon { width: 29px; height: 29px; }
  .stat-card strong { font-size: 19px; }
  .door-preview { grid-template-columns: 1fr; }
  .door-grid, .room-grid { grid-template-columns: 1fr; }
  .page-heading { gap: 8px; }
  .page-heading > .button { padding: 0 8px; font-size: 10px; }
  .demo-pill { font-size: 8px; }
  .access-options { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar-bottom { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
  .board-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .board-card { padding: 5px 8px; }
  .board-card small { display: none; }
  .profile { margin: 0 0 0 auto; border: 0; padding: 0; }
  .profile > span:not(.avatar) { display: none; }
  .heading-actions .button { padding: 0 9px; }
}

/* ---------- Camere ---------- */
:root {
  --free: #1f9d6c;
  --free-soft: #e7f6ef;
  --occ: #d4573f;
  --occ-soft: #fdeeea;
  --unk: #8c96a8;
}
.room-legend { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.legend-dot.free { background: var(--free); }
.legend-dot.occupied { background: var(--occ); }

.common-strip { display: grid; grid-template-columns: 1fr 1.3fr 2fr; gap: 12px; margin-bottom: 16px; }
.strip-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 14px 16px; box-shadow: var(--shadow); }
.strip-item.total { border-color: #dfe5ff; background: linear-gradient(135deg, #f3f5ff, #fff); }
.strip-label { display: block; margin-bottom: 6px; color: #7d889b; font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.strip-item strong { display: block; font-size: 24px; line-height: 1.1; letter-spacing: -.5px; }
.strip-item small { display: block; margin-top: 5px; color: #98a1b0; font-size: 10px; }
.strip-lights { display: flex; flex-wrap: wrap; gap: 6px; }

.suite-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.suite { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); transition: box-shadow .2s; }
.suite:hover { box-shadow: 0 12px 32px rgb(23 39 75 / 10%); }
.suite-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 18px 16px; color: #fff; }
.suite.free .suite-head { background: linear-gradient(135deg, #22a874, #17865b); }
.suite.occupied .suite-head { background: linear-gradient(135deg, #e0664c, #c24732); }
.suite.unknown .suite-head { background: linear-gradient(135deg, #9aa3b4, #7c8698); }
.suite-head h3 { margin: 0; font-size: 21px; letter-spacing: -.4px; }
.suite-state { display: inline-block; margin-top: 5px; border-radius: 20px; background: rgb(255 255 255 / 22%); padding: 3px 9px; font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.door-badge { display: inline-flex; align-items: center; gap: 7px; border-radius: 9px; background: rgb(255 255 255 / 18%); padding: 7px 10px; font-size: 11px; font-weight: 700; }
.door-badge.aperta { background: #fff; color: #b9612a; }

/* Porta disegnata: rettangolo con maniglia; aperta = anta ruotata e varco giallo. */
.door-icon { position: relative; display: inline-block; width: 13px; height: 18px; flex: 0 0 auto; border: 2px solid currentColor; border-radius: 2px; }
.door-icon::after { position: absolute; top: 7px; right: 1px; width: 3px; height: 3px; border-radius: 50%; background: currentColor; content: ""; }
.door-badge.aperta .door-icon, .door-icon.aperta { border-left-width: 6px; background: #ffd27a; transform: perspective(30px) rotateY(-28deg); }
.door-icon.mini { width: 9px; height: 12px; margin-right: 5px; border-width: 1.5px; vertical-align: -2px; }
.door-icon.mini::after { top: 4px; width: 2px; height: 2px; }
.door-icon.mini.aperta { border-left-width: 4px; }

.suite-facts { display: grid; gap: 0; margin: 0; padding: 6px 18px 2px; }
.suite-facts > div { display: grid; grid-template-columns: 104px 1fr; gap: 8px; align-items: baseline; border-bottom: 1px solid #f1f3f6; padding: 10px 0; }
.suite-facts dt { color: #98a1b0; font-size: 10px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.suite-facts dd { margin: 0; color: #2d3749; font-size: 12px; font-weight: 600; }
.suite-facts small { color: #98a1b0; font-size: 10px; font-weight: 400; }
.muted { color: #a5adba; font-weight: 400; }
.alarm-text { display: inline-block; margin-left: 6px; border-radius: 10px; background: #fff0e4; padding: 2px 7px; color: #c0621d; font-size: 9px; font-weight: 700; }
.suite.alarm { border-color: #f3b98e; box-shadow: 0 0 0 3px #fff1e6, var(--shadow); }

.suite-energy { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px 18px; }
.energy-now strong, .energy-today strong { display: block; font-size: 16px; letter-spacing: -.3px; }
.energy-now span, .energy-today span { color: #a0a8b5; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; }
.energy-today { text-align: right; }
.energy-bar { height: 8px; overflow: hidden; border-radius: 6px; background: #eef1f6; }
.energy-bar span { display: block; width: 0; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #6a83f4, #4263eb); transition: width .6s; }

.suite-lights { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; }
.light-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; border: 1px solid #e2e7ef; border-radius: 20px; background: #fff; padding: 0 11px 0 8px; color: #5a6679; font-size: 10px; font-weight: 600; }
.light-toggle .bulb { width: 12px; height: 12px; border-radius: 50%; background: #d8dde6; box-shadow: inset 0 -2px 0 rgb(0 0 0 / 8%); }
.light-toggle.on { border-color: #f5d27a; background: #fff8e3; color: #8a6514; }
.light-toggle.on .bulb { background: #ffc531; box-shadow: 0 0 8px 2px rgb(255 197 49 / 60%); }
.light-toggle:disabled { opacity: .5; cursor: default; }

.suite-foot { display: flex; justify-content: flex-end; margin-top: auto; border-top: 1px solid #f1f3f6; padding: 12px 18px; }
.suite-foot .small-button { min-height: 32px; padding: 0 16px; font-size: 11px; }

/* Riquadri camere in panoramica */
.room-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.room-tile { display: grid; gap: 3px; border: 0; border-radius: 10px; padding: 12px; color: #fff; text-align: left; }
.room-tile.free { background: linear-gradient(135deg, #22a874, #17865b); }
.room-tile.occupied { background: linear-gradient(135deg, #e0664c, #c24732); }
.room-tile.unknown { background: linear-gradient(135deg, #9aa3b4, #7c8698); }
.room-tile strong { font-size: 13px; }
.room-tile > span { font-size: 9px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; opacity: .9; }
.room-tile small { margin-top: 6px; font-size: 10px; opacity: .92; }
.room-tile:hover { filter: brightness(1.05); }

@media (max-width: 900px) { .common-strip { grid-template-columns: 1fr 1fr; } .strip-item.lights { grid-column: 1 / -1; } }
@media (max-width: 470px) {
  .common-strip { grid-template-columns: 1fr; }
  .suite-grid { grid-template-columns: 1fr; }
  .suite-facts > div { grid-template-columns: 92px 1fr; }
  .room-legend { display: none; }
}

/* ---------- PIN temporaneo ---------- */
.temppin-layout { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; align-items: start; }
.temppin-form { padding: 19px; }
.temppin-form h2 { margin: 0 0 6px; font-size: 14px; }
.temppin-form label { display: grid; gap: 6px; margin: 12px 0; color: #536075; font-size: 10px; font-weight: 600; }
.temppin-form input:not([type="checkbox"]), .temppin-form select { width: 100%; min-height: 37px; border: 1px solid #dfe4ec; border-radius: 6px; outline: 0; background: #fff; padding: 0 10px; color: #39465b; font-size: 12px; }
.temppin-form input:focus, .temppin-form select:focus { border-color: #8595f0; box-shadow: 0 0 0 3px #edf0ff; }
.temppin-form .access-options label { display: flex; align-items: center; gap: 6px; margin: 2px 0; font-size: 10px; font-weight: 400; }
.temppin-form .access-options input { width: 14px; min-height: 14px; accent-color: var(--blue); }
.temppin-form .button-primary { width: 100%; min-height: 40px; margin-top: 4px; }
.temppin-list { display: grid; gap: 10px; padding-bottom: 18px; }
.temppin-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; border: 1px solid #e6eaff; border-radius: 12px; background: linear-gradient(135deg, #f7f8ff, #fff); padding: 14px 16px; }
.temppin-code { border-radius: 10px; background: #263248; padding: 10px 14px; color: #fff; font-family: "Cascadia Mono", Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.temppin-info strong { display: block; font-size: 13px; }
.temppin-info small { display: block; margin-top: 4px; color: #8a94a6; font-size: 10px; }
@media (max-width: 900px) { .temppin-layout { grid-template-columns: 1fr; } }
@media (max-width: 470px) { .temppin-card { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- Impostazioni ---------- */
.settings-form { max-width: 560px; padding: 20px; }
.settings-form label { display: grid; gap: 6px; margin: 14px 0; color: #536075; font-size: 11px; font-weight: 600; }
.settings-form label.check { display: flex; align-items: center; gap: 8px; margin-top: 0; }
.settings-form label.check input { width: 15px; height: 15px; accent-color: var(--blue); }
.settings-form input:not([type="checkbox"]), .settings-form textarea { width: 100%; min-height: 37px; border: 1px solid #dfe4ec; border-radius: 6px; outline: 0; background: #fff; padding: 8px 10px; color: #39465b; font: inherit; font-size: 12px; }
.settings-form input:focus, .settings-form textarea:focus { border-color: #8595f0; box-shadow: 0 0 0 3px #edf0ff; }
.field-hint { margin: 0; color: #8a94a6; font-size: 10px; font-weight: 400; line-height: 1.5; }
