/* Ocean Key Stay – tối giản, sang, dễ dùng cho khách, Sale/Booker, chủ nhà và vận hành.
   Bố cục: thanh bản thử mảnh trên cùng; trang khách kiểu tạp chí; màn hình vận hành bắt đầu
   bằng "Trang chính" gồm các ô việc cần làm. Chỉ một giao diện sáng (chủ ý: dễ đọc ngoài trời,
   trên điện thoại). Bảng màu v3: nền đá sáng, chữ và nút xanh than, điểm nhấn đồng; còn lại
   trung tính. Token: docs/DESIGN.md */
:root {
  color-scheme: light;
  --chalk: #F6F5F1;        /* nền trang: đá sáng ấm */
  --paper: #FFFFFF;
  --ink: #102234;          /* chữ chính: xanh than */
  --mist: #5E6873;
  --line: #E4E1D9;
  --patina: #102234;       /* màu chính: nút, liên kết, tab đang chọn (cùng xanh than) */
  --patina-ink: #FFFFFF;
  --patina-soft: #EAEEF2;
  --brass: #8A6A39;        /* điểm nhấn đồng: huy hiệu, chữ nghiêng tiêu đề, ô việc đang chờ */
  --brass-soft: #F4EEE4;
  --dusk: #8A6A39;
  --wall: #E9E7E1;
  --pane: #C9CDD1;
  --pane-off: #F0EFEB;
  --st-free: #FFFFFF;
  --st-hold: #F1E6CF;
  --st-hold-ink: #5E4317;
  --st-booked: #2E4E6E;
  --st-booked-ink: #FFFFFF;
  --st-owner: #D4D6D8;
  --st-owner-ink: #102234;
  --st-ext: #BCCAD6;
  --st-ext-ink: #102234;
  --ok: #2F6B52;
  --warn: #8A6A39;
  --bad: #9E3F38;
  --bad-soft: #F5E4E1;
  --warn-soft: #F4EEE4;
  /* minh họa hướng nhìn */
  --sky1: #CFE2EA;
  --sky2: #F6E7D2;
  --sea1: #7FA8B4;
  --sea2: #3F6E7C;
  --land: #8FA197;
  --sand: #E6D6BA;
  --sil: #3E535B;
  --city: #9AAAB0;
  --lamp: #F2C46B;
  /* trạng thái căn trên tòa nhà (chủ dự án chọn) */
  --free: #FFA333;   /* cam (dark orange #FF8C00 nhạt đi 2 tông, mỗi tông = pha 10% trắng): chưa có khách */
  --busy: #85D6FF;   /* xanh da trời (#66CCFF nhạt đi 2 tông): có khách */
  --hotel: #8C8478;
  --hotel-win: #B7AFA3;
  --demo-bg: #ECEAE4;
  --demo-fg: #102234;
  --demo-mute: #5E6873;
  --shadow: 0 1px 2px rgba(16, 34, 52, .04), 0 10px 28px rgba(16, 34, 52, .06);

  --f-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-body: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --r1: 4px; --r2: 10px; --r3: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font: 400 16px/1.6 var(--f-body);
  font-variant-numeric: tabular-nums;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 30; background: var(--demo-bg);
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
a { color: var(--patina); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--patina); outline-offset: 2px; }
.wrap {
  max-width: 1200px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.mute { color: var(--mist); }
.small { font-size: 14px; }
.code { font-weight: 600; letter-spacing: .04em; }
.eyebrow { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--mist); font-weight: 500; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Thanh bản thử ---------- */
.demo {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--demo-bg); color: var(--demo-fg); font-size: 14px; border-bottom: 1px solid var(--line);
}
.demo .wrap { display: flex; align-items: center; gap: var(--s3); padding-block: 6px; flex-wrap: wrap; }
.demo-tag { color: var(--demo-mute); white-space: nowrap; font-size: 13px; }
.roles { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
.roles::-webkit-scrollbar { display: none; }
.role {
  border: 0; background: transparent; color: var(--demo-mute); padding: 6px 12px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; font-weight: 500;
}
.role:hover { color: var(--demo-fg); background: var(--paper); }
.role[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.clock { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.clock b { font-weight: 600; }
.tbtn {
  border: 1px solid var(--line); background: var(--paper); color: var(--demo-fg);
  border-radius: 999px; padding: 3px 10px; cursor: pointer; font-size: 13px;
}
.tbtn:hover { border-color: var(--ink); }

/* ---------- Đầu trang ---------- */
.head { background: var(--paper); border-bottom: 1px solid var(--line); }
.head .wrap { display: flex; align-items: center; gap: var(--s5); min-height: 68px; flex-wrap: wrap; padding-block: 6px; }
.brand {
  font-family: var(--f-display); font-size: 25px; letter-spacing: .06em; font-weight: 500;
  color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer;
}
.brand small { font-family: var(--f-body); font-size: 12px; letter-spacing: .14em; color: var(--mist); margin-left: 10px; text-transform: uppercase; }
.tabs { display: flex; gap: var(--s2); flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: none; border: 0; padding: 9px 14px; cursor: pointer; color: var(--mist); white-space: nowrap;
  border-radius: 999px; font-weight: 500;
}
.tab:hover { background: var(--pane-off); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--patina-soft); color: var(--patina); }
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--brass); color: #FFFFFF; font-size: 12px; font-weight: 700; margin-left: 6px; vertical-align: 1px;
}
.who { display: flex; align-items: center; gap: var(--s3); margin-left: auto; font-size: 14px; color: var(--mist); }
.who b { color: var(--ink); font-weight: 600; }
.bell {
  position: relative; background: none; border: 1px solid var(--line); border-radius: 999px; width: 40px; height: 40px;
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.bell .badge { position: absolute; top: -6px; right: -8px; margin: 0; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button { border: 0; background: none; padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--mist); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

main { padding-block: var(--s6) var(--s8); }

/* ---------- Nút, ô nhập ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  border: 1px solid var(--patina); background: var(--patina); color: var(--patina-ink);
  padding: 10px 20px; border-radius: var(--r2); cursor: pointer; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.07); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.bad { background: var(--paper); color: var(--bad); border-color: var(--bad); }
.btn.sm { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.btn.wide { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--patina); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 14px; color: var(--mist); font-weight: 500; }
.input, .field input, .field select, .field textarea {
  width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--paper); border-radius: var(--r2);
  padding: 10px 12px; min-height: 46px;
}
.field textarea { min-height: 80px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--patina); box-shadow: 0 0 0 3px var(--patina-soft); }
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: end; }
.row > .field { flex: 1 1 150px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper); }
.seg button { border: 0; background: none; border-radius: 999px; padding: 8px 16px; cursor: pointer; color: var(--mist); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.err { color: var(--bad); font-size: 14px; }

/* ---------- Trang khách ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: var(--s7); align-items: start; }
.hero h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(38px, 5.2vw, 64px); line-height: 1.04; letter-spacing: -.01em; margin-top: var(--s3); }
.hero h1 em { font-style: italic; color: var(--brass); }
.lede { max-width: 54ch; color: var(--mist); font-size: 18px; margin-top: var(--s4); }
.search {
  margin-top: var(--s6); background: var(--paper); border-radius: var(--r3); padding: var(--s5);
  box-shadow: var(--shadow); display: grid; gap: var(--s4);
}
.search .row > .field { flex: 1 1 130px; }
.tower { margin: 0; display: grid; gap: var(--s3); justify-items: center; }
.tower-body { display: flex; justify-content: center; }
.blockcol { display: grid; gap: 8px; justify-items: center; }
.crown { width: 70%; height: 10px; border-top: 2px solid var(--line); }
.facade {
  --ww: clamp(14px, 1.9vw, 22px); --wh: clamp(8px, 1.05vw, 12px);
  display: grid; grid-template-columns: 22px repeat(12, var(--ww)); gap: 3px; padding: 8px 10px 8px 4px;
  background: var(--wall); border-radius: 4px 4px 0 0; align-items: center; position: relative;
}
.lg-hotel { background: repeating-linear-gradient(135deg, var(--hotel) 0 3px, transparent 3px 6px); border: 1px solid var(--hotel); }
/* Sơ đồ căn từng tầng (phẳng): mỗi hàng một tầng, ô rộng theo diện tích căn */
.tower.plan { width: 100%; justify-items: stretch; }
.plan .facade { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 8px; border-radius: 4px 4px 0 0; width: 100%; }
.frow { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 6px; align-items: center; }
.fu { display: flex; gap: 3px; min-width: 0; }
.plan .fl { font-size: 10px; }
.plan .win { width: auto; height: 16px; flex: 1 1 0; min-width: 0; font-size: 9px; line-height: 16px; text-align: center; color: var(--mist); overflow: hidden; }
.plan .win.free { color: #2A1B05; font-weight: 600; }
.plan .win.occ { color: #10405A; }
.plan .win.free:hover { transform: none; }
.win.blk { background-image: repeating-linear-gradient(135deg, rgba(140, 132, 120, .5) 0 3px, transparent 3px 7px); }
.fl { font-size: 10px; color: var(--mist); text-align: right; padding-right: 4px; line-height: 1; }
.win { width: var(--ww); height: var(--wh); border: 0; padding: 0; border-radius: 1px; background: var(--pane-off); cursor: default; }
.win.occ { background: var(--busy); }
.win.free { background: var(--free); cursor: pointer; }
.win.free:hover { transform: scale(1.35); box-shadow: 0 0 0 2px var(--ink); }
.blocklabel { font-size: 13px; color: var(--mist); }
.ground { height: 2px; background: var(--ink); width: 100%; opacity: .5; }
.tower figcaption { font-size: 15px; color: var(--mist); text-align: center; max-width: 40ch; }
.tower figcaption b { color: var(--ink); font-weight: 600; }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; justify-content: center; font-size: 13px; color: var(--mist); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Tòa nhà 3D, bản đồ khu vực */
.tower-wrap { display: grid; gap: var(--s3); justify-items: center; }
.t3d { width: 100%; justify-items: stretch; }
.t3d-bar { display: flex; gap: var(--s2); align-items: center; justify-content: space-between; flex-wrap: wrap; width: 100%; }
.t3d-bsel { width: auto; min-height: 40px; padding: 6px 10px; }
.map-stage { width: 100%; border-radius: var(--r3); overflow: hidden; box-shadow: var(--shadow); background: var(--sea1); }
.map-stage svg { display: block; width: 100%; height: auto; }
.m-sea { fill: #9CC7D3; }
.m-land { fill: #EDE8DC; stroke: #D8CFBC; stroke-width: 1.5; }
.m-hill { fill: #B7C8A9; }
.m-mark { fill: var(--sil); }
.m-lbl { font: 600 9px var(--f-body); fill: var(--mist); }
.m-sea-lbl { font: italic 500 11px var(--f-display); fill: #2F5E6B; }
.pin { cursor: pointer; }
.pin path { stroke: #FFFFFF; stroke-width: 2; }
.pin-free { fill: var(--free); }
.pin-busy { fill: var(--busy); }
.pin-n { font: 700 10px var(--f-body); fill: #2A1B05; text-anchor: middle; }
.pin-lbl { font: 600 11px var(--f-body); fill: var(--ink); paint-order: stroke; stroke: #FFFFFF; stroke-width: 3px; }
.pin.sel path, .pin:hover path, .pin:focus-visible path { stroke: var(--ink); }
/* Mời hợp tác */
.partner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6); align-items: start; margin-top: var(--s8); padding-top: var(--s7); border-top: 1px solid var(--line); }
.partner h2 { font-family: var(--f-display); font-weight: 400; font-size: 32px; margin-top: var(--s2); }
.t3d-mode { justify-self: end; }
.t3d-stage {
  position: relative; width: 100%; height: 560px; border-radius: var(--r3); overflow: hidden;
  background: var(--chalk); box-shadow: var(--shadow);
}
.t3d-stage canvas { display: block; width: 100% !important; height: 100% !important; touch-action: pan-y; cursor: grab; }
.t3d-stage canvas:active { cursor: grabbing; }
.t3d-tip {
  position: absolute; z-index: 2; pointer-events: none; max-width: 220px; display: grid; gap: 2px;
  background: var(--paper); border-radius: var(--r2); box-shadow: var(--shadow); padding: 8px 12px; font-size: 13px;
}
.t3d-tip b { font-size: 14px; }
.t3d-tip span { color: var(--mist); }
.t3d-tip em { font-style: normal; color: var(--patina); font-weight: 600; }
.t3d-ctrl { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.t3d-card {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap;
  background: var(--patina-soft); border-radius: var(--r3); padding: var(--s4);
}
.t3d-card > div:first-child { display: grid; gap: 2px; min-width: 0; }
.t3d-card b { font-size: 17px; }
.t3d-card span { color: var(--mist); font-size: 14px; }
.t3d-hint { text-align: center; color: var(--mist); font-size: 14px; }

.sect-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin: var(--s8) 0 var(--s5); }
.sect-head h2 { font-family: var(--f-display); font-weight: 400; font-size: 34px; }
.views { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s3); }
.vtile {
  display: grid; gap: 6px; align-content: start; text-align: left; background: var(--paper); border: 2px solid transparent;
  border-radius: var(--r3); padding: 8px 8px 12px; cursor: pointer; color: inherit; box-shadow: var(--shadow);
}
.vtile .art { aspect-ratio: 4 / 3; border-radius: var(--r2); }
.vtile .art::before, .vtile .art::after { display: none; }
.vtile b { font-size: 15px; line-height: 1.3; padding-inline: 4px; }
.vtile span { font-size: 12px; color: var(--mist); line-height: 1.4; padding-inline: 4px; }
.vtile:hover { border-color: var(--line); }
.vtile[aria-pressed="true"] { border-color: var(--patina); background: var(--patina-soft); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s7) var(--s5); }
.card { display: grid; gap: var(--s2); text-align: left; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; }
.card h3 { font-family: var(--f-display); font-size: 23px; font-weight: 400; line-height: 1.2; }
.card:hover .art { filter: saturate(1.15); }
.vline { font-size: 13px; color: var(--brass); font-weight: 600; margin-top: 4px; letter-spacing: .04em; text-transform: uppercase; }
.card-meta { display: flex; justify-content: space-between; gap: var(--s3); font-size: 14px; color: var(--mist); flex-wrap: wrap; }
.price b { font-weight: 600; }

/* Khung nhìn minh họa (SVG) */
.art { position: relative; aspect-ratio: 4 / 3; max-width: 100%; border-radius: var(--r2); overflow: hidden; background: var(--sky1); transition: filter .3s; }
.art svg { display: block; width: 100%; height: 100%; }
.art::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to right, transparent calc(50% - 2px), rgba(20, 35, 43, .25) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px));
}
.art::after {
  content: attr(data-label); position: absolute; left: 10px; bottom: 8px; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.art.wide { aspect-ratio: 21 / 8; }
/* Ảnh view thật: phủ kín khung, bỏ khung cửa sổ vẽ */
.art.photo { background: var(--pane-off); }
.art.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.art.photo::before { display: none; }
.vtile .art.photo::after { display: none; }
.a-sky { fill: var(--sky1); }
.a-sea { fill: var(--sea1); }
.a-land { fill: var(--land); }
.a-sand { fill: var(--sand); }
.a-sil { fill: var(--sil); }
.a-city { fill: var(--city); }
.a-light { fill: #F7F4EC; }
.a-lamp { fill: var(--lamp); }
.a-fw { stroke: var(--dusk); stroke-width: 2; stroke-linecap: round; }
.a-hotel { fill: var(--hotel); }
.a-hwin { fill: var(--hotel-win); }

.unit { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: var(--s7); margin-top: var(--s6); align-items: start; }
.unit h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(30px, 4vw, 46px); line-height: 1.1; margin-top: var(--s2); }
.facts { display: flex; gap: var(--s6); flex-wrap: wrap; margin: var(--s5) 0; padding-block: var(--s4); border-block: 1px solid var(--line); }
.facts div { display: grid; }
.facts b { font-size: 24px; font-weight: 600; }
.facts span { font-size: 13px; color: var(--mist); }
.prose { max-width: 62ch; display: grid; gap: var(--s3); }
.prose h3 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--mist); margin-top: var(--s5); font-weight: 600; }
.prose ul { margin: 0; padding-left: 20px; }
.vparts { list-style: none; padding: 0 !important; display: flex; gap: 8px; flex-wrap: wrap; }
.vparts li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; display: flex; gap: 8px; align-items: center; }
.panel { background: var(--paper); border-radius: var(--r3); padding: var(--s5); box-shadow: var(--shadow); display: grid; gap: var(--s4); }
.sticky { position: sticky; top: 64px; }
.lines { display: grid; gap: 6px; font-size: 15px; }
.lines div { display: flex; justify-content: space-between; gap: var(--s3); }
.lines .tot { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 700; }
.tag { font-size: 12px; color: var(--warn); margin-left: 6px; }

.months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); margin-top: var(--s3); }
.month h4 { font-size: 15px; font-weight: 600; margin-bottom: var(--s2); }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; font-size: 14px; }
.mgrid .wd { color: var(--mist); font-size: 12px; text-align: center; padding-bottom: 4px; }
.day {
  aspect-ratio: 1; border: 0; border-radius: var(--r1); background: var(--paper); cursor: pointer; display: grid; place-items: center;
  color: var(--ink); padding: 0; position: relative; min-width: 0;
}
.day:hover:not([disabled]) { background: var(--patina-soft); }
.day[disabled] { color: var(--mist); text-decoration: line-through; background: transparent; opacity: .5; cursor: default; }
.day.in { background: var(--patina-soft); }
.day.edge { background: var(--patina); color: var(--patina-ink); font-weight: 700; }

