/* Reset básico para box-sizing */
* {
    box-sizing: border-box;
}

/* Geral */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow-x: hidden; /* Prevent horizontal scroll on mobile menu toggle */
}

:root {
    --primary-color: #4a90e2; /* Azul vibrante */
    --secondary-color: #50e3c2; /* Verde água */
    --accent-color: #f5a623; /* Laranja/Amarelo */
    --negative-color: #dc3545; /* Vermelho para despesas/perdas */
    --positive-color: #28a745; /* Verde para lucros/receitas */

    --background-color: #f4f7f6; /* Fundo claro */
    --card-background: #ffffff; /* Fundo dos cartões */
    --header-background: #34495e; /* Azul escuro/cinza para cabeçalho */
    --sidebar-background: #2c3e50; /* Azul escuro para sidebar */
    --text-color: #333333;
    --light-text-color: #666666;
    --border-color: #e0e0e0;
    --hover-color: #f0f0f0; /* Cor de hover para itens de lista */
}

/* Container principal */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-background);
    color: white;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    position: fixed; /* Fixa a sidebar */
    height: 100%; /* Ocupa toda a altura */
    left: 0;
    top: 0;
    z-index: 1000; /* Garante que fique acima de outros elementos */
    transform: translateX(0); /* Visível por padrão */
    transition: transform 0.3s ease-in-out;
}

.sidebar .logo {
    text-align: center;
    margin-bottom: 30px;
}

.sidebar .logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--secondary-color);
}

.sidebar .logo h2 {
    color: var(--secondary-color);
    margin-top: 10px;
    font-size: 1.2em;
}

.sidebar .menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar .menu ul li {
    margin-bottom: 10px;
}

.sidebar .menu ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar .menu ul li a i {
    margin-right: 10px;
    font-size: 1.1em;
}

.sidebar .menu ul li a:hover,
.sidebar .menu ul li a.active {
    background-color: var(--primary-color);
    color: white;
}

/* Header */
.main-header {
    background-color: var(--header-background);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky; /* Mantém o header no topo */
    top: 0;
    z-index: 1001; /* Garante que fique acima da sidebar */
    
    /* Desktop styles for header */
    width: calc(100% - 250px); /* Ajusta a largura para não sobrepor a sidebar */
    margin-left: 250px; /* Desloca para a direita para não sobrepor a sidebar */
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out; /* Adicionado transição */
}

.main-header .header-content {
    display: flex;
    align-items: center;
    width: 100%; /* Ensure content fills header width */
}

.main-header .logo {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--secondary-color);
    margin-right: 20px;
}

.main-header .logo i {
    margin-right: 10px;
}

.main-header .menu-toggle {
    display: none; /* Hidden by default on larger screens */
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
}

.main-header .user-profile {
    display: flex;
    align-items: center;
    margin-left: auto; /* Push to the right */
}

.main-header .user-profile span {
    margin-right: 10px;
    font-weight: bold;
}

.main-header .user-profile .btn {
    background-color: var(--negative-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.main-header .user-profile .btn:hover {
    background-color: #c82333;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 20px;
    margin-left: 250px; /* Offset for fixed sidebar */
    transition: margin-left 0.3s ease-in-out;
}

/* Seções e Cards */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h1, .section-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.8em;
}

.section-header h3 {
    font-size: 1.4em;
    color: var(--text-color);
}

.btn {
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: #3a7bd5;
    border-color: #3a7bd5;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-danger {
    background-color: var(--negative-color);
    color: white;
    border: 1px solid var(--negative-color);
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.8em;
}

.card {
    background-color: var(--card-background);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* Dashboard Specific Styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.dashboard-header h1 {
    color: var(--primary-color);
    font-size: 2.2em;
    margin: 0;
}

.dashboard-header .date-range {
    font-size: 1.1em;
    color: var(--light-text-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--card-background);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card .stat-icon {
    font-size: 2.5em;
    color: var(--primary-color);
}

.stat-card.revenue .stat-icon { color: var(--positive-color); }
.stat-card.expense .stat-icon { color: var(--negative-color); }
.stat-card.profit .stat-icon { color: var(--secondary-color); }
.stat-card.clients .stat-icon { color: var(--accent-color); }


.stat-card .stat-info h3 {
    margin: 0 0 5px 0;
    color: var(--light-text-color);
    font-size: 1em;
    text-transform: uppercase;
}

.stat-card .stat-info .stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--text-color);
    margin: 0;
}

.stat-card .stat-info .stat-change {
    font-size: 0.9em;
    font-weight: 500;
}

.stat-card .stat-info .stat-change.positive { color: var(--positive-color); }
.stat-card .stat-info .stat-change.negative { color: var(--negative-color); }
.stat-card .stat-info .stat-change.info { color: var(--light-text-color); }


/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns for charts */
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background-color: var(--card-background);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    height: 400px; /* Fixed height for consistent chart size */
    position: relative; /* Important for canvas resizing */
}

