/* ================================================
   ESTILOS MODERNOS PARA DASHBOARD PRINCIPAL
   ================================================ */

/* Header del Dashboard */
.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.dashboard-header h1 {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.dashboard-header p {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    margin: 0;
}

/* KPI Cards Modernos */
.modern-kpi-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 25px;
    border: none;
}

.modern-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--card-color), transparent);
}

.modern-kpi-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.modern-kpi-card .kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--card-color) 0%, var(--card-color-dark) 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.modern-kpi-card .kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 10px 0;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.modern-kpi-card .kpi-label {
    font-size: 14px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.modern-kpi-card .kpi-trend {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.modern-kpi-card .kpi-trend.down {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* Colores para cada KPI */
.kpi-card-blue {
    --card-color: #3498db;
    --card-color-dark: #2980b9;
}

.kpi-card-green {
    --card-color: #2ecc71;
    --card-color-dark: #27ae60;
}

.kpi-card-orange {
    --card-color: #f39c12;
    --card-color-dark: #e67e22;
}

.kpi-card-red {
    --card-color: #e74c3c;
    --card-color-dark: #c0392b;
}

.kpi-card-purple {
    --card-color: #9b59b6;
    --card-color-dark: #8e44ad;
}

.kpi-card-teal {
    --card-color: #1abc9c;
    --card-color-dark: #16a085;
}

/* Chart Cards */
.chart-card-modern {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.chart-card-modern:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.chart-card-modern .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.chart-card-modern .chart-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.chart-card-modern .chart-subtitle {
    font-size: 13px;
    color: #95a5a6;
    margin: 5px 0 0 0;
}

.chart-card-modern .chart-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.chart-card-modern .chart-body {
    position: relative;
    padding: 15px 0;
}

.chart-card-modern canvas {
    max-height: 300px;
}

/* Lista de leyendas personalizada */
.chart-legend-custom {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.chart-legend-custom li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.chart-legend-custom li:last-child {
    border-bottom: none;
}

.chart-legend-custom li:hover {
    background: #f8f9fa;
    padding-left: 10px;
    border-radius: 8px;
}

.chart-legend-custom .legend-item-left {
    display: flex;
    align-items: center;
}

.chart-legend-custom .legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 10px;
}

.chart-legend-custom .legend-label {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

.chart-legend-custom .legend-value {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 600;
}

/* Loading Spinner */
.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.chart-loading .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1200px) {
    .modern-kpi-card .kpi-value {
        font-size: clamp(16px, 2vw, 28px);
    }
}

@media (max-width: 992px) {
    .modern-kpi-card .kpi-value {
        font-size: clamp(18px, 3vw, 32px);
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 20px;
    }
    
    .dashboard-header h1 {
        font-size: 24px;
    }
    
    .modern-kpi-card {
        margin-bottom: 15px;
    }
    
    .modern-kpi-card .kpi-value {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .modern-kpi-card .kpi-value {
        font-size: 22px;
    }
    
    .modern-kpi-card .kpi-label {
        font-size: 12px;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modern-kpi-card,
.chart-card-modern {
    animation: fadeInUp 0.5s ease-out;
}

.modern-kpi-card:nth-child(1) { animation-delay: 0.1s; }
.modern-kpi-card:nth-child(2) { animation-delay: 0.2s; }
.modern-kpi-card:nth-child(3) { animation-delay: 0.3s; }
.modern-kpi-card:nth-child(4) { animation-delay: 0.4s; }
.modern-kpi-card:nth-child(5) { animation-delay: 0.5s; }
.modern-kpi-card:nth-child(6) { animation-delay: 0.6s; }

/* Empty State */
.chart-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
}

.chart-empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.chart-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* Badge de alerta */
.alert-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e74c3c;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* Stats Mini */
.stats-mini {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.stats-mini-item {
    flex: 1;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
}

.stats-mini-item .value {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    display: block;
}

.stats-mini-item .label {
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

/* Dashboard Header */
.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    animation: fadeInDown 0.6s ease-out;
}

.dashboard-title {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.dashboard-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    margin: 0;
}

/* Chart Empty State */
.chart-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.chart-empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.chart-empty-state p {
    font-size: 16px;
    margin: 0;
}
