/* ════════════ TRAININGS PAGE ════════════ */

/* ── Stats bar ── */
.training-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 768px) { .training-stats { grid-template-columns: repeat(2, 1fr); } }

.training-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
}
.training-stat--accent { border-color: var(--accent); background: var(--accent-glow); }
.training-stat__value  { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.training-stat--accent .training-stat__value { color: var(--accent); }
.training-stat__label  { font-size: .75rem; color: var(--muted); font-weight: 500; }

/* ── Section ── */
.training-section { margin-bottom: 28px; }
.training-section__title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}

/* ════════════ TEAM TRACK CARDS ════════════ */

.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
@media (max-width: 640px) { .track-grid { grid-template-columns: 1fr; } }

.track-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--track-color, var(--accent));
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .15s, box-shadow .15s;
}
.track-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.track-card__icon {
  font-size: 2rem;
  line-height: 1;
}
.track-card__name {
  font-size: .95rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
}
.track-card__desc {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.5;
}
.track-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .75rem;
  color: var(--muted);
}
.track-card__progress {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 2px;
}
.track-card__progress-bar {
  height: 100%;
  background: var(--track-color, var(--accent));
  border-radius: 99px;
  transition: width .4s ease;
}
.track-card__pct { font-size: .72rem; color: var(--muted); }
.track-card__action { margin-top: auto; }

