/* ═══════════ Sổ tiệc The Adora ═══════════ */
@font-face { font-family: 'Be Vietnam Pro'; src: url(/fonts/be-vietnam-pro-regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url(/fonts/be-vietnam-pro-medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url(/fonts/be-vietnam-pro-semibold.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Be Vietnam Pro'; src: url(/fonts/be-vietnam-pro-bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  /* primitive */
  --navy-950: #0F1930; --navy-900: #16233F; --navy-800: #1F3054; --navy-700: #2A3F6B; --navy-100: #E6EAF2; --navy-50: #F2F4F8;
  --gold-600: #96753F; --gold-500: #B08D57; --gold-100: #F3EBDD; --gold-50: #FAF6EE;
  --gray-900: #1A2233; --gray-700: #3D475A; --gray-500: #6A7385; --gray-400: #949CAB; --gray-300: #C9CED8; --gray-200: #E2E5EB; --gray-100: #EEF0F4; --gray-50: #F6F7F9;
  --white: #fff;

  /* semantic */
  --bg: #F3F4F7; --surface: var(--white); --line: var(--gray-200); --line-strong: var(--gray-300);
  --text: var(--gray-900); --muted: var(--gray-500); --accent: var(--gold-500); --primary: var(--navy-800); --primary-hover: var(--navy-700);
  --focus: 0 0 0 3px rgba(42, 63, 107, .28);

  /* trạng thái booking (theo biên bản họp 25/11/2026) */
  --st-hold-bg: #FFF4E0; --st-hold-bd: #E8920C; --st-hold-tx: #7A4300;
  --st-submitted-bg: #FFE9C7; --st-submitted-bd: #E8920C; --st-submitted-tx: #6E3B00;
  --st-unapproved-bg: #FFE9C7; --st-unapproved-bd: #E07A00; --st-unapproved-tx: #6E3B00;   /* cam – theo biên bản họp */
  --st-confirmed-bg: #DDF3E4; --st-confirmed-bd: #1E9E4A; --st-confirmed-tx: #0F5229;
  --st-canceled-bg: #EEF0F3; --st-canceled-bd: #A3AAB7; --st-canceled-tx: #6A7385;

  --radius: 10px; --radius-sm: 6px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-3: 0 12px 32px rgba(16, 24, 40, .18);
  --nav-w: 232px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 400 14px/1.45 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--navy-700); }
:focus-visible { outline: none; box-shadow: var(--focus); }
.ico { flex: none; display: block; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.block { display: block; }
.nowrap { white-space: nowrap; }
.empty { color: var(--muted); padding: 32px; text-align: center; }
.loading-screen { display: grid; place-items: center; height: 100vh; color: var(--muted); }

/* ─────────── Khung ─────────── */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; height: 100vh; height: 100dvh; }
.shell.nav-min { --nav-w: 68px; }
.nav { position: relative; background: var(--navy-900); color: #C9D1E3; display: flex; flex-direction: column; min-height: 0; }
.nav__brand { padding: 22px 20px 18px; display: grid; justify-items: center; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-the { font: italic 400 20px/1 Georgia, 'Times New Roman', serif; color: var(--gold-500); margin-bottom: -2px; }
.brand-name { font: 400 26px/1.1 Georgia, 'Times New Roman', serif; letter-spacing: .22em; color: #fff; margin-right: -.22em; }
.brand-logo { display: block; width: 150px; height: auto; }
.nav-min .brand-logo { width: 54px; }
.login__brand .brand-logo { width: 240px; }
.brand-sub { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-500); margin-top: 10px; }
.nav__menu { padding: 14px 10px; display: grid; gap: 2px; align-content: start; flex: 1; overflow-y: auto; }
.nav__menu a, .nav__dis { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: inherit; text-decoration: none; font-weight: 500; min-height: 44px; }
.nav__menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav__menu a.on { background: var(--navy-800); color: #fff; box-shadow: inset 3px 0 0 var(--gold-500); }
.nav__dis { opacity: .42; cursor: default; }
.nav__soon { margin: 14px 12px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #6F7C99; }
.nav__user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-500); color: var(--navy-950); display: grid; place-items: center; font-weight: 700; flex: none; }
.nav__who { display: grid; min-width: 0; flex: 1; }
.nav__who b { color: #fff; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav__who small { color: #8F9BB6; }
.nav__user form { margin: 0; }
.nav__collapse { position: absolute; right: -12px; top: 30px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--gray-700); display: grid; place-items: center; box-shadow: var(--shadow-1); z-index: 5; }
.nav-min .nav__brand { padding: 18px 4px; }
.nav-min .brand-name { font-size: 15px; letter-spacing: .08em; margin: 0; }
.nav-min .brand-sub, .nav-min .nav__menu span, .nav-min .nav__soon, .nav-min .nav__who { display: none; }
.nav-min .nav__menu a, .nav-min .nav__dis { justify-content: center; padding: 10px 0; }
.nav-min .nav__user { flex-direction: column; padding: 12px 4px; }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.ibtn.mob-menu, .nav-scrim { display: none; }

/* PWA: chừa vùng tai thỏ / thanh trạng thái iOS (status bar trong suốt) */
.shell { padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); background: var(--navy-900); }
.main { background: var(--bg); }
.drawer { padding-top: env(safe-area-inset-top); }
.drawer__foot, .nav__user { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.toasts { bottom: max(18px, env(safe-area-inset-bottom)); }
.login-page { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.nav__install { display: flex; align-items: center; gap: 12px; margin: 6px 0 0; padding: 10px 12px; min-height: 44px; border-radius: 8px; border: 1px dashed rgba(176,141,87,.6); background: transparent; color: var(--gold-500); font-weight: 600; text-align: left; }
.nav__install:hover { background: rgba(176,141,87,.12); }
.nav-min .nav__install { justify-content: center; padding: 10px 0; }
.nav-min .nav__install span { display: none; }
/* thông báo */
.nav__badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: #E03A1E; color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
.nav__badge--warn { background: var(--gold-500); color: var(--navy-950); }
.nav-min .nav__menu a { position: relative; }
.nav-min .nav__badge { position: absolute; top: 4px; right: 6px; min-width: 18px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
.mob-menu__dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: #E03A1E; border: 2px solid #fff; }
.row-gap { display: flex; align-items: center; gap: 6px; }
.drawer--notif { width: min(440px, 100vw); }
.drawer__body--flush { padding: 0; }
.nt { position: relative; display: flex; gap: 12px; width: 100%; padding: 13px 34px 13px 18px; border: 0; border-bottom: 1px solid var(--gray-100); background: #fff; text-align: left; }
.nt:hover { background: var(--gray-50); }
.nt.unread { background: #F5F8FD; }
.nt__ic { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-100); color: var(--gray-700); }
.nt__ic--warn { background: var(--st-submitted-bg); color: var(--st-submitted-tx); }
.nt__ic--ok { background: var(--st-confirmed-bg); color: var(--st-confirmed-tx); }
.nt__ic--err { background: var(--st-unapproved-bg); color: var(--st-unapproved-tx); }
.nt__ic--info { background: #E4EEFB; color: #1B3F73; }
.nt__main { display: grid; gap: 2px; min-width: 0; }
.nt__main b { font-size: 13.5px; font-weight: 600; color: var(--navy-900); }
.nt.unread .nt__main b { font-weight: 700; }
.nt__main small { color: var(--gray-700); }
.nt__main em { font-style: normal; font-size: 12px; color: var(--muted); }
.nt__dot { position: absolute; right: 16px; top: 18px; width: 9px; height: 9px; border-radius: 50%; background: #1D63B8; }
.toast--info { background: var(--navy-800); border-left: 4px solid var(--gold-500); }

.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(15,25,48,.5); display: grid; place-items: center; padding: 16px; }
.modal { width: min(420px, 100%); background: #fff; border-radius: 14px; box-shadow: var(--shadow-3); padding: 22px; }
.modal h2 { margin: 0 0 10px; font-size: 18px; color: var(--navy-900); }
.modal ol { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 8px; }
.modal .kbd { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--gray-50); font-weight: 600; }

/* ─────────── Nút & control ─────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; white-space: nowrap; background: var(--gray-100); color: var(--text); transition: background .15s, border-color .15s; }
.btn small { font-weight: 500; opacity: .75; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); }
.btn--ghost:hover:not(:disabled) { background: var(--gray-50); border-color: var(--gray-400); }
.btn--ok { background: var(--st-confirmed-bd); color: #fff; }
.btn--ok:hover:not(:disabled) { background: #178540; }
.btn--hold { background: var(--st-hold-bg); border-color: var(--st-hold-bd); color: var(--st-hold-tx); }
.btn--warn { background: var(--st-unapproved-bg); border-color: var(--st-unapproved-bd); color: var(--st-unapproved-tx); }
.btn--danger { background: #C62828; color: #fff; }
.btn--danger-t { color: #B42318; }
.ibtn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--gray-700); flex: none; }
.ibtn:hover { background: var(--gray-100); }
.ibtn.on { background: var(--navy-100); color: var(--navy-800); }
.ibtn--nav { color: #8F9BB6; }
.ibtn--nav:hover { background: rgba(255,255,255,.08); color: #fff; }
.ibtn--date { cursor: pointer; overflow: hidden; }
.ibtn--date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ibtn--date input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.ibtn--badge .badge { position: absolute; top: 1px; right: -4px; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold-500); color: var(--navy-950); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.spin .ico { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.seg { display: inline-flex; background: var(--gray-100); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--gray-700); font-weight: 500; }
.seg button.on { background: #fff; color: var(--navy-900); box-shadow: var(--shadow-1); font-weight: 600; }
.sel, .inp { height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: #fff; min-width: 0; }
textarea.inp { height: auto; padding: 8px 10px; resize: vertical; }
.sel:focus, .inp:focus { border-color: var(--navy-700); box-shadow: var(--focus); outline: none; }
.sel--center { font-weight: 600; }
.search { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--muted); }
.search input { border: 0; outline: 0; width: 200px; background: transparent; color: var(--text); }
.search:focus-within { border-color: var(--navy-700); box-shadow: var(--focus); }
.search--lg input { width: 280px; }
.tgl { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--gray-700); cursor: pointer; user-select: none; }
.tgl input { width: 16px; height: 16px; accent-color: var(--navy-800); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }

/* ─────────── Toolbar sổ tiệc ─────────── */
.board { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.tb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tb__group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb__group--right { margin-left: auto; }
.tb__center { font-weight: 700; padding: 0 6px; }
.tb__nav { display: flex; align-items: center; gap: 4px; }
.tb__title { display: grid; text-align: center; min-width: 190px; line-height: 1.2; }
.tb__title strong { font-size: 16px; font-weight: 700; color: var(--navy-900); }
.tb__title small { color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 15px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 500; color: var(--gray-700); }
.chip i { width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid; }
.chip b { font-weight: 700; color: var(--text); }
.chip.off { opacity: .45; }
.chip--hold i { background: var(--st-hold-bg); border-color: var(--st-hold-bd); border-style: dashed; }
.chip--submitted i { background: var(--st-submitted-bg); border-color: var(--st-submitted-bd); }
.chip--unapproved i { background: var(--st-unapproved-bg); border-color: var(--st-unapproved-bd); }
.chip--confirmed i { background: var(--st-confirmed-bg); border-color: var(--st-confirmed-bd); }
.chip--canceled i { background: var(--st-canceled-bg); border-color: var(--st-canceled-bd); }
.legend .tgl { margin-left: 6px; }
.legend__hint { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.dot, .bk__dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #E03A1E; box-shadow: 0 0 0 2px rgba(224,58,30,.2); }

.board__body { flex: 1; min-height: 0; display: flex; position: relative; }

/* ─────────── Bảng sổ tiệc (tuần / tháng) ─────────── */
.sb-wrap { flex: 1; overflow: auto; overscroll-behavior: contain; background: var(--surface); }
.sb { border-collapse: separate; border-spacing: 0; min-width: 100%; table-layout: fixed; width: calc(96px + var(--cols) * 140px); }
.sb th, .sb td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sb thead th { position: sticky; background: var(--navy-50); z-index: 3; font-weight: 600; }
.sb-floors th { top: 0; height: 28px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-600); background: var(--gold-50); border-bottom-color: var(--gold-100); }
.sb-floors th + th { border-left: 2px solid var(--gold-100); }
.sb-halls th { top: 28px; height: 46px; vertical-align: middle; border-bottom: 1px solid var(--line-strong); }
.sb-hall span { display: block; font-size: 13.5px; font-weight: 700; color: var(--navy-900); }
.sb-hall small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.sb thead th.sb-corner { left: 0; top: 0; z-index: 5; width: 96px; background: var(--navy-50); color: var(--navy-900); vertical-align: middle;
  text-transform: none; letter-spacing: 0; font-size: 13.5px; border-bottom: 1px solid var(--line-strong); }
.sb-corner span { display: block; font-weight: 700; }
.sb-corner small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }

.sb-date { position: sticky; left: 0; z-index: 2; width: 96px; background: #fff; padding: 6px 8px 6px 12px; text-align: left; vertical-align: top; cursor: pointer; font-weight: 400; }
.sb-date:hover { background: var(--navy-50); }
.sb-date__d { display: inline-block; font-size: 15px; font-weight: 700; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.sb-date__w { display: inline-block; margin-left: 4px; font-size: 12px; font-weight: 600; color: var(--gray-700); }
.sb-date__w.sat { color: #1D63B8; }
.sb-date__w.sun { color: #C2261C; }
.sb-date__l { display: block; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-date__l::before { content: 'ÂL '; opacity: .7; }
.sb-date__l.special { color: var(--gold-600); font-weight: 600; }
.sb-date__n { display: block; margin-top: 2px; font-size: 11.5px; color: var(--navy-700); font-weight: 600; }
.sb-row.is-weekend .sb-date { background: #FBF8F1; }
.sb-row.is-weekend .sb-cell { background: #FFFDF9; }
.sb-row.is-today .sb-date { box-shadow: inset 4px 0 0 var(--gold-500); background: var(--gold-50); }
.sb-row.is-today td { border-bottom-color: var(--gold-500); }

.sb-cell { position: relative; vertical-align: top; padding: 4px 4px 14px; height: 50px; cursor: cell; }
.sb-cell:hover { background: var(--navy-50) !important; }
.sb-add { position: absolute; right: 6px; bottom: 1px; font-size: 15px; line-height: 1; color: var(--gray-400); opacity: 0; transition: opacity .12s; pointer-events: none; }
.sb-cell:hover .sb-add { opacity: 1; }
@media (hover: none) { .sb-add { opacity: .5; } }
.sb-cell.is-blocked { background: repeating-linear-gradient(135deg, #F2F3F6 0 6px, #E8EAEF 6px 12px) !important; cursor: not-allowed; }
.blk { display: flex; gap: 4px; align-items: center; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; font: inherit; font-size: 11.5px; color: var(--gray-700); font-weight: 600; margin-bottom: 3px; cursor: pointer; }
.blk:hover { color: var(--navy-900); text-decoration: underline; }

/* thẻ booking */
.bk { display: block; width: 100%; text-align: left; margin: 0 0 3px; padding: 3px 6px 4px 7px; border-radius: var(--radius-sm); border: 1px solid; border-left-width: 3px; font-size: 12px; line-height: 1.3; background: var(--bk-bg); border-color: var(--bk-bd); color: var(--bk-tx); transition: box-shadow .12s, transform .12s, opacity .12s; }
.bk:hover, .bk.is-linked { box-shadow: 0 0 0 2px var(--bk-bd), var(--shadow-1); position: relative; z-index: 1; }
.bk.is-dim { opacity: .25; }
.bk__l1 { display: flex; align-items: center; gap: 5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 0; overflow: hidden; }
.bk__tables { font-weight: 500; opacity: .8; }
.bk__ret { flex: none; stroke-width: 2.4; margin-right: -2px; }
/* sự kiện dài ngày: nhãn "Ngày 1/3" */
.bk__day { flex: none; padding: 0 5px; border-radius: 4px; background: var(--bk-bd); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px; }
.bk--canceled .bk__day { background: var(--gray-400); }
.bk__ic { margin-left: auto; opacity: .85; }
.bk__dot { flex: none; }
.bk__l1 .bk__ic + .bk__dot { margin-left: 0; }
.bk__l1 .bk__dot:only-of-type { margin-left: auto; }
.bk__name { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk--compact { display: flex; align-items: baseline; gap: 5px; padding: 2px 5px 2px 6px; }
.bk--compact .bk__l1 { flex: none; }
.bk--compact .bk__name { flex: 1; min-width: 0; }
.bk--compact .bk__tables { display: none; }
.bk--hold { --bk-bg: var(--st-hold-bg); --bk-bd: var(--st-hold-bd); --bk-tx: var(--st-hold-tx); border-style: dashed; border-left-style: solid; }
.bk--submitted { --bk-bg: var(--st-submitted-bg); --bk-bd: var(--st-submitted-bd); --bk-tx: var(--st-submitted-tx); }
.bk--unapproved { --bk-bg: var(--st-unapproved-bg); --bk-bd: var(--st-unapproved-bd); --bk-tx: var(--st-unapproved-tx); }
.bk--confirmed { --bk-bg: var(--st-confirmed-bg); --bk-bd: var(--st-confirmed-bd); --bk-tx: var(--st-confirmed-tx); }
.bk--canceled { --bk-bg: var(--st-canceled-bg); --bk-bd: var(--st-canceled-bd); --bk-tx: var(--st-canceled-tx); }
.bk--canceled .bk__name, .bk--canceled .bk__time { text-decoration: line-through; }
.is-searching .bk:not(.is-dim) { box-shadow: 0 0 0 2px var(--navy-700); }

/* ─────────── Timeline 1 ngày ─────────── */
.tl-wrap { flex: 1; overflow: auto; background: var(--surface); }
.tl { min-width: calc(64px + var(--cols) * 150px); }
.tl-head { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(150px, 1fr)); background: var(--navy-50); border-bottom: 1px solid var(--line-strong); }
.tl-corner { position: sticky; left: 0; background: var(--navy-50); color: var(--navy-900); border-right: 1px solid var(--line-strong); display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.tl-hall { padding: 8px; text-align: center; border-right: 1px solid var(--line); }
.tl-hall span { display: block; font-weight: 700; color: var(--navy-900); }
.tl-hall small { color: var(--muted); }
.tl-body { position: relative; display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(150px, 1fr)); }
.tl-hours { position: sticky; left: 0; z-index: 2; background: #fff; border-right: 1px solid var(--line-strong); }
.tl-hour { height: var(--hpx); padding: 2px 8px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.tl-col { position: relative; border-right: 1px solid var(--line); }
.tl-slot { height: var(--hpx); border-bottom: 1px dashed var(--gray-100); cursor: cell; }
.tl-slot:nth-child(2n) { border-bottom-style: solid; border-bottom-color: var(--line); }
.tl-slot:hover { background: var(--navy-50); }
.tl-item { position: absolute; left: 4px; right: 4px; }
.tl-item .bk { height: 100%; overflow: hidden; }
.tl-blk { position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(200,205,215,.45) 0 6px, rgba(225,228,235,.45) 6px 12px); display: flex; align-items: flex-start; gap: 4px; padding: 6px; border: 0; text-align: left; font: inherit; font-size: 12px; font-weight: 600; color: var(--gray-700); cursor: pointer; }
.tl-blk:hover { color: var(--navy-900); text-decoration: underline; }
/* Hộp xem lịch khóa sảnh */
.blk-modal { width: min(460px, 100%); }
.blk-modal__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.blk-modal__head > div { flex: 1; }
.blk-modal__head small { color: var(--muted); }
.blk-modal__head h2 { margin: 2px 0 0; font-size: 18px; }
.blk-modal__ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: repeating-linear-gradient(135deg, #F2F3F6 0 5px, #E6E8ED 5px 10px); color: var(--gray-700); }
.tl-now { position: absolute; left: 64px; right: 0; height: 2px; background: #E03A1E; z-index: 2; pointer-events: none; }
.tl-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #E03A1E; }

/* ─────────── Danh sách bên phải ─────────── */
.side-list { width: 360px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #fff; min-height: 0; }
.side-list header { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--line); }
.side-list header small { color: var(--muted); flex: 1; }
.side-list__body { overflow-y: auto; flex: 1; }
.li { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; border: 0; border-bottom: 1px solid var(--gray-100); background: #fff; text-align: left; }
.li:hover { background: var(--gray-50); }
.li__date { width: 44px; flex: none; text-align: center; font-weight: 700; color: var(--navy-900); font-size: 13px; line-height: 1.2; }
.li__date small { display: block; font-weight: 500; color: var(--muted); }
.li__main { flex: 1; min-width: 0; display: grid; }
.li__main b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li__main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li--canceled .li__main b { text-decoration: line-through; color: var(--muted); }

/* badge trạng thái */
.st { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid; }
.st--sm { height: 18px; padding: 0 6px; font-size: 10.5px; }
.st--lg { height: 28px; padding: 0 12px; font-size: 13px; border-radius: 14px; }
.st--hold { background: var(--st-hold-bg); border-color: var(--st-hold-bd); color: var(--st-hold-tx); border-style: dashed; }
.st--submitted { background: var(--st-submitted-bg); border-color: var(--st-submitted-bd); color: var(--st-submitted-tx); }
.st--unapproved { background: var(--st-unapproved-bg); border-color: var(--st-unapproved-bd); color: var(--st-unapproved-tx); }
.st--confirmed { background: var(--st-confirmed-bg); border-color: var(--st-confirmed-bd); color: var(--st-confirmed-tx); }
.st--canceled { background: var(--st-canceled-bg); border-color: var(--st-canceled-bd); color: var(--st-canceled-tx); }

/* ─────────── Drawer (chi tiết / form) ─────────── */
.drawer-bg { position: fixed; inset: 0; z-index: 50; background: rgba(15, 25, 48, .38); display: flex; justify-content: flex-end; animation: fade .15s; }
.drawer { width: min(540px, 100vw); height: 100%; background: #fff; display: flex; flex-direction: column; box-shadow: var(--shadow-3); animation: slide .2s ease-out; }
.drawer--form { width: min(620px, 100vw); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: .6; } }
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 14px 22px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { margin: 2px 0 0; font-size: 19px; line-height: 1.3; color: var(--navy-900); }
.drawer__head small { color: var(--muted); font-weight: 500; }
.drawer__body { flex: 1; overflow-y: auto; padding: 16px 22px 28px; }
.drawer__foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); background: var(--gray-50); }

.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.expiry { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--gray-700); }
.expiry.warn { color: #B42318; font-weight: 600; }
.when { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; margin-bottom: 14px; background: var(--navy-50); }
.when__day { font-weight: 700; color: var(--navy-900); font-size: 15px; }
.when__day small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.when__time, .when__halls { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-weight: 600; color: var(--gray-700); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 12px; background: #fff; border: 1px solid var(--line-strong); font-size: 13px; color: var(--navy-900); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0 0 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.pre { white-space: pre-wrap; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.prompt { background: var(--gray-50); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 16px; }
.prompt__btns { display: flex; gap: 8px; margin-top: 8px; }
.log h3 { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 6px 0 10px; color: var(--navy-900); }
.log ol { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.log ol > li { position: relative; padding: 0 0 14px 12px; }
.log ol > li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--navy-700); }
.log__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.log__head small { color: var(--muted); width: 100%; }
.log__note { margin: 4px 0 0; font-size: 13px; color: var(--gray-700); }
.log__changes { margin: 4px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.log__changes span { color: var(--muted); }
.log__changes s { color: var(--gray-400); }

.alert { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; border: 1px solid; }
.alert ul { margin: 0; padding-left: 16px; }
.alert--err { background: #FEF0EE; border-color: #F4B4AA; color: #8A1C0F; }
.alert--warn { background: var(--st-unapproved-bg); border-color: #F3C88A; color: var(--st-unapproved-tx); }
.alert--info { background: #EEF4FC; border-color: #BFD3EE; color: #1B3F73; }
.alert--muted { background: var(--gray-100); border-color: var(--line-strong); color: var(--gray-700); }

/* form */
.fs { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.fs:disabled { opacity: .6; }
.fs legend { font-weight: 700; color: var(--navy-900); font-size: 14px; margin-bottom: 10px; padding: 0; display: flex; align-items: baseline; gap: 8px; width: 100%; }
.fs legend small { font-weight: 500; color: var(--muted); }
.fld { display: grid; gap: 5px; margin-bottom: 10px; min-width: 0; }
.fld > span { font-size: 12.5px; font-weight: 600; color: var(--gray-700); }
.fld > span em { font-style: normal; font-weight: 500; color: var(--muted); margin-left: 6px; }
.fld > span i { color: #C62828; font-style: normal; }
.fld--grow { flex: 1; }
.fld--sm { max-width: 110px; }
.fld--inline { display: flex; align-items: center; gap: 6px; margin: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .fld { flex: 1 1 140px; }
.row > .fld--sm { flex: 0 1 110px; }
.hint { margin: 2px 0 8px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.hint--warn { color: #B54708; font-weight: 600; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.presets--grid { display: grid; grid-template-columns: 1fr 1fr; }
.presets--grid .pill { height: auto; min-height: 44px; padding: 6px 12px; border-radius: 10px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; line-height: 1.25; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line-strong); background: #fff; font-weight: 600; font-size: 13px; }
.pill small { font-weight: 500; color: var(--muted); }
.pill.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.pill.on small { color: #C9D1E3; }
.inp-group { display: flex; align-items: center; gap: 4px; }
.inp-group .inp { flex: 1; }

.hall-floor { display: grid; grid-template-columns: 62px 1fr; gap: 8px; align-items: start; margin-bottom: 8px; }
.hall-floor__l { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-600); padding-top: 9px; }
.hall-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hchip { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 11px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: #fff; font-weight: 600; font-size: 13px; }
.hchip small { font-weight: 500; color: var(--muted); font-size: 11px; }
.hchip--free { border-color: #9BD3AE; background: #F3FBF5; }
.hchip--busy { border-color: #F0B3A6; background: #FDF1EE; color: #8A2A06; text-decoration: line-through; text-decoration-color: rgba(138,42,6,.5); }
.hchip--blocked { background: repeating-linear-gradient(135deg, #F2F3F6 0 5px, #E6E8ED 5px 10px); color: var(--muted); }
.hchip.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; text-decoration: none; }
.hchip.on small { color: #C9D1E3; }
.hchip--busy.on, .hchip--blocked.on { background: #B42318; border-color: #B42318; }

/* ─────────── Trang con ─────────── */
.page { flex: 1; overflow-y: auto; padding: 22px 26px 40px; }
.page__head h1 { margin: 0; font-size: 22px; color: var(--navy-900); }
.page__head p { margin: 4px 0 18px; color: var(--muted); }
.finder { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.finder__form { padding: 16px; position: sticky; top: 0; }
.finder__sum { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; font-size: 15px; }
.finder__sum strong { font-size: 28px; color: #1A7F3C; }
.finder__sum span { color: var(--muted); font-size: 13px; }
.finder__floor h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-600); margin: 14px 0 8px; }
.hall-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.hcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 6px; align-content: start; border-top: 4px solid; }
.hcard header { display: flex; justify-content: space-between; align-items: baseline; }
.hcard header b { font-size: 15px; color: var(--navy-900); }
.hcard header small { color: var(--muted); }
.hcard__st { margin: 0; font-weight: 600; font-size: 13px; }
.hcard--free { border-top-color: #1E9E4A; }
.hcard--free .hcard__st { color: #1A7F3C; }
.hcard--small { border-top-color: #E9A23B; }
.hcard--small .hcard__st { color: #B54708; }
.hcard--busy { border-top-color: #C9CED8; background: var(--gray-50); }
.hcard--busy .hcard__st { color: var(--muted); }
.hcard__bk { display: flex; align-items: center; gap: 6px; text-align: left; border: 0; background: transparent; padding: 2px 0; font-size: 12.5px; color: var(--gray-700); }
.hcard__bk:hover { color: var(--navy-800); text-decoration: underline; }
.hcard__blk { margin: 0; display: flex; gap: 4px; align-items: center; font-size: 12.5px; color: var(--gray-700); }
.hcard .btn { justify-self: start; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px; margin-bottom: 14px; }
.table-card { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line-strong); background: var(--gray-50); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--navy-50); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl small { color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; color: var(--muted); font-size: 13px; }

/* ─────────── Báo cáo lấp đầy ─────────── */
.rp-filters { align-items: center; }
.rp-export { margin-left: auto; }
.rp-centers { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; padding-top: 4px; border-top: 1px solid var(--gray-100); }
.rp-period { margin: 0 0 12px; font-size: 13px; color: var(--gray-700); }
.rp-tiles { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tile { padding: 16px 18px; display: grid; gap: 4px; align-content: start; }
.tile__label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--gray-700); font-weight: 500; }
.tile__value { font-size: 30px; font-weight: 600; color: var(--gray-900); line-height: 1.15; }
.tile--hero .tile__value { font-size: 48px; }
.tile__sub { font-size: 12.5px; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }
.rp-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 14px; }
.rp-card { padding: 14px 16px 10px; min-width: 0; }
.rp-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.rp-card__head h2 { margin: 0; font-size: 15px; color: var(--navy-900); }
.rp-table { padding: 14px 0 0; margin-bottom: 8px; }
.rp-table .rp-card__head { padding: 0 16px; }
.legend-inline { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--gray-700); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { width: 10px; height: 10px; border-radius: 2px; }
.viz { position: relative; width: 100%; }
.viz svg { display: block; overflow: visible; }
.viz__grid line { stroke: #e7e7e7; stroke-width: 1; }
.viz__grid line.base { stroke: #c2c2c2; }
.viz__tick { font-size: 11px; fill: #666; font-variant-numeric: tabular-nums; }
.viz__cat { font-size: 12.5px; fill: var(--gray-900); }
.viz__val { font-size: 11.5px; fill: var(--gray-700); font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.viz__cross { stroke: #c2c2c2; stroke-width: 1; }
.viz__tip { position: absolute; z-index: 5; pointer-events: none; background: #fff; border: 1px solid rgba(11,11,11,.1); border-radius: 8px; box-shadow: var(--shadow-3); padding: 8px 10px; display: grid; gap: 3px; font-size: 12.5px; min-width: 180px; }
.viz__tip span { display: flex; align-items: center; gap: 6px; }
.viz__tip i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.viz__tip small { color: var(--muted); }
.rp-crow { background: var(--gray-50); }
.rp-crow td { border-bottom-color: var(--line); }
.rp-caret { display: inline-block; vertical-align: -2px; color: var(--muted); }
.rp-caret.down { transform: rotate(-90deg); }
.rp-hrow td:first-child { padding-left: 34px; }
.rp-hrow { cursor: default !important; }
.tbl tfoot td { padding: 10px 12px; border-top: 1px solid var(--line-strong); background: var(--navy-50); }
.rp-note { margin-top: 10px; }
@media (max-width: 1100px) { .rp-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .rp-tiles { grid-template-columns: 1fr; } .tile--hero .tile__value { font-size: 40px; } }

/* ─────────── Quản trị tài khoản ─────────── */
.page__head--row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.role-list { display: grid; gap: 6px; margin-bottom: 12px; }
.role-opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; }
.role-opt input { margin-top: 3px; accent-color: var(--navy-800); }
.role-opt span { display: grid; gap: 1px; }
.role-opt small { color: var(--muted); }
.role-opt.on { border-color: var(--navy-700); background: var(--navy-50); box-shadow: inset 3px 0 0 var(--navy-700); }
.role-opt.dis { opacity: .45; cursor: not-allowed; }
.hall-chips .hchip small { margin-left: 2px; }
.role-tag { display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: 12px; font-weight: 600; background: var(--gray-100); color: var(--gray-700); white-space: nowrap; }
.role-tag--admin { background: var(--navy-800); color: #fff; }
.role-tag--executive { background: var(--navy-100); color: var(--navy-800); }
.role-tag--sales_director, .role-tag--sales_manager { background: var(--gold-100); color: #6B5228; }
.role-tag--manager { background: #E4EEFB; color: #1B3F73; }
.tbl tr.is-locked td { color: var(--muted); }
.adm-created { align-items: center; }
.adm-created > div { flex: 1; }
.adm-created code { font-size: 14px; font-weight: 700; padding: 2px 8px; background: #fff; border: 1px solid #BFD3EE; border-radius: 6px; margin-right: 8px; }

/* toast */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; padding: 11px 18px; border-radius: 10px; background: var(--navy-900); color: #fff; box-shadow: var(--shadow-3); font-weight: 500; max-width: min(560px, 92vw); animation: fade .2s; }
.toast--err { background: #8A1C0F; }

/* đăng nhập */
.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 80% -10%, #24365C 0, transparent 60%), var(--navy-950); }
.login { width: min(400px, 92vw); display: grid; gap: 22px; justify-items: center; }
.login__brand { display: grid; justify-items: center; }
.login__brand .brand-name { font-size: 38px; }
.login__brand .brand-the { font-size: 28px; }
.login__form { width: 100%; background: #fff; border-radius: 14px; padding: 26px 26px 22px; box-shadow: var(--shadow-3); display: grid; gap: 4px; }
.login__form h1 { margin: 0 0 12px; font-size: 20px; color: var(--navy-900); }
.login__form .btn { margin-top: 12px; height: 44px; }
.login__form .fld > label { font-size: 12.5px; font-weight: 600; color: var(--gray-700); }
.pw { position: relative; }
.pw .inp { width: 100%; padding-right: 46px; }
.pw__toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 40px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--gray-500); }
.pw__toggle:hover { color: var(--navy-800); background: var(--gray-100); }
.pw__eyeoff, .pw__toggle.on .pw__eye { display: none; }
.pw__toggle.on .pw__eyeoff { display: block; color: var(--navy-800); }
.pw .inp::-ms-reveal { display: none; }
.login__foot { color: #6F7C99; font-size: 12px; letter-spacing: .08em; }

/* ─────────── Responsive ─────────── */
@media (max-width: 1100px) {
  .tb__group--right { margin-left: 0; }
  .search input { width: 150px; }
  .legend__hint { display: none; }
  .finder { grid-template-columns: 1fr; }
  .finder__form { position: static; }
}
@media (max-width: 900px) {
  .shell, .shell.nav-min { grid-template-columns: 1fr; --nav-w: 260px; }
  .nav { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .2s; padding-top: env(safe-area-inset-top); }
  .nav-open .nav { transform: none; }
  .nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15,25,48,.4); }
  .nav__collapse { display: none; }
  .nav-min .brand-sub, .nav-min .nav__menu span, .nav-min .nav__soon, .nav-min .nav__who { display: revert; }
  .ibtn.mob-menu { display: inline-grid; position: absolute; left: 8px; top: 12px; z-index: 6; background: #fff; }
  .tb { padding-left: 56px; }
  .page { padding: 64px 14px 30px; }
  .side-list { position: absolute; inset: 0 0 0 auto; z-index: 10; width: min(360px, 100%); box-shadow: var(--shadow-3); }
  .tb__title { min-width: 0; }
  .search input { width: 120px; }
  .kv { grid-template-columns: 110px 1fr; }
}
/* Sổ tiệc trên điện thoại: thanh công cụ 2 hàng gọn, chú thích 1 hàng cuộn ngang, nút đặt sảnh nổi – nhường chỗ cho lịch */
.only-narrow, .ibtn.only-narrow-ib { display: none; }
@media (max-width: 640px) {
  .only-wide { display: none; }
  .only-narrow { display: inline; }
  .ibtn.only-narrow-ib { display: inline-grid; }
  .ibtn.mob-menu { top: 6px; left: 4px; }

  .tb { padding: 6px 8px 6px; gap: 4px 6px; }
  .tb__nav { order: 1; flex: 1 1 100%; margin-left: 40px; gap: 0; min-width: 0; }
  .tb__nav > .ibtn:not(.ibtn--date) { width: 30px; }
  .tb__title { flex: 1; min-width: 0; text-align: left; padding-left: 2px; }
  .tb__title strong { font-size: 15px; white-space: nowrap; }
  .tb__title small { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb__nav .btn--sm { height: 32px; padding: 0 10px; font-size: 13px; }
  .tb__nav .ibtn--date { width: 36px; height: 36px; }

  .tb__group--left { display: contents; }   /* ô trung tâm 1 hàng riêng, Ngày/Tuần/Tháng + nút ở hàng dưới */
  .tb__center { display: none; }
  .sel--center { order: 2; flex: 1 1 100%; min-width: 0; max-width: none; height: 34px; padding-left: 10px; font-size: 14px; font-weight: 600; text-overflow: ellipsis; }
  .tb .seg { order: 3; }
  .tb .seg { padding: 2px; }
  .tb .seg button { height: 30px; padding: 0 10px; font-size: 13px; }

  .tb__group--right { display: contents; }
  .tb__group--right > .ibtn { order: 3; width: 34px; height: 34px; }
  .tb__group--right > .only-narrow-ib { margin-left: auto; }
  .tb__search { display: none; order: 4; flex: 1 1 100%; height: 36px; }
  .tb--search .tb__search { display: flex; }
  .tb__search input { width: 100%; min-width: 0; }

  /* Đặt sảnh: nút tròn nổi góc dưới phải */
  .tb__add { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30;
    width: 56px; height: 56px; padding: 0; border-radius: 50%; justify-content: center; box-shadow: 0 6px 18px rgba(15,25,48,.35); }
  .tb__add svg { width: 24px; height: 24px; }
  .tb__add span { display: none; }

  .legend { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 6px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .legend::-webkit-scrollbar { display: none; }
  .legend .chip { flex: none; height: 26px; padding: 0 8px; font-size: 12px; gap: 5px; }
  .legend .tgl { flex: none; margin-left: 2px; font-size: 12px; white-space: nowrap; padding-right: 8px; }
  /* tự làm mới mỗi phút – bỏ nút tải lại cho đủ chỗ */
  .tb__group--right > .ibtn[title="Tải lại"] { display: none; }

  /* Bảng sổ: cột ngày hẹp, cột sảnh 112px → thấy nhiều sảnh hơn */
  .sb { width: calc(68px + var(--cols) * 112px); }
  .sb thead th.sb-corner, .sb-date { width: 68px; }
  .sb-corner small { display: none; }
  .sb-date { padding: 5px 4px 5px 7px; white-space: nowrap; }
  .tb .seg button { padding: 0 8px; }
  .sb-date__d { font-size: 13.5px; }
  .sb-date__w { margin-left: 2px; font-size: 11px; }
  .sb-date__l { font-size: 11px; }
  .sb-date__l::before { content: ''; }
  .sb-date__n { font-size: 11px; }
  .sb-hall span { font-size: 12.5px; }
  .sb-cell { height: 42px; padding: 3px 3px 8px; }
}
@media (max-width: 380px) {
  /* màn rất hẹp: nút ẩn sảnh trống nhường chỗ để công cụ nằm gọn 2 hàng */
  .tb__group--right > .tb__eye { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
