        :root {
            --primary: #4f46e5; --secondary: #818cf8; --success: #10b981;
            --bg: #f9fafb; --card-bg: #ffffff; --text-main: #111827; --text-sub: #6b7280;
            --radius: 20px; --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
        }

     

        body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--text-main); margin: 0; transition: 0.3s; }
        body.dark-mode { --bg: #0f172a; --card-bg: #1e293b; --text-main: #f1f5f9; --text-sub: #94a3b8; }

        #auth-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(circle at top right, #e0e7ff, #f9fafb); }
        .auth-card { background: var(--card-bg); padding: 50px; border-radius: 32px; box-shadow: var(--shadow); width: 100%; max-width: 420px; text-align: center; border: 1px solid rgba(255,255,255,0.8); }

        #main-app { display: none; }
        .navbar { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); padding: 0 60px; height: 85px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; border-bottom: 1px solid #f3f4f6; }
        body.dark-mode .navbar { background: rgba(30, 41, 59, 0.8); border-bottom: 1px solid #334155; }
        .nav-logo {
            font-family: 'Outfit', sans-serif;
            font-weight: 800; /* Extra negrito */
            font-size: 26px;  /* Levemente maior */
            color: #1e1b4b;   /* Azul marinho quase preto (sólido) */
            text-decoration: none;
            letter-spacing: -0.5px; /* Letras mais juntinhas (visual moderno) */
            display: flex;
            align-items: center;
            gap: 0px;
        }

        /* Classe auxiliar para destacar o P */
        .logo-highlight {
            color: var(--primary); /* Usa a cor principal (Azul ou Pastel) */
        }
        /* Variáveis de cores para o modo escuro */
        body.dark-mode { 
            --bg: #0f172a; 
            --card-bg: #1e293b; 
            --text-main: #f1f5f9; 
            --text-sub: #94a3b8; 
            --border: #334155;
            --nav-bg: rgba(30, 41, 59, 0.8);
        }

        /* --- TEMA PASTEL (LAVANDA & MENTA) --- */
        body.pastel-theme {
            /* Substitui o azul forte pelo lavanda suave */
            --primary: #818cf8; 
            /* Substitui o roxo do gradiente por um lilás bem clarinho */
            --secondary: #c7d2fe; 
            /* Substitui o verde forte por um verde menta */
            --success: #34d399; 
        }

        /* Ajuste para botões ficarem legíveis no tema pastel */
        body.pastel-theme .btn-primary {
            color: #fff;
            font-weight: 800;
            text-shadow: 0 1px 2px rgba(0,0,0,0.1);
        }

/* Garante altura uniforme nos inputs do grid */
#selConvEmpresa, #refMMYY {
    box-sizing: border-box; /* Garante que o padding não aumente o tamanho total */
    height: 52px !important; /* Força a altura igual */
}

/* Remove a borda azul padrão ao clicar para ficar mais clean */
input:focus, select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}


/* --- ESTILO DO NOVO MODAL DE CADASTRO (WIZARD) --- */
.wizard-step { display: none; animation: fadeIn 0.4s ease; }
.wizard-step.active { display: block; }

.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

/* Linha de fundo cinza */
.wizard-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
    transform: translateY(-50%);
}

/* Barra colorida que enche */
.progress-bar-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 2px;
    background: var(--primary);
    z-index: 0;
    transform: translateY(-50%);
    width: 0%; /* Será controlado via JS */
    transition: width 0.3s ease;
}

.step-indicator {
    width: 30px;
    height: 30px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-sub);
    position: relative;
    z-index: 1; /* Fica acima da linha */
    transition: 0.3s;
}

.step-indicator.active {
    border-color: var(--primary);
    color: var(--primary);
    background: #eef2ff;
    transform: scale(1.1);
}

.step-indicator.completed {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.input-group { text-align: left; margin-bottom: 15px; }
.input-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-sub); margin-bottom: 5px; margin-left: 4px; }
.input-error { color: #ef4444; font-size: 11px; margin-top: 4px; display: none; }
.input-error.visible { display: block; }

/* Animação suave */
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }



        /* Estilo para a área de upload customizada */
.upload-area {
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    background: #f8fafc;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: var(--primary);
    background: #eef2ff;
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--primary);
}

.upload-text {
    font-size: 14px;
    color: var(--text-sub);
    font-weight: 600;
}

