/* ============================================================
   Secrez Theme System v3 - Professional Color Palettes
   ============================================================
   Design: Material-inspired color system with:
   - Primary: Brand violet (CTA, links, active states)
   - Secondary: Cyan/teal (supporting actions, accents)
   - Surface scale: Elevation hierarchy (base → elevated → overlay)
   - Semantic: success, warning, danger, info - theme-optimized
   ============================================================ */

/* Persian (FA) + English fonts - unified across all pages */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Vazirmatn:wght@100..900&display=swap');

/* ============ DARK THEME - Premium Midnight Palette ============ */
:root {
    /* === Typography (Persian + English) === */
    --font-fa: 'Vazirmatn', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
    --font-en: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* === Surface Hierarchy (elevation system) === */
    --surface-base: #0f172a;
    --surface-1: #1e293b;
    --surface-2: #334155;
    --surface-3: #475569;
    --surface-overlay: #64748b;
    
    /* === Color Palette === */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-glass: rgba(15, 23, 42, 0.92);
    --bg-card: rgba(30, 41, 59, 0.85);
    --bg-surface: rgba(51, 65, 85, 0.5);
    --bg-input: rgba(30, 41, 59, 0.8);
    --bg-input-focus: rgba(51, 65, 85, 0.9);
    --bg-hover: rgba(139, 92, 246, 0.15);
    --bg-active: rgba(34, 211, 238, 0.12);
    
    /* === Primary (Violet) - Brand accent === */
    --accent-primary: #a78bfa;
    --accent-primary-hover: #c4b5fd;
    --accent-primary-dark: #7c3aed;
    --accent-primary-muted: rgba(167, 139, 250, 0.2);
    --accent-primary-rgb: 167, 139, 250;
    
    /* === Secondary (Cyan) - Supporting accent === */
    --accent-secondary: #22d3ee;
    --accent-secondary-hover: #67e8f9;
    --accent-secondary-dark: #0891b2;
    --accent-secondary-muted: rgba(34, 211, 238, 0.15);
    --accent-secondary-rgb: 34, 211, 238;
    
    /* === Semantic - Optimized for dark bg === */
    --accent-success: #34d399;
    --accent-success-rgb: 52, 211, 153;
    --accent-warning: #fbbf24;
    --accent-warning-rgb: 251, 191, 36;
    --accent-danger: #f87171;
    --accent-danger-rgb: 248, 113, 113;
    --accent-info: #60a5fa;
    --accent-info-rgb: 96, 165, 250;
    
    /* === Text Colors === */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-muted: #64748b;
    --text-on-accent: #ffffff;
    --text-link: #a78bfa;
    --text-link-hover: #c4b5fd;
    
    /* === Border Colors === */
    --border-primary: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(167, 139, 250, 0.3);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-input: rgba(167, 139, 250, 0.3);
    --border-input-focus: var(--accent-primary);
    
    /* === Shadow Colors === */
    --shadow-color: rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(167, 139, 250, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-elevated: 0 15px 50px rgba(0, 0, 0, 0.7);
    --shadow-button: 0 4px 15px rgba(167, 139, 250, 0.3);
    --shadow-button-hover: 0 8px 25px rgba(167, 139, 250, 0.5);
    
    /* === Effects === */
    --glass-blur: blur(20px);
    --glass-border: 1px solid rgba(255, 255, 255, 0.12);
    --text-shadow: none;
    --overlay-bg: rgba(0, 0, 0, 0.6);
    
    /* === Navbar === */
    --nav-bg: rgba(15, 23, 42, 0.96);
    --nav-border: rgba(167, 139, 250, 0.35);
    --nav-text: #94a3b8;
    --nav-text-active: #22d3ee;
    --nav-icon: #cbd5e1;
    --nav-hover-bg: rgba(167, 139, 250, 0.15);
    --nav-active-bg: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(34, 211, 238, 0.1));
    --nav-active-border: rgba(34, 211, 238, 0.4);
    --nav-shadow: 0 15px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(167, 139, 250, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    /* === Sidebar (Admin) === */
    --sidebar-bg: linear-gradient(180deg, var(--surface-base), var(--surface-1));
    --sidebar-border: rgba(167, 139, 250, 0.25);
    --sidebar-text: #cbd5e1;
    --sidebar-text-hover: #a78bfa;
    --sidebar-heading: #94a3b8;
    --topbar-bg: linear-gradient(180deg, var(--surface-1), var(--surface-base));
    --topbar-border: rgba(167, 139, 250, 0.2);
    
    /* === Table === */
    --table-header-bg: rgba(22, 29, 58, 0.8);
    --table-border: rgba(167, 139, 250, 0.3);
    --table-row-border: rgba(255, 255, 255, 0.08);
    --table-hover-bg: rgba(167, 139, 250, 0.08);
    
    /* === Dropdown === */
    --dropdown-bg: rgba(10, 14, 39, 0.95);
    --dropdown-border: rgba(255, 255, 255, 0.15);
    --dropdown-hover: rgba(167, 139, 250, 0.2);
    
    /* === Alert === */
    --alert-success-bg: rgba(16, 185, 129, 0.15);
    --alert-danger-bg: rgba(239, 68, 68, 0.15);
    --alert-warning-bg: rgba(245, 158, 11, 0.15);
    --alert-info-bg: rgba(59, 130, 246, 0.15);
    
    /* === Badge === */
    --badge-primary-bg: rgba(167, 139, 250, 0.2);
    --badge-primary-border: rgba(167, 139, 250, 0.5);
    --badge-success-bg: rgba(16, 185, 129, 0.2);
    --badge-success-border: rgba(16, 185, 129, 0.5);
    --badge-danger-bg: rgba(239, 68, 68, 0.2);
    --badge-danger-border: rgba(239, 68, 68, 0.5);
    --badge-warning-bg: rgba(245, 158, 11, 0.2);
    --badge-warning-border: rgba(245, 158, 11, 0.5);
    
    /* === Autofill === */
    --autofill-bg: var(--surface-1);
    
    /* === Background Gradients (body) === */
    --body-gradient-1: rgba(167, 139, 250, 0.12);
    --body-gradient-2: rgba(34, 211, 238, 0.12);
    --body-gradient-3: rgba(59, 130, 246, 0.05);
    
    /* === Scrollbar === */
    --scrollbar-track: var(--bg-secondary);
    --scrollbar-thumb: var(--accent-primary);
    --scrollbar-thumb-hover: var(--accent-primary-dark);
    
    /* === Theme Toggle Icon === */
    --theme-icon-color: #f59e0b;
    
    /* === Border Radius (shared) === */
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    /* === Transitions (shared) === */
    --transition-fast: 0.15s ease-in-out;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-long: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-theme: 0.35s ease;
}


/* ============ LIGHT THEME - Premium Daylight (v4) ============ */
/* Soft, professional palette: کم‌رنگ، سافت، بدون شارپ و همپوشانی متن/پس‌زمینه */
html[data-theme="light"] {
    /* === Surface - پس‌زمینه‌های نرم با سلسله‌مراتب واضح === */
    --surface-base: #f8f7f5;
    --surface-1: #ffffff;
    --surface-2: #f3f2f0;
    --surface-3: #ebeae8;
    --surface-overlay: #e5e4e2;
    
    /* === Color Palette - پالت نرم و حرفه‌ای === */
    --bg-primary: #f8f7f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3f2f0;
    --bg-glass: rgba(255, 255, 255, 0.92);
    --bg-card: rgba(255, 255, 255, 0.98);
    --bg-surface: rgba(248, 247, 245, 0.95);
    --bg-input: #eeedeb;
    --bg-input-focus: #ffffff;
    --bg-hover: rgba(80, 85, 160, 0.06);
    --bg-active: rgba(80, 85, 160, 0.1);
    
    /* === Primary - بنفش متمایل به خاکستری (نرم، نه شارپ) === */
    --accent-primary: #6366a0;
    --accent-primary-hover: #50559e;
    --accent-primary-dark: #434792;
    --accent-primary-muted: rgba(99, 102, 160, 0.1);
    --accent-primary-rgb: 99, 102, 160;
    
    /* === Secondary - سبز-آبی ملایم === */
    --accent-secondary: #0f8278;
    --accent-secondary-hover: #0d6b63;
    --accent-secondary-dark: #0b5a54;
    --accent-secondary-muted: rgba(15, 130, 120, 0.08);
    --accent-secondary-rgb: 15, 130, 120;
    
    /* === Semantic - رنگ‌های هماهنگ و کم‌اشباع === */
    --accent-success: #0d9668;
    --accent-success-rgb: 13, 150, 104;
    --accent-warning: #b45309;
    --accent-warning-rgb: 180, 83, 9;
    --accent-danger: #c53030;
    --accent-danger-rgb: 197, 48, 48;
    --accent-info: #1d5bb8;
    --accent-info-rgb: 29, 91, 184;
    
    /* === Text - کنتراست روشن و راحت برای چشم === */
    --text-primary: #1c1917;
    --text-secondary: #44403c;
    --text-tertiary: #57534e;
    --text-muted: #78716c;
    --text-on-accent: #ffffff;
    --text-link: #50559e;
    --text-link-hover: #434792;
    
    /* === Borders - خطوط خیلی ملایم === */
    --border-primary: rgba(28, 25, 23, 0.06);
    --border-accent: rgba(99, 102, 160, 0.2);
    --border-subtle: rgba(28, 25, 23, 0.04);
    --border-input: rgba(28, 25, 23, 0.08);
    --border-input-focus: var(--accent-primary);
    
    /* === Shadows - سایه‌های نرم و کم === */
    --shadow-color: rgba(28, 25, 23, 0.06);
    --shadow-glow: 0 6px 24px rgba(99, 102, 160, 0.08), 0 1px 4px rgba(28, 25, 23, 0.03);
    --shadow-card: 0 1px 2px rgba(28, 25, 23, 0.03), 0 4px 16px rgba(28, 25, 23, 0.05), 0 0 0 1px rgba(28, 25, 23, 0.02);
    --shadow-elevated: 0 8px 32px rgba(28, 25, 23, 0.07), 0 2px 8px rgba(99, 102, 160, 0.05), 0 0 0 1px rgba(28, 25, 23, 0.02);
    --shadow-button: 0 2px 6px rgba(99, 102, 160, 0.2), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-button-hover: 0 4px 16px rgba(99, 102, 160, 0.25), 0 1px 4px rgba(0, 0, 0, 0.05);
    
    /* === Effects === */
    --glass-blur: blur(20px);
    --glass-border: 1px solid rgba(28, 25, 23, 0.05);
    --text-shadow: none;
    --overlay-bg: rgba(28, 25, 23, 0.15);
    
    /* === Navbar === */
    --nav-bg: rgba(255, 255, 255, 0.9);
    --nav-border: rgba(99, 102, 160, 0.1);
    --nav-text: #57534e;
    --nav-text-active: #50559e;
    --nav-icon: #44403c;
    --nav-hover-bg: rgba(99, 102, 160, 0.06);
    --nav-active-bg: linear-gradient(135deg, rgba(99, 102, 160, 0.1) 0%, rgba(99, 102, 160, 0.06) 100%);
    --nav-active-border: rgba(99, 102, 160, 0.25);
    --nav-shadow: 0 -2px 16px rgba(28, 25, 23, 0.04), 0 0 0 1px rgba(28, 25, 23, 0.03);
    
    /* === Sidebar (Admin) === */
    --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #f8f7f5 100%);
    --sidebar-border: rgba(28, 25, 23, 0.05);
    --sidebar-text: #44403c;
    --sidebar-text-hover: #50559e;
    --sidebar-heading: #78716c;
    --topbar-bg: linear-gradient(180deg, #ffffff, #f8f7f5);
    --topbar-border: rgba(28, 25, 23, 0.04);
    
    /* === Table === */
    --table-header-bg: rgba(248, 247, 245, 0.98);
    --table-border: rgba(28, 25, 23, 0.05);
    --table-row-border: rgba(28, 25, 23, 0.03);
    --table-hover-bg: rgba(99, 102, 160, 0.04);
    
    /* === Dropdown === */
    --dropdown-bg: #ffffff;
    --dropdown-border: rgba(28, 25, 23, 0.06);
    --dropdown-hover: rgba(99, 102, 160, 0.06);
    
    /* === Alert - ملایم === */
    --alert-success-bg: rgba(13, 150, 104, 0.07);
    --alert-danger-bg: rgba(197, 48, 48, 0.07);
    --alert-warning-bg: rgba(180, 83, 9, 0.07);
    --alert-info-bg: rgba(29, 91, 184, 0.07);
    
    /* === Badge === */
    --badge-primary-bg: rgba(99, 102, 160, 0.1);
    --badge-primary-border: rgba(99, 102, 160, 0.25);
    --badge-success-bg: rgba(13, 150, 104, 0.1);
    --badge-success-border: rgba(13, 150, 104, 0.25);
    --badge-danger-bg: rgba(197, 48, 48, 0.1);
    --badge-danger-border: rgba(197, 48, 48, 0.25);
    --badge-warning-bg: rgba(180, 83, 9, 0.1);
    --badge-warning-border: rgba(180, 83, 9, 0.25);
    
    /* === Autofill === */
    --autofill-bg: #f3f2f0;
    
    /* === Background Gradients (body) - بسیار ملایم === */
    --body-gradient-1: rgba(99, 102, 160, 0.04);
    --body-gradient-2: rgba(99, 102, 160, 0.03);
    --body-gradient-3: rgba(248, 247, 245, 0.5);
    
    /* === Scrollbar === */
    --scrollbar-track: #e8e7e5;
    --scrollbar-thumb: #a5a3b8;
    --scrollbar-thumb-hover: #6366a0;
    
    /* === Theme Toggle Icon === */
    --theme-icon-color: #b45309;
    
    /* === Header gradient - نرم و حرفه‌ای === */
    --header-gradient: linear-gradient(145deg, #6366a0 0%, #50559e 35%, #434792 100%);
    --header-gradient-subtle: linear-gradient(145deg, rgba(99, 102, 160, 0.92) 0%, rgba(67, 71, 146, 0.9) 100%);
}


/* ============ THEME TRANSITION ============ */
/* Smooth transition when switching themes */
html[data-theme-transitioning],
html[data-theme-transitioning] *,
html[data-theme-transitioning] *::before,
html[data-theme-transitioning] *::after {
    transition: background-color var(--transition-theme),
                color var(--transition-theme),
                border-color var(--transition-theme),
                box-shadow var(--transition-theme),
                fill var(--transition-theme),
                stroke var(--transition-theme) !important;
}


/* ============ LIGHT MODE OVERRIDES ============ */
/* These override hardcoded dark colors used in inline styles and CSS */

html[data-theme="light"] body {
    background-color: var(--bg-primary) !important;
    background-image:
        radial-gradient(ellipse 80% 50% at 20% 10%, var(--body-gradient-1) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 90% 90%, var(--body-gradient-2) 0%, transparent 50%),
        radial-gradient(ellipse 100% 80% at 50% 50%, var(--body-gradient-3) 0%, transparent 70%);
    color: var(--text-primary) !important;
}

/* Focus visible - keyboard accessibility (light) */
html[data-theme="light"] .btn-search:focus-visible,
html[data-theme="light"] .btn-action:focus-visible,
html[data-theme="light"] .btn-details:focus-visible,
html[data-theme="light"] .btn-primary:focus-visible,
html[data-theme="light"] .form-select:focus-visible,
html[data-theme="light"] input:focus-visible,
html[data-theme="light"] select:focus-visible,
html[data-theme="light"] a:focus-visible {
    outline: 2px solid var(--accent-primary) !important;
    outline-offset: 2px !important;
}

html[data-theme="light"] .service-card:focus-visible {
    outline: 2px solid var(--accent-primary) !important;
    outline-offset: 2px !important;
}

/* Glass Card Light Mode */
html[data-theme="light"] .glass-card {
    background: var(--bg-glass) !important;
    border: var(--glass-border) !important;
    box-shadow: var(--shadow-card) !important;
}

html[data-theme="light"] .glass-card:hover {
    box-shadow: var(--shadow-glow) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.3) !important;
}

html[data-theme="light"] .glass-card::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.02), transparent);
}

