/* =====================================================================
   Núi Cúi · Điều hành — giao diện theo bộ nhận diện (css/theme.css, biến --nc-*).
   Tệp này (1) đặt tên ngắn cho các biến của bộ nhận diện, (2) thêm màu tình trạng phòng và mục đích nhà nguyện
   lấy cùng họ màu (đỏ chỉ có nghĩa "có khách", xanh trời, vàng mão…), (3) kiểu dáng các thành phần của app.
   Không viết mã màu rời trong thành phần. Giao diện tối: js/theme.js đặt data-theme="dark" lên <html>.
   ===================================================================== */
:root {
  --bg: var(--nc-bg); --surface: var(--nc-surface); --surface-2: var(--nc-surface-2);
  --line: var(--nc-line); --line-2: color-mix(in srgb, var(--nc-line) 62%, var(--nc-muted));
  --ink: var(--nc-ink); --ink-2: color-mix(in srgb, var(--nc-ink) 82%, var(--nc-muted)); --muted: var(--nc-muted);
  --brand: var(--nc-brand); --brand-2: var(--nc-brand); --brand-soft: var(--nc-brand-soft); --on-brand: var(--nc-on-brand);
  --gold: var(--nc-gold); --gold-soft: var(--nc-gold-soft); --gold-ink: var(--nc-gold-ink); --on-gold: var(--nc-on-gold);
  --sky: var(--nc-sky); --sky-soft: var(--nc-sky-soft); --sky-ink: var(--nc-sky-ink); --on-sky: var(--nc-ink);
  --ok: var(--nc-green); --ok-soft: var(--nc-green-soft); --on-ok: var(--nc-on-green);
  --warn: var(--nc-gold-ink); --warn-soft: var(--nc-gold-soft);
  --bad: var(--nc-red); --bad-soft: var(--nc-red-soft); --bad-ink: var(--nc-red-ink); --on-bad: var(--nc-on-red);
  /* tình trạng phòng (dùng chung cho sơ đồ, ô phòng, chip, biểu đồ): Có khách đỏ, Chờ nhận phòng xanh trời, Trả phòng hôm nay vàng,
     Giữ chỗ nền xanh nhạt viền đứt, Đang sửa gạch chéo, Trống trung tính. Đã chạy bộ kiểm màu (mù màu), luôn kèm chữ. */
  --st-o: var(--nc-red); --st-o-line: var(--nc-red-edge); --on-st-o: var(--nc-on-red);
  --st-den: var(--nc-sky); --st-den-line: var(--nc-sky-ink); --on-st-den: var(--on-sky);
  --st-di: var(--nc-gold); --st-di-line: var(--nc-gold-ink); --on-st-di: var(--nc-on-gold);
  --st-hold: var(--nc-brand-soft); --st-hold-line: var(--nc-brand); --on-st-hold: var(--nc-ink);
  --st-free: var(--nc-room-fill); --st-free-line: var(--nc-room-stroke);
  --st-fix: var(--nc-surface-2); --st-fix-line: var(--nc-muted); --on-st-fix: var(--nc-muted);
  /* phòng dành riêng (không cho khách): xám đậm hơn phòng trống, khác hẳn mọi màu tình trạng; tự đổi theo sáng / tối */
  --st-rieng: color-mix(in srgb, var(--nc-muted) 38%, var(--nc-surface)); --st-rieng-line: var(--nc-muted); --on-st-rieng: var(--nc-ink);
  --hatch: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--nc-muted) 32%, transparent) 0 2px, transparent 2px 7px);
  /* mục đích dùng nhà nguyện: Dâng lễ vàng, Cầu nguyện xanh trời (như chip của bộ nhận diện), Sinh hoạt / họp / ăn uống xanh Núi Cúi, Khác xám */
  --p-mass: var(--nc-gold); --on-p-mass: var(--nc-on-gold);
  --p-pray: var(--nc-sky); --on-p-pray: var(--on-sky);
  --p-act: var(--nc-brand); --on-p-act: var(--nc-on-brand);
  --p-other: var(--nc-muted); --on-p-other: var(--nc-surface);
  --r: var(--nc-r-lg); --r-md: var(--nc-r-md); --r-lg: var(--nc-r-lg);
  --shadow: var(--nc-shadow-card); --shadow-lg: var(--nc-shadow-sheet);
  --on-photo: #fff; --viewer-bg: #05070c; /* chữ / nền đè lên ảnh: giữ nguyên ở cả hai giao diện */
  --photo-shade: rgba(8, 16, 30, .78); --photo-text-shadow: 0 1px 10px rgba(5, 10, 20, .55); /* lớp tối dưới chữ trắng trên ảnh tòa nhà (mái vòm trắng) */
  --top-h: 64px; --tab-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
/* Giao diện tối: cùng họ đỏ / xanh trời / vàng, chỉnh độ sáng để còn phân biệt được trên nền tối (đã chạy lại bộ kiểm màu với nền tối). */
[data-theme="dark"] {
  --on-sky: var(--nc-bg);
  --st-o: #cc322d; --st-o-line: var(--nc-red-ink); --on-st-o: var(--nc-ink);
  --st-den: #40a6db; --st-den-line: var(--nc-sky-ink);
  --st-di: #bf9731; --st-di-line: var(--nc-gold-ink);
  --p-mass: #bf9731; --p-pray: #40a6db; --p-act: #6a6fe6; --on-p-act: var(--nc-ink);
}

/* ---------- nền ---------- */
html { text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
body.noscroll { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 17px; line-height: 22px; font-weight: 700; }
h2 { font-size: 18px; line-height: 24px; font-weight: 700; }
h3 { font-size: 16px; line-height: 22px; font-weight: 600; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--nc-focus); outline-offset: 2px; border-radius: 8px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 20px; }
.center { text-align: center; }
.grow { flex: 1; }
.pre { white-space: pre-wrap; }
.dim { opacity: .55; }
.none { padding: 14px 2px; font-size: 15px; }
.offscreen { position: fixed; left: -9999px; top: 0; }
.danger-text { color: var(--bad-ink) !important; }
.warn { color: var(--warn); font-weight: 600; display: flex; align-items: center; gap: 6px; margin: 6px 0; font-size: 15px; }
.note { background: var(--gold-soft); color: var(--gold-ink); border-radius: var(--r-md); padding: 10px 12px; font-size: 15px; margin: 8px 0; }
.narrow { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.narrow > .sec { margin-top: 4px; }
[hidden] { display: none !important; }

/* ---------- khung: thanh trên (logo tròn + tiêu đề), thanh điều hướng dưới (tối đa 5 mục) ---------- */
#app { min-height: 100dvh; }
.page { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .back { margin-left: -8px; }
.top-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface); }
.top-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top-title h1 { font-size: 16px; line-height: 20px; overflow-wrap: anywhere; }
.top-title small { font-size: 12px; line-height: 16px; color: var(--muted); overflow-wrap: anywhere; }
.top-actions { display: flex; align-items: center; gap: 2px; }
.main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 12px 16px calc(var(--tab-h) + var(--safe-b) + 96px); }
.icon-btn { width: 48px; height: 48px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--ink-2); flex: none; }
.icon-btn:active { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.icon-btn:disabled { opacity: .3; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 16px; flex: none; }
.avatar.big { width: 56px; height: 56px; font-size: 22px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px 4px calc(6px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); }
.nav-item { display: grid; justify-items: center; align-content: start; gap: 2px; min-height: 54px; padding: 3px 2px 0; color: var(--muted); font: 600 12px/15px var(--nc-font); text-align: center; border-radius: var(--r-md); }
.nav-item .ic { width: 44px; height: 30px; padding: 3px 10px; border-radius: 12px; stroke-width: 1.9; transition: background .15s; }
.nav-item.on { color: var(--brand); }
.nav-item.on .ic { background: var(--brand-soft); stroke-width: 2.2; }
.sidenav { display: none; }

@media (min-width: 900px) {
  .tabbar { display: none; }
  .sidenav { display: flex; flex-direction: column; gap: 2px; position: fixed; inset: 0 auto 0 0; width: 240px; padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--line); z-index: 30; overflow-y: auto; }
  .page { margin-left: 240px; }
  .main { max-width: 1120px; padding: 12px 28px 60px; }
  .topbar { padding: 8px 20px 8px 28px; }
  .topbar .top-logo { display: none; }
  .brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
  .brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
  .brand strong { display: block; font: 700 22px/28px var(--nc-font-display); }
  .brand span { font-size: 13px; color: var(--muted); }
  .side-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: var(--r-md); color: var(--ink-2); font-weight: 600; font-size: 15px; }
  .side-item:hover { background: var(--surface-2); }
  .side-item.on { background: var(--brand-soft); color: var(--brand); }
  .side-sep { flex: 1; min-height: 16px; }
  .fab { bottom: 28px !important; right: 28px !important; }
  .bulkbar { bottom: 20px !important; left: calc(240px + 20px) !important; }
}

/* ---------- nút: cao tối thiểu 48px, bo 14px, chữ 600 16px (nc-btn) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 6px 20px; border-radius: var(--r-md); font: 600 16px/1.25 var(--nc-font); text-align: center; background: var(--surface); border: 1.5px solid var(--brand); color: var(--brand); transition: transform .08s, background .15s; text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: var(--on-bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 6px 14px; font-size: 15px; }
.btn.small .ic { width: 18px; height: 18px; }
.btn.big { min-height: 52px; }
.btn.block { display: flex; width: 100%; }
.sec > .btn.block { margin-top: 10px; }
.row-btns { display: flex; gap: 10px; margin-top: 16px; }
.row-btns > .btn { flex: 1; }
.row-btns.wrap { flex-wrap: wrap; align-items: center; }
.row-btns.wrap > .btn { flex: 0 1 auto; }
.btn.sq { padding: 0; width: 48px; flex: none !important; }
/* chip bấm được: cao 40px, vùng bấm nới ra 48px */
.chip-btn, .chip-filter { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--nc-r-pill); border: 1.5px solid var(--line); background: var(--surface); font: 600 14px/1.2 var(--nc-font); color: var(--ink-2); white-space: nowrap; flex: none; }
.chip-btn::after, .chip-filter::after { content: ''; position: absolute; inset: -4px 0; }
.chip-btn .ic, .chip-filter .ic { width: 16px; height: 16px; }
.chip-btn.on, .chip-filter.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.link-btn { display: inline-flex; align-items: center; min-height: 48px; color: var(--brand); font-weight: 600; font-size: 15px; padding: 0 2px; }
.more { display: inline-flex; align-items: center; gap: 2px; min-height: 48px; font-size: 15px; font-weight: 600; }
.more .ic { width: 16px; height: 16px; }
.fab { position: fixed; z-index: 25; right: 16px; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); width: 60px; height: 60px; border-radius: 20px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 38%, transparent); transition: transform .1s; }
.fab .ic { width: 28px; height: 28px; stroke-width: 2.4; }
.fab:active { transform: scale(.94); }

