* { box-sizing: border-box }
[hidden] { display: none !important }
/* Bộ thiết kế Ezibee theo bản bàn giao 04/12/2026 (design/ui.css, docs/03-giao-dien.md): token màu, chữ 14/20,
   khoảng cách 4/8/12/16/24, bo góc 6 (nhãn), 8 (nút, ô nhập), 10 (ô bàn), 12 (thẻ), 16 (hộp thoại). */
:root {
  font-size: 16px;
  --ink: #17313a; --soft: #547078; --muted: #547078; --paper: #fff; --canvas: #f3f7f7;
  --line: #dce7e8; --line2: #b4c7ca; --control: #b4c7ca; --ctl: #7a9298;
  --navy: #123c49; --deep: #0c2b34; --navy-active: #17505e; --orange: #f29d49;
  --teal: #0b7468; --teal-strong: #0b7468; --teal-hover: #095e55; --teal-soft: #dff5f1;
  --danger: #a33a3a; --danger-soft: #fdf0ef;
  --occ: #c43a13; --occ-soft: #fdeee8; --occ-ink: #8f2a0c; --due: #7a4694; --due-soft: #f3eaf8; --due-ink: #5b2f74;
  --arr: #f2b134; --arr-on: #2b1d00; --arr-soft: #fff5dc; --arr-ink: #6b4600;
  --vac: #1f7a45; --vac-soft: #dff2e6; --vac-ink: #14573a;
  --dirty: #7d5742; --dirty-soft: #f4ebe6; --dirty-ink: #5e3f2e; --cln: #2a6f97; --cln-soft: #e4f0f8; --cln-ink: #1d4f6e;
  --ooo: #5d6b70; --ooo-soft: #edf0f1; --ooo-ink: #3f4b4f;
  --felt: #0b7468; --felt-rail: #08564e; --felt-off: #edf3f3; --felt-off-rail: #dbe6e6;
}
body { background: var(--canvas); color: var(--ink); font: 14px/20px Inter, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased }
body, h1, h2, h3, h4, p { margin: 0 }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
button:disabled { cursor: default; opacity: .55 }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--teal-strong); outline-offset: 2px }
button i { font-style: normal }
/* Biểu tượng nét 1,75 trên lưới 24 px, màu theo chữ (mục 6 của đặc tả giao diện) */
.icon, .sidebar svg, .command svg, .button svg, .profile svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round }
.app-shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 100dvh }
.sidebar { background: var(--deep); color: #c4d6da; padding: 0 8px 8px; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; overflow: auto }
.brand { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 8px; color: white; font-size: 18px; font-weight: 800; letter-spacing: -.01em; flex: none }
.brand span { display: grid; place-items: center; background: var(--orange); color: var(--deep); border-radius: 8px; width: 28px; height: 28px; font-size: 15px }
.brand-kind { padding: 1px 6px; border: 1px solid #f29d4999; border-radius: 6px; color: var(--orange); font-size: 11px; line-height: 14px; font-weight: 700; font-style: normal; letter-spacing: 0 }
.brand-kind:empty { display: none }
.sidebar nav { display: flex; flex-direction: column; gap: 2px }
.sidebar nav p { padding: 14px 10px 6px; color: #8fb0b6; text-transform: uppercase; font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .08em }
.sidebar nav button { border: 0; border-radius: 8px; background: transparent; color: #c4d6da; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; width: 100%; text-align: start; font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap }
.sidebar nav button svg { color: #8fb0b6 }
.sidebar nav button:hover { background: #ffffff14 }
.sidebar nav button:focus-visible, .profile button:focus-visible { outline-color: #ffd08a }
.sidebar nav button[aria-current="page"] { color: white; background: var(--navy-active) }
.sidebar nav button[aria-current="page"] svg { color: var(--orange) }
.profile { border-top: 1px solid #ffffff22; margin-top: auto; padding: 12px 4px 4px; display: flex; align-items: center; gap: 10px }
.profile small { display: block; color: #8fb0b6; font-size: 12px; line-height: 16px }
.profile button { margin-left: auto; color: #b5c9cd; border: 0; background: transparent; padding: 6px; border-radius: 8px; display: grid; place-items: center }
.profile button:hover { background: #ffffff14 }
.profile .account { margin: 0; padding: 0; display: block; color: white; font-size: 14px; text-align: start; min-width: 0; overflow-wrap: anywhere }
.profile .account:hover { background: transparent }
.profile .account:hover strong { text-decoration: underline }
.avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--navy-active); color: white; font-size: 12px; font-weight: 700 }
.workspace { min-width: 0 }
.command { background: white; border-bottom: 1px solid var(--line); padding: 8px 16px 10px; display: grid; gap: 10px }
.topline, .controls { display: flex; align-items: center; gap: 12px; min-width: 0 }
.topline { flex-wrap: wrap; min-height: 36px }
.topline h1 { font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: -.01em }
.controls { justify-content: space-between }
.switch { display: inline-flex; height: 36px; border: 1px solid var(--line2); border-radius: 8px; flex: none; overflow: hidden; background: white }
.switch button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 34px; padding: 0 14px; border: 0; background: transparent; font-weight: 600; font-size: 13px; white-space: nowrap }
.switch button:hover:not([aria-pressed="true"]):not(:disabled) { background: var(--teal-soft) }
.switch button[aria-pressed="true"] { background: var(--navy); color: white }
.search { display: flex; flex: 0 1 260px; min-width: 150px; height: 36px; align-items: center; gap: 8px; border: 1px solid var(--ctl); border-radius: 8px; padding: 0 10px; background: white; color: var(--soft) }
.search input { width: 100%; min-height: 0; height: 32px; padding: 0; border: 0; outline: 0; background: transparent; font-size: 14px; color: var(--ink) }
.search:focus-within { outline: 2px solid var(--teal-strong); outline-offset: 2px }
#business-clock { margin-left: auto; color: var(--soft); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums }
.power-summary { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--vac-soft); color: var(--vac-ink); font-weight: 600; font-size: 13px; white-space: nowrap }
.power-summary.pending { background: var(--arr-soft); color: var(--arr-ink) }
.power-summary:not([hidden]) ~ #business-clock, .power-summary:not([hidden]) ~ .shift-chip,
.shift-chip:not([hidden]) ~ #business-clock { margin-left: 0 }
.shift-chip { margin-left: auto; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 32px; padding: 0 12px; border: 1px solid #b9dccb; border-radius: 999px; background: #e8f5ef; color: var(--vac-ink); font-size: 13px; font-weight: 600 }
.shift-chip.closed { background: var(--arr-soft); color: var(--arr-ink); border-color: #ecd29f }
.filters { display: flex; gap: 8px; overflow: auto; padding: 2px; scrollbar-width: thin }
.filter { border: 1px solid var(--line2); background: white; border-radius: 999px; flex: none; height: 32px; padding: 0 12px; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums }
.filter:hover:not([aria-pressed="true"]) { background: var(--teal-soft) }
.filter[aria-pressed="true"] { background: var(--navy); color: white; border-color: var(--navy) }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--dot, #688189) }
.filter[data-status="free"] .dot { background: transparent; border: 1.5px solid var(--vac) }
.filter[data-status="free"][aria-pressed="true"] .dot { border-color: #9fe4c2 }
/* Màu trạng thái: yên thì nhạt, việc cần làm thì đậm */
[data-status="active"] { --dot: var(--occ); --state-bg: var(--occ); --state-fg: #fff }
[data-status="unpaid"], [data-status="due"] { --dot: var(--due); --state-bg: var(--due); --state-fg: #fff }
[data-status="booking"] { --dot: var(--arr); --state-bg: var(--arr); --state-fg: var(--arr-on) }
[data-status="cleaning"] { --dot: var(--cln); --state-bg: var(--cln); --state-fg: #fff }
[data-status="dirty"] { --dot: var(--dirty); --state-bg: var(--dirty); --state-fg: #fff }
[data-status="suspended"] { --dot: var(--ooo); --state-bg: var(--ooo-soft); --state-fg: var(--ooo-ink) }
[data-status="pending"] { --dot: #ad7215; --state-bg: var(--arr-soft); --state-fg: var(--arr-ink) }
[data-status="free"] { --dot: var(--vac); --state-bg: var(--vac-soft); --state-fg: var(--vac-ink) }
.desk { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100dvh - 6.64rem) }
.desk:has(.detail:not([hidden])) { grid-template-columns: minmax(0, 1fr) clamp(340px, 27vw, 400px) }
/* Sơ đồ bàn theo bản bàn giao 04/12 (mục 4): đầu khu, lưới ô 188px, ô có dải đầu 32px, mặt nỉ 76px, thân, nút 32px */
.board { min-width: 0; padding: 16px; display: grid; align-content: start; gap: 16px; --tile-width: 188px }
.board[data-density="compact"] { --tile-width: 136px }
.board[data-density="large"] { --tile-width: 256px }
.floor { display: grid; gap: 8px; min-width: 0 }
.floor-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px }
.floor-head h2 { font-size: 16px; line-height: 22px; font-weight: 700 }
.floor-head .push { margin-left: auto }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--tile-width)), 1fr)) }
.tile { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: 0 1px 2px rgba(14, 52, 61, .1); overflow: hidden; cursor: pointer; font-variant-numeric: tabular-nums; transition: box-shadow .16s }
.tile:hover { box-shadow: 0 8px 20px rgba(14, 52, 61, .16) }
.tile[aria-selected="true"] { border-color: var(--teal-strong); box-shadow: 0 0 0 1px var(--teal-strong), 0 8px 20px rgba(14, 52, 61, .16) }
.tile:focus-visible { outline: 2px solid var(--teal-strong); outline-offset: 2px }
.tile-head { display: flex; flex: none; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; background: var(--state-bg); color: var(--state-fg) }
.tile-head strong { font-size: 20px; line-height: 24px; font-weight: 700; white-space: nowrap }
.tile-head span { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0 }
.tile-head small { margin-left: auto; flex: none; max-width: 7em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; font-weight: 700; letter-spacing: .08em }
.felt { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 76px; margin: 10px 10px 0; padding: 0 16px; border-radius: 10px; text-align: center; pointer-events: none }
.felt.on { background: var(--felt); color: #fff; box-shadow: inset 0 0 0 6px var(--felt-rail) }
.felt.off { background: var(--felt-off); color: var(--soft); box-shadow: inset 0 0 0 6px var(--felt-off-rail) }
.felt.ooo { color: var(--ooo-ink); background: repeating-linear-gradient(135deg, #edf0f1 0 8px, #e2e7e9 8px 16px); box-shadow: inset 0 0 0 6px #d9e0e2 }
.felt.room.on { background: var(--navy); box-shadow: inset 0 0 0 6px var(--deep) }
.felt.pk::before { content: ""; position: absolute; inset: 0; border-radius: 10px; pointer-events: none; background: radial-gradient(circle at 9px 9px, rgba(0, 0, 0, .42) 4px, transparent 4.5px), radial-gradient(circle at 50% 6px, rgba(0, 0, 0, .42) 3.5px, transparent 4px), radial-gradient(circle at calc(100% - 9px) 9px, rgba(0, 0, 0, .42) 4px, transparent 4.5px), radial-gradient(circle at 9px calc(100% - 9px), rgba(0, 0, 0, .42) 4px, transparent 4.5px), radial-gradient(circle at 50% calc(100% - 6px), rgba(0, 0, 0, .42) 3.5px, transparent 4px), radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), rgba(0, 0, 0, .42) 4px, transparent 4.5px) }
.felt.balls::after { content: ""; position: absolute; inset: 0; border-radius: 10px; pointer-events: none; background: radial-gradient(circle at 10% 36%, #fff 3.5px, transparent 4px), radial-gradient(circle at 90% 64%, #f2b134 3.5px, transparent 4px), radial-gradient(circle at 90% 36%, #c43a13 3.5px, transparent 4px), radial-gradient(circle at 10% 64%, #2a6f97 3.5px, transparent 4px) }
.felt .tm { position: relative; z-index: 1; font-size: 24px; line-height: 28px; font-weight: 700; letter-spacing: -.01em }
.felt.off .tm { color: var(--ink) }
.felt .fs { position: relative; z-index: 1; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; line-height: 16px; font-weight: 600 }
.felt .fs.tag { padding: 0 6px; border-radius: 6px; background: #ffffffcc }
.tile-body { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; padding: 8px 10px 10px }
.tile-name { font-size: 14px; line-height: 18px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.tile-meta { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 18px }
.tile-meta .meta { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.tile-meta .meta.alert { color: var(--danger); font-weight: 650 }
.tile-amount { margin-left: auto; flex: none; font-size: 13px; line-height: 18px; font-weight: 650; white-space: nowrap }
.tile-amount.debt { color: var(--danger) }
.tile-amount.soon { color: var(--arr-ink) }
/* Mật độ Gọn (bản bàn giao: bỏ mặt nỉ): chỉ giữ đồng hồ trên một dải mảnh, ô trống không có dải */
.board[data-density="compact"] .felt { height: 28px; margin: 8px 8px 0; box-shadow: none }
.board[data-density="compact"] .felt:not(:has(.tm)) { display: none }
.board[data-density="compact"] .felt::before, .board[data-density="compact"] .felt::after, .board[data-density="compact"] .felt .fs { display: none }
.board[data-density="compact"] .felt .tm { font-size: 16px; line-height: 20px }
.board[data-density="compact"] .tile-head small, .board[data-density="compact"] .tile-actions .tile-alt { display: none }
/* Cỡ Lớn (mặc định khi mở trang): ô từ 256px; số bàn, đồng hồ, tên khách, số tiền và nút to hơn khoảng 30%. Màn hẹp dưới 760px giữ ô Tiêu chuẩn. */
@media (min-width: 761px) {
  .board[data-density="large"] .floor-head h2 { font-size: 18px; line-height: 24px }
  .board[data-density="large"] .tile-head { gap: 10px; height: 40px; padding: 0 10px 0 12px }
  .board[data-density="large"] .tile-head strong { font-size: 26px; line-height: 30px }
  .board[data-density="large"] .tile-head span { font-size: 14px }
  .board[data-density="large"] .tile-head small { font-size: 13px }
  .board[data-density="large"] .power-chip { height: 24px; padding: 0 8px; font-size: 13px }
  .board[data-density="large"] .felt { height: 100px; margin: 12px 12px 0; padding: 0 20px }
  .board[data-density="large"] .felt .tm { font-size: 32px; line-height: 38px }
  .board[data-density="large"] .felt .fs { font-size: 14px; line-height: 18px }
  .board[data-density="large"] .tile-body { gap: 6px; padding: 10px 12px 12px }
  .board[data-density="large"] .tile-name { font-size: 17px; line-height: 22px }
  .board[data-density="large"] .tile-meta { min-height: 20px }
  .board[data-density="large"] .tile-meta .meta { font-size: 14px; line-height: 18px }
  .board[data-density="large"] .tile-amount { font-size: 16px; line-height: 20px }
  .board[data-density="large"] .tile-actions { gap: 8px; padding-top: 8px }
  .board[data-density="large"] .tile-actions .button { min-height: 40px; font-size: 15px }
}
.detail { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 16px; background: var(--paper); border-left: 1px solid var(--line); font-variant-numeric: tabular-nums }
.detail h2 { font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: -.01em }
.detail header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start }
.detail .sub { margin-top: 2px; color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 500 }
.detail .title-row { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--state-bg); color: var(--state-fg); font-size: 12px; font-weight: 600; white-space: nowrap }
.clock-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px; background: var(--canvas) }
.clock-card .clock-big { font-size: 40px; line-height: 46px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums }
.clock-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 500 }
.clock-meta .button { margin-left: auto }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px }
.panel-row { display: flex; align-items: center; gap: 8px }
.panel-row > div { display: grid; flex: 1; gap: 2px; min-width: 0 }
.panel-section { display: grid; gap: 10px; font-size: 13px; line-height: 18px }
.panel-section + .panel-section { border-top: 1px solid var(--line); padding-top: 12px }
.panel-section .between strong { font-weight: 650 }
.qty-pill { display: inline-grid; place-items: center; min-width: 32px; height: 26px; padding: 0 8px; border: 1px solid var(--line2); border-radius: 8px; font-weight: 650 }
.slip-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 13px }
.slip-row > div { display: grid; gap: 2px; min-width: 0 }
.slip-row > strong { white-space: nowrap; font-weight: 650 }
.slip-row.voided { color: var(--soft) }
.slip-row.voided > div > strong { text-decoration: line-through }
.event-log { display: grid; margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 18px }
.event-log li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line) }
.event-log li > :last-child { grid-column: 2 }
.muted { color: var(--soft); font-size: 13px; line-height: 18px }

.between { display: flex; justify-content: space-between; align-items: center; gap: .5rem }

.service-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 84px; gap: 10px; align-items: center; font-size: 13px }
.service-row > :last-child { text-align: right; white-space: nowrap }
.total { border-top: 1px solid var(--line); padding-top: .62rem; font-weight: 720; font-variant-numeric: tabular-nums }
.total strong { font-size: 1.36rem }
.detail .total { padding-top: 12px; font-weight: 650 }
.detail .total strong { font-size: 24px; line-height: 30px; font-weight: 700 }
.actions { margin-top: auto; display: grid; gap: 8px }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px }
.action-grid .button { min-width: 0; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.actions > .primary { min-height: 44px; font-size: 15px }
.button, input, select, textarea { border: 1px solid var(--ctl); border-radius: 8px; background: white; min-height: 36px; padding: 0 10px; font-size: 14px }
textarea { padding: 8px 10px; resize: vertical }
input[type="checkbox"], input[type="radio"] { min-height: 0; padding: 0; accent-color: var(--teal-strong) }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border-color: var(--line2); color: var(--ink); font-size: 14px; font-weight: 600; line-height: 18px; white-space: nowrap; text-decoration: none }
.button:hover:not(:disabled) { background: var(--teal-soft) }
.button.primary { background: var(--teal-strong); color: white; border-color: var(--teal-strong) }
.button.primary:hover:not(:disabled) { background: var(--teal-hover) }
.button.icon { width: 36px; flex: none; padding: 0; font-size: 18px }
.button.small { min-height: 32px; font-size: 13px; padding: 0 10px }
.button.large { min-height: 44px; font-size: 15px }
.button.danger { color: var(--danger); border-color: #e0b4b4 }
.button.ghost { border-color: transparent; background: transparent }
.page { padding: 16px; min-width: 0 }
.page-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px }
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; background: white }
table { border-collapse: collapse; width: 100%; font-size: 13px; line-height: 18px; text-align: start; font-variant-numeric: tabular-nums }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle }
thead th { background: #f8fbfb; color: var(--soft); font-size: 12px; font-weight: 600; white-space: nowrap }
tbody tr:hover > td { background: #f8fbfb }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0 }
th.num, td.num { text-align: right; white-space: nowrap }
.calendar th, .calendar td { min-width: 2.4rem; text-align: center; padding: .36rem .32rem }
.calendar tbody th { position: sticky; left: 0; min-width: 4rem; background: white }
.calendar td button { border: 0; min-width: 1.78rem; min-height: 1.5rem; border-radius: .27rem; background: #f4f8f8; font-size: .73rem }
.calendar td .booked { background: #ffedc7; color: #795218; font-weight: 750 }
.calendar td .used { background: #fce9e2; color: #98361b; font-weight: 750 }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .6rem }
.summary-grid button { display: grid; text-align: start; padding: .7rem; gap: .2rem; border-left: .25rem solid var(--dot, var(--teal)) }
.summary-grid button strong { font-size: 1.15rem }
.empty { padding: 16px; color: var(--soft); border: 1px dashed var(--line2); border-radius: 12px; background: white }
.notice { position: fixed; z-index: 10; right: 16px; top: 16px; max-width: min(26rem, calc(100% - 32px)); padding: 10px 14px; background: var(--arr-soft); color: var(--arr-ink); border: 1px solid #e8cf9e; border-radius: 10px; box-shadow: 0 8px 24px #17313a22; font-weight: 500 }
.login { background: white; border: 1px solid var(--line); border-radius: 16px; width: min(24rem, calc(100% - 32px)); margin: 8vh auto 16px; padding: 20px; box-shadow: 0 16px 40px rgba(7, 35, 42, .12) }
.login .brand { color: var(--ink); padding-left: 0; min-height: 44px }
.login h1 { font-size: 20px; line-height: 28px }
.login form, dialog #dialog-body { display: grid; gap: 12px; margin-top: 12px }
dialog #dialog-body { margin: 0; padding: 16px 20px }
form label { display: grid; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600 }
form label :is(input,select,textarea) { width: 100%; font-weight: 400 }
.dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
dialog { width: min(32rem, calc(100% - 24px)); max-height: min(90dvh, 48rem); overflow: auto; padding: 0; border: 0; border-radius: 16px; box-shadow: 0 16px 40px rgba(7, 35, 42, .22); color: inherit }
dialog::backdrop { background: #09272f9e }
.dialog-head, .dialog-footer { display: flex; justify-content: space-between; gap: 10px; align-items: center }
.dialog-head { position: sticky; top: 0; z-index: 2; padding: 16px 20px; background: white; border-bottom: 1px solid var(--line) }
.dialog-head h2 { font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: -.01em }
.dialog-titles { flex: 1; min-width: 0 }
.dialog-titles .title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px }
.dialog-head .sub { margin: 2px 0 0; color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 500 }
.dialog-footer { position: sticky; bottom: 0; z-index: 2; flex-wrap: wrap; justify-content: end; padding: 14px 20px; background: #f8fbfb; border-top: 1px solid var(--line) }
.dialog-note { flex: 1 1 12rem; min-width: 0; margin: 0; color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 500 }
.dialog-tools { display: flex; flex-wrap: wrap; gap: 8px }
.dialog-tools:empty { display: none }
#action-error { color: var(--danger); margin: 0 20px 12px; font-size: 13px; font-weight: 600 }
.context-menu { position: fixed; z-index: 8; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; box-shadow: 0 8px 24px #17313a30; display: grid; min-width: 11rem }
.context-menu button { border: 0; border-radius: 6px; background: transparent; padding: 8px 10px; text-align: start; font-size: 13px; font-weight: 500 }
.context-menu button:hover { background: var(--teal-soft) }
.payment-check { display: flex; gap: .55rem; align-items: center; padding: .36rem .2rem }
.payment-check input { width: 1rem; min-height: 1rem; accent-color: var(--teal); flex: none }
.tabs-note { color: var(--soft); font-size: 13px }
/* Thẻ, chữ phụ, thẻ chọn, nhãn sắc thái, chỉ số (lớp dùng chung của bản bàn giao) */
.card { background: white; border: 1px solid var(--line); border-radius: 12px }
.cap { color: var(--soft); font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase }
.meta { color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 500 }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin }
.tabs > button { margin-bottom: -1px; padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--soft); font-size: 14px; font-weight: 600; white-space: nowrap }
.tabs > button[aria-selected="true"] { color: var(--ink); border-color: var(--teal-strong) }
.t-ok { background: var(--vac-soft); color: var(--vac-ink) }
.t-warn { background: var(--arr-soft); color: var(--arr-ink) }
.t-bad { background: var(--danger-soft); color: var(--danger) }
.t-info { background: var(--cln-soft); color: var(--cln-ink) }
.t-mute { background: var(--ooo-soft); color: var(--ooo-ink) }
.kpi { padding: 14px 16px; display: grid; gap: 4px; align-content: start }
.kpi strong { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums }
.live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--vac); flex: none; animation: live 1.6s infinite }
@keyframes live { 50% { opacity: .25 } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important } }
@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 184px minmax(0, 1fr) }
  .desk:has(.detail:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(15.5rem, 19rem) }
  .detail { padding: .72rem }
  .floor { grid-template-columns: 1fr; gap: .27rem }
  .floor-label { display: flex; align-items: baseline; gap: .45rem }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: minmax(0, 1fr) }
  .sidebar { position: static; height: auto; padding: .35rem .6rem; display: grid; grid-template-columns: 1fr auto; gap: .22rem }
  .sidebar .brand { padding: 0; min-height: 40px }
  .sidebar nav { grid-column: 1 / -1; order: 1; display: flex; flex-direction: row; overflow-x: auto }
  .sidebar nav p, .sidebar nav button svg, .sidebar .brand-kind, .profile .avatar, .profile small { display: none }
  .sidebar nav button { width: auto; white-space: nowrap; min-height: 32px }
  .profile { padding: 0; border: 0; font-size: .84rem }
  .command { padding: .55rem .65rem; gap: .5rem }
  .search { flex: 1 1 11rem }
  #business-clock, .power-summary { font-size: .72rem }
  .board, .page { padding: .65rem }
  /* Thanh lọc tràn sát hai mép theo lề trang hẹp (lề .65rem), không đẩy trang rộng hơn màn hình. */
  .page > .subbar { margin-left: -.65rem; margin-right: -.65rem }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)) }
  .desk:has(.detail:not([hidden])) { grid-template-columns: minmax(0, 1fr) }
  .detail { grid-row: 1; border-left: 0; border-bottom: 1px solid var(--line) }
  .density { display: none }
}
@media print {
  body > :not(dialog) { display: none !important }
  dialog, dialog.wide-dialog { position: static; width: 100%; max-width: none; max-height: none; overflow: visible; border: 0; padding: 0 2mm; margin: 0; box-shadow: none }
  dialog::backdrop { display: none }
  dialog button, #action-error, .dialog-footer { display: none !important }
}

