/* =====================================================
   MUNDUSCODE CRM - 10 UNIQUE THEMES
   ===================================================== */

/* =====================================================
   THEME 1: CYBER PURPLE (Default)
   ===================================================== */
body.theme-cyber-purple,
body.theme-cyber-purple-dark {
    --theme-primary: #a855f7;
    --theme-primary-light: #c084fc;
    --theme-primary-dark: #7c3aed;
    --theme-gradient-start: rgba(168, 85, 247, 0.4);
    --theme-gradient-mid: rgba(124, 58, 237, 0.3);
    --theme-gradient-end: rgba(139, 92, 246, 0.3);
    --theme-bg-dark: #0f0820;
    --theme-bg-mid: #1a0f2e;
    --theme-bg-light: #24184a;
    --theme-accent: #ec4899;
}

/* =====================================================
   THEME 2: OCEAN BLUE
   ===================================================== */
body.theme-ocean-blue,
body.theme-ocean-blue-dark {
    --theme-primary: #3b82f6;
    --theme-primary-light: #60a5fa;
    --theme-primary-dark: #2563eb;
    --theme-gradient-start: rgba(59, 130, 246, 0.4);
    --theme-gradient-mid: rgba(37, 99, 235, 0.3);
    --theme-gradient-end: rgba(96, 165, 250, 0.3);
    --theme-bg-dark: #0a1628;
    --theme-bg-mid: #0f1f3d;
    --theme-bg-light: #162850;
    --theme-accent: #06b6d4;
}

body.theme-ocean-blue::before,
body.theme-ocean-blue-dark::before {
    background:
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(37, 99, 235, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 60% 70%, rgba(96, 165, 250, 0.3) 0%, transparent 50%) !important;
}

body.theme-ocean-blue::after,
body.theme-ocean-blue-dark::after {
    background: linear-gradient(135deg,
        rgba(10, 22, 40, 0.95) 0%,
        rgba(15, 31, 61, 0.95) 50%,
        rgba(22, 40, 80, 0.95) 100%) !important;
}

/* =====================================================
   THEME 3: EMERALD GREEN
   ===================================================== */
body.theme-emerald-green,
body.theme-emerald-green-dark {
    --theme-primary: #10b981;
    --theme-primary-light: #34d399;
    --theme-primary-dark: #059669;
    --theme-gradient-start: rgba(16, 185, 129, 0.4);
    --theme-gradient-mid: rgba(5, 150, 105, 0.3);
    --theme-gradient-end: rgba(52, 211, 153, 0.3);
    --theme-bg-dark: #052e1a;
    --theme-bg-mid: #0a3d24;
    --theme-bg-light: #115e38;
    --theme-accent: #84cc16;
}

