:root {
  --bg: #f5f3ef;
  --surface: #ffffff;
  --ink: #2c2a28;
  --muted: #6f6b66;
  --line: #d9d3cb;
  --olive: #596436;
  --olive-strong: #4c562e;
  --wine: #7a2d45;
  --soft-pink: #f3d9df;
  --olive-soft: #e9eedf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at top right, #faf8f5 0, var(--bg) 60%);
  font-family: Manrope, "Avenir Next", sans-serif;
}

.page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.hero h1 {
  margin: 8px 0;
  font: 500 52px/56px "Cormorant Garamond", serif;
  letter-spacing: 0.01em;
}

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

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 32px;
  max-width: 820px;
}

.scope-note {
  margin: 10px 0 0;
  color: var(--olive);
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
}

.offers {
  margin-top: 24px;
}

.offers-head h2 {
  margin: 8px 0 0;
  font: 500 36px/40px "Cormorant Garamond", serif;
}

.offers-grid {
  margin-top: 14px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.offer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(32, 26, 21, 0.06);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.offer-card h3 {
  margin: 0;
  font: 700 26px/30px "Cormorant Garamond", serif;
}

.offer-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 22px;
}

.offer-btn {
  margin-top: auto;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease,
    box-shadow 180ms ease, transform 180ms ease;
}

.offer-btn:hover,
.offer-btn:focus-visible {
  background: var(--olive);
  border-color: var(--olive);
  color: #fff;
  box-shadow: 0 8px 18px rgba(89, 100, 54, 0.24);
  transform: translateY(-1px);
}

.offer-btn:active {
  background: var(--olive-strong);
  border-color: var(--olive-strong);
  color: #fff;
  transform: translateY(0);
}

.context {
  margin-top: 24px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  align-items: end;
}

.field label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

.context .field {
  position: relative;
}

.context .field[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  background: #2f2d2a;
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font: 600 12px/16px Manrope, sans-serif;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 8;
  box-shadow: 0 8px 18px rgba(44, 42, 40, 0.24);
}

.context .field[data-tip]::before {
  content: "";
  position: absolute;
  left: 14px;
  bottom: calc(100% + 2px);
  width: 10px;
  height: 10px;
  background: #2f2d2a;
  transform: rotate(45deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: 7;
}

.context .field[data-tip]:hover::after,
.context .field[data-tip]:hover::before,
.context .field[data-tip]:focus-within::after,
.context .field[data-tip]:focus-within::before {
  opacity: 1;
  transform: translateY(0);
}

select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: 600 16px/22px Manrope, sans-serif;
  color: var(--ink);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

select:focus,
select:focus-visible {
  border-color: var(--olive);
  box-shadow: 0 0 0 2px rgba(89, 100, 54, 0.18);
  outline: none;
}

.tee-select {
  min-width: 110px;
  max-width: 140px;
  padding: 8px 10px;
  font-size: 15px;
}

.course-select,
.tee-time-select {
  min-width: 140px;
}

.tee-groups {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tee-group {
  font-size: 14px;
  line-height: 20px;
}

.static-value {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: 700 16px/22px Manrope, sans-serif;
}

.btn {
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 12px 16px;
  font: 700 15px/20px Manrope, sans-serif;
  cursor: pointer;
  transition: 180ms ease;
}

.context .btn {
  min-height: 48px;
  height: 48px;
  align-self: end;
  margin-top: 0;
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-primary {
  border-color: var(--olive);
  color: #fff;
  background: var(--olive);
}

.btn-primary:hover {
  background: var(--olive-strong);
}

.btn-secondary {
  border-color: var(--olive);
  color: var(--olive);
  background: #fff;
}

.btn-secondary:disabled {
  border-color: var(--line);
  color: var(--muted);
  background: var(--soft-pink);
  cursor: not-allowed;
}

.kpis {
  margin-top: 24px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(32, 26, 21, 0.06);
  padding: 18px 18px 14px;
}

.card span {
  display: block;
  font: 700 30px/34px Manrope, "Avenir Next", sans-serif;
  letter-spacing: -0.01em;
}

.card small {
  color: var(--muted);
  font-size: 14px;
}

.sparkline {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}

.spark-head h3 {
  margin: 0 0 8px;
  font: 700 16px/22px Manrope, sans-serif;
  color: var(--muted);
}

.spark-head.secondary {
  margin-top: 12px;
}

#sparkline {
  width: 100%;
  height: 74px;
}

#weekdayChart {
  width: 100%;
  height: 96px;
}

.table-wrap {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.table-header {
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
}

.table-header h2 {
  margin: 0;
  font: 500 28px/34px "Cormorant Garamond", serif;
}
.table-header small {
  color: var(--muted);
  font: 600 12px/18px Manrope, sans-serif;
}

.live-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px 0;
}

.live-pill {
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font: 700 13px/18px Manrope, sans-serif;
  background: #fff;
}

.live-pill.ok {
  color: var(--olive);
  background: var(--olive-soft);
}

.live-pill.bad {
  color: var(--wine);
  background: var(--soft-pink);
}

.live-expand {
  border: 1px solid var(--olive);
  color: var(--olive);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font: 700 13px/18px Manrope, sans-serif;
  cursor: pointer;
}

.live-detail-row td {
  background: #faf8f4;
  padding-top: 10px;
  padding-bottom: 10px;
}

.live-month-row td {
  background: #f3eee6;
  font-weight: 700;
}

.live-date-row td:first-child {
  padding-left: 24px;
}

.live-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.live-detail-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font: 600 12px/16px Manrope, sans-serif;
  color: var(--ink);
  background: #fff;
}

