/* ==========================================================================
   MFN ENTERPRISE THEME ENGINE — LIGHT & PREMIUM OBSIDIAN DARK MODE
   High-Fidelity Token Architecture, WCAG 2.1 AA Contrast, Glassmorphism
   Compatible with all Views: Dashboard, Pipeline Kanban, Directory,
   Attribution & Ads, Settings, Scheduler, Login, Modal Intake, Embed, Drawer.
   ========================================================================== */

/* -------------------------------------------------------------
   1. GLOBAL COMPONENT & VIEWPORT UTILITIES
   ------------------------------------------------------------- */
.kanban-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(260px, 1fr));
  gap: 1rem;
  align-items: start;
}
.kanban-column {
  border-radius: 0.875rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 280px);
  min-height: 580px;
}
.kanban-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: grab;
  user-select: none;
}
.kanban-card:hover {
  transform: translateY(-2px);
}
.kanban-card:active {
  cursor: grabbing;
}
.kanban-card.is-dragging {
  opacity: 0.4;
  transform: scale(0.97);
}
.column-cards-container {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.column-cards-container::-webkit-scrollbar {
  width: 4px;
}
.column-cards-container::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
.drag-target-active {
  background-color: #EFF6FF !important;
  border-color: #3B82F6 !important;
  outline: 2px dashed #2563EB;
  outline-offset: -2px;
}

/* Metric card & table containers */
.metric-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}
.table-container {
  border: 1px solid #E2E8F0;
  border-radius: 0.875rem;
  background: #FFFFFF;
  overflow-x: auto;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.05);
}

/* Tab active states */
.source-tab, .pillar-pill, .settings-tab {
  transition: all 0.15s ease-in-out;
}
.source-tab.is-active, .pillar-pill.is-active, .settings-tab.is-active {
  background-color: #2563EB !important;
  color: #FFFFFF !important;
  border-color: #1D4ED8 !important;
}

/* -------------------------------------------------------------
   2. LIGHT MODE SPECIFICATIONS (CRISP ENTERPRISE PALETTE)
   Canvas: #F8FAFC | Surfaces: #FFFFFF | Wells: #F1F5F9
   Borders: #E2E8F0 | Text Primary: #0F172A | Muted: #64748B
   ------------------------------------------------------------- */
body:not(.dark) {
  background-color: #F8FAFC !important;
  color: #0F172A !important;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body:not(.dark) #appSidebar {
  background-color: #FFFFFF !important;
  border-right-color: #E2E8F0 !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body:not(.dark) #sidebarBrandHeader {
  border-bottom-color: #F1F5F9 !important;
}

body:not(.dark) #appHeader {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border-bottom-color: #E2E8F0 !important;
  transition: all 0.25s ease;
}

/* Card surfaces: Crisp white with subtle, clean contrast */
body:not(.dark) div.bg-white, 
body:not(.dark) section.bg-white, 
body:not(.dark) main .bg-white {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.02) !important;
}

/* Sub-panels and metric containers */
body:not(.dark) .bg-slate-50 {
  background-color: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}

body:not(.dark) .bg-slate-100 {
  background-color: #F1F5F9 !important;
  border-color: #E2E8F0 !important;
}

body:not(.dark) thead tr, 
body:not(.dark) th {
  background-color: #F8FAFC !important;
  color: #334155 !important;
  border-color: #E2E8F0 !important;
}

body:not(.dark) tbody tr:hover {
  background-color: #F8FAFC !important;
}

body:not(.dark) .kanban-column {
  background-color: #F1F5F9 !important;
  border-color: #E2E8F0 !important;
}

body:not(.dark) .kanban-card {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
}