/* ---------- chip trạng thái (nc-chip): luôn có chữ + biểu tượng ---------- */
.nc-chip .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.nc-chip--o, .nc-chip--live { background: var(--st-o); color: var(--on-st-o); }
.nc-chip--den { background: var(--st-den); color: var(--on-st-den); }
.nc-chip--di { background: var(--st-di); color: var(--on-st-di); }
.nc-chip--hold { background: var(--st-hold); color: var(--on-st-hold); box-shadow: inset 0 0 0 1.5px var(--st-hold-line); }
.nc-chip--fix { background: var(--st-fix) var(--hatch); color: var(--on-st-fix); box-shadow: inset 0 0 0 1.5px var(--st-fix-line); }
.nc-chip--rieng { background: var(--st-rieng); color: var(--on-st-rieng); }
.nc-chip--trong { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--st-free-line); }
.nc-chip--act { background: var(--brand-soft); color: var(--brand); }
.nc-chip--other { background: var(--surface-2); color: var(--muted); }
.nc-chip--wait { background: var(--surface-2); color: var(--ink-2); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- bộ lọc, chip nhỏ, segmented (nc-seg) ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px; scroll-padding: 16px; }
.chips.scroll-x::-webkit-scrollbar { display: none; }
.chip-filter .n { font-size: 12px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--surface-2); display: inline-grid; place-items: center; color: var(--muted); }
.chip-filter.on .n { background: color-mix(in srgb, var(--on-brand) 18%, transparent); color: var(--on-brand); }
.chip-filter[class*=' f-']:not(.f-all)::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--muted)); box-shadow: inset 0 0 0 1px var(--cl, transparent); }
.f-trong { --c: var(--st-free); --cl: var(--st-free-line); } .f-o { --c: var(--st-o); } .f-den { --c: var(--st-den); } .f-di { --c: var(--st-di); } .f-giu_cho { --c: var(--st-hold); --cl: var(--st-hold-line); } .f-can_don { --c: var(--gold); } .f-bao_tri { --c: var(--st-fix); --cl: var(--st-fix-line); } .f-rieng { --c: var(--st-rieng); --cl: var(--st-rieng-line); }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: var(--nc-r-pill); font: 600 13px/1 var(--nc-font); white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.chip.st-ok { background: var(--brand-soft); color: var(--brand); }
.chip.st-pending { background: var(--gold-soft); color: var(--gold-ink); box-shadow: inset 0 0 0 1.5px var(--gold); }
.chip.st-web { background: var(--surface-2); color: var(--ink-2); }
.chip.st-in { background: var(--bad-soft); color: var(--bad-ink); }
.chip.st-hold { background: var(--st-hold); color: var(--on-st-hold); box-shadow: inset 0 0 0 1.5px var(--st-hold-line); }
.chip.st-out { background: var(--surface-2); color: var(--muted); }
.chip.st-cancel { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.count { font-size: 13px; font-weight: 700; min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.count.warn { background: var(--gold-soft); color: var(--gold-ink); margin: 0; }
.badge { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: var(--nc-r-pill); white-space: nowrap; }
.badge.free { background: var(--ok-soft); color: var(--ok); }
.badge.busy { background: var(--bad-soft); color: var(--bad-ink); }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--nc-r-pill); background: var(--surface-2); }
.seg.wrap { flex-wrap: wrap; border-radius: 18px; }
.seg-btn { position: relative; flex: 1; min-height: 40px; padding: 4px 12px; border-radius: var(--nc-r-pill); font: 600 15px/1.2 var(--nc-font); color: var(--muted); transition: background .15s; }
.seg-btn::after { content: ''; position: absolute; inset: -4px -2px; }
.seg-btn.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.seg.mini .seg-btn { font-size: 14px; }
.hk-seg .seg-btn { min-height: 44px; }
.hk-seg .seg-btn.hk-can_don.on { background: var(--gold); color: var(--on-gold); }
.hk-seg .seg-btn.hk-dang_don.on { background: var(--st-den); color: var(--on-st-den); }
.hk-seg .seg-btn.hk-sach.on { background: var(--ok); color: var(--on-ok); }
.floor-seg { margin: 8px 0; }

/* ---------- thanh công cụ dính trên cùng, thanh ngày, ô tìm ---------- */
.sticky-tools { position: sticky; top: var(--top-h); z-index: 15; background: var(--bg); margin: 0 -16px; padding: 6px 16px 10px; display: flex; flex-direction: column; gap: 8px; }
.sticky-tools > .chips.scroll-x { margin: 0 -16px; }
@media (min-width: 900px) { .sticky-tools { margin: 0 -28px; padding: 6px 28px 10px; } }
.tools-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tools-row > .chips.scroll-x { flex: 1 1 100%; margin: 0 -16px; }
.tools-row > .seg { flex: 1 1 100%; }
.datebar { display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 2px; box-shadow: var(--shadow); }
.datebar-label { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; line-height: 1.25; cursor: pointer; border-radius: 10px; }
.datebar-rel { font-weight: 700; font-size: 16px; }
.datebar-full { font-size: 13px; color: var(--muted); }
.date-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; -webkit-appearance: none; appearance: none; }
.date-native::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.main > .datebar { margin: 4px 0 12px; }
.search-row { display: flex; gap: 8px; align-items: center; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); color: var(--muted); }
.search input { flex: 1; min-width: 0; min-height: 44px; border: 0; outline: 0; background: none; font-size: 16px; color: var(--ink); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nc-focus) 30%, transparent); }

/* ---------- thẻ, mục ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card.pad { padding: 16px; }
.card-title { font-size: 17px; margin-bottom: 12px; }
.sec { margin-top: 24px; }
.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sec-head h2 { display: flex; align-items: center; gap: 6px; }
.cards { display: grid; gap: 10px; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }
.empty { text-align: center; padding: 32px 20px 40px; display: grid; gap: 6px; justify-items: center; }
.empty::before { content: ''; width: 128px; height: 150px; margin-bottom: 6px; background: url(../img/brand/duc-me-net-ve.png) center bottom / contain no-repeat; opacity: .28; }
[data-theme="dark"] .empty::before { display: none; }
.empty p:first-child { font-weight: 600; font-size: 17px; }
.loading { display: flex; justify-content: center; gap: 6px; padding: 48px 0; }
.loading .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); opacity: .3; animation: blink 1s infinite; }
.loading .dot:nth-child(2) { animation-delay: .15s; } .loading .dot:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: 1; transform: translateY(-3px); } }
.tip { background: var(--brand-soft); color: var(--ink); border-radius: var(--r-md); padding: 10px 14px; margin: 6px 0 10px; font-size: 15px; }
.tip a { font-weight: 700; color: inherit; text-decoration: underline; }

/* ô số (trang cũ) */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 14px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); min-height: 96px; }
.stat:active { transform: scale(.98); }
.stat-v { font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-l { font-weight: 600; font-size: 15px; margin-top: 2px; }
.stat-s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-row .stat { min-height: 0; align-items: center; }
.stat-row .stat strong { font-size: 24px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-row .stat span { font-size: 13px; color: var(--muted); }

/* thẻ đoàn */
.booking-card { overflow: hidden; }
.bc-main { display: block; padding: 14px 16px 12px; color: inherit; }
.bc-main:active { background: var(--surface-2); }
.bc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bc-top h3 { font-size: 17px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.bc-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.bc-facts > span { display: inline-flex; align-items: center; gap: 5px; }
.bc-facts .ic { width: 16px; height: 16px; color: var(--muted); }
.phase { background: var(--gold-soft); color: var(--gold-ink); border-radius: 6px; padding: 0 7px; font-weight: 600; }
.bc-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px 10px 16px; border-top: 1px solid var(--line); }
.tel { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; font-weight: 600; color: var(--brand); font-size: 15px; }
.tel .ic { width: 16px; height: 16px; }
.month { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 2px 8px; }

/* ---------- danh sách phòng (nc-tile): mỗi ô có số phòng + chữ trạng thái ---------- */
.area { margin-top: 18px; }
.area-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.row-block { margin: 10px 0 4px; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px 2px; display: flex; align-items: center; gap: 8px; }
.row-head .row-label { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; margin-top: 6px; }
.tile { position: relative; min-height: 64px; border-radius: var(--r-md); border: 1.5px solid var(--line-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 3px; background: var(--bg-s, var(--surface)); color: var(--fg-s, var(--ink)); transition: transform .08s; }
.tile:active:not(:disabled) { transform: scale(.95); }
.tile-code { font-weight: 700; font-size: 17px; line-height: 1.1; letter-spacing: -.01em; }
.tile-st { font-size: 12px; font-weight: 600; line-height: 1.2; opacity: .92; }
.tile-hk { font-size: 12px; font-weight: 600; line-height: 1.2; padding: 0 6px; border-radius: 6px; background: var(--gold-soft); color: var(--gold-ink); }
.tile.hk-dang_don .tile-hk { background: var(--sky-soft); color: var(--sky-ink); }
.tile.v { --bg-s: var(--gold-soft); border-color: var(--gold); }
.tile.s-trong .tile-st { color: var(--muted); }
.tile.s-o { --bg-s: var(--st-o); border-color: var(--st-o-line); --fg-s: var(--on-st-o); }
.tile.s-den { --bg-s: var(--st-den); border-color: var(--st-den-line); --fg-s: var(--on-st-den); }
.tile.s-di { --bg-s: var(--st-di); border-color: var(--st-di-line); --fg-s: var(--on-st-di); }
.tile.s-di.turn { background: linear-gradient(135deg, var(--st-di) 50%, var(--st-den) 50%); }
.tile.s-giu_cho { --bg-s: var(--st-hold); border: 1.5px dashed var(--st-hold-line); --fg-s: var(--on-st-hold); }
.tile.s-bao_tri { --fg-s: var(--on-st-fix); background: var(--st-fix) var(--hatch); border-color: var(--st-fix-line); }
.tile.s-rieng { --bg-s: var(--st-rieng); border-color: var(--st-rieng-line); --fg-s: var(--on-st-rieng); }
/* phòng V có người ở (có khách / chờ nhận / giữ chỗ): đỏ viền vàng */
.tile.v.s-o, .tile.v.s-den, .tile.v.s-giu_cho { --bg-s: var(--st-o); --fg-s: var(--on-st-o); border: 2px solid var(--nc-gold); }
.tile.sel { box-shadow: 0 0 0 3px var(--brand); }
/* xếp phòng */
.tile.pick { --bg-s: var(--surface); border-color: var(--line-2); }
.tile.p-mine { --bg-s: var(--brand); border-color: var(--brand); --fg-s: var(--on-brand); }
.tile.p-taken { --bg-s: var(--surface-2); --fg-s: var(--muted); border-color: transparent; }
.tile.p-oos { --fg-s: var(--muted); background: var(--surface) var(--hatch); opacity: .75; }
.tile.pick.v.p-free { --bg-s: var(--gold-soft); border-color: var(--gold); }
.tile.pick.p-lock { --bg-s: var(--surface-2); --fg-s: var(--muted); border: 1.5px dashed var(--line-2); }
.tile.pick.p-rieng { --bg-s: var(--st-rieng); --fg-s: var(--on-st-rieng); border-color: transparent; }
.tick { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--on-brand); color: var(--brand); display: grid; place-items: center; }
.tick .ic { width: 13px; height: 13px; stroke-width: 3; }
.legend-box { margin-top: 26px; background: var(--surface); border-radius: var(--r); padding: 0 14px; border: 1px solid var(--line); }
.legend-box summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; font-size: 15px; cursor: pointer; color: var(--ink-2); }
.legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding-bottom: 14px; font-size: 14px; }
.lg-tile { display: flex; align-items: center; gap: 8px; }
.lg-tile i { width: 22px; height: 18px; border-radius: 5px; background: var(--bg-s, var(--surface)); border: 1.5px solid var(--bc, transparent); flex: none; }
.lg-tile.s-trong i { --bc: var(--line-2); } .lg-tile.s-o i { --bg-s: var(--st-o); } .lg-tile.s-den i { --bg-s: var(--st-den); } .lg-tile.s-di i { --bg-s: var(--st-di); }
.lg-tile.s-giu_cho i { --bg-s: var(--st-hold); border-style: dashed; --bc: var(--st-hold-line); } .lg-tile.s-bao_tri i { background: var(--st-fix) var(--hatch); --bc: var(--st-fix-line); }
.lg-tile.v i { --bg-s: var(--gold-soft); --bc: var(--gold); }
.lg-tile.s-rieng i { --bg-s: var(--st-rieng); --bc: var(--st-rieng-line); } .lg-tile.v-co i { --bg-s: var(--st-o); --bc: var(--nc-gold); border-width: 2px; }

