:root {
  --brand: #1a3a6b;
  --brand-ink: #1a3a6b;        /* brand used as text / accents */
  --brand-light: #eef3fb;
  --brand-hover: #14305a;
  --text: #1a1a1a;
  --text-mid: #4a4a4a;
  --text-light: #73819a;
  --border: #e4e7ec;
  --border-soft: #f0f2f5;
  --input-border: #c5cbd6;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f7f8fa;        /* hover, code boxes */
  --surface-3: #fbfcfd;        /* notes */
  --pill-bg: #eef0f3;
  --pill-text: #6b7280;
  --danger: #c8102e;
  --danger-bg: #fff5f6;
  --danger-border: #f0c2c9;
  --ok: #2e7d32;
  --shadow: 0 2px 14px rgba(20,30,60,.07);
  --radius: 10px;
  color-scheme: light;
}
/* Dark mode: follows the system, unless Light or Dark was picked in the top bar */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #4a8fe0; --brand-ink: #8ab8f0; --brand-light: #1c2b44; --brand-hover: #5c9ce6;
    --text: #e9eef4; --text-mid: #c2cbd6; --text-light: #8fa0b3;
    --border: #2a3542; --border-soft: #232d38; --input-border: #3a4756;
    --bg: #0e1318; --surface: #171e26; --surface-2: #1e2731; --surface-3: #1b242e;
    --pill-bg: #253040; --pill-text: #aab6c5;
    --danger: #ff8a80; --danger-bg: #2a1c1c; --danger-border: #4a2a2a;
    --shadow: 0 2px 14px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #4a8fe0; --brand-ink: #8ab8f0; --brand-light: #1c2b44; --brand-hover: #5c9ce6;
  --text: #e9eef4; --text-mid: #c2cbd6; --text-light: #8fa0b3;
  --border: #2a3542; --border-soft: #232d38; --input-border: #3a4756;
  --bg: #0e1318; --surface: #171e26; --surface-2: #1e2731; --surface-3: #1b242e;
  --pill-bg: #253040; --pill-text: #aab6c5;
  --danger: #ff8a80; --danger-bg: #2a1c1c; --danger-border: #4a2a2a;
  --shadow: 0 2px 14px rgba(0,0,0,.4);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); }