.steps { display: grid; gap: 0; margin: var(--s4) 0; }
.step { display: grid; grid-template-columns: 24px 1fr; gap: var(--s3); padding-bottom: var(--s4); position: relative; }
.step::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.step.done .dot { background: var(--patina); border-color: var(--patina); color: var(--patina-ink); }
.step.now .dot { border-color: var(--dusk); box-shadow: 0 0 0 4px var(--warn-soft); }
.step b { font-weight: 600; }

.pay { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.qr { background: #fff; padding: 10px; border-radius: var(--r2); border: 1px solid var(--line); }
.qr svg { display: block; width: 100%; height: auto; }
.kv { display: grid; gap: var(--s3); }
.kv div { display: grid; gap: 2px; }
.kv span { font-size: 13px; color: var(--mist); }
.kv b { font-weight: 600; display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; word-break: break-word; }
.copy { font-size: 13px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 3px 10px; cursor: pointer; color: var(--patina); font-weight: 600; }
.big-code { font-family: var(--f-display); font-size: clamp(38px, 7vw, 58px); letter-spacing: .1em; }
.center { max-width: 660px; margin: 0 auto; }

/* ---------- Trang chính vai trò ---------- */
.hello h1 { font-size: clamp(28px, 4vw, 40px); margin-top: 6px; }
.hello .lede { margin-top: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s4); margin-top: var(--s6); }
.tile {
  display: grid; gap: 6px; align-content: start; text-align: left; background: var(--paper); border: 2px solid transparent;
  border-radius: var(--r3); padding: var(--s5); cursor: pointer; color: inherit; box-shadow: var(--shadow); min-height: 170px;
}
.tile:hover { border-color: var(--patina); }
.tile-n { font-family: var(--f-display); font-size: 46px; font-weight: 400; line-height: 1.05; color: var(--patina); }
.tile b { font-size: 18px; }
.tile span:last-child { color: var(--mist); font-size: 14px; }
.tile.hot { background: var(--brass-soft); }
.tile.hot .tile-n { color: var(--brass); }

/* ---------- Màn hình vận hành ---------- */
.page-title { display: flex; justify-content: space-between; align-items: end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-title h1 { font-size: 28px; }
.list { display: grid; gap: var(--s3); }
.item { background: var(--paper); border-radius: var(--r3); padding: var(--s4) var(--s5); display: grid; gap: var(--s3); box-shadow: var(--shadow); }
.item-top { display: flex; justify-content: space-between; gap: var(--s3); align-items: start; flex-wrap: wrap; }
.item h3 { font-size: 17px; font-weight: 600; }
.item .meta { font-size: 14px; color: var(--mist); }
.acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: 13px;
  font-weight: 600; white-space: nowrap; background: var(--pane-off); color: var(--ink);
}
.chip.requested { background: var(--warn-soft); color: var(--warn); }
.chip.held { background: var(--st-hold); color: var(--st-hold-ink); }
.chip.paid, .chip.matched, .chip.verified, .chip.payable { background: var(--patina-soft); color: var(--ok); }
.chip.checked_in { background: var(--st-booked); color: var(--st-booked-ink); }
.chip.completed, .chip.paidout { background: var(--pane-off); color: var(--mist); }
.chip.expired, .chip.rejected, .chip.cancelled, .chip.unmatched, .chip.suspended { background: var(--bad-soft); color: var(--bad); }
.chip.pending { background: var(--warn-soft); color: var(--warn); }
.timer { font-size: 14px; color: var(--warn); font-weight: 600; }
.timer.late { color: var(--bad); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s5); align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.kpi { background: var(--paper); border-radius: var(--r3); padding: var(--s4); display: grid; gap: 2px; box-shadow: var(--shadow); }
.kpi span { font-size: 13px; color: var(--mist); }
.kpi b { font-size: 24px; font-weight: 700; }
.kpi small { font-size: 13px; color: var(--mist); }
.empty { padding: var(--s6); text-align: center; color: var(--mist); border: 2px dashed var(--line); border-radius: var(--r3); }
.note { font-size: 14px; color: var(--mist); background: var(--pane-off); border-radius: var(--r2); padding: var(--s3) var(--s4); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
h2.h { font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--mist); font-weight: 600; margin: var(--s5) 0 var(--s3); }

.scroll { overflow-x: auto; border-radius: var(--r3); background: var(--paper); box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--mist); font-size: 13px; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; }

