:root {
  /* "Thai 4-star" palette: ivory, deep forest green from the sign, muted gold, hibiscus red for alerts */
  --bg: #f5f1e8;
  --surface: #fffdf9;
  --surface-2: #f8f4ec;
  --ink: #1b2a22;
  --ink-2: #4d5b52;
  --ink-3: #8c948c;
  --line: #e9e2d4;
  --brand: #1f5a3d;
  --brand-2: #2c7650;
  --brand-soft: #e6efe5;
  --forest: #143826;
  --forest-2: #1b4a33;
  --gold: #b08a4f;
  --gold-2: #cfae74;
  --gold-soft: #f5ecdb;
  --red: #c2343c;
  --red-soft: #fbe8e8;
  --amber: #d99a2b;
  --amber-soft: #fbf0d9;
  --blue: #3a6db3;
  --blue-soft: #e8eef8;
  --gray-soft: #efebe2;
  --occ: #1c4732;
  --occ-2: #275e43;
  --occ-ink: #e0f4e8;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(40, 32, 16, .05), 0 10px 28px rgba(40, 32, 16, .06);
  --shadow-lg: 0 28px 70px rgba(20, 40, 28, .2);
  --font: 'Noto Sans Thai', system-ui, sans-serif;
  --serif: 'Noto Serif Thai', 'Noto Sans Thai', serif;
  --num: 'Manrope', 'Noto Sans Thai', system-ui, sans-serif;
  color-scheme: light;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--forest) 240px, var(--bg) 240px); }
