/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #0082C6;
  --primary-dark: #00527D;
  --primary-light:#EBF6FD;
  --accent:       #3397D1;
  --text:         #1a1a1a;
  --text-muted:   #666;
  --border:       #D4E8F4;
  --bg:           #ffffff;
  --bg-alt:       #F0F7FC;
  --sidebar-w:    300px;
  --nav-h:        56px;
  --radius:       6px;
  --shadow:       0 1px 4px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Navigation ────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--primary-dark);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
}
.nav-brand-olt {
  background: var(--accent);
  color: #fff;
  padding: .15rem .5rem;
  border-radius: 3px;
  font-size: .85rem;
  letter-spacing: .05em;
}
.nav-brand-text { color: #fff; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}
.nav-links a {
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  text-decoration: none;
  transition: color .15s;
}
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-user { display: flex; align-items: center; gap: .75rem; color: rgba(255,255,255,.7); font-size: .9rem; }
.nav-links .btn-sm { padding: .3rem .75rem; font-size: .82rem; border-radius: 4px; border: 1.5px solid; text-decoration: none; }
.nav-links .btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.nav-links .btn-outline:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.nav-links .btn-primary { background: #fff; color: var(--primary); border-color: #fff; }
.nav-links .btn-primary:hover { background: rgba(255,255,255,.88); }
.nav-role-badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 20px; }
.nav-role-admin  { background: rgba(255,200,0,.2); color: #ffd700; border: 1px solid rgba(255,200,0,.4); }
.nav-role-student { background: rgba(255,255,255,.15); color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.3); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55rem 1.2rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline   { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-success   { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-success:hover { background: var(--primary); border-color: var(--primary); }
.btn-sm        { padding: .35rem .8rem; font-size: .82rem; }
.btn-lg        { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-full      { width: 100%; }
.btn-link      { background: none; border: none; color: rgba(255,255,255,.75); cursor: pointer; font-size: .9rem; padding: 0; }
.btn-link:hover { color: #fff; }
button:disabled { opacity: .6; cursor: not-allowed; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  padding: 5rem 1.5rem;
  text-align: center;
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero h1 { font-size: 2.5rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.hero-sub { font-size: 1.15rem; opacity: .88; margin-bottom: 2rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero .btn-outline { border-color: rgba(255,255,255,.7); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,.1); }

/* ── Sections ───────────────────────────────────────────────── */
.section { padding: 3.5rem 1.5rem; }
.section-alt { background: var(--bg-alt); }
.section-title { text-align: center; font-size: 1.6rem; margin-bottom: 2rem; color: var(--text); }
.container { max-width: 1200px; margin: 0 auto; }

/* ── Page header ────────────────────────────────────────────── */
.page-header { background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 2rem 1.5rem; }
.page-header .container h1 { font-size: 1.8rem; }
.page-header .container p { color: var(--text-muted); margin-top: .4rem; }

/* ── Course grid ────────────────────────────────────────────── */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.course-grid-full { max-width: 100%; }
.course-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow .15s, border-color .15s;
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
}
.course-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  border-color: var(--accent);
  text-decoration: none;
}
.course-card-img {
  width: 100%;
  height: 160px;
  background-size: cover;
  background-position: center;
  background-color: var(--primary-light);
}
.course-card-body { padding: 1.25rem; }
.course-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; line-height: 1.35; }
.course-desc { font-size: .85rem; color: var(--text-muted); margin-bottom: .75rem; }
.course-card-footer { display: flex; align-items: center; gap: .75rem; margin-top: auto; }
.course-meta { font-size: .78rem; color: var(--text-muted); }
.badge-free {
  font-size: .72rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: .15rem .5rem;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: .03em;
}

/* ── Progress bar ───────────────────────────────────────────── */
.progress-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width .4s ease;
}

/* ── Features ───────────────────────────────────────────────── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.feature { text-align: center; }
.feature-icon { font-size: 2rem; margin-bottom: .75rem; }
.feature h3 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.feature p { font-size: .9rem; color: var(--text-muted); }

/* ── Auth pages ─────────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - var(--nav-h) - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg-alt);
}
.auth-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
}
.auth-box h1 { font-size: 1.5rem; margin-bottom: .4rem; }
.auth-sub { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; }
.auth-switch { text-align: center; font-size: .88rem; color: var(--text-muted); margin-top: 1.25rem; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .35rem; color: var(--text); }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: .6rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  transition: border-color .15s;
}
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,130,198,.12); }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; display: block; }
.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check input { width: auto; }
.form-check label { margin-bottom: 0; font-weight: 400; }
.required { color: #c0392b; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: .9rem; }
.alert-error   { background: #fdf0ef; border: 1px solid #f5c6c2; color: #8b1a14; }
.alert-success { background: var(--primary-light); border: 1px solid #9DD4EE; color: var(--primary-dark); }

/* ── Course player ──────────────────────────────────────────── */
.player-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--nav-h));
}
.player-sidebar {
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: calc(100vh - var(--nav-h));
  position: sticky;
  top: var(--nav-h);
}
.sidebar-course-img {
  width: 100%;
  height: 120px;
  background-size: cover;
  background-position: center;
  background-color: var(--primary-light);
}
.sidebar-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.back-link { font-size: .82rem; color: var(--text-muted); display: block; margin-bottom: .6rem; }
.sidebar-header h2 { font-size: .95rem; font-weight: 700; line-height: 1.35; margin-bottom: .75rem; }
.progress-wrap { display: flex; align-items: center; gap: .5rem; }
.progress-label { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }

.lesson-nav { padding: .5rem 0; }
.chapter { margin-bottom: .25rem; }
.chapter-name {
  padding: .6rem 1.25rem .3rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
.lesson-item {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .55rem 1.25rem;
  font-size: .85rem;
  color: var(--text);
  text-decoration: none;
  transition: background .1s;
  border-left: 3px solid transparent;
}
.lesson-item:hover { background: var(--border); text-decoration: none; }
.lesson-item.active { background: var(--primary-light); border-left-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.lesson-item.done { color: var(--text-muted); }
.lesson-item.done .lesson-icon { color: var(--primary); }
.lesson-icon { font-size: .75rem; margin-top: .15rem; flex-shrink: 0; width: 14px; text-align: center; color: var(--text-muted); }
.lesson-name { line-height: 1.4; }

.player-main {
  padding: 2rem;
  max-width: 900px;
}
.lesson-header h1 { font-size: 1.35rem; margin-bottom: 1.25rem; }

.video-wrap { margin-bottom: 1.25rem; }
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.video-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

.lesson-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.completed-badge { color: var(--primary); font-weight: 700; font-size: .9rem; }

/* ── PDF viewer ─────────────────────────────────────────────── */
.pdf-viewer-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* no overflow:hidden — Chrome's PDF renderer needs the full space */
  box-shadow: var(--shadow);
  background: var(--bg);
}
.pdf-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 1rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.pdf-viewer-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.pdf-viewer-embed {
  width: 100%;
  background: #e8e8e8;
}
.pdf-canvas-viewer {
  width: 100%;
  max-height: 76vh;
  min-height: 480px;
  overflow-y: auto;
  background: #e8e8e8;
  padding: 1rem;
  box-sizing: border-box;
}
.pdf-pages {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: center;
}
.pdf-page-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  background: #fff;
}
.pdf-loading {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}
.pdf-error {
  display: none;
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}

/* Rendered lesson content (html/quiz/survey etc.) */
.lesson-content-body {
  max-width: 720px;
  line-height: 1.75;
  color: var(--text);
}
.lesson-content-body h1,
.lesson-content-body h2,
.lesson-content-body h3 { margin: 1.5rem 0 .6rem; line-height: 1.3; }
.lesson-content-body h2 { font-size: 1.25rem; }
.lesson-content-body h3 { font-size: 1.05rem; }
.lesson-content-body p  { margin-bottom: 1rem; }
.lesson-content-body ul,
.lesson-content-body ol { margin: 0 0 1rem 1.5rem; }
.lesson-content-body li { margin-bottom: .35rem; }
.lesson-content-body strong { font-weight: 700; }
.lesson-content-body em { font-style: italic; }
.lesson-content-body blockquote {
  border-left: 4px solid var(--primary);
  padding: .5rem 1rem;
  margin: 1rem 0;
  background: var(--primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--primary-dark);
}
.lesson-content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .9rem;
}
.lesson-content-body th,
.lesson-content-body td {
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  text-align: left;
}
.lesson-content-body th { background: var(--bg-alt); font-weight: 700; }
.lesson-content-body img { max-width: 100%; border-radius: var(--radius); margin: .5rem 0; }
.lesson-content-body a { color: var(--primary); text-decoration: underline; }

