/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Página de Login */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 5px;
}

.login-header p {
    color: #666;
    font-size: 0.9em;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.login-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.8em;
    color: #666;
}

/* Botões */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-logout {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-logout:hover {
    background: #c82333;
}

/* Header */
.main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.header-left h1 {
    color: #667eea;
    font-size: 1.8em;
}

.main-nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 10px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-link:hover {
    color: #667eea;
    border-bottom-color: #667eea;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: right;
}

.user-perfil {
    display: block;
    font-size: 0.8em;
    color: #666;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 140px);
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h2 {
    color: #333;
    font-size: 2em;
    margin-bottom: 5px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-left: 4px solid #667eea;
}

.card-saldo {
    border-left-color: #28a745;
}

.card-entradas {
    border-left-color: #007bff;
}

.card-saidas {
    border-left-color: #dc3545;
}

.card-resultado {
    border-left-color: #ffc107;
}

.card-header h3 {
    color: #666;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.card-value {
    font-size: 2em;
    font-weight: bold;
    color: #333;
}

.card-value.positive {
    color: #28a745;
}

.card-value.negative {
    color: #dc3545;
}

.dashboard-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
}

/* Tabelas */
.recent-transactions h3 {
    margin-bottom: 20px;
    color: #333;
}

.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #dee2e6;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-entrada {
    background: #d4edda;
    color: #155724;
}

.badge-saida {
    background: #f8d7da;
    color: #721c24;
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Footer */
.main-footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}

