/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f0f1a;
  --bg2:       #1a1a2e;
  --bg3:       #16213e;
  --sidebar:   #12122a;
  --gold:      #d4af37;
  --gold2:     #f0d060;
  --text:      #e8e8f0;
  --muted:     #8888aa;
  --border:    #2a2a4a;
  --success:   #22c55e;
  --danger:    #ef4444;
  --radius:    10px;
  --font:      'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body { height: 100%; overflow: hidden; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; }

/* ── Titlebar ─────────────────────────────────────────────── */
.titlebar {
  height: 38px;
  background: #0a0a18;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  -webkit-app-region: drag;
  user-select: none;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.titlebar-title { font-size: 13px; color: var(--muted); }
.titlebar-controls { display: flex; gap: 6px; -webkit-app-region: no-drag; }
.titlebar-controls button {
  background: none; border: none; color: var(--muted); cursor: pointer;
  width: 28px; height: 24px; border-radius: 5px; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.titlebar-controls button:hover { background: rgba(255,255,255,.1); color: var(--text); }
.titlebar-controls .close-btn:hover { background: #c0392b; color: #fff; }

/* ── Login page ───────────────────────────────────────────── */
.login-page { display: flex; flex-direction: column; height: 100vh; }
.login-wrap  { flex: 1; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 40%, #1a1a3e 0%, var(--bg) 70%); }

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 400px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.logo-icon  { font-size: 52px; }
.login-logo h1 { font-size: 22px; color: var(--gold); margin-top: 8px; font-weight: 700; }
.login-logo p  { color: var(--muted); font-size: 13px; margin-top: 4px; }

.role-selector { display: flex; flex-direction: column; gap: 14px; }
.role-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg3);
  color: var(--text); cursor: pointer; font-size: 15px;
  transition: border-color .2s, background .2s, transform .1s;
}
.role-btn:hover { border-color: var(--gold); background: #1e1e3a; transform: translateY(-1px); }
.role-icon { font-size: 22px; }
.employee-btn:hover { border-color: var(--gold); }
.guest-btn:hover { border-color: #60a5fa; }

.employee-form { display: flex; flex-direction: column; gap: 14px; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; flex: 1; }
label { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }

input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
input::placeholder, textarea::placeholder { color: #555577; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
select { cursor: pointer; }
select option { background: var(--bg2); }
textarea { resize: vertical; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  background: var(--gold);
  color: #0f0f1a;
  border: none;
  padding: 11px 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s, transform .1s;
  font-family: var(--font);
}
.btn-primary:hover:not(:disabled) { background: var(--gold2); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
  font-family: var(--font);
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

.btn-sm {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background .2s;
  font-family: var(--font);
}
.btn-sm:hover { background: rgba(212,175,55,.15); }

.btn-logout {
  width: 100%;
  background: transparent;
  border: 1px solid #c0392b55;
  color: #ff6b6b;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background .2s;
  font-family: var(--font);
}
.btn-logout:hover { background: #c0392b33; }

/* ── Messages ─────────────────────────────────────────────── */
.login-error { color: #ff6b6b; text-align: center; font-size: 13px; margin-top: 8px; }
.login-footer { text-align: center; color: var(--muted); font-size: 11px; margin-top: 20px; }
.form-msg { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-top: 10px; }
.form-msg.success { background: rgba(34,197,94,.15); color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.form-msg.error   { background: rgba(239,68,68,.15); color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.hidden { display: none !important; }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 12px auto 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── App layout ───────────────────────────────────────────── */
.app-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.app-layout { display: flex; flex: 1; overflow: hidden; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  position: relative;
  transition: width 0.22s ease;
}

/* Collapse toggle button — sits at the top-right edge of the sidebar */
.sidebar-collapse-btn {
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(212,175,55,0.10);
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 6px;
  color: var(--gold);
  cursor: pointer;
  z-index: 5;
  font-size: 13px;
  padding: 0;
  transition: background 0.15s, transform 0.15s;
}
.sidebar-collapse-btn:hover { background: rgba(212,175,55,0.22); }
.sidebar-collapse-btn .sc-icon { display: inline-block; transition: transform 0.22s ease; line-height: 1; }
.sidebar.is-collapsed .sidebar-collapse-btn .sc-icon { transform: rotate(180deg); }

/* Collapsed state — icons only, ~64px wide */
.sidebar.is-collapsed { width: 64px; overflow: hidden; }
.sidebar.is-collapsed .sidebar-collapse-btn {
  position: static; margin: 10px auto 0;
}
.sidebar.is-collapsed .sidebar-header {
  padding: 12px 6px;
  border-bottom: 1px solid var(--border);
}
.sidebar.is-collapsed .sidebar-logo { width: 38px !important; height: 38px !important; border-width: 1px !important; }
.sidebar.is-collapsed .sidebar-header > div { display: none; }
.sidebar.is-collapsed .nav-group-header { display: none; }
.sidebar.is-collapsed .nav-group-items { max-height: none !important; overflow: visible; }
.sidebar.is-collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  margin: 1px 6px;
  border-radius: 6px;
}
.sidebar.is-collapsed .nav-item > :not(span) { display: none; }
.sidebar.is-collapsed .nav-item { font-size: 0; position: relative; }      /* hide label text */
.sidebar.is-collapsed .nav-item span { font-size: 17px; }
.sidebar.is-collapsed .sidebar-footer .btn-logout { font-size: 0; padding: 8px; }
.sidebar.is-collapsed .sidebar-footer .btn-logout::before { content: '⏻'; font-size: 16px; }

/* Floating tooltip element — rendered on the body by JS so the sidebar's
   overflow:hidden can't clip it. See sidebarTooltip* helpers in dashboard.js */
.mm-side-tip {
  position: fixed;
  pointer-events: none;
  background: #1a1a2e;
  color: var(--gold);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid rgba(212,175,55,0.45);
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
  z-index: 9999;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.13s ease, transform 0.13s ease;
}
.mm-side-tip.visible {
  opacity: 1;
  transform: translateX(0);
}
.mm-side-tip::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid rgba(212,175,55,0.45);
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.sidebar-logo { font-size: 28px; }
.sidebar-hotel { font-size: 13px; font-weight: 700; color: var(--gold); }
.sidebar-role  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sidebar-header > div { display: flex; flex-direction: column; align-items: center; }

.sidebar-nav { flex: 1; padding: 8px 8px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.nav-group { font-size: 9px; font-weight: 700; letter-spacing: 0.12em; color: #444466; text-transform: uppercase; padding: 10px 12px 4px; margin-top: 4px; }

/* Collapsible nav sections (FRONT OFFICE / RESTAURANT / FINANCE / etc.) */
.nav-section { margin-top: 4px; }
.nav-group-header {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 12px 6px; margin: 0;
  background: transparent; border: 0; cursor: pointer;
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
  color: #444466; text-transform: uppercase; text-align: left;
  transition: color .15s;
}
.nav-group-header:hover { color: var(--gold); }
.nav-chevron {
  display: inline-block; font-size: 10px; color: #666688;
  transition: transform .18s ease;
}
.nav-section.collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-group-items {
  display: flex; flex-direction: column; gap: 1px;
  overflow: hidden; max-height: 800px;
  transition: max-height .22s ease;
}
.nav-section.collapsed .nav-group-items { max-height: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--muted); cursor: pointer;
  text-decoration: none; font-size: 13px;
  transition: background .15s, color .15s;
  user-select: none;
}
.nav-item:hover  { background: rgba(255,255,255,.06); color: var(--text); }
.nav-item.active { background: rgba(212,175,55,.15); color: var(--gold); font-weight: 600; }
.nav-item span   { font-size: 15px; }

/* Reload spinner used in Dashboard "Today's Activity" card and similar empty states */
.spinner-arrow {
  display: inline-block; font-size: 28px; color: var(--gold);
  animation: spin 1.4s linear infinite;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }

/* ── Main content ─────────────────────────────────────────── */
.main-content { flex: 1; overflow-y: auto; padding: 28px; background: var(--bg); }

.page { display: none; }
.page.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 700; color: var(--text); }

/* ── Stats grid ───────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat-icon { font-size: 26px; margin-bottom: 8px; }
.stat-num  { font-size: 28px; font-weight: 700; color: var(--gold); }
.stat-lbl  { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-title { font-size: 13px; font-weight: 600; color: var(--gold); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Form card ────────────────────────────────────────────── */
.form-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 780px;
}
.form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.form-row .form-group { margin-bottom: 0; flex: 1 1 0; min-width: 0; }
.form-group { margin-bottom: 16px; }
.form-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; justify-content: flex-start; }
.total-display { font-size: 14px; color: var(--gold); font-weight: 600; }

/* ── Check-In page wider card + 4/2-col rows + section labels ── */
.ci-card { max-width: 1280px; padding: 22px 26px; }
.form-row-4 .form-group { flex: 1 1 25%; }
.form-row-2 .form-group { flex: 1 1 50%; max-width: 50%; }
.section-label {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold);
  margin: 4px 0 14px;
}
.section-divider {
  height: 1px; background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
  margin: 22px 0 18px;
}
.req-mark { color: #f87171; font-weight: 700; margin-right: 2px; }
.opt-tag { font-size: 0.66rem; color: var(--muted); font-weight: 400; margin-left: 2px; }

/* ── Kill number-input spinners ── */
input.no-spin::-webkit-outer-spin-button,
input.no-spin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.no-spin { -moz-appearance: textfield; appearance: textfield; }

/* ── Generic data table (Dashboard Occupied Rooms / Today's Activity etc.) ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: auto;
}
.data-table thead th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 9px 10px 7px;
  border-bottom: 1px solid var(--border);
  background: rgba(212,175,55,0.06);
}
.data-table tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: rgba(255,255,255,0.025); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Bordered variant — table MERGES with parent .card (no nested-box look).
   Internal grid lines visible; outer border is the parent card's border only. */
.data-table-bordered {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin-top: 0;
}
.data-table-bordered thead th {
  background: rgba(212,175,55,0.10);
  border-bottom: 1px solid rgba(212,175,55,0.30);
}
.data-table-bordered thead th + th,
.data-table-bordered tbody td + td { border-left: 1px solid rgba(212,175,55,0.20); }
.data-table-bordered tbody td { border-bottom: 1px solid rgba(212,175,55,0.14); }
.data-table-bordered tbody tr:last-child td { border-bottom: none; }
.data-table-bordered thead th + th { border-left: 1px solid rgba(212,175,55,0.30); }
.data-table-bordered .cell-serial { color: var(--muted); font-weight: 500; text-align: center; font-size: 0.78rem; }
.data-table-bordered .cell-name { color: var(--gold); font-weight: 600; }
.data-table-bordered .cell-type { color: #c7d2fe; }
.data-table-bordered .cell-date { color: #fbbf24; font-weight: 500; }
/* Dashboard cards: title sits at the very top, table fills the rest edge-to-edge.
   No gap, no inner padding around the table, table flush to card borders. */
.two-col .card {
  border: 1px solid rgba(212,175,55,0.40);
  padding: 0;                    /* kill the card's own padding */
  overflow: hidden;
}
.two-col .card .card-title {
  margin: 0;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(212,175,55,0.30);
  background: rgba(212,175,55,0.10);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.two-col .card .data-table { margin: 0; }
.two-col .card .data-table thead th:first-child,
.two-col .card .data-table tbody td:first-child { padding-left: 14px; }
.two-col .card .data-table thead th:last-child,
.two-col .card .data-table tbody td:last-child { padding-right: 14px; }
.two-col .card .empty-state { padding: 24px 16px; }
/* The wrapper #occupied-list / #activity-list keeps the .list-placeholder
   class even after the table is rendered into it. Kill that padding so the
   table sits flush right under the title. */
.two-col .card #occupied-list,
.two-col .card #activity-list,
.two-col .card .list-placeholder { padding: 0; }
.two-col .card #occupied-list:empty,
.two-col .card #activity-list:empty { padding: 24px 16px; text-align: center; color: var(--muted); }
/* Floor sub-header rows — DARKER background for clear visual separation */
.data-table .floor-header td {
  background: rgba(0,0,0,0.55);
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 8px 18px;
  text-align: left;
  border-top: 1px solid rgba(212,175,55,0.35);
  border-bottom: 1px solid rgba(212,175,55,0.35);
}

/* Use full card width — kill the parent .two-col gap waste on the dashboard */
.two-col { gap: 14px; }
.two-col .card { padding: 16px 18px; }
.two-col .card .data-table { margin-top: 8px; }

/* ── Activity Detail Modal (opens on Today's Activity row click) ── */
.adm-modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; }
.adm-modal.hidden { display: none; }
.adm-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); }
.adm-panel {
  position: relative; z-index: 1;
  width: min(820px, 92vw);
  max-height: 88vh;
  background: var(--bg2);
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  display: flex; flex-direction: column;
}
.adm-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: rgba(212,175,55,0.08);
  border-radius: 12px 12px 0 0;
}
.adm-title { font-size: 0.95rem; font-weight: 700; color: var(--gold); letter-spacing: 0.06em; }
.adm-body  { padding: 16px 20px; overflow-y: auto; }
.adm-foot  { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 14px; align-items: center; }
.adm-section-title {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold);
  margin: 12px 0 8px;
}
.adm-section-title:first-child { margin-top: 0; }
.adm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px; }
.adm-grid-full { grid-template-columns: 1fr; }
.adm-field { display: flex; flex-direction: column; gap: 4px; }
.adm-field label { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.adm-field input { background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text); padding: 7px 9px; border-radius: 6px; font-size: 0.84rem; }
.adm-field input:focus { border-color: var(--gold); outline: none; }
.adm-readonly { padding: 7px 9px; border: 1px dashed rgba(255,255,255,0.10); border-radius: 6px; font-size: 0.84rem; color: var(--muted); background: rgba(0,0,0,0.15); }
.activity-table-clickable tbody tr { cursor: pointer; transition: background .12s; }
.activity-table-clickable tbody tr:hover { background: rgba(212,175,55,0.08); }

/* ── Inline Invoice Overlay (replaces popup window) ── */
.invoice-overlay {
  position: fixed; inset: 0;
  background: #ffffff;
  z-index: 9999;
  overflow: auto;
  color: #000;
}
.invoice-overlay.hidden { display: none; }
.invoice-overlay-bar {
  position: sticky; top: 0; z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px 14px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  -webkit-app-region: drag;             /* allow dragging the window from this bar */
}
.invoice-overlay-actions {
  grid-column: 2;
  display: flex;
  gap: 12px;
  -webkit-app-region: no-drag;
}
.invoice-overlay-winctrls {
  grid-column: 3;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  -webkit-app-region: no-drag;
}
.invoice-overlay-winctrls button {
  width: 36px; height: 30px;
  border: none; background: transparent;
  color: #6b7280; font-size: 14px;
  border-radius: 5px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.invoice-overlay-winctrls button:hover { background: rgba(0,0,0,0.06); color: #1f2937; }
.invoice-overlay-winctrls .invoice-overlay-winclose:hover { background: #c0392b; color: #ffffff; }

/* Both overlay buttons are exactly the same size — only colors differ.
   Cursor + click area covers the FULL box (BB hover-only-at-bottom bug fix). */
.invoice-overlay-btn {
  height: 44px;
  min-width: 160px;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: filter .15s, background .15s, border-color .15s;
  font-family: inherit;
  user-select: none;
  -webkit-app-region: no-drag;
}
.invoice-overlay-btn:hover { cursor: pointer; }
.invoice-overlay-btn-primary {
  background: linear-gradient(135deg, #d4af37, #b89020);
  color: #ffffff;
}
.invoice-overlay-btn-primary:hover { filter: brightness(1.08); }
.invoice-overlay-btn-secondary {
  background: #ffffff;
  color: #1f2937;
  border-color: #d1d5db;
}
.invoice-overlay-btn-secondary:hover { background: #f3f4f6; border-color: #9ca3af; }
.invoice-overlay .invoice-body { padding: 14px 16px 24px; }
.invoice-overlay .invoice { color: #000; }

/* When the overlay is open, hide the rest of the app from the printer */
@media print {
  body.printing-invoice > * { display: none !important; }
  body.printing-invoice .invoice-overlay { display: block !important; position: static !important; }
  body.printing-invoice .invoice-overlay-bar { display: none !important; }
  body.printing-invoice .no-print { display: none !important; }
  body.printing-invoice .invoice-body { padding: 0 !important; }
  @page { size: A4 portrait; margin: 8mm 10mm; }
}

/* Compact stats — half-height variant for pages that need form room below */
.stats-grid-compact { gap: 10px; }
.stats-grid-compact .stat-card {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.stats-grid-compact .stat-icon { font-size: 20px; flex: 0 0 auto; }
.stats-grid-compact .stat-num  { font-size: 18px; font-weight: 700; }
.stats-grid-compact .stat-lbl  { font-size: 0.68rem; letter-spacing: 0.05em; }

/* ── Rooms grid ───────────────────────────────────────────── */
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 12px; }
.room-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  transition: border-color .2s;
}
.room-card.occupied { border-color: #ef444455; background: rgba(239,68,68,.08); }
.room-card.vacant   { border-color: #22c55e55; background: rgba(34,197,94,.05); }
.room-num    { font-size: 18px; font-weight: 700; color: var(--text); }
.room-status { font-size: 11px; margin-top: 4px; color: var(--muted); }

/* ── Room rows ────────────────────────────────────────────── */
.room-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.room-row:last-child { border-bottom: none; }
.room-badge {
  background: rgba(212,175,55,.2);
  color: var(--gold);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  min-width: 48px;
  text-align: center;
}
.muted { color: var(--muted); font-size: 12px; }

/* ── Tabs ─────────────────────────────────────────────────── */
.tab-bar { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab {
  background: none; border: none; padding: 10px 18px;
  color: var(--muted); cursor: pointer; font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .2s, border-color .2s; font-family: var(--font);
}
.tab:hover  { color: var(--text); }
.tab.active { color: var(--gold); border-color: var(--gold); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Empty state & list placeholder ──────────────────────── */
.empty-state, .list-placeholder {
  text-align: center; padding: 32px; color: var(--muted); font-size: 13px; line-height: 1.7;
}

/* ── Brain (AI) ───────────────────────────────────────────── */
.brain-ask-bar { display: flex; gap: 12px; margin-bottom: 20px; }
.brain-ask-bar input { flex: 1; }
.brain-answer { background: rgba(212,175,55,.08); border: 1px solid rgba(212,175,55,.3); border-radius: 10px; padding: 16px; margin-bottom: 20px; font-size: 14px; line-height: 1.6; }
.brain-report { display: flex; flex-direction: column; gap: 16px; }
.brain-score { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 20px; }
.score-circle { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; flex-shrink: 0; }
.score-circle.green  { background: rgba(34,197,94,.2); color: #4ade80; border: 2px solid #22c55e; }
.score-circle.yellow { background: rgba(234,179,8,.2); color: #fde047; border: 2px solid #eab308; }
.score-circle.red    { background: rgba(239,68,68,.2); color: #f87171; border: 2px solid #ef4444; }
.score-label { font-weight: 700; font-size: 16px; }
.score-sub   { color: var(--muted); font-size: 12px; margin-top: 4px; }
.brain-section { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.brain-section ul { padding-left: 18px; color: var(--text); line-height: 1.9; font-size: 13px; }
.brain-md { background: var(--bg2); border: 1px solid rgba(212,175,55,.3); border-radius: var(--radius); padding: 18px; }
.brain-md p { color: var(--text); line-height: 1.7; font-size: 14px; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Input type=date/month fix ────────────────────────────── */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator { filter: invert(0.6); cursor: pointer; }

/* ══ Checkout — compact guest summary card + collapsed detail group ══ */
.co-summary-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 22px;
  padding: 14px 18px;
  margin: 6px 0 14px;
  background: rgba(212,175,55,0.06);
  border: 1px solid rgba(212,175,55,0.30);
  border-radius: 10px;
}
.co-summary-card .co-sum-row {
  display: flex; flex-direction: column; gap: 2px;
}
.co-summary-card .co-sum-lbl {
  font-size: 0.65rem;
  letter-spacing: 0.10em;
  color: var(--muted);
  text-transform: uppercase;
}
.co-summary-card .co-sum-val {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.co-summary-card .co-sum-val.is-text {
  color: var(--text);
}
.co-detail-toggle {
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px 14px 4px;
  margin-bottom: 14px;
}
.co-detail-toggle > summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding: 4px 0;
  user-select: none;
  list-style: none;
}
.co-detail-toggle > summary::-webkit-details-marker { display: none; }
.co-detail-toggle > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  color: var(--gold);
  transition: transform 0.18s ease;
}
.co-detail-toggle[open] > summary::before { transform: rotate(90deg); }
.co-detail-toggle[open] > summary { color: var(--gold); }

/* ══ Error dialog — modal that does NOT auto-dismiss ══════════════ */
.mm-err-dialog {
  position: fixed; inset: 0; z-index: 11000;
  display: flex; align-items: center; justify-content: center;
  animation: mmErrFade 0.18s ease-out;
}
.mm-err-backdrop {
  position: absolute; inset: 0;
  background: rgba(8,8,18,0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
/* Soft validation modal — calm amber tone, no red blink */
.mm-err-panel {
  position: relative; z-index: 1;
  width: min(380px, 90vw);
  background: #1a1a2a;
  border: 1px solid rgba(212,175,55,0.28);
  border-radius: 14px;
  box-shadow: 0 14px 38px rgba(0,0,0,0.42);
  padding: 22px 22px 18px;
  text-align: center;
  animation: mmErrSlide 0.22s ease-out;
}
.mm-err-icon {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 10px;
  display: inline-block;
  opacity: 0.9;
}
.mm-err-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #d4af37;
  letter-spacing: 0.01em;
  margin: 0 0 12px;
}
.mm-err-msg {
  font-size: 0.82rem;
  color: #d8d8e0;
  line-height: 1.5;
  margin: 0 0 14px;
}
.mm-err-list {
  text-align: left;
  list-style: none;
  padding: 10px 14px;
  margin: 4px 0 16px;
  background: rgba(212,175,55,0.04);
  border: 1px solid rgba(212,175,55,0.14);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.mm-err-list li {
  font-size: 0.8rem;
  color: #d8d8e0;
  padding: 5px 0 5px 22px;
  position: relative;
}
.mm-err-list li::before {
  content: '•';
  position: absolute;
  left: 8px;
  color: #d4af37;
  font-weight: 600;
  opacity: 0.75;
}
.mm-err-foot {
  display: flex; justify-content: center; margin-top: 4px;
}
.mm-err-ok {
  background: transparent;
  color: #d4af37;
  border: 1px solid rgba(212,175,55,0.45);
  border-radius: 8px;
  padding: 8px 24px;
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.mm-err-ok:hover  { background: rgba(212,175,55,0.1); border-color: #d4af37; }
.mm-err-ok:focus  { outline: none; box-shadow: 0 0 0 2px rgba(212,175,55,0.28); }
.mm-err-ok:active { background: rgba(212,175,55,0.18); }

@keyframes mmErrFade  { from { opacity: 0; }                          to { opacity: 1; } }
@keyframes mmErrSlide { from { opacity: 0; transform: translateY(-12px) scale(0.97); } to { opacity: 1; transform: none; } }

/* ── City autocomplete dropdown — capped at ~10 visible rows ─ */
.city-ac-dropdown {
  position: absolute;
  z-index: 9999;
  top: 100%; left: 0; right: 0;
  background: #1a1a2e;
  border: 1px solid #d4af37;
  border-radius: 8px;
  max-height: 360px;          /* ~10 items × 36px */
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.7);
  margin-top: 2px;
}
.city-ac-dropdown .city-ac-item {
  padding: 9px 14px;
  font-size: 0.82rem;
  color: #e8e8f0;
  cursor: pointer;
  border-bottom: 1px solid rgba(212,175,55,0.10);
}
.city-ac-dropdown .city-ac-item:last-child { border-bottom: none; }
.city-ac-dropdown .city-ac-item:hover,
.city-ac-dropdown .city-ac-item.active { background: rgba(212,175,55,0.18); color: #fbbf24; }
.city-ac-dropdown .city-ac-empty {
  padding: 10px 14px;
  font-size: 0.78rem;
  color: #888;
  font-style: italic;
}

/* ══ Dashboard tweaks (compact stat cards, stacked tables, scroll cap, collapsibles) ══ */

/* 1. Compact stat cards (only on Dashboard #stats-grid) */
#stats-grid { gap: 12px; margin-bottom: 16px; }
#stats-grid .stat-card { padding: 12px 14px; }
#stats-grid .stat-icon { font-size: 20px; margin-bottom: 4px; }
#stats-grid .stat-num  { font-size: 22px; }
#stats-grid .stat-lbl  { font-size: 11px; margin-top: 2px; }

/* 2. Stack the dashboard tables full-width vertically */
.two-col.dashboard-stack { grid-template-columns: 1fr; gap: 14px; }

/* 3. Scroll cap (~10 rows visible) on the two dashboard tables.
   Sticky header so column titles stay put while scrolling. */
.dash-table-scroll { max-height: 580px; overflow-y: auto; }
.dash-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg2);
  box-shadow: 0 1px 0 rgba(212,175,55,0.30);
}

/* 4. Collapsible group headers (Floor 1/2/3 and activity Type) */
.data-table .floor-header { cursor: pointer; user-select: none; }
.data-table .floor-header:hover td { background: rgba(0,0,0,0.65); }
.data-table .floor-header td .floor-toggle {
  display: inline-block;
  margin-right: 10px;
  font-size: 0.85rem;
  transition: transform 0.15s ease;
}
.data-table .floor-header.collapsed td .floor-toggle { transform: rotate(-90deg); }
