/* Dashboard theme overrides - gray dark mode classes missing from compiled Tailwind */
.dark .dark\:bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}
.dark .dark\:bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}
.dark .dark\:bg-gray-600{--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity))}
.dark .dark\:border-gray-700{--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity))}
.dark .dark\:from-gray-900{--tw-gradient-from:#111827 var(--tw-gradient-from-position);--tw-gradient-to:rgb(17 24 39/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}
.dark .dark\:from-gray-800{--tw-gradient-from:#1f2937 var(--tw-gradient-from-position);--tw-gradient-to:rgb(31 41 55/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}
.dark .dark\:to-gray-900{--tw-gradient-to:#111827 var(--tw-gradient-to-position)}
.dark .dark\:to-gray-800{--tw-gradient-to:#1f2937 var(--tw-gradient-to-position)}
.dark .dark\:to-gray-700{--tw-gradient-to:#374151 var(--tw-gradient-to-position)}
.dark .dark\:via-gray-800{--tw-gradient-to:rgb(31 41 55/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),#1f2937 var(--tw-gradient-via-position),var(--tw-gradient-to)}
.dark .dark\:hover\:bg-gray-700:hover{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}
.dark .dark\:hover\:text-gray-200:hover{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}
.dark .dark\:text-gray-200{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}
.hover\:text-black:hover{color:#000}

/* Dark mode text brightness fixes */
.dark .dark\:text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}
.dark .dark\:text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}

/* Boost secondary text from gray-400 to gray-300 in dark mode for readability */
.dark p:where(.text-gray-500),
.dark span:where(.text-gray-500),
.dark td:where(.text-gray-500) {
    color: #d1d5db !important;
}
.dark p:where(.text-gray-400),
.dark span:where(.text-gray-400),
.dark label:where(.text-gray-400) {
    color: #9ca3af !important;
}
.dark p:where(.text-gray-600),
.dark span:where(.text-gray-600) {
    color: #d1d5db !important;
}

/* Ensure table headers readable in dark mode */
.dark th {
    color: #d1d5db !important;
}

/* Fix dark mode hover states */
.dark .dark\:hover\:bg-black:hover { background-color: #000 !important; }
.dark .dark\:hover\:text-white:hover { color: #fff !important; }

/* Dark mode card background fallback */
.dark .dark\:bg-white\/\[0\.03\] { background-color: rgba(255,255,255,0.03); }

/* Fix dark bg-opacity classes */
.dark .dark\:bg-opacity-20 { --tw-bg-opacity: 0.2; }

/* KYC block cards dark mode border */
.dark .dark\:border-red-800\/50 { border-color: rgba(153,27,27,0.5); }

/* Ensure green/red accent text stays bright in dark mode */
.dark .dark\:text-green-300{color:#86efac !important}
.dark .dark\:text-green-400{color:#4ade80 !important}
.dark .dark\:text-red-300{color:#fca5a5 !important}
.dark .dark\:text-red-400{color:#f87171 !important}
.dark .dark\:text-amber-300{color:#fcd34d !important}
.dark .dark\:text-amber-400{color:#fbbf24 !important}
.dark .dark\:text-purple-200{color:#e9d5ff !important}
.dark .dark\:text-orange-200{color:#fed7aa !important}

/* Dark mode focus ring */
.dark .dark\:focus\:ring-gray-400:focus{--tw-ring-color:#9ca3af}

/* Red dark bg for KYC banner */
.dark .dark\:bg-red-700{background-color:#b91c1c !important}
.dark .dark\:bg-red-900\/30{background-color:rgba(127,29,29,0.3)}

/* Fix notification dropdown in dark */
.dark #notifications-list .border-b { border-color: #374151; }
.dark #notifications-list .hover\:bg-gray-50:hover { background-color: #1f2937 !important; }

/* Native controls and chat surfaces follow the dashboard theme immediately. */
html { color-scheme: light; }
html.dark { color-scheme: dark; }
.dark #chatWidget {
    --chat-surface: #1f2937;
    --chat-canvas: #111827;
    --chat-control: #374151;
    --chat-text: #f3f4f6;
    --chat-muted: #cbd5e1;
    --chat-border: #4b5563;
}