/* Ô vị trí theo bản bàn giao 04/12: mờ khi không khớp bộ lọc, chỉ báo điện, hẹn giờ, nút nhanh theo trạng thái */
.tile.dim { opacity: .3 }
.tile.dim:focus-visible, .tile.dim:focus-within { opacity: 1 }
.power-chip { margin-left: auto; flex: none; display: flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; background: #fff; color: var(--danger); font-size: 12px; font-weight: 600; white-space: nowrap }
.tile-progress { position: absolute; left: 0; bottom: 0; width: 0; height: 3px; background: var(--teal-strong) }
.tile-progress.warn { background: var(--danger) }
/* Dải báo mất kết nối (bản bàn giao screens/so-do-ban.html, offline-banner): đỏ nhạt khi mất mạng, xanh khi đang gửi lệnh đã lưu,
   vàng khi có lệnh không ghi được hoặc lệnh của tài khoản khác chờ gửi. */
.offline-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 16px 0; padding: 10px 12px; border: 1px solid #ecc9c9; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 13px; line-height: 18px; font-weight: 600 }
.offline-banner svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }
.offline-banner span { flex: 1 1 16rem }
.offline-banner .offline-sync, .offline-banner[data-tone="sync"] .offline-warn { display: none }
.offline-banner[data-tone="sync"] .offline-sync { display: block }
.offline-banner[data-tone="sync"] { background: var(--teal-soft); color: var(--teal-strong); border-color: #b5e2d9 }
.offline-banner[data-tone="warn"] { background: var(--arr-soft); color: var(--arr-ink); border-color: #f0dba6 }
.power-chip.sync-chip { color: var(--teal-strong) }
.tile-actions { position: relative; z-index: 1; display: flex; gap: 6px; margin-top: auto; padding-top: 6px }
.tile-actions .button { flex: 1 1 0; min-width: 0; min-height: 32px; padding: 0 8px; font-size: 13px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.tile-actions .tile-open, .tile-actions .tile-pay { flex: 1; background: var(--teal-strong); color: #fff; border-color: var(--teal-strong) }
.tile-actions .tile-open:hover:not(:disabled), .tile-actions .tile-pay:hover:not(:disabled) { background: var(--teal-hover) }
.tile-actions .tile-service { display: inline-flex; align-items: center; justify-content: center; gap: 4px }
.board:not([data-density="compact"]) .tile-service svg { display: none }
.board[data-density="compact"] .tile-actions .tile-service { flex: 0 0 2rem }
.board[data-density="compact"] .tile-service span { display: none }
.tile-service svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round }
/* Gọi món, phiếu Minibar và Quầy nhanh (mẫu Gọi món, Quầy nhanh của bản bàn giao) */
.chips { display: flex; flex-wrap: wrap; gap: .4rem }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); border-radius: 999px; background: white; min-height: 32px; padding: 0 12px; font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums }
.chip:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--teal-soft) }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: white }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.4rem), 1fr)); gap: .6rem; align-content: start; padding: .1rem }
.product { position: relative; display: flex; flex-direction: column; gap: .12rem; min-height: 4.75rem; padding: .6rem .72rem; text-align: start; border: 1px solid var(--line); border-radius: .62rem; background: white; font-variant-numeric: tabular-nums }
.product:hover:not(:disabled) { border-color: var(--teal); background: #dff5f1 }
.product:disabled { opacity: 1; background: #f8fbfb; color: var(--muted) }
.product strong { font-size: .88rem; line-height: 1.25; padding-right: 1.4rem; overflow-wrap: anywhere }
.product-price { font-size: .84rem }
.product small { color: var(--muted); font-size: .75rem; font-weight: 500 }
.product small.stock-warn, .stock-warn { color: #6b4600; font-weight: 650 }
.product small.stock-out, .stock-out { color: #a33a3a; font-weight: 650 }
.product-count { position: absolute; top: .4rem; right: .45rem; min-width: 1.4rem; height: 1.4rem; padding: 0 .3rem; border-radius: 1rem; background: var(--teal); color: white; font-size: .72rem; display: grid; place-items: center }
.qty { display: inline-flex; align-items: center; flex: none; border: 1px solid #b4c7ca; border-radius: .45rem; overflow: hidden; background: white }
.qty button { width: 1.85rem; height: 1.85rem; border: 0; background: transparent; font-size: 1rem; line-height: 1 }
.qty button:hover:not(:disabled) { background: #dff5f1 }
.qty output { min-width: 1.6rem; text-align: center; font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums }
.qty button:disabled { color: #a3b3b6; cursor: default }
/* Ô số của món đã gọi ở bảng bên phải: nhỏ hơn ô số trong hộp thoại. */
.service-qty button { width: 1.65rem; height: 1.65rem }
.service-qty output { min-width: 1.9rem }
.cart-lines { display: grid; gap: .5rem; align-content: start }
.cart-line { display: grid; gap: .35rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: .62rem; background: white; font-variant-numeric: tabular-nums }
.cart-head, .cart-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-width: 0 }
.cart-head strong { min-width: 0; font-size: .86rem; overflow-wrap: anywhere }
.cart-foot input { flex: 1; min-width: 0; min-height: 1.85rem; padding: .2rem .45rem; font-size: .78rem }
.cart-amount { margin-left: auto; white-space: nowrap; font-size: .86rem }
form label.cart-price, .cart-price { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .76rem; font-weight: 600 }
form label.cart-price input, .cart-price input { width: 8.5rem; min-height: 1.85rem; padding: .2rem .45rem; text-align: right }
.cart-line small { font-size: .74rem }
.link-button { border: 0; background: transparent; padding: .2rem 0; color: var(--teal); font-size: .78rem; font-weight: 650 }
.link-button:hover:not(:disabled) { text-decoration: underline }
form label.switch-line, .switch-line { display: flex; align-items: center; gap: .55rem; font-size: .83rem; font-weight: 500; cursor: pointer }
input.switch-input, form label.switch-line input.switch-input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 2.25rem; min-height: 0; height: 1.25rem; padding: 0; margin: 0; border: 0; border-radius: 1rem; background: #b4c7ca; cursor: pointer }
.switch-input::after { content: ""; position: absolute; top: .125rem; left: .125rem; width: 1rem; height: 1rem; border-radius: 50%; background: white; transition: left .15s }
.switch-input:checked, form label.switch-line input.switch-input:checked { background: var(--teal-strong) }
.switch-input:disabled { cursor: default; opacity: .5 }
.switch-input:checked::after { left: 1.125rem }
.kbd { margin-left: 6px; padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, .2); font-size: 11px; line-height: 14px; font-weight: 600 }
dialog.order-dialog { width: min(66rem, calc(100% - 1.5rem)); max-height: min(94dvh, 52rem) }
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem); gap: 1rem; align-items: start }
.order-catalog { display: grid; gap: .65rem; min-width: 0 }
.order-catalog .product-grid { max-height: min(58dvh, 31rem); overflow: auto }
.order-cart { display: flex; flex-direction: column; gap: .6rem; min-width: 0; padding: .8rem; background: #f8fbfb; border: 1px solid var(--line); border-radius: .72rem }
.order-cart .cart-lines { max-height: min(40dvh, 21rem); overflow: auto }
.cart-title { display: flex; align-items: center; gap: .5rem }
dialog .cart-title h3, .cart-title h3 { margin: 0; color: var(--ink); font-size: 1rem; text-transform: none; letter-spacing: 0 }
.cart-title .button { margin-left: auto }
.order-total { border-top: 1px solid var(--line); padding-top: .55rem; font-weight: 700 }
.order-total strong { font-size: 1.4rem; font-variant-numeric: tabular-nums }
dialog.order-dialog .dialog-footer .primary { min-width: min(21rem, 100%); min-height: 2.8rem; font-size: .95rem }
.slip-table td:nth-child(3) { min-width: 12rem }
.slip-note { color: var(--muted); font-weight: 400 }
/* Quầy nhanh (bản bàn giao): danh mục bên trái, giỏ cao hết màn hình sát mép phải, nút Thu luôn ở cuối giỏ */
.page:has(> .pos) { padding: 0 }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; align-items: stretch; min-height: calc(100dvh - 55px) }
.pos-catalog { display: grid; gap: 12px; align-content: start; min-width: 0; padding: 16px }
.pos .product { min-height: 5.8rem }
.pos .product-price { order: 3; margin-top: auto; font-size: 1.02rem; font-weight: 750 }
.pos-cart { position: sticky; top: 0; display: flex; flex-direction: column; height: calc(100dvh - 55px); min-height: 26rem; background: white; border-left: 1px solid var(--line) }
.pos-cart-body { flex: 1; min-height: 0; overflow: auto; display: grid; gap: .55rem; align-content: start; padding: 16px }
.pos-cart-body > input, .pos-cart-body > select { width: 100% }
.pos-cart-foot { display: grid; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); background: white }
.pos-search { margin-left: auto; flex: 0 1 320px }
.pos-label { margin: 4px 0 0; color: var(--ink); font-size: 13px; line-height: 18px; font-weight: 600 }
.order-tabs { display: flex; flex-wrap: wrap; gap: .15rem; border-bottom: 1px solid var(--line) }
.order-tab { margin-bottom: -1px; padding: .5rem .6rem; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: .84rem; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums }
.order-tab[aria-selected="true"] { color: var(--ink); border-color: var(--teal) }
.switch.fill { display: flex; width: 100% }
.switch.fill button { flex: 1 1 0; min-width: 0; padding-inline: .4rem }
.switch button:disabled { opacity: .5 }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding-top: .35rem; border-top: 1px solid var(--line); font-weight: 700 }
.pos-total strong { font-size: 1.75rem; font-variant-numeric: tabular-nums }
.tender { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px }
.tender .button { font-variant-numeric: tabular-nums }
.tender .button[aria-pressed="true"] { border-color: var(--teal); background: #dff5f1 }
.pos-change { font-size: .86rem }
.pos-change strong { font-variant-numeric: tabular-nums }
.pos-change.short strong, .pos-change.short span { color: #a33a3a }
.pos-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px }
.pos-actions .primary { grid-column: 1 / -1; min-height: 2.85rem; font-size: .95rem }
@media (max-width: 1100px) {
  .pos { grid-template-columns: minmax(0, 1fr) }
  .pos-cart { position: static; height: auto; min-height: 0; border-left: 0; border-top: 1px solid var(--line) }
  .pos-cart-body { overflow: visible }
}
@media (max-width: 760px) {
  .order-layout { grid-template-columns: minmax(0, 1fr) }
  .order-catalog .product-grid { max-height: 42dvh }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.2rem), 1fr)) }
}

