/* ========================================
           DESIGN SYSTEM - shadcn/ui Inspired
           Professional, muted color palette
           ======================================== */
        :root {
            /* Layout */
            --sidebar-width: 240px;
            --header-height: 64px;

            /* Sidebar Colors (Dark - Zinc based) */
            --sidebar-bg: #18181b;
            --sidebar-hover: #27272a;
            --sidebar-active: #3f3f46;
            --sidebar-text: #a1a1aa;
            --sidebar-text-active: #fafafa;
            --sidebar-border: #27272a;

            /* Main Content Colors (Light - Clean white) */
            --main-bg: #fafafa;
            --card-bg: #ffffff;
            --header-bg: #ffffff;

            /* Primary Colors - Muted Slate Blue */
            --primary: #475569;
            --primary-dark: #334155;
            --primary-light: #64748b;
            --primary-50: rgba(71, 85, 105, 0.08);
            --primary-100: rgba(71, 85, 105, 0.15);
            --secondary: #64748b;
            --accent: #0f172a;

            /* Text Colors */
            --text-primary: #0f172a;
            --text-secondary: #64748b;

            /* Glass Effect (subtle) */
            --bg-glass: rgba(255, 255, 255, 0.8);
            --border-glass: rgba(255, 255, 255, 0.5);

            /* Semantic Colors - More muted */
            --success: #22c55e;
            --success-dark: #16a34a;
            --success-light: rgba(34, 197, 94, 0.1);
            --warning: #eab308;
            --warning-dark: #ca8a04;
            --warning-light: rgba(234, 179, 8, 0.1);
            --danger: #ef4444;
            --danger-dark: #dc2626;
            --danger-light: rgba(239, 68, 68, 0.08);
            --info: #3b82f6;
            --info-dark: #2563eb;
            --info-light: rgba(59, 130, 246, 0.08);

            /* Gradients - Subtle, professional */
            --gradient-primary: linear-gradient(135deg, #475569, #334155);
            --gradient-welcome: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);

            /* Gray Scale - Zinc palette (shadcn default) */
            --gray-50: #fafafa;
            --gray-100: #f4f4f5;
            --gray-200: #e4e4e7;
            --gray-300: #d4d4d8;
            --gray-400: #a1a1aa;
            --gray-500: #71717a;
            --gray-600: #52525b;
            --gray-700: #3f3f46;
            --gray-800: #27272a;
            --gray-900: #18181b;

            /* Backgrounds */
            --bg-primary: #fafafa;
            --bg-secondary: #ffffff;
            --bg-tertiary: #f4f4f5;
            --bg-dark: #09090b;

            /* Borders - Softer */
            --border-light: #e4e4e7;
            --border-default: #d4d4d8;

            /* Shadows - Subtle, professional */
            --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
            --shadow-md: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
            --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
            --shadow-xl: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
            --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
            --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.08);

            /* Transitions */
            --transition-fast: 150ms ease;
            --transition-normal: 200ms ease;
            --transition-slow: 300ms ease;

            /* Border Radius - shadcn style */
            --radius-sm: 4px;
            --radius-md: 6px;
            --radius-lg: 8px;
            --radius-xl: 12px;
            --radius-2xl: 16px;
            --radius-full: 9999px;
        }

        /* ========================================
           BASE STYLES
           ======================================== */
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--bg-primary);
            color: var(--gray-800);
            min-height: 100vh;
            line-height: 1.6;
            letter-spacing: -0.01em;
        }
        .container { max-width: 1400px; margin: 0 auto; padding: 24px; }
        h1 { font-size: 28px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; color: var(--gray-900); letter-spacing: -0.02em; }
        h1 span { color: var(--gray-900); }
        h2 { font-size: 22px; font-weight: 600; color: var(--gray-900); letter-spacing: -0.02em; margin-bottom: 16px; }
        h3 { font-size: 18px; font-weight: 600; color: var(--gray-800); letter-spacing: -0.01em; margin-bottom: 12px; }
        .subtitle { color: var(--gray-500); font-size: 15px; margin-bottom: 24px; line-height: 1.5; }
        .welcome-text { font-size: 32px; font-weight: 700; color: var(--gray-900); letter-spacing: -0.03em; }

        /* Animations */
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        @keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
        .fade-in { animation: fadeIn 0.4s ease-out forwards; }
        .tab-content.active { animation: fadeIn 0.3s ease-out; }
        
        /* Workspace Bar */
        .workspace-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding: 16px 20px; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-lg); flex-wrap: wrap; box-shadow: var(--shadow-md); }
        .workspace-bar label { font-size: 12px; color: var(--gray-500); text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
        .workspace-select { padding: 10px 14px; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-md); color: var(--gray-800); font-size: 14px; min-width: 200px; transition: all var(--transition-normal); }
        .workspace-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); outline: none; }
        .workspace-btn { padding: 10px 16px; font-size: 13px; border: none; border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition-normal); font-weight: 500; }
        .workspace-btn:hover { opacity: 0.9; }
        .workspace-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .workspace-btn-add { background: var(--gray-900); color: white; }
        .workspace-btn-add:hover { background: var(--gray-800); }
        .workspace-btn-delete { background: var(--gray-200); color: var(--gray-700); }
        .workspace-btn-delete:hover { background: var(--danger-light); color: var(--danger); }
        .workspace-select:disabled { opacity: 0.5; cursor: not-allowed; }
        .workspace-stats { margin-left: auto; font-size: 13px; color: var(--gray-500); font-weight: 500; }

        .tabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 1px solid var(--border-light); padding-bottom: 0; flex-wrap: wrap; }
        .tab { padding: 14px 24px; background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--gray-500); cursor: pointer; font-size: 15px; font-weight: 500; transition: all var(--transition-normal); border-radius: 0; }
        .tab:hover { color: var(--gray-700); background: var(--gray-50); }
        .tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; background: transparent; }
        .tab-admin { color: var(--primary-light); }
        .tab-admin:hover { color: var(--primary); background: var(--primary-50); }
        .tab-admin.active { color: var(--primary); border-bottom-color: var(--primary); }
        .tab-content { display: none; }
        .tab-content.active { display: block; animation: fadeIn 0.3s ease-out; }
        
        .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 20px; }
        .form-group { display: flex; flex-direction: column; gap: 8px; }
        label { font-size: 12px; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
        input, select, textarea { padding: 12px 16px; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-md); color: var(--gray-800); font-size: 14px; transition: all var(--transition-normal); font-family: inherit; }
        input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
        input:hover, select:hover, textarea:hover { border-color: var(--border-default); }
        input::placeholder { color: var(--gray-400); }

        /* Search Mode Toggle */
        .search-mode-toggle { display: flex; background: var(--gray-100); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 4px; margin-bottom: 20px; width: fit-content; }
        .search-mode-btn { padding: 10px 20px; border: none; background: transparent; color: var(--gray-500); font-size: 13px; cursor: pointer; border-radius: var(--radius-md); transition: all var(--transition-normal); font-weight: 500; }
        .search-mode-btn.active { background: var(--bg-secondary); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }
        .search-mode-btn:hover:not(.active) { color: var(--gray-700); }

        /* Searchable Industry Dropdown */
        .industry-search-container { position: relative; }
        .industry-search-input { width: 100%; }
        .industry-dropdown { position: absolute; top: 100%; left: 0; right: 0; max-height: 250px; overflow-y: auto; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: 0 0 var(--radius-md) var(--radius-md); z-index: 100; display: none; box-shadow: var(--shadow-lg); }
        .industry-dropdown.show { display: block; }
        .industry-option { padding: 12px 14px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--border-light); transition: all var(--transition-fast); color: var(--gray-700); }
        .industry-option:hover, .industry-option.highlighted { background: var(--primary); color: white; }
        .industry-option.selected { background: var(--primary-50); color: var(--primary); }
        .selected-industries { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
        .selected-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--primary-50); color: var(--primary); border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; border: 1px solid var(--primary-100); transition: all var(--transition-normal); }
        .selected-tag:hover { background: var(--primary-100); }
        .selected-tag button { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 14px; line-height: 1; transition: color var(--transition-fast); }
        .selected-tag button:hover { color: var(--danger); }
        .company-tags-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; }
        .company-tags-row .selected-industries { margin-top: 0; flex: 1; }
        .clear-all-btn { background: none; border: 1px solid var(--border-light); color: var(--gray-500); padding: 6px 12px; border-radius: var(--radius-sm); font-size: 11px; cursor: pointer; white-space: nowrap; transition: all var(--transition-normal); font-weight: 500; }
        .clear-all-btn:hover { border-color: var(--danger); color: var(--danger); background: rgba(239, 68, 68, 0.05); }

        .btn { padding: 12px 24px; border: none; border-radius: var(--radius-md); cursor: pointer; font-size: 14px; font-weight: 500; transition: all var(--transition-normal); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
        .btn-primary { background: var(--gray-900); color: #fafafa; }
        .btn-primary:hover { background: var(--gray-800); }
        .btn-primary:active { background: var(--gray-900); }
        .btn-primary:disabled { background: var(--gray-300); color: var(--gray-500); cursor: not-allowed; transform: none; box-shadow: none; }
        .btn-secondary { background: var(--bg-secondary); color: var(--gray-700); border: 1px solid var(--border-light); }
        .btn-secondary:hover { background: var(--gray-100); border-color: var(--border-default); }
        .btn-secondary:disabled { background: var(--gray-100); color: var(--gray-400); cursor: not-allowed; }
        .btn-danger { background: var(--danger); color: white; }
        .btn-danger:hover { background: var(--danger-dark); }

        .page-num {
            background: var(--bg-secondary); color: var(--gray-700); border: 1px solid var(--border-light);
            padding: 8px 14px; font-size: 13px; cursor: pointer;
            border-radius: var(--radius-md); min-width: 40px; transition: all var(--transition-normal); font-weight: 500;
        }
        .page-num:hover { background: var(--gray-50); border-color: var(--border-default); }
        .page-num.active { background: var(--primary); border-color: var(--primary); color: white; font-weight: 600; }
        .page-num.loaded { border-color: var(--success); }
        .page-num.loaded:not(.active) { background: rgba(16, 185, 129, 0.1); }
        .page-num:disabled { cursor: default; }
        .btn-warning { background: var(--warning); color: white; }
        .btn-warning:hover { background: var(--warning-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
        .btn-success { background: var(--success); color: white; }
        .btn-success:hover { background: var(--success-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
        .btn-sm { padding: 8px 14px; font-size: 13px; }
        .btn-small { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
        .filter-btn { background: var(--bg-secondary); border: 1px solid var(--border-light); color: var(--gray-600); border-radius: var(--radius-md); transition: all var(--transition-normal); padding: 8px 14px; font-size: 13px; }
        .filter-btn:hover { border-color: var(--border-default); color: var(--gray-800); background: var(--gray-50); }
        .filter-btn.active { background: var(--primary-50); color: var(--primary); border-color: var(--primary); }
        .inbox-filter-btn { background: var(--bg-secondary); border: 1px solid var(--border-light); color: var(--gray-600); border-radius: var(--radius-md); transition: all var(--transition-normal); padding: 8px 14px; font-size: 13px; }
        .inbox-filter-btn:hover { border-color: var(--border-default); color: var(--gray-800); background: var(--gray-50); }
        .inbox-filter-btn.active { background: var(--primary-50); color: var(--primary); border-color: var(--primary); }
        .star-btn { background: none; border: none; cursor: pointer; font-size: 18px; padding: 4px; transition: all var(--transition-normal); color: var(--gray-400); }
        .star-btn:hover { transform: scale(1.15); color: var(--warning); }
        .unread-row { font-weight: 600; background: var(--primary-50); }
        .unread-indicator { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; display: inline-block; }
        
        .table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); background: var(--bg-secondary); border: 1px solid var(--border-light); }
        table { width: 100%; border-collapse: collapse; }
        th, td { padding: 12px 16px; text-align: left; font-size: 14px; }
        th { background: var(--gray-50); color: var(--gray-600); font-weight: 600; text-transform: uppercase; font-size: 11px; position: sticky; top: 0; letter-spacing: 0.5px; border-bottom: 1px solid var(--border-light); }
        td { border-bottom: 1px solid var(--border-light); color: var(--gray-700); }
        tr { transition: all var(--transition-fast); }
        tbody tr:nth-child(even) { background: var(--gray-50); }
        tbody tr:hover { background: var(--primary-50); }

        .card { background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-md); transition: all var(--transition-slow); }
        .card:hover { box-shadow: var(--shadow-hover); transform: scale(1.02); }
        .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
        .card-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; color: var(--gray-900); }

        .stats { display: flex; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
        .stat { background: var(--bg-secondary); border: 1px solid var(--border-light); padding: 20px 24px; border-radius: var(--radius-lg); min-width: 140px; transition: all var(--transition-slow); box-shadow: var(--shadow-sm); }
        .stat:hover { transform: scale(1.02); box-shadow: var(--shadow-lg); }
        .stat.updating { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
        .stat-value { font-size: 28px; font-weight: 700; color: var(--primary); transition: all var(--transition-normal); }
        .stat-value.pulse { animation: pulse 0.3s ease; }
        @keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
        .stat-label { font-size: 12px; color: var(--gray-500); text-transform: uppercase; font-weight: 500; letter-spacing: 0.5px; margin-top: 4px; }
        
        .status { padding: 14px 18px; border-radius: var(--radius-lg); margin-bottom: 14px; font-size: 13px; font-weight: 500; }
        .status-info { background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.2); color: var(--info-dark); }
        .status-success { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--success-dark); }
        .status-error { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.2); color: var(--danger-dark); }
        .status-warning { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.2); color: var(--warning-dark); }

        /* Toast notifications */
        .toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; }
        .toast { padding: 14px 20px; border-radius: var(--radius-lg); color: white; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-xl); animation: slideIn 0.3s ease; min-width: 300px; display: flex; align-items: center; gap: 12px; }
        .toast-success { background: var(--success); }
        .toast-error { background: var(--danger); }
        .toast-warning { background: var(--warning); }
        .toast-info { background: var(--info); }
        .toast.hiding { animation: slideOut 0.3s ease forwards; }
        @keyframes toastSlideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
        @keyframes toastSlideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

        .checkbox-cell { width: 35px; }
        input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); border-radius: 4px; }

        .actions-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

        .badge { display: inline-block; padding: 4px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
        .badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success-dark); }
        .badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning-dark); }
        .badge-error { background: rgba(239, 68, 68, 0.1); color: var(--danger-dark); }
        .badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info-dark); }
        .badge-purple { background: var(--primary-50); color: var(--primary-dark); }

        .spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }

        .cost-indicator { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 6px 10px; border-radius: var(--radius-full); font-weight: 500; }
        .cost-free { background: rgba(16, 185, 129, 0.1); color: var(--success-dark); }

        .modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
        .modal.active { display: flex; animation: fadeIn 0.2s ease-out; }
        .modal-content { background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-xl); padding: 28px; max-width: 600px; width: 100%; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-xl); animation: slideIn 0.3s ease-out; }
        .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
        .modal-header h3 { font-size: 18px; font-weight: 600; color: var(--gray-900); }
        .modal-close { background: var(--gray-100); border: 1px solid var(--border-light); color: var(--gray-500); width: 36px; height: 36px; border-radius: var(--radius-md); font-size: 20px; cursor: pointer; transition: all var(--transition-normal); display: flex; align-items: center; justify-content: center; }
        .modal-close:hover { background: var(--gray-200); color: var(--gray-700); }

        /* Slide-in Email Panel */
        .email-panel-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); z-index: 1000; }
        .email-panel-overlay.active { display: block; animation: fadeIn 0.2s ease-out; }
        .email-panel { position: fixed; top: 0; right: -500px; width: 500px; max-width: 90vw; height: 100vh; background: var(--bg-secondary); border-left: 1px solid var(--border-light); box-shadow: -4px 0 20px rgba(0,0,0,0.15); z-index: 1001; transition: right 0.3s ease-out; display: flex; flex-direction: column; }
        .email-panel.active { right: 0; }
        .email-panel-header { padding: 20px 24px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: flex-start; flex-shrink: 0; }
        .email-panel-close { background: var(--gray-100); border: 1px solid var(--border-light); color: var(--gray-500); width: 36px; height: 36px; border-radius: var(--radius-md); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .email-panel-close:hover { background: var(--gray-200); color: var(--gray-700); }
        .email-panel-meta { flex: 1; min-width: 0; }
        .email-panel-meta-row { display: flex; gap: 8px; margin-bottom: 8px; font-size: 13px; }
        .email-panel-meta-label { color: var(--gray-500); min-width: 50px; }
        .email-panel-meta-value { color: var(--gray-800); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .email-panel-subject { font-size: 18px; font-weight: 600; color: var(--gray-900); margin-top: 12px; line-height: 1.4; }
        .email-panel-body { flex: 1; overflow-y: auto; padding: 24px; }
        .email-panel-body-content { font-size: 14px; line-height: 1.7; color: var(--gray-700); white-space: pre-wrap; background: var(--gray-50); padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--border-light); }
        .email-panel-actions { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; gap: 10px; justify-content: space-between; flex-shrink: 0; background: var(--bg-secondary); }

        /* Email Threading Styles */
        .thread-row { cursor: pointer; }
        .thread-row:hover { background: var(--gray-50); }
        .thread-count { display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; margin-left: 8px; }
        .thread-expand-btn { background: none; border: none; color: var(--gray-500); cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); transition: all 0.15s; }
        .thread-expand-btn:hover { background: var(--gray-100); color: var(--gray-700); }
        .thread-child-row { background: var(--gray-50); border-left: 3px solid var(--gray-300) !important; }
        .thread-child-row td:first-child { padding-left: 30px; }
        .thread-child-row .thread-indent { display: inline-block; width: 20px; color: var(--gray-400); }

        /* Email Label Badges */
        .email-label { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
        .email-label-lead { background: #dbeafe; color: #1d4ed8; }
        .email-label-client { background: #dcfce7; color: #15803d; }
        .email-label-newsletter { background: #fef3c7; color: #b45309; }
        .email-label-other { background: #f3f4f6; color: #6b7280; }
        .email-label-follow-up { background: #fef3c7; color: #b45309; }
        .email-label-spam { background: #fee2e2; color: #dc2626; }
        .email-label-snoozed { background: #e0e7ff; color: #4338ca; }

        /* Reply Category Badges */
        .reply-label-interested { background: #dcfce7; color: #15803d; }
        .reply-label-not-interested { background: #fee2e2; color: #dc2626; }
        .reply-label-question { background: #fef3c7; color: #b45309; }
        .reply-label-ooo { background: #e0e7ff; color: #4338ca; }

        /* AI Replied Badge */
        .ai-replied-label { background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); color: #fff; }
        .ai-pending-label { background: #ede9fe; color: #7c3aed; border: 1px dashed #a78bfa; }

        /* AI Reply Display in Panel */
        .ai-reply-display { color: #e5e7eb; }
        .ai-reply-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
        .ai-reply-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); color: #fff; border-radius: 20px; font-size: 12px; font-weight: 600; }
        .ai-reply-time { font-size: 12px; color: #9ca3af; }
        .ai-reply-content { font-size: 14px; line-height: 1.6; color: #d1d5db; white-space: pre-wrap; }

        .label-dropdown { padding: 6px 12px; border-radius: var(--radius-md); border: 1px solid var(--border-light); background: var(--bg-secondary); color: var(--gray-700); font-size: 13px; cursor: pointer; min-width: 120px; }
        .label-dropdown:focus { outline: none; border-color: var(--primary); }
        .snooze-indicator { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: #e0e7ff; color: #4338ca; border-radius: 12px; font-size: 11px; font-weight: 500; white-space: nowrap; }
        .snoozed-row { opacity: 0.6; }

        /* Schedule Send Dropdown */
        .schedule-dropdown { position: absolute; bottom: 100%; right: 0; margin-bottom: 8px; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); min-width: 200px; z-index: 100; overflow: hidden; }
        .schedule-dropdown-header { padding: 10px 14px; font-weight: 600; font-size: 13px; color: var(--gray-700); border-bottom: 1px solid var(--border-light); background: var(--gray-50); }
        .schedule-option { display: block; width: 100%; padding: 10px 14px; text-align: left; border: none; background: none; cursor: pointer; font-size: 13px; color: var(--gray-700); transition: background 0.15s; }
        .schedule-option:hover { background: var(--primary-50); color: var(--primary); }
        .schedule-dropdown-divider { height: 1px; background: var(--border-light); margin: 4px 0; }
        .scheduled-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: #dbeafe; color: #1d4ed8; border-radius: var(--radius-md); font-size: 12px; font-weight: 500; }

        /* Attachment Styles */
        .attachment-badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; background: var(--gray-100); color: var(--gray-600); border-radius: 10px; font-size: 11px; font-weight: 500; margin-left: 4px; }
        .attachment-badge svg { width: 12px; height: 12px; }
        .attachments-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-light); }
        .attachments-header { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
        .attachment-list { display: flex; flex-direction: column; gap: 8px; }
        .attachment-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--gray-50); border: 1px solid var(--border-light); border-radius: var(--radius-md); transition: all 0.15s; }
        .attachment-item:hover { background: var(--primary-50); border-color: var(--primary); }
        .attachment-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--bg-secondary); border-radius: var(--radius-sm); font-size: 18px; flex-shrink: 0; }
        .attachment-info { flex: 1; min-width: 0; }
        .attachment-name { font-size: 13px; font-weight: 500; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .attachment-size { font-size: 11px; color: var(--gray-500); }
        .attachment-download { padding: 6px 12px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 4px; }
        .attachment-download:hover { background: var(--primary-dark); }

        /* Drafts Styles */
        .drafts-list { display: flex; flex-direction: column; gap: 10px; }
        .draft-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: var(--gray-50); border: 1px solid var(--border-light); border-radius: var(--radius-md); cursor: pointer; transition: all 0.15s; }
        .draft-item:hover { background: var(--primary-50); border-color: var(--primary); }
        .draft-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--bg-secondary); border-radius: var(--radius-sm); font-size: 18px; flex-shrink: 0; }
        .draft-content { flex: 1; min-width: 0; }
        .draft-to { font-size: 14px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .draft-subject { font-size: 13px; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
        .draft-preview { font-size: 12px; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
        .draft-meta { font-size: 11px; color: var(--gray-400); margin-top: 6px; }
        .draft-actions { display: flex; gap: 6px; flex-shrink: 0; }
        .draft-btn { padding: 6px 10px; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; transition: all 0.15s; }
        .draft-btn:hover { background: var(--gray-100); }
        .draft-btn-delete { color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }
        .draft-btn-delete:hover { background: var(--danger-light); border-color: var(--danger); }
        .draft-autosave-indicator { position: fixed; bottom: 20px; left: 260px; background: var(--gray-800); color: #fff; padding: 8px 14px; border-radius: var(--radius-md); font-size: 12px; display: none; align-items: center; gap: 8px; z-index: 1000; animation: fadeIn 0.2s; }

        /* Calendar Integration Styles */
        .calendar-dates-section { margin-top: 16px; padding: 16px; background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%); border: 1px solid #bfdbfe; border-radius: var(--radius-md); }
        .calendar-dates-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 600; color: var(--gray-800); font-size: 13px; }
        .calendar-date-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-sm); margin-bottom: 8px; }
        .calendar-date-item:last-child { margin-bottom: 0; }
        .calendar-date-text { font-size: 13px; color: var(--gray-700); font-weight: 500; }
        .calendar-date-original { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
        .calendar-add-btn { padding: 6px 12px; background: #4285f4; color: #fff; border: none; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.15s; }
        .calendar-add-btn:hover { background: #3367d6; }
        .calendar-add-btn:disabled { opacity: 0.6; cursor: not-allowed; }

        /* Follow-up Reminder Styles */
        .followup-banner { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); border: 1px solid #f59e0b; border-radius: var(--radius-md); padding: 16px; margin-bottom: 16px; }
        .followup-banner-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
        .followup-banner-title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #92400e; font-size: 14px; }
        .followup-banner-close { background: none; border: none; color: #92400e; cursor: pointer; padding: 4px; opacity: 0.7; }
        .followup-banner-close:hover { opacity: 1; }
        .followup-list { display: flex; flex-direction: column; gap: 8px; }
        .followup-item { display: flex; align-items: center; justify-content: space-between; padding: 12px; background: #fff; border: 1px solid #fcd34d; border-radius: var(--radius-sm); }
        .followup-info { flex: 1; min-width: 0; }
        .followup-to { font-size: 13px; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .followup-subject { font-size: 12px; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
        .followup-days { font-size: 11px; color: #b45309; margin-top: 4px; }
        .followup-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: 12px; }
        .followup-btn { padding: 6px 10px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 500; cursor: pointer; border: 1px solid; transition: all 0.15s; }
        .followup-btn-reply { background: var(--primary); color: #fff; border-color: var(--primary); }
        .followup-btn-reply:hover { background: var(--primary-dark); }
        .followup-btn-dismiss { background: #fff; color: var(--gray-600); border-color: var(--border-light); }
        .followup-btn-dismiss:hover { background: var(--gray-100); }

        .truncate { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .help-text { font-size: 11px; color: var(--gray-500); margin-top: 4px; }

        .progress-bar { width: 100%; height: 8px; background: var(--gray-200); border-radius: var(--radius-full); overflow: hidden; margin: 12px 0; }
        .progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--info)); transition: width 0.3s ease; border-radius: var(--radius-full); }

        /* Auth Styles */
        .auth-container { display: none; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%); }
        .auth-container.active { display: flex; }
        .auth-card { background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-xl); padding: 48px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); animation: fadeIn 0.4s ease; }
        .auth-logo { text-align: center; margin-bottom: 36px; }
        .auth-logo img { height: 50px; }
        .auth-logo h1 { font-size: 32px; margin-top: 12px; font-weight: 700; color: var(--gray-900); }
        .auth-logo h1 span { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
        .auth-title { font-size: 22px; font-weight: 600; margin-bottom: 10px; text-align: center; color: var(--gray-900); }
        .auth-subtitle { color: var(--gray-500); font-size: 14px; text-align: center; margin-bottom: 32px; }
        .auth-form .form-group { margin-bottom: 22px; }
        .auth-form label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--gray-600); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
        .auth-form input { width: 100%; padding: 14px 16px; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-md); color: var(--gray-800); font-size: 15px; transition: all var(--transition-normal); }
        .auth-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
        .auth-form input:hover { border-color: var(--gray-300); }
        .auth-form .btn { width: 100%; padding: 16px; font-size: 15px; margin-top: 12px; }
        .auth-switch { text-align: center; margin-top: 28px; font-size: 14px; color: var(--gray-500); }
        .auth-switch a { color: var(--primary); text-decoration: none; cursor: pointer; font-weight: 500; transition: color var(--transition-normal); }
        .auth-switch a:hover { color: var(--primary-dark); }
        .auth-error { background: var(--danger-light); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--danger); padding: 14px; border-radius: var(--radius-md); margin-bottom: 22px; font-size: 13px; display: none; }
        .auth-error.show { display: block; animation: fadeIn 0.3s ease; }
        .user-menu { display: flex; align-items: center; gap: 12px; margin-left: auto; }
        .user-email { font-size: 13px; color: var(--gray-600); font-weight: 500; }
        .logout-btn { background: transparent; border: 1px solid var(--border-light); color: var(--gray-500); padding: 8px 14px; border-radius: var(--radius-md); font-size: 12px; cursor: pointer; transition: all var(--transition-normal); font-weight: 500; }
        .logout-btn:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }
        .app-container { display: none; }
        .app-container.active { display: flex; }

        /* ===== SIDEBAR LAYOUT ===== */

        /* Sidebar - Dark Theme (shadcn zinc) */
        .sidebar {
            position: fixed;
            left: 0;
            top: 0;
            bottom: 0;
            width: var(--sidebar-width);
            height: 100vh;
            background: var(--sidebar-bg);
            display: flex;
            flex-direction: column;
            z-index: 100;
            border-right: 1px solid var(--sidebar-border);
        }

        .sidebar-logo {
            padding: 24px 20px;
            display: flex; align-items: center; gap: 12px;
            border-bottom: 1px solid var(--sidebar-border);
        }
        .sidebar-logo img { height: 32px; flex-shrink: 0; }
        .sidebar-logo span { font-size: 18px; font-weight: 700; color: #fff; white-space: nowrap; }
        .sidebar-logo .logo-accent { color: var(--primary-light); }

        .workspace-selector { padding: 16px 20px; border-bottom: 1px solid var(--sidebar-border); }
        .workspace-selector label { font-size: 10px; color: var(--sidebar-text); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; display: block; font-weight: 600; }
        .workspace-dropdown {
            width: 100%; padding: 10px 12px;
            background: var(--sidebar-hover);
            border: 1px solid var(--sidebar-border);
            border-radius: var(--radius-md);
            color: #fff; font-size: 13px; cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
            background-repeat: no-repeat; background-position: right 10px center;
            padding-right: 30px; transition: all 0.2s;
        }
        .workspace-dropdown:hover { border-color: #444; background: #353548; }
        .workspace-dropdown:focus { outline: none; border-color: var(--primary); }
        .workspace-dropdown:disabled { opacity: 0.5; cursor: not-allowed; }
        .workspace-actions { display: flex; gap: 6px; margin-top: 10px; }
        .workspace-action-btn, .workspace-btn-new, .workspace-btn-del {
            flex: 1; padding: 8px 10px; font-size: 11px;
            border: 1px solid var(--sidebar-border);
            background: transparent; color: var(--sidebar-text);
            border-radius: var(--radius-sm); cursor: pointer;
            transition: all 0.2s; font-weight: 500;
            display: flex; align-items: center; justify-content: center; gap: 4px;
        }
        .workspace-action-btn:hover, .workspace-btn-new:hover { background: var(--sidebar-hover); color: #fff; border-color: #444; }
        .workspace-btn-new {
            background: #3f3f46;
            border: none;
            border-radius: 6px;
            color: #fff;
            transition: all 0.15s ease;
        }
        .workspace-btn-new:hover {
            background: #4f46e5;
            color: #fff;
        }
        .workspace-btn-del { border-color: rgba(239, 68, 68, 0.3); color: #f87171; }
        .workspace-btn-del:hover { background: rgba(239, 68, 68, 0.1); }

        .sidebar-nav { flex: 1; padding: 20px 12px; overflow-y: auto; }
        .nav-group { margin-bottom: 24px; }
        .nav-group-title { font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 1px; padding: 0 12px; margin-bottom: 10px; font-weight: 600; }
        .nav-item {
            display: flex;
            align-items: center;
            padding: 12px 16px;
            border-radius: 6px;
            color: var(--sidebar-text);
            cursor: pointer;
            transition: all 0.15s ease;
            margin-bottom: 4px;
            text-decoration: none;
        }
        .nav-item i {
            width: 20px;
            height: 20px;
            margin-right: 14px;
            flex-shrink: 0;
            opacity: 0.7;
            transition: opacity 0.15s ease;
        }
        .nav-item span { font-size: 15px; flex: 1; font-weight: 500; }
        .nav-item:hover {
            background: rgba(255, 255, 255, 0.05);
            color: #fff;
        }
        .nav-item:hover i { opacity: 1; }
        .nav-item.active {
            background: var(--sidebar-active);
            color: var(--sidebar-text-active);
            font-weight: 500;
        }
        .nav-item.active i {
            opacity: 1;
            color: var(--sidebar-text-active);
        }
        .nav-item.admin { color: var(--sidebar-text); }
        .nav-item.admin:hover { background: var(--sidebar-hover); }
        .nav-item.admin.active { background: var(--sidebar-active); }
        .nav-badge {
            background: var(--sidebar-hover);
            color: var(--sidebar-text);
            font-size: 11px; font-weight: 600;
            padding: 2px 8px; border-radius: var(--radius-full);
            min-width: 22px; text-align: center;
        }
        .nav-badge.highlight { background: var(--danger); color: #fff; }

        .sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--sidebar-border); }
        .user-profile { display: flex; align-items: center; gap: 12px; }
        .user-avatar {
            width: 40px; height: 40px;
            background: var(--gray-700);
            color: #fff; border-radius: var(--radius-lg);
            display: flex; align-items: center; justify-content: center;
            font-weight: 600; font-size: 15px; flex-shrink: 0;
        }
        .user-info { flex: 1; min-width: 0; }
        .user-name { font-size: 14px; font-weight: 500; color: #fff; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .user-role { font-size: 12px; color: #666; display: block; }
        .logout-btn-icon {
            color: #666; cursor: pointer; padding: 8px;
            border-radius: var(--radius-md); transition: all 0.2s;
            background: none; border: none; display: flex; align-items: center; justify-content: center;
        }
        .logout-btn-icon:hover { background: rgba(239, 68, 68, 0.15); color: #f87171; }

        /* Top Header - Light Theme */
        .top-header {
            position: fixed; top: 0; left: var(--sidebar-width); right: 0;
            height: var(--header-height);
            background: var(--header-bg);
            border-bottom: 1px solid var(--border-light);
            display: flex; align-items: center;
            padding: 0 24px; z-index: 50;
            box-shadow: var(--shadow-sm);
        }

        .mobile-menu-btn {
            display: none; width: 40px; height: 40px;
            border: none; background: transparent;
            border-radius: var(--radius-md); cursor: pointer;
            align-items: center; justify-content: center;
            color: var(--gray-500); font-size: 20px; margin-right: 12px;
        }
        .mobile-menu-btn:hover { background: var(--gray-100); color: var(--gray-700); }
        .page-title { font-size: 20px; font-weight: 600; color: var(--gray-800); margin: 0; }

        .header-search {
            position: relative;
            max-width: 300px;
            height: 36px;
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.5);
            border-radius: 6px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            padding: 0 14px;
        }
        .header-search:focus-within {
            border-color: rgba(63, 63, 70, 0.5);
            box-shadow: 0 2px 15px rgba(63, 63, 70, 0.1);
        }
        .header-search i {
            width: 16px;
            height: 16px;
            color: #9CA3AF;
            flex-shrink: 0;
        }
        .header-search input {
            flex: 1;
            padding: 0 0 0 10px;
            background: transparent;
            border: none;
            font-size: 14px;
            color: var(--gray-800);
            height: 100%;
        }
        .header-search input:focus {
            outline: none;
        }
        .header-search input::placeholder { color: #9CA3AF; }

        .header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
        .header-btn {
            width: 40px; height: 40px; border: none;
            background: transparent; border-radius: var(--radius-lg);
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            color: var(--gray-500); position: relative; transition: all 0.2s;
        }
        .header-btn:hover { background: var(--gray-100); color: var(--gray-700); }
        .notification-badge {
            position: absolute; top: 6px; right: 6px;
            width: 8px; height: 8px;
            background: var(--danger); border-radius: 50%;
            border: 2px solid var(--header-bg);
        }
        .notification-count {
            position: absolute; top: 2px; right: 2px;
            min-width: 18px; height: 18px; padding: 0 5px;
            background: var(--danger); border-radius: 9px;
            font-size: 11px; font-weight: 600; color: white;
            display: flex; align-items: center; justify-content: center;
            border: 2px solid var(--header-bg);
        }
        .notification-wrapper { position: relative; }
        .notification-dropdown {
            position: absolute; top: calc(100% + 8px); right: 0;
            width: 380px; max-height: 480px;
            background: white; border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 2px 10px rgba(0,0,0,0.1);
            border: 1px solid var(--border-light);
            display: none; z-index: 1000;
            overflow: hidden;
        }
        .notification-dropdown.active { display: block; animation: slideDown 0.2s ease; }
        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .notification-header {
            padding: 16px 20px; border-bottom: 1px solid var(--border-light);
            display: flex; justify-content: space-between; align-items: center;
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        }
        .notification-header h3 { font-size: 15px; font-weight: 600; color: var(--gray-900); margin: 0; }
        .notification-header button {
            background: none; border: none; color: var(--primary);
            font-size: 13px; font-weight: 500; cursor: pointer;
            padding: 4px 8px; border-radius: 6px; transition: all 0.2s;
        }
        .notification-header button:hover { background: var(--primary-light); }
        .notification-list { max-height: 380px; overflow-y: auto; }
        .notification-item {
            padding: 14px 20px; border-bottom: 1px solid var(--border-light);
            display: flex; gap: 12px; cursor: pointer; transition: all 0.2s;
            position: relative;
        }
        .notification-item:hover { background: var(--gray-50); }
        .notification-item.unread { background: #fef3c7; }
        .notification-item.unread:hover { background: #fde68a; }
        .notification-icon {
            width: 36px; height: 36px; border-radius: 10px;
            display: flex; align-items: center; justify-content: center;
            flex-shrink: 0;
        }
        .notification-icon.overdue { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #d97706; }
        .notification-icon.stage-change { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #2563eb; }
        .notification-icon.won { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); color: #16a34a; }
        .notification-icon.lost { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); color: #dc2626; }
        .notification-icon svg { width: 18px; height: 18px; }
        .notification-content { flex: 1; min-width: 0; }
        .notification-title { font-size: 13px; font-weight: 500; color: var(--gray-900); margin-bottom: 2px; }
        .notification-desc { font-size: 12px; color: var(--gray-600); line-height: 1.4; }
        .notification-time { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
        .notification-empty {
            padding: 40px 20px; text-align: center; color: var(--gray-500);
        }
        .notification-empty i { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }
        .notification-empty p { font-size: 14px; margin: 0; }

        /* Main Content Area - Light Theme */
        .main-wrapper {
            margin-left: var(--sidebar-width);
            padding-top: var(--header-height);
            min-height: 100vh;
            background: var(--main-bg);
            flex: 1;
        }

        .main-content { padding: 36px; max-width: 1400px; margin: 0 auto; }

        .page-content { display: none; animation: fadeIn 0.3s ease; }
        .page-content.active { display: flex; flex-direction: column; gap: 24px; }
        .section { margin-bottom: 24px; }

        /* ========================================
           ANIMATED GRADIENT BLOBS BACKGROUND
           ======================================== */
        .gradient-mesh-bg {
            position: fixed;
            top: 0;
            left: var(--sidebar-width);
            right: 0;
            bottom: 0;
            pointer-events: none;
            overflow: hidden;
            z-index: 0;
        }

        .gradient-blob {
            position: absolute;
            border-radius: 50%;
            filter: blur(100px);
        }

        /* Blob 1: Purple, top-right, 400px, opacity 0.15 - diagonal drift */
        .gradient-blob-1 {
            width: 400px;
            height: 400px;
            background: #9333EA;
            opacity: 0.15;
            top: -100px;
            right: -50px;
            animation: blobDrift1 25s ease-in-out infinite;
        }

        /* Blob 2: Pink, bottom-left, 350px, opacity 0.12 - opposite drift */
        .gradient-blob-2 {
            width: 350px;
            height: 350px;
            background: #EC4899;
            opacity: 0.12;
            bottom: -80px;
            left: -50px;
            animation: blobDrift2 30s ease-in-out infinite;
        }

        /* Blob 3: Cyan, center, 300px, opacity 0.10 - scale pulse */
        .gradient-blob-3 {
            width: 300px;
            height: 300px;
            background: #06B6D4;
            opacity: 0.10;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            animation: blobPulse3 20s ease-in-out infinite;
        }

        @keyframes blobDrift1 {
            0%, 100% { transform: translate(0, 0); }
            50% { transform: translate(-100px, 120px); }
        }

        @keyframes blobDrift2 {
            0%, 100% { transform: translate(0, 0); }
            50% { transform: translate(120px, -100px); }
        }

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

        /* Dashboard Welcome Banner with Flowing Gradient */
        .welcome-banner {
            background: linear-gradient(135deg,
                #4f46e5 0%,
                #3f3f46 15%,
                #52525b 30%,
                #71717a 45%,
                #d946ef 60%,
                #ec4899 75%,
                #52525b 90%,
                #4f46e5 100%);
            background-size: 400% 400%;
            animation: gradientFlow 8s ease infinite;
            border-radius: 12px;
            padding: 32px 36px;
            margin-bottom: 28px;
            color: #fff;
            position: relative;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.2);
            box-shadow:
                0 4px 24px rgba(63, 63, 70, 0.35),
                0 8px 48px rgba(168, 85, 247, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
            min-height: 160px;
        }
        @keyframes gradientFlow {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        .welcome-banner .wave-svg {
            position: absolute;
            bottom: 0; left: 0; right: 0;
            width: 100%; height: 100px;
            opacity: 0.4;
        }
        .welcome-banner .wave-svg-2 {
            position: absolute;
            bottom: 0; left: 0; right: 0;
            width: 100%; height: 80px;
            opacity: 0.25;
        }
        .welcome-banner .blob-svg {
            position: absolute;
            top: -30%; right: -10%;
            width: 400px; height: 400px;
            opacity: 0.25;
            animation: blobFloat 12s ease-in-out infinite;
        }
        @keyframes blobFloat {
            0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
            33% { transform: translate(20px, -20px) rotate(5deg) scale(1.05); }
            66% { transform: translate(-10px, 10px) rotate(-3deg) scale(0.98); }
        }
        .welcome-banner::before {
            content: '';
            position: absolute;
            top: -50%; right: -30%;
            width: 80%; height: 250%;
            background: radial-gradient(ellipse, rgba(255,255,255,0.2) 0%, transparent 70%);
            border-radius: 50%;
            animation: shimmer 6s ease-in-out infinite;
        }
        @keyframes shimmer {
            0%, 100% { opacity: 0.2; transform: scale(1); }
            50% { opacity: 0.35; transform: scale(1.1); }
        }
        @keyframes progressShimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(200%); }
        }
        .welcome-banner .welcome-content {
            position: relative; z-index: 2;
        }
        .welcome-banner h1 {
            font-size: 28px;
            font-weight: 700;
            margin: 0 0 8px 0;
            color: #fff;
            letter-spacing: -0.02em;
            text-shadow: 0 0 40px rgba(255, 255, 255, 0.5), 0 0 80px rgba(255, 255, 255, 0.3);
        }
        .welcome-banner h1 .name-gradient {
            background: linear-gradient(135deg, #fef08a 0%, #fde047 25%, #facc15 50%, #fbbf24 75%, #f59e0b 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            font-weight: 800;
            text-shadow: none;
            filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.6));
        }
        .welcome-banner p {
            font-size: 15px;
            margin: 0;
            color: rgba(255, 255, 255, 0.9);
            font-weight: 400;
            text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
        }

        /* Stats Cards Row with Glass Effect */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 24px;
            margin-bottom: 32px;
            position: relative;
            z-index: 1;
        }
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .stat-card {
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            padding: 20px;
            transition: all 0.2s ease;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            animation: fadeInUp 0.4s ease-out forwards;
            opacity: 0;
        }
        .stat-card:nth-child(1) { animation-delay: 0ms; }
        .stat-card:nth-child(2) { animation-delay: 50ms; }
        .stat-card:nth-child(3) { animation-delay: 100ms; }
        .stat-card:nth-child(4) { animation-delay: 150ms; }
        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(63, 63, 70, 0.12);
            border-color: rgba(63, 63, 70, 0.2);
        }
        .stat-card .stat-icon {
            width: 44px; height: 44px;
            border-radius: 10px;
            display: flex; align-items: center; justify-content: center;
            font-size: 20px; margin-bottom: 14px;
        }
        .stat-card .stat-icon.leads {
            background: rgba(63, 63, 70, 0.1);
            color: #3f3f46;
        }
        .stat-card .stat-icon.emails {
            background: rgba(16, 185, 129, 0.1);
            color: #10b981;
        }
        .stat-card .stat-icon.warmup {
            background: rgba(245, 158, 11, 0.1);
            color: #f59e0b;
        }
        .stat-card .stat-icon.inbox {
            background: rgba(82, 82, 91, 0.1);
            color: #52525b;
        }
        .stat-card .stat-content .stat-value {
            font-size: 28px;
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 2px;
            display: block;
            letter-spacing: -0.02em;
        }
        .stat-card .stat-content .stat-label {
            font-size: 12px;
            color: #64748b;
            font-weight: 500;
        }
        .stat-card .stat-trend {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            font-size: 12px;
            font-weight: 500;
            margin-top: 10px;
            padding: 3px 8px;
            border-radius: 4px;
        }
        .stat-card .stat-trend.up {
            background: #ECFDF5;
            color: #059669;
        }
        .stat-card .stat-trend.down {
            background: rgba(239, 68, 68, 0.1);
            color: var(--danger);
        }
        .stat-card .stat-trend.neutral {
            background: rgba(107, 114, 128, 0.1);
            color: var(--gray-500);
        }

        /* Pipeline Kanban Drag & Drop */
        .kanban-column.drag-active {
            border-style: dashed;
        }
        .kanban-column.drag-over {
            background: rgba(63, 63, 70, 0.08) !important;
            border-color: var(--primary) !important;
            transform: scale(1.02);
            box-shadow: 0 0 20px rgba(63, 63, 70, 0.2);
        }
        .opportunity-card {
            transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
        }
        .opportunity-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-md) !important;
            border-color: var(--primary-100) !important;
        }
        .opportunity-card:active {
            cursor: grabbing;
        }
        .opp-delete-btn {
            width: 18px;
            height: 18px;
            border: none;
            background: transparent;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            color: #9ca3af;
            font-size: 16px;
            font-weight: bold;
            line-height: 1;
            padding: 0;
            opacity: 0;
            transition: all 0.15s;
        }
        .opportunity-card:hover .opp-delete-btn {
            opacity: 1;
        }
        .opp-delete-btn:hover {
            background: #fee2e2;
            color: #ef4444;
        }

        /* Dashboard Cards */
        .dashboard-card {
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            padding: 20px;
            position: relative;
            z-index: 1;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            transition: all 0.2s ease;
        }
        .dashboard-card:hover {
            box-shadow: 0 8px 24px rgba(63, 63, 70, 0.08);
            border-color: rgba(63, 63, 70, 0.15);
        }

        /* Dashboard Grid - Activity & Quick Actions */
        .dashboard-grid {
            display: grid;
            grid-template-columns: 1.5fr 1fr;
            gap: 24px;
        }
        .card-header {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 20px; padding-bottom: 16px;
            border-bottom: 1px solid var(--border-light);
        }
        .card-header h3 {
            font-size: 15px; font-weight: 600; color: #1e293b;
            display: flex; align-items: center; gap: 10px; margin: 0;
            letter-spacing: -0.01em;
        }
        .card-header h3 i { color: #3f3f46; width: 18px; height: 18px; }

        .activity-list { display: flex; flex-direction: column; gap: 12px; }
        .activity-item {
            display: flex; align-items: flex-start; gap: 14px;
            padding: 14px; background: var(--gray-50);
            border-radius: var(--radius-lg); transition: all 0.2s;
        }
        .activity-item:hover { background: var(--gray-100); }
        .activity-item .activity-icon {
            width: 40px; height: 40px; border-radius: var(--radius-md);
            display: flex; align-items: center; justify-content: center;
            font-size: 18px; flex-shrink: 0;
        }
        .activity-item .activity-icon.search { background: var(--info-light); color: var(--info); }
        .activity-item .activity-icon.email { background: var(--success-light); color: var(--success); }
        .activity-item .activity-icon.warmup { background: var(--warning-light); color: var(--warning); }
        .activity-item .activity-content { flex: 1; min-width: 0; }
        .activity-item .activity-content p { font-size: 14px; color: var(--gray-700); margin: 0 0 4px 0; }
        .activity-item .activity-content span { font-size: 12px; color: var(--gray-400); }

        /* Empty state for activity */
        .activity-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 40px 20px;
            text-align: center;
        }
        .activity-empty .empty-icon {
            width: 48px;
            height: 48px;
            color: #9CA3AF;
            margin-bottom: 16px;
            animation: emptyPulse 2s ease-in-out infinite;
        }
        @keyframes emptyPulse {
            0%, 100% { opacity: 0.5; }
            50% { opacity: 1; }
        }
        .activity-empty .empty-title {
            font-size: 16px;
            font-weight: 500;
            color: #374151;
            margin: 0 0 4px 0;
        }
        .activity-empty .empty-subtext {
            font-size: 14px;
            color: #9CA3AF;
            margin: 0;
        }

        .quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
        .quick-action {
            padding: 18px 16px;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            cursor: pointer;
            text-align: center;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            transition: all 0.2s ease;
            min-height: 70px;
        }
        .quick-action:hover {
            background: #fff;
            border-color: rgba(63, 63, 70, 0.3);
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(63, 63, 70, 0.12);
        }
        .quick-action i {
            font-size: 24px; color: var(--primary);
            margin-bottom: 10px; display: block;
        }
        .quick-action span {
            font-size: 13px; color: var(--gray-600); font-weight: 500;
        }

        /* Page Cards for other sections */
        .page-card {
            background: var(--card-bg);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-xl);
            padding: 24px; margin-bottom: 24px;
            box-shadow: var(--shadow-card);
        }
        .page-card:hover { box-shadow: var(--shadow-lg); }
        .page-card .card-header { margin-bottom: 20px; }
        .page-card .card-title {
            font-size: 18px; font-weight: 600;
            color: var(--gray-800); display: flex;
            align-items: center; gap: 10px;
        }

        /* Hide old elements in new layout */
        .app-container.active .tabs { display: none !important; }
        .app-container.active .workspace-bar { display: none !important; }
        .app-container.active > .container { display: none !important; }

        /* Mobile Overlay */
        .mobile-overlay {
            display: none; position: fixed; inset: 0;
            background: rgba(0,0,0,0.5); z-index: 90;
            backdrop-filter: blur(2px);
        }
        .mobile-overlay.active { display: block; }

        /* Pipeline Analytics Grids */
        .pipeline-stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
            margin-bottom: 24px;
        }
        .pipeline-stat-card {
            border-radius: var(--radius-xl);
            padding: 20px;
            color: white;
        }
        .pipeline-stat-card .stat-label { font-size: 13px; opacity: 0.85; margin-bottom: 8px; }
        .pipeline-stat-card .stat-value { font-size: 28px; font-weight: 700; }
        .pipeline-stat-card.purple { background: var(--gray-900); }
        .pipeline-stat-card.green { background: var(--gray-800); }
        .pipeline-stat-card.orange { background: var(--gray-700); }
        .pipeline-stat-card.blue { background: var(--gray-600); }

        .charts-grid {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 24px;
        }
        .chart-container { height: 300px; position: relative; }
        .chart-container.pie { display: flex; align-items: center; justify-content: center; }

        /* Responsive */
        @media (max-width: 1200px) {
            .stats-grid { grid-template-columns: repeat(2, 1fr); }
            .dashboard-grid { grid-template-columns: 1fr; }
            .pipeline-stats-grid { grid-template-columns: repeat(2, 1fr); }
            .charts-grid { grid-template-columns: 1fr; }
        }
        @media (max-width: 1024px) {
            .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
            .sidebar.mobile-open { transform: translateX(0); }
            .main-wrapper { margin-left: 0; }
            .top-header { left: 0; }
            .mobile-menu-btn { display: flex; }
        }
        @media (max-width: 768px) {
            .header-search { display: none; }
            .stats-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
            .quick-actions { grid-template-columns: 1fr 1fr; }
            .main-content { padding: 16px; }
            .welcome-banner { padding: 24px; }
            .welcome-banner h1 { font-size: 22px; }
            .pipeline-stats-grid { gap: 12px; }
            .pipeline-stat-card { padding: 16px; }
            .pipeline-stat-card .stat-value { font-size: 22px; }
            .chart-container { height: 250px; }
            .dashboard-card { padding: 16px; }
        }
        @media (max-width: 480px) {
            .stats-grid { grid-template-columns: 1fr; }
            .pipeline-stats-grid { grid-template-columns: 1fr; }
            .quick-actions { grid-template-columns: 1fr; }
            .main-content { padding: 12px; }
            .welcome-banner { padding: 20px; }
            .welcome-banner h1 { font-size: 20px; }
            .welcome-banner p { font-size: 14px; }
            .chart-container { height: 220px; }
        }

        /* ========================================
           INBOX MOBILE RESPONSIVE
           ======================================== */
        .inbox-header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
        .inbox-filters { display: flex; flex-wrap: wrap; gap: 6px; }
        .inbox-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
        .inbox-bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

        @media (max-width: 1024px) {
            .email-panel { width: 100%; max-width: 100vw; right: -100%; }
            .email-panel.active { right: 0; }
        }
        @media (max-width: 768px) {
            /* Inbox header stacking */
            .card-header { flex-direction: column; align-items: flex-start !important; gap: 12px; }
            .card-header > div { width: 100%; }
            .inbox-filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
            .inbox-actions { width: 100%; justify-content: flex-start; }
            .inbox-filter-btn { flex-shrink: 0; padding: 6px 10px; font-size: 12px; }
            .inbox-bulk-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
            .inbox-bulk-bar .btn { flex-shrink: 0; }
            /* Hide preview and date columns */
            #inboxTableContainer th:nth-child(5), #inboxTableContainer td:nth-child(5),
            #inboxTableContainer th:nth-child(6), #inboxTableContainer td:nth-child(6) { display: none; }
            /* Email panel */
            .email-panel-header { padding: 16px; }
            .email-panel-body { padding: 16px; }
            .email-panel-actions { padding: 12px 16px; flex-wrap: wrap; }
            .email-panel-actions > div { width: 100%; }
            .email-panel-subject { font-size: 16px; }
            .email-panel-actions .btn { font-size: 12px; padding: 8px 12px; }
        }
        @media (max-width: 480px) {
            .inbox-filter-btn { padding: 5px 8px; font-size: 11px; }
            .inbox-actions .btn { font-size: 11px; padding: 6px 10px; }
            /* Hide checkbox and star columns */
            #inboxTableContainer th:nth-child(1), #inboxTableContainer td:nth-child(1),
            #inboxTableContainer th:nth-child(2), #inboxTableContainer td:nth-child(2) { display: none; }
            .email-panel-meta-row { font-size: 12px; }
            .email-panel-subject { font-size: 15px; }
            .email-panel-body-content { padding: 14px; font-size: 13px; }
            .email-panel-actions { gap: 6px; }
            .email-panel-actions .btn { padding: 6px 10px; font-size: 11px; }
            .label-dropdown { font-size: 12px; padding: 6px 8px; min-width: 90px; }
        }

        /* ========================================
           CRM KANBAN MOBILE RESPONSIVE
           ======================================== */
        #kanbanBoard {
            -webkit-overflow-scrolling: touch;
            scroll-snap-type: x mandatory;
            scroll-behavior: smooth;
        }
        .kanban-column {
            scroll-snap-align: center;
            touch-action: pan-y pinch-zoom;
        }
        .kanban-card {
            touch-action: none;
            user-select: none;
            -webkit-user-select: none;
        }
        .kanban-card.touch-dragging {
            opacity: 0.9;
            transform: scale(1.02) rotate(2deg);
            box-shadow: 0 15px 35px rgba(0,0,0,0.2);
            z-index: 1000;
            position: fixed;
            pointer-events: none;
        }
        .kanban-column.touch-drag-over {
            background: rgba(63, 63, 70, 0.1) !important;
            border-color: var(--primary) !important;
            transform: scale(1.01);
        }
        .kanban-scroll-indicator {
            display: none;
            text-align: center;
            padding: 8px 16px;
            color: var(--gray-500);
            font-size: 12px;
            gap: 8px;
            align-items: center;
            justify-content: center;
        }
        .kanban-scroll-indicator i { width: 16px; height: 16px; animation: swipeHint 1.5s ease-in-out infinite; }
        @keyframes swipeHint {
            0%, 100% { transform: translateX(0); }
            50% { transform: translateX(8px); }
        }
        .kanban-column-dots {
            display: none;
            justify-content: center;
            gap: 6px;
            padding: 12px 0 4px;
        }
        .kanban-column-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--gray-300);
            transition: all 0.3s ease;
        }
        .kanban-column-dot.active {
            background: var(--primary);
            transform: scale(1.3);
        }
        @media (max-width: 1024px) {
            #kanbanBoard { gap: 12px; }
            .kanban-column { min-width: 260px; width: 260px; }
        }
        @media (max-width: 768px) {
            .kanban-scroll-indicator { display: flex; }
            .kanban-column-dots { display: flex; }
            #kanbanBoard {
                gap: 12px;
                padding: 0 16px 16px;
                margin: 0 -16px;
                scroll-padding: 16px;
            }
            .kanban-column {
                min-width: calc(85vw - 32px);
                width: calc(85vw - 32px);
                max-width: 320px;
                flex-shrink: 0;
            }
            .kanban-column:first-child { margin-left: 0; }
            .kanban-column:last-child { margin-right: 16px; }
            .kanban-cards { min-height: 150px; }
            .pipeline-filters { flex-wrap: wrap; }
            .pipeline-filters > * { flex: 1 1 auto; min-width: 120px; }
        }
        @media (max-width: 480px) {
            .kanban-column {
                min-width: calc(90vw - 24px);
                width: calc(90vw - 24px);
            }
            #kanbanBoard { padding: 0 12px 12px; margin: 0 -12px; }
            .kanban-column .stage-header { padding: 12px; }
            .kanban-column .stage-header h3 { font-size: 13px; }
            .kanban-cards { padding: 8px; gap: 8px; }
        }

        /* ========================================
           ONBOARDING TOUR
           ======================================== */
        .tour-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9998; backdrop-filter: blur(2px); }
        .tour-overlay.active { display: block; animation: fadeIn 0.3s ease; }

        /* ========================================
           SETUP WIZARD (Post-Onboarding)
           ======================================== */
        .setup-wizard-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.85);
            z-index: 10001;
            backdrop-filter: blur(8px);
            animation: fadeIn 0.4s ease;
        }
        .setup-wizard-overlay.active { display: flex; align-items: center; justify-content: center; }
        .setup-wizard {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            border-radius: 20px;
            width: 90%;
            max-width: 600px;
            max-height: 90vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: 0 25px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1);
            animation: wizardSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        @keyframes wizardSlideUp {
            from { opacity: 0; transform: translateY(40px) scale(0.95); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        .setup-wizard-header {
            padding: 30px 30px 20px;
            text-align: center;
            position: relative;
        }
        .setup-wizard-icon {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, #3f3f46, #52525b);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 20px;
            font-size: 36px;
            box-shadow: 0 10px 30px rgba(63,63,70,0.4);
        }
        .setup-wizard-title {
            font-size: 28px;
            font-weight: 700;
            color: #fff;
            margin: 0 0 8px;
        }
        .setup-wizard-subtitle {
            font-size: 15px;
            color: #888;
            margin: 0;
        }
        .setup-wizard-body {
            padding: 0 30px 30px;
            flex: 1;
            overflow-y: auto;
            min-height: 0;
        }
        .setup-wizard-step { display: none; animation: stepFadeIn 0.3s ease; }
        .setup-wizard-step.active { display: block; }
        @keyframes stepFadeIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
        .setup-summary-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
            margin-bottom: 20px;
        }
        .setup-summary-item {
            background: rgba(255,255,255,0.05);
            border-radius: 12px;
            padding: 14px;
            border: 1px solid rgba(255,255,255,0.08);
        }
        .setup-summary-label {
            font-size: 11px;
            color: #888;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 4px;
        }
        .setup-summary-value {
            font-size: 14px;
            color: #fff;
            font-weight: 500;
        }
        .setup-profiles-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin: 20px 0;
        }
        .setup-profile-item {
            background: rgba(255,255,255,0.05);
            border-radius: 12px;
            padding: 16px;
            border-left: 4px solid #3f3f46;
            transition: all 0.2s ease;
        }
        .setup-profile-item:nth-child(2) { border-left-color: #52525b; }
        .setup-profile-item:nth-child(3) { border-left-color: #ec4899; }
        .setup-profile-name {
            font-weight: 600;
            color: #fff;
            margin-bottom: 4px;
        }
        .setup-profile-desc {
            font-size: 13px;
            color: #888;
        }
        .setup-profile-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 10px;
        }
        .setup-profile-tag {
            background: rgba(63,63,70,0.2);
            color: #a5b4fc;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 11px;
        }
        .setup-tip-box {
            background: linear-gradient(135deg, rgba(63,63,70,0.15), rgba(139,92,246,0.15));
            border: 1px solid rgba(63,63,70,0.3);
            border-radius: 12px;
            padding: 16px;
            margin: 20px 0;
        }
        .setup-tip-title {
            font-weight: 600;
            color: #a5b4fc;
            margin-bottom: 6px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .setup-tip-text {
            font-size: 13px;
            color: #c4b5fd;
            line-height: 1.5;
        }
        .setup-actions {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            margin-top: 20px;
        }
        .setup-action-btn {
            background: rgba(255,255,255,0.05);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 12px;
            padding: 16px 12px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .setup-action-btn:hover {
            background: rgba(255,255,255,0.1);
            transform: translateY(-2px);
        }
        .setup-action-btn.primary {
            background: linear-gradient(135deg, #3f3f46, #52525b);
            border: none;
            grid-column: span 3;
        }
        .setup-action-btn.primary:hover {
            box-shadow: 0 8px 25px rgba(63,63,70,0.4);
        }
        .setup-action-icon { font-size: 24px; margin-bottom: 8px; }
        .setup-action-label { font-size: 13px; color: #fff; font-weight: 500; }
        .setup-wizard-footer {
            padding: 20px 30px;
            border-top: 1px solid rgba(255,255,255,0.08);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }
        .setup-step-dots {
            display: flex;
            gap: 8px;
        }
        .setup-step-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: rgba(255,255,255,0.2);
            transition: all 0.3s ease;
        }
        .setup-step-dot.active { background: #3f3f46; width: 24px; border-radius: 4px; }
        .setup-step-dot.completed { background: #22c55e; }
        .setup-nav-btn {
            padding: 10px 20px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
        }
        .setup-nav-btn.secondary { background: transparent; color: #888; }
        .setup-nav-btn.secondary:hover { color: #fff; }
        .setup-nav-btn.primary { background: var(--gray-900); color: #fff; }
        .setup-nav-btn.primary:hover { background: var(--gray-800); }
        .tour-highlight { position: relative; z-index: 9999 !important; box-shadow: 0 0 0 4px rgba(63, 63, 70, 0.5), 0 0 20px rgba(63, 63, 70, 0.3); border-radius: var(--radius-md); animation: tourPulse 2s ease-in-out infinite; }
        @keyframes tourPulse { 0%,100% { box-shadow: 0 0 0 4px rgba(63, 63, 70, 0.5), 0 0 20px rgba(63, 63, 70, 0.3); } 50% { box-shadow: 0 0 0 8px rgba(63, 63, 70, 0.3), 0 0 30px rgba(63, 63, 70, 0.2); } }
        .tour-tooltip { display: none; position: fixed; z-index: 10000; background: #fff; border-radius: 12px; padding: 20px; width: 300px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); animation: tourSlideIn 0.3s ease; }
        .tour-tooltip.active { display: block; }
        @keyframes tourSlideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        .tour-tooltip::before { content: ''; position: absolute; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); }
        .tour-tooltip.arrow-left::before { left: -7px; top: 24px; }
        .tour-step-indicator { display: flex; gap: 6px; margin-bottom: 12px; }
        .tour-step-dot { width: 8px; height: 8px; border-radius: 50%; background: #e5e7eb; transition: all 0.2s; }
        .tour-step-dot.active { background: var(--primary); width: 20px; border-radius: 4px; }
        .tour-step-dot.completed { background: var(--success); }
        .tour-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--gray-900); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
        .tour-icon i { color: #fff; width: 24px; height: 24px; }
        .tour-title { font-size: 18px; font-weight: 700; color: #1f2937; margin: 0 0 8px 0; }
        .tour-description { font-size: 14px; color: #6b7280; line-height: 1.5; margin: 0 0 16px 0; }
        .tour-actions { display: flex; gap: 10px; justify-content: flex-end; }
        .tour-btn { padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
        .tour-btn-skip { background: transparent; border: 1px solid #e5e7eb; color: #6b7280; }
        .tour-btn-skip:hover { background: #f3f4f6; }
        .tour-btn-next { background: var(--gray-900); border: none; color: #fff; }
        .tour-btn-next:hover { background: var(--gray-800); }
        .tour-welcome { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 10000; background: #fff; border-radius: 16px; padding: 32px; width: 400px; max-width: 90vw; text-align: center; box-shadow: 0 25px 50px rgba(0,0,0,0.25); }
        .tour-welcome-icon { width: 80px; height: 80px; margin: 0 auto 20px; border-radius: 20px; background: var(--gray-900); display: flex; align-items: center; justify-content: center; font-size: 40px; }
        .tour-welcome h2 { font-size: 24px; font-weight: 700; color: #1f2937; margin: 0 0 8px 0; }
        .tour-welcome p { font-size: 15px; color: #6b7280; margin: 0 0 24px 0; line-height: 1.5; }

        /* ========================================
           DECORATIVE ANIMATED BLOBS
           ======================================== */
        .blob {
            position: fixed;
            border-radius: 50%;
            filter: blur(80px);
            opacity: 0.5;
            z-index: -1;
            pointer-events: none;
        }

        .blob-1 {
            width: 600px;
            height: 600px;
            background: linear-gradient(135deg, rgba(63, 63, 70, 0.4), rgba(82, 82, 91, 0.3));
            top: -200px;
            right: -100px;
            animation: float1 20s ease-in-out infinite;
        }

        .blob-2 {
            width: 500px;
            height: 500px;
            background: linear-gradient(135deg, rgba(82, 82, 91, 0.35), rgba(168, 85, 247, 0.25));
            bottom: -150px;
            left: -100px;
            animation: float2 25s ease-in-out infinite;
        }

        .blob-3 {
            width: 400px;
            height: 400px;
            background: linear-gradient(135deg, rgba(63, 63, 70, 0.3), rgba(59, 130, 246, 0.2));
            top: 40%;
            left: 50%;
            animation: float3 22s ease-in-out infinite;
        }

        @keyframes float1 {
            0%, 100% {
                transform: translate(0, 0) rotate(0deg);
            }
            25% {
                transform: translate(-30px, 40px) rotate(5deg);
            }
            50% {
                transform: translate(20px, -30px) rotate(-5deg);
            }
            75% {
                transform: translate(-20px, -20px) rotate(3deg);
            }
        }

        @keyframes float2 {
            0%, 100% {
                transform: translate(0, 0) rotate(0deg);
            }
            25% {
                transform: translate(40px, -30px) rotate(-5deg);
            }
            50% {
                transform: translate(-30px, 40px) rotate(5deg);
            }
            75% {
                transform: translate(25px, 25px) rotate(-3deg);
            }
        }

        @keyframes float3 {
            0%, 100% {
                transform: translate(-50%, -50%) rotate(0deg);
            }
            25% {
                transform: translate(calc(-50% + 50px), calc(-50% - 40px)) rotate(8deg);
            }
            50% {
                transform: translate(calc(-50% - 40px), calc(-50% + 30px)) rotate(-8deg);
            }
            75% {
                transform: translate(calc(-50% + 30px), calc(-50% + 50px)) rotate(4deg);
            }
        }

        /* Skeleton Loading Animation */
        .skeleton {
            background: linear-gradient(90deg, #2a2a3e 25%, #3a3a4e 50%, #2a2a3e 75%);
            background-size: 200% 100%;
            animation: skeletonShimmer 1.5s infinite;
            border-radius: 4px;
        }
        @keyframes skeletonShimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }
        .skeleton-row {
            animation: fadeIn 0.3s ease;
        }

        /* ============================================
           Automation Settings Wizard
           ============================================ */

        /* Step Indicators */
        .automation-step-indicator {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            flex: 1;
            opacity: 0.5;
            transition: all 0.3s ease;
        }
        .automation-step-indicator.active {
            opacity: 1;
        }
        .automation-step-indicator.completed {
            opacity: 1;
        }
        .automation-step-indicator .step-number {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--gray-200);
            color: var(--gray-600);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 14px;
            transition: all 0.3s ease;
        }
        .automation-step-indicator.active .step-number {
            background: var(--primary);
            color: white;
        }
        .automation-step-indicator.completed .step-number {
            background: #22c55e;
            color: white;
        }
        .automation-step-indicator .step-label {
            font-size: 12px;
            color: var(--gray-500);
            font-weight: 500;
        }
        .automation-step-indicator.active .step-label {
            color: var(--gray-800);
        }
        .automation-step-connector {
            flex: 0 0 40px;
            height: 2px;
            background: var(--gray-200);
            margin-top: 16px;
        }

        /* Day Checkbox Styles */
        .day-checkbox {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 14px;
            background: var(--gray-100);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.15s;
            font-size: 13px;
        }
        .day-checkbox:hover {
            border-color: var(--primary);
        }
        .day-checkbox:has(input:checked) {
            background: var(--primary-50);
            border-color: var(--primary);
            color: var(--primary);
        }
        .day-checkbox input {
            cursor: pointer;
        }

        /* Send Mode Option Styles */
        .send-mode-option {
            display: block;
            cursor: pointer;
        }
        .send-mode-option input {
            display: none;
        }
        .send-mode-content {
            display: flex;
            align-items: flex-start;
            gap: 16px;
            padding: 16px;
            background: var(--gray-50);
            border: 2px solid var(--border-light);
            border-radius: var(--radius-md);
            transition: all 0.15s;
        }
        .send-mode-option:hover .send-mode-content {
            border-color: var(--gray-300);
        }
        .send-mode-option input:checked + .send-mode-content {
            background: var(--primary-50);
            border-color: var(--primary);
        }
        .send-mode-icon {
            font-size: 28px;
            flex-shrink: 0;
        }
        .send-mode-title {
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 4px;
        }
        .send-mode-desc {
            font-size: 13px;
            color: var(--gray-500);
        }

        /* Automation Summary Styles */
        .automation-summary-item {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 16px;
            background: var(--gray-50);
            border-radius: var(--radius-md);
        }
        .automation-summary-icon {
            font-size: 24px;
            flex-shrink: 0;
        }
        .automation-summary-content {
            flex: 1;
            min-width: 0;
        }
        .automation-summary-label {
            font-size: 12px;
            color: var(--gray-500);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 2px;
        }
        .automation-summary-value {
            font-weight: 500;
            color: var(--gray-800);
        }

        /* Button Link Style */
        .btn-link {
            background: none;
            border: none;
            color: var(--gray-500);
            cursor: pointer;
            font-size: 13px;
            padding: 8px 16px;
            transition: color 0.15s;
        }
        .btn-link:hover {
            color: var(--gray-700);
            text-decoration: underline;
        }

        /* Account Menu Dropdown */
        .account-menu-item:hover {
            background: rgba(255, 255, 255, 0.08) !important;
        }

        /* Wizard Steps */
        .wizard-step {
            text-align: center;
            opacity: 0.5;
            transition: opacity 0.2s;
        }
        .wizard-step.active,
        .wizard-step.complete {
            opacity: 1;
        }
        .wizard-step .step-number {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: #333;
            color: #888;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 8px;
            font-weight: 600;
            font-size: 14px;
        }
        .wizard-step.active .step-number {
            background: #6366f1;
            color: white;
        }
        .wizard-step.complete .step-number {
            background: #10b981;
            color: white;
        }
        .wizard-step .step-label {
            font-size: 13px;
            color: #888;
        }
        .wizard-step.active .step-label {
            color: #fff;
        }

        /* Ad Card Styles */
        .ad-card {
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            border-radius: 12px;
            padding: 24px;
            margin-bottom: 16px;
            transition: box-shadow 0.2s;
        }
        .ad-card:hover {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }
        .status-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
        }
        .status-badge.status-running {
            background: rgba(34, 197, 94, 0.15);
            color: #22c55e;
        }
        .status-badge.status-paused {
            background: rgba(245, 158, 11, 0.15);
            color: #f59e0b;
        }
        .status-badge.status-draft {
            background: rgba(107, 114, 128, 0.15);
            color: #6b7280;
        }
        .status-badge.status-completed {
            background: rgba(99, 102, 241, 0.15);
            color: #6366f1;
        }

        /* Audience/Creative Selection Cards */
        .selection-card {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px;
            background: #1e1e2e;
            border: 1px solid #333;
            border-radius: 8px;
            cursor: pointer;
            transition: border-color 0.2s, background 0.2s;
        }
        .selection-card:hover {
            border-color: #6366f1;
            background: #252538;
        }
        .selection-card.selected {
            border-color: #6366f1;
            background: #2a2a4a;
        }
        .selection-card .card-title {
            font-weight: 600;
            font-size: 15px;
            color: #ffffff !important;
        }
        .selection-card .card-subtitle {
            font-size: 13px;
            color: #a0a0a0;
            margin-top: 4px;
        }
        .selection-card input[type="radio"] {
            margin: 0;
        }
/* ========================================
   Interactive Automation Widget (Dashboard)
   ======================================== */
.automation-interactive-widget {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06) 0%, rgba(99, 102, 241, 0.06) 100%);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 20px;
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
}

.automation-interactive-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.4) 100%);
    backdrop-filter: blur(12px);
    z-index: 0;
}

/* Widget Header */
.widget-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.widget-header-icon {
    font-size: 24px;
}

.widget-header-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

/* Interactive Slider */
.interactive-slider-container {
    position: relative;
    z-index: 1;
    padding: 0 8px;
    margin-bottom: 24px;
}

.interactive-slider-track {
    position: relative;
    height: 8px;
    background: linear-gradient(90deg, #e5e7eb 0%, rgba(139, 92, 246, 0.2) 100%);
    border-radius: 4px;
    cursor: pointer;
}

.interactive-slider-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.interactive-slider-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: white;
    border: 3px solid #8b5cf6;
    border-radius: 50%;
    cursor: grab;
    transition: left 0.3s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
    z-index: 10;
}

.interactive-slider-handle:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.interactive-slider-handle.dragging {
    cursor: grabbing;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    transition: none;
}

.interactive-slider-handle.autopilot-glow {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2), 0 4px 15px rgba(139, 92, 246, 0.4);
    animation: handleGlow 2s ease-in-out infinite;
}

@keyframes handleGlow {
    0%, 100% { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2), 0 4px 15px rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.3), 0 4px 20px rgba(139, 92, 246, 0.6); }
}

/* Slider Stops */
.interactive-slider-stops {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.slider-stop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
}

.slider-stop:hover {
    background: rgba(139, 92, 246, 0.08);
}

.slider-stop.active {
    background: rgba(139, 92, 246, 0.12);
}

.slider-stop-dot {
    width: 12px;
    height: 12px;
    background: #e5e7eb;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin-top: -24px;
}

.slider-stop-dot.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

.slider-stop-emoji {
    font-size: 28px;
}

.slider-stop-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    transition: color 0.2s ease;
}

.slider-stop.active .slider-stop-label {
    color: #8b5cf6;
}

/* Autopilot sparkle effect */
.autopilot-stop .autopilot-sparkle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #fbbf24;
    border-radius: 50%;
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.slider-hint {
    text-align: center;
    font-size: 11px;
    color: var(--gray-400);
    margin: 12px 0 0;
}

/* Mode Detail Card */
.mode-detail-card {
    position: relative;
    z-index: 1;
    background: white;
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.mode-detail-card.mode-pilot {
    border-color: #9ca3af;
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.05) 0%, rgba(156, 163, 175, 0.02) 100%);
}

.mode-detail-card.mode-copilot {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(99, 102, 241, 0.02) 100%);
}

.mode-detail-card.mode-autopilot {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(139, 92, 246, 0.03) 100%);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.mode-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mode-detail-emoji {
    font-size: 32px;
}

.mode-detail-info {
    flex: 1;
}

.mode-detail-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.mode-detail-price {
    font-size: 13px;
    color: #8b5cf6;
    font-weight: 500;
}

.mode-detail-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.mode-detail-features li {
    font-size: 13px;
    color: var(--gray-600);
}

/* Dashboard Calendar Prompt */
.dashboard-calendar-prompt {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.calendar-prompt-emoji {
    font-size: 24px;
}

.calendar-prompt-info {
    flex: 1;
}

.calendar-prompt-info strong {
    display: block;
    font-size: 13px;
    color: var(--gray-900);
}

.calendar-prompt-info p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--gray-600);
}

/* Widget Stats Row */
.widget-stats-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    font-size: 13px;
    color: var(--gray-600);
}

.widget-stats-label {
    color: var(--gray-500);
}

.widget-stat strong {
    color: #8b5cf6;
    font-weight: 700;
}

.widget-stat-divider {
    color: var(--gray-300);
}

/* Responsive */
@media (max-width: 600px) {
    .interactive-slider-stops {
        gap: 8px;
    }

    .slider-stop {
        padding: 6px 8px;
    }

    .slider-stop-emoji {
        font-size: 24px;
    }

    .slider-stop-label {
        font-size: 11px;
    }

    .mode-detail-features {
        flex-direction: column;
        gap: 4px;
    }

    .widget-stats-row {
        flex-wrap: wrap;
        gap: 4px 12px;
    }
}

/* ========================================
   Automation Mode Settings Section (Clean Cards)
   ======================================== */

/* Mode Cards Container */
.automation-mode-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* Individual Mode Card */
.automation-mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    border: 2px solid var(--border-light);
    border-radius: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.automation-mode-card:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.02);
}

.automation-mode-card.active {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1), 0 4px 20px rgba(139, 92, 246, 0.15);
}

.mode-card-recommended {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
    white-space: nowrap;
}

.mode-card-emoji {
    font-size: 40px;
    margin-bottom: 12px;
}

.mode-card-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.automation-mode-card.active .mode-card-title {
    color: #8b5cf6;
}

.mode-card-description {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.4;
}

.mode-card-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    padding: 6px 14px;
    background: var(--gray-50);
    border-radius: 100px;
}

.automation-mode-card.active .mode-card-price {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

/* Current Mode Summary */
.current-mode-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.mode-summary-icon {
    font-size: 32px;
}

.mode-summary-text strong {
    display: block;
    color: #8b5cf6;
    font-size: 15px;
    margin-bottom: 4px;
}

.mode-summary-text p {
    margin: 0;
    font-size: 13px;
    color: var(--gray-600);
}

/* Responsive */
@media (max-width: 768px) {
    .automation-mode-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .automation-mode-card {
        flex-direction: row;
        text-align: left;
        padding: 16px;
        gap: 16px;
    }

    .mode-card-emoji {
        font-size: 32px;
        margin-bottom: 0;
    }

    .mode-card-recommended {
        top: auto;
        bottom: -8px;
        right: 12px;
        left: auto;
        transform: none;
    }

    .automation-mode-card .mode-card-content {
        flex: 1;
    }
}

/* ========================================
   Cruise Control Widget (Dashboard)
   ======================================== */

.cruise-control-widget {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-light);
}

.cruise-control-header {
    margin-bottom: 20px;
}

.cruise-control-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.cruise-control-icon {
    font-size: 24px;
}

.cruise-control-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.cruise-control-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--gray-500);
}

/* Cruise Control Cards */
.cruise-control-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.cruise-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 12px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cruise-card:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.02);
}

.cruise-card.active {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.cruise-card-emoji {
    font-size: 28px;
    margin-bottom: 8px;
}

.cruise-card-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}

.cruise-card.active .cruise-card-title {
    color: #8b5cf6;
}

.cruise-card-description {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.3;
}

.cruise-card-price {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    padding: 4px 10px;
    background: var(--gray-50);
    border-radius: 100px;
}

.cruise-card.active .cruise-card-price {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

/* Cruise Status Bar */
.cruise-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(139, 92, 246, 0.06);
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.12);
}

