﻿/* Preloader & Progress Bar Animations */
    @keyframes pulse-fast {
        0%, 100% { opacity: 1; transform: scale(1); }
        50% { opacity: 0.8; transform: scale(0.95); }
    }
    .animate-pulse-fast {
        animation: pulse-fast 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    }
    #top-progress-bar {
        box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
    }
    #page-preloader.fade-out {
        opacity: 0;
        pointer-events: none;
    }
    #page-preloader.pointer-events-none {
        pointer-events: none;
    }

    :root {
        /* Light Theme - Clean Modern Slate & Indigo */
        --bg-primary: #f8fafc;
        --bg-secondary: #ffffff;
        --surface-elevated: rgba(255, 255, 255, 0.92);
        --surface-muted: #f1f5f9;
        --text-primary: #0f172a;
        --text-secondary: #475569;
        --text-tertiary: #64748b;
        --border-subtle: rgba(148, 163, 184, 0.22);
        
        --glass-bg: rgba(255, 255, 255, 0.85);
        --glass-border: rgba(226, 232, 240, 0.95);
        --glass-shadow: 0 10px 40px -10px rgba(31, 38, 135, 0.07);
        --sidebar-bg: rgba(255, 255, 255, 0.95);
        
        --crm-radius-sm: 0.75rem;
        --crm-radius-md: 1rem;
        --crm-radius-lg: 1.5rem;
        --crm-radius-xl: 2rem;
        
        --crm-space-xs: 0.5rem;
        --crm-space-sm: 0.75rem;
        --crm-space-md: 1rem;
        --crm-space-lg: 1.5rem;
        
        --crm-shadow-soft: 0 4px 20px -4px rgba(15, 23, 42, 0.08);
        --crm-shadow-medium: 0 16px 36px -8px rgba(15, 23, 42, 0.14);
        --crm-shadow-large: 0 24px 50px -12px rgba(15, 23, 42, 0.2);
        
        --crm-contrast-border: rgba(99, 102, 241, 0.16);
        --crm-contrast-surface: rgba(99, 102, 241, 0.05);
        
        /* Transitions & Effects */
        --crm-transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        --crm-transition-medium: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        --crm-transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        --crm-glass-blur: 16px;
    }

    [data-theme="dark"] {
        /* Dark Theme - Midnight Rich Indigo / Slate */
        --bg-primary: #0b1329;
        --bg-secondary: #131f37;
        --surface-elevated: rgba(19, 31, 55, 0.94);
        --surface-muted: #192744;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-tertiary: #94a3b8;
        --border-subtle: rgba(148, 163, 184, 0.16);
        
        --glass-bg: rgba(15, 25, 45, 0.88);
        --glass-border: rgba(148, 163, 184, 0.15);
        --glass-shadow: 0 12px 48px -12px rgba(0, 0, 0, 0.5);
        --sidebar-bg: rgba(11, 19, 41, 0.96);
        
        --crm-shadow-soft: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
        --crm-shadow-medium: 0 24px 44px -12px rgba(0, 0, 0, 0.7);
        --crm-contrast-border: rgba(129, 140, 248, 0.25);
        --crm-contrast-surface: rgba(99, 102, 241, 0.15);
        
        --crm-glass-blur: 24px;
    }

    body {
        font-family: 'Inter', sans-serif;
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }

    /* Utility harmonization so Tailwind gray/white helpers remain readable in both themes */
    [data-theme="light"] .bg-white,
    .light .bg-white {
        background-color: var(--bg-secondary) !important;
    }

    [data-theme="dark"] .bg-white,
    [data-theme="dark"] .dark\:bg-white,
    .dark .bg-white {
        background-color: var(--bg-secondary) !important;
    }

    [data-theme="dark"] .bg-gray-900,
    [data-theme="dark"] .bg-gray-800,
    [data-theme="dark"] .dark\:bg-gray-900,
    [data-theme="dark"] .dark\:bg-gray-800 {
        background-color: var(--surface-elevated) !important;
    }

    [data-theme="dark"] .text-gray-900,
    [data-theme="dark"] .text-gray-800,
    [data-theme="dark"] .dark\:text-white,
    [data-theme="dark"] .dark\:text-gray-100,
    [data-theme="dark"] .dark\:text-gray-200 {
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] .text-gray-700,
    [data-theme="dark"] .text-gray-600,
    [data-theme="dark"] .dark\:text-gray-300,
    [data-theme="dark"] .dark\:text-gray-400 {
        color: var(--text-secondary) !important;
    }

    [data-theme="dark"] .text-gray-500,
    [data-theme="dark"] .text-gray-400,
    [data-theme="dark"] .dark\:text-gray-500 {
        color: var(--text-tertiary) !important;
    }

    [data-theme="dark"] .border-gray-800,
    [data-theme="dark"] .border-gray-700,
    [data-theme="dark"] .border-gray-600,
    [data-theme="dark"] .dark\:border-gray-800,
    [data-theme="dark"] .dark\:border-gray-700,
    [data-theme="dark"] .dark\:border-gray-600 {
        border-color: var(--border-subtle) !important;
    }

    [data-theme="light"] .text-gray-900,
    [data-theme="light"] .text-gray-800 {
        color: var(--text-primary) !important;
    }

    [data-theme="light"] .text-gray-700,
    [data-theme="light"] .text-gray-600,
    [data-theme="light"] .text-gray-500 {
        color: var(--text-secondary) !important;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    .font-heading {
        font-family: 'Outfit', sans-serif;
    }

    /* Glassmorphism Utilities */
    .glass {
        background: var(--glass-bg);
        backdrop-filter: blur(var(--crm-glass-blur));
        -webkit-backdrop-filter: blur(var(--crm-glass-blur));
        border: 1px solid var(--glass-border);
        box-shadow: var(--glass-shadow);
        transition: var(--crm-transition-medium);
    }

    .glass-sidebar {
        background: var(--sidebar-bg);
        backdrop-filter: blur(var(--crm-glass-blur));
        -webkit-backdrop-filter: blur(var(--crm-glass-blur));
        border-right: 1px solid var(--glass-border);
        transition: var(--crm-transition-medium);
    }

    .glass-header {
        background: var(--sidebar-bg);
        backdrop-filter: blur(var(--crm-glass-blur));
        -webkit-backdrop-filter: blur(var(--crm-glass-blur));
        border-bottom: 1px solid var(--glass-border);
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
        transition: var(--crm-transition-medium);
    }

    /* Modern Glass Card */
    .card-glass {
        background: var(--glass-bg);
        backdrop-filter: blur(var(--crm-glass-blur));
        -webkit-backdrop-filter: blur(var(--crm-glass-blur));
        border: 1px solid var(--glass-border);
        box-shadow: var(--crm-shadow-soft);
        border-radius: var(--crm-radius-lg);
        transition: var(--crm-transition-medium);
    }

    .card-glass:hover {
        transform: translateY(-5px) scale(1.005);
        box-shadow: var(--crm-shadow-medium);
        border-color: var(--crm-contrast-border);
    }

    .enterprise-header {
        border-bottom-color: var(--crm-contrast-border) !important;
        box-shadow: var(--crm-shadow-soft);
    }

    .enterprise-sidebar {
        border-right: 1px solid var(--crm-contrast-border);
        box-shadow: var(--crm-shadow-medium);
    }

    .enterprise-sidebar .section-toggle {
        border-radius: var(--crm-radius-md);
        transition: var(--crm-transition-fast);
    }

    .enterprise-sidebar a {
        border-radius: var(--crm-radius-md);
        transition: var(--crm-transition-fast);
    }

    /* Tailwind's gradient text utilities can render invisible in some
       browser/layout combinations unless text fill and inline formatting are explicit. */
    .bg-clip-text.text-transparent {
        display: inline-block;
        background-image: linear-gradient(90deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);
        background-size: 100% 100%;
        background-repeat: no-repeat;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    [data-theme="dark"] .bg-clip-text.text-transparent,
    .dark .bg-clip-text.text-transparent {
        background-image: linear-gradient(90deg, #c7d2fe 0%, #a5b4fc 52%, #d8b4fe 100%);
    }

    .crm-logo-text {
        display: inline-block;
        line-height: 1.05;
        color: #4f46e5;
        background-image: linear-gradient(135deg, #818cf8 0%, #6366f1 45%, #a855f7 100%);
        background-size: 100%;
        background-repeat: no-repeat;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        text-shadow: 0 8px 24px rgba(79, 70, 229, 0.18);
    }

    [data-theme="dark"] .crm-logo-text,
    .dark .crm-logo-text {
        background-image: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 35%, #c084fc 100%);
        text-shadow: 0 10px 30px rgba(99, 102, 241, 0.22);
    }

    @supports not ((-webkit-background-clip: text) or (background-clip: text)) {
        .bg-clip-text.text-transparent {
            color: var(--crm-accent, #4f46e5);
            background-image: none !important;
        }

        .crm-logo-text {
            background-image: none;
            color: var(--crm-accent, #4f46e5);
            -webkit-text-fill-color: currentColor;
        }
    }

    .enterprise-panel {
        border-color: var(--crm-contrast-border);
        box-shadow: var(--crm-shadow-soft);
        transition: var(--crm-transition-medium);
    }

    .enterprise-panel:hover {
        box-shadow: var(--crm-shadow-medium);
        transform: translateY(-2px);
    }

    .nav-chevron {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .nav-section.collapsed .nav-chevron {
        transform: rotate(-90deg);
    }

    /* Scrollbar */
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    ::-webkit-scrollbar-track {
        background: transparent;
    }

    ::-webkit-scrollbar-thumb {
        background-color: rgba(156, 163, 175, 0.5);
        border-radius: 20px;
        border: 3px solid transparent;
        background-clip: content-box;
    }

    ::-webkit-scrollbar-thumb:hover {
        background-color: rgba(107, 114, 128, 0.8);
    }
    [data-theme="dark"] ::-webkit-scrollbar-thumb {
        background-color: rgba(148, 163, 184, 0.4);
    }
    
    /* Animations */
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    .animate-fade-in {
        animation: fadeIn 0.4s ease-out forwards;
    }

    /* Buttons */
    /* Buttons - Standardized Enterprise Style */
    .btn-primary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.625rem 1.25rem;
        border: 1px solid transparent;
        font-size: 0.875rem;
        font-weight: 600;
        border-radius: var(--crm-radius-sm);
        color: #ffffff !important;
        background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%) !important;
        transition: var(--crm-transition-fast);
        box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.3);
        cursor: pointer;
        gap: 0.5rem;
    }
    .btn-primary:hover {
        box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
        transform: translateY(-2px);
        filter: brightness(1.1);
    }
    .btn-primary:active {
        transform: translateY(0);
        filter: brightness(0.95);
    }

    .btn-secondary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
        font-weight: 500;
        border-radius: var(--crm-radius-sm);
        color: var(--text-primary);
        background-color: var(--bg-secondary);
        border: 1px solid var(--glass-border);
        transition: var(--crm-transition-fast);
        cursor: pointer;
        gap: 0.5rem;
    }
    .btn-secondary:hover {
        background-color: var(--surface-muted);
        border-color: var(--border-subtle);
        transform: translateY(-1px);
    }

    .btn-danger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.625rem 1.25rem;
        border: 1px solid transparent;
        font-size: 0.875rem;
        font-weight: 600;
        border-radius: var(--crm-radius-sm);
        color: #ffffff;
        background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
        transition: var(--crm-transition-fast);
        box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.3);
        cursor: pointer;
        gap: 0.5rem;
    }
    .btn-danger:hover {
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
        transform: translateY(-2px);
    }

    .btn-white {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        background-color: #ffffff;
        color: #4f46e5;
        font-weight: 700;
        padding: 0.75rem 1rem;
        border-radius: var(--crm-radius-md);
        transition: var(--crm-transition-fast);
        box-shadow: var(--crm-shadow-medium);
        cursor: pointer;
    }
    .btn-white:hover {
        background-color: #f5f3ff;
        transform: translateY(-2px) scale(1.02);
    }
</style>
<style>
    /* Sidebar Overrides */
    .sidebar {
        background: transparent !important;
        /* Managed by .glass-sidebar */
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); /* Modern easing */
    }

    .sidebar a {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
        margin-bottom: 2px;
        border-radius: 0.75rem; /* Rounded-xl */
    }

    .sidebar a:hover {
        background: rgba(99, 102, 241, 0.08);
        color: #4F46E5;
        transform: translateX(6px);
        box-shadow: var(--crm-shadow-soft);
    }

    .sidebar a.active {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.1));
        color: #4F46E5;
        font-weight: 700;
        box-shadow: 0 4px 15px -1px rgba(99, 102, 241, 0.2);
    }
    
    .sidebar a.active svg {
        color: #4F46E5 !important;
        filter: drop-shadow(0 0 5px rgba(79, 70, 229, 0.3));
    }
    
    .sidebar a.active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 15%;
        bottom: 15%;
        width: 4px;
        background: linear-gradient(to bottom, #4F46E5, #8B5CF6);
        border-radius: 0 4px 4px 0;
        box-shadow: 2px 0 10px rgba(79, 70, 229, 0.4);
    }
    
    [data-theme="dark"] .sidebar a.active {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.15));
        color: #A5B4FC;
        box-shadow: 0 4px 20px -1px rgba(0, 0, 0, 0.3);
    }
    
    [data-theme="dark"] .sidebar a.active svg {
        color: #A5B4FC !important;
        filter: drop-shadow(0 0 8px rgba(165, 180, 252, 0.4));
    }
    
    [data-theme="dark"] .sidebar a.active::before {
        background: linear-gradient(to bottom, #818CF8, #C084FC);
        box-shadow: 2px 0 15px rgba(129, 140, 248, 0.5);
    }

    /* Modern Scrollbar for Sidebar */
    .sidebar nav::-webkit-scrollbar,
    #sidebar-nav::-webkit-scrollbar {
        width: 4px;
    }
    
    .sidebar nav::-webkit-scrollbar-thumb,
    #sidebar-nav::-webkit-scrollbar-thumb {
        background: rgba(156, 163, 175, 0.3);
        border-radius: 10px;
    }
    
    .sidebar nav:hover::-webkit-scrollbar-thumb,
    #sidebar-nav:hover::-webkit-scrollbar-thumb {
        background: rgba(156, 163, 175, 0.5);
    }

    /* РҐРµРґРµСЂ: СЃРІРѕР№ СЃР»РѕР№, РєР»РёРєРё РґРѕС…РѕРґСЏС‚ РґРѕ РєРЅРѕРїРѕРє Рё СЃСЃС‹Р»РѕРє */
    .header-bar {
        pointer-events: auto;
        isolation: isolate;
    }

    /* РђРґР°РїС‚РёРІРЅРѕСЃС‚СЊ СЃР°Р№РґР±Р°СЂР° */
    /* Mobile: РЎРєСЂС‹С‚ РїРѕ СѓРјРѕР»С‡Р°РЅРёСЋ */
    @media (max-width: 1023px) {
        #sidebar {
            transform: translateX(-100%);
        }
        #sidebar.sidebar-open {
            transform: translateX(0);
        }
    }

    /* Desktop: Р’РёРґРµРЅ РїРѕ СѓРјРѕР»С‡Р°РЅРёСЋ */
    @media (min-width: 1024px) {
        #sidebar {
            transform: translateX(0);
        }
        #sidebar.sidebar-closed {
            transform: translateX(-100%);
        }
    }

    /* РЎРєСЂС‹РІР°С‚СЊ СЂР°Р·РґРµР»РёС‚РµР»СЊ Рё РїСѓСЃС‚РѕР№ breadcrumb */
    .breadcrumb-extra:has(.breadcrumb-current:empty) {
        display: none;
    }

    /* Р Р°СЃРєСЂС‹РІР°СЋС‰РёРµСЃСЏ СЃРµРєС†РёРё СЃР°Р№РґР±Р°СЂР° (Accordion Animation) */
    .nav-section .section-content {
        max-height: 1000px; /* Sufficient for submenus */
        opacity: 1;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), margin 0.3s ease;
    }
    .nav-section.collapsed .section-content {
        max-height: 0;
        opacity: 0;
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Alpine.js cloak */
    [x-cloak] {
        display: none !important;
    }

    .htmx-added {
        animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
    }
    .htmx-swapping {
        opacity: 0;
        filter: blur(4px);
        transition: opacity 0.2s ease, filter 0.2s ease;
    }

    /* Modern Card Style */
    .card {
        background-color: var(--bg-secondary);
        border: 1px solid var(--glass-border);
        border-radius: var(--crm-radius-lg);
        box-shadow: var(--crm-shadow-soft);
        transition: var(--crm-transition-medium);
    }

    .card:hover {
        transform: translateY(-2px);
        box-shadow: var(--crm-shadow-medium);
        border-color: var(--crm-contrast-border);
    }
    
    [data-theme="dark"] .card {
        background-color: var(--surface-elevated);
        border-color: var(--border-subtle);
    }
</style>
<style>
    /* Modern Table Styles - Enterprise Level */
    .table-container {
        border-radius: var(--crm-radius-lg);
        overflow: hidden;
        border: 1px solid var(--glass-border);
        box-shadow: var(--crm-shadow-soft);
        background-color: var(--surface-elevated);
        backdrop-filter: blur(8px);
    }

    .table-header {
        background-color: var(--surface-muted);
        border-bottom: 2px solid var(--crm-contrast-border);
    }

    .table-th {
        padding: 1rem 1.5rem;
        text-align: left;
        font-size: 0.75rem;
        font-weight: 700;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.1em;
    }

    .table-td {
        padding: 1rem 1.5rem;
        font-size: 0.875rem;
        color: var(--text-primary);
        border-bottom: 1px solid var(--glass-border);
    }

    .table-row {
        transition: var(--crm-transition-fast);
        background-color: transparent;
    }

    .table-row:last-child .table-td { border-bottom: 0; }

    /* Zebra Effect */
    .table-row:nth-child(even) {
        background-color: color-mix(in srgb, var(--surface-muted) 72%, transparent);
    }

    .table-row:hover {
        background-color: rgba(99, 102, 241, 0.08);
        transform: scale(1.002) translateX(2px);
    }
    
    [data-theme="dark"] .table-row:hover {
        background-color: rgba(99, 102, 241, 0.12);
    }

    /* Modern Badge */
    .badge {
        display: inline-flex;
        align-items: center;
        padding: 0.125rem 0.625rem;
        border-radius: 9999px;
        font-size: 0.75rem;
        font-weight: 500;
    }

    .badge-gray { background-color: #f3f4f6; color: #1f2937; }
    .badge-red { background-color: #fee2e2; color: #991b1b; }
    .badge-yellow { background-color: #fef3c7; color: #92400e; }
    .badge-green { background-color: #d1fae5; color: #065f46; }
    .badge-blue { background-color: #dbeafe; color: #1e40af; }
    .badge-indigo { background-color: #e0e7ff; color: #3730a3; }
    .badge-purple { background-color: #ede9fe; color: #5b21b6; }
    .badge-pink { background-color: #fce7f3; color: #9d174d; }

    [data-theme="dark"] .badge-gray { background-color: #374151; color: #d1d5db; }
    [data-theme="dark"] .badge-red { background-color: rgba(127, 29, 29, 0.3); color: #fca5a5; }
    [data-theme="dark"] .badge-yellow { background-color: rgba(120, 53, 15, 0.3); color: #fcd34d; }
    [data-theme="dark"] .badge-green { background-color: rgba(6, 78, 59, 0.3); color: #6ee7b7; }
    [data-theme="dark"] .badge-blue { background-color: rgba(30, 58, 138, 0.3); color: #93c5fd; }
    [data-theme="dark"] .badge-indigo { background-color: rgba(49, 46, 129, 0.3); color: #a5b4fc; }
    [data-theme="dark"] .badge-purple { background-color: rgba(76, 29, 149, 0.3); color: #c4b5fd; }
    [data-theme="dark"] .badge-pink { background-color: rgba(131, 24, 67, 0.3); color: #f9a8d4; }

    /* Modern Input */
    .input-modern {
        display: block;
        width: 100%;
        border-radius: var(--crm-radius-sm);
        border: 1px solid var(--glass-border);
        box-shadow: var(--crm-shadow-soft);
        font-size: 0.875rem;
        background-color: var(--bg-secondary);
        color: var(--text-primary);
        transition: var(--crm-transition-fast);
        padding: 0.625rem 1rem;
    }
    .input-modern:focus {
        border-color: #6366f1;
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
        outline: none;
        transform: translateY(-1px);
    }
    [data-theme="dark"] .input-modern {
        background-color: rgba(31, 41, 55, 0.5);
    }

    /* ==========================================
       KANBAN FILTERS - Modern CRM Style
       ========================================== */
    
    .kanban-filters-wrapper {
        width: 100%;
        margin-bottom: 0.5rem;
        position: relative;
        z-index: 40;
    }

    .filters-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        padding: 0.875rem 1rem;
        background: var(--surface-elevated);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid var(--glass-border);
        border-radius: 1rem;
        box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.18);
    }

    /* Filter Groups */
    .filter-group {
        position: relative;
    }

    .filter-group-search {
        flex: 1;
        min-width: 200px;
        max-width: 320px;
    }

    .filter-input-wrapper {
        position: relative;
        display: flex;
        align-items: center;
        min-height: 2.75rem;
    }

    .filter-search-icon {
        position: absolute;
        left: 0.75rem;
        width: 1.25rem;
        height: 1.25rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-tertiary);
        pointer-events: none;
        z-index: 1;
    }
    [data-theme="dark"] .filter-search-icon {
        color: var(--text-tertiary);
    }

    .filter-input,
    .filter-search-input {
        width: 100%;
        padding: 0.5rem 2.5rem 0.5rem 2.75rem;
        border: 1px solid var(--glass-border);
        border-radius: 0.75rem;
        font-size: 0.875rem;
        background-color: var(--bg-secondary);
        color: var(--text-primary);
        transition: all 0.2s;
    }
    .filter-input:focus,
    .filter-search-input:focus {
        outline: none;
        border-color: #6366F1;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }
    [data-theme="dark"] .filter-input,
    [data-theme="dark"] .filter-search-input {
        background-color: var(--bg-secondary);
        border-color: var(--border-subtle);
        color: var(--text-primary);
    }
    [data-theme="dark"] .filter-input:focus,
    [data-theme="dark"] .filter-search-input:focus {
        border-color: #818CF8;
        box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
    }

    .filter-clear-btn {
        position: absolute;
        right: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 1.5rem;
        height: 1.5rem;
        border: none;
        background: transparent;
        color: #9CA3AF;
        cursor: pointer;
        border-radius: 0.375rem;
        transition: all 0.2s;
    }
    .filter-clear-btn:hover {
        background-color: #F3F4F6;
        color: #6B7280;
    }
    [data-theme="dark"] .filter-clear-btn:hover {
        background-color: #374151;
        color: #D1D5DB;
    }
    .filter-clear-btn svg {
        width: 1rem;
        height: 1rem;
    }

    /* Filter Buttons */
    .filter-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.875rem;
        border: 1px solid var(--glass-border);
        border-radius: 0.75rem;
        font-size: 0.875rem;
        font-weight: 500;
        background-color: var(--bg-secondary);
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.2s;
    }
    .filter-btn:hover {
        border-color: var(--border-subtle);
        background-color: var(--surface-muted);
    }
    .filter-btn-active {
        border-color: #6366F1 !important;
        background-color: #EEF2FF !important;
        color: #4F46E5 !important;
    }
    [data-theme="dark"] .filter-btn {
        background-color: var(--bg-secondary);
        border-color: var(--border-subtle);
        color: var(--text-secondary);
    }
    [data-theme="dark"] .filter-btn:hover {
        background-color: var(--surface-muted);
        border-color: rgba(129, 140, 248, 0.22);
    }
    [data-theme="dark"] .filter-btn-active {
        border-color: #818CF8 !important;
        background-color: rgba(99, 102, 241, 0.2) !important;
        color: #A5B4FC !important;
    }

    .filter-btn-icon {
        width: 1rem;
        height: 1rem;
        color: currentColor;
        opacity: 0.7;
    }

    .filter-chevron {
        width: 1rem;
        height: 1rem;
        opacity: 0.5;
        transition: transform 0.2s;
    }
    .filter-dropdown-open .filter-chevron {
        transform: rotate(180deg);
    }

    .filter-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.25rem;
        height: 1.25rem;
        padding: 0 0.375rem;
        background-color: #6366F1;
        color: #FFFFFF;
        font-size: 0.75rem;
        font-weight: 600;
        border-radius: 9999px;
    }
    [data-theme="dark"] .filter-badge {
        background-color: #818CF8;
        color: #1E293B;
    }

    /* Filter Dropdowns */
    .filter-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1200;
        min-width: 220px;
        max-height: 0;
        overflow: hidden;
        background-color: var(--surface-elevated);
        border: 1px solid var(--glass-border);
        border-radius: 0.75rem;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
        opacity: 0;
        transform: translateY(-8px);
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
    }
    .filter-dropdown-open {
        max-height: 400px;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    [data-theme="dark"] .filter-dropdown {
        background-color: var(--surface-elevated);
        border-color: var(--border-subtle);
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    }

    .filter-dropdown-content-wide {
        min-width: 320px;
        padding: 0.75rem;
    }

    .filter-dropdown-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 0.875rem;
        border-bottom: 1px solid var(--glass-border);
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-tertiary);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    [data-theme="dark"] .filter-dropdown-header {
        border-bottom-color: var(--border-subtle);
        color: var(--text-tertiary);
    }

    .filter-dropdown-clear {
        font-size: 0.75rem;
        font-weight: 500;
        color: #6366F1;
        background: transparent;
        border: none;
        cursor: pointer;
        transition: color 0.2s;
    }
    .filter-dropdown-clear:hover {
        color: #4F46E5;
    }
    [data-theme="dark"] .filter-dropdown-clear {
        color: #A5B4FC;
    }
    [data-theme="dark"] .filter-dropdown-clear:hover {
        color: #818CF8;
    }

    .filter-dropdown-body {
        padding: 0.5rem;
        max-height: 280px;
        overflow-y: auto;
    }

    /* Inline filter sections (accordion) inside "more" dropdown */
    .filter-inline-section summary {
        list-style: none;
    }
    .filter-inline-section summary::-webkit-details-marker {
        display: none;
    }
    .filter-inline-section[open] summary svg {
        transform: rotate(180deg);
    }

    .filter-search-mini {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    .filter-search-mini input {
        width: 100%;
        padding: 0.375rem 0.75rem;
        border: 1px solid #E5E7EB;
        border-radius: 0.5rem;
        font-size: 0.875rem;
        background-color: #F9FAFB;
        color: #1F2937;
    }
    .filter-search-mini input:focus {
        outline: none;
        border-color: #6366F1;
        background-color: #FFFFFF;
    }
    [data-theme="dark"] .filter-search-mini input {
        background-color: #374151;
        border-color: #4B5563;
        color: #F9FAFB;
    }
    [data-theme="dark"] .filter-search-mini input:focus {
        border-color: #818CF8;
        background-color: #1F2937;
    }

    /* Filter Checkbox Items */
    .filter-checkbox-item {
        display: flex;
        align-items: center;
        gap: 0.625rem;
        padding: 0.5rem 0.625rem;
        border-radius: 0.5rem;
        cursor: pointer;
        transition: all 0.2s;
        user-select: none;
    }
    .filter-checkbox-item:hover {
        background-color: #F3F4F6;
    }
    .filter-checkbox-item-active {
        background-color: #EEF2FF;
    }
    [data-theme="dark"] .filter-checkbox-item:hover {
        background-color: #374151;
    }
    [data-theme="dark"] .filter-checkbox-item-active {
        background-color: rgba(99, 102, 241, 0.15);
    }

    .filter-checkbox-item input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .filter-checkbox-checkmark {
        flex-shrink: 0;
        width: 1.125rem;
        height: 1.125rem;
        border: 2px solid #D1D5DB;
        border-radius: 0.375rem;
        transition: all 0.2s;
        position: relative;
    }
    .filter-checkbox-item input[type="checkbox"]:checked + .filter-checkbox-checkmark {
        background-color: #6366F1;
        border-color: #6366F1;
    }
    [data-theme="dark"] .filter-checkbox-checkmark {
        border-color: #4B5563;
    }
    [data-theme="dark"] .filter-checkbox-item input[type="checkbox"]:checked + .filter-checkbox-checkmark {
        background-color: #818CF8;
        border-color: #818CF8;
    }

    .filter-checkbox-checkmark::after {
        content: '';
        position: absolute;
        left: 0.25rem;
        top: 0.125rem;
        width: 0.375rem;
        height: 0.625rem;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg) scale(0);
        transition: transform 0.2s;
    }
    .filter-checkbox-item input[type="checkbox"]:checked + .filter-checkbox-checkmark::after {
        transform: rotate(45deg) scale(1);
    }

    .filter-checkbox-label {
        font-size: 0.875rem;
        color: #374151;
    }
    [data-theme="dark"] .filter-checkbox-label {
        color: #E5E7EB;
    }

    .filter-empty-state {
        padding: 1.5rem;
        text-align: center;
        color: #9CA3AF;
        font-size: 0.875rem;
    }
    [data-theme="dark"] .filter-empty-state {
        color: #6B7280;
    }

    /* Filter Grid (for "More" dropdown) */
    .filter-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .filter-grid-item {
        display: flex;
        flex-direction: column;
        gap: 0.375rem;
    }

    .filter-label {
        font-size: 0.75rem;
        font-weight: 600;
        color: #6B7280;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    [data-theme="dark"] .filter-label {
        color: #9CA3AF;
    }

    .filter-select {
        padding: 0.5rem 0.75rem;
        border: 1px solid var(--glass-border);
        border-radius: 0.5rem;
        font-size: 0.875rem;
        background-color: var(--bg-secondary);
        color: var(--text-primary);
        cursor: pointer;
        transition: all 0.2s;
    }
    .filter-select:focus {
        outline: none;
        border-color: #6366F1;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }
    [data-theme="dark"] .filter-select {
        background-color: var(--bg-secondary);
        border-color: var(--border-subtle);
        color: var(--text-primary);
    }
    [data-theme="dark"] .filter-select:focus {
        border-color: #818CF8;
        box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
    }

    .filter-date-range {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .filter-date-input {
        flex: 1;
        padding: 0.5rem 0.625rem;
        border: 1px solid var(--glass-border);
        border-radius: 0.5rem;
        font-size: 0.875rem;
        background-color: var(--bg-secondary);
        color: var(--text-primary);
    }
    .filter-date-input:focus {
        outline: none;
        border-color: #6366F1;
    }
    [data-theme="dark"] .filter-date-input {
        background-color: var(--bg-secondary);
        border-color: var(--border-subtle);
        color: var(--text-primary);
    }
    [data-theme="dark"] .filter-date-input:focus {
        border-color: #818CF8;
    }

    .filter-date-separator {
        color: var(--text-tertiary);
        font-size: 0.875rem;
    }

    .filter-sort-wrapper {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .filter-sort-order {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.25rem;
        height: 2.25rem;
        border: 1px solid var(--glass-border);
        border-radius: 0.5rem;
        background-color: var(--bg-secondary);
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.2s;
    }
    .filter-sort-order:hover {
        border-color: #6366F1;
        color: #6366F1;
        background-color: #EEF2FF;
    }
    [data-theme="dark"] .filter-sort-order {
        background-color: var(--bg-secondary);
        border-color: var(--border-subtle);
        color: var(--text-tertiary);
    }
    [data-theme="dark"] .filter-sort-order:hover {
        border-color: #818CF8;
        color: #818CF8;
        background-color: rgba(129, 140, 248, 0.1);
    }
    .filter-sort-order svg {
        width: 1.125rem;
        height: 1.125rem;
    }

    .filter-checkbox {
        width: 1.125rem;
        height: 1.125rem;
        border: 2px solid #D1D5DB;
        border-radius: 0.375rem;
        cursor: pointer;
        accent-color: #6366F1;
    }
    [data-theme="dark"] .filter-checkbox {
        border-color: #4B5563;
    }

    .filter-checkbox-label {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        cursor: pointer;
        font-size: 0.875rem;
        color: #374151;
        user-select: none;
    }
    [data-theme="dark"] .filter-checkbox-label {
        color: #E5E7EB;
    }

    /* Active Filters Tags */
    .active-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 0.375rem;
        margin-left: 0.5rem;
    }

    .active-filter-tag {
        display: inline-flex;
        align-items: center;
        gap: 0.375rem;
        padding: 0.25rem 0.625rem;
        background-color: #EEF2FF;
        color: #4F46E5;
        font-size: 0.75rem;
        font-weight: 500;
        border-radius: 9999px;
        border: 1px solid #E0E7FF;
    }
    [data-theme="dark"] .active-filter-tag {
        background-color: rgba(99, 102, 241, 0.2);
        color: #A5B4FC;
        border-color: rgba(129, 140, 248, 0.3);
    }

    .active-filter-remove {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 1rem;
        height: 1rem;
        border: none;
        background: transparent;
        color: currentColor;
        cursor: pointer;
        border-radius: 9999px;
        opacity: 0.7;
        transition: all 0.2s;
    }
    .active-filter-remove:hover {
        opacity: 1;
        background-color: rgba(99, 102, 241, 0.2);
    }
    .active-filter-remove svg {
        width: 0.75rem;
        height: 0.75rem;
    }

    /* Reset All Button */
    .filter-reset-all {
        display: inline-flex;
        align-items: center;
        gap: 0.375rem;
        padding: 0.5rem 0.875rem;
        border: 1px dashed #D1D5DB;
        border-radius: 0.75rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: #6B7280;
        background: transparent;
        cursor: pointer;
        transition: all 0.2s;
    }
    .filter-reset-all:hover {
        border-color: #9CA3AF;
        color: #374151;
        background-color: #F9FAFB;
    }
    [data-theme="dark"] .filter-reset-all {
        border-color: #4B5563;
        color: #9CA3AF;
    }
    [data-theme="dark"] .filter-reset-all:hover {
        border-color: #6B7280;
        color: #E5E7EB;
        background-color: #374151;
    }
    .filter-reset-all svg {
        width: 1rem;
        height: 1rem;
    }

    /* Filters Info */
    .filters-info {
        margin-left: auto;
        font-size: 0.875rem;
        color: var(--text-secondary);
    }
    [data-theme="dark"] .filters-info {
        color: var(--text-secondary);
    }

    .filters-count {
        font-weight: 600;
        color: #4F46E5;
    }
    [data-theme="dark"] .filters-count {
        color: #A5B4FC;
    }

    /* More dropdown specific */
    .filter-dropdown-more {
        left: auto;
        right: 0;
    }

    /* Responsive adjustments */
    @media (max-width: 768px) {
        .filters-bar {
            flex-direction: column;
            align-items: stretch;
        }

        .filter-group-search {
            max-width: none;
        }

        .filter-grid {
            grid-template-columns: 1fr;
        }

        .filter-dropdown-content-wide {
            min-width: auto;
        }

        .active-filters {
            margin-left: 0;
            margin-top: 0.5rem;
        }

        .filters-info {
            margin-left: 0;
            margin-top: 0.5rem;
            text-align: center;
        }

        .filter-reset-all {
            width: 100%;
            justify-content: center;
            margin-top: 0.5rem;
        }
    }

    /* Color variants for checkbox items */
    .filter-color-gray { background-color: rgba(156, 163, 175, 0.1) !important; }
    .filter-color-blue { background-color: rgba(59, 130, 246, 0.1) !important; }
    .filter-color-amber { background-color: rgba(245, 158, 11, 0.1) !important; }
    .filter-color-emerald { background-color: rgba(16, 185, 129, 0.1) !important; }
    .filter-color-red { background-color: rgba(239, 68, 68, 0.1) !important; }
    .filter-color-slate { background-color: rgba(100, 116, 139, 0.1) !important; }
    .filter-color-purple { background-color: rgba(139, 92, 246, 0.1) !important; }

    [data-theme="dark"] .filter-color-gray { background-color: rgba(107, 114, 128, 0.15) !important; }
    [data-theme="dark"] .filter-color-blue { background-color: rgba(96, 165, 250, 0.15) !important; }
    [data-theme="dark"] .filter-color-amber { background-color: rgba(251, 191, 36, 0.15) !important; }
    [data-theme="dark"] .filter-color-emerald { background-color: rgba(52, 211, 153, 0.15) !important; }
    [data-theme="dark"] .filter-color-red { background-color: rgba(248, 113, 113, 0.15) !important; }
    [data-theme="dark"] .filter-color-slate { background-color: rgba(148, 163, 184, 0.15) !important; }
    [data-theme="dark"] .filter-color-purple { background-color: rgba(167, 139, 250, 0.15) !important; }

    /* Compact filter styles */
    @media (max-width: 768px) {
        .filter-btn span:not(.inline-flex) { display: none; }
        .filter-btn .hidden { display: none !important; }
    }
    
    /* Filter dropdown compact */
    .filter-dropdown { min-width: 12rem; }
    .filter-dropdown-content-wide { min-width: 18rem; }
    
    /* Smaller filter inputs */
    .filter-input, .filter-search-input, .filter-select, .filter-date-input {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Compact filter button */
    .filter-btn { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
    .filter-btn svg { width: 0.875rem; height: 0.875rem; }
    /* ==========================================
       KANBAN BOARD - Premium Glass Style
       ========================================== */
    .crm-kanban-page-shell {
        height: calc(100vh - 5rem);
        margin: -1.5rem;
        padding: 1.5rem;
        overflow: hidden;
    }

    .kanban-container {
        display: flex;
        gap: 1.5rem;
        padding: 0.5rem;
        min-height: calc(100vh - 250px);
        overflow-x: auto;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .kanban-column {
        display: flex;
        flex: 1;
        flex-direction: column;
        min-width: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    [data-theme="dark"] .kanban-column {
        background: color-mix(in srgb, var(--surface-elevated) 82%, transparent);
        border-color: var(--border-subtle);
    }

    .kanban-column-header {
        padding: 1.25rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    [data-theme="dark"] .kanban-column-header { border-bottom-color: var(--border-subtle); }

    .kanban-cards-container {
        flex: 1;
        padding: 1rem;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        overflow-y: auto;
        min-height: 120px;
    }

    .kanban-card {
        background: var(--bg-secondary);
        border: 1px solid var(--glass-border);
        border-radius: 1rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
        cursor: grab;
    }

    .kanban-card:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        border-color: #6366F1;
    }

    .kanban-card:active {
        cursor: grabbing;
        transform: scale(0.98);
    }

    /* Drag & Drop Visuals */
    .kanban-card.dragging {
        opacity: 0.5;
        transform: rotate(2deg) scale(0.95);
        cursor: grabbing;
    }

    .kanban-column.drag-over {
        background: rgba(99, 102, 241, 0.05);
        border-color: #6366F1;
        transform: scale(1.01);
    }
    [data-theme="dark"] .kanban-column.drag-over {
        background: rgba(99, 102, 241, 0.1);
    }

    .kanban-board-loading {
        opacity: 0.55;
        pointer-events: none;
        transition: opacity 0.18s ease;
    }

    .crm-kanban-board {
        display: flex;
        flex: 1 1 auto;
        height: 100%;
        min-height: 0;
        gap: 1rem;
        align-items: stretch;
        overflow-x: auto;
        padding-bottom: 0;
        scrollbar-gutter: stable;
    }

    .crm-kanban-column-shell {
        width: 20rem;
        flex: 0 0 20rem;
        display: flex;
        flex-direction: column;
        align-self: stretch;
        height: 100%;
        min-height: 0;
    }

    .crm-kanban-column-header {
        padding: 1rem 1rem 0.875rem;
        border-bottom: 1px solid var(--glass-border);
        background: linear-gradient(180deg, color-mix(in srgb, var(--surface-elevated) 96%, transparent), color-mix(in srgb, var(--surface-elevated) 72%, transparent));
        flex-shrink: 0;
    }

    [data-theme="dark"] .crm-kanban-column-header {
        border-bottom-color: var(--border-subtle);
        background: linear-gradient(180deg, color-mix(in srgb, var(--surface-elevated) 98%, transparent), color-mix(in srgb, var(--surface-elevated) 86%, transparent));
    }

    .crm-kanban-column-body {
        padding: 0.875rem;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        min-height: 0;
        flex: 1;
        overflow-y: auto;
    }

    .crm-kanban-card {
        border-radius: 1rem;
        border: 1px solid var(--glass-border);
        background: color-mix(in srgb, var(--bg-secondary) 96%, transparent);
        box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.45);
    }

    [data-theme="dark"] .crm-kanban-card {
        border-color: var(--border-subtle);
        background: color-mix(in srgb, var(--bg-secondary) 94%, transparent);
    }

    .kanban-load-more-wrap {
        display: flex;
        justify-content: center;
        padding-top: 0.25rem;
    }

    .kanban-load-more {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 0.625rem 0.875rem;
        border: 1px dashed rgba(99, 102, 241, 0.3);
        border-radius: 0.875rem;
        background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
        color: #4F46E5;
        font-size: 0.8125rem;
        font-weight: 600;
        transition: var(--crm-transition-fast);
    }

    .kanban-load-more:hover {
        background: color-mix(in srgb, var(--surface-muted) 88%, rgba(99, 102, 241, 0.08));
        border-color: rgba(99, 102, 241, 0.5);
    }

    .kanban-drag-ghost {
        opacity: 0.3;
    }

    .kanban-drag-chosen {
        transform: rotate(1deg);
    }
    /* ==========================================
       DASHBOARD - Modern Glass Metrics
       ========================================== */
    /* ==========================================
       DASHBOARD - Modern Glass Metrics
       ========================================== */
    .dashboard-stat-card {
        position: relative;
        overflow: hidden;
        border-radius: var(--crm-radius-lg);
        padding: 1.5rem;
        transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        border: 1px solid rgba(255, 255, 255, 0.18);
        box-shadow: 0 10px 30px -8px rgba(15, 23, 42, 0.15);
    }

    .dashboard-stat-card:hover {
        transform: translateY(-6px) scale(1.01);
        box-shadow: 0 22px 40px -10px rgba(15, 23, 42, 0.28);
        border-color: rgba(255, 255, 255, 0.35);
    }

    .dashboard-stat-card::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.25) 0%, transparent 65%);
        opacity: 0;
        transition: opacity 0.4s ease;
        pointer-events: none;
    }

    .dashboard-stat-card:hover::before {
        opacity: 1;
    }

    .stat-icon-box {
        width: 3.25rem;
        height: 3.25rem;
        border-radius: 0.875rem;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.22);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease;
    }

    .dashboard-stat-card:hover .stat-icon-box {
        transform: scale(1.08) rotate(3deg);
    }

    .stat-value {
        font-family: 'Outfit', sans-serif;
        font-size: 2.25rem;
        line-height: 2.25rem;
        font-weight: 800;
        letter-spacing: -0.03em;
        margin-top: 0.5rem;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    }

    .stat-label {
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        opacity: 0.9;
    }

    /* Vibrant Gradient Glow variants */
    .glow-blue { 
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 60%, #1e40af 100%); 
        box-shadow: 0 10px 30px -8px rgba(59, 130, 246, 0.35);
    }
    .glow-emerald { 
        background: linear-gradient(135deg, #10b981 0%, #059669 60%, #047857 100%);
        box-shadow: 0 10px 30px -8px rgba(16, 185, 129, 0.35);
    }
    .glow-purple { 
        background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 60%, #6d28d9 100%);
        box-shadow: 0 10px 30px -8px rgba(139, 92, 246, 0.35);
    }
    .glow-amber { 
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 60%, #b45309 100%);
        box-shadow: 0 10px 30px -8px rgba(245, 158, 11, 0.35);
    }
    .glow-sky { 
        background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 60%, #0369a1 100%);
        box-shadow: 0 10px 30px -8px rgba(14, 165, 233, 0.35);
    }

    /* Card Glass & Utility Glass System */
    .card-glass, .glass {
        background-color: var(--glass-bg);
        backdrop-filter: blur(var(--crm-glass-blur));
        -webkit-backdrop-filter: blur(var(--crm-glass-blur));
        border: 1px solid var(--glass-border);
        border-radius: var(--crm-radius-md);
        box-shadow: var(--glass-shadow);
        transition: var(--crm-transition-medium);
    }

    .card-glass:hover, .glass:hover {
        border-color: var(--crm-contrast-border);
    }

    /* Magic UI Inspired Animations & Premium Effects */
    @keyframes shimmer-move {
        0% { transform: translateX(-100%); }
        100% { transform: translateX(250%); }
    }

    .btn-shimmer {
        position: relative;
        overflow: hidden;
    }

    .btn-shimmer::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transform: translateX(-100%);
        animation: shimmer-move 3.5s infinite ease-in-out;
        pointer-events: none;
    }

    .border-beam-card {
        position: relative;
    }

    .border-beam-card::before {
        content: '';
        position: absolute;
        inset: -1px;
        border-radius: inherit;
        padding: 1px;
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.7), rgba(168, 85, 247, 0.7), transparent 60%);
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
</style>
<style>
    /* ==========================================
       PREMIUM ANIMATION SYSTEM вЂ” RushdCRM
       ========================================== */

    /* === View Transition API === */
    @view-transition {
        navigation: auto;
    }

    ::view-transition-old(root) {
        animation: vt-fade-out 0.22s cubic-bezier(0.4, 0, 1, 1) forwards;
    }

    ::view-transition-new(root) {
        animation: vt-fade-in 0.32s cubic-bezier(0, 0, 0.2, 1) forwards;
    }

    @keyframes vt-fade-out {
        from { opacity: 1; filter: blur(0); }
        to   { opacity: 0; filter: blur(3px); }
    }

    @keyframes vt-fade-in {
        from { opacity: 0; filter: blur(3px); transform: translateY(6px); }
        to   { opacity: 1; filter: blur(0);   transform: translateY(0); }
    }

    /* === Staggered Fade-In Animations === */
    @keyframes stagger-fade-in {
        from {
            opacity: 0;
            transform: translateY(20px) scale(0.97);
            filter: blur(4px);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
            filter: blur(0);
        }
    }

    .animate-stagger-1,
    .animate-stagger-2,
    .animate-stagger-3,
    .animate-stagger-4,
    .animate-stagger-5,
    .animate-stagger-6 {
        opacity: 0;
        animation-name: stagger-fade-in;
        animation-duration: 0.55s;
        animation-fill-mode: forwards;
        animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    }

    .animate-stagger-1 { animation-delay: 0.05s; }
    .animate-stagger-2 { animation-delay: 0.12s; }
    .animate-stagger-3 { animation-delay: 0.19s; }
    .animate-stagger-4 { animation-delay: 0.26s; }
    .animate-stagger-5 { animation-delay: 0.33s; }
    .animate-stagger-6 { animation-delay: 0.40s; }

    /* === Slide-Up Animation === */
    @keyframes slide-up {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .animate-slide-up {
        animation: slide-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
        opacity: 0;
    }

    /* === Scroll-triggered Animations === */
    .animate-on-scroll {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                    filter 0.6s cubic-bezier(0.22, 1, 0.36, 1);
        filter: blur(2px);
        will-change: opacity, transform, filter;
    }

    .animate-on-scroll.is-visible {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }

    /* Stagger children when parent becomes visible */
    .stagger-children.is-visible > * {
        animation: stagger-fade-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        opacity: 0;
    }

    .stagger-children.is-visible > *:nth-child(1) { animation-delay: 0.05s; }
    .stagger-children.is-visible > *:nth-child(2) { animation-delay: 0.12s; }
    .stagger-children.is-visible > *:nth-child(3) { animation-delay: 0.19s; }
    .stagger-children.is-visible > *:nth-child(4) { animation-delay: 0.26s; }
    .stagger-children.is-visible > *:nth-child(5) { animation-delay: 0.33s; }
    .stagger-children.is-visible > *:nth-child(6) { animation-delay: 0.40s; }
    .stagger-children.is-visible > *:nth-child(7) { animation-delay: 0.47s; }
    .stagger-children.is-visible > *:nth-child(8) { animation-delay: 0.54s; }

    /* === Enhanced Skeleton Shimmer === */
    @keyframes skeleton-shimmer {
        0%   { background-position: -400px 0; }
        100% { background-position: 400px 0; }
    }

    .skeleton-shimmer {
        background: linear-gradient(
            90deg,
            var(--surface-muted) 0%,
            color-mix(in srgb, var(--surface-muted) 60%, white) 40%,
            var(--surface-muted) 80%
        );
        background-size: 800px 100%;
        animation: skeleton-shimmer 1.6s infinite ease-in-out;
        border-radius: var(--crm-radius-sm);
    }

    [data-theme="dark"] .skeleton-shimmer {
        background: linear-gradient(
            90deg,
            var(--surface-muted) 0%,
            color-mix(in srgb, var(--surface-muted) 70%, rgba(148, 163, 184, 0.15)) 40%,
            var(--surface-muted) 80%
        );
        background-size: 800px 100%;
    }

    /* === HTMX Transition Enhancements === */
    .htmx-request .htmx-indicator {
        opacity: 1;
        transition: opacity 0.2s ease;
    }

    .htmx-settling {
        opacity: 1;
    }

    .htmx-swapping {
        opacity: 0 !important;
        filter: blur(2px);
        transform: translateY(-4px);
        transition: opacity 0.15s ease, filter 0.15s ease, transform 0.15s ease !important;
    }

    .htmx-added {
        animation: stagger-fade-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
    }

    /* === Scale-In for Modals & Drawers === */
    @keyframes scale-in {
        from {
            opacity: 0;
            transform: scale(0.92) translateY(8px);
            filter: blur(4px);
        }
        to {
            opacity: 1;
            transform: scale(1) translateY(0);
            filter: blur(0);
        }
    }

    @keyframes scale-out {
        from { opacity: 1; transform: scale(1); }
        to   { opacity: 0; transform: scale(0.95) translateY(4px); }
    }

    .animate-scale-in {
        animation: scale-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }

    .animate-scale-out {
        animation: scale-out 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
    }

    /* === Micro-Interactions === */
    .btn-primary,
    .btn-secondary,
    .btn-danger,
    .btn-white,
    button[type="submit"],
    a.btn-primary,
    a.btn-secondary {
        transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                    box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                    filter 0.25s ease,
                    background-color 0.2s ease,
                    border-color 0.2s ease !important;
    }

    .btn-primary:active,
    .btn-secondary:active,
    .btn-danger:active,
    button[type="submit"]:active {
        transform: scale(0.96) !important;
        transition-duration: 0.1s !important;
    }

    /* Input focus glow */
    .input-modern:focus,
    input[type="text"]:focus,
    input[type="email"]:focus,
    input[type="password"]:focus,
    input[type="search"]:focus,
    input[type="tel"]:focus,
    input[type="number"]:focus,
    select:focus,
    textarea:focus {
        transition: border-color 0.2s ease,
                    box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                    transform 0.2s ease !important;
    }

    /* Badge pop animation */
    @keyframes badge-pop {
        0%   { transform: scale(1); }
        40%  { transform: scale(1.25); }
        100% { transform: scale(1); }
    }

    .badge-animate {
        animation: badge-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    /* Smooth tab switching */
    [role="tabpanel"] {
        animation: stagger-fade-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }

    /* Ripple effect */
    .ripple-effect {
        position: relative;
        overflow: hidden;
    }

    .ripple-effect::after {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        pointer-events: none;
        background-image: radial-gradient(circle, rgba(255, 255, 255, 0.25) 10%, transparent 10.01%);
        background-repeat: no-repeat;
        background-position: 50%;
        transform: scale(10, 10);
        opacity: 0;
        transition: transform .4s, opacity .6s;
    }

    .ripple-effect:active::after {
        transform: scale(0, 0);
        opacity: 0.3;
        transition: 0s;
    }

    /* Number counter transition */
    .counter-animate {
        display: inline-block;
        transition: transform 0.3s ease;
    }

    /* Smooth page content entrance */
    main {
        animation: page-content-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }

    @keyframes page-content-in {
        from { opacity: 0; transform: translateY(12px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    /* Tooltip animation */
    @keyframes tooltip-in {
        from { opacity: 0; transform: translateY(4px) scale(0.95); }
        to   { opacity: 1; transform: translateY(0) scale(1); }
    }

    /* Loading dots */
    @keyframes loading-dots {
        0%, 20%  { opacity: 0; }
        50%      { opacity: 1; }
        100%     { opacity: 0; }
    }

    .loading-dots span:nth-child(1) { animation: loading-dots 1.4s infinite 0s; }
    .loading-dots span:nth-child(2) { animation: loading-dots 1.4s infinite 0.2s; }
    .loading-dots span:nth-child(3) { animation: loading-dots 1.4s infinite 0.4s; }

    /* === Tab Transition === */
    .tab-content:not(.hidden) {
        animation: tab-slide-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }

    @keyframes tab-slide-in {
        from {
            opacity: 0;
            transform: translateY(8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* === Due Date Urgency Badges === */
    .due-urgent {
        background-color: rgba(239, 68, 68, 0.15);
        color: rgb(239, 68, 68);
        border: 1px solid rgba(239, 68, 68, 0.3);
        animation: urgent-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    }

    @keyframes urgent-pulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.7; }
    }

    .due-warning {
        background-color: rgba(245, 158, 11, 0.15);
        color: rgb(245, 158, 11);
        border: 1px solid rgba(245, 158, 11, 0.3);
    }

    .due-ok {
        background-color: rgba(16, 185, 129, 0.15);
        color: rgb(16, 185, 129);
        border: 1px solid rgba(16, 185, 129, 0.3);
    }

    /* === Breadcrumb Item Transition === */
    .breadcrumb-item {
        transition: color 0.2s ease, transform 0.2s ease;
    }

    .breadcrumb-item:hover {
        transform: translateX(2px);
    }

    /* === Mobile UX Enhancements & Safe Area === */
    :root {
        --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
        --safe-area-inset-top: env(safe-area-inset-top, 0px);
        --safe-area-inset-left: env(safe-area-inset-left, 0px);
        --safe-area-inset-right: env(safe-area-inset-right, 0px);
    }

    .safe-area-bottom {
        padding-bottom: calc(0.375rem + env(safe-area-inset-bottom, 0px));
    }

    .safe-area-top {
        padding-top: calc(0.375rem + env(safe-area-inset-top, 0px));
    }

    /* Mobile tap highlight reset */
    a, button, input, select, textarea, [role="button"] {
        -webkit-tap-highlight-color: transparent;
    }

    /* Responsive adjustments for Kanban Page Shell */
    @media (max-width: 1023px) {
        .crm-kanban-page-shell {
            height: calc(100dvh - 9rem) !important;
            margin: -1rem !important;
            padding: 0.75rem !important;
        }

        .crm-kanban-column-shell {
            width: 18rem;
            flex: 0 0 18rem;
        }
    }

    @media (max-width: 640px) {
        .crm-kanban-page-shell {
            height: calc(100dvh - 8.5rem) !important;
            margin: -1rem !important;
            padding: 0.5rem !important;
        }

        .crm-kanban-column-shell {
            width: 17rem;
            flex: 0 0 17rem;
        }
    }

    /* Horizontal scroll indicator hint for tables and overflow containers */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    /* Smooth touch action */
    .touch-pan-y {
        touch-action: pan-y;
    }

    /* Mobile quick action menu animations */
    @keyframes mobileMenuPop {
        from {
            opacity: 0;
            transform: translate(-50%, 12px) scale(0.92);
        }
        to {
            opacity: 1;
            transform: translate(-50%, 0) scale(1);
        }
    }

    .animate-mobile-menu {
        animation: mobileMenuPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }
