/* ── Suryadeep Dental Clinic Reports — Mobile-first CSS ── */
:root {
  --primary: #0077B6;
  --primary-dark: #005F8E;
  --primary-light: #ADE8F4;
  --accent: #A16207; /* warm gold, used sparingly for hospitality warmth (login page only) */
  --green: #15803d;
  --green-bg: #f0fdf4;
  --red: #b91c1c;
  --red-bg: #fef2f2;
  --purple: #7c3aed;
  --bg: #f0f4f8;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 14px;
  --surface-alt: #f1f5f9; /* inset rows: .calc-row, .summary-row, disabled/readonly inputs */
  --input-bg: #f8fafc;
  --primary-bg: #e0f2fe; /* light tint of --primary: section-heading rule, "today" highlights */

  /* Booking status/type color coding — shared by bookingChipColor() (calendar chips,
     booking-card border/badge) and the calendar legend swatches, so all three stay in sync. */
  --status-tentative: #ca8a04; /* unconfirmed / blocked — any type */
  --status-cancelled: #6b7280;
  --status-nightstay: #6b8e23; /* confirmed night-stay — olive */
  --status-dayplan: #8b5a2b;   /* confirmed day-plan — brown */
  --status-custom: #7c3aed;    /* confirmed custom booking — purple */
  --status-checkout: #94a3b8;  /* booking checking out on the viewed day — slate, overrides type color */
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #4DA8DA;
    --primary-dark: #3B8CBF;
    --primary-light: #0B4A6B;
    --accent: #D4A017;
    --green: #4ADE80;
    --green-bg: #113322;
    --red: #F87171;
    --red-bg: #3A1414;
    --purple: #A78BFA;
    --bg: #12161c;
    --card: #1b2129;
    --text: #e5e9f0;
    --text-muted: #94a3b8;
    --border: #2e3844;
    --shadow: 0 2px 12px rgba(0,0,0,0.4);
    --surface-alt: #242b35;
    --input-bg: #1f2530;
    --primary-bg: #17324a;

    --status-tentative: #eab308;
    --status-cancelled: #94a3b8;
    --status-nightstay: #9acd32;
    --status-dayplan: #c08552;
    --status-custom: #A78BFA;
    --status-checkout: #64748b;
  }
}

html { color-scheme: light dark; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* ── Icon system (see icon() in common.js) ── */
.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.icon-loader-circle { animation: icon-spin 0.8s linear infinite; }
@keyframes icon-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .icon-loader-circle { animation: none; }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 72px;
}

/* ── Header ── */
.header {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.header-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-title { font-size: 15px; font-weight: 800; }
.header-sub { font-size: 11px; color: rgba(255,255,255,0.75); margin-top: 1px; }
.header-role {
  font-size: 11px;
  background: rgba(255,255,255,0.2);
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: capitalize;
}

/* Desktop nav */
.desktop-nav { display: none; }
.desktop-nav a, .desktop-nav button {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.2s;
}
.desktop-nav a:hover, .desktop-nav button:hover { background: rgba(255,255,255,0.15); }
.desktop-nav a.active { background: rgba(255,255,255,0.22); font-weight: 700; }

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.07);
}
.nav-item {
  flex: 1 0 64px;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 8px 6px;
  text-decoration: none;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.15s;
  min-height: 56px;
  justify-content: center;
  white-space: nowrap;
}
.nav-item.active { color: var(--primary); }
.nav-icon { font-size: 20px; margin-bottom: 2px; display: block; }

/* ── Main content ── */
.main {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 14px;
}
/* Wide data-table pages (Gamma masters/lists, Add/Edit item-line forms) need more
   room on desktop than the 680px default meant for single-column forms/cards - at
   680px a 6-9 column table gets squeezed so hard that cells like Address wrap into a
   narrow, unreadably tall strip instead of the table just laying out normally. */
@media (min-width: 900px) {
  .main.main-wide { max-width: 1100px; }
}

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

