/* assets/style.css */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    margin: 0;
    padding-top: 60px; /* Espaço para o header fixo */
}

/* --- Header e Navegação --- */
.main-header {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    padding: 0 40px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
}

.logo a {
    font-weight: 700;
    font-size: 1.5rem;
    color: #343a40;
    text-decoration: none;
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

.main-nav ul li {
    margin-left: 25px;
}

.main-nav ul li a {
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    font-size: 1rem;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}

.main-nav ul li a:hover {
    color: #007bff;
    border-bottom-color: #007bff;
}

/* --- Conteúdo Principal --- */
.content {
    padding: 40px;
}

.container {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    text-align: center;
}

/* --- Barra de Título e Filtro (NOVO) --- */
.main-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap; /* Permite que o filtro quebre a linha em telas pequenas */
    gap: 20px;
}

h1 {
    font-weight: 300;
    color: #2c3e50;
    margin: 0; /* Remove a margem padrão do h1 */
    font-size: 2rem;
}

/* --- Estilo Moderno para Filtro de Data (ATUALIZADO) --- */
.form-filtro {
    display: flex;
    align-items: flex-end; /* Alinha os itens pela base */
    gap: 15px;
}

.form-filtro .form-group {
    display: flex;
    flex-direction: column;
}

.form-filtro label {
    font-size: 0.85rem; /* Fonte menor */
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-filtro input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #dee2e6; /* Borda mais suave */
    border-radius: 6px; /* Bordas mais arredondadas */
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #495057;
    background-color: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-filtro input[type="date"]:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.btn-filtrar {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-filtrar:hover {
    background-color: #0056b3;
}


/* --- Estilos do Formulário de Upload (Reutilizável) --- */
.upload-area {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 25px;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
    margin-top: 20px;
    display: flex; /* Ativa o layout flexível */
    flex-direction: column; /* Organiza os itens em coluna */
    justify-content: center; /* Centraliza verticalmente */
    align-items: center; /* Centraliza horizontalmente */
    min-height: 120px; /* Garante uma altura mínima agradável */
    box-sizing: border-box; /* Melhora o cálculo de tamanho */
}
.upload-area:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.upload-area p { margin: 0; font-weight: 300; color: #6c757d; }
#file-input { display: none; }
#file-name { margin-top: 15px; font-weight: 500; color: #495057; }

.btn-submit {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 25px;
    transition: background-color 0.3s, opacity 0.3s;
    opacity: 0.6;
    pointer-events: none;
}
.btn-submit.active { opacity: 1; pointer-events: auto; }
.btn-submit:hover.active { background-color: #0056b3; }

/* Mensagens de feedback */
.mensagem { padding: 15px; border-radius: 5px; margin-bottom: 20px; font-weight: 400; text-align: left; }
.sucesso { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.erro { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- Dashboard --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.card {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px_20px rgba(0, 0, 0, 0.05);
    border-left: 5px solid #007bff;
}

.card h2 {
    margin-top: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    margin-bottom: 10px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #343a40;
}

.card-value.positive { color: #28a745; }
.card-value.negative { color: #dc3545; }

/* Estilo Corrigido */
.chart-container {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
    position: relative; /* Adicionado para melhor compatibilidade com Chart.js */
    height: 450px;      /* Adicionado para definir uma altura fixa e evitar o loop de crescimento */
}

/* Grid para os gráficos principais */
.charts-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Gráfico maior à esquerda, menor à direita */
    gap: 25px;
    margin-top: 30px;
}

/* --- Rodapé --- */
.main-footer {
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Responsividade para telas menores */
@media (max-width: 992px) {
    .charts-main-grid {
        grid-template-columns: 1fr; /* Um gráfico embaixo do outro */
    }
    .main-title-bar {
        justify-content: flex-start; /* Alinha tudo à esquerda em telas pequenas */
    }
}