/* Hide maintenance overlay by default; enable via body.maintenance-active */
.maintenance-overlay {
  display: none;
}
body.maintenance-active .maintenance-overlay {
  display: flex;
}

/* Maintenance overlay for quote page */
body.quote-page .maintenance-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}
body.quote-page .maintenance-message {
  background: #fff;
  color: #0078d7;
  padding: 2.5rem 2rem;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  text-align: center;
  max-width: 90vw;
  font-size: 1.35rem;
}
/* ============================================================
   Swash PWA Shared Styles
   Consistent layout for calculator, admin dashboard, scheduler.
   Theme colour: #0078d7 (Sego UI / Microsoft blue)
   ============================================================ */

:root {
  color-scheme: light;
  --swash-blue: #0078d7;
  --swash-blue-dark: #0b63b5;
  --swash-green: #1c9c5d;
  --swash-red: #c43131;
  --text-body: #1f2933;
  --text-muted: #5f6c7b;
  --bg-page: #f5f7fa;
  --bg-card: #ffffff;
  --border-soft: rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-md: 12px;
  /* Background image controls (used globally on all pages) */
  --bg-image-url: url('/assets/swash-bg.png');
  --bg-image-opacity: 0.25; /* 25% opacity */
}

* {
  box-sizing: border-box;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-body);
  overflow-x: hidden;
}

/* Full-page background image (faded) applied behind all content */
html, body { 
  min-height: 100%; 
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1; /* keep it behind everything */
  pointer-events: none;
  background-image: var(--bg-image-url);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  opacity: var(--bg-image-opacity);
}

/* Disable background in embed mode or when printing */
@media print {
  body::before { display: none !important; }
}
:is(body.embed-mode, .quote-modal-shell.embed-mode)::before { display: none !important; }

/* Remove background image on quote page only */
body.quote-page::before { display: none !important; }

/* Hide sensitive/rep-only controls on embedded quote form */
:is(body.embed-mode, .quote-modal-shell.embed-mode) #quoteForm label[for="repCode"],
:is(body.embed-mode, .quote-modal-shell.embed-mode) #quoteForm label[for="quoteDate"] {
  display: none !important;
}

/* Force-hide Rep Code and Quote Date fields on all quote forms */
#quoteForm label[for="repCode"],
#quoteForm label[for="quoteDate"],
#repCode,
#quoteDate {
  display: none !important;
}

/* Force-hide the generated email message controls on the quote page */
:is(body.quote-page, .quote-modal-shell) label[for="emailMessage"],
:is(body.quote-page, .quote-modal-shell) #emailMessage {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================
   Header + Navigation
   ============================================================ */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 14px 20px;
  background: var(--swash-blue);
  color: #fff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.2);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.header-company {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  transition: opacity 0.2s ease;
}

.header-company::before {
  content: "🏢";
  font-size: 1rem;
}

.header-company[hidden] {
  opacity: 0;
  pointer-events: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.role-pill strong {
  color: #ffffff;
}

.role-pill[data-role="guest"] {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.85);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: #e0f2fe;
  color: #0f172a;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.role-badge::before {
  content: "👤";
  font-size: 1rem;
}

.role-badge strong {
  color: inherit;
}

.header-actions .role-badge {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
}

.header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.header-logo {
  height: 44px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

.menu-box {
  position: relative;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.header .btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  border-radius: 9999px;
  padding: 8px 20px;
}

.header .btn:hover {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 14px rgba(12, 24, 38, 0.25);
  color: #fff;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  background: var(--swash-blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--swash-blue-dark);
}

.btn-secondary {
  background: #fff;
  color: var(--swash-blue);
}

.btn-danger {
  background: var(--swash-red);
  color: #fff;
}

.btn-success {
  background: var(--swash-green);
  color: #fff;
}

.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  min-width: 220px;
  max-width: calc(100vw - 16px);
  padding: 8px 0;
  display: none;
  z-index: 9999;
}

.dropdown.show {
  display: block;
}

.dropdown-title {
  padding: 12px 16px;
  font-weight: 700;
  color: var(--swash-blue);
  border-bottom: 1px solid var(--border-soft);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 8px 0;
}

.dropdown a {
  display: block;
  padding: 11px 16px;
  color: var(--text-body);
}

.dropdown a:hover {
  background: rgba(0, 120, 215, 0.08);
}

/* ============================================================
   Layout Containers
   ============================================================ */

.page {
  max-width: 1400px;
  margin: 24px auto 60px;
  padding: 0 16px;
  overflow-x: hidden;
}

#schedulerContent {
  max-width: 100%;
  margin: 24px 0 60px;
  padding: 0 16px;
  overflow-x: hidden;
}

#schedulerContent .card {
  max-width: 100%;
  margin: 0;
  padding: 28px 16px;
  overflow-x: hidden;
}

/* Narrow layout for embedded quote form */
#quoteEmbedCard {
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}

.card-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.card-header p {
  margin: 0;
  color: var(--text-muted);
  white-space: pre-line;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px 18px;
}

.page--stacked {
  max-width: 1100px;
  margin: 32px auto;
  width: 100%;
  display: grid;
  gap: 32px;
}

.form-field--span-2 {
  grid-column: span 2;
}

.availability-fieldset {
  margin-top: 28px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 20px;
  background: rgba(255, 255, 255, 0.85);
}

.availability-fieldset legend {
  font-weight: 700;
  font-size: 1rem;
  padding: 0 8px;
}

.availability-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) repeat(4, minmax(90px, 120px));
  column-gap: 12px;
  row-gap: 10px;
  margin-top: 16px;
  align-items: center;
}

.availability-grid__header {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.availability-grid__day {
  font-weight: 600;
  color: var(--text-body);
}

.availability-grid__checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-body);
}

.availability-grid__checkbox input {
  width: auto;
  accent-color: var(--swash-blue);
}

.cleaner-list {
  display: grid;
  gap: 18px;
}

.cleaner-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--bg-card);
  display: grid;
  gap: 10px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.cleaner-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cleaner-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.cleaner-card__meta {
  display: grid;
  gap: 2px;
}

.cleaner-card__name {
  font-weight: 700;
}

.cleaner-card__contact {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cleaner-card__availability {
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
}

.cleaner-card__availability-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 768px) {
  .page--stacked {
    margin: 24px auto;
    gap: 24px;
  }

  .form-field--span-2 {
    grid-column: span 1;
  }

  .availability-grid {
    grid-template-columns: minmax(120px, 1fr) repeat(4, minmax(70px, 1fr));
  }

  .cleaner-card__availability-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-muted);
  white-space: pre-line;
  font-weight: 600;
}

.form-section span {
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: #fff;
  color: var(--text-body);
  font-size: 0.95rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--swash-blue);
  box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.2);
}

.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.checkbox input {
  width: auto;
  accent-color: var(--swash-blue);
}

/* Larger checkbox option */
.checkbox--lg input {
  width: 22px;
  height: 22px;
}

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

/* Customer details bounding box */
.customer-box {
  border: 1px solid rgba(0, 120, 215, 0.2);
  background: rgba(0, 120, 215, 0.08);
  border-radius: 12px;
  padding: 16px;
}

/* Thicker sliders */
/* Slider styling - pill container with Swash blue accents */
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 2px solid var(--swash-blue);
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(0, 120, 215, 0.08);
}

.slider-row:focus-within {
  box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.18), 0 6px 18px rgba(0, 120, 215, 0.12);
}

.slider-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  height: 28px; /* thumb box height */
}

/* WebKit track */
.slider-row input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(0, 120, 215, 0.35);
  border-radius: 999px;
}

/* WebKit thumb */
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--swash-blue);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--swash-blue);
  margin-top: -8px; /* center on 4px track */
}

/* Firefox track */
.slider-row input[type="range"]::-moz-range-track {
  height: 4px;
  background: rgba(0, 120, 215, 0.35);
  border-radius: 999px;
}

/* Firefox thumb */
.slider-row input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--swash-blue);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--swash-blue);
}

.slider-row .slider-value {
  margin-left: 12px;
  min-width: 2ch;
  color: var(--swash-blue);
  font-weight: 700;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.result-panel {
  margin-top: 24px;
  padding: 18px;
  border-radius: 12px;
  background: rgba(0, 120, 215, 0.08);
  border: 1px solid rgba(0, 120, 215, 0.2);
  position: relative;
}

.result-panel p {
  margin: 0 0 6px;
  font-size: 1rem;
}

.result-panel .result-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-panel .result-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--swash-blue);
}

.result-panel .result-offer {
  margin-top: 4px;
  font-style: italic;
  color: #005999;
}

/* Price display enhancements */
.result-content .price-main {
  font-size: 1.2rem;
}