.chart-container h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 1.2em;
}

.chart-container canvas {
    width: 100% !important; /* Ensure canvas takes full width of its container */
    height: 100% !important; /* Ensure canvas takes full height of its container */
}


/* Recent Transactions */
.recent-transactions {
    margin-top: 30px;
    background-color: var(--card-background);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.transactions-list {
    margin-top: 20px;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:hover {
    background-color: var(--hover-color);
}

.transaction-item .transaction-icon {
    font-size: 1.5em;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.transaction-item.receita .transaction-icon {
    color: var(--positive-color);
}

.transaction-item.despesa .transaction-icon {
    color: var(--negative-color);
}

.transaction-item .transaction-info {
    flex-grow: 1;
}

.transaction-item .transaction-info h4 {
    margin: 0 0 5px 0;
    color: var(--text-color);
    font-size: 1.1em;
}

.transaction-item .transaction-info p {
    margin: 0;
    color: var(--light-text-color);
    font-size: 0.9em;
}

.transaction-item .transaction-value {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-color);
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--light-text-color);
}

.form-control {
    width: calc(100% - 20px); /* Adjust for padding */
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box; /* Include padding in width */
}

textarea.form-control {
    resize: vertical;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end; /* Align buttons to the right */
}

/* Radio buttons specific style */
.radio-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.radio-group input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2); /* Make radio buttons slightly larger */
}

.radio-group label {
    margin-bottom: 0; /* Remove bottom margin for labels in radio group */
    font-weight: normal; /* Adjust font weight for radio labels */
}


/* Data Table (Listagem) */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: var(--card-background);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden; /* Ensures rounded corners apply to content */
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}

.data-table tbody tr:hover {
    background-color: var(--hover-color);
}

.data-table .table-actions {
    white-space: nowrap; /* Prevent buttons from wrapping */
}

.data-table .table-actions .btn {
    margin-right: 5px;
}

