/* SEOVILLAGE Overview v2 — Linear/Vercel aesthetic */

:root {
  /* Light mode */
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-alt: #F5F5F5;
  --text: #18181B;
  --text-2: #71717A;
  --text-3: #A1A1AA;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --hover: rgba(0, 0, 0, 0.025);

  --pos: #16A34A;
  --pos-bg: rgba(22, 163, 74, 0.10);
  --neg: #DC2626;
  --neg-bg: rgba(220, 38, 38, 0.10);
  --warn: #D97706;
  --warn-bg: rgba(217, 119, 6, 0.10);
  --info: #2563EB;
  --info-bg: rgba(37, 99, 235, 0.10);

  --chart-1: #0D9488; /* teal */
  --chart-2: #2563EB; /* blue */
  --chart-3: #D97706; /* amber */
  --chart-4: #71717A; /* gray */
  --chart-5: #C7C7CC; /* light gray (padel placeholder) */

  --radius-card: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;

  --gap-card: 12px;
  --gap-section: 16px;
  --pad-card: 18px;

  --tooltip-bg: rgba(24, 24, 27, 0.96);
  --tooltip-text: #FAFAFA;
}

[data-theme="dark"] {
  --bg: #0E0E10;
  --surface: #18181B;
  --surface-alt: #1F1F23;
  --text: #FAFAFA;
  --text-2: #A1A1AA;
  --text-3: #71717A;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --hover: rgba(255, 255, 255, 0.04);

  --pos: #4ADE80;
  --pos-bg: rgba(74, 222, 128, 0.12);
  --neg: #F87171;
  --neg-bg: rgba(248, 113, 113, 0.12);
  --warn: #FBBF24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --info: #60A5FA;
  --info-bg: rgba(96, 165, 250, 0.12);

  --chart-1: #2DD4BF;
  --chart-2: #60A5FA;
  --chart-3: #FBBF24;
  --chart-4: #A1A1AA;
  --chart-5: #3F3F46;

  --tooltip-bg: rgba(250, 250, 250, 0.96);
  --tooltip-text: #18181B;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
input, select { font-family: inherit; }

/* ---------- Layout ---------- */
.page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 64px;
}
.section { margin-top: var(--gap-section); }
.row-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap-card); }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-card); }
.row-2-60-40 { display: grid; grid-template-columns: 60% 1fr; gap: var(--gap-card); }
.flex { display: flex; }
.between { justify-content: space-between; }
.center-y { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ---------- TopBar (Level 0) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 56px;
  margin: 0 -24px 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.tb-logo {
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.tb-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}
.tb-tabs {
  display: flex;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tb-tabs::-webkit-scrollbar { display: none; }
.tb-tab {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  white-space: nowrap;
  transition: background 80ms, color 80ms;
}
.tb-tab:hover { background: var(--hover); color: var(--text); }
.tb-tab.active {
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 500;
}
.tb-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tb-select {
  height: 32px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tb-select:hover { background: var(--hover); }
.dropdown-wrap {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  padding: 4px;
  z-index: 1000;
}
.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  text-align: left;
}
.dropdown-item:hover,
.dropdown-item.active {
  background: var(--hover);
}
.dropdown-item.selected {
  color: var(--text);
}
.dropdown-item.disabled {
  color: var(--text-3);
  cursor: not-allowed;
}
.dropdown-item.disabled:hover,
.dropdown-item.disabled.active {
  background: transparent;
}
.dropdown-check {
  color: var(--info);
  display: inline-flex;
  width: 14px;
  flex-shrink: 0;
}
.dropdown-check.empty {
  color: transparent;
}
.dropdown-hint {
  color: var(--text-3);
  font-size: 11px;
  margin-left: auto;
}
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.tb-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  padding: 0 6px;
}
.tb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

/* ---------- Card base ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--pad-card);
  position: relative;
}
.card.clickable { cursor: pointer; transition: background 80ms; }
.card.clickable:hover { background: var(--hover); }

[data-density="compact"] { --pad-card: 14px; --gap-card: 10px; --gap-section: 12px; }
[data-density="comfy"] { --pad-card: 22px; --gap-card: 14px; --gap-section: 20px; }

/* ---------- Pulse strip (Level 1) ---------- */
.pulse {
  display: flex;
  align-items: center;
  height: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0 18px;
  gap: 0;
}
.pulse-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  white-space: nowrap;
  position: relative;
}
.pulse-item:first-child { padding-left: 0; }
.pulse-item + .pulse-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 16px;
  background: var(--border);
}
.pulse-strip-element-clickable {
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 80ms ease;
}
.pulse-item.pulse-strip-element-clickable {
  padding: 8px 12px;
}
.pulse-item.pulse-strip-element-clickable:first-child {
  padding-left: 12px;
  margin-left: -12px;
}
.pulse-strip-element-clickable:hover {
  background: var(--hover);
}
.pulse-strip-element-clickable:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}
.pulse-icon { color: var(--text-3); display: inline-flex; }
.pulse-lbl { color: var(--text-2); font-size: 13px; }
.pulse-val { color: var(--text); font-weight: 500; font-size: 13px; }
.pulse-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--neg);
  color: white;
  font-size: 11px;
  font-weight: 500;
  padding: 0 5px;
  margin-left: 4px;
}

