/* ============================================================
   Экран статистики
   ============================================================ */

.page-head.with-back {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}

.stat-card-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card-icon-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.stat-card-val {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent-text);
  line-height: 1.1;
}

.stat-card-lab {
  font-size: .82rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

.stat-card-sub {
  font-size: .72rem;
  margin-top: 2px;
}

.stats-section { margin-bottom: var(--sp-5); }
.stats-hint { margin: 0 0 var(--sp-3); font-size: .82rem; }

/* --- Бары --- */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding-top: var(--sp-2);
}

.chart-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  height: 100%;
}

.chart-bar {
  width: 100%;
  max-width: 22px;
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar-fill {
  width: 100%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--r-1);
  min-height: 0;
  transition: height var(--dur) var(--ease);
}

.chart-bar-fill.accent {
  background: var(--accent);
}

.chart-xlabel {
  font-size: .62rem;
  color: var(--ink-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
}

/* --- Кольцо удержания (SVG) -------------------------- */
.retention-ring-wrap {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.retention-ring {
  display: block;
}
.retention-ring-fill {
  transition: stroke-dashoffset .6s var(--ease);
}
.retention-ring-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  fill: var(--ink);
}
.retention-ring-label {
  font-size: 11px;
  fill: var(--ink-soft);
  font-weight: 600;
}

/* --- Распределение оценок ---------------------------- */
.grade-dist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: var(--sp-2);
}
.grade-dist-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.grade-dist-label {
  font-size: var(--fs-micro);
  font-weight: 700;
  color: var(--ink-soft);
  min-width: 36px;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
}
.grade-dist-track {
  flex: 1;
  height: 8px;
  background: var(--bg-sunken);
  border-radius: var(--r-1);
  overflow: hidden;
}
.grade-dist-fill {
  height: 100%;
  border-radius: var(--r-1);
  transition: width .4s var(--ease);
  min-width: 0;
}
.grade-dist-count {
  font-size: var(--fs-micro);
  font-weight: 700;
  color: var(--ink-soft);
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Папки --- */
.stats-folders { display: flex; flex-direction: column; gap: 2px; }

.stats-folder-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
}

.stats-folder-row:nth-child(odd) { background: var(--bg-sunken); }
.stats-folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-folder-num { color: var(--ink-soft); min-width: 42px; text-align: right; }
.stats-folder-ret { color: var(--ok-text); min-width: 48px; text-align: right; }

.stats-open-btn { margin-top: var(--sp-3); }