/* Lesson placeholder (content not yet imported) */
.lesson-placeholder {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  max-width: 480px;
}
.lesson-placeholder-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.lesson-placeholder h3 { font-size: 1.1rem; color: var(--text); margin-bottom: .5rem; }
.lesson-placeholder p { font-size: .9rem; }

.no-lesson { color: var(--text-muted); padding: 2rem 0; }

/* Certificate toast */
.cert-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--primary-dark);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  font-size: .95rem;
  z-index: 999;
}
.cert-toast a { color: #7ecdf0; text-decoration: underline; }

/* ── Certificates ───────────────────────────────────────────── */
.cert-verify-page {
  min-height: calc(100vh - var(--nav-h) - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  background: var(--bg-alt);
}
.cert-card {
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0,130,198,.12);
}
.cert-badge {
  width: 64px; height: 64px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}
.cert-card h1 { font-size: 1.35rem; margin-bottom: .75rem; }
.cert-name { font-size: 1.5rem; font-weight: 800; margin-bottom: .3rem; }
.cert-course { font-size: 1rem; color: var(--primary); font-weight: 600; margin-bottom: .75rem; }
.cert-date { color: var(--text-muted); font-size: .9rem; margin-bottom: .3rem; }
.cert-uuid { font-size: .72rem; color: #aaa; margin-bottom: 1.5rem; font-family: monospace; }

.cert-list { display: flex; flex-direction: column; gap: .75rem; }
.cert-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.cert-list-info { display: flex; flex-direction: column; gap: .2rem; }
.cert-date-small { font-size: .82rem; color: var(--text-muted); }
.cert-list-actions { display: flex; gap: .5rem; }

/* ── Admin ──────────────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 200px 1fr; min-height: calc(100vh - var(--nav-h)); }
.admin-nav {
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.admin-nav a {
  display: block;
  padding: .55rem .75rem;
  border-radius: 4px;
  font-size: .9rem;
  color: var(--text);
  text-decoration: none;
}
.admin-nav a:hover { background: var(--border); }
.admin-nav a.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.admin-main { padding: 2rem; }
.admin-main h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-warn { border-color: #e6a817; }
.stat-num { font-size: 2.5rem; font-weight: 800; color: var(--primary); }
.stat-warn .stat-num { color: #c07a00; }
.stat-label { font-size: .82rem; color: var(--text-muted); margin-top: .25rem; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th {
  background: var(--bg-alt);
  text-align: left;
  padding: .6rem .85rem;
  border-bottom: 2px solid var(--border);
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.admin-table td {
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:hover td { background: var(--bg-alt); }
.text-warn { color: #c07a00; font-weight: 600; }

.badge { display: inline-block; padding: .15rem .5rem; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.badge-green { background: var(--primary-light); color: var(--primary-dark); }
.badge-grey  { background: #eee; color: #888; }

/* ── Admin page header ──────────────────────────────────────── */
.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.admin-page-header h1 { margin-bottom: 0; }
.admin-main-wide { max-width: 100%; }

/* ── Course builder ─────────────────────────────────────────── */
.editor-form { max-width: 680px; }
.editor-form textarea {
  width: 100%;
  padding: .6rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: inherit;
  resize: vertical;
}
.editor-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,130,198,.12); }
.editor-form select {
  padding: .6rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  background: var(--bg);
  width: 100%;
}
.form-actions { display: flex; align-items: center; gap: .75rem; margin-top: 1.75rem; flex-wrap: wrap; }
.btn-danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-danger:hover { background: #a93226; border-color: #a93226; }

/* ── Structure editor ───────────────────────────────────────── */
.structure-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.5rem;
  align-items: start;
}
.structure-main { display: flex; flex-direction: column; gap: .75rem; }
.structure-sidebar { position: sticky; top: calc(var(--nav-h) + 1rem); }
.structure-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.structure-panel h3 { font-size: .9rem; margin-bottom: 1rem; }
.structure-panel select {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .88rem;
  background: var(--bg);
}
.summary-dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .75rem; font-size: .85rem; }
.summary-dl dt { color: var(--text-muted); }
.summary-dl dd { font-weight: 600; }

