/* =====================================================================================================
   Hotel Management System - design system (built on Bootstrap 5.3 colour modes)
   Navy / teal / gold, rounded cards, soft shadows, touch-first sizing (inputs 52px, buttons 48px, icon buttons 44px)
   ===================================================================================================== */
@font-face { font-family: "Inter"; src: url("../lib/inter/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --hm-navy: #0B2545; --hm-navy-2: #13315C; --hm-teal: #13A89E; --hm-teal-soft: #E3F6F4; --hm-gold: #C9A227; --hm-gold-soft: #FBF3D9;
  --hm-bg: #F5F7FA; --hm-card: #FFFFFF; --hm-text: #1B2635; --hm-muted: #6B7A90; --hm-border: #E3E8EF; --hm-hover: #EEF2F7;
  --hm-danger: #D64545; --hm-success: #22A66B; --hm-warning: #E08A1E; --hm-info: #3B82F6;
  --hm-primary: var(--hm-navy); --hm-primary-hover: var(--hm-navy-2); --hm-on-primary: #FFFFFF;
  --hm-radius: 16px; --hm-radius-sm: 12px; --hm-shadow: 0 6px 24px rgba(11, 37, 69, .08); --hm-shadow-lg: 0 16px 48px rgba(11, 37, 69, .18);
  --hm-sidebar-w: 272px; --hm-rail-w: 84px; --hm-topbar-h: 64px; --hm-bottomnav-h: 68px;
  --hm-ease: 200ms cubic-bezier(.2, .8, .2, 1);
  /* room status colours (used from Phase 5) */
  --st-vacant-clean: #22A66B; --st-vacant-dirty: #E08A1E; --st-occupied: #D64545; --st-reserved: #3B82F6; --st-ooo: #6B7280; --st-inspected: #13A89E;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-size: 1rem; --bs-body-bg: var(--hm-bg); --bs-body-color: var(--hm-text); --bs-border-color: var(--hm-border);
  --bs-border-radius: var(--hm-radius-sm); --bs-link-color: var(--hm-teal); --bs-link-hover-color: var(--hm-navy-2);
  --bs-primary: var(--hm-primary); --bs-primary-rgb: 11, 37, 69; --bs-secondary-color: var(--hm-muted); --bs-emphasis-color: var(--hm-text);
}
[data-bs-theme="dark"] {
  --hm-navy: #0E1B2E; --hm-navy-2: #16294A; --hm-teal: #2CC6BB; --hm-teal-soft: #12332F; --hm-gold: #E0B94A; --hm-gold-soft: #3A3115;
  --hm-bg: #0A1220; --hm-card: #131F33; --hm-text: #E8EEF7; --hm-muted: #93A3BA; --hm-border: #22324A; --hm-hover: #1A2A44;
  --hm-primary: #2CC6BB; --hm-primary-hover: #52D8CE; --hm-on-primary: #06241F;
  --hm-shadow: 0 6px 24px rgba(0, 0, 0, .35); --hm-shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
  --bs-primary-rgb: 44, 198, 187; --bs-link-hover-color: #52D8CE;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: var(--hm-bg); color: var(--hm-text); -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.01em; }
.font-display { font-family: "Playfair Display", Georgia, "Times New Roman", serif; letter-spacing: 0; }
a { text-decoration: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--hm-teal) 60%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ---------- controls: big and touch friendly ---------- */
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.form-control, .form-select { min-height: 52px; font-size: 1rem; padding: .75rem 1rem; border-radius: var(--hm-radius-sm); background-color: var(--hm-card); color: var(--hm-text); border-color: var(--hm-border); transition: border-color var(--hm-ease), box-shadow var(--hm-ease); }
textarea.form-control { min-height: 104px; }
.form-control:focus, .form-select:focus { border-color: var(--hm-teal); box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--hm-teal) 22%, transparent); background-color: var(--hm-card); color: var(--hm-text); }
.form-control::placeholder { color: var(--hm-muted); opacity: .8; }
.form-check-input { width: 1.6rem; height: 1.6rem; margin-top: 0; cursor: pointer; border-color: var(--hm-muted); }
.form-check-input:checked { background-color: var(--hm-teal); border-color: var(--hm-teal); }
.form-switch .form-check-input { width: 3rem; height: 1.7rem; }
.form-check-label { padding-left: .35rem; line-height: 1.7rem; cursor: pointer; }
.form-text, .field-validation-error, .invalid-feedback { font-size: .85rem; }
.text-danger { color: var(--hm-danger) !important; }
.input-group > .btn { min-width: 52px; }
.btn { min-height: 48px; padding: .6rem 1.25rem; font-weight: 600; border-radius: var(--hm-radius-sm); display: inline-flex; align-items: center; justify-content: center; gap: .5rem; transition: transform var(--hm-ease), box-shadow var(--hm-ease), background-color var(--hm-ease); }
.btn:active { transform: scale(.98); }
.btn-lg { min-height: 56px; font-size: 1.05rem; }
.btn-sm { min-height: 44px; padding: .45rem 1rem; font-size: .95rem; }
.btn-primary { --bs-btn-bg: var(--hm-primary); --bs-btn-border-color: var(--hm-primary); --bs-btn-color: var(--hm-on-primary); --bs-btn-hover-bg: var(--hm-primary-hover); --bs-btn-hover-border-color: var(--hm-primary-hover); --bs-btn-hover-color: var(--hm-on-primary); --bs-btn-active-bg: var(--hm-primary-hover); --bs-btn-active-border-color: var(--hm-primary-hover); --bs-btn-active-color: var(--hm-on-primary); --bs-btn-disabled-bg: var(--hm-primary); --bs-btn-disabled-border-color: var(--hm-primary); box-shadow: 0 4px 14px color-mix(in srgb, var(--hm-primary) 30%, transparent); }
.btn-gold { --bs-btn-bg: var(--hm-gold); --bs-btn-border-color: var(--hm-gold); --bs-btn-color: #241C00; --bs-btn-hover-bg: color-mix(in srgb, var(--hm-gold) 88%, #fff); --bs-btn-hover-border-color: var(--hm-gold); --bs-btn-hover-color: #241C00; }
.btn-outline-primary { --bs-btn-color: var(--hm-primary); --bs-btn-border-color: var(--hm-primary); --bs-btn-hover-bg: var(--hm-primary); --bs-btn-hover-color: var(--hm-on-primary); --bs-btn-hover-border-color: var(--hm-primary); --bs-btn-active-bg: var(--hm-primary); --bs-btn-active-color: var(--hm-on-primary); }
.btn-outline-secondary { --bs-btn-color: var(--hm-muted); --bs-btn-border-color: var(--hm-border); --bs-btn-hover-bg: var(--hm-hover); --bs-btn-hover-color: var(--hm-text); --bs-btn-hover-border-color: var(--hm-border); }
.btn-icon { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 12px; font-size: 1.15rem; }
.btn.loading { pointer-events: none; opacity: .85; }
.btn.loading::after { content: ""; width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- cards ---------- */
.card { background: var(--hm-card); border: 1px solid var(--hm-border); border-radius: var(--hm-radius); box-shadow: var(--hm-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--hm-border); padding: 1rem 1.25rem; font-weight: 700; border-radius: var(--hm-radius) var(--hm-radius) 0 0 !important; }
.card-body { padding: 1.25rem; }
.card-hover { transition: transform var(--hm-ease), box-shadow var(--hm-ease); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--hm-shadow-lg); }

/* ---------- app shell ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--hm-sidebar-w); background: linear-gradient(180deg, #0B2545 0%, #0E2F57 100%); color: #D6E0EE; z-index: 1040; display: flex; flex-direction: column; transition: transform var(--hm-ease), width var(--hm-ease); overflow-y: auto; overscroll-behavior: contain; }
[data-bs-theme="dark"] .sidebar { background: linear-gradient(180deg, #0B1626 0%, #0E1B2E 100%); border-right: 1px solid var(--hm-border); }
.sidebar-brand { display: flex; align-items: center; gap: .85rem; padding: 1.15rem 1.25rem; min-height: var(--hm-topbar-h); color: #fff; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, var(--hm-gold), #E8CC6A); color: #241C00; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; font-family: "Playfair Display", Georgia, serif; flex: none; box-shadow: 0 4px 14px rgba(201, 162, 39, .45); }
.brand-name { font-family: "Playfair Display", Georgia, serif; font-size: 1.15rem; font-weight: 700; line-height: 1.15; }
.brand-sub { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #9FB3CF; }
.nav-group { padding: 1rem 1.25rem .35rem; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #7F96B6; font-weight: 700; }
.side-link { display: flex; align-items: center; gap: .9rem; margin: .15rem .75rem; padding: .8rem 1rem; min-height: 48px; border-radius: 12px; color: #C9D6E8; font-weight: 500; transition: background var(--hm-ease), color var(--hm-ease); }
.side-link i { font-size: 1.25rem; width: 1.5rem; text-align: center; flex: none; }
.side-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-link.active { background: rgba(201, 162, 39, .18); color: #F4DE93; box-shadow: inset 3px 0 0 var(--hm-gold); }
.sidebar-foot { margin-top: auto; padding: 1rem 1.25rem; font-size: .75rem; color: #7F96B6; }

.topbar { position: sticky; top: 0; z-index: 1030; height: var(--hm-topbar-h); display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem; background: color-mix(in srgb, var(--hm-card) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--hm-border); }
.topbar-title { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz-date { display: none; align-items: center; gap: .5rem; padding: .4rem .85rem; border-radius: 999px; background: var(--hm-gold-soft); color: #7A6210; font-weight: 600; font-size: .85rem; white-space: nowrap; }
[data-bs-theme="dark"] .biz-date { color: var(--hm-gold); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--hm-teal), var(--hm-navy-2)); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; border: 0; }
.user-menu .dropdown-menu { min-width: 260px; border-radius: var(--hm-radius); border: 1px solid var(--hm-border); box-shadow: var(--hm-shadow-lg); padding: .5rem; background: var(--hm-card); }
.user-menu .dropdown-item { min-height: 48px; display: flex; align-items: center; gap: .75rem; border-radius: 10px; color: var(--hm-text); }
.user-menu .dropdown-item:hover { background: var(--hm-hover); }

.main { margin-left: var(--hm-sidebar-w); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; transition: margin var(--hm-ease); }
.content { flex: 1; padding: 1.5rem; max-width: 1500px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.6rem; margin: 0; }
.page-head .sub { color: var(--hm-muted); margin: .15rem 0 0; }
.app-foot { padding: 1rem 1.5rem; color: var(--hm-muted); font-size: .8rem; }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(6, 15, 28, .55); z-index: 1035; opacity: 0; pointer-events: none; transition: opacity var(--hm-ease); }

.bottom-nav { display: none; position: fixed; inset: auto 0 0 0; height: calc(var(--hm-bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--hm-card); border-top: 1px solid var(--hm-border); box-shadow: 0 -8px 24px rgba(11, 37, 69, .08); z-index: 1030; }
.bottom-nav a, .bottom-nav button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; color: var(--hm-muted); font-size: .7rem; font-weight: 600; background: none; border: 0; padding: .4rem 0; min-height: 56px; }
.bottom-nav i { font-size: 1.4rem; line-height: 1; }
.bottom-nav .active { color: var(--hm-teal); }
.bottom-nav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tablet: icon rail */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .sidebar { width: var(--hm-rail-w); }
  .main { margin-left: var(--hm-rail-w); }
  .sidebar .brand-text, .sidebar .side-link span, .sidebar .nav-group, .sidebar-foot { display: none; }
  .sidebar .side-link { justify-content: center; padding: .8rem; margin: .15rem .6rem; }
  .sidebar-brand { justify-content: center; padding: 1.15rem .5rem; }
  body.sidebar-open .sidebar { width: var(--hm-sidebar-w); box-shadow: var(--hm-shadow-lg); }
  body.sidebar-open .sidebar .brand-text, body.sidebar-open .sidebar .side-link span, body.sidebar-open .sidebar .nav-group, body.sidebar-open .sidebar-foot { display: revert; }
  body.sidebar-open .sidebar .side-link { justify-content: flex-start; padding: .8rem 1rem; margin: .15rem .75rem; }
  body.sidebar-open .sidebar-brand { justify-content: flex-start; padding: 1.15rem 1.25rem; }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
}
@media (min-width: 768px) { .biz-date { display: inline-flex; } }
/* phone: drawer + bottom navigation */
@media (max-width: 767.98px) {
  .sidebar { transform: translateX(-100%); width: min(86vw, 320px); }
  body.sidebar-open .sidebar { transform: none; box-shadow: var(--hm-shadow-lg); }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .bottom-nav { display: flex; }
  .content { padding: 1rem 1rem calc(var(--hm-bottomnav-h) + 5.5rem + env(safe-area-inset-bottom)); }
  .app-foot { display: none; }
  .topbar { padding: 0 .75rem; padding-top: env(safe-area-inset-top); height: calc(var(--hm-topbar-h) + env(safe-area-inset-top)); }
  .page-head h1 { font-size: 1.35rem; }
  .page-head .btn { flex: 1 1 auto; }
}