body:not(.dark) input[type="text"], 
body:not(.dark) input[type="email"], 
body:not(.dark) input[type="tel"], 
body:not(.dark) select, 
body:not(.dark) textarea {
  background-color: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

/* Light Mode Pillar Cards */
body:not(.dark) .pillar-card {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
}
body:not(.dark) .pillar-branding { background-color: #F8FAFC !important; border-color: #E2E8F0 !important; }
body:not(.dark) .pillar-social { background-color: #F8FAFC !important; border-color: #E2E8F0 !important; }
body:not(.dark) .pillar-perf { background-color: #F8FAFC !important; border-color: #E2E8F0 !important; }
body:not(.dark) .pillar-web { background-color: #F8FAFC !important; border-color: #E2E8F0 !important; }

/* Light Mode Text Contrast Enforcement */
body:not(.dark) .text-slate-900,
body:not(.dark) [class*="text-slate-900"] {
  color: #0F172A !important;
}
body:not(.dark) .text-slate-800,
body:not(.dark) [class*="text-slate-800"] {
  color: #1E293B !important;
}
body:not(.dark) .text-slate-700,
body:not(.dark) [class*="text-slate-700"] {
  color: #334155 !important;
}
body:not(.dark) .text-slate-600,
body:not(.dark) [class*="text-slate-600"] {
  color: #475569 !important;
}
body:not(.dark) .text-slate-500,
body:not(.dark) [class*="text-slate-500"] {
  color: #64748B !important;
}
body:not(.dark) .text-slate-400,
body:not(.dark) [class*="text-slate-400"] {
  color: #94A3B8 !important;
}

/* -------------------------------------------------------------
   3. PREMIUM OBSIDIAN DARK MODE ARCHITECTURE
   Deepest Canvas: #090D16 | Elevated Surfaces: #0D1322, #111827
   Card Layer: #162032 | Borders: #1E293B, #334155
   Text Hierarchy: #F8FAFC (Headings), #CBD5E1 (Body), #94A3B8 (Muted)
   ------------------------------------------------------------- */
body.dark,
html.dark body {
  background-color: #090D16 !important;
  color: #F1F5F9 !important;
  color-scheme: dark;
}

/* Sidebar in Dark Mode */
body.dark #appSidebar,
body.dark aside#appSidebar {
  background-color: #0D1322 !important;
  border-right-color: #1E293B !important;
}

body.dark #sidebarBrandHeader {
  border-bottom-color: #1E293B !important;
}

body.dark #sidebarBrandHeader div.text-slate-900,
body.dark #sidebarBrandHeader .text-slate-900 {
  color: #F8FAFC !important;
}

body.dark #sidebarBrandHeader div.text-slate-500,
body.dark #sidebarBrandHeader .text-slate-500 {
  color: #94A3B8 !important;
}

/* Sidebar Logo Badge: Clean, Vibrant Cyan glow, No muddy invert */
#appSidebar .sidebar-brand-icon,
#sidebarBrandHeader div.w-8.h-8 {
  background: linear-gradient(135deg, #1D4ED8 0%, #0284C7 100%) !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

#appSidebar .sidebar-brand-icon img,
#sidebarBrandHeader div.w-8.h-8 img {
  filter: none !important;
  opacity: 1 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

body.dark #appSidebar nav div.text-slate-400 {
  color: #64748B !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
}

/* Sidebar Navigation Items - Sleek, High Contrast */
body.dark #appSidebar nav a {
  color: #94A3B8 !important;
  background-color: transparent !important;
  border: 1px solid transparent !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.dark #appSidebar nav a svg {
  color: #64748B !important;
  transition: color 0.2s ease, transform 0.2s ease !important;
}

body.dark #appSidebar nav a:hover {
  background-color: rgba(30, 41, 59, 0.7) !important;
  border-color: rgba(56, 189, 248, 0.2) !important;
  color: #F8FAFC !important;
}

body.dark #appSidebar nav a:hover svg {
  color: #38BDF8 !important;
  transform: translateX(2px);
}

/* Active Navigation Item */
body.dark #appSidebar nav a.bg-blue-50,
body.dark #appSidebar nav a.active {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.16) 0%, rgba(14, 165, 233, 0.06) 100%) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #38BDF8 !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.12) !important;
}

body.dark #appSidebar nav a.bg-blue-50 svg,
body.dark #appSidebar nav a.active svg {
  color: #38BDF8 !important;
}

/* Badge count pill (e.g., Kanban count) */
body.dark #appSidebar nav #navKanbanCount,
body.dark #appSidebar nav .nav-count-badge {
  background-color: #1E293B !important;
  color: #38BDF8 !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
}

body.dark #appSidebar nav a.bg-blue-50 #navKanbanCount {
  background-color: rgba(56, 189, 248, 0.25) !important;
  color: #FFFFFF !important;
}

body.dark #appSidebar div.border-slate-100 {
  border-color: #1E293B !important;
}

body.dark #appSidebar span.text-slate-900 {
  color: #F1F5F9 !important;
}

body.dark #appSidebar span.text-slate-500 {
  color: #94A3B8 !important;
}

/* Ensure bottom sidebar profile stacks name above designation */
#appSidebar .sidebar-user-details,
#appSidebar div.sidebar-hide-on-collapse.flex.flex-col {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: flex-start !important;
  line-height: 1.25 !important;
}

#appSidebar .sidebar-user-details span:first-child,
#appSidebar div.sidebar-hide-on-collapse.flex.flex-col span:first-child {
  display: block !important;
  margin-bottom: 2px !important;
}

#appSidebar .sidebar-user-details span:last-child,
#appSidebar div.sidebar-hide-on-collapse.flex.flex-col span:last-child {
  display: block !important;
}

/* Header in Dark Mode */
body.dark #appHeader,
body.dark header#appHeader {
  background-color: #0B0B0B !important;
  border-bottom-color: #1F1F1F !important;
  backdrop-filter: blur(12px) !important;
}

body.dark #appHeader h1, 
body.dark #appHeader span.text-slate-900 {
  color: #FFFFFF !important;
}

body.dark #appHeader span.text-slate-500 {
  color: #A3A3A3 !important;
}

body.dark #appHeader div.border-slate-200,
body.dark #appHeader .border-slate-200 {
  border-color: #1F1F1F !important;
}

body.dark #appHeader .bg-blue-600 {
  background-color: #F59E0B !important;
  color: #0B0B0B !important;
}

/* Generic Surfaces, Cards, Sections & Panels */
body.dark div.bg-white,
body.dark section.bg-white,
body.dark main .bg-white,
body.dark .bg-white,
body.dark [class*="bg-white"] {
  background-color: #111827 !important;
  border-color: #1F2937 !important;
  color: #E2E8F0 !important;
}

body.dark .bg-slate-50,
body.dark .bg-slate-50\/70,
body.dark .bg-slate-50\/80,
body.dark .bg-slate-50\/90,
body.dark [class*="bg-slate-50"] {
  background-color: #0F172A !important;
  border-color: #1E293B !important;
}

