:root {
  --forest: #1f5b45;
  --forest-dark: #0d2c25;
  --lime: #c8f05b;
  --lime-soft: #eaf7d6;
  --sand: #f7f3e8;
  --paper: #fffcf4;
  --ink: #17201d;
  --muted: #68736f;
  --line: #e2ded2;
  --coral: #e56a54;
  --amber: #f2a13b;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(200, 240, 91, .22), transparent 32rem),
    linear-gradient(135deg, #f9f6ed 0%, #edf4e8 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.topbar,
.hero-card,
.auth-card,
.panel,
.notice {
  border: 1px solid rgba(31, 91, 69, .12);
  box-shadow: 0 18px 50px rgba(13, 44, 37, .08);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: rgba(255, 252, 244, .84);
  border-radius: 24px;
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(13, 44, 37, .22);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  color: var(--forest-dark);
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 8px;
  color: var(--forest-dark);
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.05;
}

h3 {
  margin-bottom: 4px;
  color: var(--forest-dark);
  font-size: 22px;
}

h4 {
  margin-bottom: 12px;
  color: var(--forest-dark);
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.auth-card,
.hero-card,
.panel {
  margin-top: 24px;
  background: rgba(255, 252, 244, .92);
  border-radius: 28px;
  padding: clamp(20px, 4vw, 36px);
}

.auth-card {
  width: min(520px, 100%);
  margin: 48px auto 0;
}

.form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--forest-dark);
  font-size: 13px;
  font-weight: 750;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  outline: none;
  padding: 14px 15px;
}

input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 4px rgba(31, 91, 69, .12);
}

.primary,
.outline,
.ghost {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  font-weight: 800;
}

.primary {
  background: var(--forest);
  color: white;
}

.primary:disabled {
  cursor: not-allowed;
  background: #cfd6cf;
  color: var(--muted);
}

.outline {
  border: 1px solid rgba(31, 91, 69, .25);
  background: var(--paper);
  color: var(--forest);
}

.ghost {
  background: transparent;
  color: var(--forest);
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.auth-links button {
  border: 0;
  background: transparent;
  color: var(--forest);
  font-weight: 750;
  padding: 8px 0;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  background:
    linear-gradient(135deg, rgba(255, 252, 244, .94), rgba(234, 247, 214, .88)),
    var(--paper);
}

.date-box {
  display: grid;
  gap: 12px;
  width: min(320px, 100%);
}

.selected-date-card {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(31, 91, 69, .18);
  border-radius: 22px;
  background: var(--forest-dark);
  color: white;
  padding: 18px;
  box-shadow: 0 16px 32px rgba(13, 44, 37, .18);
}

.selected-date-label {
  color: var(--lime);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

#selectedDateDay {
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1;
  text-transform: capitalize;
}

#selectedDateFull {
  color: rgba(255, 255, 255, .76);
  font-size: 14px;
  text-transform: capitalize;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0 0;
  padding: 5px;
  border-radius: 18px;
  background: rgba(226, 222, 210, .58);
}

.tab {
  flex: 1;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  padding: 12px;
  font-weight: 800;
}

.tab.active {
  background: var(--paper);
  color: var(--forest);
  box-shadow: 0 8px 20px rgba(13, 44, 37, .06);
}

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

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.slot-card,
.reservation-card,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  padding: 16px;
}

.slot-card.full,
.slot-card.blocked,
.slot-card.disabled {
  background: #f4f2eb;
}

.slot-head,
.reservation-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.slot-time {
  color: var(--forest-dark);
  font-size: 24px;
  font-weight: 900;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--lime-soft);
  color: var(--forest);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.error {
  background: #ffe6df;
  color: var(--coral);
}

.badge.warn {
  background: #fff1d8;
  color: #9a610e;
}

.progress {
  overflow: hidden;
  height: 8px;
  margin: 14px 0;
  border-radius: 999px;
  background: var(--line);
}

.progress > span {
  display: block;
  height: 100%;
  width: var(--value);
  border-radius: inherit;
  background: var(--lime);
}

.progress > span.warn {
  background: var(--amber);
}

.progress > span.full {
  background: var(--coral);
}

.slot-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notice {
  margin-top: 18px;
  border-radius: 20px;
  padding: 16px;
}

.notice.success {
  background: var(--lime-soft);
  color: var(--forest-dark);
}

.notice.error {
  background: #ffe6df;
  color: #8c2c1d;
}

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

.reservation-card.cancelled {
  opacity: .7;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-value {
  color: var(--forest-dark);
  font-size: 30px;
  font-weight: 950;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100% - 36px));
  border-radius: 16px;
  background: var(--forest-dark);
  color: white;
  padding: 14px 16px;
  box-shadow: 0 18px 60px rgba(13, 44, 37, .28);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 44, 37, .52);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(440px, 100%);
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 26px;
  background: var(--paper);
  padding: clamp(22px, 4vw, 32px);
  box-shadow: 0 28px 80px rgba(13, 44, 37, .32);
}

.modal-card h2 {
  margin-bottom: 10px;
  font-size: clamp(26px, 6vw, 34px);
}

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

@media (max-width: 760px) {
  .shell {
    width: min(100% - 18px, 1180px);
    padding-top: 10px;
  }

  .topbar,
  .hero-card,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions button {
    flex: 1;
  }

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

  .slot-actions > button {
    flex: 1;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }
}