/* chú thích nhỏ dạng ô màu */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ''; width: 12px; height: 12px; border-radius: 4px; background: var(--c, var(--muted)); }
.lg.b-o, .b-o { --c: var(--st-o); } .lg.b-den, .b-den { --c: var(--st-den); } .lg.b-hold, .b-hold { --c: var(--st-hold); } .lg.b-fix, .b-fix { --c: var(--st-fix-line); }

/* công suất */
.occ { padding: 16px; margin-top: 24px; }
.occ-row { display: grid; grid-template-columns: 112px 1fr 48px; align-items: center; gap: 10px; padding: 7px 0; color: inherit; }
.occ-label { display: flex; flex-direction: column; line-height: 1.25; }
.occ-label strong { font-size: 14px; } .occ-label span { font-size: 12px; color: var(--muted); }
.occ-bar { height: 12px; border-radius: 6px; background: var(--surface-2); display: flex; overflow: hidden; }
.occ-bar span { height: 100%; background: var(--c); }
.occ-n { font-size: 14px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* báo hỏng */
.issues { padding: 14px 16px; margin-top: 16px; }
.issues .sec-head { margin-bottom: 6px; } .issues h2 { font-size: 17px; color: var(--gold-ink); }
.issues h2 .ic { width: 18px; height: 18px; }
.issue-list { list-style: none; margin: 0 0 8px; padding: 0; font-size: 15px; }
.issue-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.issue-list li:last-child { border-bottom: 0; }
.issue-list.big { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 2px 14px; }
.issue-list.big li { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.issue-list.big li > div { flex: 1; min-width: 0; }
.issue-list.big p { margin: 2px 0; }

/* ---------- nhà nguyện: mỗi lịch một dòng như nc-slot (giờ bên trái, chip mục đích), không có vạch màu bên trái ---------- */
.p-mass { --c: var(--p-mass); --on-c: var(--on-p-mass); --chip-bg: var(--nc-gold); --chip-fg: var(--nc-on-gold); }
.p-pray { --c: var(--p-pray); --on-c: var(--on-p-pray); --chip-bg: var(--nc-sky-soft); --chip-fg: var(--nc-sky-ink); }
.p-act, .p-eat { --c: var(--p-act); --on-c: var(--on-p-act); --chip-bg: var(--brand-soft); --chip-fg: var(--brand); }
.p-other { --c: var(--p-other); --on-c: var(--on-p-other); --chip-bg: var(--surface-2); --chip-fg: var(--muted); }
.sp-list, .task-list { display: grid; gap: 8px; }
@media (min-width: 900px) { .sp-list, .task-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }
.sp-item, .task-item { display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 64px; text-align: left; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 12px 14px; }
.sp-time { display: flex; flex-direction: column; min-width: 50px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.sp-time strong { font-size: 16px; font-weight: 700; }
.sp-time span { font-size: 14px; color: var(--muted); }
.sp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-body > strong { font-size: 16px; }
.sp-body small { color: var(--muted); font-size: 14px; }
.sp-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; order: 3; }
.purpose { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--nc-r-pill); font: 600 13px/1 var(--nc-font); background: var(--chip-bg, var(--surface-2)); color: var(--chip-fg, var(--ink-2)); white-space: nowrap; }
.purpose .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.sp-space { font-weight: 600; font-size: 16px; }
.sp-item p.small { font-size: 14px; }
.live { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--nc-r-pill); font: 600 13px/1 var(--nc-font); background: var(--st-o); color: var(--on-st-o); }
.t-done { opacity: .6; }
.t-now { box-shadow: 0 0 0 2px var(--st-o), var(--shadow); }
.note-line { font-style: italic; }
.task-need { align-self: center; font-size: 13px; font-weight: 600; color: var(--gold-ink); text-align: right; max-width: 34%; }
.task-item.ok .task-need { color: var(--ok); }
.task-item.t-done:not(.ok) { opacity: 1; }
.task-item.t-done:not(.ok) .task-need { color: var(--gold-ink); }

/* dòng thời gian theo nơi */
.tl { margin-top: 4px; }
.tl-scale, .tl-row { display: grid; grid-template-columns: 118px 1fr; gap: 8px; align-items: center; }
@media (min-width: 760px) { .tl-scale, .tl-row { grid-template-columns: 220px 1fr; } }
.tl-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.tl-name { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.tl-name strong { font-size: 14px; overflow-wrap: anywhere; }
.tl-name small { font-size: 12px; color: var(--muted); }
.tl-name small.free { color: var(--ok); font-weight: 600; }
.tl-axis { position: relative; height: 18px; }
.tl-tick { position: absolute; transform: translateX(-50%); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-bar { position: relative; height: 56px; background: var(--surface); border-radius: 10px; border: 1px solid var(--line); overflow: hidden; cursor: copy; }
.tl-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); opacity: .6; pointer-events: none; }
.tl-block { position: absolute; top: 3px; bottom: 3px; border-radius: 8px; background: var(--c); color: var(--on-c, var(--on-photo)); font-size: 12px; font-weight: 700; display: flex; align-items: flex-start; padding: 4px; overflow: hidden; min-width: 12px; box-shadow: 0 0 0 1.5px var(--surface); }
.tl-block span { white-space: nowrap; }
.tl-block.t-done { opacity: .45; }
.tl-block.t-now { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--st-o); }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); z-index: 2; pointer-events: none; }
.now-line::before { content: ''; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
@media (max-width: 759px) { .tl-block span { display: none; } .tl-name strong { font-size: 13px; } }

/* bảng trượt chi tiết lịch */
.sp-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 12px; }
.sp-head strong { font-size: 17px; }
.priest { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-radius: var(--r-md); background: var(--gold-soft); color: var(--gold-ink); margin-bottom: 10px; }
.priest strong { color: var(--ink); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 6px 0 4px; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.sub { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 18px 0 8px; }
.task-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.task { display: flex; align-items: center; gap: 10px; min-height: 56px; text-align: left; padding: 12px; border-radius: var(--r-md); border: 1.5px solid var(--line-2); background: var(--surface); }
.task strong { display: block; font-size: 15px; }
.task small { display: block; font-size: 12px; color: var(--muted); }
.task-box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; }
.task.done { border-color: var(--ok); background: var(--ok-soft); }
.task.done .task-box { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.task-box .ic { width: 16px; height: 16px; stroke-width: 3; }

/* báo trùng giờ khi đặt: khối nền đỏ nhạt, chữ đỏ đậm (bộ nhận diện); còn trống thì nền xanh lá nhạt */
.check-box { min-height: 0; }
.bad-box, .ok-box { border-radius: var(--r-md); padding: 12px 14px; font-size: 15px; line-height: 1.4; display: grid; gap: 8px; }
.bad-box { background: var(--bad-soft); color: var(--bad-ink); font-weight: 500; }
.bad-box strong { color: var(--bad-ink); }
.bad-box small { font-size: 13px; font-weight: 600; }
.ok-box { background: var(--ok-soft); color: var(--ok); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.bad-box .chips { margin-top: 4px; }
.bad-box .chip-filter { border-color: color-mix(in srgb, var(--bad-ink) 35%, transparent); }

/* ---------- dọn phòng: phòng cần dọn theo tầng, chip Cần dọn / Đang dọn / Xong, một nút lớn đổi trạng thái ---------- */
.hk-stats { margin-top: 4px; }
.hk-stats .nc-stat { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hk-stats .nc-stat span { display: block; }
.hk-group { margin-bottom: 12px; }
.hk-group .row-label { margin-top: 4px; }
.hk-row { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 12px; margin-bottom: 8px; }
.hk-row > .btn, .hk-row > .hk-wait { grid-column: 1 / -1; }
.hk-code { min-width: 64px; min-height: 56px; padding: 0 8px; border-radius: var(--r-md); background: var(--surface-2); border: 1.5px solid var(--line); font-weight: 700; font-size: 18px; display: grid; place-items: center; color: var(--ink); }
.hk-info { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; line-height: 1.3; }
.hk-info strong { font-size: 15px; overflow-wrap: anywhere; }
.hk-info small { font-size: 13px; color: var(--muted); }
.hk-info .by { color: var(--sky-ink); font-weight: 600; }
.hk-wait { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: var(--r-md); background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 15px; }
.hk-code.v { background: var(--gold-soft); border-color: var(--gold); }
.hk-wait { gap: 8px; }
.hk-wait .ic { width: 18px; height: 18px; }
.hk-done { padding: 14px 16px; display: grid; gap: 10px; }
.wait { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 5px 9px; border-radius: 8px; white-space: nowrap; }
.leave-card { padding: 14px 16px; }
.leave-card h3 { font-size: 16px; overflow-wrap: anywhere; }
.leave-codes { display: flex; flex-direction: column; margin-top: 8px; line-height: 1.3; }
.leave-codes strong { color: var(--gold-ink); font-size: 16px; }

/* ---------- ngăn kéo từ dưới lên (nc-sheet) ---------- */
.backdrop { position: fixed; inset: 0; z-index: 100; background: transparent; display: flex; align-items: flex-end; justify-content: center; transition: background .22s; }
.backdrop.in { background: var(--nc-overlay); }
.sheet { width: 100%; max-height: 92dvh; background: var(--surface); border-radius: var(--nc-r-sheet) var(--nc-r-sheet) 0 0; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .25, 1); }
.backdrop.in .sheet { transform: none; }
.sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 12px auto 4px; flex: none; }
.sheet-head { display: flex; align-items: flex-start; gap: 8px; padding: 4px 8px 6px 20px; flex: none; }
.sheet-head > div { flex: 1; min-width: 0; padding-top: 10px; }
.sheet-head h2 { font-size: 18px; overflow-wrap: anywhere; }
.sheet-head h2.nc-display { font-size: 28px; line-height: 34px; }
.sheet-head small { display: block; margin-top: 2px; font-size: 14px; line-height: 20px; color: var(--muted); }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px calc(20px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
@media (min-width: 700px) {
  .backdrop { align-items: center; padding: 24px; }
  .sheet { width: 520px; max-height: 86vh; border-radius: var(--nc-r-sheet); transform: translateY(24px) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; }
  .sheet.wide { width: 760px; }
  .backdrop.in .sheet { opacity: 1; }
  .sheet-grab { visibility: hidden; height: 2px; }
}
.confirm-msg { font-size: 17px; font-weight: 600; margin: 8px 0 4px; }
.confirm .muted { font-size: 15px; }
.quick { display: grid; gap: 10px; padding-bottom: 6px; }
.quick-btn { display: flex; align-items: center; gap: 14px; text-align: left; min-height: 64px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.quick-btn > .ic { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.quick-btn strong { display: block; font-size: 16px; } .quick-btn small { color: var(--muted); font-size: 14px; }
.quick-btn.danger { color: var(--bad-ink); }
.quick-btn.danger > .ic { background: var(--bad-soft); color: var(--bad-ink); }
.room-sheet > p.muted { font-size: 15px; }
.state-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; font-size: 15px; }
.stay-box { background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 6px; }
.stay-box a { color: var(--ink); }
.stay-box .ic { color: var(--muted); }
.stay-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stay-name { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; color: var(--ink); min-width: 0; font-size: 16px; }
.stay-name strong { overflow-wrap: anywhere; }
.stay-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.stay-btns > :only-child { grid-column: 1 / -1; }
.mini-cal { min-height: 60px; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mc-cell { display: flex; flex-direction: column; align-items: center; padding: 4px 0; border-radius: 8px; background: var(--surface-2); line-height: 1.2; }
.mc-wd { font-size: 12px; color: var(--muted); }
.mc-d { font-size: 14px; font-weight: 700; }
.mc-cell.busy { background: var(--st-o); color: var(--on-st-o); }
.mc-cell.busy .mc-wd { color: inherit; opacity: .85; }
.mc-cell.hold { background: var(--st-hold); color: var(--on-st-hold); outline: 1.5px dashed var(--st-hold-line); outline-offset: -1.5px; }
.mc-cell.hold .mc-wd { color: inherit; opacity: .8; }
.mc-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 15px; }
.mc-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mc-list a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 600; }
.mc-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--st-o); }
.mc-dot.hold { background: var(--st-hold); box-shadow: inset 0 0 0 1px var(--st-hold-line); }

