/* RESET E BASE */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Impede scroll na janela inteira */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
}

/* LAYOUT FLEXBOX PRINCIPAL */
.layout-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    transition: all 0.3s ease;
}

/* --- SIDEBAR MENU --- */
.sidebar-panel {
    width: 260px;
    background-color: #212529; /* Dark Mode */
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: margin-left 0.3s ease;
    border-right: 1px solid #333;
    z-index: 10;
}

.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #333;
    background-color: #1a1d20;
}

/* Estilo dos Links do Menu */
.nav-link {
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #198754; /* Verde Bootstrap */
}

/* --- ÁREA CENTRAL --- */
.content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.main-content-scroll {
    flex-grow: 1;
    overflow-y: auto; /* Scroll apenas aqui */
    padding: 25px;
}

/* --- CHAT SIDEBAR --- */
.chat-panel {
    width: 340px;
    background-color: #fff;
    border-left: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: margin-right 0.3s ease;
    z-index: 10;
}

.chat-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg-bot {
    background-color: #e9ecef;
    padding: 10px;
    border-radius: 10px 10px 10px 0;
    align-self: flex-start;
    max-width: 90%;
    font-size: 0.9rem;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid #dee2e6;
    background-color: white;
}

/* --- CLASSES DE TOGGLE (OCULTAR) --- */
.layout-wrapper.menu-hidden .sidebar-panel { margin-left: -260px; }
.layout-wrapper.chat-hidden .chat-panel { margin-right: -340px; }

/* --- ESTILOS DA TABELA DE FLUXO --- */
.table-fluxo { font-size: 0.9em; }
.table-fluxo th { background-color: #f8f9fa; text-align: center; vertical-align: middle; }
.table-fluxo td { text-align: right; vertical-align: middle; }

/* Coluna fixa para a categoria */
.table-fluxo td:first-child, .table-fluxo th:first-child {
    position: sticky;
    left: 0;
    background-color: #fff;
    z-index: 2;
    text-align: left;
    border-right: 2px solid #dee2e6;
}

/* Cores de valores */
.val-positivo { color: #198754; font-weight: 500; }
.val-negativo { color: #dc3545; font-weight: 500; }
.val-neutro { color: #ccc; }

/* ... MANTENHA O CSS ANTERIOR DO ARQUIVO style.css ... */

/* ADICIONE NO FINAL DO ARQUIVO: */

/* --- FILTROS (Página Registros) --- */
.filter-bar {
    background-color: #fff;
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0; /* Cola na tabela */
}

/* --- TABELA FLUXO AVANÇADA --- */

/* Linhas de Resumo (Topo) */
.row-summary {
    background-color: #eef2f7; /* Azul bem claro */
    font-weight: bold;
    border-bottom: 2px solid #dee2e6;
}
.row-summary td { border-bottom: 2px solid #fff; }

/* Linha de Categoria (Pai) */
.row-category {
    background-color: #fff;
    cursor: pointer;
    font-weight: 600;
}
.row-category:hover { background-color: #f8f9fa; }
.row-category .fa-chevron-right { transition: transform 0.2s; font-size: 0.8em; }

/* Estado Expandido */
.row-category.expanded .fa-chevron-right { transform: rotate(90deg); }

/* Linha de Subitem (Filho) */
.row-subitem {
    background-color: #fff;
    font-size: 0.9em;
    display: none; /* Oculto por padrão */
}
.row-subitem.visible { display: table-row; }
.row-subitem td:first-child { padding-left: 40px !important; color: #6c757d; }

/* Menu de Colunas (Dropdown) */
.dropdown-menu-columns {
    min-width: 250px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}