/* ---------- Hero metric cards (Level 2) ---------- */
.hero {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hero-lbl {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.hero-num {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
}
.hero-num-sub {
  font-size: 14px;
  color: var(--text-3);
  font-weight: 400;
}
.hero-secondary {
  font-size: 12px;
  color: var(--text-3);
  margin-top: -2px;
}
.hero-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.hero-spark {
  margin-top: auto;
  height: 24px;
  display: block;
  width: 100%;
}
.hero-alert-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--neg);
}

/* ---------- Compact top metrics deck ---------- */
.overview-metrics-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: var(--gap-card);
  align-items: stretch;
}
.overview-kpi-stack {
  display: grid;
  gap: var(--gap-card);
  min-width: 0;
}
.overview-metrics-top .hero,
.overview-metrics-top .mk-card {
  min-height: 104px;
  padding: 14px 16px;
  gap: 4px;
}
.overview-metrics-top .hero-lbl {
  font-size: 10px;
  letter-spacing: 0.07em;
}
.overview-metrics-top .hero-num {
  font-size: 23px;
  margin-top: 0;
}
.overview-metrics-top .mk-card .hero-num {
  font-size: 21px !important;
}
.overview-metrics-top .hero-num-sub {
  font-size: 13px;
}
.overview-metrics-top .hero-foot {
  gap: 5px;
  font-size: 11px;
  flex-wrap: wrap;
}
.overview-metrics-top .delta,
.overview-metrics-top .delta-cmp {
  font-size: 11px;
}
.overview-metrics-top .hero-secondary {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.overview-metrics-top .hero-spark {
  height: 18px;
}
.overview-metrics-top > .card[data-screen-label="09 Loyalty"] {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 16px;
}
.overview-metrics-top > .card[data-screen-label="09 Loyalty"] .card-head {
  margin-bottom: 8px;
}
.overview-metrics-top > .card[data-screen-label="09 Loyalty"] .loy-row {
  flex: 1;
  padding: 10px 0;
}
.overview-metrics-top > .card[data-screen-label="09 Loyalty"] .loy-lbl {
  font-size: 10px;
  margin-bottom: 2px;
}
.overview-metrics-top > .card[data-screen-label="09 Loyalty"] .loy-val {
  font-size: 20px;
}
.overview-metrics-top > .card[data-screen-label="09 Loyalty"] .loy-mini {
  font-size: 10px;
}

/* ---------- Delta ---------- */
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 500;
  font-feature-settings: 'tnum';
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}
.delta.pos { color: var(--pos); background: var(--pos-bg); }
.delta.neg { color: var(--neg); background: var(--neg-bg); }
.delta.warn { color: var(--warn); background: var(--warn-bg); }
.delta.flat { color: var(--text-3); background: var(--surface-alt); }
.delta-cmp { color: var(--text-3); font-size: 12px; font-weight: 400; }

/* ---------- Section title ---------- */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-title { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.card-sub { font-size: 12px; color: var(--text-3); font-weight: 400; }
.card-mix { font-size: 12px; color: var(--text-2); }
.card-mix .mix-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* ---------- Stacked area chart ---------- */
.chart-svg { width: 100%; display: block; }
.chart-legend { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.legend-sw { width: 10px; height: 10px; border-radius: 2px; }
.legend-item.muted { opacity: 0.45; }
.legend-item.muted .legend-pad-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-3);
  border: 1px solid var(--border);
  margin-left: 4px;
}