/* ---------- biểu mẫu (nc-field + nc-input): ô cao 48px, chữ 16px ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font: 600 14px/20px var(--nc-font); color: var(--ink); }
.req { color: var(--bad-ink); }
.hint { font-size: 13px; color: var(--muted); }
.field input:not([type=checkbox]):not([type=color]), .field select, .field textarea, .pw-wrap input { width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 21px) 50%, calc(100% - 15px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
.field textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .pw-wrap input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nc-focus) 30%, transparent); }
.field input[type=color] { width: 100%; height: 48px; border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 4px; background: var(--surface); }
.field input[type=date], .field input[type=time] { min-height: 48px; display: block; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-err { color: var(--bad-ink); font-weight: 600; font-size: 15px; }
.form-err:empty { display: none; }
.form-sub { font-size: 15px; margin-top: 8px; }
.page-form { max-width: 640px; margin: 0 auto; padding-top: 6px; }
.form-card { display: flex; flex-direction: column; gap: 14px; }
.bar-note { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 8px 12px; border-radius: var(--r-md); background: var(--bad-soft); color: var(--bad-ink); font-weight: 600; font-size: 14px; line-height: 1.35; }
.bar-note .ic { width: 18px; height: 18px; }
.form-bar { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 10; margin: 6px -16px 0; padding: 12px 16px; background: linear-gradient(color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 30%); }
@media (min-width: 900px) { .form-bar { bottom: 0; } }
.nights { display: inline-block; font-size: 14px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 4px 10px; border-radius: 8px; align-self: flex-start; }
.nights.bad { color: var(--bad-ink); background: var(--bad-soft); }
.nights:empty { display: none; }
.switch, .switch-row { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 15px; font-weight: 500; cursor: pointer; }
.switch-row { padding: 4px 0; }
.switch-row small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.switch input, .switch-row input { -webkit-appearance: none; appearance: none; width: 48px; height: 28px; border-radius: 14px; background: var(--line-2); position: relative; flex: none; margin: 0; cursor: pointer; transition: background .18s; }
.switch input::after, .switch-row input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 30%, transparent); transition: transform .18s; }
.switch input:checked, .switch-row input:checked { background: var(--brand); }
.switch input:checked::after, .switch-row input:checked::after { transform: translateX(20px); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 72px; }
.pw-toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); min-height: 48px; min-width: 60px; font-size: 14px; font-weight: 600; color: var(--brand); padding: 0 10px; }
.link-line { display: flex; align-items: center; gap: 8px; font-size: 15px; word-break: break-all; }

/* ---------- đoàn ---------- */
.hero { padding: 16px; }
.hero .bc-top { align-items: center; justify-content: flex-start; flex-wrap: wrap; }
.hero-dates { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 14px 0 10px; }
.hero-dates > div:not(.hero-mid) { display: flex; flex-direction: column; line-height: 1.25; }
.hero-dates > div:last-child { text-align: right; }
.hero-dates small { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.hero-dates strong { font-size: 18px; font-weight: 700; }
.hero-mid { display: flex; flex-direction: column; align-items: center; font-size: 13px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 6px 10px; border-radius: 10px; }
.hero-mid .ic { width: 16px; height: 16px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 15px; padding: 10px 0; border-top: 1px solid var(--line); }
.hero-facts span { display: inline-flex; align-items: center; gap: 6px; }
.hero-facts .ic { color: var(--muted); width: 18px; height: 18px; }
.contact { display: flex; align-items: center; gap: 8px; padding: 6px 0 2px; border-top: 1px solid var(--line); font-weight: 600; }
.contact > .ic { color: var(--muted); width: 18px; height: 18px; }
.hero .row-btns { gap: 8px; }
.hero .row-btns > .btn:not(.sq) { padding: 6px 14px; }
.alloc { padding: 4px 14px; }
.alloc-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.alloc-head { display: flex; flex-direction: column; gap: 1px; }
.alloc-codes { margin-top: 6px; font-weight: 700; color: var(--brand); font-size: 16px; font-variant-numeric: tabular-nums; }
.alloc-total { display: flex; justify-content: space-between; padding: 12px 0; font-size: 16px; }
.card > p.muted { padding: 14px; }
details.log summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 600; color: var(--ink-2); }
details.log ul { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 10px; font-size: 15px; }
ul.log { list-style: none; margin: 0; padding: 4px 14px; }
ul.log li { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
ul.log li:last-child { border-bottom: 0; }
.log-time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.log-link { font-size: 14px; font-weight: 600; padding: 15px 0; } /* liên kết nằm trong dòng chữ: đệm trên dưới để vùng bấm đủ 48px mà không đẩy dòng */

/* xếp phòng */
.assign-sum { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; display: grid; gap: 8px; border: 1px solid var(--line); }
.as-top { font-size: 15px; }
.as-nums { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; font-size: 15px; }
.as-nums strong { font-size: 20px; font-weight: 700; }
.as-nums .okay { color: var(--ok); font-weight: 700; } .as-nums .short { color: var(--gold-ink); font-weight: 700; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--gold); border-radius: 4px; transition: width .25s; }
.progress span.full { background: var(--ok); }
.as-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.assign-tools { display: grid; gap: 8px; margin-top: 4px; }

/* ---------- quản trị ---------- */
.menu-list { display: flex; flex-direction: column; overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 12px 16px; text-align: left; color: var(--ink); border-bottom: 1px solid var(--line); width: 100%; }
.menu-item:last-child { border-bottom: 0; }
.menu-item:active { background: var(--surface-2); }
.menu-item > .ic:first-child { color: var(--brand); width: 22px; height: 22px; }
.menu-item > span:not(.avatar) { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.menu-item small { color: var(--muted); font-size: 13px; }
.chev { color: var(--muted); width: 18px; height: 18px; }
.color-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.profile { display: flex; align-items: center; gap: 14px; padding: 16px; }
.profile > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.profile strong { font-size: 18px; overflow-wrap: anywhere; }
.adm-row { padding: 12px 14px; margin-bottom: 10px; }
.adm-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.adm-row-head > div { display: flex; flex-direction: column; min-width: 0; }
.adm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-room { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 60px; min-height: 48px; padding: 6px 8px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface-2); line-height: 1.2; }
.adm-room strong { font-size: 15px; } .adm-room small { font-size: 12px; color: var(--muted); }
.adm-room.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); } .adm-room.on small { color: inherit; opacity: .85; }
.adm-room.oos { background: var(--surface) var(--hatch); }
.adm-room.rieng:not(.on) { background: var(--st-rieng); border-color: var(--st-rieng-line); } .adm-room.rieng:not(.on) small { color: var(--on-st-rieng); }
.bulkbar { position: fixed; z-index: 26; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); background: var(--ink); color: var(--surface); border-radius: var(--r-md); padding: 8px 8px 8px 16px; display: none; align-items: center; justify-content: space-between; gap: 10px; box-shadow: var(--shadow-lg); font-weight: 600; }
.bulkbar.on { display: flex; }
@media (min-width: 900px) { .bulkbar { right: auto; width: 460px; } }
/* giao diện sáng / tối */
.theme-pick { padding: 14px 16px; display: grid; gap: 10px; }
.theme-pick h2 { font-size: 17px; }

