:root {
  --navy: #0c2d49;
  --navy-2: #174260;
  --blue: #4d9fd0;
  --blue-dark: #256f9f;
  --soft-blue: #eef8fd;
  --soft-blue-2: #f8fcfe;
  --teal: #27aaa4;
  --teal-soft: #edf9f7;
  --green: #167a54;
  --orange: #a85e0f;
  --red: #ad3434;
  --ink: #142b3d;
  --muted: #647b89;
  --line: #e2edf3;
  --line-strong: #c9dce7;
  --surface: #ffffff;
  --background: #f8fbfd;
  --shadow: 0 14px 34px rgba(12, 45, 73, 0.055);
  --shadow-soft: 0 8px 20px rgba(12, 45, 73, 0.045);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--background); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(234, 245, 251, 0.88) 0, rgba(244, 248, 251, 0) 360px),
    var(--background);
  color: var(--ink);
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .62; }

:focus-visible {
  outline: 3px solid rgba(28, 154, 150, .34);
  outline-offset: 3px;
}

.topbar {
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 56px);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.brand-row { display: flex; align-items: center; gap: 13px; min-width: 0; }
.logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--navy), var(--blue) 62%, var(--teal));
  color: white;
  box-shadow: var(--shadow-soft);
  font-size: 1.35rem;
  font-weight: 950;
  letter-spacing: 0;
}
.brand {
  color: var(--navy);
  font-weight: 950;
  letter-spacing: .04em;
  font-size: clamp(.9rem, 2.4vw, 1.05rem);
  line-height: 1.18;
}
.tagline { color: var(--muted); font-size: .88rem; margin-top: 3px; }
.mode-badge {
  border: 1px solid #91cdd0;
  background: var(--teal-soft);
  color: #0b6865;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  cursor: pointer;
  font-family: inherit;
}
.mode-badge.pending-bookings,
.admin-urgent-actions .pending-bookings {
  border-color: #b42318;
  background: #b42318;
  color: #fff;
}
.admin-urgent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.admin-urgent-actions button { min-height: 46px; }

.tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px clamp(16px, 4vw, 56px);
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.staff-menu {
  position: relative;
  margin-left: auto;
}
.staff-menu summary {
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--blue-dark);
  font-size: .86rem;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}
.staff-menu summary::-webkit-details-marker { display: none; }
.staff-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  gap: 8px;
  width: min(260px, 86vw);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.staff-tab {
  width: 100%;
  text-align: left;
}
.tab {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  background: transparent;
  color: #4e6676;
  font-weight: 850;
  white-space: nowrap;
}
.tab:hover { background: var(--soft-blue); color: var(--navy); }
.tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
  box-shadow: 0 8px 18px rgba(11, 39, 66, .14);
}

.shell { max-width: 1240px; margin: 0 auto; padding: 30px 16px 72px; }
.view { display: none; }
.view.active { display: block; }

.hero, .card-head, .toolbar, .split-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.hero {
  margin-bottom: 12px;
  padding: clamp(12px, 2vw, 18px);
  border: 1px solid rgba(191, 211, 223, .8);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(234, 245, 251, .96)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}
