* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f4f5f7;
  color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: #2563eb; text-decoration: none; }
a:hover { color: #1d4ed8; }
button { font-family: inherit; cursor: pointer; }
select, input { font-family: inherit; }

.btn {
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #fff; color: #0f172a; border: 1px solid #d7dbe2; }
.btn-secondary:hover { background: #f4f5f7; }
.btn-text { background: transparent; color: #2563eb; border: 0; }
.btn-text:hover { background: #eff4ff; }
.btn:disabled { background: #a8c2f8; cursor: not-allowed; }

.card {
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 12px;
}

.kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  color: #94a3b8;
}

.progress-track {
  height: 8px;
  background: #e8eaee;
  border-radius: 99px;
  position: relative;
}
.progress-fill {
  position: absolute;
  left: 0; top: 0;
  height: 8px;
  border-radius: 99px;
  background: #2563eb;
}

.tag {
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
}
.tag-certified { background: #e7f5ed; color: #1a7f47; }
.tag-progress { background: #eff4ff; color: #1d4ed8; }
.tag-behind { background: #fdecec; color: #b42318; }
.tag-locked { background: #f1f2f5; color: #64748b; }

/* Auth split screen */
.auth-wrap { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); min-height: 100vh; }
.auth-brand { background: #1e293b; color: #fff; padding: 56px 56px 44px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 56px; }
.auth-form { width: 100%; max-width: 340px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0 12px; height: 40px; font-size: 14px; color: #0f172a;
  background: #fff; border: 1px solid #d7dbe2; border-radius: 8px; outline: none; font-family: inherit;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; }
.error-msg { font-size: 13px; color: #b42318; margin: 0 0 14px; }
.info-msg { font-size: 13px; color: #1a7f47; margin: 0 0 14px; }

/* App shell */
.app-shell { display: grid; grid-template-columns: 240px minmax(0,1fr); min-height: 100vh; }
.sidebar { background: #1e293b; color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-nav { padding: 0 16px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a { display: block; padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: #cbd5e1; }
.sidebar-nav a.active { background: #2563eb; color: #fff; }
.sidebar-section-label { padding: 0 20px 8px; font-size: 11px; font-weight: 700; letter-spacing: .09em; color: #64748b; }
.sidebar-divider { margin: 18px 20px; height: 1px; background: #334155; }
main { padding: 28px 36px 72px; }

.skillset-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 14px; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 14px; margin-bottom: 18px; }

.clickable-card { cursor: pointer; }
.clickable-card:hover { border-color: #2563eb; }

.quiz-option {
  display: grid; grid-template-columns: 26px minmax(0,1fr); gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 10px; cursor: pointer; border: 1px solid #e0e3e8; background: #fff;
}
.quiz-option.selected { border-color: #2563eb; background: #f7faff; }
.quiz-option.correct { border-color: #1a7f47; background: #f3faf6; }
.quiz-option.incorrect { border-color: #b42318; background: #fdf5f4; }
.quiz-option.disabled { cursor: default; }
.quiz-mark {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: #f1f2f5; color: #64748b; border: 1px solid #e0e3e8;
}
.quiz-option.selected .quiz-mark { background: #2563eb; color: #fff; border-color: #2563eb; }
.quiz-option.correct .quiz-mark { background: #1a7f47; color: #fff; border-color: #1a7f47; }
.quiz-option.incorrect .quiz-mark { background: #b42318; color: #fff; border-color: #b42318; }

.video-embed { aspect-ratio: 16/9; background: #e8eaee; border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.video-embed iframe { width: 100%; height: 100%; border: 0; }
.video-placeholder { aspect-ratio: 16/9; background: #e8eaee; border-radius: 10px; display: grid; place-items: center; margin-bottom: 8px; text-align: center; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .07em; color: #94a3b8; padding: 12px 22px; border-bottom: 1px solid #eef0f3; }
td { padding: 14px 22px; border-bottom: 1px solid #f1f2f5; }

/* Content editor */
.content-field {
  width: 100%; padding: 8px 12px; font-size: 14px; color: #0f172a; font-family: inherit;
  background: #fff; border: 1px solid #d7dbe2; border-radius: 8px; outline: none; resize: vertical; margin-bottom: 4px;
}

.content-title-input {
  width: 100%; font-size: 17px; font-weight: 700; border: 1px solid transparent; border-radius: 8px;
  padding: 6px 8px; margin: -6px -8px 4px; outline: none;
}
.content-title-input:hover, .content-title-input:focus { border-color: #d7dbe2; background: #fbfbfc; }
.content-blurb-input {
  width: 100%; font-size: 13px; color: #64748b; border: 1px solid transparent; border-radius: 8px;
  padding: 6px 8px; margin: 0 -8px 10px; outline: none; font-family: inherit; resize: vertical;
}
.content-blurb-input:hover, .content-blurb-input:focus { border-color: #d7dbe2; background: #fbfbfc; }

.save-flash { font-size: 12px; font-weight: 600; color: #1a7f47; opacity: 0; transition: opacity .2s; }
.save-flash.show { opacity: 1; }
.save-flash.error { color: #b42318; }

.content-lesson-list { border-top: 1px solid #eef0f3; margin-top: 6px; }
.content-lesson-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 10px 0; border-bottom: 1px solid #f1f2f5;
}
.content-lesson-pos { flex: 0 0 auto; font-size: 12px; color: #94a3b8; }
.content-lesson-title { flex: 1 1 200px; min-width: 160px; font-size: 14px; font-weight: 600; color: #0f172a; }
.content-lesson-title:hover { color: #2563eb; }
.content-lesson-flags { display: flex; gap: 6px; flex: 0 0 auto; }
.content-status {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: #f1f2f5; color: #94a3b8; white-space: nowrap;
}
.content-status.on { background: #eff4ff; color: #1d4ed8; }
.content-lesson-actions { display: flex; gap: 4px; flex: 0 0 auto; margin-left: auto; }
.icon-btn {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid #d7dbe2; background: #fff;
  color: #475569; font-size: 13px; display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: #f4f5f7; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn-danger { color: #b42318; border-color: #f6d5d2; }
.icon-btn-danger:hover { background: #fdf5f4; }

.content-add-lesson { display: flex; gap: 10px; margin-top: 14px; }
.content-add-lesson input {
  flex: 1; height: 36px; padding: 0 12px; font-size: 13px; border: 1px solid #d7dbe2; border-radius: 8px; outline: none;
}

.content-preview {
  border: 1px dashed #d7dbe2; border-radius: 10px; padding: 18px 20px; background: #fbfbfc;
}

/* Shared rendering for lesson body content -- used both on the live lesson
   page and the admin content editor's preview panel, so they always match. */
.lesson-body { font-size: 15px; line-height: 1.65; color: #334155; }
.lesson-body h2 { font-size: 20px; font-weight: 700; color: #0f172a; margin: 28px 0 12px; }
.lesson-body h2:first-child { margin-top: 0; }
.lesson-body h3 { font-size: 16px; font-weight: 700; color: #0f172a; margin: 20px 0 8px; }
.lesson-body p { margin: 0 0 14px; }
.lesson-body ul, .lesson-body ol { margin: 0 0 14px; padding-left: 22px; }
.lesson-body li { margin-bottom: 6px; }
.lesson-body strong { color: #0f172a; }
.lesson-body blockquote {
  background: #eff4ff; border-left: 3px solid #2563eb; border-radius: 0 8px 8px 0;
  padding: 14px 18px; margin: 0 0 18px; color: #1e3a8a; font-style: italic;
}
.lesson-body table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14px; }
.lesson-body th { text-align: left; background: #f4f5f7; font-weight: 700; color: #475569; padding: 10px 14px; border-bottom: 1px solid #e6e8ec; }
.lesson-body td { padding: 10px 14px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.lesson-body table tr:last-child td { border-bottom: 0; }

.content-question textarea, .content-question input[type=text] { width: 100%; margin-bottom: 4px; }
.quiz-edit-options { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.quiz-edit-option { display: flex; align-items: center; gap: 10px; }
.quiz-edit-label { font-size: 12px; font-weight: 700; color: #64748b; width: 14px; }
.quiz-edit-option-text { flex: 1; height: 36px; padding: 0 10px; font-size: 13px; border: 1px solid #d7dbe2; border-radius: 8px; outline: none; }
