:root{
  --primary: #036849;      /* verde principal */
  --primary-dark: #024e3a; /* hover/ativo */
  --accent: #2aa06d;       /* degradê claro */
  --success: #198754;
  --danger: #dc3545;
  --bg: #f4f6f9;
  --card-bg: #ffffff;
  --panel-bg: #212529;
  --panel-contrast: #1a1d20;
  --muted: #6c757d;
  --text: #222;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(16,24,40,0.06);
  --gap: 16px;
}

/* 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;
}

.msg-user {
    background-color: #007bff;
    color: white;
    padding: 10px;
    border-radius: 10px 10px 0 10px;
    align-self: flex-end;
    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: #198754; 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 #2aa06d;
}
.row-summary td { border-bottom: 2px solid #fff; }

/* Linha de Categoria (Pai) */
.row-category {
    background-color: #198754;
    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;
}

/* ===========================
   Estilos da página de login
 */

body.login-page {
    overflow: auto; /* permite scroll na página de login */
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Use as mesmas larguras e bordas das "cards" do layout principal */
.login-wrapper {
    width: 100%;
    max-width: 420px;
    display: flex;
    justify-content: center;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    box-sizing: border-box;
    width: 100%;
}

/* Cabeçalho do login seguindo tipografia do app */
.login-header { text-align: center; margin-bottom: 20px; }
.login-header h2 { color: var(--text); font-weight: 700; margin: 0; font-size: 1.5rem; }
.login-header p { color: var(--muted); margin: 6px 0 0; font-size: 0.95rem; }

/* Inputs e botão devem usar as mesmas regras base */
.form-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid #e9ecef;
    margin-bottom: 12px;
    font-size: 1rem;
    background: #fff;
    box-sizing: border-box;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 0.12rem rgba(102,126,234,0.12); }

/* Botão do login utiliza classe unificada .btn para coerência */
.btn-login { width: 100%; padding: 12px; border-radius: calc(var(--radius)); }
/*.btn-login .spinner { border-color: rgba(255,255,255,0.6); border-top-color: rgba(255,255,255,0.95); }*/
.btn-login .spinner {
  /* Opção 1 — verde sóbrio (próximo ao atual) */
  border-color: rgba(3,104,73,0.25);
  border-top-color: rgba(3,104,73,0.95);
}


/* Spinner */
.spinner { display:inline-block; width:18px; height:18px; border:2px solid rgba(255,255,255,0.45); border-top-color: rgba(255,255,255,0.95); border-radius:50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.d-none { display: none !important; }

/* Alert leve (sem bootstrap), mantido estilo coerente com cards */
.alert {
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    background: #fff5f5; color: #842029; border:1px solid #f5c2c7;
    padding:12px; border-radius:8px; margin-bottom:14px; box-sizing:border-box;
}
.alert .close-btn { background:transparent; border:0; font-size:16px; line-height:1; cursor:pointer; color:inherit; }

/* Texto auxiliar */
.login-footer { text-align:center; margin-top:14px; color: var(--muted); font-size:0.9rem; }

/* Ajustes responsivos */
@media (max-width: 768px){
    .sidebar-panel { display:none; }
    .layout-wrapper { padding: 12px; }
    body.login-page { padding: 12px; }
}

/* ...existing code... */