/* Navigation Light Mode */
html[data-theme="light"] .nav-glass {
    background: var(--nav-bg) !important;
    border-color: var(--nav-border) !important;
    box-shadow: var(--nav-shadow) !important;
}

html[data-theme="light"] .nav-item {
    color: var(--nav-text) !important;
}

html[data-theme="light"] .nav-item i {
    color: var(--nav-icon) !important;
}

html[data-theme="light"] .nav-item.active,
html[data-theme="light"] .nav-item:active {
    color: var(--nav-text-active) !important;
    background: var(--nav-active-bg) !important;
    border: 1px solid var(--nav-active-border) !important;
    box-shadow: 0 0 12px rgba(var(--accent-primary-rgb), 0.2), 
                inset 0 1px 6px rgba(var(--accent-primary-rgb), 0.08) !important;
}

html[data-theme="light"] .nav-item.active i,
html[data-theme="light"] .nav-item:active i {
    color: var(--nav-text-active) !important;
}

html[data-theme="light"] .nav-item.active span,
html[data-theme="light"] .nav-item:active span {
    color: var(--nav-text-active) !important;
}

html[data-theme="light"] .nav-item:hover {
    color: var(--text-primary) !important;
    background: var(--nav-hover-bg) !important;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.2) !important;
    box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.15) !important;
}