.transfer-qr { display: grid; gap: .4rem }
.transfer-qr:empty { display: none }
.transfer-qr img { width: min(15rem,100%); margin-inline: auto; image-rendering: pixelated }
.tariff-rules { display: grid; gap: .6rem }
.tariff-rule { display: grid; gap: .5rem; border: 1px solid var(--line); border-radius: .45rem; min-width: 0 }
.tariff-days { display: flex; flex-wrap: wrap; gap: .6rem }
.tariff-days label { display: inline-flex; align-items: center }
.tariff-days input { min-height: 0; width: 1rem }

.energy-pms { display: grid; gap: .9rem; color: #12313c }
.e-switch { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem }
.e-card { padding: .9rem 1rem; text-align: left; display: grid; gap: .35rem; border: 1px solid var(--line); border-radius: .85rem; background: transparent }
.e-card[aria-selected="true"] { border-color: #12313c }
.e-card small { font-weight: 750 }
.e-panel { border: 1px solid var(--line); border-radius: 12px; background: white; overflow: hidden }
.e-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line) }
.e-head h3 { font-size: 16px; line-height: 22px; font-weight: 700; margin-bottom: 2px }
.e-panel > .muted { padding: .65rem 1rem 0 }
.e-panel .table-wrap { border: 0; border-radius: 0 }
.e-panel thead th { background: #f8fbfb; color: var(--soft); font-size: 12px }
.e-form { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,9rem),1fr)); gap: .6rem; align-items: end; padding: .82rem; border-top: 1px solid var(--line) }
.e-form label input,.e-form label select { min-width: 0 }
.e-empty { text-align: center; color: #526d76; padding: 1.65rem .8rem }
@media(max-width: 620px) { .e-switch { grid-template-columns: 1fr } .e-card { padding: .62rem } }

.role-choices { display: flex; flex-wrap: wrap; gap: .35rem .9rem; border: 1px solid var(--line); border-radius: .45rem; padding: .45rem .6rem }
.role-choices legend { font-size: .82rem; font-weight: 650; padding-inline: .2rem }
.role-choices label { display: inline-flex; align-items: center; gap: .35rem; font-weight: 500 }
.role-choices input, .check-line input { min-height: 0; width: 1rem }
form label.check-line { display: flex; align-items: center; gap: .45rem }
tr.inactive td { color: var(--muted) }
.row-actions { display: flex; flex-wrap: wrap; gap: .35rem }
dialog.wide-dialog { width: min(46rem, calc(100% - 1.5rem)) }
dialog h3 { font-size: .86rem; margin-top: .35rem }
.money-row { font-size: .84rem }
.money-row > span { min-width: 0; overflow-wrap: anywhere }
.money-row strong { white-space: nowrap; font-variant-numeric: tabular-nums }
.money-row.cancelled > span, .money-row.cancelled > strong { text-decoration: line-through; color: var(--muted) }
.refund-row, .refund-row strong { color: #a3362d }
.alert-text { color: #a3362d; font-weight: 650; font-size: .82rem }
.shift-note { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem }
.shift-note:empty { display: none }
.invoice { display: grid; gap: .38rem }
.invoice-head { display: grid; gap: .12rem; justify-items: center; text-align: center; padding-bottom: .5rem; border-bottom: 1px dashed var(--control) }
.invoice-head strong { font-size: 1.08rem }
.invoice-head span { font-size: .78rem; font-weight: 750; letter-spacing: .08em }
.invoice .table-wrap { margin-block: .25rem }
.invoice-lines td:nth-child(n+2), .invoice-lines th:nth-child(n+2) { text-align: right; white-space: nowrap }
.void-note { color: #a3362d; font-weight: 750; font-size: .84rem; padding: .45rem .6rem; border: 1px solid #e7b9b4; border-radius: .4rem; background: #fdf0ee }
.shift-card { display: grid; gap: .38rem; max-width: 34rem; margin-bottom: 1rem; padding: .9rem 1rem; background: white; border: 1px solid var(--line); border-radius: .6rem }
.shift-card h2 { font-size: 1.08rem }
.shift-card .page-toolbar { margin: .4rem 0 0 }
.section-title { font-size: 16px; line-height: 22px; font-weight: 700; margin: 16px 0 8px }
@media print {
  .invoice { font-size: 12px }
  .invoice .table-wrap { border: 0 }
}

/* Kho */
.stock-low { color: #a3362d; font-weight: 700 }
.muted-inline { color: var(--muted); font-weight: 400 }
.inline-check { display: inline-flex; align-items: center; gap: .4rem; font-size: .84rem; font-weight: 650 }
.inline-check input { min-height: 0; width: 1rem }
.stock-summary { display: flex; flex-wrap: wrap; gap: .35rem 1.6rem; margin-bottom: .75rem; padding: .6rem .85rem; background: white; border: 1px solid var(--line); border-radius: .55rem; font-size: .86rem }
.stock-table td { font-variant-numeric: tabular-nums }
.stock-lines-wrap { max-height: min(45dvh, 22rem) }
.stock-lines th { position: sticky; top: 0 }
.stock-lines td { padding: .32rem .5rem; font-variant-numeric: tabular-nums }
.stock-lines td:nth-child(n+2), .stock-lines th:nth-child(n+2) { text-align: right; white-space: nowrap }
.stock-lines input { width: 6.6rem; min-height: 1.9rem; padding: .22rem .45rem; text-align: right }
.card-lines td:nth-child(-n+4), .card-lines th:nth-child(-n+4) { text-align: start }
.card-lines td:nth-child(4) { white-space: normal; min-width: 9rem }
.print-only { display: none !important }
@media print {
  .print-only { display: flex !important }
  dialog .page-toolbar { display: none !important }
}
/* Phiếu khổ 80 mm (phiếu Minibar, phiếu bar): trang riêng lề hẹp, bỏ tiêu đề hộp thoại */
@page receipt { margin: 3mm }
@media print {
  dialog.receipt-dialog { page: receipt }
  dialog.receipt-dialog .dialog-head, dialog.receipt-dialog .muted:not(.receipt .muted) { display: none }
  .receipt { width: 72mm; font-size: 11px }
  .receipt th, .receipt td { padding: .12rem .18rem }
  .receipt .table-wrap { overflow: visible }
  .screen-only { display: none !important }
}
/* Mẫu in hóa đơn theo khổ (print.js). Trên màn hình: tờ giấy đúng khổ trên nền xám, thu nhỏ cho vừa chỗ. Phiếu cuộn 58 và 80 mm
   chữ đen, kẻ đứt cho máy in nhiệt; chứng từ A5, A4 có bảng kẻ và chỗ ký cho máy in văn phòng. */
.bill-stage { display: flex; justify-content: center; align-items: flex-start; padding: 12px; background: #e6edee; border-radius: 10px; overflow: auto }
.bill { flex: none; box-sizing: border-box; background: #fff; color: #000; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; line-height: 1.35; box-shadow: 0 1px 2px rgba(23, 49, 58, .2), 0 6px 18px rgba(23, 49, 58, .1) }
.bill h2, .bill p, .bill dl, .bill dd { margin: 0 }
/* Bỏ kiểu bảng chung của ứng dụng (chữ xám, nền tiêu đề, kẻ dòng, cỡ chữ 13px): bản in tự đặt cỡ chữ và đường kẻ. */
.bill table { width: 100%; border-collapse: collapse; font-size: inherit; line-height: inherit }
.bill th, .bill td { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; font-weight: 400; text-align: left; vertical-align: top; white-space: normal }
.bill th { font-weight: 700 }
.bill tbody tr:hover > td { background: none }
.bill .num { text-align: right; white-space: nowrap }
.bill-head, .bill-brand, .bill-title { display: grid }
.bill-shop { font-weight: 800 }
.bill-title h2 { font-weight: 800; letter-spacing: .04em }
.bill-number { font-weight: 700 }
.bill-facts dd { font-weight: 700; overflow-wrap: anywhere }
.bill-sums { display: grid }
.bill-sum { display: flex; justify-content: space-between; align-items: baseline; gap: 12px }
.bill-sum span { min-width: 0; overflow-wrap: anywhere }
.bill-sum strong { flex: none; white-space: nowrap }
.bill-total { font-weight: 800 }
.bill-due strong { font-weight: 800 }
.bill-none { padding: 6px 0; text-align: center; font-style: italic }
.bill-note { font-size: .9em; font-style: italic }
.bill-stamp { margin: 3mm 0 0; padding: 1.5mm 2mm; border: 2px solid #000; text-align: center; font-weight: 800 }
.bill-foot { display: grid; gap: 1mm; text-align: center }
.bill-thanks { font-weight: 700 }
.bill-printed { font-size: .82em }
/* Phiếu cuộn: tờ giấy gồm cả lề máy in (vùng in 72 mm với giấy 80 mm, 48 mm với giấy 58 mm). */
.bill-roll { width: 80mm; padding: 4mm 4mm 5mm; font-size: 12px }
.bill-58 { width: 58mm; padding: 3mm 5mm 4mm; font-size: 11px }
.bill-roll .bill-head { gap: 2mm; justify-items: center; text-align: center; padding-bottom: 2mm; border-bottom: 1px dashed #000 }
.bill-roll .bill-brand { gap: .4mm; justify-items: center }
.bill-roll .bill-shop { font-size: 1.4em; line-height: 1.2; text-transform: uppercase }
.bill-roll .bill-brand span, .bill-roll .bill-thanks { text-wrap: balance }
.bill-roll .bill-title { gap: .4mm; justify-items: center }
.bill-roll .bill-title h2 { font-size: 1.2em }
.bill-roll .bill-sub { font-size: .92em }
.bill-roll .bill-facts { display: grid; gap: .4mm; padding: 1.6mm 0; border-bottom: 1px dashed #000 }
.bill-roll .bill-facts div { display: flex; justify-content: space-between; gap: 3mm }
.bill-roll .bill-facts dt { flex: none }
.bill-roll .bill-facts dd { text-align: right; min-width: 0 }
.bill-roll .bill-items { margin: .6mm 0 1mm }
.bill-roll .bill-items th { padding: .8mm 0; border-bottom: 1px solid #000; font-size: .9em }
.bill-roll .bill-items td { padding: .9mm 0 .5mm; vertical-align: top }
.bill-roll .bill-items th + th, .bill-roll .bill-items td + td { padding-left: 2.2mm }
.bill-roll .bill-items small { display: block; font-size: .92em }
.bill-roll .bill-sums { gap: .7mm; padding: 1.6mm 0; border-top: 1px dashed #000 }
.bill-roll .bill-total { margin: .6mm 0; padding: 1.2mm 0; border-top: 1px solid #000; border-bottom: 1px solid #000; font-size: 1.22em }
.bill-roll .bill-due { font-size: 1.08em }
.bill-58 .bill-total { font-size: 1.1em }
.bill-58 .bill-sum { gap: 2mm }
.bill-roll .bill-note { margin-top: 1mm }
.bill-roll .bill-foot { margin-top: 1.6mm; padding-top: 2mm; border-top: 1px dashed #000 }
/* Chứng từ A5, A4: tờ giấy gồm lề trang (in: lề @page). */
.bill-doc { width: 210mm; min-height: 297mm; padding: 14mm; font-size: 13px }
.bill-a5 { width: 148mm; min-height: 210mm; padding: 10mm; font-size: 11.5px }
.bill-doc .bill-head { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8mm; padding-bottom: 4mm; border-bottom: 2px solid #17313a }
.bill-doc .bill-brand { gap: 1mm }
.bill-doc .bill-shop { font-size: 1.75em; line-height: 1.15; color: #0c3c47 }
.bill-doc .bill-brand span { color: #36505a }
.bill-doc .bill-title { gap: 1mm; justify-items: end; text-align: right }
.bill-doc .bill-title h2 { font-size: 1.4em }
.bill-doc .bill-sub { color: #36505a; font-size: .92em }
.bill-doc .bill-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6mm 8mm; padding: 4mm 0 }
.bill-doc .bill-facts div { display: flex; gap: 2mm }
.bill-doc .bill-facts dt { flex: none; min-width: 24mm; color: #36505a }
.bill-a5 .bill-facts dt { min-width: 20mm }
.bill-doc .bill-items th { padding: 2mm; background: #edf3f4; border-top: 1px solid #9fb4b9; border-bottom: 1px solid #9fb4b9; font-size: .9em; -webkit-print-color-adjust: exact; print-color-adjust: exact }
.bill-doc .bill-items td { padding: 2mm; border-bottom: 1px solid #d6e1e3; vertical-align: top }
.bill-doc .bill-items .stt { width: 9mm; text-align: center }
.bill-doc .bill-sums { gap: 1.4mm; width: 62%; margin: 4mm 0 0 auto }
.bill-a5 .bill-sums { width: 78% }
.bill-doc .bill-total { margin: .6mm 0; padding: 2mm 0; border-top: 1.5px solid #17313a; border-bottom: 1.5px solid #17313a; font-size: 1.22em }
.bill-doc .bill-pay { color: #36505a }
.bill-doc .bill-note { margin-top: 2mm; color: #36505a }
.bill-doc .bill-stamp { margin-top: 5mm }
.bill-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; margin-top: 8mm; text-align: center; break-inside: avoid }
.bill-signs div { display: grid; gap: 1mm; justify-items: center; align-content: start }
.bill-signs span { color: #36505a; font-size: .86em; font-style: italic }
.bill-signs .bill-sign-name { min-height: 1.3em; margin-top: 16mm; color: #000; font-size: 1em; font-style: normal; font-weight: 700 }
.bill-a5 .bill-signs .bill-sign-name { margin-top: 12mm }
.bill-doc .bill-foot { margin-top: 8mm; padding-top: 3mm; border-top: 1px solid #d6e1e3 }
/* Hộp thoại xem và in phiếu */
.bill-dialog .bill-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px }
.bill-dialog .bill-bar > .button { margin-left: auto }
.bill-dialog .row-actions { margin-top: 12px }
.paper-switch button { min-width: 60px }
/* Cấu hình chung: khổ in mặc định, tự in khi thanh toán, nội dung phiếu; bên phải xem trước hóa đơn mẫu */
.till.print-page { grid-template-columns: minmax(0, 1fr) 440px }
.paper-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px }
@media (max-width: 560px) { .paper-options { grid-template-columns: minmax(0, 1fr) } }
.paper-option { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; background: #fff; cursor: pointer }
.paper-option:hover { border-color: var(--teal-strong) }
.paper-option.on { border-color: var(--teal-strong); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal-strong) }
.paper-option:has(input:focus-visible) { outline: 2px solid var(--teal-strong); outline-offset: 2px }
.paper-option input { position: absolute; opacity: 0; pointer-events: none }
.paper-shape { flex: none; box-sizing: border-box; width: 24px; height: 34px; padding: 4px 3px; border: 1.5px solid var(--ink); border-radius: 2px; background: repeating-linear-gradient(to bottom, transparent 0 4px, var(--line2) 4px 5px) content-box }
.paper-shape-58 { width: 13px }
.paper-shape-80 { width: 18px }
.paper-shape-a5 { width: 20px; height: 28px }
.paper-text { display: grid; gap: 2px; min-width: 0 }
.paper-text strong { font-size: 14px; line-height: 20px }
.paper-text .meta { font-size: 12px; line-height: 16px }
.print-field { display: grid; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600 }
.print-field textarea { width: 100%; font-weight: 400; resize: vertical }
.print-problem { color: var(--danger); font-size: 13px; line-height: 18px; font-weight: 600 }
.print-guide { font-size: 13px; line-height: 19px }
.print-guide summary { color: var(--teal-strong); font-weight: 600; cursor: pointer }
.print-guide ol { display: grid; gap: 6px; margin: 8px 0 0; padding-left: 20px; color: var(--soft) }
.print-target { display: block; margin-top: 4px; padding: 6px 8px; border-radius: 6px; background: var(--canvas); color: var(--ink); font-size: 12px; line-height: 17px; overflow-wrap: anywhere; user-select: all }
.print-side .bill-stage { flex: none }
@media (max-width: 1100px) { .till.print-page { grid-template-columns: minmax(0, 1fr) } }
/* In: chỉ bản in trong #print-root, trang theo khổ đã chọn; phiếu cuộn căn giữa trong vùng in của máy in nhiệt. */
#print-root { display: none }
@page bill-58 { margin: 2mm 0 }
@page bill-80 { margin: 2mm 0 }
@page bill-a5 { size: A5 portrait; margin: 9mm }
@page bill-a4 { size: A4 portrait; margin: 13mm 14mm }
@media print {
  html.printing-sheet, html.printing-sheet body { background: #fff }
  html.printing-sheet body > :not(#print-root) { display: none !important }
  html.printing-sheet #print-root { display: block !important }
  #print-root[data-paper="58"] { page: bill-58 }
  #print-root[data-paper="80"] { page: bill-80 }
  #print-root[data-paper="A5"] { page: bill-a5 }
  #print-root[data-paper="A4"] { page: bill-a4 }
  #print-root .bill { min-height: 0; box-shadow: none; zoom: 1 }
  #print-root .bill-80 { width: 72mm; margin: 0 auto; padding: 0 }
  #print-root .bill-58 { width: 48mm; margin: 0 auto; padding: 0 }
  #print-root .bill-doc { width: auto; padding: 0 }
  #print-root .bill-items tr { break-inside: avoid }
  #print-root .bill-sums, #print-root .bill-foot { break-inside: avoid }
  #print-root .receipt { margin: 0 auto }
  #print-root .receipt-58 { width: 48mm; font-size: 10px }
}
/* Giá theo loại bàn (Giá v2, màn gia-ban của bản bàn giao) */
.pricing { display: grid; gap: 12px }
.pricing .page-toolbar.pricing-head { margin: 0 }
.pricing .push { margin-left: auto }
.pricing-dirty { color: var(--arr-ink); font-size: 13px; font-weight: 600 }
.pricing-note { display: grid; gap: 8px }
.pricing-note:empty { display: none }
.pricing-alert { padding: 10px 14px; border: 1px solid #b9d7e8; border-radius: 10px; background: var(--cln-soft); color: var(--cln-ink); font-size: 13px; font-weight: 500 }
.pricing-alert.warn { border-color: #ecd29f; background: var(--arr-soft); color: var(--arr-ink) }
.pricing-body { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start }
.pricing-main { flex: 999 1 560px; min-width: 0; display: grid; gap: 12px }
.pricing-card { padding: 16px; display: grid; gap: 12px; min-width: 0; align-content: start }
.pricing-card h2, .pricing-quote h2 { font-size: 16px; line-height: 22px; font-weight: 700 }
.pricing-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px }
.pricing label, .price-field { display: grid; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600; min-width: 0 }
.pricing label :is(input, select) { width: 100%; font-weight: 400 }
.pricing label.price-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; cursor: pointer }
.pricing label.price-check input { width: auto }
.price-days { display: grid; gap: 10px }
.price-day { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center }
.price-day > strong { font-size: 13px; line-height: 18px; font-weight: 650 }
.price-bar { position: relative; height: 32px; border-radius: 8px; overflow: hidden; background: var(--canvas); touch-action: none; user-select: none }
.price-bar > span { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 8px; border-right: 2px solid #fff; background: var(--band-bg, #edf0f1); color: var(--band-fg, #3f4b4f); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.price-bar > span.closed, .band-badge.closed { background: repeating-linear-gradient(135deg, #edf0f1 0 6px, #e2e7e9 6px 12px); color: var(--soft) }
.price-bar > b { position: absolute; z-index: 1; top: 0; bottom: 0; width: 14px; margin-left: -7px; cursor: ew-resize; border-radius: 4px }
.price-bar > b::after { content: ""; position: absolute; left: 6px; top: 7px; bottom: 7px; width: 2px; border-radius: 1px; background: #17313a66 }
.price-bar > b:hover::after, .price-bar > b:focus-visible::after { background: var(--teal-strong) }
.price-bar > b:focus-visible { outline: 2px solid var(--teal-strong); outline-offset: -2px }
.price-axis { display: flex; justify-content: space-between; padding-left: 162px; color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 500 }
.price-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px 24px; padding-top: 12px; border-top: 1px solid var(--line) }
.price-slot-list { display: grid; gap: 8px; align-content: start; justify-items: start }
.price-slot-list h3 { font-size: 13px; line-height: 18px; font-weight: 650 }
.price-slot { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto 32px; gap: 8px; align-items: center; width: 100% }
.price-slot input[type="time"] { min-width: 0; padding: 0 6px }
.price-slot select { min-width: 0 }
.price-remove { width: 32px; padding: 0; font-size: 16px }
.price-grid-wrap { overflow-x: auto; margin: 0 -16px -16px; border-top: 1px solid var(--line) }
.price-grid th, .price-grid td { padding: 6px 12px }
.price-grid thead th { padding-block: 8px }
.price-grid td:first-child { min-width: 9rem; font-weight: 650 }
.price-grid td:first-child input { width: 100% }
.price-band { min-width: 8.5rem }
.price-band-name { display: flex; align-items: center; gap: 2px; border-bottom: 3px solid var(--band-bg, var(--line)) }
.price-band-name input { width: 100%; min-width: 0; min-height: 30px; padding: 0 6px; border-color: transparent; background: transparent; color: var(--ink); font-size: 12px; font-weight: 700; text-align: right }
.price-band-name input:hover, .price-band-name input:focus { border-color: var(--ctl); background: white }
.price-band-name .price-remove { flex: none; width: 28px; min-height: 28px; border-color: transparent; background: transparent; color: var(--soft) }
.price-rate { width: 100%; min-width: 6.5rem; min-height: 34px; text-align: right; font-variant-numeric: tabular-nums }
.price-rate:invalid { border-color: var(--danger); background: var(--danger-soft) }
.pricing-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; align-items: start }
.price-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
.holiday-chips { display: flex; flex-wrap: wrap; gap: 6px }
.holiday-chip { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 3px 0 10px; border: 1px solid var(--line2); border-radius: 999px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums }
.holiday-chip button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--soft); font-size: 15px; line-height: 1 }
.holiday-chip button:hover { background: var(--danger-soft); color: var(--danger) }
.holiday-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px }
.pricing-legacy { padding: 0 }
.pricing-legacy summary { padding: 14px 16px; font-weight: 700; cursor: pointer }
.pricing-legacy[open] summary { border-bottom: 1px solid var(--line) }
.pricing-legacy > :not(summary) { margin: 12px 16px }
.pricing-quote { flex: 1 1 300px; max-width: 380px; min-width: 280px; position: sticky; top: 16px; display: grid; gap: 12px; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 12px; font-variant-numeric: tabular-nums }
.price-result { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfb; font-size: 13px }
.price-result:empty { display: none }
.price-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px }
.price-line > div { display: grid; gap: 4px; justify-items: start; min-width: 0 }
.price-line small { color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 500 }
.price-line strong { white-space: nowrap; font-weight: 650 }
.band-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; background: var(--band-bg, var(--ooo-soft)); color: var(--band-fg, var(--ooo-ink)); font-size: 12px; font-weight: 600; white-space: nowrap }
.price-round { font-size: 13px }
.price-total { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-weight: 650 }
.price-total strong { font-size: 22px; line-height: 28px; font-weight: 700 }
@media (max-width: 760px) {
  .price-day { grid-template-columns: minmax(0, 1fr); gap: 4px }
  .price-axis { padding-left: 0 }
  .price-rules { grid-template-columns: minmax(0, 1fr) }
  .pricing-quote { position: static; max-width: none }
}

/* Thanh tiêu đề của trang: dòng phụ và nút thao tác bên phải (bản bàn giao) */
.page-tools { display: flex; flex: 1 1 18rem; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0 }
.page-tools:empty { display: none }
.page-tools .push { margin-left: auto }
.page-sub { color: var(--soft); font-size: 13px; line-height: 18px; font-weight: 500 }
/* Dòng phụ dài (Đoàn): co lại và cắt bằng dấu … thay vì đẩy ô tìm, nút chính xuống dòng dưới */
.page-sub.fit { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }

/* Tổng quan (bản bàn giao): bốn chỉ số, biểu đồ đã thu, việc cần xử lý, công suất theo loại, bán chạy */
.overview { display: grid; gap: 16px }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 12px }
.kpi-note { color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 500 }
.kpi-note.up { color: var(--teal-strong); font-weight: 600 }
.kpi-note.down { color: var(--danger); font-weight: 600 }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 25rem); gap: 12px; align-items: stretch }
.overview-card { display: grid; gap: 12px; align-content: start; min-width: 0; padding: 16px }
.overview-card h2 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700 }
.overview-card > .button { justify-self: start }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0 }
.card-head .push, .card-head .legend { margin-left: auto }
.legend { display: flex; gap: 12px; color: var(--soft); font-size: 12px }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; background: #a3dcd3 }
.legend .current::before { background: var(--teal-strong) }
.chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: 8px; height: 220px; padding-top: 24px; border-bottom: 1px solid var(--line) }
.chart-bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100% }
.chart-bar i { display: block; border-radius: 4px 4px 0 0; background: #a3dcd3 }
.chart-bar.now i { background: var(--teal-strong) }
.chart-bar b { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; line-height: 14px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums }
.chart-axis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: -4px; color: var(--soft); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums }
.chart-axis .now { color: var(--ink); font-weight: 700 }
.task-list { display: grid }
.task { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line) }
.task .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--dot) }
.task > div { display: grid; flex: 1; min-width: 0 }
.task strong { font-size: 13px; line-height: 18px; font-weight: 650 }
.task > div > span { color: var(--soft); font-size: 12px; line-height: 16px }
.usage-table td:nth-child(2), .usage-table td:nth-child(3), .usage-table th:nth-child(2), .usage-table th:nth-child(3), .usage-table :is(td, th):last-child { text-align: right; white-space: nowrap }
.meter { display: flex; align-items: center; gap: 8px; min-width: 9rem }
.meter > span { flex: 1; height: 6px; overflow: hidden; border-radius: 3px; background: var(--line) }
.meter > span > i { display: block; height: 100%; background: var(--teal-strong) }
.meter small { width: 2.6rem; color: var(--soft); text-align: right; font-variant-numeric: tabular-nums }
.seller-list { display: grid; gap: 4px }
.seller { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 13px }
.seller > span:first-child { flex: 1; min-width: 0 }
.seller strong { min-width: 2.5rem; text-align: right; font-variant-numeric: tabular-nums }
@media (max-width: 1100px) { .overview-grid { grid-template-columns: minmax(0, 1fr) } }

/* Lịch đặt (bản bàn giao): dòng thời gian theo bàn bên trái, lượt đặt trong ngày bên phải; tuần, tháng là lưới ngày */
.command .search svg { width: 16px; height: 16px }
.agenda-nav { position: relative; display: inline-flex; gap: 4px }
.agenda-date { min-width: 8.5rem; font-variant-numeric: tabular-nums }
.agenda-picker { position: absolute; left: 40px; bottom: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none }
.agenda-search { flex: 0 1 300px }
.page:has(> .agenda) { padding: 0 }
.agenda { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: stretch; min-height: calc(100dvh - 55px) }
.agenda-main { display: grid; gap: 12px; align-content: start; min-width: 0; padding: 16px }
.agenda-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px; background: white; border-left: 1px solid var(--line); font-variant-numeric: tabular-nums }
.agenda-side h2 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700 }
.agenda-note { margin-bottom: 12px }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 500 }
.tl-legend span { display: inline-flex; align-items: center; gap: 5px }
.tl-legend i { display: block; width: 8px; height: 8px; border-radius: 3px }
.timeline { overflow: hidden }
.timeline-scroll { overflow-x: auto }
.tl-body { --tl-label: 88px; position: relative; display: grid; grid-template-columns: var(--tl-label) minmax(0, 1fr); min-width: 760px }
.tl-label { display: flex; align-items: center; gap: 6px; min-width: 0; height: 36px; padding: 0 10px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden }
.tl-label strong { font-weight: 700 }
.tl-label span { overflow: hidden; text-overflow: ellipsis; color: var(--soft); font-size: 12px; font-weight: 500 }
.tl-label.head { height: 32px; border-top: 0; background: #f8fbfb; color: var(--soft); font-size: 12px; font-weight: 600 }
.tl-hours { position: relative; height: 32px; background: #f8fbfb; color: var(--soft); font-size: 11px; font-variant-numeric: tabular-nums }
.tl-hours span { position: absolute; top: 9px; padding-left: 4px }
.tl-track { position: relative; height: 36px; border-top: 1px solid var(--line); background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / var(--hours))) }
.bk { position: absolute; top: 5px; bottom: 5px; display: flex; align-items: center; gap: 4px; min-width: 6px; min-height: 0; padding: 0 6px; border: 0; border-radius: 6px; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-align: start }
button.bk:hover { filter: brightness(.95) }
.bk svg { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }
.k-live { background: var(--occ); color: #fff }
.k-due { background: var(--due); color: #fff }
.k-done { background: #e4eaec; color: #3a4a4f }
.k-book { background: var(--arr-soft); color: var(--arr-ink); box-shadow: inset 0 0 0 1px var(--arr) }
.k-bad { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger) }
.k-miss { background: repeating-linear-gradient(135deg, transparent 0 6px, #edf0f1 6px 8px); color: var(--soft); box-shadow: inset 0 0 0 1px var(--line2) }
.k-ooo { background: repeating-linear-gradient(135deg, #edf0f1 0 8px, #e2e7e9 8px 16px); color: var(--ooo-ink) }
.tl-legend .k-miss { background: var(--ooo-soft) }
.bk.dim, .week-chip.dim { opacity: .3 }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--teal-strong); pointer-events: none }
.tl-now span { position: absolute; top: 6px; left: 4px; padding: 1px 5px; border-radius: 4px; background: var(--teal-strong); color: #fff; font-size: 11px; line-height: 14px; font-weight: 700; font-variant-numeric: tabular-nums }
.booking-card { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white }
.booking-card.clash { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger) }
.booking-card.past { background: #f8fbfb }
.booking-card-head { display: flex; align-items: center; gap: 8px; min-width: 0 }
.booking-card-head .push { margin-left: auto }
.booking-time { font-size: 18px; line-height: 24px; font-weight: 700 }
.booking-card.past .booking-time { color: var(--soft) }
.booking-guest { font-size: 13px; line-height: 18px; font-weight: 650 }
.booking-meta { color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 500 }
.booking-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px }
.week-grid { width: 100%; min-width: 840px; border-collapse: collapse; table-layout: fixed }
.week-grid th, .week-grid td { padding: 0; border-top: 1px solid var(--line); text-align: start; vertical-align: top }
.week-grid thead th { padding: 8px 10px; border-top: 0; background: #f8fbfb; color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 600 }
.week-grid thead th span { display: block }
.week-grid thead th strong { color: var(--ink); font-size: 13px }
.week-grid thead th:first-child { width: 88px }
.week-grid tbody th { padding: 10px; font-size: 13px }
.week-unit { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden }
.week-unit span { overflow: hidden; text-overflow: ellipsis; color: var(--soft); font-size: 12px; font-weight: 500 }
.week-grid .today { background: #f2faf8 }
.week-grid thead th.today, .week-grid thead th.today strong { color: var(--teal-strong) }
.week-grid td + td, .week-grid th + td { border-left: 1px solid var(--line) }
.week-cell { display: grid; gap: 3px; align-content: start; width: 100%; min-height: 48px; padding: 6px; border: 0; border-radius: 0; background: transparent; text-align: start }
.week-cell:hover { background: var(--teal-soft) }
.week-chip { display: block; padding: 1px 5px; border-radius: 4px; font-size: 11px; line-height: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums }
.week-count { color: var(--soft); font-size: 11px; line-height: 15px }
@media (max-width: 1100px) {
  .agenda { grid-template-columns: minmax(0, 1fr) }
  .agenda-side { border-left: 0; border-top: 1px solid var(--line) }
}

/* Khách đang dùng (bản bàn giao): hàng lọc dưới thanh tiêu đề, thanh chọn nhiều lượt, bảng có dòng tổng */
.page:has(> .subbar) { padding-top: 0 }
.subbar { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 16px; padding: 8px 16px; background: white; border-bottom: 1px solid var(--line); scrollbar-width: thin }
.select-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 8px 8px 14px; border-radius: 10px; background: var(--navy); color: white }
.select-bar strong { font-size: 13px; line-height: 18px; font-weight: 650 }
.select-bar .button { background: transparent; color: white; border-color: #ffffff55 }
.select-bar .button:hover:not(:disabled) { background: #ffffff1f }
.select-bar .button.push { margin-left: auto }
.select-bar .button.solid { background: white; color: var(--ink); border-color: white }
.select-bar .button.solid:hover:not(:disabled) { background: var(--teal-soft) }
.guest-card { overflow: hidden }
.guest-table td { white-space: nowrap }
.guest-table :is(th, td):first-child { width: 36px; padding-right: 0 }
.guest-table input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: var(--teal-strong); vertical-align: middle }
.guest-table tbody tr.picked > td { background: var(--teal-soft) }
.guest-table tfoot td { padding: 12px; border-top: 1px solid var(--line); border-bottom: 0; font-weight: 700 }
.guest-table tfoot .guest-sum strong { font-size: 16px; line-height: 22px }
.unit-no { display: inline-grid; place-items: center; min-width: 40px; height: 26px; padding: 0 6px; border: 0; border-radius: 6px; background: var(--state-bg); color: var(--state-fg); font-size: 13px; font-weight: 700 }
.unit-no:hover { filter: brightness(.94) }
.guest-who, .guest-time, .guest-sum { display: grid; gap: 2px; justify-items: start; min-width: 0 }
.guest-who strong, .guest-sum strong { font-weight: 650 }
.guest-sum { justify-items: end }
.guest-sum strong.owe { color: var(--danger) }
.guest-time .alert-text { color: var(--danger); font-weight: 600 }
.live-line { display: inline-flex; align-items: center; gap: 6px }
.live-line b { font-weight: 700 }
.live.paused { background: var(--arr); animation: none }
.guest-table .row-actions { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 8px }
.page-note { margin-top: 12px }

/* Vệ sinh (bản bàn giao): ba cột việc, thẻ việc có phút chờ chạy theo đồng hồ, bảng bàn tạm ngưng */
.lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; margin-bottom: 16px }
.lane { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px; border-radius: 12px; background: #eaf0f0 }
.lane-head { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 4px }
.lane-head h2 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700 }
.lane-empty { margin: 0; padding: 12px; border: 1px dashed var(--line2); border-radius: 10px; color: var(--soft); font-size: 13px; background: #ffffff80 }
.job { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 1px 2px rgba(14, 52, 61, .08) }
.job.doing { border-color: var(--teal-strong); box-shadow: 0 0 0 1px var(--teal-strong) }
.job-head { display: flex; align-items: center; gap: 8px; min-width: 0 }
.job-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650 }
.job-head .push { margin-left: auto; white-space: nowrap }
.job .wait.late { color: var(--danger); font-weight: 650 }
.job-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px }
.done-list { gap: 2px }
.done-row { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 22px; font-size: 13px }
.done-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.paused-card { display: grid; gap: 0; overflow: hidden }
.paused-card .card-head { padding: 14px 16px 10px }
.paused-card .card-head h2 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700 }
.paused-card .table-wrap { border: 0; border-radius: 0 }
.paused-card td:first-child { font-weight: 700 }
.paused-card .lane-empty { margin: 0 16px 16px }
@media (max-width: 900px) { .lanes { grid-template-columns: minmax(0, 1fr) } }
/* Nhóm 2 · Tổng quan: cột dự kiến tiền giờ của khung giờ kế tiếp (nét đứt) và chú thích; sơ đồ: chip đèn bật tay ở đầu ô */
.chart-bar.forecast i { background: transparent; border: 1.5px dashed var(--teal-strong); border-bottom: 0 }
.chart-bar.forecast b { color: var(--teal-strong) }
.legend .forecast::before { box-sizing: border-box; background: transparent; border: 1px dashed var(--teal-strong) }
.chart-axis .next { color: var(--teal-strong); font-weight: 600 }
.power-chip.hand-chip { color: var(--teal-strong) }
/* Nhóm 2 · Tổng quan: bảng doanh thu theo nhân viên phục vụ (số lượt, giờ chơi, hóa đơn, doanh thu canh phải) */
.server-table :is(td, th):nth-child(4), .server-table :is(td, th):nth-child(5) { text-align: right; white-space: nowrap }
/* Nhóm 2 · giao việc dọn: chip nhân viên trong ca, ô Giao cho ở thẻ Cần dọn, dòng người dọn ở khung phải */
.staff-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0 }
.job-assign { display: grid; gap: 4px; color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 600 }
.job-assign select { width: 100%; min-width: 0; color: var(--ink); font-weight: 400 }
.clean-assignee { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: -4px }

/* Vệ sinh nhóm 1: khung phải là danh mục kiểm tra của bàn đang dọn; màn hẹp thì khung nằm giữa các cột và bảng bảo trì */
.page:has(> .clean) { padding: 0 }
.clean { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto 1fr; grid-template-areas: "lanes side" "maint side"; min-height: calc(100dvh - 55px) }
.clean-lanes { grid-area: lanes; min-width: 0; padding: 16px 16px 0; container-type: inline-size }
.clean-lanes .lanes { margin-bottom: 0 }
.clean-maint { grid-area: maint; min-width: 0; padding: 16px }
.clean-side { grid-area: side; position: sticky; top: 0; display: flex; flex-direction: column; gap: 12px; height: calc(100dvh - 55px); min-height: 30rem; overflow: auto; padding: 16px; background: white; border-left: 1px solid var(--line); font-variant-numeric: tabular-nums }
.clean-side h2 { margin: 0; font-size: 20px; line-height: 26px; font-weight: 750 }
.clean-side > p { margin: 0 }
.clean-checks { display: grid; margin: 0; padding: 0; list-style: none }
.clean-check { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 41px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; cursor: pointer }
.clean-checks li:last-child .clean-check { border-bottom: 0 }
.clean-check input { width: 18px; height: 18px; margin: 0 }
.clean-check time { color: var(--soft); font-size: 12px; line-height: 16px }
.clean-note { display: grid; gap: 6px; margin-top: 4px; font-size: 13px; line-height: 18px; font-weight: 650 }
.clean-note textarea { width: 100%; min-height: 72px; resize: vertical; font-weight: 400 }
.clean-reported { color: var(--soft); font-size: 13px; line-height: 18px }
.clean-actions { display: grid; gap: 8px; margin-top: auto; padding-top: 8px }
.hk-list { display: grid; gap: 6px; margin: 0; padding-left: 20px; font-size: 14px; line-height: 20px }
.job.pick { cursor: pointer }
.job.pick:not(.doing):hover { border-color: var(--line2) }
.job.pick:focus-visible { outline: 2px solid var(--teal-strong); outline-offset: 2px }
.hk-progress { height: 6px; overflow: hidden; border-radius: 3px; background: var(--line) }
.hk-progress i { display: block; height: 100%; border-radius: inherit; background: var(--cln) }
.lane-head .meta.push { min-width: 0; margin-left: auto; text-align: right }
.hk-table :is(th, td) { padding-left: 10px; padding-right: 10px }
.hk-table td { white-space: nowrap }
.hk-table td:nth-child(2) { min-width: 10rem; white-space: normal }
.hk-table td:last-child { text-align: end }
.hk-title { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer }
.hk-title:hover { color: var(--teal-strong); text-decoration: underline }
.hk-warn { margin: 0; color: var(--danger); font-size: 13px; line-height: 18px; font-weight: 600 }
.hk-pick { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 8px 12px 12px; border: 1px solid var(--line); border-radius: 8px }
.hk-pick legend { padding: 0 4px; font-size: 13px; line-height: 18px; font-weight: 600 }
.hk-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr)); gap: 4px 10px; max-height: 9.5rem; overflow: auto }
form label.hk-unit { display: flex; align-items: center; gap: 6px; font-weight: 500 }
form label.hk-unit input { width: 16px; height: 16px; flex: none; margin: 0 }
.hk-history summary { cursor: pointer; font-size: 13px; line-height: 18px; font-weight: 600 }
.hk-history ul { display: grid; gap: 4px; margin: 8px 0 0; padding-left: 18px; color: var(--soft); font-size: 12px; line-height: 16px }
@container (max-width: 680px) { .clean-lanes .lanes { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@container (max-width: 440px) { .clean-lanes .lanes { grid-template-columns: minmax(0, 1fr) } }
@media (max-width: 1100px) {
  .clean { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "lanes" "side" "maint"; min-height: 0 }
  .clean-side { position: static; height: auto; min-height: 0; margin: 16px 16px 0; border: 1px solid var(--line); border-radius: 12px }
  .clean-side.idle { display: none }
}

/* Thẻ chỉ số cần chú ý; vạch ngăn trong hàng lọc; khoảng đệm cho dòng trống trong thẻ */
.kpi.alert { border-color: #e9b5b0 }
.kpi.alert strong { color: var(--danger) }
.subbar-rule { flex: none; align-self: center; width: 1px; height: 20px; margin: 0 4px; background: var(--line2) }
.pad { margin: 0; padding: 16px }

/* Đoàn & thanh toán (bản bàn giao): cột trái các lượt để gom, bên phải bảng tiền của nhóm và nút thu một lần */
.page:has(> .team) { padding: 0 }
.team { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100dvh - 55px) }
.team-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; border-right: 1px solid var(--line); background: #f8fbfb }
.team-list .cap { margin: 12px 0 0 }
.team-list .cap:first-child { margin-top: 0 }
.team-card { display: grid; gap: 4px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); text-align: start }
.team-card:hover { border-color: var(--line2) }
.team-card[aria-pressed="true"] { border-color: var(--teal-strong); box-shadow: 0 0 0 1px var(--teal-strong) }
.team-card.done { background: #f8fbfb }
.team-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0 }
.team-row strong { font-size: 14px; line-height: 20px; font-weight: 650; font-variant-numeric: tabular-nums }
.team-row > strong:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.team-row.meta { justify-content: flex-start; gap: 6px }
.team-none { margin: 0; color: var(--soft); font-size: 13px; line-height: 18px }
.team-main { display: grid; gap: 12px; align-content: start; min-width: 0; padding: 16px }
.team-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px }
.team-titles { display: grid; gap: 2px; min-width: 0 }
.team-titles .title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px }
.team-titles h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 700 }
.team-titles p, .team-main > p { margin: 0 }
.team-empty { display: grid; gap: 6px; justify-items: center; padding: 32px 24px; text-align: center }
.team-empty h2 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700 }
.team-empty p { max-width: 34rem; margin: 0 }
.team-actions { display: flex; flex-wrap: wrap; gap: 8px }
:is(.team-table, .bill-table, .log-table) :is(th, td):first-child { width: auto; padding-right: 12px }
.team-table th.num, .team-table td.num { text-align: right }
/* Đoàn (bản bàn giao mục 10): chia hóa đơn, các phần đã thu và còn thu */
.group-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px }
.group-split-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px }
.group-split-head h3 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700 }
.group-split-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px }
.group-split-sum .push { margin-left: auto }
.group-parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px }
.group-part { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 56px; padding: 8px 12px; border-radius: 10px }
.group-part.paid { display: grid; gap: 2px; align-content: center; justify-content: stretch; border-color: transparent; background: var(--vac-soft) }
.group-part.paid .meta { color: var(--vac-ink) }
.group-part strong { font-size: 13px; line-height: 18px; font-weight: 650 }
.part-state { color: var(--vac-ink); font-size: 12px; font-weight: 650 }
.group-part-info { display: grid; gap: 2px; min-width: 0 }
.group-part-info input { width: 8.5rem; min-height: 30px; padding: 2px 8px; font-variant-numeric: tabular-nums }
.group-split > p { margin: 0 }
.group-split > .row-actions[hidden], .group-split > p[hidden] { display: none }
.group-table td:nth-child(2) { white-space: normal; min-width: 8rem }
.group-table tfoot .group-grand { font-size: 18px; line-height: 24px; font-weight: 750 }
.group-tag { justify-self: start; border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600 }
.switch.targets button { white-space: normal; line-height: 15px; text-align: center }
/* Cột chi tiết không nở theo phần tử rộng nhất (thanh cách chia trên điện thoại): thanh cuộn ngang trong khung */
.team-main { grid-template-columns: minmax(0, 1fr) }
.group-split-head .switch { max-width: 100%; overflow-x: auto }
@media (max-width: 1100px) { .group-parts { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
.group-split-head .switch button { flex: none }
@media (max-width: 700px) {
  .page-sub.fit { flex-basis: 100%; white-space: normal }
  .group-split-head .switch { display: grid; grid-template-columns: 1fr 1fr; width: 100%; height: auto }
  .group-split-head .switch button { min-height: 36px }
}

/* Hóa đơn, Lịch sử lượt (bản bàn giao): hàng lọc sát mép, danh sách bên trái, cột chi tiết cao hết màn hình bên phải */
.page:has(> .bills) { display: flex; flex-direction: column; min-height: calc(100dvh - 55px); padding: 0 }
.page:has(> .bills) > .subbar { margin: 0 }
.bills { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 380px; align-items: stretch }
.bills-main { display: grid; gap: 12px; align-content: start; min-width: 0; padding: 16px }
.bills-main > .muted { margin: 0 }
.bill-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px; background: #f8fbfb; border-left: 1px solid var(--line) }
.bill-side h2 { margin: 0; min-width: 0; font-size: 18px; line-height: 24px; font-weight: 700 }
.bill-side > p { margin: 0 }
.bill-side .card-head { flex-wrap: nowrap }
.bill-sheet { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 13px; line-height: 18px }
.bill-sheet .table-wrap { border: 0; border-radius: 0 }
.bill-sheet th, .bill-sheet td { padding: 6px 4px }
.bill-sheet .total strong { font-size: 18px; line-height: 24px }
.bill-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto }
.bill-actions .button:only-child, .bill-actions .button.primary:last-child:nth-child(odd) { grid-column: 1 / -1 }
:is(.bill-table, .log-table) tbody tr[tabindex] { cursor: pointer }
:is(.bill-table, .log-table) tbody tr[tabindex]:not(.picked):hover > td { background: #f8fbfb }
:is(.bill-table, .log-table) tr.voided > td { color: var(--soft) }
.bill-table tr.voided strong { font-weight: 600 }
.log-sums { display: grid; gap: 4px; padding: 12px 0; border-block: 1px solid var(--line); font-size: 13px }
.log-sums .total strong { font-size: 18px; line-height: 24px }
.log-events { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none }
.log-event { display: grid; grid-template-columns: 40px 8px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 13px; line-height: 18px }
.log-event time { font-weight: 700; font-variant-numeric: tabular-nums }
.log-event i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--vac) }
.log-event[data-tone="warn"] i { background: var(--arr) }
.log-event[data-tone="bad"] i { background: var(--danger) }
.log-event[data-tone="mute"] i { background: var(--ctl) }
.log-event[data-tone="info"] i { background: var(--cln) }
.log-event div { display: grid; gap: 2px; min-width: 0 }
.log-event div span:first-child { font-weight: 600 }

