/* === DASHBOARD.CSS ===
   assets/css/dashboard.css
   НАЗНАЧЕНИЕ: Стили Dashboard - метрики, графики, фильтры периодов
   РАЗМЕР: ~150 строк */

/* -- Header -- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.dashboard-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* -- Period Filter -- */
.period-filter {
    display: flex;
    gap: 6px;
}
.period-btn {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-family: var(--font-sans);
    transition: var(--transition);
}
.period-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}
.period-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* -- Metrics Grid -- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}
.metric-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}
.metric-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}
.metric-card.skeleton {
    opacity: 0.5;
}
.metric-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-bg);
    border-radius: var(--radius-sm);
    color: var(--color-primary);
}
.metric-icon svg {
    width: 18px;
    height: 18px;
}
.metric-info {
    flex: 1;
    min-width: 0;
}
.metric-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    line-height: 1.2;
}
.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* -- Charts -- */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.chart-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    max-height: 350px;
    position: relative;
}
.chart-container canvas {
    max-height: 300px !important;
}
.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* -- Onboarding -- */
.dashboard-onboarding {
    grid-column: 1 / -1;
    background: var(--card-bg);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}
.dashboard-onboarding h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}
.dashboard-onboarding ol {
    text-align: left;
    display: inline-block;
    margin-top: 10px;
}
.dashboard-onboarding li {
    margin-bottom: 6px;
}
.dashboard-onboarding a {
    color: var(--color-primary);
    text-decoration: underline;
}

/* -- Responsive -- */
@media (max-width: 900px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .charts-row {
        grid-template-columns: 1fr;
    }
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* -- Reduced motion -- */
@media (prefers-reduced-motion: reduce) {
    .metric-card,
    .period-btn {
        transition: none;
    }
}