/* Responsividade */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
    }
    
    .main-nav {
        margin: 15px 0;
    }
    
    .header-right {
        margin-top: 15px;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .dashboard-actions {
        flex-direction: column;
    }
    
    .data-table {
        font-size: 0.9em;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
}



/* ===== ESTILOS PARA TELA DE LANÇAMENTOS ===== */

/* Container principal */
.lancamentos-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.lancamentos-header {
    margin-bottom: 30px;
    text-align: center;
}

.lancamentos-header h2 {
    color: #333;
    font-size: 2.2em;
    margin-bottom: 8px;
}

.lancamentos-header p {
    color: #666;
    font-size: 1.1em;
}

/* Controles de navegação da semana */
.controles-semana {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.navegacao-semana {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-nav {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-nav:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.semana-atual {
    font-size: 1.1em;
    color: #333;
    padding: 0 20px;
}

.filtro-usuario {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filtro-usuario label {
    font-weight: 500;
    color: #555;
}

.filtro-usuario select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    min-width: 200px;
}

/* Tabela de lançamentos */
.tabela-lancamentos {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.lancamentos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.lancamentos-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.categoria-col {
    width: 200px;
    text-align: left !important;
}

.dia-col {
    width: calc((100% - 200px) / 7);
    min-width: 120px;
}

.lancamentos-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.categoria-nome {
    text-align: left !important;
    font-weight: 500;
    color: #333;
    padding-left: 15px !important;
}

/* Seções de entrada e saída */
.secao-header td {
    background: #f8f9fa !important;
    font-weight: bold;
    text-align: center !important;
    padding: 15px !important;
    border-top: 2px solid #dee2e6;
    border-bottom: 2px solid #dee2e6;
}

.entradas-titulo {
    color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
}

.saidas-titulo {
    color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%) !important;
}

/* Linhas de lançamentos */
.entrada-row {
    background: #f8fff9;
}

.entrada-row:hover {
    background: #e8f5e8;
}

.saida-row {
    background: #fff8f8;
}

.saida-row:hover {
    background: #f5e8e8;
}

/* Inputs de valor */
.valor-input {
    width: 100%;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    text-align: right;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.valor-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.entrada-input:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.saida-input:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Linhas de totais */
.total-row {
    background: #f1f3f4 !important;
    font-weight: bold;
}

.total-row td {
    border-top: 2px solid #dee2e6;
    border-bottom: 2px solid #dee2e6;
}

.entradas-total {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
}

.saidas-total {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%) !important;
}

.total-entradas, .total-saidas {
    font-size: 1.1em;
    font-weight: bold;
}

.total-entradas {
    color: #28a745;
}

.total-saidas {
    color: #dc3545;
}

/* Linhas de saldo */
.saldo-inicial-row, .saldo-final-row {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white;
}

.saldo-inicial-row td, .saldo-final-row td {
    border-top: 3px solid #495057;
    border-bottom: 3px solid #495057;
    font-weight: bold;
    font-size: 1.1em;
}

.saldo-cell {
    text-align: center !important;
}

.saldo-valor, .saldo-final {
    font-size: 1.2em;
    font-weight: bold;
}

.saldo-final.positivo {
    color: #28a745;
}

.saldo-final.negativo {
    color: #dc3545;
}

/* Ações de lançamentos */
.acoes-lancamentos {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

/* Status de salvamento */
.status-salvamento {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 5px;
    font-weight: 500;
    z-index: 1000;
    display: none;
    animation: slideIn 0.3s ease;
}

.status-salvamento.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-salvamento.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-salvamento.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Estilos para estrutura hierárquica dos grupos */
.grupo-header {
    background-color: #f8f9fa;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.grupo-header:hover {
    background-color: #e9ecef;
}

.grupo-nome {
    position: relative;
    padding-left: 30px;
    font-size: 15px;
}

.grupo-toggle {
    cursor: pointer;
    margin-right: 8px;
    user-select: none;
    font-size: 12px;
    color: #666;
    transition: color 0.2s;
}

.grupo-toggle:hover {
    color: #333;
}

.grupo-subtotal {
    float: right;
    font-weight: normal;
    color: #666;
    font-size: 13px;
    margin-right: 10px;
}

/* Categorias indentadas */
.categoria-indentada {
    padding-left: 40px;
    position: relative;
    font-size: 14px;
}

.categoria-indentada::before {
    content: "├─";
    position: absolute;
    left: 20px;
    color: #ccc;
    font-size: 12px;
}

/* Células dos grupos */
.grupo-cell {
    background-color: #f8f9fa;
    border: none;
}

/* Estados de expansão */
.grupo-categoria.collapsed {
    display: none;
}

/* Responsividade para grupos */
@media (max-width: 768px) {
    .grupo-subtotal {
        display: block;
        float: none;
        font-size: 12px;
        margin-top: 5px;
    }
    
    .grupo-nome {
        padding-left: 25px;
        font-size: 14px;
    }
    
    .categoria-indentada {
        padding-left: 30px;
    }
    
    .categoria-indentada::before {
        left: 15px;
    }
}

/* Estilos para linhas de subtotal por grupo */
.grupo-subtotal-row {
    background-color: #f1f3f4;
    font-weight: bold;
    border-top: 2px solid #dee2e6;
}

.grupo-subtotal-row.entrada-subtotal {
    background-color: #e8f5e8;
}

.grupo-subtotal-row.saida-subtotal {
    background-color: #ffeaea;
}

.subtotal-nome {
    padding-left: 20px;
    font-size: 14px;
    color: #495057;
}

.subtotal-cell {
    text-align: center;
    padding: 8px 5px;
}

.grupo-subtotal-dia {
    font-weight: bold;
    font-size: 13px;
    color: #495057;
}

/* Correção do layout responsivo - evitar corte da última coluna */
.tabela-lancamentos {
    background: white;
    border-radius: 10px;
    overflow-x: auto; /* Permitir scroll horizontal quando necessário */
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.lancamentos-table {
    width: 100%;
    min-width: 800px; /* Largura mínima para evitar compressão excessiva */
    border-collapse: collapse;
    font-size: 14px;
}

/* Ajustes para responsividade */
@media (max-width: 1200px) {
    .lancamentos-container {
        padding: 15px;
    }
    
    .tabela-lancamentos {
        overflow-x: auto;
    }
    
    .lancamentos-table {
        min-width: 900px;
    }
}

@media (max-width: 768px) {
    .lancamentos-container {
        padding: 10px;
    }
    
    .lancamentos-table {
        min-width: 700px;
        font-size: 12px;
    }
    
    .categoria-col {
        width: 150px;
    }
    
    .dia-col {
        width: 80px;
    }
    
    .grupo-subtotal-dia {
        font-size: 11px;
    }
    
    .subtotal-nome {
        font-size: 12px;
    }
}

/* Modal para adicionar categoria */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    font-size: 24px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
}

/* Responsividade */
@media (max-width: 1200px) {
    .lancamentos-table {
        font-size: 12px;
    }
    
    .categoria-col {
        width: 150px;
    }
    
    .dia-col {
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .controles-semana {
        flex-direction: column;
        gap: 20px;
    }
    
    .navegacao-semana {
        flex-direction: column;
        gap: 10px;
    }
    
    .tabela-lancamentos {
        overflow-x: auto;
    }
    
    .lancamentos-table {
        min-width: 800px;
    }
    
    .acoes-lancamentos {
        flex-direction: column;
        align-items: center;
    }
    
    .status-salvamento {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    .lancamentos-container {
        padding: 10px;
    }
    
    .lancamentos-header h2 {
        font-size: 1.8em;
    }
    
    .btn-nav {
        padding: 8px 12px;
        font-size: 14px;
    }
}


/* ===== ESTILOS PARA GESTÃO DE USUÁRIOS ===== */

/* Container principal */
.usuarios-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.usuarios-header {
    margin-bottom: 30px;
    text-align: center;
}

.usuarios-header h2 {
    color: #333;
    font-size: 2.2em;
    margin-bottom: 8px;
}

.usuarios-header p {
    color: #666;
    font-size: 1.1em;
}

/* Controles superiores */
.controles-usuarios {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.busca-usuarios {
    flex: 1;
    max-width: 400px;
}

.busca-usuarios input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.busca-usuarios input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.acoes-usuarios {
    margin-left: 20px;
}

.acoes-usuarios .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.acoes-usuarios .icon {
    font-size: 18px;
}

/* Tabela de usuários */
.tabela-usuarios {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.usuarios-table {
    width: 100%;
    border-collapse: collapse;
}

.usuarios-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usuarios-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.usuarios-table tr:hover {
    background: #f8f9fa;
}

.usuario-nome {
    font-weight: 500;
    color: #333;
}

.usuario-email {
    color: #666;
    font-family: monospace;
}

/* Badges de perfil */
.badge-administrador {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge-operador {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.ativo {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.inativo {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Ações dos usuários */
.usuario-acoes {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn-acao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-editar {
    background: #17a2b8;
    color: white;
}

.btn-editar:hover {
    background: #138496;
    transform: translateY(-1px);
}

.btn-ativar {
    background: #28a745;
    color: white;
}

.btn-ativar:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-inativar {
    background: #ffc107;
    color: #212529;
}

.btn-inativar:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

.btn-excluir {
    background: #dc3545;
    color: white;
}

.btn-excluir:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Sem dados */
.sem-dados {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px !important;
}

/* Estatísticas */
.estatisticas-usuarios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
    border-left: 4px solid #667eea;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Modal específico para usuários */
.modal-content {
    max-width: 500px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.senha-container {
    display: flex;
    gap: 10px;
}

.senha-container input {
    flex: 1;
}

.btn-gerar-senha {
    white-space: nowrap;
    padding: 12px 16px !important;
    font-size: 14px !important;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Status de operação */
.status-operacao {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    z-index: 1000;
    display: none;
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

.status-operacao.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-operacao.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-operacao.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsividade */
@media (max-width: 768px) {
    .controles-usuarios {
        flex-direction: column;
        gap: 20px;
    }
    
    .busca-usuarios {
        max-width: 100%;
    }
    
    .tabela-usuarios {
        overflow-x: auto;
    }
    
    .usuarios-table {
        min-width: 700px;
    }
    
    .usuarios-table th,
    .usuarios-table td {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .usuario-acoes {
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-acao {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .estatisticas-usuarios {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-number {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .usuarios-container {
        padding: 10px;
    }
    
    .usuarios-header h2 {
        font-size: 1.8em;
    }
    
    .estatisticas-usuarios {
        grid-template-columns: 1fr;
    }
    
    .senha-container {
        flex-direction: column;
    }
    
    .status-operacao {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px 0;
        max-width: 100%;
    }
}


/* ===== ESTILOS PARA FILTRO DE USUÁRIO NO DASHBOARD ===== */

.filtro-dashboard {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #667eea;
}

.filtro-dashboard label {
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.filtro-dashboard select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    min-width: 250px;
    transition: border-color 0.3s;
}

.filtro-dashboard select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

@media (max-width: 768px) {
    .filtro-dashboard {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .filtro-dashboard select {
        width: 100%;
        min-width: auto;
    }
}


/* ===== ESTILOS PARA GESTÃO DE CATEGORIAS ===== */

/* Container principal */
.categorias-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.categorias-header {
    margin-bottom: 30px;
    text-align: center;
}

.categorias-header h2 {
    color: #333;
    font-size: 2.2em;
    margin-bottom: 8px;
}

.categorias-header p {
    color: #666;
    font-size: 1.1em;
}

/* Filtro de usuário */
.filtro-categorias {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #667eea;
}

.filtro-categorias label {
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.filtro-categorias select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    min-width: 250px;
    transition: border-color 0.3s;
}

.filtro-categorias select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Controles superiores */
.controles-categorias {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.busca-categorias {
    flex: 1;
    max-width: 400px;
}

.busca-categorias input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.busca-categorias input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.acoes-categorias {
    margin-left: 20px;
}

.acoes-categorias .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.acoes-categorias .icon {
    font-size: 18px;
}

/* Seções de categorias */
.secao-categorias {
    margin-bottom: 40px;
}

.secao-titulo {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    text-align: center;
}

.secao-titulo.entradas {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.secao-titulo.saidas {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

/* Grid de categorias */
.categorias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Cards de categoria */
.categoria-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 4px solid;
}

.categoria-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.entrada-card {
    border-left-color: #28a745;
}

.saida-card {
    border-left-color: #dc3545;
}

.categoria-info {
    margin-bottom: 15px;
}

.categoria-nome {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.categoria-descricao {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 10px;
}

.categoria-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.categoria-status.ativo {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.categoria-status.inativo {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Ações das categorias */
.categoria-acoes {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-acao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-editar {
    background: #17a2b8;
    color: white;
}

.btn-editar:hover {
    background: #138496;
    transform: translateY(-1px);
}

.btn-ativar {
    background: #28a745;
    color: white;
}

.btn-ativar:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-inativar {
    background: #ffc107;
    color: #212529;
}

.btn-inativar:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

.btn-excluir {
    background: #dc3545;
    color: white;
}

.btn-excluir:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Sem categorias */
.sem-categorias {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Estatísticas */
.estatisticas-categorias {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
    border-left: 4px solid #667eea;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Responsividade */
@media (max-width: 768px) {
    .controles-categorias {
        flex-direction: column;
        gap: 20px;
    }
    
    .busca-categorias {
        max-width: 100%;
    }
    
    .categorias-grid {
        grid-template-columns: 1fr;
    }
    
    .categoria-acoes {
        justify-content: center;
    }
    
    .filtro-categorias {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .filtro-categorias select {
        width: 100%;
        min-width: auto;
    }
    
    .estatisticas-categorias {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .categorias-container {
        padding: 10px;
    }
    
    .categorias-header h2 {
        font-size: 1.8em;
    }
    
    .categoria-card {
        padding: 15px;
    }
    
    .estatisticas-categorias {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 2em;
    }
}



/* ===== ESTILOS PARA GESTÃO DE GRUPOS ===== */

/* Container principal */
.grupos-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.grupos-header {
    margin-bottom: 30px;
    text-align: center;
}

.grupos-header h2 {
    color: #333;
    font-size: 2.2em;
    margin-bottom: 8px;
}

.grupos-header p {
    color: #666;
    font-size: 1.1em;
}

/* Filtro de usuário */
.filtro-grupos {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #667eea;
}

.filtro-grupos label {
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.filtro-grupos select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    min-width: 250px;
    transition: border-color 0.3s;
}

.filtro-grupos select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Controles superiores */
.controles-grupos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.busca-grupos {
    flex: 1;
    max-width: 400px;
}

.busca-grupos input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.busca-grupos input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.acoes-grupos {
    margin-left: 20px;
}

/* Grid de grupos */
.grupos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Cards de grupo */
.grupo-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 5px solid;
    position: relative;
    overflow: hidden;
}

.grupo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.grupo-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.grupo-cor {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.grupo-nome {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
}

.grupo-status {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grupo-status.ativo {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.grupo-status.inativo {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.grupo-info {
    margin-bottom: 20px;
}

.grupo-descricao {
    color: #666;
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 15px;
}

.grupo-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-number {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ações dos grupos */
.grupo-acoes {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Seletor de cores */
.cor-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cores-predefinidas {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cor-opcao {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.cor-opcao:hover {
    transform: scale(1.1);
}

/* Sem grupos */
.sem-grupos {
    grid-column: 1 / -1;
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 60px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.sem-grupos .btn {
    margin-top: 15px;
}

/* Responsividade para grupos */
@media (max-width: 768px) {
    .controles-grupos {
        flex-direction: column;
        gap: 20px;
    }
    
    .busca-grupos {
        max-width: 100%;
    }
    
    .grupos-grid {
        grid-template-columns: 1fr;
    }
    
    .grupo-acoes {
        justify-content: center;
    }
    
    .filtro-grupos {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .filtro-grupos select {
        width: 100%;
        min-width: auto;
    }
    
    .grupo-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .grupos-container {
        padding: 10px;
    }
    
    .grupos-header h2 {
        font-size: 1.8em;
    }
    
    .grupo-card {
        padding: 20px;
    }
    
    .cores-predefinidas {
        justify-content: center;
    }
}


/* ========================================
   ESTILOS PARA SUBTOTAIS POR GRUPO - ADICIONADOS
   ======================================== */

/* Estilos para linhas de subtotal por grupo */
.grupo-subtotal-row {
    background-color: #f1f3f4;
    font-weight: bold;
    border-top: 2px solid #dee2e6;
}

.grupo-subtotal-row.entrada-subtotal {
    background-color: #e8f5e8;
}

.grupo-subtotal-row.saida-subtotal {
    background-color: #ffeaea;
}

.subtotal-nome {
    padding-left: 20px;
    font-size: 14px;
    color: #495057;
}

.subtotal-cell {
    text-align: center;
    padding: 8px 5px;
}

.grupo-subtotal-dia {
    font-weight: bold;
    font-size: 13px;
    color: #495057;
}

/* Correção do layout responsivo - evitar corte da última coluna */
.tabela-lancamentos {
    overflow-x: auto !important; /* Permitir scroll horizontal quando necessário */
}

.lancamentos-table {
    min-width: 800px !important; /* Largura mínima para evitar compressão excessiva */
}

/* Ajustes adicionais para responsividade dos subtotais */
@media (max-width: 1200px) {
    .lancamentos-table {
        min-width: 900px !important;
    }
}

@media (max-width: 768px) {
    .lancamentos-table {
        min-width: 700px !important;
        font-size: 12px;
    }
    
    .grupo-subtotal-dia {
        font-size: 11px;
    }
    
    .subtotal-nome {
        font-size: 12px;
    }
}

/* ========================================
   ESTILOS PARA SUBTOTAIS POR GRUPO - ADICIONADOS
   ======================================== */

/* Estilos para linhas de subtotal por grupo */
.grupo-subtotal-row {
    background-color: #f1f3f4;
    font-weight: bold;
    border-top: 2px solid #dee2e6;
}

.grupo-subtotal-row.entrada-subtotal {
    background-color: #e8f5e8;
}

.grupo-subtotal-row.saida-subtotal {
    background-color: #ffeaea;
}

.subtotal-nome {
    padding-left: 20px;
    font-size: 14px;
    color: #495057;
}

.subtotal-cell {
    text-align: center;
    padding: 8px 5px;
}

.grupo-subtotal-dia {
    font-weight: bold;
    font-size: 13px;
    color: #495057;
}

/* Correção do layout responsivo - evitar corte da última coluna */
.tabela-lancamentos {
    overflow-x: auto !important; /* Permitir scroll horizontal quando necessário */
}

.lancamentos-table {
    min-width: 800px !important; /* Largura mínima para evitar compressão excessiva */
}

/* Ajustes adicionais para responsividade dos subtotais */
@media (max-width: 1200px) {
    .lancamentos-table {
        min-width: 900px !important;
    }
}

@media (max-width: 768px) {
    .lancamentos-table {
        min-width: 700px !important;
        font-size: 12px;
    }
    
    .grupo-subtotal-dia {
        font-size: 11px;
    }
    
    .subtotal-nome {
        font-size: 12px;
    }
}

/* ========================================
   ESTILOS PARA BOTÕES DE REORDENAÇÃO - ADICIONADOS
   ======================================== */

/* Botões de reordenação */
.btn-reordenar {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-reordenar:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.btn-reordenar:disabled {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-reordenar .icon {
    font-size: 16px;
    line-height: 1;
}

/* Ajustes para mobile */
@media (max-width: 768px) {
    .btn-reordenar {
        padding: 6px 8px;
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .btn-reordenar .icon {
        font-size: 14px;
    }
}

/* ========================================
   MELHORIAS COMPLETAS PARA TELA DE LANÇAMENTOS
   - Elimina scroll horizontal
   - Moderniza cores (remove gradientes antigos)
   - Mantém PHP puro
   ======================================== */

/* ========================================
   OTIMIZAÇÕES DE LAYOUT - ELIMINAR SCROLL HORIZONTAL
   ======================================== */

/* Otimização da tabela principal */
.tabela-lancamentos {
    background: white;
    border-radius: 8px;
    overflow: hidden; /* Remover scroll horizontal */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06) !important;
    margin-bottom: 30px;
    width: 100%;
    border: 1px solid #e2e8f0;
}

.lancamentos-table {
    width: 100%;
    min-width: auto !important; /* Remover largura mínima fixa */
    table-layout: fixed; /* Controle preciso das colunas */
    border-collapse: collapse;
    font-size: 14px;
}

/* Otimização das colunas */
.categoria-col {
    width: 180px; /* Largura fixa para categorias */
    min-width: 180px;
}

.dia-col {
    width: calc((100% - 180px) / 7); /* Distribuição igual dos dias */
    min-width: 90px; /* Largura mínima reduzida */
    max-width: 120px; /* Largura máxima */
}

/* Otimização dos inputs */
.valor-input {
    width: 100%;
    max-width: 85px; /* Largura máxima reduzida */
    min-width: 70px; /* Largura mínima */
    padding: 6px 4px; /* Padding reduzido */
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-align: center;
    box-sizing: border-box;
    background: white;
    color: #374151;
    transition: all 0.2s ease;
}

.valor-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.valor-input:hover {
    border-color: #9ca3af;
}

/* ========================================
   MODERNIZAÇÃO DAS CORES - DESIGN FLAT MODERNO
   ======================================== */

/* Cabeçalho da tabela - Azul moderno */
.lancamentos-table th {
    background: #2563eb !important; /* Azul moderno sólido */
    background-image: none !important; /* Remove gradientes antigos */
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border: none;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lancamentos-table td {
    padding: 10px 6px;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    vertical-align: middle;
}

/* Linhas de saldo - Cinza moderno */
.saldo-inicial-row, .saldo-final-row {
    background: #475569 !important; /* Cinza azulado moderno */
    background-image: none !important; /* Remove gradientes antigos */
    color: white;
}

.saldo-inicial-row td, .saldo-final-row td {
    border-top: 2px solid #334155;
    border-bottom: 2px solid #334155;
    font-weight: 600;
    font-size: 1.1em;
}

/* Totais de entradas - Verde moderno */
.entradas-total {
    background: #ecfdf5 !important; /* Verde muito claro */
    background-image: none !important; /* Remove gradientes antigos */
    border-left: 4px solid #059669; /* Verde moderno */
}

.entradas-total td {
    color: #065f46; /* Verde escuro */
    font-weight: 600;
}

/* Totais de saídas - Vermelho moderno */
.saidas-total {
    background: #fef2f2 !important; /* Vermelho muito claro */
    background-image: none !important; /* Remove gradientes antigos */
    border-left: 4px solid #dc2626; /* Vermelho moderno */
}

.saidas-total td {
    color: #991b1b; /* Vermelho escuro */
    font-weight: 600;
}

/* Subtotais de grupos - Cores suaves */
.grupo-subtotal-row.entrada-subtotal {
    background: #f0fdf4 !important; /* Verde muito suave */
    border-left: 3px solid #22c55e;
}

.grupo-subtotal-row.saida-subtotal {
    background: #fef2f2 !important; /* Vermelho muito suave */
    border-left: 3px solid #ef4444;
}

.grupo-subtotal-row {
    background: #f8fafc !important; /* Cinza muito claro */
    background-image: none !important; /* Remove gradientes antigos */
    font-weight: 600;
    border-top: 1px solid #e2e8f0;
}

/* Cabeçalhos de seção modernos */
.secao-header td {
    background: #f1f5f9 !important; /* Cinza claro moderno */
    background-image: none !important; /* Remove gradientes antigos */
    color: #334155; /* Cinza escuro */
    font-weight: 700;
    font-size: 16px;
    padding: 16px 12px;
    border-bottom: 2px solid #e2e8f0;
}

/* Grupos de categorias - Cores modernas */
.grupo-header {
    background: #f8fafc !important; /* Cinza muito claro */
    border-bottom: 1px solid #e2e8f0;
}

.grupo-nome {
    color: #1e293b; /* Cinza escuro moderno */
    font-weight: 600;
    font-size: 14px;
}

/* Linhas de categorias - Hover moderno */
.lancamento-row:hover {
    background: #f8fafc !important; /* Hover suave */
}

/* Otimização das linhas de categoria */
.categoria-nome {
    text-align: left !important;
    padding-left: 12px !important;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Otimização dos subtotais */
.subtotal-nome {
    text-align: left !important;
    padding-left: 16px !important;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grupo-subtotal-dia {
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

/* Cores de texto modernas */
.total-entradas {
    color: #059669 !important; /* Verde moderno */
}

.total-saidas {
    color: #dc2626 !important; /* Vermelho moderno */
}

.saldo-final.positivo {
    color: #059669 !important; /* Verde moderno */
}

.saldo-final.negativo {
    color: #dc2626 !important; /* Vermelho moderno */
}

/* Container principal moderno */
.lancamentos-container {
    background: #f8fafc;
    min-height: 100vh;
    padding: 20px;
}

/* ========================================
   RESPONSIVIDADE OTIMIZADA
   ======================================== */

@media (max-width: 1400px) {
    .categoria-col {
        width: 160px;
        min-width: 160px;
    }
    
    .dia-col {
        width: calc((100% - 160px) / 7);
        min-width: 85px;
    }
    
    .valor-input {
        max-width: 80px;
        font-size: 12px;
    }
}

@media (max-width: 1200px) {
    .categoria-col {
        width: 140px;
        min-width: 140px;
    }
    
    .dia-col {
        width: calc((100% - 140px) / 7);
        min-width: 80px;
    }
    
    .valor-input {
        max-width: 75px;
        padding: 5px 3px;
    }
    
    .lancamentos-table {
        font-size: 13px;
        min-width: auto !important;
    }
}

@media (max-width: 992px) {
    .categoria-col {
        width: 120px;
        min-width: 120px;
    }
    
    .dia-col {
        width: calc((100% - 120px) / 7);
        min-width: 75px;
    }
    
    .valor-input {
        max-width: 70px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .tabela-lancamentos {
        margin: 0 -10px; /* Usar toda a largura disponível */
        border-radius: 0;
    }
    
    .categoria-col {
        width: 100px;
        min-width: 100px;
        font-size: 12px;
    }
    
    .dia-col {
        width: calc((100% - 100px) / 7);
        min-width: 65px;
    }
    
    .valor-input {
        max-width: 60px;
        min-width: 55px;
        padding: 4px 2px;
        font-size: 11px;
    }
    
    .lancamentos-table {
        font-size: 12px;
        min-width: auto !important;
    }
    
    .lancamentos-table th,
    .lancamentos-table td {
        padding: 8px 4px;
    }
    
    .grupo-subtotal-dia {
        font-size: 11px;
    }
    
    .subtotal-nome {
        font-size: 12px;
    }
}