/* ---------- Heatmap (occupancy) ---------- */
.heatmap-card { overflow: visible; }
.hm-wrap {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.hm-grid-wrap {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.hm-grid-wrap::-webkit-scrollbar { height: 6px; }
.hm-grid-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.hm-grid-panel {
  position: relative;
  min-width: calc(120px + 30 * 42px + 29 * 3px);
}
.hm-grid {
  --hm-label-width: 120px;
  display: grid;
  grid-template-columns: var(--hm-label-width) repeat(30, 42px);
  gap: 3px;
  align-items: stretch;
  position: relative;
}
.hm-row-label {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding-right: 10px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 6;
  background: var(--surface);
  box-shadow: 10px 0 14px -16px rgba(0, 0, 0, 0.45);
}
.hm-header-label {
  min-height: 16px;
  z-index: 7;
}
.hm-header-cell {
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  color: var(--text-2);
  font-feature-settings: 'tnum';
  border-radius: var(--radius-xs);
  white-space: nowrap;
  overflow: hidden;
}
.hm-header-cell.weekend {
  color: var(--text-3);
  background: color-mix(in srgb, var(--surface-alt) 72%, transparent);
}
.hm-header-cell.today {
  color: var(--info);
  font-weight: 500;
}
.hm-day-num {
  min-height: 24px;
  flex-direction: row;
  gap: 2px;
  font-size: 11px;
}
.hm-day-num small {
  display: inline;
  font-size: 8.5px;
  line-height: inherit;
  color: var(--text-3);
  text-transform: uppercase;
}
.hm-cell {
  height: 40px;
  border-radius: var(--radius-xs);
  background: var(--surface-alt);
  position: relative;
  cursor: pointer;
  transition: transform 60ms, border-color 60ms, box-shadow 60ms;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  overflow: hidden;
  color: var(--text-2);
}
.hm-cell:hover {
  transform: scale(1.05);
  border-color: var(--info);
  z-index: 3;
}
.hm-cell.weekend {
  background: color-mix(in srgb, var(--surface-alt) 74%, var(--surface));
}
.hm-cell.occupied {
  background: color-mix(in srgb, var(--chart-1) 16%, var(--surface));
  color: var(--text);
}
.hm-cell.confirmed {
  background: color-mix(in srgb, var(--chart-1) 30%, var(--surface));
}
.hm-cell.in_house {
  background: var(--chart-1);
  color: var(--surface);
}
.hm-cell.checked_out {
  background: color-mix(in srgb, var(--chart-1) 14%, var(--surface));
  color: var(--text-2);
}
.hm-cell.blocked {
  color: var(--text-3);
  background:
    repeating-linear-gradient(135deg, transparent 0, transparent 5px, color-mix(in srgb, var(--text-3) 28%, transparent) 5px, color-mix(in srgb, var(--text-3) 28%, transparent) 7px),
    var(--surface-alt);
}
.hm-cell.today {
  outline: 2px solid var(--info);
  outline-offset: -2px;
}
.hm-cell-initials {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  max-width: 100%;
}
.hm-cell-rate {
  font-size: 9px;
  line-height: 1;
  opacity: 0.8;
  max-width: 100%;
}
.hm-payment-dot {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 1px solid var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent);
}
.hm-payment-dot.paid { background: var(--pos); }
.hm-payment-dot.partial { background: var(--warn); }
.hm-payment-dot.unpaid { background: var(--neg); }
.hm-payment-dot.hold { background: var(--info); }
.hm-cell-blocked {
  font-size: 12px;
  line-height: 1;
}
.hm-arrival-marker,
.hm-departure-marker {
  position: absolute;
  top: 2px;
  width: 0;
  height: 0;
  border-style: solid;
  z-index: 2;
}
.hm-arrival-marker {
  left: 2px;
  border-width: 6px 6px 0 0;
  border-color: var(--chart-3) transparent transparent transparent;
}
.hm-departure-marker {
  right: 2px;
  border-width: 6px 0 0 6px;
  border-color: var(--chart-3) transparent transparent transparent;
}
.hm-today-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--info);
  opacity: 0.45;
  pointer-events: none;
  z-index: 4;
  border-radius: 999px;
}
.hm-tooltip {
  position: fixed;
  background: var(--text);
  color: var(--surface);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  max-width: 280px;
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%);
  transition: opacity 100ms;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
}
.hm-tooltip.visible { opacity: 1; }
.hm-tooltip.below { transform: translate(-50%, 0); }
.hm-tooltip-arrow {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--text);
  transform: rotate(45deg);
  bottom: -4px;
  left: 50%;
  margin-left: -4px;
}
.hm-tooltip.below .hm-tooltip-arrow {
  top: -4px;
  bottom: auto;
}
.hm-tooltip-title {
  font-weight: 500;
  margin-bottom: 6px;
}
.hm-tooltip-sep {
  height: 1px;
  background: color-mix(in srgb, var(--surface) 22%, transparent);
  margin: 6px 0;
}
.hm-tooltip-muted {
  color: color-mix(in srgb, var(--surface) 76%, transparent);
  margin-top: 2px;
}
.hm-tooltip-event {
  color: var(--surface);
  margin-top: 6px;
  font-weight: 500;
}
.hm-tooltip-note {
  margin-top: 8px;
  color: color-mix(in srgb, var(--surface) 86%, transparent);
}
.hm-tooltip-payment {
  margin-top: 4px;
  font-weight: 500;
}
.hm-tooltip-payment.paid { color: color-mix(in srgb, var(--pos) 75%, var(--surface)); }
.hm-tooltip-payment.partial,
.hm-tooltip-payment.hold { color: color-mix(in srgb, var(--warn) 72%, var(--surface)); }
.hm-tooltip-payment.unpaid { color: color-mix(in srgb, var(--neg) 72%, var(--surface)); }
.hm-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-2);
  flex-wrap: wrap;
}
.hm-legend-header {
  margin-top: 0;
  justify-content: flex-end;
}
.hm-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.hm-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}
.hm-legend-swatch.empty {
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.hm-legend-swatch.booked { background: color-mix(in srgb, var(--chart-1) 30%, var(--surface)); }
.hm-legend-swatch.in-house { background: var(--chart-1); }
.hm-legend-swatch.marker {
  background: transparent;
}
.hm-legend-swatch.marker::before {
  content: '';
  position: absolute;
  top: 1px;
  right: 1px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 7px 7px 0;
  border-color: transparent var(--chart-3) transparent transparent;
}
.hm-legend-swatch.payment {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pos) 0 33%, var(--warn) 33% 66%, var(--neg) 66% 100%);
}

