:root {
  --bg: #0f1c24;
  --bg-elev: #173041;
  --ink: #10233a;
  --ink-soft: #4a5d6e;
  --line: #c5d0da;
  --accent: #0e7c86;
  --accent-ink: #f2fcfd;
  --up: #0f6b45;
  --down: #b42318;
  --flat: #5b6b78;
  --header: #0b1720;
  --font-display: "Literata", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --radius: 10px;
  --shadow: 0 18px 40px rgba(11, 23, 32, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 8% -12%, rgba(14, 124, 134, 0.16), transparent 55%),
    radial-gradient(900px 480px at 100% 0%, rgba(16, 35, 58, 0.08), transparent 50%),
    linear-gradient(180deg, #e8eef3 0%, #f4f7fa 45%, #e6edf3 100%);
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--header);
  color: #f4f0e7;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  display: block;
  height: 2rem;
  width: auto;
  flex-shrink: 0;
  /* Original SVG is dark green; invert for the dark topbar */
  filter: brightness(0) invert(1);
  opacity: 0.96;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nav a {
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: #d9d3c7;
  font-weight: 600;
  font-size: 0.92rem;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav a.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.nav-logout {
  opacity: 0.75;
}

.main {
  width: min(1400px, calc(100% - 2rem));
  margin: 1.25rem auto 3rem;
}

.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.5vw, 2.35rem);
  letter-spacing: -0.02em;
}

.lede {
  margin: 0.25rem 0 1rem;
  color: var(--ink-soft);
}

.filters {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.filters-context {
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(var(--filter-cols, 3), minmax(0, 1fr));
  gap: 0.75rem;
}

.filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.filter-emphasis {
  outline: 2px solid rgba(14, 124, 134, 0.35);
  outline-offset: 4px;
  border-radius: 8px;
  padding: 0.35rem;
}

.filter legend {
  padding: 0;
  margin-bottom: 0.35rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.check-list {
  border: 1px solid #b7c4d0;
  border-radius: 8px;
  background: #fff;
  max-height: 9.5rem;
  overflow: auto;
  padding: 0.35rem 0.45rem;
  font-weight: 500;
  color: var(--ink);
}

.check-list-months {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-height: none;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-weight: 500;
  font-size: 0.8rem;
  line-height: 1.25;
  padding: 0.15rem 0;
  cursor: pointer;
  color: var(--ink);
  min-width: 0;
}

.check input[type="checkbox"] {
  margin: 0.15rem 0 0;
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  accent-color: var(--accent);
}

.check-label {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Do not style checkboxes as full-width text fields — that hid all filter labels */
.filter select,
.filter input:not([type="checkbox"]),
.filter-search input,
.login-form input,
.hotel-search {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid #b7c4d0;
  border-radius: 8px;
  background: #fff;
  padding: 0.4rem 0.55rem;
  width: 100%;
}

.filters-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.filter-search {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  min-width: 220px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.btn-block {
  width: 100%;
}

.filter-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.totals--period {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: linear-gradient(135deg, #0b3d44 0%, #173041 55%, #1a4a52 100%);
  border-radius: var(--radius);
  padding: 0.85rem;
  gap: 0.55rem;
}

.totals--period .totals-period-banner {
  grid-column: 1 / -1;
  margin: 0 0 0.15rem;
  color: #c8e6ea;
  font-size: 0.88rem;
  font-weight: 500;
}

.totals--period .totals-period-banner strong {
  color: #fff;
  font-weight: 700;
}

.totals-item {
  background: var(--bg-elev);
  color: #eef5f8;
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
}

.totals--period .totals-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(200, 230, 234, 0.22);
}

.totals-label {
  display: block;
  font-size: 0.78rem;
  opacity: 0.7;
  margin-bottom: 0.2rem;
}

.totals--period .totals-label {
  opacity: 0.92;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.totals-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
}

.totals-value small {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.9;
}

.period-picker {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.65rem;
}

.period-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.period-sublegend {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.period-hint {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.35;
}

.filter-period {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 220px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td {
  padding: 0.42rem 0.65rem;
  border-bottom: 1px solid #dde6ee;
  white-space: nowrap;
  vertical-align: middle;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #143246;
  color: #eef5f8;
  font-weight: 600;
  text-align: left;
}

.data-table thead th a {
  color: inherit;
  text-decoration: none;
}

.data-table thead th a:hover {
  text-decoration: underline;
}

.data-table tbody tr:nth-child(even) {
  background: #f3f7fa;
}

.data-table tbody tr:hover {
  background: #e7f1f4;
}

.data-table tfoot td {
  position: sticky;
  bottom: 0;
  background: #dce7ef;
  font-weight: 700;
  border-top: 2px solid #b7c4d0;
}

.num {
  text-align: right;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
}

.sticky-col {
  position: sticky;
  left: 0;
  background: inherit;
  z-index: 1;
  max-width: 320px;
  white-space: normal;
}

.data-table thead .sticky-col,
.data-table thead th:first-child {
  z-index: 3;
}

.drill {
  color: #0a5f67;
  font-weight: 600;
  text-decoration: none;
}

.drill:hover {
  text-decoration: underline;
}

.yoy-up {
  color: var(--up);
}

.yoy-down {
  color: var(--down);
}

.yoy-flat {
  color: var(--flat);
}

.footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 0 1rem 2rem;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(135deg, rgba(11, 23, 32, 0.94), rgba(14, 124, 134, 0.55)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    #0b1720;
}

.login-shell {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.login-panel {
  width: min(420px, 100%);
  background: #f5f9fb;
  color: var(--ink);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  animation: rise 0.55s ease both;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}

.login-brand-logo {
  display: block;
  height: 2.75rem;
  width: auto;
}

.login-brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.15;
}

.login-panel h1 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.login-lede {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
}

.login-error {
  background: #f8e2e0;
  color: var(--down);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.login-footer {
  color: #b7c8d4;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.totals-item {
  animation: rise 0.45s ease both;
}

.totals-item:nth-child(2) { animation-delay: 0.05s; }
.totals-item:nth-child(3) { animation-delay: 0.1s; }
.totals-item:nth-child(4) { animation-delay: 0.15s; }

.data-table tbody tr {
  animation: faderow 0.35s ease both;
}

@keyframes faderow {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1100px) {
  .filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .period-picker {
    grid-template-columns: 1fr;
  }

  .main {
    width: calc(100% - 1rem);
  }

  .table-wrap {
    max-height: none;
  }
}

@media (max-width: 480px) {
  .filters-grid {
    grid-template-columns: 1fr;
  }
}