/* Lưới lịch toàn tòa */
.bgrid { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.bgrid th, .bgrid td { padding: 0; }
.bgrid thead th { position: sticky; top: 0; background: var(--paper); z-index: 2; padding: 8px 2px; font-weight: 600; color: var(--mist); min-width: 74px; text-align: center; border-bottom: 1px solid var(--line); }
.bgrid thead th.today { color: var(--patina); }
.bgrid th.u { position: sticky; left: 0; z-index: 1; background: var(--paper); text-align: left; padding: 0 12px; white-space: nowrap; font-weight: 600; border-right: 1px solid var(--line); min-width: 110px; font-size: 13px; }
.bgrid thead th.u { z-index: 3; }
.bgrid th.u small { color: var(--mist); font-weight: 400; margin-left: 6px; }
.cell { width: 74px; height: 34px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--st-free); cursor: pointer; padding: 0 4px; font-size: 11px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block; }
.cell.none { background: repeating-linear-gradient(135deg, var(--pane-off) 0 4px, transparent 4px 8px); cursor: default; }
.cell.hold { background: var(--st-hold); color: var(--st-hold-ink); }
.cell.booked { background: var(--st-booked); color: var(--st-booked-ink); }
.cell.owner_block { background: var(--st-owner); color: var(--st-owner-ink); }
.cell.external_booking { background: var(--st-ext); color: var(--st-ext-ink); }
.cell.free:hover { background: var(--patina-soft); }
.gridwrap { max-height: 66vh; overflow: auto; border-radius: var(--r3); background: var(--paper); box-shadow: var(--shadow); }