.hero h1 {
  margin: 0 0 4px;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1.05;
  color: var(--navy);
  letter-spacing: 0;
}
.hero p { margin: 0; color: var(--muted); max-width: 680px; }
.hero-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
  min-width: min(360px, 100%);
}
.hero-panel span {
  background: white;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 999px;
  color: var(--navy);
  font-size: .9rem;
  font-weight: 850;
  padding: 7px 10px;
  box-shadow: var(--shadow-soft);
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--blue-dark);
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .1em;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .85fr);
  gap: 16px;
  margin-bottom: 18px;
}
.booking-layout { align-items: start; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 24px);
  margin-bottom: 20px;
}
.card h2 { margin: 0 0 18px; font-size: 1.24rem; color: var(--navy); letter-spacing: 0; }
.card h3 { margin: 0 0 12px; color: var(--navy); font-size: 1rem; }
.sticky { position: sticky; top: 118px; align-self: start; }
.summary-card { border-top: 4px solid var(--teal); }
.task-completion-panel {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #f8fcfc;
}
.task-completion-panel .primary,
.task-completion-panel .secondary,
.task-completion-panel .danger { margin: 8px 8px 0 0; }
.completion-record { padding: 10px; background: #eaf8f1; border-radius: 6px; }
.problem-report-fields { margin-top: 12px; }
.admin-task-event { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #f8fbfd; }
.admin-task-event.error { border-color: #d92d20; background: #fff4f2; }

.control-centre {
  display: grid;
  gap: 12px;
}
.control-centre.hidden { display: none; }
.control-centre .admin-status-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
.control-centre .admin-status-row h2 { margin: 0; color: var(--navy); font-size: 1.34rem; }
.control-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.control-card > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
}
.control-card > summary::-webkit-details-marker { display: none; }
.control-card > summary span {
  color: var(--navy);
  font-weight: 950;
  font-size: 1rem;
}
.control-card > summary small {
  color: var(--muted);
  text-align: right;
}
.control-card[open] > summary {
  border-bottom: 1px solid var(--line);
  background: var(--soft-blue-2);
}
.control-card-body {
  padding: 18px;
}
.advanced-card .notice { margin-bottom: 14px; }
.advanced-actions { margin-bottom: 14px; }
.compact-head { margin-bottom: 14px; }
.operation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.operation-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}
.operation-panel h3 { margin: 0 0 8px; color: var(--navy); font-size: .98rem; }
.attention-panel { margin-top: 12px; }
.mini-booking {
  display: grid;
  gap: 3px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.mini-booking:last-child { border-bottom: 0; }
.booking-inline-details summary {
  color: var(--navy);
  cursor: pointer;
}
.booking-inline-details .small {
  margin-top: 6px;
  min-width: 180px;
}
.plain-list {
  margin: 0;
  padding-left: 18px;
}
.customer-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.customer-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.booking-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0 0 10px;
  list-style: none;
}
.booking-progress li {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .92);
  color: var(--navy);
  box-shadow: var(--shadow-soft);
}
.booking-progress span,
.section-title span {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: white;
  font-weight: 950;
  font-size: .82rem;
}
.booking-progress strong {
  overflow-wrap: anywhere;
  font-size: .82rem;
  line-height: 1.2;
}
.form-intro { margin-bottom: 0; }
.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(15px, 2vw, 20px);
  margin-bottom: 14px;
  background: linear-gradient(180deg, #fff, #fbfdfe);
}
.form-section:last-child { margin-bottom: 0; }
.form-section.booking-accordion {
  padding: 0;
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.form-section.booking-accordion > summary {
  list-style: none;
  width: 100%;
  min-height: 78px;
  padding: clamp(16px, 2.5vw, 22px);
  margin: 0;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.booking-accordion > summary::-webkit-details-marker { display: none; }
.booking-accordion > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--teal);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
}
.booking-accordion[open] > summary::after { content: "−"; }
.booking-accordion.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(39, 170, 164, .12), var(--shadow-soft);
}
.booking-accordion.active > summary { background: var(--teal-soft); }
.booking-accordion-content {
  padding: 2px clamp(15px, 2vw, 20px) clamp(18px, 2.5vw, 24px);
  border-top: 1px solid var(--line);
}
.section-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.section-title h3 { margin: 0 0 3px; color: var(--navy); }
.section-title p,
.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}
.service-accordion,
.category-cards,
.service-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.service-accordion {
  grid-template-columns: 1fr;
}
.category-cards {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.service-category-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.category-card,
.service-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: white;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.category-card {
  min-height: 112px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.service-card {
  position: relative;
  min-height: 190px;
}
.category-card:hover,
.service-card:hover {
  border-color: var(--blue);
  background: var(--soft-blue-2);
}
.category-card.selected,
.service-card.selected {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 2px rgba(28, 154, 150, .28), var(--shadow-soft);
}
.category-card.selected {
  box-shadow: inset 0 -1px 0 var(--line);
}
.category-service-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding: 14px;
  background: var(--soft-blue-2);
}
.category-count {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--soft-blue-2);
  color: var(--blue-dark);
  font-size: .76rem;
  font-weight: 900;
  white-space: nowrap;
}
.category-card strong,
.service-card strong {
  display: block;
  color: var(--navy);
  font-size: 1rem;
  margin-bottom: 6px;
}
.category-card p,
.service-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .86rem;
}
.service-card p {
  min-height: 42px;
}
.selected-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1px solid #91cdd0;
  border-radius: 999px;
  background: var(--teal-soft);
  color: #0b6865;
  padding: 4px 8px;
  font-size: .7rem;
  font-weight: 950;
}
.service-picker-head {
  margin: 18px 0 12px;
}
.service-picker-head h3 {
  margin: 0 0 3px;
}
.service-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.service-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--soft-blue-2);
  color: var(--blue-dark);
  font-size: .76rem;
  font-weight: 900;
}
.select-fallback { margin-bottom: 0; }
.hidden-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.dynamic-fields {
  display: grid;
  gap: 14px;
}
.detail-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--soft-blue-2);
}
.detail-group h4 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: .96rem;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.detail-grid .wide {
  grid-column: 1 / -1;
}
.field-note {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  margin-left: 4px;
}
.required-mark {
  color: var(--red);
  font-weight: 950;
}
.quote-callout {
  border: 1px solid #efd1a5;
  border-radius: 8px;
  background: #fff8ec;
  color: var(--orange);
  padding: 11px 12px;
  font-weight: 850;
}
.policy-note {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--soft-blue-2);
  color: var(--ink);
  padding: 11px 12px;
  margin: 0 0 14px;
  font-size: .9rem;
}