html[data-theme="light"] .nav-item:hover i {
    color: var(--accent-primary) !important;
}

html[data-theme="light"] .nav-item:hover span {
    color: var(--text-primary) !important;
}

/* Form Elements Light Mode */
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="tel"] {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-input) !important;
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary) !important;
}

html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] .form-control:focus,
html[data-theme="light"] .form-select:focus,
html[data-theme="light"] input[type="text"]:focus,
html[data-theme="light"] input[type="email"]:focus,
html[data-theme="light"] input[type="password"]:focus,
html[data-theme="light"] input[type="number"]:focus,
html[data-theme="light"] input[type="search"]:focus,
html[data-theme="light"] input[type="tel"]:focus {
    background-color: var(--bg-input-focus) !important;
    border-color: var(--border-input-focus) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.15) !important;
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary) !important;
}

html[data-theme="light"] input:active,
html[data-theme="light"] textarea:active,
html[data-theme="light"] .form-control:active {
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
    color: var(--text-muted) !important;
}

html[data-theme="light"] input::selection,
html[data-theme="light"] textarea::selection,
html[data-theme="light"] .form-control::selection {
    background: rgba(var(--accent-primary-rgb), 0.25) !important;
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

/* Autofill Light Mode */
html[data-theme="light"] input:-webkit-autofill,
html[data-theme="light"] input:-webkit-autofill:hover,
html[data-theme="light"] input:-webkit-autofill:focus,
html[data-theme="light"] input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--autofill-bg) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    color: var(--text-primary) !important;
    caret-color: var(--text-primary) !important;
}

/* Button Light Mode - Primary - متن سفید برای خوانایی در هر تم */
html[data-theme="light"] .btn-primary,
html[data-theme="light"] a.btn-primary,
html[data-theme="light"] .btn-view,
html[data-theme="light"] a.btn-view,
html[data-theme="light"] .btn-action.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-dark) 100%) !important;
    box-shadow: var(--shadow-button) !important;
    color: #ffffff !important;
}

html[data-theme="light"] .btn-success,
html[data-theme="light"] .btn-danger,
html[data-theme="light"] .btn-approve,
html[data-theme="light"] .btn-reject {
    color: #ffffff !important;
}

html[data-theme="light"] .btn-primary:hover,
html[data-theme="light"] a.btn-primary:hover,
html[data-theme="light"] .btn-view:hover,
html[data-theme="light"] a.btn-view:hover,
html[data-theme="light"] .btn-action.btn-primary:hover,
html[data-theme="light"] .btn-success:hover,
html[data-theme="light"] .btn-danger:hover,
html[data-theme="light"] .btn-approve:hover,
html[data-theme="light"] .btn-reject:hover {
    box-shadow: var(--shadow-button-hover) !important;
    color: #ffffff !important;
}

/* متن سفید برای دکمه‌های سبز و قرمز */

/* Button Light Mode - Nexus */
html[data-theme="light"] .btn-nexus {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark)) !important;
}

html[data-theme="light"] .btn-nexus:hover {
    box-shadow: 0 8px 24px rgba(var(--accent-primary-rgb), 0.3) !important;
}

/* Button Light Mode - Secondary */
html[data-theme="light"] .btn-secondary {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-secondary-dark) 100%) !important;
    box-shadow: 0 4px 15px rgba(var(--accent-secondary-rgb), 0.2) !important;
}

/* Button Light Mode - Outline (indigo, matches primary) */
html[data-theme="light"] .btn-outline {
    border-color: var(--accent-primary) !important;
    color: var(--accent-primary) !important;
}

html[data-theme="light"] .btn-outline:hover {
    background: rgba(var(--accent-primary-rgb), 0.08) !important;
    box-shadow: 0 0 15px rgba(var(--accent-primary-rgb), 0.2) !important;
}

/* Button Light Mode - Ghost */
html[data-theme="light"] .btn-ghost {
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .btn-ghost:hover {
    background: rgba(var(--accent-primary-rgb), 0.06) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.3) !important;
    color: var(--text-primary) !important;
}

