/* =========================================================================
   VARIÁVEIS GLOBAIS E RESET
   ========================================================================= */
:root {
    --bg-sidebar: #05080a;
    --bg-main: #0a0e14;
    --card-bg: rgba(17, 24, 33, 0.7);
    --accent: #00d4ff;
    --text-main: #ffffff;
    --text-muted: #6a7c8e;
    --glass-border: rgba(255, 255, 255, 0.05);
}

/* Tema Claro */
[data-tema="claro"] {
    --bg-sidebar: #ffffff;
    --bg-main: #f0f4f8;
    --card-bg: #ffffff;
    --accent: #0077b6;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --glass-border: rgba(0, 0, 0, 0.08);
}

[data-tema="claro"] body {
    background: #f0f4f8;
    color: #0f172a;
}

[data-tema="claro"] .glow-orb,
[data-tema="claro"] .glow-orb-2 {
    display: none;
}

[data-tema="claro"] .sidebar {
    background: #ffffff;
    border-right: 1px solid rgba(0,0,0,0.08);
    box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}

[data-tema="claro"] .content-area {
    background: rgba(240,244,248,0.8);
}

[data-tema="claro"] .card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

[data-tema="claro"] .reminder-item {
    background: rgba(0,119,182,0.05);
    border-left: 3px solid #0077b6;
    color: #0f172a;
}

[data-tema="claro"] .input-wrapper {
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

[data-tema="claro"] #user-input {
    color: #0f172a;
}

[data-tema="claro"] #user-input::placeholder {
    color: #94a3b8;
}

[data-tema="claro"] .mic-trigger {
    background: #0077b6;
}

[data-tema="claro"] .visao-header {
    border-bottom-color: rgba(0,0,0,0.08);
}

[data-tema="claro"] .task-list-header {
    border-bottom-color: rgba(0,0,0,0.08);
}

[data-tema="claro"] ::-webkit-scrollbar-thumb {
    background: rgba(0,119,182,0.3);
}
[data-tema="claro"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0,119,182,0.7);
    box-shadow: none;
}

/* Sidebar mobile no tema claro */
@media (max-width: 768px) {
    [data-tema="claro"] .sidebar {
        background: rgba(255,255,255,0.97) !important;
        border-top: 1px solid rgba(0,0,0,0.08) !important;
    }
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Plus Jakarta Sans', sans-serif; 
}

body { 
    background: var(--bg-main); 
    color: var(--text-main); 
    height: 100vh; 
    height: 100dvh; 
    width: 100vw;
    overflow: hidden; 
}

/* =========================================================================
   FUNDO FUTURISTA ANIMADO
   ========================================================================= */
.futuristic-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.04) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
    animation: orbMovement 20s infinite alternate;
}

@keyframes orbMovement {
    from { transform: translate(0, 0); }
    to { transform: translate(-200px, 300px); }
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
}

/* =========================================================================
   LAYOUT PRINCIPAL (DESKTOP)
   ========================================================================= */
.app-wrapper { 
    position: relative; 
    display: flex; 
    width: 100vw; 
    height: 100vh;
    height: 100dvh;
    z-index: 1; 
}

/* Sidebar Lateral */
.sidebar {
    width: 70px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--glass-border);
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
    padding: 25px 0; 
    align-items: center;
    flex-shrink: 0; 
}