/* Messages (Success/Error) */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.message i {
    font-size: 1.2em;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer */
.main-footer {
    background-color: var(--header-background);
    color: white;
    padding: 20px;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
}

.main-footer p {
    margin: 5px 0;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
}

.main-footer .fa-heart {
    color: var(--negative-color); /* Coração vermelho */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Sidebar */
    .sidebar {
        transform: translateX(-100%); /* Esconde a sidebar fora da tela */
        left: 0; /* Alinha à esquerda para o translateX funcionar */
        width: 200px; /* Largura da sidebar em mobile */
    }

    /* Quando o menu está aberto, a sidebar entra */
    body.menu-open .sidebar {
        transform: translateX(0); /* Move a sidebar para a posição visível */
    }

    /* Main Content */
    .main-content {
        margin-left: 0; /* Remove o offset da sidebar em mobile */
        padding-top: 70px; /* Espaço para o cabeçalho fixo */
        transition: transform 0.3s ease-in-out;
    }

    body.menu-open .main-content {
        transform: translateX(200px); /* Move o conteúdo para a direita quando a sidebar está aberta */
        filter: blur(2px); /* Optional: blur content when menu is open */
        pointer-events: none; /* Optional: prevent interaction with blurred content */
    }

    /* Main Header */
    .main-header {
        width: 100%; /* Ocupa toda a largura da tela */
        margin-left: 0; /* Remove o offset em mobile */
        position: fixed; /* Fixa o cabeçalho no topo */
        top: 0;
        left: 0;
        z-index: 1002; /* Garante que o header esteja acima de tudo */
        transition: transform 0.3s ease-in-out;
    }

    body.menu-open .main-header {
        transform: translateX(200px); /* Move o header para a direita quando a sidebar está aberta */
    }

    .main-header .menu-toggle {
        display: block; /* Show toggle button on small screens */
    }

    /* Esconde a navegação principal do header em mobile */
    .main-header .main-nav {
        display: none;
    }

    .charts-grid, .stats-grid {
        grid-template-columns: 1fr; /* Stack charts and stats on small screens */
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-header h1 {
        margin-bottom: 10px;
    }

    .form-control {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* New styles for reports-grid */
.reports-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns for reports */
    gap: 20px;
    margin-top: 30px; /* Add space from charts above */
    margin-bottom: 30px; /* Add space before last transactions */
}

.report-card {
    background-color: var(--card-background);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Specific styles for revenue and expense report cards */
.report-card-revenue {
    border-left: 5px solid var(--positive-color); /* Green border for revenue */
}

.report-card-expense {
    border-left: 5px solid var(--negative-color); /* Red border for expense */
}


.report-card .section-header {
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.report-card .section-header h3 {
    font-size: 1.2em;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.report-card ul li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    color: var(--text-color);
}

.report-card ul li:last-child {
    border-bottom: none;
}

.report-card ul li .value {
    font-weight: bold;
    color: var(--primary-color);
}

/* Styles for status in tables */
.status-overdue {
    color: var(--negative-color);
    font-weight: bold;
}

.status-due-today {
    color: var(--accent-color);
    font-weight: bold;
}

.status-upcoming {
    color: var(--positive-color);
    font-weight: bold;
}

/* Responsive adjustment for reports-grid */
@media (max-width: 768px) {
    .reports-grid {
        grid-template-columns: 1fr; /* Stack reports on small screens */
    }
}

---
## Estilos para Busca e Paginação (Ajustados e Integrados)

```css
/* --- Estilos para o Formulário de Busca --- */
.filter-section {
    background-color: var(--card-background); /* Usando a variável */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.search-form {
    display: flex;
    gap: 10px;
    flex-grow: 1;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color); /* Usando a variável */
    border-radius: 5px;
    font-size: 1rem;
    max-width: 300px;
    color: var(--text-color); /* Garante a cor do texto */
    background-color: var(--card-background); /* Cor de fundo para o input */
}

/* Reutilizando os botões existentes */
.search-form button,
.filter-section .btn-secondary {
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

/* Definição de .btn-dark, se não existir (ou ajuste se existir e for diferente) */
.btn-dark {
    background-color: var(--header-background); /* Usando uma cor mais escura do seu tema */
    color: white;
    border: 1px solid var(--header-background);
}

.btn-dark:hover {
    background-color: #2c3e50; /* Um tom ligeiramente mais escuro que header-background */
    border-color: #2c3e50;
}


/* --- Estilos para a Paginação --- */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 25px;
    padding: 15px;
    background-color: var(--card-background); /* Usando a variável */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    gap: 8px;
}

.pagination a {
    display: inline-block;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--primary-color); /* Usando a variável */
    border: 1px solid var(--primary-color); /* Usando a variável */
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    min-width: 40px;
    text-align: center;
    background-color: var(--card-background); /* Garante o fundo branco */
}

.pagination a:hover {
    background-color: var(--primary-color); /* Usando a variável */
    color: var(--card-background); /* Inverte a cor do texto no hover */
    border-color: var(--primary-color);
}

.pagination a.active {
    background-color: var(--primary-color); /* Usando a variável */
    color: white;
    border-color: var(--primary-color);
    font-weight: bold;
    cursor: default;
}

/* Media query para responsividade da busca e paginação */
@media (max-width: 768px) {
    .filter-section {
        flex-direction: column; /* Empilha os itens em telas menores */
        align-items: stretch; /* Estica para ocupar a largura total */
    }

    .search-form {
        flex-direction: column; /* Empilha input e botão de busca */
        gap: 15px; /* Mais espaço entre eles */
    }

    .search-form input[type="text"] {
        max-width: 100%; /* Ocupa a largura total */
    }

    .search-form button,
    .filter-section .btn-secondary {
        width: 100%; /* Botões ocupam a largura total */
    }

    .pagination {
        flex-wrap: wrap; /* Garante quebras de linha se muitos itens */
        justify-content: center; /* Centraliza mesmo com quebras */
    }

    .pagination a {
        flex-grow: 1; /* Permite que os links cresçam para preencher espaço */
        min-width: unset; /* Remove o min-width para maior flexibilidade */
        width: auto; /* Deixa o navegador decidir a largura base */
    }
}