/* Lịch tháng của chủ nhà */
.ocal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ocal .wd { font-size: 12px; color: var(--mist); text-align: center; padding-bottom: 4px; font-weight: 600; }
.od {
  position: relative; min-height: 66px; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r2);
  background: var(--st-free); color: var(--ink); text-align: left; padding: 6px 8px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
}
.od:hover:not([disabled]) { border-color: var(--patina); }
.od[disabled] { cursor: default; }
.od .dn { font-size: 14px; font-weight: 600; }
.od .dl { font-size: 12px; color: var(--mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od.hold { background: var(--st-hold); color: var(--st-hold-ink); border-color: transparent; }
.od.booked { background: var(--st-booked); color: var(--st-booked-ink); border-color: transparent; }
.od.owner_block { background: var(--st-owner); color: var(--st-owner-ink); border-color: transparent; }
.od.external_booking { background: var(--st-ext); color: var(--st-ext-ink); border-color: transparent; }
.od.hold .dl, .od.booked .dl, .od.owner_block .dl, .od.external_booking .dl { color: inherit; }
.od.past { opacity: .4; }
.od.today { box-shadow: inset 0 0 0 2px var(--ink); }
.od .ov { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--dusk); }

/* Thanh chia tiền */
.split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--pane-off); min-width: 120px; }
.split i { display: block; height: 100%; }
.p-owner { background: var(--patina); }
.p-sale { background: var(--dusk); }
.p-platform { background: var(--ink); }
.p-bql { background: var(--st-ext); }
.p-guest_refund { background: var(--bad); }
.keys { display: flex; gap: var(--s3); flex-wrap: wrap; font-size: 13px; color: var(--mist); }
.keys i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Kịch bản, thông báo ---------- */
.tour-btn {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 25;
  border: 0; border-radius: 999px; padding: 12px 18px; background: var(--ink); color: var(--paper); cursor: pointer;
  box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; font-weight: 600;
}
.tour {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 26;
  width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 120px); overflow: auto;
  background: var(--paper); border-radius: var(--r3); box-shadow: 0 12px 40px rgba(20, 35, 43, .18); padding: var(--s5);
  display: grid; gap: var(--s3);
}
.tour h3 { font-size: 20px; }
.tour ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.tour li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 14px; color: var(--mist); align-items: center; }
.tour li.cur { color: var(--ink); font-weight: 600; }
.tour li.cur .dot { border-color: var(--dusk); }
.tour li.ok .dot { background: var(--patina); border-color: var(--patina); color: var(--patina-ink); }
.pop {
  position: absolute; right: 0; top: 48px; z-index: 15; width: min(360px, calc(100vw - 32px));
  background: var(--paper); border-radius: var(--r3); box-shadow: 0 12px 40px rgba(20, 35, 43, .18); padding: var(--s3); display: grid; gap: 2px;
}
.pop div { padding: 8px; border-radius: var(--r2); font-size: 14px; }
.pop div small { display: block; color: var(--mist); }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: var(--r2); font-size: 15px; max-width: min(560px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}
.toast.bad { background: var(--bad); color: #fff; }
.flash { animation: flash 2.4s ease-out 1; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px var(--dusk); } 100% { box-shadow: 0 0 0 0 transparent; } }
footer.foot { border-top: 1px solid var(--line); }
footer.foot .wrap { padding-block: var(--s5); display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; font-size: 13px; color: var(--mist); }

@media (max-width: 1100px) {
  .views { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .hero, .unit, .grid2, .grid-side, .partner { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sticky { position: static; }
}
@media (max-width: 600px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .views { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .months { grid-template-columns: minmax(0, 1fr); }
  .pay { grid-template-columns: minmax(0, 1fr); }
  .qr { max-width: 200px; }
  .demo-tag { display: none; }
  .who span.lbl { display: none; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .t3d-stage { height: 430px; }
  .tile { min-height: 0; }
  .od { min-height: 52px; padding: 4px; }
  .od .dl { font-size: 10px; }
  .tour-btn { padding: 10px 14px; font-size: 14px; }
  main { padding-block: var(--s5) var(--s8); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
