/* ============================================================
   Система тестирования kritika24.ru
   ============================================================ */

/* ── Layout плеера ─────────────────────────────────────────── */

.test-layout-body {
  background: #f8fafc;
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
}

.test-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  height: 56px;
}

.test-header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.test-header-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  flex-shrink: 0;
}

.test-header-site {
  font-weight: 700;
  font-size: 16px;
  color: #1e293b;
}

.test-header-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.test-header-qnum {
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
}

.test-header-bar {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.test-header-bar-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.test-header-timer {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  flex-shrink: 0;
}

.test-header-timer.timer-warning {
  color: #dc2626;
}

.test-main {
  min-height: calc(100vh - 56px);
}

/* ── Экраны плеера ─────────────────────────────────────────── */

.test-player {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.test-screen { }

/* Стартовый экран */
.test-start-card {
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 40px 40px 36px;
  text-align: center;
}

.test-start-badge {
  display: inline-block;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.test-start-title {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 12px;
  line-height: 1.25;
}

.test-start-desc {
  color: #64748b;
  font-size: 15px;
  margin: 0 0 24px;
  line-height: 1.6;
}

.test-start-meta {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.test-start-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #475569;
}

.test-start-meta-item svg {
  color: #2563eb;
}

.test-start-retry-note {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: #92400e;
  margin-bottom: 20px;
  text-align: left;
}

.test-start-best {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 20px;
}

.test-start-best strong {
  color: #2563eb;
}

/* Ссылка на рейтинг на стартовом экране */
.test-start-leaderboard-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  font-size: 14px;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s;
}
.test-start-leaderboard-link:hover {
  color: #2563eb;
}

/* Ссылка на рейтинг в карточке каталога */
.test-card-rating-link {
  color: #2563eb;
  cursor: pointer;
  transition: color 0.15s;
}
.test-card-rating-link:hover {
  color: #1d4ed8;
}

.test-start-continue {
  margin-bottom: 8px;
}

.test-start-continue p {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 12px;
}

/* Экран вопроса */
.test-question-wrap {
  max-width: 680px;
  margin: 0 auto;
}

.test-question-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 20px;
}

.test-question-num {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 12px;
}

.test-question-text {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Варианты ответов */
.test-question-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* single_choice / multiple_choice */
.test-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  background: #fafafa;
  font-size: 15px;
  color: #1e293b;
  user-select: none;
}

.test-option:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.test-option.selected {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 500;
}

.test-option-indicator {
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.test-option.selected .test-option-indicator {
  background: #2563eb;
  border-color: #2563eb;
}

.test-option.selected .test-option-indicator::after {
  content: '';
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  display: block;
}

/* multiple_choice — квадратный индикатор */
.test-option.multi .test-option-indicator {
  border-radius: 5px;
}

.test-option.multi.selected .test-option-indicator::after {
  content: '';
  width: 10px;
  height: 8px;
  background: none;
  border: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* text_input */
.test-text-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: #1e293b;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.test-text-input:focus {
  outline: none;
  border-color: #2563eb;
}

/* gap_fill */
.test-gap-text {
  font-size: 16px;
  line-height: 2;
  color: #1e293b;
}

.test-gap-input {
  display: inline-block;
  width: 120px;
  padding: 2px 8px;
  border: none;
  border-bottom: 2px solid #2563eb;
  font-size: 16px;
  font-family: inherit;
  color: #1d4ed8;
  font-weight: 600;
  background: none;
  text-align: center;
  outline: none;
  vertical-align: middle;
}

/* matching */
.test-matching-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.test-matching-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.test-matching-left {
  min-width: 160px;
  font-weight: 500;
  color: #1e293b;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 8px;
  flex-shrink: 0;
}

.test-matching-arrow {
  color: #94a3b8;
  flex-shrink: 0;
}

.test-matching-select {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s;
}

.test-matching-select:focus {
  outline: none;
  border-color: #2563eb;
}

/* ordering */
.test-ordering-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.test-ordering-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: grab;
  transition: all 0.15s;
  user-select: none;
}

.test-ordering-item:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.test-ordering-item.dragging {
  opacity: 0.5;
  border-color: #2563eb;
}

.test-ordering-item.dragover {
  border-color: #2563eb;
  background: #eff6ff;
}

.test-ordering-handle {
  color: #94a3b8;
  flex-shrink: 0;
}

/* Подсказка */
.test-question-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 20px;
  padding: 10px 14px;
  background: #f0f9ff;
  border-radius: 8px;
  font-size: 13px;
  color: #0369a1;
}