.nav-icons { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.nav-item {
    background: transparent; border: none; color: var(--text-muted);
    font-size: 1.2rem; cursor: pointer; transition: 0.3s;
    width: 100%; display: flex; justify-content: center; position: relative;
    padding: 10px 0;
}
.nav-item:hover, .nav-item.active { color: var(--accent); }

.nav-item.active::after {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; background: var(--accent); box-shadow: 0 0 10px var(--accent);
}

/* Área de Conteúdo Central */
.content-area { 
    flex: 1; 
    padding: 40px; 
    padding-bottom: 140px !important;
    overflow-y: auto; 
    overflow-x: hidden; 
    background: rgba(10, 14, 20, 0.4); 

    /* CORREÇÃO: backdrop-filter removido daqui — ele quebrava o position:fixed
       da .command-bar por criar um novo "stacking context". O efeito de blur
       do fundo vem do .futuristic-bg que já está em position:fixed separado. */

    position: relative;
    height: 100vh; 
}

.tab-content { display: none; width: 100%; animation: fadeIn 0.4s ease-out; }
.tab-content.active { display: block; }

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

/* =========================================================================
   COMPONENTES E CARDS
   ========================================================================= */
.visao-header { display: flex; justify-content: space-between; margin-bottom: 40px; border-bottom: 1px solid var(--glass-border); padding-bottom: 20px; }
.header-left h2 { font-weight: 300; font-size: 1.8rem; }
.header-left p { color: var(--text-muted); font-size: 0.85rem; margin-top: 5px; }
.clock { font-size: 1.5rem; font-weight: 200; color: var(--accent); }

.dashboard-grid { display: grid; grid-template-columns: 1fr 350px; gap: 25px; }
.card { background: var(--card-bg); border: 1px solid var(--glass-border); border-radius: 16px; padding: 25px; backdrop-filter: blur(10px); }
.card h3 { font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 10px; }

/* Gráfico Financeiro */
.chart-card {
    background: rgba(17, 24, 33, 0.7); backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border); border-radius: 14px;
    padding: 15px;
    min-height: 300px;
}

/* Listas */
.reminder-item { background: rgba(0, 212, 255, 0.05); border-left: 3px solid var(--accent); padding: 12px; margin-top: 15px; border-radius: 6px; font-size: 0.95rem; animation: fadeIn 0.3s ease; }
.task-list-header { display: flex; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--glass-border); margin-bottom: 15px; font-size: 0.85rem; color: var(--text-muted); }
.task-list { list-style: none; }

/* =========================================================================
   BOTÕES ESPECIAIS
   ========================================================================= */
.btn-ouvir {
    background: rgba(0, 212, 255, 0.1); border: 1px solid var(--accent);
    color: var(--accent); padding: 10px 20px; border-radius: 8px;
    font-size: 0.9rem; font-weight: 600; cursor: pointer; display: flex;
    align-items: center; gap: 10px; transition: all 0.3s ease;
    text-transform: uppercase; letter-spacing: 1px;
}
.btn-ouvir:hover {
    background: var(--accent); color: #000; box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.btn-briefing-mini {
    display: inline-flex; align-items: center; gap: 14px;
    background: linear-gradient(135deg, rgba(0,212,255,0.08) 0%, rgba(139,92,246,0.06) 100%);
    border: 1px solid rgba(0,212,255,0.25);
    padding: 12px 18px; border-radius: 14px;
    cursor: pointer; color: var(--text-main);
    transition: all 0.25s ease; margin-top: 20px;
    text-align: left; min-width: 240px;
}
.btn-briefing-mini:hover {
    background: linear-gradient(135deg, rgba(0,212,255,0.14) 0%, rgba(139,92,246,0.1) 100%);
    border-color: rgba(0,212,255,0.45);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,212,255,0.12);
}
.btn-briefing-mini .brf-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(0,212,255,0.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: var(--accent); flex-shrink: 0;
}
.btn-briefing-mini .brf-text { flex: 1; }
.btn-briefing-mini .brf-text strong {
    display: block; font-size: 0.85rem; color: var(--text-main);
    font-weight: 600; margin-bottom: 2px;
}
.btn-briefing-mini .brf-text small {
    display: block; font-size: 0.72rem; color: var(--text-muted);
}
.btn-briefing-mini .brf-arrow {
    color: var(--accent); font-size: 1rem; opacity: 0.6; flex-shrink: 0;
    transition: transform 0.2s;
}
.btn-briefing-mini:hover .brf-arrow { transform: translateX(3px); opacity: 1; }

/* =========================================================================
   CHAT E INTERFACE DE VOZ
   ========================================================================= */
.hero-section { text-align: center; margin-top: 10vh; }
.pre-title { font-size: 0.7rem; letter-spacing: 5px; color: var(--accent); font-weight: 600; margin-bottom: 15px; }
.main-title { font-size: 2rem; font-weight: 200; letter-spacing: -2px; }