/* ── Summary grid ── */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.summary-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--border);
}
.summary-card.full { grid-column: 1 / -1; }
.summary-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.summary-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}
.summary-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* Color variants */
.sc-green  { border-color: #22c55e; } .sc-green  .summary-value { color: var(--green); }
.sc-red    { border-color: #ef4444; } .sc-red    .summary-value { color: var(--red); }
.sc-blue   { border-color: var(--primary); }
.sc-blue   .summary-value { color: var(--primary); }
.sc-blue   .summary-value.loss { color: var(--red); }
.sc-teal   { border-color: #06b6d4; } .sc-teal   .summary-value { color: #0e7490; }
.sc-purple { border-color: #a78bfa; } .sc-purple .summary-value { color: var(--purple); }
.sc-slate  { border-color: #94a3b8; } .sc-slate  .summary-value { color: #475569; }

/* ── Date range ── */
.date-range-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.date-range-row > div { flex: 1; min-width: 130px; }

/* ── Filter bar (RRW pages) ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-date { max-width: 150px; }
.filter-sep  { font-size: 13px; color: var(--text-muted); white-space: nowrap; }

/* ── Form section & summary row (RRW report form) ── */
.form-section { margin-bottom: 4px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-alt);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.summary-row strong { font-size: 16px; color: var(--text); }

/* .metric — child of .report-metrics (alias for .metric-item) */
.metric { }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
  min-height: 48px;
  white-space: nowrap;
}
.btn:active { opacity: 0.75; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline  { background: #fff; border: 2px solid var(--primary); color: var(--primary); }
.btn-danger   { background: var(--red); color: #fff; }
.btn-gray     { background: #64748b; color: #fff; }
.btn-black    { background: #000;    color: #fff; }
.btn-full     { width: 100%; }
.btn-sm       { padding: 8px 14px; font-size: 13px; min-height: 38px; border-radius: 10px; }

/* ── Forms ── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  -webkit-appearance: none;
}
.form-control:focus { outline: none; border-color: var(--primary); background: var(--card); }
.form-control[readonly] { background: var(--surface-alt); color: var(--text-muted); }
.form-control[disabled] { background: var(--surface-alt); color: var(--text-muted); opacity: 1; }

.rupee-wrap { position: relative; }
.rupee-wrap::before {
  content: '₹';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}
.rupee-wrap .form-control { padding-left: 28px; }

.section-heading {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-bg);
  margin-bottom: 14px;
  margin-top: 4px;
}

/* ── Horizontal category sub-tabs (e.g. rrw-menu.html item list) ── */
.cat-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin-bottom: 4px;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.cat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-alt);
  margin-bottom: 10px;
  font-size: 14px;
}
.calc-row .calc-label { color: var(--text-muted); font-weight: 500; }
.calc-row .calc-value { font-weight: 800; font-size: 16px; }

/* ── Report cards ── */
.report-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  border-left: 4px solid var(--primary);
}
.report-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.report-date { font-size: 15px; font-weight: 700; }
.report-day {
  font-size: 11px;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.report-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.metric-item { }
.metric-label { font-size: 10px; color: var(--text-muted); margin-bottom: 2px; }
.metric-value { font-size: 14px; font-weight: 700; }
.mv-green { color: var(--green); }
.mv-red   { color: var(--red); }
.mv-blue  { color: var(--primary); }
.mv-loss  { color: var(--red); }
.report-patients { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.report-actions { display: flex; gap: 8px; }

/* ── Login ── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(145deg, #0077B6 0%, #023E8A 100%);
}
.login-logo { font-size: 64px; margin-bottom: 8px; text-align: center; }
.login-title { font-size: 22px; font-weight: 900; color: #fff; text-align: center; }
.login-sub { font-size: 13px; color: rgba(255,255,255,0.7); text-align: center; margin-bottom: 28px; }
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 22px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  border-top: 4px solid var(--accent);
}
.login-card h2 { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 20px; }

/* ── Chart ── */
.chart-wrap { position: relative; min-width: 0; }
.chart-wrap canvas { max-width: 100%; }

/* ── Alerts / Toasts ── */
.alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 12px;
}
.alert-error   { background: var(--red-bg);  color: var(--red);  border: 1px solid #fecaca; }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid #bbf7d0; }

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  white-space: nowrap;
  max-width: 90vw;
}
.toast.show { opacity: 1; }
.toast-success { background: var(--green); }
.toast-error   { background: var(--red); }
.toast-info    { background: var(--primary); }

/* ── Settings tabs ── */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 18px;
}
.settings-tab-btn {
  flex: 1 1 auto;
  background: none;
  border: none;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.settings-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(0, 119, 182, 0.08);
}
.settings-panel { display: none; }
.settings-panel.active { display: block; }

@media (max-width: 480px) {
  .settings-tab-btn { flex-basis: 46%; font-size: 11px; padding: 8px 6px; }
}

/* ── Modal ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.show { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
}
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.modal-body  { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .es-icon { font-size: 48px; margin-bottom: 10px; }
.empty-state .es-text { font-size: 15px; margin-bottom: 16px; }

/* ── Loading ── */
.loading { text-align: center; padding: 32px; color: var(--text-muted); font-size: 15px; }

/* ── Rupee format (no spin buttons) ── */
input[type='number'] { -moz-appearance: textfield; }
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── Client picker (home page) ── */
.welcome-text {
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.welcome-text strong { color: var(--text); }

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}
.client-card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px 14px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: left;
  display: flex;
  flex-direction: column;
}
.client-card:hover { border-color: var(--primary); box-shadow: 0 4px 20px rgba(0,119,182,0.15); }
.client-card > .btn { margin-top: auto; }
.client-card-icon { font-size: 26px; margin-bottom: 6px; }
.client-card-icon img { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; display: block; }
.client-card-name { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 2px; line-height: 1.25; }
.client-card-type { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }

.add-client-btn {
  display: block;
  width: 100%;
  max-width: 900px;
  margin: 12px auto 0;
  padding: 15px;
  border: 2px dashed var(--border);
  background: none;
  border-radius: 18px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.add-client-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── Gamma masters (Clients / Projects) table view ──
   Table only fits comfortably at desktop widths - below 640px it either scrolls
   sideways or wraps cells until rows are unreadably tall. So below 640px we render
   .gamma-cards instead (same .report-card pattern used everywhere else in this app),
   and above it we show .gamma-table-wrap. Both are rendered by JS; CSS just picks
   which one is visible, mirroring the .bottom-nav/.desktop-nav breakpoint pattern. */
.gamma-table-wrap { display: none; overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.gamma-cards { display: block; }
@media (min-width: 640px) {
  .gamma-table-wrap { display: block; }
  .gamma-cards { display: none; }
}
.gamma-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.gamma-table th {
  text-align: left; padding: 10px 14px; color: var(--text-muted); font-weight: 700;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.gamma-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: normal; }
.gamma-table tbody tr:hover { background: var(--surface-alt); }
.gamma-table tbody tr:last-child td { border-bottom: none; }

.gamma-card-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.gamma-card-row .label { color: var(--text-muted); }
.gamma-card-badges { display: flex; gap: 6px; margin: 8px 0; }

.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.status-active   { background: var(--green-bg); color: var(--green); }
.status-inactive { background: var(--red-bg); color: var(--red); }
.status-pending  { background: #fff7ed; color: #c2660a; }
.priority-low    { background: var(--surface-alt); color: var(--text-muted); }
.priority-medium { background: #fff7ed; color: #c2660a; }
.priority-high   { background: var(--red-bg); color: var(--red); }

/* ── Business card settings button ── */
.client-card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}
.client-card-header-row .client-card-icon { margin-bottom: 0; }
.biz-settings-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-muted);
  line-height: 1;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s;
}
.biz-settings-btn:hover { background: var(--border); }

/* ── Settings icon in header (business home / dashboard) ── */
.header-settings-btn {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 16px;
  line-height: 1;
  padding: 7px 9px;
  border-radius: 8px;
  margin-left: 4px;
  transition: background 0.15s;
}
.header-settings-btn:hover { background: rgba(255,255,255,0.15); }

/* ── App grid (phone-home-screen style launcher on business dashboards) ── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 6px;
  text-decoration: none;
  color: var(--text);
  min-height: 76px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.app-tile:hover { box-shadow: 0 4px 20px rgba(0,119,182,0.15); transform: translateY(-2px); }
.app-tile-icon { font-size: 26px; line-height: 1; }
.app-tile-icon .icon { width: 26px; height: 26px; vertical-align: middle; }
.app-tile-label { font-size: 11px; font-weight: 600; color: var(--text-muted); line-height: 1.2; }
@media (min-width: 640px) {
  .app-grid { grid-template-columns: repeat(6, 1fr); max-width: 720px; }
}

/* ── Room tiles (night-stay booking room selection) ── */
.room-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.room-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  padding: 12px 6px;
  min-height: 68px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.room-tile:hover { transform: translateY(-2px); }
.room-tile.selected { border-color: var(--primary); background: rgba(0,119,182,0.08); }
.room-tile.disabled { opacity: 0.45; cursor: not-allowed; }
.room-tile-icon { font-size: 22px; line-height: 1; }
.room-tile-label { font-size: 11px; font-weight: 600; color: var(--text-muted); line-height: 1.2; }
.room-tile.selected .room-tile-label { color: var(--primary); }

/* Guest menu-link day tabs - date picker chips get a stronger, more distinct look than
   generic room/meal/addon tiles that also reuse .room-tile. */
.room-tile.day-tab { border-color: rgba(0,119,182,0.35); }
.room-tile.day-tab .room-tile-label { font-size: 14px; font-weight: 700; color: var(--primary); }
.room-tile.day-tab.selected { background: var(--primary); border-color: var(--primary); }
.room-tile.day-tab.selected .room-tile-label { color: #fff; }

.room-tile-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  padding: 1px 5px;
  border-radius: 8px;
}
@media (min-width: 640px) {
  .room-tile-grid { grid-template-columns: repeat(5, 1fr); }
}

.biz-email-badge {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  word-break: break-all;
}
.smtp-badge { color: var(--green); }
.form-label-hint { font-weight: 400; text-transform: none; letter-spacing: 0; }
.tls-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.tls-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ── Users management page ── */
.users-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.users-title { font-size: 18px; font-weight: 800; }
.modal-box-tall {
  max-height: 90vh;
  overflow-y: auto;
}

/* ── Booking Calendar ── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.cal-head {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 8px 2px;
  font-size: 11px;
  font-weight: 700;
}
.cal-cell {
  background: var(--card);
  min-height: 55px;
  padding: 3px;
  vertical-align: top;
}
.cal-cell.other-month { background: var(--bg); }
.cal-cell.today { background: var(--primary-bg); }
.cal-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
  line-height: 1;
}
.cal-cell.today .cal-date { color: var(--primary); }
.bk-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 4px;
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  color: #fff;
  line-height: 1.4;
}
.bk-chip:hover { opacity: 0.82; }
.cal-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-month-label { font-size: 17px; font-weight: 800; }

/* ── Desktop tweaks ── */
@media (min-width: 640px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .desktop-nav { display: flex; align-items: center; gap: 4px; }
  .header-role { display: none; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .summary-card.full { grid-column: auto; }
  .modal-backdrop { align-items: center; }
}

/* ── Print (Export PDF = browser print-to-PDF; keeps the on-screen design, drops chrome) ── */
@page { margin: 14mm 10mm; }
@media print {
  .header, .bottom-nav, .desktop-nav, .app-grid,
  .export-bar, .date-range-row, .filter-bar, .btn,
  .toast, .modal-backdrop, #bookingsFilterSection, .gamma-pagination {
    display: none !important;
  }
  /* Printed paper is always wide enough for the table - force it regardless of the
     screen viewport width the page happened to be at when Export PDF was clicked. */
  .gamma-table-wrap { display: block !important; }
  .gamma-cards { display: none !important; }
  body { padding-bottom: 0; background: #fff; }
  .main { max-width: none; margin: 0; padding: 0; }
  .card, .summary-card, .report-card {
    box-shadow: none;
    border: 1px solid var(--border);
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .summary-grid { grid-template-columns: repeat(3, 1fr) !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Printable-document layout (Gamma Invoice/Proforma Invoice, RRW Invoice) - shared here
   since all three now use it identically; previously duplicated inline per page. */
.pi-doc { max-width: 800px; margin: 0 auto; background: #fff; padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.pi-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--text); padding-bottom: 12px; margin-bottom: 16px; }
.pi-logo img { max-width: 160px; max-height: 70px; object-fit: contain; }
.pi-title { font-size: 22px; font-weight: 800; text-align: center; flex: 1; }
.pi-meta { text-align: right; font-size: 13px; }
.pi-meta strong { font-weight: 700; }
.pi-to { margin-bottom: 16px; font-size: 13px; }
.pi-to .name { font-weight: 800; font-size: 14px; margin: 4px 0 2px; }
.pi-items { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
.pi-items th, .pi-items td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.pi-items th { background: var(--surface-alt); font-weight: 700; text-align: center; }
.pi-items td.num { text-align: right; }
.pi-items tfoot td { font-weight: 800; text-align: right; }
.pi-words { border: 1px solid var(--border); border-top: none; padding: 8px 10px; font-size: 13px; margin-bottom: 16px; }
.pi-gst-boxes { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.pi-gst-box { border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; font-size: 13px; min-width: 140px; }
.pi-gst-box .row { display: flex; justify-content: space-between; padding: 2px 0; }
.pi-gst-box .total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; font-weight: 700; }
.pi-sign { margin-top: 40px; }
.pi-sign img { max-width: 140px; max-height: 60px; object-fit: contain; margin-top: 6px; display: block; }
.pi-auth { margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.pi-auth-tag { color: var(--green); font-weight: 700; margin-bottom: 3px; }
.pi-auth-key { font-family: monospace; color: var(--text); }
.pi-bank { border-top: 1px solid var(--text); margin-top: 24px; padding-top: 12px; font-size: 13px; }
.pi-bank .heading { font-weight: 800; margin-bottom: 6px; }
@media print {
  .pi-doc { box-shadow: none; padding: 0; max-width: none; }
  .pi-actions { display: none !important; }
}