.chapter-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.chapter-block-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.chapter-pos-badge {
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chapter-block-name { font-weight: 700; font-size: .92rem; flex: 1; }
.chapter-block-actions { display: flex; gap: .4rem; }

.lesson-list { padding: .5rem 0; }
.lesson-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.lesson-row:last-of-type { border-bottom: none; }
.lesson-pos-badge {
  font-size: .7rem;
  color: var(--text-muted);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}
.lesson-type-icon { font-size: .75rem; flex-shrink: 0; width: 16px; text-align: center; }
.lesson-row-name { flex: 1; }
.lesson-row-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.vimeo-badge {
  font-size: .7rem;
  padding: .1rem .45rem;
  border-radius: 3px;
  white-space: nowrap;
  font-family: monospace;
}
.vimeo-ok      { background: var(--primary-light); color: var(--primary-dark); }
.vimeo-missing { background: #fef3cd; color: #856404; }
.btn-pick-video { border: 1px dashed #856404; border-radius: 4px; cursor: pointer; font-size: inherit; font-family: inherit; }
.btn-pick-video:hover { background: #fde68a; }

.inline-form {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: .75rem 1rem;
}
.inline-form-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
.inline-form-row input { flex: 1; min-width: 180px; }
.inline-form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 80px;
  gap: .75rem;
}
.inline-form-grid .form-group { margin-bottom: 0; }
.inline-form-grid label { font-size: .78rem; }
.inline-form-grid input,
.inline-form-grid select {
  padding: .4rem .6rem;
  font-size: .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  background: var(--bg);
}

.add-lesson-row { padding: .5rem 1rem; }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state .btn { margin-top: 1rem; }

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.65);
  padding: 1.75rem 1.5rem;
  font-size: .85rem;
}
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: rgba(255,255,255,.65); }
.footer-links a:hover { color: #fff; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .player-layout { grid-template-columns: 1fr; }
  .player-sidebar { position: static; max-height: 300px; }
  .player-main { padding: 1rem; }
  .hero h1 { font-size: 1.75rem; }
  .form-row { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--border); }
  .nav-brand-text { display: none; }
}