.chat-container { margin-top: 30px; display: flex; flex-direction: column; gap: 25px; padding-bottom: 120px; }
.msg { max-width: 80%; margin: 0 auto; text-align: center; font-size: 1.2rem; line-height: 1.6; }
.user { color: var(--accent); font-weight: 300; }
.bot { color: #fff; font-weight: 400; text-shadow: 0 0 10px rgba(255,255,255,0.1); }

/* Barra de Comando Flutuante (Desktop) */
.command-bar {
    position: fixed;
    bottom: 30px; 
    left: 70px; /* alinha com a largura da sidebar */
    right: 0;
    background: transparent; 
    border: none; 
    padding: 0; 
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none; 
    padding-bottom: calc(env(safe-area-inset-bottom) + 15px);
}

.input-wrapper {
    pointer-events: auto; 
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); border-radius: 100px;
    padding: 8px 10px 8px 25px; width: 100%; max-width: 700px; display: flex; align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#user-input { background: transparent; border: none; flex: 1; color: #fff; font-size: 1rem; outline: none; }
.mic-trigger { 
    width: 45px; height: 45px; background: var(--accent); border: none; 
    border-radius: 50%; cursor: pointer; transition: 0.3s; color: #fff; flex-shrink: 0;
}
.mic-trigger.pulse-mic { background: #ff4757; transform: scale(1.1); box-shadow: 0 0 20px rgba(255, 71, 87, 0.4); }

/* =========================================================================
   CUSTOMIZAÇÃO DA BARRA DE ROLAGEM (SCROLLBAR FUTURISTA)
   ========================================================================= */

/* Para Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 212, 255, 0.5) transparent;
}

/* Para Chrome, Edge e Safari */
::-webkit-scrollbar {
    width: 6px;  /* Barra bem fina e elegante */
    height: 6px; /* Para rolagens horizontais, se houver */
}

/* O "trilho" da barra (fundo) */
::-webkit-scrollbar-track {
    background: transparent; /* Totalmente invisível para não poluir o fundo */
}

/* A "alavanca" da barra (o que você clica e arrasta) */
::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3); /* Ciano suave e semi-transparente */
    border-radius: 10px; /* Bordas arredondadas */
    transition: background 0.3s ease;
}

/* Efeito Hover: A barra "acende" quando você passa o mouse por cima */
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.8); /* Ciano brilhante */
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5); /* Pequeno brilho (glow) */
}

/* =========================================================================
   RESPONSIVIDADE MOBILE (STICKY + COMPACTAÇÃO NATIVA)
   ========================================================================= */
@media (max-width: 768px) {
    /* 1. Congela o tamanho da tela */
    .app-wrapper { flex-direction: column; display: flex; height: 100dvh; overflow: hidden; }
    
    /* 2. Menu na base */
    .sidebar { 
        order: 2; width: 100%; height: 60px !important; 
        flex-direction: row; justify-content: space-around; padding: 0 5px; 
        border-right: none; border-top: 1px solid var(--glass-border);
        background: rgba(5, 8, 10, 0.98); backdrop-filter: blur(15px);
        z-index: 1000; position: relative !important; flex-shrink: 0; 
    }
    .sidebar::-webkit-scrollbar { display: none; }
    
    /* 3. Área de conteúdo se adapta */
    .content-area { 
        order: 1; flex: 1; padding: 15px 0 0 0 !important; 
        overflow-y: auto; display: flex; flex-direction: column; 
    }
    .tab-content { padding: 0 12px 15px 12px; flex: 1; overflow-y: auto; }
    #tab-chat { display: flex; flex-direction: column; overflow-y: auto; }

    /* 4. Barra de comando grudada no fundo do conteúdo */
    .command-bar { 
        position: sticky !important; bottom: 0 !important; left: 0; right: 0; width: 100%;
        padding: 8px 12px; 
        z-index: 999; margin-top: auto; 
        padding-bottom: calc(env(safe-area-inset-bottom) + 15px);
    }

    /* 5. COMPACTAÇÃO GERAL */
    .nav-icons { flex-direction: row; gap: 0; width: 100%; justify-content: space-around; align-items: center; height: 100%; flex-shrink: 0; }
    .nav-item { padding: 0; height: 100%; width: auto; flex: 1; align-items: center; justify-content: center; font-size: 1.1rem; }
    .nav-item.active::after { left: 50%; top: 0; transform: translateX(-50%); width: 20px; height: 3px; }
    .settings { margin-left: 0; flex-shrink: 0; }
    
    .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
    .card { padding: 12px !important; border-radius: 14px; min-height: auto !important; }
    .main-title { font-size: 1.6rem; letter-spacing: -1px; }
    .hero-section { margin-top: 3vh; }
    
    .visao-header { flex-direction: column; align-items: flex-start; gap: 5px; margin-bottom: 15px; padding-bottom: 10px; }
    .header-left h2 { font-size: 1.25rem; }
    .header-left p { font-size: 0.8rem; }
    .clock { font-size: 1.1rem; align-self: flex-start; }
    .msg { max-width: 95%; font-size: 1rem; padding: 10px 15px; }
    
    .input-wrapper { padding: 4px 6px 4px 15px; width: 100%; max-width: 100%; }
    #user-input { font-size: 0.9rem; }
    .mic-trigger { width: 38px; height: 38px; font-size: 0.9rem; }
    .btn-briefing-mini { padding: 5px 12px; font-size: 0.65rem; }

    /* 6. COMPACTAÇÃO TAREFAS E HÁBITOS */
    .task-list-header { font-size: 0.75rem; padding-bottom: 8px; margin-bottom: 10px; }
    .reminder-item { padding: 10px 12px !important; margin-top: 8px !important; border-radius: 10px; }
    
    .stats-habito { margin-bottom: 15px; }
    .stat-card { padding: 10px 5px; border-radius: 10px; }
    .stat-card h4 { font-size: 0.6rem; }
    .stat-card p { font-size: 1.2rem; }
    .habitos-grid { gap: 6px; margin-top: 15px; }
    .habito-dia { border-radius: 8px; }
    .habito-dia strong { font-size: 0.85rem; }
    .habito-dia span.progresso { font-size: 0.6rem; }
}
/* =========================================================================
   PROTEÇÃO DE ÁREA SEGURA E LAYOUT MOBILE (PWA) - CORRIGIDO
   ========================================================================= */