/* Подсветка правильного/неправильного ответа */
.test-option--correct {
  border-color: #22c55e !important;
  background: #f0fdf4 !important;
}
.test-option--correct .test-option-indicator {
  border-color: #22c55e !important;
  background: #22c55e !important;
}
.test-option--wrong {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}
.test-option--wrong .test-option-indicator {
  border-color: #ef4444 !important;
  background: #ef4444 !important;
}

/* Навигация */
.test-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* Пагинация-кружочки */
.test-dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.test-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.test-dot.answered {
  background: #22c55e;
}

.test-dot.current {
  background: #2563eb;
  width: 12px;
  height: 12px;
}

.test-dot.skipped {
  background: #f87171;
}

/* Loading */
.test-screen--loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.test-loading-inner {
  text-align: center;
  color: #64748b;
}

.test-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Герой каталога тестов ─────────────────────────────────── */

.tests-hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  text-align: center;
}

.tests-hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.tests-hero h1 {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.2;
}

.tests-hero-desc {
  font-size: 17px;
  color: var(--text-secondary);
  margin: 0;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Каталог тестов ────────────────────────────────────────── */

.tests-catalog {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 24px 60px;
}

.tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.test-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  transition: all var(--transition);
}

.test-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: inherit;
}

.test-card--done {
  border-color: #bbf7d0;
}
.test-card--done:hover {
  border-color: #22c55e;
}

/* Иконка типа теста */
.test-card-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tc-icon--blue   { background: var(--primary-light); color: var(--primary); }
.tc-icon--red    { background: #fee2e2; color: #dc2626; }
.tc-icon--purple { background: #ede9fe; color: #7c3aed; }
.tc-icon--gray   { background: #f1f5f9; color: #64748b; }

.test-card-body {
  flex: 1;
  min-width: 0;
}

.test-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.test-card-best {
  font-size: 13px;
  font-weight: 700;
  color: #16a34a;
  display: flex;
  align-items: center;
  gap: 4px;
}

.test-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.3;
}

.test-card-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.test-card-meta {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  font-size: 13px;
  color: #94a3b8;
}

.test-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.test-card-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.test-card-progress-bar {
  height: 100%;
  background: #22c55e;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.tests-empty {
  text-align: center;
  padding: 80px 20px;
  color: #94a3b8;
}
.tests-empty p {
  margin-top: 16px;
  font-size: 16px;
}

/* ── Адаптив каталога ─────────────────────────────────────── */
@media (max-width: 768px) {
  .tests-hero {
    padding: 32px 16px 20px;
  }
  .tests-hero h1 {
    font-size: 26px;
  }
  .tests-hero-desc {
    font-size: 15px;
  }
  .tests-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }
  .tests-hero-icon svg {
    width: 32px;
    height: 32px;
  }
  .tests-catalog {
    padding: 4px 16px 40px;
  }
  .tests-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .test-card {
    padding: 18px;
    gap: 14px;
  }
  .test-card-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
  }
  .test-card-icon svg {
    width: 18px;
    height: 18px;
  }
}

/* ── Результаты ────────────────────────────────────────────── */

.test-result-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.test-result-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  margin-bottom: 32px;
}

.test-result-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.test-result-icon--pass { background: #dcfce7; color: #16a34a; }
.test-result-icon--fail { background: #fee2e2; color: #dc2626; }

.test-result-score {
  font-size: 56px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 8px;
}

.test-result-status {
  font-size: 20px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 28px;
}

.test-result-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.test-result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.test-result-stat-val {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
}

.test-result-stat-label {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
}

.test-result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Разбор ответов */
.test-result-review h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}

.test-review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.test-review-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}