/* ── Review panel ───────────────────────────────────────────── */
.player-layout.review-mode {
  grid-template-columns: var(--sidebar-w) 1fr 640px;
}
.review-panel {
  border-left: 1px solid var(--border);
  background: var(--bg);
  max-height: calc(100vh - var(--nav-h));
  position: sticky;
  top: var(--nav-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.review-panel-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 2px solid var(--border);
  background: var(--bg-alt);
  flex-shrink: 0;
}
.review-panel-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .3rem;
}
.review-panel-lesson {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.review-panel-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.review-existing {
  padding: 1.25rem 1.5rem;
  border-bottom: 2px solid var(--border);
}
.review-existing-header {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .85rem;
}
.review-form-section {
  padding: 1.25rem 1.5rem;
}
.review-form {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  margin-top: .75rem;
}
.review-form-row { display: flex; flex-direction: column; }
.review-name-select { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .1rem; }
.review-name-option {
  display: flex; align-items: center; gap: .4rem;
  padding: .4rem .85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .88rem;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background .15s;
}
.review-name-option:hover { border-color: var(--primary); }
.review-name-option input[type="radio"] { accent-color: var(--primary); }
.review-input {
  width: 100%;
  padding: .5rem .75rem;
  font-size: .88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  box-sizing: border-box;
}
.review-input:focus { outline: none; border-color: var(--primary); }
.review-textarea { min-height: 100px; resize: vertical; }
.review-submit { font-size: .88rem; padding: .5rem 1.1rem; }
.review-msg { font-size: .82rem; }
.review-item {
  padding: .85rem 1rem;
  margin-bottom: .6rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.review-item-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
  flex-wrap: wrap;
}
.review-item-meta strong { font-size: .88rem; }
.review-item-time { font-size: .78rem; color: var(--text-muted); margin-left: auto; }
.review-item-comment { font-size: .88rem; line-height: 1.55; color: var(--text); }
.review-empty, .review-loading { font-size: .88rem; color: var(--text-muted); padding: .25rem 0; }
@media (max-width: 1280px) {
  .player-layout.review-mode {
    grid-template-columns: var(--sidebar-w) 1fr;
  }
  .review-panel { display: none; }
}
