/* ========================================
   VARIAVEIS GLOBAIS (Paleta de Cores)
========================================
*/
:root {
    --bg-dark: #050510;         /* Fundo quase preto */
    --bg-card: rgba(15, 23, 42, 0.6); /* Vidro fosco */
    --neon-cyan: #00f3ff;       /* Ciano principal */
    --text-main: #ffffff;       /* Texto branco puro */
    --text-muted: #94a3b8;      /* Texto cinza claro */
    --danger: #ff4d4d;          /* Vermelho erro */
    
    --font-title: 'Orbitron', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

/* Reset Básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    font-family: var(--font-body);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Evita barras de rolagem no login */
    position: relative;
}

/* ========================================
   FUNDO DE ESTRELAS (Background)
========================================
*/
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle linear infinite;
}

@keyframes twinkle {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* ========================================
   CONTAINER DE LOGIN (Card)
========================================
*/
.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    z-index: 1;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px); /* Efeito vidro */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 243, 255, 0.3); /* Borda sutil */
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.1); /* Brilho externo leve */
    text-align: center;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Logo e Título */
.logo-img {
    height: 50px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 5px var(--neon-cyan));
}

.app-title {
    font-family: var(--font-title);
    font-size: 2rem;
    color: var(--neon-cyan);
    margin-bottom: 5px;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5); /* Brilho apenas no título */
    letter-spacing: 2px;
}

.app-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

/* ========================================
   FORMULÁRIO E INPUTS (Correção Neon)
========================================
*/
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 8px;
    color: var(--text-main); /* Texto limpo, sem neon */
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

/* Estado de Foco (Quando clica no input) */
.form-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2); /* Brilho APENAS na caixa */
    background: rgba(0, 0, 0, 0.6);
}

/* Placeholder limpo (Texto de exemplo) */
.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    text-shadow: none; /* Garante que não tem brilho */
}

/* ========================================
   BOTÃO
========================================
*/
.btn-login {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

.btn-login:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 20px var(--neon-cyan); /* Brilho forte no hover */
}

/* Mensagens de Erro */
.alert-box {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* ========================================
   LAYOUT DO DASHBOARD (Adicionar ao final do style.css)
========================================
*/

.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden; /* O conteúdo interno que rola, não a página */
}

/* --- SIDEBAR (Barra Lateral) --- */
.sidebar {
    width: 260px;
    background: rgba(10, 10, 20, 0.8); /* Mais escuro que o card */
    backdrop-filter: blur(15px);
    border-right: 1px solid rgba(0, 243, 255, 0.15);
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 10;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 40px;
}

.sidebar-logo {
    height: 40px;
    filter: drop-shadow(0 0 5px var(--neon-cyan));
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 10px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: var(--font-title);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.nav-link i {
    font-size: 1.2rem;
    margin-right: 12px;
}

/* Estado Hover e Ativo do Menu */
.nav-link:hover, .nav-link.active {
    background: rgba(0, 243, 255, 0.1);
    color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.05);
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.nav-link.active {
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.15);
}

/* Rodapé do Menu (Usuário e Sair) */
.sidebar-footer {
    margin-top: auto; /* Empurra para baixo */
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.user-role {
    font-size: 0.7rem;
    color: var(--neon-cyan);
    text-transform: uppercase;
}

.logout-btn {
    color: var(--danger);
    font-size: 1.2rem;
    padding: 5px;
    border-radius: 5px;
    transition: 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 77, 77, 0.1);
}

/* --- ÁREA PRINCIPAL (MAIN) --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Impede scroll na página inteira */
    position: relative;
}

.top-header {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(5, 5, 16, 0.5);
}

.page-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.content-wrapper {
    flex: 1;
    padding: 30px;
    overflow-y: auto; /* Scroll apenas aqui dentro */
}

/* Scrollbar Bonita para o Conteúdo */
.content-wrapper::-webkit-scrollbar {
    width: 8px;
}
.content-wrapper::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
.content-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.2);
    border-radius: 4px;
}
.content-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 243, 255, 0.4);
}

/* ========================================
   SIDEBAR MINIMIZADA (COLLAPSED)
========================================
*/

