        html.has-token .login-page { display: none !important; }

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

        :root {
            --bg: #0f172a;
            --bg2: #1e293b;
            --bg3: #334155;
            --bg4: #475569;
            --surface: #fff;
            --surface2: #f8fafc;
            --surface3: #f1f5f9;
            --surface4: #e2e8f0;
            --border: #e2e8f0;
            --border2: #cbd5e1;
            --text: #0f172a;
            --text2: #475569;
            --text3: #94a3b8;
            --primary: #0d9488;
            --primary2: #14b8a6;
            --primary3: #2dd4bf;
            --purple: #7c3aed;
            --purple2: #8b5cf6;
            --green: #059669;
            --yellow: #d97706;
            --red: #dc2626;
            --blue: #2563eb;
            --orange: #ea580c;
            --pink: #db2777;
            --cyan: #0891b2;
        }

        .dark-mode {
            --surface: #1e293b;
            --surface2: #0f172a;
            --surface3: #334155;
            --surface4: #475569;
            --border: #475569;
            --border2: #64748b;
            --text: #f1f5f9;
            --text2: #cbd5e1;
            --text3: #94a3b8
        }

        .dark-mode .input,
        .dark-mode .textarea,
        .dark-mode .chat-input,
        .dark-mode select,
        .dark-mode input,
        .dark-mode textarea {
            color: var(--text);
            background: var(--surface3);
            border-color: var(--border)
        }

        .dark-mode .input::placeholder,
        .dark-mode .textarea::placeholder,
        .dark-mode .chat-input::placeholder,
        .dark-mode select::placeholder,
        .dark-mode input::placeholder,
        .dark-mode textarea::placeholder {
            color: var(--text3)
        }

        .dark-mode .tab {
            color: var(--text2)
        }

        .dark-mode .tab.active {
            background: var(--surface3);
            color: var(--primary3)
        }

        .dark-mode .typing-indicator { background: var(--surface3) }
        .dark-mode .flow-stats-card { background: var(--surface3); border: 1px solid var(--border) }

        .dark-mode .login-right {
            background: var(--bg)
        }

        @media(max-width:900px) {
            .dark-mode .login-right {
                background: transparent
            }
        }

        .dark-mode .login-header h2 {
            color: var(--text)
        }

        .dark-mode .modal {
            background: var(--surface)
        }

        .dark-mode .modal-header h3 {
            color: var(--text)
        }

        .dark-mode .field label {
            color: var(--text)
        }

        .dark-mode .alert.error {
            background: rgba(220, 38, 38, .15);
            color: #fca5a5;
            border-color: rgba(220, 38, 38, .3)
        }

        .dark-mode .alert.success {
            background: rgba(5, 150, 105, .15);
            color: #6ee7b7;
            border-color: rgba(5, 150, 105, .3)
        }

        .dark-mode .btn-outline {
            border-color: var(--border);
            color: var(--text2)
        }

        .dark-mode .btn-secondary {
            background: var(--surface3);
            color: var(--text)
        }

        .dark-mode .admin-table td {
            color: var(--text)
        }

        .dark-mode .stat-card .value {
            color: var(--text)
        }

        .dark-mode .chart-card h3,
        .dark-mode .admin-card h3 {
            color: var(--text)
        }

        .dark-mode .conv-name {
            color: var(--text)
        }

        .dark-mode .label-tag.red {
            background: rgba(220, 38, 38, .15)
        }

        .dark-mode .label-tag.green {
            background: rgba(5, 150, 105, .15)
        }

        .dark-mode .label-tag.blue {
            background: rgba(37, 99, 235, .15)
        }

        .dark-mode .label-tag.yellow {
            background: rgba(217, 119, 6, .15)
        }

        .dark-mode .label-tag.purple {
            background: rgba(124, 58, 237, .15)
        }

        .dark-mode .ticket-textarea {
            color: var(--text);
            background: var(--surface3)
        }

        .dark-mode code {
            color: var(--text);
            background: var(--surface3)
        }

        .dark-mode .modal { border: 1px solid var(--border) }
        .dark-mode .modal-header { border-color: var(--border) }
        .dark-mode .modal-footer { border-color: var(--border) }
        .dark-mode .modal-close { background: var(--surface3); color: var(--text2) }
        .dark-mode .modal-close:hover { background: var(--surface4) }
        .dark-mode .qr-category { background: var(--surface3); color: var(--text2) }
        .dark-mode .chat-bar { background: var(--surface); border-color: var(--border) }
        .dark-mode .sch-item { background: var(--surface) }

        body {
            font-family: 'Inter', system-ui, sans-serif;
            background: var(--bg);
            color: var(--text);
            font-size: 14px;
            transition: all .3s
        }

        .login-page {
            min-height: 100vh;
            min-height: 100dvh;
            display: flex
        }

        .login-left {
            flex: 1;
            background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 80px
        }

        .login-brand {
            max-width: 500px
        }

        .login-brand img {
            height: 200px;
            margin: -40px 0 -20px -40px;
            max-width: calc(100% + 40px);
            object-fit: contain;
            display: block
        }

        .login-brand h1 {
            font-size: 42px;
            font-weight: 800;
            color: #fff;
            line-height: 1.15;
            margin-bottom: 20px
        }

        .login-brand h1 span {
            background: linear-gradient(90deg, var(--primary2), var(--purple2));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent
        }

        .login-brand p {
            font-size: 17px;
            color: rgba(255, 255, 255, .7);
            line-height: 1.6;
            margin-bottom: 40px
        }

        .login-features {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px
        }

        .feature {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 16px 20px;
            background: rgba(255, 255, 255, .08);
            border-radius: 14px
        }

        .feature-icon {
            min-width: 48px;
            height: 40px;
            background: linear-gradient(135deg, var(--primary), var(--purple));
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            flex-shrink: 0;
            color: #fff;
            font-weight: 700;
            padding: 0 8px
        }

        .feature span {
            color: #fff;
            font-size: 13px;
            font-weight: 600
        }

        /* Flutuante WhatsApp Suporte */
        .whatsapp-float {
            position: fixed;
            bottom: 24px;
            right: 24px;
            z-index: 9999;
            display: flex;
            align-items: center;
            gap: 10px;
            animation: floatPulse 2s ease-in-out infinite
        }

        .whatsapp-float-label {
            background: #fff;
            color: #1a1a2e;
            padding: 10px 16px;
            border-radius: 12px;
            font-size: 13px;
            font-weight: 600;
            box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
            white-space: nowrap;
            line-height: 1.4
        }

        .whatsapp-float-label small {
            display: block;
            font-size: 11px;
            font-weight: 400;
            color: #666;
            margin-top: 2px
        }

        .whatsapp-float-btn {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: #25d366;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 20px rgba(37, 211, 102, .4);
            cursor: pointer;
            transition: transform .2s, box-shadow .2s;
            text-decoration: none;
            flex-shrink: 0
        }

        .whatsapp-float-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 28px rgba(37, 211, 102, .5)
        }

        .whatsapp-float-btn svg {
            width: 32px;
            height: 32px;
            fill: #fff
        }

        @keyframes floatPulse {
            0%, 100% { transform: translateY(0) }
            50% { transform: translateY(-6px) }
        }

        @keyframes pulse {
            0%, 100% { opacity: 1 }
            50% { opacity: .4 }
        }

        .pw-strength {
            margin-top: 6px;
            height: 4px;
            border-radius: 2px;
            background: var(--bg3);
            overflow: hidden;
            transition: all .3s
        }

        .pw-strength-bar {
            height: 100%;
            border-radius: 2px;
            transition: width .3s, background .3s
        }

        .pw-strength-text {
            font-size: 11px;
            margin-top: 4px;
            font-weight: 500
        }

        .lgpd-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,.55);
            backdrop-filter: blur(6px);
            z-index: 99998;
            animation: lgpdFadeIn .3s ease
        }

        .lgpd-banner {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 460px;
            max-width: calc(100% - 32px);
            background: var(--surface);
            border-radius: 20px;
            padding: 32px;
            z-index: 99999;
            box-shadow: 0 20px 60px rgba(0,0,0,.25);
            border: 1px solid var(--border);
            animation: lgpdPopIn .4s cubic-bezier(.34,1.56,.64,1)
        }

        .lgpd-icon {
            width: 56px;
            height: 56px;
            border-radius: 16px;
            background: linear-gradient(135deg, rgba(13,148,136,.12), rgba(124,58,237,.12));
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 20px;
            color: var(--primary)
        }

        .lgpd-title {
            font-size: 17px;
            font-weight: 700;
            color: var(--text);
            text-align: center;
            margin-bottom: 12px
        }

        .lgpd-text {
            font-size: 13px;
            color: var(--text2);
            line-height: 1.7;
            text-align: center;
            margin-bottom: 24px
        }

        .lgpd-text strong {
            color: var(--text);
            font-weight: 600
        }

        .lgpd-actions {
            display: flex;
            flex-direction: column;
            gap: 10px
        }

        .lgpd-actions .lgpd-btn-accept {
            width: 100%;
            padding: 14px;
            border: none;
            border-radius: 12px;
            background: linear-gradient(135deg, var(--primary), var(--purple));
            color: #fff;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            transition: all .2s
        }

        .lgpd-actions .lgpd-btn-accept:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 24px rgba(124,58,237,.3)
        }

        .lgpd-actions .lgpd-btn-details {
            width: 100%;
            padding: 10px;
            border: none;
            border-radius: 10px;
            background: none;
            color: var(--text3);
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: color .15s
        }

        .lgpd-actions .lgpd-btn-details:hover {
            color: var(--primary)
        }

        @keyframes lgpdFadeIn { from { opacity: 0 } to { opacity: 1 } }
        @keyframes lgpdPopIn { from { opacity: 0; transform: translate(-50%,-50%) scale(.9) } to { opacity: 1; transform: translate(-50%,-50%) scale(1) } }

        .login-right {
            width: 520px;
            background: var(--surface);
            display: flex;
            flex-direction: column;
            padding: 60px
        }

        .login-card {
            max-width: 380px;
            margin: auto;
            width: 100%
        }

        .login-header {
            margin-bottom: 36px
        }

        .login-header h2 {
            font-size: 28px;
            font-weight: 800;
            margin-bottom: 8px
        }

        .login-header p {
            color: var(--text3);
            font-size: 15px
        }

        /* ==================== FLOW VISUAL - Bot (n8n/Make) ==================== */
        .flow-view-toggle{display:inline-flex;gap:2px;background:var(--surface3);padding:3px;border-radius:10px}
        .flow-view-btn{padding:7px 18px;border:none;border-radius:8px;cursor:pointer;font-size:13px;font-weight:600;background:none;color:var(--text3);transition:all .15s}
        .flow-view-btn:hover{color:var(--text)}
        .flow-view-btn.active{background:var(--surface);color:var(--primary);box-shadow:0 1px 4px rgba(0,0,0,.08)}
        .flow-canvas{position:relative;padding:28px 16px 16px;min-height:300px;background-image:radial-gradient(var(--border) .7px,transparent .7px);background-size:16px 16px;border-radius:12px;border:1px solid var(--border);overflow-x:hidden;overflow-y:auto}
        .flow-col{display:flex;flex-direction:column;align-items:center;margin:0 auto;max-width:360px;width:100%}
        .flow-status{display:flex;align-items:center;justify-content:center;gap:6px;padding:5px 14px;background:var(--surface);border:1px solid var(--border);border-radius:8px;font-size:10.5px;color:var(--text2);font-weight:600;margin-bottom:18px;box-shadow:0 1px 3px rgba(0,0,0,.04)}
        .flow-status b{color:var(--primary)}
        .flow-nd{width:100%;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:0 1px 3px rgba(0,0,0,.04);transition:box-shadow .2s,opacity .2s,transform .15s;position:relative}
        .flow-nd:hover{box-shadow:0 4px 14px rgba(0,0,0,.09);transform:translateY(-1px)}
        .flow-nd.fl-off{opacity:.38}.flow-nd.fl-off:hover{opacity:.55}
        .flow-nd::before,.flow-nd::after{content:'';position:absolute;left:50%;transform:translateX(-50%);width:8px;height:8px;border-radius:50%;background:var(--surface4);border:2px solid var(--surface);z-index:2;box-shadow:0 0 0 1px var(--border)}
        .flow-nd::before{top:-5px}.flow-nd::after{bottom:-5px}
        .flow-nd-bar{position:absolute;left:0;top:0;bottom:0;width:4px;border-radius:10px 0 0 10px}
        .flow-nd-hd{display:flex;align-items:center;gap:9px;padding:10px 12px 10px 18px;cursor:pointer;user-select:none}
        .flow-nd-ico{width:28px;height:28px;border-radius:7px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
        .flow-nd-ico svg{display:block}
        .flow-nd-tt{flex:1;min-width:0}
        .flow-nd-tt h4{font-size:12.5px;font-weight:700;margin:0;color:var(--text);line-height:1.2}
        .flow-nd-tt span{font-size:10.5px;color:var(--text3);display:block;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
        .flow-nd-sw{position:relative;width:32px;height:17px;flex-shrink:0}
        .flow-nd-sw input{opacity:0;width:0;height:0;position:absolute}
        .flow-nd-sw .sl{position:absolute;inset:0;border-radius:17px;background:var(--surface4);transition:.2s;cursor:pointer}
        .flow-nd-sw .sl:before{content:'';position:absolute;width:13px;height:13px;border-radius:50%;background:#fff;left:2px;top:2px;transition:.15s;box-shadow:0 1px 2px rgba(0,0,0,.12)}
        .flow-nd-sw input:checked+.sl{background:var(--primary)}
        .flow-nd-sw input:checked+.sl:before{left:17px}
        .flow-nd-chev{font-size:9px;color:var(--text3);transition:transform .2s,opacity .15s;flex-shrink:0;opacity:.4}
        .flow-nd:hover .flow-nd-chev{opacity:.8}
        .flow-nd-chev.open{transform:rotate(90deg);opacity:1}
        .flow-nd-body{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s ease-out}
        .flow-nd-body.open{grid-template-rows:1fr}
        .flow-nd-wrap{overflow:hidden}
        .flow-nd-form{padding:10px 12px 14px 18px;border-top:1px solid var(--border)}
        .flow-nd-form .field{margin:8px 0 0}
        .flow-nd-form .field:first-child{margin-top:0}
        .flow-nd-form label{font-size:11px;font-weight:600;display:block;margin-bottom:3px;color:var(--text2)}
        .flow-nd-form small{color:var(--text3);font-size:10px;display:block;margin-top:3px}
        .flow-nd-form .input,.flow-nd-form textarea{font-size:12px}
        .flow-nd-subs{padding:2px 12px 8px 18px;display:flex;flex-direction:column;gap:3px}
        .flow-nd-sub{background:var(--surface2);border-radius:6px;padding:5px 8px;font-size:10.5px;display:flex;align-items:center;gap:5px;border:1px solid var(--border);cursor:pointer;transition:background .12s}
        .flow-nd-sub:hover{background:var(--surface3)}
        .flow-nd-sub b{font-size:12px;min-width:16px;text-align:center;color:var(--primary);font-weight:800}
        .flow-nd-empty{padding:6px 18px 10px;font-size:10px;color:var(--text3);font-style:italic}
        .flow-edge{display:flex;flex-direction:column;align-items:center;height:24px;position:relative;width:100%;flex-shrink:0}
        .flow-edge-line{width:2px;height:100%;background:var(--border);position:relative}
        .flow-edge-line::after{content:'';position:absolute;bottom:-1px;left:50%;transform:translateX(-50%);border-left:3px solid transparent;border-right:3px solid transparent;border-top:4px solid var(--border)}
        .flow-edge.eg-green .flow-edge-line{background:#10b981}.flow-edge.eg-green .flow-edge-line::after{border-top-color:#10b981}
        .flow-edge.eg-red .flow-edge-line{background:#ef4444}.flow-edge.eg-red .flow-edge-line::after{border-top-color:#ef4444}
        .flow-edge.eg-amber .flow-edge-line{background:#f59e0b}.flow-edge.eg-amber .flow-edge-line::after{border-top-color:#f59e0b}
        .flow-edge-lbl{position:absolute;top:50%;left:calc(50% + 10px);transform:translateY(-50%);font-size:8.5px;font-weight:700;letter-spacing:.3px;text-transform:uppercase;padding:1px 6px;border-radius:3px;background:var(--surface);border:1px solid var(--border);color:var(--text3);white-space:nowrap}
        .flow-branch-wrap{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:10px}
        .flow-branch-col{display:flex;flex-direction:column;align-items:center}
        .flow-branch-tag{font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.3px;padding:3px 8px;border-radius:5px;margin-bottom:2px}
        .flow-branch-pass{padding:12px 8px;font-size:9.5px;color:var(--text3);text-align:center;font-style:italic;line-height:1.3}
        .flow-save-bar{position:sticky;bottom:0;padding:12px 0;display:flex;justify-content:center;gap:8px;z-index:5;margin-top:8px;background:linear-gradient(transparent,var(--surface) 35%)}
        .flow-save-bar .btn{min-width:140px;font-size:12.5px;font-weight:700}
        .flow-dirty-dot{width:6px;height:6px;border-radius:50%;background:var(--red);display:inline-block;margin-left:4px;animation:flP 1.5s infinite}
        @keyframes flP{0%,100%{opacity:1}50%{opacity:.2}}
        .dark-mode .flow-canvas{background-image:radial-gradient(var(--bg3) .7px,transparent .7px);border-color:var(--border)}
        .dark-mode .flow-nd{background:var(--surface);border-color:var(--border);box-shadow:0 1px 3px rgba(0,0,0,.18)}
        .dark-mode .flow-nd::before,.dark-mode .flow-nd::after{background:var(--bg3);border-color:var(--surface);box-shadow:0 0 0 1px var(--border)}
        .dark-mode .flow-view-btn.active{background:var(--surface3)}
        .dark-mode .flow-edge-lbl,.dark-mode .flow-status{background:var(--surface);border-color:var(--border)}
        .dark-mode .flow-nd-sub{background:var(--surface3);border-color:var(--border)}
        .dark-mode .flow-nd-sw .sl:before{box-shadow:0 1px 2px rgba(0,0,0,.3)}
        @media(max-width:600px){.flow-col{max-width:100%}.flow-branch-wrap{grid-template-columns:1fr;gap:3px}.flow-nd-hd{padding:8px 10px 8px 14px}.flow-nd-form{padding:8px 10px 12px 14px}}

        /* ==================== N8N FLOW EDITOR ==================== */
        .n8n-wrapper{position:relative;width:100%;height:calc(100vh - 140px);min-height:600px;border:1px solid var(--border);border-radius:16px;overflow:hidden;background:var(--surface);display:flex;flex-direction:column;box-shadow:0 1px 3px rgba(0,0,0,.04)}
        .n8n-toolbar{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;background:var(--surface);border-bottom:1px solid var(--border);gap:10px;flex-wrap:wrap;z-index:10;position:relative}
        .n8n-toolbar-left{display:flex;align-items:center;gap:10px}
        .n8n-toolbar-right{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
        .n8n-toolbar .btn{font-size:11px;padding:6px 14px;font-weight:600}
        .n8n-toolbar select{font-size:12px;padding:5px 10px;border-radius:8px;border:1px solid var(--border);background:var(--surface3);color:var(--text)}
        .n8n-canvas{position:relative;flex:1;overflow:hidden;cursor:grab;background-color:var(--surface3);background-image:radial-gradient(circle,var(--border) .5px,transparent .5px);background-size:20px 20px}
        .n8n-canvas:active{cursor:grabbing}
        .n8n-canvas-inner{position:absolute;top:0;left:0;transform-origin:0 0;will-change:transform}
        .n8n-svg{position:absolute;top:0;left:0;width:1px;height:1px;overflow:visible;pointer-events:none;z-index:1}
        .n8n-node{position:absolute;width:220px;background:var(--surface);border:1.5px solid var(--border);border-radius:14px;box-shadow:0 1px 3px rgba(0,0,0,.04),0 4px 12px rgba(0,0,0,.06);cursor:pointer;transition:box-shadow .25s ease,border-color .25s ease,transform .15s ease;user-select:none;z-index:2;overflow:visible;contain:layout style}
        .n8n-v2-canvas .n8n-node{width:240px}
        .n8n-node:hover{box-shadow:0 4px 12px rgba(0,0,0,.08),0 8px 24px rgba(0,0,0,.1);z-index:3;transform:translateY(-1px)}
        .n8n-node.n8n-dragging{transition:none!important;z-index:100;will-change:left,top;cursor:grabbing;pointer-events:auto}
        .n8n-node.n8n-dragging:hover{transform:none;box-shadow:0 8px 28px rgba(0,0,0,.15),0 2px 8px rgba(0,0,0,.08)}
        .n8n-canvas.n8n-is-dragging .n8n-node:not(.n8n-dragging){pointer-events:none;transition:none!important}
        .n8n-canvas.n8n-is-dragging .n8n-edge,.n8n-canvas.n8n-is-dragging .n8n-edge-hit{transition:none!important}
        .n8n-node.n8n-selected{border-color:var(--primary);box-shadow:0 0 0 2px rgba(124,58,237,.2),0 4px 16px rgba(124,58,237,.12)}
        .n8n-node.n8n-off{opacity:.4;filter:grayscale(.3)}.n8n-node.n8n-off:hover{opacity:.65;filter:none}
        .n8n-node-bar{position:absolute;left:0;top:0;bottom:0;width:4px;border-radius:14px 0 0 14px}
        .n8n-node-type-tag{position:absolute;top:8px;right:10px;font-size:7.5px;font-weight:800;padding:2px 7px;border-radius:5px;text-transform:uppercase;letter-spacing:.5px}
        .n8n-node-hd{display:flex;align-items:center;gap:10px;padding:14px 14px 8px}
        .n8n-node-ico{width:34px;height:34px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 2px 6px rgba(0,0,0,.1)}
        .n8n-node-ico svg{width:16px;height:16px}
        .n8n-node-info{flex:1;min-width:0}
        .n8n-node-info h4{margin:0;font-size:12px;font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
        .n8n-node-info span{font-size:10px;color:var(--text3);display:block;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
        .n8n-node-badge{font-size:8.5px;font-weight:700;padding:2px 7px;border-radius:6px;text-transform:uppercase;letter-spacing:.3px;position:absolute;top:8px;right:10px}
        .n8n-badge-on{background:rgba(16,185,129,.12);color:#059669}
        .n8n-badge-off{background:rgba(100,116,139,.12);color:#64748b}
        .n8n-port{position:absolute;width:12px;height:12px;border-radius:50%;border:2.5px solid var(--border);background:var(--surface);z-index:4;transition:all .2s ease;box-shadow:0 1px 3px rgba(0,0,0,.08)}
        .n8n-port:hover{background:var(--primary);border-color:var(--primary);transform:translateY(-50%) scale(1.4);box-shadow:0 0 0 4px rgba(124,58,237,.15),0 2px 8px rgba(124,58,237,.25)}
        .port-in{left:-7px;top:50%;transform:translateY(-50%)}
        .port-out{right:-7px;top:50%;transform:translateY(-50%)}
        .n8n-port.multi{width:10px;height:10px}
        .n8n-port.multi:hover{transform:translateY(-50%) scale(1.35)}
        .n8n-edge{stroke-width:2;fill:none;transition:stroke .2s,stroke-width .15s;stroke-linecap:round}
        .n8n-edge.selected{stroke-width:2.5;filter:drop-shadow(0 0 4px rgba(124,58,237,.5));stroke:var(--primary)!important}
        .n8n-edge-hit{stroke-width:18;fill:none;stroke:transparent;cursor:pointer;pointer-events:stroke}
        .n8n-edge-hit:hover+.n8n-edge{stroke-width:3;filter:drop-shadow(0 0 3px rgba(0,0,0,.15))}
        .n8n-edge-label{font-size:9.5px;font-weight:600;fill:var(--text2);pointer-events:none;letter-spacing:.2px}
        .n8n-edge-label-bg{fill:var(--surface);stroke:var(--border);stroke-width:.6;rx:8;filter:drop-shadow(0 1px 2px rgba(0,0,0,.06))}
        .n8n-panel-overlay{position:fixed;inset:0;background:rgba(0,0,0,.3);backdrop-filter:blur(2px);z-index:998;opacity:0;pointer-events:none;transition:opacity .3s ease}
        .n8n-panel-overlay.open{opacity:1;pointer-events:auto}
        .n8n-panel{position:fixed;top:0;right:-500px;width:480px;height:100vh;background:var(--surface);border-left:1px solid var(--border);box-shadow:-8px 0 32px rgba(0,0,0,.12);z-index:999;display:flex;flex-direction:column;transition:right .3s cubic-bezier(.16,1,.3,1)}
        .n8n-panel.open{right:0}
        .n8n-panel-header{display:flex;align-items:center;gap:12px;padding:18px 20px;border-bottom:1px solid var(--border);flex-shrink:0}
        .n8n-panel-header .n8n-node-ico{width:38px;height:38px;border-radius:10px;box-shadow:0 2px 8px rgba(0,0,0,.1)}
        .n8n-panel-header h3{margin:0;font-size:15px;font-weight:700;color:var(--text);flex:1}
        .n8n-panel-close{background:none;border:none;cursor:pointer;color:var(--text3);padding:6px;border-radius:8px;transition:all .15s}
        .n8n-panel-close:hover{background:var(--surface3);color:var(--text)}
        .n8n-panel-body{flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth}
        .n8n-panel-body .field{margin-bottom:16px}
        .n8n-panel-body .field>label{font-size:11.5px;font-weight:600;color:var(--text2);display:block;margin-bottom:6px}
        .n8n-panel-body .input{width:100%;font-size:12.5px;transition:border-color .15s,box-shadow .15s}
        .n8n-panel-body .input:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(124,58,237,.1)}
        .n8n-panel-body textarea.input{resize:vertical;min-height:60px}
        .n8n-panel-footer{display:flex;align-items:center;justify-content:space-between;padding:14px 20px;border-top:1px solid var(--border);flex-shrink:0}
        .n8n-zoom-controls{position:absolute;bottom:16px;right:16px;display:flex;flex-direction:column;gap:4px;z-index:5}
        .n8n-zoom-btn{width:34px;height:34px;border-radius:10px;border:1px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:700;transition:all .15s;box-shadow:0 1px 3px rgba(0,0,0,.06)}
        .n8n-zoom-btn:hover{background:var(--surface3);box-shadow:0 2px 6px rgba(0,0,0,.1)}
        .n8n-dirty-bar{display:none;align-items:center;gap:8px;padding:10px 16px;background:linear-gradient(90deg,rgba(124,58,237,.08),rgba(124,58,237,.04));border-top:2px solid rgba(124,58,237,.25)}
        .n8n-dirty-bar.show{display:flex;animation:n8nDirtyPulse 2s ease-in-out 1}
        @keyframes n8nDirtyPulse{0%{background:rgba(124,58,237,.15)}50%{background:rgba(124,58,237,.08)}100%{background:linear-gradient(90deg,rgba(124,58,237,.08),rgba(124,58,237,.04))}}
        .n8n-panel-header .n8n-title-wrap{flex:1;min-width:0}
        .n8n-panel-header .n8n-title-wrap h3{margin:0;font-size:15px;font-weight:700;color:var(--text)}
        .n8n-subtitle{font-size:11px;color:var(--text3);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
        .n8n-section{margin-bottom:20px}
        .n8n-section:last-child{margin-bottom:0}
        .n8n-section-hd{display:flex;align-items:center;justify-content:space-between;cursor:pointer;padding:6px 0;margin-bottom:10px;border-bottom:1px solid var(--border);user-select:none;gap:8px}
        .n8n-section-hd h4{margin:0;font-size:12.5px;font-weight:700;color:var(--text);display:flex;align-items:center;gap:6px}
        .n8n-section-hd .n8n-chv{width:14px;height:14px;transition:transform .2s;color:var(--text3);flex-shrink:0}
        .n8n-section.collapsed .n8n-section-bd{display:none}
        .n8n-section.collapsed .n8n-chv{transform:rotate(-90deg)}
        .n8n-section-ct{font-size:10px;font-weight:600;color:var(--text3);background:var(--surface3);padding:1px 8px;border-radius:10px;white-space:nowrap}
        .n8n-section-bd{padding-top:2px}
        .n8n-sw{position:relative;display:inline-flex;align-items:center;gap:10px;cursor:pointer;font-size:12.5px;font-weight:500;color:var(--text)}
        .n8n-sw input{display:none}
        .n8n-sw-tk{width:36px;height:20px;background:var(--border);border-radius:10px;position:relative;transition:background .2s;flex-shrink:0}
        .n8n-sw-tk:after{content:'';position:absolute;top:2px;left:2px;width:16px;height:16px;background:#fff;border-radius:50%;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.15)}
        .n8n-sw input:checked+.n8n-sw-tk{background:var(--green,#10b981)}
        .n8n-sw input:checked+.n8n-sw-tk:after{transform:translateX(16px)}
        .n8n-info{display:flex;gap:8px;padding:10px 12px;background:rgba(251,191,36,.08);border:1px solid rgba(251,191,36,.2);border-radius:8px;margin-bottom:16px;font-size:11.5px;line-height:1.5;color:var(--text2)}
        .n8n-info svg{flex-shrink:0;width:16px;height:16px;color:#d97706;margin-top:1px}
        .n8n-hint{font-size:11px;color:var(--text3);margin-top:4px;line-height:1.4}
        .n8n-mcard{background:var(--surface3);border:1px solid var(--border);border-radius:10px;padding:12px;margin-bottom:8px;transition:border-color .15s}
        .n8n-mcard:hover{border-color:var(--text3)}
        .n8n-mcard-hd{display:flex;align-items:center;gap:8px;margin-bottom:8px}
        .n8n-mcard-num{width:28px;height:28px;border-radius:8px;background:var(--primary);color:#fff;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;flex-shrink:0}
        .n8n-mcard-hd .input{flex:1}
        .n8n-mcard-resp{margin-top:6px}
        .n8n-mcard-resp textarea.input{min-height:40px;font-size:11.5px}
        .n8n-mcard-ft{display:flex;align-items:center;justify-content:space-between;margin-top:6px;padding-top:6px;border-top:1px dashed var(--border)}
        .n8n-mcard-ft .n8n-sw{font-size:11px}
        .n8n-mcard-ft .input{border-radius:6px;background:var(--surface);font-weight:600}
        .n8n-rcard{background:var(--surface3);border:1px solid var(--border);border-radius:10px;padding:12px 14px;margin-bottom:8px;border-left:3px solid var(--text3);transition:border-color .15s}
        .n8n-rcard:hover{border-color:var(--text2)}
        .n8n-rcard.on{border-left-color:var(--green,#10b981)}
        .n8n-rcard-hd{display:flex;align-items:center;gap:8px}
        .n8n-rcard-dot{width:8px;height:8px;border-radius:50%;background:var(--text3);flex-shrink:0}
        .n8n-rcard.on .n8n-rcard-dot{background:var(--green,#10b981)}
        .n8n-rcard-hd h5{margin:0;font-size:12.5px;font-weight:600;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
        .n8n-rcard-meta{display:flex;align-items:center;gap:6px;margin-top:6px;padding-left:16px;flex-wrap:wrap}
        .n8n-tag{font-size:9.5px;font-weight:600;padding:2px 8px;border-radius:6px;background:var(--surface);border:1px solid var(--border);color:var(--text3);white-space:nowrap}
        .n8n-rcard-act{display:flex;align-items:center;gap:4px;margin-top:8px;padding-top:8px;border-top:1px solid var(--border);justify-content:flex-end}
        .n8n-schrow{display:flex;align-items:center;gap:8px;padding:8px 10px;background:var(--surface3);border-radius:8px;margin-bottom:6px;transition:all .2s;border-left:3px solid var(--green,#10b981)}
        .n8n-schrow.off{opacity:.5;border-left-color:var(--border);background:transparent}
        .n8n-schday{font-size:12px;font-weight:700;color:var(--text);width:32px;flex-shrink:0}
        .n8n-schday-we{color:var(--text3)}
        .n8n-schtimes{display:flex;align-items:center;gap:6px;flex:1}
        .n8n-schtimes .input{width:90px;font-size:11.5px;padding:4px 8px}
        .n8n-schtimes span{font-size:10px;color:var(--text3)}
        .n8n-schquick{display:flex;gap:6px;margin-bottom:10px}
        .n8n-schquick button{font-size:10px;padding:4px 10px;border-radius:6px;background:var(--surface3);border:1px solid var(--border);color:var(--text2);cursor:pointer;transition:all .15s}
        .n8n-schquick button:hover{background:var(--primary);color:#fff;border-color:var(--primary)}
        .n8n-empty{padding:24px 16px;text-align:center;color:var(--text3);font-size:12px;background:var(--surface3);border-radius:8px;border:1.5px dashed var(--border);line-height:1.5}
        .n8n-empty svg{width:28px;height:28px;margin:0 auto 8px;display:block;opacity:.4}
        .n8n-frow{display:flex;gap:12px;flex-wrap:wrap}
        .n8n-frow .field{flex:1;min-width:100px}
        .dark-mode .n8n-wrapper{border-color:var(--border)}
        .dark-mode .n8n-canvas{background-color:var(--bg);background-image:radial-gradient(circle,rgba(255,255,255,.05) .5px,transparent .5px)}
        .dark-mode .n8n-node{background:var(--surface);border-color:var(--border);box-shadow:0 2px 6px rgba(0,0,0,.2),0 4px 16px rgba(0,0,0,.15)}
        .dark-mode .n8n-node:hover{box-shadow:0 4px 12px rgba(0,0,0,.25),0 8px 24px rgba(0,0,0,.2)}
        .dark-mode .n8n-panel{background:var(--surface);border-color:var(--border);box-shadow:-8px 0 32px rgba(0,0,0,.4)}
        .dark-mode .n8n-toolbar{background:var(--surface);border-color:var(--border)}
        .dark-mode .n8n-edge-label-bg{fill:var(--bg);stroke:var(--border)}
        .dark-mode .n8n-panel-overlay.open{background:rgba(0,0,0,.5);backdrop-filter:blur(3px)}
        .dark-mode .n8n-info{background:rgba(251,191,36,.06);border-color:rgba(251,191,36,.12)}
        .dark-mode .n8n-mcard,.dark-mode .n8n-rcard,.dark-mode .n8n-schrow{background:var(--bg);border-color:var(--border)}
        .dark-mode .n8n-sw-tk{background:var(--bg3)}
        .dark-mode .n8n-empty{background:var(--bg);border-color:var(--border)}
        .dark-mode .n8n-tag{background:var(--bg);border-color:var(--border)}
        .dark-mode .n8n-schquick button{background:var(--bg);border-color:var(--border);color:var(--text3)}
        .dark-mode .n8n-port{border-color:rgba(255,255,255,.15);background:var(--surface);box-shadow:0 1px 3px rgba(0,0,0,.2)}
        .dark-mode .n8n-zoom-btn{box-shadow:0 1px 4px rgba(0,0,0,.2)}
        /* --- Node message preview --- */
        .n8n-node-pv{padding:0 14px 12px 14px;overflow:hidden}
        .n8n-pv-bubble{background:rgba(59,130,246,.06);border:1px solid rgba(59,130,246,.12);border-radius:8px 8px 8px 2px;padding:5px 9px;font-size:10px;line-height:1.35;color:var(--text2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
        .n8n-pv-extra{font-size:9px;color:var(--text3);display:block;margin-top:2px}
        .n8n-pv-warn{font-size:9.5px;color:#d97706;display:block}
        /* --- Node health badge --- */
        .n8n-node-st{position:absolute;top:-6px;right:-6px;width:18px;height:18px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;border:2px solid var(--surface);z-index:5}
        .n8n-st-ok{background:#10b981;color:#fff}.n8n-st-warn{background:#f59e0b;color:#fff}
        /* --- Flow stats bar --- */
        .n8n-stats{display:flex;align-items:center;gap:16px;padding:7px 16px;border-bottom:1px solid var(--border);background:var(--surface);font-size:11px;flex-shrink:0;flex-wrap:wrap}
        .n8n-stat{display:flex;align-items:center;gap:5px;color:var(--text2)}.n8n-stat-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0;box-shadow:0 0 0 2px rgba(0,0,0,.06)}.n8n-stat b{font-weight:700;color:var(--text)}.n8n-stat-sep{width:1px;height:14px;background:var(--border)}
        /* --- Hover tooltip --- */
        .n8n-tip{position:fixed;z-index:10000;background:#1e293b;color:#f1f5f9;border-radius:10px;padding:14px;max-width:300px;font-size:12px;line-height:1.5;box-shadow:0 8px 24px rgba(0,0,0,.25);pointer-events:none;animation:n8n-tip-in .15s ease-out;display:none}
        @keyframes n8n-tip-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
        .n8n-tip-hd{display:flex;align-items:center;gap:10px;margin-bottom:10px;padding-bottom:8px;border-bottom:1px solid rgba(255,255,255,.1)}.n8n-tip-hd b{font-size:13px;font-weight:600;display:block}
        .n8n-tip-desc{font-size:10px;color:#94a3b8;margin-top:2px;display:block}
        .n8n-tip-msg{background:rgba(255,255,255,.08);border-radius:8px 8px 8px 2px;padding:8px 10px;margin-bottom:8px;font-size:11px;max-height:100px;overflow-y:auto;white-space:pre-wrap;word-break:break-word;border-left:3px solid #3b82f6}
        .n8n-tip-rules{padding-top:6px}.n8n-tip-rule{display:flex;align-items:center;gap:6px;margin-bottom:3px;font-size:11px}.n8n-tip-rule-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}
        .n8n-tip-warn{padding:6px 10px;background:rgba(251,191,36,.15);border-radius:6px;font-size:11px;color:#fcd34d;margin-top:8px}
        .n8n-tip-label{font-size:9px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:#64748b;margin:8px 0 4px}
        /* --- Dark mode overrides --- */
        .dark-mode .n8n-node-st{border-color:var(--surface)}.dark-mode .n8n-pv-bubble{background:rgba(59,130,246,.12);border-color:rgba(59,130,246,.2)}
        .dark-mode .n8n-stats{background:var(--surface);border-color:var(--border)}
        .dark-mode .n8n-tip{background:#0f172a;box-shadow:0 8px 24px rgba(0,0,0,.4)}
        @media(max-width:1024px){.n8n-toolbar-right .btn{font-size:10px;padding:5px 10px}.n8n-toolbar-right .btn svg{display:none}.n8n-stats{gap:10px;font-size:10.5px}}
        @media(max-width:768px){.n8n-panel{width:100vw;right:-100vw}.n8n-panel.open{right:0}.n8n-node{width:160px}.n8n-v2-canvas .n8n-node{width:180px}.n8n-node-info h4{font-size:10.5px}.n8n-node-hd{padding:10px 10px 6px;gap:8px}.n8n-node-ico{width:28px;height:28px}.n8n-wrapper{height:calc(100vh - 160px);min-height:350px}.n8n-mcard-hd{flex-wrap:wrap}.n8n-schrow{flex-wrap:wrap}.n8n-schtimes{flex-wrap:wrap}.n8n-stats{gap:6px;font-size:10px;padding:5px 12px}.n8n-stat-sep{display:none}.n8n-node-pv{padding:0 10px 8px}.n8n-tip{max-width:240px;font-size:11px}.n8n-node-type-tag{display:none}.n8n-palette{width:150px}.n8n-zoom-controls{bottom:10px;right:10px}.n8n-zoom-btn{width:30px;height:30px;font-size:14px}}
        @media(max-width:480px){.n8n-node{width:140px}.n8n-v2-canvas .n8n-node{width:155px}.n8n-node-info h4{font-size:9.5px}.n8n-node-info span{font-size:8.5px}.n8n-node-ico{width:24px;height:24px}.n8n-node-ico svg{width:12px;height:12px}.n8n-node-hd{padding:8px 8px 5px;gap:6px}.n8n-toolbar{padding:8px 10px;gap:6px}.n8n-toolbar-left>span:last-child{display:none}.n8n-stats{display:none}.n8n-node-pv{display:none}.n8n-wrapper{height:calc(100vh - 120px);min-height:300px}.n8n-port{width:14px;height:14px}}
        /* ==================== SS FLOW ==================== */
        .n8n-palette{position:absolute;left:0;top:0;bottom:0;width:180px;background:var(--surface);border-right:1px solid var(--border);z-index:8;overflow-y:auto;overflow-x:hidden;transition:width .25s cubic-bezier(.16,1,.3,1);display:flex;flex-direction:column}
        .n8n-palette.collapsed{width:40px;overflow:hidden}
        .n8n-palette-toggle{display:flex;align-items:center;justify-content:center;padding:10px;cursor:pointer;border-bottom:1px solid var(--border);background:var(--surface3);transition:background .15s}
        .n8n-palette-toggle:hover{background:var(--surface)}
        .n8n-palette-toggle svg{width:16px;height:16px;color:var(--text2);transition:transform .25s ease}
        .n8n-palette.collapsed .n8n-palette-toggle svg{transform:rotate(180deg)}
        .n8n-palette-cat{padding:10px 12px 4px;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.8px;color:var(--text3)}
        .n8n-palette-item{display:flex;align-items:center;gap:9px;padding:7px 12px;cursor:grab;border-radius:8px;margin:2px 8px;transition:all .15s;font-size:11.5px;font-weight:500;color:var(--text)}
        .n8n-palette-item:hover{background:var(--surface3);transform:translateX(2px)}
        .n8n-palette-item:active{cursor:grabbing;opacity:.7;transform:scale(.96)}
        .n8n-palette-item .n8n-node-ico{width:26px;height:26px;border-radius:7px;flex-shrink:0;box-shadow:0 1px 3px rgba(0,0,0,.08)}
        .n8n-palette.collapsed .n8n-palette-cat{display:none}
        .n8n-palette.collapsed .n8n-palette-item span{display:none}
        .n8n-palette.collapsed .n8n-palette-item{justify-content:center;padding:8px 4px;margin:2px 4px}
        .n8n-conn-line{stroke-width:2.5;stroke-dasharray:8 4;fill:none;pointer-events:none;z-index:10;filter:drop-shadow(0 0 4px rgba(124,58,237,.35));animation:n8nConnDash .4s linear infinite}
        @keyframes n8nConnDash{to{stroke-dashoffset:-12}}
        .n8n-port-hover{background:var(--primary)!important;border-color:var(--primary)!important;box-shadow:0 0 0 5px rgba(124,58,237,.2),0 0 12px rgba(124,58,237,.25);animation:n8nPortPulse .8s ease-in-out infinite alternate}
        @keyframes n8nPortPulse{0%{box-shadow:0 0 0 4px rgba(124,58,237,.15)}100%{box-shadow:0 0 0 6px rgba(124,58,237,.3),0 0 12px rgba(124,58,237,.15)}}
        .n8n-node.selected{border-color:var(--primary);box-shadow:0 0 0 2px rgba(124,58,237,.2),0 4px 16px rgba(124,58,237,.12)}
        .n8n-node-delete{position:absolute;top:-8px;right:-8px;width:20px;height:20px;border-radius:50%;background:#ef4444;color:#fff;border:2px solid var(--surface);cursor:pointer;display:none;align-items:center;justify-content:center;font-size:12px;font-weight:700;z-index:6;line-height:1;transition:transform .1s,background .1s}
        .n8n-node:hover .n8n-node-delete{display:flex}
        .n8n-node-delete:hover{transform:scale(1.15);background:#dc2626}
        .n8n-migrate-banner{display:flex;align-items:center;gap:12px;padding:16px 20px;background:linear-gradient(135deg,rgba(124,58,237,.08),rgba(59,130,246,.08));border:1px solid rgba(124,58,237,.2);border-radius:12px;margin-bottom:16px}
        .n8n-migrate-banner svg{width:24px;height:24px;color:var(--primary);flex-shrink:0}
        .n8n-migrate-banner p{flex:1;font-size:13px;color:var(--text);margin:0;line-height:1.5}
        .n8n-migrate-banner .btn{flex-shrink:0;font-size:12px}
        .n8n-empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--text3);text-align:center;padding:40px}
        .n8n-empty-state svg{width:48px;height:48px;margin-bottom:16px;opacity:.3}
        .n8n-empty-state p{font-size:14px;margin:0 0 8px}
        .n8n-empty-state small{font-size:11px;opacity:.7}
        .n8n-v2-canvas{padding-left:180px}
        .n8n-palette.collapsed+.n8n-v2-canvas{padding-left:40px}
        .dark-mode .n8n-palette{background:var(--surface);border-color:var(--border)}
        .dark-mode .n8n-palette-toggle{background:var(--bg)}
        .dark-mode .n8n-node-delete{border-color:var(--surface)}
        .dark-mode .n8n-migrate-banner{background:linear-gradient(135deg,rgba(124,58,237,.12),rgba(59,130,246,.12));border-color:rgba(124,58,237,.25)}
        @media(max-width:768px){.n8n-palette{width:0;border:none}.n8n-palette.collapsed{width:0}.n8n-v2-canvas{padding-left:0!important}.n8n-palette-toggle{display:none}.n8n-palette-cat,.n8n-palette-item{display:none}.n8n-wrapper{height:calc(100vh - 120px);min-height:400px}.n8n-panel{width:100vw;right:-100vw}.n8n-port{width:14px;height:14px}.n8n-schtimes{flex-wrap:wrap}.n8n-schtimes .input{width:80px}.n8n-node-type-tag{display:none}.n8n-frow{flex-direction:column;gap:8px}}
        @media(max-width:480px){.n8n-palette{width:0;border:none}.n8n-v2-canvas{padding-left:0!important}}
        /* ==================== BOT RULE EDITOR MODAL ==================== */
        .modal.br-modal{max-width:640px;overflow:hidden;display:flex;flex-direction:column;padding:0;border-radius:16px}
        .br-header{display:flex;justify-content:space-between;align-items:flex-start;padding:20px 24px;border-bottom:1px solid var(--border);flex-shrink:0}
        .br-header-left h3{margin:0;font-size:17px;font-weight:700;color:var(--text)}
        .br-header-sub{font-size:11.5px;color:var(--text3);margin-top:3px;display:block}
        .br-header-right{display:flex;align-items:center;gap:12px}
        .br-body{flex:1;overflow-y:auto;padding:20px 24px}
        .br-sec-title{display:flex;align-items:center;gap:6px;font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--text3);margin-bottom:12px}
        .br-sec-title svg{width:14px;height:14px;flex-shrink:0}
        .br-sep{height:1px;background:var(--border);margin:20px 0}
        .br-seg{display:flex;background:var(--surface3);border-radius:8px;padding:3px;gap:2px}
        .br-seg input[type="radio"]{position:absolute;opacity:0;width:0;height:0}
        .br-seg label{flex:1;padding:7px 6px;text-align:center;font-size:11.5px;font-weight:600;border-radius:6px;cursor:pointer;color:var(--text3);transition:all .2s;white-space:nowrap;user-select:none}
        .br-seg label:hover{color:var(--text2)}
        .br-seg input:checked+label{background:var(--surface);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.1)}
        .br-toolbar{display:flex;gap:4px;padding:6px 8px;background:var(--surface3);border:1px solid var(--border);border-bottom:none;border-radius:8px 8px 0 0;flex-wrap:wrap}
        .br-toolbar button{padding:3px 10px;font-size:11px;font-weight:600;background:var(--surface);border:1px solid var(--border);border-radius:5px;cursor:pointer;color:var(--text2);transition:all .15s;font-family:inherit;line-height:1.4}
        .br-toolbar button:hover{background:var(--primary);color:#fff;border-color:var(--primary)}
        .br-var{color:var(--primary);font-weight:700}
        .br-toolbar button:hover .br-var{color:#fff}
        .br-resp-wrap textarea.input{border-radius:0;border-top:none}
        .br-status{display:flex;justify-content:space-between;padding:5px 10px;font-size:10.5px;color:var(--text3);background:var(--surface3);border:1px solid var(--border);border-top:none;border-radius:0 0 8px 8px}
        .br-counter{float:right;font-weight:500;color:var(--text3);font-size:11px}
        .br-opt{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;background:var(--surface3);border:1px solid transparent;border-radius:8px;margin-bottom:6px;cursor:pointer;transition:all .15s}
        .br-opt:hover{background:var(--border)}
        .br-opt input[type="checkbox"]{width:16px;height:16px;margin-top:2px;accent-color:var(--primary);flex-shrink:0}
        .br-opt-text{flex:1}
        .br-opt-title{font-size:12.5px;font-weight:600;color:var(--text)}
        .br-opt-desc{font-size:10.5px;color:var(--text3);margin-top:2px;line-height:1.4}
        .br-preview{margin-top:10px;display:none;background:#e5ddd5;border-radius:8px;padding:12px}
        .br-preview.open{display:block}
        .br-preview-hd{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;font-size:11px;font-weight:600;color:rgba(0,0,0,.45)}
        .br-bubble{background:#dcf8c6;border-radius:8px 8px 0 8px;padding:8px 12px;font-size:12.5px;line-height:1.5;max-width:85%;margin-left:auto;margin-bottom:6px;box-shadow:0 1px 1px rgba(0,0,0,.08);white-space:pre-line;word-wrap:break-word}
        .br-bubble-sep{text-align:center;font-size:10px;color:rgba(0,0,0,.35);margin:4px 0;font-style:italic}
        .br-footer{display:flex;justify-content:flex-end;gap:8px;padding:14px 24px;border-top:1px solid var(--border);flex-shrink:0}
        .dark-mode .modal.br-modal{border:1px solid var(--border)}
        .dark-mode .br-seg{background:var(--bg)}
        .dark-mode .br-seg input:checked+label{background:var(--surface);box-shadow:0 1px 3px rgba(0,0,0,.2)}
        .dark-mode .br-toolbar{background:var(--bg);border-color:var(--border)}
        .dark-mode .br-toolbar button{background:var(--surface);border-color:var(--border)}
        .dark-mode .br-status{background:var(--bg);border-color:var(--border)}
        .dark-mode .br-opt{background:var(--bg)}
        .dark-mode .br-opt:hover{background:var(--surface3)}
        .dark-mode .br-preview{background:#1a1a2e}
        .dark-mode .br-bubble{background:rgba(0,92,75,.3);color:var(--text)}
        .dark-mode .br-bubble-sep{color:var(--text3)}
        .dark-mode .br-preview-hd{color:var(--text3)}
        @media(max-width:640px){.modal.br-modal{max-height:92vh;border-radius:16px 16px 0 0;max-width:100%}.br-header,.br-body,.br-footer{padding-left:16px;padding-right:16px}.br-seg{flex-wrap:wrap}.br-seg label{flex:1 1 calc(33.33% - 2px);font-size:10.5px;padding:6px 4px}.br-footer{position:sticky;bottom:0;background:var(--surface);z-index:1}}
        @media(max-width:400px){.br-seg label{flex:1 1 calc(50% - 2px)}.br-toolbar button{font-size:10px;padding:3px 6px}}

        .tabs {
            display: flex;
            gap: 4px;
            margin-bottom: 28px;
            background: var(--surface3);
            padding: 4px;
            border-radius: 12px
        }

        .tab {
            flex: 1;
            padding: 12px;
            border: none;
            background: none;
            border-radius: 10px;
            font-size: 14px;
            font-weight: 600;
            color: var(--text2);
            cursor: pointer;
            transition: all .2s
        }

        .tab.active {
            background: var(--surface);
            color: var(--primary);
            box-shadow: 0 2px 8px rgba(0, 0, 0, .08)
        }

        .field {
            margin-bottom: 20px
        }

        .field label {
            display: block;
            font-size: 13px;
            font-weight: 600;
            color: var(--text);
            margin-bottom: 8px
        }

        .input {
            width: 100%;
            padding: 14px 16px;
            border: 2px solid var(--border);
            border-radius: 12px;
            font-size: 14px;
            transition: all .2s;
            background: var(--surface)
        }

        .input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(13, 148, 136, .1)
        }

        .textarea {
            width: 100%;
            padding: 14px 16px;
            border: 2px solid var(--border);
            border-radius: 12px;
            font-size: 14px;
            resize: vertical;
            font-family: inherit;
            background: var(--surface)
        }

        .textarea:focus {
            outline: none;
            border-color: var(--primary)
        }

        .btn {
            padding: 14px 24px;
            border: none;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all .2s
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary), var(--purple));
            color: #fff
        }

        .login-card .btn-primary,
        .modal-footer .btn-primary {
            width: 100%
        }

        .btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 24px rgba(124, 58, 237, .35)
        }

        .btn-sm {
            padding: 10px 16px;
            font-size: 13px
        }

        .btn-xs {
            padding: 6px 12px;
            font-size: 11px
        }

        .btn-outline {
            background: none;
            border: 2px solid var(--border);
            color: var(--text2)
        }

        .btn-outline:hover {
            background: var(--surface3)
        }

        .btn-secondary {
            background: var(--surface3);
            color: var(--text);
            border: none
        }

        .btn-secondary:hover {
            background: var(--surface4)
        }

        .btn-danger {
            background: var(--red);
            color: #fff
        }

        .btn-success {
            background: var(--green);
            color: #fff
        }

        .btn-icon {
            width: 32px;
            height: 32px;
            padding: 0;
            border-radius: 8px;
            background: var(--surface3);
            border: none;
            color: var(--text2);
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center
        }

        .btn-icon:hover {
            background: var(--surface4)
        }

        .alert {
            padding: 14px 18px;
            border-radius: 12px;
            font-size: 13px;
            margin-bottom: 20px;
            display: none
        }

        .alert.show {
            display: block
        }

        .alert.error {
            background: #fef2f2;
            color: var(--red);
            border: 1px solid #fecaca
        }

        .alert.success {
            background: #f0fdf4;
            color: var(--green);
            border: 1px solid #bbf7d0
        }

        .app {
            display: none;
            height: 100vh;
            height: 100dvh;
            flex-direction: column
        }

        .app.show {
            display: flex
        }

        .header {
            height: 68px;
            background: var(--bg);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 24px;
            border-bottom: 1px solid var(--bg3)
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 28px
        }

        .header-logo {
            height: 60px;
            margin: -10px 0;
            object-fit: contain
        }

        .header-nav {
            display: flex;
            gap: 4px
        }

        .nav-btn {
            padding: 10px 16px;
            background: none;
            border: none;
            border-radius: 10px;
            color: var(--text3);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all .15s;
            position: relative
        }

        .nav-btn:hover {
            background: var(--bg2);
            color: #fff
        }

        .nav-btn.active {
            background: linear-gradient(135deg, var(--primary), var(--purple));
            color: #fff
        }

        .nav-badge {
            background: var(--red);
            color: #fff;
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 10px;
            font-weight: 700;
            margin-left: 6px
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 12px
        }

        .theme-toggle {
            width: 44px;
            height: 44px;
            background: var(--bg2);
            border: none;
            border-radius: 10px;
            color: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center
        }

        .theme-toggle:hover {
            background: var(--bg3)
        }

        .notif-btn {
            position: relative;
            width: 44px;
            height: 44px;
            background: var(--bg2);
            border: none;
            border-radius: 10px;
            color: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center
        }

        .notif-btn:hover {
            background: var(--bg3)
        }

        .notif-btn .badge {
            position: absolute;
            top: -4px;
            right: -4px;
            background: var(--red);
            color: #fff;
            font-size: 10px;
            min-width: 18px;
            height: 18px;
            border-radius: 10px;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center
        }

        .user-menu {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 6px 12px;
            background: var(--bg2);
            border-radius: 12px;
            cursor: pointer;
            border: none
        }

        .user-menu:hover {
            background: var(--bg3)
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            background: linear-gradient(135deg, var(--purple), var(--primary));
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 13px;
            color: #fff;
            overflow: hidden
        }

        .user-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover
        }

        .user-info {
            text-align: left
        }

        .user-name {
            color: #fff;
            font-size: 13px;
            font-weight: 600
        }

        .user-role {
            color: var(--text3);
            font-size: 10px;
            text-transform: uppercase
        }

        .user-menu-wrapper {
            position: relative
        }

        .user-dropdown {
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            min-width: 240px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 14px;
            box-shadow: 0 12px 40px rgba(0,0,0,.2);
            z-index: 9999;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-8px) scale(.97);
            transition: all .2s cubic-bezier(.4,0,.2,1);
            overflow: hidden
        }

        .user-dropdown.open {
            opacity: 1;
            visibility: visible;
            transform: translateY(0) scale(1)
        }

        .user-dropdown-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px;
            background: var(--surface3)
        }

        .user-dropdown-divider {
            height: 1px;
            background: var(--border);
            margin: 0
        }

        .user-dropdown-item {
            display: flex;
            align-items: center;
            gap: 12px;
            width: 100%;
            padding: 12px 16px;
            border: none;
            background: none;
            color: var(--text);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: background .15s
        }

        .user-dropdown-item:hover {
            background: var(--surface3)
        }

        .user-dropdown-item svg {
            color: var(--text3);
            flex-shrink: 0
        }

        .user-dropdown-logout {
            color: #ef4444
        }

        .user-dropdown-logout svg {
            color: #ef4444
        }

        .user-dropdown-logout:hover {
            background: #ef444415
        }

        .main {
            display: flex;
            flex: 1;
            overflow: hidden
        }

        .page {
            flex: 1;
            display: none;
            overflow: hidden
        }

        .page.active {
            display: flex
        }

        .sidebar {
            width: 320px;
            background: var(--bg2);
            display: flex;
            flex-direction: column;
            border-right: 1px solid var(--bg3)
        }

        .sidebar-header {
            padding: 20px;
            border-bottom: 1px solid var(--bg3)
        }

        .sidebar-header h2 {
            font-size: 16px;
            font-weight: 700;
            color: #fff;
            margin-bottom: 14px
        }

        .sidebar-list {
            flex: 1;
            overflow-y: auto;
            padding: 12px
        }

        .inst-card {
            background: var(--bg);
            border-radius: 14px;
            padding: 16px;
            margin-bottom: 10px;
            cursor: pointer;
            border: 2px solid transparent;
            transition: all .15s
        }

        .inst-card:hover {
            border-color: var(--bg4)
        }

        .inst-card.active {
            border-color: var(--primary);
            background: rgba(13, 148, 136, .08)
        }

        .inst-top {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 12px
        }

        .inst-avatar {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 16px;
            color: #fff;
            overflow: hidden;
            flex-shrink: 0
        }

        .inst-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover
        }

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

        .inst-name {
            font-weight: 600;
            font-size: 14px;
            color: #fff;
            margin-bottom: 2px
        }

        .inst-phone {
            font-size: 11px;
            color: var(--text3)
        }

        .status-badge {
            font-size: 9px;
            padding: 4px 10px;
            border-radius: 6px;
            font-weight: 700;
            text-transform: uppercase
        }

        .status-badge.online {
            background: rgba(5, 150, 105, .2);
            color: #34d399
        }

        .status-badge.qr {
            background: rgba(217, 119, 6, .2);
            color: #fbbf24
        }

        .status-badge.connecting {
            background: rgba(13, 148, 136, .2);
            color: #5eead4
        }

        .status-badge.offline {
            background: rgba(220, 38, 38, .2);
            color: #f87171
        }

        .inst-qr {
            margin: 14px 0;
            text-align: center;
            background: #fff;
            border-radius: 10px;
            padding: 16px
        }

        .inst-qr img {
            width: 160px;
            height: 160px
        }

        .inst-stats {
            display: flex;
            gap: 14px;
            margin-bottom: 12px;
            font-size: 11px;
            color: var(--text3)
        }

        .inst-auto {
            font-size: 10px;
            padding: 4px 10px;
            border-radius: 6px;
            margin-bottom: 12px;
            display: inline-block
        }

        .inst-auto.on {
            background: rgba(5, 150, 105, .2);
            color: #34d399
        }

        .inst-auto.off {
            background: rgba(107, 114, 128, .2);
            color: #9ca3af
        }

        .inst-actions {
            display: flex;
            gap: 6px;
            flex-wrap: wrap
        }

        .inst-actions button {
            flex: 1;
            min-width: 65px;
            padding: 8px;
            border: none;
            border-radius: 8px;
            font-size: 10px;
            font-weight: 600;
            cursor: pointer;
            background: var(--bg2);
            color: #fff;
            transition: all .15s
        }

        .inst-actions button:hover {
            background: var(--bg3)
        }

        .inst-actions button.purple {
            background: var(--purple)
        }

        .conv-panel {
            width: 360px;
            background: var(--surface2);
            display: flex;
            flex-direction: column;
            border-right: 1px solid var(--border)
        }

        .conv-header {
            padding: 18px 20px;
            background: var(--surface);
            border-bottom: 1px solid var(--border)
        }

        .conv-header h2 {
            font-size: 16px;
            font-weight: 700;
            margin-bottom: 2px
        }

        .conv-header p {
            font-size: 12px;
            color: var(--primary);
            font-weight: 600
        }

        .conv-tools {
            padding: 12px;
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            display: flex;
            gap: 10px;
            flex-wrap: wrap
        }

        .search-box {
            flex: 1;
            position: relative;
            min-width: 150px
        }

        .search-box input {
            width: 100%;
            padding: 10px 14px;
            background: var(--surface3);
            border: none;
            border-radius: 10px;
            font-size: 13px
        }

        .search-box input:focus {
            outline: 2px solid var(--primary)
        }

        .btn-bulk {
            padding: 10px 14px;
            background: linear-gradient(135deg, var(--purple), var(--primary));
            color: #fff;
            border: none;
            border-radius: 10px;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            white-space: nowrap
        }

        .btn-new-conv {
            width: 38px;
            height: 38px;
            background: linear-gradient(135deg, #16a34a, #22c55e);
            color: #fff;
            border: none;
            border-radius: 10px;
            font-size: 20px;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0
        }

        .filter-bar {
            padding: 8px 12px;
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            display: flex;
            gap: 6px;
            flex-wrap: wrap
        }

        .filter-btn {
            padding: 6px 14px;
            background: var(--surface3);
            border: none;
            border-radius: 8px;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            color: var(--text2)
        }

        .filter-btn:hover {
            background: var(--border)
        }

        .filter-btn.active {
            background: var(--primary);
            color: #fff
        }

        .conv-wait-badge {
            display: inline-block;
            padding: 1px 6px;
            border-radius: 4px;
            font-size: 9px;
            font-weight: 600;
            margin-right: 4px;
            white-space: nowrap
        }
        .conv-wait-badge.normal { background: rgba(5,150,105,.15); color: #059669; border: 1px solid rgba(5,150,105,.3) }
        .conv-wait-badge.warning { background: rgba(217,119,6,.15); color: #d97706; border: 1px solid rgba(217,119,6,.3) }
        .conv-wait-badge.urgent { background: rgba(239,68,68,.15); color: #ef4444; border: 1px solid rgba(239,68,68,.3) }

        .conv-list {
            flex: 1;
            overflow-y: auto;
            padding: 12px
        }

        .conv-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px;
            cursor: pointer;
            background: var(--surface);
            margin-bottom: 8px;
            border-radius: 14px;
            border: 2px solid transparent;
            transition: all .15s;
            position: relative
        }

        .conv-item:hover {
            border-color: var(--border2)
        }

        .conv-item.active {
            border-color: var(--primary);
            background: rgba(13, 148, 136, .04)
        }

        .conv-item.unread {
            border-left: 4px solid var(--primary)
        }

        .conv-avatar {
            width: 46px;
            height: 46px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--purple), var(--primary));
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-weight: 700;
            font-size: 18px;
            flex-shrink: 0;
            overflow: hidden;
            position: relative
        }

        .conv-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover
        }

        .unread-badge {
            position: absolute;
            top: -2px;
            right: -2px;
            background: var(--red);
            color: #fff;
            font-size: 9px;
            min-width: 18px;
            height: 18px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            border: 2px solid var(--surface)
        }

        .conv-body {
            flex: 1;
            min-width: 0
        }

        .conv-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 3px
        }

        .conv-name {
            font-weight: 600;
            font-size: 14px
        }

        .conv-time {
            font-size: 10px;
            color: var(--text3)
        }

        .conv-phone {
            font-size: 11px;
            color: var(--primary);
            font-weight: 600;
            margin-bottom: 4px
        }

        .conv-preview {
            font-size: 12px;
            color: var(--text2);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis
        }

        .conv-labels {
            display: flex;
            gap: 4px;
            margin-top: 6px;
            flex-wrap: wrap
        }

        .label-tag {
            font-size: 9px;
            padding: 2px 6px;
            border-radius: 4px;
            font-weight: 600
        }

        .label-tag.red {
            background: #fef2f2;
            color: var(--red)
        }

        .label-tag.green {
            background: #f0fdf4;
            color: var(--green)
        }

        .label-tag.blue {
            background: #eff6ff;
            color: var(--blue)
        }

        .label-tag.yellow {
            background: #fefce8;
            color: var(--yellow)
        }

        .label-tag.purple {
            background: #faf5ff;
            color: var(--purple)
        }

        .label-tag.orange {
            background: #fff7ed;
            color: var(--orange)
        }

        .label-tag.pink {
            background: #fdf2f8;
            color: var(--pink)
        }

        .label-tag.cyan {
            background: #ecfeff;
            color: var(--cyan)
        }

        /* Respostas Rápidas */
        .qr-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 12px;
            margin-bottom: 20px;
            flex-wrap: wrap
        }
        .qr-header h3 { margin: 0; font-size: 15px }
        .qr-header-sub {
            font-size: 12px;
            color: var(--text3);
            margin: 3px 0 0;
            line-height: 1.4
        }
        .qr-search {
            display: flex;
            gap: 8px;
            margin-bottom: 16px
        }
        .qr-search-input {
            flex: 1;
            padding: 8px 14px;
            border: 1.5px solid var(--border);
            border-radius: 10px;
            font-size: 12px;
            background: var(--surface);
            color: var(--text);
            outline: none;
            transition: border-color .15s
        }
        .qr-search-input:focus { border-color: var(--primary) }
        .qr-search-input::placeholder { color: var(--text3) }
        .qr-list { display: flex; flex-direction: column; gap: 8px }
        .qr-card {
            display: grid;
            grid-template-columns: auto 1fr auto;
            gap: 14px;
            align-items: start;
            padding: 14px 16px;
            background: var(--surface3);
            border-radius: 12px;
            border: 1px solid transparent;
            transition: border-color .15s
        }
        .qr-card:hover { border-color: var(--border) }
        .qr-shortcut {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: var(--primary);
            color: #fff;
            padding: 4px 10px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            font-family: monospace;
            white-space: nowrap;
            margin-top: 1px
        }
        .qr-shortcut svg { opacity: .7 }
        .qr-body { min-width: 0 }
        .qr-text {
            font-size: 13px;
            color: var(--text);
            line-height: 1.5;
            margin: 0;
            white-space: pre-wrap;
            word-break: break-word;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden
        }
        .qr-meta {
            display: flex;
            gap: 8px;
            margin-top: 6px;
            align-items: center;
            flex-wrap: wrap
        }
        .qr-category {
            font-size: 10px;
            background: var(--surface);
            border: 1px solid var(--border);
            padding: 2px 8px;
            border-radius: 6px;
            color: var(--text3);
            font-weight: 500
        }
        .qr-chars {
            font-size: 10px;
            color: var(--text3)
        }
        .qr-actions {
            display: flex;
            gap: 4px;
            flex-shrink: 0;
            opacity: 0;
            transition: opacity .15s
        }
        .qr-card:hover .qr-actions { opacity: 1 }
        .qr-empty {
            text-align: center;
            padding: 44px 20px;
            color: var(--text3)
        }
        .qr-empty svg { margin: 0 auto 14px; opacity: .3 }
        .qr-empty p { margin: 0; line-height: 1.6 }
        @media(max-width:640px) {
            .qr-card {
                grid-template-columns: 1fr;
                gap: 8px
            }
            .qr-shortcut { align-self: flex-start }
            .qr-actions { opacity: 1; justify-content: flex-end }
        }

        /* Mensagens Agendadas */
        .sch-list { display:flex; flex-direction:column; gap:1px; background:var(--border); border-radius:10px; overflow:hidden }
        .sch-item {
            display:flex; align-items:center; gap:14px; padding:12px 14px;
            background:var(--surface); transition:background .12s;
        }
        .sch-item:hover { background:var(--surface3) }
        .sch-item:hover .sch-del { opacity:1 }
        .sch-time {
            flex-shrink:0; width:52px; text-align:center; line-height:1.2;
        }
        .sch-time-h { font-size:15px; font-weight:700; color:var(--text) }
        .sch-time-d { font-size:10px; color:var(--text3); margin-top:1px }
        .sch-body { flex:1; min-width:0 }
        .sch-phone { font-size:13px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
        .sch-msg { font-size:12px; color:var(--text3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px }
        .sch-pill {
            flex-shrink:0; font-size:10px; font-weight:600; padding:3px 8px;
            border-radius:5px; letter-spacing:.3px;
        }
        .sch-pill.pending { background:var(--primary); color:#fff }
        .sch-pill.past { background:var(--surface3); color:var(--text3) }
        .sch-del {
            flex-shrink:0; width:28px; height:28px; border-radius:6px; border:none;
            background:transparent; color:var(--text3); cursor:pointer;
            display:flex; align-items:center; justify-content:center;
            opacity:0; transition:all .12s;
        }
        .sch-del:hover { background:var(--red); color:#fff }
        .sch-empty {
            display:flex; flex-direction:column; align-items:center; justify-content:center;
            padding:40px 20px; text-align:center; color:var(--text3);
        }
        @media(max-width:640px) {
            .sch-del { opacity:1 }
            .sch-pill { display:none }
        }

        /* Modelos de Mensagem */
        .tpl-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 10px
        }
        .tpl-card {
            background: var(--surface3);
            border-radius: 12px;
            padding: 16px;
            border: 1px solid transparent;
            transition: border-color .15s, box-shadow .15s;
            display: flex;
            flex-direction: column;
            position: relative
        }
        .tpl-card:hover {
            border-color: var(--border);
            box-shadow: 0 2px 8px rgba(0,0,0,.05)
        }
        .tpl-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 8px;
            margin-bottom: 10px
        }
        .tpl-name {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: 600;
            color: var(--text);
            min-width: 0
        }
        .tpl-name-icon {
            width: 30px;
            height: 30px;
            border-radius: 8px;
            background: var(--primary);
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-size: 13px;
            font-weight: 700
        }
        .tpl-name span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap
        }
        .tpl-actions {
            display: flex;
            gap: 4px;
            flex-shrink: 0;
            opacity: 0;
            transition: opacity .15s
        }
        .tpl-card:hover .tpl-actions { opacity: 1 }
        .tpl-text {
            font-size: 12px;
            color: var(--text2);
            line-height: 1.5;
            margin: 0;
            white-space: pre-wrap;
            word-break: break-word;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
            flex: 1
        }
        .tpl-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid var(--border);
            font-size: 10px;
            color: var(--text3)
        }
        .tpl-var-tag {
            background: var(--surface);
            border: 1px solid var(--border);
            padding: 1px 6px;
            border-radius: 4px;
            font-family: monospace;
            font-size: 10px
        }
        .tpl-tip {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 14px;
            background: var(--surface3);
            border-radius: 10px;
            border-left: 3px solid var(--primary);
            font-size: 12px;
            color: var(--text3);
            margin-bottom: 16px
        }
        .tpl-tip svg { flex-shrink: 0; color: var(--primary) }
        .tpl-empty {
            text-align: center;
            padding: 44px 20px;
            color: var(--text3)
        }
        .tpl-empty svg { margin: 0 auto 14px; opacity: .3 }
        .tpl-empty p { margin: 0; line-height: 1.6 }
        @media(max-width:640px) {
            .tpl-grid { grid-template-columns: 1fr }
            .tpl-card { padding: 14px }
            .tpl-actions { opacity: 1 }
        }

        /* Etiquetas - Settings */
        .labels-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px
        }
        .labels-header h3 { margin: 0; font-size: 15px }
        .labels-count {
            font-size: 11px;
            color: var(--text3);
            font-weight: 400;
            margin-left: 6px;
            background: var(--surface3);
            padding: 2px 8px;
            border-radius: 10px
        }
        .lbl-add-btn {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 6px 16px;
            font-size: 12px;
            font-weight: 500;
            color: var(--primary);
            background: none;
            border: 1.5px solid var(--primary);
            border-radius: 8px;
            cursor: pointer;
            transition: background .15s, color .15s
        }
        .lbl-add-btn:hover {
            background: var(--primary);
            color: #fff
        }
        .labels-grid {
            display: flex;
            flex-direction: column;
            gap: 6px
        }
        .label-card {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 14px;
            background: var(--surface3);
            border-radius: 10px;
            border: 1px solid transparent;
            transition: border-color .15s, background .15s
        }
        .label-card:hover {
            border-color: var(--border);
            background: var(--surface2)
        }
        .label-card .lc-badge {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 4px 12px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            white-space: nowrap
        }
        .label-card .lc-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0
        }
        .label-card .lc-spacer { flex: 1 }
        .label-card .lc-actions {
            display: flex;
            gap: 4px;
            align-items: center;
            flex-shrink: 0;
            opacity: 0;
            transition: opacity .15s
        }
        .label-card:hover .lc-actions { opacity: 1 }
        .lc-icon-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border-radius: 6px;
            border: none;
            cursor: pointer;
            background: var(--surface);
            color: var(--text3);
            transition: background .15s, color .15s
        }
        .lc-icon-btn:hover { background: var(--border); color: var(--text) }
        .lc-icon-btn.lc-del:hover { background: #fee2e2; color: #dc2626 }
        .label-card .lc-color {
            width: 28px;
            height: 28px;
            border: none;
            cursor: pointer;
            border-radius: 6px;
            background: transparent;
            padding: 0;
            flex-shrink: 0;
            opacity: 0;
            transition: opacity .15s
        }
        .label-card:hover .lc-color { opacity: 1 }
        .labels-empty {
            text-align: center;
            padding: 48px 20px;
            color: var(--text3)
        }
        .labels-empty svg {
            margin: 0 auto 16px;
            opacity: .3
        }
        .labels-empty p { margin: 0; line-height: 1.6 }
        @media(max-width:640px) {
            .label-card .lc-actions { opacity: 1 }
            .label-card .lc-color { opacity: 1 }
            .label-card { padding: 10px 12px }
            .label-card .lc-badge { padding: 4px 10px; font-size: 11px }
        }
        .dark-mode .lc-icon-btn { background: var(--surface3) }
        .dark-mode .lc-icon-btn:hover { background: var(--border) }
        .dark-mode .lc-icon-btn.lc-del:hover { background: rgba(220,38,38,.2); color: #f87171 }

        .chat-panel {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: var(--surface3)
        }

        .chat-header {
            background: var(--surface);
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 14px
        }

        .chat-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--purple), var(--primary));
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-weight: 700;
            font-size: 18px;
            overflow: hidden
        }

        .chat-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover
        }

        .chat-info {
            flex: 1
        }

        .chat-info h3 {
            font-size: 15px;
            font-weight: 700;
            cursor: pointer
        }

        .chat-info h3:hover {
            color: var(--primary)
        }

        .chat-info p {
            font-size: 12px;
            color: var(--primary);
            margin-top: 1px
        }

        .chat-actions {
            display: flex;
            gap: 6px
        }

        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 20px
        }

        .msg {
            max-width: 70%;
            padding: 12px 16px;
            border-radius: 18px;
            margin-bottom: 10px;
            position: relative
        }

        .msg:hover .msg-reply-btn {
            display: flex !important
        }

        .msg.in {
            margin-right: auto;
            background: var(--surface);
            border-bottom-left-radius: 4px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, .04)
        }

        .msg.out {
            margin-left: auto;
            background: linear-gradient(135deg, var(--primary), var(--primary2));
            color: #fff;
            border-bottom-right-radius: 4px
        }

        .msg-text {
            font-size: 13px;
            line-height: 1.5;
            white-space: pre-wrap;
            word-wrap: break-word
        }

        .msg-media img {
            max-width: 100%;
            max-height: 280px;
            border-radius: 10px;
            cursor: pointer;
            margin-bottom: 8px
        }

        .msg-media video {
            max-width: 100%;
            max-height: 280px;
            border-radius: 10px
        }

        .msg-media .doc-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 14px;
            background: var(--surface3);
            border-radius: 10px;
            color: var(--text);
            text-decoration: none;
            font-size: 13px
        }

        .msg-media .doc-link:hover {
            background: var(--bg3)
        }

        .msg-time {
            font-size: 9px;
            opacity: .7;
            margin-top: 6px;
            text-align: right
        }

        .typing-indicator {
            display: none;
            align-items: center;
            gap: 4px;
            padding: 8px 16px;
            font-size: 12px;
            color: var(--text3);
            background: var(--surface2);
            border-top: 1px solid var(--border)
        }
        .typing-indicator.active { display: flex }
        .typing-indicator .dots { display: flex; gap: 3px; margin-right: 6px }
        .typing-indicator .dots span {
            width: 6px; height: 6px; border-radius: 50%;
            background: var(--text3); animation: typingBounce 1.4s infinite ease-in-out
        }
        .typing-indicator .dots span:nth-child(2) { animation-delay: .2s }
        .typing-indicator .dots span:nth-child(3) { animation-delay: .4s }
        @keyframes typingBounce {
            0%, 80%, 100% { transform: scale(0.6); opacity: .4 }
            40% { transform: scale(1); opacity: 1 }
        }

        .chat-footer {
            background: var(--surface);
            border-top: 1px solid var(--border);
            padding: 16px 20px
        }

        .quick-replies {
            display: flex;
            gap: 6px;
            margin-bottom: 12px;
            flex-wrap: wrap
        }

        .quick-reply-btn {
            padding: 6px 12px;
            background: var(--surface3);
            border: 1px solid var(--border);
            border-radius: 16px;
            font-size: 11px;
            cursor: pointer;
            color: var(--text2);
            transition: all .15s
        }

        .quick-reply-btn:hover {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary)
        }

        .signature {
            font-size: 12px;
            color: var(--text2);
            margin-bottom: 12px;
            padding: 10px 14px;
            background: var(--surface3);
            border-radius: 10px
        }

        .signature strong {
            color: var(--primary)
        }

        .input-row {
            display: flex;
            gap: 8px;
            align-items: flex-end
        }

        .chat-input {
            flex: 1;
            padding: 10px 18px;
            border: 2px solid var(--border);
            border-radius: 20px;
            font-size: 13px;
            background: var(--surface);
            resize: none;
            min-height: 42px;
            max-height: 140px;
            line-height: 1.4;
            font-family: inherit;
            overflow-y: auto
        }

        .chat-input:focus {
            outline: none;
            border-color: var(--primary)
        }

        .send-btn {
            width: 46px;
            height: 46px;
            border: none;
            background: linear-gradient(135deg, var(--purple), var(--primary));
            color: #fff;
            border-radius: 50%;
            cursor: pointer;
            font-size: 18px
        }

        .chat-empty {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            color: var(--text3)
        }

        .chat-empty .icon {
            font-size: 48px;
            margin-bottom: 12px;
            opacity: .4
        }

        .dashboard-page {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: var(--surface2);
            overflow: auto;
            padding: 24px;
            gap: 20px;
        }

        .dashboard-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .dashboard-header h1 {
            font-size: 22px;
            font-weight: 700;
            margin-bottom: 0
        }

        .dashboard-header p {
            color: var(--text3);
            font-size: 13px;
            margin-top: 2px
        }

        .dash-date {
            font-size: 12px;
            color: var(--text3);
            background: var(--surface);
            padding: 6px 12px;
            border-radius: 8px;
            border: 1px solid var(--border);
            white-space: nowrap;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
        }

        .stat-card {
            background: var(--surface);
            border-radius: 12px;
            padding: 16px 18px;
            border: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 14px;
            transition: border-color .15s;
        }

        .stat-card:hover { border-color: var(--text3) }

        .stat-card .st-icon {
            width: 42px;
            height: 42px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .stat-card .st-icon.green { background: rgba(5,150,105,.1); color: var(--green) }
        .stat-card .st-icon.blue { background: rgba(37,99,235,.1); color: var(--blue) }
        .stat-card .st-icon.purple { background: rgba(124,58,237,.1); color: var(--purple) }
        .stat-card .st-icon.yellow { background: rgba(217,119,6,.1); color: var(--yellow) }

        .stat-card .st-info { min-width: 0 }

        .stat-card .label {
            font-size: 11px;
            color: var(--text3);
            text-transform: uppercase;
            letter-spacing: .3px;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .stat-card .value {
            font-size: 24px;
            font-weight: 700;
            line-height: 1.2;
            margin-top: 2px;
        }

        .charts-row {
            display: grid;
            grid-template-columns: 3fr 2fr;
            gap: 12px
        }

        .chart-card {
            background: var(--surface);
            border-radius: 12px;
            padding: 18px;
            border: 1px solid var(--border)
        }

        .chart-card h3 {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 14px;
            color: var(--text2)
        }

        .chart-placeholder {
            height: 180px;
            background: var(--surface3);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text3);
            font-size: 12px;
            padding: 14px 10px 6px;
            box-sizing: border-box
        }

        .chart-placeholder.has-data {
            background: transparent;
            align-items: stretch;
            justify-content: stretch;
            padding: 0 0 0
        }

        .chart-wrap {
            display: flex;
            flex-direction: column;
            width: 100%;
            height: 100%;
            gap: 0
        }

        .chart-bars {
            display: flex;
            align-items: flex-end;
            gap: 4px;
            flex: 1;
            min-height: 0;
            padding-bottom: 4px
        }

        .chart-col {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 3px;
            height: 100%;
            justify-content: flex-end;
            min-width: 0
        }

        .chart-val {
            font-size: 9px;
            font-weight: 600;
            color: var(--text3);
            line-height: 1
        }

        .chart-bar {
            width: 100%;
            border-radius: 3px 3px 0 0;
            min-height: 2px;
            transition: all .15s;
            background: var(--primary);
            opacity: .7
        }

        .chart-col:hover .chart-bar {
            opacity: 1
        }

        .chart-col:hover .chart-val {
            color: var(--primary)
        }

        .chart-labels {
            display: flex;
            gap: 4px;
            border-top: 1px solid var(--border);
            padding-top: 5px
        }

        .chart-lbl {
            flex: 1;
            text-align: center;
            font-size: 9px;
            color: var(--text3);
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis
        }

        @media(max-width:900px) {
            .stats-grid { grid-template-columns: repeat(2, 1fr) }
        }

        @media(max-width:520px) {
            .stats-grid { grid-template-columns: 1fr }
            .stat-card .value { font-size: 20px }
            .stat-card .st-icon { width: 36px; height: 36px }
            .dash-date { display: none }
        }

        .tickets-page {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: var(--surface2);
            overflow: hidden
        }

        .tickets-header {
            padding: 16px 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .tickets-header h1 {
            font-size: 20px;
            font-weight: 700
        }

        .tickets-header p {
            font-size: 12px; color: var(--text3); margin-top: 2px
        }

        .tk-filters {
            display: flex;
            gap: 8px;
            padding: 10px 24px;
            align-items: center;
        }
        .tk-search-wrap {
            flex: 1;
            position: relative;
            display: flex;
            align-items: center;
        }
        .tk-search-wrap svg {
            position: absolute;
            left: 12px;
            color: var(--text3);
            pointer-events: none;
        }
        .tk-search {
            width: 100%;
            padding: 8px 12px 8px 34px;
            border: 1.5px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            color: var(--text);
            font-size: 12px;
            outline: none;
            transition: border-color .15s;
        }
        .tk-search:focus { border-color: var(--primary) }
        .tk-search::placeholder { color: var(--text3) }
        .tk-filter-select {
            padding: 8px 28px 8px 10px;
            border: 1.5px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            color: var(--text);
            font-size: 12px;
            outline: none;
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 8px center;
            transition: border-color .15s;
            white-space: nowrap;
        }
        .tk-filter-select:focus { border-color: var(--primary) }

        /* Kanban board */
        .tk-kanban {
            flex: 1;
            display: flex;
            gap: 12px;
            padding: 0 24px 16px;
            overflow-x: auto;
            overflow-y: hidden;
            min-height: 0;
        }
        .tk-column {
            flex: 1;
            min-width: 260px;
            max-width: 400px;
            display: flex;
            flex-direction: column;
            background: var(--surface2);
            border-radius: 12px;
            overflow: hidden;
            border: 1px solid var(--border);
        }
        .tk-col-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 14px;
            font-size: 12px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: .4px;
            border-bottom: 1px solid var(--border);
            flex-shrink: 0;
        }
        .tk-col-header span:first-of-type { flex: 1 }
        .tk-col-pending { color: var(--yellow); border-top: 3px solid var(--yellow) }
        .tk-col-progress { color: var(--blue); border-top: 3px solid var(--blue) }
        .tk-col-resolved { color: var(--green); border-top: 3px solid var(--green) }
        .tk-col-count {
            font-size: 10px;
            font-weight: 700;
            background: var(--surface3);
            padding: 2px 7px;
            border-radius: 8px;
            min-width: 20px;
            text-align: center;
            color: var(--text3);
        }
        .tk-col-cards {
            flex: 1;
            overflow-y: auto;
            padding: 8px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .tk-col-empty {
            text-align: center;
            color: var(--text3);
            font-size: 12px;
            padding: 30px 10px;
            opacity: .6;
        }

        /* Kanban card */
        .tk-card {
            background: var(--surface);
            border-radius: 10px;
            padding: 12px;
            cursor: pointer;
            transition: all .15s;
            border: 1px solid var(--border);
            position: relative;
        }
        .tk-card:hover {
            border-color: var(--primary);
            box-shadow: 0 2px 8px rgba(0,0,0,.08);
            transform: translateY(-1px);
        }
        .tk-card-top {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 6px;
        }
        .tk-card-num {
            font-size: 10px;
            color: var(--primary);
            font-weight: 700;
            font-variant-numeric: tabular-nums;
        }
        .tk-card-title {
            font-size: 13px;
            font-weight: 600;
            line-height: 1.3;
            margin-bottom: 6px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .tk-card-meta {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }
        .tk-card-cat {
            font-size: 10px;
            color: var(--text3);
            background: var(--surface3);
            padding: 2px 7px;
            border-radius: 4px;
        }
        .tk-card-user {
            font-size: 10px;
            color: var(--text3);
            margin-left: auto;
        }
        .tk-card-date {
            font-size: 10px;
            color: var(--text3);
        }

        .ticket-priority {
            padding: 2px 6px;
            border-radius: 4px;
            font-weight: 600;
            font-size: 9px;
            text-transform: uppercase;
            letter-spacing: .3px;
            white-space: nowrap;
        }
        .ticket-priority.low { background: rgba(5,150,105,.1); color: var(--green) }
        .ticket-priority.normal { background: rgba(37,99,235,.1); color: var(--blue) }
        .ticket-priority.high { background: rgba(217,119,6,.1); color: var(--yellow) }
        .ticket-priority.urgent { background: rgba(220,38,38,.1); color: var(--red) }
        .dark-mode .ticket-priority.low { background: rgba(5,150,105,.15) }
        .dark-mode .ticket-priority.normal { background: rgba(37,99,235,.15) }
        .dark-mode .ticket-priority.high { background: rgba(217,119,6,.15) }
        .dark-mode .ticket-priority.urgent { background: rgba(220,38,38,.15) }

        /* Drag and drop */
        .tk-card.dragging { opacity: .4; transform: scale(.96) }
        .tk-col-cards.drag-over {
            background: var(--primary-alpha, rgba(37,99,235,.06));
            outline: 2px dashed var(--primary);
            outline-offset: -2px;
            border-radius: 8px;
        }

        @media(max-width:640px) {
            .tickets-header { padding: 14px 16px }
            .tk-filters { padding: 8px 16px; flex-wrap: wrap }
            .tk-search-wrap { min-width: 100% }
            .tk-filter-select { flex: 1; min-width: 0 }
            .tk-kanban { padding: 0 16px 12px; gap: 10px }
            .tk-column { min-width: 220px }
        }

        .admin-page {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: var(--surface2);
            overflow: auto
        }

        .admin-header {
            padding: 20px 24px;
            background: var(--surface);
            border-bottom: 1px solid var(--border)
        }

        .admin-header h1 {
            font-size: 22px;
            font-weight: 700;
            margin-bottom: 4px
        }

        .admin-header p {
            color: var(--text3);
            font-size: 13px
        }

        .admin-tabs {
            display: flex;
            gap: 6px 4px;
            padding: 12px 24px 14px;
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            flex-wrap: wrap;
            align-items: center
        }

        .admin-tabs .tab-sep {
            width: 1px;
            height: 22px;
            background: var(--border);
            margin: 0 6px;
            flex-shrink: 0
        }

        .admin-tabs button {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 14px;
            background: none;
            border: 1.5px solid transparent;
            border-radius: 8px;
            font-size: 12.5px;
            font-weight: 600;
            cursor: pointer;
            color: var(--text3);
            transition: all .15s;
            white-space: nowrap
        }

        .admin-tabs button svg {
            width: 15px;
            height: 15px;
            flex-shrink: 0;
            opacity: .6
        }

        .admin-tabs button:hover {
            color: var(--text);
            background: var(--surface3)
        }

        .admin-tabs button.active {
            background: var(--primary);
            background: linear-gradient(135deg, rgba(13,148,136,.1), rgba(124,58,237,.08));
            border-color: var(--primary);
            color: var(--primary)
        }

        .admin-tabs button.active svg {
            opacity: 1
        }

        .dark-mode .admin-tabs button.active {
            background: linear-gradient(135deg, rgba(13,148,136,.18), rgba(124,58,237,.12));
            border-color: var(--primary)
        }

        .admin-content {
            flex: 1;
            padding: 24px
        }

        .admin-section {
            display: none
        }

        .admin-section.active {
            display: block
        }

        .admin-card {
            background: var(--surface);
            border-radius: 14px;
            padding: 20px;
            margin-bottom: 16px;
            border: 1px solid var(--border)
        }

        .admin-card h3 {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 16px
        }

        .admin-table {
            width: 100%;
            border-collapse: collapse
        }

        .admin-table th,
        .admin-table td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid var(--border);
            font-size: 13px
        }

        .admin-table th {
            font-weight: 600;
            color: var(--text3);
            font-size: 11px;
            text-transform: uppercase
        }

        .modal-bg {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, .6);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            backdrop-filter: blur(4px)
        }

        .modal-bg.show {
            display: flex
        }

        .modal {
            background: var(--surface);
            border-radius: 20px;
            width: 100%;
            max-width: 520px;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 24px 60px rgba(0, 0, 0, .3)
        }

        .modal-header {
            padding: 20px 24px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0
        }

        .modal-header h3 {
            font-size: 18px;
            font-weight: 700
        }

        .modal-close {
            width: 36px;
            height: 36px;
            border: none;
            background: var(--surface3);
            border-radius: 10px;
            cursor: pointer;
            font-size: 18px;
            color: var(--text2)
        }

        .modal-body {
            padding: 24px;
            overflow-y: auto;
            flex: 1;
            min-height: 0
        }

        .modal-footer {
            padding: 16px 24px;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            flex-shrink: 0;
            background: var(--surface)
        }

        .bulk-var-item {
            background: var(--surface3);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 12px;
            margin-bottom: 8px;
            position: relative;
            transition: border-color .15s
        }

        .bulk-var-item:focus-within {
            border-color: var(--primary)
        }

        .bulk-var-item .bulk-var-remove {
            position: absolute;
            top: 8px;
            right: 8px;
            background: none;
            border: none;
            color: var(--text3);
            cursor: pointer;
            font-size: 18px;
            line-height: 1;
            padding: 2px 6px;
            border-radius: 6px;
            transition: all .15s
        }

        .bulk-var-item .bulk-var-remove:hover {
            color: var(--red);
            background: rgba(255, 59, 48, .1)
        }

        .bulk-var-textarea {
            width: 100%;
            box-sizing: border-box
        }

        .bulk-floating {
            position: fixed;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--surface);
            border-radius: 14px;
            box-shadow: 0 8px 28px rgba(0, 0, 0, .2);
            padding: 16px;
            min-width: 300px;
            z-index: 900;
            display: none
        }

        .bulk-floating.show {
            display: block
        }

        .bulk-floating h4 {
            font-size: 14px;
            font-weight: 700;
            margin-bottom: 12px
        }

        .bulk-progress {
            margin-top: 14px
        }

        .bulk-progress-bar {
            height: 8px;
            background: var(--surface3);
            border-radius: 4px;
            overflow: hidden
        }

        .bulk-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary), var(--purple));
            width: 0%;
            transition: width .3s
        }

        .bulk-stats {
            display: flex;
            gap: 16px;
            margin-top: 10px;
            font-size: 11px;
            color: var(--text3)
        }

        .bulk-stats .sent {
            color: var(--green)
        }

        .bulk-stats .failed {
            color: var(--red)
        }

        .notif-panel {
            position: fixed;
            top: 68px;
            right: 24px;
            width: 380px;
            background: var(--surface);
            border-radius: 16px;
            box-shadow: 0 12px 40px rgba(0, 0, 0, .2);
            border: 1px solid var(--border);
            display: none;
            flex-direction: column;
            z-index: 800;
            max-height: 480px;
            overflow: hidden
        }

        .notif-panel.show {
            display: flex
        }

        .notif-panel-header {
            padding: 18px 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
            background: var(--surface2)
        }

        .notif-panel-header h4 {
            font-size: 15px;
            font-weight: 700;
            color: var(--text)
        }

        .notif-list {
            padding: 8px;
            overflow-y: auto;
            flex: 1;
            max-height: 420px
        }

        .notif-item {
            padding: 12px 14px;
            border-radius: 10px;
            margin-bottom: 4px;
            cursor: pointer;
            background: var(--surface2);
            transition: all .15s ease
        }

        .notif-item:hover {
            background: var(--surface3);
            transform: translateX(2px)
        }

        .notif-item.unread {
            background: rgba(13, 148, 136, .08);
            border-left: 3px solid var(--primary)
        }

        .notif-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--text);
            margin-bottom: 2px
        }

        .notif-text {
            font-size: 12px;
            color: var(--text3);
            line-height: 1.4;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap
        }

        .notif-time {
            font-size: 10px;
            color: var(--text3);
            white-space: nowrap;
            flex-shrink: 0
        }

        .notif-empty {
            padding: 48px 20px;
            text-align: center;
            color: var(--text3);
            font-size: 13px
        }

        .toast-container {
            position: fixed;
            top: 80px;
            right: 24px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px
        }

        .toast {
            padding: 14px 20px;
            border-radius: 12px;
            font-size: 13px;
            font-weight: 500;
            box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
            animation: slideIn .3s ease;
            display: flex;
            align-items: center;
            gap: 10px;
            max-width: 360px;
            transition: opacity .3s, transform .3s
        }

        .toast.success {
            background: var(--green);
            color: #fff
        }

        .toast.error {
            background: var(--red);
            color: #fff
        }

        .toast.warn {
            background: var(--yellow);
            color: #fff
        }

        .toast.info {
            background: var(--blue);
            color: #fff
        }

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

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

        /* Custom Popup (confirm/prompt) */
        .ss-popup-bg {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, .55);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            backdrop-filter: blur(6px);
            animation: ssPopupFadeIn .2s ease
        }

        .ss-popup {
            background: var(--surface);
            border-radius: 20px;
            width: 100%;
            max-width: 420px;
            box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
            animation: ssPopupScaleIn .25s cubic-bezier(.34, 1.56, .64, 1);
            overflow: hidden;
            margin: 16px
        }

        .ss-popup-icon {
            width: 56px;
            height: 56px;
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 28px auto 16px;
            font-size: 26px
        }

        .ss-popup-icon.danger {
            background: rgba(220, 38, 38, .12);
            color: var(--red)
        }

        .ss-popup-icon.warn {
            background: rgba(217, 119, 6, .12);
            color: var(--yellow)
        }

        .ss-popup-icon.info {
            background: rgba(13, 148, 136, .12);
            color: var(--primary)
        }

        .ss-popup-icon.input {
            background: rgba(37, 99, 235, .12);
            color: var(--blue)
        }

        .ss-popup-title {
            font-size: 17px;
            font-weight: 700;
            text-align: center;
            color: var(--text);
            padding: 0 28px;
            line-height: 1.4
        }

        .ss-popup-msg {
            font-size: 13.5px;
            color: var(--text2);
            text-align: center;
            padding: 8px 28px 0;
            line-height: 1.6
        }

        .ss-popup-input {
            margin: 16px 28px 0;
        }

        .ss-popup-input input {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid var(--border);
            border-radius: 12px;
            font-size: 14px;
            background: var(--surface2);
            color: var(--text);
            outline: none;
            transition: border-color .2s;
            box-sizing: border-box
        }

        .ss-popup-input input:focus {
            border-color: var(--primary)
        }

        .ss-popup-actions {
            display: flex;
            gap: 10px;
            padding: 24px 28px 28px;
            justify-content: center
        }

        .ss-popup-actions button {
            flex: 1;
            padding: 12px 20px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            transition: all .15s
        }

        .ss-popup-btn-cancel {
            background: var(--surface3);
            color: var(--text2)
        }

        .ss-popup-btn-cancel:hover {
            background: var(--surface4)
        }

        .ss-popup-btn-confirm {
            background: var(--primary);
            color: #fff
        }

        .ss-popup-btn-confirm:hover {
            background: var(--primary2)
        }

        .ss-popup-btn-danger {
            background: var(--red);
            color: #fff
        }

        .ss-popup-btn-danger:hover {
            opacity: .9
        }

        @keyframes ssPopupFadeIn {
            from { opacity: 0 }
            to { opacity: 1 }
        }

        @keyframes ssPopupScaleIn {
            from { transform: scale(.85); opacity: 0 }
            to { transform: scale(1); opacity: 1 }
        }

        .hidden {
            display: none !important
        }

        .empty {
            text-align: center;
            padding: 40px 20px;
            color: var(--text3)
        }

        @media(max-width:1200px) {
            .sidebar {
                width: 280px
            }

            .conv-panel {
                width: 320px
            }
        }

        @media(max-width:900px) {
            .login-left {
                display: none
            }

            .login-page {
                display: block;
                min-height: 100vh;
                min-height: 100dvh;
                background: linear-gradient(160deg, #1e1b4b 0%, #312e81 40%, #0f172a 100%)
            }

            .login-right {
                width: 100%;
                display: flex;
                flex-direction: column;
                align-items: center;
                min-height: 100vh;
                min-height: 100dvh;
                padding: 24px;
                background: transparent
            }

            .login-logo-mobile {
                display: block !important;
                margin-bottom: 12px !important
            }

            .login-logo-mobile img {
                height: 180px;
                filter: brightness(0) invert(1)
            }

            .login-card {
                width: 100%;
                max-width: 440px;
                border-radius: 24px;
                box-shadow: 0 8px 40px rgba(0,0,0,.2);
                margin-top: auto;
                margin-bottom: auto
            }

            .whatsapp-float {
                bottom: 20px;
                right: 20px
            }

            .whatsapp-float-label small {
                display: none
            }

            .sidebar {
                display: none
            }

            .conv-panel {
                width: 280px
            }

            .header-nav {
                gap: 2px
            }

            .nav-btn {
                padding: 8px 10px;
                font-size: 12px
            }

            .header-logo {
                height: 50px !important;
                margin: -8px 0 !important
            }

            .admin-tabs {
                flex-wrap: wrap;
                gap: 4px 3px;
                padding: 10px 16px
            }

            .admin-tabs button {
                font-size: 11.5px;
                padding: 6px 10px;
                gap: 4px
            }

            .admin-tabs button svg {
                width: 13px;
                height: 13px
            }

            .admin-tabs .tab-sep {
                display: none
            }

            .charts-row {
                grid-template-columns: 1fr !important
            }


            .modal {
                width: 95vw !important;
                max-width: 95vw !important;
                margin: 10px
            }

            .dashboard-header h1,
            .tickets-header h1,
            .admin-header h1 {
                font-size: 22px !important
            }
        }

        @media(max-width:768px) {
            .conv-panel { width: 240px }
            .nav-btn { padding: 7px 8px; font-size: 11px }
            .stat-card { padding: 12px }
        }

        @media(max-width:640px) {
            .login-page {
                background: linear-gradient(160deg, #1e1b4b 0%, #312e81 40%, #0f172a 100%)
            }

            .login-right {
                padding: 0 20px 24px;
                min-height: auto;
                background: transparent
            }

            .login-card {
                width: 100%;
                max-width: 100%;
                padding: 28px 24px 32px;
                border-radius: 24px;
                background: var(--surface);
                box-shadow: 0 8px 40px rgba(0,0,0,.25);
                margin-top: -40px;
                margin-bottom: 0
            }

            .login-logo-mobile {
                display: block !important;
                margin-top: 8px;
                margin-bottom: 0 !important
            }

            .login-logo-mobile img {
                height: 235px !important;
                max-width: 100%;
                filter: brightness(0) invert(1)
            }

            .login-header {
                margin-bottom: 20px
            }

            .login-header h2 {
                font-size: 22px;
                text-align: center
            }

            .login-header p {
                text-align: center;
                font-size: 13px
            }

            .field {
                margin-bottom: 16px
            }

            .field label {
                font-size: 13px
            }

            .field .input {
                padding: 13px 16px;
                font-size: 16px;
                border-radius: 12px
            }

            .tabs {
                margin-bottom: 18px
            }

            .tab {
                padding: 11px 20px;
                font-size: 14px
            }

            .btn-primary {
                padding: 15px;
                font-size: 16px;
                border-radius: 12px
            }

            .whatsapp-float {
                bottom: 16px;
                right: 16px
            }

            .whatsapp-float-label {
                display: none
            }

            .whatsapp-float-btn {
                width: 54px;
                height: 54px
            }

            .whatsapp-float-btn svg {
                width: 28px;
                height: 28px
            }

            .header {
                padding: 0 12px !important;
                gap: 8px
            }

            .header-left {
                flex: 1;
                min-width: 0
            }

            .header-nav {
                flex-wrap: nowrap;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none
            }

            .header-nav::-webkit-scrollbar {
                display: none
            }

            .nav-btn {
                white-space: nowrap;
                padding: 6px 8px;
                font-size: 11px
            }

            .header-logo {
                height: 36px !important;
                max-width: 100px
            }

            .header-right {
                gap: 4px !important
            }

            .user-info {
                display: none
            }

            .user-menu {
                padding: 6px 8px !important
            }

            .user-menu svg[width="14"] {
                display: none
            }

            .user-dropdown {
                right: -8px;
                min-width: 200px
            }

            .main {
                height: calc(100vh - 52px);
                height: calc(100dvh - 52px)
            }

            .conv-panel {
                width: 100%;
                max-width: 100%
            }

            .chat-panel {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                z-index: 50;
                display: none
            }

            .chat-panel.mobile-active {
                display: flex !important
            }

            .dashboard-page,
            .tickets-page,
            .admin-page {
                padding: 16px !important
            }

            .admin-card {
                padding: 16px !important
            }

            .admin-table {
                font-size: 12px
            }

            .admin-table th,
            .admin-table td {
                padding: 8px 6px !important
            }

            .modal {
                border-radius: 12px !important
            }

            .modal-body {
                padding: 16px !important
            }

            .modal-footer {
                padding: 12px 16px !important
            }

            .notif-panel {
                width: 100% !important;
                right: 0 !important;
                top: 52px !important;
                border-radius: 0 0 16px 16px !important
            }

            .billing-stats {
                grid-template-columns: 1fr !important
            }

            .billing-table-wrap {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch
            }

            .menu-opt-row {
                grid-template-columns: 40px 1fr !important;
            }

            .menu-opt-row [data-field="response"] {
                grid-column: span 2;
            }

            .audit-row {
                flex-direction: column !important;
                gap: 4px !important
            }
        }
    
        /* Ticket composer */
        .ticket-compose { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
        .ticket-textarea { min-height: 120px; resize: vertical; line-height: 1.4; padding: 10px; width: 100%; }
        .ticket-compose-actions { display: flex; justify-content: flex-end; }
        .ticket-send-btn { width: auto !important; padding: 10px 16px; }

        /* Mobile back button */
        .mobile-back-btn { display: none !important; }
        @media(max-width:640px) {
            .mobile-back-btn { display: flex !important; font-size: 18px; min-width: 36px; }
        }

        /* ===== VENDAS DASHBOARD ===== */
        .vd-tabs{display:flex;gap:0;border-bottom:2px solid var(--border);margin-bottom:16px}
        .vd-tabs button{padding:8px 20px;font-size:13px;font-weight:600;border:none;background:none;color:var(--text3);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-2px;transition:all .2s}
        .vd-tabs button:hover{color:var(--text2)}
        .vd-tabs button.active{color:var(--primary);border-bottom-color:var(--primary)}
        .vd-kpi{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin-bottom:16px}
        .vd-kpi-card{padding:14px 12px;background:var(--surface3);border-radius:10px;text-align:center;position:relative;overflow:hidden}
        .vd-kpi-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;border-radius:10px 10px 0 0}
        .vd-kpi-val{font-size:22px;font-weight:800;line-height:1.2}
        .vd-kpi-label{font-size:10px;color:var(--text3);margin-top:3px;text-transform:uppercase;letter-spacing:.3px}
        .vd-kpi-sub{font-size:10px;color:var(--text3);margin-top:2px}
        .vd-grid2{display:grid;grid-template-columns:1fr 340px;gap:14px;margin-bottom:14px}
        .vd-panel{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:16px}
        .vd-panel-title{font-size:12px;font-weight:700;color:var(--text2);margin-bottom:12px;text-transform:uppercase;letter-spacing:.4px}
        .vd-chart{display:flex;align-items:flex-end;gap:2px;height:100px}
        .vd-chart-bar{flex:1;display:flex;flex-direction:column;align-items:center;gap:1px;min-width:0}
        .vd-chart-val{font-size:8px;color:var(--text3);line-height:1}
        .vd-chart-fill{width:100%;border-radius:2px 2px 0 0;min-height:1px;transition:height .3s}
        .vd-chart-dates{display:flex;gap:2px;margin-top:3px}
        .vd-chart-dates>div{flex:1;font-size:7px;color:var(--text3);text-align:center;min-width:0;overflow:hidden}
        .vd-ref-row{display:flex;align-items:center;gap:8px;margin-bottom:6px}
        .vd-ref-name{font-size:11px;min-width:100px;max-width:100px;color:var(--text2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
        .vd-ref-bar{flex:1;background:var(--surface3);border-radius:3px;height:16px;overflow:hidden}
        .vd-ref-fill{height:100%;border-radius:3px;transition:width .3s}
        .vd-ref-count{font-size:10px;font-weight:600;min-width:26px;text-align:right;color:var(--text3)}
        .vd-pipeline{display:flex;gap:0;margin-bottom:14px;border-radius:10px;overflow:hidden;border:1px solid var(--border)}
        .vd-pipe-item{flex:1;padding:12px 8px;text-align:center;position:relative;background:var(--surface)}
        .vd-pipe-item+.vd-pipe-item{border-left:1px solid var(--border)}
        .vd-pipe-count{font-size:20px;font-weight:800;line-height:1.2}
        .vd-pipe-label{font-size:10px;font-weight:600;margin-top:2px;text-transform:uppercase;letter-spacing:.3px}
        .vd-pipe-pct{font-size:9px;color:var(--text3);margin-top:1px}
        .vd-side-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:14px}
        .vd-donut-wrap{display:flex;align-items:center;gap:16px}
        .vd-donut-legend{display:flex;flex-direction:column;gap:6px}
        .vd-donut-item{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--text2)}
        .vd-donut-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}
        .vd-leads-header{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:12px}
        .vd-leads-filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
        .vd-leads-filters .input{font-size:12px}
        .vd-lead-cards{display:none}
        @media(max-width:1100px){
            .vd-kpi{grid-template-columns:repeat(3,1fr)}
            .vd-grid2{grid-template-columns:1fr}
            .vd-side-grid{grid-template-columns:1fr 1fr}
        }
        @media(max-width:768px){
            .vd-kpi{grid-template-columns:repeat(2,1fr)}
            .vd-grid2{grid-template-columns:1fr}
            .vd-side-grid{grid-template-columns:1fr}
            .vd-tabs button{padding:6px 12px;font-size:12px}
            .vd-pipeline{flex-direction:column}
            .vd-pipe-item+.vd-pipe-item{border-left:none;border-top:1px solid var(--border)}
            .vd-lead-table{display:none!important}
            .vd-lead-cards{display:flex;flex-direction:column;gap:8px}
            .vd-lead-card{background:var(--surface3);border-radius:10px;padding:12px}
            .vd-lead-card-top{display:flex;justify-content:space-between;align-items:start;margin-bottom:6px}
            .vd-lead-card-name{font-weight:700;font-size:13px}
            .vd-lead-card-date{font-size:10px;color:var(--text3)}
            .vd-lead-card-row{display:flex;gap:6px;align-items:center;font-size:12px;color:var(--text2);margin-bottom:3px}
            .vd-lead-card-actions{display:flex;gap:6px;margin-top:8px;align-items:center}
        }
        @media(max-width:480px){
            .vd-kpi{grid-template-columns:1fr 1fr}
            .vd-kpi-val{font-size:18px}
            .vd-chart{height:70px}
        }

        /* Billing table */
        .admin-table { border-collapse: collapse; }
        .admin-table th, .admin-table td { text-align: left; }
        .billing-stats { gap: 12px; }

        /* Checkout / Plans */
        /* Cycle toggle */
        .cycle-toggle {
            display: flex;
            background: var(--surface3);
            border-radius: 12px;
            padding: 4px;
            margin: 0 auto 24px;
            width: fit-content;
            gap: 4px
        }
        .cycle-btn {
            padding: 8px 24px;
            border: none;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            background: transparent;
            color: var(--text3);
            transition: all .2s;
            position: relative
        }
        .cycle-btn.active {
            background: var(--primary);
            color: #fff;
            box-shadow: 0 2px 8px rgba(124,58,237,.3)
        }
        .cycle-btn .cycle-save {
            position: absolute;
            top: -8px;
            right: -6px;
            background: #059669;
            color: #fff;
            font-size: 9px;
            font-weight: 700;
            padding: 2px 7px;
            border-radius: 8px;
            line-height: 1.3
        }
        /* Plans grid */
        .plans-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 16px;
            margin: 0 0 16px
        }
        .plan-card {
            background: var(--surface);
            border: 2px solid var(--border);
            border-radius: 16px;
            padding: 24px 20px;
            position: relative;
            transition: border-color .2s, box-shadow .2s;
            display: flex;
            flex-direction: column;
            cursor: pointer
        }
        .plan-card:hover {
            border-color: var(--primary);
            box-shadow: 0 4px 20px rgba(124,58,237,.12)
        }
        .plan-card.popular {
            border-color: var(--primary);
            box-shadow: 0 4px 20px rgba(124,58,237,.1)
        }
        .plan-card.current-plan {
            border-color: #059669;
            background: var(--surface)
        }
        .plan-card .popular-badge {
            position: absolute;
            top: -11px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(135deg, var(--primary), #9333ea);
            color: #fff;
            font-size: 10px;
            font-weight: 700;
            padding: 3px 14px;
            border-radius: 20px;
            letter-spacing: .5px;
            white-space: nowrap
        }
        .plan-card .current-badge {
            position: absolute;
            top: -11px;
            left: 50%;
            transform: translateX(-50%);
            background: #059669;
            color: #fff;
            font-size: 10px;
            font-weight: 700;
            padding: 3px 14px;
            border-radius: 20px;
            white-space: nowrap
        }
        .plan-card .plan-name {
            font-size: 16px;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 12px;
            text-align: center
        }
        .plan-card .plan-price-wrap {
            text-align: center;
            margin-bottom: 16px;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--border)
        }
        .plan-card .plan-price {
            font-size: 32px;
            font-weight: 800;
            color: var(--primary);
            line-height: 1
        }
        .plan-card .plan-price small {
            font-size: 13px;
            font-weight: 400;
            color: var(--text3)
        }
        .plan-card .plan-annual-info {
            font-size: 11px;
            color: #059669;
            font-weight: 600;
            margin-top: 4px
        }
        .plan-card .plan-features {
            list-style: none;
            padding: 0;
            margin: 0 0 16px;
            flex: 1
        }
        .plan-card .plan-features li {
            padding: 5px 0;
            font-size: 12px;
            color: var(--text2);
            display: flex;
            align-items: flex-start;
            gap: 8px;
            line-height: 1.4
        }
        .plan-card .plan-features li .pf-check {
            color: var(--green);
            font-weight: 700;
            font-size: 13px;
            flex-shrink: 0;
            margin-top: 1px
        }
        .plan-card .plan-btn {
            width: 100%;
            padding: 10px;
            border: 2px solid var(--primary);
            border-radius: 10px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all .15s;
            background: transparent;
            color: var(--primary)
        }
        .plan-card .plan-btn:hover {
            background: var(--primary);
            color: #fff
        }
        .plan-card.popular .plan-btn,
        .plan-card .plan-btn.plan-btn-fill {
            background: var(--primary);
            color: #fff
        }
        .plan-card.popular .plan-btn:hover,
        .plan-card .plan-btn.plan-btn-fill:hover {
            opacity: .9;
            box-shadow: 0 4px 16px rgba(124,58,237,.3)
        }
        .plan-card.current-plan .plan-btn {
            border-color: #059669;
            color: #059669;
            background: transparent
        }
        .plan-card.current-plan .plan-btn:hover {
            background: #059669;
            color: #fff
        }
        /* Checkout methods */
        .checkout-methods { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
        .checkout-method { flex: 1; min-width: 120px; padding: 16px; border: 2px solid var(--surface4); border-radius: 12px; cursor: pointer; text-align: center; transition: all .2s; background: var(--surface2); }
        .checkout-method:hover { border-color: var(--primary); }
        .checkout-method.active { border-color: var(--primary); background: var(--surface3); }
        .checkout-method .method-icon { font-size: 28px; margin-bottom: 6px; }
        .checkout-method .method-name { font-size: 13px; font-weight: 600; color: var(--text); }
        .checkout-method .method-desc { font-size: 11px; color: var(--text3); margin-top: 2px; }
        .pix-container { text-align: center; padding: 20px 0; }
        .pix-qr { max-width: 260px; margin: 16px auto; border-radius: 12px; border: 4px solid var(--surface4); }
        .pix-copy { background: var(--surface3); border-radius: 10px; padding: 14px; margin: 16px 0; word-break: break-all; font-family: monospace; font-size: 12px; color: var(--text2); position: relative; cursor: pointer; }
        .boleto-container { text-align: center; padding: 20px 0; }
        .boleto-code { background: var(--surface3); border-radius: 10px; padding: 14px; margin: 16px 0; word-break: break-all; font-family: monospace; font-size: 13px; color: var(--text); cursor: pointer; }
        .cc-form { display: grid; gap: 14px; }
        .cc-form .cc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
        .payment-status { text-align: center; padding: 32px; }
        .payment-status .status-icon { font-size: 48px; margin-bottom: 12px; }
        @media(max-width:768px) {
            #paywallOverlay > div:last-child { padding: 32px 16px !important }
            #paywallOverlay h2 { font-size: 20px !important }
            .plans-grid { grid-template-columns: 1fr !important; max-width: 380px !important }
            .plan-card { padding: 20px 18px }
            .plan-card .plan-price { font-size: 28px }
            .cycle-toggle { margin-bottom: 20px }
            .cycle-btn { padding: 8px 20px; font-size: 12px }
        }
        @media(max-width:640px) {
            #paywallOverlay > div:last-child { padding: 24px 12px !important }
            #paywallOverlay h2 { font-size: 18px !important }
            #paywallOverlay p { font-size: 12px !important }
            .cc-form .cc-row { grid-template-columns: 1fr }
            .checkout-methods { flex-direction: column }
            .plans-grid { max-width: 100% !important }
            .plan-card { padding: 18px 16px }
            .plan-card .plan-name { font-size: 15px }
            .plan-card .plan-price { font-size: 26px }
            .plan-card .plan-features li { font-size: 11.5px }
            .plan-card .plan-btn { padding: 10px; font-size: 13px }
            .cycle-btn { padding: 7px 18px; font-size: 12px }
        }
        .payment-status .status-text { font-size: 18px; font-weight: 700; }
        .payment-status .status-desc { font-size: 14px; color: var(--text3); margin-top: 8px; }

        /* Meu Plano */
        .mp-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            flex-wrap: wrap;
            gap: 12px
        }
        .mp-header h3 { margin: 0; font-size: 16px }
        .mp-actions { display: flex; gap: 8px; flex-wrap: wrap }
        .mp-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            margin-bottom: 28px
        }
        .mp-stat {
            background: var(--surface3);
            border-radius: 14px;
            padding: 20px 16px;
            text-align: center;
            position: relative;
            overflow: hidden
        }
        .mp-stat::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 3px;
            border-radius: 14px 14px 0 0
        }
        .mp-stat.mp-plan::before { background: var(--primary) }
        .mp-stat.mp-valid::before { background: var(--green) }
        .mp-stat.mp-valid.mp-expired::before { background: var(--red) }
        .mp-stat.mp-pay::before { background: var(--blue) }
        .mp-stat-icon {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 10px;
            color: #fff
        }
        .mp-plan .mp-stat-icon { background: var(--primary) }
        .mp-valid .mp-stat-icon { background: var(--green) }
        .mp-valid.mp-expired .mp-stat-icon { background: var(--red) }
        .mp-pay .mp-stat-icon { background: var(--blue) }
        .mp-stat-label {
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: .8px;
            color: var(--text3);
            margin-bottom: 6px;
            font-weight: 600
        }
        .mp-stat-value {
            font-size: 20px;
            font-weight: 700;
            line-height: 1.2
        }
        .mp-stat-sub {
            font-size: 11px;
            margin-top: 4px;
            font-weight: 500
        }
        .mp-progress {
            margin-bottom: 28px;
            background: var(--surface3);
            border-radius: 14px;
            padding: 16px 20px
        }
        .mp-progress-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            font-size: 12px
        }
        .mp-progress-bar {
            height: 8px;
            background: var(--border);
            border-radius: 8px;
            overflow: hidden
        }
        .mp-progress-fill {
            height: 100%;
            border-radius: 8px;
            transition: width .5s ease
        }
        .mp-invoices-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 14px
        }
        .mp-invoices-header h4 {
            margin: 0;
            font-size: 14px;
            font-weight: 600
        }
        .mp-inv-count {
            font-size: 11px;
            color: var(--text3);
            background: var(--surface3);
            padding: 2px 10px;
            border-radius: 10px
        }
        .mp-inv-card {
            display: grid;
            grid-template-columns: 1fr auto auto auto;
            gap: 12px;
            align-items: center;
            padding: 12px 16px;
            background: var(--surface3);
            border-radius: 10px;
            margin-bottom: 8px;
            font-size: 13px
        }
        .mp-inv-desc {
            font-weight: 500;
            min-width: 0
        }
        .mp-inv-desc small {
            display: block;
            font-size: 11px;
            color: var(--text3);
            font-weight: 400;
            margin-top: 2px
        }
        .mp-inv-amount { font-weight: 700; white-space: nowrap }
        .mp-inv-method {
            font-size: 11px;
            color: var(--text3);
            background: var(--surface);
            padding: 3px 8px;
            border-radius: 6px;
            white-space: nowrap
        }
        .mp-inv-status {
            font-size: 11px;
            font-weight: 700;
            padding: 4px 10px;
            border-radius: 8px;
            white-space: nowrap
        }
        .mp-inv-status.paid { background: rgba(5,150,105,.12); color: #059669 }
        .mp-inv-status.pending { background: rgba(217,119,6,.12); color: #d97706 }
        .mp-inv-status.overdue { background: rgba(220,38,38,.12); color: #dc2626 }
        .mp-inv-status.cancelled { background: var(--surface); color: var(--text3) }
        .mp-inv-status.refunded { background: rgba(37,99,235,.12); color: #2563eb }
        .mp-empty {
            text-align: center;
            padding: 32px 16px;
            color: var(--text3)
        }
        .mp-empty svg { margin: 0 auto 12px; opacity: .3 }
        @media(max-width:768px) {
            .mp-stats { grid-template-columns: 1fr }
            .mp-stat { padding: 16px 14px }
            .mp-stat-value { font-size: 18px }
            .mp-inv-card {
                grid-template-columns: 1fr 1fr;
                gap: 8px
            }
            .mp-inv-desc { grid-column: 1 / -1 }
        }
        @media(max-width:480px) {
            .mp-inv-card {
                grid-template-columns: 1fr auto;
                gap: 6px 12px
            }
            .mp-inv-method { display: none }
        }

        /* ========== LIGHTBOX ========== */
        .lightbox-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,.92); z-index: 100000;
            display: flex; align-items: center; justify-content: center;
            opacity: 0; transition: opacity .2s; cursor: zoom-out;
            -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
            touch-action: none;
        }
        .lightbox-overlay.active { opacity: 1 }
        .lightbox-img {
            max-width: 92vw; max-height: 88vh;
            border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.6);
            transition: transform .3s cubic-bezier(.25,.46,.45,.94);
            user-select: none; -webkit-user-drag: none;
            object-fit: contain; cursor: default;
        }
        .lightbox-toolbar {
            position: fixed; bottom: 0; left: 0; right: 0;
            display: flex; justify-content: center; gap: 8px;
            padding: 16px; background: linear-gradient(transparent, rgba(0,0,0,.7));
            z-index: 100001;
        }
        .lightbox-btn {
            padding: 10px 20px; border: none; border-radius: 10px;
            font-size: 13px; font-weight: 600; cursor: pointer;
            display: flex; align-items: center; gap: 6px;
            transition: all .15s;
        }
        .lightbox-btn-primary {
            background: var(--primary); color: #fff;
        }
        .lightbox-btn-primary:hover { background: var(--primary2) }
        .lightbox-btn-secondary {
            background: rgba(255,255,255,.15); color: #fff;
        }
        .lightbox-btn-secondary:hover { background: rgba(255,255,255,.25) }
        .lightbox-close {
            position: fixed; top: 16px; right: 16px; z-index: 100001;
            width: 44px; height: 44px; border: none; border-radius: 50%;
            background: rgba(255,255,255,.15); color: #fff; font-size: 22px;
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            transition: all .15s;
        }
        .lightbox-close:hover { background: rgba(255,255,255,.3) }
        .lightbox-counter {
            position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
            color: rgba(255,255,255,.7); font-size: 13px; font-weight: 600;
            z-index: 100001;
        }
        @media(max-width:640px) {
            .lightbox-img { max-width: 98vw; max-height: 80vh; border-radius: 4px }
            .lightbox-toolbar { padding: 12px; gap: 6px }
            .lightbox-btn { padding: 10px 14px; font-size: 12px }
            .lightbox-close { top: 10px; right: 10px; width: 40px; height: 40px }
        }

        /* ========== MOBILE ENHANCEMENTS ========== */
        .mobile-sidebar-toggle {
            display: none !important;
            width: 36px; height: 36px; border-radius: 10px;
            background: var(--surface3); border: 1px solid var(--border);
            cursor: pointer; align-items: center; justify-content: center;
            font-size: 16px; flex-shrink: 0; color: var(--text2);
        }
        @media(max-width:900px) {
            .mobile-sidebar-toggle { display: flex !important }
            .sidebar {
                display: none; position: fixed; top: 0; left: 0; bottom: 0;
                width: 300px; z-index: 60; box-shadow: 4px 0 20px rgba(0,0,0,.3);
                transition: transform .3s;
            }
            .sidebar.mobile-open { display: flex !important }
            .sidebar-overlay {
                display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
                background: rgba(0,0,0,.5); z-index: 59;
            }
            .sidebar-overlay.active { display: block }
        }
        @media(max-width:640px) {
            .conv-panel {
                border-right: none !important;
            }
            .conv-header { padding: 12px !important }
            .conv-tools { padding: 8px 12px !important }
            .filter-bar { padding: 6px 12px !important; gap: 4px !important }
            .filter-btn { padding: 5px 10px !important; font-size: 11px !important }
            .chat-header { padding: 10px 12px !important; gap: 8px !important }
            .chat-footer { padding: 10px 12px !important }
            .quick-replies { margin-bottom: 8px !important; gap: 4px !important }
            .signature { margin-bottom: 8px !important; padding: 6px 10px !important }
            .msg { max-width: 85% !important; padding: 10px 12px !important }
            .msg-media img { max-height: 220px !important }
            .msg-media video { max-height: 220px !important }
            .chat-input { padding: 10px 14px !important; font-size: 16px !important }
            .send-btn { width: 42px !important; height: 42px !important }
            .input-row { gap: 6px !important }
            .chat-actions { gap: 2px !important }
            .chat-actions .btn-icon { width: 30px !important; height: 30px !important; font-size: 12px !important }
            .chat-info h3 { font-size: 14px !important }
            .chat-info p { font-size: 11px !important }
            .chat-avatar { width: 34px !important; height: 34px !important; font-size: 13px !important }
            .conv-item { padding: 10px 12px !important }
            .conv-avatar { width: 40px !important; height: 40px !important; min-width: 40px !important; font-size: 14px !important }
            .conv-name { font-size: 13px !important }
            .conv-phone { font-size: 10px !important }
            .conv-preview { font-size: 11px !important }

            /* Bottom nav for mobile */
            .header-nav {
                position: fixed !important; bottom: 0; left: 0; right: 0;
                background: var(--surface) !important; border-top: 1px solid var(--border);
                display: flex !important; justify-content: space-around;
                padding: 4px 0 env(safe-area-inset-bottom, 4px) !important;
                z-index: 55; gap: 0 !important;
                box-shadow: 0 -2px 10px rgba(0,0,0,.08);
            }
            .nav-btn {
                flex-direction: column !important; gap: 2px !important;
                padding: 6px 4px !important; font-size: 9px !important;
                min-width: 0 !important; flex: 1; text-align: center;
                border-radius: 0 !important;
            }
            .nav-btn svg, .nav-btn .nav-icon { font-size: 18px !important }
            .main {
                height: calc(100vh - 52px - 52px) !important;
                height: calc(100dvh - 52px - 52px) !important;
            }
            .chat-panel.mobile-active {
                bottom: 52px !important;
            }
            /* Settings & pages padding for bottom nav */
            .dashboard-page, .tickets-page, .admin-page, .settings-page, .helpcenter-page {
                padding-bottom: 64px !important;
            }
        }

        /* ==================== CENTRAL DE AJUDA ==================== */
        .helpcenter-page { flex: 1; display: flex; flex-direction: column; overflow: auto; padding: 24px 20px; background: var(--surface2); }
        .helpcenter-page > * { max-width: 900px; width: 100%; margin-left: auto; margin-right: auto; }
        .helpcenter-page h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
        .helpcenter-page .hc-subtitle { font-size: 13px; color: var(--text3); margin-bottom: 20px; }

        .hc-search-wrap { position: relative; margin-bottom: 28px; }
        .hc-search-wrap input { width: 100%; padding: 12px 16px 12px 42px; border: 2px solid var(--border); border-radius: 12px; font-size: 14px; background: var(--surface); color: var(--text); transition: border-color .2s; }
        .hc-search-wrap input:focus { outline: none; border-color: var(--primary); }
        .hc-search-wrap .hc-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text3); pointer-events: none; }
        .hc-search-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 100; max-height: 320px; overflow-y: auto; display: none; }
        .hc-search-dropdown.show { display: block; }
        .hc-search-item { padding: 10px 16px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .15s; }
        .hc-search-item:last-child { border-bottom: none; }
        .hc-search-item:hover { background: var(--surface3); }
        .hc-search-item .hc-si-title { font-size: 13px; font-weight: 600; color: var(--text); }
        .hc-search-item .hc-si-cat { font-size: 11px; color: var(--text3); margin-top: 2px; }
        .hc-search-empty { padding: 20px 16px; text-align: center; color: var(--text3); font-size: 13px; }

        .hc-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 32px; }
        .hc-category-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 14px; cursor: pointer; transition: all .2s; text-align: center; }
        .hc-category-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(13,148,136,.12); }
        .hc-category-card .hc-cat-icon { width: 28px; height: 28px; margin: 0 auto 10px; color: var(--primary); }
        .hc-category-card .hc-cat-icon svg { width: 28px; height: 28px; }
        .hc-category-card .hc-cat-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
        .hc-category-card .hc-cat-count { font-size: 11px; color: var(--text3); }

        .hc-popular-section { margin-bottom: 24px; }
        .hc-popular-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
        .hc-popular-list { display: flex; flex-direction: column; gap: 6px; }
        .hc-popular-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all .15s; }
        .hc-popular-item:hover { border-color: var(--primary); background: var(--surface2); }
        .hc-popular-rank { width: 24px; height: 24px; border-radius: 50%; background: var(--surface3); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--text3); flex-shrink: 0; }
        .hc-popular-item:nth-child(1) .hc-popular-rank { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
        .hc-popular-item:nth-child(2) .hc-popular-rank { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
        .hc-popular-item:nth-child(3) .hc-popular-rank { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
        .hc-popular-title { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; }
        .hc-popular-views { font-size: 11px; color: var(--text3); flex-shrink: 0; }

        .hc-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); margin-bottom: 16px; flex-wrap: wrap; }
        .hc-breadcrumb a { color: var(--primary); text-decoration: none; cursor: pointer; }
        .hc-breadcrumb a:hover { text-decoration: underline; }

        .hc-article-list { display: flex; flex-direction: column; gap: 8px; }
        .hc-article-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all .15s; }
        .hc-article-row:hover { border-color: var(--primary); }
        .hc-article-row .hc-ar-title { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; }
        .hc-article-row .hc-ar-meta { font-size: 11px; color: var(--text3); display: flex; gap: 10px; flex-shrink: 0; }

        .hc-article-view { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px 20px; }
        .hc-article-view h2 { font-size: 17px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
        .hc-article-view .hc-av-meta { font-size: 11px; color: var(--text3); margin-bottom: 20px; display: flex; gap: 14px; }
        .hc-article-body { font-size: 14px; line-height: 1.7; color: var(--text2); }
        .hc-article-body h2 { font-size: 16px; font-weight: 700; color: var(--text); margin: 20px 0 10px; }
        .hc-article-body p { margin-bottom: 10px; }
        .hc-article-body ul { margin: 8px 0 12px 20px; }
        .hc-article-body li { margin-bottom: 4px; }
        .hc-article-body strong { color: var(--text); font-weight: 600; }
        .hc-article-body code { background: var(--surface3); padding: 2px 6px; border-radius: 4px; font-size: 12px; font-family: monospace; }
        .hc-article-body .step { display: flex; align-items: flex-start; gap: 12px; margin: 10px 0; padding: 12px 14px; background: var(--surface2); border-radius: 10px; border-left: 3px solid var(--primary); }
        .hc-article-body .step-num { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary2)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
        .hc-article-body .step-text { flex: 1; font-size: 13px; line-height: 1.6; }
        .hc-article-body .tip { margin: 12px 0; padding: 12px 16px; background: #ecfdf5; border-left: 3px solid var(--green); border-radius: 8px; font-size: 13px; color: #065f46; }
        .hc-article-body .tip::before { content:'Dica: '; font-weight:700; }
        .hc-article-body .warning { margin: 12px 0; padding: 12px 16px; background: #fffbeb; border-left: 3px solid var(--yellow); border-radius: 8px; font-size: 13px; color: #92400e; }
        .hc-article-body .warning::before { content:'Aviso: '; font-weight:700; }
        /* Modal artigo — layout v2 */
        #hcArticleModal .modal, #hcEditModal .modal { max-width:780px; width:95vw; display:flex; flex-direction:column; max-height:90vh; }
        #hcArticleModal .modal-header, #hcEditModal .modal-header { padding:14px 20px; flex-shrink:0; }
        #hcArticleModal .modal-header h3, #hcEditModal .modal-header h3 { font-size:16px; }
        #hcArticleModal .modal-body, #hcEditModal .modal-body { padding:16px 20px; overflow-y:auto; flex:1; min-height:0; }
        #hcArticleModal .modal-footer, #hcEditModal .modal-footer { padding:12px 20px; flex-shrink:0; border-top:1px solid var(--border); }
        #hcArticleModal .modal-footer .btn, #hcEditModal .modal-footer .btn { width:auto; }
        #hcArticleModal .field, #hcEditModal .field { margin-bottom:10px; }
        #hcArticleModal .field label, #hcEditModal .field label { font-size:12px; margin-bottom:4px; display:block; font-weight:600; color:var(--text2); }
        .hc-modal-title-field { margin-bottom:14px; }
        .hc-modal-title-field input { font-size:16px; padding:10px 14px; font-weight:600; }
        .hc-modal-meta { display:grid; grid-template-columns:1fr 1fr; gap:10px 14px; margin-bottom:14px; }
        .hc-modal-meta .field { margin-bottom:0; }
        .hc-modal-meta .field.full-width { grid-column:1/-1; }
        .hc-modal-editor-section { margin-bottom:0; }
        .hc-modal-editor-section > label { font-size:12px; font-weight:600; color:var(--text2); margin-bottom:6px; display:block; }
        .dark-mode .hc-article-body .tip { background: rgba(5,150,105,.12); color: #6ee7b7; }
        .dark-mode .hc-article-body .warning { background: rgba(217,119,6,.12); color: #fcd34d; }

        .hc-feedback { margin-top: 16px; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; }
        .hc-feedback-q { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
        .hc-feedback-btns { display: flex; gap: 10px; justify-content: center; }
        .hc-feedback-btn { padding: 8px 20px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text2); cursor: pointer; font-size: 13px; font-weight: 500; transition: all .2s; display: flex; align-items: center; gap: 6px; }
        .hc-feedback-btn:hover { border-color: var(--primary); color: var(--primary); }
        .hc-feedback-btn.active-yes { background: #ecfdf5; border-color: var(--green); color: var(--green); }
        .hc-feedback-btn.active-no { background: #fef2f2; border-color: var(--red); color: var(--red); }
        .hc-feedback-btn .hc-fb-count { font-size: 11px; opacity: .7; }
        .hc-feedback-done { font-size: 13px; color: var(--text3); margin-top: 8px; }

        /* Banner referência no chamado via Central de Ajuda */
        .hc-ref-banner { display:flex; align-items:center; gap:8px; padding:10px 12px; border-radius:8px; background:var(--primary-bg, rgba(13,148,136,.08)); border:1px solid var(--primary); font-size:12px; color:var(--text2); margin-bottom:12px; }
        .hc-ref-banner svg { flex-shrink:0; color:var(--primary); }
        .hc-ref-banner span { flex:1; min-width:0; }
        .hc-ref-banner strong { color:var(--text); }
        .hc-question-label { font-size:13px; font-weight:600; color:var(--text); margin-bottom:6px; display:flex; align-items:center; gap:6px; }
        .hc-question-label .hc-q-num { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:50%; background:var(--primary); color:#fff; font-size:11px; font-weight:700; flex-shrink:0; }

        /* CTA abrir chamado após feedback negativo */
        .hc-ticket-cta { margin-top:16px; padding:16px 20px; border-radius:10px; border:1px solid var(--border); background:var(--surface2); text-align:center; opacity:0; max-height:0; overflow:hidden; transition:all .35s ease; }
        .hc-ticket-cta.show { opacity:1; max-height:200px; }
        .hc-ticket-cta p { font-size:13px; color:var(--text3); margin-bottom:10px; }
        .hc-ticket-cta button { padding:8px 20px; border-radius:8px; border:1px solid var(--primary); background:var(--primary); color:#fff; cursor:pointer; font-size:13px; font-weight:500; transition:all .2s; display:inline-flex; align-items:center; gap:6px; }
        .hc-ticket-cta button:hover { opacity:.85; transform:translateY(-1px); }

        /* Artigos relacionados */
        .hc-related { margin-top:16px; padding-top:20px; border-top:1px solid var(--border); }
        .hc-related h4 { font-size:14px; font-weight:600; color:var(--text); margin-bottom:12px; }
        .hc-related-list { display:flex; gap:10px; flex-wrap:wrap; }
        .hc-related-card { flex:1; min-width:180px; max-width:33%; padding:12px; border-radius:8px; border:1px solid var(--border); background:var(--surface); cursor:pointer; transition:all .2s; }
        .hc-related-card:hover { border-color:var(--primary); box-shadow:0 2px 8px rgba(0,0,0,.08); }
        .hc-related-card .rc-title { font-size:13px; font-weight:600; color:var(--text); margin-bottom:4px; }
        .hc-related-card .rc-meta { font-size:11px; color:var(--text3); }

        /* Toolbar do editor admin v2 */
        .hc-editor-toolbar-v2 { display:flex; align-items:center; gap:3px; padding:6px 8px; background:var(--surface3); border:1px solid var(--border); border-bottom:none; border-radius:8px 8px 0 0; flex-wrap:nowrap; overflow-x:auto; position:relative; -webkit-overflow-scrolling:touch; scrollbar-width:thin; scrollbar-color:var(--border) transparent; }
        .hc-editor-toolbar-v2::-webkit-scrollbar { height:3px; }
        .hc-editor-toolbar-v2::-webkit-scrollbar-thumb { background:var(--border); border-radius:3px; }
        .hc-editor-toolbar-v2::-webkit-scrollbar-track { background:transparent; }
        .hc-editor-toolbar-v2 button { padding:4px 10px; font-size:11px; font-weight:600; background:var(--surface); border:1px solid var(--border); border-radius:5px; cursor:pointer; color:var(--text2); transition:all .15s; font-family:inherit; line-height:1.4; display:inline-flex; align-items:center; gap:4px; white-space:nowrap; flex-shrink:0; }
        .hc-editor-toolbar-v2 button:hover { background:var(--primary); color:#fff; border-color:var(--primary); }
        .hc-editor-toolbar-v2 button svg { width:13px; height:13px; flex-shrink:0; }
        .toolbar-sep { width:1px; height:20px; background:var(--border); margin:0 4px; flex-shrink:0; }
        .hc-editor-textarea { font-family:'SF Mono',ui-monospace,Consolas,monospace; font-size:12.5px; line-height:1.55; border-radius:0 0 8px 8px; border-top:none; min-height:200px; resize:vertical; }
        /* Block Editor */
        .hc-block-editor { display:flex; flex-direction:column; gap:8px; padding:12px; border:1px solid var(--border); border-top:none; border-radius:0 0 8px 8px; background:var(--surface); min-height:200px; max-height:60vh; overflow-y:auto; }
        .hc-block { border:1px solid var(--border); border-radius:8px; background:var(--bg); overflow:hidden; }
        .hc-block-header { display:flex; align-items:center; justify-content:space-between; padding:6px 10px; background:var(--surface2); border-bottom:1px solid var(--border); gap:6px; }
        .hc-block-badge { font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:4px; text-transform:uppercase; letter-spacing:.3px; white-space:nowrap; }
        .badge-text { background:var(--surface4); color:var(--text2); }
        .badge-step { background:rgba(13,148,136,.1); color:var(--primary); }
        .badge-tip { background:#ecfdf5; color:var(--green); }
        .badge-warning { background:#fffbeb; color:var(--yellow); }
        .badge-image { background:rgba(124,58,237,.1); color:var(--purple); }
        .hc-block-actions { display:flex; gap:2px; }
        .hc-block-actions button { width:24px; height:24px; display:inline-flex; align-items:center; justify-content:center; border:none; background:none; cursor:pointer; color:var(--text3); border-radius:4px; font-size:13px; transition:all .15s; padding:0; }
        .hc-block-actions button:hover { color:var(--text); background:var(--surface); }
        .hc-block-actions button.block-remove:hover { color:var(--red); background:rgba(220,38,38,.08); }
        .hc-block .hc-block-ta { display:block; width:100%; border:none; border-radius:0; font-size:13px; line-height:1.6; resize:none; overflow-y:auto; padding:10px 14px; font-family:inherit; background:var(--surface); color:var(--text); box-sizing:border-box; outline:none; transition:background .15s; }
        .hc-block .hc-block-ta:focus { background:var(--surface2); }
        .hc-block .hc-block-ta::placeholder { color:var(--text3); font-style:italic; }
        .hc-block-fmt { display:flex; gap:2px; margin-left:auto; margin-right:6px; }
        .hc-block-fmt button { padding:2px 7px; font-size:10px; font-weight:600; background:var(--surface); border:1px solid var(--border); border-radius:4px; cursor:pointer; color:var(--text3); transition:all .12s; font-family:inherit; }
        .hc-block-fmt button:hover { background:var(--primary); color:#fff; border-color:var(--primary); }
        .hc-block-img-row { display:flex; gap:10px; padding:10px 14px; }
        .hc-block-img-row input { flex:1; font-size:12.5px; padding:8px 12px; border:2px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text); font-family:inherit; transition:all .2s; outline:none; }
        .hc-block-img-row input:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(13,148,136,.1); }
        .hc-block-img-row input::placeholder { color:var(--text3); font-style:italic; }
        .hc-block-add-row { display:flex; gap:6px; padding:8px 0 0; flex-wrap:wrap; }
        .hc-block-add-row button { border:1px dashed var(--border); background:none; font-size:11px; font-weight:600; padding:5px 12px; border-radius:6px; cursor:pointer; color:var(--text3); transition:all .15s; font-family:inherit; }
        .hc-block-add-row button:hover { border-color:var(--primary); color:var(--primary); }
        .hc-code-toggle { margin-left:auto!important; gap:4px!important; }
        .hc-code-toggle.active { background:var(--primary)!important; color:#fff!important; border-color:var(--primary)!important; }
        @media(max-width:768px) {
            .hc-editor-toolbar-v2 { gap:2px; padding:5px 6px; }
            .hc-editor-toolbar-v2 button { padding:4px 8px; font-size:10.5px; }
            .hc-block-img-row { flex-direction:column; gap:6px; }
        }
        @media(max-width:480px) {
            .hc-editor-toolbar-v2 button { padding:3px 6px; font-size:10px; }
            .hc-editor-toolbar-v2 button svg { width:11px; height:11px; }
            .toolbar-sep { margin:0 2px; height:16px; }
            .hc-block-editor { padding:8px; gap:6px; min-height:150px; }
            .hc-block .hc-block-ta { padding:8px 10px; font-size:12.5px; }
            .hc-block-header { padding:5px 8px; }
            .hc-block-badge { font-size:9.5px; padding:2px 6px; }
            .hc-block-fmt button { padding:1px 5px; font-size:9px; }
            .hc-block-add-row { gap:4px; }
            .hc-block-add-row button { font-size:10px; padding:4px 8px; }
        }
        .dark-mode .badge-text { background:var(--bg3); color:var(--text3); }
        .dark-mode .badge-step { background:rgba(13,148,136,.15); color:var(--primary3); }
        .dark-mode .badge-tip { background:rgba(5,150,105,.12); color:#6ee7b7; }
        .dark-mode .badge-warning { background:rgba(217,119,6,.12); color:#fcd34d; }
        .dark-mode .badge-image { background:rgba(124,58,237,.15); color:var(--purple2); }
        .dark-mode .hc-block-actions button.block-remove:hover { color:var(--red); background:rgba(220,38,38,.1); }
        /* Popup inserir imagem */
        .hc-img-slug-popup { position:absolute; top:100%; right:0; z-index:50; width:280px; background:var(--surface); border:1px solid var(--border); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.15); padding:8px 0; margin-top:4px; }
        .hc-img-slug-popup .popup-title { padding:6px 14px 8px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--text3); border-bottom:1px solid var(--border); margin-bottom:4px; }
        .hc-img-slug-popup .slug-item { display:flex; align-items:center; gap:8px; padding:7px 14px; cursor:pointer; font-size:12.5px; color:var(--text); transition:background .12s; }
        .hc-img-slug-popup .slug-item:hover { background:var(--surface2); }
        .hc-img-slug-popup .slug-item.disabled { opacity:.45; cursor:default; }
        .hc-img-slug-popup .slug-item.disabled:hover { background:transparent; }
        .hc-img-slug-popup .slug-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
        .hc-img-slug-popup .slug-dot.uploaded { background:var(--green); }
        .hc-img-slug-popup .slug-dot.empty { background:var(--border); }
        .hc-img-slug-popup .slug-label { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .hc-img-slug-popup .slug-hint { font-size:10.5px; color:var(--text3); }
        .hc-img-slug-popup .slug-sep { height:1px; background:var(--border); margin:4px 0; }
        .hc-img-slug-popup .slug-manual { padding:7px 14px; cursor:pointer; font-size:12px; color:var(--primary); font-weight:500; transition:background .12s; }
        .hc-img-slug-popup .slug-manual:hover { background:var(--surface2); }
        /* Mobile: modal full-screen */
        @media (max-width:640px) {
            #hcArticleModal .modal, #hcEditModal .modal { max-width:100%; width:100%; border-radius:0; height:100vh; max-height:100vh; margin:0; }
            .hc-modal-meta { grid-template-columns:1fr; }
        }
        /* Tabs e preview do editor */
        .hc-editor-tabs { display:flex; gap:0; border-bottom:1px solid var(--border); }
        .hc-editor-tab { padding:7px 18px; font-size:12px; font-weight:600; cursor:pointer; border:none; background:none; color:var(--text3); border-bottom:2px solid transparent; transition:all .15s; }
        .hc-editor-tab:hover { color:var(--text); }
        .hc-editor-tab.active { color:var(--primary); border-bottom-color:var(--primary); }
        .hc-editor-preview { padding:16px; border:1px solid var(--border); border-top:none; border-radius:0 0 8px 8px; min-height:180px; max-height:400px; overflow-y:auto; background:var(--surface); }

        /* Empty states */
        .hc-empty { text-align:center; padding:48px 20px; }
        .hc-empty svg { display:block; margin:0 auto 12px; opacity:.35; }
        .hc-empty .hc-empty-title { font-size:15px; font-weight:600; color:var(--text2); margin-bottom:4px; }
        .hc-empty .hc-empty-sub { font-size:13px; color:var(--text3); }

        @media(max-width:600px) {
            .hc-related-card { max-width:100%; }
        }

        /* Admin HelpCenter */
        .hc-admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
        .hc-admin-table th { text-align: left; padding: 8px 10px; background: var(--surface3); font-weight: 600; color: var(--text2); border-bottom: 1px solid var(--border); }
        .hc-admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
        .hc-admin-table tr:hover td { background: var(--surface2); }
        .hc-status-badge { padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; }
        .hc-status-published { background: #ecfdf5; color: #059669; }
        .hc-status-draft { background: #fffbeb; color: #d97706; }
        .dark-mode .hc-status-published { background: rgba(5,150,105,.15); }
        .dark-mode .hc-status-draft { background: rgba(217,119,6,.15); }

        /* Imagens nos artigos */
        .hc-article-body .hc-img-wrap { margin: 14px 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface3); }
        .hc-article-body .hc-img-wrap img { width: 100%; display: block; cursor: pointer; transition: opacity .2s; }
        .hc-article-body .hc-img-wrap img:hover { opacity: .9; }
        .hc-article-body .hc-img-placeholder { padding: 24px; text-align: center; color: var(--text3); font-size: 12px; }

        /* Admin: Gerenciador de imagens por slot */
        .hci-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
        .hci-slot { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: all .2s; }
        .hci-slot:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
        .hci-slot-img { position: relative; height: 140px; background: var(--surface3); display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; }
        .hci-slot-img img { width: 100%; height: 100%; object-fit: cover; }
        .hci-slot-img .hci-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text3); font-size: 12px; }
        .hci-slot-img .hci-empty svg { opacity: .4; }
        .hci-slot-badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; background: rgba(0,0,0,.6); color: #fff; backdrop-filter: blur(4px); max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .hci-slot-status { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; }
        .hci-slot-status.uploaded { background: var(--green); }
        .hci-slot-status.empty { background: var(--text3); }
        .hci-slot-info { padding: 10px 12px; }
        .hci-slot-label { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
        .hci-slot-desc { font-size: 11px; color: var(--text3); line-height: 1.4; }
        .hci-slot-cat { font-size: 10px; color: var(--primary); font-weight: 600; margin-bottom: 4px; }
        .hci-slot-actions { display: flex; gap: 4px; margin-top: 8px; }
        .hci-slot-actions button { flex: 1; }
        .hci-slot-size { font-size: 10px; color: var(--text3); margin-top: 4px; }
        .hci-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
        .hci-tab { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text2); cursor: pointer; font-size: 12px; font-weight: 500; transition: all .15s; }
        .hci-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
        .hci-tab:hover:not(.active) { border-color: var(--primary); }
        .hci-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 12px; color: var(--text2); }
        .hci-progress-bar { flex: 1; height: 6px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
        .hci-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary2)); border-radius: 3px; transition: width .3s; }

        @media(max-width:640px) {
            .hci-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
            .hci-slot-img { height: 100px; }
        }

        @media(max-width:640px) {
            .hc-categories { grid-template-columns: repeat(2, 1fr); gap: 10px; }
            .hc-category-card { padding: 14px 10px; }
            .hc-category-card .hc-cat-icon { width: 28px; height: 28px; margin-bottom: 8px; }
            .hc-category-card .hc-cat-icon svg { width: 28px; height: 28px; }
            .hc-article-view { padding: 20px 16px; }
            .helpcenter-page { padding: 16px 12px; }
        }

        /* ==================== RELATÓRIOS ==================== */
        .rp-tabs {
            display: flex;
            gap: 4px;
            border-bottom: 1px solid var(--border);
            margin-bottom: 4px;
            flex-wrap: wrap;
        }
        .rp-tab {
            padding: 12px 18px;
            background: none;
            border: none;
            border-bottom: 2px solid transparent;
            cursor: pointer;
            font-weight: 500;
            font-size: 13.5px;
            color: var(--text2);
            transition: color .15s, border-color .15s;
            margin-bottom: -1px;
            position: relative;
        }
        .rp-tab:hover:not(:disabled) { color: var(--text) }
        .rp-tab.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
            font-weight: 600;
        }
        .rp-tab:disabled { color: var(--text3); cursor: not-allowed; opacity: .55 }
        .rp-tab .rp-tab-soon {
            font-size: 9px;
            background: var(--surface3);
            color: var(--text3);
            padding: 2px 6px;
            border-radius: 8px;
            margin-left: 6px;
            text-transform: uppercase;
            letter-spacing: .5px;
            font-weight: 600;
        }

        .rp-toolbar {
            display: flex;
            gap: 12px;
            align-items: center;
            flex-wrap: wrap;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 12px 16px;
        }
        .rp-toolbar label {
            font-size: 12px;
            color: var(--text3);
            text-transform: uppercase;
            letter-spacing: .3px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
            white-space: nowrap;
        }
        .rp-toolbar select {
            font-size: 13px;
            padding: 7px 10px;
            border: 1px solid var(--border);
            background: var(--surface);
            color: var(--text);
            border-radius: 8px;
            font-weight: 500;
            cursor: pointer;
            min-width: 140px;
        }
        .rp-toolbar select:focus { outline: 2px solid var(--primary); outline-offset: 1px }
        .rp-toolbar .rp-toolbar-spacer { flex: 1 }
        .rp-export-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 14px;
            background: var(--primary);
            color: #fff;
            border: none;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: background .15s, transform .12s;
        }
        .rp-export-btn:hover { background: var(--primary2); transform: translateY(-1px) }
        .rp-export-btn:active { transform: translateY(0) }

        /* Stat cards específicos: o icone usa cores semânticas */
        .rp-stat-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0 }
        .rp-stat-icon.teal { background: rgba(13,148,136,.1); color: var(--primary) }
        .rp-stat-icon.gray { background: var(--surface3); color: var(--text3) }
        .rp-stat-icon.amber { background: rgba(217,119,6,.1); color: var(--yellow) }
        .rp-stat-icon.green { background: rgba(5,150,105,.1); color: var(--green) }
        .rp-stat-icon.red { background: rgba(220,38,38,.1); color: var(--red) }
        .rp-stat-icon.blue { background: rgba(37,99,235,.1); color: var(--blue) }

        /* Barras horizontais (origem / lost) */
        .rp-bar-row {
            display: grid;
            grid-template-columns: minmax(160px, 1.4fr) 4fr minmax(110px, auto);
            align-items: center;
            gap: 14px;
            padding: 8px 0;
            font-size: 13px;
        }
        .rp-bar-row + .rp-bar-row { border-top: 1px dashed var(--border) }
        .rp-bar-name {
            color: var(--text);
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
        }
        .rp-bar-name .rp-bar-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
        .rp-bar-kind-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0 }
        .rp-bar-kind-dot.paid { background: var(--blue) }
        .rp-bar-kind-dot.organic { background: var(--green) }
        .rp-bar-kind-dot.other { background: var(--text3) }
        .rp-bar-kind-dot.lost { background: var(--red) }
        .rp-bar-track {
            position: relative;
            background: var(--surface3);
            border-radius: 999px;
            height: 10px;
            overflow: hidden;
        }
        .rp-bar-fill {
            position: absolute;
            top: 0; left: 0;
            height: 100%;
            border-radius: 999px;
            transition: width .35s cubic-bezier(.4,0,.2,1);
        }
        .rp-bar-fill.paid { background: linear-gradient(90deg, var(--blue), #60a5fa) }
        .rp-bar-fill.organic { background: linear-gradient(90deg, var(--green), #34d399) }
        .rp-bar-fill.other { background: linear-gradient(90deg, var(--text3), var(--border2)) }
        .rp-bar-fill.lost { background: linear-gradient(90deg, var(--red), #f87171) }
        .rp-bar-value {
            text-align: right;
            color: var(--text);
            font-weight: 600;
            font-variant-numeric: tabular-nums;
            white-space: nowrap;
        }
        .rp-bar-value .rp-bar-pct {
            color: var(--text3);
            font-size: 12px;
            font-weight: 500;
            margin-left: 4px;
        }

        /* Tabela */
        .rp-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
        .rp-table th {
            text-align: left;
            padding: 12px 14px;
            border-bottom: 1px solid var(--border);
            color: var(--text3);
            font-weight: 600;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: .4px;
            background: var(--surface2);
            white-space: nowrap;
        }
        .rp-table th.num { text-align: right }
        .rp-table th.danger { color: var(--red) }
        .rp-table th.warn { color: var(--orange) }
        .rp-table th.success { color: var(--green) }
        .rp-table td {
            padding: 12px 14px;
            border-bottom: 1px solid var(--border);
            color: var(--text);
        }
        .rp-table td.num { text-align: right; font-variant-numeric: tabular-nums }
        .rp-table tbody tr { transition: background .12s }
        .rp-table tbody tr:hover { background: var(--surface2) }
        .rp-table tbody tr:last-child td { border-bottom: none }
        .rp-table .num-strong { font-weight: 600 }
        .rp-table .num-muted { color: var(--text3) }
        .rp-table .conv-pill {
            display: inline-block;
            padding: 3px 10px;
            border-radius: 999px;
            font-weight: 700;
            font-size: 12px;
            font-variant-numeric: tabular-nums;
        }
        .rp-table .conv-pill.high { background: rgba(5,150,105,.12); color: var(--green) }
        .rp-table .conv-pill.mid  { background: rgba(234,88,12,.12); color: var(--orange) }
        .rp-table .conv-pill.low  { background: rgba(220,38,38,.12); color: var(--red) }
        .rp-table .conv-pill.none { background: var(--surface3); color: var(--text3) }

        /* Funil */
        .rp-funnel-stage {
            display: grid;
            grid-template-columns: 40px 1fr;
            gap: 16px;
            align-items: stretch;
            padding: 14px 0;
        }
        .rp-funnel-stage + .rp-funnel-stage { border-top: 1px solid var(--border) }
        .rp-funnel-step-num {
            width: 36px;
            height: 36px;
            border-radius: 12px;
            background: rgba(13,148,136,.1);
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 14px;
            font-variant-numeric: tabular-nums;
            margin-top: 2px;
        }
        .rp-funnel-stage-body { display: flex; flex-direction: column; gap: 8px; min-width: 0 }
        .rp-funnel-stage-row {
            display: grid;
            grid-template-columns: 1fr minmax(110px, auto);
            gap: 14px;
            align-items: center;
        }
        .rp-funnel-stage-name { font-weight: 600; color: var(--text); font-size: 13.5px }
        .rp-funnel-stage-meta { color: var(--text3); font-size: 12px; margin-top: 1px }
        .rp-funnel-stage-count { font-size: 22px; font-weight: 700; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; line-height: 1 }
        .rp-funnel-stage-count .rp-funnel-stage-pct { font-size: 12px; font-weight: 500; color: var(--text3); margin-left: 4px }

        /* Aviso de incoerência */
        .rp-callout {
            display: flex;
            gap: 12px;
            padding: 14px 16px;
            border-radius: 10px;
            font-size: 13px;
            line-height: 1.5;
            align-items: flex-start;
        }
        .rp-callout.warn {
            background: rgba(217,119,6,.08);
            border-left: 3px solid var(--yellow);
            color: var(--text);
        }
        .rp-callout.warn .rp-callout-icon { color: var(--yellow); flex-shrink: 0; margin-top: 1px }
        .rp-callout strong { color: var(--text) }
        .rp-callout em { color: var(--text2); font-style: normal; font-weight: 500 }

        /* Listas: segmented control */
        .rp-segmented {
            display: inline-flex;
            background: var(--surface3);
            border-radius: 10px;
            padding: 4px;
            gap: 2px;
        }
        .rp-segmented button {
            padding: 7px 14px;
            background: transparent;
            border: none;
            color: var(--text2);
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            border-radius: 7px;
            transition: background .15s, color .15s;
            white-space: nowrap;
        }
        .rp-segmented button:hover { color: var(--text) }
        .rp-segmented button.active {
            background: var(--surface);
            color: var(--text);
            font-weight: 600;
            box-shadow: 0 1px 3px rgba(0,0,0,.06);
        }

        .rp-list-info {
            font-size: 13px;
            color: var(--text2);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .rp-list-info-count {
            font-weight: 700;
            color: var(--text);
            background: var(--surface3);
            padding: 2px 10px;
            border-radius: 999px;
            font-variant-numeric: tabular-nums;
            font-size: 12px;
        }

        /* Avatar / inicial nas listas */
        .rp-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary), var(--primary2));
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 700;
            text-transform: uppercase;
            flex-shrink: 0;
        }
        .rp-avatar.lid { background: linear-gradient(135deg, var(--text3), var(--border2)) }

        .rp-contact-cell {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
        }
        .rp-contact-name {
            color: var(--text);
            font-weight: 500;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .rp-lid-tag {
            font-size: 9px;
            background: var(--surface3);
            color: var(--text3);
            padding: 2px 6px;
            border-radius: 4px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: .3px;
        }
        .rp-phone-mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; color: var(--text2) }
        .rp-phone-empty { color: var(--text3); font-style: italic; font-size: 12.5px }
        .rp-age-cell { white-space: nowrap; text-align: right; color: var(--text2) }
        .rp-age-date { font-size: 12px }
        .rp-age-rel { font-size: 11px; margin-top: 2px }
        .rp-age-rel.fresh { color: var(--text3) }
        .rp-age-rel.warn { color: var(--yellow); font-weight: 600 }
        .rp-age-rel.danger { color: var(--orange); font-weight: 600 }
        .rp-age-rel.crit { color: var(--red); font-weight: 700 }
        .rp-label-chip {
            display: inline-block;
            padding: 3px 9px;
            font-size: 11px;
            background: var(--surface3);
            color: var(--text2);
            border-radius: 999px;
            margin: 2px 2px;
            white-space: nowrap;
            font-weight: 500;
        }
        .rp-msg-preview {
            color: var(--text2);
            font-size: 12.5px;
            max-width: 320px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .rp-msg-preview-from-me {
            display: inline-block;
            font-size: 9.5px;
            background: rgba(217,119,6,.12);
            color: var(--yellow);
            padding: 2px 6px;
            border-radius: 4px;
            margin-right: 6px;
            font-weight: 700;
            letter-spacing: .3px;
            text-transform: uppercase;
            vertical-align: middle;
        }
        .rp-row-action { color: var(--primary); font-size: 12px; font-weight: 600; white-space: nowrap; opacity: 0; transition: opacity .15s }
        .rp-table tbody tr:hover .rp-row-action { opacity: 1 }
        .rp-table tbody tr.clickable { cursor: pointer }

        /* Estado vazio */
        .rp-empty {
            text-align: center;
            padding: 48px 20px;
            color: var(--text3);
            font-size: 13.5px;
        }
        .rp-empty svg { opacity: .3; margin-bottom: 12px }
        .rp-empty strong { color: var(--text2); display: block; margin-bottom: 4px; font-size: 14px }

        .rp-loading { color: var(--text3); padding: 16px 0; font-size: 13px }
        .rp-section-note { font-size: 12px; color: var(--text3); margin-top: 12px; line-height: 1.5 }
        .rp-section-note strong { color: var(--text2); font-weight: 600 }

        @media (max-width: 768px) {
            .rp-bar-row { grid-template-columns: 1fr; gap: 6px }
            .rp-bar-row .rp-bar-value { text-align: left }
            .rp-funnel-stage { grid-template-columns: 32px 1fr; gap: 10px }
            .stats-grid { grid-template-columns: repeat(2, 1fr) }
        }

        /* Dark mode */
        .dark-mode .rp-toolbar { background: var(--surface) }
        .dark-mode .rp-toolbar select { background: var(--surface3); color: var(--text) }
        .dark-mode .rp-segmented { background: var(--surface3) }
        .dark-mode .rp-segmented button.active { background: var(--surface) }
        .dark-mode .rp-table th { background: var(--surface3) }
        .dark-mode .rp-bar-track { background: var(--surface3) }
        .dark-mode .rp-funnel-step-num { background: rgba(13,148,136,.18) }

        /* === Reports v2: ícones em títulos, deltas, skeletons, empty states, heatmap, print === */
        .chart-card h3 { display: flex; align-items: center; gap: 8px }
        .rp-card-icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--text3) }

        .rp-stat-delta { font-size: 11px; font-weight: 600; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; line-height: 1 }
        .rp-stat-delta.up { color: var(--green) }
        .rp-stat-delta.down { color: var(--red) }
        .rp-stat-delta.flat { color: var(--text3) }
        .rp-stat-delta.muted { color: var(--text3); font-weight: 500 }
        .rp-stat-delta::before { content: ''; width: 0; height: 0; display: inline-block }
        .rp-stat-delta.up::before { border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 5px solid currentColor }
        .rp-stat-delta.down::before { border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor }
        .rp-stat-delta.flat::before { width: 8px; height: 2px; background: currentColor }

        .stat-card .label[title] { cursor: help; border-bottom: 1px dotted var(--border); display: inline-block; padding-bottom: 1px }

        .rp-skeleton { display: flex; flex-direction: column; gap: 10px; padding: 6px 0 }
        .rp-skeleton .rp-sk-bar { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface3) 0%, var(--surface2) 50%, var(--surface3) 100%); background-size: 200% 100%; animation: rpShimmer 1.4s ease-in-out infinite }
        .rp-skeleton .rp-sk-bar.short { width: 40% }
        .rp-skeleton .rp-sk-bar.med   { width: 65% }
        .rp-skeleton .rp-sk-bar.long  { width: 90% }
        .rp-skeleton.dist .rp-sk-bar { height: 28px }
        @keyframes rpShimmer { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
        .dark-mode .rp-skeleton .rp-sk-bar { background: linear-gradient(90deg, var(--surface3) 0%, var(--surface) 50%, var(--surface3) 100%); background-size: 200% 100% }

        .rp-empty.rp-empty-rich { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px 24px; color: var(--text3); text-align: center }
        .rp-empty.rp-empty-rich svg { color: var(--text3); opacity: .55 }
        .rp-empty.rp-empty-rich .rp-empty-title { font-size: 14px; font-weight: 600; color: var(--text2) }
        .rp-empty.rp-empty-rich .rp-empty-msg { font-size: 13px; color: var(--text3); max-width: 360px; line-height: 1.5 }

        .rp-bar-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) 3fr auto; align-items: center; gap: 14px; padding: 6px 0 }
        .rp-bar-track { height: 8px; background: var(--surface3); border-radius: 4px; overflow: hidden; position: relative }
        .rp-bar-track::before, .rp-bar-track::after { content: ''; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); opacity: .5 }
        .rp-bar-track::before { left: 50% }
        .rp-bar-track::after  { left: 75% }
        .rp-bar-fill { height: 100%; border-radius: 4px; transition: width .4s ease }

        .rp-funnel-conv-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; margin-left: auto }
        .rp-funnel-conv-pill.good { background: rgba(5,150,105,.12); color: var(--green) }
        .rp-funnel-conv-pill.mid  { background: rgba(217,119,6,.12); color: var(--yellow) }
        .rp-funnel-conv-pill.bad  { background: rgba(220,38,38,.12); color: var(--red) }
        .rp-funnel-drop { display: flex; align-items: center; justify-content: center; gap: 6px; height: 18px; font-size: 11px; color: var(--text3); position: relative; margin: 2px 0 }
        .rp-funnel-drop::before, .rp-funnel-drop::after { content: ''; flex: 1; height: 1px; background: var(--border) }

        .rp-row-action-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 6px; background: var(--surface3); color: var(--text2); border: 1px solid var(--border); font-size: 12px; font-weight: 500; cursor: pointer; transition: all .12s }
        .rp-row-action-btn:hover { background: var(--primary); color: white; border-color: var(--primary) }

        .rp-heatmap { display: grid; grid-template-columns: 50px repeat(24, 1fr); gap: 2px; font-size: 10px; padding: 8px 0 }
        .rp-heatmap-corner { color: var(--text3); font-size: 10px; text-align: right; padding-right: 6px; align-self: center }
        .rp-heatmap-hour-hdr { color: var(--text3); text-align: center; font-size: 9px; padding-bottom: 2px }
        .rp-heatmap-day-lbl { color: var(--text3); font-size: 11px; text-align: right; padding-right: 6px; align-self: center; font-weight: 500 }
        .rp-heatmap-cell { aspect-ratio: 1; border-radius: 3px; background: var(--surface3); position: relative; cursor: help; transition: transform .12s }
        .rp-heatmap-cell:hover { transform: scale(1.25); z-index: 2; outline: 1px solid var(--primary) }
        .rp-heatmap-cell.s1 { background: rgba(13,148,136,.18) }
        .rp-heatmap-cell.s2 { background: rgba(13,148,136,.36) }
        .rp-heatmap-cell.s3 { background: rgba(217,119,6,.45) }
        .rp-heatmap-cell.s4 { background: rgba(220,38,38,.50) }
        .rp-heatmap-legend { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11px; color: var(--text3); flex-wrap: wrap }
        .rp-heatmap-legend-scale { display: flex; gap: 2px }
        .rp-heatmap-legend-cell { width: 14px; height: 14px; border-radius: 3px }
        @media (max-width: 900px) {
            .rp-heatmap { grid-template-columns: 36px repeat(24, 1fr); font-size: 8px }
            .rp-heatmap-day-lbl { font-size: 10px; padding-right: 3px }
        }

        /* PDF / Print: layout sóbrio sem sidebar/tabs/botões */
        @media print {
            @page { size: A4; margin: 14mm 12mm }
            html, body { background: white !important; color: black !important }
            .sidebar, #appHeader, .nav, .user-menu-wrapper, .rp-tabs, .rp-toolbar,
            .rp-export-btn, .rp-segmented, #rpListInactiveDaysWrap, #rpListByLabelWrap,
            .rp-row-action, .rp-row-action-btn, button, #notifBadge { display: none !important }
            .page, .dashboard-page, #pagereports { display: block !important; padding: 0 !important; background: white !important; overflow: visible !important; height: auto !important }
            .stat-card, .chart-card { break-inside: avoid; page-break-inside: avoid; box-shadow: none !important; border: 1px solid #ddd !important; background: white !important }
            .rp-pane { display: block !important }
            .rp-pane + .rp-pane { page-break-before: always; margin-top: 14mm }
            .stats-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 8px !important }
            .stat-card { padding: 10px !important }
            .stat-card .value { font-size: 18px !important }
            .stat-card .label { font-size: 10px !important }
            .chart-card { padding: 10px !important; margin-top: 10px !important }
            .chart-card h3 { font-size: 12px !important; color: black !important }
            .rp-table th { background: #f3f4f6 !important; color: #111 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact }
            .rp-bar-fill, .rp-heatmap-cell, .conv-pill, .rp-funnel-conv-pill, .rp-stat-icon { -webkit-print-color-adjust: exact; print-color-adjust: exact }
            .rp-print-header { display: flex !important; align-items: center; justify-content: space-between; margin-bottom: 12mm; border-bottom: 2px solid #111; padding-bottom: 6mm }
            .rp-print-header img { height: 36px }
            .rp-print-header .rp-print-meta { font-size: 11px; color: #444; text-align: right }
            .rp-print-footer { display: block !important; position: fixed; bottom: 6mm; left: 0; right: 0; text-align: center; font-size: 9px; color: #777 }
        }
        .rp-print-header, .rp-print-footer { display: none }

