:root {
  color-scheme: light;
  --ink: #172126;
  --muted: #5f6c70;
  --line: #d7e0dd;
  --paper: #fbfcfa;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --reserved: #c95b4f;
  --selected: #1d4ed8;
  --range: #dbeafe;
  --shadow: 0 18px 50px rgba(24, 39, 45, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.hero {
  min-height: 320px;
  display: flex;
  align-items: end;
  padding: 36px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(9, 24, 29, 0.12), rgba(9, 24, 29, 0.72)),
    url("https://images.unsplash.com/photo-1578637387939-43c525550085?auto=format&fit=crop&w=1800&q=80") center 40% / cover;
  box-shadow: var(--shadow);
}

.hero-copy {
  max-width: 680px;
  color: #fff;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lead {
  margin: 16px 0 0;
  font-size: 1.08rem;
  line-height: 1.8;
}

.booking-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  margin-top: 22px;
  align-items: start;
}

.summary-panel,
.booking-panel,
.reservations-panel,
.cancel-panel,
.admin-header {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(24, 39, 45, 0.08);
}

.summary-panel {
  padding: 24px;
  position: sticky;
  top: 20px;
}

.summary-panel h2,
.booking-panel h2,
.reservations-panel h2,
.cancel-panel h2 {
  margin: 0;
  font-size: 1.2rem;
}

dl {
  margin: 22px 0 0;
}

dl div {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 0.84rem;
}

dd {
  margin: 6px 0 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.hint,
.message {
  color: var(--muted);
  line-height: 1.7;
}

.booking-panel {
  padding: 22px;
}

.toolbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.toolbar h2 {
  text-align: center;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--accent);
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekday {
  min-height: 32px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.day {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 10px;
  position: relative;
}

.day:hover:not(:disabled) {
  border-color: var(--accent);
}

.day:disabled {
  color: #9aa5a8;
  background: #f2f5f4;
  cursor: not-allowed;
}

.day.reserved {
  background: #fff0ee;
  border-color: #efc8c2;
  color: var(--reserved);
}

.day.selected {
  background: var(--selected);
  border-color: var(--selected);
  color: #fff;
}

.day.in-range {
  background: var(--range);
  border-color: #b7d4ff;
}

.day.other-month {
  opacity: 0.35;
}

.day .tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.booking-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 20px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input:focus,
select:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

#reserveButton {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  grid-column: 1 / -1;
}

#reserveButton:hover:not(:disabled) {
  background: var(--accent-strong);
}

#reserveButton:disabled {
  background: #b8c3c1;
  cursor: not-allowed;
}

.message {
  min-height: 28px;
  margin: 14px 0 0;
  font-weight: 700;
}

.message.success {
  color: var(--accent-strong);
}

.message.error {
  color: var(--reserved);
}

.reservations-panel,
.cancel-panel {
  margin-top: 20px;
  padding: 22px;
}

.admin-shell {
  max-width: 1120px;
}

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

.admin-header h1 {
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.admin-note,
.cancel-note {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.eyebrow-dark {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.subtle-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  padding: 0 16px;
  cursor: pointer;
}

.subtle-button:hover {
  border-color: var(--accent);
}

.subtle-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
}

.subtle-link:hover {
  border-color: var(--accent);
}

.cancel-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.reservations-list {
  display: grid;
  gap: 10px;
}

.empty-list {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.reservation-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfa;
}

.reservation-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.reservation-title h3 {
  margin: 0;
  font-size: 1.05rem;
}

.reservation-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.reservation-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 0;
}

.reservation-details div {
  padding: 0;
  border: 0;
  min-width: 0;
}

.reservation-details dd {
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.reservation-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.action-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.cancel-email-label {
  width: min(260px, 100%);
  font-size: 0.82rem;
}

.cancel-email-label input {
  min-height: 40px;
}

.danger-button {
  min-height: 40px;
  border: 1px solid #efc8c2;
  border-radius: 8px;
  background: #fff7f5;
  color: var(--reserved);
  font-weight: 800;
  padding: 0 16px;
  cursor: pointer;
}

.danger-button:hover {
  border-color: var(--reserved);
  background: #fff0ee;
}

.danger-button:disabled {
  border-color: #efc8c2;
  background: #f6eeec;
  color: #b98c85;
  cursor: not-allowed;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 20px, 720px);
    padding-top: 10px;
  }

  .hero {
    min-height: 260px;
    padding: 24px;
  }

  .booking-layout {
    grid-template-columns: 1fr;
  }

  .summary-panel {
    position: static;
  }

  .day {
    min-height: 54px;
    padding: 7px;
  }

  .day .tag {
    display: none;
  }

  .booking-form {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .list-header,
  .reservation-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-header {
    padding: 18px;
  }

  .reservation-title p {
    text-align: left;
  }

  .reservation-details {
    grid-template-columns: 1fr;
  }

  .reservation-actions {
    align-items: stretch;
    flex-direction: column;
    justify-content: stretch;
  }

  .cancel-form {
    grid-template-columns: 1fr;
  }

  .danger-button {
    width: 100%;
  }
}
