/* =========================================================
   LMS design system
   Brand: deep indigo + violet, slate neutrals, emerald success
   ========================================================= */
:root {
  --brand: #4f46e5;
  --brand-600: #4338ca;
  --brand-700: #3730a3;
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --violet: #7c3aed;
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --grad-soft: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e6e9f0;
  --line-2: #eef1f6;

  --success: #10b981;
  --success-50: #ecfdf5;
  --danger: #ef4444;
  --danger-50: #fef2f2;
  --warn: #f59e0b;
  --warn-50: #fffbeb;
  --info: #0ea5e9;
  --info-50: #f0f9ff;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --sh-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --sh-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --sh: 0 4px 6px -1px rgba(15, 23, 42, .06), 0 10px 24px -4px rgba(15, 23, 42, .08);
  --sh-lg: 0 20px 50px -12px rgba(15, 23, 42, .25);
  --ring: 0 0 0 4px rgba(79, 70, 229, .15);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-head: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; line-height: 1.25; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.bold { font-weight: 700; }
.mono { font-family: "Cascadia Code", Consolas, monospace; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ico.sm { width: 15px; height: 15px; }
.ico.lg { width: 22px; height: 22px; }
.ico.fill { fill: currentColor; stroke: none; }
::selection { background: var(--brand-100); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd5e1; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #b6bdcc; }

/* ---------- buttons ---------- */
.btn { --b: var(--brand); display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; background: var(--b); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .18s var(--ease), box-shadow .18s, transform .12s, border-color .18s, color .18s; box-shadow: 0 1px 2px rgba(79, 70, 229, .25), inset 0 1px 0 rgba(255, 255, 255, .12); text-decoration: none; }
.btn:hover { background: var(--brand-600); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.grad { background: var(--grad); }
.btn.grad:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: #eef1f6; color: var(--ink); }
.btn.light { background: #fff; color: var(--ink-2); border-color: var(--line); box-shadow: var(--sh-xs); }
.btn.light:hover { background: var(--surface-2); border-color: #d6dbe5; color: var(--ink); }
.btn.soft { background: var(--brand-50); color: var(--brand); box-shadow: none; }
.btn.soft:hover { background: var(--brand-100); }
.btn.danger { background: var(--danger); box-shadow: 0 1px 2px rgba(239, 68, 68, .3); }
.btn.danger:hover { background: #dc2626; }
.btn.danger-soft { background: var(--danger-50); color: #dc2626; box-shadow: none; }
.btn.danger-soft:hover { background: #fee2e2; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn .spin { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.field > label.dropzone { display: flex; margin: 0; font-weight: 400; font-size: 13px; color: var(--muted); }
.field > label.dropzone:hover { color: var(--brand); }
.field > label.switch { display: inline-flex; margin: 0; font-size: 13.5px; }
.field > label.check { display: flex; font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.input, input[type=text], input[type=password], input[type=date], input[type=url], input[type=search], input[type=number], textarea, select {
  width: 100%; height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 14px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; box-shadow: var(--sh-xs);
}
textarea { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center; cursor: pointer; }
input:hover, textarea:hover, select:hover { border-color: #d3d9e4; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.input-icon { position: relative; }
.input-icon > .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon > input { padding-left: 40px; }
.input-icon > .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--faint); cursor: pointer; padding: 6px; border-radius: 6px; display: grid; }
.input-icon > .eye:hover { color: var(--ink-2); background: #f1f4f9; }
.input-group { display: flex; gap: 8px; }
.input-group > input { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; user-select: none; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; margin: 0; }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.switch input { display: none; }
.switch .track { width: 40px; height: 23px; border-radius: 20px; background: #d5dae4; position: relative; transition: background .2s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .22s var(--ease); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(17px); }

/* segmented control */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #f1f4f9; border-radius: 11px; padding: 4px; gap: 4px; }
.segmented label { display: flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; transition: all .18s; }
.segmented input { display: none; }
.segmented label:has(input:checked) { background: #fff; color: var(--brand); box-shadow: var(--sh-sm); }

/* dropzone */
.dropzone { border: 2px dashed #d5dbe7; border-radius: var(--r); padding: 22px; text-align: center; cursor: pointer; transition: all .18s; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.dropzone .dz-icon { width: 44px; height: 44px; border-radius: 12px; background: #fff; display: grid; place-items: center; box-shadow: var(--sh-sm); color: var(--brand); margin-bottom: 4px; }
.dropzone b { color: var(--ink); font-size: 14px; }
.dropzone input { display: none; }
.file-chip { display: flex; align-items: center; gap: 10px; background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-700); padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 13px; margin-top: 10px; }
.file-chip span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { background: none; border: 0; color: inherit; cursor: pointer; display: grid; padding: 2px; border-radius: 6px; }
.file-chip button:hover { background: var(--brand-100); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.card.pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.card-body { padding: 22px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 6px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--success-50); color: #047857; }
.badge.off { background: var(--danger-50); color: #b91c1c; }
.badge.warn { background: var(--warn-50); color: #b45309; }
.badge.info { background: var(--info-50); color: #0369a1; }
.badge.gray { background: #f1f4f9; color: var(--ink-2); }
.badge.brand { background: var(--brand-50); color: var(--brand); font: 600 12px var(--font); letter-spacing: 0; gap: 5px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500; line-height: 1.45; }
.alert.error { background: var(--danger-50); color: #b91c1c; border: 1px solid #fecaca; }
.alert.info { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }
.alert.warn { background: var(--warn-50); color: #92400e; border: 1px solid #fde68a; }
.alert .ico { margin-top: 1px; }

.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; background: var(--grad); letter-spacing: .02em; }
.avatar.sm { width: 32px; height: 32px; font-size: 12.5px; }
.avatar.lg { width: 48px; height: 48px; font-size: 17px; }

.progress { height: 8px; background: #eceff5; border-radius: 10px; overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); border-radius: 10px; transition: width .5s var(--ease); }
.progress.ok > div { background: linear-gradient(90deg, #10b981, #34d399); }

.empty-state { text-align: center; padding: 56px 24px; }
.empty-state .em-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--grad-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 16px; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); max-width: 380px; margin: 0 auto 18px; }

.skeleton { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 50%, #eef1f6 75%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.fade-in { animation: fadeIn .35s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- table ---------- */
.table-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 14px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafbfd; }
tbody tr:last-child td { border-bottom: 0; }
.cell-user { display: flex; align-items: center; gap: 12px; }
.cell-user .name { font-weight: 600; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; background: #f1f4f9; color: var(--ink-2); font-size: 12px; font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- modal / dialogs ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: bgIn .2s ease both; }
@keyframes bgIn { from { opacity: 0; } }
.modal { background: #fff; border-radius: var(--r-xl); width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--sh-lg); animation: modalIn .28s var(--ease) both; }
.modal.wide { max-width: 760px; }
.modal.narrow { max-width: 420px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 6px; }
.modal-head .m-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex-shrink: 0; }
.modal-head .m-icon.danger { background: var(--danger-50); color: var(--danger); }
.modal-head .m-icon.ok { background: var(--success-50); color: var(--success); }
.modal-head h3 { font-size: 18px; }
.modal-head p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.modal-head .x { margin-left: auto; background: none; border: 0; color: var(--faint); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.modal-head .x:hover { background: #f1f4f9; color: var(--ink); }
.modal-body { padding: 16px 24px 8px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--line-2); margin-top: 8px; }

.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 500; font-size: 14px; box-shadow: var(--sh-lg); animation: toastIn .3s var(--ease) both; min-width: 240px; }
.toast .ico { color: #34d399; }
.toast.err .ico { color: #f87171; }
.toast.out { animation: toastOut .25s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

.upload-progress { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--brand-50); }
.upload-progress .row { font-size: 13px; font-weight: 600; color: var(--brand-700); margin-bottom: 8px; }

/* ---------- dropdown ---------- */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-lg); padding: 6px; min-width: 210px; z-index: 60; animation: modalIn .18s var(--ease) both; }
.menu .menu-head { padding: 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; text-align: left; }
.menu button:hover, .menu a:hover { background: #f4f6fa; color: var(--ink); }
.menu .danger { color: #dc2626; }
.menu .danger:hover { background: var(--danger-50); color: #dc2626; }

/* =========================================================
   Auth pages
   ========================================================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-art { position: relative; overflow: hidden; background: #1e1b4b; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; }
.auth-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 20%, rgba(124, 58, 237, .65), transparent 45%), radial-gradient(circle at 85% 75%, rgba(79, 70, 229, .8), transparent 50%), radial-gradient(circle at 60% 10%, rgba(14, 165, 233, .35), transparent 40%); }
.auth-art::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 80%); }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .brand-lg { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 800; font-size: 21px; }
.auth-art .hero { margin-top: auto; margin-bottom: auto; max-width: 470px; }
.auth-art h1 { color: #fff; font-size: 40px; line-height: 1.12; letter-spacing: -.03em; }
.auth-art h1 span { background: linear-gradient(90deg, #c4b5fd, #93c5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art .lead { color: #c7d2fe; font-size: 16px; margin-top: 16px; line-height: 1.6; }
.auth-feats { display: grid; gap: 14px; margin-top: 34px; }
.auth-feat { display: flex; gap: 14px; align-items: center; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(8px); padding: 14px 16px; border-radius: 14px; }
.auth-feat .fi { width: 40px; height: 40px; border-radius: 10px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; flex-shrink: 0; }
.auth-feat b { display: block; font-size: 14.5px; }
.auth-feat span { color: #c7d2fe; font-size: 13px; }
.auth-art .foot { color: #a5b4fc; font-size: 12.5px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.auth-box { width: 100%; max-width: 390px; }
.auth-box h2 { font-size: 27px; }
.auth-box .sub { color: var(--muted); margin: 8px 0 28px; }
.auth-box .note { display: flex; gap: 10px; align-items: center; margin-top: 22px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; border: 1px solid var(--line-2); }
.logo-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px -4px rgba(79, 70, 229, .5); flex-shrink: 0; }
.logo-mark.sm { width: 34px; height: 34px; border-radius: 10px; }
.auth-art .logo-mark { background: rgba(255, 255, 255, .15); box-shadow: none; border: 1px solid rgba(255, 255, 255, .2); }
.auth .mobile-brand { display: none; }
/* logo + two-line wordmark */
.logo-img { width: 48px; height: 48px; flex-shrink: 0; filter: drop-shadow(0 6px 12px rgba(79, 70, 229, .35)); }
.logo-img.sm { width: 38px; height: 38px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand-txt b { font-family: var(--font-head); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 1em; }
.brand-txt small { font-size: .56em; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; margin-top: 3px;
  background: linear-gradient(90deg, #d97706, #f59e0b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.a-side .brand-txt small, .auth-art .brand-txt small { background: linear-gradient(90deg, #fbbf24, #fde68a); -webkit-background-clip: text; background-clip: text; }

/* =========================================================
   Student: top navigation + dashboard
   ========================================================= */
.nav { position: sticky; top: 0; z-index: 40; height: 66px; background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.nav-in { max-width: 1240px; margin: 0 auto; height: 100%; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: -.02em; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.nav-links a.active, .nav-links a:hover { color: var(--ink); background: #f1f4f9; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 1px solid transparent; padding: 4px 8px 4px 4px; border-radius: 30px; cursor: pointer; transition: all .15s; }
.user-btn:hover { background: #f1f4f9; }
.user-btn .nm { font-weight: 600; font-size: 13.5px; color: var(--ink); text-align: left; line-height: 1.2; }
.user-btn .nm small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }

.page { max-width: 1240px; margin: 0 auto; padding: 30px 24px 60px; }
.welcome { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 34px 36px; background: #1e1b4b; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.welcome::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 0% 0%, rgba(124, 58, 237, .7), transparent 50%), radial-gradient(circle at 100% 100%, rgba(79, 70, 229, .9), transparent 55%); }
.welcome > * { position: relative; }
.welcome h1 { color: #fff; font-size: 28px; }
.welcome p { color: #c7d2fe; margin-top: 6px; font-size: 15px; }
.w-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.w-stat { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(6px); border-radius: 14px; padding: 14px 18px; min-width: 128px; }
.w-stat .n { font-family: var(--font-head); font-size: 26px; font-weight: 800; line-height: 1.1; }
.w-stat .l { color: #c7d2fe; font-size: 12.5px; margin-top: 2px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 36px 0 16px; gap: 12px; }
.section-title h2 { font-size: 20px; }

.resume-card { display: grid; grid-template-columns: 260px 1fr auto; gap: 22px; align-items: center; padding: 16px; }
.resume-card .rc-thumb { aspect-ratio: 16/9; border-radius: 12px; background: var(--grad) center/cover; position: relative; overflow: hidden; }
.resume-card .rc-thumb .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15, 23, 42, .25); }
.resume-card .rc-thumb .play span { width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, .95); color: var(--brand); display: grid; place-items: center; box-shadow: var(--sh); }
.kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); }

.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.c-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; color: var(--ink); box-shadow: var(--sh-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.c-card:hover { transform: translateY(-4px); box-shadow: var(--sh); border-color: #dfe3ec; }
.c-thumb { aspect-ratio: 16/9; position: relative; overflow: hidden; background: var(--grad); }
.c-thumb .img { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .5s var(--ease); }
.c-card:hover .c-thumb .img { transform: scale(1.05); }
.c-thumb .letter { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-size: 54px; font-weight: 800; color: rgba(255, 255, 255, .9); }
.c-thumb .pill { position: absolute; left: 12px; top: 12px; background: rgba(15, 23, 42, .6); backdrop-filter: blur(6px); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 20px; display: flex; gap: 6px; align-items: center; }
.c-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.c-body h3 { font-size: 16.5px; line-height: 1.35; }
.c-meta { display: flex; gap: 14px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.c-meta span { display: flex; align-items: center; gap: 5px; }
.c-foot { margin-top: auto; padding-top: 6px; }
.c-foot .row { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; justify-content: space-between; }

/* =========================================================
   Student: course player (dark theatre)
   ========================================================= */
body.theatre { background: #0b1020; color: #e2e8f0; }
body.theatre h1, body.theatre h2, body.theatre h3 { color: #f8fafc; }
.p-top { height: 62px; background: #0f162b; border-bottom: 1px solid rgba(255, 255, 255, .07); display: flex; align-items: center; gap: 16px; padding: 0 20px; position: sticky; top: 0; z-index: 40; }
.p-top .back { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #cbd5e1; border: 1px solid rgba(255, 255, 255, .1); transition: all .15s; }
.p-top .back:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.p-top .ctitle { font-family: var(--font-head); font-weight: 700; font-size: 15.5px; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-top .ring-wrap { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #94a3b8; font-weight: 600; }
.ring { width: 38px; height: 38px; }
.ring circle { fill: none; stroke-width: 4; }
.ring .bg { stroke: rgba(255, 255, 255, .12); }
.ring .fg { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); transform: rotate(-90deg); transform-origin: center; }
.p-top .user-btn:hover { background: rgba(255, 255, 255, .08); }
.p-top .user-btn .nm { color: #f1f5f9; }

.p-layout { display: grid; grid-template-columns: 390px 1fr; min-height: calc(100vh - 62px); }
.p-main { min-width: 0; }
.p-stage { background: #000; position: relative; }
.player-box { position: relative; width: 100%; max-height: calc(100vh - 62px - 120px); aspect-ratio: 16/9; margin: 0 auto; background: #000; user-select: none; -webkit-user-select: none; }
.player-box video, .player-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-box:fullscreen { max-height: none; aspect-ratio: auto; }
.player-box .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #64748b; text-align: center; }
.watermark { position: absolute; pointer-events: none; color: #fff; opacity: .45; font-size: 15px; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .15); transition: top 2s var(--ease), left 2s var(--ease); z-index: 5; white-space: nowrap; font-family: var(--font); letter-spacing: .02em; }
.fs-btn { position: absolute; top: 14px; right: 14px; z-index: 6; background: rgba(15, 23, 42, .65); backdrop-filter: blur(6px); color: #fff; border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; padding: 8px 12px; cursor: pointer; font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .25s; display: flex; align-items: center; gap: 6px; }
.player-box:hover .fs-btn { opacity: 1; }
/* ---- student notes (dark player page) ---- */
.notes { white-space: normal; display: flex; flex-direction: column; gap: 16px; }
.note-new { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .09); border-radius: 14px; padding: 14px; }
.note-head { display: flex; align-items: center; gap: 10px; color: #94a3b8; font-size: 12.5px; margin-bottom: 10px; }
body.theatre textarea { background: rgba(0, 0, 0, .25); border-color: rgba(255, 255, 255, .1); color: #f1f5f9; box-shadow: none; }
body.theatre textarea:focus { border-color: #818cf8; box-shadow: 0 0 0 4px rgba(129, 140, 248, .15); }
.note-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.time-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 8px; border: 0; background: rgba(129, 140, 248, .16); color: #c7d2fe; font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.time-chip:hover { background: rgba(129, 140, 248, .3); color: #fff; }
.time-chip.static { cursor: default; }
.seg-dark { display: inline-flex; background: rgba(255, 255, 255, .06); border-radius: 9px; padding: 3px; gap: 3px; }
.seg-dark button { border: 0; background: none; color: #94a3b8; font-weight: 600; font-size: 12.5px; padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.seg-dark button.active { background: rgba(255, 255, 255, .12); color: #fff; }
.note-list { display: flex; flex-direction: column; gap: 10px; }
.note-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .07); transition: border-color .15s; }
.note-item:hover { border-color: rgba(255, 255, 255, .14); }
.note-lec { font-size: 12px; font-weight: 700; color: #a5b4fc; margin-bottom: 4px; }
.note-body { color: #e2e8f0; white-space: pre-wrap; line-height: 1.6; font-size: 14.5px; word-break: break-word; }
.note-meta { color: #64748b; font-size: 12px; margin-top: 6px; }
.note-actions { display: flex; gap: 2px; opacity: .4; transition: opacity .15s; }
.note-item:hover .note-actions { opacity: 1; }
.note-actions button { border: 0; background: none; color: #94a3b8; padding: 6px; border-radius: 7px; cursor: pointer; display: grid; }
.note-actions button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.note-empty { display: flex; gap: 14px; align-items: center; color: #64748b; padding: 18px; border: 1px dashed rgba(255, 255, 255, .1); border-radius: 12px; }

/* ---- announcements (student dashboard) ---- */
.ann-list { display: grid; gap: 12px; }
.ann { display: flex; gap: 16px; padding: 18px 20px; align-items: flex-start; }
.ann .ai { width: 42px; height: 42px; border-radius: 12px; background: var(--grad-soft); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.ann.pinned { border-color: #c7d2fe; background: linear-gradient(135deg, #fff 60%, #f5f3ff); }
.ann h3 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann .ab { color: var(--ink-2); margin-top: 6px; white-space: pre-wrap; line-height: 1.6; font-size: 14px; }
.ann .ab.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ann .am { color: var(--muted); font-size: 12.5px; margin-top: 8px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ann .more { background: none; border: 0; color: var(--brand); font-weight: 600; cursor: pointer; padding: 0; font-size: 12.5px; }
.new-dot { background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 10px; letter-spacing: .04em; }
.bell-btn { position: relative; }
.bell-btn .cnt { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }

/* ---- admin extras ---- */
.a-side .count.alert { background: var(--danger); color: #fff; }
.alert-banner { display: flex; gap: 14px; align-items: center; padding: 16px 20px; border-radius: var(--r-lg); background: linear-gradient(135deg, #fef2f2, #fff7ed); border: 1px solid #fecaca; margin-bottom: 22px; }
.alert-banner .bi { width: 42px; height: 42px; border-radius: 12px; background: #fee2e2; color: var(--danger); display: grid; place-items: center; flex-shrink: 0; }
.alert-card { padding: 18px 20px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border-left: 4px solid var(--danger); }
.alert-card.warn { border-left-color: var(--warn); }
.alert-card .counts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.pbar { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.pbar .progress { flex: 1; height: 7px; }
.pbar b { font-size: 13px; width: 38px; text-align: right; }
.inactive { color: #b45309; font-weight: 600; }
.inactive.bad { color: #dc2626; }
.mod-report { border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; overflow: hidden; }
.mod-report .mh { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--surface-2); font-weight: 700; font-size: 13.5px; }
.mod-report .lr { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.mod-report .lr .ck { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #d5dbe5; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.mod-report .lr.done .ck { background: var(--success); border-color: var(--success); }
.mod-report .lr.started .ck { border-color: var(--brand); }
.csv-preview { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.csv-preview table td, .csv-preview table th { padding: 8px 12px; font-size: 13px; }
.csv-preview tr.bad td { background: #fef2f2; }
.step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; margin-right: 8px; }

/* ---- YouTube player with our own controls ---- */
.player-box.is-yt .fs-btn { display: none; }
.yt-wrap { position: absolute; inset: 0; overflow: hidden; background: #000; }
.yt-frame { position: absolute; }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.yt-shield { position: absolute; inset: 0; z-index: 3; cursor: pointer; }
.yt-cover { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(11, 16, 32, .55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.yt-cover.show { opacity: 1; pointer-events: auto; }
.yt-cover.solid { background: #0b1020; }
.yt-big { width: 78px; height: 78px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 30px rgba(79, 70, 229, .5); transition: transform .2s var(--ease); }
.yt-big:hover { transform: scale(1.08); }
.yt-big .ico { width: 30px; height: 30px; margin-left: 4px; }
.yt-msg { max-width: 420px; padding: 0 24px; text-align: center; color: #cbd5e1; font-weight: 600; line-height: 1.6; }
.yt-spin { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; z-index: 4; border: 3px solid rgba(255, 255, 255, .2); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; pointer-events: none; }
.yt-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; padding: 26px 14px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
.player-box.yt-active .yt-bar { opacity: 1; transform: none; }
.player-box.is-yt:not(.yt-active) { cursor: none; }
.yt-seek { position: relative; height: 16px; display: flex; align-items: center; margin-bottom: 4px; }
.yt-seek::before, .yt-buf, .yt-fill { content: ""; position: absolute; left: 0; height: 4px; border-radius: 4px; top: 6px; transition: height .15s, top .15s; }
.yt-seek::before { right: 0; background: rgba(255, 255, 255, .22); }
.yt-buf { background: rgba(255, 255, 255, .35); }
.yt-fill { background: linear-gradient(90deg, #818cf8, #a78bfa); }
.yt-seek:hover::before, .yt-seek:hover .yt-buf, .yt-seek:hover .yt-fill { height: 6px; top: 5px; }
.yt-seek input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; box-shadow: none; border: 0; }
.yt-row { display: flex; align-items: center; gap: 4px; color: #fff; }
.yt-btn { width: 38px; height: 38px; border: 0; border-radius: 8px; background: none; color: #fff; display: grid; place-items: center; cursor: pointer; }
.yt-btn:hover { background: rgba(255, 255, 255, .14); }
.yt-btn .ico.fill { width: 20px; height: 20px; }
.yt-vol { width: 80px !important; height: 4px !important; padding: 0 !important; accent-color: #a78bfa; box-shadow: none !important; border: 0 !important; background: transparent !important; }
.yt-time { font-size: 13px; font-weight: 600; margin-left: 8px; font-variant-numeric: tabular-nums; color: #e2e8f0; }
.yt-speed { width: auto !important; height: 32px !important; padding: 0 28px 0 10px !important; background-color: rgba(255, 255, 255, .12) !important; color: #fff !important; border: 0 !important; font-weight: 600; font-size: 13px !important; box-shadow: none !important; background-position: right 8px center !important; }
.yt-speed option { color: #0f172a; }
@media (max-width: 600px) { .yt-vol, .yt-btn[data-back] { display: none; } }
.next-overlay { position: absolute; inset: 0; z-index: 8; background: rgba(11, 16, 32, .88); backdrop-filter: blur(6px); display: grid; place-items: center; text-align: center; animation: bgIn .3s both; }
.next-overlay .count { width: 74px; height: 74px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: #a5b4fc; display: grid; place-items: center; font-size: 26px; font-weight: 800; margin: 0 auto 16px; animation: spin 1s linear infinite; }
.next-overlay .count span { animation: spin 1s linear infinite reverse; display: block; }
.next-overlay .lbl { color: #94a3b8; font-size: 13px; }
.next-overlay h3 { margin: 6px 0 20px; font-size: 19px; }
.privacy-shield { position: absolute; inset: 0; z-index: 9; background: #0b1020; display: grid; place-items: center; color: #94a3b8; text-align: center; font-weight: 600; }

.p-info { padding: 24px 32px 50px; max-width: 1100px; }
.p-info .crumb { color: #a5b4fc; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.p-info h1 { font-size: 24px; margin-top: 6px; }
.p-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
body.theatre .btn.light { background: rgba(255, 255, 255, .06); color: #e2e8f0; border-color: rgba(255, 255, 255, .12); box-shadow: none; }
body.theatre .btn.light:hover { background: rgba(255, 255, 255, .12); color: #fff; }
body.theatre .btn.done { background: rgba(16, 185, 129, .15); color: #34d399; border: 1px solid rgba(16, 185, 129, .35); box-shadow: none; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-top: 28px; }
.tabs button { background: none; border: 0; color: #94a3b8; font-weight: 600; font-size: 14px; padding: 12px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 8px; align-items: center; }
.tabs button.active { color: #fff; border-bottom-color: #818cf8; }
.tabs button:hover { color: #e2e8f0; }
.tab-body { padding: 22px 0; color: #cbd5e1; line-height: 1.75; white-space: pre-wrap; font-size: 15px; }
.res-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); white-space: normal; }
.res-item .ri { width: 40px; height: 40px; border-radius: 10px; background: rgba(129, 140, 248, .15); color: #a5b4fc; display: grid; place-items: center; }

.p-side { order: -1; background: #0f162b; border-right: 1px solid rgba(255, 255, 255, .07); height: calc(100vh - 62px); position: sticky; top: 62px; display: flex; flex-direction: column; }
.p-side .s-head { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.p-side .s-head h3 { font-size: 15.5px; }
.p-side .s-head .progress { background: rgba(255, 255, 255, .1); margin-top: 12px; height: 6px; }
.p-side .s-head .meta { color: #94a3b8; font-size: 12.5px; margin-top: 8px; display: flex; justify-content: space-between; }
.s-list { overflow-y: auto; flex: 1; padding-bottom: 20px; }
.s-list::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, .15); }
.mod { border-bottom: 1px solid rgba(255, 255, 255, .06); }
.mod-h { width: 100%; display: flex; align-items: center; gap: 12px; padding: 15px 20px; background: none; border: 0; color: #f1f5f9; cursor: pointer; text-align: left; transition: background .15s; }
.mod-h:hover { background: rgba(255, 255, 255, .03); }
.mod-h .mi { font-size: 11px; font-weight: 700; color: #a5b4fc; text-transform: uppercase; letter-spacing: .08em; }
.mod-h .mt { font-weight: 700; font-size: 14px; margin-top: 2px; line-height: 1.35; }
.mod-h .mc { font-size: 12px; color: #94a3b8; margin-top: 3px; }
.mod-h .chev { margin-left: auto; color: #64748b; transition: transform .25s var(--ease); }
.mod.open .mod-h .chev { transform: rotate(180deg); }
.mod-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.mod.open .mod-body { grid-template-rows: 1fr; }
.mod-body > div { overflow: hidden; }
.lec { display: flex; gap: 12px; align-items: flex-start; padding: 11px 20px 11px 22px; cursor: pointer; transition: background .15s; position: relative; }
.lec:hover { background: rgba(255, 255, 255, .04); }
.lec.active { background: rgba(129, 140, 248, .12); }
.lec.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #818cf8; }
.lec .st { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #334155; display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; color: transparent; transition: all .2s; }
.lec.done .st { background: var(--success); border-color: var(--success); color: #fff; }
.lec.active:not(.done) .st { border-color: #818cf8; color: #818cf8; }
.lec .lt { font-size: 13.5px; font-weight: 500; color: #cbd5e1; line-height: 1.4; }
.lec.active .lt { color: #fff; font-weight: 600; }
.lec .lm { font-size: 12px; color: #64748b; display: flex; gap: 10px; margin-top: 3px; align-items: center; }
.lec .lm span { display: flex; gap: 4px; align-items: center; }

/* =========================================================
   Admin
   ========================================================= */
.a-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.a-side { background: #0f172a; color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px; }
.a-side .brand { color: #fff; padding: 4px 8px 22px; line-height: 1.15; font-size: 17px; }
.a-side .nav-label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .1em; padding: 14px 12px 8px; }
.a-side a.item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #94a3b8; font-weight: 600; font-size: 14px; margin-bottom: 2px; transition: all .15s; position: relative; }
.a-side a.item:hover { background: rgba(255, 255, 255, .05); color: #e2e8f0; }
.a-side a.item.active { background: linear-gradient(90deg, rgba(99, 102, 241, .25), rgba(99, 102, 241, .08)); color: #fff; }
.a-side a.item.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #818cf8; }
.a-side a.item .ico { opacity: .9; }
.a-side .count { margin-left: auto; background: rgba(255, 255, 255, .08); color: #cbd5e1; font-size: 11.5px; padding: 1px 8px; border-radius: 10px; }
.a-side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); }
.a-side .me .nm { color: #f1f5f9; font-weight: 600; font-size: 13.5px; }
.a-side .me button { margin-left: auto; background: none; border: 0; color: #94a3b8; cursor: pointer; padding: 7px; border-radius: 8px; display: grid; }
.a-side .me button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.a-main { min-width: 0; display: flex; flex-direction: column; }
.a-top { height: 68px; background: rgba(255, 255, 255, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 32px; position: sticky; top: 0; z-index: 30; }
.a-top .crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.a-top .crumbs a { color: var(--muted); }
.a-top .crumbs a:hover { color: var(--brand); }
.a-top .crumbs b { color: var(--ink); font-weight: 700; }
.a-top .menu-btn { display: none; }
.a-content { padding: 30px 32px 60px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.stat { padding: 20px; display: flex; gap: 16px; align-items: flex-start; }
.stat .si { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.stat .si.c1 { background: var(--brand-50); color: var(--brand); }
.stat .si.c2 { background: var(--success-50); color: var(--success); }
.stat .si.c3 { background: #f5f3ff; color: var(--violet); }
.stat .si.c4 { background: var(--info-50); color: var(--info); }
.stat .si.c5 { background: var(--danger-50); color: var(--danger); }
.stat .n { font-family: var(--font-head); font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 13px; font-weight: 500; }
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-top: 22px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: 0; }
.mini-thumb { width: 72px; aspect-ratio: 16/9; border-radius: 8px; background: var(--grad) center/cover; flex-shrink: 0; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 38px; width: 260px; }
.filters { display: flex; gap: 6px; background: #eef1f6; padding: 4px; border-radius: 10px; }
.filters button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.filters button.active { background: #fff; color: var(--ink); box-shadow: var(--sh-xs); }

/* admin course cards */
.ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.ac-card { cursor: pointer; }
.ac-card .c-body { gap: 12px; }
.ac-card .c-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-2); margin: 4px -18px -18px; }
.ac-card .c-stats div { padding: 12px; text-align: center; border-right: 1px solid var(--line-2); }
.ac-card .c-stats div:last-child { border-right: 0; }
.ac-card .c-stats b { display: block; font-family: var(--font-head); font-size: 17px; }
.ac-card .c-stats span { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.new-card { border: 2px dashed #d5dbe7; border-radius: var(--r-lg); display: grid; place-items: center; min-height: 300px; color: var(--muted); cursor: pointer; transition: all .2s; background: transparent; font: inherit; }
.new-card:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.new-card .ni { width: 54px; height: 54px; border-radius: 16px; background: #fff; display: grid; place-items: center; margin: 0 auto 12px; box-shadow: var(--sh-sm); color: var(--brand); }

/* course builder */
.cb-hero { display: flex; gap: 22px; align-items: center; padding: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.cb-hero .thumb { width: 200px; aspect-ratio: 16/9; border-radius: 12px; background: var(--grad) center/cover; flex-shrink: 0; display: grid; place-items: center; color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 40px; }
.cb-hero .meta { display: flex; gap: 18px; color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 10px; flex-wrap: wrap; }
.cb-hero .meta span { display: flex; gap: 6px; align-items: center; }
.builder { display: flex; flex-direction: column; gap: 16px; }
.module { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); transition: box-shadow .2s, opacity .2s, transform .2s; }
.module.dragging { opacity: .5; box-shadow: var(--sh-lg); }
.module-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.module.collapsed .module-h { border-bottom-color: transparent; }
.module.collapsed .module-b { display: none; }
.module-h, .lrow { user-select: none; -webkit-user-select: none; }
.grip { cursor: grab; color: var(--faint); padding: 6px 2px; border-radius: 6px; display: grid; touch-action: none; }
.grip:hover { color: var(--ink-2); background: #f1f4f9; }
.grip:active { cursor: grabbing; }
.module-h .mnum { height: 26px; padding: 0 10px; border-radius: 8px; background: var(--grad); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; white-space: nowrap; }
.module-h .mtitle { font-family: var(--font-head); font-weight: 700; font-size: 15.5px; }
.module-h .msub { color: var(--muted); font-size: 12.5px; }
.module-h .collapse-btn { transition: transform .25s var(--ease); }
.module.collapsed .collapse-btn { transform: rotate(-90deg); }
.module-b { padding: 8px; }
.lec-list { min-height: 12px; display: flex; flex-direction: column; gap: 4px; padding: 2px 0; border-radius: 10px; transition: background .15s; }
.lec-list.drop-hint { background: var(--brand-50); outline: 2px dashed var(--brand-100); min-height: 52px; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; background: #fff; transition: background .15s, border-color .15s, box-shadow .15s; }
.lrow:hover { background: var(--surface-2); border-color: var(--line-2); }
.lrow.dragging { opacity: .6; background: var(--brand-50); border-color: var(--brand-100); box-shadow: var(--sh); }
.lrow .lnum { width: 38px; font-size: 12px; font-weight: 700; color: var(--faint); }
.lrow .ltype { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.lrow .ltype.v { background: var(--brand-50); color: var(--brand); }
.lrow .ltype.u { background: #f5f3ff; color: var(--violet); }
.lrow .ltitle { font-weight: 600; font-size: 14px; color: var(--ink); }
.lrow .lsub { display: flex; gap: 10px; color: var(--muted); font-size: 12px; margin-top: 2px; align-items: center; flex-wrap: wrap; }
.lrow .lsub span { display: flex; gap: 4px; align-items: center; }
.lrow .actions { opacity: 0; transition: opacity .15s; }
.lrow:hover .actions { opacity: 1; }
.add-lec { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 42px; margin-top: 6px; border: 1.5px dashed #d5dbe7; border-radius: 10px; background: none; color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; transition: all .15s; }
.add-lec:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.add-module { display: flex; align-items: center; justify-content: center; gap: 10px; height: 60px; border: 2px dashed #d5dbe7; border-radius: var(--r-lg); background: transparent; color: var(--muted); font-weight: 700; font-size: 14.5px; cursor: pointer; transition: all .18s; }
.add-module:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }

.cred-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; }
.cred-box .cr { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.cred-box .cr:last-child { border-bottom: 0; }
.cred-box .cr span { color: var(--muted); }
.cred-box .cr b { font-family: "Cascadia Code", Consolas, monospace; font-weight: 600; word-break: break-all; text-align: right; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .p-layout { grid-template-columns: 340px 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth .mobile-brand { display: flex; margin-bottom: 26px; }
  .p-layout { grid-template-columns: 1fr; }
  .p-side { order: 0; position: static; height: auto; border-right: 0; border-top: 1px solid rgba(255, 255, 255, .07); }
  .p-info { padding: 20px 18px 30px; }
  .player-box { max-height: none; }
  .resume-card { grid-template-columns: 1fr; }
  .a-shell { grid-template-columns: 1fr; }
  .a-side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 90; transform: translateX(-100%); transition: transform .3s var(--ease); }
  .a-shell.nav-open .a-side { transform: none; box-shadow: var(--sh-lg); }
  .a-top { padding: 0 16px; }
  .a-top .menu-btn { display: inline-flex; }
  .a-content { padding: 20px 16px 50px; }
  .grid2 { grid-template-columns: 1fr; }
  .search input { width: 100%; }
  .lrow .actions { opacity: 1; }
  .nav-links, .user-btn .nm { display: none; }
  .welcome { padding: 26px 22px; }
  .w-stats { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; gap: 8px; }
  .w-stat { min-width: 0; padding: 12px; }
  .w-stat .n { font-size: 20px; }
  .p-top { gap: 10px; padding: 0 12px; }
  .p-top .ring-wrap span { display: none; }
  .p-info h1 { font-size: 20px; }
  .page { padding: 20px 16px 50px; }
}
.auth-art .logo-img { width: 58px; height: 58px; }
.watermark.wm2 { font-size: 13px; opacity: .35; }
/* thumbnail shortcuts in admin */
.add-thumb { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .95); color: var(--brand); font-size: 12.5px; font-weight: 700; padding: 7px 12px; border-radius: 20px; box-shadow: var(--sh); cursor: pointer; white-space: nowrap; transition: transform .15s; }
.add-thumb:hover { transform: translateX(-50%) scale(1.05); }
.cb-hero .thumb { position: relative; overflow: hidden; }
.thumb-edit { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 8px; padding: 6px; background: rgba(15, 23, 42, .7); backdrop-filter: blur(4px); color: #fff; font: 600 12px var(--font); cursor: pointer; opacity: 0; transition: opacity .2s; }
.cb-hero .thumb:hover .thumb-edit { opacity: 1; }
.cb-hero .thumb:not([style*="background-image"]) .thumb-edit { opacity: 1; }
