:root {
  --bg: #f4f0e8;
  --panel: #fffaf1;
  --ink: #18211f;
  --muted: #66736d;
  --line: #d9d0c2;
  --brand: #16423c;
  --brand-2: #c05746;
  --brand-3: #e0b44f;
  --ok: #247a4d;
  --warn: #996515;
  --bad: #9f3030;
  --shadow: 0 18px 45px rgba(33, 39, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(22, 66, 60, 0.09), transparent 36%),
    linear-gradient(315deg, rgba(192, 87, 70, 0.1), transparent 42%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

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

.eyebrow {
  margin: 0 0 3px;
  color: var(--brand-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

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

h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255, 250, 241, 0.8);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

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

.notify-button {
  flex: 0 0 auto;
  border: 1px solid rgba(22, 66, 60, 0.22);
  border-radius: 999px;
  padding: 9px 12px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
}

.notify-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.alert-stack {
  position: sticky;
  z-index: 20;
  top: 10px;
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.app-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(36, 122, 77, 0.25);
  border-left: 5px solid var(--ok);
  border-radius: 8px;
  padding: 12px;
  background: #fffdf8;
  box-shadow: 0 14px 34px rgba(33, 39, 35, 0.16);
}

.app-alert.rejected {
  border-color: rgba(159, 48, 48, 0.25);
  border-left-color: var(--bad);
}

.app-alert strong {
  display: block;
}

.app-alert span {
  color: var(--muted);
  font-size: 0.9rem;
}

.alert-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(24, 33, 31, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}

.status-pill.ready {
  border-color: rgba(36, 122, 77, 0.35);
  color: var(--ok);
}

.status-pill.warning {
  border-color: rgba(153, 101, 21, 0.35);
  color: var(--warn);
}

.layout,
.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.lower-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.58fr);
  margin-top: 18px;
}

.panel {
  border: 1px solid rgba(217, 208, 194, 0.9);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.92);
  box-shadow: var(--shadow);
}

.calendar-panel,
.form-panel,
.bookings-panel,
.cost-panel {
  padding: 18px;
}

.panel-heading,
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title span {
  color: var(--muted);
  font-size: 0.9rem;
}

.icon-button,
.text-button,
.primary,
.secondary {
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-size: 1.8rem;
  line-height: 1;
}

.text-button {
  background: transparent;
  color: var(--brand-2);
}

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

.weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
}

.day {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fffdf8;
  text-align: left;
  cursor: pointer;
}

.day.outside {
  opacity: 0.38;
}

.day.selected {
  border-color: var(--brand);
  outline: 3px solid rgba(22, 66, 60, 0.18);
}

.day-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 900;
}

.day.today .day-number::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-3);
}

.day-bookings {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.mini-booking {
  overflow: hidden;
  border-radius: 5px;
  padding: 4px 5px;
  color: white;
  background: var(--brand);
  font-size: 0.7rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-booking.pending {
  background: var(--warn);
}

.mini-booking.rejected {
  background: var(--bad);
}

.mini-booking.cancelled {
  background: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  position: relative;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.suggestions {
  position: absolute;
  z-index: 5;
  top: calc(100% - 2px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 16px 34px rgba(33, 39, 35, 0.18);
}

.suggestion {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(217, 208, 194, 0.75);
  padding: 10px 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.suggestion:last-child {
  border-bottom: 0;
}

.suggestion:hover,
.suggestion:focus {
  background: rgba(224, 180, 79, 0.16);
}

.estimate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(22, 66, 60, 0.2);
  border-radius: 8px;
  padding: 12px;
  background: rgba(22, 66, 60, 0.07);
}

.estimate span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.estimate strong {
  text-align: right;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  background: #fffdf8;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

.primary,
.secondary {
  border-radius: 7px;
  padding: 13px 16px;
}

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

.secondary {
  background: var(--brand-2);
  color: white;
}

.message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
}

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

.booking-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--warn);
  border-radius: 8px;
  padding: 12px;
  background: #fffdf8;
}

.booking-card.approved {
  border-left-color: var(--ok);
}

.booking-card.rejected {
  border-left-color: var(--bad);
}

.booking-card.cancelled {
  border-left-color: var(--muted);
  opacity: 0.78;
}

.booking-card strong {
  display: block;
  margin-bottom: 3px;
}

.booking-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  margin-top: 8px;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(153, 101, 21, 0.14);
  color: var(--warn);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.approved {
  background: rgba(36, 122, 77, 0.14);
  color: var(--ok);
}

.badge.rejected {
  background: rgba(159, 48, 48, 0.14);
  color: var(--bad);
}

.badge.cancelled {
  background: rgba(102, 115, 109, 0.14);
  color: var(--muted);
}

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

.cancel-booking {
  border: 1px solid rgba(159, 48, 48, 0.22);
  border-radius: 7px;
  padding: 8px 10px;
  background: rgba(159, 48, 48, 0.08);
  color: var(--bad);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

.cost-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  border-radius: 8px;
  padding: 18px;
  background: var(--brand);
  color: white;
}

.cost-result strong {
  font-size: 1.65rem;
}

.cost-result span {
  font-size: 1.25rem;
  font-weight: 900;
}

@media (max-width: 850px) {
  .layout,
  .lower-grid {
    grid-template-columns: 1fr;
  }

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

  .top-actions {
    align-self: stretch;
    justify-content: stretch;
  }

  .status-pill {
    flex: 1 1 auto;
    text-align: center;
  }

  .notify-button {
    flex: 1 1 auto;
  }
}

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

  .calendar-panel,
  .form-panel,
  .bookings-panel,
  .cost-panel {
    padding: 12px;
  }

  .weekdays,
  .calendar {
    gap: 4px;
  }

  .day {
    min-height: 70px;
    padding: 5px;
  }

  .mini-booking {
    font-size: 0.62rem;
  }

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

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

  .estimate strong {
    text-align: left;
  }
}
