:root { --brand: #db2777; --brand-soft: #fdf2f8; }
[data-bs-theme=dark] { --brand-soft: #2a1520; }
body { background: var(--bs-tertiary-bg); }
.btn-brand { background: var(--brand); color: #fff; border: none; }
.btn-brand:hover { background: #be185d; color: #fff; }
.text-brand { color: var(--brand) !important; }
/* Sidebar: lebar TETAP (tidak ikut menyusut saat isi halaman lebar), menempel & bisa digulung sendiri */
.sidebar { flex: 0 0 240px; width: 240px; height: 100vh; position: sticky; top: 0; overflow-y: auto; overflow-x: hidden;
  background: var(--bs-body-bg); border-right: 1px solid var(--bs-border-color); transition: width .2s, flex-basis .2s; scrollbar-gutter: stable; }
.sidebar .nav-link { color: var(--bs-body-color); border-radius: .5rem; padding: .45rem .75rem; font-size: .92rem; white-space: nowrap; }
.sidebar .menu-label { overflow: hidden; text-overflow: ellipsis; }
.sidebar .nav-link.active, .sidebar .nav-link:hover { background: var(--brand-soft); color: var(--brand); }
.sidebar .menu-head { display: flex; align-items: center; width: calc(100% - 1rem); border: 0; background: none; padding: .25rem .5rem; margin: .6rem .5rem .1rem;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); border-radius: .4rem; }
.sidebar .menu-head:hover { background: var(--bs-tertiary-bg); color: var(--brand); }
.sidebar .menu-head span { flex: 1; text-align: left; }
.sidebar .menu-head .bi { transition: transform .2s; font-size: .7rem; }
.menu-group .menu-items { overflow: hidden; max-height: 4000px; transition: max-height .25s ease; }
.menu-group.closed .menu-items { max-height: 0; }
.menu-group.closed .menu-head .bi { transform: rotate(-90deg); }
.sidebar .sb-tools .btn { font-size: .72rem; text-decoration: none; }
/* Mode kecil: hanya ikon */
body.sidebar-mini .sidebar { flex-basis: 64px; width: 64px; }
body.sidebar-mini .sidebar .sb-text, body.sidebar-mini .sidebar .menu-label, body.sidebar-mini .sidebar .sb-tools,
body.sidebar-mini .sidebar .nav-link .bi-lock-fill, body.sidebar-mini .sidebar .menu-head span, body.sidebar-mini .sidebar .menu-head .bi { display: none !important; }
body.sidebar-mini .sidebar .menu-head { height: 1px; padding: 0; margin: .5rem .6rem; background: var(--bs-border-color); pointer-events: none; }
body.sidebar-mini .menu-group.closed .menu-items { max-height: 4000px; }
body.sidebar-mini .sidebar .nav-link { justify-content: center; padding: .5rem 0; font-size: 1.05rem; }
body.sidebar-mini .sidebar .sb-brand { justify-content: center; padding: .5rem 0 !important; }
body.sidebar-mini .sidebar .sb-brand img { width: 34px; }
.nav-link .bi-lock-fill { font-size: .7rem; opacity: .6; }
@media (max-width: 991px) {
  .sidebar { position: fixed; z-index: 1040; left: -260px; transition: left .2s; box-shadow: 0 0 24px rgba(0,0,0,.15); }
  .sidebar.show { left: 0; }
  body.sidebar-mini .sidebar { flex-basis: 240px; width: 240px; }   /* di HP selalu tampil penuh saat dibuka */
  body.sidebar-mini .sidebar .sb-text, body.sidebar-mini .sidebar .menu-label, body.sidebar-mini .sidebar .menu-head span { display: inline !important; }
  body.sidebar-mini .sidebar .nav-link { justify-content: flex-start; padding: .45rem .75rem; font-size: .92rem; }
}
.card { border: none; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-card .num { font-size: 1.8rem; font-weight: 700; }
.room-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .25rem .55rem; margin: .15rem; border-radius: .5rem; font-weight: 600; font-size: .85rem; }
.room-chip.smk { background: #fef3c7; color: #92400e; } .room-chip.non { background: #dcfce7; color: #166534; }
[data-bs-theme=dark] .room-chip.smk { background: #452a05; color: #fcd34d; } [data-bs-theme=dark] .room-chip.non { background: #0f3a20; color: #86efac; }
.hk-CLEAN { background: #dcfce7 !important; } .hk-DIRTY { background: #fee2e2 !important; } .hk-INSPECTED { background: #dbeafe !important; } .hk-MAINTENANCE { background: #e5e7eb !important; }
[data-bs-theme=dark] .hk-CLEAN, [data-bs-theme=dark] .hk-DIRTY, [data-bs-theme=dark] .hk-INSPECTED, [data-bs-theme=dark] .hk-MAINTENANCE { color: #111; }
.room-tile { cursor: pointer; border-radius: .75rem; padding: .6rem; text-align: center; border: 2px solid transparent; background: var(--bs-body-bg); }
.room-tile.sel { border-color: var(--brand); }
.room-tile.busy { opacity: .45; cursor: not-allowed; }
.blink { animation: blink 1s infinite; } @keyframes blink { 50% { opacity: .35; } }
.trial-watermark { border: 2px dashed #dc2626; color: #dc2626; font-weight: 700; text-align: center; padding: .4rem; margin: .5rem 0; font-size: .8rem; }
.lock-screen { position: fixed; inset: 0; z-index: 3000; background: rgba(15, 5, 10, .92); display: flex; align-items: center; justify-content: center; }
.calc-btn { width: 100%; height: 48px; font-size: 1.1rem; }
.qris-full { position: fixed; inset: 0; z-index: 3000; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.qris-full img { max-width: 92vw; max-height: 80vh; }
.table td, .table th { vertical-align: middle; }
.viz-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.num-r { text-align: right; font-variant-numeric: tabular-nums; }
/* Splash screen */
#splash { position: fixed; inset: 0; z-index: 5000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #fdf2f8, #fce7f3 60%, #fbcfe8); transition: opacity .4s; }
#splash img { width: 120px; animation: pop 1s ease-out; filter: drop-shadow(0 6px 12px rgba(157,23,77,.25)); }
#splash .t1 { font-size: 1.6rem; font-weight: 800; color: #9d174d; margin-top: 12px; letter-spacing: .02em; }
#splash .t2 { color: #be185d; } #splash .bar { width: 160px; height: 4px; background: #fbcfe8; border-radius: 4px; overflow: hidden; margin-top: 18px; }
#splash .bar::after { content: ''; display: block; width: 40%; height: 100%; background: #db2777; animation: load 1s infinite ease-in-out; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
/* Mode layar penuh untuk Check-in / Kasir: sidebar disembunyikan */
body.fs-mode .sidebar { display: none !important; }
body.fs-mode #page { padding: .75rem !important; }
/* Cetak laporan: hanya isi laporan yang tercetak */
@media print {
  .sidebar, header, #trialBar, .no-print, .toast-container { display: none !important; }
  body { background: #fff !important; } #page { padding: 0 !important; }
  /* Laporan tercetak memakai Arial Narrow (cadangan font sempit lain / Arial) */
  #page, #page * { font-family: 'Arial Narrow', 'Arial Nova Cond', 'Liberation Sans Narrow', 'Nimbus Sans Narrow', Arial, sans-serif !important; font-stretch: condensed; }
  .print-store { font-size: 1.5rem !important; } .card { box-shadow: none !important; }
  .trial-watermark { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* tombol tidak berguna di kertas; kotak isian filter dicetak seperti teks biasa */
  #page .btn { display: none !important; }
  #page .form-control, #page .form-select { border: 0 !important; padding: 0 !important; background: none !important; appearance: none; box-shadow: none !important; }
}

/* Kalender ketersediaan kamar (reservasi) */
.cal-table th, .cal-table td { font-size: .75rem; padding: .2rem .3rem; white-space: nowrap; }
.cal-table .sticky-col { position: sticky; left: 0; background: var(--bs-body-bg); z-index: 1; min-width: 90px; }
.cal-cell { min-width: 44px; height: 34px; cursor: pointer; overflow: hidden; max-width: 70px; text-overflow: ellipsis; }
.cal-free:hover { background: #fce7f3 !important; }
.cal-IN { background: #dbeafe !important; color: #1e3a8a; font-weight: 600; }
.cal-RESV { background: #fde68a !important; color: #78350f; font-weight: 600; }
.cal-MT { background: #e5e7eb !important; color: #374151; }
[data-bs-theme=dark] .cal-IN { background: #1e3a8a !important; color: #dbeafe; }
[data-bs-theme=dark] .cal-RESV { background: #78350f !important; color: #fde68a; }
[data-bs-theme=dark] .cal-MT { background: #374151 !important; color: #e5e7eb; }
[data-bs-theme=dark] .cal-free:hover { background: #4a1d35 !important; }

/* Layar SOS darurat */
.sos-overlay { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; color: #fff; text-align: center; overflow: auto; }
.sos-overlay.sos-alarm { background: #b91c1c; animation: sosFlash .8s infinite; }
.sos-overlay.sos-handled { background: rgba(127, 29, 29, .94); }
@keyframes sosFlash { 50% { background: #450a0a; } }
.sos-box { max-width: 720px; width: 100%; }
.sos-item { border: 3px solid rgba(255,255,255,.6); border-radius: 1rem; padding: 1.25rem; margin-bottom: 1rem; }
.sos-title { font-size: clamp(1.8rem, 6vw, 3.2rem); font-weight: 800; letter-spacing: .02em; }
.sos-contacts { font-size: 1.15rem; font-weight: 600; background: rgba(0,0,0,.25); border-radius: .75rem; padding: .6rem 1rem; }
/* diperkecil: jadi pita merah di atas layar */
.sos-overlay.sos-min { inset: 0 0 auto 0; padding: 4px 12px; cursor: pointer; animation: none; background: #b91c1c; }
.sos-overlay.sos-min .sos-item { border: 0; padding: 0; margin: 0; display: inline-block; }
.sos-overlay.sos-min .sos-item > :not(.sos-title), .sos-overlay.sos-min .sos-contacts, .sos-overlay.sos-min [data-smin] { display: none !important; }
.sos-overlay.sos-min .sos-title { font-size: 1rem; }
/* Layar tunggu restore / reset database */
.busy-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }

/* Halaman yang dibuka server untuk cetak langsung A4 (render=1): hanya isi laporan */
body.render-mode .sidebar, body.render-mode header, body.render-mode #trialBar { display: none !important; }

/* =========================================================
   Warna status (ikut tema terang / gelap)
   ========================================================= */
:root {
  --st-vacant-bg: #dcfce7; --st-vacant-fg: #15803d;
  --st-occupied-bg: #dbeafe; --st-occupied-fg: #1d4ed8;
  --st-resv-bg: #ede9fe; --st-resv-fg: #6d28d9;
  --st-overdue-bg: #fee2e2; --st-overdue-fg: #b91c1c;
  --st-clean-bg: #dcfce7; --st-clean-fg: #15803d;
  --st-dirty-bg: #ffedd5; --st-dirty-fg: #c2410c;
  --st-inspected-bg: #dbeafe; --st-inspected-fg: #1d4ed8;
  --st-maint-bg: #e5e7eb; --st-maint-fg: #374151;
  --st-smoking-bg: #fef3c7; --st-smoking-fg: #92400e;
}
[data-bs-theme=dark] {
  --st-vacant-bg: #0f3a20; --st-vacant-fg: #86efac;
  --st-occupied-bg: #172554; --st-occupied-fg: #93c5fd;
  --st-resv-bg: #2e1065; --st-resv-fg: #c4b5fd;
  --st-overdue-bg: #450a0a; --st-overdue-fg: #fca5a5;
  --st-clean-bg: #0f3a20; --st-clean-fg: #86efac;
  --st-dirty-bg: #431407; --st-dirty-fg: #fdba74;
  --st-inspected-bg: #172554; --st-inspected-fg: #93c5fd;
  --st-maint-bg: #1f2937; --st-maint-fg: #d1d5db;
  --st-smoking-bg: #452a05; --st-smoking-fg: #fcd34d;
}
.stat-card { border-left: 5px solid var(--st-fg) !important; background: linear-gradient(90deg, var(--st-bg), var(--bs-body-bg) 70%); }
.stat-card .st-ic { color: var(--st-fg); }
.st-vacant { --st-bg: var(--st-vacant-bg); --st-fg: var(--st-vacant-fg); }
.st-occupied { --st-bg: var(--st-occupied-bg); --st-fg: var(--st-occupied-fg); }
.st-resv { --st-bg: var(--st-resv-bg); --st-fg: var(--st-resv-fg); }
.st-overdue { --st-bg: var(--st-overdue-bg); --st-fg: var(--st-overdue-fg); }
/* chip housekeeping: kotak sama besar, rapi sejajar */
.hk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .4rem; }
.hk-grid .room-chip { margin: 0; flex-direction: column; justify-content: center; gap: 0; min-height: 52px; padding: .3rem; text-align: center; line-height: 1.15; }
.hk-grid .room-chip b { font-size: 1rem; } .hk-grid .room-chip small { font-size: .7rem; font-weight: 600; }
.room-chip.hk-CLEAN, .hk-CLEAN { background: var(--st-clean-bg) !important; color: var(--st-clean-fg) !important; }
.room-chip.hk-DIRTY, .hk-DIRTY { background: var(--st-dirty-bg) !important; color: var(--st-dirty-fg) !important; }
.room-chip.hk-INSPECTED, .hk-INSPECTED { background: var(--st-inspected-bg) !important; color: var(--st-inspected-fg) !important; }
.room-chip.hk-MAINTENANCE, .hk-MAINTENANCE { background: var(--st-maint-bg) !important; color: var(--st-maint-fg) !important; }
.room-chip.occ { background: var(--st-occupied-bg); color: var(--st-occupied-fg); }
.st-legend { display: inline-flex; align-items: center; gap: .3rem; margin-right: .7rem; font-size: .75rem; }
.st-legend i { width: .8rem; height: .8rem; border-radius: .2rem; display: inline-block; }

/* Grid kamar di Check-in: warna per status & tipe kamar + ikon fasilitas */
.room-tile { position: relative; overflow: hidden; padding-top: .9rem; border: 2px solid var(--st-bd, transparent); background: var(--st-tile, var(--bs-body-bg)); }
.room-tile::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--rt, #94a3b8); }
.room-tile.busy { opacity: .85; }
.room-tile.rs-vacant { --st-tile: var(--st-vacant-bg); --st-bd: var(--st-vacant-fg); }
.room-tile.rs-dirty { --st-tile: var(--st-dirty-bg); --st-bd: var(--st-dirty-fg); }
.room-tile.rs-occupied { --st-tile: var(--st-occupied-bg); --st-bd: transparent; }
.room-tile.rs-maint { --st-tile: var(--st-maint-bg); --st-bd: transparent; }
.room-tile.sel { border-color: var(--brand) !important; box-shadow: 0 0 0 3px var(--brand-soft) !important; }
.rt-standard { --rt: #64748b; } .rt-superior { --rt: #0891b2; } .rt-deluxe { --rt: #0d9488; } .rt-family { --rt: #7c3aed; }
.rt-suite { --rt: #db2777; } .rt-vip { --rt: #d97706; } .rt-vvip { --rt: linear-gradient(90deg, #111827, #d4a017, #111827); }
.rt-badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: 0 .4rem; border-radius: .3rem; color: #fff; background: var(--rt, #64748b); }
.rs-pill { display: inline-block; font-size: .7rem; font-weight: 700; padding: .05rem .45rem; border-radius: 1rem; }
.rs-pill.vacant { background: var(--st-vacant-fg); color: #fff; } .rs-pill.occupied { background: var(--st-occupied-fg); color: #fff; }
.rs-pill.dirty { background: var(--st-dirty-fg); color: #fff; } .rs-pill.maint { background: var(--st-maint-fg); color: #fff; }
[data-bs-theme=dark] .rs-pill { color: #111 !important; }
.fac-icons { display: flex; justify-content: center; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; font-size: .85rem; color: var(--bs-secondary-color); }
.fac-icons .smk { color: var(--st-smoking-fg); } .fac-icons .non { color: var(--st-vacant-fg); }

/* tombol outline-dark tetap terlihat di tema gelap (mis. QRIS) */
[data-bs-theme=dark] .btn-outline-dark { --bs-btn-color: #dee2e6; --bs-btn-border-color: #6c757d; --bs-btn-hover-bg: #495057; --bs-btn-hover-border-color: #6c757d;
  --bs-btn-active-bg: #6c757d; --bs-btn-active-border-color: #6c757d; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; }

/* sub-kelompok menu (Laporan > Keuangan, ...) */
.sidebar .menu-subhead { display: flex; align-items: center; gap: .45rem; width: calc(100% - 1.2rem); margin: .35rem .6rem .1rem; padding: .3rem .55rem;
  border: 0; border-radius: .4rem; background: var(--bs-tertiary-bg); color: var(--bs-emphasis-color); font-size: .8rem; font-weight: 600; }
.sidebar .menu-subhead:hover { color: var(--brand); }
.sidebar .menu-subhead span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .menu-subhead small { font-weight: 500; color: var(--bs-secondary-color); }
.sidebar .menu-subhead .bi-chevron-down { font-size: .65rem; transition: transform .2s; }
.menu-sub .menu-items { overflow: hidden; max-height: 1500px; transition: max-height .25s ease; }
.menu-sub .menu-items .nav-link { padding-left: 1.6rem; }
.menu-sub.closed .menu-items { max-height: 0; }
.menu-sub.closed .menu-subhead .bi-chevron-down { transform: rotate(-90deg); }
body.sidebar-mini .sidebar .menu-subhead span, body.sidebar-mini .sidebar .menu-subhead small, body.sidebar-mini .sidebar .menu-subhead .bi-chevron-down { display: none; }
body.sidebar-mini .sidebar .menu-subhead { justify-content: center; width: auto; }
body.sidebar-mini .menu-sub.closed .menu-items { max-height: 1500px; }
body.sidebar-mini .menu-sub .menu-items .nav-link { padding-left: revert; }

/* Preview laporan: lembar kertas A4 di atas latar abu-abu (lihat printPreview() di core.js) */
body.pv-open { overflow: hidden; }
.pv-overlay { position: fixed; inset: 0; z-index: 2000; background: #525659; display: flex; flex-direction: column; }
.pv-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .5rem 1rem; background: #323639; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.pv-bar .btn-light.active { background: #f9a8d4; border-color: #f9a8d4; }
.pv-scroll { flex: 1; overflow: auto; padding: 16px; }
.pv-sheet-wrap { margin: 0 auto; }
.pv-sheet { background: #fff; color: #212529; box-shadow: 0 4px 18px rgba(0,0,0,.45); padding: 12mm; transform-origin: top left; box-sizing: border-box;
  /* garis putus-putus tiap tinggi 1 halaman = perkiraan pindah halaman */
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--pv-page-h) - 1px), #d63384 calc(var(--pv-page-h) - 1px), #d63384 var(--pv-page-h));
  background-size: 100% var(--pv-page-h); background-repeat: repeat-y; }
.pv-content, .pv-content * { font-family: 'Arial Narrow', 'Arial Nova Cond', 'Liberation Sans Narrow', 'Nimbus Sans Narrow', Arial, sans-serif !important; font-stretch: condensed; }
.pv-content .card { border: 0; box-shadow: none !important; background: transparent; }
.pv-content .card-body { padding: 0; }
.pv-content .table { --bs-table-bg: transparent; --bs-table-color: #212529; }
.pv-content .table-responsive { overflow: visible; }
.pv-content .print-store { font-size: 1.5rem !important; }
.pv-field { font-weight: 600; margin-left: .35em; }
@media print { .pv-overlay { display: none !important; } }