body.theme-emerald-green::before,
body.theme-emerald-green-dark::before {
    background:
        radial-gradient(circle at 20% 50%, rgba(16, 185, 129, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(132, 204, 22, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(5, 150, 105, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 60% 70%, rgba(52, 211, 153, 0.3) 0%, transparent 50%) !important;
}

body.theme-emerald-green::after,
body.theme-emerald-green-dark::after {
    background: linear-gradient(135deg,
        rgba(5, 46, 26, 0.95) 0%,
        rgba(10, 61, 36, 0.95) 50%,
        rgba(17, 94, 56, 0.95) 100%) !important;
}

/* =====================================================
   THEME 4: SUNSET ORANGE
   ===================================================== */
body.theme-sunset-orange,
body.theme-sunset-orange-dark {
    --theme-primary: #f97316;
    --theme-primary-light: #fb923c;
    --theme-primary-dark: #ea580c;
    --theme-gradient-start: rgba(249, 115, 22, 0.4);
    --theme-gradient-mid: rgba(234, 88, 12, 0.3);
    --theme-gradient-end: rgba(251, 146, 60, 0.3);
    --theme-bg-dark: #1a0f05;
    --theme-bg-mid: #2d1a0a;
    --theme-bg-light: #3d2410;
    --theme-accent: #fbbf24;
}

body.theme-sunset-orange::before,
body.theme-sunset-orange-dark::before {
    background:
        radial-gradient(circle at 20% 50%, rgba(249, 115, 22, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(251, 191, 36, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(234, 88, 12, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 60% 70%, rgba(251, 146, 60, 0.3) 0%, transparent 50%) !important;
}

body.theme-sunset-orange::after,
body.theme-sunset-orange-dark::after {
    background: linear-gradient(135deg,
        rgba(26, 15, 5, 0.95) 0%,
        rgba(45, 26, 10, 0.95) 50%,
        rgba(61, 36, 16, 0.95) 100%) !important;
}

/* =====================================================
   THEME 5: CRIMSON RED
   ===================================================== */
body.theme-crimson-red,
body.theme-crimson-red-dark {
    --theme-primary: #ef4444;
    --theme-primary-light: #f87171;
    --theme-primary-dark: #dc2626;
    --theme-gradient-start: rgba(239, 68, 68, 0.4);
    --theme-gradient-mid: rgba(220, 38, 38, 0.3);
    --theme-gradient-end: rgba(248, 113, 113, 0.3);
    --theme-bg-dark: #1a0808;
    --theme-bg-mid: #2d0f0f;
    --theme-bg-light: #3d1515;
    --theme-accent: #f43f5e;
}

body.theme-crimson-red::before,
body.theme-crimson-red-dark::before {
    background:
        radial-gradient(circle at 20% 50%, rgba(239, 68, 68, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(244, 63, 94, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(220, 38, 38, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 60% 70%, rgba(248, 113, 113, 0.3) 0%, transparent 50%) !important;
}

body.theme-crimson-red::after,
body.theme-crimson-red-dark::after {
    background: linear-gradient(135deg,
        rgba(26, 8, 8, 0.95) 0%,
        rgba(45, 15, 15, 0.95) 50%,
        rgba(61, 21, 21, 0.95) 100%) !important;
}

/* =====================================================
   THEME 6: GOLD LUXURY
   ===================================================== */
body.theme-gold-luxury,
body.theme-gold-luxury-dark {
    --theme-primary: #eab308;
    --theme-primary-light: #facc15;
    --theme-primary-dark: #ca8a04;
    --theme-gradient-start: rgba(234, 179, 8, 0.4);
    --theme-gradient-mid: rgba(202, 138, 4, 0.3);
    --theme-gradient-end: rgba(250, 204, 21, 0.3);
    --theme-bg-dark: #1a1505;
    --theme-bg-mid: #2d2408;
    --theme-bg-light: #3d310c;
    --theme-accent: #d97706;
}

body.theme-gold-luxury::before,
body.theme-gold-luxury-dark::before {
    background:
        radial-gradient(circle at 20% 50%, rgba(234, 179, 8, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(217, 119, 6, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(202, 138, 4, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 60% 70%, rgba(250, 204, 21, 0.3) 0%, transparent 50%) !important;
}

body.theme-gold-luxury::after,
body.theme-gold-luxury-dark::after {
    background: linear-gradient(135deg,
        rgba(26, 21, 5, 0.95) 0%,
        rgba(45, 36, 8, 0.95) 50%,
        rgba(61, 49, 12, 0.95) 100%) !important;
}

/* =====================================================
   THEME 7: ROSE PINK
   ===================================================== */
body.theme-rose-pink,
body.theme-rose-pink-dark {
    --theme-primary: #ec4899;
    --theme-primary-light: #f472b6;
    --theme-primary-dark: #db2777;
    --theme-gradient-start: rgba(236, 72, 153, 0.4);
    --theme-gradient-mid: rgba(219, 39, 119, 0.3);
    --theme-gradient-end: rgba(244, 114, 182, 0.3);
    --theme-bg-dark: #1a0812;
    --theme-bg-mid: #2d0f1e;
    --theme-bg-light: #3d1528;
    --theme-accent: #a855f7;
}

body.theme-rose-pink::before,
body.theme-rose-pink-dark::before {
    background:
        radial-gradient(circle at 20% 50%, rgba(236, 72, 153, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(219, 39, 119, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 60% 70%, rgba(244, 114, 182, 0.3) 0%, transparent 50%) !important;
}

body.theme-rose-pink::after,
body.theme-rose-pink-dark::after {
    background: linear-gradient(135deg,
        rgba(26, 8, 18, 0.95) 0%,
        rgba(45, 15, 30, 0.95) 50%,
        rgba(61, 21, 40, 0.95) 100%) !important;
}

/* =====================================================
   THEME 8: TEAL MINT
   ===================================================== */
body.theme-teal-mint,
body.theme-teal-mint-dark {
    --theme-primary: #14b8a6;
    --theme-primary-light: #2dd4bf;
    --theme-primary-dark: #0d9488;
    --theme-gradient-start: rgba(20, 184, 166, 0.4);
    --theme-gradient-mid: rgba(13, 148, 136, 0.3);
    --theme-gradient-end: rgba(45, 212, 191, 0.3);
    --theme-bg-dark: #05201c;
    --theme-bg-mid: #0a3029;
    --theme-bg-light: #104038;
    --theme-accent: #22d3ee;
}

body.theme-teal-mint::before,
body.theme-teal-mint-dark::before {
    background:
        radial-gradient(circle at 20% 50%, rgba(20, 184, 166, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(34, 211, 238, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(13, 148, 136, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 60% 70%, rgba(45, 212, 191, 0.3) 0%, transparent 50%) !important;
}

body.theme-teal-mint::after,
body.theme-teal-mint-dark::after {
    background: linear-gradient(135deg,
        rgba(5, 32, 28, 0.95) 0%,
        rgba(10, 48, 41, 0.95) 50%,
        rgba(16, 64, 56, 0.95) 100%) !important;
}

/* =====================================================
   THEME 9: INDIGO NIGHT
   ===================================================== */
body.theme-indigo-night,
body.theme-indigo-night-dark {
    --theme-primary: #6366f1;
    --theme-primary-light: #818cf8;
    --theme-primary-dark: #4f46e5;
    --theme-gradient-start: rgba(99, 102, 241, 0.4);
    --theme-gradient-mid: rgba(79, 70, 229, 0.3);
    --theme-gradient-end: rgba(129, 140, 248, 0.3);
    --theme-bg-dark: #0a0a1a;
    --theme-bg-mid: #12122d;
    --theme-bg-light: #1a1a40;
    --theme-accent: #a5b4fc;
}

body.theme-indigo-night::before,
body.theme-indigo-night-dark::before {
    background:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(165, 180, 252, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(79, 70, 229, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 60% 70%, rgba(129, 140, 248, 0.3) 0%, transparent 50%) !important;
}

body.theme-indigo-night::after,
body.theme-indigo-night-dark::after {
    background: linear-gradient(135deg,
        rgba(10, 10, 26, 0.95) 0%,
        rgba(18, 18, 45, 0.95) 50%,
        rgba(26, 26, 64, 0.95) 100%) !important;
}

/* =====================================================
   THEME 10: SLATE MODERN
   ===================================================== */
body.theme-slate-modern,
body.theme-slate-modern-dark {
    --theme-primary: #64748b;
    --theme-primary-light: #94a3b8;
    --theme-primary-dark: #475569;
    --theme-gradient-start: rgba(100, 116, 139, 0.4);
    --theme-gradient-mid: rgba(71, 85, 105, 0.3);
    --theme-gradient-end: rgba(148, 163, 184, 0.3);
    --theme-bg-dark: #0f172a;
    --theme-bg-mid: #1e293b;
    --theme-bg-light: #334155;
    --theme-accent: #38bdf8;
}

body.theme-slate-modern::before,
body.theme-slate-modern-dark::before {
    background:
        radial-gradient(circle at 20% 50%, rgba(100, 116, 139, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(71, 85, 105, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 60% 70%, rgba(148, 163, 184, 0.2) 0%, transparent 50%) !important;
}

body.theme-slate-modern::after,
body.theme-slate-modern-dark::after {
    background: linear-gradient(135deg,
        rgba(15, 23, 42, 0.95) 0%,
        rgba(30, 41, 59, 0.95) 50%,
        rgba(51, 65, 85, 0.95) 100%) !important;
}

/* =====================================================
   APPLY THEME COLORS TO UI ELEMENTS
   ===================================================== */

/* Sidebar styling per theme */
body[class*="theme-"]::before {
    content: '' !important;
    position: fixed !important;
    top: -50% !important;
    left: -50% !important;
    width: 200% !important;
    height: 200% !important;
    z-index: -2 !important;
    animation: plasma-move 20s ease-in-out infinite !important;
}

body[class*="theme-"]::after {
    content: '' !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: -1 !important;
    backdrop-filter: blur(100px) !important;
}

/* Theme-aware sidebar */
body[class*="theme-"] .sidebar {
    background: linear-gradient(180deg,
        var(--theme-bg-mid, rgba(26, 15, 46, 0.95)) 0%,
        var(--theme-bg-light, rgba(36, 24, 74, 0.95)) 100%) !important;
    border-right: 2px solid rgba(var(--theme-primary), 0.4) !important;
}

body[class*="theme-"] .sidebar-logo {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--theme-primary) 30%, transparent) 0%,
        color-mix(in srgb, var(--theme-primary-dark) 30%, transparent) 100%) !important;
    border-bottom: 2px solid color-mix(in srgb, var(--theme-primary) 40%, transparent) !important;
}

body[class*="theme-"] .sidebar-logo h1 {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-accent) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Nav links */
body[class*="theme-"] .nav-link.active {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-light) 100%) !important;
}

body[class*="theme-"] .nav-link:hover {
    background: color-mix(in srgb, var(--theme-primary) 20%, transparent) !important;
    border-color: color-mix(in srgb, var(--theme-primary) 40%, transparent) !important;
}

/* Buttons */
body[class*="theme-"] .btn-primary {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-light) 100%) !important;
    border-color: var(--theme-primary-light) !important;
}

body[class*="theme-"] .btn-primary:hover {
    box-shadow:
        0 6px 25px color-mix(in srgb, var(--theme-primary) 60%, transparent),
        0 0 40px color-mix(in srgb, var(--theme-primary) 50%, transparent) !important;
}

body[class*="theme-"] .btn-secondary {
    background: color-mix(in srgb, var(--theme-primary) 20%, transparent) !important;
    border-color: color-mix(in srgb, var(--theme-primary) 50%, transparent) !important;
}

body[class*="theme-"] .btn-secondary:hover {
    background: color-mix(in srgb, var(--theme-primary) 30%, transparent) !important;
    border-color: color-mix(in srgb, var(--theme-primary) 80%, transparent) !important;
}

/* Cards */
body[class*="theme-"] .card,
body[class*="theme-"] .stat-card,
body[class*="theme-"] .detail-card {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--theme-primary) 15%, transparent) 0%,
        color-mix(in srgb, var(--theme-primary-dark) 10%, transparent) 100%) !important;
    border: 1px solid color-mix(in srgb, var(--theme-primary) 40%, transparent) !important;
}

body[class*="theme-"] .card:hover,
body[class*="theme-"] .stat-card:hover {
    border-color: color-mix(in srgb, var(--theme-primary) 80%, transparent) !important;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 30px color-mix(in srgb, var(--theme-primary) 40%, transparent) !important;
}

/* Form controls */
body[class*="theme-"] .form-control,
body[class*="theme-"] input,
body[class*="theme-"] textarea,
body[class*="theme-"] select {
    background: color-mix(in srgb, var(--theme-primary) 10%, transparent) !important;
    border: 2px solid color-mix(in srgb, var(--theme-primary) 30%, transparent) !important;
}

body[class*="theme-"] .form-control:focus,
body[class*="theme-"] input:focus,
body[class*="theme-"] textarea:focus,
body[class*="theme-"] select:focus {
    border-color: color-mix(in srgb, var(--theme-primary) 80%, transparent) !important;
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--theme-primary) 20%, transparent),
        0 0 20px color-mix(in srgb, var(--theme-primary) 40%, transparent) !important;
}

/* Page header */
body[class*="theme-"] .page-header {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--theme-primary) 20%, transparent) 0%,
        color-mix(in srgb, var(--theme-primary-dark) 10%, transparent) 100%) !important;
    border: 1px solid color-mix(in srgb, var(--theme-primary) 40%, transparent) !important;
}

/* Scrollbar */
body[class*="theme-"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--theme-primary) 0%, var(--theme-primary-light) 100%) !important;
}

/* Badge primary */
body[class*="theme-"] .badge-primary {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-light) 100%) !important;
    border-color: var(--theme-primary-light) !important;
}

/* Links */
body[class*="theme-"] a {
    color: var(--theme-primary-light) !important;
}

body[class*="theme-"] a:hover {
    color: var(--theme-primary) !important;
}

/* =====================================================
   THEME 11: CORPORATE LIGHT (White Modern Theme)
   ===================================================== */
body.theme-corporate-light,
body.theme-corporate-light-dark {
    --theme-primary: #3b82f6 !important;
    --theme-primary-light: #60a5fa !important;
    --theme-primary-dark: #2563eb !important;
    --theme-gradient-start: rgba(59, 130, 246, 0.1) !important;
    --theme-gradient-mid: rgba(37, 99, 235, 0.05) !important;
    --theme-gradient-end: rgba(96, 165, 250, 0.1) !important;
    --theme-bg-dark: #f8fafc !important;
    --theme-bg-mid: #ffffff !important;
    --theme-bg-light: #f1f5f9 !important;
    --theme-accent: #0ea5e9 !important;

    /* CRITICAL: Override all dark theme variables */
    --bg-primary: #f8fafc !important;
    --bg-secondary: #ffffff !important;
    --bg-tertiary: #f1f5f9 !important;
    --bg-elevated: #ffffff !important;
    --bg-card: #ffffff !important;

    --text-primary: #1e293b !important;
    --text-secondary: #475569 !important;
    --text-tertiary: #64748b !important;
    --text-disabled: #94a3b8 !important;

    --border-color: #e2e8f0 !important;
    --border: #e2e8f0 !important;

    /* Override purple color variables used in dark themes */
    --purple-500: #3b82f6 !important;
    --purple-700: #1d4ed8 !important;
    --primary-purple: #3b82f6 !important;
    --light-primary: #3b82f6 !important;
    --light-primary-dark: #2563eb !important;
    --color-primary: #3b82f6 !important;

    /* Override success/warning/etc colors for light backgrounds */
    --color-success: #10b981 !important;
    --color-warning: #f59e0b !important;
    --color-danger: #ef4444 !important;
    --color-info: #3b82f6 !important;
}

body.theme-corporate-light::before,
body.theme-corporate-light-dark::before {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
}

body.theme-corporate-light::after,
body.theme-corporate-light-dark::after {
    background: transparent !important;
}

/* Light theme specific styling */
body.theme-corporate-light .sidebar,
body.theme-corporate-light-dark .sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border-right: 1px solid #e2e8f0 !important;
}

