:root {
  --bg: #0e0e14;
  --bg2: #16161f;
  --bg3: #1e1e2e;
  --accent: #c8a96e;
  --accent2: #e8c98e;
  --text: #e8e6e1;
  --text2: #a09890;
  --complete: #4caf7d;
  --progress: #c8a96e;
  --radius: 10px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; line-height: 1.6; min-height: 100vh; }

/* NAV */
nav { background: var(--bg2); border-bottom: 1px solid #2a2a3a; padding: 0 2rem; display: flex; align-items: center; gap: 2rem; height: 60px; position: sticky; top: 0; z-index: 100; }
nav .brand { font-size: 1.1rem; font-weight: 700; color: var(--accent); text-decoration: none; letter-spacing: .04em; }
nav .brand span { color: var(--text2); font-weight: 400; }
.nav-search { flex: 1; max-width: 400px; display: flex; }
.nav-search input { width: 100%; padding: .4rem .9rem; background: var(--bg3); border: 1px solid #2a2a3a; border-radius: 20px; color: var(--text); font-size: .9rem; outline: none; }
.nav-search input:focus { border-color: var(--accent); }
.nav-links a { color: var(--text2); text-decoration: none; font-size: .9rem; }
.nav-links a:hover { color: var(--accent); }

/* MAIN */
main { max-width: 1280px; margin: 0 auto; padding: 2rem; }

/* PAGE HEADER */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.8rem; color: var(--accent); font-weight: 600; }
.page-header p { color: var(--text2); margin-top: .3rem; }

/* FILTER BAR */
.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 2rem; align-items: center; }
.filter-bar .pill { padding: .35rem .9rem; border-radius: 20px; border: 1px solid #2a2a3a; background: var(--bg2); color: var(--text2); text-decoration: none; font-size: .85rem; cursor: pointer; transition: all .15s; }
.filter-bar .pill:hover, .filter-bar .pill.active { border-color: var(--accent); color: var(--accent); }
.filter-bar .sep { color: #2a2a3a; }
select.sort-select { padding: .35rem .8rem; background: var(--bg2); border: 1px solid #2a2a3a; color: var(--text2); border-radius: 20px; font-size: .85rem; cursor: pointer; }
select.sort-select:focus { border-color: var(--accent); outline: none; }

/* COURSE GRID */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.course-card { background: var(--bg2); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); border: 1px solid #1e1e2e; transition: transform .2s, border-color .2s; display: flex; flex-direction: column; }
.course-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.course-card .thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg3); display: block; }
.course-card .card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.course-card h3 { font-size: .95rem; font-weight: 600; line-height: 1.4; }
.course-card .meta { color: var(--text2); font-size: .8rem; }
.progress-bar-wrap { background: #2a2a3a; border-radius: 4px; height: 4px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 4px; background: var(--accent); transition: width .3s; }
.status-badge { font-size: .75rem; padding: .2rem .6rem; border-radius: 10px; font-weight: 600; display: inline-block; }
.status-complete { background: rgba(76,175,125,.15); color: var(--complete); }
.status-in_progress { background: rgba(200,169,110,.12); color: var(--accent); }
.status-not_started { background: rgba(160,152,144,.1); color: var(--text2); }

/* COURSE PAGE */
.course-hero { display: flex; gap: 2rem; margin-bottom: 2.5rem; flex-wrap: wrap; }
.course-hero img { width: 300px; border-radius: var(--radius); object-fit: cover; flex-shrink: 0; }
.course-hero-info { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: .8rem; }
.course-hero-info h1 { font-size: 1.6rem; color: var(--accent); }
.big-progress { display: flex; align-items: center; gap: 1rem; }
.big-progress .pct { font-size: 1.4rem; font-weight: 700; color: var(--accent); min-width: 3.5rem; }
.big-progress .bar-wrap { flex: 1; background: #2a2a3a; border-radius: 6px; height: 8px; overflow: hidden; }
.big-progress .bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg,var(--accent),var(--accent2)); }
.last-activity { color: var(--text2); font-size: .85rem; }

/* LESSON LIST */
.section-group { margin-bottom: 1.5rem; }
.section-label { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text2); padding: .5rem 0; border-bottom: 1px solid #2a2a3a; margin-bottom: .5rem; }
.lesson-row { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: 8px; text-decoration: none; color: var(--text); transition: background .15s; }
.lesson-row:hover { background: var(--bg3); }
.lesson-row.complete .check { color: var(--complete); }
.check { width: 18px; height: 18px; flex-shrink: 0; color: #2a2a3a; }
.lesson-row .l-title { flex: 1; font-size: .9rem; }
.lesson-row .l-meta { font-size: .78rem; color: var(--text2); }

/* LESSON PAGE */
.lesson-layout { display: grid; grid-template-columns: 1fr 280px; gap: 2rem; align-items: start; }
@media(max-width:900px){ .lesson-layout { grid-template-columns: 1fr; } }
.lesson-main { min-width: 0; }
.lesson-sidebar { position: sticky; top: 72px; background: var(--bg2); border-radius: var(--radius); padding: 1rem; border: 1px solid #1e1e2e; max-height: calc(100vh - 90px); overflow-y: auto; }
.lesson-sidebar h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text2); margin-bottom: .75rem; }

/* VIDEO */
.video-wrap { position: relative; padding-top: 56.25%; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.video-wrap iframe, .video-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

/* AUDIO */
.audio-section { margin-bottom: 1.5rem; }
.audio-section h3 { font-size: .9rem; color: var(--text2); margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
audio { width: 100%; border-radius: 6px; accent-color: var(--accent); }
audio + audio { margin-top: .5rem; }

/* LESSON CONTENT */
.lesson-content { line-height: 1.8; color: var(--text); }
.lesson-content h1,.lesson-content h2,.lesson-content h3 { color: var(--accent); margin: 1.2rem 0 .5rem; }
.lesson-content p { margin-bottom: .8rem; }
.lesson-content a { color: var(--accent); }

/* FILES */
.file-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.5rem; }
.file-link { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; background: var(--bg3); border-radius: 8px; text-decoration: none; color: var(--text); font-size: .88rem; border: 1px solid #2a2a3a; transition: border-color .15s; }
.file-link:hover { border-color: var(--accent); }
.file-icon { font-size: 1.1rem; }

/* NAV FOOTER */
.lesson-nav { display: flex; justify-content: space-between; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #2a2a3a; }
.lesson-nav a { display: flex; align-items: center; gap: .5rem; padding: .6rem 1.2rem; background: var(--bg2); border: 1px solid #2a2a3a; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .9rem; transition: border-color .15s; }
.lesson-nav a:hover { border-color: var(--accent); }
.lesson-nav .spacer { flex: 1; }

/* SEARCH */
.search-results { display: flex; flex-direction: column; gap: .75rem; margin-top: 1.5rem; }
.result-item { padding: .9rem 1.1rem; background: var(--bg2); border-radius: 8px; border: 1px solid #1e1e2e; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: .25rem; transition: border-color .15s; }
.result-item:hover { border-color: var(--accent); }
.result-item .r-type { font-size: .75rem; text-transform: uppercase; color: var(--text2); letter-spacing: .08em; }
.result-item .r-title { font-size: .95rem; font-weight: 600; }
.result-item .r-sub { font-size: .82rem; color: var(--text2); }

/* BREADCRUMB */
.breadcrumb { font-size: .82rem; color: var(--text2); margin-bottom: 1.2rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