.cruise-status-icon {
    font-size: 24px;
}

.cruise-status-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cruise-status-text strong {
    font-size: 14px;
    font-weight: 600;
    color: #8b5cf6;
}

.cruise-status-text span {
    font-size: 13px;
    color: var(--gray-600);
}

/* Cruise Control Responsive */
@media (max-width: 768px) {
    .cruise-control-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .cruise-card {
        flex-direction: row;
        text-align: left;
        padding: 14px 16px;
        gap: 14px;
    }

    .cruise-card-emoji {
        font-size: 24px;
        margin-bottom: 0;
    }

    .cruise-card .cruise-card-content {
        flex: 1;
    }

    .cruise-card-title {
        font-size: 14px;
    }

    .cruise-card-description {
        margin-bottom: 6px;
    }
}

/* ========================================
   Launch Autopilot Modal
   ======================================== */

.launch-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.launch-modal-overlay.active {
    display: flex;
}

.launch-modal {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    position: relative;
}

.launch-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 18px;
    transition: all 0.2s ease;
    z-index: 10;
}

.launch-modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.launch-modal-header {
    padding: 32px 32px 24px;
    text-align: center;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
}

.launch-modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.launch-modal-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
}

.launch-modal-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

.launch-modal-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
}

.launch-section {
    margin-bottom: 24px;
}

