        :root {
            color-scheme: dark;
            /* Cores e Tokens de Alto Contraste */
            --bg-main: #0d0f12;
            --bg-sidebar: #141720;
            --bg-card: #181d28;
            --bg-card-hover: #1e2433;
            --bg-input: #1c212c;
            --bg-msg-user: #222838;
            --text-main: #f8fafc; /* Branco nítido / Alto Contraste */
            --text-body: #e2e8f0; /* Texto de leitura claro */
            --text-muted: #cbd5e1; /* Texto secundário com excelente legibilidade */
            --text-dim: #94a3b8; /* Metadados e carimbos de tempo */
            --primary: var(--tenant-brand-color, #38bdf8); /* Cor dinâmica da marca */
            --accent: color-mix(in srgb, var(--tenant-brand-color, #38bdf8) 85%, black);
            --border-color: rgba(255, 255, 255, 0.14);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', sans-serif;
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
        }

        html {
            color-scheme: dark;
            height: 100%;
            height: 100dvh;
            overflow: hidden;
        }

        /* Scrollbars Universais no Padrão do Design System Kognvs */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.16);
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.32);
        }

        ::-webkit-scrollbar-corner {
            background: transparent;
        }

        body {
            background-color: var(--bg-main);
            color: var(--text-main);
            height: 100%;
            height: 100dvh;
            width: 100%;
            display: flex;
            overflow: hidden;
            position: relative;
        }

        /* Sidebar Limpa e Moderna - Suporte a Modo Dual (Trilho + Submenu) */
        .sidebar {
            width: auto;
            background-color: var(--bg-sidebar);
            display: flex;
            flex-direction: row;
            padding: 0;
            height: 100vh;
            overflow: hidden;
            flex-shrink: 0;
            position: relative;
            z-index: 20;
            box-sizing: border-box;
            border-right: 1px solid rgba(255, 255, 255, 0.06);
        }

        /* --- MÓDULO 1: MENU PRINCIPAL DE NAVEGAÇÃO GLOBAL (Expandível / Colapsável) --- */
        .sidebar-primary-rail {
            width: 230px;
            min-width: 230px;
            max-width: 230px;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: space-between;
            background-color: var(--bg-sidebar, #090d16);
            border-right: 1px solid rgba(255, 255, 255, 0.08);
            padding: 0.75rem 0.65rem 0.5rem 0.65rem;
            box-sizing: border-box;
            position: relative;
            z-index: 2;
            transition: width 0.24s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.24s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.24s cubic-bezier(0.4, 0, 0.2, 1), padding 0.24s ease;
        }

        .rail-header {
            display: flex;
            flex-direction: column;
            gap: 8px;
            width: 100%;
            padding-bottom: 6px;
            flex-shrink: 0;
        }

        .rail-header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
        }

        .rail-header .kognvs-brand-logo-wrap {
            display: flex;
            align-items: center;
            min-height: 36px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .rail-header .kognvs-brand-logo {
            font-family: 'Clash Display', 'Plus Jakarta Sans', sans-serif;
            font-weight: 700;
            font-size: 1.5rem;
            letter-spacing: -0.02em;
            color: var(--text-main);
            text-transform: lowercase;
            user-select: none;
            line-height: 1;
        }

        /* Botão de Recolher/Expandir no topo do Menu Principal */
        .btn-sidebar-collapse {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.08);
            color: var(--text-muted, #94a3b8);
            width: 32px;
            height: 32px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.85rem;
            flex-shrink: 0;
        }

        .btn-sidebar-collapse:hover {
            background: rgba(255, 255, 255, 0.12);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.18);
            transform: scale(1.05);
        }

        /* Workspace Pill da Empresa Ativa */
        .rail-tenant-pill {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 4px 10px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.09);
            border-radius: 6px;
            width: 100%;
            overflow: hidden;
            box-sizing: border-box;
            transition: all 0.2s ease;
        }

        /* Botão de Ação Rápida no Trilho (visível só no modo colapsado) */
        .btn-rail-new-task {
            display: none;
            width: 42px;
            height: 42px;
            margin: 4px auto 10px auto;
            border-radius: 12px;
            background: linear-gradient(135deg, var(--primary, #38bdf8), #0284c7);
            color: #ffffff;
            border: none;
            align-items: center;
            justify-content: center;
            font-size: 1.05rem;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            flex-shrink: 0;
        }

        .btn-rail-new-task:hover {
            transform: scale(1.08);
            box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
        }

        /* Abas no Menu Principal */
        .rail-nav-tabs {
            display: flex;
            flex-direction: column;
            gap: 4px;
            width: 100%;
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            scrollbar-width: none;
            padding: 4px 0;
        }

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

        .rail-nav-tabs .nav-tab-btn {
            width: 100% !important;
            height: auto !important;
            min-height: 38px !important;
            border-radius: 8px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: flex-start !important;
            padding: 0.45rem 0.65rem !important;
            margin: 0 !important;
            position: relative !important;
            cursor: pointer;
            color: var(--text-muted, #94a3b8);
            background: transparent;
            border: 1px solid transparent;
            transition: all 0.2s ease;
            box-sizing: border-box;
            gap: 10px !important;
        }

        .rail-nav-tabs .nav-tab-btn:hover {
            background: rgba(255, 255, 255, 0.08) !important;
            color: #ffffff !important;
            border-color: rgba(255, 255, 255, 0.12) !important;
        }

        .rail-nav-tabs .nav-tab-btn.active {
            background: rgba(56, 189, 248, 0.14) !important;
            color: var(--primary, #38bdf8) !important;
            border-color: rgba(56, 189, 248, 0.35) !important;
            box-shadow: 0 0 14px rgba(56, 189, 248, 0.2) !important;
        }

        .rail-nav-tabs .nav-tab-btn i {
            font-size: 1rem;
            width: 18px;
            text-align: center;
            flex-shrink: 0;
            margin: 0;
        }

        .rail-nav-tabs .nav-tab-btn .nav-tab-label {
            display: inline-block !important;
            flex: 1 !important;
            text-align: left !important;
            font-size: 0.88rem !important;
            font-weight: 500 !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

        .rail-nav-tabs .nav-tab-btn .nav-tab-add-btn {
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            width: 22px !important;
            height: 22px !important;
            margin-left: auto !important;
            border-radius: 6px;
            color: var(--text-muted);
            transition: all 0.2s ease;
        }

        .rail-nav-tabs .nav-tab-btn .nav-tab-add-btn:hover {
            background: rgba(255, 255, 255, 0.15);
            color: #ffffff;
        }

        .rail-nav-tabs .nav-tab-btn .nav-tab-badge {
            margin-left: 6px;
            padding: 1px 6px;
            border-radius: 10px;
            font-size: 0.72rem;
            background: rgba(56, 189, 248, 0.2);
            color: #38bdf8;
            font-weight: 600;
        }

        /* Perfil no Menu Principal */
        .rail-profile-container {
            width: 100% !important;
            height: auto !important;
            display: flex !important;
            align-items: center !important;
            gap: 10px !important;
            padding: 0.5rem 0.65rem !important;
            margin: 4px 0 0 0 !important;
            cursor: pointer;
            border-radius: 10px;
            transition: all 0.2s ease;
            position: relative;
            flex-shrink: 0;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.06);
            box-sizing: border-box;
            overflow: hidden !important;
        }

        .rail-profile-container:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.12);
        }

        .rail-profile-container .user-profile {
            width: 36px !important;
            height: 36px !important;
            font-size: 0.95rem !important;
            flex-shrink: 0 !important;
        }

        .rail-profile-container .profile-info {
            display: flex !important;
            flex-direction: column !important;
            min-width: 0 !important;
            flex: 1 !important;
            overflow: hidden !important;
        }

        .rail-profile-container .profile-name {
            font-size: 0.85rem !important;
            font-weight: 600 !important;
            color: var(--text-main, #f1f5f9) !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            display: block !important;
            line-height: 1.25 !important;
        }

        .rail-profile-container .profile-badge {
            font-size: 0.72rem !important;
            color: var(--primary, #38bdf8) !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            display: block !important;
            line-height: 1.25 !important;
            margin-top: 2px !important;
        }

        .rail-profile-container .fa-gear {
            flex-shrink: 0 !important;
            margin-left: auto !important;
            color: var(--text-muted, #94a3b8) !important;
            font-size: 0.85rem !important;
            transition: transform 0.2s ease, color 0.2s ease !important;
        }

        .rail-profile-container:hover .fa-gear {
            transform: rotate(45deg);
            color: var(--text-main, #ffffff) !important;
        }

        .rail-profile-container .profile-dropdown {
            left: 0 !important;
            bottom: 50px !important;
            width: 255px !important;
            max-width: none !important;
            z-index: 1050 !important;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
            animation: profileDropdownFlyout 0.16s cubic-bezier(0.16, 1, 0.3, 1) !important;
        }

        /* =========================================================================
           ESTADO COLAPSADO DO MENU PRINCIPAL (.sidebar-primary-rail.collapsed)
           ========================================================================= */
        .sidebar-primary-rail.collapsed,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail {
            width: 68px !important;
            min-width: 68px !important;
            max-width: 68px !important;
            padding: 0.65rem 0.35rem 0.5rem 0.35rem !important;
            align-items: center !important;
        }

        .sidebar-primary-rail.collapsed .rail-header-top,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail .rail-header-top {
            flex-direction: column !important;
            gap: 8px !important;
            align-items: center !important;
        }

        .sidebar-primary-rail.collapsed .kognvs-brand-logo-wrap,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail .kognvs-brand-logo-wrap {
            display: none !important;
        }

        .sidebar-primary-rail.collapsed .tenant-workspace-name,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail .tenant-workspace-name {
            display: none !important;
        }

        .sidebar-primary-rail.collapsed .rail-tenant-pill,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail .rail-tenant-pill {
            padding: 2px 4px !important;
            border: none !important;
            background: transparent !important;
            width: auto !important;
        }

        .sidebar-primary-rail.collapsed .btn-collapsed-new-task,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail .btn-collapsed-new-task {
            display: flex !important;
        }

        .sidebar-primary-rail.collapsed .nav-tab-btn,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail .nav-tab-btn {
            width: 42px !important;
            height: 42px !important;
            min-height: 42px !important;
            justify-content: center !important;
            padding: 0 !important;
            margin: 0 auto !important;
            border-radius: 12px !important;
            gap: 0 !important;
        }

        .sidebar-primary-rail.collapsed .nav-tab-btn .nav-tab-label,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail .nav-tab-btn .nav-tab-label,
        .sidebar-primary-rail.collapsed .nav-tab-btn .nav-tab-add-btn,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail .nav-tab-btn .nav-tab-add-btn {
            display: none !important;
        }

        .sidebar-primary-rail.collapsed .nav-tab-btn .nav-tab-badge,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail .nav-tab-btn .nav-tab-badge {
            position: absolute !important;
            top: -2px !important;
            right: -2px !important;
            margin: 0 !important;
            padding: 0 !important;
            min-width: 8px !important;
            width: 8px !important;
            height: 8px !important;
            border-radius: 50% !important;
            font-size: 0 !important;
            background: #38bdf8 !important;
            border: 1.5px solid #0f172a !important;
            box-shadow: 0 0 6px rgba(56, 189, 248, 0.8) !important;
        }

        .sidebar-primary-rail.collapsed .rail-profile-container,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail .rail-profile-container {
            width: 44px !important;
            height: 44px !important;
            justify-content: center !important;
            padding: 0 !important;
            margin: 4px auto 0 auto !important;
            border-radius: 12px !important;
            background: transparent !important;
            border-color: transparent !important;
        }

        .sidebar-primary-rail.collapsed .profile-info,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail .profile-info,
        .sidebar-primary-rail.collapsed .rail-profile-container .fa-gear,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail .rail-profile-container .fa-gear {
            display: none !important;
        }

        .sidebar-primary-rail.collapsed .profile-dropdown,
        #app-sidebar.sidebar-collapsed .sidebar-primary-rail .profile-dropdown {
            left: 72px !important;
            bottom: 4px !important;
        }

        /* --- MÓDULO 2: SUBMENU / PAINEL DEDICADO DE CHATS (~270px) --- */
        .sidebar-chat-panel {
            width: 270px;
            min-width: 270px;
            max-width: 270px;
            height: 100vh;
            display: flex;
            flex-direction: column;
            background: rgba(13, 19, 33, 0.95);
            backdrop-filter: blur(16px);
            border-right: 1px solid rgba(255, 255, 255, 0.08);
            padding: 0.75rem 0.65rem 0.5rem 0.65rem;
            box-sizing: border-box;
            overflow: hidden;
            transition: width 0.24s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.24s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.24s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, padding 0.24s ease;
            position: relative;
            z-index: 1;
        }

        .sidebar-chat-panel.collapsed {
            width: 0 !important;
            min-width: 0 !important;
            max-width: 0 !important;
            padding: 0 !important;
            opacity: 0 !important;
            pointer-events: none !important;
            border-right: none !important;
        }

        .chat-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.25rem 0.3rem 0.65rem 0.3rem;
            flex-shrink: 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            margin-bottom: 8px;
        }

        .chat-panel-header-left {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .chat-panel-header-icon {
            color: var(--primary, #38bdf8);
            font-size: 0.95rem;
        }

        .chat-panel-header-title {
            font-size: 0.92rem;
            font-weight: 700;
            color: var(--text-main);
            margin: 0;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .chat-panel-count-badge {
            background: rgba(255, 255, 255, 0.08);
            color: var(--text-muted, #94a3b8);
            font-size: 0.72rem;
            font-weight: 600;
            padding: 1px 7px;
            border-radius: 10px;
            margin-left: 6px;
        }

        .btn-collapse-chat-panel {
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            color: var(--text-muted, #94a3b8);
            width: 28px;
            height: 28px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.75rem;
        }

        .btn-collapse-chat-panel:hover {
            background: rgba(255, 255, 255, 0.12);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.18);
            transform: scale(1.05);
        }

        /* Botão Nova Conversa no Painel */
        .btn-new-chat-panel {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: 100%;
            height: 38px;
            border-radius: 10px;
            background: rgba(56, 189, 248, 0.12);
            border: 1px solid rgba(56, 189, 248, 0.25);
            color: #38bdf8;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            margin-bottom: 8px;
            flex-shrink: 0;
        }

        .btn-new-chat-panel:hover {
            background: var(--primary, #38bdf8);
            color: #090d16;
            transform: translateY(-1px);
            box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
        }

        .sidebar-chat-controls-pane {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
            height: 100%;
            overflow: hidden;
        }

        .sidebar-chat-controls-pane #projects-container {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding-right: 2px;
            min-height: 0;
        }

        /* Botão de Expandir Painel de Conversas no Topbar */
        .btn-expand-chat-panel-topbar {
            display: none;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: var(--text-main);
            font-size: 0.82rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-right: 6px;
            flex-shrink: 0;
        }

        .btn-expand-chat-panel-topbar:hover {
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.2);
            color: #38bdf8;
            transform: translateY(-1px);
        }

        body.chat-panel-collapsed .btn-expand-chat-panel-topbar {
            display: inline-flex !important;
        }

        /* --- ESTADO COLAPSADO (.sidebar.collapsed) --- */
        .sidebar.collapsed {
            width: 68px !important;
            padding: 0.75rem 0.35rem 0.5rem 0.35rem !important;
            overflow: visible !important;
        }

        .sidebar.collapsed .sidebar-header {
            padding: 0.25rem 0 0.65rem 0 !important;
            align-items: center !important;
            gap: 10px !important;
        }

        .sidebar.collapsed .sidebar-header-top {
            flex-direction: column !important;
            gap: 8px !important;
            align-items: center !important;
        }

        .sidebar.collapsed .kognvs-brand-logo-wrap {
            display: none !important;
        }

        .sidebar.collapsed .tenant-workspace-pill {
            display: none !important;
        }

        .sidebar.collapsed .btn-collapsed-new-task {
            display: flex !important;
        }

        .sidebar.collapsed .sidebar-nav-tabs {
            gap: 6px !important;
        }

        .sidebar.collapsed .nav-tab-btn {
            justify-content: center !important;
            align-items: center !important;
            padding: 0 !important;
            position: relative !important;
            gap: 0 !important;
            border-radius: 12px !important;
            width: 42px !important;
            height: 42px !important;
            margin: 0 auto !important;
        }

        .sidebar.collapsed .nav-tab-btn > div {
            justify-content: center !important;
            gap: 0 !important;
            padding: 0 !important;
        }

        .sidebar.collapsed .nav-tab-btn span:not(.nav-tab-badge) {
            display: none !important;
        }

        .sidebar.collapsed .nav-tab-btn i {
            font-size: 1.15rem !important;
            width: auto !important;
            margin: 0 !important;
        }

        .sidebar.collapsed .nav-tab-btn .nav-tab-add-btn {
            display: none !important;
        }

        .sidebar.collapsed .nav-tab-btn .nav-tab-badge {
            position: absolute !important;
            top: -2px !important;
            right: -2px !important;
            padding: 0 !important;
            min-width: 8px !important;
            width: 8px !important;
            height: 8px !important;
            border-radius: 50% !important;
            font-size: 0 !important;
            background: #38bdf8 !important;
            border: 1.5px solid #0f172a !important;
            box-shadow: 0 0 6px rgba(56, 189, 248, 0.8) !important;
        }

        .sidebar.collapsed #sidebar-chat-controls {
            display: none !important;
        }

        .sidebar.collapsed .profile-container {
            justify-content: center !important;
            padding: 0.45rem 0 !important;
            gap: 0 !important;
            position: relative !important;
            overflow: visible !important;
        }

        .sidebar.collapsed .profile-info,
        .sidebar.collapsed .profile-container .fa-gear {
            display: none !important;
        }

        .sidebar.collapsed .user-profile {
            width: 38px !important;
            height: 38px !important;
            font-size: 0.95rem !important;
        }

        .sidebar.collapsed .profile-dropdown {
            left: 72px !important;
            bottom: 4px !important;
            width: 255px !important;
            max-width: none !important;
            z-index: 1050 !important;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
            animation: profileDropdownFlyout 0.16s cubic-bezier(0.16, 1, 0.3, 1) !important;
        }

        /* Listra Grossa de Identidade da Empresa / Tenant (Definida pelo CEO) */
        .tenant-color-stripe {
            width: 100%;
            height: 6px;
            border-radius: 4px;
            background: var(--tenant-brand-color, #38bdf8);
            box-shadow: 0 0 12px var(--tenant-brand-glow, rgba(56, 189, 248, 0.45));
            margin-bottom: 4px;
            flex-shrink: 0;
            transition: background 0.3s ease, box-shadow 0.3s ease;
        }

        .sidebar-header {
            padding: 0.25rem 0.45rem 0.65rem 0.45rem;
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 600;
            font-size: 1.15rem;
            color: var(--text-main);
            flex-shrink: 0;
        }

        .kognvs-brand-logo {
            font-family: 'Clash Display', 'Plus Jakarta Sans', sans-serif;
            font-weight: 700;
            font-size: 1.6rem;
            letter-spacing: -0.02em;
            color: var(--text-main);
            text-transform: lowercase;
            user-select: none;
            line-height: 1.1;
        }

        /* Workspace Pill da Empresa Ativa (Sem ícone de seta) */
        .tenant-workspace-pill {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 4px 10px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.09);
            border-radius: 6px;
            width: 100%;
            overflow: hidden;
            box-sizing: border-box;
            transition: all 0.2s ease;
        }

        .tenant-workspace-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--tenant-brand-color, #38bdf8);
            box-shadow: 0 0 8px var(--tenant-brand-color, #38bdf8);
            flex-shrink: 0;
            display: inline-block;
            transition: background 0.3s ease, box-shadow 0.3s ease;
        }

        .tenant-workspace-name {
            font-size: 0.78rem;
            font-weight: 600;
            color: var(--text-body);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            letter-spacing: 0.2px;
        }

        /* Botões de Predefinição de Cores da Empresa */
        .color-preset-btn {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, 0.2);
            cursor: pointer;
            transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
            padding: 0;
        }
        .color-preset-btn:hover {
            transform: scale(1.2);
            border-color: #ffffff;
            box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
        }

        .btn-new-chat {
            background-color: color-mix(in srgb, var(--tenant-brand-color, #38bdf8) 8%, transparent);
            color: var(--tenant-brand-color, #38bdf8);
            border: 1px solid color-mix(in srgb, var(--tenant-brand-color, #38bdf8) 20%, transparent);
            border-radius: 8px;
            padding: 0.5rem 0.75rem;
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 500;
            transition: all 0.2s ease;
            margin-bottom: 0.5rem;
            width: 100%;
            flex-shrink: 0;
        }

        .btn-new-chat:hover {
            background-color: color-mix(in srgb, var(--tenant-brand-color, #38bdf8) 15%, transparent);
            border-color: color-mix(in srgb, var(--tenant-brand-color, #38bdf8) 35%, transparent);
            color: var(--tenant-brand-color, #38bdf8);
            box-shadow: 0 4px 12px color-mix(in srgb, var(--tenant-brand-color, #38bdf8) 10%, transparent);
            transform: translateY(-1px);
        }

        .btn-stop-op {
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.2);
            color: #ef4444;
            font-size: 0.7rem;
            cursor: pointer;
            font-weight: 600;
            padding: 4px 10px;
            border-radius: 6px;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            transition: all 0.2s ease;
        }

        .btn-stop-op:hover {
            background: rgba(239, 68, 68, 0.2);
            border-color: rgba(239, 68, 68, 0.4);
            transform: scale(1.02);
        }

        .nav-list {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 0.35rem 0.55rem;
            border-radius: 8px;
            color: var(--text-muted);
            text-decoration: none;
            font-size: 0.80rem;
            line-height: 1.35;
            cursor: pointer;
            transition: background 0.15s, color 0.15s;
        }

        .nav-item:hover {
            background-color: rgba(255, 255, 255, 0.06);
            color: var(--text-main);
        }

        .nav-item.active {
            background-color: rgba(255, 255, 255, 0.09);
            color: #ffffff;
            font-weight: 600;
            border-left: 2.5px solid var(--tenant-brand-color, #38bdf8);
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 2px 8px rgba(0, 0, 0, 0.2);
        }

        /* Indicador de Chat em Processamento Ativo */
        .nav-item.chat-is-processing {
            background: rgba(56, 189, 248, 0.08);
            border-left: 2.5px solid #38bdf8;
            color: #e0f2fe;
        }
        .chat-processing-dot {
            width: 8px;
            height: 8px;
            background: #38bdf8;
            border-radius: 50%;
            margin-right: 8px;
            display: inline-block;
            box-shadow: 0 0 8px #38bdf8;
            animation: pulse-blue 1.4s infinite;
            flex-shrink: 0;
        }
        .chat-status-pill-processing {
            color: #38bdf8;
            font-size: 0.75rem;
            margin-right: 4px;
            display: inline-flex;
            align-items: center;
        }

        /* Indicador de Chat Fixado (Pin) */
        .nav-item.chat-is-pinned {
            background: rgba(245, 158, 11, 0.05);
            border-left: 2.5px solid rgba(245, 158, 11, 0.5);
        }

        /* Indicador de Chat com Pendência / Decisão do CEO (HITL) */
        .nav-item.chat-has-pending-hitl {
            background: rgba(245, 158, 11, 0.08);
            border-left: 2.5px solid #f59e0b;
            color: #fef3c7;
        }
        .nav-item.chat-has-pending-hitl:hover {
            background: rgba(245, 158, 11, 0.14);
        }
        .chat-status-pill-hitl {
            background: rgba(245, 158, 11, 0.16);
            color: #f59e0b;
            border: 1px solid rgba(245, 158, 11, 0.35);
            font-size: 0.62rem;
            font-weight: 700;
            padding: 1px 5px;
            border-radius: 4px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-right: 4px;
            white-space: nowrap;
            animation: pulseSoft 2s infinite ease-in-out;
        }


        .nav-label {
            font-size: 0.72rem;
            font-weight: 500;
            color: #8e918f;
            margin: 0.6rem 0 0.25rem 0.35rem;
            text-transform: none;
            letter-spacing: 0.01em;
        }

        /* Area de Chat */
        .main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            position: relative;
            min-width: 0; /* Previne overflow flex */
        }

        .topbar {
            height: 56px;
            min-height: 56px;
            display: flex;
            align-items: center;
            padding: 0 1.25rem;
            justify-content: space-between;
            gap: 12px;
            background: rgba(13, 16, 23, 0.85);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            position: sticky;
            top: 0;
            z-index: 50;
            box-sizing: border-box;
            width: 100%;
        }

        .topbar-left {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
            flex: 1 1 auto;
            overflow: hidden;
        }

        .topbar-right {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
            min-width: 0;
        }

        .model-selector {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-main);
            font-weight: 500;
            font-size: 1.1rem;
            cursor: pointer;
        }
        
        .model-selector i {
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .user-profile {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background-color: var(--accent);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 600;
            font-size: 0.9rem;
        }

        /* Mensagens - Correção do Scroll */
        .chat-scroll-area {
            flex: 1;
            overflow-y: auto;
            scroll-behavior: auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 2rem;
            min-height: 0; /* Essencial para o scroll funcionar no flexbox */
        }

        .welcome-screen {
            margin: auto;
            text-align: center;
            animation: fadeIn 0.8s ease;
        }

        .welcome-screen h1 {
            font-size: 2.5rem;
            font-weight: 500;
            background: -webkit-linear-gradient(0deg, #4285f4, #d96570, #a8c7fa);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 0.5rem;
        }

        .message-container {
            width: 100%;
            max-width: 1200px;
            display: flex;
            gap: 1.1rem;
            margin-bottom: 2rem;
            animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        }

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

        .message-container.user {
            flex-direction: row-reverse;
        }

        .avatar {
            width: 48px;
            height: 48px;
            border-radius: 13px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            margin-top: 2px;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }

        .avatar.ai {
            background: #0f172a;
            color: #38bdf8;
            border: 2px solid rgba(56, 189, 248, 0.45);
            font-size: 1.25rem;
            box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
        }

        .avatar.ai img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center 15%;
            border-radius: 11px;
            display: block;
            transition: transform 0.25s ease;
        }

        .avatar.ai:hover img {
            transform: scale(1.08);
        }

        .avatar.ai.agent-kognvs {
            border-color: rgba(56, 189, 248, 0.65);
            box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
        }

        .avatar.ai.agent-joao {
            border-color: rgba(168, 85, 247, 0.6);
            box-shadow: 0 0 14px rgba(168, 85, 247, 0.25);
        }

        .avatar.ai.agent-ana {
            border-color: rgba(16, 185, 129, 0.6);
            box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
        }

        .avatar.ai.agent-maya {
            border-color: rgba(249, 115, 22, 0.6);
            box-shadow: 0 0 14px rgba(249, 115, 22, 0.25);
        }

        .stepper-avatar-pulse {
            animation: avatar-pulse-glow 2s infinite alternate ease-in-out;
        }

        @keyframes avatar-pulse-glow {
            0% {
                box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
                transform: scale(1);
            }
            100% {
                box-shadow: 0 0 22px rgba(56, 189, 248, 0.55);
                transform: scale(1.04);
            }
        }

        .avatar.user {
            background: linear-gradient(135deg, #334155, #1e293b);
            color: #94a3b8;
            border: 1px solid rgba(255, 255, 255, 0.12);
            font-size: 0.95rem;
        }

        /* Estrutura do corpo da mensagem */
        .message-body-wrap {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .message-body-wrap.user-body-wrap {
            align-items: flex-end;
        }

        .message-header-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 4px;
            margin-bottom: 2px;
        }

        .msg-author-info {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .msg-author-name {
            font-size: 0.84rem;
            font-weight: 600;
            color: #f1f5f9;
            letter-spacing: 0.01em;
        }

        .msg-author-badge {
            font-size: 0.68rem;
            font-weight: 500;
            color: #38bdf8;
            background: rgba(56, 189, 248, 0.1);
            border: 1px solid rgba(56, 189, 248, 0.25);
            padding: 1px 7px;
            border-radius: 12px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            letter-spacing: 0.02em;
        }

        .msg-meta-info {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .msg-timestamp {
            font-size: 0.72rem;
            color: #64748b;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-variant-numeric: tabular-nums;
        }

        /* Conteúdo da Mensagem */
        .message-content {
            flex: 1;
            color: var(--text-main);
            font-size: 0.925rem;
            line-height: 1.68;
            max-width: 100%;
            word-break: break-word;
        }

        /* Balão do Usuário */
        .message-content.user-bubble {
            background: linear-gradient(135deg, #272a30 0%, #1e2024 100%);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: #f1f5f9;
            padding: 0.75rem 1.15rem;
            border-radius: 18px 18px 4px 18px;
            font-size: 0.915rem;
            line-height: 1.55;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
            max-width: 85%;
        }

        .user-bubble-text {
            white-space: pre-wrap;
            word-break: break-word;
        }

        /* Container do Markdown da IA (Card Elegante com acabamento profissional) */
        .message-content.markdown-body {
            background: rgba(22, 24, 28, 0.55);
            border: 1px solid rgba(255, 255, 255, 0.07);
            border-radius: 14px;
            padding: 1.25rem 1.45rem;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
            color: #e2e8f0;
            font-size: 0.925rem;
            line-height: 1.68;
            letter-spacing: -0.006em;
        }

        /* Tipografia de Markdown da IA (Tamanhos proporcionais, modernos e elegantes) */
        .markdown-body h1 {
            font-size: 1.25rem;
            font-weight: 700;
            color: #ffffff;
            letter-spacing: -0.02em;
            line-height: 1.35;
            margin-top: 1.3rem;
            margin-bottom: 0.55rem;
            padding-bottom: 0.35rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }
        .markdown-body h1:first-child {
            margin-top: 0;
        }

        .markdown-body h2 {
            font-size: 1.1rem;
            font-weight: 600;
            color: #f8fafc;
            letter-spacing: -0.015em;
            line-height: 1.4;
            margin-top: 1.15rem;
            margin-bottom: 0.45rem;
        }
        .markdown-body h2:first-child {
            margin-top: 0;
        }

        .markdown-body h3 {
            font-size: 1.0rem;
            font-weight: 600;
            color: #e2e8f0;
            letter-spacing: -0.01em;
            line-height: 1.45;
            margin-top: 0.95rem;
            margin-bottom: 0.35rem;
        }
        .markdown-body h3:first-child {
            margin-top: 0;
        }

        .markdown-body h4, .markdown-body h5, .markdown-body h6 {
            font-size: 0.925rem;
            font-weight: 600;
            color: #cbd5e1;
            margin-top: 0.8rem;
            margin-bottom: 0.3rem;
        }

        .markdown-body p {
            margin-bottom: 0.85rem;
            line-height: 1.68;
            color: #cbd5e1;
        }
        .markdown-body p:last-child {
            margin-bottom: 0;
        }

        .markdown-body strong, .markdown-body b {
            font-weight: 600;
            color: #ffffff;
        }

        .markdown-body em, .markdown-body i {
            color: #e2e8f0;
        }

        .markdown-body a {
            color: #60a5fa;
            text-decoration: none;
            border-bottom: 1px dashed rgba(96, 165, 250, 0.4);
            transition: all 0.2s ease;
        }
        .markdown-body a:hover {
            color: #93c5fd;
            border-bottom-style: solid;
            border-bottom-color: #93c5fd;
        }

        /* Imagens e Criativos Visuais no Chat / Markdown */
        .markdown-body img {
            max-width: 100%;
            max-height: 480px;
            height: auto;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.12);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
            margin: 14px 0;
            display: block;
            object-fit: contain;
            background: rgba(0, 0, 0, 0.25);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        .markdown-body img:hover {
            transform: scale(1.01);
            box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
        }

        /* Listas Modernas */
        .markdown-body ul, .markdown-body ol {
            margin-top: 0.4rem;
            margin-bottom: 0.85rem;
            padding-left: 1.4rem;
        }
        .markdown-body li {
            margin-bottom: 0.35rem;
            line-height: 1.62;
            color: #cbd5e1;
        }
        .markdown-body li::marker {
            color: #38bdf8;
        }
        .markdown-body ol li::marker {
            color: #94a3b8;
            font-weight: 600;
        }

        /* Tabelas Markdown Customizadas e Responsivas */
        .table-responsive-wrapper, .markdown-body table {
            width: 100%;
            overflow-x: auto;
            margin: 1.15rem 0;
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            background: rgba(15, 17, 21, 0.85);
            box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
            border-collapse: collapse;
        }

        .kognvs-md-table, .markdown-body table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.84rem;
            text-align: left;
        }

        .kognvs-md-table th, .markdown-body th {
            background: rgba(30, 34, 44, 0.95);
            color: #93c5fd;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            padding: 10px 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.12);
            white-space: nowrap;
        }

        .kognvs-md-table td, .markdown-body td {
            padding: 10px 14px;
            color: #cbd5e1;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            line-height: 1.55;
            vertical-align: top;
        }

        .kognvs-md-table tr:nth-child(even), .markdown-body tr:nth-child(even) {
            background: rgba(255, 255, 255, 0.015);
        }

        .kognvs-md-table tr:hover td, .markdown-body tr:hover td {
            background: rgba(56, 189, 248, 0.04);
            color: #f8fafc;
        }

        .kognvs-md-table tr:last-child td, .markdown-body tr:last-child td {
            border-bottom: none;
        }

        /* Blocos de Código (Code Blocks) */
        .code-block-wrapper {
            margin: 1.15rem 0;
            border-radius: 10px;
            overflow: hidden;
            background: #0d1117;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
        }

        .code-block-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 7px 14px;
            background: rgba(255, 255, 255, 0.03);
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }

        .code-lang-label {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.72rem;
            font-weight: 600;
            color: #94a3b8;
            letter-spacing: 0.05em;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .btn-copy-code {
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: #cbd5e1;
            border-radius: 6px;
            padding: 3px 9px;
            font-size: 0.72rem;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 5px;
            transition: all 0.2s ease;
        }

        .btn-copy-code:hover {
            background: rgba(255, 255, 255, 0.14);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.2);
        }

        .markdown-body pre {
            margin: 1.15rem 0;
            padding: 1rem 1.25rem;
            background: #0d1117;
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            overflow-x: auto;
        }

        .code-block-wrapper pre {
            margin: 0 !important;
            border: none !important;
            border-radius: 0 !important;
            background: transparent !important;
        }

        .markdown-body pre code {
            font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
            font-size: 0.84rem;
            line-height: 1.6;
            padding: 0;
            background: transparent;
            color: #e2e8f0;
        }

        /* Código Inline */
        .markdown-body code {
            font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
            font-size: 0.85em;
            background: rgba(56, 189, 248, 0.08);
            color: #38bdf8;
            border: 1px solid rgba(56, 189, 248, 0.2);
            padding: 1.5px 6px;
            border-radius: 4px;
            font-weight: 500;
        }

        /* Callouts / Blockquotes com personalidade */
        .kognvs-callout, .markdown-body blockquote {
            margin: 1.15rem 0;
            padding: 12px 16px;
            border-radius: 8px;
            font-size: 0.88rem;
            line-height: 1.6;
            display: flex;
            flex-direction: column;
            gap: 6px;
            border-left: 4px solid #6366f1;
            background: rgba(99, 102, 241, 0.07);
            color: #cbd5e1;
        }

        .kognvs-callout.quote-note {
            border-left-color: #38bdf8;
            background: rgba(56, 189, 248, 0.08);
        }

        .kognvs-callout.quote-tip {
            border-left-color: #34d399;
            background: rgba(52, 211, 153, 0.08);
        }

        .kognvs-callout.quote-important {
            border-left-color: #a855f7;
            background: rgba(168, 85, 247, 0.08);
        }

        .kognvs-callout.quote-warning {
            border-left-color: #fbbf24;
            background: rgba(251, 191, 36, 0.08);
        }

        .kognvs-callout.quote-caution {
            border-left-color: #f87171;
            background: rgba(248, 113, 113, 0.08);
        }

        .callout-badge {
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.05em;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 2px;
        }

        .callout-badge.note { color: #38bdf8; }
        .callout-badge.tip { color: #34d399; }
        .callout-badge.important { color: #c084fc; }
        .callout-badge.warning { color: #fbbf24; }
        .callout-badge.caution { color: #f87171; }

        /* Divisores */
        .kognvs-divider-wrap {
            padding: 0.75rem 0;
        }
        .kognvs-divider {
            border: none;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
            margin: 0;
        }

        /* Barra de Ações Rápidas da Resposta */
        .message-actions-toolbar {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 6px;
            padding: 2px 4px;
            opacity: 0.75;
            transition: opacity 0.2s ease;
        }

        .message-body-wrap:hover .message-actions-toolbar {
            opacity: 1;
        }

        .btn-msg-action {
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.07);
            color: #94a3b8;
            border-radius: 7px;
            padding: 4px 10px;
            font-size: 0.74rem;
            font-weight: 500;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            transition: all 0.2s ease;
        }

        .btn-msg-action i {
            color: inherit;
        }

        .btn-msg-action:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #f1f5f9;
            border-color: rgba(255, 255, 255, 0.16);
        }

        .btn-msg-action.copied {
            background: rgba(74, 222, 128, 0.12);
            color: #4ade80;
            border-color: rgba(74, 222, 128, 0.3);
        }

        .btn-msg-action.speaking {
            background: rgba(248, 113, 113, 0.15);
            color: #f87171;
            border-color: rgba(248, 113, 113, 0.3);
        }

        .btn-msg-action.btn-fact-check,
        .btn-msg-action.btn-fact-check.btn-fact-verified,
        .btn-msg-action.btn-fact-check.btn-fact-autocorrected,
        .btn-msg-action.btn-fact-check.btn-fact-warning,
        .btn-msg-action.btn-execution-steps,
        .btn-msg-action.btn-regenerate {
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.07);
            color: #94a3b8;
            box-shadow: none;
            font-weight: 500;
        }

        .btn-msg-action.btn-fact-check:hover,
        .btn-msg-action.btn-fact-check.btn-fact-verified:hover,
        .btn-msg-action.btn-fact-check.btn-fact-autocorrected:hover,
        .btn-msg-action.btn-fact-check.btn-fact-warning:hover,
        .btn-msg-action.btn-execution-steps:hover,
        .btn-msg-action.btn-regenerate:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #f1f5f9;
            border-color: rgba(255, 255, 255, 0.16);
            box-shadow: none;
        }

        .btn-msg-action.btn-execution-steps.active {
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.2);
            color: #f1f5f9;
            box-shadow: none;
        }

        .btn-msg-action.loading {
            opacity: 0.7;
            pointer-events: none;
            background: rgba(255, 255, 255, 0.08);
        }

        /* User Message Actions Toolbar */
        .user-body-wrap {
            position: relative;
        }

        .user-actions-toolbar {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 6px;
            justify-content: flex-end;
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        .message-container.user:hover .user-actions-toolbar {
            opacity: 1;
        }

        .btn-user-action {
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: #94a3b8;
            border-radius: 6px;
            padding: 3px 8px;
            font-size: 0.7rem;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            transition: all 0.2s ease;
        }

        .btn-user-action:hover {
            background: rgba(255, 255, 255, 0.14);
            color: #f8fafc;
            border-color: rgba(255, 255, 255, 0.22);
        }

        /* Inline Message Editor */
        .user-inline-editor {
            width: 100%;
            background: #18191c;
            border: 1px solid rgba(56, 189, 248, 0.35);
            border-radius: 12px;
            padding: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
            margin-top: 4px;
        }

        .user-inline-editor textarea {
            width: 100%;
            min-height: 70px;
            background: transparent;
            border: none;
            color: #f1f5f9;
            font-size: 0.95rem;
            font-family: inherit;
            resize: vertical;
            outline: none;
            line-height: 1.5;
        }

        .user-inline-editor-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
        }

        .user-inline-editor-footer .btn-group {
            display: flex;
            gap: 8px;
        }

        .btn-inline-save {
            background: #0284c7;
            color: #fff;
            border: none;
            border-radius: 6px;
            padding: 6px 14px;
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s ease;
        }

        .btn-inline-save:hover {
            background: #0369a1;
            box-shadow: 0 0 10px rgba(2, 132, 199, 0.4);
        }

        .btn-inline-cancel {
            background: rgba(255, 255, 255, 0.08);
            color: #94a3b8;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 6px;
            padding: 6px 12px;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .btn-inline-cancel:hover {
            background: rgba(255, 255, 255, 0.14);
            color: #f1f5f9;
        }

        /* ==========================================================================
           BALÃO DE MENSAGEM ENFILEIRADA (ESMAECIDA & INTERATIVA)
           Permite ao CEO visualizar, editar e cancelar demandas antes de serem processadas
           ========================================================================== */
        .message-container.message-queued {
            opacity: 0.88;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            animation: fadeInQueue 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .message-container.message-queued:hover {
            opacity: 1;
        }

        .message-content.user-bubble.queued-bubble {
            background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
            border: 1px dashed rgba(56, 189, 248, 0.5);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 16px rgba(56, 189, 248, 0.08);
            position: relative;
        }

        .queued-status-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 8px;
            padding-bottom: 6px;
            border-bottom: 1px solid rgba(56, 189, 248, 0.18);
        }

        .queued-status-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 0.74rem;
            font-weight: 700;
            color: #38bdf8;
            letter-spacing: 0.3px;
        }

        .queued-actions-toolbar {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 10px;
            padding-top: 8px;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
            justify-content: flex-end;
        }

        .btn-queue-action {
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: #94a3b8;
            border-radius: 6px;
            padding: 4px 10px;
            font-size: 0.74rem;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            transition: all 0.2s ease;
        }

        .btn-queue-action:hover {
            color: #f8fafc;
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.22);
        }

        .btn-queue-action.btn-queue-edit:hover {
            color: #38bdf8;
            border-color: rgba(56, 189, 248, 0.45);
            background: rgba(56, 189, 248, 0.15);
        }

        .btn-queue-action.btn-queue-cancel:hover {
            color: #fb7185;
            border-color: rgba(244, 63, 94, 0.45);
            background: rgba(244, 63, 94, 0.15);
        }

        @keyframes fadeInQueue {
            from {
                opacity: 0;
                transform: translateY(8px);
            }
            to {
                opacity: 0.88;
                transform: translateY(0);
            }
        }

        /* Selos de Auto-Auditoria Factual no Cabeçalho */
        .msg-fact-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.2px;
            cursor: pointer;
            transition: all 0.2s ease;
            user-select: none;
        }

        .msg-fact-badge:hover {
            transform: translateY(-1px);
            filter: brightness(1.15);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
        }

        .msg-fact-badge.badge-fact-checked {
            background: rgba(16, 185, 129, 0.14);
            color: #34d399;
            border: 1px solid rgba(16, 185, 129, 0.35);
        }

        .msg-fact-badge.badge-auto-corrected {
            background: rgba(56, 189, 248, 0.14);
            color: #38bdf8;
            border: 1px solid rgba(56, 189, 248, 0.35);
            animation: pulseSubtle 2s infinite ease-in-out;
        }

        .msg-fact-badge.badge-fact-warning {
            background: rgba(245, 158, 11, 0.14);
            color: #fbbf24;
            border: 1px solid rgba(245, 158, 11, 0.35);
        }

        @keyframes pulseSubtle {
            0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
            50% { box-shadow: 0 0 8px 1px rgba(56, 189, 248, 0.25); }
        }

        /* Cartão de Auditoria de Veracidade Factual */
        .chat-fact-check-card {
            margin-top: 14px;
            background: linear-gradient(145deg, #131720, #0f1117);
            border: 1px solid rgba(56, 189, 248, 0.3);
            border-radius: 12px;
            padding: 16px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(56, 189, 248, 0.08);
            animation: factCheckSlideDown 0.3s ease-out;
            position: relative;
        }

        @keyframes factCheckSlideDown {
            from { opacity: 0; transform: translateY(-8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .fact-check-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
            flex-wrap: wrap;
            gap: 8px;
        }

        .fact-check-title {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.88rem;
            font-weight: 700;
            color: #e2e8f0;
        }

        .fact-check-badge-score {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 0.76rem;
            font-weight: 700;
            letter-spacing: 0.3px;
        }

        .fact-check-badge-score.status-verificado {
            background: rgba(16, 185, 129, 0.15);
            color: #34d399;
            border: 1px solid rgba(16, 185, 129, 0.4);
        }

        .fact-check-badge-score.status-atencao {
            background: rgba(245, 158, 11, 0.15);
            color: #fbbf24;
            border: 1px solid rgba(245, 158, 11, 0.4);
        }

        .fact-check-badge-score.status-divergente {
            background: rgba(239, 68, 68, 0.15);
            color: #f87171;
            border: 1px solid rgba(239, 68, 68, 0.4);
        }

        .fact-check-summary {
            font-size: 0.84rem;
            color: #cbd5e1;
            line-height: 1.45;
            margin-bottom: 12px;
            padding: 8px 12px;
            background: rgba(255, 255, 255, 0.03);
            border-radius: 8px;
            border-left: 3px solid #38bdf8;
        }

        .fact-check-items-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .fact-check-item {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 8px;
            padding: 10px 12px;
            font-size: 0.82rem;
            transition: background 0.2s ease;
        }

        .fact-check-item:hover {
            background: rgba(255, 255, 255, 0.04);
        }

        .fact-check-item-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 4px;
        }

        .fact-check-item-claim {
            font-weight: 600;
            color: #f1f5f9;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .fact-tag {
            font-size: 0.7rem;
            padding: 2px 7px;
            border-radius: 4px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.4px;
        }

        .fact-tag.tag-verificado {
            background: rgba(16, 185, 129, 0.2);
            color: #10b981;
        }

        .fact-tag.tag-inconclusivo {
            background: rgba(245, 158, 11, 0.2);
            color: #f59e0b;
        }

        .fact-tag.tag-divergente {
            background: rgba(239, 68, 68, 0.2);
            color: #ef4444;
        }

        .fact-check-item-detail {
            color: #94a3b8;
            font-size: 0.78rem;
            line-height: 1.4;
            margin-top: 4px;
        }

        .fact-check-item-source {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            color: #38bdf8;
            font-size: 0.72rem;
            margin-top: 6px;
            background: rgba(56, 189, 248, 0.08);
            padding: 2px 6px;
            border-radius: 4px;
        }

        .btn-close-fact-check {
            background: transparent;
            border: none;
            color: #64748b;
            cursor: pointer;
            font-size: 0.85rem;
            padding: 4px;
            transition: color 0.2s ease;
        }

        .btn-close-fact-check:hover {
            color: #f1f5f9;
        }

        /* Cartão de Rastreabilidade de Execução, Ferramentas & Equipe */
        .chat-execution-steps-card {
            margin-top: 14px;
            background: linear-gradient(145deg, #131724, #0e111a);
            border: 1px solid rgba(99, 102, 241, 0.35);
            border-radius: 12px;
            padding: 16px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 18px rgba(99, 102, 241, 0.12);
            animation: factCheckSlideDown 0.3s ease-out;
            position: relative;
        }

        .execution-steps-card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
            flex-wrap: wrap;
            gap: 8px;
        }

        .execution-steps-card-title {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.88rem;
            font-weight: 700;
            color: #e2e8f0;
        }

        .execution-steps-badge-count {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 3px 10px;
            border-radius: 20px;
            font-size: 0.76rem;
            font-weight: 700;
            background: rgba(99, 102, 241, 0.18);
            color: #a5b4fc;
            border: 1px solid rgba(99, 102, 241, 0.4);
        }

        .execution-collab-section {
            margin-bottom: 12px;
            padding: 10px 12px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 8px;
        }

        .execution-collab-label {
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #94a3b8;
            margin-bottom: 8px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .execution-collab-pills {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .execution-collab-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: rgba(56, 189, 248, 0.08);
            border: 1px solid rgba(56, 189, 248, 0.25);
            padding: 3px 9px 3px 6px;
            border-radius: 16px;
            font-size: 0.76rem;
            color: #e0f2fe;
        }

        .execution-collab-avatar {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.65rem;
            background: var(--primary, #38bdf8);
            color: #fff;
            overflow: hidden;
        }

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

        .execution-steps-timeline {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .execution-step-item {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 8px;
            padding: 8px 12px;
            font-size: 0.82rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            transition: background 0.2s ease;
        }

        .execution-step-item:hover {
            background: rgba(255, 255, 255, 0.04);
        }

        .execution-step-item-left {
            display: flex;
            align-items: center;
            gap: 9px;
            color: #f1f5f9;
        }

        .execution-step-item-right {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        /* Input Area Fixada no Fundo */
        .input-area-container {
            width: 100%;
            padding: 0 2rem 2rem 2rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            background: linear-gradient(180deg, transparent, var(--bg-main) 30%);
        }

        /* Input Box Estilo Glassmorphism de Alto Contraste */
        .input-box {
            width: 100%;
            max-width: 1200px;
            background: rgba(26, 31, 42, 0.92);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 24px;
            padding: 1rem 1.25rem 0.75rem 1.25rem;
            display: flex;
            border: 1px solid rgba(255, 255, 255, 0.13);
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
        }

        .input-box:focus-within {
            background: rgba(30, 37, 50, 0.98);
            border-color: color-mix(in srgb, var(--primary, #38bdf8) 60%, rgba(255, 255, 255, 0.3));
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px color-mix(in srgb, var(--primary, #38bdf8) 35%, transparent);
        }

        /* Temas Cromáticos por Modo de Execução */
        .input-box.mode-automatico {
            border-color: rgba(16, 185, 129, 0.25);
        }
        .input-box.mode-automatico:focus-within {
            border-color: rgba(16, 185, 129, 0.65);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(16, 185, 129, 0.35);
        }

        .input-box.mode-planejar {
            border-color: rgba(56, 189, 248, 0.32);
            background: rgba(22, 30, 44, 0.94);
        }
        .input-box.mode-planejar:focus-within {
            border-color: rgba(56, 189, 248, 0.75);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(56, 189, 248, 0.4);
        }

        .input-box.mode-manual {
            border-color: rgba(168, 85, 247, 0.32);
            background: rgba(28, 24, 42, 0.94);
        }
        .input-box.mode-manual:focus-within {
            border-color: rgba(168, 85, 247, 0.75);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(168, 85, 247, 0.4);
        }

        .input-box.mode-autonomo,
        .input-box.cmd-goal {
            border-color: rgba(245, 158, 11, 0.38);
            background: rgba(36, 28, 18, 0.94);
        }
        .input-box.mode-autonomo:focus-within,
        .input-box.cmd-goal:focus-within {
            border-color: rgba(245, 158, 11, 0.8);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(245, 158, 11, 0.45);
        }

        /* Comandos Especiais (/forcatarefa, /consultoria, /memorizar, /automacao) */
        .input-box.cmd-forcatarefa {
            border-color: rgba(99, 102, 241, 0.45);
            background: rgba(25, 27, 46, 0.94);
        }
        .input-box.cmd-forcatarefa:focus-within {
            border-color: rgba(99, 102, 241, 0.85);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(99, 102, 241, 0.45);
        }

        .input-box.cmd-consultoria {
            border-color: rgba(236, 72, 153, 0.4);
            background: rgba(38, 22, 34, 0.94);
        }
        .input-box.cmd-consultoria:focus-within {
            border-color: rgba(236, 72, 153, 0.8);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(236, 72, 153, 0.45);
        }

        .input-box.cmd-memorizar {
            border-color: rgba(20, 184, 166, 0.4);
            background: rgba(18, 34, 34, 0.94);
        }
        .input-box.cmd-memorizar:focus-within {
            border-color: rgba(20, 184, 166, 0.8);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(20, 184, 166, 0.45);
        }

        .input-box.cmd-automacao {
            border-color: rgba(234, 179, 8, 0.4);
            background: rgba(34, 30, 18, 0.94);
        }
        .input-box.cmd-automacao:focus-within {
            border-color: rgba(234, 179, 8, 0.8);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(234, 179, 8, 0.45);
        }

        /* Ponto Indicador Luminoso do Modo Ativo */
        .mode-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            display: inline-block;
            margin-right: 4px;
            flex-shrink: 0;
            transition: all 0.25s ease;
        }

        .input-box textarea {
            width: 100%;
            background: transparent;
            border: none;
            color: #f8fafc;
            padding: 0;
            font-size: 0.96rem;
            resize: none;
            outline: none;
            max-height: 180px;
            min-height: 28px;
            overflow-y: auto;
            line-height: 1.55;
            font-family: inherit;
        }

        .input-box textarea::placeholder {
            color: #94a3b8;
            opacity: 0.9;
        }

        /* Toolbar Inferior de Ações */
        .input-toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 10px;
            padding-top: 6px;
        }

        .input-toolbar-left {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .input-toolbar-right {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn-tool-circle {
            background: rgba(255, 255, 255, 0.08);
            color: #cbd5e1;
            border: 1px solid rgba(255, 255, 255, 0.12);
            width: 34px;
            height: 34px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.9rem;
        }

        .btn-tool-circle:hover {
            background: rgba(255, 255, 255, 0.16);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.25);
            transform: scale(1.04);
        }

        .btn-tool-circle.recording {
            background: rgba(239, 68, 68, 0.22) !important;
            color: #ef4444 !important;
            border-color: #ef4444 !important;
            box-shadow: 0 0 14px rgba(239, 68, 68, 0.55);
            animation: pulse-mic 1.2s infinite ease-in-out;
        }

        @keyframes pulse-mic {
            0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
            70% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
            100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
        }

        .btn-send-circle {
            background: rgba(255, 255, 255, 0.08);
            color: #94a3b8;
            border: 1px solid rgba(255, 255, 255, 0.1);
            width: 34px;
            height: 34px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.9rem;
        }

        .btn-send-circle.active {
            background: #ffffff;
            color: #0f172a;
            box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
        }

        .btn-send-circle.active:hover {
            transform: scale(1.06);
            background: #f8fafc;
        }

        .upload-preview-item {
            background-color: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.1);
            padding: 4px 10px;
            border-radius: 10px;
            font-size: 0.8rem;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: #cbd5e1;
            box-shadow: 0 2px 6px rgba(0,0,0,0.2);
            transition: all 0.2s ease;
        }
        .upload-preview-item.youtube-preview-item {
            background-color: rgba(239, 68, 68, 0.1);
            border-color: rgba(239, 68, 68, 0.25);
            color: #fecaca;
        }
        .upload-preview-item .btn-remove-preview {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 2px 4px;
            font-size: 0.72rem;
            line-height: 1;
            border-radius: 4px;
            display: inline-flex;
            align-items: center;
            transition: all 0.15s;
            margin-left: 2px;
        }
        .upload-preview-item .btn-remove-preview:hover {
            color: #ef4444;
            background: rgba(239, 68, 68, 0.18);
        }
        .upload-preview-item.upload-preview-image {
            padding: 3px 8px 3px 4px;
            background: rgba(15, 23, 42, 0.7);
            border-color: rgba(56, 189, 248, 0.3);
        }
        .chat-input-wrapper.drag-over-input {
            border-color: var(--tenant-brand-color, #38bdf8) !important;
            box-shadow: 0 0 16px rgba(56, 189, 248, 0.35) !important;
            background: rgba(56, 189, 248, 0.05) !important;
        }
        .sidebar-section-antigos .sidebar-section-header:hover,
        .sidebar-section-archived .sidebar-section-header:hover {
            background: rgba(148, 163, 184, 0.08);
        }
        .sidebar-section-antigos .nav-item,
        .sidebar-section-archived .nav-item {
            opacity: 0.85;
        }
        .sidebar-section-antigos .nav-item:hover,
        .sidebar-section-archived .nav-item:hover {
            opacity: 1;
        }
        .chat-archived-banner {
            animation: fadeInBanner 0.3s ease-out;
        }
        @keyframes fadeInBanner {
            from { opacity: 0; transform: translateY(-6px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* ==========================================================================
           BARRA DE MONITORAMENTO DE LOOPS & CUSTOS DA IA (CEO)
           ========================================================================== */
        .ai-cost-meter-container {
            width: 100%;
            max-width: 1024px;
            margin-top: 8px;
            background: rgba(15, 23, 42, 0.4);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 12px;
            padding: 6px 14px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            animation: fadeInCostMeter 0.3s ease-out;
        }

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

        .cost-meter-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 6px;
            font-size: 0.78rem;
        }

        .cost-meter-left {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .cost-meter-pulse-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #10b981;
            box-shadow: 0 0 8px #10b981;
            display: inline-block;
            animation: pulseDotAnim 1.6s infinite ease-in-out;
        }

        @keyframes pulseDotAnim {
            0%, 100% {
                transform: scale(1);
                opacity: 1;
            }
            50% {
                transform: scale(1.3);
                opacity: 0.6;
            }
        }

        .cost-meter-title {
            color: #cbd5e1;
            font-weight: 500;
            font-size: 0.78rem;
            letter-spacing: 0.2px;
        }

        .cost-meter-turn-badge {
            background: rgba(255, 255, 255, 0.04);
            color: #94a3b8;
            border: 1px solid rgba(255, 255, 255, 0.08);
            padding: 1px 8px;
            border-radius: 6px;
            font-size: 0.72rem;
            font-weight: 500;
        }

        .cost-meter-right {
            display: flex;
            align-items: center;
            gap: 2px;
            font-family: 'JetBrains Mono', monospace, -apple-system, sans-serif;
        }

        .cost-meter-val {
            color: #f8fafc;
            font-weight: 600;
            font-size: 0.78rem;
        }

        .cost-meter-limit {
            color: var(--text-muted, #94a3b8);
            font-size: 0.74rem;
            margin-right: 4px;
        }

        .cost-meter-percent-badge {
            padding: 1px 7px;
            border-radius: 6px;
            font-weight: 500;
            font-size: 0.72rem;
            background: rgba(255, 255, 255, 0.04);
            color: #94a3b8;
            border: 1px solid rgba(255, 255, 255, 0.08);
            transition: all 0.2s ease;
        }

        .cost-meter-chat-total-badge {
            margin-left: 8px;
            padding: 1px 7px;
            border-radius: 6px;
            font-weight: 500;
            font-size: 0.72rem;
            background: rgba(255, 255, 255, 0.04);
            color: #94a3b8;
            border: 1px solid rgba(255, 255, 255, 0.08);
            display: inline-flex;
            align-items: center;
            gap: 4px;
            transition: all 0.2s ease;
        }

        .cost-meter-chat-total-badge i {
            color: inherit;
        }

        .cost-meter-progress-track {
            height: 5px;
            width: 100%;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 4px;
            overflow: hidden;
            position: relative;
        }

        .cost-meter-progress-fill {
            height: 100%;
            border-radius: 4px;
            background: linear-gradient(90deg, #10b981, #06b6d4);
            box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
            transition: width 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
        }

        .cost-meter-progress-fill.warn {
            background: linear-gradient(90deg, #f59e0b, #f97316);
            box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
        }

        .cost-meter-progress-fill.danger {
            background: linear-gradient(90deg, #ef4444, #dc2626);
            box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
            animation: dangerGlow 1.2s infinite alternate;
        }

        @keyframes dangerGlow {
            from { box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
            to { box-shadow: 0 0 14px rgba(239, 68, 68, 0.8); }
        }

        /* Seletor de Fase: Planejamento vs Execução (Sóbrio) */
        .stage-segmented-control {
            display: flex;
            align-items: center;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 18px;
            padding: 2px;
            gap: 2px;
            user-select: none;
        }
        .stage-seg-btn {
            display: flex;
            align-items: center;
            gap: 5px;
            padding: 4px 10px;
            border-radius: 14px;
            font-size: 0.76rem;
            font-weight: 500;
            color: #94a3b8;
            background: transparent;
            border: 1px solid transparent;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .stage-seg-btn:hover {
            color: #ffffff;
        }
        .stage-seg-btn.stage-plan.active {
            background: rgba(255, 255, 255, 0.12);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.15);
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
        }
        .stage-seg-btn.stage-exec.active {
            background: rgba(255, 255, 255, 0.12);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.15);
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
        }

        /* Seletor de Modos */
        .mode-dropdown-container {
            position: relative;
            display: flex;
            align-items: center;
        }

        .btn-mode-toggle {
            background: #1e1f20;
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 20px;
            padding: 6px 14px;
            color: #e3e3e3;
            cursor: pointer;
            font-size: 0.84rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s ease;
            white-space: nowrap;
        }
        .btn-mode-toggle:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.28);
        }

        /* Menu Dropdown Estilo Google Gemini (Material 3 Dark) */
        .mode-dropdown-menu {
            display: none;
            position: absolute;
            bottom: calc(100% + 12px);
            right: 0;
            background-color: #1e1f20;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 24px;
            padding: 8px;
            width: 280px;
            box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.1);
            z-index: 100;
            backdrop-filter: blur(20px);
        }
        .mode-dropdown-menu.show {
            display: block;
            animation: fadeIn 0.15s ease;
        }
        .dropdown-category-title {
            font-size: 0.68rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #8e918f;
            padding: 6px 14px 4px 14px;
        }
        .dropdown-divider {
            height: 1px;
            background: rgba(255, 255, 255, 0.08);
            margin: 6px 6px;
        }

        /* Itens de Ação Simples (Estilo Menu [+] do Gemini com Título & Descrição) */
        .gemini-action-item {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 9px 12px;
            border-radius: 14px;
            cursor: pointer;
            color: #e3e3e3;
            transition: background 0.15s ease;
            user-select: none;
        }
        .gemini-action-item:hover {
            background-color: rgba(255, 255, 255, 0.08);
        }
        .gemini-action-icon {
            font-size: 1.1rem;
            color: #c4c7c5;
            width: 22px;
            text-align: center;
            flex-shrink: 0;
            transition: color 0.15s ease;
        }
        .gemini-action-item:hover .gemini-action-icon {
            color: #ffffff;
        }
        .gemini-action-text {
            display: flex;
            flex-direction: column;
            gap: 2px;
            flex: 1;
        }
        .gemini-action-title {
            font-size: 0.88rem;
            font-weight: 500;
            color: #e3e3e3;
            line-height: 1.25;
        }
        .gemini-action-desc {
            font-size: 0.74rem;
            color: #8e918f;
            line-height: 1.25;
        }

        /* Itens do Seletor de Modo (Estilo Model Selector do Gemini) */
        .gemini-mode-card {
            display: flex;
            flex-direction: column;
            padding: 10px 14px;
            border-radius: 16px;
            border: 1.5px solid transparent;
            cursor: pointer;
            transition: all 0.15s ease;
            margin-bottom: 2px;
        }
        .gemini-mode-card:hover {
            background-color: rgba(255, 255, 255, 0.06);
        }
        .gemini-mode-card.selected {
            border-color: rgba(255, 255, 255, 0.85);
            background-color: rgba(255, 255, 255, 0.04);
        }
        .gemini-mode-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }
        .gemini-mode-title {
            font-size: 0.88rem;
            font-weight: 500;
            color: #e3e3e3;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .gemini-mode-card.selected .gemini-mode-title {
            color: #ffffff;
            font-weight: 600;
        }
        .gemini-mode-badge {
            font-size: 0.7rem;
            font-weight: 500;
            color: #c4c7c5;
            background: #333537;
            border-radius: 10px;
            padding: 2px 8px;
        }
        .gemini-mode-desc {
            font-size: 0.76rem;
            color: #8e918f;
            margin-top: 3px;
            line-height: 1.3;
        }

        /* =========================================================
           Seletor Flyout de 2 Colunas: Departamentos & Especialistas (Stripe/Linear Style)
           ========================================================= */
        .specialist-dropdown-container {
            position: relative;
            display: flex;
            align-items: center;
            flex-shrink: 0;
            min-width: 0;
        }

        .btn-specialist-toggle {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 20px;
            padding: 5px 12px;
            color: #cbd5e1;
            cursor: pointer;
            font-size: 0.82rem;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 7px;
            transition: all 0.2s ease;
            white-space: nowrap !important;
            max-width: 190px;
            flex-shrink: 0;
            box-sizing: border-box;
        }

        .btn-specialist-toggle:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.15);
        }

        #selected-specialist-label {
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            white-space: nowrap !important;
            display: inline-block !important;
            max-width: 135px;
            vertical-align: middle;
        }

        .ai-provider-select-wrapper,
        .ai-mode-select-wrapper {
            position: relative;
            display: flex;
            align-items: center;
            flex-shrink: 0;
        }

        .select-ai-provider,
        .select-ai-mode {
            appearance: none;
            -webkit-appearance: none;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: var(--text-main, #f1f5f9);
            font-size: 0.78rem;
            font-weight: 600;
            padding: 5px 26px 5px 10px;
            border-radius: 18px;
            cursor: pointer;
            outline: none;
            transition: all 0.2s;
            backdrop-filter: blur(8px);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
            height: 32px;
            max-width: 130px;
            box-sizing: border-box;
            white-space: nowrap;
        }

        .ai-provider-select-wrapper i,
        .ai-mode-select-wrapper i {
            position: absolute;
            right: 9px;
            font-size: 0.65rem;
            color: var(--text-muted, #94a3b8);
            pointer-events: none;
        }

        .specialist-dropdown-menu {
            display: none;
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            background-color: #1a1b1e;
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 16px;
            padding: 0;
            width: 600px;
            max-height: 490px;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 1px rgba(255, 255, 255, 0.1);
            z-index: 150;
            backdrop-filter: blur(20px);
            overflow: hidden;
        }

        .specialist-dropdown-menu.show {
            display: flex;
            animation: fadeIn 0.15s ease;
        }

        /* Coluna da Esquerda: Departamentos */
        .flyout-dept-col {
            width: 230px;
            background: #141518;
            border-right: 1px solid rgba(255, 255, 255, 0.07);
            padding: 10px 8px;
            display: flex;
            flex-direction: column;
            gap: 3px;
            max-height: 490px;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
        }

        .flyout-dept-col::-webkit-scrollbar,
        .flyout-roles-col::-webkit-scrollbar {
            width: 5px;
            height: 5px;
        }

        .flyout-dept-col::-webkit-scrollbar-track,
        .flyout-roles-col::-webkit-scrollbar-track {
            background: transparent;
        }

        .flyout-dept-col::-webkit-scrollbar-thumb,
        .flyout-roles-col::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.16);
            border-radius: 10px;
        }

        .flyout-dept-col::-webkit-scrollbar-thumb:hover,
        .flyout-roles-col::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.32);
        }

        .flyout-dept-header {
            font-size: 0.68rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #64748b;
            padding: 6px 10px 4px 10px;
        }

        .flyout-dept-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 10px;
            border-radius: 8px;
            cursor: pointer;
            color: #94a3b8;
            font-size: 0.82rem;
            font-weight: 500;
            transition: all 0.15s ease;
        }

        .flyout-dept-item:hover {
            background-color: rgba(255, 255, 255, 0.05);
            color: #f1f5f9;
        }

        .flyout-dept-item.active {
            background-color: color-mix(in srgb, var(--tenant-brand-color, #38bdf8) 12%, transparent);
            color: var(--primary);
        }

        .flyout-dept-left {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .flyout-dept-left i {
            font-size: 0.85rem;
            width: 16px;
            text-align: center;
        }

        /* Coluna da Direita: Especialistas */
        .flyout-roles-col {
            flex: 1;
            padding: 12px;
            display: flex;
            flex-direction: column;
            background: #1a1b1e;
            max-height: 490px;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
        }

        .flyout-roles-header {
            font-size: 0.68rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #64748b;
            padding: 0 6px 8px 6px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            margin-bottom: 8px;
        }

        .flyout-role-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 9px 10px;
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.15s ease;
        }

        .flyout-role-item:hover {
            background-color: rgba(255, 255, 255, 0.06);
        }

        .flyout-role-item.selected {
            background-color: rgba(255, 255, 255, 0.08);
        }

        .flyout-role-icon {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.05);
            color: #94a3b8;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            flex-shrink: 0;
        }

        .flyout-role-item.selected .flyout-role-icon,
        .flyout-role-item:hover .flyout-role-icon {
            background: rgba(168, 199, 250, 0.14);
            color: var(--primary);
        }

        .flyout-role-info {
            display: flex;
            flex-direction: column;
            gap: 2px;
            flex: 1;
        }

        .flyout-role-title {
            font-size: 0.86rem;
            font-weight: 500;
            color: #f1f5f9;
        }

        .flyout-role-desc {
            font-size: 0.73rem;
            color: #94a3b8;
        }

        .flyout-role-item .checkmark-icon {
            font-size: 0.82rem;
            color: #38bdf8;
            opacity: 0;
            transition: opacity 0.15s ease;
        }

        .flyout-role-item.selected .checkmark-icon {
            opacity: 1;
        }

        /* =========================================================
           Menu de Autocomplete de Menções (@sdr, @closer, @juridico)
           ========================================================= */
        /* =========================================================
           Antigravity-Style Mention Popup (@ Specialists)
           ========================================================= */
        .mention-popup {
            position: absolute;
            bottom: calc(100% + 10px);
            left: 14px;
            width: 620px;
            max-width: calc(100% - 28px);
            max-height: 290px;
            overflow-y: auto;
            background: rgba(20, 21, 25, 0.97);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            padding: 4px;
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 1px rgba(255, 255, 255, 0.12);
            z-index: 250;
            display: none;
            flex-direction: column;
            gap: 1px;
            animation: fadeIn 0.1s ease;
        }
        .mention-popup.show {
            display: flex !important;
        }
        .mention-dept-header {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.67rem;
            font-weight: 600;
            text-transform: uppercase;
            color: #64748b;
            padding: 7px 8px 3px 8px;
            letter-spacing: 0.5px;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
            margin-top: 3px;
        }
        .mention-dept-header:first-child {
            border-top: none;
            margin-top: 0;
            padding-top: 4px;
        }
        .mention-dept-icon {
            font-size: 0.70rem;
            color: #475569;
        }
        .mention-header {
            font-size: 0.68rem;
            font-weight: 600;
            text-transform: uppercase;
            color: #64748b;
            padding: 4px 8px 3px 8px;
            letter-spacing: 0.5px;
        }
        .mention-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 5px 9px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.1s ease;
            user-select: none;
            line-height: 1.25;
        }
        .mention-item:hover, .mention-item.selected {
            background: rgba(255, 255, 255, 0.07);
        }
        .mention-item.selected {
            background: rgba(255, 255, 255, 0.09);
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
        }
        .mention-icon {
            width: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            color: #94a3b8;
            flex-shrink: 0;
            transition: color 0.1s ease;
        }
        .mention-item:hover .mention-icon, .mention-item.selected .mention-icon {
            color: #f1f5f9;
        }
        .mention-tag {
            font-weight: 600;
            color: #e2e8f0;
            font-family: 'JetBrains Mono', 'Consolas', monospace;
            font-size: 0.79rem;
            min-width: 90px;
            flex-shrink: 0;
        }
        .mention-item:hover .mention-tag, .mention-item.selected .mention-tag {
            color: #ffffff;
        }
        .mention-desc {
            color: #8590a2;
            font-size: 0.76rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
        }


        /* =========================================================
           Antigravity-Style Slash Command Palette (/ Commands)
           ========================================================= */
        .slash-popup {
            position: absolute;
            bottom: calc(100% + 10px);
            left: 14px;
            width: 620px;
            max-width: calc(100% - 28px);
            max-height: 290px;
            overflow-y: auto;
            background: rgba(20, 21, 25, 0.97);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            padding: 4px;
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 1px rgba(255, 255, 255, 0.12);
            z-index: 250;
            display: none;
            flex-direction: column;
            gap: 1px;
            animation: fadeIn 0.1s ease;
        }
        .slash-popup.show {
            display: flex !important;
        }
        .slash-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 5px 9px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.1s ease;
            user-select: none;
            line-height: 1.25;
        }
        .slash-item:hover, .slash-item.selected {
            background: rgba(255, 255, 255, 0.07);
        }
        .slash-item.selected {
            background: rgba(255, 255, 255, 0.09);
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
        }
        .slash-item-icon {
            width: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            color: #94a3b8;
            flex-shrink: 0;
            transition: color 0.1s ease;
        }
        .slash-item:hover .slash-item-icon, .slash-item.selected .slash-item-icon {
            color: #f1f5f9;
        }
        .slash-item-cmd {
            font-weight: 600;
            color: #e2e8f0;
            font-family: 'JetBrains Mono', 'Consolas', monospace;
            font-size: 0.79rem;
            min-width: 105px;
            flex-shrink: 0;
        }
        .slash-item:hover .slash-item-cmd, .slash-item.selected .slash-item-cmd {
            color: #ffffff;
        }
        .slash-item-desc {
            color: #8590a2;
            font-size: 0.76rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
        }


        /* =========================================================
           Kognvs Stepper & Execution Card (Pilar 1: Stepping & Logs)
           ========================================================= */
        .execution-stepper-card {
            width: 100%;
            max-width: 780px;
            background: rgba(15, 23, 42, 0.25);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 20px;
            padding: 1.25rem 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 1.2rem;
            animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
        }

        .stepper-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            padding-bottom: 0.75rem;
        }

        .stepper-header-left {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .stepper-working-badge {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .stepper-pulse-dot {
            width: 9px;
            height: 9px;
            border-radius: 50%;
            background-color: #38bdf8;
            box-shadow: 0 0 10px #38bdf8;
            animation: pulse-dot 1.8s infinite ease-in-out;
        }

        @keyframes pulse-dot {
            0% { transform: scale(0.85); opacity: 0.6; box-shadow: 0 0 4px #38bdf8; }
            50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px #38bdf8; }
            100% { transform: scale(0.85); opacity: 0.6; box-shadow: 0 0 4px #38bdf8; }
        }

        .stepper-title {
            font-size: 0.95rem;
            font-weight: 600;
            color: #f1f5f9;
            letter-spacing: 0.1px;
        }

        .stepper-persona-badge {
            background: rgba(56, 189, 248, 0.12);
            color: #38bdf8;
            border: 1px solid rgba(56, 189, 248, 0.3);
            border-radius: 16px;
            padding: 3px 10px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        /* Badge de Redação Ativa & Especialista em Execução (Streaming) no Rodapé */
        .streaming-drafting-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            margin-top: 8px;
            margin-bottom: 4px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
            color: #cbd5e1;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 20px;
            padding: 5px 14px 5px 10px;
            font-size: 0.78rem;
            font-weight: 500;
            letter-spacing: 0.01em;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
            user-select: none;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            max-width: 100%;
        }

        .streaming-drafting-badge[data-collab-active="true"] {
            background: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.9) 100%);
            border-color: rgba(255, 255, 255, 0.16);
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 14px rgba(56, 189, 248, 0.12);
        }

        .streaming-drafting-badge.streaming-auditing {
            background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(15, 23, 42, 0.85) 100%);
            border-color: rgba(56, 189, 248, 0.3);
            color: #38bdf8;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), 0 0 12px rgba(56, 189, 248, 0.15);
        }

        .streaming-drafting-badge:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #f8fafc;
            border-color: rgba(255, 255, 255, 0.18);
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
        }

        .streaming-drafting-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background-color: var(--badge-agent-color, #38bdf8);
            box-shadow: 0 0 10px var(--badge-agent-color, #38bdf8);
            display: inline-block;
            flex-shrink: 0;
            animation: pulse-drafting-dot 1.4s ease-in-out infinite;
        }

        .streaming-drafting-dot.dot-done {
            animation: none;
            background-color: #22c55e;
            box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
        }

        @keyframes pulse-drafting-dot {
            0%, 100% { transform: scale(0.85); opacity: 1; }
            50% { transform: scale(1.6); opacity: 0.45; }
        }

        .streaming-drafting-avatar {
            width: 22px;
            height: 22px;
            border-radius: 50%;
            object-fit: cover;
            object-position: center 15%;
            border: 1.5px solid var(--badge-agent-color, #38bdf8);
            box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
            flex-shrink: 0;
            cursor: pointer;
            transition: transform 0.15s ease;
        }

        .streaming-drafting-avatar:hover {
            transform: scale(1.15);
        }

        .streaming-agent-tag-chip {
            font-size: 0.7rem;
            font-weight: 600;
            padding: 1px 7px;
            border-radius: 5px;
            background: rgba(255, 255, 255, 0.07);
            color: var(--badge-agent-color, #38bdf8);
            border: 1px solid rgba(255, 255, 255, 0.12);
            white-space: nowrap;
        }

        .streaming-drafting-icon {
            color: #94a3b8;
            font-size: 0.78rem;
            filter: none;
            display: inline-block;
        }

        @keyframes penWritingSlight {
            0%, 100% {
                transform: rotate(0deg) translateY(0);
                opacity: 0.9;
            }
            50% {
                transform: rotate(-12deg) translateY(-1.5px);
                opacity: 1;
                filter: drop-shadow(0 0 10px rgba(56, 189, 248, 1));
            }
        }

        .stepper-timer {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.8rem;
            color: #94a3b8;
        }

        .stepper-steps-list {
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
            position: relative;
            padding: 0.25rem 0.25rem 0.25rem 0.5rem;
            border-left: 1px solid rgba(255, 255, 255, 0.08);
            margin-left: 0.6rem;
        }

        .step-row {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 0.9rem;
            padding: 2px 0;
            background: transparent;
            transition: all 0.25s ease;
            position: relative;
        }

        .step-row.pending {
            color: #64748b;
            opacity: 0.6;
        }

        .step-row.running {
            color: #f8fafc;
            font-weight: 500;
            background: rgba(56, 189, 248, 0.03);
            border-radius: 8px;
            padding: 6px 12px;
            margin-left: -12px;
            border-left: 2px solid rgba(56, 189, 248, 0.5);
            box-shadow: inset 0 0 10px rgba(56, 189, 248, 0.02);
        }

        .step-row.done {
            color: #cbd5e1;
        }

        .step-icon-wrap {
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.95rem;
            flex-shrink: 0;
            background: transparent; /* Changed from dark bg to transparent to look better with glass */
            border-radius: 50%;
            position: absolute;
            left: -18.5px;
            z-index: 2;
        }

        .step-row.pending .step-icon-wrap {
            color: #64748b;
        }

        .step-row.running .step-icon-wrap {
            color: #38bdf8;
        }

        .step-row.done .step-icon-wrap {
            color: #22c55e;
        }

        .step-text {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 8px;
            padding-left: 14px;
        }

        .step-tool-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: rgba(99, 102, 241, 0.12);
            color: #a5b4fc;
            border: 1px solid rgba(99, 102, 241, 0.25);
            border-radius: 12px;
            padding: 1px 7px;
            font-size: 0.72rem;
            font-weight: 500;
        }

        /* Barra de energia/shimmer de trabalho contínuo */
        .stepper-energy-track {
            width: 100%;
            height: 3px;
            background: rgba(255, 255, 255, 0.04);
            border-radius: 3px;
            overflow: hidden;
            position: relative;
            margin: 2px 0;
        }

        .stepper-energy-shimmer {
            display: none;
        }

        @keyframes energy-slide {
            0% { left: -50%; }
            100% { left: 120%; }
        }

        /* Terminal de Logs Opcional (Gaveta Recolhida) - Glassmorphism */
        .terminal-container {
            border: 1px solid rgba(255, 255, 255, 0.04);
            border-radius: 8px;
            background: rgba(15, 23, 42, 0.3);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            overflow: hidden;
            margin-top: 0.25rem;
            transition: all 0.3s ease;
        }

        .terminal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 6px 12px;
            background: rgba(255, 255, 255, 0.03);
            border-bottom: 1px solid rgba(255, 255, 255, 0.04);
            font-size: 0.73rem;
            color: #94a3b8;
            cursor: pointer;
            user-select: none;
            transition: background 0.2s;
        }

        .terminal-header:hover {
            background: rgba(255, 255, 255, 0.06);
            color: #e2e8f0;
        }

        .terminal-body {
            max-height: 120px;
            overflow-y: auto;
            padding: 8px 12px;
            font-family: 'JetBrains Mono', 'Consolas', monospace;
            font-size: 0.72rem;
            line-height: 1.6;
            color: #94a3b8;
            display: flex;
            flex-direction: column;
            gap: 4px;
            background: transparent;
        }

        .terminal-line {
            word-break: break-all;
            white-space: pre-wrap;
        }

        .terminal-line .t-time {
            color: #475569;
            margin-right: 6px;
        }

        .terminal-line.t-err {
            color: #f87171;
        }

        .terminal-line.t-tool {
            color: #38bdf8;
            font-weight: 500;
        }

        .stepper-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding-top: 0.4rem;
            border-top: 1px solid rgba(255, 255, 255, 0.05);
        }

        .stepper-footer-left {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }

        .stepper-status-label {
            font-size: 0.82rem;
            color: #94a3b8;
        }

        .btn-toggle-dev-logs {
            background: none;
            border: none;
            color: #64748b;
            font-size: 0.75rem;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 2px 6px;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .btn-toggle-dev-logs:hover {
            color: #94a3b8;
            background: rgba(255, 255, 255, 0.04);
        }

        .btn-abort-action {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(220, 38, 38, 0.04) 100%);
            border: 1px solid rgba(239, 68, 68, 0.22);
            color: #fca5a5;
            padding: 5px 12px;
            border-radius: 8px;
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        .btn-abort-action i {
            font-size: 0.72rem;
            color: #ef4444;
            transition: transform 0.2s ease;
        }

        .btn-abort-action:hover {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.22) 0%, rgba(220, 38, 38, 0.16) 100%);
            color: #ffffff;
            border-color: rgba(239, 68, 68, 0.45);
            box-shadow: 0 0 16px rgba(239, 68, 68, 0.35);
            transform: translateY(-1px);
        }

        .btn-abort-action:hover i {
            transform: scale(1.15);
        }

        /* Fallback Legacy Loader */
        .gemini-loader {
            display: flex;
            align-items: center;
            gap: 12px;
            color: var(--primary);
            padding: 0.5rem 0;
        }
        
        .loader-dots {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .loader-dots .dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background-color: var(--primary);
            animation: dot-wave 1.4s infinite ease-in-out both;
        }

        .loader-dots .dot:nth-child(1) { animation-delay: -0.32s; }
        .loader-dots .dot:nth-child(2) { animation-delay: -0.16s; }
        .loader-dots .dot:nth-child(3) { animation-delay: 0s; }
        
        @keyframes dot-wave {
            0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
            40% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 8px rgba(168, 199, 250, 0.6); }
        }

        .profile-container {
            position: relative;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 0.45rem 0.55rem;
            border-radius: 8px;
            margin-top: auto;
            margin-bottom: 0.25rem;
            flex-shrink: 0;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
        }
        
        .profile-container:hover {
            background-color: rgba(255, 255, 255, 0.05);
        }

        .profile-info {
            display: flex;
            flex-direction: column;
        }

        .profile-name {
            font-size: 0.82rem;
            font-weight: 500;
            color: var(--text-main);
        }

        .profile-badge {
            font-size: 0.70rem;
            color: var(--primary);
        }
        
        .profile-dropdown {
            display: none;
            position: absolute;
            left: 6px;
            right: 6px;
            bottom: 58px;
            background: rgba(18, 21, 28, 0.97);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 14px;
            width: auto;
            max-width: 276px;
            padding: 8px;
            box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06);
            z-index: 1000;
            animation: profileDropdownFade 0.15s cubic-bezier(0.16, 1, 0.3, 1);
        }
        
        @keyframes profileDropdownFade {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes profileDropdownFlyout {
            from { opacity: 0; transform: translateX(-8px) scale(0.96); }
            to { opacity: 1; transform: translateX(0) scale(1); }
        }
        
        .profile-dropdown.show {
            display: block;
        }
        
        .profile-dropdown-header {
            padding: 5px 8px 4px;
            font-size: 0.67rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #94a3b8;
            opacity: 0.85;
        }
        
        .profile-dropdown-item {
            padding: 0.48rem 0.65rem;
            color: #cbd5e1;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 0.81rem;
            font-weight: 500;
            border-radius: 7px;
            cursor: pointer;
            transition: all 0.12s ease;
            user-select: none;
        }
        
        .profile-dropdown-item i {
            width: 18px;
            text-align: center;
            font-size: 0.84rem;
            color: #94a3b8;
            flex-shrink: 0;
            transition: color 0.12s ease;
        }
        
        .profile-dropdown-item:hover {
            background-color: rgba(255, 255, 255, 0.06);
            color: #ffffff;
        }

        .profile-dropdown-item:hover i {
            color: #f1f5f9;
        }

        .inner-subtabs-nav {
            display: flex;
            gap: 4px;
            border-bottom: 1px solid var(--border-color);
            margin-bottom: 1.5rem;
            padding-bottom: 0px;
            overflow-x: auto;
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* IE/Edge */
        }

        .inner-subtabs-nav::-webkit-scrollbar {
            display: none; /* Chrome, Safari, Opera */
        }

        .inner-subtab-btn {
            background: transparent;
            border: none;
            border-bottom: 2px solid transparent;
            color: var(--text-muted);
            padding: 8px 12px;
            font-size: 0.84rem;
            font-weight: 500;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            border-radius: 6px 6px 0 0;
            white-space: nowrap;
            letter-spacing: -0.01em;
        }

        .inner-subtab-btn i {
            color: var(--text-dim);
            font-size: 0.86rem;
            transition: color 0.2s ease;
        }

        .inner-subtab-btn:hover {
            color: var(--text-main);
            background: rgba(255, 255, 255, 0.04);
        }

        .inner-subtab-btn:hover i {
            color: var(--text-main);
        }

        .inner-subtab-btn.active {
            color: #ffffff;
            font-weight: 600;
            border-bottom-color: var(--primary);
            background: rgba(56, 189, 248, 0.06);
        }

        .inner-subtab-btn.active i {
            color: var(--primary);
        }

        /* Classes Utilitárias para Configurações (Sóbrio & Premium) */
        .cfg-logo-upload-container {
            display: flex;
            gap: 16px;
            align-items: center;
            flex-wrap: wrap;
            background: rgba(255, 255, 255, 0.02);
            padding: 14px 18px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            margin-top: 6px;
        }

        .cfg-logo-preview-box {
            width: 130px;
            height: 64px;
            border-radius: 8px;
            background: rgba(0, 0, 0, 0.3);
            border: 1px dashed rgba(255, 255, 255, 0.15);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            padding: 4px;
            position: relative;
        }

        .cfg-logo-placeholder {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .cfg-logo-placeholder i {
            font-size: 1.1rem;
            color: var(--text-dim);
        }

        .cfg-logo-upload-actions {
            flex: 1;
            min-width: 220px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .cfg-color-picker-box {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-top: 6px;
            flex-wrap: wrap;
            background: rgba(255, 255, 255, 0.02);
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
        }

        .cfg-color-manual-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-left: auto;
        }

        .cfg-color-manual-wrap input[type="color"] {
            width: 32px;
            height: 32px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            background: transparent;
            padding: 0;
        }

        .cfg-color-manual-wrap input[type="text"] {
            width: 95px;
            text-transform: uppercase;
            font-family: var(--font-mono, monospace);
            font-size: 0.82rem;
            font-weight: 600;
            padding: 4px 8px;
        }

        .cfg-timezone-preview-bar {
            background: rgba(0, 0, 0, 0.25);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 10px;
            padding: 12px 16px;
            margin-top: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 12px;
        }

        .cfg-timezone-icon {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.04);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            font-size: 1.05rem;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .cfg-timezone-label {
            font-size: 0.72rem;
            color: var(--text-muted);
            text-transform: uppercase;
            font-weight: 600;
            letter-spacing: 0.5px;
        }

        .cfg-timezone-time {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-main);
            font-family: 'JetBrains Mono', monospace;
        }

        .cfg-timezone-hint {
            font-size: 0.78rem;
            color: var(--text-muted);
            max-width: 420px;
            line-height: 1.35;
        }

        .cfg-banner-info {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 1.1rem 1.4rem;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .cfg-banner-icon {
            width: 42px;
            height: 42px;
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.05);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            font-size: 1.25rem;
            flex-shrink: 0;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .project-group-wrapper {
            margin-bottom: 2px;
        }

        .project-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.38rem 0.55rem;
            color: var(--text-main);
            font-size: 0.81rem;
            font-weight: 500;
            cursor: pointer;
            border-radius: 8px;
            margin-top: 0.15rem;
            transition: all 0.15s ease;
        }

        .project-header:hover {
            background-color: rgba(255, 255, 255, 0.05);
        }

        .project-header.active-new-chat {
            border: 1px solid var(--primary);
            background-color: rgba(168, 199, 250, 0.05);
        }

        .project-header.drag-over {
            background-color: rgba(255, 255, 255, 0.15);
            border: 1px dashed var(--text-muted);
        }

        .project-header-main {
            display: flex;
            align-items: center;
            gap: 7px;
            min-width: 0;
            flex: 1;
        }

        .project-folder-icon {
            font-size: 0.86rem;
            color: #f59e0b;
            flex-shrink: 0;
            transition: color 0.15s ease, transform 0.15s ease, filter 0.15s ease;
        }

        .project-header:hover .project-folder-icon {
            color: #fbbf24;
        }

        .project-header.open .project-folder-icon {
            color: #fbbf24;
            filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.45));
        }

        .project-title-text {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: 0.81rem;
        }

        .project-count-badge {
            font-size: 0.65rem;
            font-weight: 600;
            color: #94a3b8;
            background: rgba(255, 255, 255, 0.08);
            padding: 1px 5px;
            border-radius: 9999px;
            flex-shrink: 0;
        }

        .project-header-actions {
            display: flex;
            align-items: center;
            gap: 4px;
            flex-shrink: 0;
        }

        .project-chevron {
            transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            font-size: 0.68rem;
            color: #64748b;
            display: inline-block;
        }

        .project-header.open .project-chevron {
            transform: rotate(90deg) !important;
            color: #94a3b8;
        }

        .project-chats {
            display: none;
            padding-left: 0.45rem;
            margin-top: 0.1rem;
        }

        .project-chats.open {
            display: block;
        }

        .project-empty-tasks-hint {
            list-style: none;
            font-size: 0.72rem;
            color: #64748b;
            padding: 4px 10px 4px 22px;
            font-style: italic;
        }

        .project-empty-tasks-hint span {
            cursor: pointer;
            transition: color 0.15s;
        }

        .project-empty-tasks-hint span:hover {
            color: var(--primary);
        }

        /* Seções Estruturadas da Sidebar (Comando Remoto, Projetos, Geral) */
        .sidebar-section {
            display: flex;
            flex-direction: column;
            margin-bottom: 2px;
        }

        .sidebar-section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.42rem 0.7rem;
            margin-top: 2px;
            margin-bottom: 2px;
            user-select: none;
            cursor: pointer;
            border-radius: 8px;
            color: #cbd5e1;
            transition: all 0.15s ease;
        }

        .sidebar-section-header:hover {
            background-color: rgba(255, 255, 255, 0.08);
            color: #ffffff;
        }

        .sidebar-section-left {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
            flex: 1;
        }

        .sidebar-section-icon {
            font-size: 0.95rem;
            width: 18px;
            text-align: center;
            color: inherit;
            opacity: 0.95;
            flex-shrink: 0;
            transition: color 0.15s ease;
        }

        .sidebar-section-projects .sidebar-section-icon {
            color: #f59e0b;
        }

        .sidebar-section-older-projects .sidebar-section-icon {
            color: #d97706;
        }

        .sidebar-section-exec .sidebar-section-icon {
            color: #38bdf8;
        }

        .sidebar-section-geral .sidebar-section-icon {
            color: #a78bfa;
        }

        .sidebar-section-archived .sidebar-section-icon,
        .sidebar-section-archived-projects .sidebar-section-icon {
            color: #94a3b8;
        }

        .sidebar-section-title {
            font-size: 0.84rem;
            font-weight: 500;
            text-transform: none;
            letter-spacing: normal;
            color: inherit;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .sidebar-section-count {
            background: rgba(255, 255, 255, 0.08);
            color: #94a3b8;
            font-size: 0.7rem;
            padding: 1px 7px;
            border-radius: 9999px;
            font-weight: 600;
            font-family: var(--font-mono, monospace);
            line-height: 1.35;
            border: 1px solid rgba(255, 255, 255, 0.08);
            min-width: 18px;
            text-align: center;
            flex-shrink: 0;
            transition: all 0.15s ease;
        }

        .sidebar-section-header:hover .sidebar-section-count {
            background: rgba(255, 255, 255, 0.14);
            color: #f1f5f9;
            border-color: rgba(255, 255, 255, 0.16);
        }

        .sidebar-section-right {
            display: flex;
            align-items: center;
            gap: 4px;
            flex-shrink: 0;
        }

        .sidebar-section-chevron {
            transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            font-size: 0.68rem;
            color: #64748b;
            margin-left: 2px;
            display: inline-block;
        }

        .sidebar-section-header.open .sidebar-section-chevron {
            transform: rotate(90deg) !important;
            color: #94a3b8;
        }

        .sidebar-section-body {
            display: none;
        }

        .sidebar-section-header.open + .sidebar-section-body,
        .sidebar-section-body.open {
            display: block !important;
        }

        /* Subseções Aninhadas dentro da Seção Principal (ex: Projetos Anteriores e Arquivados dentro de Projetos) */
        .sidebar-section-nested {
            margin: 4px 0 2px 0;
            border-radius: 6px;
            background: rgba(0, 0, 0, 0.12);
            border: 1px solid rgba(255, 255, 255, 0.04);
            overflow: hidden;
        }

        .sidebar-section-nested .sidebar-section-header {
            padding: 5px 8px 5px 10px;
            font-size: 0.8rem;
            background: transparent;
            min-height: 28px;
        }

        .sidebar-section-nested .sidebar-section-header:hover {
            background-color: rgba(255, 255, 255, 0.05);
        }

        .sidebar-section-nested .sidebar-section-title {
            font-size: 0.78rem;
            color: #94a3b8;
            font-weight: 500;
        }

        .sidebar-section-nested .sidebar-section-header:hover .sidebar-section-title {
            color: #f1f5f9;
        }

        .sidebar-section-nested .sidebar-section-icon {
            font-size: 0.82rem;
            width: 16px;
        }

        .sidebar-section-nested .sidebar-section-count {
            font-size: 0.65rem;
            padding: 0 5px;
            min-width: 16px;
            line-height: 1.3;
        }

        .sidebar-section-nested .sidebar-section-body {
            padding: 2px 0 2px 4px;
            background: rgba(0, 0, 0, 0.08);
        }

        .btn-add-section-action {
            background: none;
            border: none;
            color: var(--text-muted, #94a3b8);
            cursor: pointer;
            padding: 2px 4px;
            border-radius: 4px;
            font-size: 0.75rem;
            transition: color 0.15s ease, background 0.15s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
        }

        .btn-add-section-action:hover {
            color: var(--text-main, #f8fafc);
            background: rgba(255, 255, 255, 0.08);
        }

        .sidebar-empty-section-hint {
            font-size: 0.74rem;
            color: #64748b;
            padding: 6px 10px;
            background: rgba(255, 255, 255, 0.02);
            border: 1px dashed rgba(255, 255, 255, 0.06);
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin: 2px 4px;
        }

        .sidebar-empty-section-hint button {
            background: none;
            border: none;
            color: var(--primary);
            font-size: 0.72rem;
            cursor: pointer;
            font-weight: 600;
        }

        /* Canais de Comando Remoto (Pills de Status) */
        .channel-status-pill {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 0.63rem;
            font-weight: 600;
            padding: 1px 6px;
            border-radius: 9999px;
            margin-right: 2px;
        }

        .channel-status-pill.tg-pill {
            background: rgba(42, 171, 238, 0.10);
            color: #38bdf8;
            border: 1px solid rgba(42, 171, 238, 0.20);
        }

        .channel-status-pill.wa-pill {
            background: rgba(37, 211, 102, 0.10);
            color: #4ade80;
            border: 1px solid rgba(37, 211, 102, 0.20);
        }

        .channel-live-dot {
            width: 5px;
            height: 5px;
            border-radius: 50%;
        }

        .channel-live-dot.tg-dot {
            background: #38bdf8;
            box-shadow: 0 0 6px #38bdf8;
        }

        .channel-live-dot.wa-dot {
            background: #4ade80;
            box-shadow: 0 0 6px #4ade80;
        }

        .nav-label-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-right: 0.5rem;
            margin-top: 0.25rem;
        }

        .btn-add-project {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            transition: color 0.2s;
            padding: 2px 4px;
        }

        .btn-add-project:hover {
            color: var(--text-main);
        }

        .chat-options {
            opacity: 0;
            transition: opacity 0.2s;
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 2px 4px;
        }

        .nav-item:hover .chat-options, 
        .project-header:hover .chat-options,
        .exec-channel-card:hover .chat-options {
            opacity: 1;
        }

        /* Dropdown Menu Estilo Gemini */
        .kognvs-dropdown {
            position: absolute;
            background-color: #282a2c;
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 8px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
            padding: 4px 0;
            min-width: 140px;
            z-index: 10000;
            display: none;
            flex-direction: column;
        }

        .kognvs-dropdown-item {
            background: none;
            border: none;
            color: var(--text-main);
            padding: 6px 12px;
            text-align: left;
            font-size: 0.80rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
            transition: background-color 0.15s;
        }

        .kognvs-dropdown-item:hover {
            background-color: rgba(255, 255, 255, 0.08);
        }

        .kognvs-dropdown-item i {
            font-size: 0.82rem;
            width: 14px;
            color: var(--text-muted);
        }

        #sidebar-chat-controls {
            display: flex !important;
            flex-direction: column;
            flex: 1 1 auto;
            min-height: 0;
            overflow: hidden;
        }

        #sidebar-chat-controls[style*="display: none"] {
            display: none !important;
        }

        #projects-container {
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto !important;
            overflow-x: hidden;
            padding-right: 4px;
            padding-bottom: 2rem;
            /* Scrollbar suave e visível */
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
        }
        
        #projects-container::-webkit-scrollbar {
            width: 4px;
        }
        #projects-container::-webkit-scrollbar-track {
            background: transparent;
        }
        #projects-container::-webkit-scrollbar-thumb {
            background-color: rgba(255, 255, 255, 0.15);
            border-radius: 4px;
        }
        #projects-container::-webkit-scrollbar-thumb:hover {
            background-color: rgba(255, 255, 255, 0.3);
        }

        .sidebar-divider {
            border: 0;
            height: 1px;
            background-color: var(--border-color);
            margin: 0.6rem 0;
        }

        /* =========================================================
           Multi-View Navigation & Module Tabs
           ========================================================= */
        .sidebar-nav-tabs {
            display: flex;
            flex-direction: column;
            gap: 2px;
            margin-bottom: 0.6rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--border-color);
            flex-shrink: 0;
        }

        .nav-tab-btn {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 0.42rem 0.7rem;
            border-radius: 8px;
            color: #cbd5e1;
            background: transparent;
            border: 1px solid transparent;
            font-size: 0.84rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
            text-align: left;
            width: 100%;
        }

        .nav-tab-btn:hover {
            background-color: rgba(255, 255, 255, 0.08);
            color: #ffffff;
        }

        .nav-tab-btn.active {
            background-color: rgba(255, 255, 255, 0.12);
            color: #ffffff;
            font-weight: 600;
            border-color: rgba(255, 255, 255, 0.15);
        }

        .nav-tab-btn i {
            font-size: 0.95rem;
            width: 18px;
            text-align: center;
            opacity: 0.95;
        }

        .nav-tab-badge {
            margin-left: auto;
            background: rgba(255, 255, 255, 0.08);
            color: #94a3b8;
            font-size: 0.7rem;
            padding: 1px 7px;
            border-radius: 9999px;
            font-weight: 600;
            font-family: var(--font-mono, monospace);
            line-height: 1.35;
            border: 1px solid rgba(255, 255, 255, 0.08);
            transition: all 0.15s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 18px;
        }

        .nav-tab-btn:hover .nav-tab-badge,
        .nav-tab-btn.active .nav-tab-badge {
            background: rgba(255, 255, 255, 0.14);
            color: #f1f5f9;
            border-color: rgba(255, 255, 255, 0.16);
        }

        .nav-tab-badge.active-badge {
            background: rgba(255, 255, 255, 0.12);
            color: #f8fafc;
            border-color: rgba(255, 255, 255, 0.18);
        }

        .nav-tab-badge.badge-notif {
            background: rgba(56, 189, 248, 0.12);
            color: #38bdf8;
            border-color: rgba(56, 189, 248, 0.25);
        }

        .nav-tab-badge.badge-warning {
            background: rgba(245, 158, 11, 0.12);
            color: #fbbf24;
            border-color: rgba(245, 158, 11, 0.28);
        }

        /* Sub-Abas Pills */
        .subnav-pill-container {
            display: flex;
            align-items: center;
            gap: 8px;
            background: #0f1219;
            padding: 4px 6px;
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.14);
            width: fit-content;
            margin-bottom: 0.5rem;
        }

        .subnav-pill {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 0.5rem 1.05rem;
            border-radius: 8px;
            color: #cbd5e1;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .subnav-pill:hover {
            color: #ffffff;
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.25);
        }

        .subnav-pill.active {
            background: #2563eb;
            color: #ffffff;
            border-color: #60a5fa;
            font-weight: 700;
            box-shadow: 0 0 12px rgba(37, 99, 235, 0.45);
        }

        /* =========================================================
           Quadro de Operações & Atividades do Time (Live Feed)
           ========================================================= */
        .live-status-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            background: rgba(34, 197, 94, 0.1);
            border: 1px solid rgba(34, 197, 94, 0.25);
            border-radius: 12px;
            color: #4ade80;
            font-size: 0.76rem;
            font-weight: 600;
            letter-spacing: 0.02em;
        }

        .live-dot-pulse {
            width: 7px;
            height: 7px;
            background: #22c55e;
            border-radius: 50%;
            box-shadow: 0 0 8px #22c55e;
            animation: pulseDot 1.8s infinite;
        }

        @keyframes pulseDot {
            0% { transform: scale(0.95); opacity: 0.7; }
            50% { transform: scale(1.3); opacity: 1; }
            100% { transform: scale(0.95); opacity: 0.7; }
        }

        .operacoes-filter-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 12px;
            background: #141720;
            border: 1px solid rgba(255, 255, 255, 0.14);
            border-radius: 12px;
            padding: 10px 16px;
            margin-bottom: 1.25rem;
        }

        .filter-group {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .filter-select {
            background: #1c212c;
            border: 1px solid rgba(255, 255, 255, 0.18);
            color: #f8fafc;
            padding: 6px 12px;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 500;
            outline: none;
            cursor: pointer;
            transition: border-color 0.2s;
        }

        .filter-select option {
            background: #1c212c;
            color: #f8fafc;
        }

        .filter-select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
        }

        .feed-timeline {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .feed-card {
            background: #1a1b1e;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            padding: 14px 18px;
            transition: all 0.2s ease;
            position: relative;
        }

        .feed-card:hover {
            border-color: rgba(255, 255, 255, 0.16);
            background: #1e1f23;
        }

        .feed-card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 8px;
        }

        .feed-card-badges {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .agent-badge-pill {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 3px 10px;
            border-radius: 6px;
            font-size: 0.78rem;
            font-weight: 600;
            background: rgba(168, 199, 250, 0.12);
            color: #93c5fd;
            border: 1px solid rgba(168, 199, 250, 0.2);
        }

        .channel-badge-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 8px;
            border-radius: 6px;
            font-size: 0.72rem;
            font-weight: 500;
            background: rgba(255, 255, 255, 0.05);
            color: #94a3b8;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .feed-time-text {
            font-size: 0.75rem;
            color: #64748b;
        }

        .feed-card-body {
            font-size: 0.88rem;
            color: #e2e8f0;
            line-height: 1.45;
            margin-bottom: 10px;
        }

        .feed-card-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 8px;
            font-size: 0.75rem;
            color: #94a3b8;
            border-top: 1px solid rgba(255, 255, 255, 0.05);
            padding-top: 8px;
        }

        .tools-tags-container {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .tool-tag {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 7px;
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.04);
            color: #cbd5e1;
            font-size: 0.7rem;
            border: 1px solid rgba(255, 255, 255, 0.06);
        }

        .feed-card-details-toggle {
            cursor: pointer;
            color: #38bdf8;
            font-weight: 500;
            background: none;
            border: none;
            font-size: 0.75rem;
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 0;
        }

        .feed-card-details-drawer {
            display: none;
            margin-top: 10px;
            padding: 10px 14px;
            background: #141517;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.06);
            font-size: 0.8rem;
            color: #cbd5e1;
            white-space: pre-wrap;
            max-height: 220px;
            overflow-y: auto;
        }

        .subtab-pane {
            display: none;
            flex-direction: column;
            gap: 2rem;
            animation: fadeIn 0.2s ease;
        }

        .subtab-pane.active {
            display: flex;
        }

        /* Container de Views */
        .content-view {
            display: none;
            width: 100%;
            height: 100%;
            flex-direction: column;
            overflow-y: auto;
            animation: fadeIn 0.25s ease;
        }

        .content-view.active {
            display: flex;
        }

        #view-chat.content-view {
            height: 100% !important;
            height: 100dvh !important;
            max-height: 100dvh !important;
            overflow: hidden !important;
            flex: 1 1 100% !important;
            min-height: 0 !important;
        }

        #view-chat.content-view.active {
            display: flex !important;
            flex-direction: column !important;
        }

        /* =========================================================
           Dashboard de Automações & Cofre (Pilar 5 e 6)
           ========================================================= */
        .dashboard-container {
            padding: 2rem 3rem;
            max-width: 1200px;
            width: 100%;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            gap: 2rem;
        }

        .view-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 1rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            padding-bottom: 1.5rem;
        }

        .view-header-left h2 {
            font-size: 1.6rem;
            font-weight: 600;
            color: var(--text-main);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .view-header-left p {
            color: var(--text-muted);
            font-size: 0.95rem;
            margin-top: 4px;
        }

        /* Grid de Métricas */
        .metric-cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 1.25rem;
            margin-bottom: 1.5rem;
        }

        .metric-card {
            background: linear-gradient(145deg, #181d28, #131720);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 14px;
            padding: 1.25rem 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 6px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
        }

        .metric-card:hover {
            transform: translateY(-2px);
            border-color: rgba(56, 189, 248, 0.4);
            box-shadow: 0 8px 25px rgba(0,0,0,0.45);
        }

        /* Team Room Layout (Operações) */
        .department-section {
            background: linear-gradient(to bottom right, rgba(30, 31, 34, 0.4), rgba(20, 21, 23, 0.2));
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 20px;
            padding: 1.25rem 1.5rem;
        }

        .team-room-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 1.25rem;
            margin-bottom: 2rem;
        }

        .team-member-card {
            background: linear-gradient(145deg, #18191c, #131416);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 16px;
            padding: 1.25rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            box-shadow: 0 4px 15px rgba(0,0,0,0.15);
            transition: all 0.2s;
        }

        .team-member-card:hover {
            border-color: rgba(255, 255, 255, 0.1);
            background: linear-gradient(145deg, #1c1d21, #151619);
        }

        .member-avatar-wrapper {
            position: relative;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.4rem;
            font-weight: 600;
            color: white;
            flex-shrink: 0;
        }
        
        .member-avatar-wrapper img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }

        .member-status-dot {
            position: absolute;
            bottom: 2px;
            right: 2px;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background-color: #22c55e;
            border: 2px solid #131416;
        }
        
        .member-status-dot.idle {
            background-color: #eab308;
        }

        @keyframes pulse-green {
            0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
            70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
            100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
        }

        .member-status-dot.active {
            animation: pulse-green 2s infinite;
        }

        .member-info {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .member-name {
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--text-main);
        }

        .member-role {
            font-size: 0.75rem;
            color: #94a3b8;
            font-weight: 500;
        }

        .member-activity {
            font-size: 0.7rem;
            color: #64748b;
            margin-top: 4px;
        }
        
        /* Social Feed Layout */
        .social-feed-item {
            display: flex;
            gap: 1rem;
            padding: 1.5rem 0;
            border-bottom: 1px solid rgba(255,255,255,0.06);
            animation: fadeIn 0.3s ease;
        }
        
        .social-feed-item:last-child {
            border-bottom: none;
        }

        .feed-item-active-pulse {
            background: rgba(56, 189, 248, 0.04);
            border-radius: 12px;
            padding: 1rem !important;
            margin-bottom: 8px;
            border: 1px solid rgba(56, 189, 248, 0.25) !important;
            box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
        }
        
        .social-feed-avatar {
            width: 40px;
            height: 40px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            font-weight: 600;
            color: white;
            flex-shrink: 0;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.12);
        }

        .social-feed-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 11px;
        }
        
        .social-feed-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        
        .social-feed-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .social-feed-author {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-main);
        }
        
        .social-feed-time {
            font-size: 0.75rem;
            color: #64748b;
        }
        
        .social-feed-action {
            font-size: 0.85rem;
            color: #cbd5e1;
            line-height: 1.4;
            background: rgba(255,255,255,0.03);
            padding: 12px 16px;
            border-radius: 0 12px 12px 12px;
            border: 1px solid rgba(255,255,255,0.05);
            display: inline-block;
            margin-top: 4px;
        }
        
        .social-feed-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 8px;
        }

        .metric-card .m-title {
            font-size: 0.82rem;
            color: #cbd5e1;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .metric-card .m-value {
            font-size: 2rem;
            font-weight: 800;
            color: #ffffff;
            line-height: 1.15;
            margin: 2px 0;
        }

        .metric-card .m-sub {
            font-size: 0.82rem;
            color: #cbd5e1;
            font-weight: 500;
            line-height: 1.35;
        }

        /* Seções e Tabelas */
        .section-card {
            background: #18191b;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 14px;
            overflow: hidden;
            box-shadow: 0 6px 25px rgba(0,0,0,0.25);
        }

        .section-card-header {
            padding: 1.25rem 1.5rem;
            background: #1f2023;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .section-card-header h3 {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text-main);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .modern-table {
            width: 100%;
            border-collapse: collapse;
            text-align: left;
            font-size: 0.9rem;
        }

        .modern-table th {
            padding: 0.9rem 1.25rem;
            background: rgba(0, 0, 0, 0.2);
            color: var(--text-muted);
            font-weight: 500;
            font-size: 0.8rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }

        .modern-table td {
            padding: 1rem 1.25rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.04);
            color: var(--text-main);
            vertical-align: middle;
        }

        .table-responsive-wrapper {
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        .table-responsive-wrapper::-webkit-scrollbar {
            height: 6px;
        }
        .table-responsive-wrapper::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.2);
        }
        .table-responsive-wrapper::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.15);
            border-radius: 4px;
        }
        .table-responsive-wrapper::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.25);
        }

        .agenda-modern-table {
            width: 100%;
            border-collapse: collapse;
            table-layout: auto;
        }
        .agenda-modern-table th,
        .agenda-modern-table td {
            padding: 0.75rem 0.65rem;
        }
        .agenda-modern-table th:first-child,
        .agenda-modern-table td:first-child {
            padding-left: 1rem;
        }
        .agenda-modern-table th:last-child,
        .agenda-modern-table td:last-child {
            padding-right: 1.25rem;
        }

        .modern-table tr:hover td {
            background-color: rgba(255, 255, 255, 0.02);
        }

        /* Paginação de Tabelas */
        .table-pagination-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: rgba(0, 0, 0, 0.2);
            border-top: 1px solid rgba(255, 255, 255, 0.06);
            flex-wrap: wrap;
            gap: 12px;
        }
        .table-pagination-footer .pagination-info {
            font-size: 0.82rem;
            color: var(--text-muted);
        }
        .table-pagination-footer .pagination-controls {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .page-num-btn {
            min-width: 32px;
            height: 32px;
            padding: 0 8px;
            border-radius: 6px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            background: rgba(255, 255, 255, 0.03);
            color: var(--text-muted);
            font-size: 0.8rem;
            font-weight: 500;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }
        .page-num-btn:hover {
            background: rgba(255, 255, 255, 0.08);
            color: var(--text-main);
            border-color: rgba(255, 255, 255, 0.15);
        }
        .page-num-btn.active {
            background: var(--primary);
            color: #ffffff;
            border-color: var(--primary);
            font-weight: 700;
            box-shadow: 0 0 10px rgba(168, 85, 247, 0.35);
        }
        .page-num-btn:disabled,
        .btn-table-action:disabled {
            opacity: 0.35;
            cursor: not-allowed;
            pointer-events: none;
        }

        .badge-cron {
            background: rgba(168, 199, 250, 0.1);
            color: var(--primary);
            border: 1px solid rgba(168, 199, 250, 0.25);
            padding: 2px 8px;
            border-radius: 6px;
            font-family: 'Consolas', monospace;
            font-size: 0.8rem;
        }

        .badge-status {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 0.78rem;
            font-weight: 500;
        }
        .status-sucesso { background: rgba(34, 197, 94, 0.12); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.25); }
        .status-erro { background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }
        .status-executando { background: rgba(56, 189, 248, 0.12); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.25); }
        .status-pendente { background: rgba(148, 163, 184, 0.12); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.25); }

        /* Switch Toggle */
        .switch {
            position: relative;
            display: inline-block;
            width: 40px;
            height: 22px;
        }
        .switch input { opacity: 0; width: 0; height: 0; }
        .slider {
            position: absolute;
            cursor: pointer;
            top: 0; left: 0; right: 0; bottom: 0;
            background-color: #374151;
            transition: .3s;
            border-radius: 22px;
        }
        .slider:before {
            position: absolute;
            content: "";
            height: 16px; width: 16px;
            left: 3px; bottom: 3px;
            background-color: white;
            transition: .3s;
            border-radius: 50%;
        }
        input:checked + .slider { background-color: #3b82f6; }
        input:checked + .slider:before { transform: translateX(18px); }

        /* Botões de Ação */
        .btn-primary-action {
            background: #4285f4;
            color: white;
            border: none;
            padding: 0.65rem 1.25rem;
            border-radius: 8px;
            font-weight: 500;
            font-size: 0.9rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background 0.2s, transform 0.1s;
        }
        .btn-primary-action:hover { background: #3367d6; transform: translateY(-1px); }

        .btn-table-action {
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.16);
            color: #e2e8f0;
            padding: 5px 12px;
            border-radius: 6px;
            font-size: 0.82rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .btn-table-action:hover {
            background: rgba(255, 255, 255, 0.18);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.3);
        }
        .btn-table-action.btn-del:hover {
            background: rgba(239, 68, 68, 0.25);
            color: #fca5a5;
            border-color: rgba(239, 68, 68, 0.5);
        }

        /* Formulários do Cofre de Configurações */
        .form-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 1.5rem;
            padding: 1.5rem;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .form-label {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-muted);
        }

        .form-input-wrap {
            position: relative;
            display: flex;
            align-items: center;
        }

        .form-input {
            width: 100%;
            background: #101113;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 0.65rem 0.9rem;
            color: var(--text-main);
            font-size: 0.9rem;
            outline: none;
            transition: border-color 0.2s;
        }

        .form-input:focus {
            border-color: #4285f4;
        }

        .btn-eye-toggle {
            position: absolute;
            right: 10px;
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px;
        }

        /* Modais */
        .modal-backdrop {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            z-index: 99999;
            align-items: center;
            justify-content: center;
        }
        .modal-backdrop.show, .modal-backdrop.active {
            display: flex !important;
        }

        .modal-box {
            background: #181d28;
            border: 1px solid rgba(255, 255, 255, 0.16);
            border-radius: 16px;
            width: 90%;
            max-width: 580px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.7);
            overflow: hidden;
            animation: slideUp 0.25s ease;
        }

        .modal-header {
            padding: 1.25rem 1.5rem;
            background: #131720;
            border-bottom: 1px solid rgba(255, 255, 255, 0.12);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .modal-body {
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
            max-height: 70vh;
            overflow-y: auto;
        }

        .modal-footer {
            padding: 1rem 1.5rem;
            background: #131720;
            border-top: 1px solid rgba(255, 255, 255, 0.12);
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }

        /* Scrollbar */
        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

        /* Estilos do Modal de Projeto & Assets */
        .proj-tab-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            padding: 12px 16px;
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s;
        }
        .proj-tab-btn:hover {
            color: var(--text-main);
        }
        .proj-tab-btn.active {
            color: #818cf8;
            border-bottom-color: #818cf8;
        }
        .proj-asset-card {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 14px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 10px;
            transition: background 0.2s;
        }
        .proj-asset-card:hover {
            background: rgba(255, 255, 255, 0.06);
        }
        .proj-chat-card {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 14px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .proj-chat-card:hover {
            background: rgba(99, 102, 241, 0.1);
            border-color: rgba(99, 102, 241, 0.3);
        }

        /* =========================================================
           Cofre de Conexões & Integrações
           ========================================================= */
        .connections-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
            gap: 1.5rem;
            margin-top: 1rem;
        }

        .connection-card {
            background: #1e1f20;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 16px;
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            transition: all 0.25s ease;
            position: relative;
            overflow: hidden;
        }

        .connection-card:hover {
            border-color: rgba(255, 255, 255, 0.18);
            transform: translateY(-2px);
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
        }

        .connection-card-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 1rem;
        }

        .connection-icon-wrap {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            flex-shrink: 0;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .connection-info-title {
            font-size: 1.05rem;
            font-weight: 600;
            color: var(--text-main);
            margin-bottom: 2px;
        }

        .connection-info-desc {
            font-size: 0.82rem;
            color: var(--text-muted);
            line-height: 1.4;
        }

        .conn-status-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            letter-spacing: 0.3px;
        }

        .conn-status-badge.conectado {
            background: rgba(16, 185, 129, 0.12);
            color: #34d399;
            border: 1px solid rgba(16, 185, 129, 0.3);
        }

        .conn-status-badge.desconectado {
            background: rgba(148, 163, 184, 0.1);
            color: #94a3b8;
            border: 1px solid rgba(148, 163, 184, 0.2);
        }

        .conn-status-badge.erro {
            background: rgba(239, 68, 68, 0.12);
            color: #f87171;
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .conn-status-badge.pausado {
            background: rgba(245, 158, 11, 0.12);
            color: #fbbf24;
            border: 1px solid rgba(245, 158, 11, 0.3);
        }

        @keyframes kognvs-pulse-live {
            0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
            70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
            100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
        }

        .kognvs-live-dot {
            display: inline-block;
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #34d399;
            animation: kognvs-pulse-live 2.4s ease-out infinite;
            flex-shrink: 0;
        }

        .conn-status-badge.conectado::before {
            content: "";
            display: inline-block;
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #34d399;
            animation: kognvs-pulse-live 2.4s ease-out infinite;
            margin-right: 2px;
        }

        .connection-details-box {
            background: rgba(0, 0, 0, 0.25);
            border-radius: 10px;
            padding: 10px 12px;
            margin: 1rem 0;
            border: 1px solid rgba(255, 255, 255, 0.05);
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .connection-details-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 3px 0;
        }

        .connection-details-row span.val {
            color: var(--text-main);
            font-family: monospace;
            font-size: 0.8rem;
        }

        .connection-card-actions {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: auto;
            padding-top: 0.8rem;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
        }

        .filter-pill {
            padding: 6px 12px;
            border-radius: 8px;
            background: transparent;
            color: var(--text-muted);
            border: 1px solid transparent;
            font-size: 0.82rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .filter-pill:hover {
            color: var(--text-main);
            background: rgba(255, 255, 255, 0.05);
        }

        .filter-pill.active {
            background: rgba(56, 189, 248, 0.15);
            color: #38bdf8;
            border-color: rgba(56, 189, 248, 0.3);
            font-weight: 600;
        }

        /* Catálogo Superior de Integrações Disponíveis */
        .catalog-integrations-section {
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(20, 21, 24, 0.8) 100%);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 16px;
            padding: 1.25rem 1.5rem;
            margin-bottom: 2rem;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        }

        .catalog-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            flex-wrap: wrap;
            gap: 10px;
        }

        .catalog-title {
            font-size: 0.98rem;
            font-weight: 600;
            color: var(--text-main);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .catalog-subtitle {
            font-size: 0.78rem;
            color: var(--text-muted);
            margin-top: 2px;
        }

        .catalog-items-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
            gap: 10px;
        }

        .catalog-item-btn {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 12px;
            padding: 12px 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            gap: 8px;
            cursor: pointer;
            transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            user-select: none;
            color: inherit;
        }

        .catalog-item-btn:hover {
            transform: translateY(-3px);
            background: rgba(255, 255, 255, 0.06);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
        }

        .catalog-item-icon {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.35rem;
            transition: transform 0.2s ease;
        }

        .catalog-item-btn:hover .catalog-item-icon {
            transform: scale(1.08);
        }

        .catalog-item-name {
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--text-main);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
        }

        .catalog-item-badge {
            font-size: 0.68rem;
            padding: 2px 7px;
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-muted);
            border: 1px solid rgba(255, 255, 255, 0.08);
            font-weight: 500;
            transition: all 0.2s;
        }

        .catalog-item-btn:hover .catalog-item-badge {
            background: rgba(56, 189, 248, 0.15);
            color: #38bdf8;
            border-color: rgba(56, 189, 248, 0.3);
        }

        .configured-section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            flex-wrap: wrap;
            gap: 12px;
        }

        .configured-section-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--text-main);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .configured-count-pill {
            font-size: 0.75rem;
            font-weight: 600;
            padding: 3px 9px;
            border-radius: 12px;
            background: rgba(168, 85, 247, 0.15);
            color: #c084fc;
            border: 1px solid rgba(168, 85, 247, 0.3);
        }

        /* Badges de Governança, Acesso e Expiração */
        .governance-badges-row {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
            margin-top: 6px;
        }

        .access-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 0.7rem;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 6px;
            background: rgba(56, 189, 248, 0.1);
            color: #38bdf8;
            border: 1px solid rgba(56, 189, 248, 0.25);
        }

        .expire-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 0.7rem;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 6px;
        }

        .expire-pill.eterno {
            background: rgba(16, 185, 129, 0.1);
            color: #34d399;
            border: 1px solid rgba(16, 185, 129, 0.25);
        }

        .expire-pill.valido {
            background: rgba(56, 189, 248, 0.1);
            color: #60a5fa;
            border: 1px solid rgba(56, 189, 248, 0.25);
        }

        .expire-pill.expirando {
            background: rgba(245, 158, 11, 0.12);
            color: #fbbf24;
            border: 1px solid rgba(245, 158, 11, 0.3);
        }

        .expire-pill.expirado {
            background: rgba(239, 68, 68, 0.15);
            color: #f87171;
            border: 1px solid rgba(239, 68, 68, 0.35);
        }

        .conn-usecase-row {
            margin-top: 8px;
            padding: 6px 10px;
            background: rgba(0, 0, 0, 0.25);
            border-radius: 8px;
            border: 1px dashed rgba(255, 255, 255, 0.08);
            font-size: 0.76rem;
            color: #cbd5e1;
            display: flex;
            align-items: flex-start;
            gap: 6px;
            line-height: 1.35;
        }

        .governance-section-box {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            padding: 14px;
            margin-top: 14px;
        }

        /* Agentes Vivos / Rotinas Contínuas Cards */
        /* Agentes Vivos / Rotinas Contínuas Cards */
        .rotina-viva-card {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 14px;
            padding: 1.25rem 1.4rem;
            margin-bottom: 1rem;
            transition: all 0.2s ease;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 0;
            width: 100%;
            box-sizing: border-box;
        }

        .rotina-viva-card:hover {
            border-color: rgba(255, 255, 255, 0.16);
            background: rgba(255, 255, 255, 0.035);
        }

        .rotina-viva-header-row {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            width: 100%;
        }

        .rotina-viva-left {
            display: flex;
            align-items: flex-start;
            gap: 14px;
            flex: 1;
            min-width: 0;
        }

        .rotina-viva-icon {
            width: 46px;
            height: 46px;
            border-radius: 12px;
            background: rgba(99, 102, 241, 0.12);
            color: #818cf8;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.3rem;
            flex-shrink: 0;
            margin-top: 2px;
            border: 1px solid rgba(99, 102, 241, 0.25);
        }

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

        .rotina-viva-title {
            font-weight: 700;
            color: var(--text-main);
            font-size: 1.02rem;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 4px;
        }

        .rotina-viva-desc {
            font-size: 0.86rem;
            color: var(--text-muted);
            line-height: 1.45;
            margin-bottom: 8px;
        }

        .rotina-viva-meta {
            display: flex;
            gap: 16px;
            font-size: 0.78rem;
            color: var(--text-muted);
            flex-wrap: wrap;
        }

        .rotina-viva-actions {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
            flex-wrap: wrap;
        }

        .rotina-viva-details-panel {
            width: 100%;
            margin-top: 14px;
            padding-top: 14px;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
        }

        /* =========================================================
           Ações Executivas & Botões Padronizados
           ========================================================= */
        .requires-builder-mode {
            display: inline-flex !important;
        }

        .requires-builder-mode.block {
            display: block !important;
        }

        .requires-builder-mode.flex {
            display: flex !important;
        }