/* Ca thu ngân (bản bàn giao): chỉ số và bảng của ca bên trái, cột đếm két theo mệnh giá và kết ca bên phải */
.page:has(> .till) { padding: 0 }
.till { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: calc(100dvh - 55px) }
.till-main { display: grid; gap: 12px; align-content: start; min-width: 0; padding: 16px }
:is(.till-main, .bills-main) .kpi-row { grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)) }
.till-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 8px; height: calc(100dvh - 55px); min-height: 34rem; overflow: auto; padding: 16px; background: white; border-left: 1px solid var(--line) }
.till-side h2 { margin: 0 0 4px; font-size: 16px; line-height: 22px; font-weight: 700 }
.till-side > p { margin: 0 }
.till-side > label:not(.till-row) { display: grid; gap: 6px; margin-top: 8px; font-size: 13px; line-height: 18px; font-weight: 600 }
.till-side > label:not(.till-row) :is(input, select) { width: 100%; font-weight: 400 }
.till-side > .till-hand { font-size: 13px; line-height: 18px }
.till-side > .till-hand.short { color: var(--danger); font-weight: 650 }
.till-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 92px; align-items: center; gap: 12px; font-size: 13px; font-variant-numeric: tabular-nums }
.till-row input { width: 100%; height: 32px; min-height: 0; text-align: right; font-variant-numeric: tabular-nums }
.till-row .num { text-align: right }
.till-totals { display: grid; gap: 4px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; font-variant-numeric: tabular-nums }
.till-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px }
.till-totals .gap { font-weight: 650 }
.till-totals .gap strong { font-size: 18px; line-height: 24px }
.till-totals .over { color: var(--teal-strong) }
.till-totals .short { color: var(--danger) }
.till-side > .button.large { margin-top: auto }
.till-card { padding: 0; gap: 0; overflow: hidden }
.till-card > h2 { margin: 0; padding: 16px 16px 12px; font-size: 16px; line-height: 22px; font-weight: 700 }
.till-card > .muted { margin: 0; padding: 0 16px 16px }
.till-card .table-wrap { border: 0; border-radius: 0 }
.till-sum :is(th, td):nth-child(n+2), .till-back :is(th, td):last-child, .till-recent :is(th, td):is(:nth-child(4), :nth-child(5)) { text-align: right; white-space: nowrap }
.till-sum tbody tr:last-child td { font-weight: 700 }
.till-recent :is(th, td):last-child { text-align: right }
.till-handover { display: grid; gap: 6px; margin-top: auto; padding: 16px; border-top: 1px solid var(--line); font-size: 13px }
.till-handover h2 { margin: 0 0 4px; font-size: 16px; line-height: 22px; font-weight: 700 }
.till-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch }
.till-grid > .till-card { display: flex; flex-direction: column }