.test-review-item--correct { border-left: 4px solid #22c55e; }
.test-review-item--wrong   { border-left: 4px solid #ef4444; }

.test-review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.test-review-num {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

.test-review-result {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  margin-left: auto;
}

.test-review-question {
  font-size: 15px;
  font-weight: 500;
  color: #1e293b;
  margin: 0 0 12px;
}

.test-review-options {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 14px;
  color: #475569;
}

.review-opt--correct-chosen  { background: #dcfce7; color: #166534; }
.review-opt--wrong-chosen     { background: #fee2e2; color: #991b1b; }
.review-opt--correct-missed   { background: #f0fdf4; border: 1px dashed #86efac; color: #15803d; }

.test-review-user-answer {
  font-size: 14px;
  color: #475569;
  margin: 0 0 8px;
}

.test-review-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  color: #64748b;
  font-style: italic;
}

/* ── Лидерборд ─────────────────────────────────────────────── */

.test-leaderboard-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.test-lb-back {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.test-lb-header {
  text-align: center;
  margin-bottom: 28px;
}

.test-lb-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
}

.test-lb-subtitle {
  font-size: 15px;
  color: #64748b;
  margin: 0;
}

.test-lb-myrank {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.test-lb-myrank-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.test-lb-myrank-pos {
  font-size: 32px;
  font-weight: 900;
  color: #1d4ed8;
}

.test-lb-myrank-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  font-weight: 600;
}

.test-lb-myrank-score {
  font-size: 14px;
  color: #1e293b;
}

.test-lb-empty {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.test-lb-table-wrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

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

.test-lb-th-rank  { width: 60px; }
.test-lb-th-score { width: 160px; }

.test-lb-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #94a3b8;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.test-lb-row td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.test-lb-row:last-child td { border-bottom: none; }
.test-lb-row--top td { background: #fefce8; }
.test-lb-row--me td  { background: #eff6ff; }

.test-lb-td-rank { text-align: center; }
.test-lb-medal   { font-size: 20px; }
.test-lb-ranknum { font-weight: 600; color: #64748b; }

.test-lb-username {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 500;
}

.test-lb-username:hover { text-decoration: underline; }
.test-lb-anon { color: #94a3b8; }

.test-lb-score-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-lb-score-val {
  font-weight: 700;
  color: #0f172a;
  min-width: 38px;
}

.test-lb-score-bar {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.test-lb-score-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 3px;
}

/* ── Конструктор (Admin) ───────────────────────────────────── */

/* Шапка */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-header h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  color: #1e293b;
  line-height: 1.3;
}

/* Формы конструктора */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.form-control:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 60px;
}

.tests-admin-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .tests-admin-layout {
    grid-template-columns: 1fr;
  }
}

.tests-admin-settings {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  position: sticky;
  top: 20px;
}

.tests-admin-settings h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 20px;
}

.tests-admin-questions {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  min-height: 300px;
}

.tests-admin-questions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.tests-admin-questions-header h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.questions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.questions-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}

/* Карточка вопроса (в конструкторе) */
.question-row {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fafafa;
  padding: 16px;
  cursor: move;
  transition: all 0.15s;
}

.question-row:hover {
  border-color: #93c5fd;
  background: #fff;
}

.question-row.dragging {
  opacity: 0.5;
  border-color: #2563eb;
}

.question-row-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.question-row-num {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  min-width: 24px;
}

.question-row-type {
  font-size: 11px;
  padding: 2px 8px;
  background: #e2e8f0;
  border-radius: 20px;
  color: #475569;
}

.question-row-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.question-row-text {
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
  margin-bottom: 10px;
  line-height: 1.4;
  max-height: 4.2em; /* ~3 строки */
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.question-row-text.expanded {
  max-height: none;
}

/* Индикатор обрезки */
.question-row-text:not(.expanded)::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 1.4em;
  background: linear-gradient(transparent, #fafafa);
  pointer-events: none;
}

.question-row:hover .question-row-text:not(.expanded)::after {
  background: linear-gradient(transparent, #fff);
}

.question-row-hint {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
  margin-bottom: 8px;
  padding: 4px 8px;
  background: #f0f9ff;
  border-radius: 4px;
}

.question-row-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.question-row-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  color: #475569;
}

.question-row-option.correct {
  color: #16a34a;
  background: #f0fdf4;
}

/* Кнопки */
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-success {
  background: #16a34a;
  color: #fff;
  border: 2px solid transparent;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-success:hover {
  background: #15803d;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
  border-radius: 10px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-green  { background: #dcfce7; color: #166534; }
.badge-blue   { background: #eff6ff; color: #1d4ed8; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #f3e8ff; color: #7c3aed; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* form helpers */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-control--sm {
  padding: 6px 10px;
  font-size: 13px;
  height: 34px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #475569;
  cursor: pointer;
}

.form-check input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Admin stats cards */
.admin-stats-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.admin-stat-card {
  flex: 1;
  min-width: 100px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.admin-stat-val {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
}

.admin-stat-label {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.admin-section {
  margin-top: 32px;
}

.admin-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 600px) {
  .test-start-card { padding: 28px 20px 24px; }
  .test-question-card { padding: 20px 16px; }
  .test-question-text { font-size: 16px; }
  .test-result-card { padding: 28px 16px; }
  .test-result-score { font-size: 42px; }
  .tests-catalog-header h1 { font-size: 24px; }
}
