/* =====================================================================
   Mộc Việt Academy — hệ thống giao diện
   Màu chủ đạo: xanh lá Mộc Việt (lấy từ biểu tượng chiếc lá của thương hiệu) và trắng.
   Chữ: một họ Be Vietnam Pro, thiết kế riêng cho tiếng Việt.
   Có hai chế độ: sáng (mặc định) và tối — chỉ khác nhau ở các biến màu bên dưới.
   ===================================================================== */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6faf3;
  --tint: #eaf5e2;
  --line: #e3eadf;
  --line-2: #cfe3c3;
  --input-line: #cdd9c7;
  --ink: #142012;
  --muted: #5d6a58;
  --brand: #3d9f17;        /* xanh lá Mộc Việt (theo logo) */
  --brand-2: #7ccf12;      /* xanh lá non — dùng trong dải chuyển màu */
  --accent: #2c8212;       /* nút và liên kết: xanh đậm hơn để chữ trắng đủ rõ */
  --accent-hover: #236b0e;
  --on-accent: #ffffff;
  --deep: #10300c;         /* chân trang, thẻ giảng viên */
  --deep-ink: #ffffff;
  --topbar: rgba(255, 255, 255, .94);
  --hero: linear-gradient(180deg, #f1f9eb 0%, #ffffff 100%);
  --warn-bg: #fbf4e1; --warn-ink: #84600f; --warn-line: #efdcaa;
  --err-bg: #fbece8; --err-ink: #a8321f; --err-line: #f0c6be;
  --overlay: rgba(12, 28, 10, .5);
  --shadow-c: rgba(22, 60, 14, .22);
  --photo-bg: #8e96a2;
  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-xl: 22px;
  --sans: "Be Vietnam Pro", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b110a;
  --surface: #121b11;
  --surface-2: #0f170e;
  --tint: #1a2a16;
  --line: #233220;
  --line-2: #2e4a27;
  --input-line: #314330;
  --ink: #e6eee3;
  --muted: #9fb299;
  --brand: #6cbf3a;
  --brand-2: #93d763;
  --accent: #6cbf3a;
  --accent-hover: #82d151;
  --on-accent: #07110a;
  --deep: #0f170e;
  --deep-ink: #e6eee3;
  --topbar: rgba(11, 17, 10, .9);
  --hero: linear-gradient(180deg, #13230f 0%, #0b110a 100%);
  --warn-bg: #2a2410; --warn-ink: #f0cf7d; --warn-line: #4a3f1a;
  --err-bg: #2c1511; --err-ink: #f4a397; --err-line: #53241d;
  --overlay: rgba(0, 0, 0, .65);
  --shadow-c: rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------- Nền tảng ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
html, body { overflow-x: clip; }
body { margin: 0; font-family: var(--sans); font-size: 1rem; line-height: 1.65; color: var(--ink); background: var(--bg); font-kerning: normal; transition: background-color .2s, color .2s; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 1rem; } /* 16px: iPhone không tự phóng to khi gõ */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.02em; line-height: 1.22; margin: 0 0 .5em; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); }
h3 { font-size: 1.2rem; line-height: 1.32; letter-spacing: -.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
.boot { padding: 40vh 20px; text-align: center; color: var(--muted); }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 860px; }
.muted { color: var(--muted); }
.small, .hint, .s { font-size: max(.8125rem, 13px); }
.hint { color: var(--muted); margin: 0; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.kicker { font-size: .875rem; font-weight: 600; color: var(--accent); margin: 0 0 6px; }
.lead { font-size: clamp(1.03rem, .98rem + .25vw, 1.15rem); line-height: 1.7; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: var(--r);
  border: 1px solid transparent; font-weight: 600; font-size: .97rem; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn svg { flex: 0 0 auto; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px -12px var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: var(--surface); color: var(--accent); border-color: var(--line-2); }
.btn-outline:hover { border-color: var(--accent); background: var(--surface-2); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-danger { background: var(--surface); color: var(--err-ink); border-color: var(--err-line); }
.btn-light, .btn-white { background: #fff; color: #10300c; }
.btn-light:hover, .btn-white:hover { background: #eef6e9; }
.btn-line { background: transparent; color: inherit; border-color: currentColor; }
.btn-line:hover { background: rgba(127, 127, 127, .1); }
.btn-lg { min-height: 52px; padding: 12px 24px; font-size: 1.02rem; }
.btn-sm { min-height: 36px; padding: 6px 13px; font-size: .86rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-publish-cta { min-height: 52px; padding: 12px 22px; font-size: 1rem; }

/* ---------- Đầu trang ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--topbar); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); line-height: 1.15; }
.brand .brand-logo { height: 42px; width: 42px; object-fit: contain; flex: 0 0 auto; }
@media (max-width: 800px) { .brand .brand-logo { height: 36px; width: 36px; } }
.brand > span { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.brand .brand-sub { display: block; font-size: .74rem; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.brand-mark { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand-2), #1f7f10); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--ink); padding: 8px 12px; font-weight: 500; font-size: .96rem; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--accent); }
.nav a.active { color: var(--accent); border-bottom-color: var(--brand); }
.user-chip { display: flex; align-items: center; gap: 8px; }
.theme-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.acc-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: .93rem; padding: 4px 10px 4px 4px; border-radius: 99px; border: 1px solid var(--line); }
.acc-link:hover { border-color: var(--accent); }
.acc-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.tabbar { display: none; }
@media (max-width: 800px) {
  .nav, .desk-only { display: none !important; }
  .topbar .wrap { justify-content: space-between; min-height: 60px; gap: 10px; }
  .brand > span { font-size: 1.1rem; }
  .brand .brand-sub { display: none; }
  .acc-link { border: 0; padding: 0; }
  .user-chip .uname { display: none; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -8px 24px -16px var(--shadow-c); }
  .tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 2px 7px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--accent); }
  #toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }
  .sticky-actions { bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* ---------- Trang chủ: phần mở đầu ---------- */
.hero { background: var(--hero); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 40px; padding-top: 40px; padding-bottom: 48px; }
.hero h1 { max-width: 13em; font-size: clamp(2.2rem, 1.3rem + 3.6vw, 3.6rem); margin-bottom: 18px; }
.hero .lead { color: var(--muted); max-width: 52ch; margin-bottom: 26px; }
.hero-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-2); color: var(--accent); font-size: .88rem; font-weight: 600; margin: 0 0 20px; }
.hero-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(75, 162, 28, .18); }
.hero-actions .btn { flex: 1 1 220px; }
.hero-stats { display: flex; margin: 28px 0 0; padding: 0; }
.hero-stats div { display: grid; padding: 0 24px; border-left: 1px solid var(--line); }
.hero-stats div:first-child { padding-left: 0; border-left: 0; }
.hero-stats dt { order: 2; font-size: .86rem; color: var(--muted); }
.hero-stats dd { order: 1; margin: 0; font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hero-visual { position: relative; padding-bottom: 8px; }
.hero-portrait { position: relative; margin: 0 auto; width: min(100%, 420px); aspect-ratio: 4 / 4.6; border-radius: 28px; overflow: hidden; background: var(--photo-bg); box-shadow: 0 30px 60px -30px var(--shadow-c); }
.hero-portrait::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); pointer-events: none; }
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; }
.portrait-tag { position: absolute; right: 14px; top: 14px; display: grid; padding: 8px 14px; border-radius: 12px; background: rgba(255, 255, 255, .95); color: #142012; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .3); }
.portrait-tag b { font-size: .95rem; }
.portrait-tag span { font-size: .78rem; color: #5d6a58; }
.frame { text-decoration: none; color: var(--ink); }
.latest-card { position: relative; z-index: 2; margin: -70px 12px 0; display: grid; gap: 8px; padding: 18px 20px; background: var(--surface); border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 24px 48px -24px var(--shadow-c); }
.latest-card:hover { border-color: var(--line-2); }
.lc-top { display: flex; align-items: center; gap: 10px; }
.frame-badge { background: var(--tint); color: var(--accent); font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.play-disc { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 6px rgba(75, 162, 28, .16); transition: transform .2s; }
.play-disc svg { width: 16px; height: 16px; margin-left: 2px; }
.latest-card:hover .play-disc { transform: scale(1.06); }
.frame-title { font-size: 1.12rem; line-height: 1.38; font-weight: 700; letter-spacing: -.01em; }
.lc-empty { font-weight: 500; color: var(--muted); font-size: 1rem; }
.frame-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; color: var(--muted); font-size: .86rem; }
.frame-meta span { display: inline-flex; align-items: center; gap: 6px; }
.lc-cta { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 700; font-size: .95rem; }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.08fr .92fr; align-items: center; padding-top: 72px; padding-bottom: 80px; gap: 64px; }
  .hero-actions .btn { flex: 0 0 auto; }
  .hero-portrait { width: 100%; max-width: 440px; margin: 0 0 0 auto; }
  .latest-card { position: absolute; left: -48px; bottom: 28px; width: 340px; margin: 0; }
}
@media (max-width: 520px) { .hero-stats div { padding: 0 16px; } .hero-stats dd { font-size: 1.5rem; } }

/* ---------- Khối nội dung ---------- */
section.block { padding: 56px 0; }
.block-tint { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.section-head h2 { margin: 0; }
.link-more { font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-more:hover { text-decoration: underline; }
.split { display: grid; gap: 44px; }
.split > *, .search-row > *, .grid2 > *, .admin-main, .lr-main { min-width: 0; }
@media (min-width: 960px) { .split { grid-template-columns: 1fr 1fr; gap: 56px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.ico { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: var(--tint); }

/* Chuyên mục */
.cats { display: grid; gap: 16px; }
@media (min-width: 860px) { .cats { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.cat { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.cat:hover { border-color: var(--line-2); box-shadow: 0 16px 32px -24px var(--shadow-c); }
.cat-head { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; margin-bottom: 12px; }
.cat-head h3 { margin: 0; font-size: 1.2rem; }
.cat-head:hover h3 { color: var(--accent); }
.cat > p { color: var(--muted); font-size: .95rem; }
.cat-courses { list-style: none; margin: 4px 0 16px; padding: 0; border-top: 1px solid var(--line); }
.cat-courses li { border-bottom: 1px solid var(--line); }
.cat-courses a { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; text-decoration: none; color: var(--ink); font-weight: 500; font-size: .95rem; line-height: 1.4; }
.cat-courses a:hover { color: var(--accent); }
.cat-courses small { color: var(--accent); font-weight: 600; white-space: nowrap; }
.cat-courses li.muted { padding: 11px 0; }
.cat-all { margin-top: auto; font-weight: 600; text-decoration: none; }
.cat-all:hover { text-decoration: underline; }

/* Danh sách buổi giảng */
.results { display: grid; gap: 10px; }
.lesson-row { display: flex; gap: 16px; align-items: center; padding: 14px 16px; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); transition: border-color .15s; }
.lesson-row:hover { border-color: var(--accent); }
.lesson-row .lr-main { flex: 1; }
.lesson-row .t { display: block; font-weight: 600; line-height: 1.45; }
.lesson-row .s { display: block; color: var(--muted); margin-top: 2px; }
.lesson-row .go { color: var(--accent); flex: 0 0 auto; display: flex; }
.lesson-row .num { flex: 0 0 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.lesson-row.current { border-color: var(--accent); background: var(--surface-2); }
.lesson-row.current .num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.lesson-row.locked .num, .lesson-row.locked .dblock b { color: var(--muted); border-color: var(--line); }
.dblock { flex: 0 0 62px; display: grid; justify-items: center; line-height: 1.1; padding-right: 14px; border-right: 1px solid var(--line); font-variant-numeric: tabular-nums lining-nums; }
.dblock b { font-size: 1.6rem; font-weight: 800; color: var(--accent); letter-spacing: -.02em; }
.dblock span { font-size: max(.75rem, 12px); color: var(--muted); white-space: nowrap; }
.lock-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--warn-ink); background: var(--warn-bg); padding: 3px 8px; border-radius: var(--r-sm); }
.prog-tag { display: inline-block; margin-left: 8px; font-size: .74rem; font-weight: 700; padding: 1px 7px; border-radius: var(--r-sm); background: var(--tint); color: var(--accent); vertical-align: 1px; }
.prog-tag.done { background: var(--accent); color: var(--on-accent); }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface); }

/* Tìm kiếm và biểu mẫu */
.search-box { display: grid; gap: 14px; }
.search-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.search-row .field:first-child { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field > span, .label, .date-label { font-size: .86rem; font-weight: 600; color: var(--ink); }
.input, select.input, textarea.input { width: 100%; min-width: 0; min-height: 48px; padding: 10px 14px; border: 1px solid var(--input-line); border-radius: var(--r); background: var(--surface); color: var(--ink); outline: none; }
.input::placeholder { color: var(--muted); opacity: .8; }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.55; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(75, 162, 28, .18); }
.input-search { padding-left: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23889883' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 14px center; }

/* Cách học */
.howto { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 860px) { .howto { grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); } }
.howto li { counter-increment: s; position: relative; padding: 18px 0 0 56px; display: grid; gap: 6px; }
.howto li::before { content: counter(s); position: absolute; left: 0; top: 16px; width: 40px; height: 40px; border-radius: 50%; background: var(--tint); color: var(--accent); font-weight: 800; font-size: 1.05rem; display: grid; place-items: center; }
@media (min-width: 860px) { .howto li { padding: 28px 28px 0 0; } .howto li::before { position: static; margin-bottom: 8px; } }
.howto b { font-size: 1.05rem; }
.howto span { color: var(--muted); font-size: .95rem; }

/* Giảng viên */
.block-teacher { background: var(--surface-2); border-top: 1px solid var(--line); }
.mentor { display: grid; background: var(--deep); color: var(--deep-ink); border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 60px -36px var(--shadow-c); }
.mentor-photo { position: relative; background: var(--photo-bg); aspect-ratio: 4 / 3.4; }
.mentor-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; }
.mentor-photo::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(to top, var(--deep), transparent); }
.mentor-mono { width: 100%; height: 100%; display: grid; place-items: center; font-size: 5rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand-2), #1f7f10); }
.mentor-body { padding: 8px 24px 28px; position: relative; }
.mentor-kicker { color: #9edb6f; font-weight: 600; font-size: .9rem; margin: 0 0 4px; }
.mentor-name { color: inherit; font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.1rem); font-weight: 800; letter-spacing: -.03em; margin: 0 0 4px; line-height: 1.1; }
.mentor-role { opacity: .88; font-weight: 500; margin: 0 0 18px; padding-bottom: 18px; border-bottom: 1px solid rgba(255, 255, 255, .16); }
.mentor-bio { opacity: .82; line-height: 1.75; max-width: 62ch; margin-bottom: 22px; }
.mentor-sub { font-size: .85rem; font-weight: 600; opacity: .62; margin: 0 0 10px; }
.mentor-topics ul { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mentor-topics a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .22); color: inherit; text-decoration: none; font-weight: 500; font-size: .92rem; }
.mentor-topics a:hover { border-color: #9edb6f; }
.mentor-topics .ico { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #9edb6f; }
.mentor-topics .ico svg { width: 16px; height: 16px; }
.mentor-facts { display: flex; gap: 32px; margin: 0 0 24px; }
.mentor-facts div { display: grid; }
.mentor-facts dt { order: 2; font-size: .85rem; opacity: .65; }
.mentor-facts dd { order: 1; margin: 0; font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: lining-nums; }
.mentor-actions .btn { flex: 0 0 auto; }
@media (max-width: 520px) { .mentor-actions .btn { flex: 1 1 100%; } }
@media (min-width: 760px) {
  .mentor { grid-template-columns: minmax(260px, 38%) 1fr; }
  .mentor-photo { aspect-ratio: auto; min-height: 100%; }
  .mentor-photo::after { inset: 0 0 0 auto; width: 30%; height: auto; background: linear-gradient(to left, var(--deep), transparent); }
  .mentor-body { padding: 44px 44px 44px 36px; align-self: center; }
}
@media (min-width: 1100px) { .mentor-body { padding: 56px 64px 56px 40px; } }

/* Kêu gọi đăng ký */
.cta-band { background: linear-gradient(120deg, #2c8212, #4ba21c 60%, #7cc243); color: #fff; }
[data-theme="dark"] .cta-band { background: linear-gradient(120deg, #173d0f, #23561a); }
.cta-inner { display: grid; gap: 20px; padding-top: 44px; padding-bottom: 44px; }
.cta-band h2 { color: #fff; margin-bottom: 6px; }
.cta-band p { margin: 0; color: rgba(255, 255, 255, .88); }
@media (min-width: 860px) { .cta-inner { grid-template-columns: 1fr auto; align-items: center; } }

/* ---------- Trang khóa học ---------- */
.page-band { background: var(--hero); border-bottom: 1px solid var(--line); padding: 40px 0 44px; margin-bottom: 28px; }
.page-band h1 { font-size: clamp(1.85rem, 1.35rem + 2.2vw, 2.7rem); max-width: 26ch; margin-bottom: 10px; }
.page-band .lead { color: var(--muted); max-width: 62ch; margin: 0; }
.band-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 16px; color: var(--muted); font-size: .92rem; font-variant-numeric: tabular-nums; }
.band-meta span { display: inline-flex; gap: 7px; align-items: center; }
.band-meta svg { color: var(--accent); }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 20px; scrollbar-width: none; }
.chip { flex: 0 0 auto; padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; font-size: .93rem; }
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.course-grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .course-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .course-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.course-card { display: flex; flex-direction: column; gap: 10px; padding: 22px; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.course-card:hover { border-color: var(--line-2); box-shadow: 0 16px 32px -24px var(--shadow-c); }
.cc-top { display: flex; align-items: center; gap: 10px; }
.cc-top .ico { flex-basis: 36px; width: 36px; height: 36px; border-radius: 10px; }
.cc-top .ico svg { width: 18px; height: 18px; }
.course-card .cat-name { font-size: .86rem; font-weight: 600; color: var(--accent); }
.course-card h3 { margin: 0; font-size: 1.15rem; }
.course-card p { margin: 0; color: var(--muted); font-size: .94rem; }
.course-card .foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: .9rem; font-weight: 600; color: var(--accent); }

/* ---------- Trang xem buổi giảng ---------- */
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .92rem; font-variant-numeric: tabular-nums; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.lesson-layout { display: grid; gap: 18px; padding: 12px 0 48px; grid-template-areas: "video" "head" "list" "body"; }
.lesson-layout .a-video { grid-area: video; } .lesson-layout .a-head { grid-area: head; }
.lesson-layout .a-list { grid-area: list; } .lesson-layout .a-body { grid-area: body; }
@media (min-width: 960px) {
  .lesson-layout { grid-template-columns: minmax(0, 1fr) 350px; grid-template-areas: "video list" "head list" "body list"; align-items: start; padding-top: 28px; gap: 22px 28px; }
  .lesson-layout .a-list { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow: auto; }
}
@media (max-width: 959px) { .lesson-page .wrap { padding: 0; } .lesson-layout .a-head, .lesson-layout .a-list, .lesson-layout .a-body { margin: 0 20px; } }
.player { background: #000; overflow: hidden; }
@media (min-width: 960px) { .player { border-radius: var(--r-lg) var(--r-lg) 0 0; } }
.player video { width: 100%; aspect-ratio: 16 / 9; display: block; background: #000; }
.player-bar { display: flex; gap: 6px; padding: 8px; background: #0f170e; flex-wrap: wrap; }
.player-bar button, .player-bar select { background: rgba(255, 255, 255, .1); color: #fff; border: 0; border-radius: 8px; min-height: 38px; padding: 6px 12px; font-size: .88rem; font-weight: 500; cursor: pointer; }
.player-bar button:hover { background: rgba(255, 255, 255, .2); }
.player-bar .sp { margin-left: auto; }
.player-bar select option { color: #000; }
.player-msg { aspect-ratio: 16 / 9; display: grid; place-items: center; color: #fff; text-align: center; padding: 20px; background: #0f170e; }
.watch { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-top: 0; }
@media (min-width: 960px) { .watch { border-radius: 0 0 var(--r-lg) var(--r-lg); } }
.watch-label, .watch-done { font-size: .92rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.watch-label b { font-size: 1.2rem; font-weight: 800; color: var(--accent); }
.watch-done { color: var(--accent); font-weight: 700; }
.watch-bar { height: 8px; border-radius: 99px; background: var(--tint); overflow: hidden; }
.watch-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--accent)); transition: width .4s; }
.watch-hint { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
.a-head h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); line-height: 1.25; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.prevnext .btn { white-space: normal; text-align: center; line-height: 1.25; font-size: .93rem; }
.list-card { padding: 16px; }
.list-card h3 { margin: 0 0 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 1.05rem; }
.list-card .results { gap: 6px; }
.list-card .lesson-row { padding: 10px 12px; gap: 12px; }
.list-card .lesson-row .num { flex-basis: 32px; height: 32px; font-size: .85rem; }
.body-card { padding: 24px; }
.body-card h2 { font-size: 1.2rem; }
.summary { white-space: pre-wrap; line-height: 1.75; }
.docs { display: grid; gap: 8px; }
.doc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: inherit; background: var(--surface); }
.doc:hover { border-color: var(--accent); }
.doc .ext { flex: 0 0 44px; height: 44px; border-radius: 8px; background: var(--tint); color: var(--accent); font-size: .72rem; font-weight: 700; display: grid; place-items: center; text-transform: uppercase; }
.doc .dl { margin-left: auto; color: var(--accent); font-weight: 600; font-size: .9rem; }
.banner { padding: 12px 16px; border-radius: var(--r); font-size: .93rem; }
.banner-warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.banner-info { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.banner-err { background: var(--err-bg); color: var(--err-ink); border: 1px solid var(--err-line); }

/* ---------- Đăng nhập, tài khoản ---------- */
.auth { max-width: 460px; margin: 40px auto 64px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 20px 48px -32px var(--shadow-c); }
.auth h1 { font-size: 1.75rem; }
.auth form { display: grid; gap: 14px; }
.err { color: var(--err-ink); font-size: .9rem; min-height: 1.2em; }
.linkbox { padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); font-size: .92rem; word-break: break-word; margin-bottom: 16px; }
.success-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--tint); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.account { display: grid; gap: 16px; }
.acc-card { padding: 22px; }
.acc-card h2 { font-size: 1.2rem; }
.acc-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* ---------- Xem tiếp ---------- */
.block-continue { padding-bottom: 0 !important; }
.continue-grid { display: grid; gap: 10px; }
@media (min-width: 860px) { .continue-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.continue { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; color: inherit; background: var(--surface); }
.continue:hover { border-color: var(--accent); }
.continue .t { display: block; font-weight: 600; line-height: 1.45; }
.continue .s { display: block; color: var(--muted); }
.play-sm { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.play-sm svg { margin-left: 2px; }
.bar { display: block; height: 5px; border-radius: 99px; background: var(--tint); margin: 8px 0 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }

/* ---------- Quản trị ---------- */
.admin { padding-top: 28px; padding-bottom: 64px; }
.admin-layout { display: grid; gap: 18px; }
.admin-side { display: grid; gap: 14px; align-content: start; }
.side-hello { display: none; }
.side-nav { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.side-nav a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.side-nav a svg { width: 18px; height: 18px; }
.side-nav a.active { color: var(--accent); border-color: var(--accent); }
.admin-title { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2rem); margin-bottom: 16px; }
@media (min-width: 1000px) {
  .admin-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
  .admin-side { position: sticky; top: 90px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
  .side-hello { display: block; }
  .side-hello .kicker { margin: 0; }
  .side-name { font-size: 1.15rem; font-weight: 700; margin: 0; }
  .side-nav { flex-direction: column; border: 0; gap: 2px; }
  .side-nav a { border: 0; border-radius: 8px; padding: 10px 12px; color: var(--ink); }
  .side-nav a:hover { background: var(--surface); }
  .side-nav a.active { background: var(--surface); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
}
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.stat { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); text-decoration: none; color: inherit; }
.stat b { font-size: 1.9rem; font-weight: 800; color: var(--accent); line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: .86rem; color: var(--muted); }
a.stat:hover { border-color: var(--accent); }
.stat-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.stat-warn b { color: var(--warn-ink); }
.toolbar { display: grid; gap: 10px; margin-bottom: 14px; }
@media (min-width: 760px) { .toolbar { grid-template-columns: 1fr 240px; } }
.admin-list { display: grid; gap: 10px; }
.arow { padding: 16px 18px; display: grid; gap: 10px; }
@media (min-width: 900px) { .arow { grid-template-columns: 1fr auto; align-items: center; } }
.arow .t { font-weight: 600; font-size: 1.02rem; line-height: 1.45; }
.badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: var(--r-sm); vertical-align: middle; }
.badge-pub { background: var(--tint); color: var(--accent); }
.badge-draft { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); }
.steps { display: grid; gap: 16px; max-width: 840px; }
.step { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.step-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.step-title .n { flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; display: grid; place-items: center; }
.step-title h2 { font-size: 1.15rem; margin: 0; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.cat-pick { display: grid; gap: 8px; }
@media (min-width: 700px) { .cat-pick { grid-template-columns: repeat(3, 1fr); } }
.cat-pick label { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font-weight: 600; font-size: .95rem; background: var(--surface); }
.cat-pick input { accent-color: var(--accent); width: 18px; height: 18px; }
.cat-pick label.on { border-color: var(--accent); background: var(--surface-2); }
.inline-new { margin-top: 12px; padding: 16px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface-2); display: grid; gap: 10px; }
.drop { border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); padding: 28px; text-align: center; background: var(--surface-2); }
.drop.over { border-color: var(--accent); background: var(--tint); }
.file-box { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 8px; background: var(--surface); }
.file-box .fname { font-weight: 600; word-break: break-all; }
.progress { height: 8px; border-radius: 99px; background: var(--tint); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.ok-text { color: var(--accent); font-weight: 600; }
.err-text { color: var(--err-ink); font-weight: 600; }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 10px; align-items: center; }
.checklist .y { color: var(--accent); font-weight: 700; }
.checklist .x { color: var(--muted); font-weight: 700; }
.sticky-actions { position: sticky; bottom: 0; background: var(--topbar); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.order-list { display: grid; gap: 6px; margin-top: 12px; }
.order-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.order-item .t { flex: 1; min-width: 0; }
.order-item button { min-width: 38px; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .93rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.create-acc > summary { list-style: none; width: fit-content; }
.create-acc > summary::-webkit-details-marker { display: none; }

/* ---------- Thông báo, hộp thoại ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); background: #10300c; color: #fff; padding: 12px 18px; border-radius: var(--r);
  font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .4); }
[data-theme="dark"] #toast { background: #e6eee3; color: #0b110a; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-bg { position: fixed; inset: 0; background: var(--overlay); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; width: 100%; max-width: 480px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.modal h2 { font-size: 1.35rem; }

/* ---------- Chân trang ---------- */
.footer { background: #10300c; color: rgba(255, 255, 255, .74); font-size: .92rem; }
[data-theme="dark"] .footer { background: #070c06; border-top: 1px solid var(--line); }
.foot-grid { display: grid; gap: 28px; padding-top: 48px; padding-bottom: 32px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 2fr 1fr 1fr; gap: 48px; } }
.foot-brand img { width: 36px; height: 36px; object-fit: contain; }
.foot-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.foot-grid p { max-width: 46ch; margin: 0; }
.foot-h { color: #fff; font-weight: 600; margin-bottom: 10px !important; }
.foot-grid a { display: block; color: rgba(255, 255, 255, .78); text-decoration: none; padding: 4px 0; }
.foot-grid a:hover { color: #fff; }
.foot-bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 18px; padding-bottom: 28px; font-size: .84rem; }
.preview-flag { background: #0a1f08; color: #d7e8d0; font-size: .82rem; text-align: center; padding: 6px 12px; }
.preview-flag b { color: #fff; }

/* Dòng chữ chạy trên cùng */
.ticker { position: relative; overflow: hidden; background: linear-gradient(90deg, #1f6f10, #3d9f17 50%, #1f6f10); color: #fff; font-size: .92rem; font-weight: 600; line-height: 1; }
[data-theme="dark"] .ticker { background: linear-gradient(90deg, #12340c, #1f5a14 50%, #12340c); }
.tk-track { display: flex; width: max-content; animation: tk-run 50s linear infinite; will-change: transform; }
.ticker:hover .tk-track { animation-play-state: paused; }
.tk-group { display: flex; align-items: center; flex: 0 0 auto; }
.tk-item { padding: 11px 0; white-space: nowrap; }
.tk-sep { display: inline-block; width: 6px; height: 6px; margin: 0 28px; border-radius: 50%; background: #b9ef8a; }
@keyframes tk-run { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (max-width: 800px) { .ticker { font-size: .86rem; } .tk-item { padding: 9px 0; } .tk-track { animation-duration: 36s; } }
/* Dòng chữ luôn chạy, kể cả khi máy tính tắt hiệu ứng chuyển động (theo yêu cầu) */