.dates-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dates-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  min-width: 320px;
}

.segmented-course {
  min-width: 420px;
}

.segmented-btn {
  border: 0;
  background: #fff;
  color: var(--ink);
  padding: 10px 18px;
  font: 700 15px/20px Manrope, sans-serif;
  cursor: pointer;
  flex: 1 1 0;
  min-width: 150px;
  white-space: nowrap;
}

.segmented-btn.active {
  background: var(--olive-soft);
  color: var(--olive);
}

.table-scroller {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  font-size: 16px;
  line-height: 22px;
}

td small {
  color: var(--muted);
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

#datesTable th,
#datesTable td {
  white-space: nowrap;
}

#datesTable td[data-label="Room x nights"] {
  white-space: normal;
  min-width: 130px;
}

#monthsTable td[data-label="Action"] .btn,
#datesTable td[data-label="Action"] .btn {
  white-space: nowrap;
  min-width: 132px;
  min-height: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  line-height: 1;
}

#datesTable td[data-label="Date"] {
  min-width: 110px;
}

#datesTable td[data-label="Course"] select,
#datesTable td[data-label="Tee time"] select {
  min-width: 110px;
}

tbody tr {
  transition: 180ms ease;
}

tbody tr:hover {
  background: #faf8f4;
}

#monthsBody tr.selected-row {
  background: #ece7de;
}

#monthsBody tr.selected-row:hover {
  background: #ece7de;
}

.chip {
  display: inline-flex;
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 700;
}

.chip-ok {
  color: var(--olive);
  background: var(--olive-soft);
}

.chip-no {
  color: var(--wine);
  background: var(--soft-pink);
}

.skeleton {
  background: linear-gradient(90deg, #efeae2 25%, #e7e1d8 37%, #efeae2 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 8px;
  height: 16px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.reveal {
  animation: reveal 180ms ease both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .context {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
  .offers-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 640px) {
  .page {
    padding: 24px 14px 60px;
  }
  .hero h1 {
    font-size: 38px;
    line-height: 42px;
  }
  .subtitle {
    font-size: 18px;
    line-height: 28px;
  }
  .context {
    grid-template-columns: 1fr;
  }
  .kpis {
    grid-template-columns: 1fr;
  }
  .context .field[data-tip]::after,
  .context .field[data-tip]::before {
    display: none;
  }
  .offers-head h2 {
    font-size: 30px;
    line-height: 34px;
  }
  .offers-grid {
    grid-template-columns: 1fr;
  }
  .dates-header-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .dates-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .segmented {
    width: 100%;
    min-width: 0;
  }
  .segmented-btn {
    min-width: 0;
    font-size: 15px;
    line-height: 20px;
  }
  .table-scroller {
    overflow: visible;
  }
  table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
  }
  thead {
    display: none;
  }
  tbody tr {
    display: block;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(32, 26, 21, 0.04);
    padding: 8px 10px;
  }
  tbody td {
    display: grid;
    grid-template-columns: 42% 58%;
    gap: 8px;
    align-items: center;
    border-bottom: 1px dashed var(--line);
    padding: 10px 4px;
    font-size: 16px;
    line-height: 22px;
  }
  tbody td:last-child {
    border-bottom: 0;
  }
  tbody td::before {
    content: attr(data-label);
    font-size: 12px;
    line-height: 16px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }
  .btn,
  .btn-secondary,
  .btn-primary {
    width: 100%;
  }
  .course-select,
  .tee-time-select,
  .tee-select {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
}
