/* public/css/reportesGastos.css */
/* (Copia de reportesFinancieros.css para mantener la consistencia visual) */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #eef1f5; /* Un gris azulado muy claro */
    color: #333;
    line-height: 1.6;
}

.container {
    width: 95%;
    max-width: 1600px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.report-header-main {
    text-align: center;
    padding-bottom: 25px;
    margin-bottom: 30px;
    border-bottom: 1px solid #dde2e7;
}

.report-header-main h1 {
    font-size: 2.2em;
    color: #2c3e50; /* Azul oscuro */
    margin-bottom: 20px;
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.filter-group label {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
    font-weight: 500;
}

.filters-bar select, .filters-bar input {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95em;
    min-width: 200px;
    background-color: #fff;
}

.filters-bar select:focus, .filters-bar input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.cta-button {
    padding: 10px 25px;
    font-size: 1em;
    font-weight: bold;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cta-button:hover {
    background-color: #0056b3;
}
.cta-button:active {
    transform: translateY(1px);
}

#reportDashboard {
    padding-top: 20px;
}

.report-title-section h2 {
    text-align: center;
    font-size: 1.8em;
    color: #17a2b8;
    margin-bottom: 10px;
    font-weight: 600;
}

.report-subtitle {
    text-align: center;
    font-size: 1.1em;
    color: #6c757d;
    margin-top: -5px;
    margin-bottom: 30px;
}


.report-content-area {
    margin-bottom: 40px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}
.kpi-grid.single-row {
    grid-template-columns: 1fr;
    justify-items: center;
}

.kpi-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #007bff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}
.kpi-card:nth-child(2n) { border-left-color: #ffc107; } /* Amarillo */
.kpi-card:nth-child(3n) { border-left-color: #17a2b8; } /* Turquesa */
.kpi-card:nth-child(4n) { border-left-color: #6f42c1; } /* Morado */

.kpi-card.main-kpi {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.kpi-card h4 {
    margin-top: 0;
    font-size: 1em;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
}

.kpi-card p {
    font-size: 1.8em;
    font-weight: 700;
    color: #343a40;
    margin-bottom: 0;
}

.chart-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.chart-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
    height: 400px;
}
.chart-container.large { height: 450px; }
.chart-container.medium { height: 380px; }

.chart-title {
    font-size: 1.2em;
    color: #495057;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}
.no-data-chart {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #888;
    font-style: italic;
}

.loading-spinner, .error-message {
    text-align: center;
    padding: 40px 20px;
}
.error-message p {
    color: #dc3545;
    font-weight: bold;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 6px;
    display: inline-block;
}

.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filter-group, .filters-bar select, .filters-bar input, .cta-button { width: 100%; box-sizing: border-box; }
    .kpi-grid, .chart-group { grid-template-columns: 1fr; }
    .chart-container { height: 350px; }
}