/* Transições suaves para a animação */
.sidebar, .sidebar-logo, .sidebar-icon-only, .user-info, .nav-link span {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Ajustes do Header da Sidebar */
.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-bottom: 30px;
}

#sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--neon-cyan);
    font-size: 1.5rem;
    cursor: pointer;
    align-self: flex-end; /* Botão fica na direita */
    margin-bottom: 10px;
}

.logo-wrapper {
    position: relative;
    height: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.sidebar-icon-only {
    position: absolute;
    height: 30px;
    opacity: 0; /* Escondido por padrão */
    transform: scale(0);
}

/* --- ESTADO FECHADO (.collapsed) --- */

.sidebar.collapsed {
    width: 80px; /* Largura reduzida */
    padding: 20px 10px;
}

/* Centraliza botão de toggle quando fechado */
.sidebar.collapsed #sidebar-toggle {
    align-self: center;
    margin-bottom: 20px;
}

/* Esconde o logo grande e mostra o pequeno */
.sidebar.collapsed .sidebar-logo {
    opacity: 0;
    transform: scale(0);
    width: 0;
}

.sidebar.collapsed .sidebar-icon-only {
    opacity: 1;
    transform: scale(1);
}

/* Esconde textos dos links */
.sidebar.collapsed .nav-link span {
    opacity: 0;
    width: 0;
    display: none;
}

/* Centraliza ícones dos links */
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 15px 0;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.5rem;
}

/* Esconde infos do usuário no rodapé */
.sidebar.collapsed .user-info {
    opacity: 0;
    width: 0;
    display: none;
}

.sidebar.collapsed .sidebar-footer {
    justify-content: center;
}

/* ========================================
   ESTILOS DOS SUBMENUS (Adicionar ao final do style.css)
========================================
*/

/* Remove estilos de lista padrão */
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* O Link que abre/fecha o submenu (Pai) */
.submenu-toggle {
    cursor: pointer;
    justify-content: space-between; /* Joga a setinha para o final */
    position: relative;
}

/* A setinha (ícone) */
.arrow-icon {
    font-size: 0.8rem !important; /* Menor que os outros ícones */
    transition: transform 0.3s ease;
    margin-right: 0 !important; /* Remove margem direita padrão dos ícones */
}

/* --- O SUBMENU (A lista de filhos) --- */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    
    /* Lógica de Animação (Acordeão) */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Visual */
    background: rgba(0, 0, 0, 0.2); /* Um pouco mais escuro que o menu */
    border-radius: 0 0 8px 8px; /* Arredonda só em baixo */
}

/* O Link Filho (Item do Submenu) */
.sub-link {
    display: flex;
    align-items: center;
    padding: 10px 15px 10px 45px; /* 45px de recuo à esquerda */
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border-left: 2px solid transparent; /* Linha lateral invisível */
}

.sub-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.sub-link.active {
    color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.05);
    border-left-color: var(--neon-cyan); /* Acende a linha lateral */
}

.sub-link i {
    font-size: 1rem;
    margin-right: 10px;
    opacity: 0.8;
}

/* --- ESTADOS ATIVOS (Quando aberto via JS) --- */

/* Quando a classe 'open' é adicionada ao LI pai (.nav-group) */
.nav-group.open .submenu {
    max-height: 300px; /* Altura suficiente para mostrar os itens */
    opacity: 1;
    padding-bottom: 10px; /* Um respiro no final */
}

/* Gira a setinha quando aberto */
.nav-group.open .arrow-icon {
    transform: rotate(180deg);
    color: var(--neon-cyan);
}