.board-layout > section { min-width: 0; }
html { overflow-x: hidden; } body { overflow-x: clip; } /* clip, not hidden: hidden on body makes it a scroll container and breaks position: sticky (sidebar) */
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 14px; display: flex; flex-direction: column; gap: 2px; background: linear-gradient(180deg, var(--forest-2), var(--forest) 60%); color: #efe9dc; }
.logo { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 8px 18px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo .mark { display: block; width: 100%; padding: 2px 4px; }
.logo img { width: 100%; height: auto; display: block; }
.logo small { color: var(--gold-2); font-size: 11.5px; letter-spacing: .08em; padding-left: 6px; text-transform: uppercase; }
.logo b { display: block; font-size: 17px; color: var(--brand); line-height: 1.1; }
.nav { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: rgba(239, 233, 220, .74); text-decoration: none; font-weight: 500; border: 0; background: none; width: 100%; text-align: left; }
.nav:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav.on { background: rgba(255,255,255,.09); color: #fff; font-weight: 600; }
.nav.on::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-2); }
.nav.on svg.i { color: var(--gold-2); }
.nav-group { margin: 14px 12px 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(239,233,220,.4); }
.nav .badge { margin-left: auto; }
.side .me { margin-top: auto; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.06); display: flex; align-items: center; gap: 10px; }
.side .me .icon-btn { color: rgba(239,233,220,.8); } .side .me .icon-btn:hover { background: rgba(255,255,255,.08); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.me .who { flex: 1; min-width: 0; } .me .who b { display: block; font-size: 14px; color: #fff; } .me .who small { color: rgba(239,233,220,.6); font-size: 12px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: var(--gray-soft); }
main { padding: 24px 28px 48px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar h1 { font-family: var(--serif); font-size: 26px; margin: 0; font-weight: 600; letter-spacing: 0; }
.topbar .sub { color: var(--ink-3); font-size: 14px; }
.topbar .grow { flex: 1; }
.clock { font-family: var(--num); font-weight: 700; font-size: 22px; }
.bottom-nav { display: none; }

/* ---------- common ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card { border: 1px solid var(--line); }
.card h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; }
.wrap { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 11px 18px; font-weight: 600; background: var(--gray-soft); color: var(--ink); min-height: 44px; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.lg { min-height: 56px; font-size: 17px; border-radius: 16px; padding: 14px 22px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--gray-soft); color: var(--ink-2); white-space: nowrap; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: #9a6200; }
.badge.green { background: var(--brand-soft); color: var(--brand); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.in { width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 13px; font-size: 15px; min-height: 46px; outline: none; }
.in:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.in { min-height: 70px; resize: vertical; }
.seg { display: flex; background: var(--gray-soft); padding: 4px; border-radius: 14px; gap: 4px; flex-wrap: wrap; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 14px; border-radius: 10px; font-weight: 600; color: var(--ink-2); min-height: 40px; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.list { display: flex; flex-direction: column; }
.list .li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.list .li:last-child { border-bottom: 0; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; color: var(--ink-3); font-weight: 600; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
.r { text-align: right; }
.empty { text-align: center; color: var(--ink-3); padding: 32px 12px; }
.scroll-x { overflow-x: auto; }

/* ---------- stats (smart-home "scene" chips) ---------- */
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { border: 0; text-align: left; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; position: relative; outline: 2px solid transparent; transition: outline-color .15s, transform .15s; }
.stat:hover { transform: translateY(-1px); }
.stat.on { outline-color: var(--ink); }
.stat .dot { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; }
.stat .n { font-family: var(--num); font-size: 28px; font-weight: 800; line-height: 1; }
.stat .l { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.stat.vacant .dot { background: var(--brand-soft); color: var(--brand); }
.stat.occupied .dot { background: var(--occ); color: var(--occ-ink); }
.stat.cleaning .dot { background: var(--amber-soft); color: #9a6200; }
.stat.maintenance .dot { background: var(--gray-soft); color: var(--ink-2); }
.stat.near .dot { background: #ffe8cc; color: #b35a00; }
.stat.over .dot { background: var(--red-soft); color: var(--red); }
.stat.over .n { color: var(--red); }

/* ---------- board ---------- */
.board-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.floor-tabs { display: flex; gap: 6px; background: var(--surface); padding: 5px; border-radius: 16px; box-shadow: var(--shadow); overflow-x: auto; }
.floor-tabs button { border: 0; background: transparent; padding: 9px 16px; border-radius: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; display: flex; align-items: center; gap: 6px; min-height: 42px; }
.floor-tabs button.on { background: var(--ink); color: #fff; }
.floor-tabs button .mini { font-family: var(--num); font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--gray-soft); color: var(--ink-2); }
.floor-tabs button.on .mini { background: rgba(255,255,255,.18); color: #fff; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-left: auto; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.board-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }

/* building overview: one row per floor, top floor first */
.building { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.floor-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.floor-label { border: 0; background: var(--surface-2); border-radius: 14px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 6px; color: var(--ink); }
.floor-label:hover { background: var(--brand-soft); }
.floor-label b { font-size: 16px; } .floor-label small { font-size: 11px; color: var(--ink-3); font-family: var(--num); }
.mini-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.mt { position: relative; border: 0; border-radius: 12px; padding: 8px 4px 6px; min-height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-family: var(--num); background: var(--brand-soft); color: var(--brand); transition: transform .12s; }
.mt:hover { transform: scale(1.05); z-index: 1; }
.mt b { font-size: 14.5px; font-weight: 800; }
.mt small { font-size: 10.5px; font-weight: 600; opacity: .85; font-family: var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mt .ic { position: absolute; top: 4px; right: 5px; opacity: .55; } .mt .ic svg.i { width: 12px; height: 12px; }
.mt.occupied { background: var(--occ); color: var(--occ-ink); }
.mt.cleaning { background: var(--amber-soft); color: #8a5800; }
.mt.maintenance { background: var(--gray-soft); color: var(--ink-3); background-image: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(0,0,0,.04) 6px 12px); }
.mt.near { box-shadow: 0 0 0 2.5px #ff9a2e inset; }
.mt.over { background: var(--red); color: #fff; animation: pulse 1.8s ease-in-out infinite; }
.mt.dim { opacity: .22; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(210, 50, 58, .45); } 50% { box-shadow: 0 0 0 6px rgba(210, 50, 58, 0); } }

/* floor detail: device-style cards */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.rc { border: 0; text-align: left; background: var(--surface); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; min-height: 168px; position: relative; transition: transform .15s, box-shadow .15s; }
.rc:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.rc .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rc .no { font-family: var(--num); font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.rc .feat { display: flex; gap: 6px; }
.rc .feat span { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.rc .feat svg.i { width: 17px; height: 17px; }
.rc .type { font-size: 12.5px; color: var(--ink-3); }
.rc .state { margin-top: auto; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.rc .state .led { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }
.rc .guest { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc .bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
.rc .bar i { display: block; height: 100%; background: #7ee2a6; border-radius: 99px; }
.rc .due { display: flex; justify-content: space-between; font-size: 12.5px; gap: 6px; }
.rc.vacant .state { color: var(--brand-2); }
.rc.cleaning { background: linear-gradient(160deg, #fff8e6, #fff); } .rc.cleaning .state { color: #a86b00; }
.rc.maintenance { background: var(--surface-2); } .rc.maintenance .state { color: var(--ink-3); }
.rc.occupied { background: linear-gradient(160deg, var(--occ-2), var(--occ)); color: var(--occ-ink); }
.rc.occupied .type { color: #9cc5ad; }
.rc.occupied .feat span { background: rgba(255,255,255,.1); color: var(--occ-ink); }
.rc.occupied .state { color: #9cf0bf; }
.rc.near { box-shadow: 0 0 0 3px #ff9a2e, var(--shadow); }
.rc.near .bar i { background: #ffb257; }
.rc.over { background: linear-gradient(160deg, #e0464d, #b9232b); }
.rc.over .bar i { background: #fff; }
.rc.over .state, .rc.over .type { color: #ffe1e2; }
.rc .bal { margin-left: auto; }

/* alert rail */
.rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.alert-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; border: 0; background: var(--surface-2); text-align: left; width: 100%; }
.alert-item:hover { background: var(--gray-soft); }
.alert-item .no { font-family: var(--num); font-weight: 800; font-size: 17px; width: 52px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.alert-item.over .no { background: var(--red); color: #fff; }
.alert-item.near .no { background: #ffe8cc; color: #b35a00; }
.alert-item.clean .no { background: var(--amber-soft); color: #8a5800; }
.alert-item .tx { flex: 1; min-width: 0; font-size: 13px; } .alert-item .tx b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- side sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(12, 28, 20, .38); backdrop-filter: blur(2px); z-index: 40; animation: fade .15s; }
.sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg); z-index: 41; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
.sheet.wide { width: min(760px, 100vw); }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 20px; flex: 1; }
.sheet-head .no { font-family: var(--num); font-weight: 800; font-size: 22px; width: 64px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.sheet-head .no.occupied { background: var(--occ); color: var(--occ-ink); } .sheet-head .no.over { background: var(--red); color: #fff; }
.sheet-head .no.cleaning { background: var(--amber-soft); color: #8a5800; }
.sheet-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 14px; }
.sheet-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }
.sheet-foot .btn { flex: 1; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 14.5px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.big-time { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: var(--occ); color: var(--occ-ink); }
.big-time.near { background: #b35a00; } .big-time.over { background: var(--red); }
.big-time .t { font-family: var(--num); font-size: 26px; font-weight: 800; line-height: 1.1; }
.big-time small { opacity: .8; font-size: 13px; }
.money-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14.5px; }
.money-row.total { font-weight: 700; font-size: 18px; border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 10px; }
.money-row.total.due { color: var(--red); }
.charge { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.charge:last-child { border-bottom: 0; }
.charge .d { flex: 1; min-width: 0; } .charge .d small { display: block; color: var(--ink-3); font-size: 12px; }
.charge.void { opacity: .45; text-decoration: line-through; }
.actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.act { border: 0; background: var(--surface); border-radius: 16px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow); min-height: 84px; }
.act span.ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.act.red span.ic { background: var(--red-soft); color: var(--red); }
.act.amber span.ic { background: var(--amber-soft); color: #9a6200; }
.act:hover { transform: translateY(-1px); }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.prod { border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px; text-align: left; display: flex; flex-direction: column; gap: 4px; min-height: 70px; position: relative; }
.prod b { font-size: 14px; } .prod span { font-family: var(--num); color: var(--brand); font-weight: 700; }
.prod.on { border-color: var(--brand); background: var(--brand-soft); }
.prod .q { position: absolute; top: 6px; right: 6px; background: var(--brand); color: #fff; border-radius: 99px; font-size: 12px; padding: 1px 8px; font-family: var(--num); }
.idcard-btn { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; border: 2px dashed color-mix(in srgb, var(--brand) 30%, #fff); background: var(--brand-soft); color: var(--brand); font-weight: 600; width: 100%; text-align: left; }
.idcard-btn small { display: block; font-weight: 400; color: var(--ink-2); font-size: 12.5px; }
.idcard-btn .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.found { padding: 10px 12px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 13.5px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.25fr 1fr; }
.login .art { position: relative; overflow: hidden; color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; background: #0c2a1b; }
.login .hero, .login .hero img { position: absolute; inset: 0; width: 100%; height: 100%; }
.login .hero img { object-fit: cover; object-position: 50% 45%; transform: scale(1.04); animation: heroIn 1.2s ease-out both; }
.login .art::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 30, 19, .55) 0%, rgba(8, 30, 19, .05) 28%, rgba(8, 30, 19, .1) 50%, rgba(10, 44, 27, .88) 78%, #0b2a1a 100%); }
.login .hero-top, .login .hero-text { position: relative; z-index: 1; }
.login .sign { display: inline-flex; }
.login .sign img { height: 104px; width: auto; display: block; filter: drop-shadow(0 4px 14px rgba(0,0,0,.45)); }
.login .eyebrow { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .04em; padding: 5px 12px; border-radius: 99px; background: rgba(255,255,255,.14); backdrop-filter: blur(6px); margin-bottom: 14px; }
.login .art h1 { font-size: clamp(30px, 3.2vw, 46px); margin: 0; line-height: 1.18; text-shadow: 0 2px 20px rgba(0,0,0,.35); }
.login .art p { opacity: .85; max-width: 460px; margin: 12px 0 18px; }
.login .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.login .chips span { font-size: 13px; padding: 6px 12px; border-radius: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(6px); }
@keyframes heroIn { from { transform: scale(1.12); opacity: .4; } }
.login .pad { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; gap: 18px; }
.pin-dots { display: flex; gap: 14px; height: 22px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-3); }
.pin-dots i.on { background: var(--brand); border-color: var(--brand); }
.pin-dots.err i { border-color: var(--red); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 84px); gap: 14px; }
.keypad button { height: 84px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); font-family: var(--num); font-size: 28px; font-weight: 600; }
.keypad button:active { background: var(--brand-soft); }
.keypad button.fn { background: transparent; box-shadow: none; font-size: 15px; font-family: var(--font); color: var(--ink-2); }

/* sign in with Google / LINE */
.sso { width: 100%; max-width: 300px; display: flex; flex-direction: column; gap: 10px; }
.sso .or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; }
.sso .or::before, .sso .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.sso-google { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.sso-line { background: #06C755; color: #fff; }

/* ---------- housekeeping ---------- */
.hk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.hk { background: var(--surface); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.hk .top { display: flex; align-items: center; gap: 12px; }
.hk .no { font-family: var(--num); font-weight: 800; font-size: 24px; width: 70px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--amber-soft); color: #8a5800; }
.hk.cleaning .no { background: var(--blue-soft); color: var(--blue); }
.hk.done .no { background: var(--brand-soft); color: var(--brand); }
.hk img { width: 100%; border-radius: 14px; aspect-ratio: 4/3; object-fit: cover; background: var(--surface-2); }

/* ---------- reports ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi .l { font-size: 13px; color: var(--ink-2); } .kpi .n { font-family: var(--num); font-size: 26px; font-weight: 800; margin-top: 4px; }
.kpi .s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .b i { width: 100%; max-width: 38px; background: var(--brand-2); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars .b:hover i { background: var(--brand); }
.bars .b small { font-size: 11px; color: var(--ink-3); font-family: var(--num); white-space: nowrap; }
.report-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.report-grid > * { min-width: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--ink-3); border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--brand); }
.assign-grid { display: grid; grid-template-columns: 60px repeat(12, minmax(0, 1fr)); gap: 5px; align-items: center; font-size: 12px; }
.assign-grid select { width: 100%; font-size: 11px; padding: 6px 2px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.assign-grid .rn { font-family: var(--num); font-weight: 700; text-align: center; font-size: 12px; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; opacity: 0; transition: .2s; z-index: 60; pointer-events: none; max-width: calc(100vw - 32px); font-weight: 500; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { background: var(--red); }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .board-layout { grid-template-columns: 1fr; }
  .rail { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
  .side { display: none; }
  main { padding: 16px 16px 96px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 30; justify-content: space-around; }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 11.5px; color: var(--ink-3); text-decoration: none; border-radius: 12px; position: relative; }
  .bottom-nav a.on { color: var(--brand); background: var(--brand-soft); }
  .bottom-nav .badge { position: absolute; top: 0; right: 14%; padding: 0 6px; font-size: 10.5px; }
  .mini-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .floor-row { grid-template-columns: 52px minmax(0, 1fr); }
  .kpis { grid-template-columns: 1fr 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login .art { min-height: 0; height: 30vh; min-height: 200px; padding: 18px; justify-content: flex-end; align-items: center; text-align: center; border-radius: 0 0 28px 28px; }
  .login .art::after { background: linear-gradient(180deg, rgba(8,30,19,.05) 0%, rgba(8,30,19,.15) 45%, rgba(10,44,27,.85) 100%); }
  .login .hero-text { display: none; }
  .login .sign img { height: 84px; }
  .login .pad { padding: 20px 16px 32px; }
  .legend { margin-left: 0; }
  .rail { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 20px; }
  .assign-grid { grid-template-columns: 44px repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 10px; border-radius: 16px; } .stat .n { font-size: 22px; } .stat .dot { display: none; }
  .room-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .rc { min-height: 150px; padding: 13px; border-radius: 18px; } .rc .no { font-size: 22px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .actions-grid { grid-template-columns: repeat(3, 1fr); }
  .keypad { grid-template-columns: repeat(3, 76px); } .keypad button { height: 76px; }
  .kv { grid-template-columns: 100px 1fr; }
}
@media print { .side, .bottom-nav, .topbar .btn { display: none; } }

/* ---------- 4-star refresh ---------- */
h1, h2, .serif { font-family: var(--serif); }
.sheet-head h2 { font-family: var(--serif); font-weight: 600; }
.btn.primary { background: var(--brand); }
.btn.gold { background: var(--gold); color: #fff; }
.badge.gold { background: var(--gold-soft); color: #87652f; }
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(245, 241, 232, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.appbar .search { flex: 1; min-width: 0; max-width: 460px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; min-height: 44px; color: var(--ink-3); }
.appbar .search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 14.5px; color: var(--ink); }
.appbar .grow { flex: 1; }
.shift-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.shift-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.appbar .clock { font-size: 18px; }
main.with-appbar { padding-top: 22px; }

/* today strip */
.daystrip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.daystrip > div, .daystrip > button { padding: 16px 18px; border: 0; background: none; text-align: left; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.daystrip > :last-child { border-right: 0; }
.daystrip > button:hover { background: var(--surface-2); }
.daystrip .l { font-size: 12.5px; color: var(--ink-3); font-weight: 500; letter-spacing: .02em; }
.daystrip .n { font-family: var(--num); font-weight: 800; font-size: 26px; line-height: 1.1; color: var(--ink); }
.daystrip .n small { font-size: 14px; font-weight: 700; color: var(--ink-3); }
.daystrip .s { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daystrip .occ { background: linear-gradient(150deg, var(--forest-2), var(--forest)); color: #fff; }
.daystrip .occ .l { color: var(--gold-2); } .daystrip .occ .n { color: #fff; } .daystrip .occ .s { color: rgba(255,255,255,.7); }
.meter { height: 6px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; margin-top: 4px; } .meter i { display: block; height: 100%; background: var(--gold-2); border-radius: 99px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px 6px 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chip b { font-family: var(--num); color: var(--ink); }
.chip i { width: 10px; height: 10px; border-radius: 4px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; } .chip.on b { color: #fff; }
.mt.booked { box-shadow: inset 0 0 0 2px var(--gold); background: var(--gold-soft); color: #7a5a28; }
.mt.booked::after { content: ''; position: absolute; left: 6px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.rc .booked-tag { position: absolute; right: 14px; top: 52px; }
.stat-legend { display: none; }

/* handover */
.note-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.note-item:last-child { border-bottom: 0; }
.note-item .tick { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); display: grid; place-items: center; flex: none; color: transparent; }
.note-item .tick:hover { border-color: var(--brand); color: var(--brand); }
.note-item.done { opacity: .5; } .note-item.done .tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.note-item small { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
.note-form { display: flex; gap: 8px; margin-top: 10px; } .note-form .in { min-height: 40px; padding: 8px 12px; font-size: 14px; }

/* reservations */
.res-list { display: flex; flex-direction: column; gap: 10px; }
.res { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); }
.res .date { text-align: center; border-radius: 14px; background: var(--gold-soft); color: #7a5a28; padding: 8px 4px; }
.res .date b { display: block; font-family: var(--num); font-size: 24px; line-height: 1; } .res .date small { font-size: 12px; }
.res .date.today { background: var(--forest); color: #fff; }
.res .who b { font-size: 15.5px; } .res .who .meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; }
.res .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.res .acts .btn { min-height: 38px; padding: 7px 14px; font-size: 14px; }
.room-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; max-height: 300px; overflow-y: auto; padding: 2px; }
.room-pick button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 4px; font-family: var(--num); font-weight: 800; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.room-pick button small { font-family: var(--font); font-weight: 500; font-size: 10.5px; color: var(--ink-3); }
.room-pick button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.room-pick button:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }

/* 14-day chart */
.chart-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.chart { display: grid; position: relative; min-width: 900px; font-size: 12px; }
.chart .hd { position: sticky; top: 0; background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 8px 2px; text-align: center; color: var(--ink-3); font-weight: 600; z-index: 1; }
.chart .hd b { display: block; font-family: var(--num); color: var(--ink); font-size: 14px; }
.chart .hd.we { background: #f3ecdf; } .chart .hd.td { background: var(--forest); color: var(--gold-2); } .chart .hd.td b { color: #fff; }
.chart .rn { position: sticky; left: 0; background: var(--surface); border-right: 1px solid var(--line); padding: 0 10px; display: flex; align-items: center; gap: 6px; font-family: var(--num); font-weight: 800; z-index: 1; height: 34px; border-bottom: 1px solid #f1ece2; }
.chart .rn small { font-family: var(--font); font-weight: 500; color: var(--ink-3); font-size: 11px; }
.chart .cell { border-bottom: 1px solid #f1ece2; border-right: 1px solid #f6f2ea; height: 34px; }
.chart .cell.we { background: #fbf7ef; }
.chart .fl { grid-column: 1 / -1; background: var(--surface-2); padding: 6px 12px; font-weight: 700; font-size: 12.5px; color: var(--ink-2); border-bottom: 1px solid var(--line); position: sticky; left: 0; }
.chart .bar { height: 26px; margin: 4px 2px; border-radius: 8px; padding: 0 8px; display: flex; align-items: center; font-size: 11.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 0; cursor: pointer; border: 0; text-align: left; font-family: var(--font); }
.chart .bar.stay { background: var(--occ-2); } .chart .bar.stay.monthly, .chart .bar.stay.yearly { background: #4a6b5a; }
.chart .bar.res { background: var(--gold); }
.chart .bar.oos { background: repeating-linear-gradient(-45deg, #c9c3b6 0 6px, #d8d2c5 6px 12px); color: var(--ink-2); }

/* maintenance */
.mx { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.mx .no { font-family: var(--num); font-weight: 800; font-size: 20px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--gray-soft); }
.mx.urgent .no { background: var(--red-soft); color: var(--red); }
.mx .meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

/* promptpay */
.qr-box { display: flex; gap: 16px; align-items: center; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.qr-box .qr { width: 150px; height: 150px; flex: none; } .qr-box .qr svg { width: 100%; height: 100%; }
.qr-box .pp { font-weight: 700; color: #113566; }
.qr-box .amt { font-family: var(--num); font-size: 26px; font-weight: 800; }

/* foreign guest toggle */
.toggle-row { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-top: 12px; }

.appbar .mlogo { display: none; }
@media (max-width: 1200px) { .daystrip { grid-template-columns: repeat(3, minmax(0, 1fr)); } .daystrip > :nth-child(3) { border-right: 0; } .daystrip > :nth-child(-n+3) { border-bottom: 1px solid var(--line); } }
@media (max-width: 900px) {
  .shell { background: var(--bg); }
  .appbar { padding: 10px 16px; gap: 8px; } .appbar .grow { display: none; } .appbar .search { max-width: none; } .appbar > * { flex-shrink: 0; } .appbar .search { flex-shrink: 1; }
  .appbar .shift-pill, .appbar .clock { display: none; }
  .appbar .mlogo { display: block; height: 34px; padding: 4px 8px; border-radius: 10px; background: var(--forest); }
  .appbar .mlogo img { height: 100%; width: auto; display: block; }
  .daystrip { grid-template-columns: 1fr 1fr; } .daystrip > div, .daystrip > button { border-bottom: 1px solid var(--line); }
  .daystrip > :nth-child(even) { border-right: 1px solid var(--line); } .daystrip > :nth-child(odd) { border-right: 0; } .daystrip > :nth-child(4), .daystrip > :nth-child(5) { border-bottom: 0; }
  .daystrip .occ { grid-column: 1 / -1; }
  .res { grid-template-columns: 60px minmax(0, 1fr); } .res .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .mx { grid-template-columns: 56px minmax(0, 1fr); } .mx > :last-child { grid-column: 1 / -1; }
  .bottom-nav { background: var(--forest); border-top: 0; }
  .bottom-nav a { color: rgba(239,233,220,.65); }
  .bottom-nav a.on { color: #fff; background: rgba(255,255,255,.1); }
}
.col { min-width: 0; display: flex; flex-direction: column; }
.kpi { border: 1px solid var(--line); }
.kpi-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: linear-gradient(150deg, var(--forest-2), var(--forest)); color: #fff; border-radius: 22px; margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow); }
.kpi-band > div { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid rgba(255,255,255,.08); min-width: 0; }
.kpi-band > div:last-child { border-right: 0; }
.kpi-band .l { color: var(--gold-2); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.kpi-band .n { font-family: var(--num); font-size: 28px; font-weight: 800; line-height: 1.1; } .kpi-band .n small { font-size: 15px; opacity: .7; }
.kpi-band .s { font-size: 12px; color: rgba(255,255,255,.65); }
.alert-item.arrive .no { background: var(--gold-soft); color: #7a5a28; }
.sheet-head .avatar { flex: none; }
.rc.booked:not(.occupied) { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--gold-2); }
.tabs button.on { border-color: var(--gold); }
.floor-tabs button.on { background: var(--forest); color: #fff; }
.floor-tabs button.on .mini { background: rgba(255,255,255,.16); color: #fff; }
.stats { display: none; }
@media (max-width: 1200px) { .kpi-band { grid-template-columns: 1fr 1fr; } .kpi-band > div:nth-child(2) { border-right: 0; } .kpi-band > div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.08); } }
@media (max-width: 560px) {
  .appbar #quickbook span { display: none; } .appbar #quickbook { padding: 10px 12px; }
  .appbar .search input::placeholder { font-size: 13px; }
  .daystrip .n { font-size: 22px; } .daystrip > div, .daystrip > button { padding: 12px 14px; }
  .kpi-band .n { font-size: 22px; } .kpi-band > div { padding: 14px; }
  .chip { padding: 6px 11px 6px 8px; font-size: 12.5px; }
}

/* ---------- phase 2: shop, stock, meters, lost & found, LINE ---------- */
.prod .stk { font-style: normal; font-size: 11.5px; color: var(--ink-3); font-family: var(--num); }
.prod .stk.low { color: #9a6200; font-weight: 700; } .prod .stk.out { color: var(--red); font-weight: 700; }
.products.compact { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.products.compact .prod { min-height: 58px; padding: 8px 10px; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.pos-items > .products { margin-bottom: 14px; }
.pos-cart { position: sticky; top: 84px; }
.pos-cart .charge .icon-btn { width: 34px; height: 34px; background: var(--gray-soft); }
.meter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding-bottom: 84px; }
.mcard { display: flex; flex-direction: column; gap: 8px; }
.mhead { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.mhead .no { font-family: var(--num); font-weight: 800; font-size: 20px; width: 62px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--gray-soft); flex: none; }
.mhead .no.occupied { background: var(--occ); color: var(--occ-ink); }
.mrow { display: grid; grid-template-columns: 36px minmax(0, 1fr) 118px; gap: 10px; align-items: center; }
.mrow .in { text-align: right; }
.mic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; }
.mic.water { background: var(--blue-soft); color: var(--blue); } .mic.electric { background: var(--gold-soft); color: #87652f; }
.ml b { display: block; font-size: 14px; } .ml small { display: block; color: var(--ink-3); font-size: 12px; line-height: 1.35; }
.mcalc { font-size: 12.5px; color: var(--ink-2); padding-left: 46px; min-height: 0; }
.mcalc:empty { display: none; }
.save-bar { position: fixed; left: calc(240px + 28px); right: 28px; bottom: 16px; z-index: 30; display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-radius: 18px; padding: 10px 10px 10px 18px; max-width: 1180px; margin: 0 auto; }
.lf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.lf { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.lf img, .lf .ph { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); }
.lf .ph .i { width: 40px; height: 40px; }
.lfb { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.lfb .kv { grid-template-columns: 82px 1fr; gap: 4px 10px; }
.cancel-row { display: flex; gap: 8px; padding: 0 4px 12px; }
.code-box { margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: var(--brand-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.code-box span { flex-basis: 100%; font-size: 13px; color: var(--ink-2); }
.code-box b { font-size: 30px; letter-spacing: .18em; color: var(--brand); }
.line-preview { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font: 13.5px/1.6 var(--font); margin-top: 12px; max-width: 420px; }
@media (max-width: 1100px) { .pos { grid-template-columns: 1fr; } .pos-cart { position: static; } }
@media (max-width: 900px) { .save-bar { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); } .meter-grid { padding-bottom: 150px; } }
@media (max-width: 560px) {
  .mrow { grid-template-columns: 32px minmax(0, 1fr) 104px; }
  .save-bar { padding: 8px 8px 8px 14px; } .save-bar .btn { padding: 10px 14px; }
  .meter-grid { grid-template-columns: 1fr; }
}

/* ---------- settings: roomier layouts ---------- */
.sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.sec-head h3 { margin: 0 0 4px; }
.sec-head p { margin: 0; font-size: 13.5px; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.tcard { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px; }
.tcard.new { outline: 2px dashed var(--line); outline-offset: -2px; }
.thead { display: flex; align-items: flex-end; gap: 14px; }
.thead .grow { flex: 1; min-width: 0; }
.thead .in { font-size: 17px; font-weight: 600; }
.ticon { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px; display: grid; place-items: center; }
.ticon .i { width: 24px; height: 24px; }
.ticon.air { background: var(--blue-soft); color: var(--blue); } .ticon.fan { background: var(--gold-soft); color: #87652f; }
.tcount { flex: 0 0 auto; text-align: center; font-size: 12px; color: var(--ink-3); line-height: 1.2; padding-bottom: 4px; }
.tcount b { display: block; font: 700 22px var(--num); color: var(--ink); }
.tsegs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tsegs .lbl, .lbl { display: block; font-size: 13px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; }
.tsegs .seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tsegs .seg .i { width: 18px; height: 18px; }
.tprices { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.in-unit { position: relative; display: block; }
.in-unit .in { padding-right: 44px; text-align: right; font-family: var(--num); font-size: 16px; }
.in-unit i { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12.5px; color: var(--ink-3); pointer-events: none; }
.tfoot { display: flex; justify-content: flex-end; gap: 10px; }

.type-pick { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.type-pick button { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 16px 10px 12px; text-align: left; min-height: 52px; }
.type-pick button i { width: 14px; height: 14px; border-radius: 5px; background: var(--c); flex: 0 0 14px; }
.type-pick button b { display: block; font-size: 14.5px; } .type-pick button small { display: block; font-size: 12px; color: var(--ink-3); }
.type-pick button.on { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.assign { display: flex; flex-direction: column; gap: 12px; }
.afloor { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 10px; }
.afloor > b { font-size: 14px; color: var(--ink-2); }
.arooms { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; }
.aroom { border: 1.5px solid color-mix(in srgb, var(--c) 30%, transparent); background: color-mix(in srgb, var(--c) 9%, var(--surface)); border-radius: 12px; padding: 8px 4px; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink); }
.aroom .no { font: 700 16px var(--num); }
.aroom small { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.aroom.cur { background: var(--c); border-color: var(--c); color: #fff; }
.aroom.cur small { color: rgba(255,255,255,.85); }
.aroom:hover:not(.cur) { border-color: var(--c); }
@media (max-width: 1100px) { .arooms { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .afloor { grid-template-columns: 1fr; gap: 6px; }
  .tsegs { grid-template-columns: 1fr; }
  .tcard { padding: 16px; }
  .tprices { grid-template-columns: 1fr 1fr; }
}

/* Tables of inputs become one card per row on phones. Cells carry data-l labels. */
@media (max-width: 760px) {
  table.t.stack, table.t.stack tbody { display: block; }
  table.t.stack tr:has(th) { display: none; }
  table.t.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  table.t.stack td { display: block; padding: 0; border: 0; min-width: 0; text-align: left; }
  table.t.stack td.wide { grid-column: 1 / -1; }
  table.t.stack td[data-l]:not([data-l=""])::before { content: attr(data-l); display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
  table.t.stack td .in { min-width: 0 !important; width: 100%; }
  table.t.stack td.checks { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
  table.t.stack td.rowact { display: flex; justify-content: flex-end; align-items: end; }
  table.t.stack tr.add-row { background: var(--surface-2); margin: 8px -12px 0; padding: 14px 12px; border-radius: 14px; border: 0; }
  .card.scroll-x:has(table.t.stack) { overflow-x: visible; }
}

/* ---------- vehicles + staff ---------- */
.vstats, .sstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.sstats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.vstat { --t: var(--ink-2); --ts: var(--gray-soft); display: flex; align-items: center; gap: 14px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); outline: 2px solid transparent; transition: outline-color .15s, transform .15s; }
.vstat:hover { transform: translateY(-1px); }
.vstat.on { outline-color: var(--t); }
.vstat .ic { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; display: grid; place-items: center; background: var(--ts); color: var(--t); }
.vstat small { display: block; font-size: 13px; color: var(--ink-2); }
.vstat b { display: block; font: 800 26px/1.15 var(--num); color: var(--ink); }
.vstat.blue { --t: var(--blue); --ts: var(--blue-soft); }
.vstat.gold { --t: #87652f; --ts: var(--gold-soft); }
.vstat.green { --t: var(--brand); --ts: var(--brand-soft); }
.vstat.amber { --t: #9a6200; --ts: var(--amber-soft); }
.vstat.gray { --t: var(--ink-2); --ts: var(--gray-soft); }
.vbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-bottom: 16px; padding: 14px 16px; }
.vbar .seg { flex: 0 0 auto; }
.search-in { position: relative; flex: 1 1 280px; min-width: 220px; }
.search-in > span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); display: flex; pointer-events: none; }
.search-in .in { padding-left: 42px; }
.cnt { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 4px; border-radius: 99px; background: var(--line); font: 700 12px/1.5 var(--num); color: var(--ink-2); }
.seg button.on .cnt { background: var(--brand); color: #fff; }
.plate { display: inline-flex; flex-direction: column; align-items: center; min-width: 104px; padding: 4px 12px 3px; border: 1.5px solid #2b2b2b; border-radius: 8px; background: #fff; line-height: 1.15; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px #d8d2c4; }
.plate b { font: 700 16px var(--font); letter-spacing: .03em; color: #111; white-space: nowrap; }
.plate small { font-size: 11px; color: #444; white-space: nowrap; }
.plate.big { min-width: 150px; padding: 7px 16px 5px; } .plate.big b { font-size: 22px; } .plate.big small { font-size: 13px; }
.vk { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.vk .i { width: 18px; height: 18px; color: var(--ink-3); }
.vk.car .i { color: var(--blue); } .vk.moto .i { color: #87652f; }
.room-chip { display: inline-block; padding: 3px 10px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font: 700 14px var(--num); }
table.t td.thumb { width: 64px; }
table.t td.thumb img { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; display: block; }
table.vtable td { padding: 14px 12px; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
table.t th.sortable { cursor: pointer; user-select: none; }
table.t th.sortable:hover, table.t th.sortable.on { color: var(--ink); }
.pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--line); }
.pager .grow { flex: 1; }
.pager .icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.seg.small { padding: 3px; } .seg.small button { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.empty.big { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 16px; }
.empty.big .i { width: 40px; height: 40px; color: var(--line); stroke-width: 1.5; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 2px 0; color: var(--brand); font-weight: 600; font-size: 13.5px; }
.link-btn .i { width: 16px; height: 16px; }
.kind-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kind-pick button, .role-pick button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); min-height: 76px; }
.kind-pick button .i { width: 26px; height: 26px; }
.kind-pick button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.plate-in { font-size: 18px; font-weight: 700; letter-spacing: .03em; }
.vphoto { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vphoto img { width: 160px; height: 112px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.btn.ghost.danger { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, var(--line)); }

.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.scard { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.scard.off { opacity: .62; }
.shead { display: flex; align-items: flex-start; gap: 14px; position: relative; }
.sname { display: block; font-size: 16.5px; line-height: 1.3; }
.online { position: absolute; right: 0; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: #2fb36a; box-shadow: 0 0 0 4px color-mix(in srgb, #2fb36a 18%, transparent); }
.skv { grid-template-columns: auto 1fr; gap: 9px 14px; font-size: 13.5px; padding: 14px 0 0; border-top: 1px solid var(--line); margin: 0; }
.skv dt { display: flex; align-items: center; gap: 6px; white-space: nowrap; } .skv dt .i { width: 16px; height: 16px; }
.skv dd { text-align: right; }
.sfoot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
.sfoot .btn { min-height: 42px; padding: 9px 12px; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; border-radius: 16px; }
.avatar.xl { width: 84px; height: 84px; font-size: 28px; border-radius: 24px; }
.avatar.r-owner { background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.avatar.r-manager { background: linear-gradient(135deg, var(--brand-2), var(--brand)); }
.avatar.r-frontdesk { background: linear-gradient(135deg, #5a8fd1, var(--blue)); }
.avatar.r-housekeeper { background: linear-gradient(135deg, #e8b456, var(--amber)); }
.sphoto { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sphoto > div { display: flex; gap: 8px; flex-wrap: wrap; }
.badge.gold { background: var(--gold-soft); color: #87652f; }
.badge .i { width: 14px; height: 14px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-pick button { --t: var(--brand); --ts: var(--brand-soft); align-items: flex-start; text-align: left; padding: 14px; gap: 4px; }
.role-pick button .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--ts); color: var(--t); margin-bottom: 4px; }
.role-pick button b { color: var(--ink); font-size: 15px; }
.role-pick button small { font-weight: 400; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.role-pick button.on { border-color: var(--t); background: color-mix(in srgb, var(--ts) 55%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--t) 14%, transparent); }
.role-pick .t-gold { --t: #87652f; --ts: var(--gold-soft); } .role-pick .t-green { --t: var(--brand); --ts: var(--brand-soft); }
.role-pick .t-blue { --t: var(--blue); --ts: var(--blue-soft); } .role-pick .t-amber { --t: #9a6200; --ts: var(--amber-soft); }
.big-code { font-size: 28px; letter-spacing: .3em; text-align: center; min-height: 60px; }
@media (max-width: 1200px) { .sstats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .vstats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  table.vtable tr { grid-template-columns: minmax(0, 1fr) auto; }
  table.vtable td.thumb { grid-row: 1; grid-column: 2; }
  table.vtable td.thumb img { width: 72px; height: 54px; }
  table.vtable td.wide { grid-column: 1; grid-row: 1; }
}
@media (max-width: 560px) {
  .vstats, .sstats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .vstat { padding: 12px; gap: 10px; } .vstat .ic { width: 36px; height: 36px; flex-basis: 36px; } .vstat b { font-size: 22px; }
  .vbar .seg, .vbar select.in { flex: 1 1 100%; width: 100% !important; min-width: 0 !important; }
  .search-in { flex-basis: 100%; min-width: 0; }
  .role-pick { grid-template-columns: 1fr; }
  .vphoto img { width: 100%; height: auto; aspect-ratio: 4 / 3; }
}
.veh-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.veh { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.veh small { font-size: 11.5px; }
.tb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 560px) { .topbar:has(.tb-actions) .grow { display: none; } .tb-actions { width: 100%; } .tb-actions .btn { flex: 1 1 0; padding-left: 10px; padding-right: 10px; } }

/* ---------- hotel settings (ตั้งค่าหอพัก) ---------- */
.hs { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 20px; align-items: start; }
.hs-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.hs-nav button { display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); }
.hs-nav button:hover { background: var(--surface-2); }
.hs-nav button .ic { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; display: grid; place-items: center; background: var(--gray-soft); color: var(--ink-2); }
.hs-nav button .ic .i { width: 18px; height: 18px; }
.hs-nav button b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.hs-nav button small { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.hs-nav button.on { background: var(--brand-soft); }
.hs-nav button.on .ic { background: var(--brand); color: #fff; }
.hs-pane { min-width: 0; max-width: 860px; }
.hs-pane .card { padding: 22px 24px; }
.hs-pane .grid3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.hs-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.sub-card { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.plist { display: flex; flex-direction: column; gap: 10px; }
.prow { display: grid; grid-template-columns: auto minmax(0, 1fr) 150px 40px; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.prow.arow { grid-template-columns: minmax(0, 1fr) 110px 130px 170px 40px; }
.prow .in { background: var(--surface); }
.kind-seg { flex-wrap: nowrap; } .kind-seg button { padding: 4px 10px; }
.kind-seg button[data-k=fine].on { color: var(--red); }
.bank-list { display: flex; flex-direction: column; gap: 12px; }
.bank-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; background: var(--surface-2); }
.bank-card .in { background: var(--surface); }
.bank-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bank-top .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.bank-top .grow { flex: 1; }
.lease-in { font-size: 14px; line-height: 1.75; min-height: 380px; }
#lf .chip { padding: 5px 11px; font-size: 12.5px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.theme-card { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px; cursor: pointer; }
.theme-card b { font-size: 14.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.theme-card small { font-size: 12.5px; color: var(--ink-3); }
.theme-card.on { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.theme-card.on::after { content: '✓'; position: absolute; top: 10px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; display: grid; place-items: center; }
.theme-card input[type=color] { margin-top: 6px; width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--surface); cursor: pointer; }
.sw { display: flex; height: 34px; border-radius: 10px; overflow: hidden; margin-bottom: 8px; border: 1px solid rgba(0,0,0,.06); }
.sw i { flex: 1; } .sw i:first-child { flex: 2; }
.theme-preview { display: grid; grid-template-columns: 170px minmax(0, 1fr); border-radius: 16px; overflow: hidden; border: 1px solid var(--line); min-height: 190px; }
.tp-side { background: linear-gradient(180deg, var(--forest-2), var(--forest)); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; color: rgba(239,233,220,.75); font-size: 13px; }
.tp-side img { width: 110px; margin: 0 0 10px 4px; }
.tp-side span { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 9px; } .tp-side .i { width: 16px; height: 16px; }
.tp-side span.on { background: rgba(255,255,255,.1); color: #fff; } .tp-side span.on .i { color: var(--gold-2); }
.tp-main { background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.tp-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tp-room { border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-height: 64px; }
.tp-room b { font: 700 16px var(--num); } .tp-room small { font-size: 11.5px; }
.tp-room.vacant { background: var(--surface); border: 1px solid var(--line); } .tp-room.vacant small { color: var(--brand); font-weight: 600; }
.tp-room.occ { background: linear-gradient(160deg, var(--occ-2), var(--occ)); color: var(--occ-ink); }
.tp-room.clean { background: var(--amber-soft); color: #7a4e00; }
.tp-main .btn { pointer-events: none; min-height: 38px; padding: 7px 14px; }
@media (max-width: 900px) {
  .hs { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .hs-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; gap: 6px; scrollbar-width: none; }
  .hs-nav button { flex: 0 0 auto; padding: 8px 12px 8px 8px; gap: 8px; }
  .hs-nav button small { display: none; }
  .hs-nav button .ic { width: 30px; height: 30px; flex-basis: 30px; }
  .hs-pane { max-width: none; }
}
@media (max-width: 640px) {
  .hs-pane .card { padding: 16px; }
  .prow { grid-template-columns: minmax(0, 1fr) 40px; }
  .prow .kind-seg { grid-column: 1 / -1; grid-row: 1; justify-self: start; }
  .prow > .in[name=name] { grid-column: 1; }
  .prow > .in-unit { grid-column: 1; }
  .prow > [data-rm] { grid-column: 2; grid-row: 2; }
  .prow.arow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
  .prow.arow > .in[name=name] { grid-column: 1 / 3; grid-row: 1; }
  .prow.arow > [data-rm] { grid-column: 3; grid-row: 1; }
  .prow.arow > .in-unit { grid-column: auto; }
  .prow.arow > select { grid-column: 1 / -1; }
  .theme-preview { grid-template-columns: 1fr; } .tp-side { flex-direction: row; flex-wrap: wrap; align-items: center; } .tp-side img { width: 80px; margin: 0 6px 0 0; }
  .tp-tiles { grid-template-columns: 1fr 1fr; }
  .hs-foot .btn { flex: 1; }
}

/* ---------- requests summary (สรุปการแจ้ง) ---------- */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.menu button { display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; padding: 10px; border-radius: 11px; }
.menu button:hover { background: var(--surface-2); }
.menu b { display: block; font-size: 14px; } .menu small { display: block; font-size: 12px; color: var(--ink-3); }
.menu .ic, .tchip { --t: var(--ink-2); --ts: var(--gray-soft); }
.menu .ic { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; display: grid; place-items: center; background: var(--ts); color: var(--t); }
.t-blue { --t: var(--blue) !important; --ts: var(--blue-soft) !important; } .t-amber { --t: #9a6200 !important; --ts: var(--amber-soft) !important; }
.t-gold { --t: #87652f !important; --ts: var(--gold-soft) !important; } .t-gray { --t: var(--ink-2) !important; --ts: var(--gray-soft) !important; }
.tchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 10px; background: var(--ts); color: var(--t); font-weight: 600; font-size: 13px; white-space: nowrap; }
.tchip .i { width: 16px; height: 16px; }
h3 .tchip { padding: 6px; }
#rtabs button { display: inline-flex; align-items: center; gap: 6px; } #rtabs .i { width: 17px; height: 17px; }
#rtabs button.on .cnt { background: var(--brand); color: #fff; }
.rtable td { padding: 14px 12px; }
.rq-title { max-width: 420px; } .rq-title .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rq-title .muted .i { width: 14px; height: 14px; vertical-align: -2px; }
.late { color: var(--red); }
.rq-photo { display: block; width: 100%; max-width: 360px; border-radius: 12px; margin-top: 12px; border: 1px solid var(--line); }
.chip.pick b { font-weight: 700; } .chip.pick.fine { border-color: color-mix(in srgb, var(--red) 25%, var(--line)); }
.rc .moveout { margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--gold-2); display: flex; align-items: center; gap: 4px; } .rc .moveout .i { width: 13px; height: 13px; }
@media (max-width: 760px) {
  table.rtable tr { grid-template-columns: minmax(0, 1fr) auto; }
  table.rtable td.rowact { display: none; }
  .rq-title { max-width: none; }
}
@media (max-width: 560px) { .menu { width: min(300px, calc(100vw - 32px)); } .tb-actions .menu-wrap { flex: 1 1 0; } .tb-actions .menu-wrap .btn { width: 100%; } }
.mt.mo { box-shadow: inset 0 -4px 0 var(--gold-2); }
@media (max-width: 640px) { .theme-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .theme-card { padding: 12px; } .theme-card small { display: none; } }

/* ---------- ทุกชั้น: 3D building model ---------- */
.viewseg { margin-left: auto; }
.viewseg button { display: inline-flex; align-items: center; gap: 6px; }
.b3d-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.b3d { position: relative; overflow: hidden; border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--shadow); touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  background: radial-gradient(ellipse 70% 45% at 50% 84%, color-mix(in srgb, var(--brand) 13%, var(--surface)) 0%, transparent 70%), linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); }
.b3d.dragging { cursor: grabbing; }
.b3d-tools { position: absolute; bottom: 10px; right: 10px; z-index: 3; display: flex; gap: 4px; background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--line); border-radius: 14px; padding: 3px; }
.b3d-tools .icon-btn { width: 34px; height: 34px; font-size: 17px; color: var(--ink-2); }
.b3d-hint { position: absolute; left: 16px; right: 140px; bottom: 18px; text-align: left; font-size: 12px; color: var(--ink-3); pointer-events: none; }
.b3d-stage { position: absolute; left: 50%; top: 0; width: 470px; height: 610px; margin-left: -235px; transform: scale(var(--s, 1)); transform-origin: 50% 0; perspective: 1700px; perspective-origin: 50% 20%; }
.b3d-scene { position: absolute; left: 55%; top: 79%; transform-style: preserve-3d; transform: translate(-50%, -50%) rotateX(var(--rx)) rotateZ(var(--rz)); transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.b3d.dragging .b3d-scene { transition: none; }
.b3d-scene i, .b3d-scene b, .b3d-scene .plate, .b3d-scene .ground { position: absolute; display: block; }
.ground { left: -45%; top: -55%; width: 190%; height: 210%; border-radius: 50%; background: radial-gradient(closest-side, rgba(20, 30, 20, .2), rgba(20, 30, 20, .07) 55%, transparent); transform: translateZ(-2px); pointer-events: none; }
/* ground floor: lobby and shop, a solid block */
.lobby { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.lw { background: color-mix(in srgb, var(--forest) 82%, #fff); }
.lw.s, .lw.n { left: 0; width: 100%; height: var(--lh); top: calc(100% - var(--lh)); transform-origin: 50% 100%; transform: rotateX(-90deg); }
.lw.n { top: calc(0px - var(--lh)); transform-origin: 50% 100%; transform: rotateX(-90deg) rotateY(180deg); }
.lw.w, .lw.e { top: 0; height: 100%; width: var(--lh); left: calc(0px - var(--lh)); transform-origin: 100% 50%; transform: rotateY(90deg); background: color-mix(in srgb, var(--forest) 92%, #000); }
.lw.e { left: calc(100% - var(--lh)); }
.lw.s, .lw.n { display: flex !important; align-items: center; justify-content: center; background: linear-gradient(180deg, color-mix(in srgb, var(--forest) 70%, #fff), var(--forest)); }
.lw span { color: #fff; background: var(--gold); padding: 3px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.lw.s::before, .lw.n::before, .lw.s::after, .lw.n::after { content: ''; position: absolute; left: 4%; width: 31%; bottom: 0; height: 58%; background: repeating-linear-gradient(90deg, rgba(255, 230, 170, .55) 0 30px, transparent 30px 37px); border-radius: 3px 3px 0 0; }
.lw.s::after, .lw.n::after { left: auto; right: 4%; }
.lw span { position: relative; top: 2px; }
/* a floor: plate, slab edge and room boxes */
.fl { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.plate { inset: 0; border-radius: 6px; background: color-mix(in srgb, var(--surface) 92%, var(--brand)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent); cursor: pointer; }
.fl.sel .plate { background: color-mix(in srgb, var(--gold-soft) 70%, var(--surface)); box-shadow: inset 0 0 0 2px var(--gold); }
.aisle { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: .02em; white-space: nowrap; }
.fl.sel .aisle { color: #87652f; }
.slab { background: color-mix(in srgb, var(--surface) 70%, #8d8676); }
.slab.s { left: 0; width: 100%; top: 100%; height: 7px; transform-origin: 50% 0; transform: rotateX(-90deg); }
.slab.e { top: 0; height: 100%; left: 100%; width: 7px; transform-origin: 0 50%; transform: rotateY(90deg); background: color-mix(in srgb, var(--surface) 55%, #8d8676); }
.rb { --c0: var(--brand-soft); --ink0: var(--brand); --c: var(--c0); position: absolute; left: 0; top: 0; width: 50px; height: 40px; transform-style: preserve-3d; cursor: pointer;
  transform: translate3d(var(--x), var(--y), var(--lift, 0px)); transition: transform .18s ease; }
.rb:hover { --lift: 7px; }
.rb .ft { inset: 0; border-radius: 5px; background: var(--c); transform: translateZ(20px); display: grid !important; place-items: center; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.rb .lb { font: 800 12.5px var(--num); color: var(--ink0); transform: rotateZ(calc(var(--rz) * -1)); white-space: nowrap; }
.rb .fw.s, .rb .fw.n { left: 0; width: 100%; height: 20px; top: calc(100% - 20px); transform-origin: 50% 100%; transform: rotateX(-90deg); background: color-mix(in srgb, var(--c) 78%, #000); }
.rb .fw.n { top: -20px; }
.rb .fw.w, .rb .fw.e { top: 0; height: 100%; width: 20px; left: -20px; transform-origin: 100% 50%; transform: rotateY(90deg); background: color-mix(in srgb, var(--c) 64%, #000); }
.rb .fw.e { left: calc(100% - 20px); }
.rb .win { left: 30%; right: 30%; top: 22%; height: 46%; border-radius: 2px; background: #ffd98a; box-shadow: 0 0 6px 1px rgba(255, 200, 90, .7); }
.rb.t-vacant { --c0: color-mix(in srgb, var(--brand-soft) 70%, #fff); }
.rb.t-booked { --c0: color-mix(in srgb, var(--gold) 45%, #fff); --ink0: #6b4f22; }
.rb.t-occupied { --c0: var(--occ-2); --ink0: var(--occ-ink); }
.rb.t-near { --c0: #ef9a3c; --ink0: #fff; }
.rb.t-over { --c0: var(--red); --ink0: #fff; }
.rb.t-cleaning { --c0: #efd08a; --ink0: #7a4e00; }
.rb.t-maintenance { --c0: #cdc6b8; --ink0: #6d685e; }
.rb.dim, .fl.fade .rb { --c: color-mix(in srgb, var(--c0) 28%, #ece7dc); --ink0: #aaa496; }
.rb.dim .win, .fl.fade .rb .win { display: none !important; }
/* floor panel beside the model */
.b3d-panel { display: flex; flex-direction: column; gap: 8px; }
.fp { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px 12px 12px; box-shadow: var(--shadow); }
.fp.sel { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 16%, transparent), var(--shadow); }
.fp-head { display: flex; align-items: baseline; gap: 10px; width: 100%; border: 0; background: none; padding: 2px 2px 8px; text-align: left; }
.fp-head b { font-size: 15px; } .fp-head span { flex: 1; font-size: 12.5px; color: var(--ink-3); } .fp-head em { font-style: normal; color: var(--red); font-weight: 600; } .fp-head i { font-style: normal; color: var(--ink-3); }
.fp-rooms { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.sq { border: 0; border-radius: 7px; min-height: 30px; font: 700 11.5px var(--num); background: var(--brand-soft); color: var(--brand); padding: 0; }
.sq:hover { filter: brightness(.95); }
.sq.t-booked { background: var(--gold-soft); color: #7a5a28; box-shadow: inset 0 0 0 1.5px var(--gold); }
.sq.t-occupied { background: var(--occ); color: var(--occ-ink); }
.sq.t-near { background: #ef9a3c; color: #fff; } .sq.t-over { background: var(--red); color: #fff; }
.sq.t-cleaning { background: var(--amber-soft); color: #8a5800; box-shadow: inset 0 0 0 1px #ecd29a; }
.sq.t-maintenance { background: var(--gray-soft); color: var(--ink-3); background-image: repeating-linear-gradient(-45deg, transparent 0 4px, rgba(0, 0, 0, .05) 4px 8px); }
.sq.dim { opacity: .25; }
.fp.sel .fp-rooms { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.fp.sel .sq { min-height: 52px; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 10px; }
.fp.sel .sq small { font: 600 10px var(--font); opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
.b3d-tip { position: absolute; z-index: 20; pointer-events: none; min-width: 170px; max-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 9px 12px; font-size: 13px; line-height: 1.45; }
.b3d-tip .muted { font-size: 12px; }
.tt { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); }
.tt.t-occupied { background: var(--occ); color: var(--occ-ink); } .tt.t-over { background: var(--red); color: #fff; } .tt.t-near { background: #ef9a3c; color: #fff; }
.tt.t-cleaning { background: var(--amber-soft); color: #8a5800; } .tt.t-maintenance { background: var(--gray-soft); color: var(--ink-2); } .tt.t-booked { background: var(--gold-soft); color: #7a5a28; }
@media (max-width: 1100px) { .b3d-wrap { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .b3d-hint { display: none; } .viewseg { margin-left: 0; width: 100%; } .b3d { border-radius: 20px; } .fp-rooms { grid-template-columns: repeat(6, minmax(0, 1fr)); } .sq { min-height: 34px; } }
@media (prefers-reduced-motion: reduce) { .b3d-scene, .fl, .rb { transition: none; } }

.ftag { left: -12px; transform-origin: 100% 50%; transform: translate3d(-100%, -50%, 20px) rotateZ(calc(var(--rz) * -1)) rotateX(calc(var(--rx) * -1)); padding: 3px 9px; border-radius: 8px; font: 700 12px var(--font); white-space: nowrap; color: #fff; background: var(--forest-2); box-shadow: 0 2px 6px rgba(0,0,0,.18); cursor: pointer; }
.fl.sel .ftag { background: var(--gold); }
.fl.fade .ftag { background: color-mix(in srgb, var(--forest-2) 35%, #ddd8cc); }
