/* Reset e Base */
* {
    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: #f4f4f4;
    font-size: 14px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* Header */
header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2c3e50;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

h1 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

/* Botões */
.btn-adicionar, .btn-voltar, .btn-salvar, .btn-editar, .btn-excluir {
    display: inline-block;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-align: center;
    border: none;
    cursor: pointer;
}

.btn-adicionar {
    background-color: #27ae60;
    color: white;
}

.btn-adicionar:hover {
    background-color: #219653;
}

.btn-voltar {
    background-color: #7f8c8d;
    color: white;
}

.btn-voltar:hover {
    background-color: #6c7b7d;
}

.btn-salvar {
    background-color: #3498db;
    color: white;
    font-size: 1rem;
}

.btn-salvar:hover {
    background-color: #2980b9;
}

.btn-editar {
    background-color: #f39c12;
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-editar:hover {
    background-color: #e67e22;
}

.btn-excluir {
    background-color: #e74c3c;
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-excluir:hover {
    background-color: #c0392b;
}

/* Filtro do Mês */
.filtro-mes {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.filtro-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filtro-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

.filtro-group label {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.filtro-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.btn-filtrar, .btn-limpar {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-filtrar {
    background-color: #3498db;
    color: white;
}

.btn-filtrar:hover {
    background-color: #2980b9;
}

.btn-limpar {
    background-color: #95a5a6;
    color: white;
}

.btn-limpar:hover {
    background-color: #7f8c8d;
}

/* Resumo */
.resumo {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.resumo h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.resumo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.resumo-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    text-align: center;
}

.resumo-card.total {
    border-left-color: #e74c3c;
}

.resumo-card h3 {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.resumo-card .valor {
    font-size: 1.4rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Tabela */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 5px;
    overflow: hidden;
}

th, td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-size: 0.9rem;
}

th {
    background-color: #2c3e50;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover {
    background-color: #f5f5f5;
}

.vazio {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 30px !important;
}

.acoes {
    white-space: nowrap;
}

/* Forms */
form {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

input, textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.erro {
    background-color: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-top {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    h1 {
        font-size: 1.3rem;
        text-align: center;
    }
    
    .btn-adicionar, .btn-voltar, .btn-salvar {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    
    .filtro-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filtro-group {
        min-width: auto;
    }
    
    .acoes {
        white-space: normal;
    }
    
    .resumo-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    .container {
        padding: 8px;
    }
    
    th, td {
        padding: 6px 4px;
        font-size: 0.75rem;
    }
    
    .resumo-card .valor {
        font-size: 1.2rem;
    }
}

/* Print */
@media print {
    .header-actions, .quick-actions, .acoes, .export-options, .filtro-mes, .btn {
        display: none !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    table {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    th {
        background-color: #f8f9fa !important;
        color: #2c3e50 !important;
        border-bottom: 2px solid #ddd;
    }
}