        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #0f172a 0%, #581c87 50%, #0f172a 100%);
            min-height: 100vh;
            color: #333;
            position: relative;
            /* overflow-x:hidden removed — breaks position:fixed children (FAB, panels) in Chrome */
        }

        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: 
                radial-gradient(circle at 20% 50%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
            pointer-events: none;
            z-index: 0;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 20px;
            position: relative;
            z-index: 1;
        }

        .login-container {
            max-width: 480px;
            margin: 40px auto;
            position: relative;
            z-index: 1;
            animation: slideUp 0.6s ease-out;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .login-logo {
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 32px auto;
            padding: 0;
            background: transparent;
            width: 100%;
            max-width: 480px;
            text-align: center;
        }
        
        .login-logo img {
            height: 64px;
            width: auto;
            display: block;
            margin: 0 auto;
        }

        .login-logo-icon {
            width: 48px;
            height: 48px;
            background: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #a855f7 100%);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 18px;
            color: white;
            box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
        }

        .login-logo-text {
            font-size: 28px;
            font-weight: 700;
            background: linear-gradient(135deg, #22d3ee 0%, #a855f7 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .login-tagline {
            text-align: center;
            color: rgba(255, 255, 255, 0.6);
            font-size: 12px;
            letter-spacing: 3px;
            text-transform: uppercase;
            margin-bottom: 30px;
        }

        .login-card {
            background: rgba(30, 41, 59, 0.8);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 20px;
            padding: 40px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
            width: 100%;
        }

        .login-card h2 {
            color: white;
            font-size: 28px;
            font-weight: 700;
            font-style: italic;
            margin-bottom: 8px;
        }

        .login-card-subtitle {
            color: rgba(255, 255, 255, 0.6);
            font-size: 14px;
            margin-bottom: 30px;
            line-height: 1.5;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .login-container .form-group {
            margin-bottom: 24px;
            position: relative;
        }

        .login-container label {
            display: block;
            margin-bottom: 10px;
            font-weight: 500;
            color: rgba(255, 255, 255, 0.7);
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 1.5px;
        }

        .login-container input {
            width: 100%;
            padding: 16px 20px;
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 12px;
            font-size: 15px;
            transition: all 0.3s ease;
            background: rgba(15, 23, 42, 0.6);
            color: white;
        }

        .login-container input::placeholder {
            color: rgba(255, 255, 255, 0.4);
        }

        .login-container input:hover {
            border-color: rgba(255, 255, 255, 0.25);
            background: rgba(15, 23, 42, 0.8);
        }

        .login-container input:focus {
            outline: none;
            border-color: #a855f7;
            box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
            background: rgba(15, 23, 42, 0.9);
        }

        .login-container button[type="submit"] {
            width: 100%;
            padding: 16px;
            font-size: 16px;
            font-weight: 600;
            letter-spacing: 0.5px;
            margin-top: 10px;
            position: relative;
            overflow: hidden;
            background: linear-gradient(135deg, #ec4899 0%, #f97316 100%);
            border: none;
            border-radius: 30px;
            color: white;
            cursor: pointer;
            box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
            transition: all 0.3s ease;
        }

        .login-container button[type="submit"]:hover {
            box-shadow: 0 6px 30px rgba(236, 72, 153, 0.5);
            transform: translateY(-2px);
        }

        .login-container button[type="submit"]:active {
            transform: translateY(0);
            box-shadow: 0 3px 15px rgba(236, 72, 153, 0.4);
        }

        .login-help {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            margin-top: 24px;
            padding-top: 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }

        .login-env-badge {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: rgba(255, 255, 255, 0.7);
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 1.5px;
            text-transform: uppercase;
        }

        .login-help-text {
            color: rgba(255, 255, 255, 0.5);
            font-size: 13px;
        }

        .login-footer {
            text-align: center;
            color: rgba(255, 255, 255, 0.5);
            font-size: 13px;
            margin-top: 30px;
        }

        .login-footer a {
            color: #22d3ee;
            text-decoration: none;
        }

        #loginError {
            background: rgba(239, 68, 68, 0.2);
            border: 1px solid rgba(239, 68, 68, 0.4);
            color: #fca5a5;
            padding: 12px 16px;
            border-radius: 10px;
            margin-top: 16px;
            font-size: 14px;
        }

        .main-container {
            background: white;
            border-radius: 15px;
            padding: 30px;
            box-shadow: 0 15px 35px rgba(0,0,0,0.1);
            margin-top: 20px;
            position: relative;
            z-index: 1;
        }

        h1, h2, h3 {
            color: #4a5568;
            margin-bottom: 20px;
            text-align: center;
        }

        .form-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            margin-bottom: 5px;
            font-weight: 600;
            color: #4a5568;
        }

        input, select, textarea {
            width: 100%;
            padding: 12px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 16px;
            transition: all 0.3s ease;
        }

        input:focus, select:focus, textarea:focus {
            outline: none;
            border-color: #9333ea;
            box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
        }

        button {
            background: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
            color: white;
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 600;
            transition: all 0.3s ease;
            margin-right: 10px;
            margin-bottom: 10px;
        }

        button:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
        }

        .btn-secondary {
            background: linear-gradient(135deg, #6b7280 0%, #374151 100%);
        }

        .btn-danger {
            background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
        }

        .btn-success {
            background: linear-gradient(135deg, #34d399 0%, #059669 100%);
        }

        .btn-small {
            padding: 6px 12px;
            font-size: 14px;
        }

        /* Base styling for status filter buttons */
        .status-filter-btn {
            border: none;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            color: white;
        }

        /* Sold button - Green */
        .status-sold-btn {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            border: none;
        }
        .status-sold-btn:hover {
            background: linear-gradient(135deg, #059669 0%, #047857 100%);
            transform: translateY(-1px);
        }
        .status-sold-btn.active-status-filter {
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.5);
            transform: translateY(-2px) scale(1.05);
        }

        /* Quoted button - Purple */
        .status-quoted-btn {
            background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
            color: white;
            border: none;
        }
        .status-quoted-btn:hover {
            background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
            transform: translateY(-1px);
        }
        .status-quoted-btn.active-status-filter {
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.5);
            transform: translateY(-2px) scale(1.05);
        }

        /* Lost button - Red */
        .status-lost-btn {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            color: white;
            border: none;
        }
        .status-lost-btn:hover {
            background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
            transform: translateY(-1px);
        }
        .status-lost-btn.active-status-filter {
            box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.5);
            transform: translateY(-2px) scale(1.05);
        }

        .status-filter-btn.active-status-filter {
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.6);
            transform: translateY(-1px);
        }

        .tabs {
            display: flex;
            margin-bottom: 20px;
            border-bottom: 2px solid #e2e8f0;
            flex-wrap: nowrap;
            overflow-x: auto;
            scrollbar-width: none;
            -ms-overflow-style: none;
            -webkit-overflow-scrolling: touch;
            gap: 0;
        }

        .tabs::-webkit-scrollbar {
            display: none;
        }

        .tab {
            padding: 10px 11px;
            cursor: pointer;
            border-bottom: 3px solid transparent;
            transition: all 0.2s ease;
            font-weight: 600;
            white-space: nowrap;
            font-size: 0.78rem;
            letter-spacing: 0.01em;
            flex-shrink: 0;
            color: #4a5568;
            position: relative;
        }

        /* Pipe divider between tabs */
        .tab + .tab::before {
            content: '';
            position: absolute;
            left: 0;
            top: 25%;
            height: 50%;
            width: 1px;
            background: #e2e8f0;
        }

        /* Group separator — inserted between tab sections */
        .tab-group-divider {
            display: inline-flex;
            align-items: center;
            flex-shrink: 0;
            width: 1px;
            margin: 0 6px;
            align-self: stretch;
            background: #cbd5e0;
            border-bottom: 3px solid transparent;
            pointer-events: none;
            font-size: 0;
        }

        .tab:hover {
            color: #7c3aed;
            background: #f5f3ff;
        }

        .tab.active {
            border-bottom-color: #a855f7;
            color: #9333ea;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        /* Compact Prospect Card Styles */
        .prospect-card {
            background: #f7fafc;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 10px;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
        }

        .prospect-card:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            transform: translateY(-1px);
            border-color: #cbd5e0;
        }

        .prospect-card.expanded {
            background: #ffffff;
            border-color: #a855f7;
        }

        .prospect-card.selected {
            background: #faf5ff;
            border-color: #a855f7;
        }

        /* Mobile badge row hidden on desktop */
        .mobile-badge-row {
            display: none;
        }

        .prospect-checkbox {
            position: absolute;
            top: 12px;
            left: 12px;
            width: 20px;
            height: 20px;
            cursor: pointer;
            z-index: 10;
        }

        .prospect-card .prospect-header {
            padding-left: 30px;
        }

        .bulk-actions-bar {
            background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
            color: white;
            padding: 15px 20px;
            border-radius: 12px;
            margin-bottom: 20px;
            display: none;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 15px;
            box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
        }

        .bulk-actions-bar.active {
            display: flex;
        }

        .bulk-actions-info {
            font-weight: 600;
            font-size: 16px;
        }

        .bulk-actions-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .bulk-actions-bar button {
            background: white;
            color: #2d3748;
            padding: 8px 16px;
            font-size: 14px;
            margin: 0;
        }

        .bulk-actions-bar button:hover {
            background: #f7fafc;
        }

        .select-all-container {
            background: #f7fafc;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            padding: 12px 15px;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .select-all-container label {
            margin: 0;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .select-all-container input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
        }

        .prospect-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
        }

        .prospect-name {
            font-size: 16px;
            font-weight: 700;
            color: #2d3748;
            flex: 1;
        }

        .prospect-company {
            font-size: 13px;
            color: #718096;
            font-weight: 500;
        }

        .prospect-source-badge {
            display: inline-block;
            font-size: 10px;
            padding: 2px 8px;
            border-radius: 10px;
            font-weight: 700;
            white-space: nowrap;
            color: #fff;
            margin-top: 3px;
            letter-spacing: 0.3px;
        }

        .status-badge {
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            white-space: nowrap;
        }

        /* Contact status badge */
        .contact-status-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 11px;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 10px;
            margin-left: 6px;
        }
        .contact-status-badge.uncontacted {
            background: #fef3c7;
            color: #92400e;
            border: 1px solid #fde68a;
        }
        .contact-status-badge.contacted {
            background: #d1fae5;
            color: #065f46;
            border: 1px solid #a7f3d0;
        }

        .status-a { background: #ff6b6b; color: white; }
        .status-b { background: #4ecdc4; color: white; }
        .status-c { background: #45b7d1; color: white; }
        .status-d { background: #8b0000; color: white; }
        .status-g { background: #f9ca24; color: #2d3748; }
        .status-s { background: #10b981; color: white; }
        .status-q { background: #3b82f6; color: white; }
        .status-l { background: #ef4444; color: white; }

        /* Sale status badges (QUOTED, SOLD) */
        .sale-status-badge {
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            white-space: nowrap;
        }
        .sale-status-quoted { 
            background: linear-gradient(135deg, #9333ea 0%, #ec4899 100%); 
            color: white; 
        }
        .sale-status-sold { 
            background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); 
            color: white; 
        }
        .sale-status-lost { 
            background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); 
            color: white; 
        }

        .prospect-summary {
            display: flex;
            gap: 15px;
            margin-top: 8px;
            font-size: 12px;
            color: #718096;
            flex-wrap: wrap;
            align-items: center;
        }

        .prospect-summary > div {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .assigned-badge {
            background: #e6fffa;
            color: #234e52;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 11px;
            font-weight: 600;
            border: 1px solid #81e6d9;
        }

        .prospect-details {
            display: none;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid #e2e8f0;
        }

        .prospect-card.expanded .prospect-details {
            display: block;
        }

        .detail-item {
            font-size: 12px;
            display: inline-flex;
            align-items: baseline;
            gap: 5px;
            margin-right: 18px;
            margin-bottom: 4px;
        }

        .detail-label {
            font-weight: 600;
            color: #718096;
            font-size: 11px;
            text-transform: uppercase;
            white-space: nowrap;
        }

        .detail-value {
            color: #2d3748;
        }

        .fleet-intel-snippet {
            display: block;
            margin-top: 8px;
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 2px solid #e2e8f0;
        }

        .header-logo-wrapper {
            flex: 1;
            display: flex;
            align-items: center;
            max-width: 60%;
            padding: 5px 0;
            overflow: visible;
        }

        .header-logo-img {
            height: 44px;
            display: flex;
            align-items: center;
        }
        .header-logo-img img {
            height: 38px;
            width: auto;
            display: block;
        }


        .user-info {
            display: flex;
            align-items: center;
            gap: 15px;
            flex-wrap: wrap;
        }

        .user-badge {
            background: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 14px;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: linear-gradient(135deg, #fff 0%, #f7fafc 100%);
            padding: 25px;
            border-radius: 12px;
            border-left: 4px solid #9333ea;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }

        .stat-number {
            font-size: 32px;
            font-weight: 700;
            color: #2d3748;
        }

        .stat-label {
            color: #718096;
            font-size: 14px;
            margin-top: 5px;
        }

        .stat-subtext {
            color: #a0aec0;
            font-size: 12px;
            margin-top: 3px;
        }

        .search-bar {
            margin-bottom: 20px;
        }

        .search-bar input {
            border-radius: 25px;
            padding: 15px 25px;
        }

        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 1000;
        }

        .modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 30px;
            border-radius: 15px;
            max-width: 600px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
        }

        .close {
            position: absolute;
            right: 15px;
            top: 15px;
            font-size: 28px;
            cursor: pointer;
            color: #718096;
        }

        .alert {
            padding: 15px;
            margin-bottom: 20px;
            border-radius: 8px;
            font-weight: 600;
        }

        .alert-success {
            background: #c6f6d5;
            color: #276749;
            border: 1px solid #9ae6b4;
        }

        .alert-error {
            background: #fed7d7;
            color: #c53030;
            border: 1px solid #fc8181;
        }

        .category-legend {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 20px;
        }

        .category-legend h4 {
            margin-bottom: 12px;
            color: #2d3748;
            text-align: left;
        }

        .legend-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 8px;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 13px;
        }

        .legend-badge {
            padding: 4px 8px;
            border-radius: 12px;
            font-weight: 600;
            font-size: 11px;
            min-width: 20px;
            text-align: center;
        }

        .quick-actions {
            margin-top: 10px;
            display: flex;
            gap: 5px;
            flex-wrap: wrap;
        }

        .prospect-card.expanded .quick-actions {
            display: flex;
        }

        .prospect-card:not(.expanded) .quick-actions {
            display: none;
        }

        /* Activity/Notes Styles */
        .activity-section {
            background: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 10px 12px;
            margin-top: 8px;
            display: none;
        }

        .prospect-card.expanded .activity-section {
            display: block;
        }

        .activity-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
            padding-bottom: 8px;
            border-bottom: 1px solid #e2e8f0;
        }

        .activity-item {
            background: #f8f9fa;
            border-left: 4px solid #9333ea;
            padding: 12px;
            margin-bottom: 10px;
            border-radius: 0 8px 8px 0;
            position: relative;
        }

        .activity-item:last-child {
            margin-bottom: 0;
        }

        .activity-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
            font-size: 12px;
            color: #718096;
        }

        .activity-type {
            background: #e2e8f0;
            color: #4a5568;
            padding: 2px 8px;
            border-radius: 12px;
            font-weight: 600;
            text-transform: uppercase;
        }

        .activity-type.call { background: #c6f6d5; color: #276749; }
        .activity-type.email { background: #bee3f8; color: #2b6cb7; }
        .activity-type.meeting { background: #fbb6ce; color: #b83280; }
        .activity-type.note { background: #fed7aa; color: #c05621; }
        .activity-type.everconnect { background: #ddd6fe; color: #6b21a8; }

        .activity-content {
            color: #2d3748;
            margin-bottom: 8px;
            line-height: 1.4;
        }

        .follow-up-date {
            background: #fff5b7;
            color: #744210;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 600;
            display: inline-block;
            margin-top: 5px;
        }

        .overdue {
            background: #fed7d7;
            color: #c53030;
        }

        .due-today {
            background: #fef5e7;
            color: #744210;
        }

        .upcoming-followups {
            background: white;
            border: 2px solid #fed7aa;
            border-top: 4px solid #f97316;
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 12px;
            box-shadow: 0 4px 16px rgba(249,115,22,0.1);
        }

        /* Container for follow-up grid */
        .followups-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 10px;
            padding: 6px 0;
        }

        .followup-item {
            display: flex;
            flex-direction: column;
            padding: 15px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            border-left: 4px solid #4299e1;
            transition: transform 0.2s, box-shadow 0.2s;
            min-height: unset;
        }

        .followup-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        .followup-item.overdue {
            border-left-color: #f56565;
        }

        .followup-item.due-today {
            border-left-color: #ed8936;
        }

        .followup-item:last-child {
            margin-bottom: 0;
        }

        .prospect-info {
            flex: 1;
        }

        .prospect-info h4 {
            margin: 0;
            color: #2d3748;
        }

        .prospect-info p {
            margin: 2px 0 0 0;
            font-size: 14px;
            color: #718096;
        }

        .loading-spinner {
            display: inline-block;
            width: 16px;
            height: 16px;
            border: 2px solid #ffffff;
            border-radius: 50%;
            border-top-color: transparent;
            animation: spin 0.8s ease-in-out infinite;
            margin-right: 8px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .login-hint {
            background: linear-gradient(135deg, #e6f7ff 0%, #f0f9ff 100%);
            border: 2px solid #91d5ff;
            border-radius: 16px;
            padding: 20px;
            margin-top: 25px;
            font-size: 14px;
            box-shadow: 0 4px 12px rgba(0, 149, 233, 0.1);
        }
        
        .login-hint h4 {
            margin-bottom: 12px;
            color: #0c4a6e;
            font-size: 15px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .login-hint ul {
            margin: 8px 0 0 20px;
            padding: 0;
        }
        
        .login-hint li {
            color: #075985;
            margin: 8px 0;
            line-height: 1.6;
        }

        .login-hint strong {
            color: #0369a1;
        }

        .login-divider {
            display: flex;
            align-items: center;
            text-align: center;
            margin: 25px 0;
            color: #a0aec0;
            font-size: 13px;
            font-weight: 600;
        }

        .login-divider::before,
        .login-divider::after {
            content: '';
            flex: 1;
            border-bottom: 1px solid #e2e8f0;
        }

        .login-divider span {
            padding: 0 15px;
        }
        
            color: #718096;
        }

        .attachment-item {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: #e6f7ff;
            border: 1px solid #91d5ff;
            padding: 6px 12px;
            border-radius: 6px;
            margin: 4px;
            font-size: 12px;
            color: #0369a1;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .attachment-item:hover {
            background: #bae7ff;
            transform: translateY(-1px);
        }

        .attachment-preview {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
        }

        .attachment-preview-item {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: #f0f9ff;
            border: 2px solid #bae7ff;
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 13px;
        }

        .attachment-remove {
            cursor: pointer;
            color: #e53e3e;
            font-weight: bold;
            margin-left: 8px;
            font-size: 16px;
            line-height: 1;
        }

        .attachment-remove:hover {
            color: #c53030;
        }

        .attachment-icon {
            font-size: 18px;
        }

        .followup-quick-buttons {
            display: flex;
            gap: 5px;
            flex-wrap: wrap;
            margin-top: 10px;
        }

        .filter-section {
            background: #f7fafc;
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            padding: 15px;
            margin-bottom: 20px;
        }

        .filter-row {
            display: flex;
            gap: 15px;
            align-items: center;
            flex-wrap: wrap;
        }

        .filter-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .filter-group label {
            font-size: 12px;
            font-weight: 600;
            color: #4a5568;
            margin-bottom: 0;
        }

        .filter-group select {
            padding: 8px 12px;
            font-size: 14px;
        }

        .expand-toggle {
            color: #9333ea;
            font-size: 11px;
            font-weight: 600;
            margin-top: 5px;
            display: block;
        }

        /* ============================================ */
        /* RESPONSIVE DESIGN - TABLET & MOBILE */
        /* ============================================ */
        
        /* Tablet (768px and below) */
        @media (max-width: 768px) {
            .tabs {
                flex-wrap: nowrap;
                overflow-x: auto;
            }
            
            .header {
                flex-direction: column;
                gap: 15px;
            }
            
            .header-logo-wrapper {
                max-width: 100%;
            }
            
            .header-logo-img {
                height: 40px;
            }
            .header-logo-img img {
                height: 34px;
                width: auto;
            }
            
            .prospect-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 10px;
            }

            .activity-meta {
                flex-direction: column;
                align-items: flex-start;
                gap: 5px;
            }

            .followup-item {
                flex-direction: column;
                align-items: flex-start;
                gap: 10px;
            }

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

            .login-container {
                margin: 40px auto;
                padding: 35px 30px;
                max-width: 95%;
            }
            
            .login-logo img {
                height: 58px;
                max-width: 95%;
            }

            .login-container h1 {
                font-size: 26px;
            }

            .login-subtitle {
                font-size: 14px;
            }
            
            /* Stats grid - 2 columns on tablet */
            .stats-grid {
                grid-template-columns: repeat(2, 1fr) !important;
                gap: 15px;
            }
            
            /* Filter section - stack vertically */
            .filter-section {
                flex-direction: column;
                gap: 10px;
            }
            
            .filter-section select,
            .filter-section input {
                width: 100% !important;
            }
            
            /* Buttons - full width */
            .btn-group {
                flex-wrap: wrap;
                gap: 10px;
            }
            
            .btn-group button {
                flex: 1 1 calc(50% - 5px);
                min-width: 120px;
            }
        }
        
        /* Mobile (480px and below) */
        @media (max-width: 480px) {
            /* Container padding */
            .container {
                padding: 10px;
            }
            
            /* Header - compact on mobile */
            .header {
                padding: 15px;
            }
            
            .header-logo-wrapper {
                max-width: 100%;
            }
            
            .header-logo-img {
                height: 36px;
            }
            .header-logo-img img {
                height: 30px;
                width: auto;
            }
            
            .header h1 {
                font-size: 20px;
            }
            
            .user-info {
                font-size: 12px;
            }
            
            /* Tabs - full width buttons */
            .tabs {
                gap: 5px;
            }
            
            .tab {
                padding: 12px 15px;
                font-size: 14px;
            }
            
            /* Stats - single column on phone */
            .stats-grid {
                grid-template-columns: 1fr !important;
                gap: 12px;
            }
            
            .stat-card {
                padding: 15px;
            }
            
            .stat-number {
                font-size: 28px;
            }
            
            .stat-label {
                font-size: 12px;
            }
            
            /* Tables - horizontal scroll */
            table {
                display: block;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                white-space: nowrap;
            }
            
            table thead,
            table tbody,
            table tr,
            table th,
            table td {
                display: table-cell;
            }
            
            /* Prospect cards - compact */
            .prospect-card {
                padding: 10px 10px 10px 36px;
                margin-bottom: 8px;
                border-radius: 10px;
                position: relative;
            }

            /* Smaller checkbox - tight top-left */
            .prospect-checkbox {
                width: 16px !important;
                height: 16px !important;
                top: 12px !important;
                left: 10px !important;
            }

            /* ── ROW 1: Name + Company ── */
            .prospect-card .prospect-header {
                flex-direction: column !important;
                align-items: flex-start !important;
                gap: 1px !important;
                margin-bottom: 5px;
            }

            .prospect-card .prospect-header > div:last-child {
                display: none !important;
            }

            .prospect-name {
                font-size: 15px !important;
                font-weight: 700 !important;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                max-width: 100%;
                line-height: 1.3;
            }

            .prospect-company {
                font-size: 11px !important;
                color: #718096;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                max-width: 100%;
            }

            .prospect-source-badge {
                font-size: 9px !important;
                padding: 1px 6px !important;
                margin-top: 2px;
            }

            /* ── ROW 2: Badges inline ── */
            .prospect-card .mobile-badge-row {
                display: flex !important;
                flex-direction: row !important;
                flex-wrap: wrap;
                align-items: center;
                gap: 4px;
                margin-bottom: 6px;
            }

            /* Hide desktop badge cluster on mobile */
            .prospect-card .desktop-badge-cluster {
                display: none !important;
            }

            .status-badge {
                font-size: 10px !important;
                padding: 2px 7px !important;
                border-radius: 10px !important;
            }

            .contact-status-badge {
                font-size: 10px !important;
                padding: 2px 6px !important;
                margin-left: 0 !important;
                border-radius: 10px !important;
            }

            .sale-status-badge {
                font-size: 9px !important;
                padding: 2px 6px !important;
                letter-spacing: 0 !important;
            }

            /* ── ROW 3: Assigned badge full width ── */
            .assigned-badge {
                font-size: 10px !important;
                padding: 2px 7px !important;
                display: inline-block;
                margin-bottom: 5px !important;
            }

            /* ── ROW 4: Info grid - 2 columns ── */
            .prospect-summary {
                display: grid !important;
                grid-template-columns: 1fr 1fr !important;
                gap: 2px 8px !important;
                margin-top: 2px !important;
                font-size: 11px !important;
                color: #4a5568;
            }

            .prospect-summary > div {
                display: flex;
                align-items: center;
                gap: 3px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                line-height: 1.5;
            }

            /* Pending spans full width */
            .prospect-summary > div:has([style*="e53e3e"]),
            .prospect-summary > div[style*="e53e3e"] {
                grid-column: 1 / -1;
            }

            /* ── Expand toggle ── */
            .expand-toggle {
                font-size: 11px !important;
                display: block;
                margin-top: 5px !important;
                color: #9333ea;
            }

            /* ── Select All container ── */
            .select-all-container {
                padding: 8px 12px !important;
                margin-bottom: 8px !important;
                gap: 8px !important;
            }

            .select-all-container input[type="checkbox"] {
                width: 16px !important;
                height: 16px !important;
            }

            .select-all-container label {
                font-size: 13px !important;
            }

            /* Tighter followup grid — single column on mobile */
            .followups-grid {
                grid-template-columns: 1fr !important;
                gap: 6px !important;
            }

            .followup-item {
                padding: 10px 12px !important;
                min-height: unset !important;
                gap: 6px !important;
            }

            /* Followup company name */
            .followup-item .company-name,
            .followup-item strong {
                font-size: 14px;
            }

            /* Done / Log buttons in followup cards */
            .followup-item button {
                min-height: 38px !important;
                padding: 8px 14px !important;
                font-size: 13px !important;
            }

            /* Section headers tighter */
            .section-header, .card-header {
                padding: 10px 12px !important;
            }

            /* Buttons - larger touch targets (exclude FAB and close buttons) */
            button:not(#voiceNoteFab button):not(.close-btn) {
                min-height: 44px;
                padding: 10px 16px;
                font-size: 14px;
            }

            /* FAB button — never let global button styles touch it */
            #voiceNoteFab button {
                min-height: unset !important;
                padding: 0 !important;
                font-size: 26px !important;
                width: 62px !important;
                height: 62px !important;
                border-radius: 50% !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                margin: 0 !important;
                touch-action: manipulation;
            }
            
            /* Forms - full width inputs */
            .form-group input,
            .form-group select,
            .form-group textarea {
                width: 100%;
                font-size: 16px; /* Prevents zoom on iOS */
                padding: 12px;
            }
            
            /* Modals - full screen on mobile */
            .modal-content {
                width: 95% !important;
                max-width: 95% !important;
                max-height: 90vh;
                overflow-y: auto;
                margin: 5vh auto;
            }
            
            /* Login screen - optimize for mobile */
            .login-container {
                margin: 20px auto;
                padding: 25px 20px;
                max-width: 100%;
            }
            
            .login-logo img {
                height: 52px;
                max-width: 98%;
            }
            
            .login-card {
                padding: 25px 20px;
            }
            
            .login-card h2 {
                font-size: 22px;
            }
            
            /* Category legend - 2 columns on mobile */
            .legend-item {
                font-size: 11px;
            }
            
            /* Activity items - compact */
            .activity-item {
                padding: 12px;
            }
            
            /* Filter dropdowns - stack */
            .filter-section {
                flex-direction: column;
            }
            
            .filter-section > div {
                width: 100%;
            }
            
            /* Export buttons - full width */
            .export-section button {
                width: 100%;
                margin-bottom: 10px;
            }
            
            /* Charts - responsive */
            canvas {
                max-width: 100% !important;
                height: auto !important;
            }
            
            /* Status badges - smaller */
            .status-badge {
                font-size: 11px;
                padding: 4px 8px;
            }
            
            /* Pending badge - adjust size */
            .pending-badge {
                font-size: 11px;
                padding: 3px 8px;
            }
            
            /* Search box - full width */
            .search-box {
                width: 100% !important;
            }
            
            /* Alert messages - adjust padding */
            .alert {
                padding: 12px;
                font-size: 14px;
            }
            
            /* Analytics filters - stack vertically */
            #analyticsRegionFilterContainer,
            #analyticsDistrictFilterContainer,
            #analyticsDealerFilterContainer {
                width: 100%;
            }
            
            /* Bulk action buttons - stack */
            .bulk-actions {
                flex-direction: column;
                gap: 8px;
            }
            
            .bulk-actions button {
                width: 100%;
            }
            
            /* Prospect info items - wrap better */
            .prospect-info {
                flex-direction: column;
                gap: 8px;
            }
            
            .prospect-info-item {
                font-size: 13px;
            }
            
            /* Activity type badges */
            .activity-type {
                font-size: 11px;
                padding: 3px 8px;
            }
            
            /* Navigation buttons */
            .nav-buttons {
                flex-direction: column;
                gap: 10px;
            }
            
            .nav-buttons button {
                width: 100%;
            }
        }
        
        /* Extra small phones (360px and below) */
        @media (max-width: 360px) {
            .header h1 {
                font-size: 18px;
            }
            
            .stat-number {
                font-size: 24px;
            }
            
            .tab {
                padding: 10px 12px;
                font-size: 13px;
            }
            
            button {
                padding: 10px 15px;
                font-size: 13px;
            }
            
            .prospect-card {
                padding: 10px;
            }
        }

        /* ============================================
           MOBILE FIXES — Voice Panel, Tabs, FAB
        ============================================ */

        /* Tabs: horizontal scroll on mobile so they don't wrap ugly */
        @media (max-width: 768px) {
            .tabs {
                flex-wrap: nowrap !important;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
                padding-bottom: 2px;
                gap: 0;
            }
            .tabs::-webkit-scrollbar { display: none; }
            .tab {
                white-space: nowrap;
                flex-shrink: 0;
                padding: 9px 10px;
                font-size: 12px;
            }
        }

        /* Voice Note FAB + Panel — full mobile treatment */
        @media (max-width: 480px) {
            #voiceNoteFab {
                bottom: 16px !important;
                right: 16px !important;
                z-index: 999999 !important;
            }

            #voiceNotePanel {
                /* Compact panel on phones — not full screen */
                width: calc(100vw - 24px) !important;
                right: 12px !important;
                left: 12px !important;
                bottom: 86px !important;
                top: auto !important;
                max-height: 72vh !important;
                overflow-y: auto !important;
                -webkit-overflow-scrolling: touch !important;
                border-radius: 16px !important;
            }

            /* Tighten up panel padding on mobile */
            #voiceNotePanel > div:not(:first-child) {
                padding: 10px 12px !important;
            }

            /* Shrink the mic icon on mobile */
            #vnRecordStatus {
                padding: 8px !important;
            }
            #vnRecordStatus > div:first-child {
                font-size: 22px !important;
                margin-bottom: 2px !important;
            }

            /* Reduce textarea rows on mobile */
            #vnTranscript {
                font-size: 12px !important;
                rows: 2;
            }

            /* Voice panel buttons — keep side by side but smaller */
            #voiceNotePanel .vn-btn-row button {
                padding: 8px 6px !important;
                font-size: 12px !important;
            }

            /* Smart extract button — readable on small screens */
            #vnCreateContactBtn {
                font-size: 12px !important;
                padding: 9px 8px !important;
            }

            #vnLogActivityBtn {
                font-size: 12px !important;
                padding: 9px 8px !important;
            }

            /* Contact preview card text */
            #vnContactPreview {
                font-size: 11px !important;
            }

            /* Saved notes list — limit height so panel doesn't overflow */
            #vnNotesList {
                max-height: 120px;
                overflow-y: auto;
            }

            /* FAB button touch target */
            #voiceNoteFab button {
                width: 56px !important;
                height: 56px !important;
                font-size: 24px !important;
            }
        }

        /* Modals — full screen on mobile, scrollable */
        @media (max-width: 480px) {
            .modal-content {
                width: 100% !important;
                max-width: 100% !important;
                min-height: 100vh;
                margin: 0 !important;
                border-radius: 0 !important;
                overflow-y: auto;
            }

            .modal {
                padding: 0 !important;
                align-items: flex-start;
            }
        }

        /* Prevent horizontal page scroll on mobile */
        @media (max-width: 768px) {
            body {
                /* overflow-x:hidden omitted — breaks fixed elements */
            }
        }
        /* Prevent Leaflet tiles from escaping map container */
        #prospectMap .leaflet-pane,
        #prospectMap .leaflet-tile,
        #prospectMap .leaflet-tile-container,
        #prospectMap .leaflet-layer {
            position: absolute !important;
        }
        .leaflet-container {
            max-height: 500px;
            overflow: hidden !important;
        }
    
        /* ── Quick-call button: always visible on mobile, hover on desktop ── */
        @media (hover: none) {
            /* touch devices — always show */
            .call-now-btn { display:inline-block !important; }
        }
        @media (hover: hover) {
            /* mouse devices — show on hover */
            a:hover .call-now-btn { display:inline-block !important; }
        }

  .dd-tab { transition: color 0.15s, background 0.15s, border-color 0.15s; }
  .dd-tab:not(.active):hover { background:rgba(255,255,255,0.7) !important; color:#1e293b !important; }
  .dd-tab.active { background:white !important; margin-bottom:-2px; box-shadow:0 -2px 8px rgba(0,0,0,0.07); }
  .dd-tab[data-tab="unit"].active    { color:#1d4ed8 !important; border-bottom:3px solid #1d4ed8 !important; }
  .dd-tab[data-tab="pricing"].active { color:#16a34a !important; border-bottom:3px solid #16a34a !important; }
  .dd-tab[data-tab="trade"].active   { color:#9333ea !important; border-bottom:3px solid #9333ea !important; }
  .dd-tab[data-tab="fees"].active    { color:#ea580c !important; border-bottom:3px solid #ea580c !important; }
  .dd-tab[data-tab="finance"].active { color:#0891b2 !important; border-bottom:3px solid #0891b2 !important; }
  .dd-tab[data-tab="summary"].active { color:#db2777 !important; border-bottom:3px solid #db2777 !important; }
  .dd-field { display:flex; flex-direction:column; gap:5px; }
  .dd-field label { font-size:12px; font-weight:600; color:#374151; text-transform:uppercase; letter-spacing:0.5px; }
  .dd-field input, .dd-field select, .dd-field textarea {
    border:1px solid #d1d5db; border-radius:8px; padding:8px 10px;
    font-size:13px; color:#1f2937; background:#fff;
    transition:border-color 0.15s, box-shadow 0.15s;
  }
  .dd-field input:focus, .dd-field select:focus, .dd-field textarea:focus {
    outline:none; border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,0.1);
  }
  .dd-money-input { position:relative; }
  .dd-money-input span { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:#6b7280; font-size:13px; font-weight:600; pointer-events:none; }
  .dd-money-input input { padding-left:22px; width:100%; box-sizing:border-box; }
  .dd-summary-row { display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid #f1f5f9; font-size:14px; }
  .dd-summary-row:last-child { border-bottom:none; }
  .dd-summary-section { background:#fff; border-radius:10px; border:1px solid #e2e8f0; padding:14px 16px; margin-bottom:14px; }
  .dd-summary-section h4 { font-size:11px; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:1px; margin:0 0 10px; }
  .dd-total-row { display:flex; justify-content:space-between; padding:10px 0 0; margin-top:8px; border-top:2px solid #1d4ed8; font-size:16px; font-weight:700; color:#1e3a5f; }


        /* ═══════════════════════════════════════════════════════════
           MAP TAB — DESKTOP + MOBILE RESPONSIVE STYLES
           ═══════════════════════════════════════════════════════════ */

        .map-tab-wrapper { padding: 0 0 10px 0; }

        /* ── Desktop Controls Bar ── */
        .map-controls-desktop {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
            padding: 12px 16px;
            background: #f8f9ff;
            border-radius: 10px;
            margin-bottom: 12px;
            border: 1px solid #e2e8f0;
        }
        .map-filter-label { font-size:13px; font-weight:600; color:#4a5568; }
        .map-select { font-size:13px; padding:5px 10px; border:1px solid #cbd5e0; border-radius:6px; background:white; }
        .map-btn-primary { font-size:11px; padding:4px 10px; border:1px solid #667eea; border-radius:6px; background:white; cursor:pointer; color:#667eea; font-weight:600; }
        .map-btn-admin { font-size:11px; padding:4px 10px; border:1px solid #cbd5e0; border-radius:6px; background:white; cursor:pointer; color:#718096; }
        .map-btn-admin-red { border-color:#fca5a5; color:#dc2626; }

        /* ── Mobile Top Bar (hidden on desktop) ── */
        .map-controls-mobile { display: none; }

        /* ── Route Panel ── */
        .map-route-panel {
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            padding: 14px;
            margin-bottom: 12px;
        }

        /* ── Map + Cluster Wrapper ── */
        .map-and-cluster-wrapper { position: relative; width: 100%; }

        .prospect-map-container {
            height: 500px;
            max-height: 500px;
            width: 100%;
            position: relative;
            border-radius: 10px;
            border: 1px solid #e2e8f0;
            overflow: hidden;
            z-index: 0;
        }

        /* ── Desktop Cluster Panel ── */
        .cluster-panel-desktop {
            display: none;
            position: absolute;
            top: 0; right: 0;
            width: 280px;
            height: 500px;
            background: white;
            box-shadow: -4px 0 20px rgba(0,0,0,0.18);
            z-index: 800;
            border-radius: 0 10px 10px 0;
            overflow: hidden;
            flex-direction: column;
        }
        .cluster-panel-header {
            background: linear-gradient(135deg,#667eea,#764ba2);
            color: white;
            padding: 12px 14px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }
        .cluster-panel-footer {
            padding: 10px 12px;
            border-top: 1px solid #e2e8f0;
            background: #f8fafc;
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        /* ── Mobile Route Bar ── */
        .mobile-route-bar {
            display: none;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            background: linear-gradient(135deg,#2d3748,#4a5568);
            border-radius: 10px;
            margin-top: 8px;
        }

        /* ── Legend ── */
        .map-legend-bar {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            margin-top: 10px;
            padding: 10px 14px;
            background: #f8f9ff;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
        }
        .map-legend-item { font-size:12px; color:#555; }
        .map-legend-hint { font-size:12px; color:#555; margin-left:10px; font-style:italic; }

        /* ── Shared Bottom Sheet Styles ── */
        .map-sheet-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.45);
            z-index: 1200;
            backdrop-filter: blur(2px);
        }
        .map-bottom-sheet {
            position: fixed;
            bottom: 0; left: 0; right: 0;
            background: white;
            border-radius: 20px 20px 0 0;
            z-index: 1300;
            display: flex;
            flex-direction: column;
            max-height: 75vh;
            box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
            animation: sheetSlideUp 0.28s cubic-bezier(0.34,1.2,0.64,1);
        }
        .map-bottom-sheet-tall { max-height: 82vh; }
        @keyframes sheetSlideUp {
            from { transform: translateY(100%); opacity: 0.5; }
            to   { transform: translateY(0);    opacity: 1;   }
        }
        .map-sheet-handle {
            width: 40px; height: 4px;
            background: #d1d5db;
            border-radius: 99px;
            margin: 10px auto 4px;
            flex-shrink: 0;
        }
        .map-sheet-title {
            font-size: 16px;
            font-weight: 700;
            color: #1e293b;
            padding: 8px 18px 12px;
            border-bottom: 1px solid #f1f5f9;
            flex-shrink: 0;
        }
        .map-sheet-body {
            overflow-y: auto;
            padding: 14px 16px;
            flex: 1;
            -webkit-overflow-scrolling: touch;
        }
        .map-sheet-footer {
            padding: 12px 16px;
            border-top: 1px solid #f1f5f9;
            display: flex;
            flex-shrink: 0;
        }
        .map-sheet-apply-btn {
            width: 100%;
            padding: 14px;
            background: linear-gradient(135deg,#667eea,#764ba2);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 15px;
            font-weight: 700;
            cursor: pointer;
        }
        .map-sheet-field { margin-bottom: 14px; }
        .map-sheet-label { display:block; font-size:12px; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:0.5px; margin-bottom:6px; }
        .map-sheet-select { width:100%; padding:12px 14px; border:1.5px solid #e2e8f0; border-radius:10px; font-size:15px; color:#1e293b; background:white; appearance:auto; }
        .map-sheet-admin-section { background:#f8fafc; border:1px solid #e2e8f0; border-radius:10px; padding:12px; margin-top:8px; }
        .map-sheet-admin-label { font-size:11px; font-weight:700; color:#94a3b8; text-transform:uppercase; letter-spacing:0.5px; margin-bottom:8px; }
        .map-sheet-admin-btn { width:100%; padding:11px; background:white; color:#4a5568; border:1px solid #d1d5db; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; margin-bottom:6px; }
        .map-sheet-admin-btn-red { color:#dc2626; border-color:#fca5a5; }
        .cluster-sheet-header {
            background: linear-gradient(135deg,#667eea,#764ba2);
            color: white;
            padding: 12px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }

        /* ── Mobile Button Styles ── */
        .map-mobile-btn {
            display: flex;
            align-items: center;
            gap: 5px;
            padding: 8px 14px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            white-space: nowrap;
        }
        .map-mobile-btn-filter { background:#667eea; color:white; }
        .map-mobile-btn-reset  { background:white; color:#667eea; border:1.5px solid #667eea; }

        /* ═══════════════════════════════════════════════════════════
           MOBILE OVERRIDES  (≤ 768px)
           ═══════════════════════════════════════════════════════════ */
        @media (max-width: 768px) {

            /* Hide desktop controls, show mobile bar */
            .map-controls-desktop { display: none; }
            .map-controls-mobile {
                display: flex;
                align-items: center;
                gap: 8px;
                padding: 10px 12px;
                background: #f8f9ff;
                border-radius: 10px;
                margin-bottom: 10px;
                border: 1px solid #e2e8f0;
            }

            /* Map fills screen height minus header + tabs + top bar */
            .prospect-map-container {
                height: calc(100vh - 260px);
                max-height: calc(100vh - 260px);
                min-height: 320px;
            }

            /* Desktop cluster panel OFF on mobile (use sheet instead) */
            .cluster-panel-desktop { display: none !important; }

            /* Mobile route bar shown as needed */
            .mobile-route-bar { display: flex; }

            /* Desktop route panel hidden on mobile (use sheet instead) */
            .map-route-panel { display: none !important; }

            /* Legend — compact horizontal scroll on mobile */
            .map-legend-bar {
                flex-wrap: nowrap;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                gap: 14px;
                padding: 8px 12px;
            }
            .map-legend-item, .map-legend-hint { white-space: nowrap; }
        }

/* ============================================================
   MOBILE FIXES — Comprehensive phone/tablet improvements
   Added: Demo prep pass
   ============================================================ */

/* ── 1. Stats grids: 4-col → 2-col on tablet, 2-col on phone ── */
@media (max-width: 768px) {
    [style*="grid-template-columns:repeat(4,1fr)"],
    [style*="grid-template-columns: repeat(4, 1fr)"],
    #prospectStatsGrid,
    #dgStatTotal ~ div {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ── 2. Add Prospect form: 4-col → 2-col → 1-col ── */
@media (max-width: 768px) {
    #addProspectForm > div[style*="repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 480px) {
    #addProspectForm > div[style*="repeat(4"],
    #addProspectForm > div[style*="repeat(2"] {
        grid-template-columns: 1fr !important;
    }
}

/* ── 3. Filter row: wrap on mobile ── */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .filter-group {
        width: 100% !important;
        min-width: unset !important;
    }
    .filter-group select,
    .filter-group input {
        width: 100% !important;
        min-width: unset !important;
        font-size: 16px !important; /* prevent iOS zoom */
    }
}

/* ── 4. Sales performance & analytics grids ── */
@media (max-width: 600px) {
    /* SP stats: sold/quoted/lost/win% → 2x2 */
    .sp-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        flex-wrap: wrap !important;
    }
    /* Analytics dash row → single col */
    .dash-row {
        grid-template-columns: 1fr !important;
    }
    /* Deal profit KPIs → 2x2 */
    .dp-kpis {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .dp-kpi {
        flex: 1 1 calc(50% - 4px) !important;
        min-width: unset !important;
    }
}

/* ── 5. Tables: wrap in scrollable container ── */
@media (max-width: 768px) {
    /* Manage Team table */
    div[style*="min-width:860px"],
    table[style*="min-width:860px"] {
        min-width: unset !important;
        width: 100% !important;
    }
    /* All tables in reports / manage team */
    .tab-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        font-size: 12px !important;
    }
    /* Gross Profit by Rep table */
    #gpByRepTable {
        font-size: 12px !important;
    }
    #gpByRepTable th,
    #gpByRepTable td {
        padding: 8px 6px !important;
    }
}

/* ── 6. Report filter dropdowns → wrap ── */
@media (max-width: 768px) {
    /* Reports & DG reports filter bars */
    div[style*="min-width:150px"],
    div[style*="min-width:160px"],
    div[style*="min-width:180px"] {
        min-width: unset !important;
        width: 100% !important;
    }
    select[style*="min-width:150px"],
    select[style*="min-width:160px"],
    select[style*="min-width:180px"] {
        min-width: unset !important;
        width: 100% !important;
    }
    /* Report filter wrapper → column */
    #rptFilters,
    #dgRptFilters {
        flex-direction: column !important;
        gap: 8px !important;
    }
}

/* ── 7. Analytics section: charts side-by-side → stacked ── */
@media (max-width: 640px) {
    /* Prospect distribution + Activities by Type */
    #categoryChart {
        width: 160px !important;
        height: 160px !important;
    }
    #activityChart {
        width: 100% !important;
        max-width: 280px !important;
    }
    /* Sales rep performance table */
    #salesRepTableBody tr td {
        padding: 6px 4px !important;
        font-size: 12px !important;
    }
}

/* ── 8. Prospect contact matrix → scrollable ── */
@media (max-width: 640px) {
    #contactMatrix,
    #contactMatrixContainer {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* ── 9. Deal desk modal → full screen on phone ── */
@media (max-width: 480px) {
    #dealDeskModal .modal-content,
    #dealDeskOverlay > div {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
    }
    /* Deal desk tabs → scrollable */
    .dd-tabs {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }
    .dd-tabs::-webkit-scrollbar { display: none !important; }
    .dd-tab {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
    /* Deal desk fields → single column */
    .dd-grid,
    div[style*="grid-template-columns: repeat(2"] {
        grid-template-columns: 1fr !important;
    }
    div[style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ── 10. Inventory tab → cards wrap properly ── */
@media (max-width: 640px) {
    #inventoryGrid {
        grid-template-columns: 1fr !important;
    }
    div[style*="grid-template-columns: repeat(auto-fill, minmax(200px"] {
        grid-template-columns: 1fr !important;
    }
}

/* ── 11. Main container padding ── */
@media (max-width: 480px) {
    .main-container {
        padding: 15px 12px !important;
        border-radius: 10px !important;
    }
    /* Header: logo left, user right, stacked on very small */
    .header {
        gap: 10px !important;
        padding-bottom: 8px !important;
    }
    .user-badge {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
}

/* ── 12. Follow-ups tab: cards full width ── */
@media (max-width: 480px) {
    .followups-grid {
        grid-template-columns: 1fr !important;
    }
    .followup-item {
        padding: 12px !important;
    }
    /* Due date badge */
    .follow-up-date {
        font-size: 11px !important;
    }
}

/* ── 13. Bulk actions bar → stack on mobile ── */
@media (max-width: 480px) {
    .bulk-actions-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        padding: 12px !important;
    }
    .bulk-actions-buttons {
        width: 100% !important;
    }
    .bulk-actions-buttons button {
        flex: 1 !important;
        font-size: 12px !important;
        padding: 8px 4px !important;
        margin: 0 !important;
    }
}

/* ── 14. Analytics hierarchy filters → wrap ── */
@media (max-width: 640px) {
    #analyticsFiltersBar {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    #analyticsFiltersBar select,
    #analyticsFiltersBar input[type="date"] {
        width: 100% !important;
        font-size: 16px !important;
    }
    /* Date pickers row */
    #analyticsDateFrom,
    #analyticsDateTo {
        font-size: 16px !important; /* prevent iOS zoom */
    }
}

/* ── 15. iOS-specific: prevent input zoom ── */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    input[type="datetime-local"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important; /* iOS won't zoom if >= 16px */
    }
}

/* ── 16. Pagination controls → center and wrap ── */
@media (max-width: 480px) {
    #paginationControls {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px !important;
    }
    #paginationControls button {
        padding: 8px 12px !important;
        font-size: 13px !important;
        min-height: 40px !important;
    }
}

/* ── 17. Service Referrals table → scrollable ── */
@media (max-width: 640px) {
    #serviceReferralsContainer table,
    #serviceReferralsTable {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        font-size: 12px !important;
    }
}
