/* ============================================================
   Giao diện LMS – tươi sáng, sinh động, thân thiện với học sinh
   ============================================================ */

:root {
    --primary: #6C5CE7;
    --primary-dark: #5344c8;
    --primary-light: #a29bfe;
    --accent: #FF7675;
    --success: #00B894;
    --info: #0984E3;
    --warning: #FDCB6E;
    --danger: #E74C3C;
    --purple: #A55EEA;

    --bg: #F5F6FC;
    --bg-soft: #EEF0FB;
    --card: #FFFFFF;
    --text: #1E2137;
    --text-soft: #6B7094;
    --text-mute: #9AA0BF;
    --border: #E6E8F5;
    --border-strong: #D3D7EE;

    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 26px;
    --shadow-sm: 0 2px 8px rgba(38, 42, 88, .06);
    --shadow: 0 8px 26px rgba(38, 42, 88, .09);
    --shadow-lg: 0 18px 48px rgba(38, 42, 88, .16);
    --sidebar-w: 262px;
    --header-h: 66px;
    --font: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

[data-theme="dark"] {
    --bg: #14162B;
    --bg-soft: #1B1E38;
    --card: #1E2140;
    --text: #EAECFB;
    --text-soft: #A6ABD4;
    --text-mute: #7C82AC;
    --border: #2C3055;
    --border-strong: #3A3F6E;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
    --shadow: 0 8px 26px rgba(0, 0, 0, .35);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .18s; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.28; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.16rem; }
h4 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }

::selection { background: var(--primary-light); color: #fff; }

/* ---------------------------------------------------------- tiện ích */
.muted { color: var(--text-soft); }
.small { font-size: .84rem; }
.tiny { font-size: .76rem; }
.center { text-align: center; }
.right { text-align: right; }
.bold { font-weight: 700; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 34px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 34px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.flex-center { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 0; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: #d68910; }
.text-primary { color: var(--primary); }

/* ---------------------------------------------------------- nút */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: 999px; border: 1.6px solid transparent;
    font-family: var(--font); font-size: .92rem; font-weight: 600; cursor: pointer;
    background: var(--card); color: var(--text); text-decoration: none;
    transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .18s, background .18s, color .18s;
    box-shadow: var(--shadow-sm); white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }
.btn-primary:hover { color: #fff; }
.btn-success { background: linear-gradient(135deg, #00B894, #55EFC4); color: #fff; }
.btn-success:hover { color: #fff; }
.btn-danger { background: linear-gradient(135deg, #E74C3C, #FF7675); color: #fff; }
.btn-danger:hover { color: #fff; }
.btn-warning { background: linear-gradient(135deg, #F39C12, #FDCB6E); color: #fff; }
.btn-warning:hover { color: #fff; }
.btn-info { background: linear-gradient(135deg, #0984E3, #74B9FF); color: #fff; }
.btn-info:hover { color: #fff; }
.btn-ghost { background: transparent; box-shadow: none; border-color: var(--border-strong); color: var(--text-soft); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); box-shadow: none; }
.btn-sm { padding: 6px 14px; font-size: .82rem; }
.btn-lg { padding: 14px 30px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: 50%; }

.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------- thẻ */
.card {
    background: var(--card); border-radius: var(--radius); padding: 22px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    transition: transform .22s, box-shadow .22s;
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 1.06rem; font-weight: 700; }
.card-title .emoji { font-size: 1.3rem; }
.card-pad-0 { padding: 0; overflow: hidden; }
.card-header {
    padding: 16px 22px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-body { padding: 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg-soft); }

/* ---------------------------------------------------------- bố cục ứng dụng */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w); flex-shrink: 0; background: var(--card);
    border-right: 1px solid var(--border); position: fixed; inset: 0 auto 0 0; z-index: 60;
    display: flex; flex-direction: column; transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.sidebar-brand {
    display: flex; align-items: center; gap: 11px; padding: 16px 18px; min-height: var(--header-h);
    border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text);
}
.sidebar-brand img { width: 38px; height: 38px; object-fit: contain; border-radius: 10px; }
.sidebar-brand .logo-fallback {
    width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; flex-shrink: 0;
}
.sidebar-brand b { font-size: 1rem; display: block; line-height: 1.25; }
.sidebar-brand span { font-size: .72rem; color: var(--text-mute); display: block; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px 24px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.nav-divider {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-mute);
    padding: 18px 14px 7px; font-weight: 700;
}
.nav-item {
    display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: 13px;
    color: var(--text-soft); text-decoration: none; font-weight: 600; font-size: .9rem;
    margin-bottom: 3px; transition: background .18s, color .18s, transform .18s;
}
.nav-item .nav-icon { font-size: 1.08rem; width: 22px; text-align: center; }
.nav-item:hover { background: var(--bg-soft); color: var(--text); transform: translateX(3px); }
.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff; box-shadow: 0 6px 16px rgba(108, 92, 231, .34);
}
.nav-badge {
    margin-left: auto; background: var(--accent); color: #fff; font-size: .7rem;
    padding: 1px 8px; border-radius: 999px; font-weight: 700;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.28); }

.sidebar-foot { padding: 12px 16px; border-top: 1px solid var(--border); font-size: .72rem; color: var(--text-mute); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
    height: var(--header-h); background: var(--card); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-weight: 700; font-size: 1.04rem; }
.topbar-spacer { flex: 1; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 12px; border: none; background: var(--bg-soft);
    cursor: pointer; font-size: 1.05rem; display: grid; place-items: center; position: relative;
    color: var(--text); transition: background .18s, transform .18s;
}
.icon-btn:hover { background: var(--border); transform: translateY(-2px); }
.icon-dot {
    position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 999px; background: var(--accent); color: #fff; font-size: .62rem;
    display: grid; place-items: center; font-weight: 700; box-shadow: 0 0 0 2px var(--card);
}
.menu-toggle { display: none; }

.user-chip {
    display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: 999px;
    background: var(--bg-soft); cursor: pointer; border: none; font-family: var(--font);
    color: var(--text); font-weight: 600; font-size: .88rem; transition: background .18s;
}
.user-chip:hover { background: var(--border); }
.user-chip .u-role { font-size: .7rem; color: var(--text-mute); font-weight: 500; display: block; line-height: 1; }

.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 10px); min-width: 232px; background: var(--card);
    border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
    padding: 8px; z-index: 80; opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .18s, transform .18s, visibility .18s; max-height: 70vh; overflow-y: auto;
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
    color: var(--text); text-decoration: none; font-size: .88rem; font-weight: 500;
}
.dropdown-item:hover { background: var(--bg-soft); color: var(--text); }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.dropdown-head { padding: 10px 12px 6px; font-size: .74rem; color: var(--text-mute); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.content { padding: 26px 26px 60px; flex: 1; max-width: 1480px; width: 100%; }

.page-head { margin-bottom: 24px; }
.page-head h1 { margin-bottom: 6px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-soft); font-size: .94rem; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------- bố cục công khai */
.public-header {
    position: sticky; top: 0; z-index: 60; background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .public-header { background: rgba(30, 33, 64, .86); }
.public-header-inner {
    max-width: 1240px; margin: 0 auto; padding: 12px 22px;
    display: flex; align-items: center; gap: 16px;
}
.public-nav { display: flex; gap: 6px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.public-nav a { padding: 8px 14px; border-radius: 999px; color: var(--text-soft); font-weight: 600; font-size: .9rem; }
.public-nav a:hover { background: var(--bg-soft); color: var(--text); }
.public-main { max-width: 1240px; margin: 0 auto; padding: 30px 22px 70px; }

.site-footer {
    background: var(--card); border-top: 1px solid var(--border); padding: 34px 22px 26px; margin-top: auto;
}
.site-footer-inner { max-width: 1240px; margin: 0 auto; display: grid; gap: 26px; grid-template-columns: 1.6fr 1fr 1fr; }
.site-footer h4 { font-size: .92rem; margin-bottom: 12px; }
.site-footer a { color: var(--text-soft); font-size: .88rem; display: block; margin-bottom: 7px; }
.site-footer a:hover { color: var(--primary); }
.footer-bottom {
    max-width: 1240px; margin: 26px auto 0; padding-top: 18px; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    color: var(--text-mute); font-size: .82rem;
}

/* ---------------------------------------------------------- trang chủ */
.hero {
    position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 58px 46px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 55%, #74B9FF 100%);
    color: #fff; margin-bottom: 34px;
}
.hero::after {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(circle at 18% 22%, rgba(255,255,255,.22) 0, transparent 42%),
                      radial-gradient(circle at 82% 78%, rgba(255,255,255,.18) 0, transparent 46%);
}
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.15fr .85fr; gap: 34px; align-items: center; }
.hero h1 { font-size: 2.6rem; color: #fff; margin-bottom: 14px; }
.hero p { font-size: 1.06rem; opacity: .95; max-width: 560px; }
.hero .btn { box-shadow: 0 10px 24px rgba(0,0,0,.16); }
.hero-art { position: relative; }
.hero-art img { width: 100%; filter: drop-shadow(0 18px 32px rgba(0,0,0,.24)); animation: floaty 5.5s ease-in-out infinite; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero-badge {
    background: rgba(255,255,255,.19); border: 1px solid rgba(255,255,255,.32); padding: 7px 15px;
    border-radius: 999px; font-size: .84rem; font-weight: 600; backdrop-filter: blur(6px);
}

@keyframes floaty { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-16px) } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px) } to { opacity: 1; transform: none } }
@keyframes pop { 0% { transform: scale(.86); opacity: 0 } 60% { transform: scale(1.04) } 100% { transform: scale(1); opacity: 1 } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }
@keyframes shimmer { 0% { background-position: -420px 0 } 100% { background-position: 420px 0 } }
@keyframes confetti-fall { 0% { transform: translateY(-12vh) rotate(0); opacity: 1 } 100% { transform: translateY(104vh) rotate(720deg); opacity: 0 } }

.fade-up { animation: fadeUp .5s cubic-bezier(.2,.7,.3,1) both; }
.fade-up:nth-child(2) { animation-delay: .06s; }
.fade-up:nth-child(3) { animation-delay: .12s; }
.fade-up:nth-child(4) { animation-delay: .18s; }
.fade-up:nth-child(5) { animation-delay: .24s; }
.fade-up:nth-child(6) { animation-delay: .3s; }
.pop-in { animation: pop .38s cubic-bezier(.34,1.56,.64,1) both; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 20px; }
.feature {
    background: var(--card); border-radius: var(--radius); padding: 24px; border: 1px solid var(--border);
    transition: transform .24s, box-shadow .24s; position: relative; overflow: hidden;
}
.feature:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.feature-icon {
    width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
    font-size: 26px; margin-bottom: 14px; background: var(--bg-soft);
}
.feature h3 { font-size: 1.04rem; margin-bottom: 6px; }
.feature p { color: var(--text-soft); font-size: .9rem; margin: 0; }

.section-head { text-align: center; margin: 54px 0 28px; }
.section-head h2 { font-size: 1.9rem; }
.section-head p { color: var(--text-soft); max-width: 620px; margin: 0 auto; }

/* ---------------------------------------------------------- thẻ khoá học */
.course-card {
    background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
    display: flex; flex-direction: column; transition: transform .24s, box-shadow .24s; height: 100%;
}
.course-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.course-cover {
    height: 138px; position: relative; overflow: hidden; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; font-size: 46px;
}
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.course-cover .cover-pattern {
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,.24) 0, transparent 40%),
                      radial-gradient(circle at 80% 70%, rgba(255,255,255,.2) 0, transparent 44%);
}
.course-cover .course-code {
    position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,.35); color: #fff;
    padding: 3px 11px; border-radius: 999px; font-size: .72rem; font-weight: 700; backdrop-filter: blur(4px);
}
.course-body { padding: 17px 18px; flex: 1; display: flex; flex-direction: column; }
.course-body h3 { font-size: 1.03rem; margin-bottom: 6px; }
.course-body h3 a { color: var(--text); }
.course-body h3 a:hover { color: var(--primary); }
.course-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--text-mute); font-size: .8rem; margin-top: auto; padding-top: 12px; }
.course-desc { color: var(--text-soft); font-size: .87rem; margin-bottom: 10px; }

/* ---------------------------------------------------------- chip / nhãn */
.chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px;
    font-size: .76rem; font-weight: 600; white-space: nowrap; line-height: 1.7;
}
.chip-gray { background: #EDEFF7; color: #5B6180; }
.chip-green { background: #E3F9F1; color: #05986F; }
.chip-blue { background: #E3F0FE; color: #0B6FC4; }
.chip-purple { background: #EFE9FE; color: #6C5CE7; }
.chip-red { background: #FDECEA; color: #D63031; }
.chip-orange { background: #FFF1E2; color: #D2691E; }
.chip-yellow { background: #FEF7DE; color: #A57B04; }
.chip-pink { background: #FDE9F3; color: #C2185B; }
[data-theme="dark"] .chip-gray { background: #2A2E52; color: #B9BEE0; }
[data-theme="dark"] .chip-green { background: #10402F; color: #4CD8A8; }
[data-theme="dark"] .chip-blue { background: #10304F; color: #6BB6F7; }
[data-theme="dark"] .chip-purple { background: #2A2358; color: #B0A3FF; }
[data-theme="dark"] .chip-red { background: #4A1E1C; color: #FF8A80; }
[data-theme="dark"] .chip-orange { background: #4A2E14; color: #FFB871; }
[data-theme="dark"] .chip-yellow { background: #47391A; color: #F4CE6B; }
[data-theme="dark"] .chip-pink { background: #4A1F35; color: #FF8FC0; }

/* ---------------------------------------------------------- biểu mẫu */
.form-group { margin-bottom: 17px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
label { display: block; font-weight: 600; font-size: .87rem; margin-bottom: 6px; color: var(--text); }
label .req { color: var(--danger); }
.form-hint { font-size: .78rem; color: var(--text-mute); margin-top: 5px; line-height: 1.5; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=time], input[type=url], input[type=search], input[type=tel],
select, textarea {
    width: 100%; padding: 11px 14px; border: 1.6px solid var(--border-strong); border-radius: var(--radius-sm);
    font-family: var(--font); font-size: .92rem; background: var(--card); color: var(--text);
    transition: border-color .18s, box-shadow .18s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108, 92, 231, .14);
}
textarea { resize: vertical; min-height: 100px; line-height: 1.65; }
select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%236B7094' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
input[type=color] { width: 58px; height: 40px; padding: 3px; border-radius: 10px; cursor: pointer; border: 1.6px solid var(--border-strong); background: var(--card); }
input[disabled], select[disabled], textarea[disabled] { background: var(--bg-soft); color: var(--text-mute); cursor: not-allowed; }

.check-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 11px; }
.check-row input[type=checkbox], .check-row input[type=radio] { width: 19px; height: 19px; accent-color: var(--primary); margin-top: 2px; flex-shrink: 0; cursor: pointer; }
.check-row label { margin: 0; font-weight: 500; cursor: pointer; }

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track {
    width: 50px; height: 28px; border-radius: 999px; background: var(--border-strong); position: relative;
    transition: background .25s; flex-shrink: 0;
}
.switch .track::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
    background: #fff; transition: transform .25s cubic-bezier(.34,1.56,.64,1); box-shadow: 0 2px 5px rgba(0,0,0,.22);
}
.switch input:checked + .track { background: linear-gradient(135deg, var(--success), #55EFC4); }
.switch input:checked + .track::after { transform: translateX(22px); }
.switch-label b { display: block; font-size: .92rem; }
.switch-label span { font-size: .78rem; color: var(--text-mute); }

fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; margin: 0 0 20px; }
legend { font-weight: 700; font-size: .92rem; padding: 0 8px; color: var(--primary); }

/* vùng kéo thả tệp */
.dropzone {
    border: 2.4px dashed var(--border-strong); border-radius: var(--radius); padding: 28px 20px;
    text-align: center; cursor: pointer; transition: border-color .2s, background .2s, transform .2s;
    background: var(--bg-soft);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: rgba(108,92,231,.07); transform: scale(1.01); }
.dropzone .dz-emoji { font-size: 40px; display: block; margin-bottom: 8px; }
.dropzone b { color: var(--primary); }
.file-preview { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }

/* ---------------------------------------------------------- bảng */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); }
table.data { width: 100%; border-collapse: collapse; font-size: .89rem; }
table.data th {
    text-align: left; padding: 13px 14px; background: var(--bg-soft); font-weight: 700; font-size: .8rem;
    color: var(--text-soft); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr { transition: background .16s; }
table.data tbody tr:hover { background: var(--bg-soft); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.center, table.data th.center { text-align: center; }
table.data td.right, table.data th.right { text-align: right; }
.table-sticky th { position: sticky; top: 0; z-index: 5; }
.table-sticky .col-fix {
    position: sticky; left: 0; background: var(--card); z-index: 4; box-shadow: 2px 0 6px -3px rgba(0,0,0,.16);
}
.table-sticky th.col-fix { z-index: 6; background: var(--bg-soft); }
.table-sticky tbody tr:hover .col-fix { background: var(--bg-soft); }

/* ---------------------------------------------------------- thông báo */
.alert {
    padding: 13px 17px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .9rem;
    display: flex; gap: 11px; align-items: flex-start; border: 1px solid transparent; animation: fadeUp .35s both;
}
.alert-success { background: #E6F9F2; color: #056B4F; border-color: #B4EDDA; }
.alert-danger  { background: #FDECEA; color: #A32018; border-color: #F8C9C4; }
.alert-warning { background: #FFF6E0; color: #8A6100; border-color: #FAE3AC; }
.alert-info    { background: #E7F1FE; color: #0A5DA6; border-color: #C2DDFB; }
[data-theme="dark"] .alert-success { background: #0E3D2D; color: #6FE3BB; border-color: #165A44; }
[data-theme="dark"] .alert-danger { background: #45191A; color: #FF9C93; border-color: #6B2724; }
[data-theme="dark"] .alert-warning { background: #453516; color: #F6CE72; border-color: #6A5222; }
[data-theme="dark"] .alert-info { background: #12314F; color: #7FC0FA; border-color: #1D4A76; }
.alert .alert-x { margin-left: auto; cursor: pointer; opacity: .6; background: none; border: none; font-size: 1.1rem; color: inherit; }
.alert .alert-x:hover { opacity: 1; }

.flash-stack { position: fixed; top: 84px; right: 22px; z-index: 300; width: min(370px, calc(100vw - 40px)); }
.flash-stack .alert { box-shadow: var(--shadow-lg); }

/* ---------------------------------------------------------- thẻ thống kê */
.stat-card {
    background: var(--card); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border);
    display: flex; gap: 15px; align-items: center; transition: transform .22s, box-shadow .22s; position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.stat-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 25px; flex-shrink: 0; }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat-label { font-size: .82rem; color: var(--text-soft); }
.stat-trend { font-size: .74rem; font-weight: 700; margin-top: 3px; }

/* ---------------------------------------------------------- tiến độ */
.progress { height: 9px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width .9s cubic-bezier(.2,.8,.3,1); }
.progress-lg { height: 14px; }

.ring { transform: rotate(-90deg); }
.ring circle { transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.3,1); }

/* ---------------------------------------------------------- avatar */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-grid; place-items: center; }
.avatar-text { color: #fff; font-weight: 700; letter-spacing: .02em; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -10px; border: 2px solid var(--card); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.user-row { display: flex; align-items: center; gap: 10px; }
.user-row .u-name { font-weight: 600; }
.user-row .u-sub { font-size: .76rem; color: var(--text-mute); }

/* ---------------------------------------------------------- nội dung khoá học */
.section-block { margin-bottom: 22px; }
.section-head-bar {
    display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(108,92,231,.11), rgba(162,155,254,.09));
    border: 1px solid var(--border); margin-bottom: 12px; flex-wrap: wrap;
}
.section-head-bar h3 { margin: 0; font-size: 1.02rem; }
.section-num {
    width: 30px; height: 30px; border-radius: 10px; background: var(--primary); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: .84rem; flex-shrink: 0;
}
.item-list { display: flex; flex-direction: column; gap: 9px; }
.item-row {
    display: flex; align-items: center; gap: 13px; padding: 13px 16px; background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius-sm); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.item-row:hover { transform: translateX(4px); box-shadow: var(--shadow-sm); border-color: var(--primary-light); }
.item-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; flex-shrink: 0; }
.item-main { flex: 1; min-width: 0; }
.item-main a { color: var(--text); font-weight: 600; }
.item-main a:hover { color: var(--primary); }
.item-sub { font-size: .78rem; color: var(--text-mute); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.item-actions { display: flex; gap: 6px; align-items: center; }
.item-row.hidden-item { opacity: .58; border-style: dashed; }

.done-tick { color: var(--success); font-size: 1.1rem; }

/* ---------------------------------------------------------- tệp đính kèm */
.file-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--card); transition: border-color .18s, transform .18s;
}
.file-item:hover { border-color: var(--primary-light); transform: translateX(3px); }
.file-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; background: var(--bg-soft); flex-shrink: 0; }
.file-name { font-weight: 600; font-size: .89rem; word-break: break-word; }
.file-meta { font-size: .74rem; color: var(--text-mute); }

/* ---------------------------------------------------------- tab */
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tab {
    padding: 10px 18px; border-radius: 12px 12px 0 0; color: var(--text-soft); font-weight: 600;
    font-size: .9rem; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -2px; text-decoration: none;
}
.tab:hover { color: var(--text); background: var(--bg-soft); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------------------------------------------------------- trạng thái rỗng */
.empty-state { text-align: center; padding: 46px 20px; color: var(--text-soft); }
.empty-emoji { font-size: 56px; margin-bottom: 12px; animation: floaty 4s ease-in-out infinite; }
.empty-state h3 { margin-bottom: 6px; color: var(--text); }
.empty-state p { max-width: 440px; margin: 0 auto 16px; font-size: .92rem; }

/* ---------------------------------------------------------- phân trang */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; align-items: center; }
.pager-btn {
    min-width: 38px; height: 38px; padding: 0 12px; border-radius: 11px; display: grid; place-items: center;
    background: var(--card); border: 1px solid var(--border); color: var(--text-soft); font-weight: 600; font-size: .86rem;
}
.pager-btn:hover { border-color: var(--primary); color: var(--primary); }
.pager-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager-btn.disabled { opacity: .45; pointer-events: none; }
.pager-dots { color: var(--text-mute); padding: 0 4px; }

/* ---------------------------------------------------------- đường dẫn */
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: .82rem; color: var(--text-mute); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-soft); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-current { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------- hộp thoại */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(20, 22, 43, .55); backdrop-filter: blur(3px);
    z-index: 200; display: grid; place-items: center; padding: 20px; animation: fadeUp .2s;
}
.modal {
    background: var(--card); border-radius: var(--radius-lg); width: min(640px, 100%); max-height: 88vh;
    overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .28s cubic-bezier(.34,1.56,.64,1);
}
.modal-head { padding: 20px 24px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-body { padding: 16px 24px; }
.modal-foot { padding: 0 24px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------------------------------------------------------- biểu đồ */
.chart { width: 100%; height: auto; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { font-size: 10px; fill: var(--text-mute); font-family: var(--font); }
.chart-value { font-size: 10px; fill: var(--text-soft); font-weight: 700; font-family: var(--font); }
.chart-bar { transition: opacity .2s; }
.chart-bar:hover { opacity: .82; }
.donut { width: 100%; max-width: 190px; height: auto; }
.donut-center { font-size: 24px; font-weight: 800; fill: var(--text); font-family: var(--font); }
.donut-sub { font-size: 11px; fill: var(--text-mute); font-family: var(--font); }
.donut-seg { transition: opacity .2s; }
.donut-seg:hover { opacity: .8; }
.spark { width: 100%; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; font-size: .82rem; }
.legend-item { display: flex; align-items: center; gap: 7px; color: var(--text-soft); }
.legend-dot { width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0; }

/* ---------------------------------------------------------- trắc nghiệm */
.quiz-shell { max-width: 940px; margin: 0 auto; }
.quiz-timer {
    position: sticky; top: 76px; z-index: 40; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 13px 18px; display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow-sm); margin-bottom: 20px; flex-wrap: wrap;
}
.quiz-timer .time { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--primary); }
.quiz-timer.warning .time { color: var(--danger); animation: pulse 1s infinite; }
.question-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.question-num {
    display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
    background: var(--primary); color: #fff; font-weight: 700; font-size: .86rem; margin-right: 10px; flex-shrink: 0;
}
.answer-option {
    display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border: 1.8px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: 9px; cursor: pointer; transition: all .18s; background: var(--card);
}
.answer-option:hover { border-color: var(--primary-light); background: rgba(108,92,231,.05); transform: translateX(3px); }
.answer-option.selected { border-color: var(--primary); background: rgba(108,92,231,.09); }
.answer-option.correct { border-color: var(--success); background: rgba(0,184,148,.1); }
.answer-option.wrong { border-color: var(--danger); background: rgba(231,76,60,.09); }
.answer-option input { margin-top: 3px; accent-color: var(--primary); width: 18px; height: 18px; flex-shrink: 0; }
.answer-letter {
    width: 26px; height: 26px; border-radius: 8px; background: var(--bg-soft); display: grid; place-items: center;
    font-weight: 700; font-size: .8rem; flex-shrink: 0;
}
.question-nav { display: flex; flex-wrap: wrap; gap: 7px; }
.qnav-btn {
    width: 38px; height: 38px; border-radius: 11px; border: 1.6px solid var(--border); background: var(--card);
    font-weight: 700; font-size: .82rem; cursor: pointer; color: var(--text-soft); font-family: var(--font); transition: all .16s;
}
.qnav-btn:hover { border-color: var(--primary); }
.qnav-btn.answered { background: var(--primary); border-color: var(--primary); color: #fff; }
.qnav-btn.flagged { border-color: var(--warning); background: #FFF8E5; }

/* ---------------------------------------------------------- AI */
.ai-panel {
    border: 1.6px solid #D8CEFF; border-radius: var(--radius); padding: 18px;
    background: linear-gradient(135deg, rgba(108,92,231,.07), rgba(116,185,255,.06));
}
[data-theme="dark"] .ai-panel { border-color: #3C3474; }
.ai-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 700; }
.ai-avatar {
    width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #6C5CE7, #74B9FF);
    display: grid; place-items: center; font-size: 19px; color: #fff; flex-shrink: 0;
}
.ai-summary { font-size: .92rem; }
table.ai-criteria { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .85rem; }
table.ai-criteria th { text-align: left; padding: 8px 10px; background: rgba(108,92,231,.12); font-size: .78rem; }
table.ai-criteria td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ai-block { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .88rem; }
.ai-block ul { margin: 8px 0 0; padding-left: 20px; }
.ai-block li { margin-bottom: 5px; }
.ai-good { background: rgba(0,184,148,.1); }
.ai-improve { background: rgba(253,203,110,.16); }

.spinner {
    width: 17px; height: 17px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
    border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
.spinner-dark { border-color: rgba(108,92,231,.25); border-top-color: var(--primary); }

/* ---------------------------------------------------------- SCORM */
.scorm-frame-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.scorm-frame { width: 100%; height: 76vh; border: 0; display: block; background: #fff; }
.scorm-bar {
    display: flex; align-items: center; gap: 12px; padding: 11px 16px; background: var(--bg-soft);
    border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.scorm-toc { max-height: 380px; overflow-y: auto; }
.scorm-toc a { display: block; padding: 8px 12px; border-radius: 9px; color: var(--text-soft); font-size: .86rem; }
.scorm-toc a:hover, .scorm-toc a.active { background: var(--bg-soft); color: var(--primary); }

/* ---------------------------------------------------------- dòng thời gian */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
    content: ''; position: absolute; left: -22px; top: 6px; width: 11px; height: 11px; border-radius: 50%;
    background: var(--primary); border: 2.5px solid var(--card); box-shadow: 0 0 0 2px var(--primary-light);
}
.timeline-time { font-size: .74rem; color: var(--text-mute); }

/* ---------------------------------------------------------- nội dung bài học */
.rich-content { line-height: 1.78; font-size: .97rem; }
.rich-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 10px 0; }
.rich-content h2, .rich-content h3 { margin-top: 1.4em; }
.rich-content ul, .rich-content ol { padding-left: 24px; }
.rich-content li { margin-bottom: 6px; }
.rich-content blockquote {
    border-left: 4px solid var(--primary-light); margin: 14px 0; padding: 8px 16px;
    background: var(--bg-soft); border-radius: 0 12px 12px 0; color: var(--text-soft);
}
.rich-content pre { background: #1E2140; color: #EAECFB; padding: 14px 16px; border-radius: 12px; overflow-x: auto; font-size: .85rem; }
.rich-content code { background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; font-size: .88em; }
.rich-content pre code { background: none; padding: 0; }
.rich-content table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.rich-content th, .rich-content td { border: 1px solid var(--border); padding: 9px 12px; }
.rich-content th { background: var(--bg-soft); }
.rich-content iframe, .rich-content video { max-width: 100%; border-radius: var(--radius-sm); }

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

/* ---------------------------------------------------------- xác thực */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-art {
    background: linear-gradient(150deg, var(--primary) 0%, var(--primary-light) 52%, #74B9FF 100%);
    color: #fff; padding: 46px; display: flex; flex-direction: column; justify-content: center;
    position: relative; overflow: hidden;
}
.auth-art::after {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(circle at 24% 20%, rgba(255,255,255,.2) 0, transparent 45%),
                      radial-gradient(circle at 78% 82%, rgba(255,255,255,.16) 0, transparent 48%);
}
.auth-art > * { position: relative; z-index: 2; }
.auth-art h2 { color: #fff; font-size: 2rem; }
.auth-art img { max-width: 380px; margin: 20px auto; animation: floaty 6s ease-in-out infinite; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 22px; background: var(--bg); }
.auth-card { width: min(430px, 100%); }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-logo .logo-fallback { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }
.auth-logo img { width: 46px; height: 46px; object-fit: contain; border-radius: 12px; }

/* ---------------------------------------------------------- bảo trì / lỗi */
.maintenance { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.maintenance-card { text-align: center; background: var(--card); padding: 44px; border-radius: var(--radius-lg); box-shadow: var(--shadow); max-width: 480px; }
.maintenance-emoji { font-size: 62px; animation: floaty 4s ease-in-out infinite; }
.error-page { text-align: center; padding: 60px 20px; }
.error-code { font-size: 5rem; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.error-emoji { font-size: 66px; animation: floaty 4s ease-in-out infinite; }

/* ---------------------------------------------------------- pháo giấy chúc mừng */
.confetti-piece { position: fixed; width: 10px; height: 14px; top: 0; z-index: 999; animation: confetti-fall 3.2s linear forwards; pointer-events: none; }

/* ---------------------------------------------------------- xương skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border) 50%, var(--bg-soft) 75%);
    background-size: 420px 100%; animation: shimmer 1.3s infinite linear; border-radius: 8px;
}

/* ---------------------------------------------------------- in ấn */
@media print {
    .sidebar, .topbar, .page-actions, .btn, .flash-stack, .site-footer, .public-header { display: none !important; }
    .main { margin-left: 0; }
    .content { padding: 0; }
    body { background: #fff; }
    .card, .table-wrap { box-shadow: none; border: 1px solid #ddd; }
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-inner { grid-template-columns: 1fr; }
    .hero-art { display: none; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-art { display: none; }
}

@media (max-width: 860px) {
    :root { --header-h: 60px; }
    /* Mọi lưới hai cột đặt bằng style nội tuyến đều xếp thành một cột trên điện thoại
       (bỏ qua các lưới đã tự co giãn bằng auto-fill/auto-fit) */
    .grid[style*="grid-template-columns"]:not([style*="auto-fill"]):not([style*="auto-fit"]) {
        grid-template-columns: 1fr !important;
    }
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .menu-toggle { display: grid; }
    .content { padding: 18px 15px 60px; }
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .site-footer-inner { grid-template-columns: 1fr; }
    .hero { padding: 34px 24px; }
    .hero h1 { font-size: 1.95rem; }
    .card { padding: 17px; }
    .flash-stack { top: 72px; right: 12px; left: 12px; width: auto; }
    .topbar-title { display: none; }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(20,22,43,.5); z-index: 55; }
}

@media (max-width: 560px) {
    .grid-4 { grid-template-columns: 1fr; }
    h1 { font-size: 1.5rem; }
    .btn { padding: 9px 16px; font-size: .87rem; }
    .quiz-timer { top: 66px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------- trình soạn thảo & công thức */
.editor-bar {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
    padding: 7px 9px; background: var(--bg-soft); border: 1.6px solid var(--border-strong);
    border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.editor-btn {
    min-width: 32px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent;
    background: var(--card); color: var(--text); font-family: var(--font); font-size: .84rem;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: background .16s, transform .16s, border-color .16s;
}
.editor-btn:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }
.editor-btn.ed-primary { color: var(--primary); border-color: rgba(108,92,231,.32); font-weight: 700; }
.editor-btn.ed-primary:hover { color: #fff; }
.editor-btn.ed-preview { margin-left: auto; background: var(--primary); color: #fff; }
.editor-hint { font-size: .7rem; color: var(--text-mute); width: 100%; padding: 2px 2px 0; }
.editor-hint code { background: var(--card); padding: 1px 5px; border-radius: 5px; font-size: .95em; }
textarea.editor-area { border-radius: 0 0 var(--radius-sm) var(--radius-sm); border-top-color: var(--border); }

/* Công thức toán hiển thị đẹp trong nội dung */
.rich-content mjx-container[display="true"] { margin: 14px 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
mjx-container { max-width: 100%; }
.rich-content figure { margin: 16px 0; text-align: center; }
.rich-content figure img { border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.rich-content figcaption { font-size: .82rem; color: var(--text-mute); margin-top: 6px; font-style: italic; }
.answer-option mjx-container { display: inline-block; }
