:root {
	--surface: #ffffff;
	--surface-muted: #f8fafc; /* light gray background */
	--surface-elevated: #ffffff; /* elevated surfaces like cards */
	--text: #0f172a; /* slate-900 */
	--text-muted: #475569; /* slate-600 */
	--text-secondary: #64748b; /* slate-500 */
	--border: #e5e7eb; /* gray-200 */
	--border-muted: #f1f5f9; /* gray-100 */
	--brand: #4f46e5; /* indigo-600 */
	--brand-hover: #3730a3; /* indigo-800 */
	--success: #059669; /* emerald-600 */
	--warning: #d97706; /* amber-600 */
	--error: #dc2626; /* red-600 */
	--info: #2563eb; /* blue-600 */
}

html { color-scheme: light dark; }

body {
	background: var(--surface-muted);
	color: var(--text);
}

/* Subtle defaults for common elements */
header, footer {
	background: var(--surface);
	color: var(--text);
	border-color: var(--border);
}

/* Basic link color alignment */
a { color: var(--brand); }

/* Dark theme via system and explicit data attribute */
@media (prefers-color-scheme: dark) {
	:root {
		--surface: #111827; /* gray-900 */
		--surface-muted: #0f172a; /* slate-900 */
		--surface-elevated: #1f2937; /* gray-800 */
		--text: #f9fafb; /* gray-50 */
		--text-muted: #d1d5db; /* gray-300 */
		--text-secondary: #9ca3af; /* gray-400 */
		--border: #374151; /* gray-700 */
		--border-muted: #4b5563; /* gray-600 */
		--brand: #6366f1; /* indigo-500 */
		--brand-hover: #4f46e5; /* indigo-600 */
		--success: #10b981; /* emerald-500 */
		--warning: #f59e0b; /* amber-500 */
		--error: #ef4444; /* red-500 */
		--info: #3b82f6; /* blue-500 */
	}
	body { background: var(--surface-muted); color: var(--text); }
}

[data-theme="dark"] {
	/* Force dark regardless of system */
	--surface: #111827; /* gray-900 */
	--surface-muted: #0f172a; /* slate-900 */
	--surface-elevated: #1f2937; /* gray-800 */
	--text: #f9fafb; /* gray-50 */
	--text-muted: #d1d5db; /* gray-300 */
	--text-secondary: #9ca3af; /* gray-400 */
	--border: #374151; /* gray-700 */
	--border-muted: #4b5563; /* gray-600 */
	--brand: #6366f1; /* indigo-500 */
	--brand-hover: #4f46e5; /* indigo-600 */
	--success: #10b981; /* emerald-500 */
	--warning: #f59e0b; /* amber-500 */
	--error: #ef4444; /* red-500 */
	--info: #3b82f6; /* blue-500 */
}

