        :root {
            /* --- Premium SaaS Soft-UI Palette --- */

            /* Neutral Backgrounds */
            --bg-body: #F4F6F9;
            /* Adjusted for better contrast with white cards */
            --bg-glass: #FFFFFF;
            /* Pure white for cards */
            --bg-glass-hover: #FFFFFF;

            /* Brand Colors (Anthrazit) */
            --primary-color: #2D3748;
            /* Elegant dark grey/anthracite for buttons/active states */
            --primary-gradient: linear-gradient(135deg, #2D3748 0%, #1A202C 100%);
            /* Bootstrap overrides for global consistency */
            --bs-primary: #2D3748;
            --bs-primary-rgb: 45, 55, 72;
            --accent-green: #97D700;
            /* Accent Green */
            --accent-green-hover: #86BE00;

            /* Text Colors */
            --text-main: #1E293B;
            /* Deep slate for strong contrast */
            --text-muted: #64748B;
            /* Soft slate for labels */
            --text-on-primary: #FFFFFF;

            /* Borders */
            --border-light: 1px solid rgba(0, 0, 0, 0.04);
            --border-strong: 1px solid rgba(0, 0, 0, 0.08);

            /* Modern Soft Shadows */
            --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
            /* Massive soft shadow for main cards to create depth without borders */
            --shadow-glass: 0 4px 20px rgba(0, 0, 0, 0.04);

            /* Enhanced active shadow for sidebar */
            --shadow-active-nav: 0 4px 14px 0 rgba(47, 60, 114, 0.25);

            /* Radius */
            --radius-sm: 0.5rem;
            /* 8px */
            --radius-md: 0.75rem;
            /* 12px */
            --radius-lg: 1.25rem;
            /* 20px */
            --radius-xl: 1.5rem;
            /* 24px */
        }

        body {
            /* Animated Organic Mesh Gradient Background */
            background: linear-gradient(-45deg, #F4F6F9, #FFFFFF, #E2E8F0, #F1F5F9);
            background-size: 400% 400%;
            animation: meshGradient 15s ease infinite;
            font-family: 'Inter', sans-serif;
            color: var(--text-main);
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            margin: 0;
            min-height: 100vh;
            overflow-x: hidden;
        }

        /* WOW Effect: Organic Mesh Background Animation */
        @keyframes meshGradient {
            0% {
                background-position: 0% 50%;
            }

            50% {
                background-position: 100% 50%;
            }

            100% {
                background-position: 0% 50%;
            }
        }


        /* WOW Effect: Custom SaaS Scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        ::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.02);
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.3);
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: rgba(148, 163, 184, 0.6);
        }

        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            font-weight: 700;
            letter-spacing: -0.02em;
            /* Tighter tracking for headings */
            color: var(--text-main);
            margin-bottom: 0.75rem;
        }

        /* Normalized page headings – consistent 2.25rem across all modules */
        h1.display-6 {
            font-size: 2.25rem !important;
            letter-spacing: -0.03em;
        }

        /* Basic typography tweaks */
        .text-muted {
            color: var(--text-muted) !important;
        }

        /* --- New Clean Sidebar --- */
        .sidebar {
            width: 280px;
            height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
            background: #FFFFFF;
            /* Pure white */
            border-right: 1px solid rgba(0, 0, 0, 0.03);
            /* Extremely subtle border */
            padding-top: 2rem;
            z-index: 3000;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            overflow-y: auto;
            /* Removed shadow for a flatter, integrated look like in the screenshot */
        }

        .sidebar-header {
            padding: 0 1.75rem 1rem 1.75rem;
        }

        /* The "MENU" header text */
        .sidebar-heading {
            font-size: 0.75rem !important;
            letter-spacing: 0.08em;
            /* Adjusted spacing */
            color: #64748B !important;
            /* Lighter text matching mockup */
            font-weight: 700;
            /* Bold */
            text-transform: uppercase;
            padding: 0 1rem;
            margin-top: 2rem;
            margin-bottom: 0.5rem;
        }

        /* Collapsible sidebar section toggle */
        .sidebar-toggle {
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            user-select: none;
            transition: color 0.2s ease;
        }

        .sidebar-toggle:hover {
            color: #334155 !important;
        }

        .sidebar-chevron {
            font-size: 0.65rem;
            transition: transform 0.25s ease;
        }

        /* Rotate chevron when section is collapsed */
        .sidebar-toggle.collapsed .sidebar-chevron,
        .sidebar-toggle[aria-expanded="false"] .sidebar-chevron {
            transform: rotate(-90deg);
        }

        /* Navigation Links container */
        .sidebar .nav {
            padding: 0 1rem;
            /* Container padding */
        }

        .sidebar .nav-link {
            font-size: 0.95rem;
            /* Slightly larger, readable text */
            font-weight: 600;
            /* Bold links */
            padding: 0.75rem 1.25rem;
            margin: 0.2rem 0;
            border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
            /* Curved on the right, flat on left */
            color: #64748B;
            /* Slate 500 */
            display: flex;
            align-items: center;
            gap: 16px;
            /* More space between icon and text */
            transition: all 0.2s ease;
            position: relative;
            border-left: 4px solid transparent;
            /* Prepare for active border */
        }

        /* The Icon */
        .sidebar .nav-link i {
            font-size: 1.25rem;
            width: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #64748B;
            /* Muted icon color */
            transition: all 0.2s ease;
            flex-shrink: 0;
        }

        /* Hover State */
        .sidebar .nav-link:hover {
            background: #F8FAFC;
            /* Very subtle background on hover */
            color: #334155;
            /* Darker text */
        }

        .sidebar .nav-link:hover i {
            color: #334155;
        }

        /* --- Active State based on user screenshot --- */
        .sidebar .nav-link.active {
            background: #F4F6F9;
            /* Very light slate background from mockup */
            color: #0F172A;
            /* Dark almost black text */
            border-left-color: #3B82F6;
            /* Bright blue border on the left matching the screenshot *exactly* */
        }

        .sidebar .nav-link.active i {
            color: #0F172A;
            /* Match text */
        }

        /* Remove the glowing line before the active element from previous design */
        .sidebar .nav-link.active::before {
            display: none;
        }

        /* User Profile / Logout section at bottom */
        .sidebar-footer-container {
            margin-top: auto;
            border-top: 1px solid rgba(0, 0, 0, 0.05);
            /* Separator line */
            padding-top: 1rem;
            margin-top: 1.5rem;
        }

        /* Sidebar Avatar Button hover */
        .sidebar-avatar-btn .user-avatar {
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
            cursor: pointer;
        }

        .sidebar-avatar-btn:hover .user-avatar {
            transform: scale(1.12);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35),
                0 6px 20px rgba(0, 0, 0, 0.18) !important;
        }

        /* Avatar hover zoom effect (tables, etc.) */
        .user-avatar {
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
            cursor: pointer;
        }

        .user-avatar:hover {
            transform: scale(1.5);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3),
                0 8px 25px rgba(0, 0, 0, 0.25),
                0 0 20px rgba(59, 130, 246, 0.15) !important;
            z-index: 50;
            position: relative;
        }

        /* Profile Modal Tabs */
        .profile-modal-tabs {
            border-bottom: 2px solid #E2E8F0;
        }

        .profile-modal-tabs .nav-link {
            border: none;
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            color: var(--text-muted);
            font-weight: 600;
            font-size: 0.88rem;
            padding: 0.6rem 1.1rem;
            transition: all 0.2s ease;
            border-radius: 0;
        }

        .profile-modal-tabs .nav-link:hover {
            color: var(--text-main);
            border-bottom-color: #CBD5E1;
            background: transparent;
        }

        .profile-modal-tabs .nav-link.active {
            color: var(--primary-color);
            border-bottom-color: var(--primary-color);
            background: transparent;
        }

        /* Activity Button styling to match the light blue from screenshot */
        .btn-activity {
            background: #F0F5FF !important;
            /* Very soft light blue */
            border: 1px solid #E0EBFF !important;
            border-radius: var(--radius-md) !important;
            color: #3B82F6 !important;
            /* Bright blue text */
            font-weight: 600 !important;
            padding: 0.6rem 1rem !important;
        }

        .btn-activity:hover {
            background: #E0EBFF !important;
            transform: translateY(-1px);
        }

        .btn-activity i {
            color: #3B82F6;
        }

        /* Content Wrapper */
        .content-wrapper {
            margin-left: 280px;
            padding: 2.5rem 3.5rem;
            transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* Modal z-index fix: ensure modals appear above sidebar (z-index: 3000) */
        .modal-backdrop {
            z-index: 3100 !important;
        }

        .modal {
            z-index: 3200 !important;
        }

        /* --- Premium Clean Cards --- */
        .card {
            border: 1px solid #E2E8F0 !important;
            /* Subtle border added for definition */
            border-radius: var(--radius-lg) !important;
            /* Larger rounding */
            background: var(--bg-glass);
            /* Solid white */
            box-shadow: var(--shadow-glass);
            /* Large soft drop shadow */
            transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
            /* Faster, smoother spring */
            margin-bottom: 2rem;
            color: var(--text-main);
            position: relative;
        }

        /* Card Hover Elevate Effect (WOW Effect) */
        .card:hover {
            transform: translateY(-6px);
            /* Lift up notably */
            box-shadow: 0 22px 45px -8px rgba(0, 0, 0, 0.12), 0 0 15px rgba(59, 83, 198, 0.05);
            /* Deeper shadow with a tiny hint of blue glow */
            border-color: #CBD5E1 !important;
            z-index: 10;
        }

        /* Card Header Styling */
        .card-header {
            background: transparent;
            border-bottom: 1px solid rgba(0, 0, 0, 0.04);
            /* Subtler border */
            padding: 1.5rem 1.5rem 1rem 1.5rem;
            /* More breathing room */
            font-weight: 700;
            /* Bolder headers */
            color: var(--text-main);
            font-size: 1.05rem;
        }

        /* Modern Card Body Padding */
        .card-body {
            padding: 1.5rem;
        }

        /* WOW Effect: Input Liquid Focus */
        .form-control,
        .form-select {
            border: 1px solid #E2E8F0;
            border-radius: var(--radius-sm);
            padding: 0.6rem 1rem;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            background-color: #F8FAFC;
        }

        .form-control:focus,
        .form-select:focus {
            background-color: #FFFFFF;
            border-color: #93C5FD;
            outline: none;
            box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 0 20px rgba(59, 130, 246, 0.05);
            transform: translateY(-1px);
        }

        /* WOW Effect: Glassmorphism Panels */
        .glass-panel {
            background: rgba(255, 255, 255, 0.85) !important;
            backdrop-filter: blur(20px) saturate(1.2);
            -webkit-backdrop-filter: blur(20px) saturate(1.2);
            border: 1px solid rgba(255, 255, 255, 0.7);
        }

        /* --- Clean Buttons --- */
        .btn-primary {
            background: var(--primary-color);
            border: none;
            color: white;
            font-weight: 600;
            padding: 0.6rem 1.25rem;
            border-radius: var(--radius-md);
            box-shadow: 0 4px 6px -1px rgba(45, 55, 72, 0.2);
            transition: all 0.2s ease;
        }

        .btn-primary:hover {
            background: #1A202C;
            /* Darker Anthracite */
            transform: translateY(-2px);
            box-shadow: 0 8px 15px -3px rgba(45, 55, 72, 0.4);
        }

        /* WOW Effect: Glowing Primary Action Button */
        .btn-glow {
            position: relative;
            z-index: 1;
        }

        .btn-glow::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: inherit;
            box-shadow: 0 0 20px rgba(45, 55, 72, 0.6);
            opacity: 0;
            z-index: -1;
            transition: opacity 0.3s ease;
            animation: pulseGlow 2s infinite alternate;
        }

        .btn-glow:hover::after {
            opacity: 1;
        }

        @keyframes pulseGlow {
            0% {
                box-shadow: 0 0 15px rgba(45, 55, 72, 0.4);
            }

            100% {
                box-shadow: 0 0 25px rgba(45, 55, 72, 0.8);
            }
        }

        /* WOW Effect: Micro Bounce */
        @keyframes iconBounce {
            0% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.15) translateY(-2px);
            }

            100% {
                transform: scale(1) translateY(0);
            }
        }

        .icon-bounce {
            transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            display: inline-block;
        }

        .nav-link:hover .icon-bounce,
        .btn:hover .icon-bounce,
        .card:hover .icon-bounce {
            animation: iconBounce 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

        .btn-primary:active {
            transform: translateY(0);
        }

        .btn-outline-primary {
            color: var(--primary-color);
            border-color: rgba(45, 55, 72, 0.5);
            font-weight: 600;
            border-radius: var(--radius-md);
            background: transparent;
        }

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

        /* Nav Pills (like in Maschinen-Typen) */
        .nav-pills .nav-link.active,
        .nav-pills .show>.nav-link {
            background-color: var(--primary-color);
            color: var(--text-on-primary);
            box-shadow: 0 4px 6px -1px rgba(45, 55, 72, 0.2);
        }

        /* --- Tables --- */
        .table {
            --bs-table-bg: transparent;
        }

        /* WOW Effect: Skeleton Loading Shimmer */
        .skeleton {
            background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
            background-size: 200% 100%;
            animation: shimmerEffect 1.5s infinite linear;
            border-radius: 4px;
            color: transparent !important;
            user-select: none;
        }

        .skeleton * {
            visibility: hidden;
        }

        @keyframes shimmerEffect {
            0% {
                background-position: -200% 0;
            }

            100% {
                background-position: 200% 0;
            }
        }

        .table thead th {
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.7rem;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            border-bottom: 1px solid rgba(0, 0, 0, 0.05);
            background-color: rgba(249, 250, 251, 0.5);
            padding: 1rem 1.5rem;
        }

        .table tbody td {
            padding: 1.25rem 1.5rem;
            color: var(--text-main);
            border-bottom: 1px solid rgba(0, 0, 0, 0.03);
            vertical-align: middle;
            font-size: 0.95rem;
        }

        .table tbody tr {
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .table-wow tbody tr {
            border-radius: 8px;
            /* Needs wrapper hack or separate padding sometimes, but we keep it simple */
        }

        .table.table-wow tbody tr:hover {
            background-color: #ffffff;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
            transform: scale(1.002) translateY(-1px);
            z-index: 10;
            position: relative;
        }

        /* WOW Effect: Animated Tooltips Customization */
        .tooltip-wow .tooltip-inner {
            background: rgba(15, 23, 42, 0.9);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 8px 12px;
            font-size: 0.75rem;
            font-weight: 500;
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
            /* Slide up animation is usually handled by Bootstrap, but we can enhance it */
        }

        .tooltip-wow.show {
            animation: tooltipPop 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

        @keyframes tooltipPop {
            0% {
                opacity: 0;
                transform: scale(0.95) translateY(5px);
            }

            100% {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        footer {
            color: var(--text-muted) !important;
            margin-left: 280px;
            transition: margin-left 0.4s ease;
            opacity: 0.7;
        }

        /* --- Pipeline Status Pills (Clean SaaS) --- */
        .status-pill {
            padding: 0.3em 0.75em;
            border-radius: var(--radius-sm);
            /* Boxier modern look instead of full pill */
            font-size: 0.75rem;
            font-weight: 700;
            letter-spacing: 0.05em;
            text-transform: uppercase;
        }

        /* Pipeline Cards (Clean borders, no gradients) */
        .card-draft {
            border-top: 4px solid #94A3B8 !important;
            /* Gray */
        }

        .card-open {
            border-top: 4px solid #3B82F6 !important;
            /* Blue */
        }

        .card-offer {
            border-top: 4px solid #F59E0B !important;
            /* Amber */
        }

        .card-sold {
            border-top: 4px solid #15803D !important;
            /* Dark Green */
        }

        .card-lost {
            border-top: 4px solid #EF4444 !important;
            /* Red */
        }

        /* --- Animations (Staggered Entrance) --- */
        @keyframes fadeSlideUp {
            from {
                opacity: 0;
                transform: translateY(30px) scale(0.98);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        /* WOW Effect: Soft Glowing Pulse */
        @keyframes softPulse {
            0% {
                box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
            }

            70% {
                box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
            }
        }

        /* Applied to icons randomly or on hover */
        .kpi-icon-primary {
            animation: softPulse 3s infinite ease-in-out;
        }

        .kpi-icon-success {
            animation: softPulse 3s infinite ease-in-out 1s;
        }

        .animate-enter {
            animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
            opacity: 0;
            /* Start hidden */
            will-change: transform, opacity;
        }

        .delay-1 {
            animation-delay: 0.1s;
        }

        .delay-2 {
            animation-delay: 0.2s;
        }

        .delay-3 {
            animation-delay: 0.3s;
        }

        .delay-4 {
            animation-delay: 0.2s;
        }

        .delay-5 {
            animation-delay: 0.25s;
        }

        .delay-6 {
            animation-delay: 0.3s;
        }

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

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

        ::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

        /* --- Responsive / Mobile --- */
        @media (max-width: 991.98px) {
            .sidebar {
                transform: translateX(-100%);
            }

            .sidebar.sidebar-open {
                transform: translateX(0);
                box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
            }

            .content-wrapper {
                margin-left: 0;
                padding: 1.5rem;
                padding-top: 5rem;
                /* Space for mobile header */
            }

            footer {
                margin-left: 0;
            }

            /* Mobile Header (Renamed to bust cache) */
            .top-bar-mobile {
                display: flex !important;
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                height: 60px;
                background: #ffffff;
                /* Solid white to ensure visibility */
                border-bottom: 1px solid rgba(0, 0, 0, 0.1);
                z-index: 2000;
                padding: 0 1.5rem;
                align-items: center;
                justify-content: space-between;
                box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            }

            /* Overlay */
            .sidebar-overlay {
                display: none;
                position: fixed;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: rgba(0, 0, 0, 0.5);
                backdrop-filter: blur(4px);
                z-index: 2500;
                opacity: 0;
                transition: opacity 0.3s ease;
            }

            .sidebar-overlay.show {
                display: block;
                opacity: 1;
            }
        }

        /* Desktop: Hide Mobile Header */
        @media (min-width: 992px) {
            .top-bar-mobile {
                display: none !important;
                /* overflow: hidden; */
            }
        }

        /* Desktop Collapsed State */
        body.sidebar-collapsed .sidebar {
            transform: translateX(-280px);
        }

        body.sidebar-collapsed .content-wrapper {
            margin-left: 0;
        }

        body.sidebar-collapsed footer {
            margin-left: 0;
        }

        /* Admin Badge Link */
        .admin-badge-link {
            color: #6b7280;
            /* text-muted */
            border-radius: 0.75rem;
            padding: 0.75rem 1rem;
            margin: 1.5rem 1rem 0.5rem 1rem;
            display: flex;
            align-items: center;
            gap: 12px;
            font-weight: 600;
            text-decoration: none;
            transition: all 0.2s ease;
        }

        .admin-badge-link:hover {
            background: rgba(255, 255, 255, 0.6);
            color: #0ea5e9;
            transform: translateX(4px);
        }

        .admin-badge-link.active {
            background-color: #1f2937;
            /* Dark Anthracite */
            color: #ffffff !important;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }

        .admin-badge-link i {
            font-size: 1.2rem;
            color: #9ca3af;
        }

        .admin-badge-link:hover i {
            color: #0ea5e9;
        }

        /* --- Charts --- */
        .chart-wrapper {
            position: relative;
            height: 300px;
            width: 100%;
        }

        .chart-glass-container {
            position: relative;
            background: var(--bg-glass);
            border: 1px solid #E2E8F0;
            border-radius: var(--radius-md);
            padding: 1rem;
            box-shadow: var(--shadow-sm);
            height: 100%;
            /* Default to full height of parent or set explicitly inline */
        }

        /* --- Activity Dropdown (Sidebar) --- */
        .activity-dropdown-sidebar {
            min-width: 320px;
            max-height: 500px;
            overflow-y: auto;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        /* ── Activity Dropdown Popup ─────────────────────────── */
        .activity-dropdown-popup {
            width: 400px !important;
            min-width: 400px !important;
            border-radius: 16px !important;
            padding: 0 !important;
            overflow: hidden;
            background: #fff;
            animation: fadeSlideIn 0.2s ease;
        }

        @keyframes fadeSlideIn {
            from {
                opacity: 0;
                transform: translateX(-8px);
            }

            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .activity-dd__header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.85rem 1.1rem;
            border-bottom: 1px solid rgba(0, 0, 0, 0.06);
            font-size: 0.8rem;
            font-weight: 700;
            color: #1e293b;
        }

        .activity-dd__all-link {
            font-size: 0.7rem;
            font-weight: 600;
            color: #3b82f6;
            text-decoration: none;
            transition: color 0.15s;
        }

        .activity-dd__all-link:hover {
            color: #2563eb;
        }

        .activity-dd__body {
            max-height: 420px;
            overflow-y: auto;
            padding: 0.35rem 0;
        }

        .activity-dd__body::-webkit-scrollbar {
            width: 4px;
        }

        .activity-dd__body::-webkit-scrollbar-thumb {
            background: rgba(0, 0, 0, 0.1);
            border-radius: 4px;
        }

        .activity-dd__item {
            display: flex;
            gap: 0.7rem;
            padding: 0.6rem 1.1rem;
            transition: background 0.15s ease;
            cursor: default;
            align-items: flex-start;
        }

        .activity-dd__item:hover {
            background: rgba(59, 130, 246, 0.04);
        }

        .activity-dd__node {
            width: 30px;
            height: 30px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-size: 0.75rem;
            margin-top: 1px;
        }

        .activity-dd__content {
            flex: 1;
            min-width: 0;
        }

        .activity-dd__desc {
            font-size: 0.78rem;
            line-height: 1.35;
            color: #374151;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .activity-dd__meta {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-top: 0.25rem;
        }

        .activity-dd__time {
            font-size: 0.65rem;
            color: #94a3b8;
        }

        .activity-dd__user {
            font-size: 0.65rem;
            color: #94a3b8;
        }

        .activity-dd__user i {
            font-size: 0.55rem;
        }

        .activity-dd__footer {
            padding: 0.65rem 1.1rem;
            border-top: 1px solid rgba(0, 0, 0, 0.06);
            text-align: center;
        }

        .activity-dd__footer-link {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.75rem;
            font-weight: 600;
            color: #3b82f6;
            text-decoration: none;
            padding: 0.35rem 1rem;
            border-radius: 20px;
            background: rgba(59, 130, 246, 0.06);
            transition: all 0.15s;
        }

        .activity-dd__footer-link:hover {
            background: rgba(59, 130, 246, 0.12);
            color: #2563eb;
        }

        /* ── Pulse animation for unread badge ──── */
        @keyframes pulse {

            0%,
            100% {
                transform: translate(-50%, -50%) scale(1);
            }

            50% {
                transform: translate(-50%, -50%) scale(1.15);
            }
        }

        /* ═══════════════════════════════════════════════════════════
           ACTIVITY TIMELINE V2
           ═══════════════════════════════════════════════════════════ */
        .activity-timeline {
            position: relative;
            padding: 1rem 0 1rem 2rem;
        }

        /* Vertical line */
        .activity-timeline::before {
            content: '';
            position: absolute;
            left: 1.15rem;
            top: 0;
            bottom: 0;
            width: 2px;
            background: linear-gradient(to bottom, rgba(148, 163, 184, 0.3), rgba(148, 163, 184, 0.08));
        }

        .activity-timeline__item {
            position: relative;
            display: flex;
            gap: 1rem;
            padding-bottom: 0.5rem;
        }

        .activity-timeline__node {
            position: absolute;
            left: -1.35rem;
            top: 0.9rem;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 3px solid var(--bg-body, #F4F7FE);
            z-index: 2;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
            flex-shrink: 0;
        }

        .activity-timeline__card {
            flex: 1;
            background: #ffffff;
            border-radius: 14px;
            padding: 1rem 1.25rem;
            box-shadow: 0 2px 12px -4px rgba(0, 0, 0, 0.06);
            border: 1px solid rgba(0, 0, 0, 0.04);
            transition: all 0.25s ease;
            margin-bottom: 0.5rem;
        }

        .activity-timeline__card:hover {
            box-shadow: 0 6px 24px -6px rgba(0, 0, 0, 0.1);
            transform: translateY(-1px);
        }

        .activity-timeline__card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 0.5rem;
            gap: 0.5rem;
        }

        .activity-timeline__time {
            font-size: 0.7rem;
            color: #94a3b8;
            white-space: nowrap;
            flex-shrink: 0;
            cursor: help;
        }

        .activity-timeline__cat-badge {
            font-size: 0.6rem;
            font-weight: 600;
            padding: 0.15rem 0.5rem;
            border-radius: 20px;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            white-space: nowrap;
        }

        .activity-timeline__action-label {
            font-size: 0.7rem;
            font-weight: 600;
            white-space: nowrap;
        }

        .activity-timeline__desc {
            font-size: 0.88rem;
            color: #334155;
            line-height: 1.5;
            margin-bottom: 0.5rem;
        }

        .activity-timeline__meta {
            display: flex;
            gap: 0.75rem;
            align-items: center;
            flex-wrap: wrap;
        }

        .activity-timeline__value-badge {
            background: linear-gradient(135deg, #10b981, #059669);
            color: white;
            font-size: 0.7rem;
            font-weight: 700;
            padding: 0.2rem 0.6rem;
            border-radius: 20px;
            letter-spacing: 0.02em;
        }

        .activity-timeline__entity-link {
            font-size: 0.72rem;
            font-weight: 600;
            color: #3b82f6;
            text-decoration: none;
            padding: 0.15rem 0.5rem;
            border-radius: 6px;
            background: rgba(59, 130, 246, 0.06);
            transition: all 0.2s ease;
        }

        .activity-timeline__entity-link:hover {
            background: rgba(59, 130, 246, 0.12);
            color: #2563eb;
        }

        .activity-timeline__ip {
            font-size: 0.65rem;
        }

        /* Date Separator */
        .activity-timeline__date-sep {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem 0 0.5rem;
            margin-left: -2rem;
        }

        .activity-timeline__date-sep::before {
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            top: 50%;
            height: 1px;
            background: linear-gradient(to right, transparent, rgba(148, 163, 184, 0.2), transparent);
        }

        .activity-timeline__date-badge {
            position: relative;
            z-index: 2;
            background: var(--bg-body, #F4F7FE);
            color: #64748b;
            font-size: 0.7rem;
            font-weight: 700;
            padding: 0.3rem 0.9rem;
            border-radius: 20px;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            border: 1px solid rgba(148, 163, 184, 0.2);
        }

        /* Expandable Details */
        .activity-timeline__details-content {
            background: rgba(248, 250, 252, 0.8);
            border-radius: 10px;
            padding: 0.75rem 1rem;
            border: 1px solid rgba(0, 0, 0, 0.04);
        }

        .activity-timeline__detail-row {
            display: flex;
            gap: 0.75rem;
            padding: 0.25rem 0;
            border-bottom: 1px solid rgba(0, 0, 0, 0.03);
            font-size: 0.8rem;
        }

        .activity-timeline__detail-row:last-child {
            border-bottom: none;
        }

        .activity-timeline__detail-key {
            font-weight: 600;
            color: #64748b;
            min-width: 100px;
            text-transform: capitalize;
        }

        .activity-timeline__detail-val {
            color: #334155;
        }

        /* KPI purple variant (for "top user") */
        .kpi-stat__icon--purple {
            background: linear-gradient(135deg, #8b5cf6, #7c3aed);
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
        }

        /* ── Dark Mode Overrides ─────────────────────────── */
        [data-theme="dark"] .activity-timeline::before {
            background: linear-gradient(to bottom, rgba(100, 116, 139, 0.3), rgba(100, 116, 139, 0.08));
        }

        [data-theme="dark"] .activity-timeline__node {
            border-color: #050505;
        }

        [data-theme="dark"] .activity-timeline__card {
            background: #111111;
            border-color: rgba(255, 255, 255, 0.06);
        }

        [data-theme="dark"] .activity-timeline__desc {
            color: #cbd5e1;
        }

        [data-theme="dark"] .activity-timeline__date-badge {
            background: #050505;
            color: #94a3b8;
            border-color: rgba(148, 163, 184, 0.15);
        }

        [data-theme="dark"] .activity-timeline__details-content {
            background: rgba(15, 23, 42, 0.6);
            border-color: rgba(255, 255, 255, 0.06);
        }

        [data-theme="dark"] .activity-timeline__detail-key {
            color: #94a3b8;
        }

        [data-theme="dark"] .activity-timeline__detail-val {
            color: #cbd5e1;
        }

        /* ── Activity Dropdown Popup – Dark Mode ─────────── */
        [data-theme="dark"] .activity-dropdown-popup {
            background: #1a1a2e;
            border: 1px solid rgba(255, 255, 255, 0.06);
        }

        [data-theme="dark"] .activity-dd__header {
            color: #e2e8f0;
            border-bottom-color: rgba(255, 255, 255, 0.06);
        }

        [data-theme="dark"] .activity-dd__desc {
            color: #cbd5e1;
        }

        [data-theme="dark"] .activity-dd__item:hover {
            background: rgba(255, 255, 255, 0.04);
        }

        [data-theme="dark"] .activity-dd__footer {
            border-top-color: rgba(255, 255, 255, 0.06);
        }

        [data-theme="dark"] .activity-dd__footer-link {
            background: rgba(99, 102, 241, 0.1);
            color: #818cf8;
        }

        [data-theme="dark"] .activity-dd__footer-link:hover {
            background: rgba(99, 102, 241, 0.2);
        }

        /* ── Responsive ─────────────────────────────────── */
        @media (max-width: 768px) {
            .activity-timeline {
                padding-left: 1.5rem;
            }

            .activity-timeline__card-header {
                flex-direction: column;
            }

            .activity-timeline__date-sep {
                margin-left: -1.5rem;
            }
        }

        /* --- NProgress Top Bar --- */
        #nprogress {
            position: fixed;
            top: 0;
            left: 0;
            height: 3px;
            width: 0;
            background: linear-gradient(90deg, #0ea5e9, #8b5cf6);
            z-index: 9999;
            transition: width 0.4s ease, opacity 0.3s ease;
            border-radius: 0 2px 2px 0;
        }

        /* --- Ripple Effect --- */
        .ripple {
            position: absolute;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.4);
            transform: scale(0);
            animation: ripple-animation 0.6s linear;
            pointer-events: none;
        }

        @keyframes ripple-animation {
            to {
                transform: scale(4);
                opacity: 0;
            }
        }

        /* --- Animations Handled Above --- */

        /* ================================================
           VISUAL POLISH — Wow Effects
           ================================================ */

        /* --- 1. Top Navigation & Stats Bar --- */
        .page-header-container {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 2rem;
            animation: fadeSlideUp 0.5s ease forwards;
            /* Quick intro */
        }

        .page-title {
            font-size: 1.75rem;
            font-weight: 800;
            color: var(--text-main);
            margin: 0;
        }

        .page-subtitle {
            color: var(--text-muted);
            font-size: 0.95rem;
            margin-top: 0.25rem;
        }

        /* --- 2. Smooth Table Row Interactions --- */
        .table tbody tr:hover {
            background-color: rgba(14, 165, 233, 0.04) !important;
        }

        .table tbody tr td:first-child {
            border-left: 3px solid transparent;
            transition: border-color 0.25s ease;
        }

        .table tbody tr:hover td:first-child {
            border-left-color: #0ea5e9;
        }

        /* WOW Effect: Deep Row Hover */
        .table tbody tr {
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .table tbody tr:hover {
            background-color: #F8FAFC !important;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) inset;
        }

        .table tbody tr:hover td {
            color: var(--primary-color);
        }

        /* --- 3. Toast Notifications --- */
        .toast-container-custom {
            position: fixed;
            top: 1.5rem;
            right: 1.5rem;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .toast-custom {
            min-width: 320px;
            max-width: 420px;
            padding: 1rem 1.25rem;
            border-radius: var(--radius-md);
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.8);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
            position: relative;
            overflow: hidden;
        }

        .toast-custom.toast-exit {
            animation: toastSlideOut 0.3s ease forwards;
        }

        .toast-custom .toast-icon {
            font-size: 1.25rem;
            flex-shrink: 0;
            margin-top: 1px;
        }

        .toast-custom .toast-body {
            flex: 1;
            font-size: 0.9rem;
            line-height: 1.4;
            color: var(--text-main);
        }

        .toast-custom .toast-close {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 0;
            font-size: 1.1rem;
            opacity: 0.5;
            transition: opacity 0.2s;
        }

        .toast-custom .toast-close:hover {
            opacity: 1;
        }

        .toast-custom.toast-success {
            border-left: 4px solid #10b981;
        }

        .toast-custom.toast-danger {
            border-left: 4px solid #ef4444;
        }

        .toast-custom.toast-warning {
            border-left: 4px solid #f59e0b;
        }

        .toast-custom.toast-info {
            border-left: 4px solid #0ea5e9;
        }

        .toast-custom.toast-success .toast-icon {
            color: #10b981;
        }

        .toast-custom.toast-danger .toast-icon {
            color: #ef4444;
        }

        .toast-custom.toast-warning .toast-icon {
            color: #f59e0b;
        }

        .toast-custom.toast-info .toast-icon {
            color: #0ea5e9;
        }

        .toast-custom .toast-progress {
            position: absolute;
            bottom: 0;
            left: 0;
            height: 3px;
            border-radius: 0 0 0 var(--radius-md);
            animation: toastProgress 5s linear forwards;
        }

        .toast-custom.toast-success .toast-progress {
            background: #10b981;
        }

        .toast-custom.toast-danger .toast-progress {
            background: #ef4444;
        }

        .toast-custom.toast-warning .toast-progress {
            background: #f59e0b;
        }

        .toast-custom.toast-info .toast-progress {
            background: #0ea5e9;
        }

        @keyframes toastSlideIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes toastSlideOut {
            from {
                transform: translateX(0);
                opacity: 1;
            }

            to {
                transform: translateX(100%);
                opacity: 0;
            }
        }

        @keyframes toastProgress {
            from {
                width: 100%;
            }

            to {
                width: 0%;
            }
        }

        /* --- 4. KPI Gradient Icons --- */
        .kpi-icon {
            width: 52px;
            height: 52px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 14px;
            font-size: 1.4rem;
            position: relative;
            overflow: hidden;
        }

        .kpi-icon::after {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
            animation: shimmer 3s ease-in-out infinite;
        }

        @keyframes shimmer {
            0% {
                transform: translateX(-100%) rotate(45deg);
            }

            100% {
                transform: translateX(100%) rotate(45deg);
            }
        }

        .kpi-icon-primary {
            background: linear-gradient(135deg, #374151, #1f2937);
            color: white;
            box-shadow: 0 4px 12px rgba(55, 65, 81, 0.3);
        }

        .kpi-icon-success {
            background: linear-gradient(135deg, #10b981, #059669);
            color: white;
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
        }

        .kpi-icon-danger {
            background: linear-gradient(135deg, #ef4444, #dc2626);
            color: white;
            box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
        }

        .kpi-icon-info {
            background: linear-gradient(135deg, #0ea5e9, #0284c7);
            color: white;
            box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
        }

        /* --- 5. Login Page Enhancements --- */
        .login-card {
            animation: loginFloat 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

        @keyframes loginFloat {
            from {
                opacity: 0;
                transform: translateY(30px) scale(0.98);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .login-title {
            font-size: 1.6rem;
            font-weight: 700;
            background: linear-gradient(135deg, #1f2937, #4b5563, #0ea5e9);
            background-size: 200% 200%;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: gradientShift 4s ease infinite;
        }

        @keyframes gradientShift {

            0%,
            100% {
                background-position: 0% 50%;
            }

            50% {
                background-position: 100% 50%;
            }
        }

        .form-control-glass {
            background: rgba(255, 255, 255, 0.6);
            border: 1px solid rgba(0, 0, 0, 0.08);
            border-radius: var(--radius-md);
            padding: 0.7rem 1rem;
            transition: all 0.3s ease;
        }

        .form-control-glass:hover {
            background: rgba(255, 255, 255, 0.8);
            border-color: rgba(0, 0, 0, 0.12);
        }

        /* --- 6. Smooth Progress Bars --- */
        .progress-bar {
            transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* ================================================
           VISUAL POLISH — Round 2
           ================================================ */

        /* --- 7. Animated Win-Rate Ring --- */
        .win-rate-ring {
            width: 160px;
            height: 160px;
            border-radius: 50%;
            background: conic-gradient(var(--primary-color) calc(var(--win-pct, 0) * 1%),
                    #e5e7eb 0);
            transition: --win-pct 1.5s cubic-bezier(0.4, 0, 0.2, 1);
        }

        @property --win-pct {
            syntax: '<number>';
            inherits: false;
            initial-value: 0;
        }

        /* --- 8. Leaderboard #1 Golden Glow --- */
        .leaderboard-gold {
            background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(253, 185, 49, 0.04)) !important;
            position: relative;
        }

        .leaderboard-gold td:first-child {
            border-left: 3px solid #FFD700 !important;
        }

        .leaderboard-gold td {
            padding-top: 1.2rem !important;
            padding-bottom: 1.2rem !important;
        }

        /* --- 9. Scroll-Reveal Animations --- */
        .scroll-reveal {
            opacity: 0;
            transform: translateY(20px);
            transition: opacity 0.6s ease, transform 0.6s ease;
        }

        .scroll-reveal.revealed {
            opacity: 1;
            transform: translateY(0);
        }

        /* --- 10. Animated Search Focus --- */
        .form-control,
        .form-select {
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
        }

        .form-control:focus,
        .form-select:focus {
            border-color: #0ea5e9;
            box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12), 0 2px 8px rgba(14, 165, 233, 0.08);
        }

        /* --- 11. Skeleton Loading --- */
        .skeleton {
            background: linear-gradient(90deg,
                    rgba(0, 0, 0, 0.04) 25%,
                    rgba(0, 0, 0, 0.08) 50%,
                    rgba(0, 0, 0, 0.04) 75%);
            background-size: 200% 100%;
            animation: skeletonShimmer 1.5s infinite;
            border-radius: var(--radius-sm);
        }

        .skeleton-text {
            height: 1em;
            margin-bottom: 0.5em;
            width: 80%;
        }

        .skeleton-title {
            height: 1.5em;
            margin-bottom: 0.75em;
            width: 60%;
        }

        .skeleton-circle {
            border-radius: 50%;
        }

        @keyframes skeletonShimmer {
            0% {
                background-position: 200% 0;
            }

            100% {
                background-position: -200% 0;
            }
        }

        /* --- 12. Pipeline Card Pulse --- */
        .pipeline-pulse {
            animation: pipelinePulse 3s ease-in-out infinite;
        }

        @keyframes pipelinePulse {

            0%,
            100% {
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            }

            50% {
                box-shadow: 0 4px 20px rgba(14, 165, 233, 0.15);
            }
        }

        /* --- 13. Custom Tooltips --- */
        [data-tooltip] {
            position: relative;
        }

        [data-tooltip]::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%) translateY(4px);
            padding: 0.5rem 0.85rem;
            background: #1f2937;
            color: white;
            font-size: 0.78rem;
            line-height: 1.3;
            border-radius: 8px;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            z-index: 100;
        }

        [data-tooltip]::before {
            content: '';
            position: absolute;
            bottom: calc(100% + 2px);
            left: 50%;
            transform: translateX(-50%);
            border: 5px solid transparent;
            border-top-color: #1f2937;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s;
            z-index: 100;
        }

        [data-tooltip]:hover::after {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        [data-tooltip]:hover::before {
            opacity: 1;
        }

        /* --- 13.5 Ticket Priority Pill Buttons --- */
        #prio_low:checked+label {
            background-color: var(--bs-success) !important;
            color: white !important;
            box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
        }

        #prio_med:checked+label {
            background-color: var(--bs-primary) !important;
            color: white !important;
            box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
        }

        #prio_high:checked+label {
            background-color: var(--bs-warning) !important;
            color: white !important;
            box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
        }

        #prio_crit:checked+label {
            background-color: var(--bs-danger) !important;
            color: white !important;
            box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
        }

        /* --- 14. Ultra Premium 3D Tilt Card --- */
        .auto-tilt-card {
            transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
            transform-style: preserve-3d;
            will-change: transform;
            /* Enhance the shadow on hover naturally as it tilts */
        }

        .auto-tilt-card:hover {
            box-shadow: 0 25px 50px -12px rgba(45, 55, 72, 0.25) !important;
            z-index: 10;
        }

        /* Push content off the background card for depth */
        .auto-tilt-card .card-body {
            transform: translateZ(30px);
            transform-style: preserve-3d;
        }

        /* Push key elements even further out for crazy 3D depth */
        .auto-tilt-card .card-body>h2,
        .auto-tilt-card .card-body>.d-flex.align-items-center {
            transform: translateZ(50px);
        }

        /* --- 15. OLED Dark Mode (Deep Black SaaS) --- */
        [data-theme="dark"] {
            /* True OLED dark base */
            --bg-body: #050505;
            /* Almost pure black for extreme contrast */
            --bg-glass: #121212;
            /* Slightly lighter for cards */
            --bg-glass-hover: #1A1A1A;

            /* Override Typography */
            --text-main: #F8FAFC;
            --text-muted: #94A3B8;
            --text-on-primary: #FFFFFF;

            /* Borders */
            --border-light: 1px solid rgba(255, 255, 255, 0.05);
            --border-strong: 1px solid rgba(255, 255, 255, 0.1);

            /* Shadows become subtle glow effects in dark mode */
            --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.5);
            --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.8);
            --shadow-glass: 0 10px 40px rgba(0, 0, 0, 0.8);
            --shadow-active-nav: 0 4px 14px 0 rgba(0, 0, 0, 0.8);

            /* Bootstrap Variables to override default text color in tables etc */
            --bs-body-bg: var(--bg-body);
            --bs-body-color: var(--text-main);
        }

        /* Essential Overrides */
        [data-theme="dark"] body {
            background: var(--bg-body) !important;
            animation: globalFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
            /* Disable mesh gradient for pure black */
        }

        [data-theme="dark"] .sidebar {
            background-color: #0A0A0A !important;
            border-right: var(--border-light);
        }

        [data-theme="dark"] .sidebar .nav-link {
            color: var(--text-muted);
        }

        [data-theme="dark"] .sidebar .nav-link.active {
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-main);
            border-left-color: var(--accent-green);
            /* Neon green active indicator in dark mode looks sick! */
        }

        [data-theme="dark"] .table {
            color: var(--text-main);
            --bs-table-color: var(--text-main);
            --bs-table-bg: transparent;
            --bs-table-hover-bg: rgba(255, 255, 255, 0.03);
            --bs-table-hover-color: var(--text-main);
        }

        [data-theme="dark"] .form-control,
        [data-theme="dark"] .form-select {
            background-color: #1A1A1A;
            color: var(--text-main);
            border-color: rgba(255, 255, 255, 0.1);
        }

        [data-theme="dark"] .form-control:focus,
        [data-theme="dark"] .form-select:focus {
            background-color: #222;
            color: var(--text-main);
            border-color: var(--primary-color);
        }

        [data-theme="dark"] .modal-content {
            background-color: var(--bg-glass) !important;
            color: var(--text-main);
            border: var(--border-light);
        }

        [data-theme="dark"] .modal-header[style*="linear-gradient"] {
            background: linear-gradient(135deg, #1A1A1A, #111827) !important;
        }

        [data-theme="dark"] .profile-modal-tabs {
            border-bottom-color: rgba(255, 255, 255, 0.1);
        }

        [data-theme="dark"] .profile-modal-tabs .nav-link {
            color: var(--text-muted);
        }

        [data-theme="dark"] .profile-modal-tabs .nav-link:hover {
            color: var(--text-main);
            border-bottom-color: rgba(255, 255, 255, 0.2);
        }

        [data-theme="dark"] .profile-modal-tabs .nav-link.active {
            color: #F8FAFC;
            border-bottom-color: #F8FAFC;
        }

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

        [data-theme="dark"] .bg-light {
            background-color: #1A1A1A !important;
        }

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

        [data-theme="dark"] .text-dark {
            color: #F8FAFC !important;
        }

        [data-theme="dark"] .btn-outline-secondary {
            color: var(--text-muted);
            border-color: rgba(255, 255, 255, 0.1);
        }

        [data-theme="dark"] .btn-outline-secondary:hover {
            background-color: rgba(255, 255, 255, 0.05);
            color: var(--text-main);
        }


        /* ═══════════════════════════════════════════════════════════════════
           KPI COMMAND CENTER – Panel-Based Analytics (Premium)
           ═══════════════════════════════════════════════════════════════════ */

        .kpi-dashboard {
            animation: fadeSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

        /* ── Entrance Animations ───────────────────────────────────────── */
        .animate-enter {
            animation: kpiSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
        }

        .delay-1 {
            animation-delay: 0.08s;
        }

        .delay-2 {
            animation-delay: 0.16s;
        }

        @keyframes kpiSlideIn {
            from {
                opacity: 0;
                transform: translateY(12px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* ── Base Panel ────────────────────────────────────────────────── */
        .kpi-panel {
            background: #FFFFFF;
            border: 1px solid #E2E8F0;
            border-radius: var(--radius-lg);
            padding: 1.25rem 1.5rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03),
                0 4px 12px rgba(0, 0, 0, 0.02);
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        /* Pipeline panel gets bottom margin */
        .kpi-panel--pipeline {
            margin-bottom: 0.75rem;
        }

        /* Side-by-side panels equal height */
        .kpi-dashboard .row>[class*="col"]>.kpi-panel {
            height: 100%;
        }

        .kpi-panel::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #3B82F6, #6366F1, #8B5CF6);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .kpi-panel:hover {
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06),
                0 1px 3px rgba(0, 0, 0, 0.03);
            border-color: #CBD5E1;
        }

        .kpi-panel:hover::before {
            opacity: 1;
        }

        /* Pipeline panel always shows the accent bar */
        .kpi-panel--pipeline::before {
            opacity: 1;
            background: linear-gradient(90deg, #0EA5E9, #3B82F6, #6366F1);
        }

        .kpi-panel__header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .kpi-panel__title {
            font-size: 0.7rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #94A3B8;
        }

        .kpi-panel__title i {
            opacity: 0.7;
        }

        .kpi-panel__total {
            font-size: 0.75rem;
            font-weight: 700;
            color: #FFFFFF;
            background: linear-gradient(135deg, #3B82F6, #6366F1);
            padding: 0.3rem 0.75rem;
            border-radius: 100px;
            letter-spacing: 0.02em;
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
        }

        /* ── Pipeline Status Bar ───────────────────────────────────────── */
        .pipeline-bar {
            display: flex;
            height: 10px;
            border-radius: 100px;
            overflow: hidden;
            background: #F1F5F9;
            gap: 2px;
            box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
        }

        .pipeline-bar__seg {
            height: 100%;
            border-radius: 100px;
            min-width: 3px;
            transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
        }

        .pipeline-bar__seg:hover {
            filter: brightness(1.15);
            transform: scaleY(1.3);
        }

        .pipeline-bar__seg--info {
            background: linear-gradient(135deg, #0EA5E9, #38BDF8);
        }

        .pipeline-bar__seg--secondary {
            background: linear-gradient(135deg, #64748B, #94A3B8);
        }

        .pipeline-bar__seg--warning {
            background: linear-gradient(135deg, #F59E0B, #FBBF24);
        }

        .pipeline-bar__seg--primary {
            background: linear-gradient(135deg, #1E293B, #475569);
        }

        .pipeline-bar__seg--success {
            background: linear-gradient(135deg, #059669, #10B981);
        }

        .pipeline-bar__seg--danger {
            background: linear-gradient(135deg, #DC2626, #EF4444);
        }

        /* ── Pipeline Counters ─────────────────────────────────────────── */
        .pipeline-counters {
            display: flex;
            flex-wrap: wrap;
            gap: 0;
        }

        .pipeline-counter {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            flex: 1 1 auto;
            min-width: 0;
            padding: 0.6rem 0.85rem;
            border-radius: 0.6rem;
            text-decoration: none;
            transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
            cursor: pointer;
            position: relative;
        }

        .pipeline-counter+.pipeline-counter::before {
            content: '';
            position: absolute;
            left: 0;
            top: 25%;
            height: 50%;
            width: 1px;
            background: #E2E8F0;
        }

        .pipeline-counter:hover {
            background: #F1F5F9;
            transform: translateY(-2px);
        }

        .pipeline-counter:hover::before {
            opacity: 0;
        }

        .pipeline-counter__dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
            transition: all 0.25s ease;
        }

        .pipeline-counter:hover .pipeline-counter__dot {
            transform: scale(1.3);
        }

        .pipeline-counter__dot--info {
            background: #0EA5E9;
            box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
        }

        .pipeline-counter__dot--secondary {
            background: #94A3B8;
            box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
        }

        .pipeline-counter__dot--warning {
            background: #F59E0B;
            box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
        }

        .pipeline-counter__dot--primary {
            background: #2D3748;
            box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.12);
        }

        .pipeline-counter__dot--success {
            background: #10B981;
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
        }

        .pipeline-counter__dot--danger {
            background: #EF4444;
            box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
        }

        .pipeline-counter__num {
            font-size: 1.15rem;
            font-weight: 800;
            color: #1E293B;
            line-height: 1;
            letter-spacing: -0.02em;
        }

        .pipeline-counter__lbl {
            font-size: 0.6rem;
            font-weight: 600;
            color: #94A3B8;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* ── Stat Grid (2×2 Activity) ──────────────────────────────────── */
        .kpi-stat-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.75rem;
            flex: 1;
        }

        .kpi-stat {
            display: flex;
            align-items: center;
            gap: 0.65rem;
            padding: 0.6rem 0.7rem;
            border-radius: 0.65rem;
            background: #F8FAFC;
            border: 1px solid transparent;
            transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .kpi-stat:hover {
            background: #F1F5F9;
            border-color: #E2E8F0;
            transform: translateY(-1px);
        }

        .kpi-stat--alert {
            background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
            border: 1px solid #FECACA;
            animation: subtlePulse 2.5s ease-in-out infinite;
        }

        @keyframes subtlePulse {

            0%,
            100% {
                box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.15);
            }

            50% {
                box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
            }
        }

        .kpi-stat--alert .kpi-stat__value {
            color: #DC2626;
        }

        .kpi-stat__icon {
            width: 36px;
            height: 36px;
            border-radius: 0.55rem;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            flex-shrink: 0;
            transition: all 0.25s ease;
        }

        .kpi-stat:hover .kpi-stat__icon {
            transform: scale(1.08);
        }

        .kpi-stat__icon--red {
            background: linear-gradient(135deg, #FEE2E2, #FECACA);
            color: #EF4444;
            box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12);
        }

        .kpi-stat__icon--orange {
            background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
            color: #F97316;
            box-shadow: 0 2px 8px rgba(249, 115, 22, 0.12);
        }

        .kpi-stat__icon--blue {
            background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
            color: #3B82F6;
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
        }

        .kpi-stat__value {
            font-size: 1.15rem;
            font-weight: 800;
            color: #1E293B;
            line-height: 1;
            letter-spacing: -0.02em;
        }

        .kpi-stat__label {
            font-size: 0.58rem;
            font-weight: 600;
            color: #94A3B8;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        /* ── Gradient Divider ──────────────────────────────────────────── */
        .kpi-divider {
            height: 1px;
            background: #E2E8F0;
            margin: 0.875rem 0;
        }

        .kpi-divider--gradient {
            height: 1px;
            background: linear-gradient(90deg,
                    transparent,
                    #CBD5E1 20%,
                    #94A3B8 50%,
                    #CBD5E1 80%,
                    transparent);
            opacity: 0.5;
        }

        /* ── Quality Row (Footer Stats) ────────────────────────────────── */
        .kpi-quality-row {
            display: flex;
            justify-content: space-around;
            gap: 0.5rem;
        }

        .kpi-quality-item {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.3rem 0.6rem;
            border-radius: 0.5rem;
            transition: all 0.2s ease;
        }

        .kpi-quality-item:hover {
            background: #F1F5F9;
            transform: translateY(-1px);
        }

        .kpi-quality-item i {
            font-size: 0.9rem;
        }

        .kpi-quality-item__val {
            font-size: 1rem;
            font-weight: 800;
            color: #1E293B;
            letter-spacing: -0.02em;
        }

        .kpi-quality-item__lbl {
            font-size: 0.55rem;
            font-weight: 600;
            color: #94A3B8;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        .kpi-quality-item--accent {
            background: linear-gradient(135deg, #F0FDF4, #DCFCE7);
            border-radius: 100px;
            padding: 0.3rem 0.75rem;
            border: 1px solid rgba(16, 185, 129, 0.15);
        }

        .kpi-quality-item--accent:hover {
            background: linear-gradient(135deg, #DCFCE7, #BBF7D0);
        }

        /* ── Distribution List ─────────────────────────────────────────── */
        .kpi-dist-list {
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
            flex: 1;
        }

        .kpi-dist-item {
            display: flex;
            align-items: center;
            gap: 0.65rem;
            padding: 0.45rem 0.6rem;
            border-radius: 0.55rem;
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            border: 1px solid transparent;
        }

        .kpi-dist-item:hover {
            background: #F8FAFC;
            border-color: #E2E8F0;
            transform: translateX(4px);
        }

        .kpi-dist-item__icon {
            width: 30px;
            height: 30px;
            border-radius: 0.45rem;
            background: #F1F5F9;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            color: #64748B;
            flex-shrink: 0;
            transition: all 0.25s ease;
        }

        .kpi-dist-item:hover .kpi-dist-item__icon {
            transform: scale(1.1);
        }

        /* Distribution Icon Color Variants */
        .kpi-dist-item__icon--indigo {
            background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
            color: #6366F1;
            box-shadow: 0 2px 6px rgba(99, 102, 241, 0.1);
        }

        .kpi-dist-item__icon--emerald {
            background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
            color: #10B981;
            box-shadow: 0 2px 6px rgba(16, 185, 129, 0.1);
        }

        .kpi-dist-item__icon--orange {
            background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
            color: #F97316;
            box-shadow: 0 2px 6px rgba(249, 115, 22, 0.1);
        }

        .kpi-dist-item__icon--violet {
            background: linear-gradient(135deg, #F5F3FF, #EDE9FE);
            color: #8B5CF6;
            box-shadow: 0 2px 6px rgba(139, 92, 246, 0.1);
        }

        .kpi-dist-item__info {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
        }

        .kpi-dist-item__label {
            font-size: 0.55rem;
            font-weight: 600;
            color: #94A3B8;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .kpi-dist-item__value {
            font-size: 0.88rem;
            font-weight: 700;
            color: #1E293B;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .kpi-dist-item__badge {
            background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
            color: #3B82F6;
            font-size: 0.65rem;
            font-weight: 800;
            padding: 0.2rem 0.55rem;
            border-radius: 100px;
            flex-shrink: 0;
            box-shadow: 0 1px 4px rgba(59, 130, 246, 0.1);
            transition: all 0.2s ease;
        }

        .kpi-dist-item:hover .kpi-dist-item__badge {
            transform: scale(1.05);
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
        }

        /* ── Responsive ────────────────────────────────────────────────── */
        @media (max-width: 575.98px) {
            .pipeline-counters {
                gap: 0;
            }

            .pipeline-counter {
                min-width: 33%;
                padding: 0.4rem 0.5rem;
            }

            .pipeline-counter__num {
                font-size: 0.95rem;
            }

            .pipeline-counter+.pipeline-counter::before {
                display: none;
            }

            .kpi-stat-grid {
                grid-template-columns: 1fr 1fr;
                gap: 0.5rem;
            }

            .kpi-quality-row {
                flex-wrap: wrap;
            }

            .kpi-panel {
                padding: 1rem 1.15rem;
            }
        }

        /* ── Dark Theme ────────────────────────────────────────────────── */
        [data-theme="dark"] .kpi-panel {
            background: #111111;
            border-color: rgba(255, 255, 255, 0.06);
        }

        [data-theme="dark"] .kpi-panel:hover {
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            border-color: rgba(255, 255, 255, 0.1);
        }

        [data-theme="dark"] .kpi-panel::before {
            opacity: 0.7;
        }

        [data-theme="dark"] .kpi-panel--pipeline::before {
            opacity: 0.8;
        }

        [data-theme="dark"] .kpi-panel__total {
            box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
        }

        [data-theme="dark"] .pipeline-bar {
            background: #1A1A1A;
            box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
        }

        [data-theme="dark"] .pipeline-counter+.pipeline-counter::before {
            background: rgba(255, 255, 255, 0.06);
        }

        [data-theme="dark"] .pipeline-counter:hover {
            background: rgba(255, 255, 255, 0.04);
        }

        [data-theme="dark"] .pipeline-counter__num {
            color: #F1F5F9;
        }

        [data-theme="dark"] .kpi-stat {
            background: rgba(255, 255, 255, 0.03);
        }

        [data-theme="dark"] .kpi-stat:hover {
            background: rgba(255, 255, 255, 0.06);
            border-color: rgba(255, 255, 255, 0.08);
        }

        [data-theme="dark"] .kpi-stat--alert {
            background: rgba(220, 38, 38, 0.08);
            border-color: rgba(220, 38, 38, 0.15);
        }

        [data-theme="dark"] .kpi-stat__value,
        [data-theme="dark"] .kpi-quality-item__val,
        [data-theme="dark"] .kpi-dist-item__value {
            color: #F1F5F9;
        }

        [data-theme="dark"] .kpi-divider {
            background: rgba(255, 255, 255, 0.06);
        }

        [data-theme="dark"] .kpi-divider--gradient {
            background: linear-gradient(90deg,
                    transparent,
                    rgba(255, 255, 255, 0.08) 20%,
                    rgba(255, 255, 255, 0.12) 50%,
                    rgba(255, 255, 255, 0.08) 80%,
                    transparent);
            opacity: 1;
        }

        [data-theme="dark"] .kpi-dist-item__icon {
            background: rgba(255, 255, 255, 0.05);
        }

        [data-theme="dark"] .kpi-dist-item__icon--indigo {
            background: rgba(99, 102, 241, 0.12);
        }

        [data-theme="dark"] .kpi-dist-item__icon--emerald {
            background: rgba(16, 185, 129, 0.12);
        }

        [data-theme="dark"] .kpi-dist-item__icon--orange {
            background: rgba(249, 115, 22, 0.12);
        }

        [data-theme="dark"] .kpi-dist-item__icon--violet {
            background: rgba(139, 92, 246, 0.12);
        }

        [data-theme="dark"] .kpi-dist-item:hover,
        [data-theme="dark"] .kpi-quality-item:hover {
            background: rgba(255, 255, 255, 0.04);
            border-color: rgba(255, 255, 255, 0.06);
        }

        [data-theme="dark"] .kpi-dist-item__badge {
            background: rgba(59, 130, 246, 0.15);
            box-shadow: none;
        }

        [data-theme="dark"] .kpi-quality-item--accent {
            background: rgba(16, 185, 129, 0.1);
            border-color: rgba(16, 185, 129, 0.15);
        }


        /* ═══════════════════════════════════════════════════════════════════
           LEAD FILTER TABS – Soft-UI
           ═══════════════════════════════════════════════════════════════════ */

        .lead-filters {
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
        }

        .lead-filter {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.4rem 0.85rem;
            border-radius: 100px;
            font-size: 0.72rem;
            font-weight: 700;
            text-decoration: none;
            color: #64748B;
            background: #FFFFFF;
            border: 1px solid #E2E8F0;
            transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
            cursor: pointer;
            position: relative;
            letter-spacing: 0.01em;
        }

        .lead-filter:hover {
            color: #1E293B;
            border-color: #CBD5E1;
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }

        .lead-filter--active {
            color: #1E293B;
            background: #F8FAFC;
            border-color: #94A3B8;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
        }

        .lead-filter--active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 20%;
            right: 20%;
            height: 2px;
            background: linear-gradient(90deg, #3B82F6, #6366F1);
            border-radius: 100px;
        }

        .lead-filter__dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .lead-filter__count {
            background: #F1F5F9;
            color: #64748B;
            font-size: 0.6rem;
            font-weight: 800;
            padding: 0.1rem 0.4rem;
            border-radius: 100px;
            margin-left: 0.15rem;
        }

        .lead-filter--active .lead-filter__count {
            background: linear-gradient(135deg, #3B82F6, #6366F1);
            color: #FFFFFF;
        }

        /* Dark Theme */
        [data-theme="dark"] .lead-filter {
            background: #111111;
            border-color: rgba(255, 255, 255, 0.06);
            color: #94A3B8;
        }

        [data-theme="dark"] .lead-filter:hover {
            color: #F1F5F9;
            border-color: rgba(255, 255, 255, 0.12);
        }

        [data-theme="dark"] .lead-filter--active {
            background: rgba(255, 255, 255, 0.05);
            border-color: rgba(255, 255, 255, 0.15);
            color: #F1F5F9;
        }

        [data-theme="dark"] .lead-filter__count {
            background: rgba(255, 255, 255, 0.08);
            color: #94A3B8;
        }


        /* ═══════════════════════════════════════════════════════════════════
           TABLE HEADER – Custom
           ═══════════════════════════════════════════════════════════════════ */

        .thead-custom {
            background: linear-gradient(180deg, #FAFBFC, #F1F5F9);
            border-bottom: 2px solid #E2E8F0;
        }

        .thead-custom th {
            padding: 0.65rem 0.75rem;
            font-size: 0.6rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: #64748B;
            border: none;
            white-space: nowrap;
        }

        /* Dark Theme */
        [data-theme="dark"] .thead-custom {
            background: linear-gradient(180deg, #0D0D0D, #111111);
            border-bottom-color: rgba(255, 255, 255, 0.06);
        }

        [data-theme="dark"] .thead-custom th {
            color: #64748B;
        }


        /* ═══════════════════════════════════════════════════════════════════
           PAGINATION
           ═══════════════════════════════════════════════════════════════════ */

        .leads-pagination {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.75rem 1rem;
            background: #FFFFFF;
            border: 1px solid #E2E8F0;
            border-radius: var(--radius-lg);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
        }

        .leads-pagination__info {
            font-size: 0.75rem;
            font-weight: 600;
            color: #475569;
        }

        .leads-pagination__nav {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }

        .leads-pagination__btn {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            padding: 0.35rem 0.75rem;
            border-radius: 100px;
            font-size: 0.7rem;
            font-weight: 700;
            text-decoration: none;
            color: #3B82F6;
            background: #EFF6FF;
            border: 1px solid #DBEAFE;
            transition: all 0.2s ease;
        }

        .leads-pagination__btn:hover {
            background: #DBEAFE;
            color: #2563EB;
            transform: translateY(-1px);
        }

        .leads-pagination__page {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            font-size: 0.7rem;
            font-weight: 700;
            text-decoration: none;
            color: #64748B;
            transition: all 0.2s ease;
        }

        .leads-pagination__page:hover {
            background: #F1F5F9;
            color: #1E293B;
        }

        .leads-pagination__page--active {
            background: linear-gradient(135deg, #3B82F6, #6366F1);
            color: #FFFFFF;
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
        }

        .leads-pagination__page--active:hover {
            background: linear-gradient(135deg, #3B82F6, #6366F1);
            color: #FFFFFF;
        }

        .leads-pagination__dots {
            font-size: 0.8rem;
            color: #94A3B8;
            padding: 0 0.2rem;
        }

        /* Dark Theme */
        [data-theme="dark"] .leads-pagination {
            background: #111111;
            border-color: rgba(255, 255, 255, 0.06);
        }

        [data-theme="dark"] .leads-pagination__info {
            color: #94A3B8;
        }

        [data-theme="dark"] .leads-pagination__btn {
            background: rgba(59, 130, 246, 0.1);
            border-color: rgba(59, 130, 246, 0.2);
        }

        [data-theme="dark"] .leads-pagination__page {
            color: #94A3B8;
        }

        [data-theme="dark"] .leads-pagination__page:hover {
            background: rgba(255, 255, 255, 0.05);
            color: #F1F5F9;
        }

        /* ═══════════════════════════════════════════════════════════════════
           MOBILE RESPONSIVE
           ═══════════════════════════════════════════════════════════════════ */

        /* ── Tablet (< 768px) ─────────────────────────────────────────── */
        @media (max-width: 767.98px) {

            /* Page header stacks */
            .d-flex.justify-content-between.align-items-center.mb-4 {
                flex-direction: column;
                align-items: flex-start !important;
                gap: 0.75rem;
            }

            .d-flex.justify-content-between.align-items-center.mb-4>.d-flex.gap-2 {
                width: 100%;
                flex-wrap: wrap;
            }

            .d-flex.justify-content-between.align-items-center.mb-4 h1 {
                font-size: 1.5rem;
            }

            /* Filter tabs horizontal scroll */
            .lead-filters {
                flex-wrap: nowrap;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
                gap: 0.3rem;
                padding-bottom: 0.25rem;
            }

            .lead-filters::-webkit-scrollbar {
                display: none;
            }

            .lead-filter {
                white-space: nowrap;
                flex-shrink: 0;
            }

            /* Hide less important table columns */
            .table-wow th:nth-child(4),
            .table-wow td:nth-child(4),
            .table-wow th:nth-child(5),
            .table-wow td:nth-child(5) {
                display: none;
            }

            /* Pagination stacks */
            .leads-pagination {
                flex-direction: column;
                gap: 0.5rem;
                text-align: center;
            }
        }

        /* ── Phone (< 576px) ──────────────────────────────────────────── */
        @media (max-width: 575.98px) {

            /* KPI Panels compact */
            .kpi-panel {
                padding: 0.875rem 1rem;
            }

            .kpi-panel__title {
                font-size: 0.6rem;
            }

            /* Pipeline counters 3-per-row */
            .pipeline-counters {
                gap: 0;
            }

            .pipeline-counter {
                min-width: 33%;
                padding: 0.35rem 0.4rem;
            }

            .pipeline-counter+.pipeline-counter::before {
                display: none;
            }

            .pipeline-counter__num {
                font-size: 0.95rem;
            }

            .pipeline-counter__lbl {
                font-size: 0.5rem;
            }

            /* Stat grid stays 2x2 but smaller */
            .kpi-stat-grid {
                gap: 0.4rem;
            }

            .kpi-stat {
                padding: 0.35rem 0.45rem;
            }

            .kpi-stat__icon {
                width: 28px;
                height: 28px;
                font-size: 0.75rem;
            }

            .kpi-stat__value {
                font-size: 0.9rem;
            }

            /* Quality row wraps */
            .kpi-quality-row {
                flex-wrap: wrap;
                gap: 0.35rem;
            }

            /* Distribution compact */
            .kpi-dist-item__icon {
                width: 24px;
                height: 24px;
                font-size: 0.7rem;
            }

            .kpi-dist-item__value {
                font-size: 0.78rem;
            }

            /* Filter tabs smaller */
            .lead-filter {
                padding: 0.3rem 0.6rem;
                font-size: 0.62rem;
            }

            /* Table: also hide Tags column on phones */
            .table-wow th:nth-child(2),
            .table-wow td:nth-child(2) {
                display: none;
            }

            /* Table compact text */
            .table-wow td {
                font-size: 0.78rem;
                padding: 0.4rem 0.35rem;
            }

            .thead-custom th {
                font-size: 0.5rem;
                padding: 0.5rem 0.35rem;
            }

            /* Pagination: only prev/next, hide page numbers */
            .leads-pagination__page {
                display: none;
            }

            .leads-pagination__btn {
                font-size: 0.65rem;
                padding: 0.3rem 0.6rem;
            }

            /* Search full width */
            .search-box {
                width: 100% !important;
            }

            /* Form action buttons */
            .d-flex.justify-content-end.mt-3 {
                flex-direction: column;
                gap: 0.5rem;
            }

            .d-flex.justify-content-end.mt-3 .btn {
                width: 100%;
            }
        }

        /* ═══════════════════════════════════════════════════════════
           MOBILE BOTTOM NAVIGATION (only < 768px)
           ═══════════════════════════════════════════════════════════ */
        .bottom-nav {
            display: none;
        }

        @media (max-width: 767.98px) {
            .bottom-nav {
                display: flex;
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                z-index: 9999;
                background: #ffffff;
                border-top: 1px solid rgba(0, 0, 0, 0.08);
                box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
                padding: 0.35rem 0;
                padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
                justify-content: space-around;
                align-items: center;
                -webkit-backdrop-filter: blur(20px);
                backdrop-filter: blur(20px);
                background: rgba(255, 255, 255, 0.92);
                transform: translateZ(0);  /* Force GPU layer for iOS */
                -webkit-transform: translateZ(0);
            }

            .bottom-nav__item {
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                gap: 0.15rem;
                padding: 0.3rem 0.75rem;
                border: none;
                background: none;
                color: #94A3B8;
                text-decoration: none;
                font-size: 0.6rem;
                font-weight: 600;
                letter-spacing: 0.02em;
                transition: all 0.2s ease;
                position: relative;
                -webkit-tap-highlight-color: transparent;
                min-width: 56px;
            }

            .bottom-nav__item i {
                font-size: 1.25rem;
                transition: transform 0.2s ease;
            }

            .bottom-nav__item.active {
                color: #2D3748;
            }

            .bottom-nav__item.active i {
                transform: scale(1.1);
            }

            .bottom-nav__item.active::before {
                content: '';
                position: absolute;
                top: -0.35rem;
                left: 50%;
                transform: translateX(-50%);
                width: 24px;
                height: 3px;
                background: linear-gradient(135deg, #3B82F6, #06B6D4);
                border-radius: 0 0 4px 4px;
            }

            .bottom-nav__badge {
                position: absolute;
                top: 0;
                right: 0.25rem;
                min-width: 16px;
                height: 16px;
                padding: 0 4px;
                font-size: 0.55rem;
                font-weight: 700;
                line-height: 16px;
                text-align: center;
                color: #fff;
                background: #3B82F6;
                border-radius: 99px;
            }

            .bottom-nav__badge--warn {
                background: #F59E0B;
            }

            /* Add bottom padding to content so it's not hidden behind nav */
            .content-wrapper {
                padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)) !important;
            }

            /* Hide footer on mobile to avoid clutter */
            footer {
                padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)) !important;
            }

            /* Hide bottom nav when modal is open – so save buttons are reachable */
            body.modal-open .bottom-nav {
                display: none !important;
            }
        }

        /* Dark Mode for Bottom Nav */
        [data-theme="dark"] .bottom-nav {
            background: rgba(15, 15, 15, 0.95);
            border-top-color: rgba(255, 255, 255, 0.06);
        }

        [data-theme="dark"] .bottom-nav__item {
            color: #64748B;
        }

        [data-theme="dark"] .bottom-nav__item.active {
            color: #E2E8F0;
        }

        /* ═══════════════════════════════════════════════════════════
           MOBILE CARD LAYOUT — Tables → Cards (only < 768px)
           ═══════════════════════════════════════════════════════════ */
        @media (max-width: 767.98px) {

            /* Hide table header on mobile */
            .table-wow thead {
                display: none !important;
            }

            /* Make table body a flex stack */
            .table-wow tbody {
                display: flex;
                flex-direction: column;
                gap: 0.75rem;
                padding: 0.75rem;
            }

            /* Each row becomes a card */
            .table-wow tbody tr {
                display: flex;
                flex-wrap: wrap;
                background: #ffffff;
                border-radius: 16px !important;
                border: 1px solid rgba(0, 0, 0, 0.06);
                box-shadow: 0 2px 12px -4px rgba(0, 0, 0, 0.06);
                padding: 1rem;
                gap: 0.5rem;
                transition: all 0.2s ease;
                position: relative;
            }

            .table-wow tbody tr:hover {
                box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.1);
                transform: none;
            }

            /* Reset all td padding/borders */
            .table-wow tbody td {
                border: none !important;
                padding: 0 !important;
                font-size: 0.88rem;
            }

            /* ── Leads Table Specifics ── */

            /* Column 1: Firma — full width, prominent */
            .table-wow tbody td:nth-child(1) {
                width: 100%;
                order: 1;
                padding-bottom: 0.25rem !important;
            }

            .table-wow tbody td:nth-child(1) .fw-bold {
                font-size: 1rem;
            }

            /* Column 3: Status — top right */
            .table-wow tbody td:nth-child(3) {
                order: 2;
                margin-left: auto;
                position: absolute;
                top: 1rem;
                right: 1rem;
            }

            .table-wow tbody td:nth-child(3) .lead-stars {
                display: none;
            }

            /* Column 2: Tags/Erfasst — below company */
            .table-wow tbody td:nth-child(2) {
                width: 100%;
                order: 3;
            }

            /* Column 4: Region — inline */
            .table-wow tbody td:nth-child(4) {
                order: 4;
            }

            /* Column 5: Assigned — inline */
            .table-wow tbody td:nth-child(5) {
                order: 5;
            }

            /* Column 6: Follow-Up — inline */
            .table-wow tbody td:nth-child(6) {
                order: 6;
            }

            /* Column 7: Actions — hidden on mobile (row is clickable) */
            .table-wow tbody td:nth-child(7) {
                display: none !important;
            }

            /* Divider between main info and meta */
            .table-wow tbody td:nth-child(4)::before {
                content: '';
                display: block;
                width: 100%;
                height: 1px;
                background: rgba(0, 0, 0, 0.05);
                margin-bottom: 0.5rem;
            }

            /* Inline meta row */
            .table-wow tbody td:nth-child(4),
            .table-wow tbody td:nth-child(5),
            .table-wow tbody td:nth-child(6) {
                display: inline-flex;
                align-items: center;
                gap: 0.25rem;
                font-size: 0.78rem;
                color: #64748B;
                padding-right: 0.75rem !important;
            }

            /* Make cards not overflow scroll on mobile (only for card tables) */
            .table-wow + .table-responsive,
            .card:has(.table-wow) .table-responsive {
                overflow-x: visible !important;
            }

            /* ── KPI Dashboard Mobile ── */
            .kpi-dashboard .row.g-3 {
                gap: 0.75rem;
            }

            .pipeline-counters {
                flex-wrap: wrap;
            }

            /* ── Page header mobile ── */
            .display-6 {
                font-size: 1.5rem !important;
            }

            /* ── Lead filters horizontal scroll ── */
            .lead-filters {
                overflow-x: auto;
                white-space: nowrap;
                -webkit-overflow-scrolling: touch;
                padding-bottom: 0.25rem;
                scrollbar-width: none;
            }

            .lead-filters::-webkit-scrollbar {
                display: none;
            }

            /* ── Action buttons wrap ── */
            .d-flex.gap-2.align-items-center {
                flex-wrap: wrap;
            }
        }

        /* Dark Mode for mobile cards */
        @media (max-width: 767.98px) {
            [data-theme="dark"] .table-wow tbody tr {
                background: rgba(30, 30, 30, 0.8);
                border-color: rgba(255, 255, 255, 0.06);
            }
        }

        /* ═══════════════════════════════════════════════════════════
           MOBILE QUICK WINS (only < 768px)
           ═══════════════════════════════════════════════════════════ */
        @media (max-width: 767.98px) {

            /* ── 1. Fullscreen Modals (Bottom Sheet Style) ── */
            .modal-dialog {
                margin: 0 !important;
                max-width: 100% !important;
                min-height: 100dvh;
                display: flex;
                align-items: flex-end;
            }

            .modal-content {
                border-radius: 20px 20px 0 0 !important;
                border: none !important;
                max-height: 92dvh;
                overflow-y: auto;
                animation: sheetSlideUp 0.3s ease forwards;
            }

            /* Sticky footer so save button is always reachable */
            .modal-footer {
                position: sticky;
                bottom: 0;
                z-index: 10;
                background: #F8FAFC !important;
                box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
            }

            [data-theme="dark"] .modal-footer {
                background: #1a1a1a !important;
            }

            @keyframes sheetSlideUp {
                from {
                    transform: translateY(100%);
                    opacity: 0.5;
                }
                to {
                    transform: translateY(0);
                    opacity: 1;
                }
            }

            /* Drag handle indicator */
            .modal-header::before {
                content: '';
                display: block;
                width: 36px;
                height: 4px;
                background: #CBD5E1;
                border-radius: 99px;
                position: absolute;
                top: 8px;
                left: 50%;
                transform: translateX(-50%);
            }

            .modal-header {
                position: relative;
                padding-top: 1.25rem !important;
            }

            /* ── 2. Touch-Friendly Inputs ── */
            .form-control,
            .form-select {
                min-height: 48px !important;
                font-size: 16px !important;  /* Prevents iOS zoom on focus */
                padding: 0.65rem 1rem !important;
                border-radius: 12px !important;
            }

            .form-control:focus,
            .form-select:focus {
                box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
            }

            /* Larger checkboxes & radios */
            .form-check-input {
                width: 1.25rem !important;
                height: 1.25rem !important;
            }

            /* Submit buttons full width */
            .modal-footer .btn {
                flex: 1;
                min-height: 48px;
            }

            /* ── 3. Sticky Filter Tabs ── */
            .lead-filters {
                position: sticky;
                top: 60px;  /* Below mobile header */
                z-index: 100;
                background: var(--bg-body, #F4F7FE);
                padding-top: 0.5rem;
                padding-bottom: 0.5rem;
                margin-left: -1.5rem;
                margin-right: -1.5rem;
                padding-left: 1.5rem;
                padding-right: 1.5rem;
            }

            [data-theme="dark"] .lead-filters {
                background: #0a0a0a;
            }

            /* ── Bonus: Better spacing ── */

            /* Cards in content tighter */
            .card-body {
                padding: 1rem !important;
            }

            /* KPI panels compact */
            .kpi-panel {
                padding: 0.75rem !important;
            }

            .kpi-stat-grid {
                gap: 0.5rem !important;
            }

            /* Search bar full width */
            .search-box {
                width: 100% !important;
                order: -1;
            }

            /* Header action buttons stack */
            .d-flex.gap-2 .btn {
                font-size: 0.78rem;
                padding: 0.4rem 0.8rem;
            }

            /* Hide import buttons on leads page (save space) */
            .d-flex.gap-2 form[action*="import"] {
                display: none;
            }

            /* Pagination compact */
            .leads-pagination {
                flex-direction: column;
                gap: 0.5rem;
                text-align: center;
            }

            .leads-pagination__nav {
                justify-content: center;
            }
        }