/* Muda a cor do Pai quando o submenu está aberto */
.nav-group.open .submenu-toggle {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* --- AJUSTE PARA MENU MINIMIZADO (.collapsed) --- */

/* Quando a sidebar está fechada, esconde a setinha e os submenus */
.sidebar.collapsed .arrow-icon {
    display: none;
}

.sidebar.collapsed .submenu {
    display: none !important; /* Força sumir, mesmo se tiver classe 'open' */
}

/* Ajuste visual do pai quando fechado */
.sidebar.collapsed .submenu-toggle {
    justify-content: center; /* Centraliza o ícone principal */
}

/* ========================================
   PÁGINA DE AUDITORIA (Adicionar ao final do style.css)
========================================
*/

/* --- 1. PAINEL DE FILTROS --- */
.filter-panel {
    position: relative; 
    z-index: 50; /* Força o painel ficar ACIMA da lista de agentes (que é 10) */
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 15px;
}

.filter-header h3 {
    font-size: 1.1rem;
    color: var(--neon-cyan);
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.filter-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

/* ==================================================================
   CORREÇÃO DEFINITIVA - BOTÕES E AGENTES (Z-Index + Visual)
================================================================== */

/* Container dos Botões (Força ficar por cima de tudo) */
.group-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    position: relative;
    z-index: 100; /* Z-INDEX ALTÍSSIMO: Garante que é o topo da pirâmide */
}

/* O BOTÃO BONITO DE VOLTA (Estilo + Correções de Lag) */
.btn-group-select {
    /* --- Estilo Visual (Restaurado) --- */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 8px 16px; /* Um pouco maior para facilitar o clique */
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;

    /* --- Correções Funcionais (Anti-Lag e Anti-Seleção) --- */
    user-select: none;           /* Impede selecionar o texto */
    -webkit-user-select: none;
    transition: none !important; /* Remove animação lenta */
    transform: none !important;  /* Remove movimento */
    
    /* --- Garantia de Clique --- */
    position: relative;
    z-index: 101; /* Mais alto que o container */
    pointer-events: auto !important; /* FORÇA o reconhecimento do clique */
}

/* Hover e Active (Instantâneo) */
.btn-group-select:hover, .btn-group-select.active {
    background: rgba(0, 243, 255, 0.15) !important;
    border-color: var(--neon-cyan) !important;
    color: var(--neon-cyan) !important;
}

/* CORREÇÃO DO BLOQUEIO INVISÍVEL (Botão Limpar) */
.btn-clear {
    margin-left: auto;       /* Mantém ele na direita */
    width: fit-content;      /* Ocupa SÓ o espaço do texto "Limpar" */
    position: relative;      
    z-index: 90 !important;  /* Força ficar ABAIXO dos outros botões (que são 101) */
    
    /* Mantém o visual vermelho */
    border-color: rgba(220, 53, 69, 0.5) !important;
    color: #ff6b6b !important;
}

.btn-clear:hover {
    background: rgba(220, 53, 69, 0.2) !important;
}

/* --- GRID E CHECKBOXES (Forçados para baixo) --- */

.filter-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
    position: relative;
    z-index: 5; /* Fica abaixo dos botões */
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
    margin-bottom: 20px;
    position: relative;
    z-index: 10; /* Fica abaixo dos botões, mas acima do fundo */
}

/* Custom Checkbox (Agente) - Blindado */
.agent-checkbox {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    
    /* Estabilidade */
    position: relative;
    z-index: 11; /* Ligeiramente acima do grid */
    transform: translateZ(0);
    transition: background 0.1s ease, border-color 0.1s ease;
}

.agent-checkbox:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Checkbox marcado */
.agent-checkbox:has(input:checked) {
    border-color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.08);
}

/* Esconde o input nativo, mas deixa clicável */
.agent-check {
    margin-right: 10px;
    accent-color: var(--neon-cyan);
    cursor: pointer;
}

/* Textos do Agente (Mantidos para não quebrar layout) */
.agent-name {
    font-size: 0.9rem;
    flex: 1;
}

.agent-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
}

/* --- 2. BARRA DE PROGRESSO --- */
.status-bar {
    background: var(--bg-card);
    border: 1px solid rgba(0, 243, 255, 0.2);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--neon-cyan);
}

.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    transition: width 0.3s ease;
}

/* --- 3. TABELA DE RESULTADOS --- */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.table-stats {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.text-cyan { color: var(--neon-cyan); }

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.9rem;
}

.results-table th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--neon-cyan);
    font-family: var(--font-title);
    padding: 12px 15px;
    text-align: left;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
}

.results-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    vertical-align: middle;
}

.results-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Inputs dentro da tabela */
.table-select, .table-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.table-select:focus, .table-input:focus {
    border-color: var(--neon-cyan);
    outline: none;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}