.hm-drawer-body {
  display: grid;
  gap: 16px;
}
.hm-drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.hm-drawer-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface);
}
.hm-drawer-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  font-weight: 500;
}
.hm-drawer-stat.payment.paid strong { color: var(--pos); }
.hm-drawer-stat.payment.partial strong,
.hm-drawer-stat.payment.hold strong { color: var(--warn); }
.hm-drawer-stat.payment.unpaid strong { color: var(--neg); }
.hm-drawer-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.hm-drawer-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  font-size: 13px;
}
.hm-drawer-row span {
  color: var(--text-2);
}
.hm-drawer-row strong {
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}
.hm-drawer-note {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--info) 8%, var(--surface));
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.hm-drawer-note.muted {
  background: var(--surface-alt);
  color: var(--text-2);
}
.hm-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}
.hm-drawer-empty-state {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}
.hm-drawer-empty-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 6px;
}

/* ---------- Marketing strip (Level 4) ---------- */
.mk-card {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- Pace table (Level 5) ---------- */
.pace-row {
  display: grid;
  grid-template-columns: 130px 1fr 140px;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.pace-row:first-of-type { border-top: 0; }
.pace-row:hover { background: var(--hover); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: var(--radius-xs); }
.pace-label { font-size: 13px; color: var(--text); }
.pace-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pace-bar {
  flex: 1;
  height: 8px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
}
.pace-bar-fill {
  height: 100%;
  border-radius: 999px;
}
.pace-bar-fill.green { background: var(--pos); }
.pace-bar-fill.lgreen { background: rgba(22, 163, 74, 0.5); }
[data-theme="dark"] .pace-bar-fill.lgreen { background: rgba(74, 222, 128, 0.5); }
.pace-bar-fill.amber { background: var(--warn); }
.pace-bar-fill.red { background: var(--neg); }
.pace-num {
  font-size: 13px;
  font-feature-settings: 'tnum';
  color: var(--text-2);
  white-space: nowrap;
}
.pace-num strong { color: var(--text); font-weight: 500; }
.pace-cmp { text-align: right; font-size: 12px; }

/* ---------- Loyalty card ---------- */
.loy-row {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: flex-end;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  text-align: left;
  border-radius: var(--radius-xs);
}
.loy-row:first-of-type { border-top: 0; padding-top: 0; }
.loy-row:last-of-type { padding-bottom: 0; }
.loy-row.clickable {
  cursor: pointer;
  transition: background 80ms, padding 80ms, margin 80ms;
}
.loy-row.clickable:hover {
  background: var(--hover);
  margin-left: -8px;
  margin-right: -8px;
  padding-left: 8px;
  padding-right: 8px;
}
.loy-row.clickable:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}
.loy-lbl { font-size: 12px; color: var(--text-3); margin-bottom: 4px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500; }
.loy-val { font-size: 22px; font-weight: 500; font-feature-settings: 'tnum'; letter-spacing: -0.01em; }
.loy-right { text-align: right; }
.loy-mini { font-size: 11px; color: var(--text-3); font-feature-settings: 'tnum'; margin-top: 4px; }

/* ---------- Tooltip ---------- */
.tt {
  position: fixed;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.45;
  max-width: 280px;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
.tt-title { font-weight: 500; margin-bottom: 4px; }
.tt-row { display: flex; justify-content: space-between; gap: 16px; font-feature-settings: 'tnum'; }
.tt-row .lbl { color: rgba(250,250,250,0.65); }
[data-theme="dark"] .tt-row .lbl { color: rgba(24,24,27,0.6); }

/* ---------- Drawer ---------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  z-index: 998;
  animation: fade 120ms ease-out;
}
.drawer {
  position: fixed;
  top: 0; right: 0;
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 999;
  display: flex;
  flex-direction: column;
  animation: slideIn 200ms ease-out;
}
.drawer-head {
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.drawer-title { font-size: 15px; font-weight: 500; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; }
.drawer-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--text-2);
}
.drawer-close:hover { background: var(--hover); color: var(--text); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ---------- Pulse mini-drawers ---------- */
.pulse-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pulse-drawer-list {
  display: grid;
  gap: 12px;
}
.pulse-drawer-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 14px;
  transition: background 80ms ease, border-color 80ms ease, opacity 200ms ease, transform 200ms ease;
}
.pulse-drawer-card.clickable {
  cursor: pointer;
}
.pulse-drawer-card.clickable:hover {
  background: var(--hover);
}
.pulse-drawer-card.empty {
  background: var(--surface-alt);
  color: var(--text-3);
}
.pulse-drawer-card.message {
  border-left-width: 3px;
}
.pulse-drawer-card.urgent-warn {
  border-left-color: var(--warn);
}
.pulse-drawer-card.urgent-critical {
  border-left-color: var(--neg);
}
.pulse-drawer-card.is-fading {
  opacity: 0;
  transform: translateX(8px);
}
.pulse-drawer-card-head,
.pulse-drawer-titleline,
.pulse-drawer-actions {
  display: flex;
  align-items: center;
}
.pulse-drawer-card-head {
  justify-content: space-between;
  gap: 12px;
}
.pulse-drawer-titleline,
.pulse-drawer-actions {
  gap: 8px;
}
.pulse-drawer-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--pos);
  flex-shrink: 0;
}
.pulse-drawer-dot.neutral {
  background: transparent;
  border: 1px solid var(--text-3);
}
.pulse-drawer-money {
  font-feature-settings: 'tnum';
}
.pulse-drawer-subline,
.pulse-drawer-muted,
.pulse-drawer-note,
.pulse-drawer-preview {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 6px;
}
.pulse-drawer-muted {
  color: var(--text-3);
}
.pulse-drawer-note {
  color: var(--text);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.pulse-drawer-preview {
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pulse-drawer-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}
.pulse-drawer-inline-action {
  display: inline-flex;
  margin-top: 12px;
  color: var(--info);
  font-size: 13px;
  font-weight: 500;
}
.pulse-drawer-main {
  font-weight: 500;
}
.pulse-drawer-time {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-feature-settings: 'tnum';
}
.pulse-drawer-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
}
.pulse-drawer-section-title {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  margin-top: 14px;
  margin-bottom: 6px;
}
.pulse-drawer-checklist {
  display: grid;
  gap: 5px;
}
.pulse-drawer-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 13px;
}
.pulse-drawer-check span:first-child {
  color: var(--text-3);
  font-feature-settings: 'tnum';
}
.pulse-drawer-check span:first-child.done {
  color: var(--pos);
}
.pulse-drawer-actions {
  margin-top: 14px;
  flex-wrap: wrap;
}
.pulse-drawer-footer {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--info);
  font-size: 13px;
  font-weight: 500;
}
.pulse-drawer-footer:hover {
  background: var(--hover);
}
.pulse-drawer-empty {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 18px;
  color: var(--text-2);
  text-align: center;
}
.pulse-drawer-empty.success {
  background: var(--pos-bg);
  color: var(--pos);
  border-color: transparent;
}
.pulse-drawer-spa-list {
  display: grid;
}
.pulse-drawer-spa-slot {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.pulse-drawer-spa-slot:first-child {
  border-top: 0;
}
.pulse-drawer-spa-slot.free {
  color: var(--text-3);
}
.pulse-drawer-spa-time {
  color: var(--text-3);
  font-feature-settings: 'tnum';
}
.pulse-drawer-spa-summary {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  display: grid;
  gap: 6px;
  color: var(--text-2);
  font-size: 13px;
}
.pulse-drawer-cross-sell-hint {
  background: var(--info-bg);
  color: var(--info);
  border-radius: var(--radius-card);
  padding: 12px;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 600px) {
  .drawer {
    top: auto;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 86vh;
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
    animation: slideUp 200ms ease-out;
  }
  .drawer-head {
    padding: 0 16px;
  }
  .drawer-body {
    padding: 18px 16px 24px;
  }
  .pulse-drawer-actions .tb-select {
    flex: 1;
    justify-content: center;
  }
  .hm-drawer-stats {
    grid-template-columns: 1fr;
  }
  .hm-drawer-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .hm-drawer-row strong {
    text-align: left;
  }
}

/* P&L mini-table inside drawer */
.pl-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  align-items: center;
}
.pl-row:first-of-type { border-top: 0; }
.pl-row.total { border-top: 1px solid var(--border-strong); margin-top: 4px; padding-top: 14px; }
.pl-lbl { font-size: 13px; color: var(--text); }
.pl-num { font-size: 13px; font-feature-settings: 'tnum'; }
.pl-num.muted { color: var(--text-3); }
.pl-num.neg::before { content: '-'; margin-right: -2px; }