.loading { padding: 60px 20px; text-align: center; color: var(--text-light); font-size: 14px; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 32px 30px 28px; box-shadow: var(--shadow);
}
.auth-brand { font-size: 15px; font-weight: 800; color: var(--brand-ink); letter-spacing: -.2px; margin-bottom: 18px; }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.3px; }
.auth-sub { color: var(--text-light); font-size: 14px; margin: 0 0 22px; line-height: 1.5; }
.auth-card label { display: block; font-size: 13.5px; font-weight: 650; margin: 14px 0 5px; }
.auth-card input, .auth-card select, .auth-card textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--input-border); border-radius: 6px;
  font-size: 15px; font-family: inherit; background: var(--surface); color: var(--text);
}
.auth-card input:focus, .auth-card select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light);
}
.auth-card .row { display: flex; gap: 12px; }
.auth-card .row > div { flex: 1; min-width: 0; }
.hint { font-size: 12.5px; color: var(--text-light); margin-top: 5px; }
.btn-primary {
  width: 100%; margin-top: 20px; padding: 12px; border: none; border-radius: 24px;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 650;
  font-family: inherit; cursor: pointer;
}
.btn-primary:disabled { background: #a8b2c2; cursor: not-allowed; }
.form-msg { font-size: 13.5px; margin-top: 12px; min-height: 18px; color: var(--danger); font-weight: 600; }
.auth-alt { text-align: center; font-size: 13.5px; color: var(--text-light); margin: 20px 0 0; }

/* ---------- landing ---------- */
.landing { max-width: 960px; margin: 0 auto; padding: 0 20px 60px; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.landing-brand { font-size: 18px; font-weight: 800; color: var(--brand-ink); letter-spacing: -.3px; }
.landing-nav nav { display: flex; align-items: center; gap: 18px; font-size: 14.5px; }
.landing-nav a { text-decoration: none; font-weight: 600; }
.btn-small { background: var(--brand); color: #fff !important; padding: 8px 16px; border-radius: 20px; }
.hero { text-align: center; padding: 56px 0 40px; }
.hero h1 { font-size: 40px; line-height: 1.15; margin: 0 0 16px; letter-spacing: -1px; }
.hero p { font-size: 17px; color: var(--text-mid); max-width: 620px; margin: 0 auto 26px; line-height: 1.6; }
.btn-hero { display: inline-block; width: auto; padding: 13px 30px; text-decoration: none; margin-top: 0; }
.hero-sub { font-size: 13.5px !important; color: var(--text-light) !important; margin-top: 14px !important; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 30px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px 22px 24px; }
.feature h3 { margin: 0 0 8px; font-size: 16.5px; }
.feature p { margin: 0; color: var(--text-mid); font-size: 14.5px; line-height: 1.55; }

/* ---------- app shell ---------- */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 26px; display: flex; align-items: center; gap: 26px;
}
.topbar .brand { font-size: 16px; font-weight: 800; color: var(--brand-ink); padding: 16px 0; letter-spacing: -.2px; }
.topbar .shopname { font-size: 14px; color: var(--text-light); }
.topbar .spacer { flex: 1; }
.topbar .navlink {
  padding: 18px 2px 15px; font-size: 14.5px; font-weight: 650; color: var(--text-light);
  cursor: pointer; border-bottom: 3px solid transparent; background: none; border-top: none;
  border-left: none; border-right: none; font-family: inherit;
}
.topbar .navlink.active { color: var(--brand-ink); border-bottom-color: var(--brand); }
.topbar .theme { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.topbar .theme-btn {
  font-size: 12px; font-weight: 650; color: var(--text-light); background: none; border: none;
  padding: 4px 9px; border-radius: 6px; cursor: pointer; font-family: inherit;
}
.topbar .theme-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.topbar .signout { font-size: 13.5px; color: var(--text-light); background: none; border: none; cursor: pointer; font-family: inherit; }
.page { max-width: 980px; margin: 0 auto; padding: 24px 20px 60px; }
.page h1 { font-size: 23px; margin: 0 0 4px; letter-spacing: -.3px; }
.page .page-sub { color: var(--text-light); font-size: 14px; margin: 0 0 20px; }

/* ---------- bookings ---------- */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 0 2px 12px; font-size: 14.5px; font-weight: 650; color: var(--text-light);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: none; border-top: none; border-left: none; border-right: none; font-family: inherit;
}
.tab.active { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tab .badge {
  display: inline-block; background: var(--brand-light); color: var(--brand-ink);
  border-radius: 10px; padding: 1px 7px; font-size: 12px; margin-left: 5px;
}
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
select, .search, input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=email], input[type=tel], textarea {
  padding: 8px 11px; border: 1px solid var(--input-border); border-radius: 7px; font-size: 14px;
  font-family: inherit; background: var(--surface); color: var(--text);
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--brand); }
.search { flex: 1; min-width: 180px; max-width: 300px; }
.btn {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-mid);
  padding: 8px 14px; border-radius: 7px; font-size: 13.5px; font-family: inherit;
  cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--surface-2); }
