        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: Arial, sans-serif;
            background: linear-gradient(135deg, #667eea, #764ba2);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .login-box {
            background: white;
            padding: 2rem;
            border-radius: 10px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
            width: 90%;
            max-width: 400px;
        }
        
        .login-box h1 {
            text-align: center;
            color: #333;
            margin-bottom: 2rem;
        }
        
        .form-group {
            margin-bottom: 1rem;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            color: #555;
        }
        
        .form-group input, .form-group select, .form-group textarea {
            width: 100%;
            padding: 0.75rem;
            border: 2px solid #ddd;
            border-radius: 5px;
            font-size: 1rem;
        }
        
        .form-group textarea {
            resize: vertical;
            min-height: 100px;
        }
        
        .btn {
            width: 100%;
            padding: 0.75rem;
            border: none;
            border-radius: 5px;
            font-size: 1rem;
            cursor: pointer;
            margin-bottom: 0.5rem;
            font-weight: bold;
        }
        
        .btn-primary {
            background: #3b82f6;
            color: white;
        }
        
        .btn-primary:hover {
            background: #2563eb;
        }
        
        .btn-success {
            background: #10b981;
            color: white;
        }
        
        .btn-success:hover {
            background: #059669;
        }
        
        .btn-warning {
            background: #f59e0b;
            color: white;
        }
        
        .btn-warning:hover {
            background: #d97706;
        }
        
        .quick-buttons {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 0.5rem;
            margin: 1rem 0;
        }
        
        .quick-buttons .btn {
            font-size: 0.85rem;
            padding: 0.5rem;
        }
        
        .info-box {
            background: #f3f4f6;
            padding: 1rem;
            border-radius: 5px;
            margin-top: 1rem;
            font-size: 0.9rem;
            color: #666;
        }
        
        .dashboard {
            display: none;
            background: white;
            min-height: 100vh;
            width: 100%;
        }
        
        .dashboard.active {
            display: block;
        }
        
        .header {
            background: #1e293b;
            color: white;
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .nav {
            background: #334155;
            padding: 1rem 2rem;
        }
        
        .nav button {
            background: transparent;
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            margin-right: 1rem;
            cursor: pointer;
            border-radius: 5px;
        }
        
        .nav button:hover {
            background: rgba(255,255,255,0.1);
        }
        
        .nav button.active {
            background: #3b82f6;
        }
        
        .content {
            padding: 2rem;
            min-height: 600px;
            height: auto;
            overflow: visible;
        }
        
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1rem;
            margin-bottom: 2rem;
        }
        
        .stat-card {
            background: white;
            padding: 1.5rem;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            border-left: 4px solid #3b82f6;
        }
        
        .stat-card h3 {
            color: #6b7280;
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
        }
        
        .stat-card .number {
            font-size: 2rem;
            font-weight: bold;
            color: #1e293b;
        }
        
        .alert {
            padding: 1rem;
            border-radius: 5px;
            margin-bottom: 1rem;
            display: none;
        }
        
        .alert.show {
            display: block;
        }
        
        .alert-error {
            background: #fee2e2;
            color: #991b1b;
            border: 1px solid #ef4444;
        }
        
        .alert-success {
            background: #d1fae5;
            color: #065f46;
            border: 1px solid #10b981;
        }
        
        .alert-warning {
            background: #fef3c7;
            color: #92400e;
            border: 1px solid #f59e0b;
        }
        
        table {
            width: 100%;
            border-collapse: collapse;
            background: white;
            border-radius: 8px;
            overflow: hidden;
        }
        
        th {
            background: #f3f4f6;
            padding: 1rem;
            text-align: left;
            font-weight: 600;
            color: #6b7280;
        }
        
        td {
            padding: 1rem;
            border-top: 1px solid #e5e7eb;
        }
        
        tr:hover {
            background: #f9fafb;
        }
        
        /* Mobile-Responsive Table Wrapper */
        .table-wrapper {
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            margin-bottom: 1rem;
        }

        .table-wrapper table {
            min-width: 600px;
        }

        @media (max-width: 768px) {
            .table-wrapper {
                border: 1px solid #e5e7eb;
                border-radius: 8px;
            }
            
            .table-wrapper table {
                border-radius: 0;
            }
            
            th, td {
                padding: 0.75rem 0.5rem;
                font-size: 0.9rem;
            }
        }

        /* Support Tab Responsive Styles */
        .support-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
        }

        .support-card {
            padding: 1.5rem;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            background: white;
        }

        .support-card h2 {
            margin-top: 0;
            margin-bottom: 1rem;
            color: #1e293b;
            font-size: 1.25rem;
        }

        .support-card p {
            color: #6b7280;
            margin: 1rem 0;
        }

        .support-card a {
            color: #3b82f6;
            text-decoration: none;
            display: inline-block;
            margin: 0.5rem 0;
        }

        .support-card a:hover {
            text-decoration: underline;
        }

        @media (max-width: 768px) {
            .support-grid {
                grid-template-columns: 1fr;
                gap: 1rem;
            }
            
            .support-card {
                padding: 1rem;
            }
            
            .support-card h2 {
                font-size: 1.1rem;
            }
        }

        /* Modal styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
        }
        
        .modal.show {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .modal-content {
            background: white;
            padding: 2rem;
            border-radius: 10px;
            width: 90%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
        }
        
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        
        .modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #6b7280;
        }
        
        /* Billing styles */
        .billing-container {
            max-width: 800px;
        }
        
        .billing-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }
        
        .billing-card h3 {
            margin-bottom: 1rem;
            color: #1e293b;
        }
        
        .plan-badge {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.875rem;
            font-weight: 600;
            margin-left: 0.5rem;
        }
        
        .plan-badge.grow {
            background: #fbbf24;
            color: #78350f;
        }
        
        .plan-badge.automate {
            background: #60a5fa;
            color: #1e3a8a;
        }
        
        .plan-badge.launch {
            background: #86efac;
            color: #14532d;
        }
        
        .billing-info {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin: 1rem 0;
        }
        
        .billing-info-item {
            display: flex;
            flex-direction: column;
        }
        
        .billing-info-item label {
            font-size: 0.875rem;
            color: #6b7280;
            margin-bottom: 0.25rem;
        }
        
        .billing-info-item span {
            font-weight: 600;
            color: #1e293b;
        }
        
        .payment-method-card {
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 1rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.5rem;
        }
        
        .payment-method-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .card-icon {
            width: 40px;
            height: 25px;
            background: #f3f4f6;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            color: #6b7280;
        }
        
        .info-note {
            background: #f0f9ff;
            border-left: 4px solid #3b82f6;
            padding: 0.75rem;
            margin: 1rem 0;
            font-size: 0.875rem;
            color: #1e40af;
        }
        
        .settings-section {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }
        
        .settings-section h3 {
            margin-bottom: 1rem;
            color: #1e293b;
            font-size: 1.25rem;
        }
        
        .save-status {
            display: inline-block;
            margin-left: 1rem;
            padding: 0.5rem 1rem;
            background: #d1fae5;
            color: #065f46;
            border-radius: 5px;
            font-size: 0.875rem;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .save-status.show {
            opacity: 1;
        }

        /* Tools Tab Styles */
        .tool-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 1.5rem;
            position: relative;
            transition: box-shadow 0.3s;
        }
        
        .tool-card:hover {
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        
        .tool-card.enabled {
            border-color: #3b82f6;
            background: #eff6ff;
        }
        
        .tool-badge {
            display: inline-block;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: bold;
            text-transform: uppercase;
            margin-bottom: 0.5rem;
        }
        
        .badge-api { background: #fbbf24; color: #78350f; }
        .badge-automation { background: #34d399; color: #064e3b; }
        .badge-ai { background: #a78bfa; color: #2e1065; }
        
        .tool-status {
            position: absolute;
            top: 1rem;
            right: 1rem;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #ef4444;
        }
        
        .tool-status.active {
            background: #10b981;
        }
        
        .tool-toggle {
            display: flex;
            align-items: center;
            margin-top: 1rem;
        }
        
        .toggle-switch {
            position: relative;
            width: 48px;
            height: 24px;
            background: #d1d5db;
            border-radius: 12px;
            cursor: pointer;
            transition: background 0.3s;
            margin-right: 0.5rem;
        }
        
        .toggle-switch.active {
            background: #3b82f6;
        }
        
        .toggle-switch::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 20px;
            height: 20px;
            background: white;
            border-radius: 50%;
            transition: transform 0.3s;
        }
        
        .toggle-switch.active::after {
            transform: translateX(24px);
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }


        /* Mobile Menu Styles */
        .hamburger-menu {
            display: none;
            flex-direction: column;
            gap: 4px;
            cursor: pointer;
            padding: 5px;
        }

        .hamburger-menu span {
            width: 25px;
            height: 3px;
            background: #333;
            transition: all 0.3s ease;
        }

        /* Mobile Menu Overlay */
        .mobile-menu-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 9999;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .mobile-menu-overlay.active {
            display: block;
            opacity: 1;
        }

        .mobile-menu-content {
            position: absolute;
            right: 0;
            top: 0;
            width: 280px;
            max-width: 85%;
            height: 100%;
            background: white;
            box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
            transform: translateX(100%);
            transition: transform 0.3s ease;
        }

        .mobile-menu-overlay.active .mobile-menu-content {
            transform: translateX(0);
        }

        .mobile-menu-close {
            position: absolute;
            top: 20px;
            right: 20px;
            background: none;
            border: none;
            font-size: 2rem;
            color: #333;
            cursor: pointer;
            padding: 0;
            width: 40px;
            height: 40px;
        }

        .mobile-nav {
            padding: 80px 20px 20px;
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .mobile-nav a, .mobile-nav button {
            color: #333;
            text-decoration: none;
            font-size: 1.1rem;
            font-weight: 500;
            padding: 0.75rem;
            border-radius: 8px;
            transition: all 0.3s ease;
            background: none;
            border: none;
            text-align: left;
            cursor: pointer;
            width: 100%;
        }

        .mobile-nav a:hover, .mobile-nav button:hover {
            background: #f0f0f0;
            color: #3b82f6;
        }

        /* Responsive styles */
        @media (max-width: 768px) {
            /* Fixed styles for login screen centering WITHOUT !important */
            #loginScreen {
                align-items: center;
                justify-content: center;
                width: 100%;
                padding: 20px;
                box-sizing: border-box;
            }
            
            .login-box {
                width: 100%;
                max-width: 400px;
                margin: 0 auto;
            }
            
            .hamburger-menu {
                display: flex;
            }
            
            .dashboard-container {
                padding: 10px;
            }
            
            .dashboard-header {
                padding: 15px;
                flex-direction: column;
                gap: 15px;
                align-items: flex-start;
            }
            
            .dashboard-tabs {
                flex-wrap: wrap;
                justify-content: flex-start;
            }
            
            .tab-button {
                padding: 8px 12px;
                font-size: 14px;
            }
            
            .tools-grid {
                grid-template-columns: 1fr;
            }
            
            .admin-container {
                padding: 20px 15px;
            }
            
            table {
                font-size: 14px;
            }
            
            td button {
                padding: 5px 10px;
                font-size: 12px;
                margin: 2px;
            }
            
            /* Make tables scrollable on mobile */
            .table-responsive {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }
            
            table {
                min-width: 500px;
            }
        }

        @media (max-width: 480px) {
            /* Ensure centering on very small screens */
            .login-box {
                width: 95%;
                padding: 1.5rem;
            }
            
            .dashboard-header h2 {
                font-size: 1.5rem;
            }
            
            .modal-content {
                width: 95%;
                margin: 10% auto;
                padding: 20px;
            }
        }

        /* Modal Styles */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }

        .modal-content {
            background: white;
            border-radius: 8px;
            padding: 2rem;
            max-width: 500px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
        }

        .password-requirements {
            background: #f3f4f6;
            border-radius: 4px;
            padding: 1rem;
            margin-top: 1rem;
        }

        .password-requirements ul {
            margin: 0.5rem 0 0 1.5rem;
            padding: 0;
        }

        .password-requirements li {
            color: #6b7280;
            margin: 0.25rem 0;
        }

        .password-requirements li.valid {
            color: #10b981;
        }

        .alert-info {
            background: #dbeafe;
            border: 1px solid #60a5fa;
            color: #1e40af;
            padding: 0.75rem;
            border-radius: 4px;
            margin: 1rem 0;
        }


/* ===== Additional Styles ===== */

    @keyframes slideIn {
        from {
            transform: translateX(400px);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    .in-app-notification {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 16px;
        margin-bottom: 12px;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        animation: slideIn 0.3s ease-out;
        display: flex;
        align-items: flex-start;
        pointer-events: all;
        cursor: pointer;
        transition: transform 0.2s;
    }

    .in-app-notification:hover {
        transform: translateX(-5px);
    }

    .in-app-notification-icon {
        font-size: 24px;
        margin-right: 12px;
    }

    .in-app-notification-content {
        flex: 1;
    }

    .in-app-notification-title {
        font-weight: bold;
        margin-bottom: 4px;
        font-size: 16px;
    }

    .in-app-notification-body {
        font-size: 14px;
        opacity: 0.95;
    }

    .in-app-notification-time {
        font-size: 11px;
        opacity: 0.7;
        margin-top: 4px;
    }

    /* ============================================
    CUSTOMER SUPPORT CHAT STYLES
    ============================================ */

    /* Desktop/Default Layout */
    .admin-chat-container {
        display: flex;
        gap: 20px;
        margin: 20px 0;
        height: 500px;
    }

    .chat-conversations-panel {
        flex: 0 0 300px;
        border: 1px solid #ddd;
        border-radius: 8px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .conversations-list {
        overflow-y: auto;
        flex: 1;
        background: white;
    }

    .chat-messages-panel {
        flex: 1;
        border: 1px solid #ddd;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
    }

    /* ============================================
    MOBILE RESPONSIVE CHAT STYLES
    ============================================ */

    @media (max-width: 768px) {
        /* Reset container for mobile */
        .admin-chat-container {
            display: block !important;
            height: auto !important;
            margin: 10px 0 !important;
            gap: 0 !important;
        }
        
        /* Full width panels on mobile */
        .chat-conversations-panel,
        .chat-messages-panel {
            width: 100% !important;
            flex: none !important;
            margin: 0 !important;
            max-width: 100% !important;
            height: calc(100vh - 300px) !important;
            min-height: 400px !important;
        }
        
        /* Conversations list height */
        .conversations-list {
            height: calc(100vh - 400px) !important;
            min-height: 300px !important;
        }
        
        /* Messages area height - matching customer view */
        #adminChatMessages {
            height: 350px !important;
            max-height: calc(100vh - 450px) !important;
        }
        
        /* Larger input on mobile - matching customer support */
        #adminChatInput {
            font-size: 16px !important;
            padding: 12px !important;
            width: 100% !important;
            box-sizing: border-box !important;
        }
        
        /* Touch-friendly buttons */
        #customer-support-tab button {
            min-height: 44px !important;
            font-size: 16px !important;
            padding: 12px 20px !important;
            cursor: pointer !important;
        }
        
        /* Mobile toggle buttons */
        #mobileChatToggle {
            display: flex !important;
            gap: 4% !important;
            margin: 15px 0 !important;
        }
        
        #mobileChatToggle button {
            flex: 1 !important;
            min-height: 44px !important;
        }
        
        /* Hide panels initially on mobile (JS will control) */
        #conversationsPanel,
        #messagesPanel {
            display: none;
        }
        
        /* Prevent horizontal scroll */
        #customer-support-tab {
            overflow-x: hidden !important;
            padding: 5px !important;
        }
        
        /* Message bubbles responsive */
        #adminChatMessages > div {
            max-width: 85% !important;
            word-wrap: break-word !important;
            word-break: break-word !important;
        }
        
        /* Fix conversation items */
        #adminConversationsList > div {
            padding: 15px !important;
            border-bottom: 1px solid #eee !important;
            cursor: pointer !important;
        }
    }

    /* Tablet adjustments */
    @media (min-width: 769px) and (max-width: 1024px) {
        .chat-conversations-panel {
            flex: 0 0 250px;
        }
    }

    /* Desktop - ensure mobile toggle is hidden */
    @media (min-width: 769px) {
        #mobileChatToggle {
            display: none !important;
        }
        
        #conversationsPanel,
        #messagesPanel {
            display: flex !important;
        }
    }

    /* AI Sales Expert Mobile & PWA Responsive Styles */
    @media screen and (max-width: 768px) {
        /* Fix modal positioning */
        #aiSalesModal.modal {
            position: fixed !important;
            top: 0 !important;
            left: 0 !important;
            width: 100% !important;
            height: 100% !important;
        }
        
        #aiSalesModal .modal-content {
            max-width: 100vw !important;
            width: 100vw !important;
            height: 100vh !important;
            height: 100dvh !important; /* Dynamic viewport height for mobile */
            margin: 0 !important;
            border-radius: 0 !important;
        }
        
        /* Fix the container to enable horizontal scrolling */
        #aiSalesModal .sales-expert-container {
            display: flex !important;
            flex-direction: row !important;
            overflow-x: scroll !important;
            overflow-y: hidden !important;
            scroll-snap-type: x mandatory !important;
            -webkit-overflow-scrolling: touch !important;
            width: 100vw !important;
            position: relative !important;
        }
        
        #aiSalesModal .sales-sidebar {
            min-width: 85vw !important;
            width: 85vw !important;
            max-width: 85vw !important;
            flex: 0 0 85vw !important;
            scroll-snap-align: start !important;
        }
        
        #aiSalesModal .sales-chat {
            min-width: 100vw !important;
            width: 100vw !important;
            max-width: 100vw !important;
            flex: 0 0 100vw !important;
            scroll-snap-align: start !important;
        }
    }

    /* Additional PWA-specific overrides */
    @supports (display-mode: standalone) {
        @media (display-mode: standalone) {
            #aiSalesModal .modal-content {
                height: 100dvh !important;
            }
        }
    }