body.theme-corporate-light .sidebar-logo,
body.theme-corporate-light-dark .sidebar-logo {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%) !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.theme-corporate-light .sidebar-logo h1,
body.theme-corporate-light-dark .sidebar-logo h1 {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

body.theme-corporate-light .nav-link,
body.theme-corporate-light-dark .nav-link {
    color: #475569 !important;
}

body.theme-corporate-light .nav-link:hover,
body.theme-corporate-light-dark .nav-link:hover {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #3b82f6 !important;
}

body.theme-corporate-light .nav-link.active,
body.theme-corporate-light-dark .nav-link.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;
}

body.theme-corporate-light .nav-section-title,
body.theme-corporate-light-dark .nav-section-title {
    color: #94a3b8 !important;
}

body.theme-corporate-light .topbar,
body.theme-corporate-light-dark .topbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.theme-corporate-light .page-content,
body.theme-corporate-light-dark .page-content {
    background: #f8fafc !important;
}

body.theme-corporate-light .card,
body.theme-corporate-light .stat-card,
body.theme-corporate-light .detail-card,
body.theme-corporate-light-dark .card,
body.theme-corporate-light-dark .stat-card,
body.theme-corporate-light-dark .detail-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

body.theme-corporate-light .form-control,
body.theme-corporate-light input,
body.theme-corporate-light textarea,
body.theme-corporate-light select,
body.theme-corporate-light-dark .form-control,
body.theme-corporate-light-dark input,
body.theme-corporate-light-dark textarea,
body.theme-corporate-light-dark select {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
}