body.dark .bg-slate-100,
body.dark .bg-slate-100\/80,
body.dark [class*="bg-slate-100"] {
  background-color: #1E293B !important;
  border-color: #334155 !important;
  color: #CBD5E1 !important;
}

body.dark .bg-slate-200,
body.dark .bg-slate-200\/70 {
  background-color: #334155 !important;
  color: #CBD5E1 !important;
}

/* Borders in Dark Mode */
body.dark .border-slate-50,
body.dark .border-slate-100,
body.dark .border-slate-200,
body.dark .border-slate-200\/60,
body.dark .border-slate-200\/70,
body.dark .border-slate-200\/80,
body.dark .border-slate-200\/90,
body.dark .border-slate-300,
body.dark .border-\[\#E2E8F0\],
body.dark [class*="border-[#E2E8F0]"],
body.dark .border-\[\#CBD5E1\],
body.dark [class*="border-[#CBD5E1]"],
body.dark .border-\[\#F1F5F9\],
body.dark [class*="border-[#F1F5F9]"] {
  border-color: #1E293B !important;
}

body.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
body.dark .divide-slate-200 > :not([hidden]) ~ :not([hidden]),
body.dark .divide-\[\#E2E8F0\] > :not([hidden]) ~ :not([hidden]) {
  border-color: #1E293B !important;
}

/* Text Hierarchy in Dark Mode */
body.dark .text-slate-900,
body.dark [class*="text-slate-900"],
body.dark .text-\[\#0F172A\],
body.dark [class*="text-[#0F172A]"] {
  color: #F8FAFC !important;
}

body.dark .text-slate-800,
body.dark [class*="text-slate-800"] {
  color: #F1F5F9 !important;
}

body.dark .text-slate-700,
body.dark [class*="text-slate-700"],
body.dark .text-\[\#334155\],
body.dark [class*="text-[#334155]"] {
  color: #CBD5E1 !important;
}

body.dark .text-slate-600,
body.dark [class*="text-slate-600"],
body.dark .text-\[\#475569\],
body.dark [class*="text-[#475569]"] {
  color: #94A3B8 !important;
}

body.dark .text-slate-500,
body.dark [class*="text-slate-500"],
body.dark .text-\[\#64748B\],
body.dark [class*="text-[#64748B]"] {
  color: #94A3B8 !important;
}

body.dark .text-slate-400,
body.dark [class*="text-slate-400"],
body.dark .text-\[\#94A3B8\],
body.dark [class*="text-[#94A3B8]"] {
  color: #64748B !important;
}

body.dark .text-slate-300 {
  color: #475569 !important;
}

/* Hover States in Dark Mode */
body.dark .hover\:bg-slate-50:hover,
body.dark .hover\:bg-slate-50\/50:hover,
body.dark .hover\:bg-slate-50\/80:hover,
body.dark .hover\:bg-slate-100:hover,
body.dark [class*="hover:bg-[#EFF6FF]"]:hover {
  background-color: #1E293B !important;
  color: #F8FAFC !important;
}

body.dark .hover\:text-slate-900:hover,
body.dark .hover\:text-slate-800:hover,
body.dark .hover\:text-slate-700:hover {
  color: #38BDF8 !important;
}

/* Kanban Columns & Cards */
body.dark .kanban-column {
  background-color: #0D1322 !important;
  border-color: #1E293B !important;
}

body.dark .kanban-column > div:first-child {
  background-color: #111827 !important;
  border-bottom-color: #1E293B !important;
}

body.dark .kanban-column .column-count {
  background-color: #1E293B !important;
  color: #38BDF8 !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
}

body.dark .kanban-card {
  background-color: #162032 !important;
  border-color: #1E293B !important;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.5) !important;
}

body.dark .kanban-card:hover {
  border-color: #38BDF8 !important;
  box-shadow: 0 8px 20px -2px rgba(0, 0, 0, 0.7), 0 0 12px 0 rgba(56, 189, 248, 0.15) !important;
}

body.dark .kanban-empty {
  border-color: #1E293B !important;
  background-color: rgba(17, 24, 39, 0.5) !important;
  color: #64748B !important;
}

/* Tables in Dark Mode */
body.dark div.table-container {
  background-color: #111827 !important;
  border-color: #1E293B !important;
}

body.dark thead tr,
body.dark th {
  background-color: #172033 !important;
  color: #38BDF8 !important;
  border-color: #1E293B !important;
}

body.dark tbody tr {
  background-color: #111827 !important;
  border-color: #1E293B !important;
  color: #F1F5F9 !important;
}

body.dark tbody tr:hover {
  background-color: #1A2438 !important;
}

body.dark tbody td span.text-slate-900,
body.dark tbody td span.text-slate-800,
body.dark tbody td span.text-slate-700,
body.dark tbody td span.font-bold,
body.dark tbody td span.font-semibold {
  color: #F8FAFC !important;
}

body.dark tbody td span.text-slate-500,
body.dark tbody td span.text-slate-400 {
  color: #94A3B8 !important;
}

body.dark tbody td span.font-mono {
  color: #38BDF8 !important;
}

/* -------------------------------------------------------------
   4. BADGE MATRIX (WCAG 2.1 AA COMPLIANT IN DARK MODE)
   Luminous, legible tints on dark obsidian backgrounds
   ------------------------------------------------------------- */
body.dark .bg-sky-50,
body.dark .bg-sky-100,
body.dark [class*="bg-sky-"] {
  background-color: rgba(14, 165, 233, 0.15) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #38BDF8 !important;
}
body.dark .text-sky-700,
body.dark .text-sky-800,
body.dark .text-sky-900 {
  color: #38BDF8 !important;
}

body.dark .bg-amber-50,
body.dark .bg-amber-100,
body.dark [class*="bg-amber-"] {
  background-color: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
  color: #FBBF24 !important;
}
body.dark .text-amber-700,
body.dark .text-amber-800,
body.dark .text-amber-900 {
  color: #FBBF24 !important;
}

body.dark .bg-violet-50,
body.dark .bg-violet-100,
body.dark .bg-purple-50,
body.dark .bg-purple-100,
body.dark [class*="bg-violet-"],
body.dark [class*="bg-purple-"] {
  background-color: rgba(168, 85, 247, 0.15) !important;
  border-color: rgba(192, 132, 252, 0.35) !important;
  color: #C084FC !important;
}
body.dark .text-violet-700,
body.dark .text-violet-800,
body.dark .text-violet-900,
body.dark .text-purple-700,
body.dark .text-purple-800 {
  color: #C084FC !important;
}

body.dark .bg-emerald-50,
body.dark .bg-emerald-100,
body.dark [class*="bg-emerald-"] {
  background-color: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
  color: #34D399 !important;
}
body.dark .text-emerald-700,
body.dark .text-emerald-800,
body.dark .text-emerald-900 {
  color: #34D399 !important;
}

body.dark .bg-blue-50,
body.dark .bg-blue-100,
body.dark .bg-indigo-50,
body.dark .bg-indigo-100,
body.dark [class*="bg-blue-"],
body.dark [class*="bg-indigo-"] {
  background-color: rgba(59, 130, 246, 0.15) !important;
  border-color: rgba(96, 165, 250, 0.35) !important;
  color: #60A5FA !important;
}
body.dark .text-blue-700,
body.dark .text-blue-800,
body.dark .text-indigo-700,
body.dark .text-indigo-800 {
  color: #60A5FA !important;
}

body.dark .bg-rose-50,
body.dark .bg-red-50,
body.dark [class*="bg-rose-"],
body.dark [class*="bg-red-"] {
  background-color: rgba(244, 63, 94, 0.15) !important;
  border-color: rgba(251, 113, 133, 0.35) !important;
  color: #FB7185 !important;
}

/* Practice Pillar Dashboard Cards in Dark Mode */
body.dark .pillar-card {
  background-color: #0F172A !important;
  border-color: #1E293B !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
body.dark .pillar-card:hover {
  transform: translateY(-2px);
  border-color: #38BDF8 !important;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6), 0 0 12px 0 rgba(56, 189, 248, 0.15) !important;
}
body.dark .pillar-card .pillar-title,
body.dark .pillar-card .pillar-count {
  color: #F8FAFC !important;
}
body.dark .pillar-card .pillar-sub {
  color: #94A3B8 !important;
}
body.dark .pillar-card .pillar-badge {
  background-color: #1E293B !important;
  border-color: #334155 !important;
  color: #38BDF8 !important;
}
body.dark .pillar-branding .pillar-badge { color: #38BDF8 !important; border-color: rgba(56, 189, 248, 0.3) !important; }
body.dark .pillar-social .pillar-badge { color: #FBBF24 !important; border-color: rgba(251, 191, 36, 0.3) !important; }
body.dark .pillar-perf .pillar-badge { color: #C084FC !important; border-color: rgba(192, 132, 252, 0.3) !important; }
body.dark .pillar-web .pillar-badge { color: #34D399 !important; border-color: rgba(52, 211, 153, 0.3) !important; }

/* -------------------------------------------------------------
   5. FORM INPUTS, SELECTS & TEXTAREAS IN DARK MODE
   ------------------------------------------------------------- */
body.dark input[type="text"],
body.dark input[type="email"],
body.dark input[type="tel"],
body.dark input[type="password"],
body.dark input[type="search"],
body.dark input[type="number"],
body.dark select,
body.dark textarea {
  background-color: #0F172A !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}

body.dark input::placeholder,
body.dark textarea::placeholder {
  color: #64748B !important;
}

body.dark input:focus,
body.dark select:focus,
body.dark textarea:focus {
  background-color: #111827 !important;
  border-color: #38BDF8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
}

body.dark select option {
  background-color: #0F172A !important;
  color: #F8FAFC !important;
}

body.dark code {
  background-color: #1E293B !important;
  color: #38BDF8 !important;
  border-color: #334155 !important;
}

/* -------------------------------------------------------------
   6. DRAWERS, MODALS & DIALOGS IN DARK MODE
   ------------------------------------------------------------- */
body.dark #drawerContent,
body.dark aside.w-full.sm\:w-\[460px\],
body.dark #drawerOverlay > div {
  background-color: #0F172A !important;
  border-left-color: #1E293B !important;
  color: #F1F5F9 !important;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.75) !important;
}

body.dark #drawerContent header,
body.dark aside.w-full.sm\:w-\[460px\] header {
  background-color: #0F172A !important;
  border-bottom-color: #1E293B !important;
}

/* Meeting Cards in Drawer & Modals */
body.dark .drawer-meeting-card {
  background-color: #162032 !important;
  background-image: none !important;
  border-color: #1E293B !important;
}

body.dark .drawer-meeting-title {
  color: #38BDF8 !important;
}

body.dark .drawer-meeting-badge {
  background-color: #1E293B !important;
  border-color: #334155 !important;
  color: #94A3B8 !important;
}

body.dark .drawer-meeting-desc {
  color: #94A3B8 !important;
}

body.dark .drawer-meeting-desc strong {
  color: #F8FAFC !important;
}

body.dark .drawer-meeting-btn {
  background-color: #2563EB !important;
  color: #FFFFFF !important;
  border: 1px solid #3B82F6 !important;
}

body.dark .drawer-meeting-btn:hover {
  background-color: #1D4ED8 !important;
  border-color: #60A5FA !important;
  color: #FFFFFF !important;
}

/* Modals */
body.dark #createUserModal > div,
body.dark #editUserModal > div,
body.dark #resetPasswordModal > div,
body.dark #scheduleMeetModal > div,
body.dark #scenarioModal > div {
  background-color: #0F172A !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
}

body.dark #createUserModal h3,
body.dark #editUserModal h3,
body.dark #resetPasswordModal h3,
body.dark #scheduleMeetModal h3,
body.dark #scenarioModal h3 {
  color: #F8FAFC !important;
}

body.dark #createUserModal input,
body.dark #createUserModal select,
body.dark #editUserModal input,
body.dark #editUserModal select,
body.dark #resetPasswordModal input,
body.dark #scheduleMeetModal input[type="date"],
body.dark #scenarioModal input[type="datetime-local"] {
  background-color: #111827 !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
  color-scheme: dark;
}

body.dark .sm\:max-w-\[580px\],
body.dark .max-w-\[580px\],
body.dark .max-w-\[440px\] > div {
  background-color: #111827 !important;
  border-color: #1F2937 !important;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8) !important;
}

body.dark div[class*="sm:max-w-[580px]"] > div:first-child,
body.dark div[class*="sm:max-w-[580px]"] > div:last-child {
  background-color: #0F172A !important;
  border-color: #1E293B !important;
}

/* -------------------------------------------------------------
   7. INTERACTIVE PILLS, DATE BUTTONS & WIDGET TOGGLES
   ------------------------------------------------------------- */
body.dark .pillar-btn {
  background-color: #111827 !important;
  border-color: #1F2937 !important;
}
body.dark .pillar-btn:hover {
  background-color: #1E293B !important;
  border-color: #38BDF8 !important;
}
body.dark .pillar-btn[class*="border-2"],
body.dark .pillar-btn[class*="border-[#2563EB]"],
body.dark .pillar-btn.active {
  background-color: rgba(37, 99, 235, 0.15) !important;
  border-color: #38BDF8 !important;
}

body.dark .date-pill {
  background-color: #111827 !important;
  border-color: #1F2937 !important;
  color: #CBD5E1 !important;
}
body.dark .date-pill.active {
  background-color: #2563EB !important;
  border-color: #38BDF8 !important;
  color: #FFFFFF !important;
}

body.dark .slot-pill {
  background-color: #111827 !important;
  border-color: #1F2937 !important;
  color: #CBD5E1 !important;
}
body.dark .slot-pill:hover {
  border-color: #38BDF8 !important;
  color: #F8FAFC !important;
}
body.dark .slot-pill.active {
  background-color: rgba(37, 99, 235, 0.2) !important;
  border-color: #38BDF8 !important;
  color: #38BDF8 !important;
}

/* Theme Switch Button Styling */
.theme-switch-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

body:not(.dark) .theme-switch-btn {
  background-color: #FFFFFF;
  border: 1px solid #BAE6FD;
  color: #0284C7;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

body:not(.dark) .theme-switch-btn:hover {
  background-color: #E0F2FE;
  color: #0369A1;
}

body.dark .theme-switch-btn {
  background-color: #1E293B;
  border: 1px solid #334155;
  color: #FBBF24;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

body.dark .theme-switch-btn:hover {
  background-color: #334155;
  color: #FDE68A;
}

/* -------------------------------------------------------------
   8. ACCESSIBILITY & WCAG 2.1 AA COMPLIANCE (UI/UX PRO MAX)
   ------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #38BDF8 !important;
  outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

button,
[role="button"],
.cursor-pointer,
select,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer !important;
}

/* ----------------------------------------------------------

/* -------------------------------------------------------------
   WHATSAPP UI/UX PRO-MAX ADAPTIVE TOKENS
   ------------------------------------------------------------- */
.whatsapp-chat-page-main {
  padding-top: 5rem !important; /* 80px clears the 64px fixed header with comfortable air */
}

/* Base Light Mode WhatsApp & Chat Screen */
body:not(.dark) .whatsapp-mock-container,
body:not(.dark) .wa-chat-window-bg {
  background-color: #F8FAFC !important;
  border-color: #E2E8F0 !important;
  background-image: radial-gradient(#CBD5E1 1.2px, transparent 1.2px) !important;
  background-size: 20px 20px !important;
}
body:not(.dark) .wa-sidebar-bg {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
}
body:not(.dark) #chatTopBar {
  background-color: #FFFFFF !important;
  border-bottom-color: #E2E8F0 !important;
}
body:not(.dark) #chatLeadName {
  color: #0F172A !important;
}
body:not(.dark) .wa-contact-item {
  border-color: #F1F5F9 !important;
  background-color: #FFFFFF !important;
}
body:not(.dark) .wa-contact-item:hover {
  background-color: #F8FAFC !important;
}
body:not(.dark) .wa-contact-item.active {
  background-color: #EFF6FF !important;
  border-left: 4px solid #0284C7 !important;
  box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.15) !important;
}
body:not(.dark) .wa-contact-item.active span.font-bold {
  color: #0F172A !important;
}
body:not(.dark) .wa-contact-item.active p {
  color: #334155 !important;
}
body:not(.dark) .wa-contact-name {
  color: #0F172A !important;
}
body:not(.dark) .wa-contact-msg {
  color: #475569 !important;
}
body:not(.dark) .whatsapp-bubble-card,
body:not(.dark) .wa-bubble-inbound {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}
body:not(.dark) .wa-bubble-outbound {
  background-color: #DCFCE7 !important;
  color: #064E3B !important;
  font-weight: 500;
  border-color: #BBF7D0 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}
body:not(.dark) .whatsapp-bubble-header {
  border-bottom-color: #F1F5F9 !important;
  color: #0F172A !important;
}
body:not(.dark) .whatsapp-bubble-body {
  color: #1E293B !important;
}
body:not(.dark) .whatsapp-meta-box {
  background-color: #F8FAFC !important;
  border-color: #E2E8F0 !important;
  color: #0F172A !important;
}
body:not(.dark) .whatsapp-button-card {
  background-color: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
  font-weight: 600 !important;
}
body:not(.dark) .whatsapp-button-card:hover {
  background-color: #F1F5F9 !important;
  border-color: #94A3B8 !important;
}
body:not(.dark) .wa-composer-bar {
  background-color: #FFFFFF !important;
  border-color: #E2E8F0 !important;
}

/* Dark Mode WhatsApp & Chat Screen (Bento & Deep Obsidian Contrast) */
body.dark .whatsapp-mock-container,
body.dark .wa-chat-window-bg {
  background-color: #0B141A !important;
  border-color: #1E293B !important;
  background-image: radial-gradient(#1E293B 1.2px, transparent 1.2px) !important;
  background-size: 20px 20px !important;
}
body.dark .wa-sidebar-bg {
  background-color: #111B21 !important;
  border-color: #1E293B !important;
}
body.dark #chatTopBar {
  background-color: #111B21 !important;
  border-bottom-color: #1E293B !important;
}
body.dark #chatLeadName {
  color: #F8FAFC !important;
}
body.dark .wa-contact-item {
  border-color: #1E293B !important;
  background-color: #111B21 !important;
}
body.dark .wa-contact-item:hover {
  background-color: #182229 !important;
}
body.dark .wa-contact-item.active {
  background-color: #1E293B !important;
  border-left: 4px solid #10B981 !important;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.2), 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}
body.dark .wa-contact-item.active span.font-bold {
  color: #FFFFFF !important;
}
body.dark .wa-contact-item.active p {
  color: #CBD5E1 !important;
}
body.dark .wa-contact-name {
  color: #F8FAFC !important;
}
body.dark .wa-contact-msg {
  color: #94A3B8 !important;
}
body.dark .whatsapp-bubble-card,
body.dark .wa-bubble-inbound {
  background-color: #1F2C34 !important;
  color: #F8FAFC !important;
  border-color: #2A3942 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2) !important;
}
body.dark .wa-bubble-outbound {
  background-color: #005C4B !important;
  color: #F8FAFC !important;
  border-color: #02735E !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2) !important;
}
body.dark .whatsapp-bubble-header {
  border-bottom-color: #2A3942 !important;
  color: #FFFFFF !important;
}
body.dark .whatsapp-bubble-body {
  color: #E2E8F0 !important;
}
body.dark .whatsapp-meta-box {
  background-color: #111B21 !important;
  border-color: #2A3942 !important;
  color: #E2E8F0 !important;
}
body.dark .whatsapp-button-card {
  background-color: #1F2C34 !important;
  border: 1px solid #2A3942 !important;
  color: #F8FAFC !important;
  font-weight: 600 !important;
}
body.dark .whatsapp-button-card:hover {
  background-color: #2A3942 !important;
}
/* Light Mode Calendar & Meets Page Aesthetics */
body:not(.dark) #calendarMonthGrid > div {
  transition: all 0.15s ease-in-out;
}

body:not(.dark) .calendar-bento-card,
body:not(.dark) div.bg-white {
  background-color: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

body:not(.dark) #calendarMonthTitle,
body:not(.dark) #selectedDateTitle {
  color: #0F172A !important;
}

body:not(.dark) #dayScheduleFeed > div {
  background-color: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

body:not(.dark) #dayScheduleFeed > div:hover {
  background-color: #FFFFFF !important;
  border-color: #93C5FD !important;
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.08) !important;
}

body:not(.dark) #bookingsGridContainer > div {
  background-color: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

body:not(.dark) #bookingsGridContainer > div:hover {
  border-color: #3B82F6 !important;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04) !important;
  transform: translateY(-2px);
}

body:not(.dark) #bookingsGridContainer .bg-slate-50 {
  background-color: #F1F5F9 !important;
  border-color: #E2E8F0 !important;
}

body:not(.dark) #bookingsListContainer > div {
  background-color: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

body:not(.dark) #bookingsListContainer > div:hover {
  border-color: #3B82F6 !important;
}

body:not(.dark) #calendarSearchInput,
body:not(.dark) #statusFilter {
  background-color: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
}

body:not(.dark) #viewGridBtn,
body:not(.dark) #viewListBtn {
  border-color: transparent !important;
}

body.dark .wa-composer-bar {
  background-color: #111B21 !important;
  border-color: #1E293B !important;
}


/* ==========================================================================
   GLOBAL LIGHT MODE FIGMA DESIGN SYSTEM (01–13)
   Strictly scoped to html:not(.dark) so Dark Mode is 100% preserved.
   Applies across all pages: Notification Center, Modals, Sidebar, Header, Cards.
   ========================================================================== */
html:not(.dark) body {
  background-color: #F5F4EF !important;
  color: #111111 !important;
}

/* Global Smart Sidebar & Top Header */
html:not(.dark) #appSidebar {
  background-color: #0D0D0D !important;
  border-right: 1px solid #1F1F1F !important;
  color: #E5E5E5 !important;
}
html:not(.dark) #appSidebar #sidebarBrandHeader {
  background-color: #0D0D0D !important;
  border-bottom-color: #1F1F1F !important;
}
html:not(.dark) #appSidebar nav a {
  color: #A3A3A3 !important;
  border-radius: 0.375rem !important;
}
html:not(.dark) #appSidebar nav a:hover {
  background-color: #1A1A1A !important;
  color: #FFFFFF !important;
}
html:not(.dark) #appSidebar nav a.bg-blue-50 {
  background-color: #1A1A1A !important;
  color: #FFFFFF !important;
  border-color: #2A2A2A !important;
}
html:not(.dark) #appSidebar nav a.bg-blue-50 svg {
  color: #F59E0B !important;
}
html:not(.dark) #appHeader {
  background-color: #0D0D0D !important;
  border-bottom: 1px solid #1F1F1F !important;
  color: #FFFFFF !important;
}
html:not(.dark) #appHeader h1,
html:not(.dark) #appHeader .text-slate-900,
html:not(.dark) #appHeader .text-slate-800 {
  color: #FFFFFF !important;
}
html:not(.dark) #appHeader .text-slate-500,
html:not(.dark) #appHeader .text-slate-400 {
  color: #A3A3A3 !important;
}
html:not(.dark) #appHeader button.bg-blue-600 {
  background-color: #F59E0B !important;
  color: #111111 !important;
  font-weight: 700 !important;
  border-radius: 0.25rem !important;
}