@media (max-width: 1100px) {
  .bills, .till, .till-grid { grid-template-columns: minmax(0, 1fr) }
  .bill-side, .till-side { border-left: 0; border-top: 1px solid var(--line) }
  .till-side { position: static; height: auto; min-height: 0 }
  .page:has(> .bills), .till { min-height: 0 }
}
@media (max-width: 900px) {
  .team { grid-template-columns: minmax(0, 1fr); min-height: 0 }
  .team-list { border-right: 0; border-bottom: 1px solid var(--line) }
}

/* Người dùng (bản bàn giao): danh sách nhân viên bên trái, bảng quyền theo vai trò bên phải */
.staff { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start }
.staff-card > .muted { margin: 0; padding: 12px 16px 16px }
.staff-who { display: flex; align-items: center; gap: 10px; min-width: 0 }
.staff-who > div { display: grid; min-width: 0 }
.staff-who strong { font-weight: 650 }
.staff-table td { white-space: nowrap }
.staff-table tr.inactive td { color: var(--soft) }
.staff-table .row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 8px }
/* Tên và cách đăng nhập xuống dòng được để cột thao tác không bị cắt khi bảng quyền chiếm nửa phải. */
.staff-table .staff-who { white-space: normal; min-width: 11rem }
.role-table th:not(:first-child), .role-table td:not(:first-child) { width: 64px; padding-inline: 4px; text-align: center }
.role-yes { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; background: var(--teal-strong); color: white; font-size: 13px; font-weight: 700 }
.role-no { color: var(--line2) }
@media (max-width: 1100px) { .staff { grid-template-columns: minmax(0, 1fr) } }

