:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-soft: #fffaf1;
  --ink: #17252a;
  --muted: #68747a;
  --line: #ded8ce;
  --primary: #1f7a73;
  --primary-dark: #145f59;
  --accent: #d95d39;
  --warning: #f4b942;
  --danger: #b33a3a;
  --shadow: 0 16px 40px rgba(23, 37, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px clamp(16px, 5vw, 48px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand,
.topnav {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand {
  color: var(--ink);
  font-weight: 800;
  min-width: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  font-size: 0.78rem;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.topnav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topnav a,
.nav-button {
  color: var(--ink);
  font: inherit;
  font-size: 0.94rem;
}

.nav-button {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.inline-form {
  margin: 0;
}

.page {
  margin: 0 auto;
  max-width: 1120px;
  padding: 28px clamp(16px, 5vw, 48px) 48px;
}

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

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
  margin-bottom: 10px;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.2;
}

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

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

.section-heading {
  margin-bottom: 22px;
}

.section-heading.tight {
  margin-bottom: 14px;
}

.row-heading {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

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

.panel {
  padding: 20px;
}

.auth-shell,
.booking-shell {
  margin: 0 auto;
  max-width: 720px;
}

.auth-panel,
.confirmation,
.empty-state {
  padding: clamp(22px, 5vw, 40px);
}

.confirmation,
.empty-state {
  margin: 0 auto;
  max-width: 680px;
  text-align: center;
}

.flash {
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.flash-success {
  background: #e7f4ef;
  color: #155946;
}

.flash-error {
  background: #ffe9e4;
  color: #8b2c1f;
}

.form-stack,
.booking-form {
  display: grid;
  gap: 16px;
}

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

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

.full-span {
  grid-column: 1 / -1;
}

label,
.field-label {
  color: var(--ink);
  display: grid;
  font-weight: 750;
  gap: 7px;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid #cfc7ba;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 122, 115, 0.16);
  outline: none;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  text-decoration: none;
}

.button.primary {
  background: var(--primary);
  color: #ffffff;
}

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

.button.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--primary-dark);
}

.button.danger {
  background: var(--danger);
  color: #ffffff;
}

.button.full {
  width: 100%;
}

.button.compact {
  font-size: 0.92rem;
  min-height: 36px;
  padding: 7px 10px;
}

.form-actions,
.filter-bar,
.split-fields {
  align-items: end;
  display: flex;
  gap: 12px;
}

.form-actions {
  justify-content: flex-end;
}

.form-actions.single {
  justify-content: center;
  margin: 24px 0 12px;
}

.filter-bar {
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-bar label {
  min-width: 220px;
}

.split-fields > * {
  flex: 1;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface-soft);
  color: #4d585c;
  font-size: 0.82rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.actions {
  text-align: right;
}

.profile-head {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 20px;
}

.profile-main,
.booking-profile {
  align-items: center;
  display: flex;
  gap: 16px;
}

.profile-logo {
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 76px;
  object-fit: cover;
  width: 76px;
}

.profile-logo.fallback {
  align-items: center;
  background: var(--ink);
  color: #ffffff;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
}

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

.item-list {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0;
  margin-top: 18px;
}

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

.list-item:last-child {
  border-bottom: 0;
}

.list-item p {
  color: var(--muted);
  margin-bottom: 0;
}

.is-muted {
  opacity: 0.58;
}

.appointments {
  display: grid;
  gap: 14px;
}

.appointment-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: 180px 1fr 180px;
  padding: 16px;
}

.appointment-time {
  display: grid;
  gap: 4px;
}

.appointment-time span,
.appointment-body p {
  color: var(--muted);
  margin-bottom: 6px;
}

.appointment-title {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.appointment-title h2 {
  font-size: 1.1rem;
  margin-bottom: 0;
}

.comment {
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 10px;
}

.status-form {
  align-content: start;
  display: grid;
  gap: 8px;
}

.status-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 9px;
  white-space: nowrap;
}

.status-pill.pending {
  background: #fff4cf;
  color: #6d4c00;
}

.status-pill.confirmed {
  background: #dff3ed;
  color: #155946;
}

.status-pill.cancelled {
  background: #f5dddd;
  color: #8a2d2d;
}

.booking-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 30px);
}

.booking-profile {
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  padding-bottom: 18px;
}

.booking-profile h1 {
  font-size: clamp(1.9rem, 6vw, 3rem);
}

.slot-area {
  display: grid;
  gap: 8px;
}

.slot-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  min-height: 48px;
}

.slot-button {
  background: #ffffff;
  border: 1px solid #cfc7ba;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  min-height: 48px;
  padding: 10px 12px;
}

.slot-button.selected,
.slot-button:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.summary-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  margin: 24px 0;
  text-align: left;
}

.summary-list div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding: 14px;
}

.summary-list div:last-child {
  border-bottom: 0;
}

.summary-list span {
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 860px) {
  .row-heading,
  .profile-head,
  .two-column,
  .appointment-card {
    grid-template-columns: 1fr;
  }

  .row-heading,
  .profile-head {
    align-items: stretch;
    display: grid;
  }

  .profile-actions,
  .profile-actions .button {
    width: 100%;
  }

  .two-column {
    display: grid;
  }

  .appointment-card {
    display: grid;
  }

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

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    display: grid;
  }

  .topnav {
    justify-content: flex-start;
  }

  .page {
    padding-top: 20px;
  }

  h1 {
    font-size: 2rem;
  }

  .form-grid,
  .compact-grid,
  .split-fields,
  .filter-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .booking-profile,
  .profile-main {
    align-items: flex-start;
  }

  .profile-logo {
    height: 58px;
    width: 58px;
  }

  .slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button {
    width: 100%;
  }

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