/* ---------- Skeleton ---------- */
.sk {
  background: linear-gradient(90deg, var(--surface-alt) 0%, var(--hover) 50%, var(--surface-alt) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-xs);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Mobile (375) ---------- */
.mobile-wrap {
  width: 375px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px 32px;
  background: var(--bg);
  min-height: 100vh;
}
.mobile-frame {
  background: var(--surface-alt);
  padding: 24px;
  border-radius: 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.06);
  margin-top: 16px;
}
.m-topbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}
.m-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 -16px 12px;
  padding: 0 16px;
  scrollbar-width: none;
}
.m-tabs::-webkit-scrollbar { display: none; }
.m-tab {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  color: var(--text-2);
  flex-shrink: 0;
}
.m-tab.active { background: var(--surface-alt); color: var(--text); font-weight: 500; }

/* ---------- Responsive desktop ---------- */
@media (max-width: 1100px) {
  .row-4 { grid-template-columns: repeat(2, 1fr); }
  .row-2-60-40 { grid-template-columns: 1fr; }
  .overview-metrics-top {
    grid-template-columns: 1fr;
  }
  .overview-metrics-top > .card[data-screen-label="09 Loyalty"] {
    min-height: auto;
  }
}

/* ---------- States toolbar (top) ---------- */
.states-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 4px;
  display: flex;
  gap: 2px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 200;
}
.states-bar button {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-2);
}
.states-bar button.on { background: var(--text); color: var(--bg); }
.states-bar button:not(.on):hover { background: var(--hover); color: var(--text); }
.states-bar .vsep { width: 1px; background: var(--border); margin: 4px 4px; }