/* File Explorer (Central de Entregáveis) */
.file-explorer-sidebar {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.file-explorer-main {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Tree Nodes */
.tree-node-header {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 6px;
    margin: 2px 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s;
}
.tree-node-header:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}
.tree-node-header.active {
    background: rgba(129, 140, 248, 0.15);
    color: #818cf8;
    font-weight: 500;
}
.tree-node-header.active i {
    color: #818cf8 !important;
}
.tree-node-children {
    padding-left: 20px;
    display: none;
}
.tree-node-children.open {
    display: block;
}

/* =========================================================
   Windows Explorer Style File Manager (Clean, Compact, Modern)
   ========================================================= */

.explorer-view-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0.75rem 1.25rem 0.85rem 1.25rem;
    box-sizing: border-box;
    gap: 0.65rem;
}

.file-explorer-container {
    background: #13151a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    flex: 1;
    display: flex;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.file-explorer-sidebar {
    width: 280px;
    min-width: 260px;
    max-width: 320px;
    background: #16181d;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s ease;
    overflow: hidden;
}

.file-explorer-sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border-right: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.file-explorer-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #111317;
    min-width: 0;
    height: 100%;
}

/* Tree Navigation */
.tree-node-header {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 8px;
    margin: 2px 8px;
    font-size: 0.84rem;
    color: #94a3b8;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}
.tree-node-header:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
}
.tree-node-header.active {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    font-weight: 500;
}
.tree-node-header.active i {
    color: #38bdf8 !important;
}