body.theme-corporate-light .form-control:focus,
body.theme-corporate-light input:focus,
body.theme-corporate-light textarea:focus,
body.theme-corporate-light select:focus,
body.theme-corporate-light-dark .form-control:focus,
body.theme-corporate-light-dark input:focus,
body.theme-corporate-light-dark textarea:focus,
body.theme-corporate-light-dark select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Select dropdown options for corporate light theme */
body.theme-corporate-light select option,
body.theme-corporate-light-dark select option {
    background: #ffffff !important;
    color: #1e293b !important;
    padding: 10px !important;
}

body.theme-corporate-light .page-header,
body.theme-corporate-light-dark .page-header {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.theme-corporate-light .page-header h1,
body.theme-corporate-light-dark .page-header h1 {
    color: #1e293b !important;
}

body.theme-corporate-light a,
body.theme-corporate-light-dark a {
    color: #3b82f6 !important;
}

body.theme-corporate-light .stat-value,
body.theme-corporate-light-dark .stat-value {
    color: #1e293b !important;
}

body.theme-corporate-light .stat-label,
body.theme-corporate-light-dark .stat-label {
    color: #64748b !important;
}

body.theme-corporate-light .table,
body.theme-corporate-light-dark .table {
    background: #ffffff !important;
}

body.theme-corporate-light .table th,
body.theme-corporate-light-dark .table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}