/* ---------- Misc ---------- */
/* ---------- Help icon ---------- */
.help-ico {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-3);
  font-size: 9px;
  font-weight: 500;
  display: inline-grid;
  place-items: center;
  cursor: help;
  background: transparent;
  transition: color 80ms, border-color 80ms;
  flex-shrink: 0;
  font-family: inherit;
  line-height: 1;
}
.help-ico:hover { color: var(--text); border-color: var(--text-2); }
.help-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.help-title > span:first-child {
  min-width: 0;
}
.hero-head, .mk-head, .loy-head, .card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.uppercase-lbl {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.tnum { font-feature-settings: 'tnum'; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* H scrollbar mobile heatmap */
.h-scroll { overflow-x: auto; }
.h-scroll::-webkit-scrollbar { height: 6px; }
.h-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

/* ---------- Bookings table (Overview) ---------- */
.bk-table-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bk-table-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.bk-table-title-wrap {
  min-width: 240px;
  flex: 1;
}
.bk-table-sub {
  margin-top: 3px;
  color: var(--text-2);
  font-size: 12px;
  font-feature-settings: 'tnum';
}
.bk-table-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.bk-table-menu-wrap {
  position: relative;
  display: inline-flex;
}
.bk-table-period-wrap { z-index: 8; }
.bk-table-btn,
.bk-table-chip,
.bk-table-icon-btn {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 0 10px;
  white-space: nowrap;
}
.bk-table-icon-btn {
  width: 30px;
  padding: 0;
  justify-content: center;
}
.bk-table-btn:hover,
.bk-table-chip:hover,
.bk-table-icon-btn:hover { background: var(--hover); }
.bk-table-chip.active {
  color: var(--info);
  border-color: var(--info);
  background: var(--info-bg);
}
.bk-table-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.bk-table-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  max-height: 280px;
  overflow: auto;
  z-index: 80;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(0,0,0,0.12);
  padding: 6px;
}
.bk-table-dropdown.period { min-width: 280px; }
.bk-table-dropdown-item {
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  text-align: left;
  color: var(--text);
}
.bk-table-dropdown-item:hover,
.bk-table-dropdown-item.selected { background: var(--hover); }
.bk-table-dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.bk-table-check {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}
.bk-table-check.checked {
  border-color: var(--info);
  background: var(--info);
  box-shadow: inset 0 0 0 2px var(--surface);
}
.bk-table-segmented {
  height: 30px;
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}
.bk-table-segmented button {
  padding: 0 9px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  color: var(--text-2);
}
.bk-table-segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.bk-table-banner {
  min-height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
}
.bk-table-banner.warn {
  color: var(--warn);
  background: var(--warn-bg);
}
.bk-table-banner.info {
  color: var(--info);
  background: var(--info-bg);
}
.bk-table-banner span { flex: 1; }
.bk-table-banner button {
  color: inherit;
  font-weight: 500;
  white-space: nowrap;
}
.bk-table-active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.bk-table-pill {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-2);
  font-size: 11px;
}
.bk-table-pill span { color: var(--text-3); margin-left: 4px; }
.bk-table-clear {
  color: var(--text-3);
  font-size: 11px;
  padding: 3px 4px;
}
.bk-table-clear:hover { color: var(--text); }
.bk-table-wrap {
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.bk-table {
  width: 100%;
  min-width: 1010px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12px;
}
.bk-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--text-3);
  font-weight: 500;
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bk-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bk-table tbody tr:last-child td { border-bottom: 0; }
.bk-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding: 10px;
  border-top: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-feature-settings: 'tnum';
  white-space: nowrap;
}
.bk-table-total-row td {
  box-shadow: 0 -4px 12px rgba(0,0,0,0.03);
}
.bk-table-row { cursor: pointer; }
.bk-table-row:hover { background: var(--hover); }
.bk-table th.num,
.bk-table td.num { text-align: right; }
.bk-table-sort {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  color: inherit;
  text-align: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  font-size: inherit;
  font-weight: inherit;
}
.bk-table th.num .bk-table-sort { justify-content: flex-end; }
.bk-table-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.bk-table-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--text-3);
  flex-shrink: 0;
}
.bk-table-dot.in-house { background: var(--pos); }
.bk-table-dot.confirmed { background: var(--info); }
.bk-table-dot.checked-out { background: var(--text-3); }
.bk-table-dot.cancelled { background: var(--warn); }
.bk-table-dot.no-show { background: var(--neg); }
.bk-table-cabin { font-weight: 500; }
.bk-table-guest {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.bk-table-guest > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.bk-table-repeat {
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 10px;
  padding: 1px 5px;
}
.bk-table-discovery {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.bk-table-disc-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 1px solid var(--text-3);
  flex-shrink: 0;
}
.bk-table-disc-dot.manual {
  border-color: var(--pos);
  background: var(--pos);
}
.bk-table-disc-dot.ga4 {
  border-color: var(--info);
  background: transparent;
}
.bk-table-disc-dot.unknown {
  border-color: var(--text-3);
  border-style: dashed;
  background: transparent;
}
.bk-table-revenue {
  font-weight: 500;
  font-feature-settings: 'tnum';
}
.bk-table-revenue s {
  color: var(--text-3);
  font-weight: 400;
  margin-left: 4px;
}
.bk-table-note {
  color: var(--text-2);
}
.bk-table-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}
.bk-table-empty button {
  color: var(--info);
  font-weight: 500;
  margin-left: 6px;
}
.bk-table-footer-link {
  align-self: flex-start;
  color: var(--info);
  font-size: 12px;
  font-weight: 500;
}
.bk-table-mobile-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bk-table-mobile-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px;
  text-align: left;
}
.bk-table-mobile-card:hover { background: var(--hover); }
.bk-table-mobile-total {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.bk-table-mobile-total div div {
  font-weight: 500;
  color: var(--text);
}
.bk-table-mobile-total span {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
}
.bk-table-mobile-total strong {
  font-size: 13px;
  font-weight: 600;
  font-feature-settings: 'tnum';
}
.bk-table-mobile-top,
.bk-table-mobile-line,
.bk-table-mobile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bk-table-mobile-guest {
  margin-top: 7px;
  font-size: 13px;
  font-weight: 500;
}
.bk-table-mobile-line {
  margin-top: 5px;
  color: var(--text-2);
  font-size: 12px;
  justify-content: flex-start;
}
.bk-table-mobile-meta {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 11px;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.bk-table-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.28);
  display: grid;
  place-items: center;
  padding: 18px;
}
.bk-table-modal {
  width: 360px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.18);
}
.bk-table-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.bk-table-field {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--text-2);
  margin-top: 10px;
}
.bk-table-field input {
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 0 9px;
}
.bk-table-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.tb-select.active {
  color: var(--surface);
  background: var(--text);
  border-color: var(--text);
}
.bk-table-drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.bk-table-drawer-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.bk-table-drawer-stat div:last-child {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 500;
}
.bk-table-drawer-section {
  margin-top: 22px;
}
.bk-table-drawer-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--border);
  padding: 10px 0;
  font-size: 13px;
}
.bk-table-drawer-row span { color: var(--text-2); }
.bk-table-drawer-row strong {
  font-weight: 500;
  text-align: right;
}
.bk-table-drawer-row.total {
  border-top-color: var(--border-strong);
}
.bk-table-drawer-actions {
  margin-top: 26px;
  display: flex;
  gap: 8px;
}
.bk-table-drawer-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  text-align: center;
}