/* ---------- thông báo ---------- */
.toasts { position: fixed; z-index: 200; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 10px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 14px; }
.toast { background: var(--ink); color: var(--surface); padding: 12px 16px; border-radius: var(--r-md); font-size: 15px; font-weight: 500; box-shadow: var(--shadow-lg); max-width: 480px; opacity: 0; transform: translateY(-12px); transition: opacity .22s, transform .22s; pointer-events: auto; }
.toast.in { opacity: 1; transform: none; }
.toast.err { background: var(--bad); color: var(--on-bad); }

/* ---------- đăng nhập: ảnh tòa nhà trên cùng, logo tròn chồng mép ảnh, "Núi Cúi" chữ Playfair, nét vẽ Đức Mẹ mờ ở góc ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.login-photo { position: relative; flex: none; height: 40vh; min-height: 220px; max-height: 380px; background: var(--brand) url(../img/brand/toa-nha.jpg) center / cover no-repeat; }
.login-photo::after { content: ''; position: absolute; inset: auto 0 0 0; height: 90px; background: linear-gradient(color-mix(in srgb, var(--bg) 0%, transparent), var(--bg)); }
.login-logo { position: absolute; z-index: 1; left: 50%; bottom: -48px; transform: translateX(-50%); width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 4px solid var(--bg); background: var(--surface); }
.login-body { position: relative; flex: 1; overflow: hidden; padding: 64px 24px calc(28px + var(--safe-b)); }
.login-body::before { content: ''; position: absolute; right: -38px; bottom: -30px; width: 250px; height: 340px; background: url(../img/brand/duc-me-net-ve.png) right bottom / contain no-repeat; opacity: .28; pointer-events: none; }
[data-theme="dark"] .login-body::before { display: none; }
.login-inner { position: relative; max-width: 400px; margin: 0 auto; text-align: center; }
.login-inner .nc-small { margin: 2px 0 22px; }
.login-inner .form { text-align: left; gap: 12px; }
.login-note { margin-top: 16px; }
.login-public { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin-top: 8px; color: var(--brand); font-weight: 600; font-size: 15px; }
/* khách chưa đăng nhập: nút đăng ký lưu trú + lịch nhà nguyện ngay dưới tên, phần đăng nhập nhân viên ở dưới */
.login.has-guest .login-photo { height: 34vh; min-height: 200px; }
.login-guest { display: grid; justify-items: center; gap: 2px; }
.login-guest .login-public { margin-top: 2px; }
.login-split { display: flex; align-items: center; gap: 12px; margin: 14px 0 12px; font: 600 12px/16px var(--nc-font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.login-split::before, .login-split::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- lịch công khai ---------- */
.pub { min-height: 100dvh; }
.pub-head { position: relative; overflow: hidden; background: var(--brand); color: var(--on-photo); padding: 90px 16px 22px; display: grid; gap: 14px; }
.pub-head .g-cover { z-index: 0; }
.pub-head::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--nc-overlay) 20%, transparent) 0%, var(--nc-overlay) 45%, var(--photo-shade) 100%); }
.pub-head h1, .pub-head .pub-brand { text-shadow: var(--photo-text-shadow); }
.pub-head > :not(.g-cover) { position: relative; z-index: 1; }
.pub-brand { display: flex; align-items: center; gap: 12px; max-width: 900px; width: 100%; margin: 0 auto; }
.pub-brand img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--on-photo); flex: none; background: var(--surface); }
.pub-brand strong { display: block; font: 700 22px/28px var(--nc-font-display); }
.pub-brand span { font-size: 14px; opacity: .9; }
.pub-head .datebar { max-width: 900px; width: 100%; margin: 0 auto; color: var(--ink); }
.pub-body { max-width: 900px; margin: 0 auto; padding: 16px 16px 40px; }
.pub-grid { display: grid; gap: 10px; }
@media (min-width: 700px) { .pub-grid { grid-template-columns: 1fr 1fr; } }
.pub-card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 14px; }
.pub-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pub-card-head h2 { font-size: 17px; overflow-wrap: anywhere; }
.pub-busy { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.pub-busy li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.pub-time { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pub-free { margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--ok); }
.pub-free .muted { font-weight: 400; }
.pub-note { text-align: center; color: var(--muted); font-size: 14px; margin-top: 22px; }
.pub-note .btn { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ======================================================================
   Sơ đồ tòa nhà (SVG nhúng trực tiếp, màu theo biến --nc-*), ảnh, infographic, nhận phòng từng phòng, trang cho khách
   ====================================================================== */
.pl-card { margin-top: 2px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 8px; position: relative; }
.pl-floors { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--surface-2); border-radius: 18px; padding: 4px; }
.pl-floor { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; padding: 6px 4px; border-radius: 14px; color: var(--muted); transition: background .15s, box-shadow .15s, color .15s; }
.pl-floor strong { font-size: 15px; font-weight: 600; line-height: 1.2; }
.pl-floor small { font-size: 12px; font-weight: 600; }
.pl-floor.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.pl-stage { position: relative; margin-top: 8px; }
/* giờ đang xem cho nhà nguyện (tầng có nhà nguyện) */
.pl-time { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; padding: 0 4px; }
.pl-time-l { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.pl-time-in { min-height: 48px; min-width: 156px; padding: 0 40px 0 14px; border: 1.5px solid var(--line); border-radius: var(--r-md); color: var(--ink); font: 600 16px/1.2 var(--nc-font); font-variant-numeric: tabular-nums; -webkit-appearance: none; appearance: none; cursor: pointer;
  background-color: var(--surface); background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 21px) 50%, calc(100% - 15px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.pl-time-in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nc-focus) 30%, transparent); }
