/* ════════════════════════════════════════════════════════════════════════ 
           DESIGN SYSTEM — HERESY COMMAND HUB V18.1 "AMETHYST"
           ════════════════════════════════════════════════════════════════════════  */
        :root {
            /* ── Core Backgrounds ── */
            --bg: #05060a;
            --sidebar-bg: rgba(7, 8, 14, 0.98);
            --middle-bg: rgba(8, 10, 18, 0.95);
            --right-bg: rgba(7, 9, 16, 0.96);
            --card: rgba(14, 18, 32, 0.55);
            --surface: rgba(10, 13, 24, 0.97);

            /* —— Primary Accent (Purple/Violet) —— */
            --accent: #a855f7;
            --accent-glow: rgba(168, 85, 247, 0.3);
            --accent-dim: rgba(168, 85, 247, 0.08);
            --accent-solid: #7c3aed;
            --accent-bright: #c084fc;

            /* —— Secondary Accent (Fuchsia) —— */
            --accent2: #d946ef;
            --accent2-glow: rgba(217, 70, 239, 0.25);
            --accent2-dim: rgba(217, 70, 239, 0.07);

            /* ── Tertiary Accent (Amber/Gold) ── */
            --accent3: #f59e0b;
            --accent3-glow: rgba(245, 158, 11, 0.25);
            --accent3-dim: rgba(245, 158, 11, 0.07);

            /* ── Semantic Colors ── */
            --success: #c084fc;
            --hot: #fb7185;
            --warm: #fbbf24;
            --cold: #38bdf8;
            --danger: #f43f5e;

            /* ── Text Hierarchy ── */
            --text: #e8ecf4;
            --text-dim: #94a3b8;
            --text-muted: #4b5570;

            /* ── Glass & Borders ── */
            --glass-border: rgba(255, 255, 255, 0.06);
            --glass-border-light: rgba(255, 255, 255, 0.10);
            --glass-border-accent: rgba(168, 85, 247, 0.12);

            /* ── Geometry ── */
            --radius-sm: 8px;
            --radius-md: 12px;
            --radius-lg: 16px;
            --radius-xl: 20px;

            /* ── Shadows ── */
            --shadow-glow: 0 0 30px rgba(168, 85, 247, 0.06);
            --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25);
            --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.4);


            /* ── Fonts ── */
            --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: var(--font-ui);
            background: var(--bg);
            color: var(--text);
            height: 100vh;
            display: flex;
            overflow: hidden;
            position: relative;
        }

        body::before {
            content: '';
            position: fixed;
            inset: 0;
            background:
                radial-gradient(ellipse at 8% 92%, rgba(168, 85, 247, 0.08) 0%, transparent 42%),
                radial-gradient(ellipse at 88% 8%, rgba(217, 70, 239, 0.06) 0%, transparent 42%),
                radial-gradient(ellipse at 50% 50%, rgba(245, 158, 11, 0.025) 0%, transparent 50%),
                radial-gradient(ellipse at 75% 85%, rgba(251, 113, 133, 0.03) 0%, transparent 35%);
            z-index: 0;
            pointer-events: none;
        }

        /* ═══════ GLASSMORPHISM UTILITY ═══════ */
        .glass {
            background: var(--card);
            backdrop-filter: blur(20px) saturate(1.2);
            -webkit-backdrop-filter: blur(20px) saturate(1.2);
            border: 1px solid var(--glass-border);
        }

        /* ═══════ SIDEBAR (NUCLEOS) — 72px ═══════ */
        #sidebar {
            width: 72px;
            min-width: 72px;
            background: linear-gradient(180deg, rgba(7, 8, 14, 0.99) 0%, rgba(10, 12, 22, 0.99) 100%);
            backdrop-filter: blur(24px);
            border-right: 1px solid var(--glass-border-light);
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 14px 0;
            gap: 3px;
            overflow-y: auto;
            overflow-x: hidden;
            z-index: 10;
            position: relative;
        }

        .sidebar-divider {
            width: 32px;
            height: 1px;
            background: linear-gradient(90deg, transparent, var(--glass-border-light), transparent);
            margin: 8px 0;
        }

        .core-btn {
            width: 42px;
            height: 42px;
            border-radius: 10px;
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.05);
            color: var(--text-muted);
            font-weight: 700;
            font-size: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
            position: relative;
            flex-shrink: 0;
        }
        .core-btn:hover {
            background: rgba(168, 85, 247, 0.08);
            color: var(--text);
            border-color: rgba(168, 85, 247, 0.2);
            transform: scale(1.05);
        }
        .core-btn.active {
            background: linear-gradient(135deg, var(--accent-solid), #6d28d9);
            color: #fff;
            border-color: transparent;
            box-shadow: 0 0 20px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
        }
        .core-btn .status-dot {
            position: absolute;
            top: -2px;
            right: -2px;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--text-muted);
            border: 2px solid rgba(8,10,20,0.97);
            transition: background 0.3s;
        }
        .core-btn.online .status-dot { background: var(--success); box-shadow: 0 0 6px rgba(192, 132, 252,0.5); }
        .core-btn.error .status-dot { background: var(--warm); box-shadow: 0 0 6px rgba(251,191,36,0.4); }
        .core-btn.offline .status-dot { background: #374151; box-shadow: none; }
        .core-btn.connecting .status-dot { background: var(--accent2); box-shadow: 0 0 6px rgba(232, 121, 249,0.4); animation: pulse-dot 1.2s ease-in-out infinite; }
        .core-btn.quota_exceeded .status-dot { background: #c084fc; box-shadow: 0 0 6px rgba(192,132,252,0.5); }
        @keyframes pulse-dot {
            0%, 100% { opacity: 0.4; transform: scale(0.9); }
            50% { opacity: 1; transform: scale(1.1); }
        }

        /* Control buttons container under core button */
        #cores-container > div > div {
            display: flex;
            gap: 4px;
            align-items: center;
            background: rgba(255, 255, 255, 0.02);
            padding: 3px 4px;
            border-radius: 6px;
            border: 1px solid rgba(255, 255, 255, 0.04);
            margin-top: 1px;
        }

        /* Power Button Stylings */
        .core-power-btn {
            font-size: 0 !important;
            width: 16px;
            height: 16px;
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            border: none;
            cursor: pointer;
            background: rgba(255, 255, 255, 0.02);
            position: relative;
            transition: all 0.2s;
            opacity: 0.55;
            padding: 0;
            line-height: 1;
        }
        .core-power-btn:hover {
            opacity: 1;
            background: rgba(255, 255, 255, 0.08);
        }
        .core-power-btn::after {
            content: '';
            width: 10px;
            height: 10px;
            background-color: var(--text-muted);
            -webkit-mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPSdibGFjaycgc3Ryb2tlLXdpZHRoPScyLjgnIHN0cm9rZS1saW5lY2FwPSdyb3VuZCcgc3Ryb2tlLWxpbmVqb2luPSdyb3VuZCc+PHBhdGggZD0nTTE4LjM2IDYuNjRhOSA5IDAgMSAxLTEyLjczIDAnLz48bGluZSB4MT0nMTInIHkxPScyJyB4Mj0nMTInIHkyPScxMicvPjwvc3ZnPg==") no-repeat center / contain;
            mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPSdibGFjaycgc3Ryb2tlLXdpZHRoPScyLjgnIHN0cm9rZS1saW5lY2FwPSdyb3VuZCcgc3Ryb2tlLWxpbmVqb2luPSdyb3VuZCc+PHBhdGggZD0nTTE4LjM2IDYuNjRhOSA5IDAgMSAxLTEyLjczIDAnLz48bGluZSB4MT0nMTInIHkxPScyJyB4Mj0nMTInIHkyPScxMicvPjwvc3ZnPg==") no-repeat center / contain;
            transition: all 0.2s;
        }
        /* When Account is ON */
        .core-power-btn.is-on::after {
            background-color: var(--success);
            filter: drop-shadow(0 0 4px var(--success));
        }
        /* When Account is OFF */
        .core-power-btn.is-off::after {
            background-color: var(--text-muted);
            opacity: 0.45;
        }
        /* When Connecting */
        .core-power-btn.is-connecting::after {
            background-color: var(--accent2);
            -webkit-mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPSdibGFjaycgc3Ryb2tlLXdpZHRoPSczJyBzdHJva2UtbGluZWNhcD0ncm91bmQnIHN0cm9rZS1saW5lam9pbj0ncm91bmQnPjxwYXRoIGQ9J00yMS41IDJ2NmgtNk0yMS4zNCAxNS41N2ExMCAxMCAwIDEgMS0uNTctOC4zOGw1LjY3LTUuNjcnLz48L3N2Zz4=") no-repeat center / contain;
            mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPSdibGFjaycgc3Ryb2tlLXdpZHRoPSczJyBzdHJva2UtbGluZWNhcD0ncm91bmQnIHN0cm9rZS1saW5lam9pbj0ncm91bmQnPjxwYXRoIGQ9J00yMS41IDJ2NmgtNk0yMS4zNCAxNS41N2ExMCAxMCAwIDEgMS0uNTctOC4zOGw1LjY3LTUuNjcnLz48L3N2Zz4=") no-repeat center / contain;
            animation: spin 1s linear infinite;
        }

        /* Outreach Button Stylings */
        .core-outreach-btn {
            font-size: 0 !important;
            width: 16px;
            height: 16px;
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            border: none;
            cursor: pointer;
            background: rgba(255, 255, 255, 0.02);
            position: relative;
            transition: all 0.2s;
            opacity: 0.55;
            padding: 0;
            line-height: 1;
        }
        .core-outreach-btn:hover {
            opacity: 1;
            background: rgba(255, 255, 255, 0.08);
        }
        .core-outreach-btn::after {
            content: '';
            width: 10px;
            height: 10px;
            background-color: var(--text-muted);
            -webkit-mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPSdibGFjaycgc3Ryb2tlLXdpZHRoPScyLjInIHN0cm9rZS1saW5lY2FwPSdyb3VuZCcgc3Ryb2tlLWxpbmVqb2luPSdyb3VuZCc+PGxpbmUgeDE9JzIyJyB5MT0nMicgeDI9JzExJyB5Mj0nMTMnLz48cG9seWdvbiBwb2ludHM9JzIyIDIgMTUgMjIgMTEgMTMgMiA5IDIyIDInLz48L3N2Zz4=") no-repeat center / contain;
            mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPSdibGFjaycgc3Ryb2tlLXdpZHRoPScyLjInIHN0cm9rZS1saW5lY2FwPSdyb3VuZCcgc3Ryb2tlLWxpbmVqb2luPSdyb3VuZCc+PGxpbmUgeDE9JzIyJyB5MT0nMicgeDI9JzExJyB5Mj0nMTMnLz48cG9seWdvbiBwb2ludHM9JzIyIDIgMTUgMjIgMTEgMTMgMiA5IDIyIDInLz48L3N2Zz4=") no-repeat center / contain;
            transition: all 0.2s;
        }
        /* Outreach Active (Rocket) */
        .core-outreach-btn.is-active::after {
            background-color: var(--accent2);
            filter: drop-shadow(0 0 4px var(--accent2));
        }
        /* Outreach Paused (Sleep) */
        .core-outreach-btn.is-paused::after {
            background-color: var(--text-muted);
            opacity: 0.45;
        }

        /* Screenshot Button Stylings */
        #cores-container button[onclick^="openScreenshot"] {
            font-size: 0 !important;
            width: 16px;
            height: 16px;
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            border: none;
            cursor: pointer;
            background: rgba(255, 255, 255, 0.02);
            position: relative;
            transition: all 0.2s;
            opacity: 0.55;
            padding: 0;
            line-height: 1;
        }
        #cores-container button[onclick^="openScreenshot"]:hover {
            opacity: 1;
            background: rgba(255, 255, 255, 0.08);
        }
        #cores-container button[onclick^="openScreenshot"]::after {
            content: '';
            width: 10px;
            height: 10px;
            background-color: var(--text-dim);
            -webkit-mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPSdibGFjaycgc3Ryb2tlLXdpZHRoPSIyLjUiIHN0cm9rZS1saW5lY2FwPSdyb3VuZCcgc3Ryb2tlLWxpbmVqb2luPSdyb3VuZCc+PHBhdGggZD0nTTIzIDE5YTIgMiAwIDAgMS0yIDJIM2EyIDIgMCAwIDEtMi0yVjhhMiAyIDAgMCAxIDItMmg0bDItM2g2bDIgM2g0YTIgMiAwIDAgMSAyIDJ6Jy8+PGNpcmNsZSBjeD0nMTInIGN5PScxMycgcj0nNCcvPjwvc3ZnPg==") no-repeat center / contain;
            mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAyNCAyNCcgZmlsbD0nbm9uZScgc3Ryb2tlPSdibGFjaycgc3Ryb2tlLXdpZHRoPSIyLjUiIHN0cm9rZS1saW5lY2FwPSdyb3VuZCcgc3Ryb2tlLWxpbmVqb2luPSdyb3VuZCc+PHBhdGggZD0nTTIzIDE5YTIgMiAwIDAgMS0yIDJIM2EyIDIgMCAwIDEtMi0yVjhhMiAyIDAgMCAxIDItMmg0bDItM2g2bDIgM2g0YTIgMiAwIDAgMSAyIDJ6Jy8+PGNpcmNsZSBjeD0nMTInIGN5PScxMycgcj0nNCcvPjwvc3ZnPg==") no-repeat center / contain;
            transition: all 0.2s;
        }
        #cores-container button[onclick^="openScreenshot"]:hover::after {
            background-color: var(--text);
        }

        .core-btn-icon {
            width: 20px;
            height: 20px;
        }

        .core-btn-globe {
            width: 18px;
            height: 18px;
            stroke-width: 1.8;
            color: currentColor;
            transition: transform 0.3s ease;
        }
        .core-btn:hover .core-btn-globe {
            transform: scale(1.1);
        }
        .core-btn.active .core-btn-globe {
            filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.5));
        }

        /* â•â•â•â•â•â•â• MIDDLE PANEL (INBOX + ANALYTICS) â€” 340px â•â•â•â•â•â•â• */
        #middle-panel {
            width: 340px;
            min-width: 340px;
            display: flex;
            flex-direction: column;
            background: var(--middle-bg);
            backdrop-filter: blur(16px);
            border-right: 1px solid var(--glass-border);
            z-index: 5;
            position: relative;
        }

        /* Analytics header */
        .analytics-header {
            padding: 16px 16px 12px;
            border-bottom: 1px solid var(--glass-border);
            background: linear-gradient(180deg, rgba(15,18,32,0.4) 0%, transparent 100%);
        }
        .analytics-title-row {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 8px;
            margin-bottom: 10px;
            width: 100%;
            white-space: nowrap;
        }
        .analytics-title-row h2 {
            font-size: 13px;
            font-weight: 700;
            letter-spacing: 0.8px;
            margin: 0;
            white-space: nowrap;
            text-transform: uppercase;
            background: linear-gradient(135deg, var(--text), var(--accent-bright));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .live-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--success);
            animation: pulse-dot 2s ease-in-out infinite;
            transition: background 0.3s;
        }
        .live-dot.disconnected {
            background: var(--danger);
            animation: pulse-dot-err 1.5s ease-in-out infinite;
        }
        .live-dot.reconnecting {
            background: var(--warm);
            animation: pulse-dot-warn 1s ease-in-out infinite;
        }
        @keyframes pulse-dot {
            0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(168, 85, 247,0.5); }
            50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(168, 85, 247,0); }
        }
        .live-status {
            font-size: 8px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--success);
            background: rgba(192, 132, 252, 0.1);
            border: 1px solid rgba(192, 132, 252, 0.2);
            padding: 2px 6px;
            border-radius: 6px;
            white-space: nowrap;
            display: inline-block;
            line-height: 1;
            transition: color 0.3s, background 0.3s, border-color 0.3s;
        }
        .live-status.disconnected {
            color: var(--danger);
            background: rgba(244, 63, 94, 0.1);
            border-color: rgba(244, 63, 94, 0.2);
        }
        .live-status.reconnecting {
            color: var(--warm);
            background: rgba(251, 191, 36, 0.1);
            border-color: rgba(251, 191, 36, 0.2);
        }

        #total-leads-count {
            white-space: nowrap !important;
            font-size: 10px !important;
        }

        @keyframes pulse-dot-err {
            0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(244,63,94,0.5); }
            50% { opacity: 0.4; box-shadow: 0 0 0 6px rgba(244,63,94,0); }
        }
        @keyframes pulse-dot-warn {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.3; }
        }

        .temp-bar-container {
            display: flex;
            height: 5px;
            border-radius: 3px;
            overflow: hidden;
            background: rgba(255,255,255,0.05);
        }
        .temp-bar { transition: width 0.5s ease; min-width: 2px; }
        .temp-bar.hot { background: linear-gradient(90deg, var(--hot), #f43f5e); }
        .temp-bar.warm { background: linear-gradient(90deg, var(--warm), #f59e0b); }
        .temp-bar.cold { background: linear-gradient(90deg, var(--cold), #3b82f6); }

        .stat-counters {
            display: flex;
            justify-content: space-between;
            margin-top: 8px;
            font-size: 11px;
            font-weight: 600;
        }
        .stat-counters .c-hot { color: var(--hot); }
        .stat-counters .c-warm { color: var(--warm); }
        .stat-counters .c-cold { color: var(--cold); }

        /* KPI row — 3 visible cards */
        .kpi-row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
            margin-top: 10px;
        }
        .kpi-card {
            text-align: center;
            padding: 10px 4px 8px;
            background: rgba(255,255,255,0.02);
            border-radius: var(--radius-sm);
            border: 1px solid var(--glass-border);
            transition: border-color 0.3s, transform 0.2s;
        }
        .kpi-card:hover {
            border-color: rgba(168, 85, 247, 0.25);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }
        .kpi-card .kpi-val {
            font-size: 22px;
            font-weight: 800;
            font-family: var(--font-mono);
            color: var(--accent);
            line-height: 1;
        }
        .kpi-card:nth-child(1) .kpi-val { color: var(--accent2); }
        .kpi-card:nth-child(2) .kpi-val { color: var(--accent); }
        .kpi-card:nth-child(4) .kpi-val { color: var(--cold); }
        .kpi-card .kpi-label {
            font-size: 9px;
            text-transform: uppercase;
            letter-spacing: 0.6px;
            color: var(--text-muted);
            margin-top: 5px;
            font-weight: 500;
        }

        /* Action bar (CSV, Notifications) */
        .action-bar {
            display: flex;
            gap: 4px;
            padding: 8px 16px;
            border-bottom: 1px solid var(--glass-border);
        }
        .action-btn {
            flex: 1;
            padding: 6px 4px;
            font-size: 10px;
            font-weight: 600;
            text-align: center;
            background: rgba(255,255,255,0.03);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-sm);
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
        }
        .action-btn:hover {
            background: var(--accent-dim);
            color: var(--accent-bright);
            border-color: rgba(168, 85, 247, 0.3);
        }

        /* Filter bar â€” REDESIGNED to prevent truncation */
        .filter-bar {
            display: flex;
            flex-direction: column;
            gap: 5px;
            padding: 8px 12px;
            border-bottom: 1px solid var(--glass-border);
        }
        .filter-bar-row {
            display: grid;
            gap: 4px;
            width: 100%;
        }
        .filter-bar-row.row-type {
            grid-template-columns: repeat(3, 1fr);
        }
        .filter-bar-row.row-period {
            grid-template-columns: repeat(5, 1fr);
        }
        .filter-bar-row.row-actions-primary {
            grid-template-columns: 1fr 1fr 1.2fr;
        }
        .filter-bar-row.row-actions-tools {
            grid-template-columns: repeat(3, 1fr);
            gap: 4px;
            animation: slideDown 0.2s ease-out;
        }
        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-6px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .tools-toggle {
            background: rgba(168, 85, 247, 0.06) !important;
            border-color: rgba(168, 85, 247, 0.18) !important;
            color: var(--accent-bright) !important;
        }
        .tools-toggle:hover {
            background: rgba(168, 85, 247, 0.12) !important;
            border-color: rgba(168, 85, 247, 0.3) !important;
        }
        .tools-chevron {
            font-size: 9px;
            margin-left: 2px;
            display: inline-block;
            transition: transform 0.2s;
        }
        .filter-btn {
            min-width: 0;
            padding: 5px 4px;
            font-size: 10px;
            font-weight: 600;
            background: rgba(255,255,255,0.025);
            border: 1px solid rgba(255,255,255,0.07);
            border-radius: 6px;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.3;
        }
        .filter-btn:hover {
            color: var(--text-dim);
            border-color: rgba(168, 85, 247, 0.2);
            background: rgba(168, 85, 247, 0.05);
        }
        .filter-btn.active {
            background: rgba(168, 85, 247, 0.10);
            color: var(--accent-bright);
            border-color: rgba(168, 85, 247, 0.35);
            box-shadow: 0 0 8px rgba(168, 85, 247, 0.08);
        }
        /* Period filter pills */
        .period-btn {
            min-width: 0;
            padding: 4px 4px;
            font-size: 9px;
            font-weight: 600;
            background: rgba(245, 158, 11, 0.03);
            border: 1px solid rgba(245, 158, 11, 0.1);
            border-radius: 5px;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.3;
        }
        .period-btn:hover {
            color: var(--accent3);
            border-color: rgba(245, 158, 11, 0.25);
            background: rgba(245, 158, 11, 0.07);
        }
        .period-btn.active {
            background: rgba(245, 158, 11, 0.10);
            color: var(--accent3);
            border-color: rgba(245, 158, 11, 0.35);
            box-shadow: 0 0 6px rgba(245, 158, 11, 0.1);
        }
        .filter-count {
            font-size: 8px;
            opacity: 0.7;
            margin-left: 2px;
        }

        /* Search bar */
        .search-bar {
            padding: 8px 16px;
            border-bottom: 1px solid var(--glass-border);
        }
        .search-bar input {
            width: 100%;
            background: rgba(0,0,0,0.2);
            border: 1px solid rgba(255,255,255,0.07);
            padding: 8px 12px 8px 32px;
            border-radius: var(--radius-sm);
            color: #fff;
            font-family: var(--font-ui);
            font-size: 12px;
            outline: none;
            transition: border-color 0.3s, box-shadow 0.3s;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6384' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: 10px center;
        }
        .search-bar input:focus {
            border-color: var(--accent);
            box-shadow: 0 0 12px rgba(168, 85, 247, 0.12);
        }
        .search-bar input::placeholder { color: var(--text-muted); }

        /* Date separator in chat */
        .msg-date-separator {
            text-align: center;
            padding: 8px 0;
            font-size: 10px;
            font-weight: 600;
            color: var(--text-muted);
            letter-spacing: 0.5px;
            position: relative;
        }
        .msg-date-separator span {
            background: var(--bg);
            padding: 0 12px;
            position: relative;
            z-index: 1;
        }
        .msg-date-separator::before {
            content: '';
            position: absolute;
            left: 10%;
            right: 10%;
            top: 50%;
            height: 1px;
            background: var(--glass-border-light);
        }

        /* Mark as read button */
        .chat-header-btn.mark-read {
            font-size: 12px;
            padding: 0 10px;
            width: auto;
            gap: 4px;
        }
        .chat-header-btn.mark-read.is-read {
            background: rgba(192, 132, 252,0.15);
            color: var(--success);
            border-color: rgba(192, 132, 252,0.3);
        }

        /* Inbox list */
        #inbox-list {
            flex: 1;
            overflow-y: auto;
        }

        .chat-item {
            padding: 12px 16px;
            border-bottom: 1px solid var(--glass-border);
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }
        .chat-item:hover { background: rgba(129,140,248,0.04); }
        .chat-item.active {
            background: rgba(168, 85, 247, 0.06);
            border-left: 3px solid var(--accent);
            box-shadow: inset 4px 0 12px rgba(168, 85, 247, 0.04);
        }
        .chat-item-name {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 2px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .chat-item-phone {
            font-size: 10px;
            color: var(--text-muted);
            margin-bottom: 3px;
        }
        .chat-item-preview {
            font-size: 11px;
            color: var(--text-dim);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            opacity: 0.6;
        }
        .chat-item-time {
            position: absolute;
            top: 14px;
            right: 20px;
            font-size: 10px;
            color: var(--text-muted);
        }
        .badge {
            display: inline-block;
            font-size: 9px;
            padding: 2px 6px;
            border-radius: 4px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }
        .badge.hot { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
        .badge.warm { background: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.25); }
        .badge.cold { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.25); }
        .badge.waiting { background: rgba(168, 85, 247,0.12); color: #a7f3d0; border: 1px solid rgba(168, 85, 247,0.2); }

        /* V13.1: Hot Lead Visual System */
        .chat-item.is-interested {
            border-left: 3px solid #ef4444;
            background: rgba(239,68,68,0.05);
        }
        .chat-item.is-interested:not(.active):not(.read) {
            animation: hot-pulse 3s ease-in-out infinite;
        }
        @keyframes hot-pulse {
            0%, 100% { background: rgba(239,68,68,0.05); }
            50% { background: rgba(239,68,68,0.10); }
        }
        .chat-item.is-interested .chat-item-name {
            color: #fca5a5;
        }
        .chat-item.is-interested .chat-item-preview {
            opacity: 0.9;
            color: #d4d4d8;
        }

        /* Hot Leads Banner */
        #hot-leads-banner {
            display: none;
            padding: 10px 16px;
            background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(245,158,11,0.08));
            border-bottom: 1px solid rgba(239,68,68,0.2);
            cursor: pointer;
            transition: all 0.3s;
            animation: banner-glow 2s ease-in-out infinite;
        }
        #hot-leads-banner:hover {
            background: linear-gradient(135deg, rgba(239,68,68,0.20), rgba(245,158,11,0.14));
        }
        @keyframes banner-glow {
            0%, 100% { box-shadow: 0 2px 8px rgba(239,68,68,0); }
            50% { box-shadow: 0 2px 12px rgba(239,68,68,0.15); }
        }
        /* ═══════ V12.10: SENT HISTORY DRAWER ═══════ */
        #sent-history-fab {
            display: inline-block;
        }
        #sent-history-fab::after {
            content: " Historial";
        }
        #sent-history-fab.open::after {
            content: " Cerrar";
        }
        #hot-leads-banner .banner-count {
            font-size: 16px;
            font-weight: 800;
            color: #fca5a5;
        }
        #hot-leads-banner .banner-text {
            font-size: 10px;
            color: rgba(252,165,165,0.7);
            margin-top: 1px;
        }

        .tag {
            display: inline-block;
            font-size: 9px;
            padding: 1px 5px;
            border-radius: 3px;
            background: rgba(255,255,255,0.06);
            color: var(--text-dim);
            margin-right: 3px;
        }

        /* ═══════ V12.10: SENT HISTORY DRAWER ═══════ */
        /* FAB is now hidden — trigger lives in the action-bar */
        /* Removed display none to allow action-bar styling */

        /* ═══════ STICKER RENDERING ═══════ */
        .msg-sticker {
            max-width: 140px;
            max-height: 140px;
            margin-top: 4px;
            filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
        }
        .msg.sticker-msg {
            background: transparent !important;
            box-shadow: none !important;
            padding: 6px 8px;
        }
        #sent-history-drawer {
            position: fixed;
            bottom: 78px;
            left: 24px;
            width: 380px;
            max-height: 55vh;
            background: rgba(10,12,20,0.97);
            backdrop-filter: blur(24px);
            border: 1px solid rgba(168, 85, 247,0.2);
            border-radius: 14px;
            z-index: 199;
            box-shadow: 0 12px 48px rgba(0,0,0,0.6);
            display: none;
            flex-direction: column;
            overflow: hidden;
            animation: drawerSlideUp 0.25s ease-out;
        }
        @keyframes drawerSlideUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        #sent-history-drawer.active { display: flex; }
        .sent-drawer-header {
            padding: 14px 16px 10px;
            border-bottom: 1px solid var(--glass-border);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .sent-drawer-header h3 {
            font-size: 13px;
            font-weight: 700;
            color: var(--text);
            margin: 0;
            flex: 1;
        }
        .sent-drawer-header span {
            font-size: 10px;
            color: var(--text-muted);
        }
        .sent-drawer-body {
            flex: 1;
            overflow-y: auto;
            padding: 8px 0;
        }
        .sent-item {
            padding: 10px 16px;
            border-bottom: 1px solid rgba(255,255,255,0.03);
            cursor: pointer;
            transition: background 0.15s;
        }
        .sent-item:hover { background: rgba(168, 85, 247,0.06); }
        .sent-item-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 4px;
        }
        .sent-item-name {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-dim);
        }
        .sent-item-time {
            font-size: 9px;
            color: var(--text-muted);
        }
        .sent-item-body {
            font-size: 11px;
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .sent-item-account {
            font-size: 9px;
            color: rgba(129,140,248,0.6);
            margin-top: 2px;
        }

        /* â•â•â•â•â•â•â• V12.10: MESSAGE CONTEXT MENU â•â•â•â•â•â•â• */
        .msg {
            position: relative;
        }
        .msg-actions {
            position: absolute;
            top: 4px;
            right: 6px;
            display: none;
            gap: 2px;
        }
        .msg:hover .msg-actions { display: flex; }
        .msg-action-btn {
            width: 22px;
            height: 22px;
            border: none;
            border-radius: 4px;
            background: rgba(0,0,0,0.4);
            color: var(--text-muted);
            font-size: 11px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
        }
        .msg-action-btn:hover {
            background: rgba(168, 85, 247,0.3);
            color: #fff;
        }
        .msg-action-btn.delete:hover {
            background: rgba(239,68,68,0.4);
            color: #fca5a5;
        }

        /* â•â•â•â•â•â•â• V12.10: SPELL CHECKER â•â•â•â•â•â•â• */
        #spell-suggestions {
            display: none;
            position: absolute;
            bottom: 100%;
            left: 12px;
            right: 60px;
            background: rgba(10,12,20,0.96);
            backdrop-filter: blur(16px);
            border: 1px solid rgba(251,191,36,0.25);
            border-radius: 8px;
            padding: 6px 10px;
            z-index: 50;
            box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
            margin-bottom: 4px;
        }
        #spell-suggestions.active { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
        .spell-label {
            font-size: 9px;
            color: var(--text-muted);
            margin-right: 4px;
            white-space: nowrap;
        }
        .spell-chip {
            font-size: 10px;
            padding: 2px 8px;
            border-radius: 4px;
            background: rgba(251,191,36,0.12);
            border: 1px solid rgba(251,191,36,0.25);
            color: #fbbf24;
            cursor: pointer;
            transition: all 0.15s;
            white-space: nowrap;
        }
        .spell-chip:hover {
            background: rgba(251,191,36,0.25);
            color: #fde68a;
        }

        /* â•â•â•â•â•â•â• TAG MANAGER (Chat Header) â•â•â•â•â•â•â• */
        .tag-manager-btn {
            width: 34px; height: 34px;
            border-radius: var(--radius-sm);
            background: rgba(251,191,36,0.1);
            border: 1px solid rgba(251,191,36,0.25);
            color: #fbbf24;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer; font-size: 14px;
            transition: all 0.2s;
        }
        .tag-manager-btn:hover { background: rgba(251,191,36,0.2); }
        #tag-manager-dropdown {
            display: none;
            position: absolute;
            top: 64px; right: 24px;
            width: 320px;
            background: rgba(10,12,20,0.97);
            backdrop-filter: blur(24px);
            border: 1px solid rgba(168, 85, 247,0.15);
            border-radius: var(--radius-md);
            padding: 16px;
            z-index: 100;
            box-shadow: 0 12px 40px rgba(0,0,0,0.6);
        }
        #tag-manager-dropdown.active { display: block; }
        .tag-mgr-title {
            font-size: 11px; font-weight: 700; text-transform: uppercase;
            letter-spacing: 1px; color: var(--accent); margin-bottom: 12px;
        }
        .tag-mgr-section {
            margin-bottom: 14px;
        }
        .tag-mgr-section-label {
            font-size: 10px; font-weight: 600; color: var(--text-muted);
            margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
        }
        .tag-mgr-temps {
            display: flex; gap: 6px;
        }
        .tag-mgr-temp-btn {
            flex: 1; padding: 8px 4px; text-align: center;
            border-radius: 8px; border: 1px solid var(--glass-border);
            background: rgba(255,255,255,0.03); cursor: pointer;
            font-size: 12px; font-weight: 700;
            transition: all 0.2s;
        }
        .tag-mgr-temp-btn:hover { background: rgba(255,255,255,0.08); }
        .tag-mgr-temp-btn.active-hot { background: rgba(251,113,133,0.15); border-color: rgba(251,113,133,0.4); color: #fda4af; }
        .tag-mgr-temp-btn.active-warm { background: rgba(251,191,36,0.15); border-color: rgba(251,191,36,0.4); color: #fcd34d; }
        .tag-mgr-temp-btn.active-cold { background: rgba(56,189,248,0.15); border-color: rgba(56,189,248,0.4); color: #7dd3fc; }
        .tag-mgr-tags {
            display: flex; flex-wrap: wrap; gap: 6px;
        }
        .tag-mgr-chip {
            padding: 5px 10px; border-radius: 6px;
            font-size: 11px; font-weight: 600;
            border: 1px solid var(--glass-border);
            background: rgba(255,255,255,0.04);
            color: var(--text-dim); cursor: pointer;
            transition: all 0.2s;
        }
        .tag-mgr-chip:hover { background: rgba(255,255,255,0.08); color: var(--text); }
        .tag-mgr-chip.active {
            background: rgba(168, 85, 247,0.15); border-color: rgba(168, 85, 247,0.35);
            color: var(--accent);
        }
        .tag-mgr-chip .tag-x {
            margin-left: 4px; font-size: 10px; opacity: 0.6;
        }
        .tag-mgr-custom {
            display: flex; gap: 6px; margin-top: 8px;
        }
        .tag-mgr-custom input {
            flex: 1; background: rgba(0,0,0,0.3);
            border: 1px solid var(--glass-border); padding: 6px 10px;
            border-radius: 6px; color: #fff; font-size: 11px;
            font-family: var(--font-ui); outline: none;
        }
        .tag-mgr-custom input:focus { border-color: var(--accent); }
        .tag-mgr-custom button {
            padding: 6px 12px; border-radius: 6px;
            background: var(--accent); border: none;
            color: #fff; font-size: 11px; font-weight: 600;
            cursor: pointer; transition: all 0.2s;
        }
        .tag-mgr-custom button:hover { background: #6d28d9; }

        /* â•â•â•â•â•â•â• LEAD CRM PANEL â•â•â•â•â•â•â• */
        #leads-crm-panel {
            display: none;
            flex-direction: column;
            height: 100%;
            overflow: hidden;
            background: rgba(6, 8, 14, 0.7);
            width: 100%;
            min-width: 0;
        }
        #crm-leads-list {
            flex: 1;
            overflow-y: auto;
            min-height: 0;
        }
        #leads-crm-panel.active { display: flex; }
        .crm-filters {
            display: flex; gap: 5px; flex-wrap: wrap;
            padding: 10px 20px;
            border-bottom: 1px solid var(--glass-border);
            background: rgba(12,14,26,0.4);
        }
        .crm-filter-chip {
            padding: 5px 12px; border-radius: 20px;
            font-size: 10px; font-weight: 600;
            border: 1px solid var(--glass-border);
            background: rgba(255,255,255,0.025);
            color: var(--text-muted); cursor: pointer;
            transition: all 0.2s;
        }
        .crm-filter-chip:hover { background: rgba(168, 85, 247,0.06); color: var(--text-dim); border-color: rgba(168, 85, 247,0.15); }
        .crm-filter-chip.active {
            background: rgba(168, 85, 247,0.1); border-color: rgba(168, 85, 247,0.3);
            color: var(--accent);
        }
        .crm-filter-chip.hot.active { background: rgba(251,113,133,0.1); border-color: rgba(251,113,133,0.3); color: #fda4af; }
        .crm-filter-chip.warm.active { background: rgba(251,191,36,0.1); border-color: rgba(251,191,36,0.3); color: #fcd34d; }
        .crm-filter-chip.cold.active { background: rgba(56,189,248,0.1); border-color: rgba(56,189,248,0.3); color: #7dd3fc; }
        .crm-lead-card {
            padding: 12px 20px;
            border-bottom: 1px solid var(--glass-border);
            cursor: pointer;
            transition: all 0.2s;
            display: flex; align-items: center; gap: 10px;
        }
        .crm-lead-card:hover { background: rgba(168, 85, 247,0.04); }
        .crm-lead-avatar {
            width: 36px; height: 36px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 13px; font-weight: 700; flex-shrink: 0;
        }
        .crm-lead-avatar.hot { background: rgba(251,113,133,0.12); color: #fda4af; border: 1px solid rgba(251,113,133,0.25); }
        .crm-lead-avatar.warm { background: rgba(251,191,36,0.12); color: #fcd34d; border: 1px solid rgba(251,191,36,0.25); }
        .crm-lead-avatar.cold { background: rgba(56,189,248,0.12); color: #7dd3fc; border: 1px solid rgba(56,189,248,0.25); }
        .crm-lead-info { flex: 1; min-width: 0; }
        .crm-lead-name { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
        .crm-lead-phone { font-size: 10px; color: var(--text-muted); }
        .crm-lead-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
        .crm-stats-row {
            display: grid; grid-template-columns: repeat(4, 1fr);
            gap: 8px; padding: 14px 20px;
            border-bottom: 1px solid var(--glass-border);
        }
        .crm-stat {
            text-align: center; padding: 10px 4px;
            background: rgba(255,255,255,0.02);
            border-radius: var(--radius-sm);
            border: 1px solid var(--glass-border);
            transition: border-color 0.3s, transform 0.2s;
        }
        .crm-stat:hover { border-color: rgba(168, 85, 247,0.2); transform: translateY(-1px); }
        .crm-stat-val { font-size: 18px; font-weight: 700; line-height: 1; }
        .crm-stat-label { font-size: 8px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); margin-top: 4px; }

        /* â•â•â•â•â•â•â• MAIN PANEL (CHAT) â€” flex â•â•â•â•â•â•â• */
        #main-panel {
            flex: 1;
            display: flex;
            flex-direction: column;
            position: relative;
            z-index: 1;
            min-width: 0;
        }

        #chat-header {
            height: 60px;
            padding: 0 20px;
            display: flex;
            align-items: center;
            gap: 10px;
            border-bottom: 1px solid var(--glass-border);
            background: linear-gradient(90deg, rgba(8, 10, 18, 0.6), rgba(10, 13, 24, 0.5));
            backdrop-filter: blur(12px);
        }
        #chat-header-name {
            font-size: 15px;
            font-weight: 600;
        }
        #chat-header-phone {
            font-size: 11px;
            color: var(--text-dim);
        }
        #chat-header-core {
            margin-left: auto;
            padding: 4px 12px;
            background: rgba(168, 85, 247, 0.08);
            border: 1px solid rgba(168, 85, 247, 0.2);
            border-radius: 20px;
            font-size: 10px;
            font-weight: 700;
            color: var(--accent);
            letter-spacing: 0.5px;
            font-family: var(--font-mono);
        }
        .chat-header-btn {
            width: 32px;
            height: 32px;
            border-radius: var(--radius-sm);
            background: rgba(255,255,255,0.04);
            border: 1px solid var(--glass-border);
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 15px;
        }
        .chat-header-btn:hover {
            background: rgba(168, 85, 247, 0.1);
            color: var(--accent);
            border-color: rgba(168, 85, 247, 0.25);
        }

        /* Chat history */
        #chat-history {
            flex: 1;
            padding: 24px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .msg {
            max-width: 62%;
            padding: 10px 16px;
            border-radius: 14px;
            font-size: 13px;
            line-height: 1.55;
            position: relative;
            word-wrap: break-word;
        }
        .msg .msg-time {
            font-size: 10px;
            color: rgba(255,255,255,0.35);
            margin-top: 4px;
            text-align: right;
        }
        .msg.in {
            align-self: flex-start;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.04);
            border-bottom-left-radius: 4px;
        }
        .msg.out {
            align-self: flex-end;
            background: linear-gradient(135deg, #7c3aed, #a855f7);
            border-bottom-right-radius: 4px;
            box-shadow: 0 4px 20px rgba(168, 85, 247, 0.18);
        }
        .msg.out .msg-time { color: rgba(255,255,255,0.55); }
        
        .msg-ack-status {
            font-size: 11px;
            margin-left: 5px;
            font-weight: 700;
            display: inline-block;
            vertical-align: middle;
            line-height: 1;
        }
        .msg-ack-status.ack-pending {
            color: rgba(255,255,255,0.35);
        }
        .msg-ack-status.ack-sent {
            color: rgba(255,255,255,0.45);
        }
        .msg-ack-status.ack-delivered {
            color: rgba(255,255,255,0.65);
        }
        .msg-ack-status.ack-read {
            color: #38bdf8;
            text-shadow: 0 0 4px rgba(56,189,248,0.4);
        }

        .msg audio, .msg video { max-width: 100%; margin-top: 6px; border-radius: 8px; }
        .msg img.media-img { max-width: 100%; border-radius: 8px; margin-top: 6px; cursor: pointer; }

        /* Welcome screen */
        .welcome-screen {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 16px;
            color: var(--text-muted);
        }
        .welcome-icon-box {
            width: 80px;
            height: 80px;
            border-radius: var(--radius-lg);
            background: rgba(168, 85, 247,0.06);
            border: 1px solid rgba(168, 85, 247,0.15);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 36px;
            box-shadow: 0 0 40px rgba(168, 85, 247,0.08);
        }
        .welcome-screen p { font-size: 13px; }

        /* Chat input */
        #chat-input-area {
            padding: 16px 24px;
            background: rgba(12,12,20,0.7);
            border-top: 1px solid var(--glass-border);
            display: flex;
            gap: 8px;
            align-items: flex-end;
        }
        #chat-input {
            flex: 1;
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.1);
            padding: 12px 16px;
            border-radius: var(--radius-md);
            color: #fff;
            font-family: var(--font-ui);
            font-size: 14px;
            outline: none;
            transition: border-color 0.3s;
            resize: none;
            min-height: 42px;
            max-height: 300px;
            overflow-y: auto;
            line-height: 1.4;
        }
        #chat-input:focus { border-color: var(--accent); }
        #chat-input:disabled { opacity: 0.4; }

        .input-btn {
            width: 42px;
            height: 42px;
            border-radius: var(--radius-md);
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.25s;
            font-size: 18px;
            flex-shrink: 0;
            align-self: flex-end;
        }
        .input-btn.send {
            background: linear-gradient(135deg, var(--accent-solid), #a855f7);
            color: #fff;
        }
        .input-btn.send:hover { background: linear-gradient(135deg, #6d28d9, #6d28d9); transform: scale(1.04); }
        .input-btn.attach {
            background: rgba(255,255,255,0.06);
            color: var(--text-dim);
            border: 1px solid var(--glass-border);
        }
        .input-btn.attach:hover { background: rgba(255,255,255,0.12); color: var(--text); }
        .input-btn.send:disabled { opacity: 0.3; cursor: not-allowed; }
        .input-btn.copilot {
            background: rgba(168, 85, 247,0.15);
            color: var(--success);
            border: 1px solid rgba(168, 85, 247,0.3);
        }
        .input-btn.copilot:hover { background: rgba(168, 85, 247,0.25); }

        /* V12.4: Drag & Drop overlay */
        .drop-overlay {
            display: none;
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(168, 85, 247,0.1);
            border: 2px dashed var(--accent);
            border-radius: var(--radius-md);
            z-index: 50;
            align-items: center;
            justify-content: center;
            pointer-events: none;
        }
        .drop-overlay.active { display: flex; }
        .drop-overlay-text {
            font-size: 15px;
            font-weight: 700;
            color: var(--accent);
            background: rgba(10,12,20,0.85);
            padding: 12px 24px;
            border-radius: 10px;
        }
        /* V12.4: File preview bar */
        #media-preview {
            display: none;
            padding: 8px 24px;
            background: rgba(12,12,20,0.8);
            border-top: 1px solid var(--glass-border);
            align-items: center;
            gap: 10px;
            font-size: 12px;
        }
        #media-preview.active { display: flex; }
        .media-preview-thumb {
            width: 48px;
            height: 48px;
            border-radius: 8px;
            object-fit: cover;
            border: 1px solid var(--glass-border);
            background: rgba(0,0,0,0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .media-preview-thumb img {
            width: 100%;
            height: 100%;
            border-radius: 8px;
            object-fit: cover;
        }
        .media-preview-info {
            flex: 1;
            min-width: 0;
        }
        .media-preview-name {
            font-weight: 600;
            color: var(--text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .media-preview-size {
            color: var(--text-muted);
            font-size: 10px;
        }
        .media-preview-remove {
            background: rgba(244,63,94,0.12);
            border: 1px solid rgba(244,63,94,0.25);
            color: #fb7185;
            border-radius: 6px;
            padding: 4px 10px;
            cursor: pointer;
            font-size: 11px;
            font-weight: 600;
            transition: all 0.2s;
        }
        .media-preview-remove:hover { background: rgba(244,63,94,0.25); }
        .media-upload-progress {
            height: 3px;
            background: rgba(168, 85, 247,0.15);
            border-radius: 3px;
            overflow: hidden;
            margin-top: 4px;
        }
        .media-upload-progress .bar {
            height: 100%;
            background: var(--accent);
            border-radius: 3px;
            transition: width 0.3s;
            width: 0%;
        }

        /* Copilot suggestion bubble */
        #copilot-bubble {
            display: none;
            padding: 10px 16px;
            margin: 0 24px 8px;
            background: rgba(168, 85, 247,0.1);
            border: 1px solid rgba(168, 85, 247,0.25);
            border-radius: var(--radius-md);
            font-size: 13px;
            color: var(--success);
            cursor: pointer;
            transition: background 0.2s;
        }
        #copilot-bubble:hover { background: rgba(168, 85, 247,0.18); }
        #copilot-bubble .copilot-label {
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 4px;
            opacity: 0.7;
        }

        /* â•â•â•â•â•â•â• RIGHT PANEL (LOG + STATS) â€” 260px â•â•â•â•â•â•â• */
        #right-panel {
            width: 260px;
            min-width: 260px;
            background: linear-gradient(180deg, rgba(9,11,22,0.97) 0%, rgba(7,9,18,0.97) 100%);
            backdrop-filter: blur(16px);
            border-left: 1px solid var(--glass-border-light);
            display: flex;
            flex-direction: column;
            z-index: 5;
            position: relative;
        }

        /* â•â•â•â•â•â•â• AUTO-PILOT LOG (inside right panel) â•â•â•â•â•â•â• */
        #autopilot-log {
            flex: 1;
            overflow-y: auto;
            padding: 14px 12px;
            font-size: 11px;
            font-family: var(--font-ui);
            color: var(--text-dim);
        }
        #autopilot-log .log-title {
            color: var(--text);
            font-weight: 700;
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 1.2px;
            border-bottom: 1px solid var(--glass-border-light);
            padding-bottom: 10px;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 6px;
            background: linear-gradient(135deg, var(--text), var(--accent));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .log-entry {
            padding: 7px 10px;
            margin-bottom: 4px;
            border-radius: 6px;
            background: rgba(255,255,255,0.015);
            border: 1px solid transparent;
            cursor: pointer;
            transition: all 0.2s;
            line-height: 1.4;
            word-wrap: break-word;
            font-size: 10px;
        }
        .log-entry:hover {
            background: rgba(255,255,255,0.04);
            border-color: var(--glass-border);
            color: var(--text);
        }
        .log-entry .log-time {
            font-size: 9px;
            color: var(--text-muted);
            margin-right: 4px;
            opacity: 0.7;
        }
        .log-entry.log-auto-reply { border-left: 2px solid var(--accent); background: rgba(168, 85, 247,0.03); }
        .log-entry.log-media { border-left: 2px solid var(--success); background: rgba(192, 132, 252,0.03); }
        .log-entry.log-interest { border-left: 2px solid var(--warm); background: rgba(251,191,36,0.03); }
        .log-entry.log-status { border-left: 2px solid var(--text-muted); }

        /* â•â•â•â•â•â•â• SETTINGS PANEL â•â•â•â•â•â•â• */
        #settings-panel {
            position: fixed;
            top: 0; right: -400px;
            width: 380px;
            height: 100vh;
            background: rgba(8,10,18,0.98);
            backdrop-filter: blur(24px);
            border-left: 1px solid rgba(168, 85, 247,0.15);
            z-index: 1000;
            transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
            display: flex;
            flex-direction: column;
            box-shadow: -8px 0 32px rgba(0,0,0,0.5);
        }
        #settings-panel.active { right: 0; }
        .settings-header {
            padding: 18px 22px;
            border-bottom: 1px solid var(--glass-border-light);
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: linear-gradient(90deg, rgba(12,14,26,0.5), transparent);
        }
        .settings-header h2 {
            font-size: 15px;
            font-weight: 700;
            color: var(--text);
            margin: 0;
        }
        .settings-close {
            background: none;
            border: none;
            font-size: 20px;
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 6px;
            transition: all 0.2s;
        }
        .settings-close:hover { color: var(--text); background: rgba(168, 85, 247,0.1); }
        .settings-body {
            flex: 1;
            overflow-y: auto;
            padding: 18px 22px;
        }
        .settings-section {
            margin-bottom: 22px;
        }
        .settings-section-title {
            font-size: 9px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            color: var(--accent2);
            margin-bottom: 12px;
        }
        .settings-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 14px;
            background: rgba(255,255,255,0.02);
            border: 1px solid var(--glass-border);
            border-radius: 10px;
            margin-bottom: 8px;
            transition: all 0.2s;
        }
        .settings-toggle:hover { background: rgba(168, 85, 247,0.04); border-color: rgba(168, 85, 247,0.15); }
        .settings-toggle-info h4 {
            font-size: 12px;
            font-weight: 600;
            color: var(--text);
            margin: 0 0 2px;
        }
        .settings-toggle-info p {
            font-size: 10px;
            color: var(--text-muted);
            margin: 0;
            line-height: 1.3;
        }
        .toggle-switch {
            position: relative;
            width: 44px;
            height: 24px;
            flex-shrink: 0;
            margin-left: 12px;
        }
        .toggle-switch input { opacity: 0; width: 0; height: 0; }
        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(255,255,255,0.08);
            border-radius: 24px;
            transition: all 0.3s;
        }
        .toggle-slider:before {
            content: '';
            position: absolute;
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background: white;
            border-radius: 50%;
            transition: all 0.3s;
        }
        .toggle-switch input:checked + .toggle-slider {
            background: linear-gradient(135deg, var(--accent-solid), #a855f7);
            box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
        }
        .toggle-switch input:checked + .toggle-slider:before {
            transform: translateX(20px);
        }
        .settings-mode-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 6px;
            font-size: 10px;
            font-weight: 700;
            margin-bottom: 14px;
            letter-spacing: 0.5px;
        }
        .settings-mode-badge.production {
            background: rgba(192, 132, 252,0.12);
            color: var(--success);
            border: 1px solid rgba(192, 132, 252,0.25);
        }
        .settings-mode-badge.test {
            background: rgba(251,191,36,0.12);
            color: var(--warm);
            border: 1px solid rgba(251,191,36,0.25);
        }

        /* â•â•â•â•â•â•â• FULLSCREEN STATS MODAL â•â•â•â•â•â•â• */
        #modal-stats .modal-box {
            width: 90vw;
            height: 90vh;
            max-width: 1200px;
            display: flex;
            flex-direction: column;
            background: rgba(8,10,18,0.97);
            backdrop-filter: blur(24px);
            border: 1px solid rgba(168, 85, 247,0.12);
            box-shadow: 0 20px 80px rgba(0,0,0,0.6), 0 0 60px rgba(168, 85, 247,0.06);
        }
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 16px;
            margin-top: 16px;
            overflow-y: auto;
            padding-right: 8px;
        }
        .stat-panel {
            background: linear-gradient(135deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
            border: 1px solid var(--glass-border-light);
            border-radius: var(--radius-md);
            padding: 20px;
            transition: border-color 0.3s;
        }
        .stat-panel:hover {
            border-color: rgba(168, 85, 247,0.2);
        }
        #stats-section {
            border-top: 1px solid var(--glass-border);
            padding: 14px;
            overflow-y: auto;
            max-height: 55%;
            background: rgba(0,0,0,0.1);
        }
        .stats-title {
            color: var(--text);
            font-weight: 700;
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 1.2px;
            border-bottom: 1px solid rgba(168, 85, 247,0.2);
            padding-bottom: 10px;
            margin-bottom: 14px;
        }
        .adv-stat-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            font-size: 11px;
        }
        .adv-stat-label {
            color: var(--text-dim);
        }
        .adv-stat-value {
            font-weight: 600;
            color: var(--text);
            background: rgba(255,255,255,0.04);
            padding: 3px 8px;
            border-radius: 5px;
            border: 1px solid var(--glass-border-light);
            font-size: 12px;
        }
        .adv-stat-value.good { color: var(--success); border-color: rgba(192, 132, 252,0.3); background: rgba(192, 132, 252,0.06); }
        .adv-stat-value.warn { color: var(--warm); border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.06); }
        .adv-stat-value.bad { color: var(--hot); border-color: rgba(251,113,133,0.3); background: rgba(251,113,133,0.06); }
        
        .stat-progress-bg {
            height: 4px;
            background: rgba(255,255,255,0.04);
            border-radius: 4px;
            margin-top: 4px;
            margin-bottom: 14px;
            overflow: hidden;
        }
        .stat-progress-bar {
            height: 100%;
            border-radius: 4px;
            transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
            box-shadow: 0 0 8px currentColor;
        }

        /* â•â•â•â•â•â•â• TOAST NOTIFICATIONS â•â•â•â•â•â•â• */
        #toast-container {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .toast {
            padding: 12px 20px;
            border-radius: var(--radius-md);
            font-size: 13px;
            font-weight: 600;
            animation: toast-in 0.35s cubic-bezier(0.4,0,0.2,1);
            box-shadow: 0 8px 32px rgba(0,0,0,0.5);
            backdrop-filter: blur(12px);
        }
        .toast.error {
            background: rgba(244,63,94,0.85);
            border: 1px solid rgba(244,63,94,0.5);
            color: #fff;
        }
        .toast.success {
            background: rgba(168, 85, 247,0.85);
            border: 1px solid rgba(192, 132, 252,0.4);
            color: #fff;
        }
        @keyframes toast-in {
            from { opacity: 0; transform: translateY(-12px) scale(0.95); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        /* â•â•â•â•â•â•â• MODALS â•â•â•â•â•â•â• */
        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.65);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(6px);
        }
        .modal-overlay.active { display: flex; }
        .modal-box {
            width: 500px;
            max-height: 80vh;
            background: rgba(10,12,22,0.97);
            border: 1px solid var(--glass-border-light);
            border-radius: var(--radius-lg);
            padding: 24px;
            overflow-y: auto;
            box-shadow: 0 16px 64px rgba(0,0,0,0.5);
        }
        .modal-box h3 {
            font-size: 17px;
            margin-bottom: 16px;
        }
        .modal-close {
            float: right;
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 20px;
            cursor: pointer;
            transition: color 0.2s;
        }
        .modal-close:hover { color: var(--text); }

        /* â•â•â•â•â•â•â• SCROLLBARS â•â•â•â•â•â•â• */
        * {
            scrollbar-width: thin;
            scrollbar-color: rgba(168, 85, 247, 0.25) transparent;
        }
        ::-webkit-scrollbar { width: 5px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb {
            background: rgba(168, 85, 247, 0.18);
            border-radius: 10px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: rgba(168, 85, 247, 0.3);
        }

        /* â•â•â•â•â•â•â• ANALYTICS PANEL (inside main-panel) â•â•â•â•â•â•â• */
        #analytics-panel {
            display: none;
            flex-direction: column;
            height: 100%;
            overflow-y: auto;
            background: rgba(6, 8, 14, 0.7);
        }
        #analytics-panel.active { display: flex; }
        .analytics-panel-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 16px 20px;
            border-bottom: 1px solid var(--glass-border-light);
            background: linear-gradient(90deg, rgba(12,14,26,0.6), rgba(15,18,32,0.5));
            backdrop-filter: blur(12px);
            flex-shrink: 0;
        }
        .analytics-panel-header h2 {
            font-size: 16px;
            font-weight: 700;
            letter-spacing: 1px;
            background: linear-gradient(135deg, var(--text), var(--accent2));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .analytics-back-btn {
            padding: 6px 14px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--glass-border-light);
            background: rgba(255,255,255,0.03);
            color: var(--text-dim);
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            margin-left: auto;
        }
        .analytics-back-btn:hover {
            background: rgba(168, 85, 247,0.1);
            color: var(--accent);
            border-color: rgba(168, 85, 247,0.3);
        }
        .analytics-body {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
        }
        /* KPI Top Row */
        .analytics-kpi-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
            gap: 8px;
            margin-bottom: 20px;
        }
        .analytics-kpi {
            text-align: center;
            padding: 14px 6px;
            background: rgba(255,255,255,0.02);
            border-radius: var(--radius-md);
            border: 1px solid var(--glass-border);
            transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
            position: relative;
            overflow: hidden;
        }
        .analytics-kpi::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: var(--radius-md);
            padding: 1px;
            background: linear-gradient(135deg, rgba(168, 85, 247,0), rgba(168, 85, 247,0));
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask-composite: exclude;
            transition: background 0.3s;
            pointer-events: none;
        }
        .analytics-kpi:hover {
            border-color: rgba(168, 85, 247,0.25);
            transform: translateY(-2px);
            box-shadow: 0 4px 16px rgba(168, 85, 247,0.08);
        }
        .analytics-kpi:hover::before {
            background: linear-gradient(135deg, rgba(168, 85, 247,0.3), rgba(232, 121, 249,0.15));
        }
        .analytics-kpi .kpi-big {
            font-size: 22px;
            font-weight: 700;
            line-height: 1;
            margin-bottom: 4px;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .analytics-kpi .kpi-sub {
            font-size: 9px;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            color: var(--text-muted);
        }
        /* Chart containers */
        .chart-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            margin-bottom: 12px;
            min-width: 0;
        }
        .chart-card {
            background: rgba(255,255,255,0.015);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-md);
            padding: 16px;
            overflow: hidden;
            min-width: 0;
            min-height: 0;
            transition: border-color 0.3s;
        }
        .chart-card:hover {
            border-color: rgba(168, 85, 247,0.15);
        }
        .chart-card-title {
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-dim);
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .chart-card canvas {
            display: block;
            width: 100% !important;
            height: 220px !important;
            max-width: 100%;
        }
        .chart-card-full { grid-column: 1 / -1; }
        .chart-card-full canvas { height: 200px !important; }
        /* Sector table */
        .sector-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 11px;
        }
        .sector-table th {
            text-align: left;
            padding: 8px 6px;
            font-size: 9px;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            color: var(--text-muted);
            border-bottom: 1px solid var(--glass-border-light);
        }
        .sector-table td {
            padding: 7px 6px;
            border-bottom: 1px solid rgba(255,255,255,0.03);
            color: var(--text-dim);
        }
        .sector-table tr:hover td { color: var(--text); background: rgba(168, 85, 247,0.04); }
        .sector-bar {
            height: 5px;
            background: rgba(255,255,255,0.05);
            border-radius: 4px;
            overflow: hidden;
            min-width: 60px;
        }
        .sector-bar-fill {
            height: 100%;
            border-radius: 4px;
            transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
        }
        /* Heatmap */
        .heatmap-grid {
            display: grid;
            grid-template-columns: repeat(24, 1fr);
            gap: 2px;
        }
        .heatmap-cell {
            aspect-ratio: 1;
            border-radius: 3px;
            position: relative;
            transition: transform 0.15s, box-shadow 0.15s;
        }
        .heatmap-cell:hover { transform: scale(1.4); z-index: 2; box-shadow: 0 0 8px currentColor; }
        .heatmap-labels {
            display: grid;
            grid-template-columns: repeat(24, 1fr);
            gap: 2px;
            margin-top: 4px;
        }
        .heatmap-labels span {
            text-align: center;
            font-size: 8px;
            color: var(--text-muted);
        }
        /* Top leads list */
        .top-lead-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 6px;
            border-bottom: 1px solid rgba(255,255,255,0.03);
            border-radius: 6px;
            transition: background 0.2s;
        }
        .top-lead-item:hover { background: rgba(168, 85, 247,0.04); }
        .top-lead-rank {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 700;
            flex-shrink: 0;
        }
        .top-lead-name { flex: 1; font-size: 12px; font-weight: 600; }
        .top-lead-score {
            font-size: 11px;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 4px;
        }
        /* â”€â”€ V12.11: BULK ACTIONS PANEL â”€â”€ */
        #bulk-backdrop {
            display: none;
            position: fixed; inset: 0;
            background: rgba(0,0,0,0.4);
            backdrop-filter: blur(2px);
            z-index: 600;
        }
        #bulk-backdrop.active { display: block; }
        #bulk-panel {
            position: fixed;
            top: 0; left: 0;
            width: 340px; height: 100vh;
            background: var(--surface);
            border-right: 1px solid var(--glass-border);
            z-index: 610;
            display: flex;
            flex-direction: column;
            transform: translateX(-100%);
            transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
            box-shadow: 4px 0 32px rgba(0,0,0,0.4);
        }
        #bulk-panel.active { transform: translateX(0); }
        .bulk-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 16px 14px;
            border-bottom: 1px solid var(--glass-border);
            flex-shrink: 0;
        }
        .bulk-header h3 {
            font-size: 15px; font-weight: 700;
            background: linear-gradient(135deg, #a855f7, #e879f9);
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .bulk-close {
            background: none; border: none;
            color: var(--text-muted); cursor: pointer;
            font-size: 16px; padding: 4px 8px; border-radius: 6px;
            transition: all 0.2s;
        }
        .bulk-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }
        .bulk-filters {
            display: flex; flex-wrap: wrap; gap: 5px;
            padding: 10px 12px;
            border-bottom: 1px solid var(--glass-border);
            flex-shrink: 0;
        }
        .bulk-filter-btn {
            background: rgba(255,255,255,0.05);
            border: 1px solid rgba(255,255,255,0.08);
            color: var(--text-muted);
            border-radius: 20px;
            padding: 3px 10px; font-size: 11px;
            cursor: pointer; transition: all 0.2s;
        }
        .bulk-filter-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }
        .bulk-filter-btn.active {
            background: rgba(168, 85, 247,0.15);
            border-color: rgba(168, 85, 247,0.4);
            color: #a855f7;
        }
        .bulk-select-all-row {
            display: flex; align-items: center; justify-content: space-between;
            padding: 8px 14px;
            background: rgba(255,255,255,0.02);
            border-bottom: 1px solid var(--glass-border);
            flex-shrink: 0;
        }
        .bulk-checkbox-label {
            display: flex; align-items: center; gap: 8px;
            font-size: 12px; color: var(--text-muted);
            cursor: pointer; user-select: none;
        }
        .bulk-checkbox-label input[type="checkbox"] {
            width: 15px; height: 15px; cursor: pointer;
            accent-color: #a855f7;
        }
        .bulk-list {
            flex: 1; overflow-y: auto;
            padding: 6px 0;
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
        }
        .bulk-list::-webkit-scrollbar { width: 4px; }
        .bulk-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
        .bulk-item {
            display: flex; align-items: center; gap: 10px;
            padding: 8px 14px;
            cursor: pointer;
            transition: background 0.15s;
            border-left: 3px solid transparent;
        }
        .bulk-item:hover { background: rgba(255,255,255,0.04); }
        .bulk-item.selected { background: rgba(168, 85, 247,0.08); border-left-color: #a855f7; }
        .bulk-item input[type="checkbox"] { accent-color: #a855f7; width: 14px; height: 14px; flex-shrink: 0; cursor: pointer; }
        .bulk-item-info { flex: 1; min-width: 0; }
        .bulk-item-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .bulk-item-meta { font-size: 10px; color: var(--text-muted); display: flex; gap: 6px; margin-top: 2px; align-items: center; }
        .bulk-temp-dot {
            width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
        }
        .bulk-temp-dot.hot { background: #f97316; }
        .bulk-temp-dot.warm { background: #f59e0b; }
        .bulk-temp-dot.cold { background: #7c3aed; }
        .bulk-item-unread { width: 7px; height: 7px; border-radius: 50%; background: #a855f7; flex-shrink: 0; }
        .bulk-actions-bar {
            display: flex; align-items: center; gap: 6px;
            padding: 10px 12px;
            border-top: 1px solid var(--glass-border);
            background: rgba(0,0,0,0.2);
            flex-shrink: 0; flex-wrap: wrap;
        }
        .bulk-action-btn {
            flex: 1; min-width: 70px;
            padding: 7px 6px; border-radius: 8px;
            font-size: 11px; font-weight: 600;
            cursor: pointer; transition: all 0.2s;
            border: 1px solid;
        }
        .bulk-action-btn.read {
            background: rgba(168, 85, 247,0.12); border-color: rgba(168, 85, 247,0.3); color: #a855f7;
        }
        .bulk-action-btn.read:hover { background: rgba(168, 85, 247,0.25); }
        .bulk-action-btn.unread {
            background: rgba(168, 85, 247,0.1); border-color: rgba(168, 85, 247,0.3); color: #a855f7;
        }
        .bulk-action-btn.unread:hover { background: rgba(168, 85, 247,0.2); }
        .bulk-action-sep { width: 1px; height: 28px; background: var(--glass-border); flex-shrink: 0; }
        .bulk-action-select {
            flex: 1; min-width: 90px;
            background: rgba(255,255,255,0.06);
            border: 1px solid var(--glass-border);
            color: var(--text);
            border-radius: 8px; padding: 6px 8px;
            font-size: 11px; cursor: pointer;
        }
        .bulk-action-select option { background: #1a1f2e; }
        .bulk-feedback {
            padding: 8px 14px; font-size: 11px;
            color: #a855f7; text-align: center;
            background: rgba(168, 85, 247,0.08);
            border-top: 1px solid rgba(168, 85, 247,0.15);
            animation: fadeIn 0.3s ease;
        }
        /* â”€â”€ V12.11: FLEET STATUS PANEL â”€â”€ */
        #fleet-status-panel {
            padding: 12px 8px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            overflow-y: auto;
            flex: 1;
        }
        #fleet-cores-status {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .fleet-node {
            display: flex;
            flex-direction: column;
            gap: 5px;
            padding: 8px 10px;
            border-radius: 8px;
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.05);
            cursor: default;
            transition: background 0.2s, border-color 0.2s;
        }
        .fleet-node:hover {
            background: rgba(255,255,255,0.06);
            border-color: rgba(255,255,255,0.1);
        }
        .fleet-node-header {
            display: flex;
            align-items: center;
            gap: 6px;
            width: 100%;
        }
        .fleet-dot {
            width: 7px; height: 7px;
            border-radius: 50%;
            flex-shrink: 0;
            animation: none;
        }
        .fleet-online .fleet-dot { animation: pulse-green 2s infinite; }
        .fleet-connecting .fleet-dot { animation: pulse-blue 1.5s infinite; }
        .fleet-quota-exceeded .fleet-dot { animation: pulse-purple 2s infinite; }
        @keyframes pulse-green {
            0%,100% { box-shadow: 0 0 0 0 rgba(232, 121, 249,0.5); }
            50% { box-shadow: 0 0 0 3px rgba(232, 121, 249,0); }
        }
        @keyframes pulse-blue {
            0%,100% { box-shadow: 0 0 0 0 rgba(129,140,248,0.5); }
            50% { box-shadow: 0 0 0 3px rgba(129,140,248,0); }
        }
        @keyframes pulse-purple {
            0%,100% { box-shadow: 0 0 0 0 rgba(192,132,252,0.5); }
            50% { box-shadow: 0 0 0 3px rgba(192,132,252,0); }
        }
        .fleet-id { font-weight: 600; color: var(--text); font-size: 11px; }
        .fleet-label { font-size: 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-left: 2px; }
        .fleet-online .fleet-label { color: #e879f9; }
        .fleet-error .fleet-label { color: #f59e0b; }
        .fleet-banned .fleet-label { color: #ef4444; }
        .fleet-connecting .fleet-label { color: #a855f7; }
        .fleet-quota-exceeded .fleet-label { color: #c084fc; }

        .fleet-quota {
            margin-left: auto;
            font-size: 10px;
            font-family: monospace, Courier, sans-serif;
            font-weight: 500;
            color: var(--text-muted);
        }
        .fleet-progress-wrap {
            width: 100%;
            height: 4px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 2px;
            overflow: hidden;
        }
        .fleet-progress-fill {
            height: 100%;
            width: 0%;
            border-radius: 2px;
            transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
        }

        /* Dynamic limit colors */
        .limit-low {
            background: linear-gradient(90deg, #a855f7, #7c3aed);
            box-shadow: 0 0 4px rgba(168, 85, 247, 0.3);
        }
        .limit-medium {
            background: linear-gradient(90deg, #f59e0b, #d97706);
            box-shadow: 0 0 4px rgba(245, 158, 11, 0.3);
        }
        .limit-high {
            background: linear-gradient(90deg, #ef4444, #dc2626);
            box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
        }

        /* â”€â”€ V13.0: SYSTEM HEALTH BAR â”€â”€ */
        #system-health-bar {
            padding: 10px 10px 8px;
            border-bottom: 1px solid var(--glass-border);
            display: flex;
            flex-direction: column;
            gap: 6px;
            flex-shrink: 0;
        }
        .health-row {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 10px;
        }
        .health-label {
            color: var(--text-muted);
            min-width: 60px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }
        .health-val {
            color: var(--text);
            font-weight: 700;
            font-size: 10px;
            margin-left: auto;
        }
        .health-bar-wrap {
            flex: 1;
            height: 6px;
            background: rgba(255,255,255,0.06);
            border-radius: 3px;
            overflow: hidden;
        }
        .health-bar-fill {
            height: 100%;
            border-radius: 3px;
            background: linear-gradient(90deg, #e879f9, #a855f7);
            transition: width 0.8s ease, background 0.5s ease;
        }
        .health-bar-fill.warning { background: linear-gradient(90deg, #f59e0b, #f97316); }
        .health-bar-fill.danger { background: linear-gradient(90deg, #ef4444, #f43f5e); }
        .health-backup-btn {
            width: 100%;
            padding: 5px 0;
            border: 1px solid rgba(168, 85, 247,0.2);
            background: rgba(168, 85, 247,0.08);
            color: var(--accent);
            border-radius: 6px;
            font-size: 10px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        .health-backup-btn:hover { background: rgba(168, 85, 247, 0.15); }
        .health-backup-btn:active { transform: scale(0.97); }

        /* V13.1.2: CSS para Mensajes Citados (Quoted Messages) */
        .quoted-msg-box {
            background: rgba(255, 255, 255, 0.08);
            border-left: 3px solid var(--accent);
            border-radius: 4px;
            padding: 6px 10px;
            margin-bottom: 6px;
            font-size: 11px;
            color: rgba(255, 255, 255, 0.7);
            cursor: pointer;
            transition: background 0.2s ease, border-left-color 0.2s ease;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .msg.out .quoted-msg-box {
            background: rgba(0, 0, 0, 0.18);
            border-left-color: rgba(255, 255, 255, 0.6);
            color: rgba(255, 255, 255, 0.85);
        }
        .quoted-msg-box:hover {
            background: rgba(255, 255, 255, 0.14);
        }
        .msg.out .quoted-msg-box:hover {
            background: rgba(0, 0, 0, 0.25);
        }
        
        /* Quoted Reply Preview above input area */
        #quoted-reply-preview {
            display: none;
            align-items: center;
            justify-content: space-between;
            padding: 8px 16px;
            background: rgba(20, 20, 30, 0.95);
            border-top: 1px solid var(--glass-border);
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            gap: 12px;
            font-size: 12px;
            backdrop-filter: blur(10px);
            z-index: 10;
        }
        .quoted-preview-content {
            display: flex;
            flex-direction: column;
            min-width: 0;
            flex: 1;
        }
        .quoted-preview-label {
            font-size: 10px;
            color: var(--accent);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 2px;
        }
         /* ═══════ CRM VIEW SELECTOR ═══════ */
        .crm-view-btn {
            padding: 6px 12px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--glass-border-light);
            background: rgba(255, 255, 255, 0.03);
            color: var(--text-dim);
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .crm-view-btn:hover {
            background: rgba(129, 140, 248, 0.1);
            color: var(--text);
            border-color: rgba(129, 140, 248, 0.3);
        }
        .crm-view-btn.active {
            background: rgba(129, 140, 248, 0.18);
            color: var(--text);
            border-color: var(--accent);
            box-shadow: 0 0 12px rgba(129, 140, 248, 0.25);
        }

        /* ═══════ KANBAN BOARD LAYOUT ═══════ */
        #crm-leads-list.kanban-mode {
            display: flex;
            flex-direction: row;
            gap: 18px;
            overflow-x: auto;
            overflow-y: hidden;
            padding: 16px 20px 20px 20px;
            height: 100%;
            align-items: stretch;
            scroll-behavior: smooth;
            scrollbar-width: thin;
            scrollbar-color: rgba(129, 140, 248, 0.2) rgba(255, 255, 255, 0.02);
            width: 100%;
            min-width: 0;
        }
        #crm-leads-list.kanban-mode::-webkit-scrollbar {
            height: 6px;
        }
        #crm-leads-list.kanban-mode::-webkit-scrollbar-track {
            background: rgba(255,255,255,0.02);
            border-radius: 3px;
        }
        #crm-leads-list.kanban-mode::-webkit-scrollbar-thumb {
            background: rgba(129,140,248,0.2);
            border-radius: 3px;
        }
        #crm-leads-list.kanban-mode::-webkit-scrollbar-thumb:hover {
            background: rgba(129,140,248,0.35);
        }

        /* ═══════ KANBAN CARDS HOVER PREVIEW POPOVER ═══════ */
        #kanban-preview-popover {
            position: absolute;
            z-index: 10000;
            display: none;
            width: 290px;
            max-height: 380px;
            overflow-y: auto;
            background: rgba(10, 13, 28, 0.95);
            border: 1px solid rgba(168, 85, 247, 0.35);
            border-radius: var(--radius-md);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(168, 85, 247, 0.15);
            padding: 12px 14px;
            backdrop-filter: blur(20px);
            pointer-events: none; /* Crucial to prevent enter/leave loops */
            animation: kanban-fade-in 0.15s cubic-bezier(0.4, 0, 0.2, 1);
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
        }

        #kanban-preview-popover::-webkit-scrollbar {
            width: 4px;
        }
        #kanban-preview-popover::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.1);
            border-radius: 2px;
        }

        @keyframes kanban-fade-in {
            from { opacity: 0; transform: scale(0.96); }
            to { opacity: 1; transform: scale(1); }
        }

        .quoted-preview-body {
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .quoted-preview-close {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 14px;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 4px;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .quoted-preview-close:hover {
            color: #fff;
            background: rgba(255, 255, 255, 0.1);
        }

        /* Glow effect on scrolling to target quoted message */
        @keyframes highlight-glow {
            0% {
                box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
                background-color: rgba(168, 85, 247, 0);
            }
            15% {
                box-shadow: 0 0 15px 4px rgba(168, 85, 247, 0.6);
                background-color: rgba(168, 85, 247, 0.25);
            }
            100% {
                box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
                background-color: rgba(168, 85, 247, 0);
            }
        }
        .highlight-glow {
            animation: highlight-glow 2s ease;
        }

            color: var(--text);
            border-color: var(--accent);
            box-shadow: 0 0 12px rgba(129, 140, 248, 0.25);
        }

        /* â•â•â•â•â•â•â• KANBAN BOARD LAYOUT â•â•â•â•â•â•â• */
        #crm-leads-list.kanban-mode {
            display: flex;
            flex-direction: row;
            gap: 18px;
            overflow-x: auto;
            overflow-y: hidden;
            padding: 16px 20px 20px 20px;
            height: 100%;
            align-items: stretch;
            scroll-behavior: smooth;
            scrollbar-width: thin;
            scrollbar-color: rgba(129, 140, 248, 0.2) rgba(255, 255, 255, 0.02);
        }
        #crm-leads-list.kanban-mode::-webkit-scrollbar {
            height: 6px;
        }
        #crm-leads-list.kanban-mode::-webkit-scrollbar-track {
            background: rgba(255,255,255,0.02);
            border-radius: 3px;
        }
        #crm-leads-list.kanban-mode::-webkit-scrollbar-thumb {
            background: rgba(129,140,248,0.2);
            border-radius: 3px;
        }
        #crm-leads-list.kanban-mode::-webkit-scrollbar-thumb:hover {
            background: rgba(129,140,248,0.35);
        }

        .kanban-column {
            flex: 1;
            min-width: 320px;
            max-width: 400px;
            background: rgba(10, 13, 25, 0.5);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-md);
            backdrop-filter: blur(12px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border-top: 4px solid var(--glass-border-light);
            box-shadow: 0 2px 12px rgba(0,0,0,0.15);
        }

        /* Header colors corresponding to commercial stages */
        .kanban-column[data-stage="outreach"] { border-top-color: var(--cold); }
        .kanban-column[data-stage="replied"] { border-top-color: var(--warm); }
        .kanban-column[data-stage="interested"] { border-top-color: var(--accent); }
        .kanban-column[data-stage="scheduled"] { border-top-color: var(--success); }
        .kanban-column[data-stage="closed"] { border-top-color: var(--hot); }

        .kanban-column-header {
            padding: 14px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: rgba(255, 255, 255, 0.015);
            border-bottom: 1px solid var(--glass-border);
            user-select: none;
        }

        .kanban-column-title {
            font-size: 13px;
            font-weight: 700;
            letter-spacing: 0.8px;
            text-transform: uppercase;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .kanban-column[data-stage="outreach"] .kanban-column-title { color: var(--cold); }
        .kanban-column[data-stage="replied"] .kanban-column-title { color: var(--warm); }
        .kanban-column[data-stage="interested"] .kanban-column-title { color: var(--accent); }
        .kanban-column[data-stage="scheduled"] .kanban-column-title { color: var(--success); }
        .kanban-column[data-stage="closed"] .kanban-column-title { color: var(--hot); }

        .kanban-column-count {
            font-size: 10px;
            font-weight: 700;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid var(--glass-border-light);
            color: var(--text-dim);
            padding: 2px 8px;
            border-radius: 20px;
        }

        .kanban-column-body {
            flex: 1;
            overflow-y: auto;
            padding: 14px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            min-height: 200px;
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
        }

        .kanban-column-body::-webkit-scrollbar {
            width: 5px;
        }
        .kanban-column-body::-webkit-scrollbar-track {
            background: transparent;
        }
        .kanban-column-body::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.08);
            border-radius: 3px;
        }
        .kanban-column-body::-webkit-scrollbar-thumb:hover {
            background: rgba(255,255,255,0.15);
        }

        .kanban-column.drag-over {
            background: rgba(129, 140, 248, 0.06);
            border-color: rgba(129, 140, 248, 0.4);
            box-shadow: inset 0 0 20px rgba(129, 140, 248, 0.08), 0 0 16px rgba(129, 140, 248, 0.1);
            transform: translateY(-2px);
        }

        /* â•â•â•â•â•â•â• KANBAN CARD â•â•â•â•â•â•â• */
        .kanban-card {
            background: linear-gradient(135deg, rgba(20, 24, 45, 0.6) 0%, rgba(13, 16, 32, 0.6) 100%);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: var(--radius-sm);
            padding: 12px 14px;
            cursor: grab;
            user-select: none;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            box-shadow: 0 4px 10px rgba(0,0,0,0.15);
        }

        .kanban-card:hover {
            background: linear-gradient(135deg, rgba(28, 33, 62, 0.75) 0%, rgba(18, 22, 45, 0.75) 100%);
            border-color: rgba(168, 85, 247, 0.35);
            transform: translateY(-3px) scale(1.01);
            box-shadow: 0 8px 24px rgba(168, 85, 247, 0.15), 0 0 15px rgba(168, 85, 247, 0.05);
        }

        .kanban-card:active {
            cursor: grabbing;
            transform: scale(0.98);
        }

        .kanban-card-preview {
            font-size: 10px;
            color: var(--text-dim);
            margin-top: 6px;
            padding: 5px 8px;
            background: rgba(255,255,255,0.015);
            border-radius: 4px;
            border-left: 2px solid var(--accent);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.4;
        }

        .kanban-card-name {
            font-size: 12px;
            font-weight: 700;
            color: var(--text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 2px;
            letter-spacing: 0.2px;
        }

        .kanban-card-phone {
            font-size: 10px;
            color: rgba(255, 255, 255, 0.35);
            font-family: var(--font-mono);
            margin-bottom: 6px;
        }

        .kanban-card-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin-bottom: 6px;
        }

        .kanban-card-tag {
            font-size: 8px;
            font-weight: 700;
            padding: 1px 6px;
            border-radius: 4px;
            background: rgba(168, 85, 247, 0.05);
            border: 1px solid rgba(168, 85, 247, 0.12);
            color: var(--accent-bright);
            text-transform: uppercase;
        }

        .kanban-card-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 6px;
            padding-top: 6px;
            border-top: 1px solid rgba(255, 255, 255, 0.03);
        }

        .kanban-card-time {
            font-size: 9px;
            color: var(--text-muted);
        }

        .kanban-card-temp {
            font-size: 8px;
            font-weight: 700;
            text-transform: uppercase;
            padding: 1px 6px;
            border-radius: 4px;
            border: 1px solid transparent;
        }

        .kanban-card-temp.hot {
            background: rgba(251, 113, 133, 0.12);
            border-color: rgba(251, 113, 133, 0.3);
            color: var(--hot);
        }

        .kanban-card-temp.warm {
            background: rgba(251, 191, 36, 0.1);
            border-color: rgba(251, 191, 36, 0.3);
            color: var(--warm);
        }

        .kanban-card-temp.cold {
            background: rgba(56, 189, 248, 0.1);
            border-color: rgba(56, 189, 248, 0.3);
            color: var(--cold);
        }

        /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
        /* ðŸ“Š ADVANCED ROI & ANALYTICS STYLES (Ãtem 10) */
        /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
        .roi-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 16px;
            margin-bottom: 24px;
        }

        .roi-card {
            background: rgba(12, 14, 26, 0.45);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            border: 1px solid var(--glass-border-light);
            border-radius: 16px;
            padding: 20px;
            position: relative;
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
        }

        .roi-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 100%);
            pointer-events: none;
        }

        .roi-card:hover {
            transform: translateY(-4px);
            border-color: rgba(168, 85, 247, 0.25);
            box-shadow: 0 8px 32px rgba(168, 85, 247, 0.15);
        }

        .roi-card.success-theme:hover {
            border-color: rgba(192, 132, 252, 0.25);
            box-shadow: 0 8px 32px rgba(192, 132, 252, 0.15);
        }

        .roi-card.hot-theme:hover {
            border-color: rgba(248, 113, 113, 0.25);
            box-shadow: 0 8px 32px rgba(248, 113, 113, 0.15);
        }

        .roi-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
        }

        .roi-title {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.8px;
        }

        .roi-icon {
            font-size: 16px;
            opacity: 0.8;
        }

        .roi-value {
            font-size: 28px;
            font-weight: 700;
            font-family: var(--font-ui);
            letter-spacing: -0.5px;
            margin-bottom: 6px;
            background: linear-gradient(120deg, #ffffff, var(--text-dim));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .roi-card.success-theme .roi-value {
            background: linear-gradient(120deg, #c084fc, #7c3aed);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .roi-card.accent-theme .roi-value {
            background: linear-gradient(120deg, #a855f7, #6d28d9);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .roi-badge-glow {
            display: inline-flex;
            align-items: center;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 10px;
            font-weight: 700;
            background: rgba(168, 85, 247, 0.12);
            border: 1px solid rgba(168, 85, 247, 0.35);
            color: var(--accent);
            text-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
            box-shadow: 0 0 12px rgba(168, 85, 247, 0.1);
        }

        .roi-badge-glow.success {
            background: rgba(192, 132, 252, 0.12);
            border-color: rgba(192, 132, 252, 0.35);
            color: var(--success);
            text-shadow: 0 0 8px rgba(192, 132, 252, 0.5);
            box-shadow: 0 0 12px rgba(192, 132, 252, 0.1);
        }

        .roi-detail-list {
            margin-top: 12px;
            font-size: 11px;
            color: var(--text-dim);
            border-top: 1px solid rgba(255, 255, 255, 0.05);
            padding-top: 8px;
        }

        .roi-detail-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 6px;
        }

        .roi-detail-val {
            font-weight: 600;
            color: var(--text);
        }

        /* Speed Comparison Styles */
        .speed-compare-container {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .speed-row {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .speed-label-group {
            width: 90px;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-dim);
        }

        .speed-bar-container {
            flex-grow: 1;
            height: 12px;
            background: rgba(255, 255, 255, 0.03);
            border-radius: 6px;
            overflow: hidden;
            border: 1px solid var(--glass-border-light);
        }

        .speed-bar-fill {
            height: 100%;
            border-radius: 5px;
            transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .speed-bar-fill.ai {
            background: linear-gradient(90deg, #60a5fa, #3b82f6);
            box-shadow: 0 0 10px rgba(96, 165, 250, 0.4);
        }

        .speed-bar-fill.operator {
            background: linear-gradient(90deg, #f59e0b, #d97706);
            box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
        }

        .speed-value-text {
            width: 55px;
            text-align: right;
            font-size: 12px;
            font-weight: 700;
            font-family: var(--font-ui);
            color: var(--text);
        }

        .speed-win-badge {
            margin-top: 6px;
            text-align: center;
            font-size: 11px;
            font-weight: 600;
            color: var(--success);
            background: rgba(192, 132, 252, 0.06);
            border: 1px solid rgba(192, 132, 252, 0.15);
            border-radius: 8px;
            padding: 6px 12px;
        }

        /* Top Fleet Accounts Styles */
        .top-accounts-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .top-account-row {
            display: flex;
            align-items: center;
            padding: 10px 14px;
            background: rgba(255, 255, 255, 0.02);
            border-radius: 10px;
            border: 1px solid var(--glass-border-light);
            transition: all 0.2s ease;
        }

        .top-account-row:hover {
            background: rgba(255, 255, 255, 0.04);
            border-color: rgba(168, 85, 247, 0.15);
        }

        .top-account-rank {
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 800;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-dim);
            margin-right: 12px;
        }

        .top-account-rank.first {
            background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
            color: #0c0e1a;
            box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
        }

        .top-account-rank.second {
            background: linear-gradient(135deg, #cbd5e1 0%, #64748b 100%);
            color: #0c0e1a;
        }

        .top-account-rank.third {
            background: linear-gradient(135deg, #b45309 0%, #78350f 100%);
            color: #ffffff;
        }

        .top-account-name {
            font-weight: 600;
            font-size: 13px;
            color: var(--text);
            flex-grow: 1;
        }

        .top-account-metrics {
            display: flex;
            gap: 12px;
            font-size: 11px;
            color: var(--text-muted);
            margin-right: 12px;
        }

        .top-account-badge {
            font-size: 10px;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 6px;
        }

        .top-account-badge.online {
            background: rgba(192, 132, 252, 0.12);
            border: 1px solid rgba(192, 132, 252, 0.3);
            color: var(--success);
        }

        .top-account-badge.error {
            background: rgba(248, 113, 113, 0.12);
            border: 1px solid rgba(248, 113, 113, 0.3);
            color: var(--hot);
        }

        /* Sector Advanced Table */
        .adv-sector-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 11px;
        }

        .adv-sector-table th {
            text-align: left;
            padding: 8px 10px;
            color: var(--text-muted);
            font-weight: 600;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            text-transform: uppercase;
            font-size: 9px;
            letter-spacing: 0.5px;
        }

        .adv-sector-table td {
            padding: 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.03);
            vertical-align: middle;
        }

        .adv-sector-table tr:last-child td {
            border-bottom: none;
        }

        /* ======================================================================
           â° PROGRAMACIÃ“N DE MENSAJES (SCHEDULER - V14.5)
           ====================================================================== */
        .input-btn.schedule {
            background: rgba(168, 85, 247, 0.08);
            border: 1px solid rgba(168, 85, 247, 0.25);
            color: var(--accent);
            cursor: pointer;
            font-size: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border-radius: 8px;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .input-btn.schedule:hover {
            background: rgba(168, 85, 247, 0.2);
            border-color: var(--accent);
            transform: scale(1.05);
            box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
        }

        .input-btn.schedule:active {
            transform: scale(0.95);
        }

        /* Contenedor debajo del chat para mostrar mensajes programados */
        .scheduled-list-container {
            background: rgba(15, 23, 42, 0.4);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-top: 1px solid var(--glass-border);
            padding: 12px 16px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 160px;
            overflow-y: auto;
            border-bottom: 1px solid var(--glass-border);
        }

        .scheduled-list-title {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--accent);
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 4px;
        }

        .scheduled-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 8px 12px;
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid var(--glass-border);
            border-radius: 8px;
            transition: all 0.2s ease;
        }

        .scheduled-item:hover {
            background: rgba(255, 255, 255, 0.05);
            border-color: rgba(168, 85, 247, 0.3);
            transform: translateX(2px);
        }

        .scheduled-item-content {
            display: flex;
            flex-direction: column;
            gap: 3px;
            flex: 1;
            min-width: 0;
        }

        .scheduled-item-text {
            font-size: 12px;
            color: var(--text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .scheduled-item-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 10px;
        }

        .scheduled-badge-time {
            color: var(--accent2);
            background: rgba(236, 72, 153, 0.1);
            border: 1px solid rgba(236, 72, 153, 0.2);
            padding: 1px 6px;
            border-radius: 4px;
            font-family: monospace;
            font-weight: 600;
        }

        .scheduled-badge-status {
            color: var(--warm);
            background: rgba(245, 158, 11, 0.1);
            border: 1px solid rgba(245, 158, 11, 0.2);
            padding: 1px 6px;
            border-radius: 4px;
            font-size: 9px;
            text-transform: uppercase;
            font-weight: 700;
        }

        .scheduled-delete-btn {
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.2);
            color: #f87171;
            cursor: pointer;
            width: 28px;
            height: 28px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            transition: all 0.2s ease;
        }

        .scheduled-delete-btn:hover {
            background: rgba(239, 68, 68, 0.25);
            border-color: #ef4444;
            color: #ffffff;
            transform: scale(1.08);
        }

        .scheduled-delete-btn:active {
            transform: scale(0.92);
        }


        
        /* ═══════════════════════════════════════════════════════════════
           SHIMMER LOADING EFFECT — V18
           ═══════════════════════════════════════════════════════════════ */
        @keyframes shimmer {
            0% {
                background-position: -200% 0;
            }
            100% {
                background-position: 200% 0;
            }
        }
        .shimmer-card {
            position: relative;
            overflow: hidden;
        }
        .shimmer-card::after {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: linear-gradient(90deg, 
                transparent 0%, 
                rgba(168, 85, 247, 0.06) 35%, 
                rgba(217, 70, 239, 0.06) 50%, 
                rgba(168, 85, 247, 0.06) 65%, 
                transparent 100%
            );
            background-size: 200% 100%;
            animation: shimmer 2s infinite linear;
            pointer-events: none;
        }
        



        /* ─── Batch Start Controls (Premium Visual Redesign) ─── */
        #fleet-batch-controls {
            padding: 12px 10px 14px;
            background: rgba(255, 255, 255, 0.015);
            border: 1px solid rgba(255, 255, 255, 0.03);
            border-radius: 12px;
            margin-bottom: 12px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.02);
        }
        .batch-header-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 2px;
        }
        .batch-title {
            font-size: 10px;
            font-weight: 700;
            color: var(--text-dim);
            letter-spacing: 0.8px;
            text-transform: uppercase;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .batch-title-icon {
            width: 12px;
            height: 12px;
            color: var(--accent);
        }
        #fleet-offline-count {
            font-size: 9px;
            font-weight: 700;
            color: rgba(251, 113, 133, 0.95);
            background: rgba(251, 113, 133, 0.08);
            border: 1px solid rgba(251, 113, 133, 0.15);
            padding: 2px 8px;
            border-radius: 20px;
            letter-spacing: 0.3px;
        }
        .batch-actions-grid {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .batch-btn-all {
            width: 100%;
            height: 30px;
            padding: 0 12px;
            font-size: 10px;
            font-weight: 700;
            font-family: inherit;
            background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(217, 70, 239, 0.12) 100%);
            border: 1px solid rgba(168, 85, 247, 0.3);
            color: var(--accent-bright);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        }
        .batch-btn-all:hover {
            background: linear-gradient(135deg, rgba(168, 85, 247, 0.25) 0%, rgba(217, 70, 239, 0.25) 100%);
            border-color: rgba(217, 70, 239, 0.5);
            color: #fff;
            box-shadow: 0 0 12px rgba(217, 70, 239, 0.2);
            transform: translateY(-1px);
        }
        .batch-btn-all:active {
            transform: translateY(0);
        }
        .batch-btn-all .btn-icon {
            width: 9px;
            height: 9px;
            fill: currentColor;
        }
        .batch-group {
            display: flex;
            gap: 6px;
            width: 100%;
        }
        #batch-count-select {
            flex: 1;
            height: 30px;
            padding: 0 24px 0 10px;
            font-size: 10px;
            font-weight: 600;
            font-family: inherit;
            background: rgba(0, 0, 0, 0.35);
            border: 1px solid var(--glass-border);
            border-radius: 8px;
            color: var(--text);
            outline: none;
            cursor: pointer;
            transition: all 0.2s ease;
            appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
            background-repeat: no-repeat;
            background-position: calc(100% - 8px) center;
            background-size: 11px;
        }
        #batch-count-select:hover {
            border-color: rgba(255, 255, 255, 0.12);
            background-color: rgba(255, 255, 255, 0.01);
        }
        #batch-count-select:focus {
            border-color: var(--accent);
            box-shadow: 0 0 6px var(--accent-glow);
        }
        #batch-count-select option {
            background: #0d0f18;
            color: var(--text);
        }
        .batch-btn-run {
            flex: 1.1;
            height: 30px;
            padding: 0 12px;
            font-size: 10px;
            font-weight: 700;
            font-family: inherit;
            background: rgba(168, 85, 247, 0.08);
            border: 1px solid rgba(168, 85, 247, 0.25);
            color: var(--text-dim);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }
        .batch-btn-run:hover {
            background: rgba(168, 85, 247, 0.16);
            border-color: var(--accent);
            color: #fff;
            box-shadow: 0 0 10px rgba(168, 85, 247, 0.15);
            transform: translateY(-1px);
        }
        .batch-btn-run:active {
            transform: translateY(0);
        }
        .batch-btn-run .btn-icon {
            width: 9px;
            height: 9px;
            stroke: currentColor;
        }
        #fleet-status-panel .log-title {
            color: var(--text);
            font-weight: 700;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 1.2px;
            border-bottom: 1px solid var(--glass-border-light);
            padding-bottom: 8px;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 6px;
            background: linear-gradient(135deg, var(--text), var(--accent2));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            flex-shrink: 0;
        }
