/* AeroLearn professional layer — operational aviation UI, loaded last. */
:root {
  --pro-navy: #06172b;
  --pro-navy-2: #0a2948;
  --pro-cyan: #63d5ff;
  --pro-blue: #1768d4;
  --pro-ink: #10233d;
  --pro-canvas: #eef4fa;
  --pro-line: #d7e2ee;
  --pro-shadow: 0 18px 48px rgba(9, 38, 70, .10);
}

body {
  background:
    radial-gradient(circle at 88% 8%, rgba(53, 139, 231, .10), transparent 28rem),
    linear-gradient(180deg, #f7faff 0, var(--pro-canvas) 45rem);
}

.topbar {
  background: rgba(255, 255, 255, .88);
  border-bottom-color: rgba(166, 187, 210, .55);
  backdrop-filter: blur(18px) saturate(150%);
}

.sidebar {
  background:
    radial-gradient(circle at 25% 3%, rgba(99, 213, 255, .20), transparent 10rem),
    linear-gradient(165deg, #041120 0%, var(--pro-navy) 47%, #092746 100%);
}

.sidebar .brand-mark {
  background: linear-gradient(145deg, #9ae9ff, #4fc4f1);
  box-shadow: 0 10px 26px rgba(70, 196, 244, .28);
}

.sidebar .brand-mark svg { fill: #061a30; }
.brand-copy small { color: #79d9fa; }
.nav-item { border: 1px solid transparent; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 213, 255, .22), rgba(99, 213, 255, .08));
  border-color: rgba(119, 220, 255, .16);
  box-shadow: inset 3px 0 0 var(--pro-cyan), 0 8px 24px rgba(0, 0, 0, .10);
}

.content { padding-top: 28px; }

.workspace-intro {
  position: relative;
  isolation: isolate;
  min-height: 154px;
  margin: 0 0 22px;
  padding: 28px 30px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(106, 185, 235, .23);
  border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(100deg, rgba(5, 23, 43, .98) 0%, rgba(9, 47, 82, .96) 58%, rgba(17, 92, 143, .88) 100%);
  box-shadow: 0 22px 55px rgba(5, 31, 59, .18);
}

.workspace-intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 340px;
  height: 340px;
  right: -70px;
  top: -122px;
  border: 1px solid rgba(120, 221, 255, .22);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(99, 213, 255, .035), 0 0 0 110px rgba(99, 213, 255, .025);
}

.workspace-intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .17;
  background-image: linear-gradient(rgba(120, 221, 255, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 221, 255, .22) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
}

.workspace-kicker {
  margin: 0 0 8px;
  color: #7fddff;
  font: 700 12px/1.3 var(--font-body);
  letter-spacing: .15em;
}

.workspace-intro h1 {
  margin: 0;
  max-width: 720px;
  color: #fff;
  font: 750 clamp(24px, 2.3vw, 34px)/1.16 var(--font-heading);
  letter-spacing: -.035em;
}

.workspace-intro #workspaceCopy {
  margin: 9px 0 0;
  max-width: 720px;
  color: #bcd0e3;
  font-size: 14px;
}

.workspace-pulse {
  position: relative;
  flex: 0 0 auto;
  min-width: 136px;
  padding: 15px 16px 15px 42px;
  border: 1px solid rgba(135, 223, 255, .22);
  border-radius: 13px;
  background: rgba(3, 18, 34, .32);
  backdrop-filter: blur(8px);
}

.workspace-pulse > span {
  position: absolute;
  left: 17px;
  top: 22px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #55e0ae;
  box-shadow: 0 0 0 5px rgba(85, 224, 174, .13), 0 0 18px rgba(85, 224, 174, .7);
}

.workspace-pulse small,
.workspace-pulse strong { display: block; }
.workspace-pulse small { color: #7fa5c2; font-size: 10px; letter-spacing: .13em; }
.workspace-pulse strong { margin-top: 2px; color: #eaf8ff; font-size: 13px; }

.preview-mode-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: -6px 0 20px;
  padding: 13px 15px;
  border: 1px solid #c3d9f1;
  border-radius: 12px;
  background: linear-gradient(90deg, #edf6ff, #f8fbff);
  color: #173d67;
}
.preview-mode-banner[hidden] { display: none; }
.preview-mode-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #d9ecff; color: #0d65c8; font-size: 20px; }
.preview-mode-banner div { flex: 1; }
.preview-mode-banner strong, .preview-mode-banner small { display: block; }
.preview-mode-banner small { margin-top: 2px; color: #5c7590; }
.preview-mode-banner button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #9bbce0;
  border-radius: 9px;
  background: #fff;
  color: #165493;
  font: 700 13px var(--font-body);
  cursor: pointer;
}

.subtabs {
  position: relative;
  margin-bottom: 18px;
  padding: 0 2px;
}
.subtabs button { min-height: 44px; }

.panel, .report-panel, .bank-panel, .training-admin-panel, .email-admin-panel,
.course-list-card, .timeline, .empty-state, .certificate-card {
  border-color: var(--pro-line);
  border-radius: 15px;
  box-shadow: 0 6px 22px rgba(16, 52, 87, .065);
}

.primary-button, .secondary-action, .report-actions button, .settings-export button {
  min-height: 40px;
  border-radius: 9px;
  font-weight: 700;
}
.primary-button { background: linear-gradient(135deg, #1768d4, #0f58b9); }

.report-kpis { gap: 14px; }
.report-kpis article {
  position: relative;
  min-height: 116px;
  overflow: hidden;
  padding: 20px 20px 18px 22px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #f8fbff);
}
.report-kpis article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #2d83e8;
}
.report-kpis article:nth-child(3)::before { background: #13a475; }
.report-kpis article:nth-child(5)::before { background: #e89a2d; }
.report-kpis article:nth-child(6)::before { background: #8d6fe8; }
.report-kpis article::after {
  content: "";
  position: absolute;
  width: 74px;
  height: 74px;
  right: -27px;
  bottom: -31px;
  border: 12px solid rgba(39, 120, 211, .06);
  border-radius: 50%;
}
.report-kpis strong { font-size: 30px; letter-spacing: -.04em; }

.bank-table th {
  padding-top: 13px;
  padding-bottom: 13px;
  background: #edf3f9;
  color: #4a6078;
}
.bank-table td { padding-top: 14px; padding-bottom: 14px; }

/* Text actions in the learner table must not inherit the 28px icon-button rule. */
.learner-table .row-actions button {
  width: auto;
  min-width: 58px;
  min-height: 36px;
  height: auto;
  padding: 7px 10px;
  white-space: nowrap;
}
.learner-table { min-width: 1320px; table-layout: fixed; }
.learner-table td:first-child { width: auto; }
.learner-table th:nth-child(1) { width: 132px; }
.learner-table th:nth-child(2) { width: 150px; }
.learner-table th:nth-child(3) { width: 170px; }
.learner-table th:nth-child(4) { width: 210px; }
.learner-table th:nth-child(5) { width: 150px; }
.learner-table th:last-child { width: 220px; }
.learner-table .cell-input { min-width: 0; }
.learner-table th:last-child,
.learner-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  background: #fff;
  box-shadow: -12px 0 18px -18px rgba(5, 31, 59, .55);
}
.learner-table th:last-child { z-index: 2; background: #edf3f9; }

.settings-export .secondary-action { align-self: center; padding: 10px 15px; }

.login-screen {
  background: #f4f8fc;
  grid-template-columns: minmax(0, 1.08fr) minmax(460px, .92fr);
}
.login-brand-panel {
  background:
    radial-gradient(circle at 82% 78%, rgba(69, 180, 239, .25), transparent 23rem),
    linear-gradient(145deg, #03101f 0%, #08294b 65%, #0c4a75 100%);
}
.login-brand-panel::before { border-color: rgba(110, 215, 255, .18); }
.login-brand-panel::after { border-color: rgba(110, 215, 255, .13); }
.login-brand-content { width: min(540px, 74%); }
.login-brand-content h1 { max-width: 520px; font-size: clamp(38px, 4vw, 58px); letter-spacing: -.045em; }
.login-brand-content > small { max-width: 480px; font-size: 15px; }
.login-form { min-width: 0; padding: 28px; }
.login-form-inner {
  width: 100%;
  max-width: 420px;
  min-width: 0;
  padding: 38px;
  border-radius: 18px;
  box-shadow: var(--pro-shadow);
}
.login-form-inner .field, .login-form-inner input { min-width: 0; max-width: 100%; }
.login-form-inner h2 { font-size: 28px; letter-spacing: -.035em; }
.login-form-inner .primary-button { min-height: 48px; }

@media (max-width: 1100px) and (min-width: 781px) {
  .learner-table { min-width: 1250px; }
}

@media (max-width: 780px) {
  .content { padding: 20px 16px 42px; }
  .top-actions { gap: 9px; }
  .workspace-intro { min-height: 0; padding: 22px 20px; border-radius: 15px; }
  .workspace-intro h1 { font-size: 24px; }
  .workspace-intro #workspaceCopy { font-size: 13px; }
  .workspace-pulse { display: none; }
  .preview-mode-banner { align-items: flex-start; flex-wrap: wrap; }
  .preview-mode-banner div { min-width: calc(100% - 52px); }
  .preview-mode-banner button { width: 100%; }

  .subtabs::after {
    content: "";
    position: sticky;
    right: 0;
    flex: 0 0 22px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--pro-canvas));
  }

  .login-screen { grid-template-columns: minmax(0, 1fr); }
  .login-form { width: 100%; min-width: 0; padding: 18px; overflow: hidden; }
  .login-form-inner { width: 100%; max-width: 420px; min-width: 0; padding: 27px 22px; }
  .login-form-inner .field, .login-form-inner input { width: 100%; min-width: 0; }

  .learner-table { min-width: 0; }
  .learner-table th:last-child, .learner-table td:last-child { position: static; box-shadow: none; }
  .learner-table .row-actions button { min-width: 44px; min-height: 44px; padding: 0 12px; }

  .email-admin-head { align-items: stretch; flex-direction: column; gap: 16px; }
  .email-admin-head > div:first-child { min-width: 0; }
  .email-admin-head > div:last-child { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .email-admin-head > div:last-child button { min-width: 0; min-height: 44px; white-space: nowrap; }

  .settings-export { grid-template-columns: 1fr; }
  .settings-export .secondary-action { width: 100%; min-height: 44px; white-space: normal; }
}

@media (max-width: 420px) {
  .workspace-intro { padding: 20px 18px; }
  .workspace-intro h1 { font-size: 22px; }
  .email-admin-head > div:last-child { grid-template-columns: 1fr; }
  .subtabs button { padding-inline: 13px; }
}

@media (max-width: 340px) {
  .subtabs { flex-wrap: wrap; overflow: visible; }
  .subtabs::after { display: none; }
  .subtabs button { flex: 1 1 calc(50% - 2px); }
}

/* ---------------- Dark theme (default) ---------------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --text-strong: #edf5ff;
  --text-subtle: #9db0c6;
  --canvas: #07111f;
  --surface-1: #101d2e;
  --surface-2: #0b1727;
  --surface-3: #16263a;
  --border-subtle: #263a51;
  --border-strong: #4a617b;
  --text: var(--text-strong);
  --muted: var(--text-subtle);
  --line: var(--border-subtle);
  --bg: var(--canvas);
  --surface: var(--surface-1);
  --control-border: var(--border-strong);
  --shadow-sm: 0 5px 18px rgba(0, 0, 0, .22);
  --shadow-md: 0 16px 38px rgba(0, 0, 0, .30);
  --shadow-lg: 0 28px 65px rgba(0, 0, 0, .42);
}

html[data-theme="dark"] body {
  color: #edf5ff;
  background:
    radial-gradient(circle at 82% 3%, rgba(19, 114, 207, .18), transparent 29rem),
    radial-gradient(circle at 22% 80%, rgba(75, 60, 179, .08), transparent 28rem),
    linear-gradient(180deg, #081321 0%, #07101d 100%);
}

html[data-theme="dark"] .main { background: transparent; }

html[data-theme="dark"] .sidebar {
  background:
    radial-gradient(circle at 30% 0%, rgba(112, 218, 255, .30), transparent 12rem),
    linear-gradient(180deg, #0864dc 0%, #0751bd 45%, #073d92 100%);
  box-shadow: 10px 0 38px rgba(0, 20, 50, .32);
}
html[data-theme="dark"] .sidebar .brand { border-bottom-color: rgba(255,255,255,.16); }
html[data-theme="dark"] .sidebar .brand-mark { background: #fff; box-shadow: 0 10px 25px rgba(0, 24, 62, .22); }
html[data-theme="dark"] .sidebar .brand-mark svg { fill: #0960d2; }
html[data-theme="dark"] .brand-copy small,
html[data-theme="dark"] .brand-copy > span { color: rgba(255,255,255,.76); }
html[data-theme="dark"] .brand-copy strong { color: #fff; }
html[data-theme="dark"] .nav-item { color: rgba(255,255,255,.78); }
html[data-theme="dark"] .nav-item:hover { color: #fff; background: rgba(255,255,255,.10); }
html[data-theme="dark"] .nav-item.active {
  color: #fff;
  background: rgba(4, 27, 61, .30);
  border-color: rgba(255,255,255,.18);
  box-shadow: inset 3px 0 0 #80e3ff, 0 9px 26px rgba(1, 26, 65, .18);
}
html[data-theme="dark"] .logout { color: rgba(255,255,255,.74); }
html[data-theme="dark"] .logout:hover { color: #fff; background: rgba(255,255,255,.10); }
html[data-theme="dark"] .sidebar-collapse { background: #08182c; border-color: #27598f; color: #ccefff; }

html[data-theme="dark"] .topbar {
  background: rgba(8, 20, 35, .88);
  border-bottom-color: #21354b;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
html[data-theme="dark"] .breadcrumb { color: #7890a9; }
html[data-theme="dark"] .breadcrumb b { color: #43566d; }
html[data-theme="dark"] .breadcrumb strong,
html[data-theme="dark"] .profile strong { color: #e8f3ff; }
html[data-theme="dark"] .profile small { color: #8197ae; }
html[data-theme="dark"] .profile { border-left-color: #2b3d52; }
html[data-theme="dark"] .language,
html[data-theme="dark"] .notification {
  color: #c9d9e9;
  background: #101d2e;
  border-color: #2b4057 !important;
}
html[data-theme="dark"] .theme-toggle span { position: static; width: auto; height: auto; border: 0; background: none; color: #ffd06b; font-size: 18px; }
/* Theme sang: bieu tuong ☾ cung phai thoat quy tac ".notification span" (cham do 6px) cua styles.css, neu khong nut thanh o vuong trong co cham do. */
html:not([data-theme="dark"]) .theme-toggle span { position: static; width: auto; height: auto; border: 0; border-radius: 0; background: none; color: #3f4d60; font-size: 18px; line-height: 1; }

html[data-theme="dark"] .workspace-intro {
  border-color: rgba(80, 183, 255, .35);
  background: linear-gradient(105deg, #092444 0%, #0b3d72 56%, #0960ae 100%);
  box-shadow: 0 24px 60px rgba(0, 19, 46, .34);
}

/* Interactive tabs are controls, not passive labels. */
html[data-theme="dark"] .subtabs {
  gap: 6px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid #243950;
  border-radius: 13px;
  background: #0e1b2c;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 8px 22px rgba(0,0,0,.13);
}
html[data-theme="dark"] #subtabs button,
html[data-theme="dark"] .subtabs button,
html[data-theme="dark"] .panel-tabs button {
  min-height: 40px;
  padding: 8px 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #9eb2c8;
}
html[data-theme="dark"] #subtabs button::after,
html[data-theme="dark"] .subtabs button::after,
html[data-theme="dark"] .panel-tabs button::after { display: none; }
html[data-theme="dark"] #subtabs button:hover,
html[data-theme="dark"] .subtabs button:hover,
html[data-theme="dark"] .panel-tabs button:hover {
  color: #fff;
  background: #172a40;
  border-color: #304b68;
}
html[data-theme="dark"] #subtabs button[aria-selected="true"],
html[data-theme="dark"] .subtabs button[aria-selected="true"],
html[data-theme="dark"] .panel-tabs button[aria-selected="true"] {
  color: #fff;
  border-color: #398ded;
  background: linear-gradient(135deg, #2080eb, #0c5fc6);
  box-shadow: 0 8px 20px rgba(19, 105, 207, .32), inset 0 1px 0 rgba(255,255,255,.18);
}

html[data-theme="dark"] .filter-tabs,
html[data-theme="dark"] .panel-tabs {
  width: max-content;
  max-width: 100%;
  gap: 5px;
  padding: 5px;
  border: 1px solid #263a51;
  border-radius: 11px;
  background: #0d1929;
}
html[data-theme="dark"] .filter-tabs button {
  min-height: 36px;
  padding: 7px 13px;
  border: 0;
  border-radius: 8px;
  color: #9db0c6;
}
html[data-theme="dark"] .filter-tabs button:hover { color: #fff; background: #172a40; }
html[data-theme="dark"] .filter-tabs button.active {
  color: #fff;
  border: 0;
  background: #156bd5;
  box-shadow: 0 7px 18px rgba(13, 95, 198, .28);
}
html[data-theme="dark"] .filter-tabs span { color: #c5d8eb; background: rgba(255,255,255,.10); }

html[data-theme="dark"] :is(.panel,.report-panel,.bank-panel,.training-admin-panel,.email-admin-panel,.course-list-card,.timeline,.empty-state,.certificate-card,.stat-card,.results-grid article,.slide-card,.theory-deck,.material-empty) {
  color: #eaf3fd;
  border-color: #263b52;
  background: linear-gradient(145deg, #111f32, #0e1a2b);
  box-shadow: 0 11px 30px rgba(0,0,0,.17);
}
html[data-theme="dark"] :is(.panel,.report-panel,.bank-panel,.course-list-card):hover { border-color: #36577a; }
/* Nhap Excel hoc vien: styles.css dat nen trang co dinh, theme toi de chu sang tren nen trang (khong thay gi). */
html[data-theme="dark"] .import-panel { background: linear-gradient(145deg, #111f32, #0e1a2b); border-color: #263b52; color: #eaf3fd; }
html[data-theme="dark"] .import-head p:last-child,
html[data-theme="dark"] .import-file { color: #9fb4ca; }
html[data-theme="dark"] :is(.import-check,.import-message) { color: #cfdcea; }
html[data-theme="dark"] .import-message.error,
html[data-theme="dark"] .import-table .import-error { color: #ff9b9b; }
html[data-theme="dark"] .import-message.ok { color: #7fe0b5; }
html[data-theme="dark"] .import-table .import-warning { color: #f3c969; }
html[data-theme="dark"] .import-table tr.has-error td { background: #3a1a22; }
html:not([data-theme="dark"]) .import-head p:last-child { color: #5d6b7b; }
/* Danh sach tai lieu va the khoa hoc: chu toi co dinh tu styles.css tren nen toi (quet tuong phan toan app 30/09). */
html[data-theme="dark"] .material-item { border-color: #22364c; }
html[data-theme="dark"] .material-item strong { color: #eaf3fd; }
html[data-theme="dark"] .material-item:hover { background: #15283e; }
html[data-theme="dark"] .material-item.active { background: #17304d; }
html[data-theme="dark"] .course-list-card .course-code,
html[data-theme="dark"] .course-list-card .course-footer button,
html[data-theme="dark"] .course-list-card .course-thumb b { color: #8cc0ff; }
/* Man hoc (lesson player): styles.css dat nen trang co dinh, theme toi truoc day de chu sang tren nen trang
   (nut "Quay lai" vo hinh) va chu toi tren the slide nen toi (tieu de slide khong doc duoc). */
html[data-theme="dark"] .lesson-player { background: #0b1522; color: #eaf3fd; }
html:not([data-theme="dark"]) .lesson-player .player-progress { color: #4f6275; }
html[data-theme="dark"] .lesson-player > header,
html[data-theme="dark"] .lesson-player .lesson-list { background: #0f1c2d; border-color: #263b52; }
html[data-theme="dark"] .lesson-player .lesson-content { background: #0b1522; color: #eaf3fd; }
html[data-theme="dark"] .lesson-player .lesson-content label { color: #9fb4ca; }
html[data-theme="dark"] .lesson-player > header button { color: #eaf3fd; background: #16283d; border-color: #33506f; }
html[data-theme="dark"] .lesson-player > header button:hover { background: #1d3550; }
html[data-theme="dark"] .lesson-player > header small,
html[data-theme="dark"] .lesson-list-head p { color: #9fb4ca; }
html[data-theme="dark"] .lesson-list-head { border-color: #263b52; }
html[data-theme="dark"] .lesson-player .lessons strong { color: #eaf3fd; }
html[data-theme="dark"] .lesson-player .lessons small { color: #9fb4ca; }
html[data-theme="dark"] .lesson-player .lessons span { background: #1d3048; color: #d6e5f5; }
html[data-theme="dark"] .lesson-player .lessons button.active { background: #17304d; border-color: #2f5a88; }
html[data-theme="dark"] .slide-card small { color: #8fb3d9; }
html[data-theme="dark"] .slide-card h4 { color: #f3f8ff; }
html[data-theme="dark"] .slide-card pre { color: #cfdcea; }
html[data-theme="dark"] .page-strip li { background: #13243a; color: #cfdcea; border-color: #2c4561; }
html[data-theme="dark"] .page-strip li.blank { color: #7f94ab; }
html[data-theme="dark"] .page-strip li.active { background: #156bd5; border-color: #156bd5; color: #fff; }
html[data-theme="dark"] .page-strip li.done { background: #0f3b2c; border-color: #1f6b4f; color: #9fe3c4; }
html[data-theme="dark"] :is(.panel-heading,.bank-toolbar,.email-admin-head,.material-head,.theory-deck>header,.theory-deck>footer) { border-color: #273b51; }

html[data-theme="dark"] .report-kpis article,
html[data-theme="dark"] .bank-stats article {
  color: #fff;
  border-color: rgba(255,255,255,.09);
  background: linear-gradient(145deg, #153c68, #102a4a);
  box-shadow: 0 14px 30px rgba(0,0,0,.19);
}
html[data-theme="dark"] .report-kpis article:nth-child(3),
html[data-theme="dark"] .bank-stats article:nth-child(2) { background: linear-gradient(145deg, #136149, #104434); }
html[data-theme="dark"] .report-kpis article:nth-child(5),
html[data-theme="dark"] .bank-stats article:nth-child(3) { background: linear-gradient(145deg, #815019, #583715); }
html[data-theme="dark"] .report-kpis article:nth-child(6),
html[data-theme="dark"] .bank-stats article:nth-child(4) { background: linear-gradient(145deg, #493b83, #302861); }
html[data-theme="dark"] .report-kpis small,
html[data-theme="dark"] .bank-stats small { color: rgba(255,255,255,.72); }
html[data-theme="dark"] .report-kpis strong,
html[data-theme="dark"] .bank-stats strong { color: #fff; }

html[data-theme="dark"] .bank-table th { color: #aac0d7; background: #16273b; border-color: #2b4056; }
html[data-theme="dark"] .bank-table td,
html[data-theme="dark"] .bank-table td:first-child { color: #e0ebf6; border-color: #22364b; }
html[data-theme="dark"] .bank-table tbody tr:hover { background: #14273b; }
html[data-theme="dark"] .learner-table th:last-child { background: #16273b; }
html[data-theme="dark"] .learner-table td:last-child { background: #101d2e; }
html[data-theme="dark"] .cell-input { color: #dfebf7; }
html[data-theme="dark"] .cell-input:hover,
html[data-theme="dark"] .cell-input:focus { color: #fff; background: #0a1726; }

html[data-theme="dark"] :is(input,select,textarea) {
  color: #edf5ff;
  border-color: #405771;
  background: #0b1726;
}
html[data-theme="dark"] :is(input,textarea)::placeholder { color: #72869c; }
html[data-theme="dark"] option { color: #edf5ff; background: #101d2e; }
html[data-theme="dark"] .bank-search { border-color: #405771; background: #0b1726; }

html[data-theme="dark"] .secondary-action,
html[data-theme="dark"] .report-actions button,
html[data-theme="dark"] .row-actions button,
html[data-theme="dark"] .preview-mode-banner button {
  color: #c7daf0;
  border-color: #3a526c;
  background: #13243a;
}
html[data-theme="dark"] .secondary-action:hover,
html[data-theme="dark"] .report-actions button:hover,
html[data-theme="dark"] .row-actions button:hover { color: #fff; border-color: #4a8dd4; background: #193553; }
html[data-theme="dark"] .row-actions button.danger { color: #ff928e; border-color: #7c4346; }

html[data-theme="dark"] .preview-mode-banner {
  color: #ddecff;
  border-color: #305b86;
  background: linear-gradient(90deg, #102a46, #0f2136);
}
html[data-theme="dark"] .preview-mode-banner small { color: #91a9c0; }
html[data-theme="dark"] .preview-mode-icon { color: #78d8ff; background: #173c60; }

html[data-theme="dark"] :is(.page-title h1,.welcome-row h1,.course-list-content h2,.timeline h3,.empty-state h2,.material-empty h3,.material-head h3,.regulation-card h4,.training-admin-panel h3,.email-admin-head h3,.panel-heading h3) { color: #edf5ff; }
html[data-theme="dark"] :is(.page-title p,.course-list-content>p,.timeline p,.empty-state p,.material-head p,.training-admin-panel p,.email-admin-head p,.report-kpis p) { color: #91a5ba; }

html[data-theme="dark"] .course-list-content { background: linear-gradient(145deg, #111f32, #0e1a2b); }
html[data-theme="dark"] .course-list-card .course-thumb { background: linear-gradient(145deg, #0e4e8d, #092c51); }
html[data-theme="dark"] .progress-track { background: #263950; }
html[data-theme="dark"] .timeline article { border-color: #283c52; }
html[data-theme="dark"] .timeline-date { border-color: #3c526a; }

html[data-theme="dark"] .notify-panel,
html[data-theme="dark"] .modal-backdrop .question-modal {
  color: #eaf3fd;
  border-color: #30465e;
  background: #101d2e;
}
html[data-theme="dark"] .notify-panel li { color: #d7e6f5; background: #14263a; }
html[data-theme="dark"] .question-modal-head { border-color: #2b4056; }

html[data-theme="dark"] .login-screen { background: #07111f; }
html[data-theme="dark"] .login-form { background: radial-gradient(circle at 50% 20%, #102946, #07111f 72%); }
html[data-theme="dark"] .login-form-inner {
  color: #eaf3fd;
  border-color: #2d435b;
  background: linear-gradient(145deg, #13243a, #0d1929);
  box-shadow: 0 30px 80px rgba(0,0,0,.40);
}
html[data-theme="dark"] .login-form-inner h2 { color: #fff; }
html[data-theme="dark"] .login-form-inner > p:nth-of-type(2),
html[data-theme="dark"] .demo-accounts { color: #91a6bc; border-color: #2a3e54; }
html[data-theme="dark"] .demo-accounts strong { color: #d4e4f5; }

@media (max-width: 780px) {
  html[data-theme="dark"] .subtabs::after { background: linear-gradient(90deg, transparent, #0e1b2c); }
  html[data-theme="dark"] .bank-table tr { border-color: #294057; background: #101d2e; }
  html[data-theme="dark"] .bank-table td { border-color: #24384d; }
  html[data-theme="dark"] .bank-table td::before { color: #93aac1; }
  html[data-theme="dark"] .learner-table td:last-child { background: transparent; }
}

/* ---- Theme toi, ban diu (29/09): sidebar cung tong voi nen, chi muc dang chon co mau xanh;
   KPI nen toi, mau chi o vach trai va con so. Mot nhom mau nhan tren moi man. ---- */
html[data-theme="dark"] .sidebar {
  background: #0c1829;
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: none;
}
html[data-theme="dark"] .sidebar .brand { border-bottom-color: rgba(255,255,255,.07); }
html[data-theme="dark"] .sidebar .brand-mark { background: #1a6fd8; box-shadow: none; }
html[data-theme="dark"] .sidebar .brand-mark svg { fill: #fff; }
html[data-theme="dark"] .brand-copy small,
html[data-theme="dark"] .brand-copy > span { color: #7d91a8; }
html[data-theme="dark"] .nav-item { color: #a9b8c9; }
html[data-theme="dark"] .nav-item:hover { color: #e6eef7; background: rgba(255,255,255,.05); }
html[data-theme="dark"] .nav-item.active {
  color: #fff;
  background: rgba(76,157,255,.12);
  border-color: transparent;
  box-shadow: inset 3px 0 0 #4c9dff;
}
html[data-theme="dark"] .logout { color: #8497ad; }
html[data-theme="dark"] .logout:hover { color: #e6eef7; background: rgba(255,255,255,.05); }
html[data-theme="dark"] .sidebar-collapse { background: #0c1829; border-color: #26384d; color: #a9b8c9; }

html[data-theme="dark"] .report-kpis article,
html[data-theme="dark"] .report-kpis article:nth-child(n),
html[data-theme="dark"] .bank-stats article,
html[data-theme="dark"] .bank-stats article:nth-child(n) {
  background: #101d2e;
  border-color: #22364b;
  box-shadow: none;
}
html[data-theme="dark"] .report-kpis article::before { width: 3px; background: #4c9dff; }
html[data-theme="dark"] .report-kpis article:nth-child(3)::before { background: #2fbf8a; }
html[data-theme="dark"] .report-kpis article:nth-child(5)::before { background: #f0a63c; }
html[data-theme="dark"] .report-kpis article:nth-child(6)::before { background: #a28cf0; }
html[data-theme="dark"] .report-kpis article::after { border-color: rgba(255,255,255,.03); }
html[data-theme="dark"] .report-kpis small,
html[data-theme="dark"] .bank-stats small { color: #8da2b9; }
html[data-theme="dark"] .report-kpis strong { color: #e8f1fb; }
html[data-theme="dark"] .report-kpis article:nth-child(5) strong { color: #f5b95e; }
html[data-theme="dark"] .report-kpis article:nth-child(6) strong { color: #bba9f5; }

/* ---- Tab con tren thanh tren cung, dang nut chon (29/09) ----
   Tab con cua moi nhom nam ngay tren thanh tren cung, canh ten nhom: khong ton them mot dong.
   Mot man chi con toi da mot dong tab ben trong noi dung (loc khoa hoc, tab tai lieu). */
[hidden] { display: none !important; }

.sidebar { display: flex; flex-direction: column; }
.sidebar .logout { margin-top: auto; }

.topbar { gap: 16px; }
.breadcrumb { flex: 0 0 auto; font-weight: 600; }
.breadcrumb #breadcrumbGroup { color: var(--text, #15243a); font-size: 14px; }
.breadcrumb b:has(+ strong:empty) { display: none; }

#subtabs.subtabs {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid #d3deea;
  border-bottom: 1px solid #d3deea;
  border-radius: 12px;
  background: #eef3f9;
  box-shadow: none;
}
#subtabs.subtabs::-webkit-scrollbar { display: none; }
#subtabs.subtabs::after { display: none; }
#subtabs.subtabs button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #4d6178;
  font: 600 14px var(--font-body);
  white-space: nowrap;
  background: transparent;
}
#subtabs.subtabs button::after { display: none; }
#subtabs.subtabs button:hover { color: #15243a; background: #fff; border-color: #d3deea; }
#subtabs.subtabs button[aria-selected="true"] {
  color: #fff;
  background: #1769ce;
  border-color: #1769ce;
  box-shadow: 0 4px 12px rgba(23, 105, 206, .28);
}

/* Tab ben trong noi dung (loc khoa hoc, tab tai lieu): cung kieu nut chon nhung nho hon. */
.filter-tabs, .panel-tabs {
  width: max-content;
  max-width: 100%;
  display: flex;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid #d3deea;
  border-radius: 11px;
  background: #eef3f9;
}
.filter-tabs button, .panel-tabs button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 14px;
  border: 0;
  border-radius: 8px;
  color: #4d6178;
  font-weight: 600;
  white-space: nowrap;
  background: transparent;
}
.filter-tabs button::after, .panel-tabs button::after { display: none; }
.filter-tabs button.active, .panel-tabs button[aria-selected="true"] {
  color: #0f4ea3;
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 52, 87, .14);
}
.filter-tabs button span { margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: rgba(23,105,206,.1); font-size: 12px; }

html[data-theme="dark"] .breadcrumb #breadcrumbGroup { color: #e6eef7; }
html[data-theme="dark"] #subtabs.subtabs { border-color: #243950; background: #0e1b2c; }
html[data-theme="dark"] #subtabs.subtabs button { color: #9eb2c8; }
html[data-theme="dark"] #subtabs.subtabs button:hover { color: #fff; background: #172a40; border-color: #304b68; }
html[data-theme="dark"] #subtabs.subtabs button[aria-selected="true"] { color: #fff; background: #1f6fd6; border-color: #3a8bef; box-shadow: 0 4px 14px rgba(19,105,207,.35); }
html[data-theme="dark"] :is(.filter-tabs, .panel-tabs) { border-color: #243950; background: #0e1b2c; }
html[data-theme="dark"] :is(.filter-tabs, .panel-tabs) button { color: #9eb2c8; }
html[data-theme="dark"] .filter-tabs button.active,
html[data-theme="dark"] .panel-tabs button[aria-selected="true"] { color: #fff; background: #1c3350; box-shadow: none; }

/* Dien thoai/may tinh bang: thanh tren cung xuong dong, tab con chiem ca dong duoi, cuon ngang neu dai. */
@media (max-width: 780px) {
  .topbar { height: auto; min-height: 60px; flex-wrap: wrap; row-gap: 8px; padding-block: 8px; }
  #subtabs.subtabs { order: 10; flex: 1 1 100%; }
  #subtabs.subtabs button { flex: 1 0 auto; min-height: 40px; }
}
.filter-tabs button.active { border-bottom: 0; }
@media (max-width: 780px) {
  .topbar { column-gap: 8px; }
  .top-actions { gap: 6px; flex-wrap: nowrap; }
}

/* ---- Theme toi: cac the con nen trang (quet tuong phan 29/09) ---- */
html[data-theme="dark"] :is(.exam-card, .regulation-card) { background: #101d2e; border-color: #22364b; }
html[data-theme="dark"] .exam-metrics > div { background: #0e1b2c; border-color: #22364b; }
html[data-theme="dark"] .exam-metrics small { color: #8da2b9; }
html[data-theme="dark"] .exam-rules { background: #0e1b2c; border-color: #22364b; color: #a9b8c9; }
html[data-theme="dark"] .exam-rules strong { color: #e6eef7; }
html[data-theme="dark"] .exam-details > p { color: #a9b8c9; }
html[data-theme="dark"] .regulation-card small { color: #8da2b9; }



html[data-theme="dark"] .timeline-date span { color: #8da2b9; }
html[data-theme="dark"] .regulation-card strong,
html[data-theme="dark"] .regulation-card h4 { color: #e6eef7; }
html[data-theme="dark"] .regulation-card p { color: #a9b8c9; }
html[data-theme="dark"] .regulation-card a { color: #7db6ff; }
html[data-theme="dark"] .exam-details .course-code { color: #7db6ff; }
html[data-theme="dark"] .timeline-date span,
html[data-theme="dark"] .timeline-date strong { color: #a9b8c9; }

/* Theme sang: chu xam phu dat toi thieu ~4.5:1 tren nen trang. */
html:not([data-theme="dark"]) :where(.certificate-card small, .results-grid p, .next-lesson span, .reminder strong, .bank-search span,
  .regulation-card small, #regulationReviewed, .training-admin-panel > div > p, .timeline-date span,
  .compliance-row small) { color: #5a6b7f; }
html[data-theme="dark"] .timeline-date,
html[data-theme="dark"] .timeline-date.important { background: #0e1b2c; border-color: #2b4056; }
html[data-theme="dark"] .timeline-date.important strong { color: #ff9b95; }
html:not([data-theme="dark"]) .training-admin-panel > div > p:last-child { color: #5a6b7f; }

/* ---- Bao cao (reports.js) ---- */
.rp { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.rp-embedded.rp { grid-template-columns: minmax(0, 1fr); }
.rp-list { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 3px; padding: 12px; border: 1px solid #d3deea; border-radius: 14px; background: #fff; }
.rp-group { margin: 10px 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5a6b7f; }
.rp-group:first-child { margin-top: 2px; }
.rp-item { text-align: left; border: 0; background: transparent; border-radius: 9px; padding: 9px 11px; font: 600 14px var(--font-body); color: #33475e; cursor: pointer; }
.rp-item:hover { background: #eef3f9; color: #15243a; }
.rp-item[aria-current="true"] { background: #1769ce; color: #fff; }
.rp-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.rp-head h2 { margin: 0 0 4px; font: 700 22px var(--font-heading); }
.rp-head p { margin: 0; color: #5a6b7f; font-size: 14px; max-width: 900px; }
.rp-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; padding: 14px; border: 1px solid #d3deea; border-radius: 14px; background: #fff; }
.rp-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 12px; font-weight: 700; color: #4d6178; }
.rp-field input, .rp-field select { min-height: 40px; width: 100%; min-width: 0; border: 1px solid #b9c7d6; border-radius: 9px; padding: 7px 10px; font: 500 14px var(--font-body); color: #15243a; background: #fff; }
.rp-period { grid-column: span 2; }
.rp-period .rp-period { display: flex; align-items: center; gap: 6px; }
.rp-period small { color: #5a6b7f; font-weight: 600; }
.rp-reset { min-height: 40px; justify-self: start; }
.rp-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.rp-summary { margin: 0; font-weight: 600; color: #33475e; }
.rp-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.rp-pdf { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px dashed #9fb4ca; border-radius: 14px; background: #f7faff; }
.rp-pdf-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.rp-check { display: flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 600; font-size: 14px; }
.rp-note { margin: 0; font-size: 13px; font-weight: 600; color: #4d6178; }
.rp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid #c5d3e2; border-radius: 99px; background: #fff; font-size: 13px; cursor: pointer; }
.rp-chip:has(input:checked) { border-color: #1769ce; background: #e8f1ff; color: #0f4ea3; }
.rp-table-wrap { border: 1px solid #d3deea; border-radius: 14px; background: #fff; overflow: auto; max-height: 70vh; }
.rp-table-wrap[aria-busy="true"] { opacity: .55; }
.rp-table { min-width: 100%; }
.rp-table thead th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.rp-table td { white-space: nowrap; }
.rp-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.rp-sort span { color: #7d91a8; }
.rp-empty { text-align: center; padding: 28px !important; color: #5a6b7f; }
.rp-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: #33475e; }
.rp-page-buttons { display: flex; align-items: center; gap: 8px; }
.rp-page-buttons .secondary-action { min-width: 40px; min-height: 36px; padding: 4px 10px; }
.rp-pager select { min-height: 36px; border: 1px solid #b9c7d6; border-radius: 9px; padding: 4px 8px; }
.status-badge.tone-success { background: #e8f7f0; color: #087a55; }
.status-badge.tone-danger { background: #fff1f0; color: #b3261e; }
.status-badge.tone-warning { background: #fff6e5; color: #8a5700; }
.status-badge.tone-info { background: #eff6ff; color: #1253a8; }
.status-badge.tone-neutral { background: #eef2f7; color: #4d6178; }
td.tone-danger { color: #b3261e; font-weight: 700; }
td.tone-warning { color: #8a5700; font-weight: 700; }

html[data-theme="dark"] :is(.rp-list, .rp-filters, .rp-table-wrap) { border-color: #22364b; background: #101d2e; }
html[data-theme="dark"] .rp-item { color: #a9b8c9; }
html[data-theme="dark"] .rp-item:hover { background: #172a40; color: #fff; }
html[data-theme="dark"] .rp-item[aria-current="true"] { background: #1f6fd6; color: #fff; }
html[data-theme="dark"] :is(.rp-group, .rp-head p, .rp-period small, .rp-note, .rp-empty) { color: #8da2b9; }
html[data-theme="dark"] :is(.rp-field, .rp-summary, .rp-pager) { color: #c9d6e4; }
html[data-theme="dark"] .rp-head h2 { color: #e6eef7; }
html[data-theme="dark"] .rp-pdf { border-color: #304b68; background: #0e1b2c; }
html[data-theme="dark"] .rp-chip { border-color: #304b68; background: #101d2e; color: #c9d6e4; }
html[data-theme="dark"] .rp-chip:has(input:checked) { border-color: #3a8bef; background: #13325a; color: #fff; }
html[data-theme="dark"] .rp-pager select { color: #edf5ff; border-color: #405771; background: #0b1726; }
html[data-theme="dark"] .status-badge.tone-success { background: #0f3a2c; color: #7fe0b8; }
html[data-theme="dark"] .status-badge.tone-danger { background: #43191b; color: #ffaaa4; }
html[data-theme="dark"] .status-badge.tone-warning { background: #3e2c0f; color: #f5c77e; }
html[data-theme="dark"] .status-badge.tone-info { background: #12304f; color: #9cc8ff; }
html[data-theme="dark"] .status-badge.tone-neutral { background: #1b2a3c; color: #b4c3d3; }
html[data-theme="dark"] td.tone-danger { color: #ffaaa4; }
html[data-theme="dark"] td.tone-warning { color: #f5c77e; }

@media (max-width: 900px) {
  .rp { grid-template-columns: minmax(0, 1fr); }
  .rp-list { position: static; flex-direction: row; overflow-x: auto; padding: 6px; scrollbar-width: none; }
  .rp-group { display: none; }
  .rp-item { flex: 0 0 auto; white-space: nowrap; }
  .rp-period { grid-column: auto; }
}
@media (max-width: 520px) {
  .rp-filters { grid-template-columns: minmax(0, 1fr); }
  .rp-period .rp-period { flex-wrap: wrap; }
  .rp-period .rp-period input { flex: 1 1 130px; }
  .rp-actions .rp-buttons, .rp-actions .rp-buttons button { width: 100%; }
}

/* ---- O tim kiem danh sach (29/09) ---- */
.list-search { min-height: 40px; width: 100%; max-width: 360px; border: 1px solid #b9c7d6; border-radius: 10px; padding: 7px 12px; font: 500 14px var(--font-body); background: #fff; color: #15243a; }
.course-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.course-filter-row .filter-tabs { margin: 0; }
.list-search-row { padding: 0 14px 10px; }
.list-search-row .list-search { max-width: none; }
.list-filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.list-filter-bar select { min-height: 40px; border: 1px solid #b9c7d6; border-radius: 10px; padding: 6px 10px; background: #fff; }
.email-explorer { padding: 0 18px 18px; }
html[data-theme="dark"] :is(.list-search, .list-filter-bar select) { color: #edf5ff; border-color: #405771; background: #0b1726; }
@media (max-width: 520px) { .list-search { max-width: none; } .list-filter-bar > * { flex: 1 1 100%; } }

/* ---- Sidebar cung mot kieu cho ca hai theme (29/09): nen dac, khong vang sang; chi muc dang chon co vach xanh ---- */
html:not([data-theme="dark"]) .sidebar {
  background: #0c1829;
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: none;
}
html:not([data-theme="dark"]) .sidebar .brand { border-bottom-color: rgba(255,255,255,.07); }
html:not([data-theme="dark"]) .sidebar .brand-mark { background: #1a6fd8; box-shadow: none; }
html:not([data-theme="dark"]) .sidebar .brand-mark svg { fill: #fff; }
html:not([data-theme="dark"]) .brand-copy small,
html:not([data-theme="dark"]) .brand-copy > span { color: #7d91a8; }
html:not([data-theme="dark"]) .brand-copy strong { color: #fff; }
html:not([data-theme="dark"]) .nav-item { color: #a9b8c9; }
html:not([data-theme="dark"]) .nav-item:hover { color: #e6eef7; background: rgba(255,255,255,.05); }
html:not([data-theme="dark"]) .nav-item.active {
  color: #fff;
  background: rgba(76,157,255,.12);
  border-color: transparent;
  box-shadow: inset 3px 0 0 #4c9dff;
}
html:not([data-theme="dark"]) .logout { color: #8497ad; }
html:not([data-theme="dark"]) .logout:hover { color: #e6eef7; background: rgba(255,255,255,.05); }
html:not([data-theme="dark"]) .sidebar-collapse { background: #0c1829; border-color: #26384d; color: #a9b8c9; }

/* ---- Chong nhay khi tai trang (30/09) ----
   Chua biet da dang nhap hay chua: an khung ung dung, chi hien nen + chu AeroLearn. Neu JS loi, 6 giay sau van hien lai. */
html[data-auth="pending"] .app-shell,
html[data-auth="out"] .app-shell { visibility: hidden; }
html[data-auth="pending"] .app-shell { animation: aero-reveal 0s 6s forwards; }
@keyframes aero-reveal { to { visibility: visible; } }
html[data-auth="pending"] body::after {
  content: "AEROLEARN"; position: fixed; inset: 0; display: grid; place-items: center;
  font: 800 20px var(--font-heading); letter-spacing: .3em; color: #4c9dff; opacity: .7; pointer-events: none;
}
/* Menu theo vai tro ngay tu CSS: khong con loe menu cua vai tro kia truoc khi JS chay. */
html:not([data-role="admin"]) .admin-only { display: none !important; }
html[data-role="admin"] .learner-only { display: none !important; }

/* ---- Menu con trong sidebar ---- */
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 8px 22px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.12); animation: aero-sub-in .18s ease-out; }
.nav-sub-item { border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 8px; color: #8fa3ba; font: 500 13.5px var(--font-body); cursor: pointer; }
.nav-sub-item:hover { color: #e6eef7; background: rgba(255,255,255,.05); }
.nav-sub-item.active { color: #fff; font-weight: 600; background: rgba(76,157,255,.16); }
.nav-sub-item:focus-visible { outline: 2px solid #4c9dff; outline-offset: 1px; }
.sidebar-collapsed .nav-sub { display: none; }
@media (max-width: 780px) { .sidebar-collapsed .nav-sub { display: flex; } }
@keyframes aero-sub-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nav-sub { animation: none; } }

/* Tong quan hoc vien: moi khoa dang hoc mot dong bam duoc (learn.js renderDashboardCourses). */
.dashboard-courses { display: grid; gap: 4px; margin-top: 6px; }
.dash-course { display: flex; align-items: center; gap: 14px; padding: 14px 12px; margin: 0 -12px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.dash-course:hover, .dash-course:focus-visible { background: #f1f6fd; outline: none; }
.dash-course:focus-visible { box-shadow: 0 0 0 2px #1767cb inset; }
.dash-course + .dash-course { border-top: 1px solid var(--line); }
.dash-course-badge { flex: 0 0 auto; min-width: 48px; height: 48px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font: 800 13px var(--font-heading); letter-spacing: .04em; color: #1b5fb8; background: #e8f1fd; }
.dash-course-info { flex: 1; min-width: 0; }
.dash-course-info small { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #3b6fae; text-transform: uppercase; }
.dash-course-info h4 { font: 700 14px/1.35 var(--font-heading); margin: 3px 0; overflow-wrap: anywhere; }
.dash-course-info p { font-size: 12px; color: #536377; margin: 0 0 8px; overflow-wrap: anywhere; }
.dash-course-percent { font-size: 13px; color: #2c63b0; min-width: 38px; text-align: right; }
.dash-course.overdue .dash-course-info small { color: #b3261e; }
.course-list-card.clickable { cursor: pointer; }
.course-list-card.clickable:hover { border-color: #9fc0ea; }
.course-list-card.clickable:focus-visible { outline: 2px solid #1767cb; outline-offset: 2px; }
.course-resume { font-size: 13px; font-weight: 600; color: #1d5aa8; margin: 0 0 8px; }
.lp-media video { width: 100%; max-height: 62vh; background: #000; border-radius: 10px; display: block; }
.lp-media-note { margin: 10px 0 0; font-size: 13px; color: #536377; }
html[data-theme="dark"] .dash-course:hover, html[data-theme="dark"] .dash-course:focus-visible { background: #15283e; }
html[data-theme="dark"] .dash-course + .dash-course { border-color: #22364c; }
html[data-theme="dark"] .dash-course-badge { color: #cfe3ff; background: #1b3656; }
html[data-theme="dark"] .dash-course-info small { color: #8cc0ff; }
html[data-theme="dark"] .dash-course-info h4 { color: #eef5fd; }
html[data-theme="dark"] .dash-course-info p, html[data-theme="dark"] .lp-media-note { color: #a9bccf; }
html[data-theme="dark"] .dash-course-percent { color: #8cc0ff; }
html[data-theme="dark"] .dash-course.overdue .dash-course-info small { color: #ff9b9b; }
html[data-theme="dark"] .course-resume { color: #8cc0ff; }
html[data-theme="dark"] .course-list-card.clickable:hover { border-color: #36577a; }
@media (max-width: 520px) { .dash-course { flex-wrap: wrap; } .dash-course-info { flex-basis: calc(100% - 62px); } .dash-course-percent { margin-left: 62px; text-align: left; } .dash-course .play-button { margin-left: auto; } }
/* Theme toi: chu xanh dam co dinh tren nen toi (quet tuong phan man hoc vien 30/09). */
html[data-theme="dark"] .panel-heading button,
html[data-theme="dark"] .results-grid strong { color: #8cc0ff; }
html[data-theme="dark"] .results-grid p { color: #a9bccf; }
html[data-theme="dark"] .certificate-main h2,
html[data-theme="dark"] .certificate-main h2 span,
html[data-theme="dark"] .certificate-main h3 { color: #eef5fd; }
html[data-theme="dark"] .certificate-row { background: #13243a; border-color: #2c4561; color: #eaf3fd; }
html[data-theme="dark"] .certificate-row small { color: #a9bccf; }
html[data-theme="dark"] .certificate-row strong { color: #eef5fd; }
@media (max-width: 520px) { .dash-course-badge { width: 48px; min-width: 48px; padding: 0; font-size: 11px; overflow: hidden; } .dash-course-info { flex-basis: calc(100% - 64px); } }
/* Trinh hoc: cong tac Tu doc / Tu sang slide, lop phu "dang hoc o tab khac". */
.lp-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #34465c; cursor: pointer; user-select: none; }
.lp-toggle input { width: 16px; height: 16px; accent-color: #1767cb; cursor: pointer; }
.lp-toggle:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.lp-takeover { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(8, 17, 29, .72); backdrop-filter: blur(2px); }
.lp-takeover[hidden] { display: none !important; }
.lp-takeover-box { max-width: 420px; background: #fff; color: #15243a; border-radius: 14px; padding: 24px; box-shadow: 0 18px 50px rgba(0,0,0,.35); text-align: center; }
.lp-takeover-box h3 { margin: 0 0 8px; font: 700 18px var(--font-heading); }
.lp-takeover-box p { margin: 0 0 18px; font-size: 14px; line-height: 1.55; color: #475a70; }
html[data-theme="dark"] .lp-toggle { color: #cfdcea; }
html[data-theme="dark"] .lp-takeover-box { background: #13243a; color: #eef5fd; border: 1px solid #2c4561; }
html[data-theme="dark"] .lp-takeover-box p { color: #b4c6d8; }
/* Tong quan quan tri: o so lieu bam duoc; "Xem nhu hoc vien" la tien ich cuoi sidebar, tach khoi cac nhom nghiep vu. */
.report-kpis article.kpi-link { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.report-kpis article.kpi-link:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 50, 100, .18); }
.report-kpis article.kpi-link:focus-visible { outline: 2px solid #8cc0ff; outline-offset: 3px; }
.nav-item.nav-utility { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(160, 185, 215, .22); font-size: 13px; opacity: .92; }
/* Ban nhap phien ban moi va lich su phien ban (quan tri khoa hoc). */
.draft-pending-badge { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; color: #9a5b00; cursor: help; }
.row-actions .primary-text { color: #1459b8; font-weight: 700; }
.row-actions .danger-text { color: #b3261e; }
.version-modal { max-width: 720px; }
.version-list { display: grid; gap: 10px; max-height: 64vh; overflow: auto; padding-right: 4px; }
.version-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.version-item header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-bottom: 6px; }
.version-item header strong { font: 700 15px var(--font-heading); }
.version-item header small { color: #5a6b7f; font-size: 12px; }
.version-item ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; color: #2b3b4e; }
.version-item.is-current { border-color: #1767cb; box-shadow: inset 3px 0 0 #1767cb; }
.version-item.is-draft { border-style: dashed; border-color: #c98a1b; background: #fffaf0; }
html[data-theme="dark"] .draft-pending-badge { color: #f3c969; }
html[data-theme="dark"] .row-actions .primary-text { color: #8cc0ff; }
html[data-theme="dark"] .row-actions .danger-text { color: #ff9b9b; }
html[data-theme="dark"] .version-item { background: #13243a; border-color: #2c4561; }
html[data-theme="dark"] .version-item header strong { color: #eef5fd; }
html[data-theme="dark"] .version-item header small { color: #a9bccf; }
html[data-theme="dark"] .version-item ul { color: #cfdcea; }
html[data-theme="dark"] .version-item.is-current { border-color: #3d8bf0; box-shadow: inset 3px 0 0 #3d8bf0; }
html[data-theme="dark"] .version-item.is-draft { background: #2a2210; border-color: #a57a1f; }
/* Sua bai hoc: ten, thoi gian doc, chu tung slide (01/10/2026) */
.lesson-admin-tools { display: inline-flex; gap: 6px; align-items: center; flex-shrink: 0; }
.lesson-edit-modal { max-width: 820px; }
.lesson-edit-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 4px 0 10px; }
.lesson-edit-tools input[type="search"] { flex: 1 1 220px; min-height: 40px; border: 1px solid var(--control-border); border-radius: 8px; padding: 8px 10px; font: 500 14px var(--font-body); }
.lesson-edit-tools small { color: #5a6b7f; font-size: 12px; }
.lesson-edit-pages { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; max-height: 52vh; overflow: auto; overflow-x: hidden; padding-right: 4px; }
.lesson-edit-page { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.lesson-edit-page summary { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; cursor: pointer; font-size: 14px; font-weight: 600; color: #1d2c3d; min-height: 44px; align-items: center; }
.lesson-edit-page summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-edit-page.is-edited { border-color: #c98a1b; box-shadow: inset 3px 0 0 #c98a1b; }
.lesson-edit-badge { flex-shrink: 0; font-size: 12px; font-weight: 700; color: #9a5b00; }
.lesson-edit-fields { display: grid; gap: 8px; padding: 0 12px 12px; }
.lesson-edit-fields input, .lesson-edit-fields textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--control-border); border-radius: 8px; padding: 8px 10px; font: 500 14px/1.5 var(--font-body); color: #1d2c3d; background: #fff; }
.lesson-edit-fields textarea { resize: vertical; white-space: pre-wrap; }
.lesson-edit-fields button { justify-self: start; }
html[data-theme="dark"] .lesson-edit-tools small { color: #a9bccf; }
html[data-theme="dark"] .lesson-edit-tools input[type="search"], html[data-theme="dark"] .lesson-edit-fields input, html[data-theme="dark"] .lesson-edit-fields textarea { background: #0f1d30; color: #eef5fd; border-color: #2c4561; }
html[data-theme="dark"] .lesson-edit-page { background: #13243a; border-color: #2c4561; }
html[data-theme="dark"] .lesson-edit-page summary { color: #eef5fd; }
html[data-theme="dark"] .lesson-edit-page.is-edited { border-color: #a57a1f; box-shadow: inset 3px 0 0 #a57a1f; }
html[data-theme="dark"] .lesson-edit-badge { color: #f3c969; }
/* ---- Trinh hoc (01/10/2026): toan man hinh, nut Truoc/Tiep lon o cuoi, thanh ben tien do (ngan keo tren dien thoai) ---- */
.lesson-player > header { gap: 12px; padding: 10px 16px; }
.lesson-player .lp-head-title { flex: 1; min-width: 0; }
.lesson-player .lp-head-title strong, .lesson-player .lp-head-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-player .lp-head-button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.lesson-player .lp-head-button[hidden] { display: none; }
.lesson-player .player-progress { min-width: 150px; }
.lesson-player.sidebar-closed .player-layout { grid-template-columns: minmax(0, 1fr); }
.lesson-player.sidebar-closed .lesson-list { display: none; }
.lesson-player .lesson-list { display: flex; flex-direction: column; gap: 14px; }
.lp-sidebar-backdrop[hidden] { display: none; }
.lp-progress-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #f7faff; display: grid; gap: 6px; }
.lp-progress-card p { margin: 0; }
.lp-card-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #5a6b7f; }
.lp-card-percent { display: flex; align-items: baseline; gap: 8px; }
.lp-card-percent strong { font: 800 28px var(--font-heading); color: #125cd4; }
.lp-card-percent span { font-size: 13px; color: #5a6b7f; }
.lp-card-row { font-size: 13px; color: #26384e; font-weight: 600; }
.lp-card-row.is-soon { color: #9a5b00; }
.lp-card-row.is-overdue { color: #c0343b; }
.lp-card-note { font-size: 12px; color: #5a6b7f; }
.lp-card-exam { font-size: 13px; color: #34465c; padding: 8px 10px; border-radius: 8px; background: #eef2f7; }
.lp-card-exam.is-ready { background: #e6f6ee; color: #0f6849; font-weight: 700; }
.lp-mini-track { height: 5px; border-radius: 99px; background: #e2e8f0; overflow: hidden; margin: 2px 0 4px; }
.lp-mini-track i { display: block; height: 100%; background: #16835e; border-radius: inherit; }
.lesson-player .lessons button .lp-mini-track { margin-top: 5px; }
.lesson-player .lessons button > div { flex: 1; min-width: 0; }
.lp-slide-map { border-top: 1px solid var(--line); padding-top: 10px; }
.lp-slide-map[hidden] { display: none; }
.lp-slide-map summary { cursor: pointer; font-size: 13px; font-weight: 700; color: #26384e; min-height: 32px; display: flex; align-items: center; gap: 8px; }
.lp-slide-map summary small { font-weight: 500; color: #5a6b7f; }
.lp-slide-map .page-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; margin-top: 8px; }
.lp-slide-map .page-strip li { width: auto; height: 36px; }
.lp-slide-map .page-strip li:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.lp-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: 8px 0 0; font-size: 11px; color: #5a6b7f; }
.lp-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; border: 1px solid #c8d2de; background: #fff; vertical-align: middle; margin-right: 3px; }
.lp-legend i.seen { background: #eaf8f2; border-color: #bfe6d3; }
.lp-legend i.current { background: #125cd4; border-color: #125cd4; }
.lesson-player .lesson-slides { display: flex; flex-direction: column; gap: 12px; overflow: hidden; padding: 14px 24px 0; }
.lesson-player .slide-toolbar { flex: 0 0 auto; }
.lesson-player .lp-media { flex: 0 1 auto; }
.lesson-player .slide-card { flex: 1 1 auto; min-height: 0; overflow: auto; }
.lesson-player .slide-card pre { font-size: 17px; line-height: 1.65; }
.lesson-player.is-fullscreen .slide-card h4 { font-size: 30px; }
.lesson-player.is-fullscreen .slide-card pre { font-size: 21px; }
.lp-sync { font-size: 12px; font-weight: 700; color: #9a5b00; }
.lp-sync[hidden] { display: none; }
.lp-nav { flex: 0 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0 16px; border-top: 1px solid var(--line); }
.lp-nav-center { display: grid; justify-items: center; gap: 2px; text-align: center; }
.lp-nav-center strong { font: 700 15px var(--font-heading); color: #26384e; }
.lp-nav-center .slide-gate { display: flex; gap: 6px; align-items: center; font-size: 13px; color: #5a6b7f; }
.lp-nav-center .slide-gate.unlocked { color: #16835e; }
.lp-nav-center .slide-gate[hidden] { display: none; }
.lp-nav-actions { display: flex; justify-content: flex-end; }
.lp-nav-button { min-height: 48px; min-width: 128px; padding: 0 20px; border-radius: 10px; border: 1px solid #c8d2de; background: #fff; color: #26384e; font: 700 15px var(--font-body); cursor: pointer; }
.lp-nav-button.primary { background: #125cd4; border-color: #125cd4; color: #fff; box-shadow: 0 6px 16px rgba(20,101,232,.24); }
.lp-nav-button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.lp-nav-button[hidden] { display: none; }
.lp-nav-button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.exam-submit-notice { margin: 0 0 12px; padding: 10px 14px; border-radius: 8px; background: #fff4e0; color: #7a4a00; font-weight: 600; font-size: 14px; }
@media (max-width: 900px) {
  .lesson-player .lesson-list { display: flex; position: fixed; top: 0; bottom: 0; left: 0; width: min(86vw, 340px); z-index: 40; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .lesson-player.sidebar-open .lesson-list { transform: none; }
  .lesson-player.sidebar-closed .lesson-list { display: flex; }
  .lp-sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(8,17,29,.55); }
  .lesson-player .lp-head-label { display: none; }
  .lesson-player > header { gap: 8px; padding: 8px 10px; }
  .lesson-player > header #closeLessonPlayer { padding: 8px 10px; }
  .lesson-player .player-progress { min-width: 0; }
  .lesson-player .player-progress > div { display: none; }
  .lesson-player .lesson-slides { padding: 10px 12px 0; }
  .lesson-player .slide-toolbar { gap: 6px 10px; }
  .lesson-player .slide-card { padding: 16px; }
  .lesson-player .slide-card pre { font-size: 16px; }
  .lp-nav { gap: 8px; padding: 10px 0 max(12px, env(safe-area-inset-bottom)); }
  .lp-nav-button { min-width: 0; padding: 0 16px; }
  .lp-nav-center strong { font-size: 13px; }
}
@media (max-width: 420px) { .lp-nav #lpPrev span { display: none; } .lesson-player .lp-toggle { font-size: 12px; } }
html[data-theme="dark"] .lp-progress-card { background: #13243a; border-color: #2c4561; }
html[data-theme="dark"] .lp-card-eyebrow, html[data-theme="dark"] .lp-card-percent span, html[data-theme="dark"] .lp-card-note, html[data-theme="dark"] .lp-slide-map summary small, html[data-theme="dark"] .lp-legend { color: #a9bccf; }
html[data-theme="dark"] .lp-card-percent strong { color: #6fb0ff; }
html[data-theme="dark"] .lp-card-row, html[data-theme="dark"] .lp-slide-map summary, html[data-theme="dark"] .lp-nav-center strong { color: #eaf3fd; }
html[data-theme="dark"] .lp-card-row.is-soon, html[data-theme="dark"] .lp-sync { color: #f3c969; }
html[data-theme="dark"] .lp-card-row.is-overdue { color: #ff8a8f; }
html[data-theme="dark"] .lp-card-exam { background: #1a2d44; color: #cfdcea; }
html[data-theme="dark"] .lp-card-exam.is-ready { background: #0f3b2c; color: #9fe3c4; }
html[data-theme="dark"] .lp-mini-track { background: #243a55; }
html[data-theme="dark"] .lp-mini-track i { background: #34c38f; }
html[data-theme="dark"] .lp-slide-map, html[data-theme="dark"] .lp-nav { border-color: #263b52; }
html[data-theme="dark"] .lp-nav-center .slide-gate { color: #a9bccf; }
html[data-theme="dark"] .lp-nav-center .slide-gate.unlocked { color: #5fd3a3; }
html[data-theme="dark"] .lp-nav-button { background: #16283d; border-color: #33506f; color: #eaf3fd; }
html[data-theme="dark"] .lp-nav-button.primary { background: #1f6fe0; border-color: #1f6fe0; color: #fff; }
html[data-theme="dark"] .lp-legend i { background: #13243a; border-color: #2c4561; }
html[data-theme="dark"] .lp-legend i.seen { background: #0f3b2c; border-color: #1f6b4f; }
html[data-theme="dark"] .lp-legend i.current { background: #156bd5; border-color: #156bd5; }
html[data-theme="dark"] .exam-submit-notice { background: #3a2a0c; color: #f3d28a; }
.lesson-player .lessons { background: transparent; padding: 0; }
.lp-nav-center .slide-gate { grid-column: auto; grid-row: auto; white-space: nowrap; }
.lp-nav-center .slide-gate small { margin: 0 0 0 4px; width: 70px; }
@media (max-width: 900px) { .lp-nav-center .slide-gate { font-size: 12px; } .lp-nav-center .slide-gate small { display: none; } }
.lp-drawer-close { display: none; }
@media (max-width: 900px) { .lp-drawer-close { display: block; align-self: flex-end; min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: inherit; font: 600 14px var(--font-body); cursor: pointer; } }
.lesson-edit-insert { display: inline-flex; gap: 8px; margin-left: auto; }
.lesson-edit-page.is-inserted { border-style: dashed; }
.lesson-edit-video { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; }
.lesson-edit-video > span { flex: 1 1 200px; font-weight: 600; }
.lesson-edit-video progress { flex: 1 1 140px; height: 8px; }
.lesson-edit-video-preview { flex-basis: 100%; }
.lesson-edit-video-preview video { width: 100%; max-height: 260px; background: #000; border-radius: 8px; }
html[data-theme="dark"] .lesson-edit-video { border-color: #2c4561; color: #eaf3fd; }
/* Goi y on tap sau khi truot thi */
.exam-review-hints { grid-column: 1 / -1; margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: #fff7e8; border: 1px solid #f0d49c; }
.exam-review-hints h3 { margin: 0 0 8px; font: 700 16px var(--font-heading); color: #5c3b00; }
.exam-review-hints ul { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 4px; }
.exam-review-hints li button { padding: 0; font-size: 14px; text-align: left; }
.exam-review-hints small { color: #7a5a1f; }
.exam-review-hints p { margin: 4px 0 0; font-size: 14px; color: #4b3a1a; }
html[data-theme="dark"] .exam-review-hints { background: #2a2210; border-color: #6b5420; }
html[data-theme="dark"] .exam-review-hints h3 { color: #f3d28a; }
html[data-theme="dark"] .exam-review-hints small, html[data-theme="dark"] .exam-review-hints p { color: #e6d3a8; }
.exam-result-card.active { flex-wrap: wrap; }
.exam-review-hints { flex-basis: 100%; text-align: left; }
html[data-theme="dark"] .exam-result-card { background: #13243a; border-color: #2c4561; color: #eaf3fd; }
html[data-theme="dark"] .exam-result-card h2 { color: #f3f8ff; }
html[data-theme="dark"] .exam-result-card p, html[data-theme="dark"] .exam-result-card small, html[data-theme="dark"] .exam-result-card .result-ring span { color: #b4c6d8; }
html[data-theme="dark"] .exam-result-card .result-numbers strong, html[data-theme="dark"] .exam-result-card .result-ring strong { color: #eaf3fd; }
html[data-theme="dark"] .result-ring { background: conic-gradient(#34c38f 0deg, #34c38f var(--score-angle,0deg), #243a55 var(--score-angle,0deg)); }
html[data-theme="dark"] .result-ring:before { background: #13243a; }
/* Chung nhan: QR xac minh, nut in, ban in A4 ngang chi co the chung nhan */
.certificate-actions { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 10px; }
.certificate-actions[hidden] { display: none; }
.certificate-actions a { text-decoration: none; display: inline-flex; align-items: center; }
.certificate-qr { width: 84px; height: 84px; flex-shrink: 0; background: #fff; border-radius: 6px; padding: 2px; }
.certificate-qr svg { width: 100%; height: 100%; display: block; }
.certificate-verify-url { display: block; margin-top: 2px; font-size: 10px; opacity: .8; overflow-wrap: anywhere; }
@media print {
  body.printing-certificate * { visibility: hidden !important; }
  body.printing-certificate .certificate-card, body.printing-certificate .certificate-card * { visibility: visible !important; }
  body.printing-certificate .certificate-card { page: certificate; position: fixed; inset: 0; margin: auto; width: 100%; max-width: none; box-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* Ngan hang cau hoi: chon nhieu, thanh thao tac hang loat */
.bank-check { width: 36px; text-align: center; }
/* td:first-child{width:46%} (styles.css) de len cot o chon: cot nay chi rong vua o chon, cot cau hoi duoc phan con lai. */
.bank-table th.bank-check, .bank-table td.bank-check { width: 36px; }
.bank-check input { width: 18px; height: 18px; cursor: pointer; accent-color: #125cd4; }
.bank-bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin: 0 0 10px; border-radius: 10px; background: #eaf2ff; border: 1px solid #c9dcf5; position: sticky; top: 0; z-index: 2; }
.bank-bulk[hidden] { display: none; }
.bank-bulk strong { margin-right: auto; font-size: 14px; color: #17304c; }
html[data-theme="dark"] .bank-bulk { background: #17304d; border-color: #2f5a88; }
html[data-theme="dark"] .bank-bulk strong { color: #eaf3fd; }
/* Cot so thu tu cua ngan hang cau hoi: so chay theo danh sach dang hien (cung so voi day so o man sua cau hoi) */
.bank-table th.bank-seq, .bank-table td.bank-seq { width: 56px; text-align: right; font-variant-numeric: tabular-nums; color: #64748b; }
html[data-theme="dark"] .bank-table td.bank-seq { color: #93aac1; }
/* Trang in rieng cho chung nhan (A4 ngang); trang khac (bao cao...) giu kho giay mac dinh */
@page certificate { size: A4 landscape; margin: 12mm; }
/* Anh trong slide (tu file PowerPoint goc) */
.lp-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.lp-images[hidden] { display: none; }
.lp-images img { width: 100%; height: auto; max-height: 52vh; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.lesson-player.is-fullscreen .lp-images img { max-height: 62vh; }
html[data-theme="dark"] .lp-images img { border-color: #2c4561; }
.attempt-history { margin-top: 18px; }
.attempt-table-wrap { overflow-x: auto; }
.attempt-table td, .attempt-table th { white-space: nowrap; }
.attempt-table td:nth-child(2) { white-space: normal; min-width: 180px; }
.lesson-edit-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.lesson-edit-thumbs img { height: 64px; width: auto; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.material-images { margin: 8px 0 12px; }
.lp-rate { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.lp-rate select { border: 1px solid var(--control-border); border-radius: 6px; padding: 6px; font: 600 13px var(--font-body); }
html[data-theme="dark"] .lp-rate select { background: #0f1d30; color: #eaf3fd; border-color: #2c4561; }
.lesson-edit-subs { display: inline-flex; flex-wrap: wrap; gap: 4px; flex-basis: 100%; }
/* Bai thi tren dien thoai: dong ho dinh tren dau, bang cau hoi thanh mot hang cuon ngang ngay tren cau hoi, nut nop dinh duoi */
@media (max-width: 780px) {
  .exam-workspace.active { overflow: visible; }
  .exam-workspace-head { position: sticky; top: 0; z-index: 5; }
  .exam-layout { display: flex; flex-direction: column; }
  .exam-palette { order: -1; padding: 10px 12px; border-left: 0; border-bottom: 1px solid var(--line); }
  .exam-palette .question-grid { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 4px; scroll-snap-type: x proximity; }
  .exam-palette .question-grid button { flex: 0 0 44px; height: 44px; scroll-snap-align: start; }
  .exam-palette .palette-legend, .exam-palette > p { display: none; }
  .exam-palette .submit-exam { position: sticky; bottom: 8px; z-index: 4; margin-top: 8px; }
  .exam-options .exam-option { min-height: 48px; }
}
/* Khung lam bai thi o theme toi (truoc day nen trang, cau hoi xanh nhat gan nhu khong doc duoc) */
html[data-theme="dark"] .exam-workspace { background: #101d2e; border-color: #22364b; }
html[data-theme="dark"] .exam-question-panel { border-color: #22364b; }
html[data-theme="dark"] .exam-question-panel h2 { color: #f3f8ff; }
html[data-theme="dark"] .exam-question-meta span { color: #8fc0ff; }
html[data-theme="dark"] .exam-option { background: #13243a; border-color: #2c4561; color: #dbe7f3; }
html[data-theme="dark"] .exam-option:hover { background: #17304d; border-color: #3d6fa8; }
html[data-theme="dark"] .exam-option.selected { background: #17304d; border-color: #3d8bf0; color: #eaf3fd; }
html[data-theme="dark"] .exam-option b { border-color: #3a5878; }
html[data-theme="dark"] .exam-palette { background: #0e1b2c; border-color: #22364b; }
html[data-theme="dark"] .exam-palette strong, html[data-theme="dark"] .palette-progress span, html[data-theme="dark"] .palette-legend, html[data-theme="dark"] .exam-palette > p { color: #cfdcea; }
html[data-theme="dark"] .question-grid button { background: #13243a; border-color: #2c4561; color: #cfdcea; }
html[data-theme="dark"] .question-grid button.answered { background: #1f6fe0; border-color: #1f6fe0; color: #fff; }
html[data-theme="dark"] .exam-nav-actions button, html[data-theme="dark"] #flagQuestion { color: #cfdcea; background: transparent; border-color: #2c4561; }
/* Ghi chu, danh dau, tim trong bai (thanh ben trinh hoc) */
.lp-notes { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.lp-notes[hidden] { display: none; }
.lp-search { width: 100%; min-height: 40px; border: 1px solid var(--control-border); border-radius: 8px; padding: 0 10px; font: 500 14px var(--font-body); }
.lp-search-results { margin: 0; padding-left: 18px; display: grid; gap: 2px; max-height: 180px; overflow: auto; font-size: 13px; }
.lp-search-results[hidden] { display: none; }
.lp-search-results button, .lp-bookmarks button { padding: 2px 0; text-align: left; font-size: 13px; }
.lp-note-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.lp-notes textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--control-border); border-radius: 8px; padding: 8px; font: 500 14px/1.45 var(--font-body); resize: vertical; }
.lp-notes small { color: #5a6b7f; min-height: 1em; }
.lp-bookmarks { display: grid; gap: 2px; }
.page-strip li.bookmarked { position: relative; }
.page-strip li.bookmarked::after { content: "★"; position: absolute; top: -6px; right: -4px; font-size: 11px; color: #d99a00; }
html[data-theme="dark"] .lp-notes { border-color: #2c4561; }
html[data-theme="dark"] .lp-search, html[data-theme="dark"] .lp-notes textarea { background: #0f1d30; color: #eaf3fd; border-color: #2c4561; }
html[data-theme="dark"] .lp-notes small { color: #a9bccf; }
html[data-theme="dark"] .lp-note-head strong { color: #eaf3fd; }
/* Xac thuc hai lop */
.mfa-section { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; display: grid; gap: 8px; }
.mfa-section h3 { margin: 0; font: 700 16px var(--font-heading); }
.mfa-section p { margin: 0; font-size: 14px; }
.mfa-steps { margin: 0 0 6px; padding-left: 20px; font-size: 13px; line-height: 1.6; }
.mfa-qr { width: 180px; height: 180px; background: #fff; padding: 6px; border-radius: 8px; }
.mfa-qr svg { width: 100%; height: 100%; display: block; }
.mfa-secret code { font: 600 14px ui-monospace, Consolas, monospace; letter-spacing: .05em; }
#mfaRecoveryCodes { font: 600 15px/1.7 ui-monospace, Consolas, monospace; background: #f3f6fa; padding: 10px 14px; border-radius: 8px; margin: 6px 0 0; }
html[data-theme="dark"] #mfaRecoveryCodes { background: #0f1d30; color: #eaf3fd; }
html[data-theme="dark"] .mfa-section { border-color: #2c4561; }
/* Ma tran dao tao theo chuc danh */
.matrix-panel { margin-top: 18px; }
.matrix-form { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(200px, 3fr) minmax(120px, 1fr) auto; gap: 10px; align-items: end; margin: 12px 0; }
.matrix-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.matrix-form input, .matrix-form select { min-height: 40px; border: 1px solid var(--control-border); border-radius: 8px; padding: 0 10px; font: 500 14px var(--font-body); }
.matrix-warn { color: #9a5b00; }
@media (max-width: 780px) { .matrix-form { grid-template-columns: 1fr; } }
html[data-theme="dark"] .matrix-form input, html[data-theme="dark"] .matrix-form select { background: #0f1d30; color: #eaf3fd; border-color: #2c4561; }
html[data-theme="dark"] .matrix-warn { color: #f3c969; }
/* Bao het phien dang nhap */
.session-expired { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 20px; background: rgba(8,17,29,.6); }
.session-expired-box { max-width: 420px; background: #fff; color: #15243a; border-radius: 14px; padding: 24px; box-shadow: 0 18px 50px rgba(0,0,0,.35); text-align: center; }
.session-expired-box h3 { margin: 0 0 8px; font: 700 18px var(--font-heading); }
.session-expired-box p { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: #475a70; }
html[data-theme="dark"] .session-expired-box { background: #13243a; color: #eef5fd; border: 1px solid #2c4561; }
html[data-theme="dark"] .session-expired-box p { color: #b4c6d8; }
/* Viec can lam (Tong quan quan tri) */
.todo-panel { margin: 14px 0; }
.todo-list { list-style: none; margin: 0; padding: 0 14px 12px; display: grid; gap: 6px; }
.todo-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: #f3f6fa; font-size: 14px; }
.todo-item.warn { background: #fff4e0; }
.todo-text { flex: 1; }
.todo-mark { width: 18px; text-align: center; font-weight: 800; }
.todo-item.warn .todo-mark { color: #9a5b00; }
html[data-theme="dark"] .todo-item { background: #13243a; color: #dbe7f3; }
html[data-theme="dark"] .todo-item.warn { background: #3a2a0c; color: #f3d28a; }
html[data-theme="dark"] .todo-item.warn .todo-mark { color: #f3c969; }
/* Trinh hoc tren dien thoai: an tuy chon doc sau nut "Tuy chon doc" (dung lai 3 dong phia tren slide). */
.lp-options-toggle { display: none; }
@media (max-width: 900px) {
  .lp-options-toggle { display: inline-flex; }
  .lesson-player .slide-toolbar:not(.options-open) .lp-opt { display: none; }
  .lesson-player .slide-toolbar .lp-opt { order: 10; }
  .lesson-player .slide-toolbar.options-open .lp-options-toggle { background: #eaf2ff; border-color: #9cc1f2; }
  html[data-theme="dark"] .lesson-player .slide-toolbar.options-open .lp-options-toggle { background: #1c3350; border-color: #3a6aa3; }
}
/* Cong tac trong Kiem soat tuan thu */
.compliance-toggle { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.compliance-toggle input { width: 18px; height: 18px; }
.compliance-external { display: flex; gap: 6px; margin-top: 8px; }
.compliance-external input { flex: 1; min-width: 0; padding: 7px 9px; border-radius: 7px; border: 1px solid var(--control-border, #c8d2de); font: inherit; font-size: 13px; }
#downloadMyRecord { flex: 0 0 auto; }
/* Ket qua tren dien thoai: 3 the so lieu thanh hang gon (nhan trai, so phai) de bang Cac lan thi hien ngay. */
@media (max-width: 600px) {
  .results-grid { gap: 8px; }
  .results-grid article { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 12px 16px; }
  .results-grid article small { grid-column: 1; grid-row: 1; }
  .results-grid article p { grid-column: 1; grid-row: 2; }
  .results-grid article strong { grid-column: 2; grid-row: 1 / 3; margin: 0; font-size: 26px; }
}
/* Cac lan thi tren dien thoai: moi lan thi la the luoi 2 cot (nhan nho tren gia tri), ten khoa chiem ca hang. */
@media (max-width: 780px) {
  .attempt-table tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .attempt-table td { display: block; border-bottom: 0; padding: 5px 0; }
  .attempt-table td::before { display: block; margin-bottom: 2px; font-size: 11px; }
  .attempt-table td:nth-child(2) { grid-column: 1 / -1; }
  .attempt-table td[colspan] { grid-column: 1 / -1; }
  .attempt-table td:nth-child(7) { grid-column: 2; grid-row: 1; }
}
/* Lien ket Huong dan su dung o cuoi thanh ben (tren nut Dang xuat). */
.sidebar .help-link { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: #8497ad; font: 500 13px var(--font-body); text-decoration: none; }
.sidebar .help-link > span:first-child { width: 20px; height: 20px; display: grid; place-items: center; border: 1.5px solid currentColor; border-radius: 50%; font-size: 12px; font-weight: 700; }
.sidebar .help-link:hover { color: #e6eef7; background: rgba(255,255,255,.05); }
.sidebar .help-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sidebar .help-link + .logout { margin-top: 0; }
.schedule-actions { display: flex; justify-content: flex-end; margin: 0 0 12px; }
/* Sua ten bai tai dong; man sua noi dung bai toan man hinh (05/10/2026). */
.lesson-rename { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 0; }
.lesson-rename input { flex: 1; min-width: 0; min-height: 36px; padding: 6px 10px; border: 1px solid var(--control-border); border-radius: 8px; font: 500 14px var(--font-body); }
.lesson-rename button { min-height: 36px; padding: 0 12px; }
html[data-theme="dark"] .lesson-rename input { background: #0f1d30; color: #eef5fd; border-color: #36577a; }
:is(#lessonEditModal, #questionModal) { padding: 0; }
:is(#lessonEditModal, #questionModal) .lesson-edit-modal { width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; margin: 0; display: flex; flex-direction: column; overflow: hidden; }
:is(#lessonEditModal, #questionModal) .lesson-edit-pages { flex: 1 1 auto; max-height: none; min-height: 0; }
:is(#lessonEditModal, #questionModal) .lesson-edit-fields textarea { min-height: 220px; font-size: 15px; }
:is(#lessonEditModal, #questionModal) .question-modal-actions { flex: 0 0 auto; margin-top: 8px; }
/* Danh sach khoa: vao thang sua noi dung (05/10/2026). */
.course-name-link { cursor: pointer; }
.course-name-link:hover { color: var(--blue, #125cd4); text-decoration: underline; }
.course-name-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }
.lesson-pick { position: absolute; z-index: 90; width: 290px; max-height: 320px; overflow: auto; background: #fff; border: 1px solid #c8d2de; border-radius: 10px; box-shadow: 0 14px 36px rgba(16,52,87,.22); padding: 6px; }
.lesson-pick p { margin: 4px 8px 6px; font-size: 12px; font-weight: 700; color: #5a6b7f; }
.lesson-pick button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 7px; font: 500 14px var(--font-body); color: #15243a; cursor: pointer; }
.lesson-pick button:hover, .lesson-pick button:focus-visible { background: #eaf2ff; outline: none; }
html[data-theme="dark"] .lesson-pick { background: #13243a; border-color: #2c4561; }
html[data-theme="dark"] .lesson-pick p { color: #a9bccf; }
html[data-theme="dark"] .lesson-pick button { color: #eef5fd; }
html[data-theme="dark"] .lesson-pick button:hover, html[data-theme="dark"] .lesson-pick button:focus-visible { background: #1c3350; }
html[data-theme="dark"] .course-name-link:hover { color: #8cc0ff; }
.course-actions-cell { width: 1%; white-space: nowrap; }
.course-actions-cell .row-actions { flex-wrap: nowrap; justify-content: flex-end; align-items: center; }
.bank-table td.nowrap { white-space: nowrap; }
.course-assessment { line-height: 1.45; }
.draft-rename { color: #9a5b00; font-weight: 600; }
html[data-theme="dark"] .draft-rename { color: #f3c969; }
.course-pool { color: #5a6b7f; }
.course-pool.short { color: #b3261e; font-weight: 700; }
html[data-theme="dark"] .course-pool { color: #a9bccf; }
html[data-theme="dark"] .course-pool.short { color: #ff9b9b; }
/* Nut ⋯ va menu thao tac cua hang */
.row-actions .row-more { width: 34px; height: 30px; font-size: 18px; line-height: 1; letter-spacing: 1px; }
.row-menu { position: absolute; z-index: 95; min-width: 210px; overflow-y: auto; overscroll-behavior: contain; background: #fff; border: 1px solid #c8d2de; border-radius: 10px; box-shadow: 0 14px 36px rgba(16,52,87,.22); padding: 6px; }
.row-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 7px; font: 500 14px var(--font-body); color: #15243a; cursor: pointer; white-space: nowrap; }
.row-menu button:hover, .row-menu button:focus-visible { background: #eaf2ff; outline: none; }
.row-menu button.danger { color: #b3261e; }
.row-menu button.danger:hover, .row-menu button.danger:focus-visible { background: #fdecea; }
.row-menu-sep { height: 1px; margin: 6px 4px; background: #dce3ea; }
html[data-theme="dark"] .row-menu { background: #13243a; border-color: #2c4561; }
html[data-theme="dark"] .row-menu button { color: #eef5fd; }
html[data-theme="dark"] .row-menu button:hover, html[data-theme="dark"] .row-menu button:focus-visible { background: #1c3350; }
html[data-theme="dark"] .row-menu button.danger { color: #ff9b9b; }
html[data-theme="dark"] .row-menu button.danger:hover, html[data-theme="dark"] .row-menu button.danger:focus-visible { background: #3a1f24; }
html[data-theme="dark"] .row-menu-sep { background: #2c4561; }
@media (max-width: 780px) { .row-menu button { min-height: 44px; } .row-actions .row-more { width: 44px; height: 44px; } }
#courseTableBody td:first-child { width: auto; }
#courseTableBody td:nth-child(5) { min-width: 120px; }
/* Tich hop & khoa API (He thong) */
.integration-list { display: grid; gap: 8px; }
.integration-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.integration-row > div:nth-child(2) { flex: 1; min-width: 0; }
.integration-row strong, .integration-row small { display: block; }
.integration-row small { color: #5a6b7f; margin-top: 2px; }
.integration-mark { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #eef2f7; color: #5a6b7f; }
.integration-row.ok .integration-mark { background: #e6f6ee; color: #0f6849; }
.integration-tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.integration-tools button { min-height: 36px; padding: 0 14px; white-space: nowrap; }
html[data-theme="dark"] .integration-row { border-color: #2c4561; }
html[data-theme="dark"] .integration-row small { color: #a9bccf; }
html[data-theme="dark"] .integration-mark { background: #1c3350; color: #a9bccf; }
html[data-theme="dark"] .integration-row.ok .integration-mark { background: #0f3b2c; color: #9fe3c4; }
@media (max-width: 640px) { .integration-row { flex-wrap: wrap; } .integration-tools { width: 100%; justify-content: flex-start; } }
.integrations-panel { align-items: start; }
/* Nut dong hop thoai ro rang (13/10/2026): chu "Dong" co vien thay vi dau x nho mau xam. */
.question-modal-head > button.modal-close { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 1.5px solid #9fb2c8; border-radius: 9px; background: #fff; color: #15243a; font: 700 14px var(--font-body); cursor: pointer; }
.question-modal-head > button.modal-close:hover { border-color: #125cd4; color: #125cd4; background: #eef4ff; }
.question-modal-head > button.modal-close:focus-visible { outline: none; box-shadow: var(--focus-ring); }
html[data-theme="dark"] .question-modal-head > button.modal-close { background: #13243a; color: #eef5fd; border-color: #4a6a8e; }
html[data-theme="dark"] .question-modal-head > button.modal-close:hover { border-color: #8cc0ff; color: #8cc0ff; background: #1c3350; }
/* Hop thoai: tieu de (co nut Dong) dinh tren, nut Luu / Dong dinh duoi khi cuon (truoc day cuon xuong la mat nut dong). */
.modal-backdrop .question-modal { padding-top: 0; padding-bottom: 0; }
.modal-backdrop .question-modal > .question-modal-head { position: sticky; top: 0; z-index: 3; background: inherit; padding-top: 20px; margin-left: -25px; margin-right: -25px; padding-left: 25px; padding-right: 25px; align-items: center; }
.modal-backdrop .question-modal > .question-modal-actions { position: sticky; bottom: 0; z-index: 3; background: inherit; padding-bottom: 18px; margin: 12px -25px 0; padding-left: 25px; padding-right: 25px; }
.modal-backdrop .question-modal { background-clip: padding-box; }
/* Man sua khoa (gom cai dat bai thi) va man sua cau hoi: toan man hinh nhu man sua noi dung. */
#courseModal, #questionModal { padding: 0; }
#courseModal > .question-modal, #questionModal > .question-modal { width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; box-shadow: none; }
#courseModal > .question-modal > *:not(.question-modal-head):not(.question-modal-actions), #questionModal > .question-modal > *:not(.question-modal-head):not(.question-modal-actions) { max-width: 1100px; margin-left: auto; margin-right: auto; }
/* Nut dong co chu cho menu dien thoai, bang thong bao, danh sach chon bai (13/10). */
.sidebar-close { width: auto !important; padding: 0 14px !important; gap: 6px; font-size: 14px !important; font-weight: 700; border: 1.5px solid rgba(255,255,255,.35) !important; border-radius: 9px !important; }
.notify-close { display: block; margin: 0 0 8px auto; min-height: 34px; padding: 0 12px; border: 1.5px solid #9fb2c8; border-radius: 8px; background: transparent; color: inherit; font: 700 13px var(--font-body); cursor: pointer; }
.lesson-pick p { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lesson-pick .lesson-pick-close { width: auto; padding: 4px 10px; border: 1.5px solid #9fb2c8; border-radius: 7px; font-size: 12px; font-weight: 700; }
/* Man Sua noi dung: nut chen slide ro rang (13/10/2026). */
.lesson-edit-insert { display: inline-flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.lesson-edit-insert button { min-height: 40px; padding: 0 14px; }
.lesson-edit-hint { margin: 0 0 8px; padding: 9px 12px; border-radius: 8px; background: #eef4ff; color: #1d3a63; font-size: 14px; }
.lesson-edit-hint.warn { background: #fff4e0; color: #7a4a00; }
.lesson-edit-page summary > span:first-child { flex: 1; }
.lesson-edit-page summary .lesson-edit-quick { display: inline-flex; gap: 4px; flex-shrink: 0; overflow: visible; }
.lesson-edit-quick button { min-height: 32px; padding: 0 10px; font-size: 13px; }
html[data-theme="dark"] .lesson-edit-hint { background: #16304f; color: #cfe2fb; }
html[data-theme="dark"] .lesson-edit-hint.warn { background: #3a2a0c; color: #f3d28a; }
@media (max-width: 640px) {
  .lesson-edit-quick button { min-height: 40px; padding: 0 8px; }
  .lesson-edit-page summary { flex-wrap: wrap; }
  :is(#lessonEditModal, #questionModal) .lesson-edit-fields textarea { min-height: 160px; }
}
/* Thu vien tai lieu (13/10/2026) */
.library-alert { margin: 0 0 10px; padding: 10px 14px; border-radius: 8px; background: #fff4e0; color: #7a4a00; font-size: 14px; font-weight: 600; }
.library-warn { display: inline-block; margin-top: 4px; color: #9a5b00; font-size: 13px; font-weight: 700; }
.library-desc { display: block; margin-top: 3px; color: #5a6b7f; font-size: 12px; }
.library-actions .row-actions { flex-wrap: wrap; justify-content: flex-end; }
.library-table td:first-child { width: auto; }
.library-history td { background: #f5f8fc; }
.library-history ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; }
.library-current { color: #0f6849; font-weight: 700; }
.library-old { color: #5a6b7f; }
html[data-theme="dark"] .library-alert { background: #3a2a0c; color: #f3d28a; }
html[data-theme="dark"] .library-warn { color: #f3c969; }
html[data-theme="dark"] .library-desc, html[data-theme="dark"] .library-old { color: #a9bccf; }
html[data-theme="dark"] .library-history td { background: #0f1d30; }
html[data-theme="dark"] .library-current { color: #9fe3c4; }

/* Form khoa: chon bai giang tu thu vien (15/10/2026) */
.course-builder-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 12px; max-height: 220px; overflow: auto; padding: 4px 0; }
.course-builder-list .lp-toggle { min-height: 36px; }
#courseFormQuizNote { display: block; margin-top: 4px; color: var(--muted, #5b6b7d); font-size: 13px; }
input[readonly] { opacity: .75; }

/* Nhat ky he thong (15/10/2026) */
.syslog-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e8eef6; color: #2b3d52; }
.syslog-badge.error { background: #fde8e8; color: #9b1c1c; }
.syslog-badge.warn { background: #fff4e0; color: #7a4a00; }
.syslog-meta { display: inline-block; margin-top: 4px; font-size: 12px; color: #4a5a6c; white-space: pre-wrap; word-break: break-word; }
.syslog-table td:first-child { white-space: nowrap; }
html[data-theme="dark"] .syslog-badge { background: #22344c; color: #d6e4f5; }
html[data-theme="dark"] .syslog-badge.error { background: #4a1f22; color: #ffb4b4; }
html[data-theme="dark"] .syslog-badge.warn { background: #3a2a0c; color: #f3d28a; }
html[data-theme="dark"] .syslog-meta { color: #a9b8c9; }

/* Tab Tao bai giang trong man tai lieu (15/10/2026) */
.lecture-from-material { margin: 8px 0; padding-left: 18px; display: grid; gap: 4px; }
/* Bai kiem tra & cau hoi (18/10/2026): danh sach bo cau hoi -> chi tiet mot bo */
.set-head { display: grid; gap: 10px; padding: 14px 16px 6px; }
.set-head .set-back, html[data-theme="dark"] .set-head .set-back { justify-self: start; padding: 4px 0; font-weight: 700; color: #1459b8; background: transparent; border: 0; box-shadow: none; }
.set-head-main { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.set-head-main h2 { margin: 2px 0 4px; font: 700 22px var(--font-heading); color: #15243a; }
.set-meta { margin: 0; font-size: 14px; color: #5a6b7f; }
.set-meta .set-short { color: #b3261e; font-weight: 700; }
.set-meta .set-ok { color: #15835c; font-weight: 700; }
.set-table tr.set-unassigned td { background: #fbf7ee; }
html[data-theme="dark"] .set-head .set-back { color: #8cc0ff; }
html[data-theme="dark"] .set-head-main h2 { color: #eef5fd; }
html[data-theme="dark"] .set-meta { color: #a9bccf; }
html[data-theme="dark"] .set-meta .set-short { color: #ff9b9b; }
html[data-theme="dark"] .set-meta .set-ok { color: #6fd3a6; }
html[data-theme="dark"] .set-table tr.set-unassigned td { background: #1f2a33; }
@media (max-width: 780px) { .set-head-main { align-items: stretch; } .set-head-main .bank-actions { width: 100%; }
  /* O tim chiem ca dong, cac o loc xuong dong duoi (truoc day min-width:0 lam o tim co con vai ky tu). */
  .bank-toolbar .bank-search { flex: 1 1 100%; min-width: 100%; } }
#setTitle:focus { outline: none; }
/* Sua bai theo so slide (18/10/2026): day so ben trai, mot slide dang mo ben phai; moi cot tu cuon. */
:is(#lessonEditModal, #questionModal) .lesson-edit-pages.le-split { display: grid; grid-template-columns: 244px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 14px; overflow: hidden; padding-right: 0; width: 100%; }
/* Khong co day so (chi mot cau, hoac cau moi): vung soan chiem ca hang thay vi bi nhet vao cot 244px. */
:is(#lessonEditModal, #questionModal) .lesson-edit-pages.le-split.le-no-nav { grid-template-columns: minmax(0, 1fr); }
.le-nav { min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #f6f8fb; }
.le-nav-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.le-num { position: relative; width: 100%; min-height: 38px; border: 1.5px solid #c8d2de; border-radius: 8px; background: #fff; color: #15243a; font: 700 14px var(--font-body); cursor: pointer; }
.le-num:hover { border-color: #125cd4; }
.le-num.current { background: #125cd4; border-color: #125cd4; color: #fff; }
.le-num.edited { border-color: #c98a1b; box-shadow: inset 0 -3px 0 #c98a1b; }
.le-num.dirty::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: #d4380d; }
.le-num.video::before { content: "▶"; position: absolute; left: 3px; top: 1px; font-size: 9px; color: #6b3fd4; }
.le-num.current.video::before { color: #fff; }
.le-num.inserted { border-style: dashed; }
.le-num.uploading { animation: le-pulse 1.2s ease-in-out infinite; }
.le-num.dim { opacity: .35; }
@keyframes le-pulse { 50% { opacity: .55; } }
.le-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 10px 0 0; font-size: 12px; color: #5a6b7f; }
.le-key { display: inline-flex; align-items: center; gap: 4px; }
.le-key::before { content: ""; width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid #c8d2de; background: #fff; }
.le-key.edited::before { border-color: #c98a1b; box-shadow: inset 0 -3px 0 #c98a1b; }
.le-key.dirty::before { border-color: #d4380d; background: radial-gradient(circle at 70% 30%, #d4380d 3px, #fff 3.5px); }
.le-key.video::before { content: "▶"; font-size: 8px; line-height: 9px; text-align: center; color: #6b3fd4; }
.le-key.inserted::before { border-style: dashed; }
.le-editor { min-height: 0; overflow: auto; padding-right: 4px; }
.le-current { display: grid; gap: 10px; padding: 12px 14px 14px; }
.le-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.le-head strong { font: 700 16px var(--font-heading); color: #15243a; }
.le-head .lesson-edit-quick { margin-left: auto; display: inline-flex; gap: 6px; }
.le-current .lesson-edit-fields { padding: 0; }
html[data-theme="dark"] .le-nav { background: #0d1a2b; border-color: #2c4561; }
html[data-theme="dark"] .le-num { background: #13243a; border-color: #36506d; color: #eef5fd; }
html[data-theme="dark"] .le-num:hover { border-color: #6aa8f0; }
html[data-theme="dark"] .le-num.current { background: #2f7de0; border-color: #2f7de0; color: #fff; }
html[data-theme="dark"] .le-num.edited { border-color: #d4a03a; box-shadow: inset 0 -3px 0 #d4a03a; }
html[data-theme="dark"] .le-num.dirty::after { background: #ff7a59; }
html[data-theme="dark"] .le-num.video::before { color: #b9a1ff; }
html[data-theme="dark"] .le-num.current.video::before { color: #fff; }
html[data-theme="dark"] .le-legend { color: #a9bccf; }
html[data-theme="dark"] .le-key::before { background: #13243a; border-color: #36506d; }
html[data-theme="dark"] .le-key.edited::before { border-color: #d4a03a; box-shadow: inset 0 -3px 0 #d4a03a; }
html[data-theme="dark"] .le-key.dirty::before { border-color: #ff7a59; background: radial-gradient(circle at 70% 30%, #ff7a59 3px, #13243a 3.5px); }
html[data-theme="dark"] .le-key.video::before { color: #b9a1ff; }
html[data-theme="dark"] .le-head strong { color: #eef5fd; }
@media (max-width: 780px) {
  /* Dien thoai: day so nam ngang tren cung, cuon ngang; slide dang mo ben duoi. */
  /* Man hep: phan dau (huong dan, nut) chiem het chieu cao nen vung slide bi ep con vai px. Cho ca hop thoai cuon,
     vung slide cao theo noi dung, thanh Huy / Luu dinh o day. */
  :is(#lessonEditModal, #questionModal) .lesson-edit-modal { overflow-y: auto; }
  :is(#lessonEditModal, #questionModal) .lesson-edit-pages.le-split { flex: 0 0 auto; overflow: visible; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; gap: 10px; }
  :is(#lessonEditModal, #questionModal) .le-editor { overflow: visible; padding-right: 0; }
  :is(#lessonEditModal, #questionModal) .question-modal-actions { position: sticky; bottom: 0; z-index: 2; padding: 10px 25px; background: var(--surface, #f8fafc); }
  html[data-theme="dark"] :is(#lessonEditModal, #questionModal) .question-modal-actions { background: #0f1d30; }
  .le-nav { padding: 8px; overflow-x: auto; overflow-y: hidden; }
  .le-nav-list { display: flex; gap: 6px; }
  .le-num { width: 44px; min-height: 44px; flex: 0 0 auto; }
  .le-legend { display: none; }
}
/* Man sua bai gon (18/10/2026): mot hang ten bai / thoi gian doc / tim / loc / chen; nhan che do canh tieu de. */
.le-mode { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e8f0fb; color: #1459b8; cursor: help; }
.le-mode.draft { background: #fff4dc; color: #8a5300; }
html[data-theme="dark"] .le-mode { background: #1c3350; color: #9cc8ff; }
html[data-theme="dark"] .le-mode.draft { background: #3a2c10; color: #f3c969; }
/* width:100%: hop thoai la flex cot, ma hang nay co margin-left/right:auto (gioi han 1100px) nen khong co width se co lai
   bang be ngang noi dung va bi day vao giua. */
:is(#lessonEditModal, #questionModal) .lesson-edit-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; width: 100%; }
:is(#lessonEditModal, #questionModal) .lesson-edit-bar .field { margin: 0; }
:is(#lessonEditModal, #questionModal) .lesson-edit-bar .le-name { flex: 1 1 260px; min-width: 0; }
:is(#lessonEditModal, #questionModal) .lesson-edit-bar .le-gate { flex: 0 0 130px; }
:is(#lessonEditModal, #questionModal) .lesson-edit-bar .lesson-edit-tools { flex: 3 1 560px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0; }
:is(#lessonEditModal, #questionModal) .lesson-edit-bar .lesson-edit-tools input[type="search"] { flex: 1 1 200px; min-width: 160px; }
/* Hang cong cu cua man sua cau hoi chi co o tim + dong dem: o tim khong gian het hang, de dong dem nam ngay ben canh.
   Dat SAU quy tac tren vi hai ben cung do uu tien. */
#questionModal .lesson-edit-bar .lesson-edit-tools input[type="search"] { flex: 0 1 320px; }
:is(#lessonEditModal, #questionModal) .lesson-edit-bar .lesson-edit-insert { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
@media (max-width: 780px) { :is(#lessonEditModal, #questionModal) .lesson-edit-bar .lesson-edit-tools { flex-basis: 100%; } :is(#lessonEditModal, #questionModal) .lesson-edit-bar .lesson-edit-insert { margin-left: 0; } }
/* O noi dung slide gian het chieu cao con lai cua vung soan (khong dung o 220px). */
:is(#lessonEditModal, #questionModal) .le-editor { display: flex; flex-direction: column; }
:is(#lessonEditModal, #questionModal) .le-current { display: flex; flex-direction: column; flex: 1 0 auto; min-height: 100%; box-sizing: border-box; }
:is(#lessonEditModal, #questionModal) .le-current .lesson-edit-fields { display: flex; flex-direction: column; flex: 1 0 auto; }
:is(#lessonEditModal, #questionModal) .le-current .lesson-edit-fields textarea { flex: 1 0 220px; }
:is(#lessonEditModal, #questionModal) .le-current .lesson-edit-fields > :not(textarea) { flex: 0 0 auto; }
@media (max-width: 780px) { :is(#lessonEditModal, #questionModal) .le-current { min-height: 0; } :is(#lessonEditModal, #questionModal) .le-current .lesson-edit-fields textarea { flex: 0 0 auto; } }
/* Hang dau slide gom dieu huong + thao tac. */
.le-where { display: inline-flex; align-items: center; gap: 8px; }
.le-step { min-width: 34px; min-height: 32px; padding: 0 8px; font-size: 18px; line-height: 1; }
.le-step:disabled { opacity: .4; cursor: not-allowed; }
.le-head .lesson-edit-quick { flex-wrap: wrap; justify-content: flex-end; }
.le-head .lesson-edit-quick button:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 780px) { .le-step { min-width: 44px; min-height: 44px; } .le-head .lesson-edit-quick { margin-left: 0; justify-content: flex-start; } }
/* Bai SCORM trong trinh hoc */
.lp-media iframe.lp-scorm { width: 100%; height: 72vh; border: 0; border-radius: 10px; background: #fff; display: block; }
@media (max-width: 780px) { .lp-media iframe.lp-scorm { height: 78vh; border-radius: 0; } }

/* The "han sap toi" o Tong quan hoc vien: nhan mau diu khi la han CHUNG NHAN (khong phai han phai hoc),
   va chu "THANG 10" phai vua o ngay rong 54px - truoc day bi cat con "THA 10" tren dien thoai. */
.deadline-tag.calm-tag { color: #1459b8; background: #e8f0fb; }
html[data-theme="dark"] .deadline-tag.calm-tag { color: #9cc8ff; background: #1c3350; }
/* .date-card la flex, nen o ngay (rong 54px) bi ep nho lai con ~37px khi chu ben canh dai -> "THANG 11"
   bi cat. flex:0 0 auto giu dung be ngang; co chu nho lai cho vua trong 54px. */
.date-card .date-box { flex: 0 0 auto; }
.date-box small { font-size: 10px; padding: 4px 1px; white-space: nowrap; letter-spacing: 0; }

/* Ma tran dao tao: luoi CHUC DANH x KHOA. O co so = khoa bat buoc, so la han (ngay ke tu khi giao);
   o "·" = khong bat buoc. Cung ngon ngu thi giac voi day so slide (.le-num) o man sua bai. */
.matrix-table .matrix-col { text-align: center; white-space: nowrap; font-size: 12px; }
.matrix-table .matrix-num, .matrix-table td.matrix-num { text-align: right; font-variant-numeric: tabular-nums; }
.matrix-table td.matrix-cell { text-align: center; color: #9aa7b6; }
.matrix-mark {
  min-width: 36px; min-height: 32px; padding: 2px 6px; cursor: pointer;
  border: 1px solid #c8d2de; border-radius: 6px; background: #fff;
  font: 700 13px var(--font-body); color: #15243a; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -3px 0 #1459b8;
}
.matrix-mark:hover { border-color: #1459b8; }
.matrix-mark:focus-visible { outline: 2px solid #125cd4; outline-offset: 1px; }
.matrix-legend-row td { color: #5a6b7f; font-size: 12px; border-bottom: 0; }
html[data-theme="dark"] .matrix-table td.matrix-cell { color: #6b7d91; }
html[data-theme="dark"] .matrix-mark { background: #13243a; border-color: #36506d; color: #eef5fd; box-shadow: inset 0 -3px 0 #4f91dd; }
html[data-theme="dark"] .matrix-mark:hover { border-color: #4f91dd; }
html[data-theme="dark"] .matrix-legend-row td { color: #a9bccf; }
@media (max-width: 780px) { .matrix-mark { min-width: 44px; min-height: 44px; } }
/* Nhieu khoa thi bang cuon ngang: giu cot ten chuc danh dinh lai de con biet dang doc dong nao.
   Chi tu 781px tro len - duoi do bang da thanh the (.bank-table tr{display:block}) nen sticky vo nghia. */
@media (min-width: 781px) {
  .matrix-table th:first-child, .matrix-table td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }
  .matrix-table thead th:first-child { background: #eef2f7; }
  html[data-theme="dark"] .matrix-table td:first-child { background: #0f1d30; }
  html[data-theme="dark"] .matrix-table thead th:first-child { background: #16273b; }
}

/* Man sua cau hoi: nhac rang de thi thuoc ve phien ban khoa, sua o day phai phat hanh ban moi moi co hieu luc. */
.question-published-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5;
  background: #fff4dc; color: #7a4e00; border: 1px solid #f0d49a; }
.question-published-note[hidden] { display: none; }
html[data-theme="dark"] .question-published-note { background: #3a2c10; color: #f3c969; border-color: #6a5320; }

/* Hop lich su thay doi (doc tu nhat ky kiem toan) */
.history-modal { max-width: 720px; }
.history-subtitle { margin: 4px 0 0; font-size: 13px; color: #5a6b7f; font-variant-numeric: tabular-nums; }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.history-entry { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.history-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 6px; font-size: 13px; }
.history-head strong { font-variant-numeric: tabular-nums; }
.history-actor { color: #5a6b7f; }
.history-action { margin-left: auto; font-weight: 700; color: #1459b8; }
.history-changes { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.history-from { color: #8a5300; text-decoration: line-through; }
.history-to { color: #15835c; }
.history-arrow { color: #8a97a6; }
.question-history-row { margin: 0 0 12px; }
html[data-theme="dark"] .history-subtitle, html[data-theme="dark"] .history-actor { color: #a9bccf; }
html[data-theme="dark"] .history-entry { border-color: #2c4561; }
html[data-theme="dark"] .history-action { color: #9cc8ff; }
html[data-theme="dark"] .history-from { color: #f3c969; }
html[data-theme="dark"] .history-to { color: #6fd3a6; }
html[data-theme="dark"] .history-arrow { color: #6b7d91; }

/* Xem truoc mot slide dung nhu hoc vien thay: dung lai .slide-card cua trinh hoc, chi dong khung lai. */
/* Hai hop nay mo TU BEN TRONG mot hop khac (man soan bai, man sua cau hoi). Lop phu mac dinh z-index:80,
   ma #lessonEditModal nam sau trong DOM nen se de len - phai nang han. */
#slidePreviewModal, #historyModal { z-index: 90; }
.slide-preview-modal { max-width: 860px; }
.slide-preview-stage { max-height: 68vh; overflow: auto; padding: 4px; }
.slide-preview-media { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5;
  background: #eef4fd; color: #1b4b8f; border: 1px solid #cadcf5; }
html[data-theme="dark"] .slide-preview-media { background: #16273b; color: #9cc8ff; border-color: #2c4561; }

/* Goi SCORM mo coi: con file tren dia nhung khong con trong CSDL */
.scorm-orphans { padding: 14px 16px; border-top: 1px solid var(--line); }
.scorm-orphan-note { margin: 4px 0 10px; font-size: 13px; line-height: 1.5; color: #5a6b7f; }
.scorm-orphan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.scorm-orphan-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.scorm-orphan-list code { font-variant-numeric: tabular-nums; }
.scorm-orphan-list button { margin-left: auto; min-height: 44px; padding: 0 12px; }
html[data-theme="dark"] .scorm-orphans { border-top-color: #2c4561; }
html[data-theme="dark"] .scorm-orphan-note { color: #a9bccf; }

/* Day so cau hoi bi cat o 2000 cau: noi ro con bao nhieu cau khong hien */
.le-nav-cut { margin-top: 8px; font-size: 12px; line-height: 1.5; color: #8a5a00; }
html[data-theme="dark"] .le-nav-cut { color: #e8b35c; }
/* Giao khoa nhieu hoc vien (29/10/2026): the nguoi da chon, o dan ma NV, dong bao bo qua. */
#enrollmentForm .enroll-picked,#enrollmentForm .enroll-paste,#enrollmentForm .enroll-result{grid-column:1/-1}
.enroll-picked{display:flex;flex-wrap:wrap;gap:6px}
.enroll-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 4px 2px 10px;border-radius:999px;border:1px solid var(--line);font-size:13px}
.enroll-chip button{border:0;background:none;color:inherit;font-size:16px;line-height:1;min-width:28px;min-height:28px;cursor:pointer;border-radius:999px}
.enroll-paste summary{cursor:pointer;font-size:13px}
.enroll-paste textarea{width:100%;margin-top:6px;font:inherit}
.enroll-result{margin:0;font-size:13px;color:#b45309}
.enroll-result:empty{display:none}
html[data-theme="dark"] .enroll-result{color:#fbbf24}
@media(max-width:640px){.enroll-chip button{min-width:44px;min-height:44px}}

/* Tro ly nhap de bang AI (question-import.js) */
#importAiModal > .import-ai-modal { width: min(1180px, 96vw); max-width: none; height: min(860px, 94dvh); display: flex; flex-direction: column; }
.qi-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; gap: 16px; padding: 14px 0 16px; }
.qi-chat, .qi-draft-panel { min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--pro-line); border-radius: 10px; background: #fff; }
.qi-chat.qi-drop { outline: 2px dashed var(--pro-blue); outline-offset: -4px; }
.qi-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.qi-msg { display: flex; flex-direction: column; max-width: 92%; }
.qi-bubble { white-space: pre-wrap; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.qi-user { align-self: flex-end; }
.qi-user .qi-bubble { background: var(--pro-blue); color: #fff; border-bottom-right-radius: 4px; }
.qi-assistant .qi-bubble { background: #f1ecfd; color: #2c1d63; border-bottom-left-radius: 4px; }
.qi-note { align-self: center; max-width: 100%; }
.qi-note .qi-bubble { background: #eef4fa; color: #4b5d73; font-size: 13px; }
.qi-error .qi-bubble { background: #fdecec; color: #9b1c1c; }
.qi-warn { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: #8a5a00; }
.qi-status { margin: 0; padding: 6px 14px; font-size: 13px; color: #5b3fb5; }
.qi-file { display: flex; align-items: center; gap: 8px; margin: 0 14px; padding: 6px 10px; border-radius: 8px; background: #eef4fa; font-size: 13px; }
.qi-file span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qi-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px 14px; }
.qi-compose textarea { flex: 1; resize: vertical; min-height: 44px; max-height: 160px; border: 1px solid var(--pro-line); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 14px; }
.qi-compose button { min-height: 44px; }
.qi-attach { min-width: 44px; font-size: 18px; }
.qi-draft-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--pro-line); font-size: 14px; }
.qi-empty { margin: auto; padding: 24px; max-width: 420px; text-align: center; color: #66768a; font-size: 14px; }
.qi-draft { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.qi-draft:empty { display: none; }
.qi-card { border: 1px solid var(--pro-line); border-radius: 9px; padding: 10px 12px; }
.qi-card.qi-missing { border-color: #e8b04a; background: #fffaf0; }
.qi-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.qi-num { font-size: 13px; }
.qi-basis { padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.qi-basis.ok { background: #e7f6ec; color: #17663a; }
.qi-basis.warn { background: #fff1d6; color: #8a5a00; }
.qi-basis.bad { background: #fdecec; color: #9b1c1c; }
.qi-ref { color: #66768a; }
.qi-remove { margin-left: auto; border: 0; background: none; font-size: 18px; line-height: 1; color: #8a96a6; cursor: pointer; min-width: 32px; min-height: 32px; }
.qi-prompt { margin: 8px 0 6px; font-weight: 600; white-space: pre-wrap; }
.qi-options { display: grid; gap: 4px; }
.qi-option { display: flex; align-items: flex-start; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.qi-option input { margin-top: 4px; }
.qi-option.correct { background: #e7f6ec; font-weight: 600; }
.qi-letter { font-weight: 700; color: #66768a; min-width: 1em; }
.qi-expl { margin: 6px 0 0; font-size: 13px; color: #4b5d73; }
.qi-save { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px 14px; border-top: 1px solid var(--pro-line); }
.qi-save select { flex: 1; min-width: 200px; min-height: 44px; border: 1px solid var(--pro-line); border-radius: 8px; padding: 0 10px; font: inherit; }
.qi-save button { min-height: 44px; }
.qi-save small { flex-basis: 100%; color: #66768a; }
@media (max-width: 860px) {
  #importAiModal > .import-ai-modal { width: 100vw; height: 100dvh; border-radius: 0; }
  .qi-layout { grid-template-columns: 1fr; grid-template-rows: minmax(320px, 1fr) auto; overflow-y: auto; }
  .qi-draft-panel { min-height: 360px; }
}
html[data-theme="dark"] .qi-chat, html[data-theme="dark"] .qi-draft-panel { background: #0d1928; border-color: #2b4056; }
html[data-theme="dark"] .qi-assistant .qi-bubble { background: #2a2152; color: #e8e1ff; }
html[data-theme="dark"] .qi-note .qi-bubble, html[data-theme="dark"] .qi-file { background: #14263a; color: #c3d3e4; }
html[data-theme="dark"] .qi-error .qi-bubble { background: #3b1717; color: #ffc9c9; }
html[data-theme="dark"] .qi-compose textarea, html[data-theme="dark"] .qi-save select { background: #101d2e; color: #eaf3fd; border-color: #30465e; }
html[data-theme="dark"] .qi-card { border-color: #2b4056; }
html[data-theme="dark"] .qi-card.qi-missing { background: #2b2210; border-color: #7a5a1c; }
html[data-theme="dark"] .qi-option.correct, html[data-theme="dark"] .qi-basis.ok { background: #123222; color: #b8f0cf; }
html[data-theme="dark"] .qi-basis.warn { background: #3a2c0c; color: #ffd98a; }
html[data-theme="dark"] .qi-basis.bad { background: #3b1717; color: #ffc9c9; }
html[data-theme="dark"] .qi-draft-head, html[data-theme="dark"] .qi-save { border-color: #2b4056; }
html[data-theme="dark"] .qi-empty, html[data-theme="dark"] .qi-ref, html[data-theme="dark"] .qi-expl, html[data-theme="dark"] .qi-save small, html[data-theme="dark"] .qi-letter { color: #9fb2c7; }
html[data-theme="dark"] .qi-status { color: #c9b8ff; }
#importAiModal .question-modal-head { gap: 8px; }
#importAiModal .qi-reset { margin-left: auto; flex-shrink: 0; min-height: 40px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--pro-blue); font: inherit; font-weight: 600; cursor: pointer; }
#importAiModal .qi-unfile { flex-shrink: 0; min-width: 36px; min-height: 36px; border: 0; border-radius: 6px; background: none; color: #66768a; font-size: 18px; line-height: 1; cursor: pointer; }
#importAiModal .qi-reset:hover, #importAiModal .qi-unfile:hover { background: #eef4fa; }
html[data-theme="dark"] #importAiModal .qi-reset { color: #8cc8ff; }
html[data-theme="dark"] #importAiModal .qi-reset:hover, html[data-theme="dark"] #importAiModal .qi-unfile:hover { background: #1a2d44; }
.qi-layout > * { min-width: 0; }
.qi-msg, .qi-bubble, .qi-prompt, .qi-option span { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .modal-backdrop#importAiModal { padding: 0; }
  #importAiModal > .import-ai-modal { width: 100%; max-width: 100%; margin: 0; }
  .qi-layout { grid-template-columns: minmax(0, 1fr); padding: 10px 0 12px; }
  .qi-messages { max-height: 46dvh; }
}
/* Form bo cau hoi mo tu tro ly nhap de: noi tren hop nhap de */
#quizModal.qi-over { z-index: 90; }

/* Tro ly AI (assistant.js): bong bong noi, ngan keo ben phai, trang rieng dung chung khung chat */
.as-bubble-button { position: fixed; right: 0; top: 46%; z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 46px; min-height: 64px; padding: 8px 0; border: 0; border-radius: 14px 0 0 14px; background: linear-gradient(160deg, #7b5cff, #4c2fd6); color: #fff; font: 800 15px var(--font-heading); box-shadow: -4px 6px 22px rgba(76, 47, 214, .35); cursor: pointer; }
.as-bubble-button span:first-child { font-size: 14px; }
.as-bubble-button:hover { width: 52px; }
.as-bubble-button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.as-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 75; width: min(440px, 100vw); display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--pro-line); box-shadow: -18px 0 48px rgba(9, 38, 70, .18); transform: translateX(105%); transition: transform .22s ease; visibility: hidden; }
.as-drawer.open { transform: none; visibility: visible; }
.as-drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--pro-line); color: #4c2fd6; }
.as-drawer-body { flex: 1; min-height: 0; display: flex; }
.as-head-btn { min-width: 40px; min-height: 40px; border: 0; border-radius: 8px; background: none; color: #4f6074; font-size: 17px; cursor: pointer; }
.as-head-btn:hover { background: #eef4fa; }
.as-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.as-page-host { display: flex; height: calc(100dvh - 330px); min-height: 420px; border: 1px solid var(--pro-line); border-radius: 12px; background: #fff; overflow: hidden; }
.as-page-host .as-messages { padding: 18px 22px; }
.as-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.as-msg { display: flex; flex-direction: column; max-width: 92%; }
.as-user { align-self: flex-end; }
.as-user .as-bubble { background: var(--pro-blue); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.as-ai .as-bubble { background: #f4f1ff; color: #22184f; border-bottom-left-radius: 4px; }
.as-bubble { padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.as-md p { margin: 0 0 6px; } .as-md p:last-child { margin-bottom: 0; }
.as-md ul, .as-md ol { margin: 2px 0 6px; padding-left: 20px; }
.as-md .as-h { font-weight: 700; }
.as-md code { padding: 1px 5px; border-radius: 4px; background: rgba(76, 47, 214, .1); font-size: 13px; }
.as-table { overflow-x: auto; margin: 4px 0 6px; }
.as-table table { border-collapse: collapse; font-size: 13px; }
.as-table th, .as-table td { border: 1px solid #d9d2f7; padding: 4px 8px; text-align: left; vertical-align: top; white-space: nowrap; }
.as-table th { background: rgba(76, 47, 214, .08); }
.as-step { align-self: flex-start; font-size: 12px; color: #5b6b80; padding: 2px 10px; border-radius: 99px; background: #eef4fa; }
.as-step.error { color: #9b1c1c; background: #fdecec; }
.as-step.declined { color: #6b7280; text-decoration: line-through; }
.as-typing { align-self: flex-start; font-size: 13px; color: #5b3fb5; }
.as-confirm { align-self: stretch; border: 1.5px solid #e8b04a; background: #fffaf0; border-radius: 10px; padding: 10px 12px; }
.as-confirm small { color: #8a5a00; font-weight: 700; letter-spacing: .04em; }
.as-confirm p { margin: 4px 0 8px; font-weight: 600; }
.as-confirm-actions { display: flex; gap: 8px; }
.as-confirm-actions button { min-height: 40px; }
.as-intro { padding: 6px 2px; color: #33445a; font-size: 14px; }
.as-intro p { margin: 6px 0 10px; }
.as-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.as-suggest button { border: 1px solid #d5cdf8; background: #f8f6ff; color: #4c2fd6; border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; min-height: 36px; }
.as-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 12px; border-top: 1px solid var(--pro-line); }
.as-compose textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; border: 1px solid var(--pro-line); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 14px; }
.as-compose .primary-button { min-height: 44px; }
@media (max-width: 780px) { .as-page-host { height: calc(100dvh - 220px); } .as-bubble-button { top: auto; bottom: 90px; } }
html[data-theme="dark"] .as-drawer, html[data-theme="dark"] .as-page-host { background: #0d1928; border-color: #2b4056; }
html[data-theme="dark"] .as-drawer-head, html[data-theme="dark"] .as-compose { border-color: #2b4056; color: #c9b8ff; }
html[data-theme="dark"] .as-ai .as-bubble { background: #221a46; color: #ece6ff; }
html[data-theme="dark"] .as-step { background: #14263a; color: #9fb2c7; }
html[data-theme="dark"] .as-step.error { background: #3b1717; color: #ffc9c9; }
html[data-theme="dark"] .as-confirm { background: #2b2210; border-color: #7a5a1c; }
html[data-theme="dark"] .as-confirm small { color: #ffd98a; }
html[data-theme="dark"] .as-intro { color: #c3d3e4; }
html[data-theme="dark"] .as-suggest button { background: #1a1638; border-color: #3d3378; color: #c9b8ff; }
html[data-theme="dark"] .as-compose textarea { background: #101d2e; color: #eaf3fd; border-color: #30465e; }
html[data-theme="dark"] .as-head-btn { color: #9fb2c7; }
html[data-theme="dark"] .as-head-btn:hover { background: #1a2d44; }
html[data-theme="dark"] .as-table th, html[data-theme="dark"] .as-table td { border-color: #3d3378; }

/* He thong -> Tai khoan (accounts.js) */
.account-panel { grid-template-columns: minmax(200px, .7fr) 2fr; align-items: start; }
.account-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.account-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.account-form input:not([type=checkbox]), .account-form select { min-height: 42px; border: 1px solid var(--pro-line); border-radius: 8px; padding: 0 10px; font: inherit; font-weight: 400; }
.account-form .account-invite { flex-direction: row; align-items: center; gap: 8px; grid-column: span 2; }
.account-form button { min-height: 44px; }
.account-form .login-error { grid-column: 1 / -1; margin: 0; }
.account-admin { color: #5b3fb5; font-weight: 700; }
.account-locked td { color: #8a96a6; }
@media (max-width: 900px) { .account-panel { grid-template-columns: 1fr; } .account-form { grid-template-columns: 1fr; } .account-form .account-invite { grid-column: auto; } }
html[data-theme="dark"] .account-form input:not([type=checkbox]), html[data-theme="dark"] .account-form select { background: #101d2e; color: #eaf3fd; border-color: #30465e; }
html[data-theme="dark"] .account-admin { color: #c9b8ff; }

/* Giao bai giang / bai kiem tra (assign.js) */
.pkg-panel { grid-template-columns: minmax(200px, .8fr) 2fr; align-items: start; }
.pkg-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.pkg-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.pkg-form select, .pkg-form input:not([type=checkbox]) { min-height: 42px; border: 1px solid var(--pro-line); border-radius: 8px; padding: 0 10px; font: inherit; font-weight: 400; }
.pkg-form .pkg-wide, .pkg-form .enroll-picked, .pkg-form .enroll-result { grid-column: 1 / -1; }
.pkg-form button { min-height: 44px; justify-self: start; }
@media (max-width: 900px) { .pkg-panel { grid-template-columns: 1fr; } .pkg-form { grid-template-columns: 1fr; } }
html[data-theme="dark"] .pkg-form select, html[data-theme="dark"] .pkg-form input:not([type=checkbox]) { background: #101d2e; color: #eaf3fd; border-color: #30465e; }
#accountForm label.account-invite { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; font-weight: 600; }
#accountForm label.account-invite input { width: 18px; height: 18px; min-height: 0; margin: 0; flex: none; }
#accountTableBody button { white-space: nowrap; border: 0; background: none; color: var(--pro-blue); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 4px; min-height: 36px; }
html[data-theme="dark"] #accountTableBody button { color: #8cc8ff; }
.as-file { display: flex; align-items: center; gap: 8px; margin: 0 12px 6px; padding: 4px 4px 4px 10px; border-radius: 8px; background: #eef4fa; font-size: 13px; }
.as-file span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-attach { align-self: flex-end; margin-bottom: 4px; padding: 6px 10px; border-radius: 10px; background: #e3ecf8; color: #1d3a5f; font-size: 13px; font-weight: 600; }
.as-panel.as-drop { outline: 2px dashed #7b5cff; outline-offset: -6px; }
html[data-theme="dark"] .as-file, html[data-theme="dark"] .as-attach { background: #14263a; color: #c3d3e4; }
.as-confirm-list { max-height: 220px; overflow-y: auto; margin: 0 0 10px; padding: 6px 10px 6px 30px; border-radius: 8px; background: rgba(255,255,255,.7); font-size: 13px; }
html[data-theme="dark"] .as-confirm-list { background: rgba(0,0,0,.25); }

/* Hinh / video + canh le trong cau hoi (questionMediaNode trong app.js, khung sua trong question-bank.js) */
.q-align-left { text-align: left; } .q-align-center { text-align: center; } .q-align-right { text-align: right; }
.q-media { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 14px; }
.q-media.align-left { justify-content: flex-start; } .q-media.align-center { justify-content: center; } .q-media.align-right { justify-content: flex-end; }
.q-media figure { margin: 0; max-width: min(100%, 560px); }
.q-media img, .q-media video { display: block; max-width: 100%; max-height: 360px; border-radius: 8px; border: 1px solid var(--pro-line); background: #000; }
.q-media img { background: #fff; }
.q-media figcaption { font-size: 12px; color: #66768a; margin-top: 4px; text-align: center; }
.qe-media { display: flex; flex-direction: column; gap: 8px; }
.qe-media-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.qe-align { display: inline-flex; border: 1px solid var(--pro-line); border-radius: 8px; overflow: hidden; }
.qe-align button { border: 0; background: none; padding: 0 12px; min-height: 36px; font: inherit; font-weight: 600; cursor: pointer; color: #4f6074; }
.qe-align button[aria-pressed="true"] { background: var(--pro-blue); color: #fff; }
.qe-media-add { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; cursor: pointer; }
.qe-media-list { display: flex; flex-wrap: wrap; gap: 10px; }
.qe-media-item { display: flex; flex-direction: column; gap: 4px; width: 180px; }
.qe-media-item img, .qe-media-item video { width: 180px; height: 120px; object-fit: contain; border-radius: 6px; border: 1px solid var(--pro-line); background: #f4f7fb; }
.qe-media-item input { min-height: 32px; border: 1px solid var(--pro-line); border-radius: 6px; padding: 0 8px; font: inherit; font-size: 12px; }
.media-badge { background: #e6f3ff; color: #145a9e; margin-right: 4px; }
html[data-theme="dark"] .q-media figcaption { color: #9fb2c7; }
html[data-theme="dark"] .qe-align { border-color: #30465e; } html[data-theme="dark"] .qe-align button { color: #c3d3e4; }
html[data-theme="dark"] .qe-media-item img, html[data-theme="dark"] .qe-media-item video { background: #0d1928; border-color: #30465e; }
html[data-theme="dark"] .qe-media-item input { background: #101d2e; color: #eaf3fd; border-color: #30465e; }
html[data-theme="dark"] .media-badge { background: #14304d; color: #9fd0ff; }
.qe-media-item button.text { align-self: flex-start; border: 0; background: none; padding: 2px 4px; min-height: 28px; font: inherit; font-size: 12px; font-weight: 600; color: #c0392b; cursor: pointer; }
html[data-theme="dark"] .qe-media-item button.text { color: #ff9b8f; }

/* Mon hoc (results.js) */
.subject-panel { grid-template-columns: minmax(180px, .6fr) 2fr; align-items: start; margin-bottom: 16px; }
.subject-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.subject-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.subject-form input:not([type=checkbox]) { min-height: 42px; border: 1px solid var(--pro-line); border-radius: 8px; padding: 0 10px; font: inherit; font-weight: 400; }
.subject-form fieldset { border: 1px solid var(--pro-line); border-radius: 8px; padding: 8px 12px; margin: 0; }
.subject-form legend { font-size: 13px; font-weight: 700; padding: 0 4px; }
.subject-checks { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.subject-checks label { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.subject-actions { display: flex; gap: 8px; grid-column: 1 / -1; }
.subject-actions button { min-height: 42px; }
.subject-form .login-error { grid-column: 1 / -1; margin: 0; }
@media (max-width: 900px) { .subject-panel { grid-template-columns: 1fr; } .subject-form { grid-template-columns: 1fr; } }
html[data-theme="dark"] .subject-form input:not([type=checkbox]) { background: #101d2e; color: #eaf3fd; border-color: #30465e; }
html[data-theme="dark"] .subject-form fieldset { border-color: #30465e; }

/* Mau bieu ket qua (results.js) */
.tpl-panel, .tpl-export { grid-template-columns: minmax(200px, .8fr) 2fr; align-items: start; margin-bottom: 16px; }
.tpl-panel code, .tpl-guide code { font-size: 12px; padding: 1px 4px; border-radius: 4px; background: rgba(23, 104, 212, .1); }
.tpl-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.tpl-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.tpl-form input:not([type=file]), .tpl-form select { min-height: 42px; border: 1px solid var(--pro-line); border-radius: 8px; padding: 0 10px; font: inherit; font-weight: 400; }
.tpl-form .tpl-file { grid-column: 1 / -1; }
.tpl-form button { min-height: 44px; justify-self: start; }
.tpl-form .enroll-result { grid-column: 1 / -1; margin: 0; }
.tpl-guide { margin-top: 16px; }
.tpl-guide summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.tpl-guide-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tpl-guide h4 { margin: 8px 0; font-size: 14px; }
#tplBody .row-actions .secondary-action { min-height: 34px; padding: 0 12px; margin-right: 6px; }
@media (max-width: 900px) { .tpl-panel, .tpl-export { grid-template-columns: 1fr; } .tpl-form, .tpl-guide-cols { grid-template-columns: 1fr; } }
html[data-theme="dark"] .tpl-form input:not([type=file]), html[data-theme="dark"] .tpl-form select { background: #101d2e; color: #eaf3fd; border-color: #30465e; }
.tpl-guide.bank-panel { padding: 4px 16px 12px; overflow-x: auto; }
.tpl-guide .bank-table td { padding: 6px 10px; }

/* Dai "de thi chua co thay doi moi" trong trang bo cau hoi (quizzes.js) */
.set-apply { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 12px; padding: 12px 16px; border: 1.5px solid #e8b04a; border-radius: 10px; background: #fffaf0; }
.set-apply strong { color: #8a5a00; }
.set-apply p { margin: 4px 0 0; font-size: 13px; color: #5b4a24; }
.set-apply button { min-height: 44px; flex-shrink: 0; }
@media (max-width: 780px) { .set-apply { flex-direction: column; align-items: stretch; } }
html[data-theme="dark"] .set-apply { background: #2b2210; border-color: #7a5a1c; }
html[data-theme="dark"] .set-apply strong { color: #ffd98a; }
html[data-theme="dark"] .set-apply p { color: #e8d9b5; }
/* Giao khoa 3 buoc (22/11/2026, assign-course.js): chu to, moi buoc mot khoi, nut cham >= 44px. */
.assign-flow{display:grid;gap:18px;max-width:880px}
.assign-flow .af-title{font-size:24px;margin:0}
.af-step{border:1px solid var(--line);border-radius:12px;padding:16px}
.af-step h3{display:flex;align-items:center;gap:10px;font-size:18px;margin:0 0 12px}
.af-step h3 small{font-size:14px;font-weight:500;opacity:.8}
.af-num{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#2563eb;color:#fff;font-size:15px;flex:none}
.af-courses{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}
.af-course{display:grid;gap:4px;text-align:left;padding:14px;min-height:64px;border:2px solid var(--line);border-radius:10px;background:transparent;color:inherit;font:inherit;cursor:pointer}
.af-course strong{font-size:16px}
.af-course small{font-size:13px;opacity:.75}
.af-course[aria-checked="true"]{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.25)}
.af-filter{display:grid;grid-template-columns:1fr 220px;gap:8px;margin-bottom:8px}
.af-filter input,.af-filter select{min-height:44px;font-size:16px}
.af-bulkbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}
.af-bulkbar button{min-height:40px}
.af-people{list-style:none;margin:0;padding:0;max-height:420px;overflow:auto;border:1px solid var(--line);border-radius:10px}
.af-person label{display:flex;align-items:center;gap:12px;padding:10px 12px;min-height:52px;cursor:pointer;border-bottom:1px solid var(--line)}
.af-person input{width:20px;height:20px;flex:none}
.af-person-text{display:grid;flex:1;min-width:0}
.af-person-text strong{font-size:15px}
.af-person-text small{font-size:13px;opacity:.75;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.af-person.is-busy label{opacity:.55;cursor:not-allowed}
.af-tag{font-style:normal;font-size:12px;padding:3px 8px;border-radius:999px;flex:none}
.af-tag-active{background:rgba(148,163,184,.25)}
.af-tag-valid{background:rgba(22,163,74,.18);color:#15803d}
html[data-theme="dark"] .af-tag-valid{color:#4ade80}
.af-empty,.af-more{padding:14px;opacity:.75;font-size:14px}
.af-due{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.af-due button{min-height:44px;min-width:88px;border:2px solid var(--line);border-radius:10px;background:transparent;color:inherit;font:inherit;cursor:pointer}
.af-due button.on{border-color:#2563eb;background:rgba(37,99,235,.12)}
.af-due input{min-height:44px;font-size:16px}
.af-submit{display:grid;gap:8px}
.af-submit .primary-button{min-height:52px;font-size:17px}
.af-history{margin-top:8px}
.af-history>summary{cursor:pointer;padding:10px 0;font-size:15px}
@media(max-width:640px){.af-filter{grid-template-columns:1fr}.af-courses{grid-template-columns:1fr}}
/* Bao cao theo cau hoi (22/11/2026): o to tren dau man Bao cao; dien thoai gom o loc vao "Bo loc". */
.rq-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px;margin-bottom:16px}
.rq-tile{display:grid;gap:4px;text-align:left;padding:14px 16px;min-height:72px;border:2px solid var(--line);border-radius:12px;background:transparent;color:inherit;font:inherit;cursor:pointer}
.rq-tile strong{font-size:16px}
.rq-tile small{font-size:13px;opacity:.75}
.rq-tile:hover,.rq-tile[aria-pressed="true"]{border-color:#2563eb}
.rq-tile[aria-pressed="true"]{box-shadow:0 0 0 3px rgba(37,99,235,.25)}
.rp-filter-box>summary{cursor:pointer;font-weight:600;padding:8px 0;min-height:44px;display:flex;align-items:center}
.rp-filter-box:not([open])>summary{border:1px solid var(--line);border-radius:10px;padding:8px 14px}
@media(max-width:640px){.rq-tiles{grid-template-columns:1fr 1fr}.rq-tile{min-height:64px;padding:10px 12px}.rq-tile small{display:none}.rp-head p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}}
/* Bai SCORM (24/11/2026, Tuan: "keo xuong lien tuc, khong hieu dang keo cai gi"): truoc day van hien thanh Doc to + the slide
   (lap tieu de bai) + khung SCORM cao co dinh 72vh -> hai lop cuon chong nhau. Nay: an phan cua bai slide, khung SCORM gian vua
   cho trong, chi con thanh cuon BEN TRONG goi. */
.lesson-player[data-kind="scorm"] .slide-toolbar,.lesson-player[data-kind="scorm"] .lesson-slides>.slide-card{display:none!important}
.lesson-player[data-kind="scorm"] .lesson-slides{padding:8px 12px 0}
/* Goi gui chu tung slide (khoa Goc re): hien lai thanh doc to, bo o chon ngon ngu (goi chi co mot ban). */
.lesson-player[data-kind="scorm"].scorm-readable .slide-toolbar{display:flex!important;flex:none}
/* Bai SCORM: thanh doc nam o hang duoi, cung hang "Bai tiep theo"; toc do luon hien, "Tu doc" trong nut tuy chon. */
.lesson-player[data-kind="scorm"] .lp-nav{grid-template-columns:minmax(0,1fr) auto}
.lesson-player[data-kind="scorm"] .lp-nav>#lpPrev,.lesson-player[data-kind="scorm"] .lp-nav>.lp-nav-center{display:none}
.lesson-player[data-kind="scorm"] .lp-nav>.slide-toolbar{min-width:0;gap:6px;flex-wrap:nowrap}
.lesson-player[data-kind="scorm"] .lp-nav>.slide-toolbar.options-open{flex-wrap:wrap}
.lesson-player[data-kind="scorm"] .lp-nav>.slide-toolbar .lp-rate{display:flex!important;order:0}
.lesson-player[data-kind="scorm"] .lp-nav>.slide-toolbar :is(#lpSpeak,#lpStop){order:-1}
.lesson-player[data-kind="scorm"] .lp-nav>.slide-toolbar .lp-options-toggle{display:inline-flex}
.lesson-player[data-kind="scorm"] .lp-nav>.slide-toolbar:not(.options-open) .lp-toggle{display:none}
@media (max-width:560px){
  .lesson-player[data-kind="scorm"] .lp-nav{padding-left:10px;padding-right:10px}
  .lesson-player[data-kind="scorm"] .lp-nav>.slide-toolbar :is(#lpSpeak,#lpStop,.lp-options-toggle)>span{display:none}
  .lesson-player[data-kind="scorm"] .lp-nav>.slide-toolbar .lp-rate{font-size:0;gap:0}
  .lesson-player[data-kind="scorm"] .lp-nav>.slide-toolbar .lp-rate select{font-size:14px}
  .lesson-player[data-kind="scorm"] .lp-nav>.slide-toolbar :is(#lpSpeak,#lpStop,.lp-options-toggle,select){min-height:44px;min-width:44px;justify-content:center}
}
.lesson-player[data-kind="scorm"] .slide-toolbar .lp-opt:has(#lpLanguage){display:none!important}
.lesson-player[data-kind="scorm"] .lp-media{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
.lesson-player[data-kind="scorm"] .lp-media iframe.lp-scorm{flex:1 1 auto;height:auto;min-height:0}
.lesson-player[data-kind="scorm"] .lp-media-note{margin:6px 0 0;flex:none}
@media (max-width:780px){.lesson-player[data-kind="scorm"] .lesson-slides{padding:0}}
/* Trinh hoc mo (24/11/2026): khoa cuon trang nen phia sau. Truoc day vuot vao dau/chan trinh hoc tren dien thoai lam trang
   Tong quan phia sau cuon theo, nguoi hoc thay "keo xuong lien tuc". */
html:has(.lesson-player.open),html:has(.lesson-player.open) body{overflow:hidden}
.lesson-player.open{overscroll-behavior:contain}
/* Trinh hoc (24/11/2026, Tuan: "tien do ... de o ben phai thay vi ben trai, de tranh distracting"): cot tien do / noi dung
   khoa chuyen sang BEN PHAI, mac dinh thu gon (learn.js sidebarPref), nut "Tien do" dat cuoi thanh dau, phan bai dung het ngang. */
.lesson-player>header #lpToggleSidebar{order:10}
@media (min-width:901px){
  .lesson-player .player-layout{grid-template-columns:minmax(0,1fr) 300px}
  .lesson-player .lesson-list{order:2;border-right:0;border-left:1px solid var(--line)}
  .lesson-player.sidebar-closed .player-layout{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:900px){.lesson-player .lesson-list{left:auto;right:0;transform:translateX(102%)}}