body.theme-corporate-light .table td,
body.theme-corporate-light-dark .table td {
    color: #1e293b !important;
    border-color: #e2e8f0 !important;
}

body.theme-corporate-light .table tr:hover,
body.theme-corporate-light-dark .table tr:hover {
    background: #f8fafc !important;
}

/* Corporate Light - Fix ALL text colors */
body.theme-corporate-light,
body.theme-corporate-light-dark {
    color: #1e293b !important;
}

body.theme-corporate-light *,
body.theme-corporate-light-dark * {
    color: inherit;
}

body.theme-corporate-light h1,
body.theme-corporate-light h2,
body.theme-corporate-light h3,
body.theme-corporate-light h4,
body.theme-corporate-light h5,
body.theme-corporate-light h6,
body.theme-corporate-light-dark h1,
body.theme-corporate-light-dark h2,
body.theme-corporate-light-dark h3,
body.theme-corporate-light-dark h4,
body.theme-corporate-light-dark h5,
body.theme-corporate-light-dark h6 {
    color: #1e293b !important;
}

body.theme-corporate-light p,
body.theme-corporate-light span,
body.theme-corporate-light div,
body.theme-corporate-light label,
body.theme-corporate-light-dark p,
body.theme-corporate-light-dark span,
body.theme-corporate-light-dark div,
body.theme-corporate-light-dark label {
    color: #1e293b !important;
}

body.theme-corporate-light .text-secondary,
body.theme-corporate-light .subtitle,
body.theme-corporate-light-dark .text-secondary,
body.theme-corporate-light-dark .subtitle {
    color: #64748b !important;
}

body.theme-corporate-light .btn,
body.theme-corporate-light-dark .btn {
    color: #ffffff !important;
}

body.theme-corporate-light .btn-secondary,
body.theme-corporate-light-dark .btn-secondary {
    color: #1e293b !important;
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
}

body.theme-corporate-light .btn-primary,
body.theme-corporate-light-dark .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;
}

body.theme-corporate-light .badge,
body.theme-corporate-light-dark .badge {
    color: #ffffff !important;
}

body.theme-corporate-light .badge-secondary,
body.theme-corporate-light-dark .badge-secondary {
    background: #64748b !important;
}

body.theme-corporate-light .badge-success,
body.theme-corporate-light-dark .badge-success {
    background: #10b981 !important;
}

body.theme-corporate-light .badge-warning,
body.theme-corporate-light-dark .badge-warning {
    background: #f59e0b !important;
}

body.theme-corporate-light .badge-danger,
body.theme-corporate-light-dark .badge-danger {
    background: #ef4444 !important;
}

body.theme-corporate-light .badge-info,
body.theme-corporate-light-dark .badge-info {
    background: #3b82f6 !important;
}

/* Corporate Light - Main content area */
body.theme-corporate-light .main-content,
body.theme-corporate-light-dark .main-content {
    background: #f8fafc !important;
}

