/**
 * Dashboard Styles Enhanced
 * Estilos premium para el dashboard CPO
 */

/* === VARIABLES === */
:root {
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-danger: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-dark: linear-gradient(135deg, #434343 0%, #000000 100%);
    
    --shadow-card: 0 10px 40px rgba(0,0,0,0.1);
    --shadow-card-hover: 0 20px 60px rgba(0,0,0,0.15);
    --shadow-glow-primary: 0 0 30px rgba(102, 126, 234, 0.4);
    --shadow-glow-success: 0 0 30px rgba(56, 239, 125, 0.4);
    --shadow-glow-danger: 0 0 30px rgba(235, 51, 73, 0.4);
}

/* === DASHBOARD GRID === */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* === STAT CARDS PREMIUM === */
.stat-card {
    background: white;
    border-radius: 20px;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-card);
    border: none;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 20px 20px 0 0;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-card-hover);
}

.stat-card .label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.stat-card .value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Outfit', sans-serif;
    line-height: 1.2;
}

.stat-card .trend {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: #f1f5f9;
}

.stat-card .trend.positive {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.stat-card .trend.negative {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

/* Card Variants */
.stat-card.card-primary::before { background: var(--gradient-primary); }
.stat-card.card-success::before { background: var(--gradient-success); }
.stat-card.card-danger::before { background: var(--gradient-danger); }
.stat-card.card-warning::before { background: var(--gradient-warning); }
.stat-card.card-info::before { background: var(--gradient-info); }

/* Big Number Cards */
.stat-card.big-number {
    text-align: center;
    padding: 2.5rem;
}

.stat-card.big-number .value {
    font-size: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Utility Card */
.stat-card.utility-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #bbf7d0;
}

.stat-card.utility-card.negative {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #fecaca;
}

/* === INSIGHTS PANEL === */
.insights-panel {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #fde68a;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.15);
}

.insights-panel h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    color: #92400e;
    margin-bottom: 1rem;
}

.insight-card {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.insight-card:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.insight-card.type-danger { border-left-color: #ef4444; background: linear-gradient(90deg, #fef2f2 0%, white 30%); }
.insight-card.type-warning { border-left-color: #f59e0b; background: linear-gradient(90deg, #fffbeb 0%, white 30%); }
.insight-card.type-success { border-left-color: #22c55e; background: linear-gradient(90deg, #f0fdf4 0%, white 30%); }
.insight-card.type-info { border-left-color: #3b82f6; background: linear-gradient(90deg, #eff6ff 0%, white 30%); }

/* === CHART CARDS === */
.chart-card {
    background: white;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.chart-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-card h3 i {
    color: #6366f1;
}

/* === QUICK TABLES === */
.quick-table {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.quick-table:hover {
    box-shadow: var(--shadow-card-hover);
}

.quick-table h3 {
    padding: 1.25rem 1.5rem;
    margin: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-table table {
    width: 100%;
    border-collapse: collapse;
}

.quick-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8fafc;
}

.quick-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.quick-table tr:last-child td {
    border-bottom: none;
}

.quick-table tr:hover td {
    background: linear-gradient(90deg, #f8fafc 0%, transparent 100%);
}

/* === REPORTS NAV === */
.reports-nav {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.reports-nav .report-tab {
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    border: none;
    background: white;
    color: #64748b;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.reports-nav .report-tab:hover {
    background: #e0e7ff;
    color: #4338ca;
    transform: translateY(-2px);
}

.reports-nav .report-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow-primary);
}

.reports-nav .report-tab i {
    font-size: 1.1rem;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.2); }
    50% { box-shadow: 0 0 40px rgba(102, 126, 234, 0.4); }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

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

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* === PROGRESS BARS === */
.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.progress-bar .fill.success { background: var(--gradient-success); }
.progress-bar .fill.danger { background: var(--gradient-danger); }
.progress-bar .fill.primary { background: var(--gradient-primary); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card .value {
        font-size: 1.75rem;
    }
    
    .reports-nav {
        flex-direction: column;
    }
    
    .reports-nav .report-tab {
        justify-content: center;
    }
}
