/* ── App Training Page ── */
.training-page { min-height: 100%; padding-bottom: var(--space-lg); }

.tr-header-row,
.tr-page-header {
  margin-bottom: var(--space-md);
}

.tr-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.tr-stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.tr-stat-card.is-done { background: linear-gradient(135deg, #f0fdf4, #fff); }
.tr-stat-card.is-progress { background: linear-gradient(135deg, #eff6ff, #fff); }
.tr-stat-card.is-total { background: linear-gradient(135deg, #f5f3ff, #fff); }

.tr-stat-label {
  display: block;
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.tr-stat-value {
  font-family: var(--font-en);
  font-size: var(--text-lg);
  font-weight: 700;
}

.tr-stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: #fff;
}

.tr-stat-icon svg { width: 24px; height: 24px; color: #2563eb; }

.tr-progress-card {
  margin-bottom: var(--space-lg);
}

.tr-title-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-left: 4px solid #2563eb;
  padding-left: var(--space-sm);
}

.tr-title-wrap .page-title-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
}

.tr-title-wrap .page-title-back:hover {
  background: #eff6ff;
  color: #2563eb;
}

.tr-title-wrap .page-title-back svg { width: 20px; height: 20px; }

.tr-progress-card {
  min-width: 200px;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  border-top: 3px solid #2563eb;
  box-shadow: var(--shadow-sm);
}

.tr-progress-label {
  display: block;
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.tr-progress-bar-wrap {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.tr-progress-bar {
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
  transition: width 0.3s ease;
  width: 0;
}

.tr-progress-value {
  font-family: var(--font-en);
  font-size: var(--text-md);
  font-weight: 700;
  color: #2563eb;
}

.tr-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-lg);
}

.tr-categories { display: flex; flex-direction: column; gap: var(--space-md); }

.tr-category {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.tr-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: none;
  background: #eff6ff;
  font-family: var(--font-bn);
  font-size: var(--text-md);
  font-weight: 700;
  color: #1d4ed8;
  cursor: pointer;
  text-align: left;
}

.tr-category-head:hover { background: #dbeafe; }

.tr-category-meta {
  font-family: var(--font-en);
  font-size: var(--text-sm);
  font-weight: 600;
  color: #2563eb;
}

.tr-category-head svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.tr-category.is-open .tr-category-head svg { transform: rotate(180deg); }

.tr-lessons {
  display: none;
  padding: 0 var(--space-lg) var(--space-md);
}

.tr-category.is-open .tr-lessons { display: block; }

.tr-lesson {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.tr-lesson:last-child { border-bottom: none; }

.tr-lesson-check {
  flex-shrink: 0;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.tr-lesson-body { flex: 1; min-width: 0; }

.tr-lesson-title {
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 4px;
}

.tr-lesson.is-done .tr-lesson-title {
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.tr-lesson-text {
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.tr-lesson-link {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}

.tr-lesson-link:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .tr-stats-grid { grid-template-columns: 1fr; }
  .tr-progress-card { width: 100%; min-width: 0; }
  .tr-category-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .tr-category-meta {
    margin-left: auto;
  }
  .tr-quick-links {
    gap: 10px;
  }
  .tr-lesson {
    flex-direction: column;
    gap: var(--space-sm);
  }
  .tr-lesson-check {
    width: 22px;
    height: 22px;
  }
  .tr-title-wrap .page-title-back {
    width: var(--touch-min);
    height: var(--touch-min);
  }
}