label, legend { color: var(--navy); font-size: .9rem; font-weight: 850; }
label { display: block; margin-bottom: 16px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 11px 12px;
  margin-top: 7px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
}
input:hover, select:hover, textarea:hover { border-color: #9bb9ca; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(28, 154, 150, .2);
  border-color: var(--teal);
}
textarea { resize: vertical; min-height: 92px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 0 0 16px;
  background: var(--soft-blue-2);
}
legend { padding: 0 7px; }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 9px; margin-top: 10px; }
.slot {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 11px 10px;
  min-height: 46px;
  background: white;
  font-weight: 900;
  color: var(--navy);
  box-shadow: 0 1px 0 rgba(11, 39, 66, .03);
}
.slot:hover { border-color: var(--blue); background: var(--soft-blue); }
.slot.selected {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #075d5a;
  box-shadow: inset 0 0 0 1px var(--teal);
}
.slot small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
}
.slot.selected small { color: #075d5a; }

.primary, .secondary, .danger, .small-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 900;
  padding: 11px 15px;
  min-height: 44px;
}
.primary {
  width: 100%;
  background: var(--navy);
  color: white;
  box-shadow: 0 10px 22px rgba(11, 39, 66, .16);
}
.primary:hover { background: var(--navy-2); }
.secondary {
  background: var(--soft-blue);
  color: var(--blue-dark);
  border-color: #c5dce8;
}
.secondary:hover { background: #dff0f8; }
.danger { background: #fff1f1; color: var(--red); border-color: #e4b8b8; }
.danger:hover { background: var(--red); color: white; }
.small-btn {
  padding: 8px 11px;
  min-height: 36px;
  background: var(--soft-blue);
  color: var(--blue-dark);
  border-color: #c5dce8;
  font-size: .82rem;
}
.small-btn.red { background: #fff1f1; color: var(--red); border-color: #e7bcbc; }
.small-btn.red:hover { background: var(--red); color: white; }

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
  background: var(--soft-blue-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.check-row input { width: auto; min-height: auto; margin: 4px 0 0; }

.summary-line {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(120px, 1.2fr);
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.summary-line span { color: var(--muted); font-size: .9rem; }
.summary-line strong:last-child { text-align: right; color: var(--navy); }
.summary-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 14px 2px;
  margin-bottom: 12px;
  background: #fbfdfe;
}
.summary-title {
  margin: 6px 0 0;
  color: var(--blue-dark);
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.summary-group .summary-line:last-child { border-bottom: 0; }
.summary-total {
  margin-top: 4px;
  padding: 14px 0 0;
  border-bottom: 0;
  font-size: 1.12rem;
}
.summary-total strong:last-child { color: #08736f; font-size: 1.35rem; }
.muted { color: var(--muted); }
.small { color: var(--muted); font-size: .88rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

.notice {
  margin-bottom: 20px;
  border: 1px solid #96d2d0;
  background: var(--teal-soft);
  color: #075d5a;
  border-radius: 8px;
  padding: 13px 16px;
  font-weight: 850;
  box-shadow: var(--shadow-soft);
}
.notice.error { background: #fff1f1; border-color: #e1adad; color: var(--red); }
.hidden { display: none !important; }

.empty {
  padding: 24px;
  border: 1px dashed #acc2cf;
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  background: var(--soft-blue-2);
  font-weight: 650;
}
.compact-empty { padding: 14px; text-align: left; }

.booking, .job, .timeoff {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #fff, #fbfdfe);
  box-shadow: 0 1px 0 rgba(11, 39, 66, .03);
}
.booking-head, .job-head, .timeoff {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.booking strong, .job strong { color: var(--navy); }
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 9px 16px;
  margin-top: 13px;
  color: var(--muted);
  font-size: .9rem;
}
.meta-grid strong { color: #365162; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  min-height: 28px;
  border: 1px solid #bfd9e8;
  background: var(--soft-blue);
  color: var(--blue-dark);
  font-size: .74rem;
  white-space: nowrap;
  font-weight: 950;
  letter-spacing: .02em;
}
.pill.good { background: #e8f6ef; color: var(--green); border-color: #b7dfca; }
.pill.warn { background: #fff5e5; color: var(--orange); border-color: #efd1a5; }
.pill.bad { background: #fff0f0; color: var(--red); border-color: #e5b9b9; }

#availabilityRows {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.availability-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-blue-2);
}
.day-check { display: flex; align-items: center; gap: 9px; margin: 0; }
.day-check input { width: auto; min-height: auto; margin: 0; }
.availability-row label { margin: 0; }

.toolbar { justify-content: flex-start; padding: 16px 18px; }
.toolbar label { margin: 0; min-width: min(320px, 100%); }
.inline-form { display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 10px; align-items: end; margin-bottom: 14px; }
.inline-form input { margin: 0; }

.login-card {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(280px, .7fr);
  gap: 24px;
  align-items: start;
  border-top: 4px solid var(--teal);
}
.admin-auth-card {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(280px, .7fr);
  gap: 24px;
  align-items: start;
  border-left: 4px solid var(--teal);
}
.admin-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.admin-status-row .secondary {
  width: auto;
}
.login-card h2,
.session-bar h2 {
  margin-bottom: 8px;
}
.login-form {
  background: var(--soft-blue-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.login-error {
  margin-top: 12px;
  border: 1px solid #e1adad;
  background: #fff1f1;
  color: var(--red);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 850;
}
.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 4px solid var(--teal);
}
.session-bar .secondary {
  flex: 0 0 auto;
}

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  padding: 18px;
  border-top: 4px solid var(--blue);
}
.metric:nth-child(3) { border-top-color: var(--teal); }
.metric-value {
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.1;
  font-weight: 950;
  color: var(--navy);
  margin-top: 8px;
}
.metric-hint {
  color: var(--muted);
  font-size: .82rem;
  margin-top: 6px;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 920px; background: white; }
th, td { text-align: left; padding: 13px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  color: #4f6878;
  background: var(--soft-blue-2);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfe; }
td select, td input { margin: 0; padding: 8px; min-width: 128px; min-height: 38px; }
td .pill + select { display: block; margin-top: 8px; }

.service-row {
  display: grid;
  grid-template-columns: 1.4fr .7fr .8fr .8fr auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--soft-blue-2);
}
.service-row label { margin: 0; }
.service-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 12px;
  overflow: hidden;
}
.service-category-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-blue-2);
  padding: 14px;
  margin-bottom: 14px;
}
.service-category-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.service-category-editor-head h4 {
  margin: 0 0 4px;
  color: var(--navy);
}
.service-category-editor-head p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}
.service-subcategory-list {
  display: grid;
  gap: 10px;
}
.special-project-editor {
  border-color: #c8ebe8;
}
.service-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
}
.service-editor-head h4 {
  margin: 0 0 8px;
  color: var(--navy);
}
.service-editor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}
.service-editor-body {
  border-top: 1px solid var(--line);
  background: var(--soft-blue-2);
  padding: 14px;
}
.service-editor-body .service-row {
  margin-bottom: 0;
  background: transparent;
  border: 0;
  padding: 0;
}
.setup-summary {
  margin-bottom: 16px;
}
.category-settings {
  margin-bottom: 18px;
}
.category-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr .7fr auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  background: #fff;
}
.category-row label { margin: 0; }
.service-row-expanded {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}
.service-row-expanded .wide {
  grid-column: span 3;
}
.service-row-expanded .small-btn {
  align-self: end;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: end;
}
.settings-grid label {
  margin: 0;
}
.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  font-weight: 850;
  color: var(--navy);
}
.switch-row input {
  width: 20px;
  height: 20px;
  margin: 0;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 45, 73, .42);
}
.modal-panel {
  width: min(920px, 100%);
  max-height: min(860px, calc(100vh - 36px));
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px;
}
.setup-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.setup-step {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft-blue-2);
  color: var(--muted);
  padding: 6px 9px;
  font-size: .78rem;
  font-weight: 900;
}
.setup-step.active {
  border-color: var(--blue);
  color: var(--blue-dark);
  background: var(--soft-blue);
}
.setup-step.done {
  border-color: #91cdd0;
  color: #0b6865;
  background: var(--teal-soft);
}
.wizard-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.compact { margin: 0; min-width: 170px; }
.compact select { margin-top: 4px; }