/* Global Notification Center (#mfnNotifPane) */
html:not(.dark) #mfnNotifPane {
  background-color: #FFFFFF !important;
  border-color: #E5E3DC !important;
  border-radius: 0.25rem !important;
}
html:not(.dark) #mfnNotifPane > div:first-child {
  background-color: #0D0D0D !important;
  border-bottom-color: #1F1F1F !important;
  color: #FFFFFF !important;
}
html:not(.dark) #mfnNotifPane > div:first-child h3 {
  color: #FFFFFF !important;
}
html:not(.dark) #mfnNotifPane > div:first-child p {
  color: #A3A3A3 !important;
}
html:not(.dark) #mfnNotifPane > div:first-child .bg-blue-50 {
  background-color: #1A1A1A !important;
  color: #F59E0B !important;
  border: 1px solid #262626 !important;
}
html:not(.dark) #mfnNotifPane .text-blue-600 {
  color: #D97706 !important;
}

/* Global Modals, Drawers & Primary Actions */
html:not(.dark) .fixed.inset-0 .bg-blue-600,
html:not(.dark) main button.bg-blue-600 {
  background-color: #111111 !important;
  color: #FFFFFF !important;
  border-radius: 0.25rem !important;
}
html:not(.dark) .fixed.inset-0 .bg-blue-600:hover,
html:not(.dark) main button.bg-blue-600:hover {
  background-color: #262626 !important;
}
html:not(.dark) .fixed.inset-0 .text-blue-600,
html:not(.dark) .fixed.inset-0 .text-blue-500 {
  color: #D97706 !important;
}
html:not(.dark) .table-container,
html:not(.dark) .metric-card {
  border-color: #E5E3DC !important;
  border-radius: 0.25rem !important;
  box-shadow: none !important;
}