.launch-section:last-child {
    margin-bottom: 0;
}

.launch-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.launch-section-title span {
    font-size: 20px;
}

/* Mailbox List */
.launch-mailboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.launch-mailbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.launch-mailbox-status {
    font-size: 20px;
}

.launch-mailbox-info {
    flex: 1;
    min-width: 0;
}

.launch-mailbox-email {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.launch-mailbox-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.launch-mailbox-badge {
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
}

.launch-mailbox-badge.warmed {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.launch-mailbox-badge.warming {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.launch-mailbox-badge.new {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.launch-mailbox-limit {
    text-align: right;
}

.launch-mailbox-limit-number {
    font-size: 18px;
    font-weight: 700;
    color: #8b5cf6;
}

.launch-mailbox-limit-label {
    font-size: 11px;
    color: var(--gray-500);
}

.launch-capacity-total {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.launch-capacity-number {
    font-size: 36px;
    font-weight: 800;
    color: #8b5cf6;
    line-height: 1;
}

.launch-capacity-label {
    font-size: 14px;
    color: var(--gray-600);
    margin-top: 4px;
}

/* Campaign Summary */
.launch-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.launch-summary-item {
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
    text-align: center;
}

.launch-summary-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.launch-summary-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.launch-summary-item.highlight {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.launch-summary-item.highlight .launch-summary-number {
    color: #22c55e;
}

/* Auto-Find Leads Section */
.launch-autofind-section {
    padding: 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
}

.launch-autofind-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.launch-autofind-icon {
    font-size: 28px;
}

.launch-autofind-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.launch-autofind-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

.launch-profiles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.launch-profile-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 8px;
}

.launch-profile-icon {
    font-size: 16px;
}

.launch-profile-info {
    flex: 1;
    min-width: 0;
}

.launch-profile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.launch-profile-meta {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.launch-autofind-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 8px;
    font-size: 13px;
    color: #7c3aed;
    font-weight: 500;
}

/* Business Context Display */
.launch-business-context {
    padding: 12px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 8px;
    margin-bottom: 16px;
}

.launch-context-item {
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 6px;
    line-height: 1.4;
}

.launch-context-item:last-child {
    margin-bottom: 8px;
}

.launch-context-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 6px;
    margin-top: 4px;
}

/* Warnings and Blockers */
.launch-warnings {
    margin-top: 16px;
    padding: 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
}

.launch-warning-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #b45309;
    margin-bottom: 8px;
}

.launch-warning-text {
    font-size: 14px;
    color: #92400e;
    margin-bottom: 12px;
}

.launch-warning-actions {
    display: flex;
    gap: 8px;
}

.launch-blockers {
    margin-top: 16px;
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
}

.launch-blocker-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #b91c1c;
    margin-bottom: 8px;
}

.launch-blocker-text {
    font-size: 14px;
    color: #991b1b;
}

.launch-blocker-link {
    color: #dc2626;
    text-decoration: underline;
    cursor: pointer;
}

/* Launch Footer */
.launch-modal-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--gray-50);
}

