:root {
  --brand: #1f5fe0;
  --brand-500: #2f6fed;
  --brand-700: #184bb6;
  --brand-50: #eef5ff;
  --brand-100: #dce9ff;
  --accent: #f39a1f;
  --accent-600: #e0860d;
  --ink: #172033;
  --muted: #5f6e82;
  --line: #e5edf5;
  --canvas: #f4f7fb;
  --navy: #0d1b30;
  --navy-800: #13243c;
  --ok: #1c9a5b;
  --ok-bg: #e7f7ee;
  --danger: #e11d48;
  --danger-bg: #fff0f3;
  --warn-bg: #fff4e5;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(18, 42, 76, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Be Vietnam Pro", system-ui, sans-serif; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hide { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.mt-l { margin-top: 24px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.btn:hover { background: var(--brand-700); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: var(--accent-600); }
.btn.outline { background: #fff; color: var(--brand); border-color: var(--brand-100); }
.btn.outline:hover { background: var(--brand-50); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--canvas); }
.btn.danger { background: #fff; color: var(--danger); border-color: #fbd0da; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.success { background: var(--ok); }
.btn.success:hover { background: #157d49; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--brand); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 13px; color: var(--ink); }
.input, select.input, textarea.input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 90px; padding: 10px 14px; resize: vertical; }
.input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.input.err { border-color: var(--danger); }
.field-err { color: var(--danger); font-size: 12.5px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.input-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* Cards and badges */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #edf2f8; }
.card.pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 16px; }
.card-body { padding: 20px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--canvas); color: var(--muted); white-space: nowrap; }
.badge.blue { background: var(--brand-50); color: var(--brand); }
.badge.green { background: var(--ok-bg); color: var(--ok); }
.badge.orange { background: var(--warn-bg); color: var(--accent-600); }
.badge.red { background: var(--danger-bg); color: var(--danger); }
.badge.dark { background: #e9edf3; color: #334155; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; }
.alert.info { background: var(--brand-50); color: var(--brand-700); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.err { background: var(--danger-bg); color: var(--danger); }
.alert.warn { background: var(--warn-bg); color: #9a5b00; }
.progress { height: 8px; background: #e8eef6; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s; }
.progress.blue > span { background: var(--brand); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button, .tabs a { border: 0; background: transparent; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs .on { color: var(--brand); border-bottom-color: var(--brand); }
.pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pills button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 14px; font-weight: 600; color: var(--muted); cursor: pointer; font-size: 13px; }
.pills .on { background: var(--brand); border-color: var(--brand); color: #fff; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg.i { width: 40px; height: 40px; color: #c3cfde; margin-bottom: 8px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 12px 14px; background: #f8fafd; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #fafcff; }

/* Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.auth-art { position: relative; overflow: hidden; background: linear-gradient(160deg, #eaf2ff 0%, #f7faff 55%, #fff4e6 100%); padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; }
.auth-art h1 { font-size: 34px; margin-top: 28px; color: var(--ink); }
.auth-art p.lead { font-size: 17px; color: var(--muted); margin-top: 12px; }
.auth-art .art { margin-top: 36px; max-width: 520px; }
.auth-side { display: grid; place-items: center; padding: 32px; background: var(--canvas); }
.auth-card { width: min(420px, 100%); padding: 32px; }
.auth-card h2 { font-size: 26px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); }
.logo .mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--brand); color: #fff; }
.logo .mark svg.i { width: 22px; height: 22px; }
.logo.light { color: #fff; }

/* Shell */
.shell { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: 248px; background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; z-index: 30; overflow-y: auto; }
.side .logo { padding: 0 8px 22px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #4b5a70; font-weight: 500; cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left; }
.nav-item:hover { background: var(--canvas); }
.nav-item.on { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.nav-item .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; }
.side .bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.shell.admin .side { background: var(--navy); border-right: 0; }
.shell.admin .nav-item { color: #a9b6c9; }
.shell.admin .nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.shell.admin .nav-item.on { background: var(--brand); color: #fff; }
.shell.admin .side .bottom { border-top-color: rgba(255,255,255,.08); }
.main { margin-left: 248px; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; min-width: 0; }
.crumbs a:hover { color: var(--brand); }
.crumbs b { color: var(--ink); font-weight: 600; }
.me { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-500), #6a9bff); color: #fff; font-weight: 700; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; }
.content { padding: 28px; max-width: 1240px; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title h1 { font-size: 24px; }
.page-title p { color: var(--muted); margin-top: 4px; }
.menu-btn { display: none; }
.bottom-nav { display: none; }
.drawer-mask { display: none; }

/* Grids */
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.stat { padding: 18px 20px; }
.stat .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.stat .sub { font-size: 12.5px; margin-top: 4px; }
.stat .ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-50); color: var(--brand); }
.stat .ico.green { background: var(--ok-bg); color: var(--ok); }
.stat .ico.orange { background: var(--warn-bg); color: var(--accent-600); }
.stat .ico.red { background: var(--danger-bg); color: var(--danger); }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--danger); font-weight: 600; }

/* Course cover */
.cover { position: relative; overflow: hidden; border-radius: 14px; background: linear-gradient(135deg, #2f6fed, #1d4ed8); color: #fff; display: flex; align-items: flex-end; padding: 12px; flex: none; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover::after { content: ""; position: absolute; right: -24px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.1); }
.cover.has-img::after { display: none; }
.cover .code { position: relative; z-index: 1; font-size: 11px; font-weight: 700; letter-spacing: .12em; opacity: .85; text-transform: uppercase; }
.cover .nm { position: relative; z-index: 1; font-weight: 700; font-size: 15px; line-height: 1.2; }
.cover.teal { background: linear-gradient(135deg, #0f766e, #115e59); }
.cover.navy { background: linear-gradient(135deg, #1d4e89, #16345c); }
.cover.orange { background: linear-gradient(135deg, #f39a1f, #d9720b); }
.cover.violet { background: linear-gradient(135deg, #6d4aed, #4c2fc4); }

/* My courses list (mockup 3) */
.course-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 200px 150px; gap: 18px; align-items: center; padding: 16px; }
.course-row + .course-row { border-top: 1px solid var(--line); }
.course-row .cover { width: 150px; height: 96px; }
.course-row h3 { font-size: 16px; }
.compact .course-row { grid-template-columns: 96px minmax(0, 1fr) 150px; gap: 14px; }
.compact .course-row .cover { width: 96px; height: 64px; }
.compact .course-row .cover .nm { display: none; }
.compact .course-row .act { display: none; }
.searchbar { position: relative; }
.searchbar svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchbar .input { padding-left: 38px; }

/* Course detail (mockup 4) */
.course-hero { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; padding: 20px; align-items: center; }
.course-hero .cover { width: 220px; height: 140px; }
.chapter { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.chapter + .chapter { margin-top: 12px; }
.chapter-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #f8fafd; cursor: pointer; font-weight: 600; }
.chapter-head .chev { margin-left: auto; transition: transform .2s; color: var(--muted); }
.chapter.closed .chev { transform: rotate(-90deg); }
.chapter.closed .lessons { display: none; }
.lesson-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.lesson-item:hover { background: #fafcff; }
.lesson-item.current { background: var(--brand-50); }
.lesson-item.current .t { color: var(--brand); font-weight: 600; }
.lesson-item .st { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none; }
.lesson-item .st.done { background: var(--ok); color: #fff; }
.lesson-item .st.play { background: var(--brand); color: #fff; }
.lesson-item .st.idle { border: 2px solid #cfd9e6; color: #cfd9e6; }
.lesson-item .st svg.i { width: 14px; height: 14px; stroke-width: 2.6; }
.lesson-item .t { flex: 1; min-width: 0; }
.lesson-item .d { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* Player (mockup 5) */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.player { position: relative; background: #0b1220; border-radius: var(--radius); overflow: hidden; user-select: none; }
.player .stage { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.player .wm-top { position: absolute; left: 16px; top: 14px; display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; font-size: 13px; text-shadow: 0 1px 3px rgba(0,0,0,.6); pointer-events: none; z-index: 3; }
.player .wm-top .logo .mark { width: 26px; height: 26px; border-radius: 8px; }
.player .wm-top .logo .mark svg.i { width: 15px; height: 15px; }
.player .wm-float { position: absolute; color: rgba(255,255,255,.55); font-size: 12px; font-weight: 600; pointer-events: none; z-index: 3; transition: left 1.2s, top 1.2s; text-shadow: 0 1px 2px rgba(0,0,0,.5); white-space: nowrap; }
.player .big-play { position: absolute; inset: 0; display: grid; place-items: center; background: transparent; border: 0; cursor: pointer; z-index: 2; }
.player .big-play span { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--brand); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.player .big-play svg.i { width: 30px; height: 30px; fill: currentColor; margin-left: 4px; }
.player .shield { position: absolute; inset: 0; z-index: 4; background: #000; display: none; place-items: center; color: #fff; font-weight: 600; text-align: center; padding: 20px; }
.player.shielded .shield { display: grid; }
.controls { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #0b1220; color: #fff; }
.controls button { border: 0; background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; }
.controls button:hover { background: rgba(255,255,255,.1); }
.controls .time { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.controls input[type="range"] { accent-color: var(--brand-500); }
.controls .seek { flex: 1; min-width: 60px; }
.controls .vol { width: 80px; }
.controls select { background: rgba(255,255,255,.1); border: 0; border-radius: 8px; color: #fff; height: 30px; padding: 0 6px; font-size: 12px; }
.controls select option { color: #000; }
.player:fullscreen { border-radius: 0; display: flex; flex-direction: column; }
.player:fullscreen .stage { flex: 1; aspect-ratio: auto; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.lesson-nav .btn { min-width: 180px; }
.side-list { max-height: calc(100vh - 140px); overflow-y: auto; }
.side-list .chapter { border-radius: 0; border: 0; border-top: 1px solid var(--line); }
.side-list .chapter + .chapter { margin-top: 0; }

/* Assignment rows (mockup 6) */
.file-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.file-row + .file-row { border-top: 1px solid var(--line); }
.pdf-ico { display: grid; place-items: center; width: 40px; height: 46px; border-radius: 8px; background: #ffe9ec; color: #e5383b; font-size: 10px; font-weight: 800; flex: none; position: relative; }
.pdf-ico.txt { background: var(--brand-50); color: var(--brand); }

/* Certificate (mockup 7) */
.cert-wrap { max-width: 820px; margin: 0 auto; }
.cert { position: relative; background: #fffdf8; border: 10px solid #c9a24c; outline: 2px solid #e8d7a8; outline-offset: -22px; padding: 44px 56px 36px; text-align: center; border-radius: 6px; box-shadow: var(--shadow); }
.cert .brand { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 700; font-size: 18px; }
.cert h2 { font-size: 26px; letter-spacing: .04em; color: #1d2b45; margin-top: 16px; }
.cert .sub { color: var(--muted); margin-top: 6px; }
.cert .name { font-family: "Great Vibes", "Be Vietnam Pro", cursive; font-size: 46px; color: var(--brand-700); margin-top: 14px; line-height: 1.2; }
.cert .course { font-size: 22px; font-weight: 700; margin-top: 8px; color: #1d2b45; }
.cert .meta { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 30px; text-align: left; }
.cert .seal { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle, #f7d774 0%, #d4a83a 70%); color: #7a5a10; font-weight: 800; border: 4px solid #fff3cf; box-shadow: 0 0 0 3px #d4a83a; }
.cert .sign { font-family: "Great Vibes", cursive; font-size: 28px; color: #1d2b45; border-bottom: 1px solid #c9d3e0; padding-bottom: 2px; }

/* Video call (mockup 8) */
.call { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 20px; }
.call + .call { border-top: 1px solid var(--line); }
.cal { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--brand-50); color: var(--brand); }
.cal svg.i { width: 26px; height: 26px; }

/* Devices (mockup 9) */
.device { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 20px; }
.device + .device { border-top: 1px solid var(--line); }
.device .dico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--brand-50); color: var(--brand); }
.device .dico svg.i { width: 26px; height: 26px; }
.device.empty-slot { opacity: .55; }
.device.empty-slot .dico { background: var(--canvas); color: #b6c3d4; }

/* Profile (mockup 2) */
.info-table { display: grid; grid-template-columns: 160px minmax(0, 1fr); }
.info-table > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.info-table > div:nth-child(odd) { color: var(--muted); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mini-stats > div { border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; }
.mini-stats b { display: block; font-size: 26px; margin-top: 4px; }

/* Admin */
.dropzone { border: 2px dashed #cbd8ea; border-radius: 16px; padding: 26px 20px; text-align: center; background: #fafcff; transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--brand); background: var(--brand-50); }
.dropzone svg.i { width: 34px; height: 34px; color: var(--brand); }
.upbar { height: 6px; border-radius: 99px; background: #e5edf7; overflow: hidden; margin-top: 10px; }
.upbar span { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; height: 100%; }
.bars .b span { width: 100%; max-width: 26px; background: var(--brand-500); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars .b small { font-size: 10px; color: var(--muted); }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) 160px 52px; gap: 12px; align-items: center; padding: 8px 0; }
.hbar .track { height: 10px; background: #edf2f8; border-radius: 99px; overflow: hidden; }
.hbar .track span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-500), #6a9bff); border-radius: 99px; }
.lesson-admin { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); align-items: start; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form .input { height: 36px; border-radius: 10px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Toast */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 360px; font-size: 13.5px; animation: pop .2s ease; }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.loading { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--brand-100); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }

/* Tablet */
@media (max-width: 1180px) {
  .side { width: 78px; padding: 18px 10px; }
  .side .logo span:not(.mark), .side .nav-item .lbl, .side .nav-item .count { display: none; }
  .side .logo { padding: 0 0 18px; justify-content: center; }
  .nav-item { justify-content: center; padding: 12px; }
  .main { margin-left: 78px; }
  .split, .watch { grid-template-columns: minmax(0, 1fr); }
  .course-row { grid-template-columns: 130px minmax(0, 1fr) 170px; }
  .course-row .act { grid-column: 2 / -1; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-list { max-height: none; }
}
/* Mobile */
@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .side { transform: translateX(-100%); width: 270px; transition: transform .2s; padding: 20px 14px; }
  .side .logo span:not(.mark), .side .nav-item .lbl, .side .nav-item .count { display: inline; }
  .side .logo { justify-content: flex-start; padding: 0 8px 18px; }
  .nav-item { justify-content: flex-start; padding: 10px 12px; }
  .shell.drawer .side { transform: none; }
  .shell.drawer .drawer-mask { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 25; }
  .main { margin-left: 0; padding-bottom: 70px; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px; }
  .crumbs { display: none; }
  .me .who { display: none; }
  .g2, .g3, .g4, .form-grid, .mini-stats { grid-template-columns: minmax(0, 1fr); }
  .g4.keep, .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .course-row { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .course-row .cover { width: 96px; height: 70px; }
  .course-row .prog, .course-row .act { grid-column: 1 / -1; }
  .course-hero { grid-template-columns: 1fr; }
  .course-hero .cover { width: 100%; height: 150px; }
  .lesson-nav .btn { min-width: 0; flex: 1; }
  .controls .vol, .controls .hide-m { display: none; }
  .call, .device { grid-template-columns: 44px minmax(0, 1fr); }
  .call > :last-child, .device > :last-child { grid-column: 1 / -1; }
  .cal, .device .dico { width: 44px; height: 44px; }
  .cert { padding: 28px 18px; border-width: 6px; }
  .cert .name { font-size: 32px; }
  .info-table { grid-template-columns: 120px 1fr; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: 62px; background: #fff; border-top: 1px solid var(--line); z-index: 20; }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; color: var(--muted); }
  .bottom-nav a.on { color: var(--brand); font-weight: 600; }
  .shell.admin .bottom-nav { display: none; }
  .shell.admin .main { padding-bottom: 0; }
  .hbar { grid-template-columns: minmax(0, 1fr) 90px 40px; }
  .lesson-admin { grid-template-columns: minmax(0, 1fr); }
  .lesson-admin > :last-child { justify-content: flex-start !important; }
  .controls { gap: 4px; padding: 8px 10px; }
  .controls select { display: none; }
}
@media print {
  body * { visibility: hidden; }
  .cert, .cert * { visibility: visible; }
  .cert { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; }
}