/* Explorer Grid View - Windows Explorer / macOS Desktop Layout */
.explorer-content-area.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    grid-auto-rows: max-content;
    gap: 12px 14px;
    padding: 1.5rem 1.8rem;
    align-content: start;
    justify-content: start;
}

.file-grid-item {
    position: relative;
    width: 100%;
    min-height: 115px;
    padding: 12px 8px 8px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    user-select: none;
}

.file-grid-item:hover, .file-grid-item.selected {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.file-grid-icon {
    font-size: 3.2rem;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.35));
    transition: transform 0.15s ease;
}

.file-grid-item:hover .file-grid-icon {
    transform: scale(1.06);
}

.file-grid-name {
    font-size: 0.82rem;
    line-height: 1.3;
    font-weight: 500;
    color: #f1f5f9;
    text-align: center;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
}

/* 3-dots Menu Button on item */
.file-item-more-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #94a3b8;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    z-index: 5;
}

.file-grid-item:hover .file-item-more-btn,
.file-list-item:hover .file-item-more-btn,
.file-item-more-btn.active {
    opacity: 1;
}

.file-item-more-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* =========================================================
   Service Loading & Empty States (Centered & Fluid Layout)
   ========================================================= */
.explorer-service-loading {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    box-sizing: border-box;
    margin: 0 auto;
}