/* Typography Light Mode */
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6 {
    color: var(--text-primary) !important;
}

html[data-theme="light"] p,
html[data-theme="light"] span:not(.nav-item span) {
    color: var(--text-secondary);
}

html[data-theme="light"] a:not(.nav-item):not(.btn):not(.btn-primary):not(.btn-secondary):not(.btn-success):not(.btn-danger):not(.btn-warning) {
    color: var(--text-link);
}

html[data-theme="light"] a:not(.nav-item):not(.btn):hover {
    color: var(--text-link-hover);
}

/* Table Light Mode */
html[data-theme="light"] thead {
    background: var(--table-header-bg) !important;
}

html[data-theme="light"] th {
    color: var(--text-secondary) !important;
    border-bottom-color: var(--table-border) !important;
}

html[data-theme="light"] td {
    color: var(--text-secondary) !important;
    border-bottom-color: var(--table-row-border) !important;
}

html[data-theme="light"] tr:hover {
    background: var(--table-hover-bg) !important;
}

/* Dropdown Light Mode */
html[data-theme="light"] .dropdown-menu {
    background: var(--dropdown-bg) !important;
    border-color: var(--dropdown-border) !important;
    box-shadow: var(--shadow-elevated) !important;
}

html[data-theme="light"] .dropdown-item {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .dropdown-item:hover {
    background: var(--dropdown-hover) !important;
    color: var(--text-primary) !important;
}

/* Alert Light Mode */
html[data-theme="light"] .alert-success {
    background: var(--alert-success-bg) !important;
    color: var(--accent-success) !important;
}

html[data-theme="light"] .alert-danger {
    background: var(--alert-danger-bg) !important;
    color: var(--accent-danger) !important;
}

html[data-theme="light"] .alert-warning {
    background: var(--alert-warning-bg) !important;
    color: var(--accent-warning) !important;
}

html[data-theme="light"] .alert-info {
    background: var(--alert-info-bg) !important;
    color: var(--accent-info) !important;
}

/* Badge Light Mode */
html[data-theme="light"] .badge-primary {
    background: var(--badge-primary-bg) !important;
    color: var(--accent-primary) !important;
    border-color: var(--badge-primary-border) !important;
}

html[data-theme="light"] .badge-success {
    background: var(--badge-success-bg) !important;
    color: var(--accent-success) !important;
    border-color: var(--badge-success-border) !important;
}

html[data-theme="light"] .badge-danger {
    background: var(--badge-danger-bg) !important;
    color: var(--accent-danger) !important;
    border-color: var(--badge-danger-border) !important;
}

html[data-theme="light"] .badge-warning {
    background: var(--badge-warning-bg) !important;
    color: var(--accent-warning) !important;
    border-color: var(--badge-warning-border) !important;
}

/* Menu Items Light Mode */
html[data-theme="light"] .menu-item {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .menu-item:hover {
    background: rgba(var(--accent-primary-rgb), 0.06) !important;
    color: var(--text-primary) !important;
    border-left-color: var(--accent-primary) !important;
}

html[data-theme="light"] .menu-item.active {
    background: rgba(var(--accent-primary-rgb), 0.1) !important;
    color: var(--accent-primary) !important;
    border-left-color: var(--accent-primary) !important;
}

/* Sidebar Light Mode (Admin) */
html[data-theme="light"] .sidebar {
    background: var(--sidebar-bg) !important;
    border-right-color: var(--sidebar-border) !important;
}

html[data-theme="light"] .navbar-nav .nav-link {
    color: var(--sidebar-text) !important;
}

html[data-theme="light"] .navbar-nav .nav-link:hover {
    color: var(--sidebar-text-hover) !important;
    background: rgba(var(--accent-primary-rgb), 0.06) !important;
}

html[data-theme="light"] .navbar-nav .nav-link.active {
    color: var(--sidebar-text-hover) !important;
    background: rgba(var(--accent-primary-rgb), 0.1) !important;
}

html[data-theme="light"] .sidebar-heading {
    color: var(--sidebar-heading) !important;
}

html[data-theme="light"] .sidebar-brand-text {
    color: var(--accent-primary) !important;
}

html[data-theme="light"] .topbar {
    background: var(--topbar-bg) !important;
    border-bottom-color: var(--topbar-border) !important;
}

/* Section Headers - Soft elegant gradient with depth */
html[data-theme="light"] .header,
html[data-theme="light"] .page-header {
    background: var(--header-gradient) !important;
    box-shadow: 0 4px 24px rgba(var(--accent-primary-rgb), 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    border: none !important;
}

html[data-theme="light"] .header::before,
html[data-theme="light"] .page-header::before {
    opacity: 0.15 !important;
}

html[data-theme="light"] .header h1,
html[data-theme="light"] .header p,
html[data-theme="light"] .page-header h1,
html[data-theme="light"] .page-header p {
    color: var(--text-on-accent) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* Back button in header - frosted glass, readable on gradient */
html[data-theme="light"] .header .back-btn,
html[data-theme="light"] .page-header .back-btn {
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--accent-primary-dark) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

html[data-theme="light"] .header .back-btn:hover,
html[data-theme="light"] .page-header .back-btn:hover {
    background: #ffffff !important;
    color: var(--accent-primary) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
}

html[data-theme="light"] .header .back-btn i,
html[data-theme="light"] .page-header .back-btn i {
    color: inherit !important;
}

/* Balance Card - Soft tinted, refined */
html[data-theme="light"] .balance-card {
    background: linear-gradient(145deg, rgba(var(--accent-primary-rgb), 0.08) 0%, rgba(var(--accent-primary-rgb), 0.04) 100%) !important;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.18) !important;
    box-shadow: var(--shadow-card) !important;
}

html[data-theme="light"] .balance-card h3,
html[data-theme="light"] .balance-card .balance-row span {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .balance-amount {
    color: var(--text-primary) !important;
    text-shadow: none !important;
}

html[data-theme="light"] .balance-label {
    color: var(--text-secondary) !important;
    text-shadow: none !important;
}

html[data-theme="light"] .balance-meta {
    color: var(--text-tertiary) !important;
}

/* Action Buttons / Quick Actions */
html[data-theme="light"] .action-btn,
html[data-theme="light"] .quick-action-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-card) !important;
}

html[data-theme="light"] .action-btn:hover,
html[data-theme="light"] .quick-action-card:hover {
    background: var(--bg-hover) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.3) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-glow) !important;
}

html[data-theme="light"] .action-btn span,
html[data-theme="light"] .action-btn i {
    color: var(--text-primary) !important;
    text-shadow: none !important;
}

html[data-theme="light"] .action-btn i {
    color: var(--accent-primary) !important;
}

html[data-theme="light"] .action-btn:hover span,
html[data-theme="light"] .action-btn:hover i {
    color: var(--accent-primary) !important;
}

/* Section headers - soft gradient */
html[data-theme="light"] .section-header,
html[data-theme="light"] [class*="section-header"] {
    background: var(--header-gradient) !important;
    box-shadow: 0 4px 20px rgba(var(--accent-primary-rgb), 0.15) !important;
}

html[data-theme="light"] .user-welcome h1 {
    color: var(--text-primary) !important;
    text-shadow: none !important;
}