/* Alternating checkbox positioned in top-right of price box */
.alt-top-right {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
}

/* Special offer button with dynamic glow */
.btn-offer {
  --offer-color-start: #34d399;
  --offer-color-end: #059669;
  --offer-text-color: #ffffff;
  --offer-border-color: #047857;
  --offer-shadow: rgba(5, 150, 105, 0.35);
  appearance: none;
  border: 1px solid var(--offer-border-color);
  background: linear-gradient(135deg, var(--offer-color-start), var(--offer-color-end));
  color: var(--offer-text-color);
  box-shadow: 0 0 0 2px var(--offer-shadow), 0 6px 20px var(--offer-shadow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn-offer:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px var(--offer-shadow), 0 12px 24px var(--offer-shadow);
  filter: brightness(1.02);
}
.btn-offer.offer-applied {
  filter: brightness(0.97);
  transform: translateY(0);
}

.offer-description {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: #0f172a;
  line-height: 1.4;
  text-align: center;
}

.status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
}

.status.success {
  background: rgba(28, 156, 93, 0.1);
  color: var(--swash-green);
}

.status.warning {
  background: rgba(255, 170, 0, 0.12);
  color: #aa5a00;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 27, 47, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.auth-overlay[hidden] {
  display: none;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 32, 52, 0.18);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
  width: 100%;
  padding: 28px 32px;
}

.auth-card--subscriber-picker {
  max-width: 560px;
  padding: 36px 40px;
  gap: 22px;
}

.subscriber-picker {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.subscriber-picker__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 6px;
}

.subscriber-picker__item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.subscriber-picker__name {
  font-weight: 600;
  color: #0f172a;
}

.subscriber-picker__meta {
  color: #475569;
  font-size: 0.85rem;
}

.subscriber-picker__button {
  background: var(--swash-blue);
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  align-self: flex-end;
}

.subscriber-picker__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 120, 215, 0.25);
}

.subscriber-picker__empty {
  padding: 18px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
  color: #64748b;
  text-align: center;
}

@media (max-width: 640px) {
  .auth-card--subscriber-picker {
    padding: 28px 24px;
  }

  .subscriber-picker__list {
    grid-template-columns: 1fr;
    max-height: none;
  }
}

.auth-card h2 {
  margin: 0;
}

.auth-card label {
  font-weight: 600;
}

.auth-card input {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
}

.auth-card .status {
  margin: 0;
}
.customer-section {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.customer-section h3 {
  margin: 0;
  font-size: 1.2rem;
}

/* Light blue bounding box for options on add-new-customer.html */
.options-box {
  grid-column: 1 / -1;
  background: rgba(0, 120, 215, 0.08);
  border: 1px solid rgba(0, 120, 215, 0.2);
  border-radius: 12px;
  padding: 16px;
}

.customer-section .form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-muted);
  white-space: pre-line;
  font-weight: 600;
}

.payment-ref {
  margin-top: 24px;
  padding: 16px;
  border-radius: 10px;
  background: rgba(28, 156, 93, 0.08);
  border: 1px solid rgba(28, 156, 93, 0.3);
  color: var(--swash-green);
}

.payment-ref p {
  margin: 0;
  font-weight: 600;
}

/* ============================================================
   Admin Dashboard Styles
   ============================================================ */

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: pre-line;
  font-size: 0.92rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  align-items: center;
}

.controls input[type="date"] {
  width: auto;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  padding: 10px;
  background: #f4f8ff;
  border: 1px solid rgba(0, 120, 215, 0.12);
  border-radius: 6px;
}

.filter-group > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-toggle {
  align-self: flex-end;
}

.filter-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.filter-group input[type="date"],
.filter-group select {
  min-width: 140px;
}

.filter-actions .btn {
  padding: 8px 16px;
}

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

.filter-actions .btn {
  width: 100%;
}

.filter-actions .btn-secondary {
  padding: 6px 12px;
}

.controls-with-actions {
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.actions-group {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.actions-dropdown {
  position: relative;
}

.actions-toggle {
  min-width: 160px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
}

.actions-toggle__icon {
  font-size: 12px;
}

.actions-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid #d6e1f2;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16, 42, 67, 0.18);
  padding: 6px 0;
  list-style: none;
  margin: 0;
  display: none;
  z-index: 50;
}

.actions-menu[aria-hidden="true"] {
  display: none;
}

.actions-menu li {
  width: 100%;
}

.actions-menu button {
  width: 100%;
  background: none;
  border: 0;
  padding: 10px 16px;
  text-align: left;
  font-size: 15px;
  color: #1f2933;
  cursor: pointer;
}

.actions-menu button:hover,
.actions-menu button:focus {
  background: #eef5ff;
  color: #0057b8;
  outline: none;
}

.selected-customers-box {
  background-color: #e6f0ff;
  border: 2px solid #b3d9ff;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.selected-customers-box.hidden {
  display: none;
}

.selected-customers-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.selected-customers-list {
  flex: 1;
  display: grid;
  gap: 8px;
}

.selected-customer-item {
  background: #fff;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
}

.selected-customer-item__name {
  font-weight: 600;
  color: #1f2933;
}

.selected-customer-item__address {
  color: #5a6c7d;
  font-size: 13px;
}


.scheduler-controls {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.scheduler-controls .controls-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.scheduler-controls .control-label {
  font-weight: 600;
}

.scheduler-controls .controls-right {
  margin-left: auto;
}

.scheduler-controls .cleaner-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scheduler-controls .cleaner-filter label {
  font-weight: 600;
  white-space: nowrap;
}

.scheduler-controls .cleaner-filter select {
  min-width: 180px;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.92rem;
}

thead {
  background: var(--swash-blue);
  color: #fff;
}

th,
td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

thead th {
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:hover {
  background: rgba(0, 120, 215, 0.05);
}

.quotes-table th:first-child,
.quotes-table td:first-child {
  width: 48px;
  text-align: center;
}

.quotes-table td.checkbox-cell {
  cursor: default;
}

.quotes-table tbody tr.quote-row {
  cursor: pointer;
}

.quotes-table tbody tr.quote-row:focus {
  outline: 2px solid rgba(0, 120, 215, 0.35);
  outline-offset: -2px;
}

.quotes-table td {
  white-space: normal;
  word-break: break-word;
  overflow: visible;
}

.quotes-table td:nth-child(2),
.quotes-table td:nth-child(8),
.quotes-table td:nth-child(9) {
  white-space: nowrap;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.contact-info span {
  display: block;
  font-size: 0.88rem;
  line-height: 1.2;
}

.contact-info .contact-email {
  color: var(--swash-blue);
}

.contact-info .contact-missing {
  color: var(--text-muted);
  white-space: pre-line;
}

.booked {
  background: rgba(28, 156, 93, 0.12);
}

.tab-btn {
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid var(--swash-blue);
  background: #fff;
  color: var(--swash-blue);
  cursor: pointer;
  font-weight: 600;
}

.tab-btn.active {
  background: var(--swash-blue);
  color: #fff;
}

#popupModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  z-index: 50;
  padding: 20px;
}

#popupModal .modal {
  background: #fff;
  padding: 24px;
  border-radius: 14px;
  width: min(720px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-soft);
}

#dayMessageModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  z-index: 60;
  padding: 20px;
}

#dayMessageModal:not([hidden]) {
  display: flex;
}

#importModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  z-index: 60;
  padding: 20px;
}

#scheduleModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  z-index: 60;
  padding: 20px;
}

#importModal:not([hidden]) {
  display: flex;
}

#scheduleModal:not([hidden]) {
  display: flex;
}

#setCustomerLocationModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  z-index: 60;
  padding: 20px;
}

#setCustomerLocationModal:not([hidden]) {
  display: flex;
}

#setCustomerLocationModal .modal__dialog {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: min(600px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#areasModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  z-index: 60;
  padding: 20px;
}

#areasModal:not([hidden]) {
  display: flex;
}

.areas-modal__dialog {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: min(1080px, 95vw);
  max-height: 95vh;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.areas-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.areas-modal__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.areas-modal__subtitle {
  margin: 4px 0 0;
  color: #475569;
  font-size: 0.9rem;
}

.areas-modal__layout {
  display: grid !important;
  grid-template-columns: minmax(260px, 320px) 1fr !important;
  gap: 18px;
  flex: 1;
  min-height: 420px;
}

.areas-modal__sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 4px;
}

.cleaner-pill-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.cleaner-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #cbd5f5;
  color: #1d4ed8;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cleaner-pill.is-selected {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}

.areas-list-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.areas-list-header h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}

.areas-list-header p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.areas-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.areas-list-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  border: none;
  text-align: left;
}

.areas-list-item__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.areas-list-item__swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-flex;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.areas-list-item__meta {
  font-size: 0.75rem;
  color: #64748b;
}