.btn-accent { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-accent:hover { background: var(--brand-hover); }
.push-right { margin-left: auto; }

.daygroup { margin-top: 22px; }
.daylabel {
  font-size: 13px; font-weight: 700; color: var(--text-light);
  letter-spacing: .3px; text-transform: uppercase; margin-bottom: 10px;
}
/* a booking (or a drop-off group) is one row: coloured bar, time, title */
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  color: var(--text-mid); background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 12px; cursor: pointer; font-family: inherit;
}
.chip.active { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-light); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.daylabel .daycount { font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 12.5px; opacity: .85; margin-left: 10px; }
.row {
  border: 1px solid var(--border); border-left: 5px solid var(--svc, var(--brand));
  border-radius: var(--radius); margin-bottom: 8px; background: var(--surface); overflow: hidden;
}
.row.cancelled { opacity: .6; border-left-color: var(--input-border); }
.row-head {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px; cursor: pointer; user-select: none;
}
.row-head:hover { background: var(--surface-2); }
.row-time { font-size: 14.5px; font-weight: 700; min-width: 86px; color: var(--text); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 15.5px; font-weight: 650; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.row-title .svc-tag { color: var(--svc, var(--brand-ink)); }
.row-title .with { font-weight: 500; color: var(--text-light); }
.row-sub { font-size: 13px; color: var(--text-light); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.row-actions .chev { color: var(--text-light); display: inline-flex; transition: transform .15s; }
.row-head.open .chev { transform: rotate(180deg); }
.row-body { display: none; padding: 0 16px 14px 116px; border-top: 1px solid var(--border-soft); }
.row-body.open { display: block; }
.row-foot { margin-top: 12px; display: flex; justify-content: flex-end; }
.spots { font-size: 12.5px; font-weight: 650; color: var(--text-light); }
.spots.full { color: var(--danger); }
.group-when { font-size: 13px; color: var(--text-light); padding: 10px 0 2px; font-weight: 600; }
.attendee { border-top: 1px solid var(--border-soft); padding: 12px 0 4px; }
.attendee-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.attendee-head .spacer { flex: 1; }
.pill-pink { color: #d6457a; background: rgba(214,69,122,.14); }
@media (max-width: 700px) {
  .row-body { padding-left: 16px; }
  .row-time { min-width: 64px; font-size: 13.5px; }
}
.btn-cancel {
  background: none; border: 1px solid var(--border); color: var(--danger); padding: 7px 13px;
  border-radius: 7px; font-size: 13px; font-family: inherit; cursor: pointer; font-weight: 650;
}
.btn-cancel:hover { background: var(--danger-bg); border-color: var(--danger-border); }
.btn-cancel:disabled { opacity: .5; cursor: default; }
.bk-details {
  margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--border-soft);
  display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 13.5px; color: var(--text-mid);
}
.bk-details .item { display: flex; gap: 7px; align-items: flex-start; }
.bk-details .k { color: var(--text-light); font-weight: 600; }
.bk-details a { color: var(--brand-ink); text-decoration: none; font-weight: 600; }
.bk-notes {
  margin-top: 9px; font-size: 13.5px; color: var(--text-mid); background: var(--surface-3);
  border: 1px solid var(--border-soft); border-radius: 7px; padding: 9px 11px; line-height: 1.5;
}
.pill {
  font-size: 11.5px; font-weight: 700; color: var(--pill-text); background: var(--pill-bg);
  border-radius: 10px; padding: 2px 9px; letter-spacing: .3px;
}
.pill-staff { color: var(--brand-ink); background: var(--brand-light); }
.empty { text-align: center; padding: 50px 20px; color: var(--text-light); font-size: 14.5px; }

/* ---------- cards / settings ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 22px 22px; margin-bottom: 16px;
}
.card h2 { font-size: 16.5px; margin: 0 0 4px; }
.card .card-sub { font-size: 13.5px; color: var(--text-light); margin: 0 0 16px; line-height: 1.5; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.field-row > div { flex: 1; min-width: 180px; }
.field-row label, .card label {
  display: block; font-size: 13px; font-weight: 650; margin-bottom: 5px; color: var(--text);
}
.card input, .card select, .card textarea { width: 100%; }
.card textarea { min-height: 70px; resize: vertical; }

.svc-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 9px; background: var(--surface);
}
.svc-row.inactive { opacity: .55; }
.svc-row .grow { flex: 1; min-width: 0; }
.svc-row .nm { font-size: 15px; font-weight: 650; }
.svc-row .sub { font-size: 13px; color: var(--text-light); margin-top: 3px; }

.hours-grid { display: grid; grid-template-columns: 88px 1fr 1fr 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.hours-grid .dayname { font-size: 13.5px; font-weight: 650; }
.hours-head { font-size: 12px; color: var(--text-light); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }

.modal-back {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex;
  align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50;
}
.modal {
  background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px;
  padding: 24px 26px 26px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.modal h2 { margin: 0 0 4px; font-size: 18px; }
.modal label { display: block; font-size: 13px; font-weight: 650; margin-bottom: 5px; color: var(--text); }
.modal input, .modal select, .modal textarea { width: 100%; }
.modal textarea { min-height: 70px; resize: vertical; }
.modal .hours-grid input[type=checkbox] { width: auto; justify-self: center; }
.modal .modal-sub { color: var(--text-light); font-size: 13.5px; margin: 0 0 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.embed-box {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; color: var(--text-mid); word-break: break-all; line-height: 1.6; margin-bottom: 10px;
}
.copy-row { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 11px 20px; border-radius: 24px;
  font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.2); opacity: 0;
  transition: opacity .2s; pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; }

@media (max-width: 700px) {
  .topbar { padding: 0 14px; gap: 16px; overflow-x: auto; }
  .page { padding: 18px 14px 50px; }
  .hero h1 { font-size: 30px; }
  .hours-grid { grid-template-columns: 70px 1fr 1fr 30px; }
}

.bk-shopnote { border-left: 3px solid var(--brand); }
.bk-shopnote .k { font-weight: 600; color: var(--brand-ink); }
.attendee-time { font-weight: 700; color: var(--svc, var(--brand-ink)); min-width: 84px; }