@media (max-width: 768px) {
    /* 1. O Menu Principal (Sidebar vira Rodapé) */
    .sidebar {
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        
        /* Ajuste preciso para a área segura */
        padding-top: 10px !important;
        padding-bottom: calc(env(safe-area-inset-bottom) + 10px) !important;
        
        background: rgba(10, 14, 20, 0.95) !important; 
        backdrop-filter: blur(15px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
        z-index: 9999 !important;
    }
    
    
    .nav-icons {
        display: flex !important;
        justify-content: space-around !important;
        align-items: center !important;
        width: 100% !important;
    }

    /* 2. Correção do Ícone Ativo (Adeus linha cortada!) */
    .nav-item {
        height: 45px !important;
        width: 45px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important; /* Remove qualquer linha antiga */
    }

    .nav-item.active {
        border: none !important;
        /*background: rgba(0, 212, 255, 0.15) !important;  Fundo ciano suave */
        /*border-radius: 12px !important;  Quadrado arredondado premium */
        color: var(--accent) !important;
    }

    /* 3. Barra de Comandos (Colada em cima do menu) */
    .command-bar {
        position: fixed !important;
        /* Sobe exatamente a altura do menu para ficar colada a ele */
        bottom: calc(65px + env(safe-area-inset-bottom)) !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 9998 !important;
        
        /* Fundo escuro para a lista passar por trás sem misturar as letras 
        background: rgba(5, 8, 12, 0.95) !important; 
        padding: 10px 15px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05) !important;*/
    }
    
    /* 4. Espaço no fim da lista de tarefas para poder rolar até a última */
    .content-area {
        /* Aumenta o espaço final para compensar o menu + a barra de comandos */
        padding-bottom: calc(140px + env(safe-area-inset-bottom)) !important;
    }
}
/* =========================================================================
   TEMA CLARO — Overrides para financeiro.php e configuracoes.php
   ========================================================================= */

[data-tema="claro"] .fin-card,
[data-tema="claro"] .chart-card,
[data-tema="claro"] .calendario-card,
[data-tema="claro"] .patrimonio-card,
[data-tema="claro"] .analise-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    backdrop-filter: none;
}

[data-tema="claro"] .fin-card.saldo p   { color: #0f172a; }
[data-tema="claro"] .patrimonio-card .pat-valor { color: #0f172a; }

[data-tema="claro"] .cal-dia.hoje {
    background: rgba(0,119,182,0.12);
    color: #0077b6;
}

[data-tema="claro"] .mov-item {
    background: rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.06);
}

[data-tema="claro"] .pat-conta-btn {
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.08);
}
[data-tema="claro"] .pat-conta-btn:hover {
    background: rgba(0,0,0,0.08);
}