.status-ok { background: rgba(40, 167, 69, 0.2); color: #28a745; border: 1px solid #28a745; } /* Verde */
.status-pending { background: rgba(255, 193, 7, 0.2); color: #ffc107; border: 1px solid #ffc107; } /* Amarelo */
.status-error { background: rgba(220, 53, 69, 0.2); color: #dc3545; border: 1px solid #dc3545; } /* Vermelho */

/* Botões de Ação na Tabela */
.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.2s;
    margin-right: 5px;
}
.btn-icon:hover { color: var(--neon-cyan); transform: scale(1.1); }

/* --- 4. BARRA FLUTUANTE (Actions) --- */
.floating-action-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px); /* Começa escondida embaixo */
    background: rgba(10, 10, 30, 0.95);
    border: 1px solid var(--neon-cyan);
    padding: 15px 30px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.3);
    z-index: 100;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.floating-action-bar.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.action-info {
    font-size: 1rem;
    color: white;
}

.cost-estimate {
    margin-left: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 15px;
}

.btn-audit {
    padding: 8px 25px;
    border-radius: 25px;
    font-size: 0.9rem;
    box-shadow: 0 0 15px var(--neon-cyan);
}

/* --- 5. MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #0a0a1a;
    width: 80%;
    max-width: 900px;
    height: 80vh;
    border-radius: 15px;
    border: 1px solid var(--neon-cyan);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.2);
    transform: scale(0.9);
    transition: 0.3s;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { color: var(--neon-cyan); margin: 0; }

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.close-modal:hover { color: var(--danger); }

.modal-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
    font-family: var(--font-title);
}

.tab-btn.active {
    color: white;
    border-bottom-color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.05);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.transcript-area {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: #050510;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 15px;
    font-family: monospace;
    resize: none;
}

/* ========================================
   CORREÇÕES DE ESTILO - AUDITORIA
========================================
*/

/* --- INPUTS DE DATA (Estilo Dark/Neon) --- */
/* Força o navegador a renderizar o calendário em modo escuro */
input[type="date"] {
    color-scheme: dark; /* Funciona no Chrome/Edge para deixar o calendário escuro */
}

/* Estilização da caixa de data */
.filter-row .form-input[type="date"] {
    background-color: rgba(10, 10, 32, 0.7) !important;
    border: 1px solid rgba(0, 243, 255, 0.3) !important;
    color: var(--neon-cyan) !important;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    padding: 8px 12px; /* Reduzi o padding para diminuir a altura */
    height: 40px;      /* Altura fixa para alinhar com outros botões */
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;       /* Garante que ocupe o espaço do form-group */
}

/* Ícone do calendário (WebKit - Chrome/Edge) */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    filter: invert(1) drop-shadow(0 0 2px var(--neon-cyan)); /* Deixa o ícone branco/brilhante */
    transition: 0.3s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Foco na data */
.filter-row .form-input[type="date"]:focus {
    border-color: var(--neon-cyan) !important;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

/* --- BOTÃO DE BUSCAR (Estilo Neon Forte) --- */
#btn-buscar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Espaço entre ícone e texto */
    
    background: rgba(0, 243, 255, 0.05); /* Fundo sutil */
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    
    padding: 10px 25px;
    height: 40px; /* Mesma altura da data para alinhar */
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.1);
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.5);
    margin-top: 24px; /* Empurra para baixo para alinhar com os inputs */
}

/* Hover do Botão (O "Tchan") */
#btn-buscar:hover {
    background: var(--neon-cyan);
    color: #050510; /* Texto preto para contraste */
    box-shadow: 0 0 20px var(--neon-cyan), 0 0 40px rgba(0, 243, 255, 0.4);
    transform: translateY(-2px);
    text-shadow: none;
    border-color: var(--neon-cyan);
}

/* Clique do Botão */
#btn-buscar:active {
    transform: translateY(0);
    box-shadow: 0 0 10px var(--neon-cyan);
}

/* Ajuste no container dos filtros para alinhar verticalmente */
.filter-row {
    align-items: flex-end; /* Alinha o botão com a base dos inputs */
}

/* ========================================
   BOTÕES E ELEMENTOS GERAIS
========================================
*/