.track-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}
.track-badge--approved { background: rgba(34,197,94,.12); color: #22c55e; }
.track-badge--pending  { background: rgba(245,158,11,.12); color: #f59e0b; }
.track-badge--none     { background: rgba(100,116,139,.12); color: #64748b; }

/* ════════════ TRACK VIEW ════════════ */

.track-view-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.track-view-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.track-view-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.track-view-name { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.track-view-sub  { font-size: .75rem; color: var(--muted); margin-top: 2px; }

/* ── Level headers ── */
.level-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.level-badge {
  font-size: .78rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 99px;
}
.level-badge--unlocked { background: var(--accent-glow); color: var(--accent); border: 1px solid var(--accent); }
.level-badge--locked   { background: rgba(100,116,139,.1); color: #64748b; border: 1px dashed #64748b; }
.level-badge--passed   { background: rgba(34,197,94,.12); color: #22c55e; border: 1px solid #22c55e; }

/* Level quiz prompt / result banners */
.level-quiz-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 10px;
}
.level-quiz-prompt__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: .84rem;
  color: var(--text);
}
.level-quiz-prompt__text strong { color: var(--accent); }
.level-quiz-prompt__text span   { color: var(--muted); font-size: .78rem; }

.level-quiz-done {
  background: rgba(34,197,94,.08);
  border: 1px solid #22c55e;
  color: #22c55e;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .84rem;
  font-weight: 600;
  margin-top: 10px;
}
.level-quiz-failed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(239,68,68,.07);
  border: 1px solid #ef4444;
  color: #ef4444;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .84rem;
  font-weight: 600;
  margin-top: 10px;
}
.level-quiz-locked-note {
  font-size: .78rem;
  color: var(--muted);
  background: rgba(255,255,255,.03);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 10px;
  text-align: center;
}
.quiz-score--pass { color: #22c55e; font-weight: 700; }
.quiz-score--fail { color: #ef4444; font-weight: 700; }
.level-progress  { font-size: .75rem; color: var(--muted); }
.level-lock-note { font-size: .72rem; color: #f59e0b; background: rgba(245,158,11,.1); padding: 2px 8px; border-radius: 99px; }

.training-list--locked { opacity: .6; pointer-events: none; }
.training-thumb--blurred { filter: blur(4px); }

/* ════════════ ADMIN ACCESS PANEL ════════════ */

.access-panel {
  background: var(--surface);
  border: 1px solid #f59e0b;
  border-left: 3px solid #f59e0b;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.access-panel__title {
  font-size: .85rem;
  font-weight: 800;
  color: #f59e0b;
}
.access-panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.access-panel__info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--text);
}
.access-panel__time { font-size: .72rem; color: var(--muted); }
.access-panel__self-tag {
  font-size: .68rem;
  font-weight: 800;
  background: var(--accent-glow);
  color: var(--accent);
  padding: 1px 7px;
  border-radius: 99px;
}

/* ── List container ── */
.training-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ════════════ ASSIGNMENT CARDS ════════════ */

.assign-card { border-left: 3px solid #f59e0b; }

.assign-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: rgba(245,158,11,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.assign-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}
.assign-badge--approved { background: rgba(34,197,94,.12); color: #22c55e; }
.assign-badge--review   { background: rgba(245,158,11,.12); color: #f59e0b; }
.assign-badge--rejected { background: rgba(239,68,68,.1);  color: #ef4444; }
.assign-badge--pending  { background: rgba(100,116,139,.1); color: #94a3b8; }

.assign-desc {
  font-size: .84rem;
  color: var(--text);
  line-height: 1.7;
  background: rgba(245,158,11,.05);
  border-left: 3px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
}

.assign-submit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.assign-submit-label {
  font-size: .78rem;
  color: var(--muted);
}
.assign-submit-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.assign-url-input {
  flex: 1;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: .84rem;
  outline: none;
}
.assign-url-input:focus { border-color: var(--accent); }

.assign-submitted {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(245,158,11,.06);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: 10px;
  padding: 14px 16px;
}
.assign-submitted--approved { background: rgba(34,197,94,.06); border-color: rgba(34,197,94,.3); }
.assign-submitted--rejected { background: rgba(239,68,68,.06); border-color: rgba(239,68,68,.3); }
.assign-submitted__icon { font-size: 1.4rem; flex-shrink: 0; }
.assign-submitted__title { font-size: .88rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.assign-submitted__note  { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.assign-feedback { font-size: .78rem; color: #ef4444; margin-top: 6px; background: rgba(239,68,68,.08); padding: 6px 10px; border-radius: 6px; }
.assign-link { font-size: .78rem; color: var(--accent); text-decoration: none; }
.assign-link:hover { text-decoration: underline; }

/* ── Google Drive submission steps ── */
.assign-drive-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: rgba(99,102,241,.05);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.assign-drive-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .82rem;
  color: var(--text);
  line-height: 1.5;
}
.assign-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Feedback display ── */
.assign-feedback-box {
  margin-top: 10px;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.assign-feedback-box--approved { background: rgba(34,197,94,.07); border: 1px solid rgba(34,197,94,.2); }
.assign-feedback-box--rejected { background: rgba(239,68,68,.07); border: 1px solid rgba(239,68,68,.2); }
.assign-feedback-box__title { font-size: .75rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.assign-feedback-point {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .82rem;
  color: var(--text);
  line-height: 1.5;
}
.assign-point-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-subs-title { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.admin-sub-pts { padding: 6px 0; display: flex; flex-direction: column; gap: 3px; }

/* ── Review Modal ── */
.review-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 32px 80px rgba(0,0,0,.5);
}
.review-box__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.review-box__title { font-size: 1rem; font-weight: 800; color: var(--text); }
.review-box__sub   { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.review-box__body  { padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }

.review-instructions {
  font-size: .84rem;
  color: var(--muted);
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
}

.review-points { display: flex; flex-direction: column; gap: 10px; }
.review-point-row { display: flex; align-items: center; gap: 10px; }
.review-point-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.review-decision__label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.review-eval-btn { font-size: .84rem; padding: 10px 18px; }

.admin-subs-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.admin-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-wrap: wrap;
}
.admin-sub-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .82rem;
}

/* ── Card row ── */
.training-card-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .15s;
}
.training-card-row:hover { box-shadow: var(--shadow-lg); }
.training-card-row--done {
  border-left: 3px solid #22c55e;
}

/* ── Card header ── */
.training-card-row__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  gap: 12px;
  user-select: none;
}
.training-card-row__header:hover { background: rgba(255,255,255,.03); }

.training-card-row__left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.training-card-row__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Thumbnail ── */
.training-thumb {
  width: 80px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--surface-2, #1e2030);
}
.training-thumb--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--surface-2, #1e2030);
  border: 1px solid var(--border);
}

/* ── Card info ── */
.training-card-row__info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.training-card-row__title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.training-card-row__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.training-card-row__done {
  font-size: .7rem;
  color: #22c55e;
  font-weight: 600;
}

/* ── Progress bar (compact, inside card header) ── */
.training-progress-bar-wrap {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  width: 100%;
  max-width: 260px;
}
.training-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .4s ease;
}

.assign-day-tag {
  font-size: .68rem;
  font-weight: 800;
  background: rgba(99,102,241,.12);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 99px;
}
.assign-time-tag {
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255,255,255,.05);
  padding: 2px 7px;
  border-radius: 99px;
}
.training-watched-label {
  font-size: .68rem;
  color: var(--accent);
  font-weight: 600;
}

/* ── Badges ── */
.training-type-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: capitalize;
}
.training-done-badge {
  font-size: .68rem;
  font-weight: 700;
  color: #22c55e;
  background: rgba(34,197,94,.12);
  padding: 2px 8px;
  border-radius: 99px;
}

/* ── Delete button ── */
.training-delete-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.training-delete-btn:hover { color: #ef4444; background: rgba(239,68,68,.1); }

/* ── Chevron ── */
.training-chevron {
  color: var(--muted);
  transition: transform .2s ease;
  flex-shrink: 0;
}
.training-chevron--open {
  transform: rotate(180deg);
}

/* ════ EXPAND PANEL ════ */
.training-expand-panel {
  border-top: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(0,0,0,.12);
}

.training-expand-desc {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.training-expand-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
  align-items: center;
}

.yt-complete-locked {
  font-size: .8rem;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.yt-lock-icon { font-size: .95rem; }

/* ════ YOUTUBE PLAYER ════ */
.yt-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  /* Establish a new stacking context so our overlays sit above the iframe */
  isolation: isolate;
}
.yt-player-wrap iframe,
.yt-player-wrap > div:first-child {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* ── Overlay blockers: stop YouTube logo, More Videos, info cards ── */

/* Click-to-play overlay — centre of video only, leaves ALL controls free */
.yt-block-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: 64px;         /* leave full YouTube control bar (including fullscreen, speed) */
  z-index: 20;
  cursor: pointer;
  background: transparent;
  /* Don't block right side where settings gear / fullscreen icon sit */
  right: 20%;
}

/* Bottom-right: hidden — don't block settings, speed, fullscreen */
.yt-block-br {
  display: none;
}

/* Top-right: info cards only */
.yt-block-tr {
  position: absolute;
  top: 0; right: 0;
  width: 80px;
  height: 40px;
  z-index: 21;
  background: transparent;
  pointer-events: all;
}

/* ── End screen (replaces iframe entirely — no YouTube end cards) ── */
.yt-end-screen {
  position: absolute;
  inset: 0;
  background: #0f1117;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  border-radius: 8px;
}
.yt-end-screen__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  box-shadow: 0 0 24px rgba(34,197,94,.4);
}
.yt-end-screen__title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}
.yt-end-screen__sub {
  font-size: .82rem;
  color: rgba(255,255,255,.5);
}
.yt-end-screen__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

/* ── YT Progress bar ── */
.yt-progress-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.yt-progress-bar-outer {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.yt-progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #818cf8);
  border-radius: 99px;
  transition: width .5s linear;
  box-shadow: 0 0 8px rgba(99,102,241,.4);
}

.yt-progress-label {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── AI Section ── */
.yt-ai-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.yt-ai-output {
  min-height: 0;
}

.yt-ai-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  color: var(--muted);
  padding: 14px 0;
}

.yt-ai-notice {
  font-size: .82rem;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}

.yt-ai-error {
  font-size: .82rem;
  color: #ef4444;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 8px;
  padding: 12px 16px;
}

.yt-ai-result {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 10px;
  overflow: hidden;
}
.yt-ai-result__header {
  background: var(--accent-glow);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  padding: 10px 16px;
  border-bottom: 1px solid var(--accent);
}
.yt-ai-result__body {
  padding: 14px 16px;
  font-size: .84rem;
  color: var(--text);
  line-height: 1.7;
}

/* ════════════ QUIZ MODAL ════════════ */

.quiz-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.quiz-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 32px 80px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.quiz-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}
.quiz-header__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.quiz-header__sub {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 3px;
}
.quiz-answered-count {
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

.quiz-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  flex: 1;
}

.quiz-question__num {
  font-size: .7rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.quiz-question__text {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 12px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.quiz-option:hover { border-color: var(--accent); background: var(--accent-glow); }
.quiz-option--selected { border-color: var(--accent); background: var(--accent-glow); }
.quiz-option--correct  { border-color: #22c55e !important; background: rgba(34,197,94,.1) !important; }
.quiz-option--wrong    { border-color: #ef4444 !important; background: rgba(239,68,68,.08) !important; }

.quiz-option__letter {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
}
.quiz-option--selected .quiz-option__letter { background: var(--accent); color: #fff; }
.quiz-option--correct  .quiz-option__letter { background: #22c55e; color: #fff; }
.quiz-option--wrong    .quiz-option__letter { background: #ef4444; color: #fff; }

.quiz-option__text {
  font-size: .84rem;
  color: var(--text);
  line-height: 1.4;
}

.quiz-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.quiz-footer__note {
  font-size: .78rem;
  color: var(--muted);
}
.quiz-score {
  font-size: .85rem;
  font-weight: 700;
  color: #22c55e;
}

/* ── Add modal ── */
#add-training-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#add-training-modal.active { display: flex; }

.add-training-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
}
.add-training-box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.add-training-box__header h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.add-training-box__body  { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.add-training-box__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Empty / loading ── */
.training-empty, .training-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.training-empty p { margin: 0; font-size: .95rem; }
.training-empty small { font-size: .78rem; opacity: .7; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .training-thumb { width: 60px; height: 40px; }
  .training-card-row__title { font-size: .88rem; }
  .training-expand-panel { padding: 14px; }
}

/* ════════════ DRIVE FOLDER BUTTON ════════════ */

.drive-folder-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a73e820;
  color: #1a73e8;
  border: 1px solid #1a73e840;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: .84rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s;
}
.drive-folder-btn:hover { background: #1a73e830; }
.drive-subfolder-hint {
  font-size: .75rem;
  color: var(--muted);
  background: rgba(255,255,255,.03);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 6px;
}

/* ════════════ BADGES BAR ════════════ */

.badges-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.badges-bar__title { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.badges-bar__list  { display: flex; gap: 8px; flex-wrap: wrap; }

.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: color-mix(in srgb, var(--badge-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--badge-color) 30%, transparent);
  color: var(--badge-color);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: .75rem;
  font-weight: 700;
  cursor: default;
}
.badge-chip__icon  { font-size: .95rem; }
.badge-chip__label { }

/* ════════════ TRANSFORMATION MODAL ════════════ */

.transform-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(8px);
  z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.transform-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 40px 100px rgba(0,0,0,.6);
  overflow: hidden;
}
.transform-header {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.transform-title { font-size: 1.2rem; font-weight: 800; color: #fff; }
.transform-sub   { font-size: .82rem; color: rgba(255,255,255,.7); margin-top: 4px; }
.transform-body  { padding: 20px; display: flex; flex-direction: column; gap: 16px; max-height: 60vh; overflow-y: auto; }

.transform-level { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.transform-level__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.transform-level__badge { font-size: .75rem; font-weight: 800; background: var(--accent-glow); color: var(--accent); border: 1px solid var(--accent); padding: 3px 10px; border-radius: 99px; }
.transform-level__score { font-size: .75rem; color: #22c55e; font-weight: 700; }
.transform-level__items { display: flex; flex-direction: column; gap: 6px; }
.transform-item { font-size: .82rem; color: var(--text); display: flex; align-items: center; gap: 8px; }
.transform-item--video  { color: var(--muted); }
.transform-item--assign { color: var(--text); }
.transform-link { font-size: .75rem; color: var(--accent); text-decoration: none; margin-left: auto; }
.transform-badges { border-top: 1px solid var(--border); padding-top: 14px; }
.transform-badges__title { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ════════════ ADMIN PANEL MODAL ════════════ */

.apanel-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  z-index: 1050;
  display: flex; align-items: stretch; justify-content: flex-end;
  padding: 0;
}
.apanel-box {
  background: var(--surface);
  border-left: 1px solid var(--border);
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.apanel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.apanel-tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.apanel-tab {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-size: .8rem; font-weight: 600;
  padding: 6px 14px; cursor: pointer; transition: all .15s;
}
.apanel-tab--active { background: var(--accent-glow); color: var(--accent); border-color: var(--accent); }
.apanel-body { flex: 1; overflow-y: auto; padding: 20px; }

.apanel-subs { display: flex; flex-direction: column; gap: 12px; }
.apanel-sub-card { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.apanel-sub-top  { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.apanel-sub-user { font-size: .9rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.apanel-sub-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ════════════ LEARNER DASHBOARD ════════════ */

.learner-dashboard { display: flex; flex-direction: column; gap: 16px; }
.learner-stats-bar {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 12px;
}
.learner-stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; text-align: center;
}
.learner-stat strong { display: block; font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.learner-stat span   { font-size: .72rem; color: var(--muted); }

.learner-table { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.learner-table__head {
  display: grid;
  grid-template-columns: 2fr 1.5fr 100px 60px 100px 80px 90px;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255,255,255,.04);
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.learner-table__row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 100px 60px 100px 80px 90px;
  gap: 8px;
  padding: 12px 16px;
  align-items: center;
  border-top: 1px solid var(--border);
  font-size: .82rem;
}
.learner-table__row:hover { background: rgba(255,255,255,.02); }
.learner-name { display: flex; align-items: center; gap: 10px; }
.learner-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-glow); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .82rem; flex-shrink: 0;
}
.learner-levels { display: flex; gap: 4px; }
.learner-lvl {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 800;
  background: rgba(100,116,139,.15); color: #64748b;
}
.learner-lvl--done { background: rgba(34,197,94,.15); color: #22c55e; }

/* ════════════ AI REVIEW SUGGESTIONS ════════════ */

.ai-review-suggestions { margin-top: 8px; }
.ai-suggestions-box {
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-suggestions-box__title { font-size: .72rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.ai-suggestion-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .82rem; color: var(--text);
  cursor: pointer; padding: 6px 8px; border-radius: 6px;
  transition: background .15s;
}
.ai-suggestion-item:hover { background: rgba(99,102,241,.1); }

/* ════════════ QUIZ MOBILE ════════════ */
@media (max-width: 768px) {
  .quiz-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .quiz-box {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }
  .quiz-body {
    padding: 16px;
    gap: 16px;
  }
  .quiz-header {
    padding: 16px;
  }
  .quiz-footer {
    padding: 12px 16px;
  }
  .quiz-option {
    padding: 12px 14px;
  }
}

/* ══════════════════════════════════════════
   Canva Design School Section
   ══════════════════════════════════════════ */
.canva-school-section {
  margin-top: 36px;
  background: linear-gradient(135deg, #7c3aed08 0%, #06b6d408 100%);
  border: 1.5px solid color-mix(in srgb, #7c3aed 20%, transparent);
  border-radius: 16px;
  padding: 24px;
}
.canva-school-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 10px;
}
.canva-school-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}
.canva-school-sub {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.canva-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.canva-course-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s, border-color .15s, box-shadow .15s;
  cursor: pointer;
}
.canva-course-card:hover {
  transform: translateY(-2px);
  border-color: #7c3aed55;
  box-shadow: 0 6px 20px #7c3aed15;
}
.canva-course-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.canva-course-badge {
  font-size: .72rem;
  font-weight: 700;
  background: #7c3aed18;
  color: #7c3aed;
  border-radius: 20px;
  padding: 2px 9px;
}
.canva-course-duration {
  font-size: .72rem;
  color: var(--muted);
}
.canva-course-card__title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.canva-course-card__desc {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}
.canva-course-card__cta {
  font-size: .78rem;
  font-weight: 700;
  color: #7c3aed;
  margin-top: 4px;
}
@media (max-width: 600px) {
  .canva-courses-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .canva-courses-grid { grid-template-columns: 1fr; }
}