/* Cấu hình QR động (bản bàn giao): mã thử khách quét ở cột phải */
.qr-side { background: white }
.qr-screen { display: grid; gap: 8px; justify-items: center; padding: 20px 16px; border-radius: 14px; background: var(--deep); color: #dbe8ea; text-align: center }
.qr-screen .qr-caption, .qr-screen .qr-content, .qr-screen .qr-wait { margin: 0; font-size: 13px; line-height: 18px }
.qr-screen .qr-wait { padding: 48px 8px; color: #b7cdd1 }
.qr-screen .qr-content strong { color: white }
.qr-amount { color: white; font-size: 30px; line-height: 38px; font-weight: 700; font-variant-numeric: tabular-nums }
.qr-code { padding: 10px; border-radius: 10px; background: white }
.qr-code img { display: block; width: 188px; height: 188px; image-rendering: pixelated }
.qr-try { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px }
.qr-try input { width: 100%; text-align: right }
.qr-sample { display: grid; gap: 2px; padding: 12px; border-radius: 8px; background: #f3f7f7 }
.qr-sample strong { font-size: 15px; letter-spacing: .02em }
.qr-rule { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line) }
.qr-rule > div { display: grid; gap: 2px; min-width: 0 }
.qr-rule strong { font-size: 13px; line-height: 18px; font-weight: 650 }
.overview-card > .qr-rule:last-child { padding-bottom: 0 }
.qr-accounts td { white-space: nowrap }
.qr-accounts td:last-child { text-align: right }
/* Cấu hình QR động nhóm 1: tài khoản mặc định và dự phòng, mẫu nội dung có xem trước, hạn mã; cột phải màn hình khách */
.qr-head { padding: 14px 16px 10px }
.qr-head h2 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700 }
.qr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch }
.qr-field { display: grid; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600 }
.qr-field input { width: 100%; font-weight: 400; letter-spacing: .01em }
.qr-field input.bad { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger) }
.qr-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--soft); font-size: 13px; line-height: 18px }
.qr-chip { min-height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: var(--teal-soft); color: var(--teal-strong); font-size: 13px; font-weight: 650 }
.qr-chip:hover { background: #c8ece4 }
.qr-sample .qr-count { color: var(--soft); font-size: 12px; line-height: 16px }
.qr-sample .qr-count.over { color: var(--danger); font-weight: 650 }
.qr-problem { margin: 0; color: var(--danger); font-size: 13px; line-height: 18px; font-weight: 600 }
.qr-rule select { flex: none; width: 7.5rem }
.qr-screen-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px }
.qr-side .button.wide { width: 100%; margin-top: 4px }
.qr-side > label { display: grid; gap: 6px; margin-top: 4px; font-size: 13px; line-height: 18px; font-weight: 600 }
.qr-side > label select { width: 100%; font-weight: 400 }
.qr-side > .meta { margin: 0 }
@media (max-width: 1100px) { .qr-grid { grid-template-columns: minmax(0, 1fr) } }
/* VietQR khi thu: số tiền, tài khoản, nội dung, đếm ngược hết hạn; hết hạn thì mã mờ đi */
.qr-figure { position: relative; justify-self: center; width: min(15rem, 100%); line-height: 0 }
.transfer-qr .qr-figure img { display: block; width: 100% }
.qr-figure.expired img { opacity: .15 }
.qr-figure.expired::after { content: "Hết hạn"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--danger); font-size: 14px; line-height: 20px; font-weight: 700 }
.qr-info { display: grid; gap: 2px; min-width: 0; font-size: 13px; line-height: 18px }
.qr-info p { margin: 0; overflow-wrap: anywhere }
.qr-sum { font-size: 20px; line-height: 26px; font-weight: 700; font-variant-numeric: tabular-nums }
.qr-line { color: var(--soft) }
.qr-line strong { color: var(--ink); letter-spacing: .02em }
.qr-info .qr-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-weight: 600; font-variant-numeric: tabular-nums }
.qr-status i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--teal-strong) }
.qr-info .qr-status.over { color: var(--danger) }
.qr-account { display: grid; gap: 4px; margin-top: 6px; color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 600 }
.qr-account select { width: 100%; height: 32px; min-height: 0; color: var(--ink); font-size: 13px; font-weight: 400 }
.qr-info .qr-note { margin-top: 4px; color: var(--soft) }