.areas-list-item.is-selected {
  border-color: #1d4ed8;
  background: rgba(29, 78, 216, 0.08);
}

.areas-admin-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f1f5f9;
}

.areas-admin-controls.hidden {
  display: none;
}

.areas-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.areas-style-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.areas-style-fields .modal__field {
  margin: 0;
}

.areas-modal__map {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  min-width: 0;
  flex: 1;
}

.areas-map-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.areas-map-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.areas-map {
  width: 100%;
  height: 520px;
  min-height: 520px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
}

.area-selection-summary {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.area-selection-summary__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #475569;
}

.area-selection-summary__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.area-selection-summary__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.area-selection-summary__subtitle {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.3;
}

.area-selection-summary__note {
  margin: 8px 0 10px;
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.4;
  padding: 6px 8px;
  background: #eff6ff;
  border-left: 3px solid #0078d7;
  border-radius: 4px;
}

.area-selection-summary__list {
  margin: 0;
  padding-left: 16px;
  font-size: 0.85rem;
  color: #1f2937;
}

.area-selection-summary__header {
  display: grid;
  gap: 4px;
}

.assign-cleaner-options {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.assign-cleaner-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.assign-cleaner-option:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.assign-cleaner-option.is-active {
  border-color: #0078d7;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #0078d7;
}

.assign-cleaner-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0078d7;
  cursor: pointer;
}

.area-selection-summary__list {
  margin: 0;
  padding-left: 16px;
  font-size: 0.85rem;
  color: #1f2937;
}

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

.area-assignments-panel__item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.area-assignments-panel__item h5 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
}

.area-assignments-panel__item ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.8rem;
  color: #475569;
}

.areas-modal__actions {
  margin-top: auto;
}

.areas-modal__restore {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15,23,42,0.25);
}

#areasModal.areas-modal--collapsed .areas-modal__actions {
  display: none;
}

#areasModal.areas-modal--collapsed .areas-modal__dialog {
  width: min(920px, 95vw);
  max-height: 80vh;
}

#areasModal.areas-modal--collapsed .areas-modal__layout {
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 16px;
}

#areasModal.areas-modal--collapsed .areas-modal__sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: none;
  border-right: 1px solid #e2e8f0;
  padding-right: 16px;
  overflow-y: auto;
}

#areasModal.areas-modal--collapsed .areas-modal__map {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#areasModal.areas-modal--collapsed .areas-map {
  height: 420px;
  flex: 1;
}

#areasModal.areas-modal--collapsed .area-selection-summary {
  display: block;
  position: static;
  width: 100%;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  margin-bottom: 12px;
}

#areasModal.areas-modal--collapsed .areas-modal__restore {
  display: inline-flex;
}

@media (max-width: 1024px) {
  .areas-modal__layout {
    grid-template-columns: 1fr;
  }

  .areas-modal__sidebar {
    max-height: 220px;
  }

  #areasModal.areas-modal--collapsed .areas-modal__layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #areasModal.areas-modal--collapsed .areas-modal__sidebar {
    border-right: none;
    padding-right: 0;
    max-height: 240px;
    order: 2;
  }

  #areasModal.areas-modal--collapsed .areas-modal__map {
    order: 1;
  }

  #areasModal.areas-modal--collapsed .areas-map {
    height: 320px;
  }
}

.assign-clear-day {
  display: none;
  margin-left: auto;
  padding: 2px 8px;
  font-size: 0.7rem;
  border-radius: 999px;
  border: 1px solid #f87171;
  background: rgba(248, 113, 113, 0.1);
  color: #b91c1c;
  cursor: pointer;
}

.schedule-row.assign-targetable {
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.schedule-row.assign-targetable:hover {
  background: rgba(30, 64, 175, 0.08);
}

.schedule-row.assign-selected {
  background: rgba(37, 99, 235, 0.12) !important;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.4);
}

.schedule-row.assign-selected .assign-clear-day {
  display: inline-flex;
}

.schedule-row.assign-selected .day-title::after {
  content: "•";
  color: #1d4ed8;
  margin-left: 6px;
  font-weight: 700;
}

body.assign-mode::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  pointer-events: none;
  z-index: 20;
}

body.assign-mode .card,
body.assign-mode #schedule {
  position: relative;
  z-index: 21;
}

body.assign-mode .schedule-row {
  opacity: 0.45;
}

body.assign-mode .schedule-row.assign-targetable {
  opacity: 1;
}

body.assign-mode .schedule-job {
  pointer-events: none;
}

body.assign-mode .schedule-job .job-select input {
  pointer-events: none;
}

body.assign-mode .schedule-job button,
body.assign-mode .schedule-job a {
  pointer-events: none;
}

body.assign-mode .schedule-row.assign-selected .schedule-job,
body.assign-mode .schedule-row.assign-selected .day-total {
  pointer-events: auto;
}

#orderJobsModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  z-index: 60;
  padding: 20px;
}

#orderJobsModal:not([hidden]) {
  display: flex;
}

#orderJobsModal .modal__dialog {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: min(500px, 95vw);
  max-height: 95vh;
  overflow-y: auto;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal__dialog--route-planner {
  width: min(1200px, 95vw) !important;
  max-height: 90vh !important;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* prevent double scroll bars */
}

.route-planner-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  flex: 1;
  min-height: 500px;
  overflow: hidden; /* remove internal scrollbar */
}

.route-planner-map-container {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  height: 100%;
  min-height: 500px;
}

.route-planner-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden; /* container itself won't scroll */
  max-height: 100%;
}

