:root {
  --bg: #f7f7f4;
  --panel: #ffffff;
  --ink: #232321;
  --muted: #707069;
  --line: #ddddd5;
  --accent: #275e55;
  --accent-dark: #183f39;
  --open: #bfe6d6;
  --booked: #f28b77;
  --blocked: #d8d8d1;
  --shadow: 0 18px 50px rgba(35, 35, 33, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.booking-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.booking-hero {
  display: flex;
  align-items: end;
  min-height: 220px;
  padding: 32px 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 700px;
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.booking-hero p,
.muted,
.section-title p,
.empty-state {
  color: var(--muted);
}

.picker,
.login-panel,
.message-panel,
.admin-section,
.modal-panel,
.toast-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.picker {
  padding: 22px;
}

.day-list {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.day-button,
.slot-button,
.primary-button,
.icon-button,
.admin-slot {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.day-button {
  min-height: 72px;
  padding: 12px 8px;
}

.day-button strong,
.day-button span {
  display: block;
}

.day-button.active,
.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.slot-head,
.admin-topbar,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.slot-head {
  margin-top: 24px;
}

.icon-button {
  width: 42px;
  height: 42px;
}

.slot-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}

.slot-button {
  min-height: 52px;
  font-weight: 700;
}

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

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 22, 20, 0.48);
}

.modal[hidden],
[hidden] {
  display: none !important;
}

.modal-panel {
  position: relative;
  width: min(420px, 100%);
  padding: 24px;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
}

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

input,
select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

fieldset {
  grid-template-columns: 1fr 1fr;
  border: 0;
  padding: 0;
}

legend {
  grid-column: 1 / -1;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}

.radio-row input {
  min-height: auto;
  width: auto;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 800;
}

.form-error {
  color: #a73222;
  font-weight: 700;
}

.toast-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(360px, calc(100% - 48px));
  padding: 20px;
}

.simple-page,
.admin-login {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel,
.message-panel {
  width: min(420px, 100%);
  padding: 28px;
}

.message-panel.success {
  border-color: var(--open);
}

.admin-page {
  padding: 24px;
}

.admin-topbar {
  width: min(1240px, 100%);
  margin: 0 auto 18px;
}

.admin-topbar h1 {
  font-size: 2.2rem;
}

.admin-topbar a {
  color: var(--accent);
  font-weight: 800;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  width: min(1240px, 100%);
  margin: 0 auto;
}

.admin-section {
  padding: 18px;
  overflow: auto;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
  min-width: 880px;
}

.admin-day {
  display: grid;
  gap: 5px;
}

.admin-day-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-radius: 8px;
  background: #efefea;
}

.admin-slot {
  min-height: 34px;
  padding: 6px;
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-slot.open,
.legend .open {
  background: var(--open);
}

.admin-slot.booked,
.legend .booked {
  background: var(--booked);
}

.admin-slot.blocked,
.legend .blocked {
  background: var(--blocked);
}

.admin-slot:disabled {
  cursor: not-allowed;
  color: #64291f;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.template-row {
  display: grid;
  grid-template-columns: 64px 44px 1fr 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.template-row input[type="checkbox"] {
  min-height: auto;
  width: 22px;
  height: 22px;
}

@media (max-width: 720px) {
  .booking-shell {
    width: min(100% - 20px, 980px);
    padding: 24px 0;
  }

  .booking-hero {
    min-height: 160px;
  }

  .day-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .picker {
    padding: 14px;
  }

  .slot-head,
  .section-title {
    align-items: start;
    flex-direction: column;
  }

  .admin-page {
    padding: 12px;
  }

  .template-row {
    grid-template-columns: 52px 34px 1fr;
  }

  .template-row select:last-child {
    grid-column: 3;
  }
}

