:root {
  --ink: #1e293b;
  --muted: #64748b;
  --line: #d9e2ec;
  --panel: #ffffff;
  --soft: #f5f7fb;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #b45309;
  --danger: #b91c1c;
  --ok: #15803d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--soft);
  line-height: 1.5;
}
a { color: var(--brand-dark); }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px clamp(16px, 4vw, 48px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.2rem;
}
nav { display: flex; gap: 16px; }
nav a { text-decoration: none; font-weight: 700; }
.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}
.hero { min-height: 58vh; }
h1, h2 { line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: clamp(2rem, 4vw, 4.5rem); }
h2 { font-size: 1.25rem; }
.kicker {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
}
.home-hero {
  position: relative;
  min-height: min(620px, 72vh);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 32px;
  align-items: center;
  padding: clamp(28px, 6vw, 72px);
  border-radius: 8px;
  background: #eef2ef url("/assets/images/soho-diary-hero.png") center / cover no-repeat;
  overflow: hidden;
}
.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .58);
}
.home-hero-copy { position: relative; z-index: 1; max-width: 660px; }
.home-hero h1 { font-size: 5rem; }
.home-lead { max-width: 520px; font-size: 1.2rem; color: #18212f; }
.hero-note { margin: 14px 0 0; color: #263445; font-size: .92rem; font-weight: 700; }
.home-hero-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  align-self: end;
}
.home-hero-panel div {
  display: grid;
  gap: 3px;
  padding: 16px 18px;
  border: 1px solid rgba(217, 226, 236, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 16px 32px rgba(15, 23, 42, .09);
}
.home-hero-panel span { color: var(--accent); font-size: .82rem; font-weight: 900; text-transform: uppercase; }
.home-hero-panel strong { font-size: 1.2rem; }
.home-intro {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 40px;
  padding: 70px 0 28px;
}
.home-intro h2, .home-workflow h2, .home-pricing h2, .home-final h2, .home-roles h2 { font-size: 2.4rem; }
.home-intro p { max-width: 720px; font-size: 1.05rem; }
.home-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 28px 0 64px;
}
.home-features article {
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 4px solid #c8d8cc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .05);
}
.home-features article:nth-child(2) { border-top-color: #d7c38b; }
.home-features article:nth-child(3) { border-top-color: #c9b6d8; }
.home-features article:nth-child(4) { border-top-color: #dfb4aa; }
.home-features article:nth-child(5) { border-top-color: #a9c4d6; }
.home-features article:nth-child(6) { border-top-color: #b9c9ad; }
.home-features span { color: var(--accent); font-size: .8rem; font-weight: 900; }
.home-features h3 { margin: 10px 0 8px; font-size: 1.05rem; }
.home-features p { margin: 0; color: var(--muted); font-size: .94rem; }
.home-roles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.home-roles .home-section-heading {
  grid-column: 1 / -1;
  max-width: 720px;
}
.home-roles article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .05);
}
.home-roles article:nth-child(3) { background: #fff9ed; }
.home-roles span {
  color: var(--brand-dark);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.home-roles h3 { margin: 10px 0 8px; }
.home-roles p { margin: 0; color: var(--muted); }
.home-workflow {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr);
  gap: 56px;
  padding: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .06);
}
.home-workflow ol { list-style: none; margin: 0; padding: 0; counter-reset: steps; }
.home-workflow li {
  counter-increment: steps;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 2px 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.home-workflow ol { display: grid; gap: 12px; }
.home-workflow li::before {
  content: counter(steps);
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf3ef;
  color: var(--brand-dark);
  font-weight: 800;
}
.home-workflow li span { color: var(--muted); }
.home-pricing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: center;
  margin-top: 24px;
  padding: 56px;
  border: 1px solid #d5e3d9;
  border-radius: 8px;
  background: #edf3ef;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .06);
}
.home-pricing > div:first-child { max-width: 680px; }
.home-pricing-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.home-pricing-list li {
  padding-left: 20px;
  position: relative;
  color: #334155;
  font-weight: 700;
}
.home-pricing-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}
.home-price {
  display: grid;
  justify-items: start;
  min-width: 220px;
  padding: 24px;
  border: 1px solid #c8d8cc;
  border-radius: 8px;
  background: #fff;
}
.home-price strong { font-size: 3rem; line-height: 1; }
.home-price span { margin: 5px 0 18px; color: var(--muted); font-weight: 700; }
.home-final {
  max-width: 820px;
  margin: 32px auto 0;
  padding: 52px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .06);
}
.home-final p { color: var(--muted); font-size: 1.05rem; }
.actions, .inline, .date-filter {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}
.button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.button.danger { border-color: #fecdd3; background: #fff1f2; color: var(--danger); }
.button.small { min-height: 34px; padding: 7px 12px; font-size: .9rem; }
.summary-panel, .panel, .metric, .form-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .07);
}
.summary-panel, .metric {
  padding: 24px;
  display: grid;
  gap: 8px;
}
.summary-panel strong, .metric strong { font-size: 1.8rem; }
.form-wrap {
  max-width: 540px;
  margin: 0 auto;
  padding: 28px;
}
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 92px; resize: vertical; }
fieldset { min-width: 0; }
.field-help { color: var(--muted); font-weight: 400; }
.payment-choices { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.payment-choices legend { margin-bottom: 6px; font-weight: 700; }
.payment-options-table { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.payment-option-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.payment-option-row:last-child { border-bottom: 0; }
.payment-option-row:has(input:checked) { background: #edf3ef; }
.payment-option-control {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
}
.payment-option-control input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid #94a3b8;
  border-radius: 3px;
  cursor: pointer;
}
.payment-option-control input:checked {
  border-color: #617c69;
  background: #617c69;
  box-shadow: inset 0 0 0 4px #edf3ef;
}
.payment-option-copy { display: grid; gap: 2px; padding: 12px 14px; }
.payment-option-copy small { color: var(--muted); font-weight: 400; }
.field-label { display: block; margin-bottom: 6px; font-weight: 700; }
.logo-upload-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.logo-preview {
  width: 180px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
}
.logo-preview img {
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
  box-sizing: border-box;
}
.logo-upload small { color: var(--muted); }
.alert {
  padding: 12px 14px;
  border-left: 4px solid var(--danger);
  background: #fff1f2;
  color: #7f1d1d;
  transition: opacity .3s ease, transform .3s ease;
}
.alert.is-dismissing { opacity: 0; transform: translateY(-4px); }
.alert.success {
  border-left-color: var(--ok);
  background: #ecfdf5;
  color: #14532d;
}
.dashboard-head, .business-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}
.booking-link-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.booking-link-row a { overflow-wrap: anywhere; }
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { padding: 22px; }
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}
.section-head p { margin: 0; color: var(--muted); }
.section-copy { margin: 0; color: var(--muted); }
.payfast-settings {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-left: 3px solid #c8d8cc;
  background: #f8faf9;
}
.payfast-settings h3 { margin: 0 0 4px; font-size: 1rem; }
.compact-form { margin: 0; }
.admin-actions { display: grid; gap: 8px; min-width: 190px; }
.admin-dashboard-actions { display: grid; gap: 10px; justify-items: stretch; }
.day-row {
  display: grid;
  grid-template-columns: 1fr 120px 120px;
  gap: 10px;
  align-items: center;
}
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: auto; }
.check span { display: inline; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; color: var(--muted); text-transform: uppercase; }
.status {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e2e8f0;
  font-weight: 800;
  font-size: .8rem;
}
.status.paid, .status.active { background: #dcfce7; color: var(--ok); }
.status.unpaid { background: #fef3c7; color: #92400e; }
.status.pending, .status.trial { background: #fef3c7; color: #92400e; }
.status.failed, .status.expired, .status.suspended { background: #fee2e2; color: var(--danger); }
.status.sent { background: #dcfce7; color: var(--ok); }
.legal-copy { max-width: 820px; margin: 0 auto; }
.legal-copy h1 { font-size: 2.4rem; }
.legal-copy h2 { margin-top: 28px; }
.business-profile {
  grid-template-columns: 200px minmax(0, 1fr) auto;
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}
.logo-box {
  width: 200px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 900;
  font-size: 1.5rem;
  overflow: hidden;
}
.business-profile h1 { font-size: 1.75rem; }
.business-description { color: var(--muted); }
.business-address { margin-bottom: 0; }
.business-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin-top: 0;
}
.contact-item {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}
.contact-item a { overflow-wrap: anywhere; }
.contact-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: var(--brand-dark);
}
.logo-box img {
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
  box-sizing: border-box;
}
.price {
  display: grid;
  gap: 2px;
  color: var(--brand-dark);
  text-align: right;
  white-space: nowrap;
}
.price strong { font-size: 2rem; line-height: 1.1; }
.price span { color: var(--muted); font-size: 1rem; font-weight: 700; }
.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.slot {
  min-height: 72px;
  display: grid;
  gap: 3px;
  place-content: center;
  border: 1px solid #c8d8cc;
  background: #edf3ef;
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  font-weight: 800;
}
.slot strong { font-size: 1.1rem; white-space: nowrap; }
.slot span { color: var(--muted); font-size: .9rem; font-weight: 700; }
.slot.active { border-color: #789382; background: #d8e5dc; }
.slot.disabled {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #9f1239;
  opacity: .72;
  cursor: not-allowed;
}
.selected { color: var(--muted); }
.owner-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.owner-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.owner-menu {
  position: sticky;
  top: 20px;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.owner-menu-toggle { display: none; }
.owner-menu a {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.owner-menu a:last-child { border-bottom: 0; }
.owner-menu a:hover, .owner-menu a:focus { background: #ecfdf5; color: var(--brand-dark); }
.owner-content { min-width: 0; }
.owner-section { margin-bottom: 20px; scroll-margin-top: 20px; }
.owner-slot {
  width: 100%;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 5px;
  align-content: start;
  background: #fff;
}
.slot-toggle { margin: 0; }
.slot-toggle .owner-slot { cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.slot-toggle .owner-slot:hover { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(15, 118, 110, .12); }
.slot-toggle .owner-slot:disabled { cursor: not-allowed; box-shadow: none; }
.owner-slot.booked { border-color: #789382; background: #d8e5dc; }
.owner-slot.booked.moving { border-color: #d2b66d; background: #f4ecd6; color: #6f571d; }
.owner-slot.open { border-color: #c8d8cc; background: #edf3ef; }
.owner-slot.closed {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #9f1239;
  opacity: .72;
}
.owner-slot small { color: var(--muted); }
.appointment-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.appointment-actions form { margin: 0; }
.session-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.session-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px 140px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}
.add-session-form { background: #fff; }
.session-actions { display: flex; gap: 8px; align-items: end; }
.notes-editor { min-width: 240px; }
.notes-editor summary { list-style: none; width: max-content; }
.notes-editor summary::-webkit-details-marker { display: none; }
.notes-editor form {
  min-width: 280px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}
.notes-editor textarea { min-height: 80px; }
.support-form { max-width: 680px; margin-top: 14px; }
.danger-zone { border-color: #fecaca; background: #fffafa; }
.danger-zone > p { color: #7f1d1d; }
.danger-zone form { max-width: 520px; }

@media (max-width: 800px) {
  .hero, .grid.two, .dashboard-head, .business-profile { grid-template-columns: 1fr; }
  .home-hero {
    grid-template-columns: 1fr;
    min-height: 650px;
    align-items: flex-start;
    padding: 28px 22px;
    background-position: 62% center;
  }
  .home-hero-copy { width: 100%; padding-bottom: 0; }
  .home-hero-panel {
    width: 100%;
    align-self: start;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .home-hero-panel div { padding: 12px; }
  .home-hero h1 { font-size: 3rem; }
  .home-intro, .home-workflow, .home-pricing, .home-roles { grid-template-columns: 1fr; }
  .home-intro { gap: 8px; padding: 48px 0 36px; }
  .home-features { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 48px; }
  .home-roles .home-section-heading { grid-column: auto; }
  .home-workflow, .home-pricing { padding: 28px 22px; gap: 24px; }
  .home-price { width: 100%; }
  .price { text-align: left; }
  .section-head { display: grid; align-items: stretch; }
  .logo-upload-row { grid-template-columns: 1fr; }
  .owner-layout { grid-template-columns: 1fr; }
  .owner-menu-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    gap: 4px;
    place-content: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
  }
  .owner-menu-toggle span {
    width: 20px;
    height: 2px;
    display: block;
    background: var(--ink);
  }
  .owner-menu {
    position: static;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .owner-menu.is-open { display: grid; }
  .owner-menu a:nth-child(odd) { border-right: 1px solid var(--line); }
  .day-row { grid-template-columns: 120px 120px; justify-content: start; }
  .day-row .check { grid-column: 1 / -1; }
  .session-row { grid-template-columns: 1fr; }
  .session-actions { align-items: stretch; }
  #client-list .table-wrap,
  #email-log .table-wrap { overflow: visible; }
  #client-list table,
  #email-log table,
  #client-list tbody,
  #email-log tbody,
  #client-list tr,
  #email-log tr,
  #client-list td,
  #email-log td { display: block; width: 100%; min-width: 0; }
  #client-list thead,
  #email-log thead { display: none; }
  #client-list tr,
  #email-log tr {
    margin-top: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
  }
  #client-list td,
  #email-log td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 12px;
    overflow-wrap: anywhere;
  }
  #client-list td::before,
  #email-log td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
  }
  #client-list td:last-child,
  #email-log td:last-child { border-bottom: 0; }
  #client-list .notes-editor,
  #client-list .notes-editor form { min-width: 0; width: 100%; }
  .topbar { align-items: flex-start; gap: 12px; flex-direction: column; }
}

@media (max-width: 520px) {
  .home-features { grid-template-columns: 1fr; }
  .home-hero { min-height: auto; }
  .home-hero-panel { grid-template-columns: 1fr; }
  .home-hero .actions { align-items: stretch; flex-direction: column; }
}