.route-planner-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.route-planner-controls .modal__field {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.route-planner-controls .modal__field span {
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
}

.route-planner-timeline-list {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 12px;
  background: #ffffff;
  overflow-y: auto; /* only this area scrolls */
  min-height: 200px;
  max-height: 100%;
}

.route-timeline-item {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: #f9fafb;
  border-radius: 4px;
  border-left: 3px solid #0078d7;
  font-size: 0.85rem;
  align-items: center;
  flex-shrink: 0;
}

.route-timeline-item.break {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.route-timeline-time {
  font-weight: 600;
  color: #1f2937;
  min-width: 50px;
}

.route-timeline-job {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.route-timeline-job-name {
  font-weight: 500;
  color: #1f2937;
}

.route-timeline-duration {
  color: #6b7280;
  font-size: 0.75rem;
}

@media (max-width: 1024px) {
  .route-planner-grid {
    grid-template-columns: 1fr;
    min-height: 300px;
    gap: 12px;
  }
  
  .route-planner-map-container {
    min-height: 300px;
  }
  
  .modal__dialog--route-planner {
    width: min(95vw, 100%) !important;
    max-height: 95vh !important;
  }
}

#areasModal .modal__dialog {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: min(800px, 95vw);
  max-height: 95vh;
  overflow-y: auto;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#dayMessageModal .modal__dialog {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: min(520px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#importModal .modal__dialog {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: min(460px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#scheduleModal .modal__dialog {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: min(520px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal__close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  white-space: pre-line;
  font-size: 18px;
  cursor: pointer;
  align-self: flex-end;
}

.modal__recipients {
  max-height: 160px;
  overflow-y: auto;
  background: rgba(0, 120, 215, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
}

.modal__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal__field select,
.modal__field textarea {
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.modal__list li {
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(0, 120, 215, 0.05);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal__list strong {
  font-weight: 600;
  color: var(--swash-blue-dark);
}

.modal__footer {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal__actions {
  display: flex;
  gap: 10px;
}

.modal__progress {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: pre-line;
}

.email-preview-pane {
  margin-top: 16px;
  background: #f5f7fb;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 18px;
  max-height: 60vh;
  overflow-y: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.email-preview-pane .email-container {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  max-width: 600px;
  margin: 0 auto;
}

.email-preview-pane .email-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--swash-blue);
  padding: 18px 24px;
  color: #fff;
  gap: 18px;
}

.email-preview-pane .email-header img {
  height: 44px;
  width: auto;
}

.email-preview-pane .email-header__title {
  font-size: 1.15rem;
  font-weight: 600;
}

.email-preview-pane .email-content {
  padding: 24px 26px;
  color: var(--text-body);
  line-height: 1.55;
  font-size: 0.95rem;
}

.email-preview-pane .email-content p {
  margin: 0 0 14px;
}

.email-preview-pane .email-welcome {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--swash-blue);
}

.email-preview-pane .email-content a {
  display: inline-block;
  background: var(--swash-blue);
  color: #fff;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 28px;
  font-weight: 600;
}

.email-preview-pane.mobile-view .email-container {
  max-width: 420px;
}

.preview-tabs {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.email-preview-pane .booking-email {
  width: 100%;
}

.email-preview-pane .booking-email__container {
  max-width: 600px;
}

.email-preview-pane.mobile-view .booking-email__container {
  max-width: 420px;
}

.details-panel {
  background: linear-gradient(135deg, rgba(0, 120, 215, 0.06), rgba(0, 120, 215, 0.02));
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.details-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--swash-blue);
  margin-bottom: 18px;
  cursor: pointer;
}

.details-panel__header:focus {
  outline: 3px solid rgba(0, 120, 215, 0.35);
  outline-offset: 3px;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.details-panel .details-form,
.details-panel .details-form * {
  cursor: auto;
}

@media (min-width: 960px) {
  .details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.details-field,
.details-notes {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.details-notes {
  grid-column: 1 / -1;
  align-items: flex-start;
}

.details-field span,
.details-notes span {
  font-weight: 600;
  color: var(--text-muted);
  white-space: pre-line;
  align-self: center;
}

.details-notes span {
  margin-top: 4px;
}

.details-field input,
.details-field select,
.details-field textarea,
.details-notes textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  font-size: 0.95rem;
}

.details-field textarea {
  min-height: 42px;
  resize: vertical;
}

.details-notes textarea {
  min-height: 90px;
}

.details-actions {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.details-status {
  margin-right: auto;
  font-weight: 600;
  color: var(--text-muted);
  white-space: pre-line;
}

.details-status.success {
  color: var(--swash-green);
}

.details-status.error {
  color: var(--swash-red);
}

@media (max-width: 600px) {
  .details-field,
  .details-notes {
    grid-template-columns: 1fr;
  }

  .details-field span,
  .details-notes span {
    margin-bottom: 6px;
  }
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

/* ============================================================
   Scheduler Styles
   ============================================================ */

.schedule-week {
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin-top: 32px;
  margin-bottom: 28px;
  border: none;
  box-shadow: none;
  overflow-x: hidden;
  box-sizing: border-box;
}

.week-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 48px;
  font-size: 1rem;
}

.week-header {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 48px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e5e7eb;
}

#schedule {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.week-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  box-sizing: border-box;
  overflow: hidden;
}

.week-table th {
  background: #d9ecff;
  color: var(--swash-blue);
  font-weight: 600;
  height: 36px;
  padding: 0;
}

.week-table th,
.week-table td {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.9);
  padding: 0;
}

.week-table tr {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.week-table td {
  position: relative;
  transition: background 0.2s ease, outline 0.2s ease;
  display: flex;
}

.day-column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 100%;
  width: 100%;
  padding: 12px;
  gap: 0;
}

.day-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.day-footer {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: auto;
  padding-top: 0;
}

.job {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 12px;
  border-radius: 12px;
  margin: 0;
  background: #f0f7ff;
  color: var(--text-body);
  font-size: 0.9rem;
  border: 1px solid rgba(0, 120, 215, 0.16);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}


.job:hover {
  border-color: var(--swash-blue);
  box-shadow: 0 8px 18px rgba(0, 120, 215, 0.18);
  transform: translateY(-2px);
}

.job.dragging {
  opacity: 0.65;
  box-shadow: none;
}

.job.search-match {
  border-color: var(--swash-blue);
  box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.2);
}

.job-selected {
  border-color: var(--swash-blue);
  box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.35);
}

.job-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2px 6px;
  justify-content: space-between;
}

.job-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.job-primary {
  font-weight: 600;
}

.job-address {
  color: var(--text-muted);
  white-space: pre-line;
  font-size: 0.85rem;
  flex: 1 1 1px;
  margin: 0;
}

.job-duration {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2px;
  font-weight: 500;
}

.job-price {
  font-weight: 600;
  color: var(--swash-blue);
}

.job-details {
  display: none;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: pre-line;
  line-height: 1.25;
  margin-top: 1px;
}

.job.expanded .job-details {
  display: block;
}

.job.paid {
  background: rgba(28, 156, 93, 0.12);
}

.job.unpaid {
  background: rgba(196, 49, 49, 0.12);
}

.day-highlight {
  background: rgba(0, 120, 215, 0.08);
}

.drop-target {
  outline: 2px dashed var(--swash-blue);
  outline-offset: -4px;
}

.scheduler-controls input[type="date"],
#scheduleSearch {
  min-height: 42px;
}

#scheduleSearch {
  width: min(280px, 100%);
  padding-left: 14px;
  padding-right: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============================================================
   Utilities & Responsive
   ============================================================ */

.text-muted {
  color: var(--text-muted);
  white-space: pre-line;
}

/* Thin blue borders for Saturday/Areas/Refresh buttons */
#toggleSaturday,
#defineAreas,
#refresh {
  border: 1px solid var(--swash-blue) !important;
}

#toggleSaturday:hover,
#defineAreas:hover,
#refresh:hover {
  box-shadow: 0 4px 12px rgba(0, 120, 215, 0.12);
}

