/* Основной контейнер */
.stats-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Шапка */
.stats-header {
    text-align: center;
    margin-bottom: 3rem;
}

.stats-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.stats-subtitle {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 400;
}

/* Сетка карточек */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Карточки статистики */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    color: #4a6cf7;
}

.stat-card h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #718096;
    margin: 0;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0.5rem 0;
    line-height: 1.2;
}

.stat-comparison {
    font-size: 0.875rem;
    color: #718096;
    display: flex;
    align-items: center;
}

.stat-comparison.positive {
    color: #38a169;
}

.stat-comparison.negative {
    color: #e53e3e;
}

.trend-icon {
    margin-right: 0.25rem;
    font-weight: bold;
}

/* Контейнер графика */
.stats-chart-container {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.chart-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.chart-period-selector {
    display: flex;
    background: #edf2f7;
    border-radius: 8px;
    padding: 0.25rem;
}

.chart-period-selector button {
    border: none;
    background: none;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.chart-period-selector button.active {
    background: #fff;
    color: #4a6cf7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* График */
.stats-chart {
    position: relative;
    height: 350px;
    width: 100%;
}

/* Адаптивность */
@media (max-width: 768px) {
    .stats-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .chart-period-selector {
        width: 100%;
    }
    
    .chart-period-selector button {
        flex: 1;
        text-align: center;
    }
}
.stats-chart-container {
    position: relative;
    margin-top: 40px;
}

.stats-chart {
    position: relative;
    height: 350px;
    width: 100%;
}

.chart-error {
    color: #e53e3e;
    text-align: center;
    padding: 20px;
    background: #fff5f5;
    border-radius: 8px;
}

/* Анимация загрузки */
@keyframes chartLoading {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.chart-loading {
    animation: chartLoading 1.5s infinite;
    text-align: center;
    color: #718096;
    padding: 20px;
}