/* Classe Genérica para Botões Neon (Usada no Novo Usuário e na Busca) */
.btn-neon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    
    font-family: var(--font-title); /* Orbitron */
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.1);
}

.btn-neon:hover {
    background: var(--neon-cyan);
    color: #050510;
    box-shadow: 0 0 15px var(--neon-cyan), 0 0 30px rgba(0, 243, 255, 0.4);
    transform: translateY(-2px);
}

.btn-neon:active {
    transform: translateY(0);
}

/* Estilo para input desabilitado (no modo editar) */
.disabled-input {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: transparent !important;
}

/* ========================================
   NOTIFICAÇÕES TOAST (Alertas Bonitos)
========================================
*/

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999; /* Fica acima de tudo, inclusive modais */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    background: rgba(5, 5, 16, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    
    /* Animação de entrada */
    transform: translateX(120%);
    animation: slideInToast 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    border-left: 4px solid transparent; /* Linha colorida na esquerda */
}

/* Tipos de Mensagem */
.toast.success {
    border-left-color: #00ff88; /* Verde Neon */
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-left-width: 4px;
}
.toast.success i { color: #00ff88; font-size: 1.2rem; }

.toast.error {
    border-left-color: #ff4d4d; /* Vermelho Neon */
    border: 1px solid rgba(255, 77, 77, 0.3);
    border-left-width: 4px;
}
.toast.error i { color: #ff4d4d; font-size: 1.2rem; }

.toast.info {
    border-left-color: var(--neon-cyan); /* Azul Neon */
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-left-width: 4px;
}
.toast.info i { color: var(--neon-cyan); font-size: 1.2rem; }

/* Animação de Saída (será adicionada via JS) */
.toast.hiding {
    animation: slideOutToast 0.4s forwards;
}

@keyframes slideInToast {
    to { transform: translateX(0); }
}

@keyframes slideOutToast {
    to { transform: translateX(120%); opacity: 0; }
}

/* ========================================
   PÁGINA DE SCRIPTS (Editor)
========================================
*/

.scripts-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    height: calc(100vh - 140px); /* Ajuste para caber na tela sem scroll global */
    overflow: hidden;
}

/* --- SIDEBAR DE SCRIPTS --- */
.scripts-sidebar {
    display: flex;
    flex-direction: column;
    padding: 0; /* Remove padding padrão do card */
    overflow: hidden;
}

.sidebar-actions {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-full { width: 100%; }

.scripts-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Scrollbar fina para a lista */
.scripts-list-container::-webkit-scrollbar { width: 4px; }
.scripts-list-container::-webkit-scrollbar-thumb { background: rgba(0, 243, 255, 0.2); border-radius: 2px; }

.list-header {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    margin: 10px 10px;
    letter-spacing: 1px;
}

.scripts-list {
    list-style: none;
    padding: 0;
}

.script-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    border: 1px solid transparent;
}

.script-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.script-item.active {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.script-item.empty {
    justify-content: center;
    font-style: italic;
    opacity: 0.5;
    cursor: default;
}

.script-item i:first-child { margin-right: 10px; font-size: 1.1rem; }
.script-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9rem; }
.arrow { font-size: 0.8rem; opacity: 0; transition: 0.2s; }
.script-item.active .arrow { opacity: 1; }

/* --- EDITOR PRINCIPAL --- */
.scripts-editor {
    display: flex;
    flex-direction: column;
    padding: 25px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

.input-extension {
    position: absolute;
    right: 15px;
    color: var(--text-muted);
    font-family: monospace;
    pointer-events: none;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.btn-icon-danger {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    width: 42px;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}
.btn-icon-danger:hover { background: var(--danger); color: white; box-shadow: 0 0 15px rgba(255, 77, 77, 0.4); }

.editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.badge-ai {
    float: right;
    background: rgba(147, 112, 219, 0.2);
    color: #d8b4fe;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    border: 1px solid rgba(147, 112, 219, 0.4);
    text-transform: uppercase;
    font-weight: bold;
}

/* Area de Texto (Code Style) */
.code-editor {
    flex: 1;
    width: 100%;
    background: #050510;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #e0e0e0;
    padding: 20px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: 0.3s;
}

.code-editor:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

/* Efeito de Loading no Editor */
.loading .code-editor {
    opacity: 0.5;
    pointer-events: none;
}

.editor-footer {
    margin-top: 15px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   MODAL DE DETALHES (Melhorias Visuais)
========================================
*/

/* 1. Cabeçalho de Informações Técnicas (Metadados) */
.metadata-box {
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.meta-item:last-child {
    border-right: none;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.meta-value {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
    font-family: 'Fira Code', monospace; /* Fonte técnica para nomes de arquivos */
}

.meta-value.highlight {
    color: var(--neon-cyan);
}

/* 2. Formatação do Texto do Relatório (Markdown) */
.markdown-content {
    color: #e0e0e0;
    font-size: 1rem;
    line-height: 1.8; /* Espaçamento entre linhas maior para leitura confortável */
    padding-right: 10px;
}

/* Títulos dentro do relatório (## Título) */
.markdown-content h1, 
.markdown-content h2, 
.markdown-content h3 {
    color: var(--neon-cyan);
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
    padding-bottom: 5px;
    font-family: var(--font-title);
}

/* Listas e Parágrafos */
.markdown-content p {
    margin-bottom: 20px; /* Separação clara entre parágrafos */
    text-align: justify;
}

.markdown-content ul, 
.markdown-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
    background: rgba(255, 255, 255, 0.02); /* Fundo sutil nos blocos de lista */
    padding: 15px 15px 15px 40px;
    border-radius: 8px;
}

.markdown-content li {
    margin-bottom: 8px;
}

.markdown-content strong {
    color: white;
    font-weight: 700;
}

/* 3. Barra de Rolagem Azul (Neon) no Modal */
.modal-body::-webkit-scrollbar,
.transcript-area::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.modal-body::-webkit-scrollbar-track,
.transcript-area::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb,
.transcript-area::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.3); /* Azul Neon suave */
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.modal-body::-webkit-scrollbar-thumb:hover,
.transcript-area::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan); /* Acesa no hover */
}

/* ========================================
   ESTILIZAÇÃO DO RELATÓRIO (MARKDOWN)
========================================
*/

.markdown-content {
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 10px 5px;
    font-family: 'Roboto', sans-serif;
}

/* Títulos (### ou ##) - Cor Neon e Linha Embaixo */
.markdown-content h1, 
.markdown-content h2, 
.markdown-content h3,
.markdown-content h4 {
    color: var(--neon-cyan);
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    padding-bottom: 5px;
    font-family: var(--font-title);
    letter-spacing: 1px;
}

/* Negrito (**Texto**) - Branco Brilhante */
.markdown-content strong {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255,255,255,0.2);
}

/* Listas (1. Item ou * Item) */
.markdown-content ul, 
.markdown-content ol {
    margin-left: 20px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03); /* Fundo leve para destacar a lista */
    padding: 15px 15px 15px 35px;
    border-radius: 8px;
    border-left: 3px solid var(--neon-cyan);
}