@media (max-width: 768px) {
  .header {
    flex-wrap: nowrap;
    justify-content: space-between;
    text-align: left;
  }

  .header-left {
    justify-content: flex-start;
  }

  .header-actions {
    margin-left: auto;
    width: auto;
    justify-content: flex-end;
  }

  .btn {
    border-radius: 18px;
    padding: 9px 16px;
  }

  /* Slightly smaller header buttons so header actions fit neatly */
  .header .btn {
    padding: 7px 12px;
    font-size: 0.9rem;
  }
  .header-left { gap: 8px; }
  .header-logo { height: 38px; }

  /* Keep dropdown inside the viewport on narrow screens */
  .dropdown { right: 8px; left: auto; max-width: calc(100vw - 16px); }

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

  .inline-two {
    grid-template-columns: 1fr; /* stack on mobile */
  }

  /* Allow specific inline-two rows to remain side-by-side on mobile */
  body.quote-page .inline-two.inline-two--mobile-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* Keep compact action row inline and shrink the offer button on mobile */
  body.quote-page .form-actions--compact .btn {
    width: auto;
  }

  body.quote-page .btn-offer {
    padding: 6px 10px;
    font-size: 0.9rem;
    border-radius: 8px;
  }

  body.quote-page .form-actions--compact {
    gap: 8px; /* slightly tighter gap to fit label + button */
  }

  body.quote-page .form-actions--compact .checkbox span {
    white-space: nowrap; /* prevent Alternating label wrap */
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  /* Scheduler controls mobile layout: structured stack with clear groups */
  .scheduler-controls {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .scheduler-controls .controls-left {
    display: grid;
    grid-template-columns: 1fr; /* stack groups */
    gap: 8px;
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
  }
  .scheduler-controls .controls-left label.control-label { margin-right: 0; }
  .scheduler-controls .controls-left #startWeek { width: 100%; }
  .scheduler-controls .controls-left .btn { flex: 1 1 auto; }
  .scheduler-controls .controls-right { width: 100%; margin-left: 0; }

  .scheduler-controls .controls-left .btn {
    flex: 0 0 auto;
    min-width: 100px;
    font-size: 0.78rem;
    padding: 6px 10px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .scheduler-controls .control-label {
    width: auto;
    font-size: 0.7rem;
    margin: 0 2px 0 0;
    flex: 0 0 auto;
    white-space: nowrap;
    letter-spacing: .25px;
    display: inline-block; /* keep label inline with the date input */
  }

  /* Inline groups inside the scheduler controls */
  .scheduler-inline-group { 
    display: grid; 
    grid-template-columns: auto 1fr; 
    align-items: center; 
    gap: 6px; 
  }
  .scheduler-inline-group .control-label { margin: 0; }
  .actions-cluster { 
    display: grid; 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    gap: 8px; 
  }
  .actions-cluster .btn { width: 100%; }
  .filters-cluster { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 8px; 
    width: 100%; 
    align-items: stretch; 
  }
  .spacer { flex: 1 1 auto; }

  /* controls container already overridden above */

  .scheduler-controls .controls-right {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }

  .scheduler-controls .cleaner-filter {
    width: 100%;
  }

  .scheduler-controls .cleaner-filter select {
    width: 100%;
    min-width: 0;
  }

  .scheduler-controls #scheduleSearch {
    width: 100%;
    max-width: 280px;
  }

  /* Prevent horizontal scroll originating from card padding + 100% width children */
  body, html, .page, #schedulerContent, #schedulerContent .card { overflow-x: hidden; }
  #schedulerContent .card { padding-left: 16px; padding-right: 16px; }
  .schedule-table, .schedule-row, .jobs-cell { max-width: 100%; }
  .schedule-row { overflow-x: hidden; }

  /* Schedule table responsive - 1 column on mobile, 5 on desktop */
  .week-table tr {
    grid-template-columns: 1fr; /* stack single column on mobile */
  }

  .week-table th,
  .week-table td {
    min-width: 0;
  }

  .day-column {
    min-height: 300px;
  }

  .schedule-week {
    padding: 0;
    margin-top: 24px;
    margin-bottom: 20px;
  }

  .summary {
    font-size: 0.95rem;
  }
}

/* Ultra-narrow tweaks */
@media (max-width: 540px) {
  .actions-cluster { grid-template-columns: 1fr; }
  .scheduler-inline-group { grid-template-columns: 1fr; }
  .scheduler-inline-group .control-label { font-size: 0.78rem; }
}

/* Under Development overlay */
.under-dev-overlay{position:fixed;inset:0;z-index:2000;background:rgba(15,23,42,0.55);backdrop-filter:saturate(120%) blur(2px);display:flex;align-items:center;justify-content:center;padding:20px}
.under-dev-card{background:#fff;border-radius:16px;box-shadow:0 20px 60px rgba(15,23,42,0.25);width:min(560px,95vw);padding:24px;text-align:center;display:flex;flex-direction:column;gap:10px}
.under-dev-card h2{margin:0;color:#0b3b77}
.under-dev-sub{margin:0;color:#475569}
.under-dev-actions{display:flex;justify-content:center;gap:12px;margin-top:8px}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}

/* Extra-small screens: keep header buttons tidy */
@media (max-width: 480px) {
  .header { padding: 10px 12px; gap: 8px; }
  .header .btn { padding: 6px 10px; font-size: 0.86rem; }
  .header-logo { height: 34px; }
}

/* Embed mode (for iframe + inline modal shell) */
:is(body.embed-mode, .quote-modal-shell.embed-mode) {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
}

:is(body.embed-mode, .quote-modal-shell.embed-mode) .page {
  box-shadow: none !important;
  background: transparent !important;
}

:is(body.embed-mode, .quote-modal-shell.embed-mode) header,
:is(body.embed-mode, .quote-modal-shell.embed-mode) .navbar,
:is(body.embed-mode, .quote-modal-shell.embed-mode) .banner {
  display: none !important;
}


.day-total {
  margin-top: 0;
  padding-top: 4px;
  padding-bottom: 0;
  font-weight: 600;
  color: var(--text-muted);
  white-space: pre-line;
  align-self: stretch;
}

.day-actions {
  margin: 0;
  align-self: stretch;
}

.day-actions select {
  width: 100%;
  min-height: 36px;
}

.day-empty {
  margin: 0;
  padding: 14px 0;
  border-radius: 12px;
  background: rgba(0, 120, 215, 0.08);
  color: var(--text-muted);
  white-space: pre-line;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.schedule-table {
  display: grid;
  grid-template-columns: 1fr; /* mobile: stacked */
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 700px) {
  .schedule-table {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 980px) {
  .schedule-table {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .schedule-table {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1600px) {
  .schedule-table {
    grid-template-columns: repeat(5, 1fr); /* desktop: Mon–Fri side-by-side */
  }
}

.schedule-row {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #d6e1f2;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(16, 42, 67, 0.08);
  overflow: hidden;
}

@keyframes todayHighlightPulse {
  0%, 100% {
    box-shadow: inset 0 0 0 3px rgba(10, 132, 255, 0.22), inset 0 12px 24px rgba(0, 120, 215, 0.18);
  }
  50% {
    box-shadow: inset 0 0 0 5px rgba(10, 132, 255, 0.32), inset 0 16px 28px rgba(0, 120, 215, 0.22);
  }
}

.schedule-row.today-highlight {
  position: relative;
  border-color: rgba(0, 120, 215, 0.55);
  background: linear-gradient(180deg, rgba(0, 120, 215, 0.18) 0%, rgba(255, 255, 255, 0.96) 65%, rgba(0, 120, 215, 0.08) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.schedule-row.today-highlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.0) 0%, rgba(0, 120, 215, 0.14) 50%, rgba(0, 120, 215, 0.08) 100%);
  animation: todayHighlightPulse 5s ease-in-out infinite;
}

.schedule-row.today-highlight .day-cell {
  background: linear-gradient(90deg, #0060bf, #0a84ff);
  color: #f5fbff;
}

.day-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--swash-blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.day-title { opacity: 0.95; }

.day-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.14);
  padding: 4px 8px;
  border-radius: 8px;
}
.day-select-wrap input[type="checkbox"] {
  width: 16px; height: 16px;
}
.day-select-wrap span { color: #fff; font-weight: 600; font-size: 0.85rem; }

.jobs-cell {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  background: #fff;
  min-height: auto;
}

.day-empty {
  text-align: center;
  padding: 12px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.schedule-job {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 0;
  background: #f0f7ff;
  border: none;
  cursor: grab;
  transition: all 0.2s ease;
}

.schedule-job:hover {
  border-color: var(--swash-blue);
  box-shadow: 0 4px 12px rgba(0, 120, 215, 0.18);
  transform: translateY(-2px);
}

.schedule-job.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.insertion-line {
  height: 3px;
  background: linear-gradient(90deg, var(--swash-blue), transparent);
  border-top: 2px solid var(--swash-blue);
  margin: 6px 0;
  animation: pulse-insertion 0.6s ease-in-out infinite;
  pointer-events: none;
  transition: margin 0.05s ease-out, transform 0.05s ease-out;
}

@keyframes pulse-insertion {
  0%, 100% {
    opacity: 0.7;
    box-shadow: 0 0 4px rgba(0, 120, 215, 0.5);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(0, 120, 215, 0.8);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.schedule-job.selected {
  background: #d9ecff;
  border-color: var(--swash-blue);
}

/* Payment status coloring */
.schedule-job--paid {
  background: #ecfdf5; /* green-50 */
  border-color: #34d399; /* green-400 */
}
.schedule-job--repeat-unpaid {
  background: #fef2f2; /* red-50 */
  border-color: #f87171; /* red-400 */
}
.schedule-job--unpaid {
  background: #fff7ed; /* orange-50 */
  border-color: #fb923c; /* orange-400 */
}

.job-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.job-select {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.job-select input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.job-select__box {
  width: 18px;
  height: 18px;
  border: 2px solid #a3b3c7;
  border-radius: 4px;
  display: inline-block;
}
.job-select input:checked + .job-select__box {
  background: var(--swash-blue);
  border-color: var(--swash-blue);
  box-shadow: inset 0 0 0 2px #fff;
}

.job-header__text {
  display: flex;
  flex-direction: column;
}

.schedule-job__details {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #c8d4e5;
}

.job-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-body);
}
.job-details__row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
}
.job-details dt {
  font-weight: 600;
  color: var(--text-muted);
}
.job-details dd {
  margin: 0;
  /* Allow long emails/numbers to wrap within the cell */
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Navigation button inside expanded job card */
.job-details__actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.job-nav-btn {
  background: var(--swash-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.job-nav-btn:hover,
.job-nav-btn:focus {
  background: var(--swash-blue-dark);
  color: #fff;
  transform: translateY(-1px);
}

.job-nav-btn:active {
  transform: translateY(0);
}

.job-comm-btn {
  border: 1px solid rgba(0, 120, 215, 0.5);
  background: rgba(0, 120, 215, 0.1);
  color: var(--swash-blue);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
  cursor: pointer;
}

.job-comm-btn:hover,
.job-comm-btn:focus {
  background: rgba(0, 120, 215, 0.2);
  border-color: var(--swash-blue);
  transform: translateY(-1px);
}

.job-comm-btn:active {
  transform: translateY(0);
}

/* Make contact links clearly clickable and contained */
.job-details a {
  color: var(--swash-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.job-details a:hover {
  filter: brightness(0.9);
}

.customer-chat-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 3200;
}

.customer-chat-modal.is-open {
  display: flex;
}

.customer-chat-dialog {
  width: min(640px, 100%);
  max-height: 90vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 32px 60px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.customer-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.customer-chat-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-heading);
}

.customer-chat-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.customer-chat-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.customer-chat-body {
  flex: 1;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.customer-chat-status {
  min-height: 18px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.customer-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.customer-chat-message {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 14px;
  background: #f1f5f9;
  color: var(--text-body);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.customer-chat-message + .customer-chat-message {
  margin-top: 8px;
}

.customer-chat-message--inbound {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.customer-chat-message--outbound {
  margin-left: auto;
  background: linear-gradient(135deg, #0a84ff, #0078d7);
  color: #fff;
  box-shadow: 0 10px 20px rgba(0, 120, 215, 0.35);
}

.customer-chat-message__header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.customer-chat-message__icon {
  font-size: 1.1rem;
  line-height: 1;
  margin-top: 2px;
}

.customer-chat-message__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
  color: rgba(15, 23, 42, 0.65);
}

.customer-chat-badge {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.customer-chat-badge--email {
  background: rgba(14, 165, 233, 0.18);
  color: #0369a1;
}

.customer-chat-badge--sms {
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
}

.customer-chat-badge--note {
  background: rgba(234, 179, 8, 0.18);
  color: #92400e;
}

.customer-chat-message--outbound .customer-chat-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.customer-chat-message--outbound .customer-chat-message__meta {
  color: rgba(255, 255, 255, 0.75);
}

.customer-chat-message__author {
  font-weight: 600;
}

.customer-chat-job {
  font-size: 0.7rem;
  opacity: 0.75;
}

.customer-chat-message__subject {
  margin-top: 4px;
  font-weight: 600;
}

.customer-chat-message__body {
  margin-top: 4px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.customer-chat-message__content {
  word-break: break-word;
}

.customer-chat-message__body--single .customer-chat-message__content {
  display: block;
}

.customer-chat-message__body:not(.is-expanded) .customer-chat-message__content--full {
  display: none;
}

.customer-chat-message__body.is-expanded .customer-chat-message__content--preview {
  display: none;
}

.customer-chat-message__footer {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: rgba(15, 23, 42, 0.55);
}

.customer-chat-message--outbound .customer-chat-message__footer {
  color: rgba(255, 255, 255, 0.8);
}

.customer-chat-message__timestamp {
  margin-right: auto;
}

.customer-chat-expander,
.customer-chat-reply {
  background: none;
  border: none;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  color: inherit;
}

.customer-chat-reply {
  font-weight: 600;
}

.customer-chat-expander:hover,
.customer-chat-reply:hover {
  text-decoration: none;
}

.customer-chat-divider {
  margin: 0 0 8px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.customer-chat-empty {
  padding: 24px;
  border: 2px dashed rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.customer-chat-form {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 16px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.customer-chat-form textarea {
  width: 100%;
  min-height: 90px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.customer-chat-form textarea:focus {
  border-color: var(--swash-blue);
  box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.15);
  outline: none;
}

.customer-chat-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.customer-chat-error {
  color: #b91c1c;
  font-size: 0.8rem;
}

.customer-chat-actions .customer-chat-send {
  align-self: flex-end;
}

.customer-chat-modal.is-sending .customer-chat-send {
  pointer-events: none;
}

.customer-chat-modal.is-sending textarea,
.customer-chat-modal.is-loading textarea {
  opacity: 0.75;
}

.customer-chat-modal.is-loading .customer-chat-send {
  pointer-events: none;
  opacity: 0.7;
}

@media (max-width: 640px) {
  .customer-chat-dialog {
    border-radius: 0;
    width: 100%;
    height: 100%;
    max-height: none;
  }

  .customer-chat-header,
  .customer-chat-body,
  .customer-chat-form {
    padding: 16px;
  }

  .customer-chat-message {
    max-width: 92%;
  }
}

.job-name {
  font-weight: 600;
  color: var(--text-heading);
  font-size: 0.95rem;
}

.job-address {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.job-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 0.85rem;
}

.job-price {
  font-weight: 600;
  color: var(--swash-blue);
}

.job-cleaner {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.job-mark-done {
  background: var(--swash-blue);
  color: white;
  border: 2px solid var(--swash-blue);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  align-self: center;
}

.job-mark-done:hover {
  background: #005a9c;
  border-color: #005a9c;
  transform: scale(1.05);
}

.job-mark-done:active {
  transform: scale(0.95);
}

.job-mark-done:disabled {
  background: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* Status display for completed jobs */
.job-status-completed {
  background: #e8f4fd;
  color: var(--swash-blue);
  border: 1px solid var(--swash-blue);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  align-self: center;
}

/* Status display for paid jobs (same style as completed, different hue) */
.job-status-paid {
  background: #ecfdf5;
  color: #047857; /* emerald-700 */
  border: 1px solid #10b981; /* emerald-500 */
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  align-self: center;
  margin-left: 6px;
}

/* Generic utility */
.hidden { display: none !important; }

.day-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.day-actions-select {
  padding: 6px 10px;
  border: 1px solid #c8d4e5;
  border-radius: 6px;
  background: #fff;
}

.day-total {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-heading);
}

.btn-send-day {
  padding: 8px 20px;
  background: var(--swash-blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-send-day:hover {
  background: #005a9e;
}

.hidden-by-search {
  display: none !important;
}

/* Modal improvements */
.modal__recipients-section {
  margin-bottom: 20px;
}

.modal__recipients {
  max-height: 200px;
  overflow-y: auto;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}

.modal__recipients ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.modal__recipients li {
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.9rem;
  color: var(--text-body);
}

.modal__recipients li:last-child {
  border-bottom: none;
}

.modal__errors {
  background: #fef2f2;
  border: 1px solid #f87171;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
  color: #b91c1c;
  font-size: 0.9rem;
}

.modal__errors ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.modal__progress {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--swash-blue);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

.quotes-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quotes-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Ensure mobile-only sections stay hidden on desktop even if other classes set display */
.mobile-only {
  display: none !important;
}

.quotes-cards__empty {
  padding: 18px;
  border: 1px dashed #c8d4e5;
  border-radius: 12px;
  text-align: center;
  color: #6b7785;
  background: #f8fbff;
}

.quote-card {
  background: #ffffff;
  border: 1px solid #d6e1f2;
  border-radius: 14px;
  border-left: 5px solid transparent;
  box-shadow: 0 12px 32px rgba(16, 42, 67, 0.1);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quote-card--booked {
  border-color: rgba(28, 156, 93, 0.28);
  border-left-color: #1c9c5d;
}

.quote-card--needs-booking {
  border-color: rgba(245, 158, 11, 0.28);
  border-left-color: #f59e0b;
}

.quote-card--cancelled {
  border-color: rgba(176, 0, 32, 0.28);
  border-left-color: #b00020;
}

.quote-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quote-card__header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.quote-card__checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #0057b8;
}

.quote-card__checkbox input {
  width: 20px;
  height: 20px;
}

.quote-card__ref {
  font-weight: 700;
  color: #0078d7;
  font-size: 15px;
}

.quote-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quote-card__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.quote-card__row--contact {
  flex-direction: column;
}

.quote-card__row--contact .quote-card__value {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quote-card__row--pricing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quote-card__row--pricing > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.quote-card__label {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7785;
}

.quote-card__value {
  font-size: 15px;
  font-weight: 600;
  color: #1f2933;
  text-align: right;
}

.quote-card__time {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #6b7785;
}

.quote-card__contact {
  display: block;
  font-size: 15px;
  color: #0057b8;
  text-decoration: none;
  word-break: break-word;
}

.quote-card__contact + .quote-card__contact {
  margin-top: 4px;
}

.quote-card__contact--missing {
  color: #9aa5b1;
}

.quote-card__status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #eef2f7;
  color: #334155;
}

.quote-card__status-pill--booked {
  background: rgba(28, 156, 93, 0.18);
  color: #0f8a3b;
}

.quote-card__status-pill--needs-booking {
  background: rgba(245, 158, 11, 0.18);
  color: #b36b00;
}

.quote-card__status-pill--cancelled {
  background: rgba(176, 0, 32, 0.18);
  color: #b00020;
}

@media (max-width: 768px) {
  .schedule-week {
    padding: 0;
    margin-top: 24px;
    margin-bottom: 20px;
    gap: 16px;
    overflow-x: hidden !important;
  }

  .week-table {
    overflow-x: hidden !important;
  }

  .week-table tr {
    grid-template-columns: 1fr;
    row-gap: 16px;
  }

  .week-table thead {
    display: none;
  }

  .week-table td {
    display: block;
    border: none;
    background: transparent;
    padding: 0;
    overflow-x: hidden;
  }

  .day-column {
    width: 100%;
    padding: 12px 14px 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    overflow-x: hidden;
  }

  .day-column::before {
    content: attr(data-date);
    display: block;
    background: #d9ecff;
    color: var(--swash-blue);
    font-weight: 600;
    text-align: center;
    padding: 10px 12px;
    border-radius: 10px 10px 0 0;
    margin: -12px -14px 12px;
  }

  .day-header {
    border-radius: 10px 10px 0 0;
  }
}

@media (max-width: 900px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .controls-with-actions {
    gap: 12px;
  }

  .page {
    margin: 16px auto 40px;
    padding: 0 12px;
  }

  .card {
    padding: 18px 16px;
  }

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

  .filter-group input[type="date"],
  .filter-group select {
    min-width: 0;
    width: 100%;
  }

}





/* ============================================================
   Quote Page (rep) scoped theming
   Ensures even spacing, alignment, and consistent control styling
   without affecting other pages. Applies only to body.quote-page
   or the inline .quote-modal-shell component.
   ============================================================ */
:is(body.quote-page, .quote-modal-shell) .form-grid {
  gap: 18px 20px; /* even spacing across grid rows/cols */
}

:is(body.quote-page, .quote-modal-shell) .inline-two {
  gap: 18px 20px; /* match form-grid spacing */
}

/* Inputs: consistent size and rounded corners */
:is(body.quote-page, .quote-modal-shell) input,
:is(body.quote-page, .quote-modal-shell) select,
:is(body.quote-page, .quote-modal-shell) textarea {
  min-height: 42px;
  padding: 12px 14px;
  border-radius: 10px; /* less rounded */
  border: 1px solid var(--swash-blue);
  background: #fff;
  box-shadow: none;
}

/* Stronger focus treatment, but scoped */
:is(body.quote-page, .quote-modal-shell) input:focus,
:is(body.quote-page, .quote-modal-shell) select:focus,
:is(body.quote-page, .quote-modal-shell) textarea:focus {
  box-shadow: none; /* remove glow */
  border-color: var(--swash-blue-dark);
}

/* Labels spacing for clean vertical rhythm */
:is(body.quote-page, .quote-modal-shell) .form-section {
  gap: 8px;
}

/* Unify label spacing above inputs across all sections on quote page */
:is(body.quote-page, .quote-modal-shell) .form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px; /* consistent with .form-section gap */
  color: var(--text-muted);
  font-weight: 600;
}

/* Customer box, Options box, Result panel: consistent outside spacing */
:is(body.quote-page, .quote-modal-shell) .customer-section.customer-box {
  margin-bottom: 16px;
}

:is(body.quote-page, .quote-modal-shell) .options-box {
  margin-top: 16px;
}

:is(body.quote-page, .quote-modal-shell) .result-panel {
  margin-top: 18px;
}

/* Actions rows below result: align items and unify spacing */
:is(body.quote-page, .quote-modal-shell) .form-actions {
  align-items: center;
  gap: 18px;
  margin-top: 12px;
}

/* Compact spacing variant for tight alignment under pricing box */
:is(body.quote-page, .quote-modal-shell) .form-actions--compact {
  gap: 10px;
  margin-top: 8px; /* small gap below pricing box */
  flex-wrap: wrap; /* allow clean wrapping on small screens */
}

/* Utility modifiers for alignment per row */
:is(body.quote-page, .quote-modal-shell) .form-actions--start { justify-content: flex-start; }
:is(body.quote-page, .quote-modal-shell) .form-actions--end { justify-content: flex-end; }

/* Ensure checkbox label in action rows has no extra margins */
:is(body.quote-page, .quote-modal-shell) .form-actions .checkbox { margin: 0; }

/* Chip-style toggles in compact action row */
:is(body.quote-page, .quote-modal-shell) .form-actions--compact .checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

:is(body.quote-page, .quote-modal-shell) .form-actions--compact .checkbox input {
  width: 18px;
  height: 18px;
}

:is(body.quote-page, .quote-modal-shell) .form-actions--compact .checkbox span {
  line-height: 1.1;
}

/* Order jobs modal styles */
.order-job-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: move;
  transition: all 0.2s ease;
  user-select: none;
}

.order-job-item:hover {
  background: #f9fafb;
  border-color: #0078d7;
  box-shadow: 0 2px 4px rgba(0, 120, 215, 0.1);
}

.order-job-drag-handle {
  color: #9ca3af;
  font-size: 18px;
  cursor: grab;
  flex-shrink: 0;
}

.order-job-drag-handle:active {
  cursor: grabbing;
}

.order-job-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.order-job-number {
  background: #0078d7;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.order-job-details {
  flex: 1;
  min-width: 0;
}

.order-job-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1f2937;
}

.order-job-address {
  font-size: 0.85rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-job-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.order-job-price {
  font-weight: 600;
  color: #0078d7;
  font-size: 0.9rem;
  white-space: nowrap;
}

.order-job-duration {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
  padding: 2px 6px;
  background: #f1f5f9;
  border-radius: 3px;
  font-weight: 500;
}

/* Larger checkboxes alignment */
body.quote-page .checkbox--lg span {
  line-height: 1.1;
}

/* Slider row minor refinements for alignment */
body.quote-page .slider-row {
  gap: 12px;
  border-radius: 12px; /* less rounded */
  border: 1px solid var(--swash-blue); /* thinner */
  box-shadow: none; /* no shadow */
}

body.quote-page .slider-row:focus-within {
  box-shadow: none; /* remove focus glow */
}

body.quote-page .slider-row .slider-value {
  margin-left: 10px;
}

/* Prevent pill border on range inputs and checkboxes */
body.quote-page input[type="range"] {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.quote-page input[type="checkbox"] {
  border: 0;
  box-shadow: none;
}

/* Remove range thumb shadow/ring inside quote page only */
body.quote-page .slider-row input[type="range"]::-webkit-slider-thumb {
  box-shadow: none;
}

body.quote-page .slider-row input[type="range"]::-moz-range-thumb {
  box-shadow: none;
}

/* Selection info bar */
.schedule-selection-info {
  display: none !important;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #0078d7 0%, #106ebe 100%);
  color: white;
  border-radius: 6px;
  font-weight: 600;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.selection-count {
  font-size: 0.95rem;
}

.selection-total {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.95rem;
}

.schedule-selection-info .btn-sm {
  font-size: 0.8rem;
  padding: 4px 10px;
}

/* Message Log Page */
.message-log-table {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.message-log-list {
  display: flex;
  flex-direction: column;
}

.message-log-row {
  display: grid;
  grid-template-columns: 120px 1fr 2fr 180px;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s ease, transform 0.1s ease;
  cursor: pointer;
}

.message-log-row:active {
  transform: scale(0.995);
}

.message-log-row:hover {
  background-color: #f9fafb;
}

.message-log-row:last-child {
  border-bottom: none;
}

.message-log-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.message-type {
  display: flex;
  justify-content: flex-start;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  width: fit-content;
}

.badge--booking {
  background: #dbeafe;
  color: #0c4a6e;
}

.badge--message {
  background: #fce7f3;
  color: #831843;
}

.badge--reminder {
  background: #fef3c7;
  color: #78350f;
}

.badge--receipt {
  background: #dcfce7;
  color: #14532d;
}

.badge-unread {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #e11d48;
  color: #fff;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
  padding: 0 6px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.customer-name {
  font-weight: 600;
  color: #1f2937;
  font-size: 0.95rem;
}

.customer-email {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 2px;
}

.message-subject {
  font-weight: 600;
  color: #1f2937;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.message-preview {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.date-time {
  font-size: 0.85rem;
  color: #475569;
  font-weight: 500;
  line-height: 1.3;
}

.ref-code {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
  font-family: monospace;
}

.table-loading,
.empty-state,
.error-message {
  text-align: center;
  padding: 48px 16px;
  color: #64748b;
}

.empty-state {
  font-weight: 500;
  font-size: 1rem;
}

.error-message {
  color: #dc2626;
}

.table-info {
  padding: 12px 16px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  font-size: 0.9rem;
  color: #64748b;
  border-radius: 0 0 8px 8px;
}

/* Message Log Controls */
.controls {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.controls-left,
.controls-right {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.controls-left {
  flex: 0 1 auto;
}

.controls-right {
  flex: 1;
}

.control-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

#logStartDate,
#logEndDate,
#messageTypeFilter,
#messageSearch {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .message-log-row {
    grid-template-columns: 100px 1fr 1fr 150px;
    gap: 12px;
    padding: 12px;
  }

  .controls-left,
  .controls-right {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .message-log-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .message-log-cell {
    padding: 4px 0;
  }

  .message-log-cell::before {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 2px;
  }

  .message-type::before {
    content: "Type:";
  }

  .message-customer::before {
    content: "Customer:";
  }

  .message-content::before {
    content: "Message:";
  }

  .message-date::before {
    content: "Date:";
  }

  .controls-left,
  .controls-right {
    width: 100%;
    flex-direction: column;
  }

  #logStartDate,
  #logEndDate,
  #messageTypeFilter,
  #messageSearch {
    width: 100%;
  }
}

/* ============================================================
   TRAINING PAGE STYLES
   ============================================================ */

.section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 24px;
  font-weight: 500;
}

/* Training Navigation Tabs */
.training-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-soft);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.training-nav-btn {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 2px solid var(--border-soft);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.training-nav-btn:hover {
  border-color: var(--swash-blue);
  color: var(--swash-blue);
  background: rgba(0, 120, 215, 0.05);
}

.training-nav-btn.active {
  background: var(--swash-blue);
  color: white;
  border-color: var(--swash-blue);
  box-shadow: 0 4px 12px rgba(0, 120, 215, 0.3);
}

/* Training Content Container */
.training-content {
  width: 100%;
}

.training-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.training-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Training Cards */
.training-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
  transition: all 0.2s ease;
}

.training-card:hover {
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}

.training-card h3 {
  font-size: 1.25rem;
  color: var(--swash-blue);
  margin-bottom: 16px;
  margin-top: 0;
}

.training-card h4 {
  font-size: 1.05rem;
  color: var(--text-body);
  margin-bottom: 12px;
  margin-top: 0;
}

.training-card p {
  line-height: 1.7;
  margin: 12px 0;
}

/* Highlight Boxes */
.highlight-box {
  background: linear-gradient(135deg, rgba(0, 120, 215, 0.1), rgba(0, 120, 215, 0.05));
  border-left: 4px solid var(--swash-blue);
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
}

.highlight-box p {
  margin: 0;
  font-weight: 500;
}

/* Checklists */
.checklist {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.checklist li {
  padding: 10px 0;
  padding-left: 8px;
  border-bottom: 1px solid var(--border-soft);
  line-height: 1.6;
  font-size: 0.95rem;
}

.checklist li:last-child {
  border-bottom: none;
}

/* Mindset List */
.mindset-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.mindset-list li {
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(28, 156, 93, 0.08);
  border-left: 3px solid var(--swash-green);
  border-radius: 4px;
  line-height: 1.6;
  font-size: 0.95rem;
}

.mindset-list strong {
  color: var(--text-body);
}

/* Step-by-step */
.step-by-step {
  margin: 16px 0;
}

.step {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(0, 120, 215, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--swash-blue);
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  background: var(--swash-blue);
  color: white;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.step strong {
  color: var(--text-body);
  display: block;
  margin-bottom: 6px;
}

.step p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Goals Grid */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.goal-item {
  text-align: center;
  padding: 20px 16px;
  background: linear-gradient(135deg, #0078d7, #005a9e);
  color: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 120, 215, 0.2);
}

.goal-number {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.goal-item p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
}

/* Q&A Grid */
.qa-grid {
  display: grid;
  gap: 16px;
  margin: 16px 0;
}

.qa-item {
  padding: 16px;
  background: var(--bg-page);
  border-radius: 8px;
  border-left: 3px solid var(--swash-blue);
}

.qa-item strong {
  color: var(--text-body);
}

.qa-item p {
  margin: 8px 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.qa-item em {
  color: var(--text-muted);
}

/* Objection Response */
.objection-response {
  background: #fff3cd;
  padding: 16px;
  border-radius: 8px;
  border-left: 3px solid #ffc107;
  margin: 16px 0;
}

.objection-response p {
  margin: 8px 0;
}

/* Objection Table */
.objection-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.objection-table th {
  background: linear-gradient(135deg, #0078d7, #005a9e);
  color: white;
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
}

.objection-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--border-soft);
  line-height: 1.6;
  font-size: 0.93rem;
}

.objection-table tr:last-child td {
  border-bottom: none;
}

/* Psychology Grid */
.psychology-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.psychology-card {
  background: var(--bg-page);
  padding: 18px;
  border-radius: 12px;
  border: 2px solid var(--border-soft);
  transition: all 0.2s ease;
  text-align: center;
}

.psychology-card:hover {
  border-color: var(--swash-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 120, 215, 0.15);
}

.psychology-card h4 {
  color: var(--swash-blue);
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1rem;
}

.psychology-card p {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Resilience Techniques */
.resilience-technique {
  background: var(--bg-page);
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 8px;
  border-left: 3px solid var(--swash-green);
}

.resilience-technique h4 {
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--text-body);
}

.resilience-technique p {
  margin: 6px 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Debrief Checklist */
.debrief-checklist {
  display: grid;
  gap: 14px;
  margin: 16px 0;
}

.debrief-item {
  padding: 14px;
  background: linear-gradient(135deg, rgba(0, 120, 215, 0.08), rgba(0, 120, 215, 0.03));
  border-left: 3px solid var(--swash-blue);
  border-radius: 6px;
}

.debrief-item strong {
  color: var(--text-body);
  display: block;
  margin-bottom: 6px;
}

.debrief-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* FAQ Items */
.faq-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}

.faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.faq-item h4 {
  color: var(--swash-blue);
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.faq-item p {
  margin: 8px 0;
  line-height: 1.7;
  color: var(--text-muted);
}

/* Core Values Section */
.core-values {
  text-align: center;
}

.core-values h3 {
  color: white !important;
  margin-bottom: 20px;
}

.core-values ul {
  text-align: left;
  display: inline-block;
  max-width: 100%;
}

.core-values li {
  font-size: 1rem;
  margin-bottom: 12px;
  line-height: 1.8;
  text-align: left;
}

.core-values li:last-child {
  margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .training-nav {
    gap: 6px;
    margin-bottom: 24px;
  }

  .training-nav-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .training-card {
    padding: 18px;
    margin-bottom: 18px;
  }

  .training-card h3 {
    font-size: 1.1rem;
  }

  .goals-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
  }

  .goal-item {
    padding: 16px 12px;
  }

  .goal-number {
    font-size: 1.5rem;
  }

  .psychology-grid {
    grid-template-columns: 1fr;
  }

  .step {
    flex-direction: column;
    gap: 12px;
  }

  .step-num {
    min-width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }

  .objection-table {
    font-size: 0.85rem;
  }

  .objection-table th,
  .objection-table td {
    padding: 10px 12px;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }
}

/* ============================================================
   WEEKLY OVERVIEW BAR - Schedule/Admin Dashboard
   Displays unpaid/uncompleted job counts with live updates
   ============================================================ */

.weekly-overview-bar {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.weekly-overview-bar:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.weekly-overview-bar--hidden {
  display: none;
}

.weekly-overview-bar--has-issues {
  background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
  border-color: #ffc107;
}

/* Bar header: summary stats */
.weekly-overview-bar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text-body);
  padding: 0;
}

.weekly-overview-bar__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.weekly-overview-bar__toggle {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--swash-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.weekly-overview-bar__toggle--expanded {
  transform: rotate(180deg);
}

.weekly-overview-bar__stats {
  display: flex;
  gap: 16px;
  font-size: 0.95rem;
}

.weekly-overview-bar__stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.weekly-overview-bar__stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.weekly-overview-bar__stat-value {
  font-weight: 700;
  color: var(--swash-blue);
  min-width: 24px;
  text-align: center;
}

.weekly-overview-bar__stat-value--warning {
  color: var(--swash-red);
}

.weekly-overview-bar__stat-amount {
  font-weight: 600;
  color: var(--text-body);
  display: flex;
  gap: 4px;
}

.weekly-overview-bar__weather {
  font-weight: 600;
  color: var(--text-body);
  font-size: 0.9rem;
}

.weekly-overview-bar__weather-rain {
  color: #0078d7;
  font-size: 0.8rem;
  font-style: italic;
}

/* Expanded content */
.weekly-overview-bar__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-top: 0;
}

.weekly-overview-bar__content--expanded {
  max-height: 2000px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.weekly-overview-bar__jobs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.weekly-overview-job {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: box-shadow 0.2s ease;
}

.weekly-overview-job:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.weekly-overview-job--unpaid {
  border-left: 4px solid var(--swash-red);
}

.weekly-overview-job--uncompleted {
  border-left: 4px solid #ffc107;
}

.weekly-overview-job__info {
  flex: 1;
}

.weekly-overview-job__customer {
  font-weight: 600;
  color: var(--text-body);
  font-size: 0.95rem;
}

.weekly-overview-job__details {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.weekly-overview-job__detail {
  display: flex;
  gap: 4px;
}

.weekly-overview-job__price {
  font-weight: 600;
  color: var(--text-body);
}

.weekly-overview-job__date {
  color: var(--text-muted);
}

.weekly-overview-job__cleaner {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.weekly-overview-job__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.weekly-overview-job__button {
  padding: 6px 12px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text-body);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.weekly-overview-job__button:hover:not(:disabled) {
  background: var(--swash-blue);
  color: #ffffff;
  border-color: var(--swash-blue);
}

.weekly-overview-job__button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.weekly-overview-job__button--paid {
  background: var(--swash-green);
  color: #ffffff;
  border-color: var(--swash-green);
}

.weekly-overview-job__button--done {
  background: var(--swash-green);
  color: #ffffff;
  border-color: var(--swash-green);
}

/* Empty state */
.weekly-overview-bar__empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
  .weekly-overview-bar {
    padding: 12px;
  }

  .weekly-overview-bar__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .weekly-overview-bar__stats {
    flex-wrap: wrap;
    gap: 12px;
  }

  .weekly-overview-job {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .weekly-overview-job__actions {
    width: 100%;
  }

  .weekly-overview-job__button {
    flex: 1;
    text-align: center;
  }
}