html[data-theme="light"] .user-welcome p {
    color: var(--text-secondary) !important;
    text-shadow: none !important;
}

/* Main Container */
html[data-theme="light"] .main-container {
    background: var(--bg-secondary) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.12) !important;
    box-shadow: var(--shadow-card) !important;
}

/* Content area */
html[data-theme="light"] .content {
    color: var(--text-primary) !important;
}

/* Profile Section */
html[data-theme="light"] .profile-avatar-section {
    background: rgba(var(--accent-primary-rgb), 0.06) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.12) !important;
}

html[data-theme="light"] .profile-name {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .profile-username {
    color: var(--text-secondary) !important;
}

/* Wallet Section */
html[data-theme="light"] .wallet-content {
    color: var(--text-primary) !important;
}

/* Scrollbar Light Mode */
html[data-theme="light"] ::-webkit-scrollbar {
    width: 8px;
}

html[data-theme="light"] ::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

html[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

html[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ============ THEME TOGGLE BUTTON ============ */
/* LTR (English): دکمه سمت راست | RTL (فارسی): دکمه سمت چپ */
.theme-toggle-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    left: auto;
    z-index: 1002; /* Higher than notification bell (1000) to stay on top */
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-card);
    padding: 0;
}

[dir="rtl"] .theme-toggle-btn {
    right: auto;
    left: 16px;
}

.theme-toggle-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: var(--shadow-glow);
    border-color: var(--accent-primary);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.theme-toggle-btn .theme-icon {
    font-size: 1.3rem;
    color: var(--theme-icon-color);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    line-height: 1;
}

/* Sun icon for dark mode (switch to light) */
.theme-toggle-btn .icon-sun {
    display: block;
}
.theme-toggle-btn .icon-moon {
    display: none;
}

/* Moon icon for light mode (switch to dark) */
html[data-theme="light"] .theme-toggle-btn .icon-sun {
    display: none;
}
html[data-theme="light"] .theme-toggle-btn .icon-moon {
    display: block;
}

/* ============ UTILITY CLASSES ============ */
/* Use these for elements that should only show in a specific theme */
.dark-only {
    display: block;
}
.light-only {
    display: none;
}
html[data-theme="light"] .dark-only {
    display: none !important;
}
html[data-theme="light"] .light-only {
    display: block !important;
}

/* Inline elements */
.dark-only-inline {
    display: inline;
}
.light-only-inline {
    display: none;
}
html[data-theme="light"] .dark-only-inline {
    display: none !important;
}
html[data-theme="light"] .light-only-inline {
    display: inline !important;
}

/* ============ COMMON HARDCODED COLOR OVERRIDES ============ */
/* Override common hardcoded dark colors found across templates */

/* Override hardcoded dark backgrounds in light mode */
html[data-theme="light"] [style*="background-color: #0a0e27"],
html[data-theme="light"] [style*="background:#0a0e27"],
html[data-theme="light"] [style*="background: #0a0e27"],
html[data-theme="light"] [style*="background-color: #0f172a"],
html[data-theme="light"] [style*="background:#0f172a"],
html[data-theme="light"] [style*="background-color: #1e293b"],
html[data-theme="light"] [style*="background:#1e293b"] {
    background-color: var(--bg-primary) !important;
    background: var(--bg-primary) !important;
}

/* Override hardcoded dark surface backgrounds in light mode */
html[data-theme="light"] [style*="background-color: #161d3a"],
html[data-theme="light"] [style*="background:#161d3a"],
html[data-theme="light"] [style*="background: #161d3a"],
html[data-theme="light"] [style*="background-color: #334155"],
html[data-theme="light"] [style*="background:#334155"] {
    background-color: var(--bg-secondary) !important;
    background: var(--bg-secondary) !important;
}

/* Override rgba dark surfaces in light mode */
html[data-theme="light"] [style*="rgba(22, 29, 58"],
html[data-theme="light"] [style*="rgba(10, 14, 39"],
html[data-theme="light"] [style*="rgba(30, 41, 59"] {
    background-color: var(--bg-card) !important;
}

/* Override hardcoded white text when not needed */
html[data-theme="light"] [style*="color: #ffffff"]:not(.btn):not(.btn-primary):not(.btn-secondary):not(.btn-success):not(.btn-danger):not(.btn-warning):not([class*="header"]) {
    color: var(--text-primary) !important;
}

/* Override hardcoded #cbd5e1 text */
html[data-theme="light"] [style*="color: #cbd5e1"] {
    color: var(--text-secondary) !important;
}

/* Override hardcoded #94a3b8 text */
html[data-theme="light"] [style*="color: #94a3b8"] {
    color: var(--text-tertiary) !important;
}

/* ============ SPECIFIC PAGE OVERRIDES ============ */

/* Dashboard Stats Cards */
html[data-theme="light"] .stat-card,
html[data-theme="light"] .quick-action-card {
    background: var(--bg-card) !important;
    border: var(--glass-border) !important;
    box-shadow: var(--shadow-card) !important;
}

html[data-theme="light"] .stat-card:hover,
html[data-theme="light"] .quick-action-card:hover {
    box-shadow: var(--shadow-glow) !important;
}

/* Reservation Cards */
html[data-theme="light"] .reservation-card {
    background: var(--bg-card) !important;
    border: var(--glass-border) !important;
}

/* دکمه‌های تأیید/رد در رزرو - ردیفی کنار هم در تم لایت */
html[data-theme="light"] .action-section,
html[data-theme="light"] .reservation-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
}
html[data-theme="light"] .action-section .btn-success,
html[data-theme="light"] .action-section .btn-danger,
html[data-theme="light"] .action-section .btn-primary,
html[data-theme="light"] .reservation-actions .btn-approve,
html[data-theme="light"] .reservation-actions .btn-reject,
html[data-theme="light"] .reservation-actions .btn-view {
    flex: 0 0 auto !important;
}

/* Crypto Card */
html[data-theme="light"] .crypto-card {
    background: var(--bg-card) !important;
    border: var(--glass-border) !important;
}

/* Section Titles */
html[data-theme="light"] .section-title {
    color: var(--text-primary) !important;
    text-shadow: none !important;
}

html[data-theme="light"] .section-title::before {
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-primary-dark)) !important;
    box-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.2) !important;
}

/* Dividers */
html[data-theme="light"] hr,
html[data-theme="light"] .divider {
    border-color: var(--border-subtle) !important;
}

/* Empty State */
html[data-theme="light"] .empty-state {
    color: var(--text-muted) !important;
}

/* Price Tags */
html[data-theme="light"] .price-tag,
html[data-theme="light"] .amount {
    color: var(--accent-primary) !important;
}

/* Footer */
html[data-theme="light"] footer {
    background: var(--bg-secondary) !important;
    color: var(--text-muted) !important;
}

html[data-theme="light"] footer span {
    color: var(--text-muted) !important;
}

/* Modal Overlays */
html[data-theme="light"] .modal-content {
    background: var(--bg-secondary) !important;
    border: var(--glass-border) !important;
    box-shadow: var(--shadow-elevated) !important;
}

html[data-theme="light"] .modal-header {
    border-bottom-color: var(--border-subtle) !important;
}