[data-tema="claro"] .saude-bar-wrap {
    background: rgba(0,0,0,0.07);
}

[data-tema="claro"] .analise-row {
    border-bottom-color: rgba(0,0,0,0.05);
}

/* Configuracoes.php */
[data-tema="claro"] .acao-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

[data-tema="claro"] .form-input {
    background: #f8fafc;
    border: 1px solid rgba(0,0,0,0.1);
    color: #0f172a;
}
[data-tema="claro"] .form-input:focus {
    border-color: #0077b6;
    box-shadow: 0 0 0 3px rgba(0,119,182,0.1);
}

[data-tema="claro"] .config-secao-titulo {
    border-bottom-color: rgba(0,0,0,0.08);
}

/* =========================================================================
   TEMA CLARO — Overrides para briefing.php
   ========================================================================= */

[data-tema="claro"] .card-tarefas {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    backdrop-filter: none;
}

[data-tema="claro"] .card-tarefas h3 {
    border-bottom-color: rgba(0,0,0,0.08);
}

[data-tema="claro"] .item-tarefa {
    background: rgba(0,119,182,0.04);
    border-left: 3px solid #0077b6;
    color: #0f172a;
}

[data-tema="claro"] .resumo-box {
    background: #ffffff;
    border: 1px solid rgba(0,119,182,0.2);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    color: #0f172a;
}

/* =========================================================================
   TEMA CLARO — Overrides para tarefas.php (modal + cards)
   ========================================================================= */

[data-tema="claro"] .modal-overlay {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
}

[data-tema="claro"] .modal-analise {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

[data-tema="claro"] .modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

[data-tema="claro"] .modal-header h2 {
    color: #0f172a;
}

[data-tema="claro"] .btn-fechar-modal {
    border-color: rgba(0,0,0,0.15);
    color: #64748b;
}

[data-tema="claro"] .progresso-bg {
    background: rgba(0,0,0,0.07);
}

[data-tema="claro"] .tarefas-wrapper,
[data-tema="claro"] .tarefas-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    backdrop-filter: none;
}

[data-tema="claro"] .filtro-btn {
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.08);
    color: #64748b;
}

[data-tema="claro"] .filtro-btn.active,
[data-tema="claro"] .filtro-btn:hover {
    background: rgba(0,119,182,0.1);
    border-color: rgba(0,119,182,0.3);
    color: #0077b6;
}

[data-tema="claro"] .btn-analise {
    background: rgba(0,119,182,0.08);
    border: 1px solid rgba(0,119,182,0.2);
    color: #0077b6;
}

[data-tema="claro"] .btn-analise:hover {
    background: #0077b6;
    color: #fff;
    box-shadow: 0 0 15px rgba(0,119,182,0.3);
}

/* =========================================================================
   TEMA CLARO — Overrides adicionais para modal de tarefas (textos brancos)
   ========================================================================= */

[data-tema="claro"] .resumo-item span:last-child {
    color: #0f172a;
}

[data-tema="claro"] .resumo-grid {
    background: rgba(0,0,0,0.03);
}

[data-tema="claro"] .prod-card {
    background: rgba(0,0,0,0.03);
}

[data-tema="claro"] .prod-card strong {
    color: #0f172a;
}

[data-tema="claro"] .stat-card {
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.07);
}

[data-tema="claro"] .stat-card h4 {
    color: #64748b;
}

[data-tema="claro"] .modal-header h2,
[data-tema="claro"] .modal-body,
[data-tema="claro"] .progresso-header {
    color: #0f172a;
}

[data-tema="claro"] .section-label {
    color: #64748b;
}

[data-tema="claro"] .progresso-desc {
    color: #64748b;
}

/* Briefing — cards de resumo rápido */
[data-tema="claro"] .resumo-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    backdrop-filter: none;
}

/* =========================================================================
   TEMA CLARO — Configurações: Google card + botões de tema
   ========================================================================= */

/* Ícone Google */
[data-tema="claro"] .icone-google {
    background: rgba(66,133,244,0.1);
    color: #4285f4;
}

/* Botão Conectar Google */
[data-tema="claro"] a[href="google_auth.php"].acao-card-btn {
    background: rgba(66,133,244,0.08);
    border: 1px solid rgba(66,133,244,0.25);
    color: #4285f4;
}