/* Corporate Light - Cards and containers */
body.theme-corporate-light .meeting-card,
body.theme-corporate-light .filters-bar,
body.theme-corporate-light .meetings-container,
body.theme-corporate-light-dark .meeting-card,
body.theme-corporate-light-dark .filters-bar,
body.theme-corporate-light-dark .meetings-container {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.theme-corporate-light .meeting-header h3 a,
body.theme-corporate-light-dark .meeting-header h3 a {
    color: #1e293b !important;
}

body.theme-corporate-light .meeting-meta,
body.theme-corporate-light .meeting-summary,
body.theme-corporate-light .meeting-attendees,
body.theme-corporate-light-dark .meeting-meta,
body.theme-corporate-light-dark .meeting-summary,
body.theme-corporate-light-dark .meeting-attendees {
    color: #64748b !important;
}

body.theme-corporate-light .attendee,
body.theme-corporate-light-dark .attendee {
    background: #f1f5f9 !important;
    color: #475569 !important;
}

body.theme-corporate-light .keyword-tag,
body.theme-corporate-light-dark .keyword-tag {
    background: #3b82f6 !important;
    color: #ffffff !important;
}

/* Corporate Light - Filter labels */
body.theme-corporate-light .filter-group label,
body.theme-corporate-light-dark .filter-group label {
    color: #475569 !important;
}

/* Corporate Light - Icons */
body.theme-corporate-light .fas,
body.theme-corporate-light .far,
body.theme-corporate-light .fab,
body.theme-corporate-light i,
body.theme-corporate-light-dark .fas,
body.theme-corporate-light-dark .far,
body.theme-corporate-light-dark .fab,
body.theme-corporate-light-dark i {
    color: inherit !important;
}

body.theme-corporate-light .stat-icon,
body.theme-corporate-light-dark .stat-icon {
    color: #ffffff !important;
}

body.theme-corporate-light .nav-link i,
body.theme-corporate-light-dark .nav-link i {
    color: inherit !important;
}

/* Corporate Light - User menu and dropdowns */
body.theme-corporate-light .user-menu,
body.theme-corporate-light-dark .user-menu {
    color: #1e293b !important;
}

body.theme-corporate-light .user-name,
body.theme-corporate-light-dark .user-name {
    color: #1e293b !important;
}

body.theme-corporate-light .user-role,
body.theme-corporate-light-dark .user-role {
    color: #64748b !important;
}

body.theme-corporate-light .user-avatar,
body.theme-corporate-light-dark .user-avatar {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;
}

/* Corporate Light - Topbar search */
body.theme-corporate-light .topbar-search input,
body.theme-corporate-light-dark .topbar-search input {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
}

body.theme-corporate-light .topbar-search input::placeholder,
body.theme-corporate-light-dark .topbar-search input::placeholder {
    color: #94a3b8 !important;
}

body.theme-corporate-light .topbar-icon,
body.theme-corporate-light-dark .topbar-icon {
    color: #64748b !important;
}

/* Corporate Light - Empty state */
body.theme-corporate-light .empty-state,
body.theme-corporate-light-dark .empty-state {
    color: #64748b !important;
}

body.theme-corporate-light .empty-state i,
body.theme-corporate-light-dark .empty-state i {
    color: #cbd5e1 !important;
}

/* Corporate Light - Modals */
body.theme-corporate-light .modal-content,
body.theme-corporate-light-dark .modal-content {
    background: #ffffff !important;
    color: #1e293b !important;
}

body.theme-corporate-light .modal-header,
body.theme-corporate-light-dark .modal-header {
    border-color: #e2e8f0 !important;
}

body.theme-corporate-light .modal-header h2,
body.theme-corporate-light .modal-header h3,
body.theme-corporate-light-dark .modal-header h2,
body.theme-corporate-light-dark .modal-header h3 {
    color: #1e293b !important;
}

/* Corporate Light - Alerts */
body.theme-corporate-light .alert,
body.theme-corporate-light-dark .alert {
    color: #1e293b !important;
}

/* Theme Selector Override - ensure dropdown is always readable */
#themeSelector,
#themeSelector option {
    background: #1a1b2e !important;
    color: #ffffff !important;
    border-color: rgba(168, 85, 247, 0.3) !important;
}

/* User dropdown should not have theme link colors */
.user-dropdown a {
    color: #ffffff !important;
}

.user-dropdown a:hover {
    color: #ffffff !important;
}

/* =====================================================
   CORPORATE LIGHT - COMPREHENSIVE TEXT OVERRIDES
   ===================================================== */

/* Dashboard stat cards - all text must be dark */
body.theme-corporate-light .stat-card,
body.theme-corporate-light-dark .stat-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.theme-corporate-light .stat-card *,
body.theme-corporate-light-dark .stat-card * {
    color: #1e293b !important;
}

body.theme-corporate-light .stat-card .stat-icon,
body.theme-corporate-light-dark .stat-card .stat-icon {
    color: #ffffff !important;
}

body.theme-corporate-light .stat-card .stat-icon i,
body.theme-corporate-light-dark .stat-card .stat-icon i {
    color: #ffffff !important;
}

/* Stats grid items */
body.theme-corporate-light .stats-grid .stat-card,
body.theme-corporate-light-dark .stats-grid .stat-card {
    background: #ffffff !important;
}

body.theme-corporate-light .stats-grid .stat-value,
body.theme-corporate-light-dark .stats-grid .stat-value {
    color: #1e293b !important;
}