[data-density="compact"] .bk-table {
  font-size: 11px;
}
[data-density="compact"] .bk-table td {
  padding-top: 8px;
  padding-bottom: 8px;
}
[data-density="comfy"] .bk-table {
  font-size: 13px;
}
[data-density="comfy"] .bk-table td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.mobile-frame .bk-table-card {
  margin-top: 12px;
  padding: 14px;
  gap: 10px;
}
.mobile-frame .bk-table-header {
  display: grid;
  gap: 10px;
}
.mobile-frame .bk-table-controls {
  justify-content: stretch;
}
.mobile-frame .bk-table-period-wrap,
.mobile-frame .bk-table-btn {
  width: 100%;
}
.mobile-frame .bk-table-btn {
  justify-content: center;
}
.mobile-frame .bk-table-dropdown {
  left: 0;
  right: auto;
  min-width: 100%;
}

/* =====================================================================
   REVENUE TAB
   ===================================================================== */

.rev-page {
  padding: 16px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.rev-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}
.rev-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.rev-section-sub {
  font-size: 12px;
  color: var(--text-2);
}

/* ---------- Section 1: snapshot strip ---------- */
.rev-snapshot {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap-card);
}
.rev-snap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.rev-snap.alert {
  border-color: rgba(220, 38, 38, 0.35);
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.04), var(--surface));
}
.rev-snap-label {
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.rev-snap-label > span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.rev-snap-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.rev-snap-value.lg { font-size: 26px; }
.rev-snap-delta {
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.rev-snap-delta.pos { color: var(--pos); }
.rev-snap-delta.neg { color: var(--neg); }
.rev-snap-delta.flat { color: var(--text-3); }
.rev-snap.featured {
  grid-column: span 2;
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.rev-snap.featured .rev-snap-label,
.rev-snap.featured .rev-snap-value { color: var(--surface); }
.rev-snap.featured .rev-snap-delta.pos { color: #4ADE80; }
.rev-snap.featured .rev-snap-delta.neg { color: #FCA5A5; }

/* ---------- Section 2: Revenue mix ---------- */
.rev-mix-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--gap-card);
}
.rev-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--pad-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.rev-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.rev-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.rev-card-sub {
  font-size: 11px;
  color: var(--text-2);
}
.rev-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-2);
}
.rev-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: 0;
}
.rev-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.rev-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-3);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.rev-table th.num { text-align: right; }
.rev-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.rev-table td.num { text-align: right; }
.rev-table tr:last-child td { border-bottom: none; }
.rev-share-bar {
  display: inline-block;
  height: 6px;
  background: var(--chart-1);
  border-radius: 3px;
  margin-right: 8px;
  vertical-align: middle;
}
.rev-share-cell { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.rev-share-cell .pct { color: var(--text-2); font-size: 11px; min-width: 30px; }

/* Donut */
.rev-donut-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}
.rev-donut-center {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rev-donut-center .v { font-size: 20px; font-weight: 600; }
.rev-donut-center .l { font-size: 11px; color: var(--text-2); }
.rev-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.rev-donut-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.rev-donut-row .name { flex: 1; color: var(--text); }
.rev-donut-row .val { font-variant-numeric: tabular-nums; color: var(--text-2); }

/* ---------- Section 3: Expenses ---------- */
.rev-exp-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--gap-card);
}
.rev-pl-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 10px 8px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.rev-pl-row:hover { background: var(--hover); }
.rev-pl-row.subitem {
  grid-template-columns: 1fr auto;
  padding: 6px 8px 6px 32px;
  cursor: default;
  font-size: 12px;
  color: var(--text-2);
  border-bottom: 1px dashed var(--border);
}
.rev-pl-row.subitem:hover { background: transparent; }
.rev-pl-caret {
  display: inline-block;
  width: 14px;
  text-align: center;
  color: var(--text-3);
  transition: transform 0.15s;
  margin-right: 4px;
  font-size: 10px;
}
.rev-pl-caret.open { transform: rotate(90deg); }
.rev-pl-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
}
.rev-pl-bar {
  width: 80px;
  height: 4px;
  background: var(--surface-alt);
  border-radius: 2px;
  overflow: hidden;
}
.rev-pl-bar > span {
  display: block;
  height: 100%;
  background: var(--text);
  border-radius: 2px;
}
.rev-pl-total {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-align: right;
  font-size: 13px;
}
.rev-pl-row.subitem .rev-pl-total { font-weight: 400; font-size: 12px; }
.rev-pl-delta {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  margin-left: 8px;
}
.rev-pl-delta.pos { color: var(--pos); }
.rev-pl-delta.neg { color: var(--neg); }
.rev-pl-delta.flat { color: var(--text-3); }
.rev-pl-row.alert .rev-pl-label { color: var(--neg); }
.rev-pl-row.alert .rev-pl-bar > span { background: var(--neg); }

