:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1b1f23;
  --muted: #667085;
  --line: #d9dee5;
  --accent: #0f4c81;
  --accent-soft: #e8f1f8;
  --ok: #1f7a46;
  --warn: #946200;
  --bad: #a33a3a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(180deg, #f9fbfc 0%, #eef2f5 100%);
  color: var(--ink);
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: #0f1720;
  color: #fff;
  border-bottom: 1px solid #253344;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}

.brand {
  color: #fff;
  text-decoration: none;
  font-size: 28px;
  font-weight: 700;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: #b4c0ce;
  font-size: 14px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-nav a {
  color: #d8e2ec;
  text-decoration: none;
}

.user-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d8e2ec;
  font-size: 13px;
}

.inline-form {
  margin: 0;
}

.link-button {
  border: 0;
  background: transparent;
  color: #d8e2ec;
  cursor: pointer;
  font: inherit;
}

.page-content {
  padding: 28px 0 40px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.hero-with-filter {
  align-items: flex-start;
  gap: 24px;
}

.hero-copy {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}

.hero-meta {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.hero-meta p,
.hero-meta .small-note {
  margin: 0;
}

.hero h1 {
  margin: 0;
  font-size: 32px;
}

.hero p,
.hero-date,
.muted {
  color: var(--muted);
}

.hero-date,
.small-note {
  font-size: 13px;
}

.grid {
  display: grid;
  gap: 20px;
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.report-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  margin-top: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(20, 32, 45, 0.05);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.card-header h2 {
  margin: 0;
}

.button-link,
.date-filter button,
.report-filter button,
.login-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 76, 129, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.button-link:hover,
.date-filter button:hover,
.report-filter button:hover,
.login-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 76, 129, 0.16);
}

.secondary-button {
  background: #fff;
  border-color: var(--line);
  color: var(--accent);
  box-shadow: none;
}

.secondary-button:hover {
  background: var(--accent-soft);
  box-shadow: none;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wide-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--accent-soft);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.metric strong {
  font-size: 20px;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--muted);
}

.small-note {
  margin: 12px 0 0;
  line-height: 1.5;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.budget-base,
.budget-note,
.comparison-base,
.comparison-note {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
}

.budget-base,
.comparison-base {
  color: var(--muted);
}

.budget-good {
  color: var(--ok);
}

.budget-bad {
  color: var(--bad);
}

.comparison-good {
  color: var(--ok);
}

.comparison-bad {
  color: var(--bad);
}

.date-filter,
.toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.report-filter {
  display: grid;
  gap: 12px;
  width: min(560px, 100%);
  flex: 0 1 560px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.filter-field {
  flex: 1 1 170px;
  min-width: 170px;
}

.report-filter label,
.date-filter label,
.login-form label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

.report-filter input,
.report-filter select,
.date-filter input,
.date-filter select,
.login-form input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.report-filter input[type="date"],
.date-filter input[type="date"] {
  padding-right: 38px;
}

.filter-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  justify-content: flex-end;
}

.compare-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 2px;
}

.compare-note-caption {
  margin: 0;
  width: 100%;
}

.login-card {
  max-width: 440px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.form-row ul.errorlist {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--bad);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

th.money-col,
td.money-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-section-row th {
  padding-top: 14px;
  padding-bottom: 10px;
  background: #f7f9fb;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: none;
  border-bottom: 0;
}

.sectioned-table .table-section-row th:first-child {
  border-radius: 12px 0 0 12px;
}

.sectioned-table .table-section-row th:last-child {
  border-radius: 0 12px 12px 0;
}

.sectioned-table .revenue-section-body + .revenue-section-body .table-section-row th {
  padding-top: 24px;
}

.sectioned-table .table-subrow td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.table-subrow td:first-child {
  padding-left: 22px;
}

.reconciliation-card {
  background: linear-gradient(180deg, #fbfcfd 0%, #f1f6fb 100%);
}

.reconciliation-card .card-header {
  margin-bottom: 0;
  align-items: center;
}

.reconciliation-card strong {
  font-size: 28px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.dates-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dates-list a {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.analytics-home-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 20px;
}

.analytics-spotlight {
  min-height: 100%;
}

.analytics-summary-card {
  min-height: 100%;
}

.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.analytics-hotels-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.analytics-hotel-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfcfd 0%, #f2f6fa 100%);
}

.analytics-hotel-copy h3 {
  margin: 0 0 8px;
}

.analytics-hotel-copy .small-note {
  margin-top: 0;
}

.analytics-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.analytics-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}

.analytics-nav a,
.analytics-nav-label {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  text-decoration: none;
}

.analytics-nav a:hover {
  background: var(--accent-soft);
}

.analytics-nav a.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.analytics-nav-label {
  color: var(--muted);
  background: transparent;
}

.metabase-embed-card {
  padding: 0;
  overflow: hidden;
}

.embed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f7fa 100%);
}

.metabase-embed-frame {
  display: block;
  width: 100%;
  min-height: 1200px;
  border: 0;
  background: #fff;
}

.metabase-note {
  margin: 0;
}

.status-chip {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #f5f6f7;
}

.status-ok {
  color: var(--ok);
  background: #e9f7ee;
}

.status-partial,
.status-needs_confirmation {
  color: var(--warn);
  background: #fff4d8;
}

.status-missing,
.status-source_pending {
  color: var(--bad);
  background: #fde9e9;
}

@media (max-width: 760px) {
  .header-row,
  .hero,
  .date-filter,
  .toolbar,
  .top-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .report-filter {
    width: 100%;
    flex-basis: auto;
  }

  .filter-row,
  .compare-fields {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-field {
    min-width: 0;
  }

  .analytics-summary-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .analytics-card-actions {
    width: 100%;
  }

  .analytics-card-actions .button-link,
  .hero-actions .button-link {
    width: 100%;
  }

  .embed-toolbar {
    padding: 14px 16px;
  }

  .metabase-embed-frame {
    min-height: 960px;
  }

  .filter-actions {
    justify-content: stretch;
  }

  .filter-actions .button-link,
  .filter-actions button {
    width: 100%;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }
}