.markdown-content li {
    margin-bottom: 8px;
}

/* Parágrafos */
.markdown-content p {
    margin-bottom: 15px;
    text-align: justify;
}

/* Citações / Itálico */
.markdown-content em {
    color: var(--text-muted);
    font-style: italic;
}

/* =========================================
   ANALYTICS DASHBOARD
   ========================================= */

/* --- KPIs (Cards do Topo) --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: rgba(10, 25, 47, 0.7);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.05);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.kpi-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: #fff;
    margin: 10px 0;
    text-shadow: 0 0 5px var(--neon-cyan);
}

.kpi-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- GRÁFICOS --- */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr; /* O primeiro gráfico ocupa o dobro do segundo */
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: rgba(10, 25, 47, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    position: relative;
    height: 350px;
}

/* Responsividade para telas menores */
@media (max-width: 900px) {
    .charts-row {
        grid-template-columns: 1fr; /* Empilha os gráficos */
    }
}

/* --- ABAS DE INTELIGÊNCIA (Nuvem/Mercado/Churn) --- */
.intel-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    
    /* --- NOVO: Remove a barra de rolagem visualmente --- */
    overflow-y: hidden;       /* Garante que não apareça barra vertical */
    scrollbar-width: none;    /* Para Firefox */
    -ms-overflow-style: none; /* Para IE e Edge antigo */
}