.btn-launch {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-launch:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.btn-launch:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-launch.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Launch Success Modal */
.launch-success-modal {
    max-width: 500px;
    text-align: center;
}

.launch-success-content {
    padding: 48px 32px;
}

.launch-success-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.launch-success-title {
    margin: 0 0 8px;
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
}

.launch-success-subtitle {
    margin: 0 0 24px;
    font-size: 16px;
    color: var(--gray-500);
}

.launch-success-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.launch-success-stat {
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
}

.launch-success-stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #8b5cf6;
}

.launch-success-stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.launch-success-progress {
    margin-bottom: 24px;
}

.launch-progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 8px;
}

.launch-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #22c55e);
    border-radius: 100px;
    width: 0%;
    transition: width 0.5s ease;
}

.launch-progress-text {
    margin: 0;
    font-size: 14px;
    color: var(--gray-500);
}

/* Autopilot Status Card (Dashboard) */
.autopilot-status-card {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border-radius: 16px;
    padding: 24px;
    color: white;
    margin-bottom: 24px;
}

.autopilot-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.autopilot-status-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
}

.autopilot-status-title span {
    font-size: 24px;
}

.autopilot-status-badge {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

.autopilot-capacity {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.autopilot-progress-container {
    margin-bottom: 16px;
}

.autopilot-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
}

.autopilot-progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    overflow: hidden;
}

.autopilot-progress-fill {
    height: 100%;
    background: white;
    border-radius: 100px;
    transition: width 0.3s ease;
}

.autopilot-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.autopilot-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.autopilot-stat-number {
    font-weight: 700;
}

.autopilot-actions {
    display: flex;
    gap: 12px;
}

.autopilot-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.autopilot-btn.primary {
    background: white;
    color: #8b5cf6;
}

.autopilot-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.autopilot-btn:hover {
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 640px) {
    .launch-modal {
        max-height: 100vh;
        border-radius: 0;
    }

    .launch-modal-header {
        padding: 24px 20px 20px;
    }

    .launch-modal-body {
        padding: 20px;
    }

    .launch-summary-grid {
        grid-template-columns: 1fr;
    }

    .launch-success-stats {
        grid-template-columns: 1fr;
    }
}

/* Day Checkbox Styles */
.day-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.day-checkbox:hover {
    border-color: var(--primary);
}

.day-checkbox input[type="checkbox"] {
    display: none;
}

.day-checkbox input[type="checkbox"]:checked + span {
    color: white;
}

.day-checkbox:has(input:checked) {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.day-checkbox span {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
}