html[data-theme="light"] .modal-footer {
    border-top-color: var(--border-subtle) !important;
}

/* Back Button (inline styles overrides) */
html[data-theme="light"] .back-btn {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-card) !important;
}

html[data-theme="light"] .back-btn:hover {
    background: var(--bg-hover) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.3) !important;
    color: var(--accent-primary) !important;
    box-shadow: var(--shadow-glow) !important;
}

html[data-theme="light"] .back-btn i {
    color: inherit !important;
}

/* Detail Cards (subscription / service details) */
html[data-theme="light"] .detail-card {
    background: var(--bg-card) !important;
    border: var(--glass-border) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-card) !important;
}

html[data-theme="light"] .detail-card:hover {
    background: var(--bg-hover) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.25) !important;
    box-shadow: var(--shadow-glow) !important;
}

html[data-theme="light"] .detail-card h4,
html[data-theme="light"] .detail-card p {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .detail-card i {
    color: var(--accent-primary) !important;
}

/* Subscription Info Block */
html[data-theme="light"] .subscription-info,
html[data-theme="light"] .subscription-details {
    background: transparent !important;
    color: var(--text-primary) !important;
}

/* Price Highlight (inline green override) */
html[data-theme="light"] .price-highlight {
    color: var(--accent-success) !important;
}

/* Payment Options / Payment Option Cards */
html[data-theme="light"] .payment-options {
    background: transparent !important;
}

html[data-theme="light"] .payment-option {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-card) !important;
}

html[data-theme="light"] .payment-option:hover {
    background: var(--bg-hover) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.3) !important;
    box-shadow: var(--shadow-glow) !important;
}

html[data-theme="light"] .payment-option.selected {
    background: var(--accent-primary-muted) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.2) !important;
}

html[data-theme="light"] .payment-option label,
html[data-theme="light"] .payment-details {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .payment-option .balance-info,
html[data-theme="light"] .balance-info {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .payment-icon {
    color: var(--accent-primary) !important;
}

/* Purchase Button */
html[data-theme="light"] .purchase-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark)) !important;
    color: var(--text-on-accent) !important;
    border: none !important;
    box-shadow: var(--shadow-button) !important;
}

html[data-theme="light"] .purchase-btn:hover:not(:disabled) {
    box-shadow: var(--shadow-button-hover) !important;
}

html[data-theme="light"] .purchase-btn:disabled {
    background: var(--bg-tertiary) !important;
    color: var(--text-muted) !important;
}

/* Payment Section Headers */
html[data-theme="light"] .payment-section h3,
html[data-theme="light"] .purchase-section {
    color: var(--text-primary) !important;
}

/* Recent Activity Items */
html[data-theme="light"] .recent-activity-item {
    background: var(--bg-card) !important;
    border: var(--glass-border) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .recent-activity-item:hover {
    background: var(--bg-hover) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.2) !important;
}

/* Deposit Button (wallet) */
html[data-theme="light"] .deposit-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark)) !important;
    color: var(--text-on-accent) !important;
    box-shadow: var(--shadow-button) !important;
}

html[data-theme="light"] .deposit-btn:hover {
    box-shadow: var(--shadow-button-hover) !important;
}

/* Pagination (if used) */
html[data-theme="light"] .pagination .page-link {
    background: var(--bg-card) !important;
    border-color: var(--border-primary) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .pagination .page-link:hover {
    background: var(--bg-hover) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.3) !important;
    color: var(--accent-primary) !important;
}

html[data-theme="light"] .pagination .page-item.active .page-link {
    background: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
    color: var(--text-on-accent) !important;
}

/* Toast / Notification (Bootstrap or custom) */
html[data-theme="light"] .toast,
html[data-theme="light"] .toast-header {
    background: var(--bg-secondary) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .toast-body {
    color: var(--text-primary) !important;
}

/* ============ WALLET & TRANSACTIONS LIGHT OVERRIDES ============ */

/* Transactions Section - Soft card, no harsh gradient */
html[data-theme="light"] .transactions-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: var(--shadow-card) !important;
}

html[data-theme="light"] .transactions-section .section-title {
    color: var(--text-primary) !important;
}

/* View All button - Primary gradient */
html[data-theme="light"] .view-all-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark)) !important;
    color: var(--text-on-accent) !important;
    box-shadow: var(--shadow-button) !important;
}

html[data-theme="light"] .view-all-btn:hover {
    box-shadow: var(--shadow-button-hover) !important;
}

/* Filter Tabs - Refined pill buttons */
html[data-theme="light"] .filter-tab {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .filter-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark)) !important;
    color: var(--text-on-accent) !important;
    border-color: transparent !important;
    box-shadow: var(--shadow-button) !important;
}

html[data-theme="light"] .filter-tab:hover {
    border-color: rgba(var(--accent-primary-rgb), 0.4) !important;
    color: var(--text-primary) !important;
}

/* Transaction Items */
html[data-theme="light"] .transaction-item {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: var(--shadow-card) !important;
}

html[data-theme="light"] .transaction-item::before {
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-primary-dark)) !important;
}

html[data-theme="light"] .transaction-header .transaction-type,
html[data-theme="light"] .transaction-type {
    color: var(--text-primary) !important;
}

/* ============ WEBAPP DASHBOARD LIGHT OVERRIDES ============ */

/* Stat Cards - Soft gradient instead of harsh purple */
html[data-theme="light"] .stat-card {
    background: linear-gradient(145deg, rgba(var(--accent-primary-rgb), 0.15) 0%, rgba(var(--accent-primary-rgb), 0.06) 100%) !important;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.2) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-card) !important;
}

html[data-theme="light"] .stat-card .stat-value,
html[data-theme="light"] .stat-value {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .stat-card .stat-label,
html[data-theme="light"] .stat-label {
    color: var(--text-secondary) !important;
}

/* WebApp Balance Card - Override cyan gradient */
html[data-theme="light"] .balance-card {
    background: linear-gradient(145deg, rgba(var(--accent-primary-rgb), 0.1) 0%, rgba(var(--accent-primary-rgb), 0.04) 100%) !important;
}

/* WebApp .card - General content cards */
html[data-theme="light"] .card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: var(--shadow-card) !important;
}

html[data-theme="light"] .card h3 {
    color: var(--text-primary) !important;
}

/* WebApp .card inner action buttons - primary style */
html[data-theme="light"] .card .action-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark)) !important;
    color: var(--text-on-accent) !important;
    box-shadow: var(--shadow-button) !important;
}

html[data-theme="light"] .card .action-btn:hover {
    box-shadow: var(--shadow-button-hover) !important;
}

/* ============ PENDING / STATUS BADGES LIGHT ============ */

html[data-theme="light"] .pending-alert,
html[data-theme="light"] [class*="pending"] {
    background: rgba(var(--accent-warning-rgb), 0.08) !important;
    border-color: rgba(var(--accent-warning-rgb), 0.3) !important;
}

html[data-theme="light"] .status-pending,
html[data-theme="light"] .status-badge.pending {
    background: rgba(var(--accent-warning-rgb), 0.12) !important;
    color: var(--accent-warning) !important;
}

html[data-theme="light"] .status-completed {
    background: rgba(var(--accent-success-rgb), 0.12) !important;
    color: var(--accent-success) !important;
}

