:root {
    --primary-color: #000000;
    --secondary-color: #000000;
    --accent-color: #27ae60;
    --success-color: #27ae60;
    --warning-color: #27ae60;
    --info-color: #27ae60;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #2c3e50;
    --border-color: #bdc3c7;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

/* Header mejorado */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    border-bottom: 3px solid var(--accent-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dashboard-header h1 {
    font-weight: 300;
    font-size: 1.8rem;
    margin: 0;
}

.dashboard-header .fas {
    color: var(--accent-color);
    margin-right: 10px;
}

/* Panel de filtros mejorado */
.filters-panel {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.filters-panel .form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.filters-panel .form-control,
.filters-panel .form-select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.filters-panel .form-control:focus,
.filters-panel .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.1);
}

/* Botón mejorado */
.btn-primary {
    background: linear-gradient(135deg, #000000 0%, #000000 100%);
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* Contenedor principal */
.container-fluid {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Grid de resumen mejorado */
.resumen-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Cards de resumen específicas */
.summary-card {
    border-left: 4px solid;
    transition: all 0.3s ease;
    height: 100%;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.summary-card.bg-primary {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #27ae60 0%, #27ae60 100%) !important;
}

.summary-card.bg-success {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%) !important;
}

.summary-card.bg-warning {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #27ae60 0%, #27ae60 100%) !important;
}

.summary-card.bg-info {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #27ae60 0%, #27ae60 100%) !important;
}

.summary-card .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .card-text {
    font-size: 2rem;
    font-weight: 300;
    margin: 0;
    line-height: 1.2;
}

.summary-card .card-subtext {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* Gráficos */
/* Gráficos - Tamaño mejorado */
.chart-container {
    position: relative;
    height: 500px; /* Aumentado de 400px a 500px */
    width: 100%;
    margin: 0 auto;
}

.chart-card .card-body {
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100%;
}

/* Canvas del gráfico más grande */
#chartCombinado {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
}

/* Card del gráfico más alta */
.chart-card {
    min-height: 600px; /* Altura mínima para la card */
}

/* Quitar limitaciones de tamaño */
.chart-wrapper {
    width: 100%;
    height: 100%;
}

/* Asegurar que Chart.js use todo el espacio */
canvas#chartCombinado {
    width: 100% !important;
    height: 100% !important;
}

/* Cards generales */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-bottom: none;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

/* Tabs mejorados */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-color);
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border-color: var(--border-color);
    background-color: var(--light-color);
}

.nav-tabs .nav-link.active {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: transparent;
}

.tab-content {
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

/* Tablas mejoradas */
.table {
    margin-bottom: 0;
}

.table th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
}

.table td {
    padding: 0.75rem 1rem;
    border-color: var(--border-color);
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(236, 240, 241, 0.5);
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

/* Loading spinner */
#loading {
    background-color: rgba(255, 255, 255, 0.95);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Alertas mejoradas */
.alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
    padding: 1rem 1.5rem;
}

.alert-danger {
    background-color: #fdeded;
    border-left-color: #e74c3c;
    color: #c0392b;
}

/* Grid de resumen compacto */
.resumen-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Cards de resumen compactas */
.summary-card {
    border-left: 4px solid;
    transition: all 0.3s ease;
    height: 100%;
    min-height: 100px; /* Reducido de 120px a 100px */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.summary-card.bg-primary {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #27ae60; 0%, #27ae60 100%) !important;
}

.summary-card.bg-success {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #27ae60 0%, #27ae60 100%) !important;
}

.summary-card.bg-warning {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #27ae60 0%, #27ae60 100%) !important;
}

.summary-card.bg-info {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #27ae60 0%, #27ae60 100%) !important;
}

.summary-card .card-body {
    padding: 1rem 1.25rem; /* Reducido el padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-card .card-title {
    font-size: 0.8rem; /* Reducido de 0.9rem */
    font-weight: 600;
    margin-bottom: 0.25rem; /* Reducido el margen */
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .card-text {
    font-size: 1.5rem; /* Reducido de 2rem */
    font-weight: 300;
    margin: 0;
    line-height: 1.2;
}

.summary-card .card-subtext {
    font-size: 0.7rem; /* Reducido de 0.8rem */
    opacity: 0.8;
    margin-top: 0.1rem; /* Reducido el margen */
}

/* Cards generales más compactas */
.card {
    border: none;
    border-radius: 8px; /* Reducido de 10px */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); /* Sombra más sutil */
    transition: all 0.3s ease;
    margin-bottom: 1rem; /* Reducido de 1.5rem */
    overflow: hidden;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-bottom: none;
    padding: 0.75rem 1rem; /* Reducido el padding */
    font-weight: 600;
}

.card-header h5 {
    margin: 0;
    font-size: 0.9rem; /* Reducido de 1rem */
    font-weight: 600;
}

/* Reducir también el gráfico para mantener proporción */
.chart-container {
    position: relative;
    height: 350px; /* Reducido de 400px */
    width: 100%;
    margin: 0 auto;
}

.chart-card .card-body {
    padding: 1.5rem; /* Reducido de 2rem */
}

.chart-card {
    min-height: 450px; /* Reducido de 600px */
}

/* Responsive para cards compactas */
@media (max-width: 1200px) {
    .resumen-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    .resumen-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .summary-card {
        min-height: 90px;
    }
    
    .summary-card .card-body {
        padding: 0.75rem 1rem;
    }
    
    .summary-card .card-text {
        font-size: 1.25rem;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .chart-card {
        min-height: 400px;
    }
}

@media (max-width: 576px) {
    .summary-card {
        min-height: 80px;
    }
    
    .summary-card .card-body {
        padding: 0.5rem 0.75rem;
    }
    
    .summary-card .card-title {
        font-size: 0.75rem;
    }
    
    .summary-card .card-text {
        font-size: 1.1rem;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .chart-card {
        min-height: 350px;
    }
}

/* Utilidades adicionales */
.text-muted {
    color: #7f8c8d !important;
}

.border-light {
    border-color: var(--border-color) !important;
}

.shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

/* Asegurar que el contenido no se salga */
.row {
    margin-left: 0;
    margin-right: 0;
}

.col, .col-1, .col-10, .col-11, .col-12, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-auto, .col-lg, .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-auto, .col-md, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-auto, .col-sm, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-auto, .col-xl, .col-xl-1, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-auto {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Header con Logo */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    border-bottom: 3px solid var(--accent-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    min-height: 80px;
}

/* Logo */
.logo-img {
    height: 50px; /* Ajusta según el tamaño de tu logo */
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Hace el logo blanco */
}

/* Alternativa si quieres mantener los colores originales del logo */
.logo-img.color {
    filter: none;
}

/* Divisor entre logo y título */
.header-divider {
    width: 2px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 1rem;
}

/* Título del header */
.dashboard-header h1 {
    font-weight: 300;
    font-size: 1.8rem;
    margin: 0;
    color: white;
}

.dashboard-header .fas {
    color: var(--accent-color);
    margin-right: 10px;
}

/* Responsive para header con logo */
@media (max-width: 768px) {
    .dashboard-header {
        min-height: 70px;
        padding: 1rem !important;
    }
    
    .logo-img {
        height: 40px;
        max-width: 150px;
    }
    
    .dashboard-header h1 {
        font-size: 1.4rem;
    }
    
    .header-divider {
        height: 30px;
        margin: 0 0.75rem;
    }
}

@media (max-width: 576px) {
    .dashboard-header {
        flex-direction: column;
        text-align: center;
        min-height: auto;
        padding: 1rem !important;
    }
    
    .dashboard-header .col-auto {
        margin-bottom: 0.5rem;
    }
    
    .header-divider {
        display: none;
    }
    
    .logo-img {
        height: 35px;
        max-width: 120px;
    }
    
    .dashboard-header h1 {
        font-size: 1.2rem;
    }
}