:root {
  color-scheme: light;
  --ink: #101b1a;
  --teal: #0c544a;
  --lime: #dffc63;
  --paper: #f5f6ef;
  --line: #dbe1d8;
  --muted: #465952;
  --warning: #952726;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 15rem; }
h1, h2, p, dl { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #298a76; outline-offset: 3px; }
:disabled { cursor: default; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.rail {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 1.8rem 1.25rem 1.25rem;
  color: #fff;
  background: var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.7rem;
  font-size: 1.11rem;
  font-weight: 750;
  line-height: 1.15;
  text-decoration: none;
}
.brand-mark {
  display: block;
  width: 2.6rem;
  height: 2.6rem;
}
.brand small { display: block; margin-top: 0.15rem; color: #bccac2; font-size: 0.78rem; font-weight: 500; }
.rail :focus-visible { outline-color: var(--lime); }
.rail-caption { margin: 0 0 0.55rem 0.7rem; color: #bccac2; font-size: 0.8rem; }
.rail-links { display: grid; gap: 0.35rem; }
.rail-links button, .rail-footer a, .rail-footer button {
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.6rem;
  padding: 0.65rem 0.7rem;
  color: #e4ede7;
  background: transparent;
  font-size: 0.93rem;
  font-weight: 620;
  text-align: start;
  text-decoration: none;
}
.rail-links button:hover, .rail-footer a:hover, .rail-footer button:hover { background: #243633; }
.rail-links button[aria-current="page"] { color: var(--ink); background: var(--lime); }
.rail-footer { display: grid; gap: 0.3rem; margin-top: auto; }

.main-content { min-width: 0; }
.view { max-width: 83rem; margin-inline: auto; padding: clamp(1rem, 4vw, 3.4rem); }
.view-header { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.65rem; }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 800; letter-spacing: -0.06em; line-height: 1.05; }
h2 { font-size: 1.23rem; letter-spacing: -0.025em; }
.muted { color: var(--muted); font-size: 0.94rem; line-height: 1.5; }
.view-header .muted, .login-card .muted { margin-top: 0.55rem; }

.login { display: grid; min-height: 100vh; padding: clamp(1rem, 5vw, 4rem); place-items: center; }
.login-card, .panel, .metric {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fff;
}
.login-card { width: min(100%, 29rem); padding: clamp(1.15rem, 4vw, 2.3rem); box-shadow: 0 16px 50px #101b1a10; }
.login-card h1 { font-size: clamp(2rem, 4vw, 2.65rem); }
.login-card form { margin-top: 1.5rem; }
.notice { margin-top: 1.15rem; padding: 0.9rem; border-radius: 0.6rem; color: #164b42; background: #e6f2ea; font-size: 0.94rem; line-height: 1.5; }

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.58rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}
.button.primary { color: #fff; background: var(--teal); }
.button.primary:hover:enabled { background: #0a493f; }
.button.secondary { border-color: #cfd8ce; color: var(--teal); background: #fff; }
.button.secondary:hover:not(:disabled) { background: #edf4ee; }
.button:disabled { opacity: 0.53; }

fieldset { display: grid; gap: 0.85rem; min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset:disabled label { opacity: 0.6; }
label { display: grid; gap: 0.36rem; color: var(--ink); font-size: 0.9rem; font-weight: 650; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 2.7rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid #bccbc0;
  border-radius: 0.55rem;
  color: var(--ink);
  background-color: #fff;
  font-size: 1rem;
  font-weight: 400;
}
input::placeholder, textarea::placeholder { color: #526960; }
textarea { resize: vertical; line-height: 1.45; }
.feedback { margin-top: 0.9rem; color: var(--muted); font-size: 0.94rem; line-height: 1.4; }
.feedback:empty { display: none; }
.feedback.error { color: var(--warning); }
.feedback.success { color: var(--teal); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; margin-bottom: 1.05rem; }
.metric { padding: clamp(0.8rem, 2vw, 1.25rem); }
.metric.new { border-color: #cedd96; background: #f1f8d7; }
.metric dt { color: var(--muted); font-size: 0.87rem; font-weight: 660; }
.metric dd { margin: 0.35rem 0 0; font-size: clamp(1.55rem, 3.25vw, 2.25rem); font-weight: 780; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.table-panel { padding: clamp(0.85rem, 2vw, 1.25rem); }
.filters { display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(7rem, 10rem) auto; align-items: end; gap: 0.55rem; }
.table-wrap { overflow-x: auto; margin-top: 1rem; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); text-align: start; }
th { padding: 0.65rem 0.5rem; color: var(--muted); background: var(--paper); font-size: 0.84rem; font-weight: 680; }
td { padding: 0.65rem 0.5rem; font-size: 0.94rem; overflow-wrap: anywhere; }
td:last-child { text-align: end; }
td .muted { display: block; margin-top: 0.13rem; font-size: 0.86rem; }
td time { white-space: nowrap; }
.badge { display: inline-block; padding: 0.24rem 0.48rem; border-radius: 0.4rem; color: #39443f; background: #eef0eb; font-size: 0.84rem; font-weight: 690; white-space: nowrap; }
.badge.new { color: #304e16; background: #e8f5c8; }
.badge.contacted { color: #174b44; background: #ddf2ec; }
.badge.requested { color: #66501c; background: #fff2c9; }
.badge.confirmed { color: #174b44; background: #ddf2ec; }
.badge.completed { color: #304e16; background: #e8f5c8; }
.badge.cancelled { color: #862f2d; background: #f9e8e6; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 1rem; }
.pagination > div { display: flex; gap: 0.5rem; }

.settings-panel { max-width: 42rem; padding: clamp(1rem, 3vw, 1.75rem); }
.settings-panel fieldset > button, #edit-enquiry-fields > button { justify-self: start; }
.field-help { margin-top: -0.5rem; font-size: 0.88rem; }
.form-divider { margin: 0.35rem 0; border-top: 1px solid var(--line); }
.booking-filters { grid-template-columns: minmax(7rem, 1fr) repeat(2, minmax(7rem, 9rem)) auto; }
.booking-reference { font-variant-numeric: tabular-nums; }
.booking-schedule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
#edit-booking-fields > .button { justify-self: start; }
.use-preferred-slot { margin-bottom: 0.1rem; }

dialog { width: min(38rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--line); border-radius: 1rem; color: var(--ink); background: #fff; box-shadow: 0 15px 60px #101b1a42; }
dialog::backdrop { background: #101b1aa8; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 0.65rem; padding: 0.9rem clamp(0.9rem, 4vw, 1.5rem); border-bottom: 1px solid var(--line); }
.dialog-body { padding: clamp(0.9rem, 4vw, 1.5rem); }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.details > div:last-child { grid-column: 1 / -1; }
.details dt { color: var(--muted); font-size: 0.88rem; font-weight: 660; }
.details dd { margin: 0.18rem 0 0; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.customer-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }

@media (max-width: 53rem) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rail { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.6rem; padding: 0.65rem 1rem; }
  .rail-caption { display: none; }
  #dashboard-nav { grid-column: 1 / -1; grid-row: 2; }
  .rail-links, .rail-footer { display: flex; flex-wrap: wrap; gap: 0.2rem; margin: 0; }
  .rail-links button, .rail-footer a, .rail-footer button { padding: 0.55rem; }
  .login { min-height: calc(100vh - 4rem); }
}

@media (max-width: 34rem) {
  .view-header { align-items: start; flex-direction: column; margin-bottom: 1rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: minmax(0, 1fr) auto; }
  .booking-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booking-filters > button { grid-column: 1 / -1; }
  .search-field { grid-column: 1 / -1; }
  .table-wrap { margin-top: 0.65rem; overflow: visible; }
  table, tbody, tr { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; padding: 0.7rem 0; border-top: 1px solid var(--line); }
  td { padding: 0; border-bottom: 0; }
  td:last-child { grid-column: 1 / -1; text-align: start; }
  .pagination { flex-wrap: wrap; }
  .details { grid-template-columns: 1fr; }
}

@media (max-width: 22rem) {
  .rail { grid-template-columns: 1fr; }
  #dashboard-nav { grid-row: 3; }
  .booking-schedule-fields { grid-template-columns: 1fr; }
}