.explorer-service-loading .loading-icon-box {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.35);
    position: relative;
}

.explorer-service-loading .loading-icon-box::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 23px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    animation: girar 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
    opacity: 0.85;
}

.explorer-service-loading .loading-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 6px 0;
    letter-spacing: -0.01em;
}

.explorer-service-loading .loading-subtitle {
    font-size: 0.82rem;
    color: #94a3b8;
    max-width: 480px;
    line-height: 1.5;
    margin: 0;
}

/* =========================================================
   macOS Finder Tree View & Collapsible Sidebar Styles
   ========================================================= */

/* Sidebar Section Headers (Collapsible) */
.explorer-sidebar-section {
    margin-bottom: 8px;
}

.explorer-sidebar-section-header {
    padding: 6px 8px 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
    border-radius: 6px;
    margin: 2px 6px;
    transition: background 0.15s, color 0.15s;
    box-sizing: border-box;
}

.explorer-sidebar-section-header:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
}

.explorer-sidebar-section-header.active-section {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
}
.explorer-sidebar-section-header.active-section span,
.explorer-sidebar-section-header.active-section i,
.explorer-sidebar-section-header.active-section .sidebar-section-title {
    color: #38bdf8 !important;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.sidebar-section-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.sidebar-section-btn {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    font-size: 0.65rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.sidebar-section-btn:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.sidebar-section-chevron {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #64748b;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s, background 0.15s;
    box-sizing: border-box;
}