body.theme-corporate-light .stats-grid .stat-label,
body.theme-corporate-light-dark .stats-grid .stat-label {
    color: #64748b !important;
}

/* Dashboard card bodies */
body.theme-corporate-light .card,
body.theme-corporate-light-dark .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.theme-corporate-light .card *,
body.theme-corporate-light-dark .card * {
    color: #1e293b !important;
}

body.theme-corporate-light .card .btn,
body.theme-corporate-light-dark .card .btn {
    color: #ffffff !important;
}

body.theme-corporate-light .card .btn-secondary,
body.theme-corporate-light-dark .card .btn-secondary {
    color: #1e293b !important;
}

body.theme-corporate-light .card .btn-outline-primary,
body.theme-corporate-light-dark .card .btn-outline-primary {
    color: #3b82f6 !important;
    background: transparent !important;
    border-color: #3b82f6 !important;
}

body.theme-corporate-light .card-header,
body.theme-corporate-light-dark .card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.theme-corporate-light .card-header *,
body.theme-corporate-light-dark .card-header * {
    color: #1e293b !important;
}

body.theme-corporate-light .card-title,
body.theme-corporate-light-dark .card-title {
    color: #1e293b !important;
}

body.theme-corporate-light .card-title i,
body.theme-corporate-light-dark .card-title i {
    color: #3b82f6 !important;
}

body.theme-corporate-light .card-body,
body.theme-corporate-light-dark .card-body {
    background: #ffffff !important;
}

/* Quick tasks widget */
body.theme-corporate-light #quick-tasks-widget,
body.theme-corporate-light-dark #quick-tasks-widget {
    background: #ffffff !important;
    border-color: #3b82f6 !important;
}

body.theme-corporate-light #quick-tasks-widget *,
body.theme-corporate-light-dark #quick-tasks-widget * {
    color: #1e293b !important;
}

body.theme-corporate-light .quick-add-form,
body.theme-corporate-light-dark .quick-add-form {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.theme-corporate-light .task-item,
body.theme-corporate-light-dark .task-item {
    background: #f8fafc !important;
}

body.theme-corporate-light .task-item *,
body.theme-corporate-light-dark .task-item * {
    color: #1e293b !important;
}

/* Inline styles with div for stat cards on dashboard */
body.theme-corporate-light div[style*="font-size: 1.75rem"],
body.theme-corporate-light-dark div[style*="font-size: 1.75rem"] {
    color: #1e293b !important;
}

body.theme-corporate-light div[style*="font-size: 0.875rem; opacity: 0.7"],
body.theme-corporate-light-dark div[style*="font-size: 0.875rem; opacity: 0.7"] {
    color: #64748b !important;
    opacity: 1 !important;
}

/* Page subtitle */
body.theme-corporate-light .page-subtitle,
body.theme-corporate-light-dark .page-subtitle {
    color: #64748b !important;
}

/* Task cards */
body.theme-corporate-light div[style*="padding: 1rem; border-radius"],
body.theme-corporate-light-dark div[style*="padding: 1rem; border-radius"] {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.theme-corporate-light div[style*="padding: 1rem; border-radius"] *,
body.theme-corporate-light-dark div[style*="padding: 1rem; border-radius"] * {
    color: #1e293b !important;
}

/* Upcoming deadlines */
body.theme-corporate-light div[style*="padding: 1rem; border-radius: var(--border-radius); background-color"],
body.theme-corporate-light-dark div[style*="padding: 1rem; border-radius: var(--border-radius); background-color"] {
    background-color: rgba(59, 130, 246, 0.05) !important;
}

/* Canvas chart container text */
body.theme-corporate-light canvas,
body.theme-corporate-light-dark canvas {
    filter: none !important;
}

/* Table content */
body.theme-corporate-light .table tbody,
body.theme-corporate-light .table tbody tr,
body.theme-corporate-light .table tbody td,
body.theme-corporate-light-dark .table tbody,
body.theme-corporate-light-dark .table tbody tr,
body.theme-corporate-light-dark .table tbody td {
    background: #ffffff !important;
    color: #1e293b !important;
}

body.theme-corporate-light .table strong,
body.theme-corporate-light-dark .table strong {
    color: #1e293b !important;
}

/* Override opacity styles */
body.theme-corporate-light [style*="opacity: 0.7"],
body.theme-corporate-light-dark [style*="opacity: 0.7"] {
    opacity: 1 !important;
    color: #64748b !important;
}

body.theme-corporate-light [style*="opacity: 0.3"],
body.theme-corporate-light-dark [style*="opacity: 0.3"] {
    opacity: 0.5 !important;
}

/* Ensure icon colors in stat cards with gradients stay white */
body.theme-corporate-light div[style*="background: linear-gradient"] i,
body.theme-corporate-light-dark div[style*="background: linear-gradient"] i {
    color: #ffffff !important;
}

/* Secondary/tertiary text colors */
body.theme-corporate-light .text-tertiary,
body.theme-corporate-light-dark .text-tertiary {
    color: #94a3b8 !important;
}

body.theme-corporate-light .text-muted,
body.theme-corporate-light-dark .text-muted {
    color: #94a3b8 !important;
}

/* Fix all divs that might inherit white */
body.theme-corporate-light .main-content div,
body.theme-corporate-light .main-content span,
body.theme-corporate-light .main-content p,
body.theme-corporate-light .main-content h1,
body.theme-corporate-light .main-content h2,
body.theme-corporate-light .main-content h3,
body.theme-corporate-light .main-content h4,
body.theme-corporate-light .main-content h5,
body.theme-corporate-light .main-content h6,
body.theme-corporate-light-dark .main-content div,
body.theme-corporate-light-dark .main-content span,
body.theme-corporate-light-dark .main-content p,
body.theme-corporate-light-dark .main-content h1,
body.theme-corporate-light-dark .main-content h2,
body.theme-corporate-light-dark .main-content h3,
body.theme-corporate-light-dark .main-content h4,
body.theme-corporate-light-dark .main-content h5,
body.theme-corporate-light-dark .main-content h6 {
    color: #1e293b !important;
}

/* Preserve button text colors */
body.theme-corporate-light .main-content .btn-primary,
body.theme-corporate-light .main-content .btn-success,
body.theme-corporate-light .main-content .btn-danger,
body.theme-corporate-light .main-content .btn-warning,
body.theme-corporate-light .main-content .btn-info,
body.theme-corporate-light-dark .main-content .btn-primary,
body.theme-corporate-light-dark .main-content .btn-success,
body.theme-corporate-light-dark .main-content .btn-danger,
body.theme-corporate-light-dark .main-content .btn-warning,
body.theme-corporate-light-dark .main-content .btn-info {
    color: #ffffff !important;
}

/* Preserve badge text colors */
body.theme-corporate-light .main-content .badge,
body.theme-corporate-light-dark .main-content .badge {
    color: #ffffff !important;
}

/* Links should be blue */
body.theme-corporate-light .main-content a:not(.btn),
body.theme-corporate-light-dark .main-content a:not(.btn) {
    color: #3b82f6 !important;
}

/* Gradient icon backgrounds keep white text */
body.theme-corporate-light .main-content div[style*="background: linear-gradient"] *,
body.theme-corporate-light-dark .main-content div[style*="background: linear-gradient"] * {
    color: #ffffff !important;
}

/* Form labels */
body.theme-corporate-light .form-label,
body.theme-corporate-light label,
body.theme-corporate-light-dark .form-label,
body.theme-corporate-light-dark label {
    color: #475569 !important;
}

/* Scrollbar for light theme */
body.theme-corporate-light ::-webkit-scrollbar-track,
body.theme-corporate-light-dark ::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
}

body.theme-corporate-light ::-webkit-scrollbar-thumb,
body.theme-corporate-light-dark ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%) !important;
}

