:root {
  --ink: #172018;
  --muted: #66715f;
  --paper: #f7f6ef;
  --panel: #ffffff;
  --line: #dfe2d7;
  --olive: #4f6f3d;
  --olive-dark: #243b22;
  --clay: #b96f45;
  --gold: #d7b568;
  --bad: #a53835;
  --shadow: 0 20px 60px rgba(22, 28, 20, 0.14);
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.hero {
  position: relative;
  min-height: 56vh;
  overflow: hidden;
  color: white;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 25, 14, 0.78), rgba(16, 25, 14, 0.28) 48%, rgba(16, 25, 14, 0.12));
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(18px, 4vw, 56px);
}

.brand {
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.95rem;
}

.nav-actions a {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: 9px 13px;
  text-decoration: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100% - 36px));
  margin: clamp(70px, 11vw, 150px) 0 60px clamp(18px, 4vw, 56px);
}

.hero-copy h1 {
  margin: 8px 0 14px;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  line-height: 0.92;
  max-width: 9ch;
}

.hero-copy p:last-child {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.08rem;
  line-height: 1.6;
}

.page {
  width: min(1540px, calc(100% - 28px));
  margin: -38px auto 64px;
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--clay);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
}

.alert {
  width: min(720px, 100%);
  margin: 0 auto 18px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #edf5e8;
  border: 1px solid #c7dfbc;
  box-shadow: var(--shadow);
}

.alert.bad {
  background: #fff0ee;
  border-color: #efc6c1;
  color: var(--bad);
}

.auth-panel,
.panel,
.toolbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px);
  display: grid;
  grid-template-columns: 1fr minmax(260px, 360px);
  gap: clamp(22px, 5vw, 54px);
}

.form-stack,
.compact-form,
.modal-form {
  display: grid;
  gap: 13px;
}

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

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

.button,
.booking-list button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 800;
}

.button.primary {
  background: var(--olive-dark);
  color: white;
}

.button.ghost {
  background: #eef0e8;
  color: var(--olive-dark);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  margin-bottom: 16px;
}

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-weight: 700;
}

.admin-jump {
  border-radius: 8px;
  background: var(--olive-dark);
  color: white;
  padding: 9px 12px;
  text-decoration: none;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.dot.free {
  background: var(--olive);
}

.dot.busy {
  background: var(--clay);
}

.dot.mine {
  background: var(--gold);
}

.schedule {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: var(--panel);
  border: 1px solid var(--line);
}

.schedule-grid {
  display: grid;
  grid-template-columns: 74px repeat(15, minmax(112px, 1fr));
  min-width: 1780px;
}

.corner,
.day-head,
.time-head,
.slot {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.corner,
.day-head,
.time-head {
  background: #f0f1e8;
  font-weight: 900;
}

.corner,
.time-head {
  position: sticky;
  left: 0;
  z-index: 2;
  display: grid;
  place-items: center;
}

.corner {
  z-index: 4;
}

.day-head {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 54px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.day-head.today {
  color: var(--olive-dark);
  background: #e4eadc;
}

.time-head {
  min-height: 70px;
  color: var(--muted);
}

.slot {
  min-height: 70px;
  padding: 8px;
  display: grid;
  align-content: center;
  gap: 2px;
  background: #fffdf9;
}

.slot strong,
.slot span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot span {
  color: var(--muted);
  font-size: 0.78rem;
}

.slot.is-busy {
  background: #fbede6;
}

.slot.is-mine {
  background: #fff4c8;
}

.slot.is-past {
  background: #eeeee9;
}

.slot form {
  justify-self: end;
}

.slot form button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 32, 24, 0.12);
  cursor: pointer;
}

.reserve-trigger {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(79, 111, 61, 0.28);
  border-radius: 8px;
  background: #eef6ea;
  color: var(--olive-dark);
  cursor: pointer;
  font-weight: 900;
}

.reserve-trigger:hover {
  background: #dfeeda;
}

.closed {
  color: #a5a99f;
  text-align: center;
}

.dashboard-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 22px;
}

.admin-panel {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading span {
  border-radius: 999px;
  background: #eef0e8;
  color: var(--muted);
  padding: 7px 10px;
  font-weight: 800;
  white-space: nowrap;
}

.panel h3 {
  margin: 20px 0 10px;
  font-size: 1rem;
}

.booking-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
}

.booking-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.booking-list button {
  min-height: 34px;
  background: #f2e9df;
  color: var(--bad);
}

.compact-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0;
}

.compact-form .button,
.compact-form select {
  min-height: 44px;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px auto;
  gap: 8px;
}

.password-field button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef0e8;
  color: var(--olive-dark);
  cursor: pointer;
  font-weight: 900;
}

.password-field button:last-child {
  padding: 0 12px;
}

.user-table {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.user-main strong,
.user-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-table small {
  color: var(--muted);
  font-size: 0.86rem;
}

.user-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.user-row button {
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #eef0e8;
  color: var(--olive-dark);
  cursor: pointer;
  font-weight: 800;
}

.user-row button.danger-button {
  background: #f2e9df;
  color: var(--bad);
}

.user-row button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 700px) {
  .user-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-actions {
    justify-content: flex-start;
  }
}

.self-pill {
  border-radius: 999px;
  background: #eef0e8;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 0.82rem;
  font-weight: 800;
}

dialog {
  width: min(440px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(18, 26, 17, 0.5);
}

.modal-form {
  padding: 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.setup-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #edf0e4, #f8f3ea);
}

.setup-shell {
  width: min(560px, calc(100% - 28px));
}

.setup-shell .auth-panel {
  padding: 28px;
}

.setup-note {
  color: var(--bad);
  font-weight: 800;
}

@media (max-width: 860px) {
  .hero {
    min-height: 50vh;
  }

  .hero-copy h1 {
    max-width: 10ch;
  }

  .login-panel,
  .dashboard-row {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .password-field {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

  .hero-copy {
    margin-top: 48px;
  }

  .hero-copy p:last-child {
    font-size: 1rem;
  }
}