.sidebar-section-chevron:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.sidebar-section-chevron.expanded {
    transform: rotate(90deg);
    color: #94a3b8;
}

.sidebar-folder-chevron {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    color: #64748b;
    cursor: pointer;
    margin-right: 4px;
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s;
    border-radius: 3px;
    flex-shrink: 0;
}

.sidebar-folder-chevron:hover {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

.sidebar-folder-chevron.expanded {
    transform: rotate(90deg);
    color: #f59e0b;
}

/* Finder Tree List View */
.explorer-content-area.file-list-view {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0.4rem 0.8rem 1.5rem 0.8rem;
}

.file-list-header-row {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: 0;
    background: #111317;
    z-index: 5;
}

.file-list-item {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    background: transparent;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.12s ease-out, border-color 0.12s ease-out;
    user-select: none;
    position: relative;
}

.file-list-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.file-list-item.selected {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.25);
}

.finder-chevron-btn {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    color: #64748b;
    cursor: pointer;
    margin-right: 4px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: background 0.15s;
}

.finder-chevron-btn:hover {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.18);
}

.finder-chevron-btn i {
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.finder-chevron-btn.expanded i {
    transform: rotate(90deg);
    color: #f59e0b;
}

.finder-chevron-spacer {
    width: 18px;
    margin-right: 4px;
    flex-shrink: 0;
    display: inline-block;
}

.finder-empty-subfolder {
    padding: 4px 10px 4px 36px;
    font-size: 0.72rem;
    color: #475569;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.file-list-col-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.file-list-col-name .file-list-name {
    font-size: 0.82rem;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-list-col-date {
    width: 140px;
    font-size: 0.76rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.file-list-col-type {
    width: 130px;
    font-size: 0.76rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.file-list-col-size {
    width: 90px;
    text-align: right;
    font-size: 0.76rem;
    color: #94a3b8;
    padding-right: 10px;
    flex-shrink: 0;
}

.file-list-col-actions {
    width: 32px;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.file-list-header-row .sortable-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s ease;
    user-select: none;
}

.file-list-header-row .sortable-header:hover {
    color: #38bdf8;
}

.file-list-header-row .sortable-header.active {
    color: #38bdf8;
    font-weight: 700;
}

.file-list-header-row .sortable-header.align-right {
    justify-content: flex-end;
}

/* Dropdown Context Menu */
.file-context-menu {
    position: fixed;
    background: rgba(20, 23, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
    padding: 6px;
    z-index: 99999;
    min-width: 195px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    animation: ctxFadeIn 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.file-context-menu::-webkit-scrollbar {
    width: 4px;
}
.file-context-menu::-webkit-scrollbar-track {
    background: transparent;
}
.file-context-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

@keyframes ctxFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.file-context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    font-size: 0.80rem;
    color: #cbd5e1;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    user-select: none;
}

.file-context-menu-item i {
    width: 16px;
    text-align: center;
    font-size: 0.82rem;
    color: #94a3b8;
}

.file-context-menu-item:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #ffffff;
}

.file-context-menu-item:hover i {
    color: #38bdf8;
}

.file-context-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

.file-context-menu-item.danger:hover i {
    color: #ef4444;
}

.file-context-menu-item.disabled {
    opacity: 0.38;
    cursor: not-allowed !important;
    pointer-events: none;
}

.file-context-menu-item .ctx-shortcut {
    margin-left: auto;
    padding-left: 12px;
    font-size: 0.70rem;
    color: #64748b;
    font-family: inherit;
    font-weight: 500;
}

.file-context-menu-item:hover .ctx-shortcut {
    color: #94a3b8;
}

.file-context-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

/* Explorer Status Bar (Windows Style) */
.file-explorer-statusbar {
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.74rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.view-toggle-btns {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.82rem;
}

.view-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.view-btn.active {
    background: rgba(56, 189, 248, 0.20) !important;
    color: #38bdf8 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* =========================================================
   DRAG & DROP NATIVO (ESTILO WINDOWS EXPLORER / GOOGLE DRIVE)
   ========================================================= */

.file-grid-item,
.file-list-item {
    cursor: grab;
    user-select: none;
    -webkit-user-drag: element;
}

.file-grid-item:active,
.file-list-item:active {
    cursor: grabbing;
}

/* Item sendo arrastado */
.file-grid-item.dragging,
.file-list-item.dragging {
    opacity: 0.35 !important;
    transform: scale(0.92) !important;
    filter: grayscale(40%) brightness(1.2) !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.5) !important;
}

/* Quando o usuário está arrastando um item, os filhos internos não interceptam eventos de mouse */
body.is-dragging-explorer-item .file-grid-item *,
body.is-dragging-explorer-item .file-list-item *,
body.is-dragging-explorer-item .tree-node-header *,
body.is-dragging-explorer-item .breadcrumb-drop-target * {
    pointer-events: none !important;
}

body.is-dragging-explorer-item .file-item-more-btn {
    display: none !important;
}

/* Pasta destino ao passar item por cima (Sem Flicker) */
.file-grid-item.drag-over-target,
.file-list-item.drag-over-target {
    background: rgba(245, 158, 11, 0.25) !important;
    border-radius: 10px !important;
    box-shadow: 0 0 0 2px #f59e0b, 0 8px 24px rgba(245, 158, 11, 0.45) !important;
    transform: scale(1.06) !important;
    transition: transform 0.12s ease-out, background 0.12s ease-out, box-shadow 0.12s ease-out !important;
    z-index: 10;
}

.file-grid-item.drag-over-target .file-grid-icon i,
.file-list-item.drag-over-target .file-list-col-name i {
    transform: scale(1.18);
    color: #fbbf24 !important;
    transition: transform 0.12s ease-out;
}

.file-grid-item.drag-over-target .file-grid-name,
.file-list-item.drag-over-target .file-list-name {
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* Nós da Árvore Lateral como alvo de soltura */
.tree-node-header.drag-over-target {
    background: rgba(245, 158, 11, 0.28) !important;
    color: #fbbf24 !important;
    border-radius: 6px;
    box-shadow: inset 0 0 0 2px #f59e0b, 0 4px 12px rgba(245, 158, 11, 0.3) !important;
    padding-left: calc(var(--pad-left, 10px) + 3px);
}

.tree-node-header.drag-over-target i {
    color: #fbbf24 !important;
    transform: scale(1.15);
}

/* Segmentos do Breadcrumb como alvo de soltura */
.breadcrumb-drop-target.drag-over-target {
    background: rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
    padding: 3px 8px;
    border-radius: 6px;
    box-shadow: 0 0 0 1.5px #f59e0b;
}

/* Overlay de Upload Direto do Computador / Windows Desktop */
.explorer-dropzone-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 29, 0.88);
    border: 2px dashed #38bdf8;
    border-radius: 10px;
    z-index: 999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #38bdf8;
    pointer-events: none;
    backdrop-filter: blur(6px);
    animation: fadeInDropzone 0.15s ease-out;
}

@keyframes fadeInDropzone {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.explorer-dropzone-overlay i {
    font-size: 3.2rem;
    animation: bounceDropIcon 1.2s infinite ease-in-out;
}

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

/* =========================================================
   MATRIZ DE SUPERPODERES & CAPACIDADES DOS AGENTES
   ========================================================= */

.capacidade-card {
    background: #18191b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.capacidade-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.16);
}

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

.cap-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

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

.cap-cat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.cap-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cap-status-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.cap-level-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.3px;
}

.cap-level-badge.level-base {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.cap-level-badge.level-ceo {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.cap-level-badge.level-ia {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.btn-cap-fixar {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-cap-fixar:hover {
    background: #10b981;
    color: #fff;
}

.cap-description {
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cap-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.78rem;
}

.cap-meta-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.76rem;
    display: none; /* Removed to make cards less verbose */
}

.cap-agents-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.cap-agent-badge {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.73rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cap-origin-badge {
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.73rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cap-prompts-accordion {
    margin-top: 6px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.cap-prompts-accordion:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.cap-accordion-toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-main);
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.cap-accordion-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.cap-accordion-badge {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
}

.cap-accordion-icon {
    font-size: 0.72rem;
    color: var(--text-muted);
    transition: transform 0.25s ease;
    margin-left: 2px;
}

.cap-accordion-icon.open {
    transform: rotate(180deg);
    color: var(--primary);
}

.cap-accordion-body {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px 10px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.18);
}

.cap-accordion-body.open {
    display: flex;
}

.cap-prompt-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s;
}

.cap-prompt-box:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.cap-prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #cbd5e1;
    font-weight: 600;
}

.cap-prompt-text {
    font-size: 0.78rem;
    color: #94a3b8;
    font-style: italic;
    line-height: 1.35;
}

.btn-cap-use-prompt {
    background: rgba(236, 72, 153, 0.12);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-cap-use-prompt:hover {
    background: #ec4899;
    color: #ffffff;
    border-color: #ec4899;
    transform: scale(1.03);
}

/* =========================================================
   AUTOMAÇÕES COMPLEXAS & PLAYBOOKS TREINADOS (MACRO-WORKFLOWS)
   ========================================================= */

.playbook-card {
    background: linear-gradient(145deg, #161a24, #0f121a);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.playbook-card:hover {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 14px 40px rgba(245, 158, 11, 0.12);
}

.playbook-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding-bottom: 1.25rem;
}

.playbook-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 280px;
}

.playbook-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.playbook-dept-tag {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #f59e0b;
    font-weight: 700;
    margin-bottom: 3px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.playbook-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px 0;
    line-height: 1.25;
}

.playbook-sub {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin: 0;
}

.playbook-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.playbook-overview {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.playbook-desc-text {
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.55;
    margin: 0;
}

.playbook-meta-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
}

.playbook-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.playbook-pipeline-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.playbook-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #cbd5e1;
}

.playbook-steps-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.playbook-step-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.playbook-step-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(245, 158, 11, 0.35);
    transform: translateY(-2px);
}

.step-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-num-pill {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f59e0b;
    color: #000000;
    font-weight: 800;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    line-height: 1.3;
}

.step-card-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.45;
    margin: 0;
    flex: 1;
}

.step-tools-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.step-tool-badge {
    background: rgba(56, 189, 248, 0.08);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.step-output-box {
    background: rgba(0, 0, 0, 0.25);
    border-left: 2px solid #10b981;
    padding: 4px 8px;
    border-radius: 0 4px 4px 0;
    font-size: 0.72rem;
    color: #a7f3d0;
    margin-top: 4px;
}

.playbook-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.btn-playbook-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000000;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-playbook-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}


/* =========================================================
   KOGNVS DOCTOR & AUTODIAGNÓSTICO (PADRÃO VISUAL ENTERPRISE)
   ========================================================= */

.doctor-hero-card {
    background: linear-gradient(135deg, rgba(20, 24, 33, 0.85) 0%, rgba(13, 16, 23, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.doctor-hero-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    min-width: 300px;
}

.doctor-score-circle {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(closest-side, #0f172a 79%, transparent 80% 100%), conic-gradient(#10b981 var(--health-deg, 324deg), rgba(255,255,255,0.08) 0);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.12);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.doctor-score-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: #10b981;
    font-family: 'Plus Jakarta Sans', var(--font-main), sans-serif;
    letter-spacing: -0.02em;
}

.doctor-hero-info h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.doctor-hero-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.doctor-meta-row {
    margin-top: 8px;
    display: flex;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.doctor-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.doctor-kpi-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.doctor-kpi-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 18px;
    text-align: center;
    min-width: 95px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.doctor-kpi-badge:hover {
    transform: translateY(-2px);
}

.doctor-kpi-badge .kpi-num {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.2;
}

.doctor-kpi-badge .kpi-lbl {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.doctor-kpi-badge.kpi-ok {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
}
.doctor-kpi-badge.kpi-ok .kpi-num {
    color: #10b981;
}

.doctor-kpi-badge.kpi-warn {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
}
.doctor-kpi-badge.kpi-warn .kpi-num {
    color: #f59e0b;
}

.doctor-kpi-badge.kpi-fail {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
}
.doctor-kpi-badge.kpi-fail .kpi-num {
    color: #ef4444;
}

/* Badges de Status do Diagnóstico na Tabela */
.diag-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.diag-status-badge.badge-ok {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.diag-status-badge.badge-warn {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.diag-status-badge.badge-fail {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.diag-status-badge.badge-skip {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.diag-subsystem-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.diag-check-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
}

.diag-remediation-box {
    margin-top: 6px;
    font-size: 0.78rem;
    color: #c084fc;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.2);
    padding: 5px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-chip {
    padding: 6px 12px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-chip:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.filter-chip.active {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
    font-weight: 600;
}

/* =========================================================
   CENTRAL DE NOTIFICAÇÕES & MENSAGERIA DOS AGENTES
   ========================================================= */

.notif-card {
    background: linear-gradient(145deg, #181d28, #131620);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    transition: all 0.2s ease;
    position: relative;
    border-left: 4px solid #38bdf8;
}

.notif-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.24);
}

.notif-card.notif-unread {
    background: linear-gradient(145deg, #1d2332, #161922);
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(245, 158, 11, 0.1);
}

.notif-card.type-urgente { border-left-color: #ef4444; }
.notif-card.type-aprovacao { border-left-color: #f59e0b; }
.notif-card.type-pergunta { border-left-color: #06b6d4; }
.notif-card.type-lembrete { border-left-color: #a855f7; }
.notif-card.type-sucesso { border-left-color: #10b981; }
.notif-card.type-relatorio { border-left-color: #38bdf8; }
.notif-card.type-info { border-left-color: #818cf8; }

.notif-card-pending-action {
    border-color: rgba(245, 158, 11, 0.45);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), #181d28 45%);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.12);
}

.notif-card-pending-action:hover {
    border-color: rgba(245, 158, 11, 0.7);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.22);
}

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

.notif-agent-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-agent-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.notif-agent-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
}

.notif-badges-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    flex-wrap: wrap;
}

.notif-type-pill {
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
}

.notif-type-pill.type-urgente { background: rgba(239, 68, 68, 0.22); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.45); }
.notif-type-pill.type-aprovacao { background: rgba(245, 158, 11, 0.22); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.45); }
.notif-type-pill.type-pergunta { background: rgba(6, 182, 212, 0.22); color: #a5f3fc; border: 1px solid rgba(6, 182, 212, 0.45); }
.notif-type-pill.type-lembrete { background: rgba(168, 85, 247, 0.22); color: #f3e8ff; border: 1px solid rgba(168, 85, 247, 0.45); }
.notif-type-pill.type-sucesso { background: rgba(16, 185, 129, 0.22); color: #bbf7d0; border: 1px solid rgba(16, 185, 129, 0.45); }
.notif-type-pill.type-relatorio { background: rgba(56, 189, 248, 0.22); color: #bae6fd; border: 1px solid rgba(56, 189, 248, 0.45); }
.notif-type-pill.type-info { background: rgba(129, 140, 248, 0.22); color: #c7d2fe; border: 1px solid rgba(129, 140, 248, 0.45); }

.notif-status-pill {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.74rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.notif-status-pill.pending { background: rgba(245, 158, 11, 0.25); color: #fef08a; border: 1px solid rgba(245, 158, 11, 0.6); animation: pulseSoft 2s infinite ease-in-out; }
.notif-status-pill.approved { background: rgba(16, 185, 129, 0.25); color: #bbf7d0; border: 1px solid rgba(16, 185, 129, 0.6); }
.notif-status-pill.rejected { background: rgba(239, 68, 68, 0.25); color: #fecaca; border: 1px solid rgba(239, 68, 68, 0.6); }
.notif-status-pill.answered { background: rgba(6, 182, 212, 0.25); color: #a5f3fc; border: 1px solid rgba(6, 182, 212, 0.6); }

@keyframes pulseSoft {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(0.98); }
}

.notif-channel-pill {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.74rem;
}

.notif-time {
    font-size: 0.8rem;
    color: #cbd5e1;
    font-weight: 500;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

.notif-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
    display: inline-block;
}

.notif-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #ffffff;
    margin: 2px 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.notif-body-text {
    font-size: 0.93rem;
    color: #e2e8f0;
    line-height: 1.6;
    margin: 0;
    word-break: break-word;
}

.notif-body-text p {
    color: #e2e8f0;
    margin-bottom: 8px;
    line-height: 1.6;
}

.notif-body-text p:last-child {
    margin-bottom: 0;
}

.notif-body-text a {
    color: #38bdf8 !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
    transition: color 0.15s ease;
}

.notif-body-text a:hover {
    color: #7dd3fc !important;
}

.notif-body-text strong, .notif-body-text b {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.notif-body-text em, .notif-body-text i {
    color: #f1f5f9;
    font-style: italic;
}

.notif-body-text code {
    background: rgba(255, 255, 255, 0.12);
    color: #38bdf8;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.88em;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.notif-body-text pre {
    background: #0f1219;
    color: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    overflow-x: auto;
    margin: 8px 0;
}

.notif-body-text ul, .notif-body-text ol {
    margin: 6px 0 8px 18px;
    color: #e2e8f0;
}

.notif-body-text li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.notif-decision-banner {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0;
    font-weight: 500;
}

.notif-decision-banner strong {
    color: #ffffff;
    font-weight: 700;
}

.notif-decision-banner.pending { background: rgba(245, 158, 11, 0.16); border: 1.5px solid rgba(245, 158, 11, 0.5); color: #fef08a; }
.notif-decision-banner.question { background: rgba(6, 182, 212, 0.16); border: 1.5px solid rgba(6, 182, 212, 0.5); color: #e0f2fe; }
.notif-decision-banner.reminder { background: rgba(168, 85, 247, 0.16); border: 1.5px solid rgba(168, 85, 247, 0.5); color: #f3e8ff; }
.notif-decision-banner.approved { background: rgba(16, 185, 129, 0.16); border: 1.5px solid rgba(16, 185, 129, 0.5); color: #dcfce7; }
.notif-decision-banner.rejected { background: rgba(239, 68, 68, 0.16); border: 1.5px solid rgba(239, 68, 68, 0.5); color: #fee2e2; }
.notif-decision-banner.answered { background: rgba(56, 189, 248, 0.16); border: 1.5px solid rgba(56, 189, 248, 0.5); color: #e0f2fe; }

.notif-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

.notif-action-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 7px 15px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.notif-action-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.notif-action-btn.btn-hitl-approve {
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff;
    border: 1px solid #34d399;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(5, 150, 105, 0.4);
}

.notif-action-btn.btn-hitl-approve:hover {
    background: #059669;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.6);
    transform: translateY(-1px);
}

.notif-action-btn.btn-hitl-reject {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    border: 1px solid #f87171;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4);
}

.notif-action-btn.btn-hitl-reject:hover {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.6);
    transform: translateY(-1px);
}

.notif-action-btn.btn-hitl-reply {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    border: 1px solid #38bdf8;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

.notif-action-btn.btn-hitl-reply:hover {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
    transform: translateY(-1px);
}

.notif-action-btn.btn-hitl-chat {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-weight: 600;
}

.notif-action-btn.btn-hitl-chat:hover {
    background: rgba(56, 189, 248, 0.24);
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
    transform: translateY(-1px);
}

.notif-secondary-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.metric-highlight-pending {
    border-color: rgba(245, 158, 11, 0.6) !important;
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.18), #181d28) !important;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.12);
}

.metric-highlight-pending .m-title {
    color: #fbbf24 !important;
    font-weight: 700;
}

.metric-highlight-pending .m-value {
    color: #fbbf24 !important;
    font-weight: 800;
}

.metric-highlight-pending .m-sub {
    color: #fde68a !important;
    font-weight: 500;
}

.pill-highlight-pending.active {
    background: #f59e0b !important;
    color: #000000 !important;
    border-color: #fbbf24 !important;
    font-weight: 800 !important;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
}

/* ==========================================================================
   LIVE COLLABORATION DOCK (CHAT EXECUTION PIPELINE)
   ========================================================================== */
.stepper-collab-dock {
    margin: 4px 0 8px 0;
    padding: 0;
    background: transparent;
    border: none;
}

.collab-dock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #94a3b8;
}

.collab-pipeline-track {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 6px 2px;
    scrollbar-width: none;
}
.collab-pipeline-track::-webkit-scrollbar { display: none; }

.collab-node {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: transparent;
    border: none;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.collab-node.active {
    color: #38bdf8;
}

.collab-node.done {
    color: #10b981;
}

.collab-node.waiting {
    opacity: 0.55;
}

.collab-avatar-wrap {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #38bdf8;
    position: relative;
    flex-shrink: 0;
}

.collab-node.active .collab-avatar-wrap {
    animation: avatarPulseGlow 1.8s infinite alternate;
}

@keyframes avatarPulseGlow {
    0% { box-shadow: 0 0 4px rgba(56, 189, 248, 0.4); transform: scale(1); }
    100% { box-shadow: 0 0 14px rgba(56, 189, 248, 0.85); transform: scale(1.06); }
}

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

.collab-node-info {
    display: flex;
    flex-direction: column;
}

.collab-node-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    white-space: nowrap;
}

.collab-node-status {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.2;
    margin-top: 1px;
    white-space: nowrap;
}

.collab-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.7rem;
    position: relative;
    padding: 0 2px;
    flex-shrink: 0;
}

.collab-connector.active {
    color: #38bdf8;
    animation: beamFlow 1.2s infinite linear;
}

@keyframes beamFlow {
    0% { transform: translateX(-2px); opacity: 0.5; }
    50% { transform: translateX(2px); opacity: 1; text-shadow: 0 0 8px #38bdf8; }
    100% { transform: translateX(-2px); opacity: 0.5; }
}

/* ==========================================================================
   OPEN SPACE EXECUTIVO VIVO (11 DEPARTAMENTOS & FEED EM TEMPO REAL)
   ========================================================================== */
/* =========================================================
   Central de Operações & Colaboração Interdepartamental (Redesign)
   ========================================================= */
.open-space-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1.4rem;
    padding: 10px 14px;
    background: rgba(20, 21, 25, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    backdrop-filter: blur(12px);
}

.open-space-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 12px;
    flex: 1;
    min-width: 260px;
    max-width: 440px;
    transition: all 0.2s ease;
}

.open-space-search-box:focus-within {
    border-color: color-mix(in srgb, var(--primary, #38bdf8) 50%, transparent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--primary, #38bdf8) 15%, transparent);
}

.open-space-search-box i {
    color: #64748b;
    font-size: 0.85rem;
}

.open-space-search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #f1f5f9;
    font-size: 0.84rem;
    width: 100%;
}

.open-space-search-box input::placeholder {
    color: #64748b;
}

.open-space-dept-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.open-space-pill-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}

.open-space-pill-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.15);
}

.open-space-pill-btn.active {
    background: color-mix(in srgb, var(--primary, #38bdf8) 15%, transparent);
    color: var(--primary, #38bdf8);
    border-color: color-mix(in srgb, var(--primary, #38bdf8) 40%, transparent);
    font-weight: 600;
}

.open-space-grid-11 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    margin-bottom: 2rem;
}

.dept-live-card {
    background: rgba(20, 22, 27, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    backdrop-filter: blur(12px);
}

.dept-live-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.dept-live-card.active-working {
    border-color: rgba(56, 189, 248, 0.5) !important;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.09) 0%, rgba(20, 22, 27, 0.94) 75%) !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.18) !important;
}

.dept-live-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dept-live-title-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.dept-live-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.dept-live-name {
    font-weight: 700;
    font-size: 0.94rem;
    color: #f1f5f9;
    line-height: 1.25;
}

.dept-live-desc {
    font-size: 0.74rem;
    color: #8590a2;
    margin-top: 2px;
    line-height: 1.35;
}

.dept-live-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    flex-shrink: 0;
}

.dept-live-status-pill.status-working {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.35);
    color: #38bdf8;
}

.dept-live-status-pill.status-idle {
    background: rgba(100, 116, 139, 0.12);
    border-color: rgba(100, 116, 139, 0.25);
    color: #94a3b8;
}

/* Lista Estruturada de Agentes */
.dept-agents-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 12px 0;
}

.dept-agent-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 8px 10px;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dept-agent-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.dept-agent-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dept-agent-id-group {
    display: flex;
    align-items: center;
    gap: 7px;
}

.dept-agent-icon {
    font-size: 0.78rem;
    color: #94a3b8;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.dept-agent-tag {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.76rem;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
}

.dept-agent-name {
    font-weight: 600;
    font-size: 0.82rem;
    color: #e2e8f0;
}

.dept-agent-desc {
    font-size: 0.75rem;
    color: #8590a2;
    line-height: 1.35;
    padding-left: 23px;
}

.dept-agent-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-left: 23px;
    margin-top: 2px;
}

.btn-agent-dossie {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-agent-dossie:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-agent-chat-mini {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-agent-chat-mini:hover {
    background: #38bdf8;
    color: #0f172a;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.dept-live-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
    margin-top: 4px;
}

.dept-metric-count {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.dept-metric-count strong {
    color: var(--text-main);
}

.btn-dept-talk {
    background: rgba(56, 189, 248, 0.08);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-dept-talk:hover {
    background: #38bdf8;
    color: #0f172a;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

/* Modal: Dossiê Executivo & Personalidade do Especialista */
.dossie-modal-box {
    animation: dossieModalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dossieModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dossie-avatar-frame {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dossie-avatar-frame:hover {
    transform: scale(1.05);
}

.dossie-section-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.2s ease;
}

.dossie-section-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.dossie-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.dossie-personality-highlight {
    position: relative;
    overflow: hidden;
}

.dossie-personality-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #38bdf8, #a855f7);
    border-radius: 4px 0 0 4px;
}

.dossie-prompt-chip {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: #cbd5e1;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.78rem;
    padding: 9px 12px;
    border-radius: 8px;
    margin-bottom: 7px;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dossie-prompt-chip:hover {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.45);
    color: #38bdf8;
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

.flyout-btn-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 6px;
}

.flyout-btn-info:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    transform: scale(1.1);
}

/* Ticker de Atividades e Handoffs da Equipe */
.team-live-stream-card {
    background: rgba(24, 25, 27, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 2rem;
}

.stream-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.stream-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    font-size: 0.82rem;
    transition: all 0.2s ease;
}

.stream-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.09);
}

.stream-icon-badge {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.stream-content {
    flex: 1;
}

.stream-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* =========================================================
   Cofre de Credenciais de Acesso & Portais (Enterprise Keychain)
   ========================================================= */
.credentials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
}

.cred-card {
    background: rgba(30, 31, 35, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.cred-card:hover {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(30, 31, 35, 0.9);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.cred-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.cred-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cred-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.cred-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.cred-info-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    min-width: 60px;
}

.cred-info-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
}

.cred-card-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Card Interativo de Credencial Detectada no Chat */
.chat-credential-prompt-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(30, 31, 35, 0.95));
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 14px;
    padding: 12px 16px;
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.2s ease;
}

.ccp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #f59e0b;
}

.ccp-body {
    font-size: 0.82rem;
    color: #e2e8f0;
    line-height: 1.4;
}

.ccp-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-ccp-save {
    background: #f59e0b;
    color: #0f172a;
    border: none;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-ccp-save:hover {
    background: #d97706;
    color: #ffffff;
}

.btn-ccp-dismiss {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-ccp-dismiss:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* =========================================================
   Filtros Rápidos de Telemetria de Custos (Pills)
   ========================================================= */
.btn-filter-pill {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-filter-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-filter-pill.active {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #34d399 !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3) !important;
}

/* =========================================================
   Executive SaaS Schedule Builder (Frequência Amigável)
   ========================================================= */
.scheduler-type-tabs {
    display: flex;
    gap: 6px;
    background: rgba(15, 18, 25, 0.95);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 14px;
    overflow-x: auto;
}

.scheduler-type-tab {
    flex: 1;
    min-width: fit-content;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.scheduler-type-tab:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
}

.scheduler-type-tab.active {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.scheduler-panel {
    background: rgba(22, 23, 27, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.weekday-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.weekday-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.weekday-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.weekday-btn.active {
    background: #38bdf8 !important;
    color: #0f172a !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.time-preset-pill {
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.time-preset-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

.time-preset-pill.active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border-color: #10b981;
}

.scheduler-summary-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(56, 189, 248, 0.08));
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.template-badge-pill {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.template-badge-pill:hover {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateY(-1px);
}

.badge-freq-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(56, 189, 248, 0.08);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.22);
    padding: 1px 7px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

/* =========================================================
   Aba de Agentes & Especialistas (Matriz Corporativa)
   ========================================================= */
.agent-dept-section {
    background: rgba(24, 25, 27, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.agent-dept-section:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.agent-dept-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 0px;
    margin-bottom: 0px;
    cursor: pointer;
    user-select: none;
}

.agent-dept-section.expanded .agent-dept-header {
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 16px;
}

.agent-dept-collapse-icon {
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: transform 0.25s ease, color 0.2s ease;
    margin-right: 2px;
}

.agent-dept-section.expanded .agent-dept-collapse-icon {
    transform: rotate(180deg);
    color: var(--text-main);
}

.agent-dept-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-dept-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.agent-dept-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-dept-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.agent-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
}

.agent-cfg-card {
    background: rgba(30, 31, 35, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    position: relative;
}

.agent-cfg-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.agent-cfg-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.agent-cfg-avatar-wrap {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.agent-cfg-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-cfg-title-wrap {
    flex: 1;
    min-width: 0;
}

.agent-cfg-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.agent-cfg-name {
    font-weight: 700;
    font-size: 0.96rem;
    color: var(--text-main);
}

.agent-cfg-tag {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    white-space: nowrap;
}

.agent-cfg-role {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
}

.agent-cfg-scope-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.45;
    margin-bottom: 12px;
}

.agent-cfg-scope-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.agent-cfg-details-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.agent-cfg-detail-item {
    font-size: 0.78rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.agent-cfg-detail-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.agent-cfg-tools-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.agent-cfg-tool-tag {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.agent-cfg-model-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #a78bfa;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.25);
    padding: 2px 8px;
    border-radius: 6px;
    width: fit-content;
}

.agent-cfg-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
}

.dept-filter-pill-btn {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.dept-filter-pill-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.dept-filter-pill-btn.active {
    background: rgba(139, 92, 246, 0.2);
    color: #c084fc;
    border-color: rgba(139, 92, 246, 0.4);
    font-weight: 600;
}

/* ========================================= */
/* IA THOUGHT PROCESS (RACIOCÍNIO COLAPSÁVEL) */
/* ========================================= */
.ia-thought-process {
    background: rgba(13, 17, 28, 0.82);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-left: 3px solid #6366f1;
    border-radius: 8px;
    margin-top: 4px;
    margin-bottom: 14px;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: fit-content;
    min-width: 270px;
    max-width: 100%;
}

.ia-thought-process[open] {
    background: rgba(10, 14, 26, 0.94);
    border-color: rgba(99, 102, 241, 0.32);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 12px rgba(99, 102, 241, 0.08);
    width: 100%;
}

.ia-thought-process summary {
    cursor: pointer;
    padding: 8px 12px;
    font-weight: 600;
    color: #a5b4fc;
    user-select: none;
    font-size: 0.76rem;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    list-style: none;
    transition: all 0.15s ease;
}

.ia-thought-process summary::-webkit-details-marker {
    display: none;
}

.ia-thought-process summary:hover {
    color: #e0e7ff;
    background-color: rgba(99, 102, 241, 0.1);
}

.thought-content {
    padding: 12px 14px;
    font-size: 0.78rem;
    line-height: 1.65;
    color: #cbd5e1;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background-color: rgba(0, 0, 0, 0.22);
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

.thought-content::-webkit-scrollbar {
    width: 6px;
}

.thought-content::-webkit-scrollbar-track {
    background: transparent;
}

.thought-content::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.35);
    border-radius: 4px;
}

.thought-content::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}

.thought-content p {
    margin-bottom: 8px;
}

.thought-content p:last-child {
    margin-bottom: 0;
}

.thought-content code {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #93c5fd;
    border: 1px solid rgba(255, 255, 255, 0.06);
}



/* Animações Kognvs Typing Indicator */
@keyframes kognvs-typing {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}
@keyframes pulse-blue { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); } 70% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(56, 189, 248, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); } }
@keyframes pulse-purple { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.75); } 70% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(168, 85, 247, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); } }
@keyframes pulse-green { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.75); } 70% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@keyframes pulse-amber { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.75); } 70% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }

/* Card de Resposta Interrompida por Reload */
.chat-pending-retry-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(56, 189, 248, 0.05);
    border: 1px dashed rgba(56, 189, 248, 0.25);
    border-radius: 10px;
    padding: 10px 16px;
    margin: 16px 0;
    color: #cbd5e1;
    font-size: 0.85rem;
    gap: 12px;
    animation: fadeIn 0.3s ease-out;
}
.chat-pending-retry-card .cprc-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #94a3b8;
}
.btn-cprc-retry {
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-cprc-retry:hover {
    background: #0369a1;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Botão Flutuante de Rolar para Baixo durante Stream */
.btn-scroll-bottom-floating {
    position: absolute;
    bottom: 95px;
    left: 50%;
    transform: translateX(-50%);
    background: #0284c7;
    color: #ffffff;
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 12px rgba(56, 189, 248, 0.35);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.25s ease-out;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-scroll-bottom-floating:hover {
    background: #0369a1;
    transform: translateX(-50%) scale(1.04);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(56, 189, 248, 0.5);
}

/* ==========================================================================
   MENU DE OPÇÕES DO CHAT (...) ESTILO GOOGLE GEMINI ENTERPRISE
   ========================================================= */
.btn-chat-header-options {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted, #94a3b8);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-chat-header-options:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main, #f8fafc);
    border-color: rgba(255, 255, 255, 0.18);
}

.chat-options-flyout {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 275px;
    background: rgba(20, 21, 25, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(16px);
    z-index: 1000;
    animation: scaleInMenu 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleInMenu {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-cost-summary-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 9px 11px;
    margin-bottom: 4px;
}

.ccsc-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ccsc-val {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f1f5f9;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    margin-top: 3px;
    letter-spacing: -0.02em;
}

.ccsc-sub {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 1px;
}

.gemini-action-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.12s ease;
    color: #cbd5e1;
    user-select: none;
}

.gemini-action-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.gemini-action-item.danger-subtle {
    color: #94a3b8;
}

.gemini-action-item.danger-subtle:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.gemini-action-item.danger-subtle:hover .gemini-action-icon,
.gemini-action-item.danger-subtle:hover .gemini-action-title,
.gemini-action-item.danger-subtle:hover .gemini-action-desc {
    color: #ef4444 !important;
}

.gemini-action-icon {
    font-size: 0.82rem;
    width: 18px;
    text-align: center;
    color: #94a3b8;
    flex-shrink: 0;
    transition: color 0.12s ease;
}

.gemini-action-item:hover .gemini-action-icon {
    color: #f1f5f9;
}

.gemini-action-text {
    flex: 1;
    min-width: 0;
}

.gemini-action-title {
    font-size: 0.79rem;
    font-weight: 500;
    line-height: 1.2;
    color: inherit;
}

.gemini-action-desc {
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 1px;
    line-height: 1.2;
}

/* ==========================================================================
   TÍTULO DO CHAT EDITÁVEL NA TOPBAR
   ========================================================= */
.chat-topbar-title-container {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 460px;
}

.chat-topbar-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.chat-topbar-title:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.btn-edit-chat-title {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.72rem;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    opacity: 0;
}

.chat-topbar-title-container:hover .btn-edit-chat-title {
    opacity: 0.8;
}

.btn-edit-chat-title:hover {
    opacity: 1;
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.08);
}

.input-edit-chat-title {
    background: rgba(15, 16, 20, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.84rem;
    padding: 3px 8px;
    outline: none;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.15);
    min-width: 180px;
    max-width: 380px;
}





.cost-meter-add-budget-btn {
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    margin-left: 6px;
    margin-right: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}
.cost-meter-add-budget-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.16);
    color: #f1f5f9;
}
.cost-meter-add-budget-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


.nav-tab-add-btn {
    margin-left: auto;
    background: transparent;
    color: #94a3b8;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.nav-tab-add-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}
.nav-tab-btn:hover .nav-tab-add-btn,
.nav-tab-btn.active .nav-tab-add-btn {
    color: #cbd5e1;
}

/* ==========================================================================
   KOGNVS CANVAS STUDIO (LIVE DOCUMENT STUDIO & SPLIT-SCREEN)
   ========================================================================== */

#view-chat {
    overflow: hidden !important;
    height: 100% !important;
    width: 100% !important;
    display: none;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    position: relative !important;
}

#view-chat.active {
    display: flex !important;
}

.chat-split-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    height: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    position: relative !important;
    box-sizing: border-box !important;
}

.chat-main-pane {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important;
    min-width: 320px;
    box-sizing: border-box !important;
    transition: flex 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Quando o Canvas está ABERTO */
/* 50% é só a largura INICIAL — sem !important, pra que o arraste do divisor
   (CanvasStudio.applySplitWidth, que define flex/width via style inline)
   consiga sobrescrever depois. Com !important o painel ficava travado em
   50% pra sempre, ignorando o redimensionamento. */
.chat-split-wrapper.canvas-active .chat-main-pane {
    flex: 0 0 50%;
    width: 50%;
    max-width: 75%;
}

.chat-split-wrapper.canvas-active .canvas-studio-pane {
    display: flex !important;
    flex: 0 0 50%;
    width: 50%;
    max-width: 80%;
}

.chat-split-wrapper.canvas-active .canvas-split-resizer {
    display: flex !important;
}

/* Quando o Canvas está FECHADO (Blindagem total contra vazamento de layout) */
.chat-split-wrapper:not(.canvas-active) .canvas-studio-pane {
    display: none !important;
}

.chat-split-wrapper:not(.canvas-active) .canvas-split-resizer {
    display: none !important;
}

.chat-split-wrapper:not(.canvas-active) .chat-main-pane {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Resizer entre Chat e Canvas */
.canvas-split-resizer {
    width: 6px;
    height: 100% !important;
    min-height: 0 !important;
    background: rgba(255, 255, 255, 0.04);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    cursor: col-resize;
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
    z-index: 15;
}

/* Badge de Documento Ativo no Canvas Acima do Input do Chat */
#canvas-context-preview {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.canvas-context-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.14) 0%, rgba(14, 165, 233, 0.08) 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: #38bdf8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), 0 0 15px rgba(56, 189, 248, 0.1);
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.canvas-context-chip:hover {
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), 0 0 20px rgba(56, 189, 248, 0.18);
}

.canvas-context-chip i.fa-file-lines {
    color: #38bdf8;
    font-size: 0.9rem;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
}

.canvas-context-chip strong {
    color: #f8fafc;
    font-weight: 600;
}

.canvas-context-chip button {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.8rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.canvas-context-chip button:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.canvas-split-resizer:hover,
.canvas-split-resizer:active {
    background: var(--primary, #38bdf8);
    border-color: var(--primary, #38bdf8);
}

.canvas-split-resizer .resizer-handle {
    width: 2px;
    height: 28px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

.canvas-split-resizer:hover .resizer-handle {
    background: #ffffff;
}

/* Painel do Canvas Studio */
.canvas-studio-pane {
    flex: 0 0 50%;
    width: 50%;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    background: var(--bg-card, #0f172a) !important;
    display: none;
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important;
    min-width: 340px;
    max-width: 80%;
    box-sizing: border-box !important;
    border-left: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5) !important;
    animation: canvasSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 12 !important;
}

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

/* Header do Canvas */
.canvas-header {
    /* Duas linhas FIXAS sempre (título em cima, ações embaixo) em vez de tentar
       caber tudo numa linha só e quebrar apenas quando aperta. A versão anterior
       (row + flex-wrap) ainda tinha um caso ruim: quando a meta-row (status/
       palavras/tempo) quebrava internamente em várias linhas, o header-left
       ficava mais ALTO que o header-right, mas os dois continuavam cabendo na
       mesma "linha do flex" em largura — e com align-items:center, o header-
       right ficava centralizado na altura do header-left, sobrepondo o meio
       dele. Com column, cada lado é sua própria linha garantida, sem ambiguidade.
    */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 8px;
    flex-shrink: 0;
}

.canvas-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.canvas-doc-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary, #38bdf8) 15%, transparent);
    color: var(--primary, #38bdf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    border: 1px solid color-mix(in srgb, var(--primary, #38bdf8) 25%, transparent);
}

.canvas-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.canvas-title-input {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-main, #f8fafc);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 2px 6px;
    width: 100%;
    outline: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.canvas-title-input:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
}

.canvas-title-input:focus {
    border-color: var(--primary, #38bdf8);
    background: rgba(255, 255, 255, 0.06);
}

.canvas-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
    padding-left: 6px;
    /* Sem isso, com um título comprido o conteúdo desta linha (status/palavras/
       tempo de leitura) vazava por cima dos botões Editor/Visualizar à direita
       em vez de caber dentro do cabeçalho. Quebra numa segunda linha em vez de
       cortar o texto no meio — mais previsível que um corte abrupto. */
    min-width: 0;
    flex-wrap: wrap;
    row-gap: 2px;
}

.canvas-meta-dot {
    opacity: 0.4;
}

.canvas-status-badge {
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.canvas-status-badge.neutral {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

.canvas-status-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.canvas-status-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.canvas-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Modo Pill: Editor vs Preview */
.canvas-mode-pill {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.btn-canvas-mode {
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-canvas-mode.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.btn-canvas-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main, #f8fafc);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-canvas-action:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-canvas-action.icon-only {
    padding: 6px 9px;
}

.btn-canvas-action.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

/* Toolbar de Formatação */
.canvas-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.btn-canvas-tool {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted, #94a3b8);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-canvas-tool:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.btn-canvas-tool:disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.canvas-tool-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

.canvas-tool-spacer {
    flex: 1;
}

.canvas-tool-info {
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
}

/* Corpo do Editor & Live Preview */
.canvas-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-body, #0b0f17);
}

/* Só ocupa espaço/padding quando tem um laudo de auditoria dentro — vazio, não deve
   empurrar o editor nem deixar uma faixa de respiro à toa. */
#canvas-audit-card-container:not(:empty) {
    padding: 16px 28px 0;
    flex-shrink: 0;
}

#canvas-stale-banner-container:not(:empty) {
    padding: 12px 28px 0;
    flex-shrink: 0;
}

.canvas-stale-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(234, 88, 12, 0.10) 100%);
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    font-size: 0.84rem;
    color: #f8fafc;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: factCheckSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.canvas-stale-banner .canvas-stale-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.canvas-stale-banner .canvas-stale-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.4;
}

.canvas-stale-banner .canvas-stale-content strong {
    color: #fbbf24;
    font-weight: 700;
}

.canvas-stale-banner .canvas-stale-content span {
    color: #f1f5f9;
}

.canvas-stale-banner .canvas-stale-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.canvas-stale-banner button.btn-stale-update {
    flex-shrink: 0;
    border: none;
    border-radius: 7px;
    font-size: 0.79rem;
    font-weight: 700;
    cursor: pointer;
    padding: 7px 14px;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.canvas-stale-banner button.btn-stale-update i {
    font-size: 0.78rem;
}

.canvas-stale-banner button.btn-stale-update:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45);
}

.canvas-stale-banner button.btn-stale-update:active {
    transform: translateY(0);
}

.canvas-stale-banner button.dismiss {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.canvas-stale-banner button.dismiss:hover {
    background: rgba(245, 158, 11, 0.2);
    color: #ffffff;
}

.canvas-editor-textarea {
    width: 100%;
    height: 100%;
    flex: 1;
    padding: 24px 28px;
    background: transparent;
    color: var(--text-main, #f8fafc);
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.92rem;
    line-height: 1.7;
    border: none;
    resize: none;
    outline: none;
    box-sizing: border-box;
    tab-size: 4;
}

.canvas-editor-textarea::placeholder {
    color: #475569;
}

.canvas-live-preview {
    width: 100%;
    height: 100%;
    flex: 1;
    padding: 28px 36px;
    overflow-y: auto;
    color: var(--text-main, #f1f5f9);
    font-size: 0.95rem;
    line-height: 1.75;
    box-sizing: border-box;
    background: var(--bg-body, #0b0f17);
}

.canvas-live-preview h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #f8fafc;
    border-bottom: 2px solid var(--primary, #38bdf8);
    padding-bottom: 8px;
    margin-top: 0;
    margin-bottom: 16px;
}

.canvas-live-preview h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
    margin-top: 24px;
    margin-bottom: 12px;
}

.canvas-live-preview h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-top: 18px;
    margin-bottom: 8px;
}

.canvas-live-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.88rem;
}

.canvas-live-preview th,
.canvas-live-preview td {
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 12px;
    text-align: left;
}

.canvas-live-preview th {
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
    font-weight: 600;
}

.canvas-live-preview tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.canvas-live-preview blockquote {
    border-left: 4px solid var(--primary, #38bdf8);
    margin: 12px 0;
    padding: 8px 16px;
    background: rgba(56, 189, 248, 0.06);
    color: #93c5fd;
    border-radius: 0 6px 6px 0;
}

/* Rodapé com Assistente de IA do Canvas */
.canvas-ai-footer {
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.canvas-ai-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 4px 10px;
    gap: 10px;
    transition: all 0.2s ease;
}

.canvas-ai-box:focus-within {
    border-color: var(--primary, #38bdf8);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #38bdf8) 20%, transparent);
    background: rgba(255, 255, 255, 0.06);
}

.canvas-ai-icon {
    color: var(--primary, #38bdf8);
    font-size: 0.9rem;
}

.canvas-ai-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main, #f8fafc);
    font-size: 0.85rem;
    outline: none;
    padding: 4px 0;
}

.canvas-ai-input::placeholder {
    color: #64748b;
}

.btn-canvas-ai-send {
    background: var(--primary, #38bdf8);
    color: #0f172a;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-canvas-ai-send:hover {
    transform: scale(1.08);
    box-shadow: 0 0 10px color-mix(in srgb, var(--primary, #38bdf8) 50%, transparent);
}

.btn-canvas-ai-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.canvas-ai-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--primary, #38bdf8);
    padding: 2px 4px;
}

/* Botão de Abrir no Canvas dentro dos balões de mensagens do Chat */
.btn-open-in-canvas {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: color-mix(in srgb, var(--primary, #38bdf8) 12%, transparent);
    color: var(--primary, #38bdf8);
    border: 1px solid color-mix(in srgb, var(--primary, #38bdf8) 25%, transparent);
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 6px;
}

.btn-open-in-canvas:hover {
    background: color-mix(in srgb, var(--primary, #38bdf8) 22%, transparent);
    border-color: var(--primary, #38bdf8);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--primary, #38bdf8) 20%, transparent);
}

/* Adaptação Responsiva para Telas Menores (< 1024px) */
@media (max-width: 1024px) {
    .chat-split-wrapper.canvas-active .chat-main-pane {
        display: none !important;
    }
    .chat-split-wrapper.canvas-active .canvas-split-resizer {
        display: none !important;
    }
    .chat-split-wrapper.canvas-active .canvas-studio-pane {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Seletor e Dropdown de Múltiplos Documentos no Canvas */
.btn-canvas-doc-picker {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted, #94a3b8);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-canvas-doc-picker:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: var(--primary, #38bdf8);
}

.canvas-doc-count-badge {
    background: var(--primary, #38bdf8);
    color: #0f172a;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    line-height: 1.1;
}

.canvas-doc-dropdown {
    /* position:fixed (não absolute) de propósito — o Canvas tem overflow:hidden
       pra conter seu próprio layout, e com o painel estreito (arrastado perto do
       mínimo) um dropdown absolute era cortado na borda direita. Com fixed, o
       JS (CanvasStudio.toggleDocPicker) calcula top/left a partir da posição
       real do botão na tela, então o menu nunca fica preso pelo pai. */
    position: fixed;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 200;
    overflow: hidden;
    animation: fadeIn 0.15s ease;
}

.canvas-doc-dropdown-header {
    padding: 8px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #94a3b8);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.canvas-doc-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
}

.canvas-doc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.canvas-doc-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.canvas-doc-item.active {
    background: color-mix(in srgb, var(--primary, #38bdf8) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary, #38bdf8) 30%, transparent);
}

.canvas-doc-item-icon {
    color: var(--primary, #38bdf8);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.canvas-doc-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.canvas-doc-item-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main, #f8fafc);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.canvas-doc-item-preview {
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.canvas-doc-item-empty {
    padding: 16px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
}

/* ==========================================================================
   KOGNVS AGENDA: CALENDÁRIO GRÁFICO INTERATIVO EXECUTIVO
   ========================================================================== */

/* Barra de Alternância de Visualização (Calendário vs Tabela) e Legenda */
.agenda-display-switcher-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.25rem;
    padding: 6px 0;
}

.agenda-quick-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 4px 14px;
}

.agenda-quick-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: var(--text-muted, #94a3b8);
    font-weight: 500;
}

.agenda-quick-legend .legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Container de Modos de Exibição */
.agenda-view-mode-container {
    animation: fadeInCal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Barra de Controle e Navegação do Calendário */
.calendar-toolbar-card {
    background: var(--bg-card, #181d28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.calendar-nav-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-cal-nav {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main, #f8fafc);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.btn-cal-nav:hover {
    background: color-mix(in srgb, var(--primary, #38bdf8) 15%, transparent);
    color: var(--primary, #38bdf8);
    border-color: color-mix(in srgb, var(--primary, #38bdf8) 35%, transparent);
    transform: scale(1.05);
}

.btn-cal-today {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-main, #f8fafc);
    padding: 0 14px;
    height: 34px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cal-today:hover {
    background: color-mix(in srgb, var(--primary, #38bdf8) 15%, transparent);
    color: var(--primary, #38bdf8);
    border-color: color-mix(in srgb, var(--primary, #38bdf8) 40%, transparent);
}

.calendar-period-label-wrap {
    display: flex;
    flex-direction: column;
    margin-left: 6px;
}

.calendar-period-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
    letter-spacing: -0.01em;
}

.calendar-period-subtitle {
    font-size: 0.74rem;
    color: var(--text-muted, #94a3b8);
}

/* Pílulas de Granularidade (Mês, Semana, Dia) */
.calendar-granularity-pills {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}

.btn-granularity {
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-granularity:hover {
    color: var(--text-main, #f8fafc);
    background: rgba(255, 255, 255, 0.06);
}

.btn-granularity.active {
    background: color-mix(in srgb, var(--primary, #38bdf8) 18%, transparent);
    color: var(--primary, #38bdf8);
    border: 1px solid color-mix(in srgb, var(--primary, #38bdf8) 35%, transparent);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--primary, #38bdf8) 15%, transparent);
}

/* ==========================================================================
   GRADE MENSAL (Month Grid)
   ========================================================================== */
.calendar-month-table-wrap {
    background: var(--bg-card, #181d28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.calendar-weekdays-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: rgba(20, 23, 32, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 0;
}

.weekday-col {
    text-align: center;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #94a3b8);
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: rgba(255, 255, 255, 0.06);
}

.calendar-day-cell {
    background: var(--bg-card, #181d28);
    min-height: 120px;
    max-height: 180px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    transition: background 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.calendar-day-cell:hover {
    background: rgba(30, 41, 59, 0.7);
}

.calendar-day-cell.calendar-day-other-month {
    background: rgba(15, 18, 26, 0.55);
    opacity: 0.45;
}

.calendar-day-cell.calendar-day-other-month:hover {
    opacity: 0.8;
}

.calendar-day-cell.calendar-day-today {
    background: color-mix(in srgb, var(--primary, #38bdf8) 5%, transparent);
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--primary, #38bdf8) 45%, transparent);
}

.calendar-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.calendar-day-num {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.calendar-day-today .calendar-day-num {
    background: var(--primary, #38bdf8);
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 0 10px color-mix(in srgb, var(--primary, #38bdf8) 50%, transparent);
}

.calendar-day-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.calendar-day-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary, #38bdf8);
    background: color-mix(in srgb, var(--primary, #38bdf8) 12%, transparent);
    padding: 1px 6px;
    border-radius: 8px;
}

.calendar-day-add-btn {
    opacity: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-main, #f8fafc);
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.calendar-day-cell:hover .calendar-day-add-btn {
    opacity: 1;
}

.calendar-day-add-btn:hover {
    background: var(--primary, #38bdf8);
    color: #0f172a;
}

/* Lista de Eventos no Dia */
.calendar-events-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow: hidden;
}

/* Chip de Compromisso no Calendário */
.calendar-event-chip {
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.calendar-event-chip:hover {
    transform: translateY(-1px);
    filter: brightness(1.2);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.calendar-event-chip .chip-time {
    font-size: 0.68rem;
    opacity: 0.85;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    flex-shrink: 0;
}

.calendar-event-chip .chip-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Cores dos Chips por Tipo de Compromisso */
.calendar-event-chip.chip-reuniao {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border-left: 3px solid #10b981;
    border-top: 1px solid rgba(16, 185, 129, 0.25);
    border-right: 1px solid rgba(16, 185, 129, 0.25);
    border-bottom: 1px solid rgba(16, 185, 129, 0.25);
}

.calendar-event-chip.chip-followup {
    background: rgba(56, 189, 248, 0.16);
    color: #38bdf8;
    border-left: 3px solid #0284c7;
    border-top: 1px solid rgba(56, 189, 248, 0.25);
    border-right: 1px solid rgba(56, 189, 248, 0.25);
    border-bottom: 1px solid rgba(56, 189, 248, 0.25);
}

.calendar-event-chip.chip-prazo {
    background: rgba(168, 85, 247, 0.16);
    color: #c084fc;
    border-left: 3px solid #9333ea;
    border-top: 1px solid rgba(168, 85, 247, 0.25);
    border-right: 1px solid rgba(168, 85, 247, 0.25);
    border-bottom: 1px solid rgba(168, 85, 247, 0.25);
}

.calendar-event-chip.chip-lembrete {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border-left: 3px solid #d97706;
    border-top: 1px solid rgba(245, 158, 11, 0.25);
    border-right: 1px solid rgba(245, 158, 11, 0.25);
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
}

.calendar-event-chip.chip-concluido {
    opacity: 0.55;
    text-decoration: line-through;
    filter: grayscale(40%);
}

.calendar-more-btn {
    font-size: 0.68rem;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border: 1px dashed rgba(56, 189, 248, 0.35);
    border-radius: 4px;
    padding: 2px 4px;
    text-align: center;
    cursor: pointer;
    margin-top: 2px;
    transition: all 0.15s ease;
}

.calendar-more-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #ffffff;
}

/* ==========================================================================
   LINHA DO TEMPO SEMANAL (Week Grid)
   ========================================================================== */
.calendar-week-table-wrap {
    background: var(--bg-card, #181d28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.calendar-week-header {
    display: grid;
    grid-template-columns: 55px repeat(7, 1fr);
    background: rgba(20, 23, 32, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 5;
}

.calendar-week-header-day {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.calendar-week-header-day .day-name {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted, #94a3b8);
}

.calendar-week-header-day .day-num {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.calendar-week-header-day.is-today .day-num {
    background: var(--primary, #38bdf8);
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 0 10px color-mix(in srgb, var(--primary, #38bdf8) 40%, transparent);
}

.calendar-week-body-scroll {
    max-height: 620px;
    overflow-y: auto;
}

.calendar-week-body {
    display: grid;
    grid-template-columns: 55px repeat(7, 1fr);
    position: relative;
}

.calendar-time-axis {
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.calendar-hour-label {
    height: 52px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-right: 8px;
    padding-top: 4px;
}

.calendar-week-day-col {
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    display: flex;
    flex-direction: column;
}

.calendar-week-hour-slot {
    height: 52px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.15s ease;
}

.calendar-week-hour-slot:hover {
    background: rgba(56, 189, 248, 0.06);
}

.calendar-week-event-card {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.74rem;
    z-index: 2;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.calendar-week-event-card:hover {
    transform: scale(1.02);
    filter: brightness(1.15);
    z-index: 4;
}

/* Indicador de Horário Atual ("Live Line") */
.calendar-now-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
    z-index: 3;
    pointer-events: none;
}

.calendar-now-dot {
    position: absolute;
    left: -4px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

/* ==========================================================================
   VISÃO DIÁRIA DETALHADA (Day View)
   ========================================================================== */
.calendar-day-container {
    background: var(--bg-card, #181d28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calendar-day-hero-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(168, 85, 247, 0.12));
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
}

.calendar-day-hero-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
}

.calendar-day-hero-sub {
    font-size: 0.82rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 2px;
}

.calendar-day-timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calendar-day-event-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.calendar-day-event-card:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(56, 189, 248, 0.35);
}

.calendar-day-event-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: #38bdf8;
    min-width: 65px;
}

.calendar-day-event-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-day-event-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
}

.calendar-day-event-meta {
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.calendar-day-empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--text-muted, #94a3b8);
}

/* ==========================================================================
   MODAL DE DETALHES RÁPIDOS DO EVENTO (Quick Popover)
   ========================================================================== */
.cal-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.cal-detail-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cal-detail-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #94a3b8);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cal-detail-val {
    font-size: 0.88rem;
    color: var(--text-main, #f8fafc);
    font-weight: 600;
}

.cal-meet-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
}

.cal-meet-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    color: #ffffff;
}

.cal-detail-desc-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px;
}

/* Responsividade do Calendário */
@media (max-width: 900px) {
    .calendar-toolbar-card {
        flex-direction: column;
        align-items: stretch;
    }
    .calendar-granularity-pills {
        justify-content: center;
    }
    .calendar-day-cell {
        min-height: 80px;
        padding: 4px;
    }
    .calendar-event-chip {
        font-size: 0.65rem;
        padding: 2px 4px;
    }
    .cal-details-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Kognvs Workspace: QuickLook, Spotlight Search & Pinned
   ========================================================= */

/* QuickLook Modal */
.quicklook-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.quicklook-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.quicklook-card {
    width: 90%;
    max-width: 1050px;
    height: 85vh;
    max-height: 820px;
    background: #14171d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.quicklook-modal-overlay.show .quicklook-card {
    transform: scale(1);
}

.quicklook-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.4rem;
    background: #101217;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 12px;
}

.quicklook-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.quicklook-file-icon {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.quicklook-filename {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f8fafc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 450px;
}

.quicklook-metadata {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
}

.quicklook-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.quicklook-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    background: #0d0f13;
    position: relative;
}

.quicklook-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem;
    background: #0e1014;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.quicklook-footer kbd,
.spotlight-footer kbd,
.spotlight-badge kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.70rem;
    font-family: inherit;
    color: #cbd5e1;
}

/* QuickLook Renderers */
.ql-preview-markdown {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.ql-preview-markdown h1, .ql-preview-markdown h2, .ql-preview-markdown h3 {
    color: #f8fafc;
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
}
.ql-preview-markdown pre {
    background: #090a0d;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,0.06);
}

.ql-preview-csv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
}
.ql-preview-csv-table th {
    background: #181b22;
    color: #94a3b8;
    padding: 8px 12px;
    font-weight: 600;
    position: sticky;
    top: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 2;
}
.ql-preview-csv-table td {
    padding: 7px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #f1f5f9;
}
.ql-preview-csv-table tr:hover td {
    background: rgba(56, 189, 248, 0.06);
}

.ql-preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: auto;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.ql-preview-code {
    width: 100%;
    height: 100%;
    background: #0a0c10;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: auto;
    white-space: pre;
    margin: 0;
}

/* QuickLook Office / Word DOCX Preview */
.ql-office-docx-wrapper {
    width: 100%;
    min-height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px 16px 60px 16px;
    box-sizing: border-box;
    background: transparent;
}

.ql-office-docx-page {
    background: #ffffff !important;
    color: #1e293b !important;
    padding: 56px 64px;
    border-radius: 8px;
    max-width: 860px;
    width: 100%;
    min-height: fit-content;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.75;
    font-size: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
    word-break: break-word;
    flex-shrink: 0;
}

.ql-office-docx-page p {
    color: #1e293b !important;
    margin-top: 0;
    margin-bottom: 1.1em;
}

.ql-office-docx-page strong,
.ql-office-docx-page b {
    color: #0f172a !important;
    font-weight: 700;
}

.ql-office-docx-page h1,
.ql-office-docx-page h2,
.ql-office-docx-page h3,
.ql-office-docx-page h4,
.ql-office-docx-page h5,
.ql-office-docx-page h6 {
    color: #0f172a !important;
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.6em;
    line-height: 1.35;
}

.ql-office-docx-page table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    background: #ffffff !important;
}

.ql-office-docx-page table th,
.ql-office-docx-page table td {
    border: 1px solid #cbd5e1 !important;
    padding: 10px 14px;
    font-size: 14px;
    color: #1e293b !important;
}

.ql-office-docx-page table th {
    background: #f8fafc !important;
    font-weight: 600;
}

.ql-office-docx-page ul,
.ql-office-docx-page ol {
    margin-top: 0.5em;
    margin-bottom: 1em;
    padding-left: 28px;
    color: #1e293b !important;
}

.ql-office-docx-page li {
    margin-bottom: 0.4em;
    color: #1e293b !important;
}

/* Spotlight Command Palette Modal (Ctrl + K) */
.spotlight-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 12000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.spotlight-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.spotlight-container {
    width: 92%;
    max-width: 660px;
    background: #15181f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: transform 0.16s ease;
}

.spotlight-modal-overlay.show .spotlight-container {
    transform: translateY(0) scale(1);
}

.spotlight-input-wrapper {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 12px;
}

.spotlight-search-icon {
    font-size: 1.1rem;
    color: #38bdf8;
}

.spotlight-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.05rem;
    color: #f1f5f9;
    font-weight: 500;
}

.spotlight-filter-pills {
    display: flex;
    gap: 6px;
    padding: 0.5rem 1.25rem;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
}

.spotlight-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.74rem;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    white-space: nowrap;
}

.spotlight-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
}

.spotlight-pill.active {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
    font-weight: 600;
}

.spotlight-results-list {
    max-height: 380px;
    overflow-y: auto;
    padding: 0.5rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spotlight-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.1s, border-color 0.1s;
}

.spotlight-result-item:hover,
.spotlight-result-item.selected {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.25);
}

.spotlight-result-item.selected .spotlight-item-name {
    color: #38bdf8;
}

.spotlight-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.25rem;
    background: #0e1014;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.72rem;
    color: #64748b;
}

/* Pinned Folder Row in Sidebar */
.tree-node-pinned-row {
    position: relative;
}
.tree-node-pinned-row .unpin-btn {
    opacity: 0;
    transition: opacity 0.15s;
}
.tree-node-pinned-row:hover .unpin-btn {
    opacity: 1;
}

/* =========================================================
   Seleção Múltipla, Marquee Box & Barra Flutuante de Ações
   ========================================================= */

.file-grid-item.selected {
    background: rgba(56, 189, 248, 0.14) !important;
    border-color: rgba(56, 189, 248, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35), 0 4px 14px rgba(56, 189, 248, 0.2);
    transform: translateY(-2px);
}

.file-list-item.selected {
    background: rgba(56, 189, 248, 0.14) !important;
    border-left: 3px solid #38bdf8 !important;
}

/* Caixa de seleção com mouse (Marquee) */
.selection-marquee-box {
    position: absolute;
    border: 1.5px solid rgba(56, 189, 248, 0.75);
    background: rgba(56, 189, 248, 0.18);
    border-radius: 4px;
    pointer-events: none;
    z-index: 100;
}

/* Barra Flutuante de Ações em Lote */
.explorer-batch-bar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #181b22;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 30px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.explorer-batch-bar.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.batch-count-badge {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 700;
}

.batch-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.12s, border-color 0.12s, transform 0.1s;
}

.batch-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.batch-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.batch-btn.ia {
    background: rgba(167, 139, 250, 0.15);
    border-color: rgba(167, 139, 250, 0.3);
    color: #c4b5fd;
}
.batch-btn.ia:hover {
    background: rgba(167, 139, 250, 0.25);
    border-color: rgba(167, 139, 250, 0.5);
}

/* ==========================================================================
   KOGNVS MOBILE APP-FEEL RESPONSIVENESS (TASK CHAT & NAVIGATION)
   ========================================================================== */

/* Botão de Hambúrguer Mobile (Oculto em Desktop) */
.btn-mobile-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main, #f1f5f9);
    font-size: 0.95rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-mobile-sidebar-toggle:hover,
.btn-mobile-sidebar-toggle:active {
    background: rgba(255, 255, 255, 0.14);
    transform: scale(1.04);
}

/* Backdrop Escurecido para Gaveta Mobile */
.sidebar-mobile-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-mobile-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   BREAKPOINTS INTERMEDIÁRIOS: Telas Médias, Split Screen e Document Studio
   ========================================================================== */
@media (max-width: 1200px) {
    .topbar {
        padding: 0 0.85rem !important;
        gap: 8px !important;
    }
    .chat-topbar-tags-bar {
        max-width: 180px !important;
    }
    #chat-ai-model-badge {
        display: none !important;
    }
    .btn-specialist-toggle {
        max-width: 160px !important;
        padding: 4px 10px !important;
    }
    #selected-specialist-label {
        max-width: 105px !important;
    }
}

@media (max-width: 992px) {
    .chat-topbar-tags-bar {
        display: none !important;
    }
    #chat-project-badge {
        display: none !important;
    }
    #btn-chat-header-files {
        display: none !important;
    }
    .btn-specialist-toggle {
        max-width: 140px !important;
    }
    #selected-specialist-label {
        max-width: 85px !important;
    }
    .select-ai-provider,
    .select-ai-mode {
        font-size: 0.72rem !important;
        padding: 4px 22px 4px 8px !important;
        max-width: 105px !important;
        height: 28px !important;
    }
    .ai-provider-select-wrapper i,
    .ai-mode-select-wrapper i {
        right: 7px !important;
        font-size: 0.58rem !important;
    }
}

/* ==========================================================================
   BREAKPOINT MOBILE (<= 768px): Experiência Nativa de App de Celular
   ========================================================================== */
@media (max-width: 768px) {
    /* Mostra o botão de hambúrguer */
    .btn-mobile-sidebar-toggle {
        display: inline-flex !important;
    }

    /* Trava rolagem do body quando menu estiver aberto */
    body.sidebar-mobile-open {
        overflow: hidden !important;
    }

    /* Sidebar vira Gaveta Deslizante (Off-Canvas Drawer) */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 290px !important;
        max-width: 86vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 999 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease !important;
        box-shadow: none !important;
        border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding: 0.85rem 0.75rem 0.6rem 0.75rem !important;
        background: #0f1219 !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0) !important;
        box-shadow: 15px 0 45px rgba(0, 0, 0, 0.75) !important;
    }

    /* Quando colapsado no localStorage, força estado normal na gaveta mobile */
    .sidebar.collapsed {
        width: 290px !important;
        padding: 0.85rem 0.75rem 0.6rem 0.75rem !important;
    }

    .sidebar.collapsed .kognvs-brand-logo-wrap {
        display: flex !important;
    }

    .sidebar.collapsed .sidebar-header-top {
        flex-direction: row !important;
        align-items: center !important;
    }

    .sidebar.collapsed .tenant-workspace-pill {
        display: flex !important;
    }

    .sidebar.collapsed .btn-collapsed-new-task {
        display: none !important;
    }

    .sidebar.collapsed .sidebar-nav-tabs {
        display: flex !important;
    }

    .sidebar.collapsed .nav-tab-btn {
        justify-content: flex-start !important;
        padding: 8px 12px !important;
    }

    .sidebar.collapsed .nav-tab-btn span:not(.nav-tab-badge) {
        display: inline !important;
    }

    .sidebar.collapsed .nav-tab-btn .nav-tab-add-btn {
        display: flex !important;
    }

    .sidebar.collapsed #sidebar-chat-controls {
        display: flex !important;
    }

    .sidebar.collapsed .profile-container {
        padding: 8px 10px !important;
        justify-content: flex-start !important;
    }

    .sidebar.collapsed .profile-info,
    .sidebar.collapsed .profile-container .fa-gear {
        display: block !important;
    }

    /* Área Principal ocupa 100% da tela sem divisores espremendo */
    .main-content {
        width: 100% !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        flex: 1 1 auto !important;
        overflow: hidden !important;
    }

    #view-chat.content-view {
        width: 100% !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
        flex: 1 1 100% !important;
        min-height: 0 !important;
    }

    #view-chat.content-view.active {
        display: flex !important;
        flex-direction: column !important;
    }

    .chat-split-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow: hidden !important;
        flex: 1 1 100% !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .chat-main-pane {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        flex: 1 1 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
    }

    /* Topbar com visual de barra de aplicativo mobile */
    .topbar {
        padding: 0 8px !important;
        height: 50px !important;
        min-height: 50px !important;
        gap: 6px !important;
        background: rgba(13, 16, 23, 0.92) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 50 !important;
        box-sizing: border-box !important;
    }

    .topbar-left {
        gap: 6px !important;
    }

    .topbar-right {
        gap: 6px !important;
    }

    /* Oculta título de edição inline no topbar em telas compactas */
    .chat-topbar-title-container {
        display: none !important;
    }

    /* Botão de Especialista estilo Pill Compacto */
    .btn-specialist-toggle {
        padding: 4px 8px !important;
        font-size: 0.74rem !important;
        gap: 5px !important;
        max-width: 120px !important;
        border-radius: 14px !important;
        background: rgba(255, 255, 255, 0.06) !important;
    }

    #selected-specialist-label {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-weight: 600 !important;
        max-width: 75px !important;
    }

    /* Seletor Compacto do Motor de IA e Modo */
    .select-ai-provider,
    .select-ai-mode {
        padding: 3px 20px 3px 6px !important;
        font-size: 0.68rem !important;
        border-radius: 14px !important;
        height: 28px !important;
        max-width: 90px !important;
    }

    .ai-provider-select-wrapper i,
    .ai-mode-select-wrapper i {
        right: 6px !important;
        font-size: 0.55rem !important;
    }

    /* Botões de Ação do Header (Canvas, 3 Pontos) */
    .btn-chat-header-options {
        width: 30px !important;
        height: 30px !important;
        border-radius: 8px !important;
        font-size: 0.82rem !important;
    }

    /* Badges Opcionais e Ações Secundárias Ocultos no Mobile para não apertar */
    #chat-ai-model-badge,
    #chat-project-badge,
    #btn-chat-header-files,
    #btn-toggle-canvas,
    #btn-toggle-live-browser,
    .chat-topbar-tags-bar {
        display: none !important;
    }

    /* Menu Suspenso de Especialistas Adaptativo (Modal/Sheet Responsivo) */
    .specialist-dropdown-menu {
        position: fixed !important;
        top: 56px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(82vh - 60px) !important;
        flex-direction: column !important;
        border-radius: 16px !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85) !important;
        z-index: 1000 !important;
        overflow: hidden !important;
    }

    .flyout-dept-col {
        width: 100% !important;
        max-height: 110px !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        padding: 6px 8px !important;
        gap: 6px !important;
    }

    .flyout-dept-header {
        display: none !important;
    }

    .flyout-dept-item {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 5px 10px !important;
        font-size: 0.75rem !important;
        border-radius: 20px !important;
        background: rgba(255, 255, 255, 0.04) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
    }

    .flyout-dept-item.active {
        background: color-mix(in srgb, var(--primary, #38bdf8) 22%, transparent) !important;
        border-color: var(--primary, #38bdf8) !important;
        color: #ffffff !important;
    }

    .flyout-dept-item > i.fa-chevron-right {
        display: none !important;
    }

    .flyout-roles-col {
        flex: 1 !important;
        max-height: 280px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 8px 10px !important;
    }

    .flyout-role-item {
        padding: 8px 10px !important;
        border-radius: 10px !important;
        margin-bottom: 4px !important;
    }

    .flyout-role-title {
        font-size: 0.82rem !important;
    }

    .flyout-role-desc {
        font-size: 0.70rem !important;
        line-height: 1.35 !important;
    }

    /* Área de Rolagem do Chat */
    .chat-scroll-area {
        flex: 1 1 0px !important;
        min-height: 0 !important;
        height: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 10px 8px 12px 8px !important;
        gap: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .welcome-screen {
        padding: 2rem 0.5rem !important;
        max-width: 100% !important;
    }

    .welcome-screen h1 {
        font-size: 1.65rem !important;
        margin-bottom: 0.4rem !important;
        letter-spacing: -0.02em !important;
    }

    .welcome-screen p {
        font-size: 0.88rem !important;
        line-height: 1.45 !important;
        padding: 0 8px !important;
    }

    /* Balões de Mensagem Mobile */
    .message-container {
        margin-bottom: 1rem !important;
        gap: 8px !important;
        max-width: 100% !important;
    }

    .avatar {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        border-radius: 10px !important;
        font-size: 0.95rem !important;
        margin-top: 0 !important;
    }

    .message-body-wrap {
        max-width: calc(100% - 42px) !important;
    }

    .msg-author-name {
        font-size: 0.78rem !important;
    }

    .msg-author-badge {
        font-size: 0.64rem !important;
        padding: 1px 5px !important;
    }

    .msg-timestamp {
        font-size: 0.65rem !important;
    }

    .message-content.user-bubble {
        max-width: 90% !important;
        padding: 8px 12px !important;
        font-size: 0.90rem !important;
        line-height: 1.5 !important;
        border-radius: 16px 16px 4px 16px !important;
    }

    .message-content.markdown-body {
        padding: 10px 12px !important;
        border-radius: 12px !important;
        font-size: 0.88rem !important;
        line-height: 1.55 !important;
        max-width: 100% !important;
    }

    .markdown-body h1 {
        font-size: 1.15rem !important;
        margin-top: 0.9rem !important;
        margin-bottom: 0.35rem !important;
    }

    .markdown-body h2 {
        font-size: 1.05rem !important;
        margin-top: 0.8rem !important;
        margin-bottom: 0.3rem !important;
    }

    .markdown-body h3 {
        font-size: 0.95rem !important;
        margin-top: 0.7rem !important;
        margin-bottom: 0.25rem !important;
    }

    .markdown-body p {
        margin-bottom: 0.65rem !important;
    }

    .markdown-body ul,
    .markdown-body ol {
        padding-left: 1.1rem !important;
        margin-bottom: 0.65rem !important;
    }

    .markdown-body img {
        max-height: 280px !important;
        border-radius: 8px !important;
    }

    .markdown-body pre,
    .code-block-wrapper {
        margin: 8px 0 !important;
        border-radius: 8px !important;
    }

    .markdown-body code {
        font-size: 0.82em !important;
    }

    .table-responsive-wrapper,
    .markdown-body table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        font-size: 0.78rem !important;
        margin: 8px 0 !important;
    }

    .kognvs-md-table th,
    .markdown-body th,
    .kognvs-md-table td,
    .markdown-body td {
        padding: 6px 10px !important;
        white-space: nowrap !important;
    }

    .message-actions-toolbar {
        opacity: 1 !important;
        margin-top: 4px !important;
        gap: 4px !important;
        flex-wrap: wrap !important;
    }

    .btn-msg-action {
        padding: 3px 7px !important;
        font-size: 0.68rem !important;
        border-radius: 6px !important;
    }

    /* Barra de Digitação Fixada / Flutuante no Rodapé */
    .input-area-container {
        padding: 0 8px 4px 8px !important;
        background: linear-gradient(180deg, transparent 0%, rgba(10, 13, 18, 0.98) 40%) !important;
        width: 100% !important;
        box-sizing: border-box !important;
        position: relative !important;
        flex-shrink: 0 !important;
        z-index: 40 !important;
    }

    .input-box {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px !important;
        padding: 6px 6px 6px 8px !important;
        gap: 6px !important;
        align-items: flex-end !important;
        background: rgba(22, 27, 38, 0.97) !important;
        border: 1px solid rgba(255, 255, 255, 0.13) !important;
        box-shadow: 0 4px 22px rgba(0, 0, 0, 0.55) !important;
        box-sizing: border-box !important;
    }

    .input-toolbar-left {
        margin-bottom: 1px !important;
    }

    #btn-actions-menu {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85rem !important;
        border-radius: 50% !important;
    }

    /* 16px previne zoom automático no Safari iOS */
    #message-input {
        font-size: 16px !important;
        min-height: 32px !important;
        max-height: 110px !important;
        padding: 5px 2px !important;
        margin: 0 2px !important;
        line-height: 1.4 !important;
        align-self: center !important;
    }

    .input-toolbar-right {
        gap: 4px !important;
        margin-bottom: 1px !important;
    }

    #btn-execution-mode {
        padding: 4px 8px !important;
        height: 32px !important;
        border-radius: 16px !important;
        font-size: 0.72rem !important;
        gap: 4px !important;
    }

    #cur-mode-label {
        display: inline-block !important;
        max-width: 65px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 0.72rem !important;
    }

    #send-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85rem !important;
        border-radius: 50% !important;
    }

    /* Popups e Menus Suspensos Bounded na Viewport Mobile */
    #actions-popup-menu,
    #execution-mode-menu {
        position: fixed !important;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        max-height: 65vh !important;
        overflow-y: auto !important;
        z-index: 1000 !important;
        border-radius: 16px !important;
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.75) !important;
    }

    #slash-popup,
    #mention-popup {
        position: fixed !important;
        bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        max-height: 52vh !important;
        overflow-y: auto !important;
        z-index: 1000 !important;
        border-radius: 16px !important;
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.75) !important;
    }

    #chat-header-dropdown {
        position: fixed !important;
        top: 56px !important;
        right: 10px !important;
        width: 270px !important;
        max-width: calc(100vw - 20px) !important;
        z-index: 1000 !important;
        border-radius: 14px !important;
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.75) !important;
    }

    /* Barra de Monitoramento de Custos & Loops Ultra-Compacta */
    .ai-cost-meter-container {
        width: calc(100% - 16px) !important;
        max-width: calc(100% - 16px) !important;
        padding: 3px 8px !important;
        margin: 0 8px max(6px, env(safe-area-inset-bottom, 6px)) 8px !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
        background: rgba(15, 23, 42, 0.75) !important;
        backdrop-filter: blur(8px) !important;
        flex-shrink: 0 !important;
        z-index: 40 !important;
    }

    .cost-meter-top {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        font-size: 0.68rem !important;
        gap: 4px !important;
        margin-bottom: 3px !important;
    }

    .cost-meter-left {
        gap: 4px !important;
        flex-shrink: 0 !important;
    }

    .cost-meter-title {
        display: none !important;
    }

    .cost-meter-turn-badge {
        font-size: 0.65rem !important;
        padding: 1px 5px !important;
    }

    .cost-meter-right {
        gap: 3px !important;
        font-size: 0.68rem !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
    }

    .cost-meter-val {
        font-size: 0.72rem !important;
    }

    .cost-meter-limit {
        font-size: 0.66rem !important;
        opacity: 0.8 !important;
    }

    .cost-meter-percent-badge {
        font-size: 0.62rem !important;
        padding: 1px 4px !important;
    }

    .cost-meter-chat-total-badge {
        font-size: 0.62rem !important;
        padding: 1px 4px !important;
        display: inline-flex !important;
    }

    .cost-meter-progress-track {
        height: 3px !important;
    }
}

/* Telas Ultra-Compactas (ex: iPhone SE / 375px) */
@media (max-width: 480px) {
    .topbar {
        padding: 0 6px !important;
        gap: 4px !important;
    }

    .btn-specialist-toggle {
        max-width: 95px !important;
        padding: 3px 5px !important;
        font-size: 0.70rem !important;
    }

    #selected-specialist-label {
        max-width: 50px !important;
    }

    .select-ai-provider,
    .select-ai-mode {
        padding: 2px 16px 2px 4px !important;
        font-size: 0.64rem !important;
        max-width: 78px !important;
        height: 26px !important;
    }

    .ai-provider-select-wrapper i,
    .ai-mode-select-wrapper i {
        right: 4px !important;
        font-size: 0.50rem !important;
    }

    .cost-meter-right .cost-meter-limit {
        display: none !important;
    }
}

/* =========================================================
   PALCO MULTI-AGENTE AO VIVO & FAIXA DE CO-CRIAÇÃO (STAGE)
   ========================================================= */

.step-row.step-collab-specialist {
    background: rgba(56, 189, 248, 0.04);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 4px;
    transition: all 0.25s ease;
}

.step-row.step-collab-specialist.running {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.step-row.step-collab-specialist.done {
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.25);
}

.streaming-collab-deck {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 12px;
    width: 100%;
}

.collab-live-card {
    position: relative;
    background: linear-gradient(135deg, rgba(23, 31, 48, 0.9) 0%, rgba(13, 19, 31, 0.97) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3.5px solid var(--agent-color, #38bdf8);
    border-radius: 12px;
    padding: 12px 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 0 16px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: collabCardFadeIn 0.35s ease-out;
}

@keyframes collabCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.collab-live-card.active {
    border-color: rgba(255, 255, 255, 0.12);
    border-left-color: var(--agent-color, #38bdf8);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), 
                0 0 20px rgba(56, 189, 248, 0.16),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.collab-live-card.done {
    border-color: rgba(34, 197, 94, 0.25);
    border-left-color: #22c55e;
    background: linear-gradient(135deg, rgba(16, 36, 26, 0.88) 0%, rgba(10, 24, 18, 0.96) 100%);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3), 0 0 14px rgba(34, 197, 94, 0.12);
}

.collab-live-card.dismissing {
    opacity: 0 !important;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-width: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    transform: translateY(-8px) scale(0.96) !important;
    transition: all 0.65s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.collab-card-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
    z-index: 2;
}

.collab-live-avatar-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    cursor: pointer;
}

.collab-live-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
    border: 2px solid var(--agent-color, #38bdf8);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.collab-live-avatar-wrap:hover .collab-live-avatar {
    transform: scale(1.06);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.55);
}

.collab-live-radar {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--agent-color, #38bdf8);
    border: 2px solid #0f172a;
    animation: pulse-specialist-radar 1.5s infinite;
}

.collab-live-radar.radar-done {
    background: #22c55e;
    animation: none;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

@keyframes pulse-specialist-radar {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.collab-live-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.collab-live-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.collab-live-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: color 0.15s ease;
}

.collab-live-name:hover {
    color: var(--agent-color, #38bdf8);
}

.collab-live-role-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--agent-color, #38bdf8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    letter-spacing: 0.2px;
}

.collab-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.collab-status-badge.status-running {
    background: rgba(255, 255, 255, 0.06);
    color: var(--agent-color, #38bdf8);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.collab-status-badge.status-done {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.28);
}

.collab-live-mission-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 7px 12px;
    margin-top: 6px;
}

.collab-mission-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--agent-color, #38bdf8);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-top: 1px;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
}

.collab-mission-text {
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.45;
    word-break: break-word;
}

.collab-card-scanline {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--agent-color, #38bdf8) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: collabScanlineAnim 2.2s linear infinite;
}

@keyframes collabScanlineAnim {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.msg-collab-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(56, 189, 248, 0.22);
    padding: 4px 12px;
    border-radius: 24px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.collab-stack-avatars {
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
}

.collab-stack-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #0f172a;
    margin-left: -6px;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.collab-stack-avatar:first-child {
    margin-left: 0;
}

.collab-stack-avatar:hover {
    transform: translateY(-2px) scale(1.15);
    z-index: 10;
}

/* ==========================================================================
   PAINEL VISUAL DE ROTINAS & MISSÕES (CRON & AGENDAMENTOS)
   ========================================================================== */

.rotinas-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .rotinas-grid-container {
        grid-template-columns: 1fr;
    }
}

.rotina-card {
    background: var(--bg-surface, #1e293b);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.rotina-card:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.rotina-card.card-ativa {
    border-left: 4px solid #10b981;
}

.rotina-card.card-pausada {
    border-left: 4px solid #64748b;
    opacity: 0.85;
}

.rotina-card.card-missao {
    border-left: 4px solid #38bdf8;
}

.rotina-card.card-concluida {
    border-left: 4px solid #a855f7;
}

.rotina-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0.9rem;
}

.rotina-agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.rotina-agent-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.rotina-card-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 0.4rem;
    line-height: 1.35;
    cursor: pointer;
}

.rotina-card-title:hover {
    color: #38bdf8;
}

.rotina-type-pill {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.type-pill-recorrente {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.type-pill-missao {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.rotina-cron-frequency {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.rotina-prompt-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.80rem;
    color: #94a3b8;
    line-height: 1.45;
    margin-bottom: 1rem;
    max-height: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    cursor: pointer;
    transition: background 0.15s ease;
}

.rotina-prompt-box:hover {
    background: rgba(15, 23, 42, 0.9);
    color: #cbd5e1;
}

.rotina-meta-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 1rem;
}

.rotina-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
}

.rotina-next-fire-badge {
    color: #38bdf8;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rotina-progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.rotina-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.rotina-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-rotina-run {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.btn-rotina-run:hover {
    background: #10b981;
    color: #000;
    transform: translateY(-1px);
}

.rotina-filter-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rotina-pill-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted, #94a3b8);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.80rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.rotina-pill-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
}

.rotina-pill-btn.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    font-weight: 600;
}

.view-mode-toggle {
    display: inline-flex;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.view-mode-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.view-mode-toggle-btn.active {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   KOGNVS SETTINGS: 2-COLUMN SIDEBAR LAYOUT (Linear / Stripe Pattern)
   ========================================================================== */

.settings-layout-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    align-items: start;
    margin-top: 1.25rem;
}

.settings-internal-sidebar {
    position: sticky;
    top: 20px;
    background: rgba(22, 23, 27, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-nav-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.settings-nav-group-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 4px 10px 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s ease;
}

.settings-nav-item:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
}

.settings-nav-item i {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.settings-nav-item:hover i {
    transform: scale(1.12);
}

.settings-nav-item.active {
    color: #f8fafc !important;
    background: color-mix(in srgb, var(--group-color, #38bdf8) 12%, rgba(255, 255, 255, 0.03)) !important;
    border-color: color-mix(in srgb, var(--group-color, #38bdf8) 30%, transparent) !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 14px color-mix(in srgb, var(--group-color, #38bdf8) 15%, transparent);
    position: relative;
}

.settings-nav-item.active::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--group-color, #38bdf8);
    border-radius: 4px;
    box-shadow: 0 0 8px var(--group-color, rgba(56, 189, 248, 0.8));
}

.settings-nav-item.active i {
    filter: drop-shadow(0 0 5px currentColor);
}

.settings-content-area {
    min-width: 0;
}

.subtab-panel {
    animation: subtabFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

@media (max-width: 980px) {
    .settings-layout-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .settings-internal-sidebar {
        position: static;
    }
}

/* ==========================================================================
   Kognvs Creative OS — Inline Media Players (Áudio & Vídeo no Chat)
   ========================================================================== */
.kognvs-inline-audio-player {
    margin: 0.85rem 0;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    max-width: 520px;
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
}

.kognvs-inline-audio-player:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.kognvs-inline-audio-player.is-playing {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.22);
}

.kognvs-audio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.kognvs-audio-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kognvs-audio-badge-tts {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(168, 85, 247, 0.18);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kognvs-audio-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.markdown-body a.kognvs-audio-btn-action,
.kognvs-audio-btn-action {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-muted, #94a3b8) !important;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.markdown-body a.kognvs-audio-btn-action:hover,
.kognvs-audio-btn-action:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
    border-bottom-style: solid !important;
}

.kognvs-audio-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kognvs-audio-play-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.kognvs-audio-play-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.6);
}

.kognvs-audio-play-btn:active {
    transform: scale(0.96);
}

.kognvs-audio-progress-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kognvs-audio-timeline {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: background 0.15s;
}

.kognvs-audio-timeline:hover {
    background: rgba(255, 255, 255, 0.2);
}

.kognvs-audio-timeline::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #a78bfa;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(167, 139, 250, 0.8);
    transition: transform 0.1s;
}

.kognvs-audio-timeline::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.kognvs-audio-timeline::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #a78bfa;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(167, 139, 250, 0.8);
}

.kognvs-audio-time-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted, #94a3b8);
}

/* SMART VIDEO PLAYER CARD */
.kognvs-inline-video-card {
    margin: 1rem 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
    max-width: 620px;
    transition: all 0.25s ease;
}

.kognvs-inline-video-card.is-vertical-9-16 {
    max-width: 350px;
    border-color: rgba(244, 114, 182, 0.35);
    box-shadow: 0 10px 32px rgba(244, 114, 182, 0.16), 0 8px 24px rgba(0, 0, 0, 0.55);
}

.kognvs-video-header {
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    box-sizing: border-box;
}

.kognvs-video-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.kognvs-video-title > i {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: #f472b6;
}

.kognvs-video-title > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    min-width: 0;
}

.kognvs-video-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Badge 9:16 Vertical */
.kognvs-video-badge-vertical {
    font-size: 0.70rem;
    font-weight: 600;
    height: 26px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(244, 114, 182, 0.14);
    color: #f472b6;
    border: 1px solid rgba(244, 114, 182, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap !important;
    flex-shrink: 0;
    user-select: none;
    line-height: 1;
    letter-spacing: 0.02em;
    box-sizing: border-box;
}

.kognvs-video-badge-vertical i {
    font-size: 0.72rem;
}

/* Video Header Action Buttons */
.markdown-body a.kognvs-video-btn-action,
.kognvs-video-btn-action {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
    border-radius: 6px;
    height: 26px;
    padding: 0 9px;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex-shrink: 0;
    box-sizing: border-box;
    line-height: 1;
}

.markdown-body a.kognvs-video-btn-action:hover,
.kognvs-video-btn-action:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    border-bottom-color: rgba(255, 255, 255, 0.28) !important;
    border-bottom-style: solid !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.markdown-body a.kognvs-video-btn-action:active,
.kognvs-video-btn-action:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.1);
}

.markdown-body a.kognvs-video-btn-action.is-icon-only,
.kognvs-video-btn-action.is-icon-only {
    width: 26px;
    min-width: 26px;
    padding: 0;
}

.kognvs-video-media-wrap {
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.kognvs-video-element {
    max-width: 100%;
    max-height: 520px;
    display: block;
    outline: none;
}

.kognvs-inline-video-card.is-vertical-9-16 .kognvs-video-element {
    max-height: 580px;
    aspect-ratio: 9 / 16;
    object-fit: cover;
}

/* ==========================================================================
   SISTEMA EXECUTIVO DE TAGS, BUSCA & SPOTLIGHT (KOGNVS CHAT RECOVERY)
   ========================================================================== */

/* 1. Barra de Busca na Sidebar */
.sidebar-chat-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin: 8px 10px 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    padding: 0 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-chat-search-wrap:focus-within {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}

.sidebar-chat-search-wrap .search-icon {
    font-size: 0.75rem;
    color: var(--text-dim, #94a3b8);
    margin-right: 7px;
    pointer-events: none;
}

.sidebar-chat-search-wrap input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main, #f8fafc);
    font-size: 0.8rem;
    font-family: inherit;
    padding: 7px 0;
}

.sidebar-chat-search-wrap input::placeholder {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.78rem;
}

.btn-clear-chat-search {
    background: transparent;
    border: none;
    color: var(--text-dim, #94a3b8);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.btn-clear-chat-search:hover {
    color: #f87171;
}

.search-shortcut-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-dim, #94a3b8);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 5px;
    margin-left: 4px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}

.search-shortcut-badge:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}

/* 2. Régua Horizontal de Chips de Tags na Sidebar */
.sidebar-chat-tags-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 10px 8px 10px;
    padding-bottom: 2px;
}

.sidebar-chat-tags-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
    width: 100%;
}

.sidebar-chat-tags-bar::-webkit-scrollbar {
    display: none;
}

.btn-scroll-chat-tags {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: #141720;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted, #cbd5e1);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.6rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: all 0.15s;
}

.btn-scroll-chat-tags:hover {
    background: #1e2433;
    color: #fff;
    border-color: rgba(56, 189, 248, 0.4);
}

#btn-scroll-chat-tags-left { left: -4px; }
#btn-scroll-chat-tags-right { right: -4px; }

.chat-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted, #cbd5e1);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.chat-tag-chip:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-main, #f8fafc);
    border-color: rgba(255, 255, 255, 0.16);
}

.chat-tag-chip.active {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
    font-weight: 600;
}

.chat-tag-chip-count {
    font-size: 0.65rem;
    opacity: 0.75;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 4px;
    border-radius: 8px;
}

.chat-tag-chip.active .chat-tag-chip-count {
    background: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    opacity: 1;
}

/* 3. Micro-Badges de Tags no Item de Chat da Sidebar */
.chat-item-tags-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin-top: 3px;
    overflow: hidden;
    padding-left: 20px;
}

.chat-card-tag-badge {
    display: inline-block;
    font-size: 0.64rem;
    font-weight: 500;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1px 6px;
    border-radius: 6px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 90px;
}

.nav-item.active .chat-card-tag-badge {
    color: rgba(56, 189, 248, 0.95);
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.2);
}

/* 4. Tags no Topbar do Chat Ativo */
.chat-topbar-tags-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 400px;
    scrollbar-width: none;
}

.chat-topbar-tags-bar::-webkit-scrollbar {
    display: none;
}

.topbar-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.22);
    color: #38bdf8;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s;
}

.topbar-tag-pill:hover {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.35);
}

.topbar-tag-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 0.65rem;
    padding: 0;
    margin-left: 2px;
    transition: opacity 0.15s;
}

.topbar-tag-remove-btn:hover {
    opacity: 1;
    color: #f87171;
}

.btn-add-topbar-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.16);
    color: var(--text-dim, #94a3b8);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.btn-add-topbar-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main, #f8fafc);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 5. Modal Spotlight Executivo (Ctrl + K) */
.spotlight-dialog {
    position: relative;
    width: 650px;
    max-width: 92vw;
    background: #11141c;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 30px rgba(56, 189, 248, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: spotlightPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes spotlightPopIn {
    from { opacity: 0; transform: scale(0.96) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.spotlight-header {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.spotlight-search-icon {
    font-size: 1.1rem;
    color: #38bdf8;
    margin-right: 12px;
}

.spotlight-header input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main, #f8fafc);
    font-size: 1.05rem;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 500;
}

.spotlight-header input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
}

.spotlight-kbd-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-dim, #94a3b8);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    padding: 2px 7px;
    user-select: none;
}

.spotlight-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 18px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.spotlight-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-dim, #94a3b8);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.spotlight-tab:hover {
    color: var(--text-main, #f8fafc);
    background: rgba(255, 255, 255, 0.05);
}

.spotlight-tab.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    font-weight: 600;
}

.spotlight-count {
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.spotlight-tab.active .spotlight-count {
    background: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
}

.spotlight-body {
    max-height: 420px;
    overflow-y: auto;
    padding: 8px;
}

.spotlight-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-dim, #94a3b8);
}

.spotlight-empty-icon {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.15);
    margin-bottom: 12px;
}

.spotlight-empty-state p {
    font-size: 0.88rem;
    max-width: 360px;
    margin: 0 auto;
    line-height: 1.4;
}

.spotlight-empty-state code {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
}

.spotlight-result-item {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    margin-bottom: 4px;
}

.spotlight-result-item:hover,
.spotlight-result-item.selected {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(56, 189, 248, 0.25);
}

.spotlight-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.spotlight-result-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main, #f8fafc);
    display: flex;
    align-items: center;
    gap: 8px;
}

.spotlight-result-title i {
    font-size: 0.8rem;
    color: #38bdf8;
}

.spotlight-result-meta {
    font-size: 0.72rem;
    color: var(--text-dim, #94a3b8);
    display: flex;
    align-items: center;
    gap: 6px;
}

.spotlight-result-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.spotlight-result-tag {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.08);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.18);
}

.spotlight-snippet {
    font-size: 0.8rem;
    color: var(--text-muted, #cbd5e1);
    line-height: 1.35;
    margin-top: 4px;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 10px;
    border-radius: 6px;
    border-left: 2px solid #38bdf8;
}

.spotlight-snippet mark {
    background: rgba(245, 158, 11, 0.28);
    color: #fcd34d;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

.spotlight-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.72rem;
    color: var(--text-dim, #94a3b8);
}

.spotlight-footer-shortcuts {
    display: flex;
    gap: 12px;
}

.spotlight-footer-shortcuts kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.68rem;
    color: var(--text-muted, #cbd5e1);
}

/* 6. Tags Modal Suggestions */
.tag-suggestion-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted, #cbd5e1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.15s;
}

.tag-suggestion-chip:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
}

.modal-selected-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 500;
}

.modal-selected-tag-pill button {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 0.7rem;
    opacity: 0.7;
    padding: 0;
}

.modal-selected-tag-pill button:hover {
    opacity: 1;
    color: #f87171;
}

/* =============================================================================
   COFRE DE VERSÕES & HISTÓRICO DE MODIFICAÇÕES (DIFF & TIMELINE)
   ============================================================================= */

.modal-box-versoes {
    animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-versoes-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
}

.modal-versoes-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateX(2px);
}

.modal-versoes-item.active {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.modal-versoes-item.item-atual {
    border-left: 3px solid #10b981;
}

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

.versao-badge-id {
    font-size: 0.76rem;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    padding: 1px 7px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.versao-badge-atual {
    font-size: 0.68rem;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1px 6px;
    border-radius: 6px;
    text-transform: uppercase;
}

.versao-item-time {
    font-size: 0.72rem;
    color: #94a3b8;
}

.versao-item-motivo {
    font-size: 0.78rem;
    font-weight: 500;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.versao-item-chat {
    font-size: 0.72rem;
    color: #a78bfa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.versao-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
}

.btn-diff-mode {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-diff-mode:hover {
    color: #f8fafc;
}

.btn-diff-mode.active {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Tabela e Linhas de Diff */
.diff-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.45;
}

.diff-row {
    display: flex;
    width: 100%;
}

.diff-row:hover {
    filter: brightness(1.1);
}

.diff-num {
    width: 44px;
    min-width: 44px;
    padding: 1px 8px;
    text-align: right;
    color: #475569;
    user-select: none;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.18);
    font-size: 0.72rem;
}

.diff-sign {
    width: 22px;
    min-width: 22px;
    text-align: center;
    font-weight: bold;
    user-select: none;
}

.diff-text {
    flex: 1;
    padding: 1px 10px;
    white-space: pre-wrap;
    word-break: break-all;
}

.diff-row-add {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.diff-row-add .diff-sign {
    color: #10b981;
}

.diff-row-del {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.diff-row-del .diff-sign {
    color: #ef4444;
}

.diff-row-same {
    color: #94a3b8;
}

.diff-row-header {
    background: rgba(56, 189, 248, 0.08);
    color: #38bdf8;
    padding: 4px 12px;
    font-weight: 600;
    font-size: 0.75rem;
    border-top: 1px solid rgba(56, 189, 248, 0.15);
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.diff-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #64748b;
    text-align: center;
    gap: 12px;
}

.diff-empty-icon {
    font-size: 2.2rem;
    color: #334155;
}

/* ========================================================
   VISUALIZADOR EXECUTIVO DE DOCUMENTOS WORD (.DOCX / .DOC)
   ======================================================== */
.docx-paper-container {
    display: flex;
    justify-content: center;
    padding: 24px 20px;
    background: #090d16;
    overflow-y: auto;
    flex: 1;
    min-height: 520px;
}

.docx-paper-sheet {
    max-width: 840px;
    width: 100%;
    background: #ffffff;
    color: #1e293b;
    padding: 50px 60px;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 1px rgba(0, 0, 0, 0.4);
    font-family: 'Calibri', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    font-size: 1.02rem;
    line-height: 1.65;
    min-height: 600px;
}

.docx-paper-sheet h1, .docx-paper-sheet h2, .docx-paper-sheet h3, .docx-paper-sheet h4 {
    color: #0f172a;
    font-weight: 700;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    line-height: 1.3;
}

.docx-paper-sheet h1 { font-size: 1.55rem; border-bottom: 2px solid #e2e8f0; padding-bottom: 8px; }
.docx-paper-sheet h2 { font-size: 1.35rem; }
.docx-paper-sheet h3 { font-size: 1.15rem; }

.docx-paper-sheet p {
    margin-bottom: 0.9em;
    text-align: justify;
}

.docx-paper-sheet table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
    font-size: 0.92rem;
}

.docx-paper-sheet table, .docx-paper-sheet th, .docx-paper-sheet td {
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
}

.docx-paper-sheet th {
    background: #f1f5f9;
    font-weight: 600;
    color: #334155;
}

.docx-paper-sheet ul, .docx-paper-sheet ol {
    margin: 0.8em 0;
    padding-left: 1.8em;
}

.docx-paper-sheet blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 14px;
    color: #475569;
    margin: 1em 0;
    font-style: italic;
}

/* ========================================================
   VISUALIZADOR EXECUTIVO DE PLANILHAS EXCEL (.XLSX / .CSV)
   ======================================================== */
.excel-viewer-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: #090d16;
    overflow: hidden;
}

.excel-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.excel-sheet-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    max-width: 60%;
}

.excel-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.76rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.excel-tab-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}

.excel-tab-btn.active {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.35);
    font-weight: 600;
}

.excel-search-input {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    font-size: 0.76rem;
    padding: 4px 10px;
    border-radius: 6px;
    outline: none;
    width: 190px;
    transition: all 0.15s ease;
}

.excel-search-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
    width: 230px;
}

.excel-table-wrapper {
    flex: 1;
    overflow: auto;
    position: relative;
    background: #0b0f19;
}

.excel-grid-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    font-family: 'JetBrains Mono', 'Segoe UI', monospace;
    font-size: 0.78rem;
}

.excel-grid-table th, .excel-grid-table td {
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 6px 12px;
    white-space: nowrap;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.excel-grid-table thead th {
    background: #111827;
    color: #94a3b8;
    font-weight: 600;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 2px solid rgba(56, 189, 248, 0.3);
}

.excel-row-num {
    width: 44px;
    min-width: 44px;
    text-align: center;
    background: #0f172a !important;
    color: #64748b !important;
    font-weight: 600;
    font-size: 0.7rem;
    user-select: none;
    position: sticky;
    left: 0;
    z-index: 1;
    border-right: 2px solid rgba(255, 255, 255, 0.1) !important;
}

.excel-grid-table thead th.excel-row-num {
    z-index: 3;
}

.excel-grid-table tbody tr:hover td {
    background: rgba(56, 189, 248, 0.06);
}

.excel-grid-table tbody td {
    color: #cbd5e1;
    background: #0b0f19;
}