/* ---------- Section 4: Profitability 2x2 ---------- */
.rev-2x2-wrap {
  position: relative;
  height: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px 28px;
}
.rev-2x2 {
  position: relative;
  width: 100%;
  height: 100%;
}
.rev-2x2 .axis-x, .rev-2x2 .axis-y {
  position: absolute;
  background: var(--border);
}
.rev-2x2 .axis-x { left: 0; right: 0; height: 1px; }
.rev-2x2 .axis-y { top: 0; bottom: 0; width: 1px; }
.rev-2x2 .quadrant-bg {
  position: absolute;
  width: 50%;
  height: 50%;
}
.rev-2x2 .q-tl { top: 0; left: 0; }
.rev-2x2 .q-tr { top: 0; right: 0; background: rgba(22, 163, 74, 0.04); }
.rev-2x2 .q-bl { bottom: 0; left: 0; background: rgba(220, 38, 38, 0.04); }
.rev-2x2 .q-br { bottom: 0; right: 0; }
.rev-2x2 .q-label {
  position: absolute;
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}
.rev-cabin-dot {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--text);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 11px;
  font-weight: 600;
  transform: translate(-50%, -50%);
  border: 2px solid var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.15s;
  text-align: center;
  line-height: 1.1;
}
.rev-cabin-dot:hover { transform: translate(-50%, -50%) scale(1.08); z-index: 2; }
.rev-cabin-dot .gop { font-size: 9px; opacity: 0.8; font-weight: 400; }
.rev-cabin-dot.warn { background: var(--warn); color: #fff; }
.rev-cabin-dot.danger { background: var(--neg); color: #fff; }
.rev-cabin-dot.star::after {
  content: '★';
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--surface);
  color: var(--warn);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.rev-2x2-axislabel {
  position: absolute;
  font-size: 11px;
  color: var(--text-2);
}

/* ---------- Section 5: Forecast + What-if ---------- */
.rev-fc-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--gap-card);
}
.rev-whatif {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rev-whatif-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rev-whatif-row label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
}
.rev-whatif-row label b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rev-whatif-row input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--surface-alt);
  border-radius: 2px;
  outline: none;
}
.rev-whatif-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--text);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.rev-whatif-result {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rev-whatif-result .row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
}
.rev-whatif-result .row b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.rev-whatif-result .row.total {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
}
.rev-whatif-badge {
  display: inline-block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--info-bg);
  color: var(--info);
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: 2px;
  font-weight: 600;
}

/* Empty / skeleton helpers for revenue */
.rev-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .rev-snapshot { grid-template-columns: repeat(3, 1fr); }
  .rev-mix-grid, .rev-exp-grid, .rev-fc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .rev-snapshot { grid-template-columns: repeat(2, 1fr); }
  .rev-snap.featured { grid-column: span 2; }
}
