:root {
  color-scheme: light;
  --app-primary: #1f3a5f;
  --app-bg: #f4f6f9;
  --nav-height: 64px;
  --occ-available: #198754;
  --occ-reserved: #0d6efd;
  --occ-occupied: #6f42c1;
  --occ-oos: #495057;
}

body {
  background: var(--app-bg);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  font-size: 1rem;
}
body.has-bottom-nav { padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom)); }

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 1030;
  background: var(--app-primary); color: #fff;
  padding-top: env(safe-area-inset-top);
}
.app-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: .25rem .25rem .25rem 1rem; min-height: 52px;
}
.app-title { font-size: 1.15rem; font-weight: 600; }
.app-main { max-width: 1100px; margin: 0 auto; padding: .75rem; }

/* Global HTMX progress bar */
.htmx-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000;
  background: #ffc107; opacity: 0; transition: opacity .15s;
}
.htmx-progress.htmx-request { opacity: 1; }

/* Bottom navigation */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid #dee2e6;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #6c757d; text-decoration: none; font-size: .8rem;
}
.bottom-nav a i { font-size: 1.4rem; line-height: 1; }
.bottom-nav a.active { color: var(--app-primary); font-weight: 700; }

/* Filter chips */
.filter-chips {
  display: flex; gap: .5rem; overflow-x: auto; padding: .25rem 0 .75rem;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem;
  min-height: 44px; padding: .4rem .9rem; border-radius: 999px;
  background: #fff; border: 1px solid #ced4da; color: #212529; text-decoration: none; white-space: nowrap;
}
.chip.active { background: var(--app-primary); border-color: var(--app-primary); color: #fff; }
.chip-count {
  min-width: 1.5rem; padding: 0 .4rem; border-radius: 999px; text-align: center;
  background: rgba(0,0,0,.08); font-weight: 600; font-size: .85rem;
}
.chip.active .chip-count { background: rgba(255,255,255,.25); }

/* Board: view switch, today summary, building groups */
.view-switch .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.board-summary {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: .75rem;
}
@media (min-width: 768px) { .board-summary { grid-template-columns: repeat(4, 1fr); } }
.summary-tile {
  --tone: var(--app-primary); --tone-bg: #e7edf5;
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: .65rem; min-width: 0; min-height: 64px;
  padding: .6rem .75rem; background: #fff; color: #212529; text-decoration: none;
  border: 1px solid #dee2e6; border-radius: .75rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
a.summary-tile:hover { border-color: var(--tone); color: #212529; }
a.summary-tile:focus-visible { outline: 3px solid #ffc107; outline-offset: 2px; }
.summary-tile.is-active { border-color: var(--tone); box-shadow: inset 0 0 0 1px var(--tone); }
.summary-icon {
  flex: 0 0 auto; display: grid; place-items: center; width: 2.4rem; height: 2.4rem;
  border-radius: 50%; background: var(--tone-bg); color: var(--tone); font-size: 1.15rem;
}
.summary-text { display: flex; flex-direction: column; min-width: 0; }
.summary-value { font-size: 1.4rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.summary-label { font-size: .8rem; color: #495057; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--tone-bg); }
.summary-bar > span { display: block; height: 100%; background: var(--tone); }
.tone-arrivals { --tone: var(--occ-reserved); --tone-bg: #e7f0ff; }
.tone-departures { --tone: #b35c00; --tone-bg: #fff1e0; }
.tone-ready { --tone: var(--occ-available); --tone-bg: #e3f3ea; }
.tone-tonight { --tone: var(--occ-occupied); --tone-bg: #efe9f8; }
.room-group + .room-group { margin-top: 1rem; }
.room-group-title { font-size: 1rem; font-weight: 700; margin: 0 0 .5rem; color: #212529; }
.room-group-count { font-size: .8rem; font-weight: 400; color: #6c757d; }

/* Room grid */
.room-grid {
  display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
}
@media (min-width: 768px) { .room-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }

.room-card {
  color-scheme: light;
  display: flex; flex-direction: column; align-items: flex-start; gap: .3rem;
  min-height: 132px; padding: .6rem .6rem .7rem; text-align: left;
  background: #fff; border: 1px solid #dee2e6; border-left: 6px solid var(--occ-available);
  border-radius: .6rem; color: #212529;
}
.room-card:focus-visible { outline: 3px solid #ffc107; outline-offset: 2px; }
.room-card.occ-RESERVED { border-left-color: var(--occ-reserved); }
.room-card.occ-OCCUPIED { border-left-color: var(--occ-occupied); }
.room-card.occ-OUT_OF_SERVICE { border-left-color: var(--occ-oos); background: #e9ecef; }
.room-number { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.room-type { font-size: .78rem; color: #6c757d; }

/* Status pills: always colour + text */
.status-pill {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .5rem; border-radius: .4rem; font-size: .78rem; font-weight: 600; line-height: 1.4;
}
.occ-pill-AVAILABLE { background: #d1e7dd; color: #0a3622; }
.occ-pill-RESERVED { background: #cfe2ff; color: #052c65; }
.occ-pill-OCCUPIED { background: #e2d9f3; color: #3d2373; }
.occ-pill-OUT_OF_SERVICE { background: #495057; color: #fff; }
.hk-pill-CLEAN { background: #f8f9fa; color: #146c43; border: 1px solid #a3cfbb; }
.hk-pill-DIRTY { background: #f8d7da; color: #58151c; }
.hk-pill-CLEANING { background: #fff3cd; color: #664d03; }
.hk-pill-INSPECTION { background: #cff4fc; color: #055160; }

/* Bottom sheet */
.room-sheet.offcanvas-bottom { height: auto; max-height: 90vh; border-radius: 1rem 1rem 0 0; }
.room-sheet .offcanvas-body { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
.hk-state { padding: .75rem; border: 1px solid #dee2e6; border-radius: .75rem; background: #fff; }
.hk-state-line { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; font-size: 1.05rem; }
.hk-state-line > i { font-size: 1.5rem; }
.hk-state-line small { font-size: .85rem; color: #495057; }
.hk-state-CLEAN .hk-state-line > i { color: #198754; }
.hk-state-DIRTY .hk-state-line > i { color: #b02a37; }
.hk-state-CLEANING .hk-state-line > i { color: #997404; }
.hk-state-INSPECTION .hk-state-line > i { color: #0a58ca; }
.hk-state-actions { display: grid; grid-template-columns: auto 1fr; gap: .5rem; }
.hk-state-actions > :only-child { grid-column: 1 / -1; }
@media (min-width: 768px) {
  .room-sheet.offcanvas-bottom { max-width: 560px; margin: 0 auto; }
}

.empty-state { text-align: center; padding: 3rem 1rem; }

.login-page { display: flex; min-height: 100vh; align-items: center; }
.login-page .app-main { width: 100%; }
.login-card {
  max-width: 400px; margin: 0 auto; padding: 2rem 1.25rem;
  background: #fff; border-radius: 1rem; box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.btn-lg { min-height: 48px; }

/* Room board: guest + due-out */
.room-guest { font-size: .8rem; max-width: 100%; }
.due-pill { background: #ffc107; color: #332701; }
.unit-pill { background: #fde2c8; color: #5c2d00; }
.tape-group td { background: #f1f4f8; border-bottom: 1px solid #dee2e6; padding: .3rem .5rem !important; }
.tape-group span { position: sticky; left: .5rem; font-size: .8rem; font-weight: 700; color: #1f3a5f; }
.tape .tape-room small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-pick { position: relative; flex: 1 1 auto; min-width: 0; }
.date-pick-text { display: flex; align-items: center; gap: .5rem; white-space: nowrap; overflow: hidden; }
.date-pick-text .bi { color: #6c757d; }
.date-pick-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.date-pick:focus-within .date-pick-text { border-color: #86b7fe; box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25); }
.primary-action {
  position: sticky; z-index: 20; margin-bottom: .75rem; padding: .5rem 0;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  background: var(--app-bg);
}
.unit-tag { display: block; font-size: .65rem; font-weight: 600; color: #8a4b00; line-height: 1.1; }
.tape tr.is-unit .tape-room { background: #fff6ec; }
.tape tr.is-unit .tape-room small { color: #8a4b00; font-weight: 600; }

/* Reservations */
[x-cloak] { display: none !important; }
.res-row {
  display: flex; align-items: center; gap: .75rem; padding: .75rem;
  margin-bottom: .5rem; background: #fff; border: 1px solid #dee2e6; border-radius: .6rem;
  color: #212529; text-decoration: none; min-height: 64px;
}
.res-room { font-size: 1.35rem; font-weight: 700; min-width: 3.2rem; }
.res-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.res-guest { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-dates { font-size: .85rem; }
.res-code { font-size: .78rem; color: #6c757d; }
.st-pill-CONFIRMED { background: #cfe2ff; color: #052c65; }
.st-pill-CHECKED_IN { background: #e2d9f3; color: #3d2373; }
.st-pill-CHECKED_OUT { background: #e9ecef; color: #343a40; }
.st-pill-CANCELLED { background: #f8d7da; color: #58151c; }
.st-pill-NO_SHOW { background: #fff3cd; color: #664d03; }
.summary-card { background: #fff; border: 1px solid #dee2e6; border-radius: .75rem; padding: 1rem; }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: .35rem .75rem; }
.detail-list dt { font-weight: 400; color: #6c757d; }
.detail-list dd { margin: 0; }
.room-pick { text-decoration: none; min-height: 110px; }
.total-line { font-size: 1.1rem; text-align: right; padding: .5rem 0; }
.cancel-box { background: #fff; border: 1px solid #f1aeb5; border-radius: .6rem; padding: .75rem; }
.history-list { list-style: none; padding: 0; }
.history-list li { padding: .5rem 0; border-bottom: 1px solid #e9ecef; }

/* Cashier */
.cash-banner {
  display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; margin-bottom: .75rem;
  border-radius: .6rem; text-decoration: none; font-weight: 600; min-height: 56px;
}
.cash-banner.is-open { background: #d1e7dd; color: #0a3622; }
.cash-banner.is-closed { background: #fff3cd; color: #664d03; }
.balance-box {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: .75rem; padding: .6rem .9rem; border-radius: .6rem;
}
.balance-box strong { font-size: 1.8rem; }
.balance-box.due { background: #f8d7da; color: #58151c; }
.balance-box.credit { background: #fff3cd; color: #664d03; }
.balance-box.settled { background: #d1e7dd; color: #0a3622; }
.totals-row { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .5rem; font-size: .9rem; color: #495057; }
.pos-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.pos-actions .btn { padding: .6rem .25rem; font-size: .9rem; min-height: 76px; }
.pos-panel { background: #fff; border: 1px solid #dee2e6; border-radius: .75rem; padding: 1rem; margin-bottom: 1rem; }
.method-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.method-picker .btn { min-height: 52px; display: flex; align-items: center; justify-content: center; }
.method-picker input:disabled + * , .method-picker label:has(input:disabled) { opacity: .45; }
.amount-input { font-size: 1.6rem; font-weight: 700; text-align: right; }
.quick-amounts { display: flex; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.quick-amounts .btn { min-height: 44px; flex: 1; }
.quick-charges { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .5rem; }
.quick-charges .btn { min-height: 60px; font-size: .95rem; }
.change-line { font-size: 1.2rem; margin-top: .5rem; text-align: right; }
.ledger { list-style: none; padding: 0; background: #fff; border: 1px solid #dee2e6; border-radius: .6rem; }
.ledger li { padding: .6rem .75rem; border-bottom: 1px solid #e9ecef; }
.ledger li:last-child { border-bottom: 0; }
.ledger-row { display: flex; align-items: center; gap: .5rem; }
.ledger-desc { flex: 1; min-width: 0; }
.ledger-amount { font-weight: 600; white-space: nowrap; }
.ledger li.is-void .ledger-desc, .ledger li.is-void .ledger-amount { text-decoration: line-through; color: #adb5bd; }
.amount-due { color: #b02a37; font-weight: 700; white-space: nowrap; }
.amount-credit { color: #997404; font-weight: 700; white-space: nowrap; }
.amount-ok { color: #146c43; font-weight: 700; }

/* Tape chart */
.tape-toolbar { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.tape-range { flex: 1; text-align: center; font-weight: 600; }
.tape-scroll {
  overflow: auto; background: #fff; border: 1px solid #dee2e6; border-radius: .6rem;
  max-height: calc(100dvh - 330px); min-height: 240px;
  -webkit-overflow-scrolling: touch;
}
.tape thead th { position: sticky; top: 0; z-index: 3; background: #fff; }
.tape thead th.is-weekend { background: #f8f9fa; }
.tape thead th.is-today { background: #fff3cd; }
.tape thead .tape-room { z-index: 4; }
.tape {
  --tape-room-w: 84px; --tape-day-w: 48px;
  border-collapse: separate; border-spacing: 0; table-layout: fixed;
  width: max(100%, calc(var(--tape-room-w) + var(--tape-days, 14) * var(--tape-day-w)));
}
.tape th, .tape td { padding: 0; border-bottom: 1px solid #edf0f3; }
.tape .tape-room {
  position: sticky; left: 0; z-index: 2; background: #fff; width: var(--tape-room-w);
  padding: .35rem .5rem; text-align: left; font-weight: 700; border-right: 1px solid #dee2e6;
  overflow: hidden;
}
.tape .tape-room small { display: block; font-weight: 400; color: #6c757d; font-size: .7rem; line-height: 1.2; }
.tape-day { text-align: center; font-weight: 400; padding: .25rem 0 !important; line-height: 1.15; }
.tape-day .tape-month { display: block; font-size: .65rem; color: #0d6efd; font-weight: 600; }
.tape-day .tape-dow { display: block; font-size: .7rem; color: #6c757d; }
.tape-day .tape-dom { display: block; font-weight: 700; }
.tape-day.is-weekend { background: #f8f9fa; }
.tape-day.is-today { background: #fff3cd; }
.tape-day.is-past { opacity: .5; }
.tape-cell { height: 46px; padding: 3px 1px !important; overflow: hidden; }
.tape-free {
  display: block; width: 100%; height: 40px; border: 1px dashed #ced4da;
  border-radius: .35rem; background: #fff;
}
.tape-free:hover { background: #e9f5ef; }
.tape-free.is-selected { background: #198754; border: 1px solid #198754; }
.tape-blocked { background: repeating-linear-gradient(45deg, #f1f3f5, #f1f3f5 4px, #fff 4px, #fff 8px); }
.tape .is-oos .tape-room { color: #6c757d; }
.tape-bar {
  display: block; height: 40px; line-height: 40px; padding: 0 .5rem; border-radius: .4rem;
  color: #fff; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
}
.tape-bar.st-CONFIRMED { background: #0d6efd; }
.tape-bar.st-CHECKED_IN { background: #6f42c1; }
.tape-bar.clip-start { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tape-bar.clip-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tape-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: .5rem 0 6rem; }
.legend-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: .3rem; vertical-align: -2px; }
.legend-swatch.free { border: 1px dashed #adb5bd; }
.legend-swatch.st-CONFIRMED { background: #0d6efd; }
.legend-swatch.st-CHECKED_IN { background: #6f42c1; }
.legend-swatch.selected { background: #198754; }
.tape-selection {
  position: fixed; left: 0; right: 0; z-index: 1025;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem;
  background: #1f3a5f; color: #fff; box-shadow: 0 -2px 10px rgba(0,0,0,.15);
}
.tape-picks { max-height: 4.5rem; overflow-y: auto; opacity: .9; }
.min-w-0 { min-width: 0; }

/* Returning-guest autocomplete */
.guest-field { position: relative; }
.guest-suggest-list {
  position: absolute; left: 0; right: 0; z-index: 1040; margin-top: 2px;
  max-height: 320px; overflow-y: auto; box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.guest-suggest-list .list-group-item { min-height: 56px; text-align: left; }
.guest-picked {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; margin-bottom: .75rem;
  background: #d1e7dd; color: #0a3622; border-radius: .6rem;
}
.guest-picked[hidden] { display: none; }

/* Reports */
.report-datebar { display: flex; gap: .5rem; margin-bottom: .75rem; }
.report-datebar input { flex: 1; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: 1rem; }
@media (min-width: 768px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } .stat-tiles-2 { grid-template-columns: repeat(2, 1fr); } }
.stat-tile { background: #fff; border: 1px solid #dee2e6; border-radius: .6rem; padding: .75rem; min-width: 0; }
.stat-label { font-size: .8rem; color: #495057; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: #212529; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat-note { font-size: .75rem; color: #6c757d; }
.report-h { font-size: 1rem; font-weight: 700; margin: 1.25rem 0 .5rem; }
.report-table { background: #fff; font-size: .9rem; margin-bottom: .5rem; }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-table tfoot th, .report-table tfoot td { font-weight: 700; border-top: 2px solid #212529; }
.report-daily { min-width: 640px; }
.activity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.activity-grid div { background: #fff; border: 1px solid #dee2e6; border-radius: .6rem; padding: .5rem; text-align: center; font-size: .8rem; color: #495057; }
.activity-grid span { display: block; font-size: 1.3rem; font-weight: 700; color: #212529; }
.print-only { display: none; }
@media print {
  .app-header, .bottom-nav, .no-print, .toast-container, .htmx-progress { display: none !important; }
  body.has-bottom-nav { padding-bottom: 0; background: #fff; }
  .print-only { display: block; }
  .report-print-head { margin-bottom: .5rem; }
  .report-sign { margin-top: 2rem; }
  .stat-tile, .report-table, .activity-grid div { border-color: #999; }
}

/* Column charts (reports/_bar_chart.html). Single series per chart, so no legend box;
   forecast days use a 45° texture of the same hue and get a two-key legend. */
.bar-chart {
  --bc-color: #2a78d6; --bc-color-light: #b9d3f3; --bc-grid: #e9ecef; --bc-axis: 2.6rem;
  position: relative; background: #fff; border: 1px solid #dee2e6; border-radius: .6rem;
  padding: .75rem .75rem .5rem; margin: 0 0 1rem;
}
.bar-chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin-bottom: .5rem; }
.bc-title { font-weight: 700; color: #212529; }
.bc-subtitle { font-size: .8rem; color: #6c757d; }
.bc-legend { display: flex; gap: .75rem; font-size: .75rem; color: #495057; margin-left: auto; }
.bc-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .3rem; background: var(--bc-color); vertical-align: -1px; }
.bc-key.is-forecast, .bc-bar.is-forecast {
  background: repeating-linear-gradient(45deg, var(--bc-color) 0 2px, var(--bc-color-light) 2px 5px);
}
.bc-body { display: flex; height: 160px; }
.bc-yaxis { position: relative; width: var(--bc-axis); flex: none; font-size: .7rem; color: #6c757d; font-variant-numeric: tabular-nums; }
.bc-yaxis span { position: absolute; right: .4rem; transform: translateY(50%); }
.bc-plot { position: relative; flex: 1; min-width: 0; }
.bc-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--bc-grid); }
.bc-cols { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.bc-col {
  flex: 1; min-width: 0; height: 100%; padding: 0 1px; display: flex; align-items: flex-end;
  justify-content: center; text-decoration: none; outline-offset: -2px;
}
.bc-bar {
  display: block; width: 70%; max-width: 24px; min-height: 0; background: var(--bc-color);
  border-radius: 4px 4px 0 0;
}
.bc-bar.is-zero { height: 0 !important; }
.bc-col:hover .bc-bar, .bc-col:focus-visible .bc-bar { opacity: .75; }
.bc-col:focus-visible { outline: 2px solid #212529; }
.bc-xaxis { display: flex; margin-left: var(--bc-axis); padding-top: .25rem; font-size: .7rem; color: #6c757d; }
.bc-xaxis span { flex: 1; width: 0; display: flex; justify-content: center; white-space: nowrap; }
.bc-tooltip {
  position: absolute; z-index: 5; pointer-events: none; transform: translateX(-50%);
  background: #212529; color: #fff; border-radius: .4rem; padding: .3rem .5rem; font-size: .8rem;
  white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.bc-tooltip strong { display: block; font-size: .9rem; }
.bc-tooltip span { opacity: .8; }
@media print {
  .bar-chart { break-inside: avoid; border-color: #999; }
  .bc-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Housekeeping & incidents */
.bottom-nav-2 { grid-template-columns: repeat(2, 1fr); }
.hk-card { display: block; background: #fff; border: 1px solid #dee2e6; border-radius: .6rem; padding: .6rem .75rem; margin-bottom: .5rem; color: #212529; text-decoration: none; }
.hk-card-head { display: flex; align-items: center; gap: .75rem; min-height: 44px; }
.hk-pool { border-left: 6px solid #0d6efd; }
.hk-mine.status-ASSIGNED { border-left: 6px solid #dc3545; }
.hk-mine.status-IN_PROGRESS { border-left: 6px solid #ffc107; }
.hk-mine.status-SUBMITTED { border-left: 6px solid #0dcaf0; }
.hk-mine.status-DONE { border-left: 6px solid #198754; opacity: .75; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .5rem; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .5rem; background: #e9ecef; }
.photo-item { position: relative; }
.photo-delete {
  position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff;
}
.incident-icon { font-size: 1.5rem; min-width: 2.2rem; text-align: center; color: #495057; }
.inc-OPEN { background: #f8d7da; color: #58151c; }
.inc-IN_PROGRESS { background: #fff3cd; color: #664d03; }
.inc-RESOLVED { background: #d1e7dd; color: #0a3622; }
.kind-picker { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.kind-picker .btn { min-height: 52px; font-size: .95rem; }
.kind-picker .btn-check-native { position: absolute; opacity: 0; pointer-events: none; }
.kind-picker label:has(input:checked) { background: #212529; color: #fff; }
.kind-picker label:has(input:focus-visible) { outline: 3px solid #ffc107; }
.link-code { font-size: 3rem; font-weight: 800; letter-spacing: .3em; margin: .5rem 0; font-variant-numeric: tabular-nums; }
.secret-code { font-size: 1.75rem; font-weight: 700; letter-spacing: .08em; margin: .5rem 0; font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.pin-input { letter-spacing: .5em; font-size: 1.5rem; text-align: center; font-variant-numeric: tabular-nums; }

/* Cashier: bill-first layout */
.bill { background: #fff; border: 1px solid #dee2e6; border-radius: .75rem; padding: 1rem; margin-bottom: .75rem; }
.bill-head { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.bill-lines { width: 100%; }
.bill-lines td { padding: .3rem 0; vertical-align: top; }
.bill-lines .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 1rem; }
.bill-lines tfoot td { color: #495057; }
.bill-lines .bill-sum td { border-top: 1px solid #adb5bd; font-weight: 600; color: #212529; }
.bill-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: .5rem; padding: .6rem .9rem; border-radius: .6rem; font-weight: 600;
}
.bill-total strong { font-size: 2rem; font-variant-numeric: tabular-nums; }
.bill-total.due { background: #f8d7da; color: #58151c; }
.bill-total.open { background: #e7edf5; color: #1f3a5f; }
.bill-total small { font-size: .78rem; font-weight: 400; }
.bill-calc { display: block; font-size: .78rem; color: #6c757d; }
.bill-lines tr.is-preview td { color: #495057; }
.bed-stepper {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; padding: .6rem .75rem;
  background: #fff; border: 1px solid #dee2e6; border-radius: .75rem;
}
.bed-stepper-label { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.bed-stepper-label small { font-weight: 400; }
.bed-stepper .btn { width: 48px; height: 48px; font-size: 1.25rem; display: grid; place-items: center; padding: 0; }
.bed-stepper-count { min-width: 2ch; text-align: center; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper { display: grid; grid-template-columns: 52px minmax(3.5rem, 1fr) 52px; gap: .4rem; align-items: stretch; }
.stepper .btn { min-height: 52px; font-size: 1.3rem; display: grid; place-items: center; padding: 0; }
.stepper input { text-align: center; font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.count-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.count-label { flex: 1 1 auto; min-width: 0; font-weight: 500; margin: 0; }
.count-row .stepper { flex: 0 0 auto; width: 190px; }
.pos-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .75rem; }
.pos-secondary .btn { min-height: 48px; }
.undo-bar {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem;
  padding: .55rem .75rem; border-radius: .6rem; background: #1f3a5f; color: #fff;
}
.bill-total.credit { background: #fff3cd; color: #664d03; }
.bill-total.settled { background: #d1e7dd; color: #0a3622; }
.quick-add { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; margin-bottom: .75rem; }
.quick-add form { display: contents; }
.quick-add .btn { min-height: 56px; display: flex; flex-direction: column; justify-content: center; line-height: 1.2; }
.quick-add .btn small { font-size: .75rem; opacity: .8; }
.pos-primary { min-height: 64px; font-size: 1.25rem; font-weight: 700; margin-bottom: .75rem; }
.pos-done { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .75rem; }
.pos-done > :only-child { grid-column: 1 / -1; }
.method-big { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.method-big .btn { min-height: 72px; display: flex; flex-direction: column; justify-content: center; font-size: 1.05rem; }
.method-big .btn i { font-size: 1.5rem; }
.pay-amount-line { font-size: 1.1rem; }
.pay-amount-line strong { font-size: 1.4rem; }
.quick-amounts input { flex: 1; min-width: 90px; min-height: 44px; }
.pos-more-toggle { color: #495057; }

/* Customers */
.customer-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #e7eef7; color: #1f3a5f; font-weight: 700;
}
@media (max-width: 400px) { .bottom-nav a { font-size: .72rem; } }