/* Melhoria no título */
.page-title {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 40px; /* Mais espaço abaixo do título */
    letter-spacing: -0.5px;
}

        /* Estilo do Toggle Switch */
        .switch { position: relative; display: inline-block; width: 50px; height: 26px; }
        .switch input { opacity: 0; width: 0; height: 0; }
        .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
        .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
        input:checked + .slider { background-color: var(--primary); }
        input:checked + .slider:before { transform: translateX(24px); }

        .nav-links { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; background: #f1f5f9; padding: 6px; border-radius: 18px; }
        body.dark-mode .nav-links { background: #334155; }
        .nav-links button { background: none; border: none; font-weight: 600; cursor: pointer; color: var(--text-sub); padding: 10px 15px; transition: 0.3s; border-radius: 12px; font-size: 14px; }
        .nav-links button.active { color: var(--primary); background: #fff; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
        body.dark-mode .nav-links button.active { background: #1e293b; color: #fff; }



        .container { max-width: 1100px; margin: 50px auto; padding: 0 30px; }
        .card { background: var(--card-bg); padding: 40px; border-radius: 28px; box-shadow: var(--shadow); border: 1px solid #f1f5f9; margin-bottom: 30px; }
        body.dark-mode .card { border: 1px solid #334155; }
        
        h2 { font-weight: 800; font-size: 28px; letter-spacing: -1px; margin-bottom: 30px; color: var(--text-main); text-align: center; }

        .stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
        .stat-card { background: #fff; padding: 25px; border-radius: 24px; border: 1px solid #f1f5f9; box-shadow: var(--shadow); text-align: center; }
        body.dark-mode .stat-card { background: var(--card-bg); border: 1px solid #334155; }
        .stat-val { display: block; font-size: 32px; font-weight: 800; color: var(--primary); font-family: 'Outfit'; }
        .stat-lab { font-size: 12px; color: var(--text-sub); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

        input, select { width: 100%; padding: 16px; border: 1.5px solid #f1f5f9; border-radius: 14px; font-size: 15px; outline: none; transition: 0.2s; background: #f9fafb; font-family: inherit; color: inherit; }
        body.dark-mode input, body.dark-mode select { background: #334155; border-color: #475569; }

        .btn { border: none; padding: 18px; border-radius: 16px; font-weight: 700; cursor: pointer; transition: 0.3s; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 10px; }
        .btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.4); }
        .btn-outline { background: transparent; border: 1.5px solid #e2e8f0; color: var(--text-sub); }
        .btn-small { padding: 8px 12px; font-size: 12px; border-radius: 10px; }

        .dual-list { display: grid; grid-template-columns: 1fr 60px 1fr; gap: 25px; margin-top: 20px; }
        .list-box { border: 1.5px solid #f1f5f9; border-radius: 20px; height: 420px; overflow-y: auto; background: var(--card-bg); padding: 10px; }
        .list-box-header { padding: 15px; color: var(--text-sub); font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; text-align: center; }
        .list-item { padding: 14px 18px; font-size: 14px; cursor: pointer; border-radius: 12px; margin-bottom: 5px; transition: 0.2s; position: relative; }
        .list-item:hover { background: #f8fafc; }
        .list-item.selected { background: #eef2ff; color: var(--primary); font-weight: 700; }
        .edit-hint { font-size: 10px; color: #94a3b8; display: block; margin-top: 2px; font-weight: 400; }

        .step-box { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 25px; padding: 20px; background: var(--card-bg); border-radius: 20px; border: 1px solid #f1f5f9; box-shadow: var(--shadow); }
        body.dark-mode .step-box { border-color: #334155; }
        .step-circle { min-width: 40px; height: 40px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
        
        .accordion-item { border: 1px solid #f1f5f9; border-radius: 16px; margin-bottom: 12px; overflow: hidden; background: var(--card-bg); transition: 0.3s; }
        body.dark-mode .accordion-item { border-color: #334155; }
        .accordion-header { width: 100%; padding: 20px; text-align: left; background: none; border: none; font-weight: 800; color: var(--text-main); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
        .accordion-content {
            /* Lógica de animação */
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-out;
            padding: 0 25px; /* Espaçamento nas laterais */

            /* --- MELHORIA DA FONTE (O QUE FICA BONITO) --- */
            font-family: 'Plus Jakarta Sans', sans-serif; /* Força a fonte do site */
            font-size: 15px;       /* Aumentei um pouco para leitura fácil */
            line-height: 1.7;      /* Mais "ar" entre as linhas de texto */
            color: #475569;        /* Um cinza azulado profissional (Slate-600) */
            font-weight: 500;      /* Peso médio, não fica nem muito fino nem negrito */
            letter-spacing: 0.2px; /* Leve respiro entre as letras */
        }

        .accordion-item.active .accordion-content {
            /* Removemos o max-height: 1000px daqui */
            /* O JS vai calcular a altura exata */
            padding-bottom: 20px; /* Mantemos o padding final */
        }

        .config-layout { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: start; }
        .config-nav { display: flex; flex-direction: column; gap: 6px; }
        .config-nav-btn { text-align: left; padding: 14px 20px; border-radius: 14px; font-weight: 600; color: var(--text-sub); cursor: pointer; border: none; background: none; font-size: 14px; transition: 0.2s; }
        .config-nav-btn:hover { background: #f1f5f9; color: var(--primary); }
        .config-nav-btn.active { background: #eef2ff; color: var(--primary); }
        body.dark-mode .config-nav-btn.active { background: #334155; color: #fff; }
        

        .plan-header {
            /* NOVO GRADIENTE PASTEL (Azul Suave para Lavanda) */
            background: linear-gradient(135deg, #818cf8 0%, #c7d2fe 100%);
            
            color: white;
            padding: 30px;
            border-radius: 24px;
            position: relative;
            overflow: hidden;
            margin-bottom: 30px;
            /* Sombra mais suave para combinar com o pastel */
            box-shadow: 0 10px 25px -5px rgba(129, 140, 248, 0.4);
        }
        
        /* Ajuste leve na "bolha" decorativa para ficar mais sutil no fundo claro */
        .plan-header::after {
            content: "";
            position: absolute;
            top: -50%;
            right: -10%;
            width: 300px;
            height: 300px;
            background: rgba(255, 255, 255, 0.15); /* Um pouco mais transparente */
            border-radius: 50%;
        }

        .usage-container {
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 20px;
            padding: 25px;
        }

        .progress-track {
            width: 100%;
            height: 12px;
            background: #f1f5f9;
            border-radius: 10px;
            margin: 15px 0;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: var(--success);
            border-radius: 10px;
            width: 0%;
            transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .progress-fill.warning { background: #f59e0b; } /* Amarelo se estiver enchendo */
        .progress-fill.danger { background: #ef4444; }   /* Vermelho se lotou */

        .plan-details-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-top: 20px;
        }

        .detail-box {
            background: #f8fafc;
            padding: 15px;
            border-radius: 12px;
            border: 1px solid #f1f5f9;
        }

        .plan-card { border: 2px solid #f1f5f9; border-radius: 20px; padding: 25px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
        .plan-card.active { border-color: var(--primary); background: #fcfdff; }
        body.dark-mode .plan-card.active { background: #1e293b; border-color: var(--primary); }

        #modal-empresa, #modal-edit-empresa, #modal-edit-evento { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(17, 24, 39, 0.6); backdrop-filter: blur(4px); z-index: 1000; align-items: center; justify-content: center; }
        .modal-content { background: var(--card-bg); width: 90%; max-width: 500px; padding: 40px; border-radius: 32px; box-shadow: var(--shadow); position: relative; }

        /* Correção para telas pequenas */
#modal-planos-pro {
    display: none;
    align-items: flex-start !important; /* Permite rolar desde o topo */
    padding-top: 50px;
    padding-bottom: 50px;
}

#modal-planos-pro .modal-content {
    margin: auto; /* Centraliza horizontalmente */
    max-height: none; /* Deixa crescer conforme o conteúdo */
    overflow: visible; /* Remove barra de rolagem interna do card se a tela for grande */
}

/* Em telas muito baixas, ajusta o grid */
@media (max-height: 800px) {
    #modal-planos-pro {
        padding-top: 20px;
    }
}

        .danger-link { color: #94a3b8; font-size: 12px; cursor: pointer; text-decoration: underline; margin-top: 20px; display: inline-block; }
        .hidden { display: none; }

        .empresa-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 20px;
        }

        .empresa-card {
            background: #fff;
            border: 1.5px solid #f1f5f9;
            border-radius: 20px;
            padding: 25px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            transition: 0.2s;
            position: relative;
            min-height: 180px;
        }

        .modal {
        display: none; 
        position: fixed; 
        top: 0; 
        left: 0; 
        width: 100%; 
        height: 100%; 
        background: rgba(17, 24, 39, 0.6); 
        backdrop-filter: blur(4px); 
        z-index: 9999; /* Garante que fique acima de tudo */
        align-items: center; 
        justify-content: center;
        }

        .empresa-card:hover {
            transform: translateY(-5px);
            border-color: var(--primary);
            box-shadow: var(--shadow);
        }

        body.dark-mode .empresa-card {
            background: var(--card-bg);
            border-color: #334155;
        }

        .empresa-code {
            background: #eef2ff;
            color: var(--primary);
            font-weight: 800;
            padding: 5px 10px;
            border-radius: 8px;
            font-size: 25px;
            display: inline-block;
            margin-bottom: 10px;
            font-family: 'Outfit';
        }

        .empresa-name {
            font-weight: 700;
            font-size: 40px;
            line-height: 1.4;
            margin-bottom: 30px;
            letter-spacing: 0.4px;
            color: var(--text-main);
        }

        .empresa-cnpj {
            font-size: 11px;
            color: var(--text-sub);
            margin-bottom: 20px;
        }

        .empresa-cnpj-label {
            display: block;
            font-size: 8px;
            font-weight: 700;
            color: #94a3b8;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .empresa-actions {
            display: flex;
            gap: 8px;
            margin-top: auto;
        }

        .action-btn {
            flex: 1;
            padding: 10px;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            background: white;
            cursor: pointer;
            transition: 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-sub);
        }

        .action-btn:hover {
            background: #f8fafc;
            color: var(--primary);
            border-color: var(--primary);
        }

        .action-btn.del:hover {
            background: #fef2f2;
            color: #ef4444;
            border-color: #ef4444;
        }

        /* --- CORREÇÃO DA LOGO NO MODO ESCURO --- */
        /* Quando o corpo tiver a classe 'dark-mode', a logo fica branca */
        body.dark-mode .nav-logo {
            color: #ffffff; 
        }

/* Ajuste da Aba de Chat para não quebrar o layout */
#tab-chat .card {
    max-width: 800px;
    margin: 0 auto;
    height: 700px; /* Altura fixa para controlar o scroll */
    display: flex;
    flex-direction: column;
    padding: 30px !important;
}

/* Centraliza o nome Zuli e a descrição */
#tab-chat h3 {
    text-align: center;
    font-size: 38px; /* Maior como você pediu */
    color: var(--primary);
    margin: 0 0 5px 0;
    font-family: 'Outfit', sans-serif;
}

#tab-chat p {
    text-align: center;
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 25px;
}

/* Janela de Chat - Estilo Gemini */
#chat-window {
    flex: 1;
    overflow-y: auto;
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border: 1px solid #e2e8f0;
}

/* Ajuste das Bolhas */
.msg-bubble {
    max-width: 85%;
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    border-radius: 18px;
}

.ia-msg {
    align-self: flex-start;
    background: white;
    color: var(--text-main);
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.user-msg {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* BOTÃO DE ENVIAR - RECUPERADO E BONITO */
.btn-enviar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 25px;
    height: 52px; /* Mesma altura do input */
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.btn-enviar:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Alinhamento do Input com o Botão */
.chat-input-container {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

/* Estilo para o botão de IA quando bloqueado */
.nav-links button:contains('🔒') {
    opacity: 0.7;
    cursor: help;
}

body.dark-mode .nav-links button:contains('🔒') {
    color: #94a3b8;
}

/* Card de Sucesso Moderno */
#audit-card {
    border: 1px solid #d1fae5 !important; 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
    border-radius: 24px !important;
}

/* Contraste do cabeçalho da tabela de auditoria */
#audit-table-container th {
    color: #475569 !important; 
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 12px 10px;
    border-bottom: 2px solid #f1f5f9;
}

/* Estilo para as linhas da tabela */
#audit-table-container td {
    padding: 12px 10px;
    font-size: 14px;
    color: var(--text-main);
    border-bottom: 1px solid #f8fafc;
}

/* Botão Secundário (Nova Conversão) */
.btn-secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: 0.3s !important;
}

.btn-secondary:hover {
    background: #e2e8f0 !important;
    transform: translateY(-1px);
}