/* Botão tema Escuro — no tema claro fica legível */
[data-tema="claro"] #btn-tema-escuro {
    background: rgba(15,23,42,0.08) !important;
    border-color: rgba(15,23,42,0.2) !important;
    color: #0f172a !important;
}

/* Botões de tema no mobile — empilha verticalmente */
@media (max-width: 480px) {
    [data-tema="claro"] .acao-card div[style*="display:flex"][style*="gap:8px"],
    div[style*="display:flex"][style*="gap:8px"] {
        flex-direction: column;
        width: 100%;
    }
    #btn-tema-escuro, #btn-tema-claro {
        width: 100%;
        justify-content: center;
    }
}

/* Botões de tema — mobile (empilha verticalmente) */
@media (max-width: 600px) {
    #btn-tema-escuro, #btn-tema-claro {
        width: 100% !important;
        justify-content: center;
    }
}

/* =========================================================================
   CHAT NEURAL — layout bilateral com rede animada
   ========================================================================= */

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 0 140px;
    position: relative;
}

.chat-container::before {
    content: '';
    position: fixed;
    left: calc(70px + (100vw - 70px) / 2);
    top: 0; bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom,
        transparent 100%,
        rgba(0,212,255,0.06) 30%,
        rgba(0,212,255,0.06) 70%,
        transparent 100%);
    pointer-events: none;
    z-index: 0;
}

[data-tema="claro"] .chat-container::before {
    background: linear-gradient(to bottom,
        transparent 100%,
        rgba(0,119,182,0.05) 30%,
        rgba(0,119,182,0.05) 70%,
        transparent 100%);
}

.msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 100%;
    animation: msgSlideIn 0.35s ease forwards;
    opacity: 0;
}
.msg-row.user { flex-direction: row-reverse; }
.msg-row.bot  { flex-direction: row; }

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

.msg-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 600; flex-shrink: 0;
    letter-spacing: 0.5px;
}
.msg-avatar.user {
    background: rgba(0,212,255,0.12);
    color: #00d4ff;
    border: 1px solid rgba(0,212,255,0.25);
}
.msg-avatar.bot {
    background: rgba(124,58,237,0.15);
    color: #a78bfa;
    border: 1px solid rgba(124,58,237,0.25);
}
[data-tema="claro"] .msg-avatar.user {
    background: rgba(0,119,182,0.1);
    color: #0077b6;
    border: 1px solid rgba(0,119,182,0.2);
}
[data-tema="claro"] .msg-avatar.bot {
    background: rgba(124,58,237,0.08);
    color: #7c3aed;
    border: 1px solid rgba(124,58,237,0.2);
}

.msg-wrap { display: flex; flex-direction: column; max-width: 58%; }
.msg-row.user .msg-wrap { align-items: flex-end; }
.msg-row.bot  .msg-wrap { align-items: flex-start; }

.msg-sender {
    font-size: 0.6rem; letter-spacing: 1.5px; text-transform: uppercase;
    margin-bottom: 3px; padding: 0 4px;
}
.msg-row.user .msg-sender { color: rgba(0,212,255,0.45); }
.msg-row.bot  .msg-sender { color: rgba(167,139,250,0.45); }
[data-tema="claro"] .msg-row.user .msg-sender { color: rgba(0,119,182,0.5); }
[data-tema="claro"] .msg-row.bot  .msg-sender { color: rgba(124,58,237,0.5); }

.msg-bubble {
    padding: 10px 14px;
    font-size: 0.9rem;
    line-height: 1.55;
    word-break: break-word;
}
.msg-bubble.user {
    background: rgba(0,212,255,0.07);
    border: 1px solid rgba(0,212,255,0.18);
    color: var(--text-main);
    border-radius: 14px 14px 4px 14px;
}
.msg-bubble.bot {
    background: rgba(124,58,237,0.07);
    border: 1px solid rgba(124,58,237,0.18);
    color: var(--text-main);
    border-radius: 14px 14px 14px 4px;
}
[data-tema="claro"] .msg-bubble.user {
    background: rgba(0,119,182,0.06);
    border-color: rgba(0,119,182,0.15);
}
[data-tema="claro"] .msg-bubble.bot {
    background: rgba(124,58,237,0.05);
    border-color: rgba(124,58,237,0.15);
}

