:root {
  --navy: #0b3d62;
  --navy-dark: #082c4a;
  --navy-hover: #0e4d7a;
  --teal: #1aa3a8;
  --teal-mid: #12808c;
  --teal-deep: #0b6a82;
  --step-on: #e8f5f6;
  --step-on-border: #8ecdd3;
  --page: #eef1f4;
  --text: #2a3340;
  --muted: #5b6775;
  --line: #d5dde4;
  --white: #fff;
  --danger: #9b2c2c;
  --ok: #1b6b4a;
  --radius: 14px;
  --shadow: 0 10px 28px rgba(16, 42, 67, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--page);
  min-height: 100vh;
}

a { color: var(--navy); }
.topbar {
  background: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid #e6ebf0;
}
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.logo img {
  display: block;
  height: 28px;
  width: auto;
}
.login-card .logo img {
  height: 32px;
}
.admin-side .logo {
  display: block;
  margin: 0 0 24px;
}
.admin-side .logo img {
  height: 22px;
  max-width: 160px;
}
.topbar-phone {
  color: var(--navy);
  font-size: 14px;
  text-align: right;
  line-height: 1.35;
}
.topbar-phone span { display: block; font-size: 12px; color: var(--muted); }

.hero {
  background: linear-gradient(105deg, #1aa3a8 0%, #127f8f 42%, #0c5f7c 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
  padding: 42px 24px 48px;
}
.hero::after {
  content: "";
  position: absolute;
  right: 6%;
  top: 10%;
  width: 280px;
  height: 220px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 140'><g fill='none' stroke='white' stroke-width='4' opacity='0.18'><circle cx='62' cy='18' r='10'/><path d='M62 28 L62 70 L40 110'/><path d='M62 48 L90 58 L78 110'/><circle cx='38' cy='118' r='14'/><circle cx='82' cy='118' r='14'/><path d='M52 118 H68'/></g></svg>") no-repeat center / contain;
  pointer-events: none;
}
.hero-inner { max-width: 920px; margin: 0 auto; position: relative; z-index: 1; }
.hero-kicker {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.9;
  margin: 0 0 10px;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero p { margin: 0; max-width: 640px; line-height: 1.55; font-size: 16px; }

.stepper {
  max-width: 920px;
  margin: 0 auto;
  padding: 18px 24px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.step {
  background: var(--white);
  border: 1px solid var(--line);
  color: #8a95a3;
  font-size: 13px;
  padding: 12px 10px;
  text-align: center;
  font-weight: 600;
}
.step.is-on {
  background: var(--step-on);
  border-color: var(--step-on-border);
  color: var(--navy);
}

.wrap { max-width: 920px; margin: 0 auto; padding: 22px 24px 48px; }
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 40px 40px;
}
.plz-map {
  height: 380px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 4px 0 10px;
  background: #eef2f5;
  position: relative;
  overflow: hidden;
}
.plz-map .leaflet-container,
.plz-map .maplibregl-map { font-family: inherit; height: 100%; }
.plz-map .leaflet-gl-layer,
.plz-map .maplibregl-map,
.plz-map .maplibregl-canvas {
  box-sizing: content-box;
}
.plz-map .maplibregl-ctrl-attrib { font-size: 11px; }
.map-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 8px;
}
.map-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid var(--line);
}
.map-swatch-on { background: #1aa3a8; border-color: #0e6e85; }
.map-swatch-off { background: #e6ebf0; }
.map-note { font-size: 12px; margin: 0 0 18px; }
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 40px 40px;
}
.card h2 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 28px;
}
.lead { color: var(--muted); line-height: 1.55; margin: 0 0 24px; }

label { display: block; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="number"],
select,
textarea {
  width: 100%;
  max-width: 420px;
  border: 1px solid #cfd8e0;
  border-radius: 4px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--white);
}
textarea { min-height: 90px; max-width: 100%; }
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  min-height: 42px;
  color-scheme: light;
  line-height: 1.2;
}
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit {
  padding: 0;
  color: var(--text);
}
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper,
input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}
input[type="time"]::-webkit-inner-spin-button,
input[type="time"]::-webkit-clear-button {
  display: none;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  width: 18px;
  height: 18px;
  margin: 0 0 0 8px;
  padding: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230b3d62' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4.5' width='18' height='16.5' rx='2'/><path d='M16 2.5v4M8 2.5v4M3 10h18'/></svg>");
}
input[type="time"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230b3d62' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 7.5V12l3 2'/></svg>");
}
.field { margin-bottom: 18px; }
.req { color: #8b2e2e; font-weight: 700; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  max-width: 640px;
}