/* Utility overrides to adapt Tailwind-ish classes in dark */
@media (prefers-color-scheme: dark) {
	.bg-white { background-color: #111827 !important; }
	.bg-gray-50 { background-color: #0f172a !important; }
	.bg-gray-100 { background-color: #111827 !important; }
	.text-black, .text-gray-900 { color: #e5e7eb !important; }
	.text-gray-800 { color: #e2e8f0 !important; }
	.text-gray-700 { color: #cbd5e1 !important; }
	.text-gray-600 { color: #94a3b8 !important; }
	.text-gray-500 { color: #94a3b8 !important; }
	.text-gray-400 { color: #64748b !important; }
	.border-gray-200 { border-color: #1f2937 !important; }
	.border-gray-300 { border-color: #374151 !important; }
}

[data-theme="dark"] .bg-white { background-color: #111827 !important; }
[data-theme="dark"] .bg-gray-50 { background-color: #0f172a !important; }
[data-theme="dark"] .bg-gray-100 { background-color: #111827 !important; }
[data-theme="dark"] .text-black, 
[data-theme="dark"] .text-gray-900 { color: #e5e7eb !important; }
[data-theme="dark"] .text-gray-800 { color: #e2e8f0 !important; }
[data-theme="dark"] .text-gray-700 { color: #cbd5e1 !important; }
[data-theme="dark"] .text-gray-600 { color: #94a3b8 !important; }
[data-theme="dark"] .text-gray-500 { color: #94a3b8 !important; }
[data-theme="dark"] .text-gray-400 { color: #64748b !important; }
[data-theme="dark"] .border-gray-200 { border-color: #1f2937 !important; }
[data-theme="dark"] .border-gray-300 { border-color: #374151 !important; }

/* Layout containers commonly used */
.card,
.container,
.content-surface,
.clean-card {
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--border);
}

/* Common component styles */
.btn-primary {
	background: var(--brand);
	color: white;
	border: 1px solid var(--brand);
}

.btn-primary:hover {
	background: var(--brand-hover);
	border-color: var(--brand-hover);
}

.btn-secondary {
	background: var(--surface-elevated);
	color: var(--text);
	border: 1px solid var(--border);
}

.btn-secondary:hover {
	background: var(--border-muted);
}

/* Status colors */
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-error { color: var(--error) !important; }
.text-info { color: var(--info) !important; }

.bg-success { background-color: var(--success) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-error { background-color: var(--error) !important; }
.bg-info { background-color: var(--info) !important; }

/* Form elements */
input, textarea, select {
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--border);
}

input:focus, textarea:focus, select:focus {
	border-color: var(--brand);
	outline: none;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Tables */
table {
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--border);
}

th {
	background: var(--surface-elevated);
	color: var(--text);
	border-bottom: 1px solid var(--border);
}

td {
	border-bottom: 1px solid var(--border-muted);
}

/* Navigation */
nav {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
}

nav a {
	color: var(--text-muted);
}

nav a:hover, nav a.active {
	color: var(--brand);
}

/* Modals and overlays */
.modal, .overlay {
	background: rgba(0, 0, 0, 0.5);
}

.modal-content {
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--border);
}

/* Notifications */
.notification {
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--border);
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Loading states */
.loading {
	background: var(--border-muted);
}

/* Ensure all text elements inherit theme colors */
h1, h2, h3, h4, h5, h6 {
	color: var(--text);
}

p, span, div {
	color: inherit;
}

/* Links */
a {
	color: var(--brand);
	text-decoration: none;
}

a:hover {
	color: var(--brand-hover);
	text-decoration: underline;
}

/* Code blocks */
code, pre {
	background: var(--surface-elevated);
	color: var(--text);
	border: 1px solid var(--border);
}

/* Dividers */
hr {
	border-color: var(--border);
}

/* Ensure proper contrast for all elements */
* {
	box-sizing: border-box;
}

/* Override hardcoded colors with higher specificity */
[data-theme="dark"] * {
	color: inherit !important;
}

[data-theme="dark"] body {
	background: var(--surface-muted) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .app-container {
	background: var(--surface-muted) !important;
}

[data-theme="dark"] .clean-card {
	background: var(--surface) !important;
	color: var(--text) !important;
	border: 1px solid var(--border) !important;
}

[data-theme="dark"] .stat-box {
	background: var(--surface-elevated) !important;
	color: var(--text) !important;
	border: 1px solid var(--border) !important;
}

[data-theme="dark"] header {
	background: var(--surface-muted) !important;
	color: var(--text) !important;
}

[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3, 
[data-theme="dark"] h4, 
[data-theme="dark"] h5, 
[data-theme="dark"] h6 {
	color: var(--text) !important;
}

[data-theme="dark"] p, 
[data-theme="dark"] span, 
[data-theme="dark"] div {
	color: inherit !important;
}

[data-theme="dark"] .btn-primary {
	background: var(--brand) !important;
	color: white !important;
	border: 1px solid var(--brand) !important;
}

[data-theme="dark"] .btn-primary:hover {
	background: var(--brand-hover) !important;
	border-color: var(--brand-hover) !important;
}

[data-theme="dark"] .mission-item {
	background: var(--surface-elevated) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .mission-item:active {
	background: var(--border-muted) !important;
}

[data-theme="dark"] .mission-btn {
	background: var(--surface-elevated) !important;
	color: var(--text) !important;
	border: 1px solid var(--border) !important;
}

[data-theme="dark"] .mission-btn.complete {
	background: var(--brand) !important;
	color: white !important;
}

[data-theme="dark"] .mission-btn.completed {
	background: var(--success) !important;
	color: white !important;
	border: 1px solid var(--success) !important;
}

[data-theme="dark"] .leaderboard-item {
	background: var(--surface-elevated) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .leaderboard-item:active {
	background: var(--border-muted) !important;
}

[data-theme="dark"] .leaderboard-item.top-3 {
	background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--surface) 100%) !important;
}

[data-theme="dark"] .leaderboard-item.current-user {
	background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--surface) 100%) !important;
	border: 1px solid var(--brand) !important;
}

[data-theme="dark"] .rank-badge {
	background: var(--border-muted) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .rank-badge.gold {
	background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
	color: #000000 !important;
}

[data-theme="dark"] .rank-badge.silver {
	background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%) !important;
	color: #000000 !important;
}

[data-theme="dark"] .rank-badge.bronze {
	background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%) !important;
	color: #ffffff !important;
}

[data-theme="dark"] .avatar-badge {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
	color: white !important;
}

[data-theme="dark"] .tab-buttons {
	background: var(--border-muted) !important;
}

[data-theme="dark"] .tab-btn {
	background: transparent !important;
	color: var(--text-muted) !important;
}

[data-theme="dark"] .tab-btn.active {
	background: var(--surface) !important;
	color: var(--brand) !important;
	box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .calendar-day {
	color: var(--text) !important;
}

[data-theme="dark"] .calendar-day:hover:not(.checked) {
	background: var(--border-muted) !important;
}

[data-theme="dark"] .calendar-day.checked {
	background: var(--brand) !important;
	color: white !important;
}

[data-theme="dark"] .calendar-day.today {
	border: 2px solid var(--brand) !important;
	color: var(--brand) !important;
}

[data-theme="dark"] .month-nav-btn {
	color: var(--brand) !important;
}

[data-theme="dark"] .month-nav-btn:hover {
	background: var(--border-muted) !important;
}

[data-theme="dark"] .progress-bar {
	background: var(--border-muted) !important;
}

[data-theme="dark"] .progress-fill {
	background: var(--brand) !important;
}

[data-theme="dark"] .success-message {
	background: var(--success) !important;
	color: white !important;
}

[data-theme="dark"] .error-message {
	background: var(--error) !important;
	color: white !important;
}

[data-theme="dark"] .achievement-badge {
	background: var(--success) !important;
	color: white !important;
}

[data-theme="dark"] .streak-status {
	background: var(--warning) !important;
	color: white !important;
}

[data-theme="dark"] .streak-status.safe {
	background: var(--success) !important;
	color: white !important;
}

[data-theme="dark"] .streak-status.warning {
	background: var(--error) !important;
	color: white !important;
}

[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
	background: var(--surface) !important;
	color: var(--text) !important;
	border: 1px solid var(--border) !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
	border-color: var(--brand) !important;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

/* Override specific hardcoded colors in daily page */
[data-theme="dark"] #exitButton {
	background: rgba(255,255,255,0.1) !important;
	color: var(--text) !important;
	border: 1px solid rgba(255,255,255,0.2) !important;
}

[data-theme="dark"] #exitButton:hover {
	background: rgba(255,255,255,0.2) !important;
	color: var(--text) !important;
}

/* Override inline styles with CSS variables */
[data-theme="dark"] [style*="color: #000"],
[data-theme="dark"] [style*="color:#000"] {
	color: var(--text) !important;
}

[data-theme="dark"] [style*="color: #666"],
[data-theme="dark"] [style*="color:#666"] {
	color: var(--text-muted) !important;
}

[data-theme="dark"] [style*="color: #999"],
[data-theme="dark"] [style*="color:#999"] {
	color: var(--text-secondary) !important;
}

[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:white"] {
	background: var(--surface) !important;
}

[data-theme="dark"] [style*="background: #f9f9f9"],
[data-theme="dark"] [style*="background:#f9f9f9"] {
	background: var(--surface-elevated) !important;
}

[data-theme="dark"] [style*="background: #f5f5f5"],
[data-theme="dark"] [style*="background:#f5f5f5"] {
	background: var(--surface-muted) !important;
}

[data-theme="dark"] [style*="background: #f3f4f6"],
[data-theme="dark"] [style*="background:#f3f4f6"] {
	background: var(--surface-muted) !important;
}

[data-theme="dark"] [style*="background: #e8e8e8"],
[data-theme="dark"] [style*="background:#e8e8e8"] {
	background: var(--border-muted) !important;
}

[data-theme="dark"] [style*="background: #f0f0f0"],
[data-theme="dark"] [style*="background:#f0f0f0"] {
	background: var(--border-muted) !important;
}

[data-theme="dark"] [style*="border: 1px solid #e5e7eb"],
[data-theme="dark"] [style*="border:1px solid #e5e7eb"] {
	border: 1px solid var(--border) !important;
}

[data-theme="dark"] [style*="border: 1px solid #ddd"],
[data-theme="dark"] [style*="border:1px solid #ddd"] {
	border: 1px solid var(--border) !important;
}

[data-theme="dark"] [style*="border: 1px solid #f0f0f0"],
[data-theme="dark"] [style*="border:1px solid #f0f0f0"] {
	border: 1px solid var(--border) !important;
}

/* Specific overrides for sell page */
[data-theme="dark"] .sell-option {
	border: 1px solid var(--border) !important;
	background: var(--surface) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .sell-option:hover {
	border-color: var(--brand) !important;
}

[data-theme="dark"] .sell-button {
	background: var(--brand) !important;
	color: white !important;
}

[data-theme="dark"] .sell-button:hover {
	background: var(--brand-hover) !important;
}

[data-theme="dark"] .sell-title {
	color: var(--brand) !important;
}

[data-theme="dark"] .counter-button {
	background: var(--border-muted) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .counter-button:hover {
	background: var(--border) !important;
}

[data-theme="dark"] .transaction-summary {
	background: var(--surface-elevated) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .transaction-info {
	border-bottom: 1px solid var(--border) !important;
}

[data-theme="dark"] .status-pending,
[data-theme="dark"] .status-processing {
	background: var(--warning) !important;
	color: white !important;
}

[data-theme="dark"] .status-completed {
	background: var(--success) !important;
	color: white !important;
}

[data-theme="dark"] .status-declined {
	background: var(--error) !important;
	color: white !important;
}

[data-theme="dark"] .wallet-status {
	background: var(--surface-elevated) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .wallet-status p {
	color: var(--text-muted) !important;
}

[data-theme="dark"] .progress-container {
	background-color: var(--border-muted) !important;
}

[data-theme="dark"] .progress-bar {
	background: linear-gradient(90deg, var(--brand), var(--brand-hover)) !important;
}

[data-theme="dark"] .modal-overlay {
	background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] .modal-content {
	background: var(--surface) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .step-number {
	background: var(--border-muted) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .step-number.active {
	background: var(--brand) !important;
	color: white !important;
}

[data-theme="dark"] .step-number.completed {
	background: var(--success) !important;
	color: white !important;
}

[data-theme="dark"] .step-line {
	background: var(--border-muted) !important;
}

[data-theme="dark"] .step-line.active {
	background: var(--brand) !important;
}

[data-theme="dark"] .step-line.completed {
	background: var(--success) !important;
}

[data-theme="dark"] .step-date {
	color: var(--text-muted) !important;
}

[data-theme="dark"] .close-button {
	background: var(--border-muted) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .notice-content {
	background: var(--surface) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .notice-title {
	color: var(--text) !important;
}

[data-theme="dark"] .notice-text {
	color: var(--text-muted) !important;
}

[data-theme="dark"] .notice-button {
	background: var(--brand) !important;
	color: white !important;
}

[data-theme="dark"] .notice-button:hover {
	background: var(--brand-hover) !important;
}

[data-theme="dark"] .input-group input {
	border: 1px solid var(--border) !important;
	background: var(--surface) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .input-group input:focus {
	border-color: var(--brand) !important;
	box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1) !important;
}

[data-theme="dark"] .input-group label {
	color: var(--text-muted) !important;
	background: var(--surface) !important;
}

[data-theme="dark"] .input-group input:focus + label {
	color: var(--brand) !important;
	background: var(--surface) !important;
}

[data-theme="dark"] .input-group .input-icon {
	color: var(--text-muted) !important;
}

/* Specific overrides for history page */
[data-theme="dark"] .language-toggle {
	background: var(--surface-elevated) !important;
	border: 1px solid var(--border) !important;
	color: var(--text-muted) !important;
}

[data-theme="dark"] .language-toggle:focus {
	border-color: var(--brand) !important;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

[data-theme="dark"] .history-title {
	color: var(--brand) !important;
}

/* Override specific color values in inline styles */
[data-theme="dark"] [style*="color: #4f46e5"],
[data-theme="dark"] [style*="color:#4f46e5"] {
	color: var(--brand) !important;
}

[data-theme="dark"] [style*="color: #007AFF"],
[data-theme="dark"] [style*="color:#007AFF"] {
	color: var(--brand) !important;
}

[data-theme="dark"] [style*="background: #4f46e5"],
[data-theme="dark"] [style*="background:#4f46e5"] {
	background: var(--brand) !important;
}

[data-theme="dark"] [style*="background: #007AFF"],
[data-theme="dark"] [style*="background:#007AFF"] {
	background: var(--brand) !important;
}

[data-theme="dark"] [style*="background: linear-gradient"],
[data-theme="dark"] [style*="background:linear-gradient"] {
	background: var(--brand) !important;
}

/* Override specific status colors */
[data-theme="dark"] [style*="color: #10b981"],
[data-theme="dark"] [style*="color:#10b981"] {
	color: var(--success) !important;
}

[data-theme="dark"] [style*="background: #10b981"],
[data-theme="dark"] [style*="background:#10b981"] {
	background: var(--success) !important;
}

[data-theme="dark"] [style*="color: #3b82f6"],
[data-theme="dark"] [style*="color:#3b82f6"] {
	color: var(--info) !important;
}

[data-theme="dark"] [style*="background: #3b82f6"],
[data-theme="dark"] [style*="background:#3b82f6"] {
	background: var(--info) !important;
}

/* Additional overrides for remaining hardcoded colors */
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:#f8fafc"] {
	background: var(--surface-muted) !important;
}

[data-theme="dark"] [style*="background: #f0f0f0"],
[data-theme="dark"] [style*="background:#f0f0f0"] {
	background: var(--border-muted) !important;
}

[data-theme="dark"] [style*="border: 1px solid #f0f0f0"],
[data-theme="dark"] [style*="border:1px solid #f0f0f0"] {
	border: 1px solid var(--border) !important;
}

[data-theme="dark"] [style*="border: 3px solid #4f46e5"],
[data-theme="dark"] [style*="border:3px solid #4f46e5"] {
	border: 3px solid var(--brand) !important;
}

[data-theme="dark"] [style*="border: 1px solid #e5e7eb"],
[data-theme="dark"] [style*="border:1px solid #e5e7eb"] {
	border: 1px solid var(--border) !important;
}

[data-theme="dark"] [style*="border-color: #4f46e5"],
[data-theme="dark"] [style*="border-color:#4f46e5"] {
	border-color: var(--brand) !important;
}

[data-theme="dark"] [style*="color: #333"],
[data-theme="dark"] [style*="color:#333"] {
	color: var(--text) !important;
}

[data-theme="dark"] [style*="color: #ef4444"],
[data-theme="dark"] [style*="color:#ef4444"] {
	color: var(--error) !important;
}

[data-theme="dark"] [style*="color: #f59e0b"],
[data-theme="dark"] [style*="color:#f59e0b"] {
	color: var(--warning) !important;
}

[data-theme="dark"] [style*="color: #6b7280"],
[data-theme="dark"] [style*="color:#6b7280"] {
	color: var(--text-muted) !important;
}

[data-theme="dark"] [style*="background-color: #ef4444"],
[data-theme="dark"] [style*="background-color:#ef4444"] {
	background-color: var(--error) !important;
}

[data-theme="dark"] [style*="background-color: #f59e0b"],
[data-theme="dark"] [style*="background-color:#f59e0b"] {
	background-color: var(--warning) !important;
}

[data-theme="dark"] [style*="background-color: #6b7280"],
[data-theme="dark"] [style*="background-color:#6b7280"] {
	background-color: var(--text-muted) !important;
}

[data-theme="dark"] [style*="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%)"],
[data-theme="dark"] [style*="background:linear-gradient(135deg, #667eea 0%, #764ba2 100%)"] {
	background: linear-gradient(135deg, var(--brand), var(--brand-hover)) !important;
}

/* Override specific elements that might be missed */
[data-theme="dark"] .package-option {
	background: var(--surface) !important;
	border: 1px solid var(--border) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .package-option:hover {
	border-color: var(--brand) !important;
}

[data-theme="dark"] .notification-container {
	background: var(--surface) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .notification-header {
	background: linear-gradient(135deg, var(--brand), var(--brand-hover)) !important;
	color: white !important;
}

[data-theme="dark"] .notification-item {
	background: var(--surface) !important;
	color: var(--text) !important;
	border-bottom: 1px solid var(--border) !important;
}

[data-theme="dark"] .notification-item.unread {
	background: var(--surface-elevated) !important;
}

[data-theme="dark"] .notification-priority {
	background-color: var(--text-muted) !important;
}

[data-theme="dark"] .notification-priority[style*="background-color: #ef4444"] {
	background-color: var(--error) !important;
}

[data-theme="dark"] .notification-priority[style*="background-color: #f59e0b"] {
	background-color: var(--warning) !important;
}

[data-theme="dark"] .notification-priority[style*="background-color: #6b7280"] {
	background-color: var(--text-muted) !important;
}

[data-theme="dark"] .action-btn {
	background: var(--surface-elevated) !important;
	color: var(--text) !important;
	border: 1px solid var(--border) !important;
}

[data-theme="dark"] .action-btn:hover {
	background: var(--border-muted) !important;
}

[data-theme="dark"] .close-btn {
	background: var(--surface-elevated) !important;
	color: var(--text) !important;
}

[data-theme="dark"] .close-btn:hover {
	background: var(--border-muted) !important;
}

/* Loading spinner overrides */
[data-theme="dark"] .loading-spinner {
	border-top-color: var(--brand) !important;
}

[data-theme="dark"] [style*="border-top: 4px solid #007bff"] {
	border-top: 4px solid var(--brand) !important;
}

/* Box shadow overrides for dark theme */
[data-theme="dark"] [style*="box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1)"] {
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] [style*="box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08)"] {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] [style*="box-shadow: 0 2px 4px rgba(0,0,0,0.1)"] {
	box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

/* Additional specific overrides for common patterns */
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:#fff"] {
	background: var(--surface) !important;
}

[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background:#ffffff"] {
	background: var(--surface) !important;
}

[data-theme="dark"] [style*="color: #000000"],
[data-theme="dark"] [style*="color:#000000"] {
	color: var(--text) !important;
}

[data-theme="dark"] [style*="color: #111827"],
[data-theme="dark"] [style*="color:#111827"] {
	color: var(--text) !important;
}

[data-theme="dark"] [style*="color: #1f2937"],
[data-theme="dark"] [style*="color:#1f2937"] {
	color: var(--text) !important;
}

[data-theme="dark"] [style*="color: #374151"],
[data-theme="dark"] [style*="color:#374151"] {
	color: var(--text) !important;
}

[data-theme="dark"] [style*="color: #4b5563"],
[data-theme="dark"] [style*="color:#4b5563"] {
	color: var(--text-muted) !important;
}

[data-theme="dark"] [style*="color: #6b7280"],
[data-theme="dark"] [style*="color:#6b7280"] {
	color: var(--text-muted) !important;
}

[data-theme="dark"] [style*="color: #9ca3af"],
[data-theme="dark"] [style*="color:#9ca3af"] {
	color: var(--text-secondary) !important;
}

[data-theme="dark"] [style*="color: #d1d5db"],
[data-theme="dark"] [style*="color:#d1d5db"] {
	color: var(--text-muted) !important;
}

/* Ensure all text elements inherit proper colors */
[data-theme="dark"] * {
	color: inherit;
}

[data-theme="dark"] body * {
	color: inherit;
}

/* Override any remaining white backgrounds */
[data-theme="dark"] [style*="background-color: white"],
[data-theme="dark"] [style*="background-color:white"] {
	background-color: var(--surface) !important;
}

[data-theme="dark"] [style*="background-color: #fff"],
[data-theme="dark"] [style*="background-color:#fff"] {
	background-color: var(--surface) !important;
}

[data-theme="dark"] [style*="background-color: #ffffff"],
[data-theme="dark"] [style*="background-color:#ffffff"] {
	background-color: var(--surface) !important;
}

/* Additional Tailwind class overrides for dark theme */
[data-theme="dark"] .bg-slate-50 { background-color: var(--surface-muted) !important; }
[data-theme="dark"] .bg-slate-100 { background-color: var(--surface-elevated) !important; }
[data-theme="dark"] .bg-slate-200 { background-color: var(--border-muted) !important; }
[data-theme="dark"] .bg-slate-300 { background-color: var(--border) !important; }
[data-theme="dark"] .bg-slate-400 { background-color: var(--border) !important; }
[data-theme="dark"] .bg-slate-500 { background-color: var(--text-secondary) !important; }
[data-theme="dark"] .bg-slate-600 { background-color: var(--text-muted) !important; }
[data-theme="dark"] .bg-slate-700 { background-color: var(--text) !important; }
[data-theme="dark"] .bg-slate-800 { background-color: var(--text) !important; }
[data-theme="dark"] .bg-slate-900 { background-color: var(--text) !important; }

[data-theme="dark"] .text-slate-50 { color: var(--text) !important; }
[data-theme="dark"] .text-slate-100 { color: var(--text) !important; }
[data-theme="dark"] .text-slate-200 { color: var(--text-muted) !important; }
[data-theme="dark"] .text-slate-300 { color: var(--text-muted) !important; }
[data-theme="dark"] .text-slate-400 { color: var(--text-secondary) !important; }
[data-theme="dark"] .text-slate-500 { color: var(--text-secondary) !important; }
[data-theme="dark"] .text-slate-600 { color: var(--text-muted) !important; }
[data-theme="dark"] .text-slate-700 { color: var(--text) !important; }
[data-theme="dark"] .text-slate-800 { color: var(--text) !important; }
[data-theme="dark"] .text-slate-900 { color: var(--text) !important; }

[data-theme="dark"] .border-slate-200 { border-color: var(--border) !important; }
[data-theme="dark"] .border-slate-300 { border-color: var(--border) !important; }
[data-theme="dark"] .border-slate-400 { border-color: var(--border-muted) !important; }

[data-theme="dark"] .bg-gray-50 { background-color: var(--surface-muted) !important; }
[data-theme="dark"] .bg-gray-100 { background-color: var(--surface-elevated) !important; }
[data-theme="dark"] .bg-gray-200 { background-color: var(--border-muted) !important; }
[data-theme="dark"] .bg-gray-300 { background-color: var(--border) !important; }
[data-theme="dark"] .bg-gray-400 { background-color: var(--border) !important; }
[data-theme="dark"] .bg-gray-500 { background-color: var(--text-secondary) !important; }
[data-theme="dark"] .bg-gray-600 { background-color: var(--text-muted) !important; }
[data-theme="dark"] .bg-gray-700 { background-color: var(--text) !important; }
[data-theme="dark"] .bg-gray-800 { background-color: var(--text) !important; }
[data-theme="dark"] .bg-gray-900 { background-color: var(--text) !important; }

[data-theme="dark"] .text-gray-50 { color: var(--text) !important; }
[data-theme="dark"] .text-gray-100 { color: var(--text) !important; }
[data-theme="dark"] .text-gray-200 { color: var(--text-muted) !important; }
[data-theme="dark"] .text-gray-300 { color: var(--text-muted) !important; }
[data-theme="dark"] .text-gray-400 { color: var(--text-secondary) !important; }
[data-theme="dark"] .text-gray-500 { color: var(--text-secondary) !important; }
[data-theme="dark"] .text-gray-600 { color: var(--text-muted) !important; }
[data-theme="dark"] .text-gray-700 { color: var(--text) !important; }
[data-theme="dark"] .text-gray-800 { color: var(--text) !important; }
[data-theme="dark"] .text-gray-900 { color: var(--text) !important; }

[data-theme="dark"] .border-gray-200 { border-color: var(--border) !important; }
[data-theme="dark"] .border-gray-300 { border-color: var(--border) !important; }
[data-theme="dark"] .border-gray-400 { border-color: var(--border-muted) !important; }

/* Additional common color overrides */
[data-theme="dark"] [style*="color: #1e293b"],
[data-theme="dark"] [style*="color:#1e293b"] {
	color: var(--text) !important;
}

[data-theme="dark"] [style*="color: #334155"],
[data-theme="dark"] [style*="color:#334155"] {
	color: var(--text) !important;
}

[data-theme="dark"] [style*="color: #475569"],
[data-theme="dark"] [style*="color:#475569"] {
	color: var(--text-muted) !important;
}

[data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] [style*="color:#64748b"] {
	color: var(--text-secondary) !important;
}

[data-theme="dark"] [style*="color: #94a3b8"],
[data-theme="dark"] [style*="color:#94a3b8"] {
	color: var(--text-secondary) !important;
}

[data-theme="dark"] [style*="color: #cbd5e1"],
[data-theme="dark"] [style*="color:#cbd5e1"] {
	color: var(--text-muted) !important;
}

[data-theme="dark"] [style*="color: #e2e8f0"],
[data-theme="dark"] [style*="color:#e2e8f0"] {
	color: var(--text) !important;
}

[data-theme="dark"] [style*="color: #f1f5f9"],
[data-theme="dark"] [style*="color:#f1f5f9"] {
	color: var(--text) !important;
}

[data-theme="dark"] [style*="color: #f8fafc"],
[data-theme="dark"] [style*="color:#f8fafc"] {
	color: var(--text) !important;
}

/* Background color overrides for common patterns */
[data-theme="dark"] [style*="background: #1e293b"],
[data-theme="dark"] [style*="background:#1e293b"] {
	background: var(--surface) !important;
}

[data-theme="dark"] [style*="background: #334155"],
[data-theme="dark"] [style*="background:#334155"] {
	background: var(--surface-elevated) !important;
}

[data-theme="dark"] [style*="background: #475569"],
[data-theme="dark"] [style*="background:#475569"] {
	background: var(--border) !important;
}

[data-theme="dark"] [style*="background: #64748b"],
[data-theme="dark"] [style*="background:#64748b"] {
	background: var(--text-secondary) !important;
}

[data-theme="dark"] [style*="background: #94a3b8"],
[data-theme="dark"] [style*="background:#94a3b8"] {
	background: var(--text-secondary) !important;
}

[data-theme="dark"] [style*="background: #cbd5e1"],
[data-theme="dark"] [style*="background:#cbd5e1"] {
	background: var(--text-muted) !important;
}

[data-theme="dark"] [style*="background: #e2e8f0"],
[data-theme="dark"] [style*="background:#e2e8f0"] {
	background: var(--text) !important;
}

[data-theme="dark"] [style*="background: #f1f5f9"],
[data-theme="dark"] [style*="background:#f1f5f9"] {
	background: var(--surface-muted) !important;
}

[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:#f8fafc"] {
	background: var(--surface-muted) !important;
}