.management-toolbar {
  margin-bottom: 16px;
}
.management-toolbar label {
  max-width: 520px;
}
.cleaner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.cleaner-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfdfe);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
.cleaner-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.cleaner-card h3 {
  margin: 0 0 3px;
  color: var(--navy);
}
.cleaner-card .small-btn {
  width: 100%;
  margin-top: 12px;
}
.profile-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-blue-2);
  padding: 18px;
  margin-top: 18px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.profile-grid .wide {
  grid-column: 1 / -1;
}
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.profile-actions .primary {
  width: auto;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.skill-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.skill-check input {
  width: auto;
  min-height: auto;
  margin: 0;
}
.qualification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}
.qualification-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(12, 45, 73, .035);
}
.qualification-card input {
  width: auto;
  min-height: auto;
  margin: 4px 0 0;
}
.qualification-card strong {
  display: block;
  color: var(--navy);
  margin-bottom: 4px;
}
.qualification-card .small {
  display: block;
}
.qualification-card:has(input:checked) {
  border-color: var(--teal);
  background: #f1fbfa;
  box-shadow: inset 0 0 0 2px rgba(39, 170, 164, .18);
}
.qualification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.exception-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.admin-availability-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.profile-bookings {
  margin-top: 18px;
}
.profile-bookings .booking {
  background: white;
}
.team-list,
.team-checks {
  display: grid;
  gap: 8px;
  margin: 8px 0;
}
.team-member,
.team-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 9px 10px;
}
.team-check {
  justify-content: flex-start;
  font-weight: 700;
  margin: 0;
}
.team-check input {
  width: auto;
  min-height: auto;
  margin: 0;
}
.team-block {
  margin-top: 14px;
}
.lookup-card { border-top: 4px solid var(--blue); }
.lookup-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.lookup-form label { margin: 0; }
.lookup-form .primary { width: auto; }
.lookup-message {
  margin: 14px 0;
  border: 1px solid #96d2d0;
  background: var(--teal-soft);
  color: #075d5a;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 850;
}
.lookup-message.error {
  background: #fff1f1;
  border-color: #e1adad;
  color: var(--red);
}
.rating-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-blue-2);
  padding: 16px;
}
.star-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}
.star-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  color: #667985;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 950;
}
.star-button.selected,
.star-button:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #0b6865;
}
.stars {
  color: #0b6865;
  font-weight: 950;
  letter-spacing: .04em;
}
.rating-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
}
.review-list {
  display: grid;
  gap: 10px;
}
.review-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 13px;
}
.review-card.hidden-review {
  opacity: .68;
  background: #f8fafb;
}
.review-actions {
  margin-top: 10px;
}