/* ── Denúncia de conteúdo gerado por IA (política do Google Play) ──────────
   Bandeira discreta dentro da bolha da Lia (abre modal de motivo) + "⋯" fora
   da bolha (abre painel com Copiar/Denunciar). Só aparece em mensagens bot. */
.msg-bubble-row { display: flex; align-items: flex-end; gap: 6px; }
.msg-bubble.bot { position: relative; padding-right: 30px; }

.msg-flag-denuncia {
    position: absolute; bottom: 7px; right: 10px;
    font-size: 0.7rem; color: rgba(255,255,255,0.22);
    cursor: pointer; transition: color 0.2s ease;
}
.msg-flag-denuncia:hover { color: #ef4444; }
[data-tema="claro"] .msg-flag-denuncia { color: rgba(15,23,42,0.2); }
[data-tema="claro"] .msg-flag-denuncia:hover { color: #ef4444; }

.msg-mais-opcoes {
    font-size: 0.85rem; color: var(--text-muted); opacity: 0.5;
    cursor: pointer; flex-shrink: 0; padding-bottom: 8px; transition: opacity 0.2s ease;
}
.msg-mais-opcoes:hover { opacity: 1; }

.msg-opcoes-painel {
    position: absolute; background: var(--surface, #1a1f2b);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
    padding: 4px; min-width: 160px; z-index: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.msg-opcoes-painel .opcao {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; border-radius: 6px; font-size: 0.8rem;
    color: var(--text-main); cursor: pointer; white-space: nowrap;
}
.msg-opcoes-painel .opcao:hover { background: rgba(255,255,255,0.06); }
.msg-opcoes-painel .opcao.denunciar { color: #ef4444; }
.msg-opcoes-painel .opcao.denunciar:hover { background: rgba(239,68,68,0.1); }

/* Modal: Denunciar resposta */
.modal-overlay-denuncia {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(5,8,12,0.75); backdrop-filter: blur(6px);
    align-items: center; justify-content: center; opacity: 0;
    transition: opacity 0.2s ease;
}
.modal-overlay-denuncia.ativo { display: flex; opacity: 1; }
.modal-box-denuncia {
    background: var(--surface, #0f1520);
    border: 1px solid rgba(239,68,68,0.3); border-radius: 16px;
    padding: 24px; width: 90%; max-width: 400px;
    transform: scale(0.95); transition: transform 0.2s ease;
}
.modal-overlay-denuncia.ativo .modal-box-denuncia { transform: scale(1); }
.denuncia-textarea {
    width: 100%; background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1); color: #fff;
    padding: 10px 14px; border-radius: 8px; font-size: 0.85rem;
    font-family: 'Plus Jakarta Sans', sans-serif; outline: none; resize: vertical;
}
.denuncia-textarea:focus { border-color: rgba(239,68,68,0.4); }
[data-tema="claro"] .denuncia-textarea { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); color: #1e293b; }
.denuncia-feedback-msg {
    font-size: 0.8rem; padding: 10px; border-radius: 8px; margin-top: 10px;
}
.denuncia-feedback-msg.ok { background: rgba(16,185,129,0.1); color: #10b981; }
.denuncia-feedback-msg.erro { background: rgba(239,68,68,0.1); color: #ef4444; }

.typing-indicator {
    display: flex; gap: 5px; align-items: center;
    padding: 12px 16px;
    background: rgba(124,58,237,0.07);
    border: 1px solid rgba(124,58,237,0.18);
    border-radius: 14px 14px 14px 4px;
}
.typing-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: #7c3aed; opacity: 0.4;
    animation: typingBounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%,60%,100% { transform: translateY(0); opacity: 0.4; }
    30%          { transform: translateY(-5px); opacity: 1; }
}

.neural-confirm-ring {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9990;
    transform: translate(-50%,-50%) scale(0);
    border: 1.5px solid rgba(0,212,255,0.7);
}
[data-tema="claro"] .neural-confirm-ring {
    border-color: rgba(0,119,182,0.6);
}

.msg { display: none !important; }

@media (max-width: 768px) {
    .msg-wrap { max-width: 78%; }
    .chat-container::before { left: 00%; }
    .msg-bubble { font-size: 0.85rem; }
}