/* ==========================================
   FLUXO DE CAIXA GERENCIAL - ESTILOS
   ========================================== */

/* Tabela principal */
.fluxo-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-size: 14px;
}

/* Cabeçalho */
.fluxo-table thead {
    background: linear-gradient(135deg, #10a37f 0%, #0d8a6a 100%);
    color: white;
}

.fluxo-table thead th {
    padding: 16px 20px;
    font-weight: 600;
    text-align: left;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Corpo da tabela */
.fluxo-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

.fluxo-table tbody tr:hover {
    background-color: #fafafa;
}

.fluxo-table tbody td {
    padding: 10px 20px;
    color: #333;
    vertical-align: middle;
}

/* ==========================================
   TIPOS DE LINHA
   ========================================== */

/* LINHAS ANALÍTICAS (Contas operacionais) */
.fluxo-table .analitica td {
    font-weight: 400;
    color: #555;
    font-size: 13px;
}

/* LINHAS SINTÉTICAS (Subtotais) */
.fluxo-table .sintetica td {
    font-weight: 600;
    background-color: #f5f5f5;
    color: #0d0d0d;
    font-size: 14px;
    padding: 12px 20px;
}

/* LINHAS CALCULADAS (Resultados importantes) */
.fluxo-table .calculada td {
    font-weight: 700;
    background: linear-gradient(135deg, #e8f5f1 0%, #d4ede5 100%);
    color: #10a37f;
    font-size: 15px;
    padding: 14px 20px;
    border-top: 2px solid #10a37f;
    border-bottom: 2px solid #10a37f;
}

/* ==========================================
   BORDAS COLORIDAS POR SEÇÃO
   ========================================== */

/* Seção 1 - Receitas (Verde) */
.fluxo-table .secao-1 td:first-child {
    border-left: 4px solid #10a37f;
}

/* Seção 2 - Custos Variáveis (Vermelho) */
.fluxo-table .secao-2 td:first-child {
    border-left: 4px solid #dc3545;
}

/* Seção Resultado (Amarelo/Laranja) */
.fluxo-table .secao-resultado td:first-child {
    border-left: 4px solid #ff9800;
}

/* ==========================================
   CORES DE VALORES
   ========================================== */

/* Valores positivos (Receitas) */
.valor-positivo {
    color: #10a37f !important;
    font-weight: 600;
}

/* Valores negativos (Despesas) */
.valor-negativo {
    color: #dc3545 !important;
    font-weight: 600;
}

/* ==========================================
   TOGGLE ICONS (ÁRVORE EXPANSÍVEL)
   ========================================== */

.toggle-icon {
    display: inline-block;
    width: 12px;
    font-size: 10px;
    color: #666;
    margin-right: 4px;
    transition: transform 0.2s ease;
}

/* Cursor pointer para linhas clicáveis */
.fluxo-table tbody tr[onclick] {
    cursor: pointer;
}

.fluxo-table tbody tr[onclick]:hover .toggle-icon {
    color: #10a37f;
    transform: scale(1.2);
}

/* ==========================================
   INDENTAÇÃO HIERÁRQUICA
   ========================================== */

/* Nível 1 - Principais */
.fluxo-table tbody tr.calculada td:first-child,
.fluxo-table tbody tr.sintetica[data-nivel="1"] td:first-child {
    padding-left: 20px;
}

/* Nível 2 - Secundários */
.fluxo-table tbody tr.sintetica[data-nivel="2"] td:first-child {
    padding-left: 36px;
}

/* Nível 3 - Analíticas */
.fluxo-table tbody tr.analitica td:first-child {
    padding-left: 52px;
}

/* ==========================================
   RESPONSIVIDADE
   ========================================== */

@media (max-width: 768px) {
    .fluxo-table {
        font-size: 12px;
    }
    
    .fluxo-table thead th,
    .fluxo-table tbody td {
        padding: 8px 12px;
    }
    
    .fluxo-table .analitica td:first-child {
        padding-left: 32px;
    }
    
    .fluxo-table .sintetica[data-nivel="2"] td:first-child {
        padding-left: 24px;
    }
}

/* ==========================================
   ANIMAÇÕES E TRANSIÇÕES
   ========================================== */

.fluxo-table tbody tr {
    animation: fadeIn 0.3s ease-in;
}

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

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    .fluxo-table {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .fluxo-table thead {
        background: #10a37f !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .fluxo-table tbody tr:hover {
        background-color: transparent;
    }
    
    .fluxo-table .calculada td {
        background: #e8f5f1 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