html:not(.dark) #lightDirectoryView thead tr,
html:not(.dark) #lightDirectoryView th {
  background-color: #111111 !important;
  color: #FFFFFF !important;
  border-color: #1F1F1F !important;
}

/* Replace remaining blue accents with Figma Amber (#F59E0B / #D97706) in Light Mode */
html:not(.dark) .text-blue-600,
html:not(.dark) .text-blue-700,
html:not(.dark) .text-blue-500 {
  color: #D97706 !important;
}
html:not(.dark) .bg-blue-50,
html:not(.dark) .bg-blue-100 {
  background-color: #FEF3C7 !important;
  color: #92400E !important;
}
html:not(.dark) .border-blue-500,
html:not(.dark) .border-blue-600 {
  border-color: #F59E0B !important;
}
html:not(.dark) .bg-blue-500 {
  background-color: #F59E0B !important;
}

/* ==========================================================================
   DARK MODE FIGMA UI (Proposals, Discovery Briefs, Lead Detail)
   ========================================================================== */
html.dark body {
  background-color: #09090B !important;
  color: #F5F5F5 !important;
}
html.dark .figma-card {
  background-color: #141414 !important;
  border-color: #262626 !important;
  color: #F5F5F5 !important;
}
html.dark .figma-card input,
html.dark .figma-card select,
html.dark .figma-card textarea {
  background-color: #1A1A1A !important;
  border-color: #2A2A2A !important;
  color: #F5F5F5 !important;
}
html.dark .figma-card .text-\[\#111111\],
html.dark .figma-card .text-\[\#262626\] {
  color: #F5F5F5 !important;
}
html.dark .figma-card .text-\[\#737373\],
html.dark .figma-card .text-\[\#525252\] {
  color: #A3A3A3 !important;
}
html.dark .figma-card .divide-\[\#E5E3DC\] > :not([hidden]) ~ :not([hidden]),
html.dark .figma-card .border-\[\#E5E3DC\] {
  border-color: #262626 !important;
}
html.dark .figma-card .bg-\[\#FAF9F6\] {
  background-color: #1A1A1A !important;
}
html.dark .crm-input {
  background-color: #1A1A1A !important;
  border-color: #2A2A2A !important;
  color: #E5E5E5 !important;
}
html.dark .crm-tag {
  background-color: #262626 !important;
  color: #A3A3A3 !important;
}

/* Global Dark Mode overrides for all Figma Light Views */
html.dark #lightDashboardView,
html.dark #lightPipelineView,
html.dark #lightDirectoryView,
html.dark #lightCalendarView,
html.dark #lightSettingsView,
html.dark #lightAttributionView,
html.dark #lightUsersView {
  background-color: #09090B !important;
  color: #F5F5F5 !important;
}
html.dark #lightDashboardView .bg-white,
html.dark #lightPipelineView .bg-white,
html.dark #lightDirectoryView .bg-white,
html.dark #lightCalendarView .bg-white,
html.dark #lightSettingsView .bg-white,
html.dark #lightAttributionView .bg-white,
html.dark #lightUsersView .bg-white,
html.dark .bg-\[\#FAF9F6\],
html.dark .bg-\[\#FAF9F5\] {
  background-color: #141414 !important;
  border-color: #262626 !important;
  color: #F5F5F5 !important;
}
html.dark .text-\[\#111111\],
html.dark .text-\[\#262626\] {
  color: #F5F5F5 !important;
}
html.dark .text-\[\#737373\],
html.dark .text-\[\#525252\] {
  color: #A3A3A3 !important;
}
html.dark .border-\[\#E5E3DC\],
html.dark .border-\[\#F0EFEA\] {
  border-color: #262626 !important;
}

/* WCAG AA Dark Mode Contrast & Interactive Controls */
html.dark .bg-\[\#F5F4EF\],
html.dark .bg-\[\#EBE9E1\],
html.dark .bg-\[\#F0EFE9\] {
  background-color: #09090B !important;
  color: #F5F5F5 !important;
}
html.dark tbody.bg-white,
html.dark tbody.bg-white tr {
  background-color: #141414 !important;
  color: #F5F5F5 !important;
}
html.dark tbody.bg-white tr:hover {
  background-color: #1C1C1C !important;
}
html.dark input:not([type="checkbox"]):not([type="radio"]),
html.dark select,
html.dark textarea {
  background-color: #1A1A1A !important;
  color: #F5F5F5 !important;
  border-color: #2E2E2E !important;
}
html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #737373 !important;
}
html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  border-color: #F59E0B !important;
}

/* Dark Mode Pipeline Chart Bars */
html.dark #lightPipelineBars .bg-\[\#111111\] {
  background-color: #F5F5F5 !important;
}
html.dark #lightPipelineBars .bg-\[\#E5E3DC\] {
  background-color: #3F3F46 !important;
}

/* Dark Mode Kanban Columns */
html.dark #lightPipelineView .bg-\[\#EBE9E1\],
html.dark #lightPipelineView .bg-\[\#EBE9E1\]\/60,
html.dark #lightPipelineView .bg-\[\#E5E3DC\],
html.dark #lightPipelineView .bg-\[\#F0EFEA\] {
  background-color: #111113 !important;
  border-color: #262626 !important;
}

html.dark #lightPipeBoard > div {
  background-color: #111113 !important;
  border-color: #262626 !important;
}

/* Dark Mode Directory Stage Badges */
html.dark #lightDirectoryView td span[class*="bg-[#FEF3C7]"],
html.dark #lightDirectoryView td span[class*="bg-[#ECFDF5]"],
html.dark #lightDirectoryView td span[class*="bg-[#FEE2E2]"],
html.dark #lightDirectoryView td span[class*="bg-[#F5F4EF]"] {
  background-color: #262626 !important;
  color: #F59E0B !important;
  border-color: #3F3F46 !important;
}

html.dark #lightDirectoryView thead tr,
html.dark #lightDirectoryView th {
  background-color: #141414 !important;
  color: #A3A3A3 !important;
  border-color: #262626 !important;
}

html.dark #lightDirectoryView tbody,
html.dark #lightDirectoryView tbody tr,
html.dark #lightDirectoryView tbody td {
  background-color: #141414 !important;
  border-color: #262626 !important;
}
html.dark #lightDirectoryView tbody tr:hover,
html.dark #lightDirectoryView tbody tr:hover td {
  background-color: #1C1C1C !important;
}

/* Dark Mode Modals */
html.dark #briefDetailModal > div,
html.dark #scheduleMeetModal > div,
html.dark #followUpModal > div {
  background-color: #141414 !important;
  border-color: #262626 !important;
  color: #F5F5F5 !important;
}
