:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #15181e;
  --muted: #6b7280;
  --line: #e4e7ec;
  --chip: #eef1f5;
  --brand: #1f6feb;
  --brand-ink: #ffffff;
  --brand-weak: #e7f0ff;
  --ok: #15803d;
  --ok-weak: #e6f6ec;
  --warn: #b45309;
  --warn-weak: #fff4e0;
  --bad: #c62828;
  --bad-weak: #fdecec;
  --info: #0e7490;
  --info-weak: #e2f5f8;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .05);
  --grad-brand: linear-gradient(135deg, #3b8bff 0%, #1f5fe0 100%);
  --grad-accent: linear-gradient(135deg, #ff9a3c 0%, #f25c1f 100%);
  --grad-ok: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  --accent: #f26a1f;
  --accent-weak: #fff0e6;
  --zalo: #0068ff;
  --zalo-weak: #e5efff;
  --radius: 14px;
  --top: 56px;
  --nav: 64px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0e1626;
  --card: #18233a;
  --text: #e8edf5;
  --muted: #95a3ba;
  --line: #27344f;
  --chip: #22304b;
  --brand: #3b82f6;
  --brand-weak: #1b315a;
  --ok: #4ade80;
  --ok-weak: #163527;
  --warn: #fbbf24;
  --warn-weak: #3a2e12;
  --bad: #f87171;
  --bad-weak: #3d1d22;
  --info: #67d3e6;
  --info-weak: #173843;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --accent: #ff8a3d;
  --accent-weak: #3d2414;
  --zalo: #5b9bff;
  --zalo-weak: #16294d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--nav) + env(safe-area-inset-bottom));
}
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 20px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Thanh trên ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--top);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 17px; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--grad-accent); box-shadow: 0 3px 10px rgba(242, 92, 31, .35); color: var(--brand-ink); display: grid; place-items: center; font-size: 13px; letter-spacing: .5px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.role-btn {
  border: 1px solid var(--line); background: var(--chip); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; max-width: 46vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg, .btn svg, .nav svg { width: 20px; height: 20px; }
.btn.sm svg { width: 17px; height: 17px; }

/* ---------- Thanh điều hướng ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: var(--card); border-top: 1px solid var(--line);
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11.5px; color: var(--muted); position: relative; font-weight: 500;
}
.nav a.on { color: var(--brand); font-weight: 600; }
.nav a svg { padding: 3px 14px; box-sizing: content-box; border-radius: 999px; transition: background .15s; }
.nav a.on svg { background: var(--brand-weak); }
.nav a .dot {
  position: absolute; top: 6px; left: 50%; margin-left: 6px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; display: grid; place-items: center;
}
.nav .desk-only { display: none; }
.nav-toggle { display: none; }

/* ---------- Bố cục ---------- */
.app { max-width: 1200px; margin: 0 auto; }
.page { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.card.flat { box-shadow: none; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn { transition: transform .08s ease, box-shadow .15s ease, filter .15s ease; }
.btn:hover:not([disabled]) { filter: brightness(1.04); }
.btn:active:not([disabled]) { transform: scale(.97); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.xs { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; display: inline-flex; align-items: center; gap: 5px; }
.btn.xs svg { width: 14px; height: 14px; }
.staff-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; flex-direction: row; }
.staff-tools .row { gap: 6px; }
.staff-tools .st-btns { display: flex; gap: 6px; flex: none; }
/* Trang Phòng (Admin): chữ nhỏ hơn 10%, các khối sát nhau hơn */
.sticky-tools.rm-tools { gap: 6px; padding-bottom: 6px; min-width: 0; }
.sticky-tools.rm-tools > * { min-width: 0; max-width: 100%; width: 100%; align-self: stretch; }
.sticky-tools.rm-tools .page-head h1 { font-size: 90%; margin: 0; }
.sticky-tools.rm-tools .page-head .btn { font-size: 12.5px; min-height: 34px; padding: 0 12px; }
.sticky-tools.rm-tools .chips { gap: 6px; }
.sticky-tools.rm-tools .chip { font-size: 11.3px; padding: 6px 11px; min-height: 0; }
.sticky-tools.rm-tools .search { min-height: 0; padding: 0 12px; gap: 8px; }
.sticky-tools.rm-tools .search svg { width: 17px; height: 17px; }
.sticky-tools.rm-tools .search input { font-size: 13px; min-height: 40px; }
.rm-note { font-size: 11.7px; line-height: 1.4; margin-top: 4px; }
.rm-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.rm-ctrl .lv-chips { display: inline-flex; gap: 5px; flex: none; }
.rm-ctrl .chip { font-size: 12px; padding: 5px 9px; min-height: 0; }
.rm-ctrl .avail-ctl { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; flex: none; }
.rm-ctrl .avail-ctl .btn.sm { min-width: 28px; height: 28px; min-height: 0; padding: 0 8px; font-size: 14px; }
.rm-ctrl .avail-ctl b { min-width: 14px; text-align: center; font-size: 13px; }
.rm-ctrl .small { font-size: 11.5px; white-space: nowrap; flex: none; }
.rm-ctrl { gap: 6px; }
.rm-ctrl .lv-chips { gap: 4px; }
.rm-ctrl .chip { font-size: 11.5px; padding: 5px 8px; }
.rm-ctrl .avail-ctl { gap: 4px; }
.rm-ctrl .avail-ctl .btn.sm { min-width: 26px; height: 26px; padding: 0 6px; }
.rm-rules { margin-top: -2px; }
.rm-rules summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--brand); list-style: none; padding: 4px 10px; border-radius: 999px; background: var(--brand-weak); }
.rm-rules summary::-webkit-details-marker { display: none; }
.rm-rules[open] summary { background: var(--chip); color: var(--text); }
.backup-card.late { background: #FFF6E5; border-color: #f5c26b; }
:root[data-theme="dark"] .backup-card.late { background: #3a2b10; border-color: #8a6420; }
.st-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.st-dot.warn { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.st-dot.bad { background: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.18); }
.staff-tools:has(> .st-btns:only-child) { justify-content: stretch; }
.staff-tools:has(> .st-btns:only-child) .st-btns { flex: 1; }
.staff-tools:has(> .st-btns:only-child) .st-btns .btn { flex: 1; justify-content: center; }
@media (max-width: 600px) {
  .staff-tools { flex-direction: column; align-items: stretch; gap: 8px; }
  .staff-tools > .tag { align-self: flex-start; }
  .staff-tools .st-btns { display: grid; grid-template-columns: 1.5fr .8fr 1.2fr; }
  .staff-tools .st-btns .btn { padding-left: 6px; padding-right: 6px; }
  .staff-tools .st-btns .kit-btn svg { width: 14px; height: 14px; }
  .staff-tools .st-btns .btn { width: 100%; justify-content: center; white-space: nowrap; }
}
.btn.primary { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(31, 95, 224, .32); }
.btn.accent { background: var(--grad-accent); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(242, 92, 31, .32); }
.btn.ok { background: var(--grad-ok); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(21, 128, 61, .28); }
.btn.navy { background: #1e40af; border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(30, 64, 175, .3); }
[data-theme="dark"] .btn.navy { background: #2563eb; }
.btn.pill { border-radius: 999px; }
.btn.soft { background: var(--brand-weak); border-color: transparent; color: var(--brand); }
.btn.zalo { background: var(--zalo-weak); border-color: transparent; color: var(--zalo); }
.btn.ok-soft { background: var(--ok-weak); border-color: transparent; color: var(--ok); }
.btn.bad-soft { background: var(--bad-weak); border-color: transparent; color: var(--bad); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }

/* ---------- Nhãn ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px; background: var(--chip);
  font-size: 12.5px; font-weight: 500; white-space: nowrap; border: 0; cursor: default; color: var(--text);
}
button.chip, a.chip { cursor: pointer; background: var(--card); border: 1px solid var(--line); color: var(--text); transition: all .15s; }
button.chip:hover, a.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-weak); }
.chip.on, button.chip.on, a.chip.on { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(31, 95, 224, .28); }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.t-warn { background: var(--warn-weak); color: var(--warn); }
.t-ok { background: var(--ok-weak); color: var(--ok); }
.t-bad { background: var(--bad-weak); color: var(--bad); }
.t-info { background: var(--info-weak); color: var(--info); }
.t-brand { background: var(--brand-weak); color: var(--brand); }
.t-muted { background: var(--chip); color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.home-tools .chips { margin: 0 -16px; padding: 0 16px 2px; scroll-padding: 16px; }
/* Hàng chip vuốt ngang (không xuống dòng); lịch sử cũ trôi dần sang phải, mờ ở mép. Nút Link + QR của CTV đứng yên bên phải */
.chips-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.home-tools .chips-wrap .chips { flex: 1; min-width: 0; margin: 0; padding: 0 0 2px; flex-wrap: nowrap; overflow-x: auto;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.chips .chip { flex: none; }
.chips-wrap .chip.ctv-qr { margin-left: 0; }
/* Điện thoại: nút Link + QR nhỏ đi 1/3 */
@media (max-width: 759px) {
  /* Mọi chip trong hàng (4tr5 - 5tr5, lịch sử, Link + QR) cùng cỡ chữ nhỏ */
  .home-tools .chips-wrap .chip { font-size: 10px; padding: 4px 9px; gap: 4px; }
  .home-tools .chips-wrap .chip svg { width: 11px; height: 11px; }
}
.chip-label { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; padding-right: 2px; }
.chip-label svg { width: 15px; height: 15px; }
.chip-n { font-size: 11px; opacity: .65; font-weight: 600; }
.hist-chip svg { width: 13px; height: 13px; opacity: .7; }
/* Chế độ Đã thuê: ghim và giá màu cam nhạt (phòng không còn trống nên không nổi bật) */
.view-rented .band-g, .view-rented .band-b, .view-rented .band-p { --band: #e9a187; }
.view-rented .pin[class*="band-"] { background: #fff; color: #e8743b; box-shadow: 0 0 0 1.5px #f4b9a0, 0 2px 6px rgba(0,0,0,.2); }
.view-rented .pin[class*="band-"]::before { border-top-color: #f4b9a0; }
.view-rented .pin[class*="band-"].on { background: #f4a98a; color: #fff; }
.view-rented .pin[class*="band-"].on::after { border-top-color: #f4a98a; }
/* Mũi tên chọn giá tăng / giảm bên trái dải phòng (điện thoại) */
.mc-row { display: flex; align-items: stretch; gap: 6px; padding-left: 10px; }
.mc-row .mc-track { flex: 1; min-width: 0; padding-left: 0; }
.mc-sort { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.mc-arrow { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.mc-arrow svg { width: 18px; height: 18px; }
.mc-arrow.on { background: var(--brand); border-color: var(--brand); color: #fff; }
/* Lịch sử tìm kiếm có nút ghim */
.chip.grp { padding: 0; gap: 0; cursor: default; }
.chip.grp button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.chip.grp .hc-main { padding: 4px 4px 4px 10px; }
.chip.grp .hc-pin { padding: 4px 9px 4px 3px; opacity: .85; }
.chip.grp .hc-pin svg { width: 12px; height: 12px; }
.chip.grp.pinned { border-color: var(--line); }
.chip.grp .hc-unpin { padding: 4px 3px 4px 10px; color: var(--brand); }
.chip.grp .hc-unpin svg { width: 12px; height: 12px; opacity: 1; }
.chip.grp .hc-main-pin { padding: 4px 10px 4px 2px; }
.chip.grp.pinned.on .hc-unpin { color: #fff; }
.chip.grp.pinned.on .hc-main svg { color: #fff; }
.hist-pinbtn { display: inline-flex; align-items: center; justify-content: center; }
.hist-pinbtn svg { width: 16px; height: 16px; }
.hist-pinbtn.on { color: var(--brand); }.chip-sep { flex: none; width: 1px; align-self: stretch; margin: 4px 2px; background: var(--line); }
.ref-bar {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  background: var(--info-weak); color: var(--info); border-radius: 999px;
  padding: 4px 4px 4px 12px; font-size: 12.5px; min-height: 32px;
}
.ref-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ref-zalo { flex: none; display: inline-flex; align-items: center; gap: 4px; background: var(--zalo); color: #fff; border-radius: 999px; padding: 4px 10px; font-weight: 600; font-size: 12px; }
.ref-zalo svg { width: 14px; height: 14px; }
.view-btn {
  flex: none; display: inline-flex; align-items: center; gap: 4px; border: 0; cursor: pointer;
  background: var(--brand-weak); color: var(--brand); border-radius: 999px; padding: 7px 10px; font-weight: 600; font-size: 12.5px;
}
.view-btn svg { width: 15px; height: 15px; }

/* ---------- Ô nhập ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); outline: none;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }

/* ---------- Tìm kiếm ---------- */
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 6px 0 14px; min-height: 48px; box-shadow: var(--shadow);
}
.search svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.search input { flex: 1; border: 0; outline: none; background: transparent; min-height: 46px; min-width: 0; }
.search .clear { border: 0; background: var(--chip); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; flex: none; }
.search .filter-link { border: 0; background: var(--brand-weak); color: var(--brand); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.search .filter-link svg { width: 17px; height: 17px; }
.search-hint { font-size: 12.5px; color: var(--muted); padding: 0 4px; }

/* ---------- Trang chủ ---------- */
.home { padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 899px) {
  .home-tools { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .search { min-height: 44px; }
  .search input { min-height: 42px; }
  .home-tools .chip { padding: 4px 9px; font-size: 12px; }
  #map { height: calc(100vh - var(--top) - var(--nav) - 140px); }
}
.home-tools {
  display: flex; flex-direction: column; gap: 10px;
  position: sticky; top: var(--top); z-index: 30;
  background: var(--bg); margin: -12px -16px 0; padding: 12px 16px 10px;
}
.search-wrap { position: relative; }
/* CHẾ ĐỘ BẢN ĐỒ CỐ ĐỊNH (Khách/CTV/Quản lý/Admin) */
@media (max-width: 899px) {
  .home.map-fixed { height: calc(var(--app-h, 100dvh) - var(--top) - var(--nav) - env(safe-area-inset-bottom)); padding-bottom: 0; gap: 6px; overflow: hidden; }
  .home.map-fixed .home-tools { position: relative; top: auto; margin: 0 -16px; flex: none; z-index: 30; }
  .home.map-fixed .split { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .home.map-fixed .map-wrap { flex: 1; min-height: 0; }
  .home.map-fixed #map { height: 100%; min-height: 0; }
  .home.map-fixed .map-card { bottom: 0; padding-bottom: 8px; background: linear-gradient(to top, var(--bg) 60%, transparent); }
  .home.map-fixed .notice-pill { display: none; }
}
@media (min-width: 900px) {
  .home.map-fixed .split.desk-map .map-wrap { position: sticky; top: calc(var(--top) + 150px); }
  .home.map-fixed .split.desk-map #map { height: calc(100vh - var(--top) - 175px); }
  .home.map-fixed .split.desk-map .side-panel { height: calc(100vh - var(--top) - 175px); overflow-y: auto; }
}
/* Tiêu đề, tab và ô tìm của trang Phòng (Admin) đứng yên khi cuộn */
.sticky-tools { position: sticky; top: var(--top); z-index: 25; background: var(--bg); display: flex; flex-direction: column; gap: 10px; margin: -16px -16px 0; padding: 16px 16px 10px; }
@media (min-width: 900px) { .sticky-tools { margin: -22px -28px 0; padding: 22px 28px 12px; } }
/* Tổng quan: khách đi xem hôm nay kèm mã phòng */
.today-row { display: flex; flex-direction: column; gap: 4px; }
.today-codes { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.today-codes span { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; background: var(--chip); padding: 2px 7px; border-radius: 6px; overflow-wrap: anywhere; }
/* Lịch hẹn: khối ghim gọn hơn, có bóng mờ khi nội dung trôi bên dưới */
.bk-sticky { gap: 8px; box-shadow: 0 6px 10px -8px rgba(16, 24, 40, .25); }
.bk-sticky .page-head h1 { margin: 0; }
.hist {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 35;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(16,24,40,.12);
  padding: 6px;
}
.search-wrap:focus-within .hist.has { display: block; }
.hist-row { display: flex; align-items: center; }
.hist-item { flex: 1; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 10px; border-radius: 10px; cursor: pointer; text-align: left; font-size: 14.5px; }
.hist-item:hover { background: var(--chip); }
.hist-item svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.hist-go { font-weight: 700; }
.hist-go span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-go em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--brand); background: var(--brand-weak); padding: 3px 10px; border-radius: 999px; flex: none; }
.hist-go svg { color: var(--brand); }
.hist-del { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; color: var(--muted); font-size: 18px; }
.hist-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px; font-size: 12.5px; color: var(--muted); }
.hist-head button { border: 0; background: transparent; color: var(--brand); cursor: pointer; font-size: 12.5px; }
.seg { display: inline-flex; background: var(--chip); border-radius: 12px; padding: 3px; align-self: flex-start; }
.seg button { border: 0; background: transparent; padding: 7px 16px; border-radius: 9px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--grad-brand); color: #fff; box-shadow: 0 3px 10px rgba(31, 95, 224, .28); }
.split { display: block; }
.map-wrap { position: relative; z-index: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--chip); }
.map-wrap.mobile-hidden { display: none; }
#map { width: 100%; height: calc(100vh - var(--top) - var(--nav) - 175px); min-height: 360px; }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--muted); font-size: 14px; }
.map-card { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 1001; }
.side-panel { overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.sp-head { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 16px 8px; position: sticky; top: 0; background: var(--card); z-index: 2; }
.sp-row { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 16px; cursor: pointer; color: var(--text); }
.sp-row:hover { background: var(--chip); }
.sp-thumb { width: 96px; height: 80px; border-radius: 12px; flex: none; }
.sp-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sp-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-price { color: var(--brand); font-weight: 700; }
.sp-addr { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-gallery { border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.gallery.sp-gallery .back { left: auto; right: 12px; font-size: 22px; line-height: 1; }
.sp-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.sp-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.sp-line svg { width: 19px; height: 19px; flex: none; color: var(--muted); margin-top: 1px; }
.mc-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 12px; scrollbar-width: none; }
.mc-track::-webkit-scrollbar { display: none; }
.mc-card {
  flex: 0 0 72%; max-width: 255px; scroll-snap-align: center; display: flex; gap: 9px; align-items: center;
  background: var(--card); color: var(--text); border-radius: 14px; padding: 7px; box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}
.mc-track.single { justify-content: center; }
.mc-track.single .mc-card { flex-basis: 100%; }
.mc-thumb { width: 78px; height: 69px; border-radius: 10px; flex: none; }
.mc-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mc-title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-price { color: var(--brand); font-weight: 700; font-size: 13px; }
.mc-sub, .mc-addr { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-hint { text-align: center; margin-bottom: 6px; }
.mc-hint span { display: inline-block; font-size: 12px; font-weight: 600; color: #fff; background: rgba(15, 23, 42, .72); padding: 3px 10px; border-radius: 999px; }
.pin { cursor: pointer; transition: transform .12s; }
.pin.on { transform: translate(-50%, -50%) scale(1.12); box-shadow: 0 4px 12px rgba(31, 95, 224, .45); }
.list.mobile-hidden { display: none; }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }

/* ---------- Thẻ phòng ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.room-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; color: var(--text); }
.room-card .thumb { aspect-ratio: 4 / 3; }
.room-card .body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.room-card .title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.room-card .price { color: var(--accent); font-weight: 700; font-size: 16px; }
.room-card { transition: transform .15s ease, box-shadow .15s ease; }
.room-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16, 24, 40, .1); }
.room-card .meta { font-size: 12.5px; color: var(--muted); }
.room-card .hh { font-size: 12.5px; font-weight: 600; color: var(--ok); }
.room-card .add { margin-top: auto; padding-top: 6px; }
/* Nút Đặt lịch xem luôn nằm sát đáy thẻ, cùng một hàng giữa các thẻ, dù tiêu đề dài hay ngắn */
.room-card .body.add { flex: none; }
.room-card .title { min-height: 2.9em; }
.room-card .meta { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.room-card .meta b { color: var(--text); font-weight: 700; }
/* Điện thoại: thẻ phòng gọn để lướt được nhiều phòng */
@media (max-width: 899px) {
  .cards { gap: 10px; }
  .room-card .body { padding: 7px 8px 2px; gap: 1px; }
  .room-card .price { font-size: 14.5px; }
  .room-card .title { font-size: 13px; -webkit-line-clamp: 1; min-height: 0; }
  .room-card .meta { font-size: 11.5px; }
  .room-card .hh { font-size: 11.5px; }
  .room-card .body.add { padding: 4px 8px 7px; }
  .room-card .body.add .btn { min-height: 24px; height: 24px; font-size: 11px; border-radius: 999px; }
  .room-card .body.add .btn[data-act="copyCardLink"] { width: 24px !important; }
  .room-card .body.add .btn svg { width: 13px; height: 13px; }
  /* Nhãn mã trên ảnh nhỏ lại 1/3 */
  .room-card .badge { font-size: 8px; padding: 2px 5px; border-radius: 5px; left: 6px; bottom: 6px; }
  .room-card .body.add .btn svg { width: 15px; height: 15px; }
}
.room-row { display: flex; gap: 10px; align-items: center; color: var(--text); }
.room-row .thumb { width: 76px; height: 60px; border-radius: 10px; flex: none; }
.room-row .title { font-weight: 600; font-size: 14px; }

.thumb { position: relative; overflow: hidden; display: grid; place-items: center; user-select: none; -webkit-user-drag: none; }
.thumb svg.ph { width: 34%; height: 34%; opacity: .55; color: #fff; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  background: var(--grad-brand); box-shadow: 0 2px 6px rgba(0,0,0,.2); color: #fff; font-weight: 700; font-size: 6px;
  padding: 1px 4px; border-radius: 5px; text-transform: uppercase; letter-spacing: .2px;
}
.count { position: absolute; right: 8px; top: 8px; z-index: 2; background: rgba(0,0,0,.5); color: #fff; font-size: 11.5px; padding: 2px 7px; border-radius: 6px; }
.km-tag { position: absolute; left: 8px; top: 8px; z-index: 2; background: var(--grad-accent); color: #fff; font-weight: 800; font-size: 11px; padding: 3px 7px; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.km-price { display: inline-block; margin-left: 6px; background: var(--accent-weak); color: var(--accent); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; vertical-align: middle; }
.room-card .price { color: var(--band); }
.km-inline { font-weight: 800; color: var(--accent); opacity: .85; font-size: 12px; }
.wm {
  position: absolute; right: 8px; bottom: 7px; z-index: 2;
  color: rgba(255,255,255,.78); font-size: 4.7px; font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,.45); max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wm.big { font-size: 5.5px; }

/* ---------- Ghim bản đồ ---------- */
.pin {
  background: var(--card); color: var(--text); border: 2px solid var(--brand);
  border-radius: 999px; padding: 3px 9px; font-weight: 700; font-size: 12.5px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,.2); display: inline-block; transform: translate(-50%, -50%);
}
.pin.on { background: var(--brand); color: #fff; }
.leaflet-div-icon { background: transparent; border: 0; }
/* 3 mức giá: dưới 4tr5 · 4tr5–6tr · trên 6tr */
/* Phương án A: rẻ = cam, giữa = xanh biển, cao = xanh đậm */
/* Mọi mức giá dùng chung một màu xanh (không chia màu theo giá) */
.band-g, .band-b, .band-p { --band: #1F6FEB; }
[data-theme="dark"] .band-g, [data-theme="dark"] .band-b, [data-theme="dark"] .band-p { --band: #3B82F6; }
.map-legend { display: none !important; } /* chú thích 3 màu không còn ý nghĩa */
/* Ghim giá dạng bong bóng có đuôi chỉ đúng vị trí */
.pin[class*="band-"] {
  position: relative; background: #fff; color: var(--band); border: 0; border-radius: 10px 10px 10px 3px;
  padding: 4px 9px; transform: translate(-50%, calc(-100% - 6px));
  box-shadow: 0 0 0 1.5px var(--band), 0 2px 6px rgba(0,0,0,.25); /* nền trắng, chữ xanh, viền xanh mảnh cho dễ tách khi nhiều ghim đè nhau */
}
.z-mid .pin[class*="band-"] { font-size: 11px; padding: 3px 7px; }
.z-far .pin[class*="band-"] { font-size: 9.5px; padding: 1px 5px; border-radius: 7px 7px 7px 2px; }
.z-far .pin[class*="band-"]::after { border-width: 4px; border-bottom: 0; bottom: -4px; margin-left: -4px; }
.z-far .pin[class*="band-"]::before { border-width: 5.5px; border-bottom: 0; bottom: -6px; margin-left: -5.5px; }
.pin[class*="band-"]::before { content: ''; position: absolute; left: 50%; bottom: -8.5px; margin-left: -7.5px; border: 7.5px solid transparent; border-bottom: 0; border-top-color: var(--band); }
.pin[class*="band-"]::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #fff; }
.pin[class*="band-"].on::after { border-top-color: var(--band); }
.pin[class*="band-"].on { background: var(--band); color: #fff; outline: 3px solid #fff; transform: translate(-50%, calc(-100% - 6px)) scale(1.15); z-index: 1000; }
/* Cụm: "N phòng · từ Xtr" */
.cl2 { display: inline-flex; flex-direction: column; align-items: center; transform: translate(-50%, -50%); background: var(--card); color: var(--text); border: 1.5px solid var(--text); border-radius: 12px; padding: 4px 10px; line-height: 1.2; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.2); cursor: pointer; }
.cl2 b { font-size: 13px; } .cl2 span { font-size: 11px; color: var(--muted); }
.map-legend { position: absolute; left: 10px; bottom: 10px; z-index: 900; display: flex; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 5px 9px; font-size: 12px; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--band); margin-right: 5px; vertical-align: -1px; }
/* Khi dải phòng hiện ở dưới, chú thích màu chuyển lên góc trên phải */
.map-wrap:has(.map-card:not(:empty)) .map-legend { top: 10px; bottom: auto; left: auto; right: 10px; font-size: 11px; gap: 7px; padding: 4px 7px; }
.leaflet-container { background: #ebe7ec; }
/* Thẻ CTV (Admin): nút Link + QR nằm cùng hàng với tên và tầng, thu gọn */
.ctv-top { display: flex; justify-content: space-between; flex-wrap: nowrap; align-items: center; gap: 8px; }
.ctv-name { min-width: 0; }
.ctv-top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.ctv-top-actions .ctv-big { display: inline-flex; }
.btn.ctv-qr2 { height: 28px; padding: 0 10px; font-size: 12px; gap: 5px; white-space: nowrap; }
.btn.ctv-qr2 svg { width: 14px; height: 14px; }
@media (max-width: 600px) {
  /* Điện thoại: chỉ còn biểu tượng, tên - nút - tầng nằm trên 1 dòng */
  .btn.ctv-qr2 { width: 30px; padding: 0; justify-content: center; }
  .btn.ctv-qr2 .lbl { display: none; }
  .ctv-top-actions { gap: 4px; }
}
/* Báo cáo: danh sách CTV có khách bấm link */
button.stat { font: inherit; text-align: left; cursor: pointer; }
a.stat span, button.stat span { color: var(--muted); }
.clk-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.clk-l { min-width: 0; }
.clk-a { display: flex; gap: 6px; flex: none; }/* Thẻ CTV (Admin): gọn, dễ quét mắt */
.ctv-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ctv-nm { font-size: 16px; }
.ctv-code { font-size: 12.5px; color: var(--muted); margin-left: 6px; font-weight: 600; }
.ctv-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ctv-meta { font-size: 12.5px; color: var(--muted); line-height: 1.5; display: flex; flex-direction: column; gap: 1px; }
.ctv-meta b { color: var(--text); }
.ctv-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ctv-kpis > div { background: var(--brand-weak); border-radius: 10px; padding: 8px 6px; text-align: center; display: flex; flex-direction: column; gap: 1px; }
.ctv-kpis b { font-size: 20px; color: var(--brand); line-height: 1.1; }
.ctv-kpis span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.ctv-more { border-top: 1px dashed var(--line); padding-top: 8px; }
.ctv-more > summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); list-style: none; display: flex; align-items: center; justify-content: space-between; }
.ctv-more > summary::-webkit-details-marker { display: none; }
.ctv-more > summary::after { content: '▾'; transition: transform .15s; }
.ctv-more[open] > summary::after { transform: rotate(180deg); }
.ctv-more-body { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }/* Quy tắc làm việc của CTV */
.ctv-rules > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.ctv-rules > summary::-webkit-details-marker { display: none; }
.ctv-rules > summary::after { content: '▾'; color: var(--muted); }
.ctv-rules[open] > summary::after { transform: rotate(180deg); }
.ctv-rules-body { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.ctv-rules-body p { margin: 0; font-size: 14px; line-height: 1.55; }
/* Thanh chọn bán kính quanh trường */
.zone-bar.place { gap: 6px; min-width: 230px; }
.pl-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pl-chip { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 4px 11px; font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.pl-chip.on { background: #e8743b; border-color: #e8743b; color: #fff; }
.pl-slide { display: flex; align-items: center; gap: 10px; }
.pl-slide input[type=range] { flex: 1; min-width: 90px; accent-color: #e8743b; }
.pl-num { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; white-space: nowrap; }
.rad-place { width: 52px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; font-weight: 700; text-align: center; padding: 3px 2px; }
.place-end { display: inline-block; transform: translate(-50%, -50%); background: #e8743b; color: #fff; border: 2px solid #fff; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
/* Gợi ý đường đi giữa 2 địa điểm */
.zone-bar { position: absolute; top: 10px; left: 54px; z-index: 1000; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.18); max-width: calc(100% - 64px); display: flex; flex-direction: column; gap: 6px; }
.zone-bar.hidden { display: none; }
@media (max-width: 899px) { .zone-bar:not(.mini) { left: auto; right: 8px; top: 10px; transform: scale(.72); transform-origin: top right; width: 235px; max-width: calc((100% - 64px) / .72); } }
@media (min-width: 900px) { .zone-bar:not(.mini) { left: auto; right: 12px; top: 12px; max-width: 360px; } }
.zone-bar > span { display: block; }
.zone-bar button.x { border: 0; background: var(--chip); color: var(--text); border-radius: 999px; width: 24px; height: 24px; line-height: 1; font-size: 16px; cursor: pointer; flex: none; }
.zone-bar.mini { left: auto; right: 8px; top: 8px; flex-direction: row; align-items: center; gap: 7px; padding: 6px 11px 6px 9px; border-radius: 999px; cursor: pointer; max-width: calc(100% - 64px); border-color: var(--c); }
.zone-bar.mini i { width: 4px; height: 16px; border-radius: 3px; background: var(--c); flex: none; }
.zone-bar.mini span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-bar.mini em { font-style: normal; color: var(--muted); }
.zb-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.zb-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zb-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.ropt { display: flex; flex-direction: column; align-items: flex-start; gap: 0; text-align: left; border: 1.5px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px; padding: 4px 9px 4px 14px; cursor: pointer; position: relative; font: inherit; line-height: 1.25; }
.ropt i { position: absolute; left: 4px; top: 8px; bottom: 8px; width: 4px; border-radius: 3px; background: var(--c); }
.ropt b { font-size: 12.5px; }
.ropt small { font-size: 11px; color: var(--muted); }
.ropt.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--card)); }
.rad { width: 44px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; font-weight: 700; text-align: center; padding: 0 2px; margin: 0 1px; }
.ropt small .rad { font-weight: 600; width: 38px; }
.rad:focus { outline: 2px solid var(--c, var(--brand)); }
.zb-count { font-size: 12px; color: var(--muted); }
.route-end { display: inline-block; transform: translate(-50%, -50%); background: #111; color: #fff; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.3); }.mc-track { position: relative; }
.mc-card { position: relative; scroll-snap-align: center; }
.mc-card.on { outline: 2.5px solid var(--brand); outline-offset: -2.5px; }
.mc-title { font-size: 12px !important; line-height: 1.3; white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-price[class*="band-"] { color: var(--band); }
/* Khung phải: N phòng trong vùng + lưới ảnh */
.sp-head2 { position: sticky; top: 0; z-index: 5; background: var(--card); padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.sp-head2 input[type=range] { width: 100%; accent-color: var(--brand); }
/* Mỗi phòng một hàng dài: ảnh bên trái, địa chỉ · giá · mã bên phải */
.sp-grid { display: flex; flex-direction: column; padding: 4px 0 12px; }
.sp-card { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; background: transparent; padding: 10px 14px; text-align: left; cursor: pointer; color: var(--text); transition: background .15s; }
.sp-card:hover { background: var(--chip); }
.sp-thumb2 { width: 96px; height: 80px; border-radius: 12px; flex: none; }
.sp-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sp-cap { font-size: 14.5px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-price { font-size: 12.5px; color: var(--muted); }
.sp-ph { position: relative; flex: none; }
.sp-tag { position: absolute; left: 6px; top: 6px; z-index: 1; background: var(--band); color: #fff; font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 7px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.sp-code { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marker-cluster div { background: var(--brand) !important; color: #fff; font-weight: 700; font-family: inherit; font-size: 13px; }
.marker-cluster { background: rgba(31, 111, 235, .28) !important; }
.leaflet-container { font-family: inherit; background: var(--chip); }

/* ---------- Chi tiết phòng ---------- */
.detail { padding-bottom: 90px; }
.gallery { position: relative; background: #000; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 4 / 3; max-height: 62vh; }
.slide .thumb { width: 100%; height: 100%; }
.gallery .counter { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; padding: 3px 10px; border-radius: 999px; z-index: 3; }
.gallery .back { position: absolute; left: 12px; top: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.92); border: 0; display: grid; place-items: center; cursor: pointer; color: #111; }
.gallery .back svg { width: 20px; height: 20px; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #111; font-size: 24px; font-weight: 800; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.gal-nav.prev { left: 10px; } .gal-nav.next { right: 10px; }
.gal-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px 0; background: var(--card); scrollbar-width: none; }
.gal-thumbs::-webkit-scrollbar { display: none; }
.gal-thumb { flex: 0 0 118px; height: 90px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--chip); cursor: pointer; }
.gal-thumb.on { border-color: var(--accent); }
.gal-thumb-img { width: 100%; height: 100%; border-radius: 0; }
@media (min-width: 900px) {
  .gal-nav { opacity: 0; transition: opacity .15s; }
  .gallery:hover .gal-nav { opacity: 1; }
  .gal-thumbs { padding-left: calc((100% - 1200px) / 2 + 16px); padding-right: calc((100% - 1200px) / 2 + 16px); }
}
@media (max-width: 480px) { .gal-thumbs { display: none; } }
.detail-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.price-big { font-size: 24px; font-weight: 700; color: var(--accent); }
.code-line { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--chip); padding: 3px 8px; border-radius: 6px; word-break: break-all; }
/* Mã đầy đủ trong form sửa phòng: thu nhỏ còn ~70% */
.tiny.muted .code-line { font-size: 9px; padding: 2px 6px; border-radius: 5px; line-height: 1.3; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fact { background: var(--chip); border-radius: 10px; padding: 8px 10px; }
.fact b { display: block; font-size: 14px; }
.fact span { font-size: 12px; color: var(--muted); }
.list-plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.hh-box { border: 1px dashed var(--ok); background: var(--ok-weak); color: var(--ok); border-radius: 12px; padding: 10px 12px; font-weight: 600; }
.ngo-pin {
  display: inline-flex; align-items: center; gap: 4px; transform: translate(-50%, -100%);
  background: #1e40af; color: #fff; font-weight: 700; font-size: 12.5px; white-space: nowrap;
  padding: 5px 10px 5px 7px; border-radius: 999px; box-shadow: 0 4px 12px rgba(30, 64, 175, .4); position: relative;
}
.ngo-pin svg { width: 15px; height: 15px; }
.ngo-pin::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #1e40af; }
.mini-map { height: 220px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); position: relative; z-index: 0; isolation: isolate; }
.share-ask { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #FFF0E6; color: #5a2a0c; zoom: 1.15; }
.share-ask .ico { flex: none; }
.share-ask .txt { flex: 1; font-weight: 700; font-size: 14px; line-height: 1.4; }
.share-ask .txt small { display: block; font-weight: 400; font-size: 12px; color: #8a4a20; margin-top: 2px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; border: 1px solid transparent; }
.pick-row.on { background: var(--brand-weak); border-color: var(--brand); }
.pick-box { width: 22px; height: 22px; flex: none; accent-color: var(--brand); cursor: pointer; }
.ok-text { color: var(--brand); font-weight: 700; }
.share-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: rgba(255,255,255,.85); color: #1f2937; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.share-btn:active { transform: scale(.97); }
.share-btn:disabled { opacity: .5; cursor: not-allowed; }
:root[data-theme="dark"] .share-btn { background: rgba(255,255,255,.12); color: #fde3d0; }
:root[data-theme="dark"] .share-ask { background: #3d2414; color: #fde3d0; }
:root[data-theme="dark"] .share-ask .txt small { color: #f0b48a; }
.action-bar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav) + env(safe-area-inset-bottom)); z-index: 30;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 10px 12px; display: flex; gap: 8px;
}
.action-bar .btn { flex: 1; padding: 0 8px; }
.action-bar .btn.icon-only { flex: 0 0 48px; }
.action-bar .btn.main-act { flex: 1.6; }

/* ---------- Thanh trạng thái lịch hẹn của CTV ---------- */
.ctv-status-bar {
  display: flex; gap: 8px; margin: 10px 0 12px; padding: 4px;
  background: var(--chip); border-radius: 999px; overflow-x: auto;
  scrollbar-width: none;
}
.ctv-status-bar::-webkit-scrollbar { display: none; }
.ctv-status {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px; color: var(--muted);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.ctv-status.on { background: var(--card); color: var(--brand); box-shadow: var(--shadow); }
.ctv-status-n {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 999px; background: var(--line);
  color: var(--muted); font-size: 12px; font-weight: 700;
}
.ctv-status.on .ctv-status-n { background: var(--brand); color: var(--brand-ink); }

/* ---------- Lịch hẹn ---------- */
.steps { display: flex; gap: 6px; }
.steps div { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps div.on { background: var(--brand); }
.stop { display: flex; gap: 10px; align-items: flex-start; }
.stop-no { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.chot-box { display: flex; flex-direction: column; gap: 2px; }
.bk-room-link { display: flex; gap: 12px; align-items: center; color: var(--text); padding: 6px; margin: -6px; border-radius: 12px; transition: background .15s; }
.bk-room-link:hover { background: var(--chip); }
.bk-room-thumb { width: 104px; height: 80px; border-radius: 10px; flex: none; }
.guide { background: var(--ok-weak); color: var(--ok); border-radius: 10px; padding: 8px 10px; font-weight: 600; }
.guide.wait { background: var(--warn-weak); color: var(--warn); }
.bk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.bk-id { font-weight: 700; }
.consultant { border: 2px solid var(--zalo); background: linear-gradient(180deg, var(--zalo-weak), var(--card) 70%); }
.avatar { width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--grad-brand); color: #fff; font-weight: 700; font-size: 22px; }
.consultant-name { font-size: 19px; font-weight: 700; }
.btn.zalo-solid { background: var(--zalo); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 104, 255, .35); }
.support-quiet { font-size: 12.5px; color: var(--muted); text-align: center; padding: 2px 8px; }
.support-quiet a { color: var(--muted); text-decoration: underline; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: inherit; }
/* Hộp lịch hẹn dạng bảng: Khách hàng | Phòng | CTV | Thanh toán | Thao tác */
.tabs-pill { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs-pill::-webkit-scrollbar { display: none; }
.tab-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tab-pill .tab-n { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--chip); color: var(--muted); font-size: 12px; display: grid; place-items: center; }
.tab-pill.on { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(31, 95, 224, .3); }
.tab-pill.on .tab-n { background: rgba(255, 255, 255, .25); color: #fff; }
.bk-table { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.bk-head-row, .bk-row { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(400px, 2.6fr) minmax(160px, .9fr) minmax(230px, 1fr); gap: 14px; padding: 12px 16px; }
.act-pay { flex: 1; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 10px; min-height: 30px; }
.act-pay .pill-st { font-size: 10.5px; }
/* Nút Chốt thuê / Đã xem / Hủy / Ghi chú ở cột cuối bên phải */
.bk-row .act-row { justify-content: flex-end; flex-wrap: wrap; }
.bk-row .act-pay { flex: 0 0 auto; padding: 0 4px; min-height: 18px; border-radius: 6px; }
/* Nút thao tác thu nhỏ một nửa */
.bk-row .act-row { gap: 4px; }
.bk-row .act-btn { padding: 3px 7px; font-size: 9px; border-radius: 6px; letter-spacing: .2px; box-shadow: none; }
.bk-row .act-pay .pill-st { font-size: 8.5px; padding: 2px 5px; border-radius: 5px; }
.rm-copy { flex: none; align-self: flex-start; margin-top: 3px; width: 30px; height: 30px; border: 0; border-radius: 9px; background: var(--brand-weak); color: var(--brand); display: grid; place-items: center; cursor: pointer; transition: transform .08s; }
.rm-copy:hover { background: var(--brand); color: #fff; }
.rm-copy:active { transform: scale(.92); }
.rm-copy svg { width: 15px; height: 15px; }
.rm-tools .prev-guide { margin-left: 4px; }
/* Hàng số dẫn thu nhỏ một nửa; nút Gửi màu nhạt như nút Ghi chú */
.bk-row .rm-tools { gap: 4px; margin-top: 3px; }
.bk-row .rm-tools .input { width: 110px; min-height: 20px; height: 20px; padding: 1px 6px; font-size: 10.5px; border-radius: 5px; }
.bk-row .rm-tools .mini-btn { height: 20px; padding: 0 7px; font-size: 10px; border-radius: 5px; }
.bk-row .rm-tools .mini-btn.primary { background: var(--brand-weak); color: var(--brand); }
.bk-row .rm-tools .prev-guide, .bk-row .rm-tools .prev-guide .link-btn { font-size: 10px; }
/* Địa chỉ nổi bật, ảnh to hơn */
.rm-line .rm-addr { font-size: 15px; font-weight: 700; color: var(--text); white-space: normal; overflow: visible; }
.rm-thumb { width: 56px; height: 56px; border-radius: 10px; }
.bk-col.pay .pill-st { font-size: 10px; padding: 3px 7px; }
.bk-time { white-space: nowrap; }
/* Trạng thái, mã lịch, thông tin CTV: nhỏ hơn 1/4 so với cỡ thường */
.bk-mini { font-size: 9.5px; line-height: 1.35; }
.bk-mini .tag { font-size: 9px; padding: 1px 6px; border-radius: 5px; }
.bk-mini svg { width: 10px !important; height: 10px !important; }
button.phone-ic { border: 0; cursor: pointer; transition: transform .08s; }
button.phone-ic:hover { background: var(--brand); color: #fff; }
button.phone-ic:active { transform: scale(.92); }
.bk-col.cust .tag { white-space: normal; }
.bk-col.pay .tiny { font-size: 11px; }
.rm-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rm-line .rm-addr { flex: 1; min-width: 0; font-style: normal; }
.rm-tools { display: flex; align-items: center; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.rm-tools .input { width: 150px; min-height: 28px; padding: 3px 8px; font-size: 12.5px; border-radius: 7px; }
.mini-btn { display: inline-flex; align-items: center; gap: 3px; border: 0; border-radius: 7px; padding: 0 9px; height: 28px; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.mini-btn svg { width: 12px; height: 12px; }
.mini-btn.primary { background: var(--grad-brand); color: #fff; }
.mini-btn.soft { background: var(--brand-weak); color: var(--brand); }
.mini-btn.zalo { background: var(--zalo-weak); color: var(--zalo); }
.rm-tools .guide-done { margin-top: 0; padding: 3px 8px; font-size: 11.5px; }
.bk-head-row { font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); background: var(--chip); }
.bk-row { border-top: 1px solid var(--line); align-items: start; }
.bk-row:nth-child(odd) { background: color-mix(in srgb, var(--chip) 45%, transparent); }
.bk-col { min-width: 0; }
.bk-sel { width: 16px; height: 16px; margin-top: 10px; accent-color: var(--brand); flex: none; }
.phone-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--brand-weak); color: var(--brand); display: grid; place-items: center; flex: none; }
.phone-ic svg { width: 18px; height: 18px; }
.bk-phone { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 16px; }
.bk-time { display: flex; align-items: center; gap: 4px; color: #8b2fd6; font-weight: 700; font-size: 12.5px; margin-top: 2px; }
[data-theme="dark"] .bk-time { color: #c084fc; }
.bk-time svg { width: 13px; height: 13px; }
.guide-box { margin-top: 8px; padding: 8px; border: 1px dashed var(--brand); border-radius: 10px; background: var(--brand-weak); display: flex; flex-direction: column; gap: 4px; }
.guide-lbl { font-size: 11.5px; font-weight: 700; color: var(--brand); }
.guide-box .input { min-height: 34px; padding: 6px 9px; font-size: 13.5px; border-radius: 9px; background: var(--card); }
.guide-box .btn { min-height: 34px; padding: 0 12px; }
.guide-done { margin-top: 8px; display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--ok); background: var(--ok-weak); padding: 4px 10px; border-radius: 8px; }
.rm { display: flex; gap: 10px; align-items: flex-start; }
/* Phòng khách chốt trong lịch nhiều phòng */
/* Mọi lịch hẹn của Admin: 1 tone xanh biển. Nút chính xanh đậm, nút phụ (Hủy) xanh nhạt; giờ, giá, số dẫn để trung tính */
.bk-row .bk-time { color: var(--text); }
.bk-row .rm-price { background: var(--chip); color: var(--text); }
.bk-row .guide-done { background: var(--chip); color: var(--text); }
.bk-row .bk-mini .tag:not(.t-bad) { background: #E7F0FF; color: #1F6FEB; }
.bk-row .act-btn.green, .bk-row .act-btn.navy { background: #1F6FEB; color: #fff; box-shadow: 0 3px 10px rgba(31, 111, 235, .25); }
.bk-row .act-btn.red { background: #E7F0FF; color: #1F6FEB; border-color: transparent; }
[data-theme="dark"] .bk-row .act-btn.red, [data-theme="dark"] .bk-row .bk-mini .tag:not(.t-bad) { background: #1b315a; color: #8fb6ff; }
/* Phương án A: lịch đã cọc chỉ dùng 1 màu nhấn xanh biển, còn lại xám */
/* Mọi khối phòng trong lịch hẹn cùng một lề: nút chép + ảnh bên trái, cột chữ (giá + địa chỉ / mã / số dẫn) thẳng hàng */
.bk-row .rm { border-left: 3px solid transparent; border-radius: 0 10px 10px 0; padding: 6px 6px 6px 8px; }
.bk-row .rm + .rm { margin-top: 6px; border-top: 0; padding-top: 6px; }
.rm.rm-chot { background: color-mix(in srgb, #1F6FEB 5%, transparent); border-left-color: #1F6FEB; }
@media (min-width: 700px) {
  .bk-row .rm-line { align-items: flex-start; }
  .bk-row .rm-line .rm-price { flex: none; margin-top: 2px; }
  .bk-row .rm-copy { margin-top: 3px; }
}
.bk-row.deposit { box-shadow: inset 0 0 0 2px color-mix(in srgb, #1F6FEB 35%, transparent); }
.bk-row.deposit .bk-time { color: var(--text); }
.bk-row.deposit .rm-price { background: var(--chip); color: var(--text); }
.bk-row.deposit .guide-done { background: var(--chip); color: var(--muted); }
.bk-row.deposit .chot-tag { background: none; color: #1F6FEB; padding: 0 0 0 6px; font-size: 11.5px; }
.bk-row.deposit .act-box.navy-soft { background: var(--chip); color: #1F6FEB; }
.rm.rm-dim { opacity: .45; }
.chot-line { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--accent-weak); }
.chot-tag { font-family: var(--font, inherit); font-size: 11px; font-weight: 800; color: #fff; background: var(--accent); padding: 1px 8px; border-radius: 6px; white-space: nowrap; }
.rm + .rm { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.rm-thumb { width: 36px; height: 36px; border-radius: 8px; flex: none; }
.rm-thumb svg.ph { width: 50%; height: 50%; }
.rm-info { min-width: 0; flex: 1; }
.rm-code { background: #f3e8ff; color: #7e22ce; font-weight: 700; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; }
.rm-price { background: var(--accent-weak); color: var(--accent); font-weight: 700; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; }
[data-theme="dark"] .rm-code { background: #3b1d5c; color: #d8b4fe; }
.rm-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.rm-addr { font-size: 12px; color: var(--muted); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-code-full { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; margin-top: 2px; overflow-wrap: anywhere; }
.rm-code-full .bk-copy { width: 22px; height: 22px; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.ctv-name { font-size: 13px; }
/* Thẻ CTV trong Admin: tầng, trạng thái, số liệu to hơn 1/3; phần đổi tầng, ngừng, xóa nhỏ lại 1/2 */
.ctv-big .tag { font-size: 13px; padding: 2px 8px; border-radius: 6px; }
.ctv-stats { font-size: 18.5px; font-weight: 600; }
.ctv-admin { display: flex; flex-direction: column; gap: 4px; }
.ctv-admin:empty { display: none; }
.ctv-admin .field > span { font-size: 10px; }
.ctv-admin select.input { min-height: 24px; height: 24px; padding: 1px 6px; font-size: 11px; border-radius: 6px; width: auto; max-width: 260px; }
.ctv-admin .btn-row { gap: 4px; }
.ctv-admin .btn { min-height: 22px; height: 22px; padding: 0 8px; font-size: 10.5px; border-radius: 6px; flex: 0 0 auto; }
.ctv-admin .tiny { font-size: 9.5px; }
.bk-col.ctv svg { width: 13px; height: 13px; vertical-align: -2px; }
.pill-st { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .4px; color: var(--muted); background: var(--chip); padding: 4px 9px; border-radius: 8px; }
.pill-st.warn { color: var(--warn); background: var(--warn-weak); }
.pill-st.ok { color: var(--ok); background: var(--ok-weak); }
.bk-col.acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.act-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.act-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; border-radius: 10px; padding: 7px 12px; font-size: 11.5px; font-weight: 800; letter-spacing: .3px; cursor: pointer; white-space: nowrap; transition: transform .08s; }
.act-btn:active { transform: scale(.96); }
.act-btn svg { width: 13px; height: 13px; }
/* Mẫu 1: Chốt thuê = cam chủ đạo, Đã xem = xanh biển chủ đạo */
.act-btn.green { background: #F26A1F; color: #fff; box-shadow: 0 3px 10px rgba(242, 106, 31, .3); }
.act-btn.navy { background: #1F6FEB; color: #fff; box-shadow: 0 3px 10px rgba(31, 111, 235, .3); }
.act-btn.red { background: var(--bad-weak); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.act-btn.soft { background: var(--brand-weak); color: var(--brand); }
.act-btn.zalo { background: var(--zalo-weak); color: var(--zalo); }
@media (max-width: 1299px) {
  .bk-head-row { display: none; }
  .bk-row { grid-template-columns: 1fr; gap: 10px; }
  .bk-col.pay:empty { display: none; }
  .bk-col.acts { align-items: stretch; }
  .act-row { justify-content: stretch; }
  .act-row .act-btn { flex: 1; justify-content: center; }
}
/* Điện thoại: khối "hỏi người thân / chia sẻ" nhỏ còn khoảng 1/2 */
@media (max-width: 759px) {
  .share-ask { gap: 7px; padding: 6px 8px; border-radius: 10px; }
  .share-ask .ico { width: 22px; height: 20px; }
  .share-ask .txt { font-size: 9.5px; line-height: 1.3; }
  .share-ask .txt small { font-size: 8px; margin-top: 1px; }
  .share-btn { height: 26px; padding: 0 10px; gap: 4px; font-size: 10px; }
  .share-btn svg { width: 12px; height: 12px; }
}
/* Nút "Lịch xem" nháy khi khách vừa chọn phòng */
@keyframes navPulse { 0%, 100% { transform: scale(1); background: transparent; } 50% { transform: scale(1.12); background: color-mix(in srgb, #F26A1F 18%, transparent); } }
#nav a.nav-pulse { animation: navPulse .8s ease-in-out 4; border-radius: 14px; color: #F26A1F; }
#nav a.nav-pulse svg { color: #F26A1F; }
/* Ô ngày dd/mm/yyyy + nút lịch */
.date-wrap { position: relative; display: flex; align-items: center; }
.date-wrap input[data-date] { flex: 1; padding-right: 42px; letter-spacing: .3px; }
.date-pick { position: absolute; right: 6px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; border-radius: 8px; }
.date-pick:hover { background: var(--chip); color: var(--brand); }
.date-pick svg { width: 18px; height: 18px; }
.date-native { position: absolute; right: 6px; bottom: 0; width: 32px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
/* Thưởng chủ nhà theo phòng (chỉ CTV/Admin thấy) */
.bonus-tag { color: var(--accent); font-weight: 700; white-space: nowrap; }
.bonus-field input { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
/* CTV: nút Link + QR ở hàng chip, và khung mã QR */
.chip.ctv-qr { margin-left: auto; flex: none; background: var(--accent-weak); color: var(--accent); border-color: transparent; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.chip.ctv-qr svg { width: 14px; height: 14px; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; min-height: 120px; justify-content: center; }
.qr-box img { width: 220px; height: 220px; image-rendering: pixelated; }
.qr-cap { font-size: 12.5px; font-weight: 700; color: #1f2937; text-align: center; text-wrap: balance; max-width: 240px; }
.qr-id { align-self: flex-end; font-size: 10px; color: #b0b4bb; margin-top: -2px; }
.qr-link { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--chip); padding: 8px 10px; border-radius: 8px; overflow-wrap: anywhere; }
/* CTV: thu nhập theo tháng */
.inc-big { font-size: 26px; font-weight: 800; margin-top: -4px; }
.inc-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--chip); }
.inc-bar span { display: block; height: 100%; }
.inc-sum { display: flex; align-items: flex-start; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.inc-sum .dot { width: 10px; height: 10px; border-radius: 3px; margin-top: 5px; flex: none; }
.inc-sum .grow b { display: block; font-size: 14px; }
.inc-sum .grow span { font-size: 12px; color: var(--muted); }
.inc-sec { display: flex; flex-direction: column; }
.inc-sec + .inc-sec { margin-top: 10px; }
.inc-sec > .row { padding: 6px 0; border-bottom: 1px solid var(--line); }
/* Mỗi dòng: thông tin | nhãn trạng thái (cố định, thẳng cột) | số tiền (cố định) */
.inc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t g" "s v" "a a"; column-gap: 10px; row-gap: 4px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.inc-row > .inc-t { grid-area: t; }
.inc-row > .inc-tag { grid-area: g; justify-self: end; width: auto; padding: 3px 10px; }
.inc-row > .inc-s { grid-area: s; }
.inc-row > .inc-v { grid-area: v; align-self: end; }
.inc-row > .inc-act { grid-area: a; }.inc-t { font-size: 13px; font-weight: 700; }
.inc-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.inc-code { display: block; font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--text); }
.inc-tag { width: 100%; text-align: center; font-size: 11.5px; font-weight: 700; padding: 4px 0; border-radius: 7px; white-space: nowrap; }
.inc-v { text-align: right; font-size: 13.5px; white-space: nowrap; }
.st-wait { background: var(--chip); color: var(--muted); }
.st-ok2 { background: var(--info-weak); color: var(--info); }
.st-hd { background: #F26A1F; color: #fff; }
.tag-btn { border: 1px dashed var(--muted); cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 700; }
.tag-btn:hover { border-style: solid; color: var(--text); }
.adj-note { display: block; color: var(--accent); font-weight: 700; margin-top: 2px; }
.hh-adjust { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.inc-act { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inc-act .link-btn { font-size: 12px; font-weight: 700; }
.inc-act .bad-link { color: var(--bad); }
.inc-act .hd-wait { color: var(--muted); }
.inc-act .hd-wait:hover { color: var(--text); }
.inc-act .hd-done { font-size: 12px; font-weight: 700; color: #1F6FEB; }
/* Bước Đã làm HĐ / Đã chuyển khoản: chưa bấm = xám, bấm rồi = xanh */
.step-btn { border: 1px solid var(--line); background: var(--chip); color: var(--muted); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.step-btn:disabled { opacity: .55; cursor: not-allowed; }
span.step-btn { cursor: default; }
.step-btn.done { background: #1F6FEB; border-color: #1F6FEB; color: #fff; }
.step-btn.bad { background: var(--card); border-color: #f1b4ab; color: var(--bad); }
button.step-btn.bad:not(:disabled):hover { background: #fdecea; border-color: var(--bad); color: var(--bad); }
button.step-btn:not(:disabled):hover { border-color: #1F6FEB; color: #1F6FEB; }
.inc-act .muted-link { color: var(--muted); font-weight: 600; }
.f1-lbl { display: inline-block; font-size: 11px; font-weight: 800; color: #fff; background: var(--accent); padding: 1px 7px; border-radius: 6px; vertical-align: 1px; }
.f2-row { display: flex; flex-direction: column; gap: 3px; padding: 9px 0 0 12px; border-top: 1px solid var(--line); border-left: 3px solid var(--accent-weak); }
.pay-link { font-size: 11.5px; font-weight: 700; color: var(--brand); white-space: nowrap; align-self: center; }
.pay-sum { font-size: 20px; font-weight: 800; white-space: nowrap; }
.st-due { background: var(--accent-weak); color: var(--accent); }
.st-paid { background: var(--ok-weak); color: var(--ok); }
/* Đã chốt: 2 ô ngang nhau — trái Đã làm HĐ, phải Hủy cọc */
.act-two { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.act-two.one { grid-template-columns: 1fr; }
.act-box { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 6px 10px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 12px; font-weight: 800; letter-spacing: .3px; text-align: center; }
button.act-box { cursor: pointer; }
button.act-box:active { transform: scale(.97); }
.act-box.navy { background: #1F6FEB; color: #fff; }
.act-box.red { background: var(--bad-weak); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.act-box.ok { background: var(--ok-weak); color: var(--ok); }
.act-box.navy-soft { background: color-mix(in srgb, #1F6FEB 12%, var(--card)); color: #1F6FEB; }
.act-box.bad { background: var(--bad-weak); color: var(--bad); flex-wrap: wrap; }
.act-box.off { background: var(--chip); color: var(--muted); opacity: .6; text-decoration: line-through; }
.act-box .link-btn { font-size: 11.5px; font-weight: 700; }
.cancel-reason { flex: 1 1 200px; font-size: 12px; color: var(--bad); background: var(--bad-weak); padding: 5px 10px; border-radius: 8px; }
.note-inline { flex: 1 1 260px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.note-inline .pill-st { flex: none; }
.note-inline .note-in { flex: 1; min-width: 0; min-height: 30px; height: 30px; padding: 4px 10px; font-size: 12.5px; border-radius: 8px; }
/* Lịch hẹn: chọn tháng + dải ngày */
.month-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.month-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 13px; }
.month-chip b { font-weight: 700; }
.month-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.month-chip.on .tab-n { background: rgba(255,255,255,.25); color: #fff; }
.input.month-sel { width: auto; flex: none; min-height: 34px; padding: 4px 10px; font-size: 13px; border-radius: 999px; }
.bk-day { display: flex; align-items: center; gap: 8px; padding: 9px 16px; background: var(--brand-weak); border-top: 1px solid var(--line); }
.bk-day-date { font-weight: 800; font-size: 14.5px; color: var(--brand); }
.bk-day-rel { font-size: 11.5px; font-weight: 700; color: #fff; background: var(--brand); padding: 1px 8px; border-radius: 999px; }
/* Hôm nay cũng dùng màu xanh biển như các ngày khác (chỉ khác nhãn "Hôm nay") */
.ctv-day .bk-day { border: 1px solid var(--line); border-radius: 12px; }
.bk-day-n { margin-left: auto; font-size: 12px; color: var(--muted); }
/* Điện thoại: mọi khối thẳng một lề trái (thẳng với số điện thoại khách) */
@media (max-width: 699px) {
  .bk-row { gap: 12px; padding: 14px; }
  .bk-col.rooms, .bk-col.ctv, .bk-col.acts { padding-left: 26px; }
  .bk-col.rooms { border-top: 1px dashed var(--line); padding-top: 10px; }
  .rm { display: grid; grid-template-columns: 44px minmax(0, 1fr) 30px; column-gap: 10px; row-gap: 4px; align-items: center; }
  .rm .rm-info { display: contents; }
  .rm .rm-thumb { grid-column: 1; grid-row: 1; width: 44px; height: 44px; }
  .rm .rm-line { grid-column: 2; grid-row: 1; }
  .rm .rm-copy { grid-column: 3; grid-row: 1; align-self: start; }
  .rm .rm-code-full, .rm .rm-tools { grid-column: 1 / -1; margin-top: 0; }
  /* Thu nhỏ 1/3: giờ hẹn, ảnh + địa chỉ; giá cùng cỡ với địa chỉ */
  .rm { grid-template-columns: 30px minmax(0, 1fr) 30px; }
  .rm .rm-thumb { width: 30px; height: 30px; border-radius: 7px; }
  .rm .rm-line .rm-addr { font-size: 10px; line-height: 1.3; }
  .rm .rm-line .rm-price { font-size: 10px; padding: 1px 6px; }
  .bk-row .bk-time { font-size: 8.5px; gap: 3px; }
  .bk-row .bk-time svg { width: 9px; height: 9px; }
  .bk-row .rm-tools .input { flex: 1; min-width: 0; max-width: 170px; height: 28px; min-height: 28px; font-size: 13px; }
  .bk-row .rm-tools .mini-btn { height: 28px; padding: 0 12px; font-size: 12px; }
  .bk-row .rm-tools .prev-guide { flex-basis: 100%; margin-left: 0; font-size: 11.5px; }
  .bk-col.acts { align-items: flex-start; }
  .bk-row .act-row { justify-content: flex-start; gap: 6px; }
  .bk-row .act-row .act-btn { flex: none; padding: 6px 10px; font-size: 10.5px; }
  .bk-row .act-pay { flex: none; padding: 0; border: 0; background: none; }
}
@media (min-width: 700px) and (max-width: 1299px) {
  .bk-row { grid-template-columns: 1fr 1.2fr; }
  .bk-col.ctv, .bk-col.pay { grid-column: auto; }
  .bk-col.acts { grid-column: 1 / -1; }
}
/* Hộp lịch hẹn: mỗi phòng một hàng, cột theo thứ tự tin gửi chủ */
.bk-grid {
  display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  grid-template-columns: minmax(170px, 2.2fr) max-content max-content minmax(120px, 1.3fr) minmax(150px, 1.8fr) minmax(170px, 1.9fr);
}
.bk-gh { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--chip); padding: 6px 10px; }
.bk-c { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); min-width: 0; }
.bk-v { flex: 1; min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.bk-c.addr .bk-v { font-weight: 700; font-size: 14.5px; }
.bk-c.nowrap .bk-v { white-space: nowrap; overflow-wrap: normal; }
.bk-c.code .bk-v { font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.bk-copy { flex: none; width: 26px; height: 26px; border: 0; border-radius: 7px; background: var(--brand-weak); color: var(--brand); display: grid; place-items: center; cursor: pointer; }
.bk-copy svg { width: 14px; height: 14px; }
.bk-copy:active { transform: scale(.92); }
.bk-l { display: none; }
.bk-guide { flex-direction: column; align-items: stretch; gap: 3px; }
.bk-guide .input { min-height: 34px; padding: 6px 8px; font-size: 13.5px; border-radius: 9px; }
.bk-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bk-actions .btn { flex: 1; min-height: 34px; padding: 0 8px; font-size: 13px; }
@media (max-width: 899px) {
  .bk-grid { grid-template-columns: 1fr 1fr; }
  .bk-gh { display: none; }
  .bk-c { flex-wrap: wrap; row-gap: 2px; }
  .bk-l { display: block; width: 100%; font-size: 11px; color: var(--muted); }
  .bk-c.addr, .bk-c.code, .bk-guide { grid-column: 1 / -1; }
  .bk-actions .btn { flex: 1 1 30%; }
}
.bk-rooms { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .bk-rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bk-room { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.bk-addr { display: flex; align-items: flex-start; gap: 6px; font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.3; }
.bk-addr svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 1px; }
.prev-guide { font-size: 11.5px; color: var(--muted); padding: 0 2px; }
.prev-guide .link-btn { color: var(--brand); font-weight: 600; margin-left: 4px; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 4px 10px; font-size: 14px; }
.kv > span:nth-child(odd) { color: var(--muted); }
.alert { border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.alert.warn { background: var(--warn-weak); color: var(--warn); }
.alert.bad { background: var(--bad-weak); color: var(--bad); }
.alert.ok { background: var(--ok-weak); color: var(--ok); }
.alert.info { background: var(--info-weak); color: var(--info); }

/* ---------- Thống kê ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.stat b { font-size: 22px; }
.stat b small { font-size: 14px; font-weight: 600; opacity: .55; }
.stat span { font-size: 12.5px; color: var(--muted); }
.stat.ok b { color: var(--ok); }
.stat.ok-soft { border-left-color: var(--ok); background: var(--ok-weak); }
.stat.ok-soft b { color: var(--ok); }
.bad-text { color: var(--bad); font-weight: 700; }
.recruit-line { color: var(--text); }
.recruit-line b { color: var(--brand); }
.room-view-bar { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; flex-wrap: wrap; }
.room-view-bar .ref-bar { margin-left: auto; min-height: 28px; padding: 3px 3px 3px 9px; font-size: 11.5px; max-width: 45%; }
.room-view-bar .ref-zalo { width: 24px; height: 24px; padding: 0; border-radius: 50%; justify-content: center; }
.room-view-bar .seg button { padding: 7px 9px; }
.seg { display: flex; background: var(--chip); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 7px 12px; font: 600 13px inherit; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--brand); box-shadow: var(--shadow); }
.seg button.rented.on { color: #e8743b; background: #fff; box-shadow: var(--shadow); } /* nền trắng, chữ cam */
.seg svg { width: 15px; height: 15px; }
/* Điện thoại, trang bản đồ: thu nhỏ hàng Trống / Đã thuê và khoảng cách trên dưới cho bản đồ rộng hơn */
@media (max-width: 899px) {
  .home.map-fixed { padding-top: 2px; gap: 4px; }
  .home.map-fixed .home-tools { gap: 4px; padding-top: 2px; padding-bottom: 0; }
  .home.map-fixed .search { min-height: 39px; border-radius: 14px; }
  .home.map-fixed .search input { min-height: 37px; font-size: 12.5px; }
  .home.map-fixed .search .view-btn { padding: 5px 11px; font-size: 12.5px; }
  .home.map-fixed .search svg { width: 18px; height: 18px; }
  .home.map-fixed .chips-wrap .chip { padding: 3px 8px; font-size: 11.5px; }
  .home.map-fixed .room-view-bar { margin: 0; }
  .home.map-fixed .seg { padding: 2px; }
  .home.map-fixed .seg button { padding: 4px 10px; font-size: 12px; gap: 4px; }
  .home.map-fixed .seg svg { width: 13px; height: 13px; }
  .home.map-fixed .room-view-bar .ref-bar { min-height: 24px; }
}
.maplist { margin-left: auto; display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.maplist .view-btn { background: var(--brand-weak); font-size: 12.5px; padding: 6px 10px; }
/* Báo cáo: phễu chuyển đổi + biểu đồ thanh ngang */
.funnel { display: flex; flex-direction: column; gap: 7px; }
.funnel-row { display: grid; grid-template-columns: 100px 1fr 40px; gap: 8px; align-items: center; font-size: 13px; }
.funnel-bar, .bar-track { height: 12px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.funnel-bar i, .bar-track i { display: block; height: 100%; border-radius: 999px; }
.funnel-row b, .bar-row b { text-align: right; font-size: 13px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 759px) { .chart-grid { grid-template-columns: 1fr; } }
.report-months { margin-bottom: 2px; }
table.matrix { font-size: 13px; }
table.matrix th.num, table.matrix td.num { position: relative; min-width: 74px; text-align: right; white-space: nowrap; }
table.matrix th.sel, table.matrix td.sel { background: var(--brand-weak); color: var(--brand); }
table.matrix td.num b { position: relative; z-index: 1; }
table.matrix .cell-bar { position: absolute; left: 0; bottom: 3px; height: 4px; width: var(--w); background: var(--c); opacity: .35; border-radius: 999px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 30px; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 6px; }
.bar-track i { background: var(--grad-brand); }
/* Trang Lương trên điện thoại: 4 ô tổng + nút duyệt tất cả nhỏ đi 1/4 */
@media (max-width: 759px) {
  .pay-stats { gap: 8px; }
  .pay-stats .stat { padding: 9px; }
  .pay-stats .stat b { font-size: 16.5px; }
  .pay-stats .stat span { font-size: 9.5px; }
  .btn.pay-bulk { min-height: 33px; font-size: 11px; padding: 0 12px; }
}
.stat { border-left: 4px solid var(--brand); }
.stat b { color: var(--brand); }
.stat.warn { border-left-color: var(--warn); background: var(--warn-weak); }
.stat.warn b { color: var(--warn); }
.stat.bad { border-left-color: var(--bad); background: var(--bad-weak); }
.stat.bad b { color: var(--bad); }
.progress > div { background: var(--grad-brand); }
.progress { height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); border-radius: 4px; }

/* ---------- Bảng ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; background: var(--card); }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--chip); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pct-input { width: 64px; min-height: 36px; padding: 6px 8px; text-align: right; }

/* ---------- Menu ---------- */
.menu { display: flex; flex-direction: column; }
.menu a, .menu button {
  display: flex; align-items: center; gap: 12px; padding: 14px 4px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--text); font-weight: 500; cursor: pointer; text-align: left; width: 100%;
}
.menu a:last-child, .menu button:last-child { border-bottom: 0; }
.menu svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.menu .grow { flex: 1; }

/* ---------- Bảng trượt ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(10, 15, 25, .45); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-back.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  background: var(--card); border-radius: 18px 18px 0 0; max-height: 88vh; overflow-y: auto;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .22s ease;
}
.sheet.on { transform: translateY(0); }
.sheet { visibility: hidden; transition: transform .22s ease, visibility .22s; }
.sheet.on { visibility: visible; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
.sheet h2 { margin-bottom: 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav) + 84px); transform: translateX(-50%) translateY(20px);
  background: #111827; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 80;
  opacity: 0; pointer-events: none; transition: all .2s; max-width: 90vw; text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Viên thông báo cho khách ở cuối trang tìm phòng */
.notice-pill {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav) + 14px + env(safe-area-inset-bottom)); z-index: 50; /* dưới khung bật lên (sheet z 60+) */
  display: flex; align-items: center; background: var(--card); border-radius: 999px; box-shadow: 0 6px 20px rgba(16, 24, 40, .18);
  max-width: calc(100vw - 32px); border: 1px solid var(--line);
}
.np-main { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 10px 6px 10px 16px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.np-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; flex: none; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: npPulse 1.8s infinite; }
@keyframes npPulse { 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.np-x { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 50%; color: var(--muted); font-size: 18px; cursor: pointer; flex: none; margin-right: 4px; }
@media (min-width: 900px) { .notice-pill { left: calc(50% + 105px); bottom: 22px; } }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.sel-bar { position: sticky; bottom: calc(var(--nav) + 8px); z-index: 20; }

/* ---------- Màn hình rộng ---------- */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .nav {
    top: var(--top); bottom: 0; right: auto; width: 210px; height: auto;
    flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 12px 10px; gap: 2px; overflow-y: auto;
  }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
  .nav a.on { background: var(--brand-weak); }
  .nav a svg, .nav a.on svg { padding: 0; background: none; }
  .nav a .dot { position: static; margin-left: auto; }
  .nav .desk-only { display: flex; }
  .nav .mob-only { display: none; }
  .app { margin-left: 210px; max-width: none; }
  .page { max-width: 1280px; padding: 22px 28px; }
  .home { padding: 16px 20px; }
  .home-tools { margin: -16px -20px 0; padding: 16px 20px 12px; }
  .seg { display: flex; } /* Trống / Đã thuê hiện cả trên máy tính */
  /* Máy tính: bản đồ lớn + khung bên phải (như TinMap), hoặc danh sách toàn màn hình */
  .split.desk-map { display: grid; grid-template-columns: minmax(0, 1fr) clamp(380px, 27vw, 500px); gap: 12px; align-items: start; }
  /* Trang bản đồ: ẩn thanh menu trái cho bản đồ rộng; nút ☰ trên đầu trang mở lại */
  body.nav-off .nav { display: none; }
  body.nav-off .app { margin-left: 0; }
  body.map-home .nav-toggle { display: inline-flex; }
  .split.desk-map .list { display: none; }
  .split.desk-map .map-wrap { display: block; }
  .split.desk-map #map, .side-panel { height: calc(100vh - var(--top) - 140px); }
  /* PC: gom ô tìm kiếm, nút lịch sử, Trống / Đã thuê lại gọn (3 hàng thấp, Trống / Đã thuê nằm dưới lịch sử tìm kiếm) để bản đồ rộng hơn */
  .home { padding: 8px 20px 10px; gap: 6px; }
  .home-tools { margin: -8px -20px 0; padding: 8px 20px 4px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px; align-items: center; }
  .home-tools .search-wrap { grid-column: 1 / -1; }
  .home-tools .search { min-height: 38px; }
  .home-tools .search input { min-height: 36px; font-size: 14px; }
  .home-tools .chips-wrap { grid-column: 1 / -1; min-width: 0; }
  .home-tools .room-view-bar { grid-column: 1 / -1; margin: 0; flex-wrap: nowrap; justify-content: flex-start; }
  .home-tools .room-view-bar .ref-bar { max-width: none; }
  .home-tools .chips-wrap .chip { padding: 3px 10px; font-size: 12px; }
  .home-tools .seg { padding: 2px; }
  .home-tools .seg button { padding: 4px 12px; font-size: 12.5px; }
  .home.map-fixed .split.desk-map .map-wrap { top: calc(var(--top) + 124px); }
  .home.map-fixed .split.desk-map #map, .home.map-fixed .split.desk-map .side-panel { height: calc(100vh - var(--top) - 136px); }
  .split.desk-list .map-wrap { display: none; }
  .split.desk-list .list { display: block; }
  .split.desk-list .cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail { max-width: 880px; padding-bottom: 100px; }
  .action-bar { left: 210px; bottom: 0; justify-content: center; }
  .action-bar .btn { flex: 0 1 200px; }
  .action-bar .btn.main-act { flex: 0 1 280px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .sheet { left: 50%; right: auto; width: 520px; transform: translate(-50%, 110%); bottom: 24px; border-radius: 18px; }
  .sheet.on { transform: translate(-50%, 0); }
  .toast { bottom: 40px; }
  .sel-bar { bottom: 12px; }
}
@media (min-width: 1300px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ===== Lịch hẹn Admin: thẻ tối giản ===== */
.st-dot.info { background: #378ADD; box-shadow: 0 0 0 3px rgba(55,138,221,.18); }
.st-dot.brand { background: #F26A1F; box-shadow: 0 0 0 3px rgba(242,106,31,.18); }
.st-dot.muted { background: #888780; box-shadow: 0 0 0 3px rgba(136,135,128,.18); }
.bk-top { display: block; }
.bk-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.bk-sub .bk-name { color: var(--text); font-weight: 600; }
.bk-st { display: inline-flex; align-items: center; gap: 5px; }
.bk-st .st-dot { margin: 0; width: 7px; height: 7px; box-shadow: none; }
.src-tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.src-tag.self { background: #E7F0FF; color: #1F6FEB; }
.src-tag.ctv { background: #F3E8FF; color: #7e22ce; }
:root[data-theme="dark"] .src-tag.self { background: #1b315a; color: #8fb6ff; }
:root[data-theme="dark"] .src-tag.ctv { background: #3b1d5c; color: #d8b4fe; }
.bk-warn { color: var(--bad); font-weight: 600; }
.bk-dup { color: #b45309; }
.ctv-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.ctv-line .ico-user svg { width: 14px; height: 14px; vertical-align: -2px; }
.ctv-line { flex-wrap: nowrap; }
.ctv-line .ico-user, .ctv-line .ctv-id, .ctv-line a { flex: none; white-space: nowrap; }
.ctv-line .ctv-name { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.ctv-line a { color: var(--brand); display: inline-flex; }
.guide-go { display: none; }
@media (max-width: 699px) {
  .bk-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .bk-row .bk-time { font-size: 12px; color: var(--muted); font-weight: 500; }
  .bk-row .bk-time svg { width: 13px !important; height: 13px !important; }
  .bk-row .bk-phone { font-size: 16px; }
  .bk-row { grid-template-columns: minmax(0, 1fr) minmax(0, auto); grid-template-areas: "cust cust" "rooms rooms" "ctv acts"; align-items: center; row-gap: 8px; }
  .bk-row .bk-col.cust { grid-area: cust; }
  .bk-row .bk-col.rooms { grid-area: rooms; padding-left: 0; }
  .bk-row .rm:not(.rm-chot) { padding-left: 0; border-left: 0; }
  .bk-row .bk-col.ctv { grid-area: ctv; padding-left: 0; min-width: 0; }
  .bk-row .bk-col.acts { grid-area: acts; padding-left: 0; align-items: flex-end; }
  .bk-row .act-btn.red { background: none; border: 0; box-shadow: none; padding: 0; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--bad); text-transform: none; }
  .bk-row .rm-tools .guide-go-off { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: #1F6FEB; color: #fff; box-shadow: 0 3px 10px rgba(31, 111, 235, .25); font-size: 12px; font-weight: 700; cursor: pointer; flex: none; }
  .bk-row .rm-tools .input { flex: 0 1 190px; width: 190px; max-width: 100%; height: 30px; min-height: 30px; font-size: 12.5px; padding: 2px 9px; }
  .bk-col.ctv .pill-st { font-size: 10px; }
  .bk-row.need .ctv-line .ctv-id { display: none; }
  .bk-row.deposit { grid-template-areas: "cust cust" "rooms rooms" "ctv ctv" "acts acts"; }
  .bk-row.deposit .bk-col.acts { align-items: flex-start; }
  .bk-row.deposit .act-row { justify-content: flex-start; width: 100%; }
  .bk-row.deposit .act-box { white-space: normal; }
  .bk-row .bk-col.ctv .ctv-name { max-width: 100%; }
}
/* Nút xếp danh sách theo giá (cạnh dòng "N phòng · …") */
.result-bar > span:first-child { min-width: 0; flex: 1; }
.sort-btns { display: inline-flex; gap: 6px; flex: none; }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sort-btn svg { width: 13px; height: 13px; }
.sort-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.sort-btn em { font-style: normal; }
@media (max-width: 560px) { .result-bar { align-items: flex-start; } .sort-btn { padding: 0; width: 30px; height: 30px; justify-content: center; } .sort-btn em { display: none; } .sort-btn svg { width: 15px; height: 15px; } }
/* Trang Phòng (Admin): hàng nút Hết / Làm mới / Sửa nhỏ lại 15% */
.rm-acts { gap: 7px; }
.rm-acts > .btn.sm { min-height: 31px; padding: 0 10px; font-size: 11.5px; border-radius: 9px; }
/* Thưởng thâm niên: 12 ô tháng */
.ly-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.ly-m { text-align: center; font-size: 11px; font-weight: 600; padding: 5px 0; border-radius: 6px; background: var(--chip); color: var(--muted); }
.ly-m.ok { background: #E3F4E8; color: #1b7a3a; }
.ly-m.miss { background: #FDE8E8; color: #c0392b; }
.ly-m.pend { background: #FFF6E5; color: #b45309; }
:root[data-theme="dark"] .ly-m.ok { background: #1e3a2a; color: #7ee2a0; }
:root[data-theme="dark"] .ly-m.miss { background: #4a1f1f; color: #ff9a9a; }
:root[data-theme="dark"] .ly-m.pend { background: #3a2b10; color: #f5c26b; }
.logo-img { width: 36px; height: 36px; object-fit: contain; flex: none; }

/* Chữ logo: 3M xanh, HOME cam (gradient giống logo) */
.logo-text { display: inline-flex; gap: 5px; font-size: 19px; font-weight: 800; letter-spacing: .2px; line-height: 1; }
.logo-text b { font-weight: 800; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.lt-blue { background-image: linear-gradient(180deg, #1ec0ff 0%, #0a4fc0 100%); }
.lt-orange { background-image: linear-gradient(180deg, #ffcf1f 0%, #ff5a0a 100%); }
.logo-text { gap: 2px; font-family: 'Russo One', 'Be Vietnam Pro', sans-serif; font-weight: 400; font-size: 21px; letter-spacing: .3px; }
.logo-text b { font-weight: 400; }

/* Phòng gần đây: giá xanh nổi bật, khoảng cách hiện rõ ở bên phải */
.near-row { padding: 8px; gap: 10px; align-items: center; }
.near-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.near-price { font-size: 17px; font-weight: 800; color: #1F6FEB; line-height: 1.15; }
.near-price small { font-size: 11.5px; font-weight: 600; margin-left: 2px; }
.near-type { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.near-addr { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.near-dist { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 62px; padding: 6px 8px; border-radius: 12px; background: #FFF0E6; color: #E85A0C; line-height: 1.1; }
.near-dist small { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.near-dist b { font-size: 16px; font-weight: 800; white-space: nowrap; }
:root[data-theme="dark"] .near-dist { background: #3d2414; color: #ffb27a; }

/* Khoảng cách: một dòng, cùng hàng với giá, nằm sát bên phải */
.near-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.near-dist { min-width: 0; padding: 0; border-radius: 0; background: none; flex-direction: row; display: block; font-size: 11.2px; font-weight: 800; color: var(--muted); white-space: nowrap; text-transform: none; letter-spacing: 0; }
:root[data-theme="dark"] .near-dist { background: none; color: var(--muted); }

/* Trang tài khoản CTV: chữ nhỏ hơn 10%, các khối sát nhau hơn */
.ctv-acc { gap: 9px; }
.ctv-acc > .card, .ctv-acc > .alert { padding: 11px 13px; gap: 7px; }
.ctv-acc h1 { font-size: 90%; }
.ctv-acc b { font-size: 90%; }
.ctv-acc .small, .ctv-acc .tiny { font-size: 11.7px; }
.ctv-acc .fact { padding: 8px 10px; }
.ctv-acc .fact b { font-size: 14px; }
.ctv-acc .fact span { font-size: 11.5px; }
.ctv-acc .btn.sm { min-height: 31px; padding: 0 11px; font-size: 12.3px; border-radius: 9px; }
.ctv-acc .progress { height: 7px; }
.ctv-acc .prog-in { gap: 6px; }
.ctv-acc > .card .divider { margin: 2px 0; }

/* Hướng dẫn dùng web (CTV): bấm để mở / gập */
.ctv-guide > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; color: var(--brand); }
.ctv-guide > summary::-webkit-details-marker { display: none; }
.ctv-guide > summary::after { content: '›'; margin-left: auto; font-size: 18px; transition: transform .15s; }
.ctv-guide[open] > summary::after { transform: rotate(90deg); }
.gd-ic { display: inline-flex; } .gd-ic svg { width: 17px; height: 17px; }
.gd-list { display: grid; gap: 4px; margin-top: 8px; }
.gd-item { border-top: 1px solid var(--line); padding: 7px 0 2px; }
.gd-item > summary { cursor: pointer; font-weight: 600; font-size: 13px; padding-bottom: 5px; }
.gd-body { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.gd-body ul { margin: 0; padding-left: 17px; display: grid; gap: 4px; }
.gd-body b { color: var(--text); }

/* Máy tính: nút ☰ hiện số phòng đã chọn và nháy khi vừa chọn phòng (menu trái đang ẩn ở trang bản đồ) */
.nav-toggle { position: relative; }
.nav-badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #F26A1F; color: #fff; font-size: 11.5px; font-weight: 800; line-height: 19px; text-align: center; box-shadow: 0 2px 6px rgba(242, 106, 31, .5); }
.nav-badge[hidden] { display: none; }
.nav-toggle.nav-pulse { animation: navPulse .8s ease-in-out 4; border-radius: 14px; color: #F26A1F; }
.nav-toggle.nav-pulse .nav-badge { animation: badgeBlink .8s ease-in-out 4; }
@keyframes badgeBlink { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }

/* Thẻ "Tư vấn viên của bạn" (lịch của khách): chỉ chữ tên tư vấn viên nhỏ lại 40%, các phần khác giữ nguyên */
.consultant { zoom: 0.7; }
/* Màn hình sau khi CTV đăng ký xong */
.reg-ok { text-align: center; padding: 26px 18px; }
.reg-ok h2 { font-size: 24px; margin: 10px 0 6px; }
.reg-ok p { color: var(--muted); margin: 0; }
.reg-tick { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 30px; color: #1F6FEB; background: #E3EEFF; }
.reg-notes { background: var(--bg-soft, #EEF2F6); }
.reg-notes h3 { margin: 0 0 8px; font-size: 16px; }
.reg-notes ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); line-height: 1.5; }
.reg-done .btn.block { margin-top: 12px; }
:root[data-theme="dark"] .reg-tick { background: #14284a; color: #7db2ff; }
.warn-text { color: #C2570C; font-weight: 700; }
:root[data-theme="dark"] .warn-text { color: #ffb27a; }

.f2-zalo { flex: none; min-height: 0; height: 24px; padding: 0 10px; font-size: 12px; font-weight: 700; border-radius: 999px; gap: 4px; }
.f2-zalo svg { width: 13px; height: 13px; }

.btn.f2-zalo { min-height: 0 !important; height: 22px !important; padding: 0 9px !important; font-size: 11.5px !important; line-height: 1; }

/* Khung thông tin phòng cạnh bản đồ: thưa ra cho dễ đọc, có nút lướt ảnh */
.sp-gallery + .sp-body { gap: 16px; padding: 16px 18px 22px; }
.sp-gallery + .sp-body > .small.muted { line-height: 1.55; }
.sp-gallery + .sp-body .sp-line { line-height: 1.5; gap: 12px; }
.sp-gallery + .sp-body .list-plain { gap: 14px; padding-left: 20px; font-size: 14.5px; line-height: 1.6; }
.sp-gallery .gal-nav { opacity: 1; }
/* Thẻ phòng trong danh sách: mã nguồn nằm dưới tiêu đề (không đè lên ảnh) */
.room-card .tw { min-height: calc(2.9em + 22px); display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.room-card .tw .title { min-height: 0; }
.src-chip { background: var(--grad-brand); color: #fff; font-weight: 700; font-size: 9px; line-height: 1; padding: 3px 6px; border-radius: 5px; text-transform: uppercase; letter-spacing: .2px; }
@media (max-width: 899px) { .room-card .tw { min-height: 0; } .src-chip { font-size: 8px; padding: 2px 5px; } }
/* Thẻ phòng trong danh sách: nút ‹ › đổi ảnh hai bên */
.room-card .thumb { position: relative; }
.cp-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.92); color: #111; font-size: 21px; font-weight: 800; line-height: 1; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); user-select: none; padding-bottom: 2px; }
.cp-nav.prev { left: 7px; } .cp-nav.next { right: 7px; }
@media (hover: hover) { .cp-nav { opacity: 0; transition: opacity .15s; } .room-card:hover .cp-nav { opacity: 1; } }
@media (max-width: 899px) { .cp-nav { width: 26px; height: 26px; font-size: 18px; } }
/* Mã nguồn dạng chữ thường (không nền); giá thẻ danh sách màu cam, giá trang chi tiết màu xanh */
.src-chip, .room-card .src-chip { background: none; color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-weight: 600; font-size: 12px; line-height: 1.2; padding: 0; border-radius: 0; text-transform: none; letter-spacing: 0; }
@media (max-width: 899px) { .src-chip, .room-card .src-chip { font-size: 11px; padding: 0; } }
.room-card .price { color: var(--band); }
.price-big { color: #1F6FEB; }
:root[data-theme="dark"] .price-big { color: #3B82F6; }
/* Ghim vị trí trên bản đồ nhỏ của trang phòng: màu cam */
.ngo-pin { background: var(--accent); box-shadow: 0 4px 12px rgba(242, 106, 31, .4); }
.ngo-pin::after { border-top-color: var(--accent); }
/* Mã đầy đủ của phòng, không cắt bớt */
.src-chip, .room-card .src-chip { word-break: break-all; max-width: 100%; }
/* Bỏ khoảng trống giữa mã và dòng quận: dòng quận lên sát mã */
.room-card .tw { min-height: 0; }
/* Dòng gợi ý trong khối tư vấn viên: nổi hơn chữ xám cũ nhưng vẫn nhỏ hơn tên tư vấn viên */
.consultant .consultant-hint { font-size: 13px; font-weight: 700; color: var(--brand); line-height: 1.35; }
/* Lương: khối công cụ trên cùng gọn lại để có nhiều chỗ xem danh sách lương */
.pay-tools { gap: 6px; padding-top: 4px; padding-bottom: 4px; }
.pay-tools .page-head { margin: 0; gap: 8px; flex-wrap: nowrap; }
.pay-tools .page-head h1 { font-size: 17px; margin: 0; white-space: nowrap; }
.pay-tools .page-head .row { gap: 6px; flex-wrap: nowrap; }
.pay-tools .btn.sm { min-height: 26px; height: 26px; padding: 0 9px; font-size: 12px; border-radius: 999px; }
.pay-tools .btn.sm svg { width: 13px; height: 13px; }
.pay-tools .month-bar { gap: 6px; }
.pay-tools .month-chip { padding: 3px 9px; font-size: 12px; gap: 4px; }
.pay-tools .month-chip .tab-n { font-size: 10.5px; padding: 0 5px; min-width: 0; }
.pay-tools .month-sel { height: 26px; min-height: 0; padding: 0 8px; font-size: 12px; width: auto; }
.pay-tools .chips { gap: 5px; }
.pay-tools .chip { padding: 3px 9px; font-size: 12px; min-height: 0; height: auto; }
.pay-tools .row.small { font-size: 12px; }
/* iPhone / Zalo: ô nhập chữ nhỏ hơn 16px làm trình duyệt tự phóng to trang khi chạm vào (trang bị lệch, mất nút), nên ép 16px trên iOS */
@supports (-webkit-touch-callout: none) {
  input, select, textarea { font-size: 16px !important; }
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Ô tìm kiếm: dòng gợi ý chạy (chữ trượt lên lần lượt), tự ẩn khi khách chạm vào ô hoặc đã gõ chữ */
.search .ph-wrap { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.search .ph-wrap input { width: 100%; }
.ph-rot { position: absolute; left: 0; right: 0; top: 50%; margin-top: -0.7em; line-height: 1.4; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 14px; transition: transform .26s ease, opacity .26s ease; }
.ph-rot.out { transform: translateY(-70%); opacity: 0; }
.ph-rot.pre { transition: none; transform: translateY(70%); opacity: 0; }
.ph-wrap.ph-off .ph-rot { display: none; }
.ph-wrap:not(.ph-off) input::placeholder { color: transparent; }
.home.map-fixed .ph-rot, .home-tools .ph-rot { font-size: 13.5px; }
@media (prefers-reduced-motion: reduce) { .ph-rot { transition: none; } }

/* Máy tính và điện thoại giống nhau: bỏ hàng nút gợi ý, ô tìm kiếm chỉ còn chữ cố định. Dòng chữ nghiêng ngay dưới ô cứ 3 giây đổi một câu:
   bấm vào chữ là tìm luôn câu đó, bấm nút › mở bảng tất cả các câu gợi ý */
.ph-line { display: none; }
@media all {
  .ph-rot { display: none; }
  .ph-wrap:not(.ph-off) input::placeholder { color: var(--muted); }
  .home-tools .chips-wrap { display: none; }
  .ph-line { display: flex; align-items: center; gap: 6px; width: 100%; height: 26px; margin: 3px 0 0; padding: 0 12px; color: var(--muted); font-size: 13px; font-style: italic; overflow: hidden; }
  /* dòng gợi ý luôn hiện, kể cả khi đang gõ chữ, để khung trang không đổi */
  .ph-line .pl-main { display: flex; align-items: center; gap: 5px; min-width: 0; flex: 0 1 auto; border: 0; background: none; padding: 0; font: inherit; font-style: italic; color: inherit; text-align: left; cursor: pointer; overflow: hidden; white-space: nowrap; }
  .ph-line .t { color: var(--brand); font-weight: 700; font-style: italic; display: inline-block; overflow: hidden; text-overflow: ellipsis; min-width: 0; transition: transform .26s ease, opacity .26s ease; }
  /* nút Danh sách / Bản đồ nằm ở góc phải dòng gợi ý, nhường chỗ cho ô tìm kiếm rộng hơn */
  .ph-line .view-btn { margin-left: auto; padding: 3px 11px; font-size: 12.5px; font-style: normal; }
  .ph-line { height: 30px; padding-right: 4px; }
  .ph-line .t.out { transform: translateY(-70%); opacity: 0; }
  .ph-line .t.pre { transition: none; transform: translateY(70%); opacity: 0; }
  .ph-line .go { flex: none; width: 26px; height: 22px; border: 0; border-radius: 999px; background: var(--brand-weak); color: var(--brand); font-size: 17px; font-weight: 800; font-style: normal; line-height: 1; padding: 0 0 2px; cursor: pointer; display: grid; place-items: center; }
}
/* Bảng tất cả câu gợi ý tìm kiếm */
.tip-list { gap: 8px; margin-top: 8px; }
.tip-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-radius: 12px; background: var(--chip); color: var(--text); padding: 12px 14px; font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
.tip-row svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
/* Dòng gợi ý nghiêng: chữ câu gợi ý màu xanh nhạt */
@media all {
  .ph-line .t { color: #5C9DF2; font-weight: 600; }
  :root[data-theme="dark"] .ph-line .t { color: #8fbcff; }
}

/* Điện thoại, trang bản đồ cố định: không cho cả trang cuộn (kéo bản đồ, bật bàn phím, thanh địa chỉ co giãn đều không làm trang bị dịch lên) */
html.map-lock, html.map-lock body { overflow: hidden; overscroll-behavior: none; }
/* Tìm có "xe điện" / "pet": phòng nhận thì có dấu tích, phòng chưa ghi thì có nút hỏi sale */
.soft-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 6px; }
.mc-body .soft-row, .sp-body .soft-row { padding: 2px 0 0; }
.soft-yes { font-size: 12px; font-weight: 700; color: var(--ok); }
.soft-ask { border: 0; border-radius: 999px; padding: 4px 10px; background: var(--accent-weak); color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; text-align: left; line-height: 1.25; }
/* Quản lý tuyển dụng: các ô nhóm CTV đã tuyển */
.rec-grp { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
/* Tin mời Quản lý tuyển dụng (xem trước khi chép) */
.invite-pre { margin: 0; white-space: pre-wrap; font: inherit; font-size: 13px; line-height: 1.5; max-height: 240px; overflow: auto; }
/* Thẻ Quản lý tuyển dụng: hai nút cùng hàng (CTV đã tuyển, Quản lý tài khoản) mở bảng bên dưới */
.rec-toggles { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pill-toggle { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--brand-weak); color: var(--brand); }
.pill-toggle.pill-acct { background: var(--chip); color: var(--muted); }
.pill-toggle.on { background: var(--brand); color: #fff; }
.rec-panel[hidden] { display: none; }
/* Video trong thư viện ảnh phòng */
.slide-video { background: #000; display: flex; align-items: center; justify-content: center; }
.slide-video video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.vid-thumb { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: #111; color: #fff; font-size: 24px; }
.vid-thumb small { font-size: 11px; opacity: .8; }
/* Danh sách phòng của Admin: bấm vào phòng để sửa, cảnh báo trùng / chưa ảnh */
.rm-link { color: inherit; text-decoration: none; cursor: pointer; }
.rm-link:hover { opacity: .92; }
.rm-warn { font-size: 13px; line-height: 1.4; padding: 8px 10px; border-radius: 10px; background: #fff7e0; color: #8a5a00; border: 1px solid #f2d48a; }
.rm-warn a { color: inherit; font-weight: 600; text-decoration: underline; word-break: break-all; }
:root[data-theme="dark"] .rm-warn { background: #3a2f12; color: #f3d68c; border-color: #6b5420; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rm-warn { background: #3a2f12; color: #f3d68c; border-color: #6b5420; } }
/* PC: khung chi tiết phòng bên phải bản đồ rộng hơn, ảnh thấp lại để thấy đủ thông tin mà không phải kéo thanh cuộn */
@media (min-width: 900px) {
  .side-panel .sp-gallery .slide { aspect-ratio: 16 / 9; max-height: 28vh; }
  .side-panel .sp-gallery + .sp-body { gap: 10px; padding: 14px 18px 16px; }
  .side-panel .sp-gallery + .sp-body h2 { font-size: 18px; line-height: 1.3; margin: 0; }
  .side-panel .sp-gallery + .sp-body .list-plain { gap: 6px; line-height: 1.45; font-size: 14px; }
  .side-panel .sp-gallery + .sp-body .sp-line { gap: 10px; line-height: 1.45; }
}
/* Bộ lọc phòng mới đăng từ ngày */
.since-bar { display: flex; align-items: center; flex-wrap: nowrap; gap: 5px; padding: 2px 0 0; overflow-x: auto; scrollbar-width: none; } /* 1 dòng, tràn thì vuốt ngang */
.since-bar::-webkit-scrollbar { display: none; }
.since-bar > * { flex: none; }
.since-lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.since-bar .chip { padding: 3px 7px; font-size: 12px; }
.since-date { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.since-date input { font: inherit; font-size: 12px; padding: 3px 2px; width: 98px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); min-height: 28px; }
.since-x { color: #c0392b; }