/* --- NOVO: Para Chrome, Safari e Edge novo --- */
.intel-tabs::-webkit-scrollbar {
    display: none;
}

.intel-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 10px 20px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif; /* Usando a fonte do título */
    font-size: 0.9rem;
    position: relative;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.intel-tab:hover {
    color: #fff;
}

.intel-tab.active {
    color: var(--neon-cyan);
}

.intel-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
}

.intel-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.intel-content.active {
    display: block;
}

/* Animação suave para troca de abas */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- TABELA DE CHURN --- */
.churn-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.churn-table th {
    text-align: left;
    color: var(--neon-cyan);
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.churn-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    vertical-align: middle;
}

.churn-row:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: white;
}

.risk-tag {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid #ff6b6b;
    text-transform: uppercase;
    font-weight: bold;
}

/* --- BARRA DE CONTROLE (Onde fica o botão Analisar) --- */
.control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- BARRA DE ROLAGEM PERSONALIZADA (Neon Scroll) --- */
.custom-scroll::-webkit-scrollbar {
    width: 8px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 4px;
    box-shadow: 0 0 5px var(--neon-cyan);
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #00d2dd; /* Um tom ligeiramente mais claro no hover */
}

/* --- CORES DOS ALERTAS (Adicionar ao final do style.css) --- */

/* Sucesso (Verde Neon) */
.alert-box.success {
    background: rgba(0, 255, 136, 0.1);
    border-color: #00ff88;
    color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.1);
}

/* Aviso / Atenção (Laranja Neon) */
.alert-box.warning {
    background: rgba(255, 159, 67, 0.1);
    border-color: #ff9f43;
    color: #ff9f43;
    box-shadow: 0 0 10px rgba(255, 159, 67, 0.1);
}

/* Informação (Azul Neon - Opcional) */
.alert-box.info {
    background: rgba(0, 243, 255, 0.1);
    border-color: #00f3ff;
    color: #00f3ff;
}

/* ============================================================
   CORREÇÃO FINAL: EDITOR DE SCRIPTS (Auto-Resize & Unlock)
   Adicione isso ao FINAL do seu arquivo style.css
============================================================ */

/* 1. Destrava o clique (Garante que o editor esteja na frente do fundo) */
.scripts-editor {
    position: relative;
    z-index: 10;
}

.editor-body {
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
}

/* 2. Ajuste Fino da Caixa de Texto (COM BARRA DE ROLAGEM) */
.code-editor {
    /* Garante interação do mouse */
    pointer-events: auto !important;
    position: relative;
    z-index: 30;
    cursor: text;

    /* Visual Técnico */
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace; 
    font-size: 0.95rem;
    line-height: 1.6;
    
    /* Lógica de Rolagem e Tamanho */
    resize: vertical;            /* Permite você puxar a borda se quiser */
    overflow-y: auto !important; /* Traz a barra de rolagem de volta */
    min-height: 400px;           /* Altura mínima garantida */
    max-height: 60vh;            /* TRAVA a altura em 60% da tela para não sumir */
    height: auto;
}

/* Efeito de Foco (Para saber que está digitando) */
.code-editor:focus {
    border-color: var(--neon-cyan);
    background: rgba(5, 5, 16, 0.9); /* Fundo um pouco mais sólido ao focar */
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.15);
}

/* 3. Personalização da Barra de Rolagem do Editor (Neon Style) */
.code-editor::-webkit-scrollbar {
    width: 10px;               /* Largura da barra */
}

.code-editor::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3); /* Fundo do trilho (escuro) */
    border-radius: 4px;
}

.code-editor::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);   /* A cor Ciano */
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.5); /* Borda interna para dar profundidade */
    box-shadow: 0 0 5px var(--neon-cyan); /* O brilho Neon */
}

.code-editor::-webkit-scrollbar-thumb:hover {
    background: #fff; /* Fica branco brilhante ao passar o mouse */
    box-shadow: 0 0 15px var(--neon-cyan);
}