/* Thiết đặt sơ đồ (bản bàn giao, màn thiet-dat-so-do): loại kéo vào sơ đồ và danh sách bàn bên trái, mặt bằng tự do lưới 20 px ở
   giữa, thuộc tính bàn hoặc hình đang chọn bên phải */
.page:has(> .plan) { padding: 0 }
/* Cột trái 210, phải 300 (bản bàn giao: co từ 220 và 320) để mặt bằng 680 px vừa màn 1440 */
.plan { display: grid; grid-template-columns: 210px minmax(0, 1fr) 300px; min-height: calc(100dvh - 55px) }
.plan-list { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 16px; border-right: 1px solid var(--line); background: #f8fbfb }
.plan-palette { display: flex; flex-direction: column; gap: 8px; min-width: 0 }
.plan-roster { display: flex; flex-direction: column; gap: 2px; min-width: 0 }
.plan-roster .cap { margin: 10px 0 4px }
.plan-roster .cap:first-child { margin-top: 0 }
.plan-kind { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 13px; font-weight: 600; text-align: start; cursor: grab }
.plan-kind:hover { border-color: var(--teal-strong); background: var(--teal-soft) }
.plan-kind i { flex: none; width: 26px; height: 16px; border-radius: 4px; background: var(--felt); box-shadow: inset 0 0 0 2px var(--felt-rail) }
.plan-kind[data-kind="carom"] i { background: #2a6f97; box-shadow: inset 0 0 0 2px #1d4f6e }
.plan-kind[data-kind="vip"] i, .plan-kind[data-kind="room"] i { background: var(--navy); box-shadow: inset 0 0 0 2px var(--deep) }
.plan-kind[data-kind="zone"] i { background: transparent; box-shadow: none; border: 1.5px dashed var(--line2) }
.plan-kind[data-kind="counter"] i { background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line2) }
.plan-kind[data-kind="door"] i { background: transparent; box-shadow: none; border-bottom: 3px solid var(--line2); border-radius: 0 }
.plan-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 30px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; font-size: 13px; text-align: start }
.plan-row:hover { background: white }
.plan-row[aria-pressed="true"] { background: var(--teal-soft) }
.plan-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.plan-row .plan-changed { color: var(--arr-ink); font-weight: 650 }
.plan-row.off strong { color: var(--soft) }
.plan-count { margin: 8px 0 0; padding: 0 6px }
.plan-discard { align-self: flex-start; margin-top: 8px }
.plan-main { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 12px }
.fp-scroll { max-width: 100%; overflow: auto }
.fp-canvas { position: relative; border: 2px solid var(--line2); border-radius: 12px; background-color: white; touch-action: pan-x pan-y; user-select: none }
.fp-canvas.snap { background-image: radial-gradient(circle, #c9d7d9 1px, transparent 1.2px); background-size: 20px 20px; background-position: -10px -10px }
.fp-canvas.over { border-color: var(--teal-strong); box-shadow: 0 0 0 3px var(--teal-soft) }
.fp-shape { position: absolute; display: flex; min-width: 0; cursor: move; touch-action: none }
.fp-shape.zone { z-index: 1; border: 1.5px dashed var(--line2); border-radius: 10px; background: #ffffffb3 }
.fp-shape.zone.room { border-style: solid }
.fp-shape.zone > .cap { position: absolute; left: 10px; top: 7px; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.fp-shape.counter { z-index: 2; align-items: center; justify-content: center; border: 1px solid var(--line2); border-radius: 8px; background: var(--canvas) }
.fp-shape.door { z-index: 2; align-items: flex-end; justify-content: center; border-bottom: 4px solid var(--line2) }
.fp-shape.door.tall { align-items: center; justify-content: flex-end; border-bottom: 0; border-right: 4px solid var(--line2); writing-mode: vertical-rl }
.fp-label { max-width: 100%; overflow: hidden; padding: 0 4px; color: var(--soft); font-size: 12px; line-height: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap }
.fp-unit { position: absolute; z-index: 3; display: grid; place-items: center; min-width: 0; padding: 0; border: 0; border-radius: 8px; background: var(--felt); box-shadow: inset 0 0 0 5px var(--felt-rail); color: white; font-size: 14px; font-weight: 700; cursor: move; touch-action: none }
.fp-unit[data-kind="carom"] { background: #2a6f97; box-shadow: inset 0 0 0 5px #1d4f6e }
.fp-unit[data-kind="vip"], .fp-unit[data-kind="room"] { background: var(--navy); box-shadow: inset 0 0 0 5px var(--deep) }
.fp-unit.pk::before, .map-felt.pk::before { content: ""; position: absolute; inset: 0; border-radius: 8px; pointer-events: none; background: radial-gradient(circle at 7px 7px, rgba(0, 0, 0, .45) 3px, transparent 3.5px), radial-gradient(circle at 50% 4px, rgba(0, 0, 0, .45) 2.5px, transparent 3px), radial-gradient(circle at calc(100% - 7px) 7px, rgba(0, 0, 0, .45) 3px, transparent 3.5px), radial-gradient(circle at 7px calc(100% - 7px), rgba(0, 0, 0, .45) 3px, transparent 3.5px), radial-gradient(circle at 50% calc(100% - 4px), rgba(0, 0, 0, .45) 2.5px, transparent 3px), radial-gradient(circle at calc(100% - 7px) calc(100% - 7px), rgba(0, 0, 0, .45) 3px, transparent 3.5px) }
.fp-name { position: relative; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.fp-unit.dirty::after { content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--arr); box-shadow: 0 0 0 2px white }
.fp-unit.clash { outline: 2px dashed var(--danger); outline-offset: 2px }
.fp-unit:focus-visible, .fp-shape:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px }
.fp-unit[aria-pressed="true"], .fp-shape[aria-pressed="true"], .fp-unit.picked, .fp-shape.picked { outline: 2px solid var(--teal-strong); outline-offset: 3px }
.fp-handle { position: absolute; z-index: 4; width: 10px; height: 10px; border: 2px solid var(--teal-strong); border-radius: 2px; background: white; touch-action: none }
.fp-handle.nw { left: -8px; top: -8px; cursor: nwse-resize }
.fp-handle.ne { right: -8px; top: -8px; cursor: nesw-resize }
.fp-handle.sw { left: -8px; bottom: -8px; cursor: nesw-resize }
.fp-handle.se { right: -8px; bottom: -8px; cursor: nwse-resize }
.fp-rotate { position: absolute; z-index: 4; left: 50%; top: -30px; width: 12px; height: 12px; margin-left: -6px; border: 2px solid var(--teal-strong); border-radius: 50%; background: white; cursor: pointer; touch-action: none }
.fp-rotate::after { content: ""; position: absolute; left: 3px; top: 10px; height: 13px; border-left: 2px solid var(--teal-strong) }
.fp-guides { position: absolute; inset: 0; z-index: 5; pointer-events: none }
.fp-guide { position: absolute }
.fp-guide.row { height: 0; border-top: 1px dashed var(--orange) }
.fp-guide.column { width: 0; border-left: 1px dashed var(--orange) }
.fp-guide-tag { position: absolute; padding: 4px 8px; border-radius: 6px; background: var(--ink); color: white; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap }
.fp-empty { position: absolute; left: 50%; top: 50%; z-index: 1; width: min(420px, 80%); margin: 0; color: var(--soft); text-align: center; transform: translate(-50%, -50%); pointer-events: none }
.plan-hint { margin: 0; color: var(--soft); font-size: 12px; text-align: center }
.plan-side { background: white }
.plan-side > label, .plan-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600 }
.plan-side > label :is(input, select) { width: 100%; font-weight: 400 }
.plan-side .plan-price { font-weight: 500 }
.plan-side .dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px }
.plan-side .dialog-grid label { display: grid; gap: 6px; font-size: 13px; font-weight: 600 }
.plan-side .dialog-grid :is(input, select) { width: 100%; font-weight: 400 }
.plan-relay { display: grid; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line) }
.plan-relay > div:first-child { display: grid; gap: 2px }
.plan-relay-tools { display: flex; flex-wrap: wrap; gap: 8px }
.plan-side > .button:not(.plan-hide) { align-self: flex-start }
.plan-pending { color: var(--arr-ink); font-weight: 650; white-space: nowrap }
.plan-pending:empty { display: none }
.plan-actions { display: inline-flex; align-items: center; gap: 8px; flex: none }
.plan-view svg { display: none }
/* Thanh tiêu đề còn ca thu ngân và giờ: thiếu chỗ thì "N chưa lưu", thiếu nữa thì nút Xem sơ đồ bàn chỉ còn biểu tượng,
   để thanh không nhảy dòng khi bắt đầu sửa. Đo theo bề ngang thật của thanh công cụ (tên ca dài ngắn khác nhau). */
@container (max-width: 779px) { .plan-long { display: none } }
@container (max-width: 729px) {
  .plan-view { width: 36px; padding: 0 }
  .plan-view span { display: none }
  .plan-view svg { display: block }
}
.page-tools:has(> .plan-floors) { column-gap: 8px; container-type: inline-size }
.plan-floors { max-width: min(32vw, 420px); overflow-x: auto; scrollbar-width: none }
.plan-floors button { flex: none }
.plan-history { display: inline-flex; gap: 4px; flex: none }
.plan-snap { flex: none; font-size: 13px; font-weight: 600; white-space: nowrap }
.plan-flags { display: grid; gap: 14px; padding: 4px 0 12px; border-bottom: 1px solid var(--line) }
.plan-side .toggle-row { padding: 0; cursor: pointer }
.plan-side .plan-hide { margin-top: auto }
/* Sơ đồ bàn, chế độ Mặt bằng: bàn đúng chỗ của Thiết đặt sơ đồ; mặt nỉ và nhãn trạng thái tô như ô ở chế độ Lưới */
.map-wrap { overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfd }
.map-stage { position: relative }
.map-shape { cursor: default; touch-action: auto }
.map-unit { position: absolute; z-index: 3; display: flex; border-radius: 8px; cursor: pointer; font-variant-numeric: tabular-nums }
.map-felt { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 0 8px; border-radius: 8px; text-align: center }
.map-felt.on { background: var(--felt); color: white; box-shadow: inset 0 0 0 5px var(--felt-rail) }
.map-felt.off { background: var(--felt-off); color: var(--ink); box-shadow: inset 0 0 0 5px var(--felt-off-rail) }
.map-felt.ooo { color: var(--ooo-ink); background: repeating-linear-gradient(135deg, #edf0f1 0 8px, #e2e7e9 8px 16px); box-shadow: inset 0 0 0 5px #d9e0e2 }
.map-unit[data-kind="room"] .map-felt.on { background: var(--navy); box-shadow: inset 0 0 0 5px var(--deep) }
.map-felt strong { position: relative; max-width: 100%; overflow: hidden; font-size: 14px; line-height: 18px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap }
.map-sub { position: relative; max-width: 100%; overflow: hidden; font-size: 11px; line-height: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap }
.map-felt.off .map-sub { color: var(--soft) }
.map-unit.tight .map-sub { display: none }
.map-chip, .map-flag { position: absolute; top: -9px; z-index: 1; height: 18px; max-width: calc(100% - 12px); overflow: hidden; padding: 0 6px; border-radius: 6px; font-size: 11px; line-height: 18px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 0 0 2px white }
.map-chip { left: 6px; background: var(--state-bg); color: var(--state-fg) }
.map-flag { right: 6px; background: var(--arr-soft); color: var(--arr-ink) }
.map-flag.alert { background: var(--danger-soft); color: var(--danger) }
.map-unit:has(.map-flag) :is(.map-chip, .map-flag) { max-width: calc(50% - 8px) }
.map-unit[aria-selected="true"], .map-unit:focus-visible { outline: 2px solid var(--teal-strong); outline-offset: 3px }
.map-unit.warn::after { content: ""; position: absolute; inset: -5px; border: 2px solid var(--danger); border-radius: 11px; pointer-events: none }
.map-unit.dim { opacity: .3 }
.map-unit.dim:focus-visible { opacity: 1 }
@media (max-width: 1200px) {
  .plan { grid-template-columns: 200px minmax(0, 1fr) }
  .plan-side { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line) }
}
@media (max-width: 800px) {
  .plan { grid-template-columns: minmax(0, 1fr); min-height: 0 }
  .plan-list { display: contents }
  .plan-palette { order: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f8fbfb }
  .plan-palette > :is(.cap, .meta, .button) { grid-column: 1 / -1 }
  .plan-main { order: 2; align-items: stretch; padding: 8px }
  .plan-side { order: 3 }
  .plan-roster { order: 4; padding: 12px 16px 16px; border-top: 1px solid var(--line); background: #f8fbfb }
  .plan-floors { max-width: 100% }
}

/* Năng lượng (bản bàn giao): bảng đèn từng bàn, cột quy tắc tự động và bộ điều khiển */
.light { display: inline-flex; align-items: center; gap: 6px; font-weight: 600 }
.light::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ctl) }
.light.on::before { background: var(--arr) }
.light-table td { white-space: nowrap }
.light-table td:last-child { text-align: right }
.energy-side { gap: 12px }
.energy-rules { display: grid; gap: 12px }
.energy-rules > .button { justify-self: start }
.energy-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; line-height: 18px }
.energy-rule input { width: 64px; height: 32px; min-height: 0; text-align: center }
.energy-rule input[type="time"] { width: 96px }
.energy-rules .toggle-row.energy-flag { padding: 0; gap: 12px }
.energy-flag .energy-rule { font-size: 14px; line-height: 20px; font-weight: 650 }
.till.single { grid-template-columns: minmax(0, 1fr) }
.light-log td { white-space: nowrap }
.light-log .audit-detail { justify-items: start }
.energy-rule input:disabled { color: var(--muted); background: #f3f6f6 }
.light-log td:nth-child(5) { white-space: normal; min-width: 10rem }
.energy-gateway { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 10px }
.energy-side h2 + .energy-gateway { margin-top: -4px }

/* Hộp thoại Mở bàn (bản bàn giao 04/12): ô số − +, hẹn giờ dạng nút phân đoạn, thẻ bật tắt, Enter bắt đầu tính giờ */
dialog.open-dialog { width: min(35rem, calc(100% - 24px)) }
dialog #dialog-body:has(> .field-group) { gap: 16px }
.field-group { display: grid; gap: 6px; min-width: 0; font-size: 13px; line-height: 18px; font-weight: 600 }
.field-group > .qty { justify-self: start }
.field-hint { margin: 0; color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 500 }
.field-hint.alert-text { color: var(--danger); font-weight: 600 }
.qty input { width: 2.6rem; min-height: 0; height: 1.85rem; padding: 0; border: 0; border-radius: 0; text-align: center; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0 }
.toggle-card { display: grid; border: 1px solid var(--line); border-radius: 10px }
.toggle-card > * + * { border-top: 1px solid var(--line) }
form label.toggle-row, .toggle-row { display: flex; align-items: center; gap: 10px; padding: 12px; font-size: 14px; line-height: 20px; font-weight: 400 }
form label.toggle-row { cursor: pointer }
form label.toggle-row:has(input:disabled) { cursor: default }
.toggle-row > div { display: grid; flex: 1; min-width: 0 }
.toggle-row > div > strong { font-weight: 650 }
.toggle-row > div > span { color: var(--soft); font-size: 12px; line-height: 16px; font-weight: 500 }
.open-booking { display: grid; gap: 2px; padding: 12px 14px }
.open-booking strong { font-size: 15px; font-weight: 650 }

/* Gọi món (bản bàn giao): danh mục bên trái, giỏ món mới cao hết hộp bên phải, nút Thêm vào bàn ở cuối giỏ */
dialog.order-dialog #dialog-body { padding: 0 }
dialog.order-dialog .order-layout { grid-template-columns: minmax(0, 1fr) 21rem; gap: 0; align-items: stretch }
dialog.order-dialog .order-catalog { align-content: start; padding: 16px 20px }
dialog.order-dialog .order-cart { padding: 16px 20px 12px; border: 0; border-left: 1px solid var(--line); border-radius: 0 }
dialog.order-dialog .order-cart .cart-lines { flex: 1 }
dialog.order-dialog .dialog-footer { width: 21rem; margin-left: auto; padding-top: 0; border-top: 0; border-left: 1px solid var(--line) }
dialog.order-dialog #confirm { flex: 1 }

/* Thanh toán (bản bàn giao): bảng tiền bên trái; tổng, cách trả, VietQR động bên phải; F9 hoàn tất */
dialog.pay-wide { width: min(70rem, calc(100% - 24px)); max-height: min(94dvh, 52rem) }
dialog.pay-wide #dialog-body { padding: 0 }
dialog.pay-wide .dialog-footer { justify-content: start }
dialog.pay-dialog #confirm { min-height: 44px; font-size: 15px }
.pay-layout { display: grid; grid-template-columns: minmax(0, 1fr) 24rem }
.pay-main { display: grid; gap: 16px; align-content: start; min-width: 0; padding: 16px 20px }
.pay-side { display: grid; gap: 14px; align-content: start; min-width: 0; padding: 16px 20px; border-left: 1px solid var(--line); background: #f8fbfb; font-variant-numeric: tabular-nums }
dialog:not(.pay-wide) .pay-side { padding: 0; border: 0; background: none }
.pay-guest { display: grid; gap: 2px; padding: 12px 14px }
.pay-guest strong { margin-top: 2px; font-weight: 650 }
.pay-part { display: grid; gap: 6px; min-width: 0 }
.pay-table :is(th, td):nth-last-child(-n+2), .pay-table.items :is(th, td):nth-child(2) { text-align: right; white-space: nowrap }
.pay-sums { display: grid; gap: 6px; font-size: 13px }
.pay-sums span { color: var(--soft); font-weight: 500 }
.pay-sums strong { font-weight: 500 }
.pay-due { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding-top: 10px; border-top: 1px solid var(--line) }
.pay-due span { font-weight: 650 }
.pay-due strong { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.01em }
.pay-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px }
.pay-ways.pair { grid-template-columns: repeat(2, minmax(0, 1fr)) }
/* Chọn một vị trí trong danh sách (Đổi sang bàn khác) */
.choice-list { display: grid; gap: 6px; max-height: 50dvh; overflow: auto }
.choice-row { display: grid; grid-template-columns: auto 64px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer }
.choice-row:has(input:checked) { border-color: var(--teal-strong); background: var(--teal-soft) }
.choice-row .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
/* Chia nhiều cách: số tiền theo từng cách trả và số còn chưa chia */
.pay-split { display: grid; gap: 8px }
.split-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; font-weight: 600 }
.split-row input { width: 100%; height: 36px; min-height: 0; text-align: right; font-variant-numeric: tabular-nums }
.split-left { font-size: 13px }
.split-left.over strong { color: var(--danger) }
/* Danh sách hóa đơn: dòng phân trang ở chân bảng */
.bill-pager { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line) }
/* Nhật ký thao tác: đối tượng và chi tiết xuống dòng, dòng trước → sau nhỏ bên dưới. */
.audit-table td.audit-wrap { white-space: normal; min-width: 12rem; max-width: 28rem }
.audit-detail { display: grid; gap: 2px }
.audit-head { padding: 14px 16px; border-bottom: 1px solid var(--line) }
.audit-head h2 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700 }
.audit-main > .muted { max-width: 72rem }
.opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 10px; background: white; font-size: 14px; font-weight: 600; text-align: center }
.opt:hover { background: var(--teal-soft) }
.opt[aria-pressed="true"] { border-color: var(--teal-strong); box-shadow: 0 0 0 1px var(--teal-strong); background: var(--teal-soft) }
.qr-card { display: grid; gap: 8px; padding: 14px }
.qr-card .transfer-qr { grid-template-columns: 140px minmax(0, 1fr); align-items: start; gap: 4px 14px; font-size: 13px }
.qr-card .transfer-qr .qr-figure { width: 140px }
.qr-card .transfer-qr .qr-figure img { margin: 0; border: 1px solid var(--line); border-radius: 4px }
.qr-card .transfer-qr > .muted { grid-column: 1 / -1 }
.pay-paid, .pay-left { font-size: 13px }
.pay-paid span { color: var(--soft) }
.pay-left { margin-top: -8px; font-weight: 650 }
.pay-left strong { color: var(--danger) }
.pay-left.refund strong { color: var(--vac-ink) }
@media (max-width: 860px) {
  .pay-layout { grid-template-columns: minmax(0, 1fr) }
  .pay-side { border-left: 0; border-top: 1px solid var(--line) }
  dialog.order-dialog .order-layout { grid-template-columns: minmax(0, 1fr) }
  dialog.order-dialog .order-cart { border-left: 0; border-top: 1px solid var(--line) }
  dialog.order-dialog .dialog-footer { width: auto; margin-left: 0; border-left: 0 }
}
/* Nhóm 2: đăng nhập bằng mã PIN trên máy tin cậy, hộp duyệt mã PIN (shared/pin.js), bảng quyền và máy tin cậy ở màn Người dùng */
.login-device { margin-top: 2px; color: var(--soft); font-size: 13px; font-weight: 600 }
.login-hint { margin-top: 12px; color: var(--soft); font-size: 12px; line-height: 16px }
.login-switch, .pin-change { display: block; margin: 12px auto 0; padding: 4px 6px; border: 0; background: transparent; color: var(--teal-strong); font-weight: 600; text-decoration: underline; text-underline-offset: 3px }
.pin-login { display: grid; gap: 12px; margin-top: 12px }
.pin-hint { color: var(--soft); font-size: 13px }
.pin-staff { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px }
.pin-person { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 12px 6px; border: 1px solid var(--line2); border-radius: 12px; background: white; text-align: center }
.pin-person:hover { background: var(--teal-soft); border-color: var(--teal-strong) }
.pin-face { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--navy-active); color: white; font-size: 14px; font-weight: 700 }
.pin-names { display: grid; gap: 1px; min-width: 0 }
.pin-names strong { font-size: 14px; line-height: 18px; font-weight: 650; overflow-wrap: anywhere }
.pin-names small { color: var(--soft); font-size: 12px; line-height: 16px }
.pin-step { display: grid; gap: 12px; justify-items: center }
.pin-who { display: flex; align-items: center; gap: 10px; text-align: start }
input.pin-field { width: 10rem; min-height: 48px; padding: 0 0 0 .5em; text-align: center; font-size: 24px; letter-spacing: .5em }
.pin-pad { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; justify-content: center }
.pin-key { min-height: 52px; border: 1px solid var(--line2); border-radius: 12px; background: white; font-size: 20px; font-weight: 650 }
.pin-key:hover:not(:disabled), .pin-key:active { background: var(--teal-soft) }
.pin-key.pin-ok { background: var(--teal-strong); border-color: var(--teal-strong); color: white }
.pin-key.pin-ok:hover:not(:disabled) { background: var(--teal-hover) }
.pin-key.pin-back { color: var(--soft) }
.pin-error, .approval-error { margin: 0; color: var(--danger); font-size: 13px; line-height: 18px; font-weight: 600; text-align: center }
.pin-change { margin-top: 0 }
dialog.approval-dialog { width: min(26rem, calc(100% - 24px)) }
.approval-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line) }
.approval-head h2 { font-size: 18px; line-height: 24px; font-weight: 700 }
.approval-lock { width: 22px; height: 22px; flex: none; margin-top: 1px; fill: none; stroke: var(--due); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round }
.approval-reason { margin-top: 2px; color: var(--soft); font-size: 13px; line-height: 18px }
.approval-body { display: grid; gap: 10px; padding: 16px 20px }
.approval-cap { color: var(--soft); font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase }
.approval-people { display: grid; gap: 6px }
.approver { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 10px; background: white; text-align: start }
.approver:hover { border-color: var(--teal-strong) }
.approver[aria-pressed="true"] { border-color: var(--teal-strong); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal-strong) }
.approver .pin-face { width: 32px; height: 32px; font-size: 12px }
.approval-none { padding: 8px 10px; border: 1px dashed var(--line2); border-radius: 10px; color: var(--soft); font-size: 13px }
.approval-pin { display: grid; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600 }
.approval-pin input.pin-field { width: 100% }
.approval-note { color: var(--soft); font-size: 12px; line-height: 16px }
.approval-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; background: #f8fbfb; border-top: 1px solid var(--line) }
.staff-side { display: grid; gap: 16px; align-content: start; min-width: 0 }
.role-lock { width: 14px; height: 14px; margin-left: 6px; vertical-align: -2px; fill: none; stroke: var(--due); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }
.role-table select.sel-in { min-height: 28px; height: 28px; padding: 0 4px; font-size: 13px }
.device-list { list-style: none; margin: 0; padding: 0 }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line) }
.device-text { display: grid; gap: 2px; min-width: 0 }
.device-text strong { display: flex; align-items: center; gap: 8px; font-weight: 650 }
.device-row .row-actions { flex: none; display: flex; gap: 8px }
.audit-approver { color: var(--due-ink) }