.btn {
  appearance: none;
  border: 0;
  background: var(--navy);
  color: var(--white);
  font: inherit;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
}
.btn:hover { background: var(--navy-hover); }
.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
}
.btn-danger { background: #8b2e2e; }
.btn-small { padding: 7px 12px; font-size: 13px; font-weight: 600; }

.alert {
  background: #fdecec;
  color: var(--danger);
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 18px;
}
.alert-ok {
  background: #e8f6ee;
  color: var(--ok);
}

.slot-day { margin: 0 0 18px; }
.slot-day h3 { margin: 0 0 10px; color: var(--navy); font-size: 16px; }
.slot-list { display: flex; flex-wrap: wrap; gap: 10px; }
.slot-option {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  min-width: 148px;
  text-align: center;
}
.slot-option input { margin-right: 6px; }
.slot-option:has(input:checked) {
  border-color: var(--teal-mid);
  background: var(--step-on);
  color: var(--navy);
  font-weight: 700;
}

.check { display: flex; gap: 10px; align-items: flex-start; max-width: 640px; }
.check input { margin-top: 4px; }
.muted { color: var(--muted); }
.phone-box {
  margin-top: 18px;
  font-weight: 700;
  color: var(--navy);
  font-size: 18px;
}

.site-footer {
  text-align: center;
  color: #8b95a1;
  font-size: 13px;
  padding: 8px 24px 28px;
}
.site-footer a { color: inherit; }

.admin-body { background: #f4f6f8; }
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-side {
  background: var(--navy-dark);
  color: var(--white);
  padding: 22px 16px;
}
.admin-side a {
  color: #d5e4f0;
  text-decoration: none;
  display: block;
  padding: 9px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.admin-side a.is-on, .admin-side a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.admin-main { padding: 28px; }
.admin-main h1 { margin-top: 0; color: var(--navy); }
.admin-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}
.admin-page-head h1 { margin: 0; }
.slot-filter { margin: 0 0 8px; }
.slot-check-col {
  width: 36px;
  text-align: center;
  vertical-align: middle;
}
.slot-check-col input { margin: 0; }
.slot-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.slot-bulk-count {
  color: var(--muted);
  font-size: 13px;
  margin-right: 4px;
}
tr.slot-item.is-selected td { background: #eef7f7; }
.slot-day-row td {
  background: #eef4f8;
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  padding-top: 12px;
  padding-bottom: 8px;
  border-bottom-color: #d5e4f0;
}
.admin-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 440px;
  width: calc(100% - 32px);
  color: var(--text);
  box-shadow: var(--shadow);
}
.admin-dialog::backdrop {
  background: rgba(8, 44, 74, 0.45);
}
.admin-dialog h2 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 20px;
}
.admin-dialog p { margin: 0 0 12px; line-height: 1.45; }
.admin-dialog .field-row-actions { margin: 8px 0 0; }
.slot-day-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.slot-day-label input { margin: 0; }
.weekday-set {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px 12px;
  margin: 0 0 16px;
  background: #fff;
}
.weekday-set legend {
  padding: 0 6px;
  color: var(--navy);
  font-weight: 600;
  font-size: 14px;
}
.weekday-set .check {
  max-width: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.weekday-set .check input { margin: 0; }
#slot-window:has(#offer-availability:checked) .field-pack-duration {
  display: none;
}
code {
  font-size: 13px;
  background: #f7fafc;
  padding: 2px 6px;
  border-radius: 4px;
}
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; font-size: 14px; vertical-align: top; }
th { background: #f7fafc; color: var(--navy); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge-pending { background: #fff4d6; color: #8a6d12; }
.badge-confirmed { background: #e5f6ea; color: #1b6b4a; }
.badge-expired { background: #eee; color: #666; }
.badge-cancelled { background: #fdecec; color: #9b2c2c; }
.inline-form { display: inline; }
.booking-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 140px;
}
.booking-actions form { margin: 0; }
.booking-actions .btn { text-align: center; width: 100%; box-sizing: border-box; }
.audit-filters { margin-bottom: 8px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.booking-toolbar { padding-bottom: 14px; }
.booking-search { margin: 0; }
.booking-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7fbfb;
  border: 1px solid var(--step-on-border);
  border-radius: 10px;
  padding: 6px 6px 6px 14px;
}
.booking-search-bar:focus-within {
  border-color: var(--teal-mid);
  box-shadow: 0 0 0 3px rgba(26, 163, 168, 0.18);
  background: var(--white);
}
.booking-search-icon {
  display: flex;
  color: var(--teal-mid);
  flex: 0 0 auto;
}
.booking-search-input {
  flex: 1 1 auto;
  max-width: none !important;
  border: 0 !important;
  background: transparent !important;
  padding: 10px 4px !important;
  box-shadow: none;
  outline: none;
  font-size: 15px;
}
.booking-search-input::-webkit-search-decoration,
.booking-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.booking-search-clear {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.booking-search-clear:hover {
  background: #e8f0f2;
  color: var(--navy);
}
.booking-search-submit {
  flex: 0 0 auto;
  padding: 10px 18px;
  border-radius: 8px;
}
.booking-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}
.booking-status-tabs a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.booking-status-tabs a:hover { border-color: var(--teal-mid); background: var(--step-on); }
.booking-status-tabs a.is-on {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.booking-search-meta {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.booking-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.booking-pager-status {
  color: var(--navy);
  font-weight: 600;
  font-size: 14px;
  min-width: 120px;
  text-align: center;
}
.booking-pager .is-disabled {
  opacity: 0.4;
  pointer-events: none;
}
@media (max-width: 720px) {
  .booking-search-bar { flex-wrap: wrap; padding: 10px; }
  .booking-search-icon { display: none; }
  .booking-search-submit { width: 100%; }
}
.audit-details { margin-top: 6px; font-size: 12px; }
.admin-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px 16px;
  margin-bottom: 22px;
}
.admin-panel h2 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 18px;
}
.admin-panel-lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}
.admin-panel-create {
  border-color: var(--step-on-border);
  background: #f7fbfb;
}
.admin-panel table { margin: 4px 0 0; }
.admin-main .plz-map,
.admin-plz-map {
  max-width: 100%;
  height: 440px;
  margin: 0 0 12px;
}
.login-card { max-width: 420px; margin: 80px auto; background: #fff; padding: 32px; border-radius: var(--radius); box-shadow: var(--shadow); }

.suggest { position: relative; max-width: 100%; }
.suggest input { max-width: 100%; }
.suggest-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 10px);
  z-index: 20;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow: auto;
}
.suggest-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  cursor: pointer;
}
.suggest-item.is-active,
.suggest-item:hover { background: var(--step-on); }
.suggest-title { color: var(--navy); font-weight: 600; }
.suggest-detail { color: var(--muted); font-size: 12px; }
.address-hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.extra-fields { margin: 0 0 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.service-fields { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.service-fields h3 { margin: 0; font-size: 16px; color: var(--navy); }
.service-fields h4 { margin: 0 0 12px; font-size: 15px; color: var(--navy); }
.service-fields-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 6px;
}
.field-hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.field-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.field-row-actions .btn { margin: 0; }
.field-form-panel {
  margin-top: 16px;
  padding: 16px 18px 8px;
  border: 1px solid var(--step-on-border);
  border-radius: 8px;
  background: #f7fbfb;
}
tr.is-editing td { background: #f7fbfb; }
.booking-extra { color: var(--muted); font-size: 13px; margin-top: 4px; }
.extra-answers { margin: 0 0 16px; padding: 0; list-style: none; color: var(--text); font-size: 14px; }
.extra-answers li { margin: 0 0 4px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 0 0 8px;
}
.stat-card {
  background: #f7fbfb;
  border: 1px solid var(--step-on-border);
  border-radius: 8px;
  padding: 12px 14px;
}
.stat-card-total {
  background: var(--navy);
  border-color: var(--navy);
}
.stat-card-total .stat-value,
.stat-card-total .stat-label { color: var(--white); }
.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;
}
.stat-label { color: var(--muted); font-size: 13px; margin-top: 2px; }
.funnel-row {
  display: grid;
  grid-template-columns: 150px minmax(80px, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  margin: 0 0 8px;
  font-size: 14px;
}
.funnel-label { color: var(--navy); font-weight: 600; }
.funnel-track {
  height: 18px;
  background: #e8eef3;
  border-radius: 4px;
  overflow: hidden;
}
.funnel-track span {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 4px;
  min-width: 0;
}
.funnel-nums { white-space: nowrap; color: var(--navy); font-weight: 600; }
.analyse-help {
  background: #f7fbfb;
  border: 1px solid var(--step-on-border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.analyse-help code {
  display: inline-block;
  margin: 2px 0;
  word-break: break-all;
}
.channel-create { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }

.totp-qr {
  display: inline-block;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 4px 0 12px;
}
.totp-qr svg { display: block; width: 180px; height: 180px; }
.totp-secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
  word-break: break-all;
  margin: 0 0 8px;
}
.totp-uri { word-break: break-all; font-size: 12px; }

@media (max-width: 800px) {
  .stepper { grid-template-columns: 1fr 1fr; }
  .card { padding: 24px 18px; }
  .hero h1 { font-size: 30px; }
  .grid-2 { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .funnel-row { grid-template-columns: 1fr; gap: 4px; }
}