/* Canto inferior onde as barras se encontram (se houver horizontal) */
.code-editor::-webkit-scrollbar-corner {
    background: transparent;
}

/* Correção de Lag nos Botões de Grupo */
.btn-group-select {
    user-select: none; /* Impede que o texto fique azul ao clicar rápido */
    -webkit-user-select: none; /* Para Chrome/Safari */
}

/* Garante feedback visual instantâneo */
.btn-group-select:active {
    background-color: var(--neon-cyan) !important;
    color: #000 !important;
}

/* ==========================================================================
   CORREÇÃO DEFINITIVA V4 - ISOLAMENTO DE FILTROS
   Substitua o último bloco do style.css por este
========================================================================== */

/* 1. Painel (Fundo) */
.holographic-panel {
    position: relative;
    z-index: 50; 
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

/* 2. O GRANDE SEGREDO: Isolar cada container de filtro */
/* Isso impede que o 'Data Início' invada o espaço do 'Data Fim' */
.holographic-panel .form-group {
    position: relative; 
    z-index: auto; /* Garante ordem natural */
    isolation: isolate; /* Cria um novo contexto de empilhamento para cada filtro */
}

/* 3. Inputs e Selects (Camada Alta) */
.holographic-panel .form-input {
    display: block !important;
    height: 45px !important;
    width: 100%;
    padding: 10px 15px !important; 
    line-height: 1.5 !important;
    
    background: rgba(0, 0, 0, 0.5) !important;
    color: #fff !important;
    border: 1px solid rgba(0, 243, 255, 0.3) !important;
    border-radius: 8px;
    
    position: relative;
    z-index: 100; /* Fica acima do label */
    cursor: pointer;
}

/* 4. Rótulos (Camada Baixa) */
.holographic-panel label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    
    position: relative;
    z-index: 50; /* Abaixo do input */
    pointer-events: none; /* Garante que clique atravesse o texto */
}

/* Ajuste específico para datas (Conserta o ícone deslocado) */
.holographic-panel input[type="date"].form-input {
    display: block !important;
    padding-top: 10px !important;
}

/* Hover */
.holographic-panel .form-input:hover,
.holographic-panel .form-input:focus {
    border-color: var(--neon-cyan) !important;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.15);
    outline: none;
}

/* ==========================================================================
   CORREÇÃO FINAL - REMOVER MODAL FANTASMA
   Adicionar ao final do style.css
========================================================================== */

/* Força o desaparecimento total da caixa do modal quando ele está fechado.
   Isso impede que o cabeçalho invisível bloqueie os cliques nos filtros.
*/
.modal-overlay:not(.active) .modal-content {
    display: none !important;
}

/* --- ESTILOS DO MODAL DE CONTESTAÇÃO --- */

/* Caixa de Aviso (Amarela) */
.warning-box {
    background: rgba(255, 153, 0, 0.05); /* Fundo bem sutil */
    border-left: 4px solid #ffcc00; /* Borda lateral grossa estilo "Tech" */
    padding: 15px;
    margin-bottom: 20px;
    font-family: 'Consolas', monospace;
}

/* Inputs Escuros (Textarea e Select) */
.input-dark {
    background-color: #111; /* Fundo quase preto */
    border: 1px solid #444; /* Borda discreta */
    color: #e0e0e0; /* Texto claro */
    padding: 12px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace; /* Fonte tech */
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box; /* Garante que padding não estoure a largura */
    transition: all 0.3s ease;
    resize: vertical; /* Permite redimensionar verticalmente */
}

/* Efeito de Foco (Ao clicar) */
.input-dark:focus {
    outline: none;
    border-color: var(--neon-cyan); /* Brilho Ciano */
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.2); /* Glow suave */
    background-color: #1a1a1a;
}

/* Ajuste específico para o Select (Dropdown) */
select.input-dark {
    cursor: pointer;
    appearance: none; /* Remove a seta padrão feia do navegador */
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300f3ff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 12px auto;
    padding-right: 30px;
}

/* Labels */
.form-group label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

/* Rodapé do Modal */
.modal-footer {
    display: flex;
    justify-content: flex-end; /* Botões à direita */
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #333;
}