.pl-scroll { overflow: auto; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; aspect-ratio: 1420 / 1010; max-height: 74vh; scrollbar-width: thin; }
.pl-scroll.zoomed { cursor: grab; }
.pl-inner { width: 100%; }
.pl-inner svg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.pl-inner svg.fade { animation: plfade .28s ease; }
@keyframes plfade { from { opacity: 0; transform: scale(.985); } }
.pl-zoom { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; align-items: center; padding: 0 2px; border-radius: var(--nc-r-pill); background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pl-zbtn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.pl-zbtn .ic { width: 18px; height: 18px; }
.pl-zbtn:active { background: var(--brand-soft); color: var(--brand); }
.zsym { font-size: 24px; font-weight: 600; line-height: 1; }
.pl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 6px 4px; font-size: 13px; color: var(--muted); }
.pl-lg { display: inline-flex; align-items: center; gap: 6px; }
.pl-lg i { width: 14px; height: 14px; border-radius: 4px; background: var(--c, var(--st-free)); border: 1.5px solid var(--b, var(--c, var(--st-free-line))); flex: none; }
.pl-lg b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pl-lg.st-o, .pl-lg.st-now { --c: var(--st-o); --b: var(--st-o-line); } .pl-lg.st-den, .pl-lg.st-later { --c: var(--st-den); --b: var(--st-den-line); } .pl-lg.st-di { --c: var(--st-di); --b: var(--st-di-line); }
.pl-lg.st-giu_cho i { background: var(--st-hold); border: 1.5px dashed var(--st-hold-line); }
.pl-lg.st-trong { --c: var(--st-free); --b: var(--st-free-line); } .pl-lg.st-bao_tri i { background: var(--st-fix) var(--hatch); border-color: var(--st-fix-line); }
.pl-lg.is-v { --c: var(--gold-soft); --b: var(--gold); } .pl-lg.is-chapel { --c: var(--sky-soft); --b: var(--nc-sky-strong); } .pl-lg.is-place { --c: var(--surface-2); --b: var(--line); }
.pl-lg.st-rieng { --c: var(--st-rieng); --b: var(--st-rieng-line); } .pl-lg.v-co { --c: var(--st-o); --b: var(--nc-gold); } .pl-lg.v-co i { border-width: 2px; } .pl-lg.mine { --c: var(--nc-brand); --b: var(--nc-brand); }
.pl-lg.hk-can_don { --c: var(--gold); --b: var(--gold-ink); } .pl-lg.hk-dang_don { --c: var(--st-den); --b: var(--st-den-line); } .pl-lg.hk-sach { --c: var(--st-free); --b: var(--st-free-line); }
.pl-mode { flex: 1 1 100%; }
.pl-extra { display: grid; gap: 8px; margin: 6px 4px 4px; }
.pl-extra:empty { display: none; }
.pl-hint { font-size: 14px; color: var(--muted); text-align: center; padding: 4px 0; }
.plan-space { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface-2); text-align: left; }
.plan-space > span { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.plan-space small { color: var(--muted); font-size: 13px; }
.plan-space.now { border-color: var(--st-o); background: var(--bad-soft); }
.plan-space.later { border-color: var(--st-den); }
/* bên trong sơ đồ (thay cho <style> trong tệp SVG: CSP chặn style nhúng). Theo đúng màu của so-do/*.svg trong bộ nhận diện */
.pl-inner svg .bg { fill: var(--nc-surface); }
.pl-inner svg .void { fill: none; stroke: var(--nc-line); stroke-width: 2; stroke-dasharray: 6 8; }
.pl-inner svg .title { font: 700 64px var(--nc-font-display); fill: var(--nc-ink); text-anchor: middle; opacity: .22; }
.pl-inner svg .sub { font: 600 22px var(--nc-font); fill: var(--nc-muted); text-anchor: middle; letter-spacing: .12em; opacity: .5; }
.pl-inner svg .sub2 { font: 600 13px var(--nc-font); fill: var(--nc-line); text-anchor: middle; letter-spacing: .2em; }
/* 1) nền theo loại ô (một class + một thuộc tính): phòng thường trung tính, phòng V vàng nhạt, nhà nguyện xanh trời nhạt, khu phụ xám */
.pl-inner svg .room path, .pl-inner svg .zone path, .pl-inner svg .zone rect { fill: var(--nc-room-fill); stroke: var(--nc-room-stroke); stroke-width: 1.2; transition: fill .15s, stroke .15s; }
.pl-inner svg .room text, .pl-inner svg .zone text { font: 600 12.5px var(--nc-font); fill: var(--nc-ink); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pl-inner svg .zone text { font-size: 13px; letter-spacing: .08em; fill: var(--nc-muted); }
.pl-inner svg .zone path, .pl-inner svg .zone rect { fill: var(--nc-surface-2); stroke: var(--nc-line); }
.pl-inner svg .room[data-kind="hall"] path, .pl-inner svg .room[data-kind="service"] path, .pl-inner svg .room.is-place path { fill: var(--nc-surface-2); stroke: var(--nc-line); }
.pl-inner svg .room[data-kind="hall"] text, .pl-inner svg .room[data-kind="service"] text, .pl-inner svg .room.is-place text { fill: var(--nc-muted); }
.pl-inner svg .room[data-type="v"] path { fill: var(--nc-gold-soft); stroke: var(--nc-gold); }
.pl-inner svg .room[data-kind="chapel"] path, .pl-inner svg .room.is-chapel path, .pl-inner svg .zone.is-chapel path, .pl-inner svg .zone.is-chapel rect { fill: var(--nc-sky-soft); stroke: var(--nc-sky-strong); }
.pl-inner svg .room[data-kind="chapel"] text, .pl-inner svg .room.is-chapel text, .pl-inner svg .zone.is-chapel text { fill: var(--nc-ink); }
.pl-inner svg .linked { cursor: pointer; outline: none; }
.pl-inner svg .room .pl-ico { fill: none; stroke: var(--nc-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.pl-inner svg .room .pl-ico .f { fill: var(--nc-muted); stroke: none; }
/* 2) tình trạng (hai class, đặt sau nên luôn thắng màu nền theo loại). occupied = có khách / nhà nguyện có lượt trùng giờ đang xem (đỏ) */
.pl-inner svg .linked.occupied path, .pl-inner svg .linked.occupied rect { fill: var(--st-o); stroke: var(--st-o-line); }
.pl-inner svg .linked.occupied text { fill: var(--on-st-o); }
.pl-inner svg .linked.st-den path, .pl-inner svg .linked.st-later path, .pl-inner svg .linked.st-later rect, .pl-inner svg .linked.hk-dang_don path { fill: var(--st-den); stroke: var(--st-den-line); }
.pl-inner svg .linked.st-den text, .pl-inner svg .linked.st-later text, .pl-inner svg .linked.hk-dang_don text { fill: var(--on-st-den); }
.pl-inner svg .linked.st-giu_cho path { fill: var(--st-hold); stroke: var(--st-hold-line); stroke-width: 1.6; stroke-dasharray: 5 3; }
.pl-inner svg .linked.st-giu_cho text { fill: var(--on-st-hold); }
.pl-inner svg .linked.st-di path, .pl-inner svg .linked.hk-can_don path { fill: var(--st-di); stroke: var(--st-di-line); }
.pl-inner svg .linked.st-di text, .pl-inner svg .linked.hk-can_don text { fill: var(--on-st-di); }
.pl-inner svg .linked.st-bao_tri path { fill: url(#nc-hatch); stroke: var(--st-fix-line); stroke-dasharray: 3 3; }
.pl-inner svg .linked.st-bao_tri text { fill: var(--on-st-fix); }
.pl-inner svg .linked.st-rieng path { fill: var(--st-rieng); stroke: var(--st-rieng-line); }
.pl-inner svg .linked.st-rieng text { fill: var(--on-st-rieng); }
.pl-inner svg .linked.v-co path { fill: var(--st-o); stroke: var(--nc-gold); stroke-width: 2.4; }
.pl-inner svg .linked.v-co text { fill: var(--on-st-o); }
/* trang của đoàn: phòng của đoàn tô xanh Núi Cúi */
.pl-inner svg .room.mine path { fill: var(--nc-brand); stroke: var(--nc-brand); }
.pl-inner svg .room.mine text { fill: var(--nc-on-brand); }
.pl-inner svg .hatch-bg { fill: var(--nc-surface-2); }
.pl-inner svg .hatch-line { stroke: var(--nc-muted); stroke-width: 1.5; opacity: .45; }
/* 3) di chuột / phím và ô đang mở ngăn kéo (selected: viền xanh dày) */
.pl-inner svg .linked:hover path, .pl-inner svg .linked:hover rect, .pl-inner svg .linked:focus-visible path { stroke: var(--nc-ink); stroke-width: 2.2; }
.pl-inner svg .linked.selected path, .pl-inner svg .linked.selected rect { stroke: var(--nc-brand); stroke-width: 3.5; stroke-dasharray: none; }

/* ---------- ảnh: ảnh bìa trong bảng, dải ảnh, xem trượt ---------- */
.ph { margin: 0 0 12px; display: grid; gap: 6px; }
.ph-cover { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.ph-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.ph-cover:active img { transform: scale(1.02); }
.ph-count { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--nc-r-pill); background: var(--nc-overlay); color: var(--on-photo); font-size: 13px; font-weight: 600; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ph-count .ic { width: 15px; height: 15px; }
.ph-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ph-mini { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.ph-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-mini span { position: absolute; inset: 0; display: grid; place-items: center; background: var(--nc-overlay); color: var(--on-photo); font-weight: 700; }
.ph-manage { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; font-size: 15px; font-weight: 600; color: var(--brand); padding: 0 2px; }
.ph-manage .ic { width: 16px; height: 16px; }
.ph-empty { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; padding: 8px 8px 8px 14px; border-radius: var(--r-md); border: 1.5px dashed var(--line-2); color: var(--muted); font-size: 14px; }
.ph-empty > span { flex: 1; min-width: 140px; }
.ph-empty .ph-manage { padding: 0 12px; border-radius: 10px; background: var(--brand-soft); }
.viewer { position: fixed; inset: 0; z-index: 150; background: var(--viewer-bg); color: var(--on-photo); display: flex; flex-direction: column; opacity: 0; transition: opacity .2s; outline: none; }
.viewer.in { opacity: 1; }
.vw-top { display: flex; align-items: center; gap: 6px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px 8px 16px; }
.vw-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.vw-title strong { font-size: 16px; overflow-wrap: anywhere; }
.vw-count { font-size: 13px; opacity: .75; font-variant-numeric: tabular-nums; }
.vw-btn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--on-photo); background: color-mix(in srgb, var(--on-photo) 12%, transparent); }
.vw-btn.on { background: var(--nc-brand); color: var(--nc-on-brand); }
.vw-stage { position: relative; flex: 1; min-height: 0; }
.vw-track { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.vw-track::-webkit-scrollbar { display: none; }
.vw-slide { flex: 0 0 100%; height: 100%; margin: 0; display: grid; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; }
.vw-slide img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.vw-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; display: none; place-items: center; background: color-mix(in srgb, var(--on-photo) 14%, transparent); color: var(--on-photo); }
.vw-nav:disabled { opacity: .25; }
.vw-nav.prev { left: 14px; } .vw-nav.next { right: 14px; }
@media (hover: hover) and (min-width: 700px) { .vw-nav { display: grid; } }
.vw-bottom { padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 12px); display: grid; gap: 10px; }
.vw-cap { text-align: center; font-size: 15px; opacity: .9; }
.vw-thumbs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; justify-content: safe center; }
.vw-thumbs::-webkit-scrollbar { display: none; }
.vw-thumb { flex: none; width: 64px; height: 48px; border-radius: 8px; overflow: hidden; opacity: .5; outline: 2px solid transparent; outline-offset: 1px; transition: opacity .15s; }
.vw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vw-thumb.on { opacity: 1; outline-color: var(--on-photo); }
.pm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.pm-item { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.pm-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-badge { position: absolute; left: 6px; top: 6px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: var(--nc-r-pill); background: var(--nc-brand); color: var(--nc-on-brand); }
.pm-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 12px; color: var(--on-photo); text-align: left; background: linear-gradient(transparent, var(--nc-overlay)); overflow-wrap: anywhere; }
.upload-busy { position: fixed; z-index: 220; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 14px); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--nc-r-pill); background: var(--ink); color: var(--surface); font-size: 15px; font-weight: 600; box-shadow: var(--shadow-lg); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.place-sheet .sp-list { grid-template-columns: 1fr; }

/* ---------- infographic: ô số, thanh chia phần, cột, xếp hạng (không có vạch màu trang trí) ---------- */
.info { display: grid; gap: 10px; margin-top: 16px; }
.info-hero { padding: 16px 16px 14px; display: grid; gap: 14px; }
.hero-num { display: flex; align-items: center; gap: 14px; }
.hn-v { font: 700 52px/1 var(--nc-font-display); letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.hn-v small { font-size: 26px; margin-left: 2px; color: var(--ink-2); }
.hn-l { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; min-width: 0; }
.hn-l strong { font-size: 16px; } .hn-l small { font-size: 14px; color: var(--muted); }
.segbar-wrap { display: grid; gap: 10px; }
.segbar { display: flex; gap: 2px; height: 22px; }
.segbar-part { min-width: 3px; background: var(--c); border-radius: 2px; }
.segbar-part:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.segbar-part:last-child { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.segbar-part.hollow { background: var(--c, var(--st-free)); box-shadow: inset 0 0 0 1px var(--st-free-line); }
.segbar-part.dashed { box-shadow: inset 0 0 0 1.5px var(--st-hold-line); }
.segbar-part.hatched { background: var(--st-fix) var(--hatch); box-shadow: inset 0 0 0 1px var(--st-fix-line); }
.segbar-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 14px; color: var(--ink-2); }
.segbar-legend li { display: flex; align-items: flex-start; gap: 7px; min-width: 0; }
.segbar-legend li > span { flex: 1; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.segbar-legend i { width: 12px; height: 12px; margin-top: 3px; border-radius: 4px; background: var(--c); flex: none; }
.segbar-legend i.hollow { box-shadow: inset 0 0 0 1px var(--st-free-line); }
.segbar-legend i.dashed { box-shadow: inset 0 0 0 1.5px var(--st-hold-line); }
.segbar-legend i.hatched { background: var(--st-fix) var(--hatch); box-shadow: inset 0 0 0 1px var(--st-fix-line); }
.segbar-legend b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.segbar-legend small { color: var(--muted); font-size: 12px; min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.segbar-legend li.zero { opacity: .5; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } .segbar-legend { grid-template-columns: repeat(3, 1fr); } }
.kpi { position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 1px; padding: 14px; background: var(--surface); border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: var(--shadow); }
button.kpi:active { transform: scale(.98); }
.kpi-v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 32px; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-l { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.kpi-s { font-size: 13px; color: var(--muted); }
.meter { display: block; height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: var(--c, var(--brand)); transition: width .3s; }
.meter-line { display: grid; gap: 5px; margin-top: 10px; }
.meter-line .meter { height: 6px; --c: var(--brand); }
.meter-line.done .meter { --c: var(--ok); }
.meter-line small { font-size: 13px; color: var(--muted); font-weight: 500; }
.info-row { padding: 14px 16px; display: grid; gap: 10px; }
.ir-head { display: flex; align-items: baseline; gap: 4px; }
.ir-head strong { font-size: 16px; }
.ir-head b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ir-head small { color: var(--muted); font-size: 13px; }
.cday { position: relative; border-radius: 10px; background: var(--surface-2); }
.cday-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.cday-b { position: absolute; height: 12px; min-width: 6px; border-radius: 4px; background: var(--c); box-shadow: 0 0 0 1.5px var(--surface-2); }
.cday-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; }
.cday-now::before { content: ''; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.cday-x { position: relative; height: 16px; font-size: 12px; color: var(--muted); }
.cday-x span { position: absolute; transform: translateX(-50%); }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rank-top { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.rank-l { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.rank-top b { font-variant-numeric: tabular-nums; }
.rank-top small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rank-bar { display: block; height: 10px; margin-top: 4px; }
.rank-bar i { display: block; height: 100%; background: var(--c); border-radius: 0 4px 4px 0; }
.colchart { display: grid; gap: 4px; }
.col-plot { position: relative; margin-top: 18px; }
.col-row { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; padding: 0; position: relative; }
.col i { display: block; width: 100%; background: var(--c); opacity: .8; border-radius: 4px 4px 0 0; min-height: 1px; transition: opacity .12s; }
.col.mark i { opacity: 1; box-shadow: 0 0 0 1.5px var(--ink); }
.col.on i, .col:hover i { opacity: 1; }
.col-grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.col-grid small { position: absolute; right: 0; top: -16px; font-size: 12px; color: var(--muted); background: var(--surface); padding-left: 4px; }
.col-tip { position: absolute; top: -16px; transform: translate(-50%, -100%); z-index: 3; background: var(--ink); color: var(--surface); padding: 7px 10px; border-radius: 10px; font-size: 13px; line-height: 1.35; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.col-tip span { opacity: .85; }
.col-x { position: relative; height: 16px; font-size: 12px; color: var(--muted); }
.col-x span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.table-box { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; margin-top: 6px; }
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.dtable th, .dtable td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtable th:first-child, .dtable td:first-child { text-align: left; }
.dtable th { position: sticky; top: 0; background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 600; }
.chart-card { padding: 14px 16px; display: grid; gap: 8px; align-content: start; }
.cc-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; }
.cc-head h2 { font-size: 17px; }
.cc-head small { color: var(--muted); font-size: 13px; }
.grid-2col { display: grid; gap: 10px; }
@media (min-width: 900px) { .grid-2col { grid-template-columns: 1fr 1fr; } }
.stats-body { display: grid; gap: 10px; }
.range-line { font-size: 14px; color: var(--muted); font-weight: 600; }
.stats-link { display: flex; align-items: center; gap: 12px; margin-top: 24px; min-height: 64px; padding: 12px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); }
.stats-link > .ic:first-child { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.stats-link span { display: flex; flex-direction: column; line-height: 1.3; }
.stats-link small { color: var(--muted); font-size: 14px; }
.pending-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; min-height: 64px; padding: 12px 14px; border-radius: var(--r); background: var(--gold-soft); border: 1.5px solid var(--gold); color: var(--ink); }
.pending-banner span.grow { display: flex; flex-direction: column; line-height: 1.3; }
.pending-banner small { font-size: 14px; color: var(--gold-ink); }
.pb-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--gold); color: var(--on-gold); flex: none; }

/* ---------- thẻ đoàn, chi tiết đoàn ---------- */
.bc-chips { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; align-items: center; flex: none; max-width: 50%; }
.tabs-x { margin: 0 -16px; }
.chip-filter.f-pending:not(.on) { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-ink); }
.review { padding: 14px 16px; display: grid; gap: 12px; border: 1.5px solid var(--gold); background: var(--surface); }
.rv-head { display: flex; align-items: center; gap: 12px; }
.rv-head > div { display: flex; flex-direction: column; line-height: 1.3; }
.rv-head small { color: var(--muted); font-size: 14px; }
.rv-req small { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.rv-req ul { margin: 6px 0 0; padding-left: 18px; font-size: 15px; display: grid; gap: 4px; }
.review .row-btns { margin-top: 0; }
.link-card { margin-top: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lc-text { flex: 1 1 200px; display: flex; flex-direction: column; line-height: 1.35; }
.lc-text strong { display: inline-flex; align-items: center; gap: 6px; }
.lc-text strong .ic { width: 18px; height: 18px; color: var(--brand); }
.lc-text small { color: var(--muted); font-size: 14px; }
.lc-btns { display: flex; gap: 8px; }
.pub-note-box { margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); font-size: 15px; }
.pub-note-box small { font-size: 12px; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; }
.in-line { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ok); margin-top: 2px; }
.in-line .ic { width: 16px; height: 16px; }
.in-line.wait { color: var(--gold-ink); background: none; padding: 0; }
.guest-mini { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; font-size: 15px; }
.guest-mini li { display: flex; align-items: center; gap: 8px; }
.guest-mini .ic { width: 15px; height: 15px; color: var(--muted); }
.guest-mini small { color: var(--muted); }
.guests-box { margin-top: 2px; }
.guests-box:empty { display: none; }
.sheet-extra { display: grid; gap: 8px; }
.sheet-extra:empty { display: none; }
.req-box { display: grid; gap: 8px; margin-bottom: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--gold-soft); border: 1.5px solid var(--gold); }
.req-box > small { font-size: 12px; font-weight: 600; color: var(--gold-ink); text-transform: uppercase; letter-spacing: .06em; }
.req-item { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.req-item > span { flex: 1; min-width: 0; }

/* ---------- nhận phòng từng phòng ---------- */
.ci { display: grid; gap: 10px; }
.ci-hero { padding: 14px 16px; display: grid; gap: 8px; }
.ci-hero .bc-top { align-items: center; }
.ci-hero h2 { font-size: 18px; overflow-wrap: anywhere; }
.ci-meta { color: var(--muted); font-size: 14px; }
.ci-prog { display: grid; gap: 8px; margin-top: 4px; }
.ci-nums { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-2); }
.ci-nums strong { font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.ci-self { padding: 12px; display: flex; gap: 14px; align-items: center; }
.ci-qr { flex: none; width: 112px; height: 112px; border-radius: 14px; overflow: hidden; background: var(--on-photo); border: 1px solid var(--line); }
.ci-qr img { width: 100%; height: 100%; display: block; }
.ci-self-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ci-self-text small { color: var(--muted); font-size: 14px; }
.ci-self-text .row-btns { margin-top: 8px; flex-wrap: wrap; }
.ci .search { margin-top: 4px; }
.ci-rooms { overflow: hidden; }
.ci-room { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.ci-room:last-child { border-bottom: 0; }
.ci-room:active { background: var(--surface-2); }
.ci-code { min-width: 58px; height: 48px; padding: 0 6px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 16px; background: var(--st-free); box-shadow: inset 0 0 0 1.5px var(--st-free-line); }
.ci-in .ci-code { background: var(--st-o); color: var(--on-st-o); box-shadow: none; }
.ci-wait .ci-code { background: var(--st-den); color: var(--on-st-den); box-shadow: none; }
.ci-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ci-info strong { font-size: 15px; overflow-wrap: anywhere; }
.ci-info small { font-size: 13px; color: var(--muted); }
.ci-wait .ci-info strong { color: var(--sky-ink); }
.ci-later .ci-info strong { color: var(--muted); font-weight: 600; }
.ci-n { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.ci-n .ic { width: 15px; height: 15px; }
.ci-bulk { margin-top: 18px; }
.g-forms { display: grid; gap: 10px; }
.g-box { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px 12px; margin: 0; display: grid; gap: 10px; background: var(--surface-2); min-width: 0; }
.gb-head { display: flex; align-items: center; justify-content: space-between; margin: -4px -4px -4px 0; }
.g-title { font-weight: 700; font-size: 15px; padding: 0; }
.g-list { list-style: none; margin: 10px 0 4px; padding: 0; display: grid; gap: 2px; }
.g-list li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.g-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700; flex: none; }
.g-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.g-main small { font-size: 13px; color: var(--muted); }
.grid3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.qr-full { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: var(--nc-overlay); opacity: 0; transition: opacity .2s; }
.qr-full.in { opacity: 1; }
.qr-card { width: min(380px, 100%); background: var(--surface); border-radius: var(--nc-r-sheet); padding: 22px; display: grid; gap: 12px; justify-items: center; text-align: center; box-shadow: var(--shadow-lg); }
.qr-card img { width: min(300px, 78vw); height: auto; image-rendering: pixelated; background: var(--on-photo); padding: 8px; border-radius: 12px; }
.qr-card small { word-break: break-all; }

/* ---------- nhật ký: biểu tượng xanh Núi Cúi trên nền xanh nhạt, không vạch màu ---------- */
.fam-chips { margin-top: 2px; }
.chip-filter.fam .ic { width: 16px; height: 16px; color: var(--brand); }
.chip-filter.fam.on .ic { color: var(--on-brand); }
.tline { list-style: none; margin: 0; padding: 4px 14px; }
.tline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tline li:last-child { border-bottom: 0; }
.tl-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.tl-ic .ic { width: 16px; height: 16px; }
.tl-body { flex: 1; min-width: 0; }
.tl-body p { font-size: 15px; overflow-wrap: anywhere; }
.tl-body small { font-size: 13px; color: var(--muted); }

/* ---------- quản trị: ảnh & nhận diện ---------- */
.brand-grid { display: grid; gap: 16px; }
.brand-slot { display: flex; gap: 14px; align-items: center; }
.brand-slot.wide { flex-direction: column; align-items: stretch; }
.brand-img { flex: none; width: 88px; height: 88px; border-radius: 50%; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-size: 12px; border: 1px dashed var(--line-2); }
.brand-img span { display: grid; justify-items: center; gap: 4px; text-align: center; }
.brand-slot.wide .brand-img { width: 100%; height: auto; aspect-ratio: 3 / 1; border-radius: var(--r-md); }
.brand-img img { width: 100%; height: 100%; object-fit: cover; }
.brand-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-meta small { color: var(--muted); font-size: 14px; }
.brand-meta .row-btns { margin-top: 8px; flex-wrap: wrap; }
.ph-thumb { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.ph-thumb.none .ic { width: 20px; height: 20px; }

/* ---------- trang cho khách (/dat-phong, /d/<mã>): ảnh tòa nhà làm bìa, logo tròn ---------- */
body.guest { background: var(--bg); }
.g { min-height: 100dvh; }
.g-head { position: relative; overflow: hidden; padding: 120px 18px 54px; color: var(--on-photo); background: var(--brand); }
.g-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.g-head::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--nc-overlay) 10%, transparent) 0%, var(--nc-overlay) 42%, var(--photo-shade) 100%); }
.g-brand, .g-head h2, .g-head h3 { text-shadow: var(--photo-text-shadow); }
.g-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; }
.g-logo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--on-photo); background: var(--surface); flex: none; }
.g-brand strong { display: block; font: 700 22px/28px var(--nc-font-display); }
.g-brand span { font-size: 14px; opacity: .9; }
.g-page { max-width: 760px; margin: -36px auto 0; padding: 0 16px 48px; position: relative; z-index: 2; display: grid; gap: 14px; }
.g-card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 16px; }
.g-card.form { gap: 14px; }
.g-sec { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-top: 6px; }
.g-sec.plain { margin: 0 0 10px; }
.g-sec .ic { width: 20px; height: 20px; color: var(--brand); }
.g-sec small { font-weight: 500; }
.g-step { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); font-size: 14px; font-weight: 700; flex: none; }
.g-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.g-avail { font-size: 14px; font-weight: 600; padding: 6px 10px; border-radius: 10px; }
.g-avail.ok { background: var(--ok-soft); color: var(--ok); } .g-avail.low { background: var(--gold-soft); color: var(--gold-ink); } .g-avail.full { background: var(--bad-soft); color: var(--bad-ink); }
.g-chapels { display: grid; gap: 10px; }
.g-head-row { display: flex; align-items: center; justify-content: space-between; margin: -4px -4px -4px 0; }
.g-head-row legend { font-weight: 700; font-size: 15px; padding: 0; }
.g-strip-sec { display: grid; gap: 0; }
.g-strip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; }
.g-page > .g-strip-sec:first-child > .g-sec { color: var(--on-photo); text-shadow: var(--photo-text-shadow); }
.g-strip::-webkit-scrollbar { display: none; }
.g-tile { flex: 0 0 min(62%, 240px); scroll-snap-align: start; background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.g-tile-img { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--surface-2); color: var(--muted); margin-bottom: 6px; }
.g-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-tile-img .ic { width: 30px; height: 30px; }
.g-tile strong { font-size: 15px; padding: 0 4px; }
.g-tile small { font-size: 13px; color: var(--muted); padding: 0 4px; }
.g-foot { text-align: center; }
.g-foot a { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; font-weight: 600; }
.g-contact { display: grid; gap: 10px; }
.g-contact p { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; color: var(--ink-2); }
.g-contact p .ic { color: var(--muted); margin-top: 2px; }
.g-success { display: flex; align-items: center; gap: 12px; background: var(--ok-soft); border-color: var(--ok); }
.g-success > .ic { width: 36px; height: 36px; padding: 7px; border-radius: 50%; background: var(--ok); color: var(--on-ok); }
.g-success div { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.g-success small { color: var(--ink-2); font-size: 14px; }
.g-status { display: grid; gap: 8px; }
.g-status h1 { font: 700 24px/30px var(--nc-font-display); overflow-wrap: anywhere; }
.g-pill { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; border-radius: var(--nc-r-pill); font-size: 13px; font-weight: 600; background: var(--brand-soft); color: var(--brand); }
.g-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-cho_duyet .g-pill { background: var(--gold-soft); color: var(--gold-ink); }
.st-da_nhan .g-pill { background: var(--bad-soft); color: var(--bad-ink); }
.st-huy .g-pill { background: var(--surface-2); color: var(--muted); }
.st-da_tra .g-pill { background: var(--surface-2); color: var(--ink-2); }
.g-dates { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 6px 0 2px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.g-dates > div:not(.g-mid) { display: flex; flex-direction: column; line-height: 1.3; }
.g-dates > div:last-child { text-align: right; }
.g-dates small { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.g-dates strong { font-size: 17px; font-weight: 700; }
.g-dates span { font-size: 13px; color: var(--muted); }
.g-mid { font-size: 13px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 6px 10px; border-radius: 10px; }
.g-sub { font-size: 15px; color: var(--ink-2); }
.g-note { padding: 12px 14px; border-radius: var(--r-md); background: var(--brand-soft); display: grid; gap: 4px; }
.g-note strong { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.g-req { font-size: 15px; }
.g-req strong { font-size: 14px; color: var(--muted); }
.g-req ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.g-mine { display: grid; gap: 8px; }
.g-mine > small { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.g-mine-list { display: flex; flex-wrap: wrap; gap: 10px; }
.g-mine-room { display: flex; flex-direction: column; padding: 8px 14px; border-radius: var(--r-md); background: var(--st-o); color: var(--on-st-o); line-height: 1.2; }
.g-mine-room strong { font: 700 24px/30px var(--nc-font-display); }
.g-mine-room span { font-size: 13px; opacity: .9; }
.g-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 12px; }
.g-room { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 64px; padding: 10px 6px; border-radius: var(--r-md); border: 1.5px solid var(--line-2); background: var(--surface); line-height: 1.2; transition: transform .08s; }
.g-room:active:not(:disabled) { transform: scale(.96); }
.g-room strong { font-size: 18px; font-weight: 700; }
.g-room small { font-size: 12px; color: var(--muted); }
.g-room .g-room-st { font-weight: 600; color: var(--sky-ink); }
.g-room.in { border-color: var(--st-o); background: var(--bad-soft); }
.g-room.in .g-room-st { color: var(--bad-ink); }
.g-room.off { opacity: .45; }
.g-floor { padding: 8px 0; border-bottom: 1px solid var(--line); }
.g-floor:last-child { border-bottom: 0; }
.g-floor small { font-size: 12px; color: var(--muted); font-weight: 600; }
.g-floor p { font-weight: 700; color: var(--brand); }
.g-sched { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.g-sched li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-md); background: var(--surface-2); }
.g-sched li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.g-sched li small { font-size: 13px; color: var(--muted); }
.g-time { display: flex; flex-direction: column; align-items: center; min-width: 48px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.g-time small { font-size: 12px; }
.g-thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; flex: none; }
.g-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-people { display: grid; gap: 8px; }
.g-person { display: grid; grid-template-columns: minmax(0, 1fr) 108px auto; gap: 8px; align-items: center; }
.g-person input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r-md); font-size: 16px; background: var(--surface); color: var(--ink); outline: none; -webkit-appearance: none; appearance: none; }
.g-person input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nc-focus) 30%, transparent); }