/* Hội viên (nhóm 2): Khách lẻ / Hội viên ở hộp Mở bàn, ô tìm thẻ, khối thẻ, nhãn hạng, trang Hội viên, hạng thẻ. */
.guest-kind { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px }
.guest-kind .opt .meta { font-weight: 500 }
.member-pick .search, .member-search { flex: none; width: 100%; max-width: none }
form label.search.member-search { display: flex; align-items: center; gap: 8px; height: 40px; font-weight: 400 }
.member-search svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round }
form label.member-search input { flex: 1; min-height: 0; height: 36px; padding: 0; border: 0; outline: 0; background: transparent }
.member-results { display: grid; gap: 6px; max-height: 15.5rem; overflow: auto }
.member-results:empty { display: none }
.member-row, .member-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; width: 100%; min-height: 56px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font: inherit; font-weight: 400; text-align: left }
.member-row { cursor: pointer }
.member-row:hover { background: var(--teal-soft) }
.member-row[aria-pressed="true"], .member-chip { border-color: var(--teal-strong); background: var(--teal-soft) }
.member-row[aria-pressed="true"] { box-shadow: 0 0 0 1px var(--teal-strong) }
.member-row > .badge, .member-chip > .badge { margin-left: auto }
.member-face { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: white; font-size: 13px; font-weight: 700 }
.member-text { display: grid; flex: 1 1 11rem; gap: 1px; min-width: 0 }
.member-text strong { overflow: hidden; font-size: 14px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis }
.member-text .meta { overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.member-tag { justify-self: start; margin-top: 2px }
.panel-row > .row-actions { display: flex; flex: none; flex-wrap: nowrap }
.pay-table.perk-table :is(th, td):first-child { text-align: left; white-space: normal }
.tile-meta .meta.tile-tier { flex: 0 1 auto; height: 18px; padding: 0 6px; border-radius: 5px; background: var(--cln-soft); color: var(--cln-ink); font-size: 11px; line-height: 18px; font-weight: 600 }
.tile-meta .meta.tile-tier.alert { padding: 0; background: none; color: var(--danger); font-size: inherit; font-weight: 650 }
.member-table td:first-child strong { font-variant-numeric: tabular-nums }
.member-table .audit-detail .badge { justify-self: start }
.member-side .bill-actions { margin-top: 0 }
.member-side h3 { margin: 4px 0 0; font-size: 15px; line-height: 20px; font-weight: 700 }
.member-facts { display: grid; gap: 4px; font-size: 13px }
.point-log { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 10px; background: white }
.point-log li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "kind text points" "kind text left"; align-items: center; column-gap: 10px; padding: 8px 12px; font-size: 13px }
.point-log li + li { border-top: 1px solid var(--line) }
.point-log .badge { grid-area: kind; align-self: start }
.point-log .audit-detail { grid-area: text; min-width: 0 }
.point-log strong { grid-area: points; justify-self: end; font-variant-numeric: tabular-nums }
.point-log li > .meta { grid-area: left; justify-self: end }
.point-log .up { color: var(--teal-strong) }
.point-log .down { color: var(--danger) }
.tier-table td:not(:first-child), .tier-table th:not(:first-child) { text-align: right }
.tier-rows { display: grid; gap: 6px }
.tier-row { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)) 36px; align-items: center; gap: 8px }
.tier-head { color: var(--soft); font-size: 12px; font-weight: 600 }
.tier-row input { min-width: 0 }
.tier-row > .field-group { justify-self: start }