/* Card footer */
body.theme-corporate-light .card-footer,
body.theme-corporate-light-dark .card-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

/* =====================================================
   TOPBAR ICONS - IMPROVED VISIBILITY
   ===================================================== */

/* Make topbar icons more visible across all themes */
.topbar-icon {
    background: rgba(115, 103, 240, 0.15) !important;
    border: 1px solid rgba(115, 103, 240, 0.3) !important;
}

.topbar-icon i {
    color: #a78bfa !important;
    font-size: 1.1rem !important;
}

.topbar-icon:hover {
    background: rgba(115, 103, 240, 0.25) !important;
    border-color: rgba(115, 103, 240, 0.5) !important;
}

.topbar-icon:hover i {
    color: #c4b5fd !important;
}

/* Corporate Light theme - darker icons */
body.theme-corporate-light .topbar-icon,
body.theme-corporate-light-dark .topbar-icon {
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

body.theme-corporate-light .topbar-icon i,
body.theme-corporate-light-dark .topbar-icon i {
    color: #3b82f6 !important;
}

body.theme-corporate-light .topbar-icon:hover,
body.theme-corporate-light-dark .topbar-icon:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
}

/* =====================================================
   NOTIFICATION AND MAILBOX DROPDOWNS - Z-INDEX FIX
   ===================================================== */

/* Ensure dropdowns appear above sidebar */
.notification-dropdown,
.mailbox-dropdown,
.company-dropdown,
.user-dropdown {
    z-index: 10000 !important;
}

/* Make sure topbar is above sidebar */
.topbar {
    position: relative;
    z-index: 1001 !important;
}

/* Dropdown containers need proper stacking */
.notification-container,
.mailbox-container {
    position: relative;
    z-index: 1002 !important;
}

/* =====================================================
   MAILBOX EMAIL SENDER - YELLOW HIGHLIGHT
   ===================================================== */
.email-sender,
.email-from .email-sender,
.email-item .email-sender,
span.email-sender {
    color: #fbbf24 !important;
    font-weight: 700 !important;
}

.email-item .email-from .email-sender {
    color: #fbbf24 !important;
    font-size: 0.95rem;
    font-weight: 700 !important;
    text-shadow: 0 0 1px rgba(251, 191, 36, 0.3);
}