footer {
  text-align: center;
  padding: 22px 16px;
  color: var(--muted);
  font-size: .82rem;
  border-top: 1px solid var(--line);
  background: white;
}

/* Light usability refresh */
body {
  background:
    linear-gradient(180deg, rgba(238, 248, 253, 0.78) 0, rgba(248, 251, 253, 0) 340px),
    var(--background);
}
.topbar {
  box-shadow: 0 1px 0 rgba(12, 45, 73, .03);
}
.logo {
  background: linear-gradient(135deg, #174260, #4d9fd0 70%, #27aaa4);
  box-shadow: 0 8px 18px rgba(12, 45, 73, .08);
}
.tabs {
  gap: 8px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.tab {
  background: #fff;
  border-color: var(--line);
  color: #4c6574;
  box-shadow: 0 1px 2px rgba(12, 45, 73, .025);
}
.tab.active {
  background: #eaf6fb;
  border-color: #b9dbe9;
  color: var(--navy);
  box-shadow: inset 0 -2px 0 var(--teal), 0 6px 14px rgba(12, 45, 73, .06);
}
.shell {
  padding-top: 16px;
}
.hero {
  padding: clamp(12px, 2vw, 18px);
  background: linear-gradient(135deg, #fff, #f7fcfe);
  box-shadow: var(--shadow-soft);
}
.hero h1 {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
}
.hero-panel span {
  border-left-width: 0;
  box-shadow: none;
}
.card,
.booking,
.job,
.timeoff,
.cleaner-card,
.metric,
.review-card {
  box-shadow: var(--shadow-soft);
}
.card {
  padding: clamp(20px, 3vw, 28px);
}
.booking-card {
  background: rgba(255,255,255,.98);
}
.booking-progress {
  gap: 8px;
}
.booking-progress li {
  padding: 8px 10px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(12, 45, 73, .04);
}
.booking-progress span,
.section-title span {
  background: #e8f6f4;
  color: #0b6865;
}
.booking-progress strong {
  font-size: .82rem;
}
.form-section {
  padding: clamp(15px, 2vw, 20px);
  margin-bottom: 14px;
  background: #fff;
}
.section-title {
  margin-bottom: 18px;
}
.section-title h3 {
  font-size: 1.08rem;
}
.section-title p,
.field-hint,
.small {
  color: #6a7f8d;
}
label,
legend {
  font-size: .94rem;
}
input,
select,
textarea {
  border-color: #d4e5ee;
  background: #fff;
  padding: 12px 13px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(39, 170, 164, .18);
}
.category-cards,
.service-cards {
  gap: 14px;
}
.category-card,
.service-card {
  padding: 17px;
  border-color: #dcebf2;
  background: #fff;
  box-shadow: 0 5px 16px rgba(12, 45, 73, .035);
}
.category-card:hover,
.service-card:hover {
  background: #fbfeff;
}
.category-card.selected,
.service-card.selected,
.slot.selected {
  border-color: #27aaa4;
  background: #f1fbfa;
  box-shadow: inset 0 0 0 2px rgba(39, 170, 164, .26), 0 8px 18px rgba(12, 45, 73, .06);
}
.service-meta span {
  background: #f6fbfe;
  border-color: #dbeaf2;
  color: #2a6d91;
}
.selected-badge {
  background: #0f8f89;
  color: white;
  border-color: #0f8f89;
}
.detail-group,
fieldset,
.login-form,
.rating-panel,
.profile-panel,
.availability-row,
.service-row {
  background: #fbfeff;
}
.detail-group {
  padding: 16px;
}
.slot-grid {
  gap: 10px;
}
.slot {
  min-height: 52px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(12, 45, 73, .035);
}
.primary {
  background: #0d3654;
  box-shadow: 0 8px 18px rgba(12, 45, 73, .14);
}
.primary:hover {
  background: #174a6d;
}
.secondary {
  background: #f0f8fc;
}
.check-row {
  background: #fbfeff;
  padding: 14px;
}
.summary-card {
  border-top: 0;
  border-left: 4px solid var(--teal);
}
.summary-group {
  padding: 10px 15px 4px;
  background: #fff;
}
.summary-line {
  padding: 12px 0;
}
.summary-total {
  background: #f1fbfa;
  border: 1px solid #c8ebe8;
  border-radius: 8px;
  padding: 14px 15px;
}
.summary-total strong:last-child {
  color: #0b6865;
  font-size: 1.42rem;
}
.notice,
.lookup-message {
  box-shadow: none;
}
.empty {
  background: #fbfeff;
  border-color: #c6dbe6;
}
.session-bar,
.login-card,
.lookup-card {
  border-top-width: 0;
  border-left: 4px solid var(--teal);
}
.metric {
  border-top-width: 0;
  border-left: 4px solid var(--blue);
}
.metric:nth-child(3) {
  border-left-color: var(--teal);
}
.table-wrap {
  background: #fff;
  box-shadow: 0 5px 16px rgba(12, 45, 73, .035);
}
th {
  background: #f7fbfd;
}
th,
td {
  padding: 15px 13px;
}
tbody tr:hover {
  background: #f8fcfe;
}
.category-row,
.service-row,
.cleaner-card,
.booking,
.job,
.timeoff,
.team-member,
.team-check {
  background: #fff;
}
.profile-panel {
  background: #fbfeff;
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .booking-progress { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sticky { position: static; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-row { grid-template-columns: 1fr 1fr; }
  .service-row-expanded { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-row-expanded .wide { grid-column: 1 / -1; }
  .category-row { grid-template-columns: 1fr 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; }
}
@media (max-width: 680px) {
  .topbar { align-items: flex-start; }
  .mode-badge { display: none; }
  .hero, .card-head, .split-head { align-items: flex-start; flex-direction: column; }
  .service-category-editor-head { align-items: flex-start; flex-direction: column; }
  .hero-panel { width: 100%; }
  .booking-progress { grid-template-columns: 1fr; }
  .booking-progress li { padding: 10px; }
  .form-grid, .metrics, .operation-grid, .inline-form, .service-row, .service-row-expanded, .category-row, .lookup-form { grid-template-columns: 1fr; }
  .control-card > summary { align-items: flex-start; flex-direction: column; gap: 4px; }
  .booking-accordion > summary { min-height: 70px; padding: 15px; }
  .booking-accordion > summary::after { font-size: 1.45rem; }
  .booking-accordion-content { padding: 2px 14px 18px; }
  .control-card > summary small { text-align: left; }
  .lookup-form .primary { width: 100%; }
  .login-card { grid-template-columns: 1fr; }
  .admin-auth-card { grid-template-columns: 1fr; }
  .admin-status-row { align-items: stretch; flex-direction: column; }
  .admin-urgent-actions { flex-direction: column; }
  .admin-urgent-actions button { width: 100%; }
  .session-bar { align-items: stretch; flex-direction: column; }
  .availability-row { grid-template-columns: 1fr; }
  .summary-line { grid-template-columns: 1fr; gap: 3px; }
  .summary-line strong:last-child { text-align: left; }
  .card { padding: 17px; }
}
@media (max-width: 420px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .tabs { padding-left: 12px; padding-right: 12px; }
  .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
