.dark {
  color-scheme: dark;
}

/* Surface fallbacks for pages that use light-only utility classes */
.dark :where(div, section, article, aside, main, nav, header, footer, ul, ol, li, table, thead, tbody, tr, td, th, form, fieldset)[class~="bg-white"]:not([class*="bg-opacity"]) {
  background-color: #1f2937 !important;
}

.dark :where(div, section, article, aside, main, nav, header, footer, ul, ol, li, table, thead, tbody, tr, td, th, form, fieldset)[class~="bg-gray-50"] {
  background-color: #111827 !important;
}

.dark :where(div, section, article, aside, main, nav, header, footer, ul, ol, li, table, thead, tbody, tr, td, th, form, fieldset)[class~="bg-gray-100"] {
  background-color: #1f2937 !important;
}

/* Text/border fallbacks where dark: variants are missing */
.dark [class~="text-gray-900"] {
  color: #f9fafb !important;
}

.dark [class~="text-gray-800"] {
  color: #f3f4f6 !important;
}

.dark [class~="text-gray-700"] {
  color: #e5e7eb !important;
}

.dark [class~="text-gray-600"] {
  color: #d1d5db !important;
}

.dark [class~="text-gray-500"] {
  color: #9ca3af !important;
}

.dark [class~="border-gray-100"] {
  border-color: #374151 !important;
}

.dark [class~="border-gray-200"] {
  border-color: #374151 !important;
}

.dark [class~="border-gray-300"] {
  border-color: #4b5563 !important;
}

.dark .hover\:bg-gray-50:hover {
  background-color: #374151 !important;
}

.dark .hover\:bg-gray-100:hover {
  background-color: #4b5563 !important;
}

/* Theme-adaptive branding images */
.theme-monogram-adaptive {
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.dark .theme-monogram-adaptive {
  filter: brightness(0) invert(1) saturate(0);
  opacity: 0.92;
}

.theme-wordmark-adaptive {
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.dark .theme-wordmark-adaptive {
  filter: brightness(0) invert(1) contrast(1.1);
  opacity: 0.92;
}

/* Stable status pill colors (avoid dynamic Tailwind class purge issues) */
.booking-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 9999px;
}

.booking-status-pill-mobile {
  border: 1px solid transparent;
}

.booking-status-pill-default {
  background-color: #f3f4f6;
  color: #1f2937;
}

.booking-status-pill-pending {
  background-color: #fef3c7;
  color: #92400e;
}

.booking-status-pill-assigned {
  background-color: #dbeafe;
  color: #1e40af;
}

.booking-status-pill-confirmed {
  background-color: #dcfce7;
  color: #166534;
}

.booking-status-pill-arrived {
  background-color: #e0e7ff;
  color: #3730a3;
}

.booking-status-pill-progress {
  background-color: #cffafe;
  color: #155e75;
}

.booking-status-pill-followup {
  background-color: #ffedd5;
  color: #9a3412;
}

.booking-status-pill-completed {
  background-color: #dbeafe;
  color: #1e40af;
}

.booking-status-pill-outscope {
  background-color: #f3e8ff;
  color: #6b21a8;
}

.booking-status-pill-refused {
  background-color: #fef3c7;
  color: #92400e;
}

.booking-status-pill-cancelled {
  background-color: #fee2e2;
  color: #991b1b;
}

.booking-status-pill-mobile.booking-status-pill-default {
  border-color: #d1d5db;
}

.booking-status-pill-mobile.booking-status-pill-pending {
  border-color: #fde68a;
}

.booking-status-pill-mobile.booking-status-pill-assigned,
.booking-status-pill-mobile.booking-status-pill-completed {
  border-color: #bfdbfe;
}

.booking-status-pill-mobile.booking-status-pill-confirmed {
  border-color: #86efac;
}

.booking-status-pill-mobile.booking-status-pill-arrived {
  border-color: #c7d2fe;
}

.booking-status-pill-mobile.booking-status-pill-progress {
  border-color: #a5f3fc;
}

.booking-status-pill-mobile.booking-status-pill-followup,
.booking-status-pill-mobile.booking-status-pill-refused {
  border-color: #fed7aa;
}

.booking-status-pill-mobile.booking-status-pill-outscope {
  border-color: #d8b4fe;
}

.booking-status-pill-mobile.booking-status-pill-cancelled {
  border-color: #fecaca;
}