/* sticky action bar (Save / Cancel) - pinned above the bottom nav on phones */
.action-bar { display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.5rem; }
@media (max-width: 767.98px) {
  .action-bar { position: fixed; inset: auto 0 calc(var(--hm-bottomnav-h) + env(safe-area-inset-bottom)) 0; z-index: 1029; margin: 0; padding: .75rem 1rem; background: var(--hm-card); border-top: 1px solid var(--hm-border); box-shadow: 0 -8px 24px rgba(11, 37, 69, .08); flex-wrap: nowrap; }
  .action-bar .btn { flex: 1; }
}

/* ---------- dashboard ---------- */
.kpi-card { position: relative; padding: 1.25rem; overflow: hidden; }
.kpi-card .kpi-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; background: var(--hm-teal-soft); color: var(--hm-teal); }
.kpi-card.gold .kpi-icon { background: var(--hm-gold-soft); color: var(--hm-gold); }
.kpi-card.danger .kpi-icon { background: color-mix(in srgb, var(--hm-danger) 14%, transparent); color: var(--hm-danger); }
.kpi-card.navy .kpi-icon { background: color-mix(in srgb, var(--hm-navy-2) 14%, transparent); color: var(--hm-navy-2); }
[data-bs-theme="dark"] .kpi-card.navy .kpi-icon { color: #8FB2E8; }
.kpi-value { font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.kpi-label { color: var(--hm-muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.quick-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; min-height: 104px; padding: 1rem; border-radius: var(--hm-radius); border: 1px dashed var(--hm-border); background: var(--hm-card); color: var(--hm-muted); font-weight: 600; text-align: center; }
.quick-action i { font-size: 1.8rem; color: var(--hm-teal); }
.quick-action small { font-weight: 500; font-size: .75rem; }
.hero { background: linear-gradient(120deg, var(--hm-navy) 0%, var(--hm-navy-2) 60%, #1C4A7C 100%); color: #fff; border-radius: var(--hm-radius); padding: 1.75rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(201, 162, 39, .35), transparent 70%); }
.hero h2 { font-family: "Playfair Display", Georgia, serif; margin: 0 0 .25rem; }
[data-bs-theme="dark"] .hero { background: linear-gradient(120deg, #0E1B2E 0%, #16294A 60%, #1B3B66 100%); border: 1px solid var(--hm-border); }

/* ---------- tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--hm-text); --bs-table-border-color: var(--hm-border); --bs-table-hover-bg: var(--hm-hover); margin: 0; }
.table > :not(caption) > * > * { padding: .9rem 1rem; vertical-align: middle; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--hm-muted); font-weight: 700; border-bottom: 1px solid var(--hm-border); white-space: nowrap; }
.table-wrap { overflow-x: auto; border-radius: var(--hm-radius); }
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack tr { display: block; padding: .75rem 0; border-bottom: 1px solid var(--hm-border); }
  .table-stack td { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 1rem !important; border: 0; text-align: right; }
  .table-stack td::before { content: attr(data-label); font-weight: 600; color: var(--hm-muted); text-align: left; flex: none; }
  .table-stack td.cell-actions { justify-content: flex-end; }
  .table-stack td.cell-actions::before, .table-stack td:empty { display: none; }
}

/* ---------- badges / status ---------- */
.badge { font-weight: 600; padding: .45em .8em; border-radius: 999px; }
.badge-soft-success { background: color-mix(in srgb, var(--hm-success) 15%, transparent); color: var(--hm-success); }
.badge-soft-danger { background: color-mix(in srgb, var(--hm-danger) 15%, transparent); color: var(--hm-danger); }
.badge-soft-warning { background: color-mix(in srgb, var(--hm-warning) 18%, transparent); color: var(--hm-warning); }
.badge-soft-info { background: color-mix(in srgb, var(--hm-info) 15%, transparent); color: var(--hm-info); }
.badge-soft-muted { background: var(--hm-hover); color: var(--hm-muted); }
.status-dot { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; }
.room-tile { border-radius: var(--hm-radius); padding: 1rem; color: #fff; min-height: 96px; box-shadow: var(--hm-shadow); }
.room-tile.vacant-clean { background: var(--st-vacant-clean); } .room-tile.vacant-dirty { background: var(--st-vacant-dirty); }
.room-tile.occupied { background: var(--st-occupied); } .room-tile.reserved { background: var(--st-reserved); }
.room-tile.out-of-order { background: var(--st-ooo); } .room-tile.inspected { background: var(--st-inspected); }

/* ---------- feedback: toasts, skeletons, empty states, modals ---------- */
.toast-stack { position: fixed; top: calc(var(--hm-topbar-h) + .75rem); right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .6rem; width: min(420px, calc(100vw - 2rem)); }
.hm-toast { display: flex; align-items: flex-start; gap: .8rem; padding: .95rem 1rem; border-radius: var(--hm-radius-sm); background: var(--hm-card); border: 1px solid var(--hm-border); border-left: 5px solid var(--hm-teal); box-shadow: var(--hm-shadow-lg); animation: toast-in .3s cubic-bezier(.2, .8, .2, 1); }
.hm-toast.success { border-left-color: var(--hm-success); } .hm-toast.danger { border-left-color: var(--hm-danger); }
.hm-toast.warning { border-left-color: var(--hm-warning); } .hm-toast.info { border-left-color: var(--hm-info); }
.hm-toast i { font-size: 1.3rem; margin-top: .05rem; } .hm-toast.success i { color: var(--hm-success); } .hm-toast.danger i { color: var(--hm-danger); } .hm-toast.warning i { color: var(--hm-warning); } .hm-toast.info i { color: var(--hm-info); }
.hm-toast .msg { flex: 1; font-weight: 500; } .hm-toast.leaving { animation: toast-out .25s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
@media (max-width: 767.98px) { .toast-stack { right: .75rem; left: .75rem; width: auto; } }
.skeleton { position: relative; overflow: hidden; background: var(--hm-hover); border-radius: 10px; min-height: 1rem; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--hm-card) 70%, transparent), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--hm-muted); }
.empty-state svg { width: 140px; height: auto; margin-bottom: 1rem; opacity: .95; }
.empty-state h3 { font-size: 1.15rem; color: var(--hm-text); }
.modal-content { border-radius: var(--hm-radius); border: 1px solid var(--hm-border); background: var(--hm-card); box-shadow: var(--hm-shadow-lg); }
.modal-header, .modal-footer { border-color: var(--hm-border); }
.modal-footer .btn { min-width: 110px; }
.modal-icon { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; margin: 0 auto 1rem; background: color-mix(in srgb, var(--hm-danger) 14%, transparent); color: var(--hm-danger); }
.modal-icon.warn { background: var(--hm-gold-soft); color: var(--hm-gold); }
.page-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--hm-teal), var(--hm-gold)); z-index: 3000; transition: width .4s ease, opacity .3s; }

/* ---------- permission matrix ---------- */
.perm-table th, .perm-table td { text-align: center; } .perm-table th:first-child, .perm-table td:first-child { text-align: left; }
.perm-cell { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; }
.perm-cell .form-check-input { margin: 0; }
.effect-select { min-height: 44px; padding: .4rem 2rem .4rem .75rem; min-width: 120px; }
.effect-select.allow { border-color: var(--hm-success); } .effect-select.deny { border-color: var(--hm-danger); }
@media (max-width: 767.98px) {
  .perm-table thead { display: none; } .perm-table tr { display: block; padding: .75rem; border-bottom: 1px solid var(--hm-border); }
  .perm-table td { display: inline-flex; padding: .25rem !important; text-align: left !important; border: 0; } .perm-table td:first-child { display: block; font-weight: 700; padding-bottom: .5rem !important; }
  .perm-cell .perm-name { display: inline !important; }
}
.perm-cell .perm-name { display: none; margin-left: .35rem; font-size: .85rem; }
pre.code { background: var(--hm-hover); color: var(--hm-text); border-radius: var(--hm-radius-sm); padding: 1rem; font-size: .8rem; white-space: pre-wrap; word-break: break-word; margin: 0; max-height: 420px; overflow: auto; }

/* ---------- auth pages ---------- */
.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; background: radial-gradient(1200px 600px at 10% 0%, #1C4A7C 0%, transparent 60%), linear-gradient(160deg, #0B2545 0%, #0E2F57 55%, #13315C 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-art::before, .auth-art::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(201, 162, 39, .28); }
.auth-art::before { width: 520px; height: 520px; right: -180px; bottom: -160px; } .auth-art::after { width: 320px; height: 320px; right: -60px; bottom: -40px; background: radial-gradient(circle, rgba(201, 162, 39, .18), transparent 70%); }
.auth-art h1 { font-family: "Playfair Display", Georgia, serif; font-size: 2.6rem; line-height: 1.15; max-width: 14ch; }
.auth-art .lead { color: #B9CAE3; max-width: 34ch; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: var(--hm-bg); position: relative; }
.auth-card { width: 100%; max-width: 440px; }
.auth-theme { position: absolute; top: 1rem; right: 1rem; }
@media (max-width: 991.98px) {
  .auth-shell { grid-template-columns: 1fr; } .auth-art { display: none; }
  .auth-panel { align-items: flex-start; padding-top: max(3rem, env(safe-area-inset-top)); background: linear-gradient(180deg, var(--hm-navy) 0, var(--hm-navy) 190px, var(--hm-bg) 190px); }
  .auth-card { margin-top: 0; } .auth-mobile-brand { display: flex !important; }
}
.auth-mobile-brand { display: none; align-items: center; gap: .85rem; color: #fff; margin-bottom: 1.25rem; }
.auth-card .card { box-shadow: var(--hm-shadow-lg); }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; color: var(--hm-muted); border-radius: 10px; }
.pw-wrap { position: relative; } .pw-wrap .form-control { padding-right: 3.25rem; }
.strength { height: 6px; border-radius: 4px; background: var(--hm-hover); overflow: hidden; margin-top: .5rem; } .strength > i { display: block; height: 100%; width: 0; transition: width var(--hm-ease), background var(--hm-ease); }

/* ---------- misc ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; border-top: 1px solid var(--hm-border); color: var(--hm-muted); }
.pager .btn { min-height: 44px; min-width: 44px; }
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; align-items: end; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: .6rem 1rem; } .kv dt { color: var(--hm-muted); font-weight: 600; } .kv dd { margin: 0; word-break: break-word; }
@media (max-width: 575.98px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: .75rem; } }
.json-diff { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; } @media (max-width: 767.98px) { .json-diff { grid-template-columns: 1fr; } }
[hidden] { display: none !important; }
.offline-banner { position: fixed; left: 0; right: 0; top: 0; z-index: 3100; background: var(--hm-warning); color: #1c1200; text-align: center; padding: .4rem; font-weight: 600; font-size: .85rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ---------- print (A4 + 80mm thermal helpers used by later phases) ---------- */
@media print {
  .sidebar, .topbar, .bottom-nav, .action-bar, .toast-stack, .no-print, .app-foot, .sidebar-backdrop { display: none !important; }
  .main { margin: 0 !important; } .content { padding: 0 !important; max-width: none; } body { background: #fff !important; color: #000 !important; }
  .card { box-shadow: none !important; border: 0 !important; }
}
.print-thermal { width: 302px; font-family: "Courier New", monospace; font-size: 12px; }
@page { margin: 12mm; }

/* ---------- Phase 2: master forms, guest profile, documents ---------- */
.multi-check { padding: .25rem 0; }
.multi-check.is-invalid { outline: 2px solid var(--hm-danger); border-radius: var(--hm-radius-sm); }
.check-tile { display: flex; align-items: center; gap: .6rem; min-height: 52px; padding: .5rem .85rem; border: 1px solid var(--hm-border); border-radius: var(--hm-radius-sm); background: var(--hm-card); cursor: pointer; transition: border-color var(--hm-ease), background var(--hm-ease); height: 100%; }
.check-tile:hover { border-color: var(--hm-teal); }
.check-tile:has(input:checked) { border-color: var(--hm-teal); background: var(--hm-teal-soft); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--hm-danger); background-image: none; }
.invalid-feedback { color: var(--hm-danger); }
.guest-photo { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; border: 4px solid var(--hm-card); box-shadow: var(--hm-shadow); }
.guest-photo-empty { display: inline-grid; place-items: center; font-size: 2.6rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--hm-teal), var(--hm-navy-2)); }
.doc-thumb { display: grid; place-items: center; height: 150px; overflow: hidden; background: var(--hm-hover); border-radius: var(--hm-radius) var(--hm-radius) 0 0; color: var(--hm-danger); font-size: 3.2rem; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nav-pills .btn { min-height: 44px; }
.nav-pills .btn.active { background: var(--hm-primary); color: var(--hm-on-primary); border-color: var(--hm-primary); }

/* ---------- Phase 3: tape chart, availability calendar, room board ---------- */
.tape-scroll { overflow-x: auto; }
#tapeChart { min-width: calc(170px + var(--days) * 58px); }
.tape-head, .tape-row { display: grid; grid-template-columns: 170px repeat(var(--days), minmax(56px, 1fr)); position: relative; }
.tape-head { position: sticky; top: 0; z-index: 4; background: var(--hm-card); border-bottom: 1px solid var(--hm-border); }
.tape-label { grid-column: 1; grid-row: 1; position: sticky; left: 0; z-index: 3; display: flex; align-items: center; gap: .4rem; padding: .35rem .75rem; min-height: 46px; background: var(--hm-card); border-right: 1px solid var(--hm-border); font-size: .9rem; }
.tape-day { grid-row: 1; text-align: center; padding: .3rem 0; line-height: 1.15; border-left: 1px solid var(--hm-border); }
.tape-day.today, .tape-cell.today { background: color-mix(in srgb, var(--hm-teal) 14%, transparent); }
.tape-day.weekend, .tape-cell.weekend { background: color-mix(in srgb, var(--hm-gold) 9%, transparent); }
.tape-row { border-bottom: 1px solid var(--hm-border); }
.tape-row.unassigned .tape-label { background: color-mix(in srgb, var(--hm-hover) 60%, var(--hm-card)); }
.tape-row.drop { outline: 2px dashed var(--hm-teal); outline-offset: -2px; }
.tape-cell { grid-row: 1; min-height: 46px; border-left: 1px solid var(--hm-border); }
.tape-bar { grid-row: 1; z-index: 2; margin: 5px 2px; padding: 2px 8px; border-radius: 8px; color: #fff; display: flex; flex-direction: column; justify-content: center; min-width: 0; font-size: .8rem; line-height: 1.15; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.tape-bar small { opacity: .85; font-size: .68rem; }
.tape-bar[draggable=true] { cursor: grab; } .tape-bar.dragging { opacity: .4; }
.tape-bar.clip-l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; } .tape-bar.clip-r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tape-booked { background: var(--st-reserved); } .tape-inhouse { background: var(--st-occupied); } .tape-out { background: var(--st-ooo); }
.tape-tentative { background: repeating-linear-gradient(135deg, var(--st-vacant-dirty), var(--st-vacant-dirty) 8px, color-mix(in srgb, var(--st-vacant-dirty) 80%, #000) 8px, color-mix(in srgb, var(--st-vacant-dirty) 80%, #000) 16px); }
.tape-key { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: .3rem; }
.cal-table th, .cal-table td { min-width: 52px; vertical-align: middle; } .cal-table th.today { background: color-mix(in srgb, var(--hm-teal) 14%, transparent); } .cal-table th.weekend { background: color-mix(in srgb, var(--hm-gold) 9%, transparent); }
.cal-sticky { position: sticky; left: 0; z-index: 2; background: var(--hm-card); min-width: 190px !important; border-right: 1px solid var(--hm-border); }
.cal-cell { display: grid; place-items: center; min-height: 44px; border-radius: 10px; font-weight: 700; color: #fff; }
.cal-ok { background: var(--st-vacant-clean); } .cal-low { background: var(--st-vacant-dirty); } .cal-full { background: var(--st-occupied); }
.chip.active { background: var(--hm-hover); border-color: var(--hm-teal); color: var(--hm-text); }
.board-room .room-tile { min-height: 116px; transition: transform var(--hm-ease); } .board-room .room-tile:hover { transform: translateY(-2px); }
.guest-picker .gp-avatar { width: 44px; height: 44px; }
.min-w-0 { min-width: 0; }

/* ---------- Phase 4: folio ---------- */
.folio-table .tx-sub td { font-size: .85rem; color: var(--hm-muted, #6b7a90); padding-top: .15rem; padding-bottom: .15rem; }
.folio-table .tx-void td { opacity: .6; }
.folio-table td.text-end { font-variant-numeric: tabular-nums; }

/* ---------- Phase 5: housekeeping + POS ---------- */
.hk-room { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: .02em; }
.hk-card { border-left: 5px solid var(--hm-border); }
.hk-card.hk-high { border-left-color: var(--hm-warning); } .hk-card.hk-urgent { border-left-color: var(--hm-danger); }
.hk-btn { min-height: 56px; font-weight: 600; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.pos-table { display: flex; flex-direction: column; justify-content: space-between; gap: .15rem; min-height: 120px; padding: .85rem; border-radius: var(--hm-radius); border: 2px solid var(--hm-border); background: var(--hm-card); color: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: transform var(--hm-ease), box-shadow var(--hm-ease); }
.pos-table:hover { transform: translateY(-2px); box-shadow: var(--hm-shadow); color: inherit; }
.pos-table .pt-no { font-size: 1.5rem; font-weight: 800; } .pos-table .pt-meta { font-size: .85rem; color: var(--hm-muted, #6b7a90); }
.pos-table .pt-state { font-weight: 600; color: var(--hm-success, #1e8e5a); } .pos-table .pt-amount { font-size: 1.15rem; font-weight: 700; }
.pos-table.free { border-color: var(--hm-success, #1e8e5a); } .pos-table.busy { border-color: var(--hm-warning); background: var(--hm-gold-soft, rgba(212,160,23,.1)); }
.pos-table.ready { border-color: var(--hm-success, #1e8e5a); animation: posPulse 1.6s ease-in-out infinite; }
.pos-table .pt-flag { font-size: .8rem; font-weight: 600; } .pos-table .pt-flag.ready { color: var(--hm-success, #1e8e5a); }
@keyframes posPulse { 50% { box-shadow: 0 0 0 6px rgba(30,142,90,.18); } }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.menu-tile { display: flex; flex-direction: column; justify-content: space-between; min-height: 92px; padding: .7rem; border-radius: var(--hm-radius-sm); border: 1px solid var(--hm-border); background: var(--hm-card); color: inherit; text-align: left; }
.menu-tile:hover:not(:disabled) { border-color: var(--hm-teal); background: var(--hm-teal-soft); }
.menu-tile .mt-name { font-weight: 600; line-height: 1.2; } .menu-tile .mt-price { font-weight: 700; color: var(--hm-teal); } .menu-tile.off { opacity: .45; } .menu-tile .mt-off { font-size: .75rem; color: var(--hm-danger); }
.pos-panel { position: sticky; top: 1rem; }
.qty-step { display: inline-flex; align-items: center; gap: .35rem; margin-top: .25rem; } .qty-step .qty { min-width: 1.6rem; text-align: center; font-weight: 700; }
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.kds-ticket { padding: 1rem; border-radius: var(--hm-radius); border: 2px solid var(--hm-border); background: var(--hm-card); }
.kds-ticket.new { border-color: var(--hm-warning); } .kds-ticket.preparing { border-color: var(--hm-teal); } .kds-ticket.ready { border-color: var(--hm-success, #1e8e5a); } .kds-ticket.late { border-color: var(--hm-danger); }
.kds-head { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; } .kds-where { font-size: 1.3rem; font-weight: 800; }
.kds-lines { list-style: none; padding: 0; margin: 0 0 .75rem; font-size: 1.1rem; } .kds-lines li { padding: .2rem 0; border-bottom: 1px dashed var(--hm-border); } .kds-lines li.void { text-decoration: line-through; opacity: .6; }
.kds-qty { display: inline-block; min-width: 1.8rem; font-weight: 800; } .kds-note { display: block; font-size: .85rem; color: var(--hm-danger); font-weight: 600; }

/* ---------- notification bell ---------- */
.notif-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--hm-danger); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.notif-panel { width: min(360px, 92vw); max-height: 70vh; overflow-y: auto; padding: 0; }
.notif-item { white-space: normal; padding: .75rem 1rem; min-height: 44px; border-bottom: 1px solid var(--hm-border); }
.notif-item.unread { background: color-mix(in srgb, var(--hm-teal) 8%, transparent); }

/* ---------- dashboard charts (pure CSS, no chart library) ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 18px; }
.bar-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar-col .bar { width: 100%; max-width: 34px; border-radius: 6px 6px 0 0; background: var(--hm-navy-2); min-height: 0; transition: height var(--hm-ease); }
.bar-col .bar.gold { background: var(--hm-gold); } .bar-col .bar.teal { background: var(--hm-teal); }
[data-bs-theme="dark"] .bar-col .bar:not(.gold):not(.teal) { background: #5B8BD6; }
.bar-col .bar-val { font-size: .75rem; color: var(--hm-muted); margin-bottom: 2px; }
.bar-col .bar-lbl { font-size: .75rem; color: var(--hm-muted); margin-top: 4px; white-space: nowrap; }
.status-stack { display: flex; height: 18px; border-radius: 9px; overflow: hidden; }
.dot { display: inline-block; width: 12px; height: 12px; min-height: 0 !important; padding: 0 !important; border-radius: 50% !important; box-shadow: none !important; vertical-align: middle; }