html[data-theme="light"] .status-cancelled {
    background: rgba(var(--accent-danger-rgb), 0.12) !important;
    color: var(--accent-danger) !important;
}

/* Section title decorative bar - light mode */
html[data-theme="light"] .section-title::before {
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-primary-dark)) !important;
    box-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.2) !important;
}

/* Main container - light refinement (کادربندی حرفه‌ای مثل تم دارک) */
html[data-theme="light"] .main-container {
    box-shadow: var(--shadow-elevated) !important;
    border: 1px solid var(--border-primary) !important;
    background: var(--bg-secondary) !important;
}


/* Login / Entry page container - premium card */
html[data-theme="light"] body > .container,
html[data-theme="light"] .login-container {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: var(--shadow-elevated) !important;
}

html[data-theme="light"] .features li::before {
    color: var(--accent-success) !important;
}

/* Glass card hover - use theme variable for border */
html[data-theme="light"] .glass-card:hover {
    border-color: rgba(var(--accent-primary-rgb), 0.25) !important;
}

/* ============ BROWSE SERVICES / GRID PAGES - Premium Light ============ */

/* Filters Section - Elevated premium card */
html[data-theme="light"] .filters-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(26, 24, 22, 0.04), 0 8px 32px rgba(26, 24, 22, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    transition: box-shadow var(--transition-smooth) !important;
}

html[data-theme="light"] .filters-title {
    color: var(--text-primary) !important;
}

/* Filter selects - refined */
html[data-theme="light"] .filters-section .form-select {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-input) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .filters-section .form-select:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.12) !important;
}

html[data-theme="light"] .form-label {
    color: var(--text-secondary) !important;
}

/* Search Button - Premium CTA */
html[data-theme="light"] .btn-search {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-dark) 100%) !important;
    color: var(--text-on-accent) !important;
    box-shadow: 0 4px 14px rgba(var(--accent-primary-rgb), 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

html[data-theme="light"] .btn-search:hover {
    box-shadow: 0 8px 28px rgba(var(--accent-primary-rgb), 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-2px) !important;
}

html[data-theme="light"] .btn-search:disabled {
    opacity: 0.65 !important;
    transform: none !important;
    cursor: not-allowed !important;
}

html[data-theme="light"] .btn-search:active:not(:disabled) {
    transform: translateY(0) scale(0.98) !important;
}

/* Service Cards - Layered depth, premium feel */
html[data-theme="light"] .service-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 6px rgba(26, 24, 22, 0.03), 0 8px 24px rgba(26, 24, 22, 0.06), 0 0 0 1px rgba(26, 24, 22, 0.02) !important;
    transition: box-shadow var(--transition-smooth), border-color var(--transition-smooth), transform var(--transition-smooth) !important;
}

html[data-theme="light"] .service-card::before {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-primary-dark)) !important;
}

html[data-theme="light"] .service-card:hover {
    box-shadow: 0 8px 32px rgba(26, 24, 22, 0.08), 0 16px 48px rgba(var(--accent-primary-rgb), 0.08), 0 0 0 1px rgba(var(--accent-primary-rgb), 0.15) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.2) !important;
}

/* Service type badge - softer pill */
html[data-theme="light"] .service-type {
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.15) 0%, rgba(var(--accent-primary-rgb), 0.08) 100%) !important;
    color: var(--accent-primary-dark) !important;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.3) !important;
}

/* Info items in cards */
html[data-theme="light"] .service-card .info-item {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .service-card .info-item i {
    color: var(--accent-primary) !important;
}

/* Rating stars - filled & unfilled */
html[data-theme="light"] .rating-stars,
html[data-theme="light"] .price-stars {
    color: #eab308 !important;
}

html[data-theme="light"] .rating-stars .fa-star,
html[data-theme="light"] .price-stars .fa-star {
    color: #eab308 !important;
}

html[data-theme="light"] .rating-stars .fa-star-half-alt {
    color: #eab308 !important;
}

/* Empty stars - subtle outline */
html[data-theme="light"] .rating-stars .far.fa-star,
html[data-theme="light"] .price-stars .far.fa-star {
    color: rgba(234, 179, 8, 0.4) !important;
}

/* Feature badges - cohesive soft tones */
html[data-theme="light"] .badge-online {
    background: linear-gradient(135deg, rgba(var(--accent-success-rgb), 0.15), rgba(var(--accent-success-rgb), 0.08)) !important;
    color: var(--accent-success) !important;
    border: 1px solid rgba(var(--accent-success-rgb), 0.3) !important;
}

html[data-theme="light"] .badge-onsite {
    background: linear-gradient(135deg, rgba(var(--accent-info-rgb), 0.15), rgba(var(--accent-info-rgb), 0.08)) !important;
    color: var(--accent-info) !important;
    border: 1px solid rgba(var(--accent-info-rgb), 0.3) !important;
}

html[data-theme="light"] .badge-delivery {
    background: linear-gradient(135deg, rgba(var(--accent-warning-rgb), 0.15), rgba(var(--accent-warning-rgb), 0.08)) !important;
    color: var(--accent-warning) !important;
    border: 1px solid rgba(var(--accent-warning-rgb), 0.3) !important;
}

html[data-theme="light"] .badge-available {
    background: rgba(var(--accent-success-rgb), 0.12) !important;
    color: var(--accent-success) !important;
}

html[data-theme="light"] .badge-unavailable {
    background: var(--surface-3) !important;
    color: var(--text-muted) !important;
}

/* Service pricing box */
html[data-theme="light"] .service-pricing {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-subtle) !important;
}

html[data-theme="light"] .regular-price {
    color: var(--accent-success) !important;
}

html[data-theme="light"] .original-price {
    color: var(--text-muted) !important;
}

html[data-theme="light"] .discounted-price {
    color: var(--accent-danger) !important;
}

html[data-theme="light"] .price-note {
    color: var(--text-tertiary) !important;
}

/* Service card footer & buttons */
html[data-theme="light"] .service-footer {
    border-top-color: var(--border-subtle) !important;
}