/* ======================================================================
   Màn hình theo bộ nhận diện: thẻ "Hôm nay" (nc-card--hero), nhà nguyện hôm nay (nc-slot), cần dọn hôm nay (chip)
   ====================================================================== */
.day-hero { display: grid; gap: 0; }
.dh-top { display: flex; align-items: center; gap: 2px; margin: -8px -8px 0 0; }
.dh-top .nc-label { flex: 1; }
.day-hero .icon-btn { color: inherit; }
.day-hero .icon-btn:active { background: color-mix(in srgb, var(--on-brand) 16%, transparent); }
.dh-date { position: relative; display: block; margin: 0 0 14px; cursor: pointer; }
.dh-date .nc-display { display: block; }
.dh-today { position: relative; display: inline-flex; align-items: center; min-height: 36px; margin: -4px 0 12px; padding: 0 12px; border-radius: var(--nc-r-pill); background: color-mix(in srgb, var(--on-brand) 16%, transparent); color: inherit; font-weight: 600; font-size: 14px; justify-self: start; }
.dh-today::after { content: ''; position: absolute; inset: -6px 0; }
.day-hero .nc-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.day-hero .nc-stat { min-width: 0; }
.day-hero .nc-stat span { display: block; overflow-wrap: anywhere; }
.slot-card { padding: 16px 16px 6px; }
.slot-card .nc-h3 { margin-bottom: 4px; }
.slot-card .nc-slot { width: 100%; text-align: left; min-height: 48px; }
.slot-card .nc-slot__who { overflow-wrap: anywhere; }
.slot-card .nc-slot__meta { overflow-wrap: anywhere; }
.slot-card .slot-body { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.slot-card .t-done { opacity: .6; }
.card-foot { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 6px; }
.clean-card { padding: 16px; display: grid; gap: 10px; }
.clean-card .card-foot { margin: 0 -4px -8px; }
.today-sec { margin-top: 16px; }

/* ---------- Hướng dẫn sử dụng (/huong-dan). Tiền tố hd- (g- là của trang đoàn) ---------- */
.guide { gap: 12px; }
.hd-list { display: grid; gap: 10px; }
.hd-head { margin: 10px 4px 0; font-size: 15px; color: var(--muted); }
.hd-topic { overflow: hidden; scroll-margin-top: calc(var(--top-h) + 8px); }
.hd-topic > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 14px 8px 16px; font-weight: 700; font-size: 16px; line-height: 1.3; color: var(--ink); cursor: pointer; }
.hd-topic > summary::-webkit-details-marker { display: none; }
.hd-topic > summary > span { flex: 1; min-width: 0; }
.hd-topic > summary .chev { transition: transform .15s; }
.hd-topic[open] > summary { border-bottom: 1px solid var(--line); }
.hd-topic[open] > summary .chev { transform: rotate(90deg); }
.hd-body { display: grid; gap: 12px; padding: 14px 16px 16px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.hd-body p { margin: 0; }
.hd-body strong { color: var(--ink); }
.hd-steps { margin: 0; padding: 0; list-style: none; counter-reset: hd; display: grid; gap: 10px; }
.hd-steps li { counter-increment: hd; position: relative; min-height: 26px; padding-left: 36px; }
.hd-steps li::before { content: counter(hd); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font: 700 13px/1 var(--nc-font); }
.hd-steps li:only-child { padding-left: 0; }
.hd-steps li:only-child::before { display: none; }
/* tên nút như trên màn hình; dài thì xuống dòng mà vẫn giữ khung */
.hd-btn { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); font-weight: 600; font-size: 14px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hd-sep { margin: 0 5px; color: var(--muted); font-weight: 700; }
.hd-tip { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--gold-soft); color: var(--gold-ink); }
.hd-tip .ic { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.hd-legend { padding: 0; gap: 8px 16px; font-size: 14px; color: var(--ink-2); }
.hd-roles { margin: 0; display: grid; gap: 2px; }
.hd-roles dt { margin-top: 6px; font-weight: 700; color: var(--ink); }
.hd-roles dt:first-child { margin-top: 0; }
.hd-roles dd { margin: 0; }
.hd-shot { margin: 2px 0 0; display: grid; justify-items: center; gap: 6px; }
.hd-shot img { width: 100%; max-width: 300px; height: auto; border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface-2); }
.hd-shot figcaption { font-size: 13px; line-height: 1.4; color: var(--muted); text-align: center; }
.hd-open { justify-self: start; }
.hd-ic { display: inline-flex; align-items: center; vertical-align: -4px; padding: 2px 5px; }
.hd-ic .ic { width: 16px; height: 16px; }

/* ---------- trang của đoàn: sơ đồ phòng ---------- */
.g-plan .pl-group { margin-top: 10px; }
.g-plan .pl-legend { padding-bottom: 0; }