html[data-theme="light"] .btn-action {
    background: linear-gradient(135deg, var(--accent-success), #047857) !important;
    color: var(--text-on-accent) !important;
    box-shadow: 0 4px 12px rgba(var(--accent-success-rgb), 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

html[data-theme="light"] .btn-action:hover {
    box-shadow: 0 6px 20px rgba(var(--accent-success-rgb), 0.4) !important;
}

html[data-theme="light"] .btn-details {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark)) !important;
    color: var(--text-on-accent) !important;
    box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

html[data-theme="light"] .btn-details:hover {
    box-shadow: 0 6px 20px rgba(var(--accent-primary-rgb), 0.4) !important;
}

html[data-theme="light"] .btn-action:disabled,
html[data-theme="light"] .btn-details:disabled,
html[data-theme="light"] .btn-search:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Empty state */
html[data-theme="light"] .empty-state {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .empty-state i {
    color: rgba(var(--accent-primary-rgb), 0.25) !important;
}

html[data-theme="light"] .empty-state p {
    color: var(--text-muted) !important;
}

/* Badge variants in cards (hot, new, discount) */
html[data-theme="light"] .badge-hot {
    background: linear-gradient(135deg, var(--accent-danger), #b91c1c) !important;
}

html[data-theme="light"] .badge-new {
    background: linear-gradient(135deg, var(--accent-success), #047857) !important;
}

html[data-theme="light"] .discount-badge {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

/* Content area - ensure warm background */
html[data-theme="light"] .content {
    background: transparent !important;
}

/* Lists & small text in light */
html[data-theme="light"] ul, html[data-theme="light"] ol {
    color: var(--text-secondary);
}

html[data-theme="light"] small, html[data-theme="light"] .text-muted {
    color: var(--text-muted) !important;
}

/* Main container - subtle inner shadow for depth */
html[data-theme="light"] .main-container {
    background: var(--bg-secondary) !important;
}

/* Subscription cards (browse subscriptions page) */
html[data-theme="light"] .subscription-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 6px rgba(26, 24, 22, 0.03), 0 8px 24px rgba(26, 24, 22, 0.06) !important;
}

html[data-theme="light"] .subscription-card:hover {
    box-shadow: 0 8px 32px rgba(26, 24, 22, 0.08), 0 16px 48px rgba(var(--accent-primary-rgb), 0.08) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.2) !important;
}

html[data-theme="light"] .subscription-title {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .subscription-info .info-item {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .subscription-footer {
    border-top-color: var(--border-subtle) !important;
}

html[data-theme="light"] .price-badge {
    background: linear-gradient(135deg, var(--accent-success), #047857) !important;
    color: var(--text-on-accent) !important;
    box-shadow: 0 2px 6px rgba(var(--accent-success-rgb), 0.25) !important;
}

html[data-theme="light"] .btn-buy {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark)) !important;
    box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.3) !important;
}

html[data-theme="light"] .btn-buy:hover {
    box-shadow: 0 6px 20px rgba(var(--accent-primary-rgb), 0.4) !important;
}

/* Service title in cards */
html[data-theme="light"] .service-title {
    color: var(--text-primary) !important;
}

/* ============ WALLET PAGE - LIGHT THEME (تراکنش‌های اخیر و یکپارچه با تم لایت) ============ */
html[data-theme="light"] .transactions-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(26, 24, 22, 0.04), 0 8px 24px rgba(26, 24, 22, 0.06) !important;
}

html[data-theme="light"] .transactions-section .section-title {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .transactions-section .view-all-btn {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-dark) 100%) !important;
    color: var(--text-on-accent) !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(var(--accent-primary-rgb), 0.25) !important;
}

html[data-theme="light"] .transactions-section .view-all-btn:hover {
    box-shadow: 0 4px 14px rgba(var(--accent-primary-rgb), 0.35) !important;
    color: var(--text-on-accent) !important;
}

html[data-theme="light"] .filter-tab {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-input) !important;
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .filter-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark)) !important;
    color: var(--text-on-accent) !important;
    border-color: transparent !important;
}

html[data-theme="light"] .filter-tab:hover {
    border-color: var(--accent-primary) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .transaction-item {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-subtle) !important;
}

html[data-theme="light"] .transaction-item::before {
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-primary-dark)) !important;
}

html[data-theme="light"] .transaction-type {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .transaction-meta,
html[data-theme="light"] .transaction-date {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .actions-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(26, 24, 22, 0.04) !important;
}

html[data-theme="light"] .actions-section h3 {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .action-btn {
    background: var(--surface-2) !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .action-btn:hover {
    color: var(--text-primary) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.25) !important;
}

html[data-theme="light"] .action-title {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .action-desc {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .balance-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(26, 24, 22, 0.04) !important;
}

html[data-theme="light"] .balance-amount {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .balance-label {
    color: var(--text-secondary) !important;
}

/* Wallet responsive: ensure content doesn't overflow on small screens */
@media (max-width: 768px) {
    html[data-theme="light"] .main-container .content,
    .main-container .content {
        padding: 1rem !important;
    }
    .transactions-section,
    .actions-section {
        padding: 1.25rem !important;
    }
    .filter-tabs {
        gap: 0.5rem;
    }
    .filter-tab {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .balance-section {
        grid-template-columns: 1fr !important;
    }
    .actions-grid {
        grid-template-columns: 1fr !important;
    }
    .actions-grid[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
}

/* ============ RESERVATION PAGES - LIGHT THEME (الگوی صفحه جستجو) ============ */
html[data-theme="light"] .reservation-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    box-shadow: 0 2px 8px rgba(26, 24, 22, 0.04) !important;
}

html[data-theme="light"] .reservation-card:hover {
    border-color: rgba(var(--accent-primary-rgb), 0.2) !important;
    box-shadow: 0 4px 16px rgba(26, 24, 22, 0.06) !important;
}

html[data-theme="light"] .reservation-header,
html[data-theme="light"] .service-name,
html[data-theme="light"] .detail-label,
html[data-theme="light"] .detail-value {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .reservation-details,
html[data-theme="light"] .detail-item {
    color: var(--text-secondary) !important;
}

html[data-theme="light"] .pending-alert {
    background: rgba(var(--accent-warning-rgb), 0.08) !important;
    border: 1px solid rgba(var(--accent-warning-rgb), 0.25) !important;
    color: var(--text-primary) !important;
}

html[data-theme="light"] .pending-alert h4 {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .alert-btn {
    color: var(--text-on-accent) !important;
}

/* UI-003: Override legacy sharp purple/green gradients in light mode - use theme soft colors */
/* نکته: btn-action و btn-details در صفحه جستجو جدا هستند (اشتراک=سبز، سرویس=بنفش) - در این قاعده شرکت نمی‌کنند */
html[data-theme="light"] .submit-btn,
html[data-theme="light"] .btn-order,
html[data-theme="light"] .btn-buy,
html[data-theme="light"] .method-card.primary,
html[data-theme="light"] .method-recommended .method-card.primary,
html[data-theme="light"] .copy-btn,
html[data-theme="light"] .share-btn,
html[data-theme="light"] .deposit-btn,
html[data-theme="light"] .purchase-btn:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-dark) 100%) !important;
    color: var(--text-on-accent) !important;
    border-color: transparent !important;
}

html[data-theme="light"] .submit-btn:hover,
html[data-theme="light"] .btn-order:hover,
html[data-theme="light"] .btn-buy:hover,
html[data-theme="light"] .method-card.primary:hover,
html[data-theme="light"] .deposit-btn:hover,
html[data-theme="light"] .purchase-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-primary-hover) 0%, var(--accent-primary) 100%) !important;
    box-shadow: var(--shadow-button-hover) !important;
}

html[data-theme="light"] .referral-link-section,
html[data-theme="light"] .referral-link-section::before {
    background: linear-gradient(135deg, var(--accent-success) 0%, var(--accent-secondary) 100%) !important;
}

/* ============ LIGHT THEME - REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
    html[data-theme="light"] .service-card,
    html[data-theme="light"] .filters-section,
    html[data-theme="light"] .btn-search,
    html[data-theme="light"] .action-btn,
    html[data-theme="light"] .glass-card {
        transition: none !important;
    }
    html[data-theme="light"] .service-card:hover {
        transform: none !important;
    }
    html[data-theme="light"] .btn-search:hover {
        transform: none !important;
    }
}

/* ============ END THEME SYSTEM ============ */
