/* ==========================================================================
   Hoàn thiện giao diện trước khi đưa lên môi trường thật (rà soát 15/11/2026).
   Nạp sau cùng. Mỗi mục ghi rõ lỗi đã sửa để dễ đối chiếu.
   ========================================================================== */

/* 1. Đổi trang không giật ------------------------------------------------------
   Lỗi: trang dài có thanh cuộn, trang ngắn không có -> cả bố cục xô ngang ~15px mỗi lần đổi trang;
   mở hộp thoại (khoá cuộn) cũng xô. Sửa: luôn chừa chỗ thanh cuộn, thanh mảnh, dải chừa cạnh thanh trên tô cùng màu thanh trên. */
@media screen and (min-width: 760px) {
    .main-area {
        scrollbar-gutter: stable;
        scrollbar-width: thin;
        scrollbar-color: color-mix(in srgb, var(--chu-phu) 45%, transparent) transparent;
        background: linear-gradient(var(--nen-the), var(--nen-the)) top right / 24px var(--chieu-cao-header) no-repeat;
    }
}
/* Lỗi: mọi khối trượt lên 10px rồi mới đứng yên ở mỗi lần đổi trang (cảm giác giật). Sửa: chỉ mờ dần rất nhanh, không dịch chuyển. */
.content > * { animation: ht-hien 140ms ease-out both !important; }
.content > *:nth-child(n) { animation-delay: 0ms !important; }
@keyframes ht-hien { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .content > * { animation: none !important; } }
:root[data-giam-chuyen-dong] .content > * { animation: none !important; }
/* Khung xương giữ chỗ cao hơn để nội dung thật hiện ra không đẩy chân trang nhảy lên xuống quá nhiều. */
.content > .khung-xuong { min-height: 12rem; }

/* 2. Khoảng cách giữa các khối --------------------------------------------------
   Lỗi: nhiều khối nằm sát nhau (ví dụ "So sánh điểm" dính vào lưới đề kiểm tra) vì chỉ một số lớp có margin.
   Sửa: mọi khối liền kề trong vùng nội dung cách nhau 1rem. :where() = độ ưu tiên 0, khối nào đã tự đặt khoảng cách thì giữ nguyên;
   lề dọc gộp với nhau nên không bị cộng đôi. */
:where(.content > * + *) { margin-top: var(--kc-4); }
:where(.tt-khoi > * + .kt-luoi, .tt-khoi + .kt-luoi, .kt-so-sanh + .kt-luoi) { margin-top: var(--kc-4); }
.kt-so-sanh { margin-bottom: var(--kc-4); }
.kt-luoi, .luoi-the-lop, .tv-luoi, .bt-luoi-the { row-gap: 1rem; }
/* Các nhóm thẻ xếp chồng (lớp theo khoá, bài tập theo học phần...) luôn có khe. */
.nhom-the-lop + .nhom-the-lop, .bt-nhom + .bt-nhom, .tt-khoi + .tt-khoi { margin-top: var(--kc-4); }

/* 3. Bảng có tiêu đề dính -------------------------------------------------------
   Lỗi: trong hộp "Chấm bài", ô nhập điểm của các dòng cuộn đè lên hàng tiêu đề (ô nhập Radzen có z-index riêng). */
.bang-diem thead th, .directory-grid .rz-grid-table thead th { z-index: 3; }
.bang-diem th { white-space: nowrap; }
.bang-cuon { position: relative; overscroll-behavior: auto; }
.bang-cham-bai th:nth-child(3), .bang-cham-bai td:nth-child(3) { width: 9rem; min-width: 9rem; }
.bang-cham-bai td:nth-child(4) .rz-textbox { width: 100%; min-width: 10rem; }
.bang-cham-bai .o-diem { width: 100%; }
.bang-cham-bai td:first-child { min-width: 11rem; }

/* 4. Bấm cả ô ------------------------------------------------------------------
   hoan-thien.js gắn lớp co-the-bam cho thẻ có đích bấm; cả thẻ hiện con trỏ tay và sáng viền khi rê. */
.co-the-bam { cursor: pointer; }
.co-the-bam:is(.the-lop, .tv-the, .ol-the, .kt-the, .the-khoa-hoc, .dv-the-a, .hk-to, .lt-the, .the-buoi, .sd-the, .nh-the, .bt2-the) {
    transition: border-color var(--tg-nhanh) ease, box-shadow var(--tg-nhanh) ease, transform var(--tg-nhanh) ease;
}
.co-the-bam:is(.the-lop, .tv-the, .ol-the, .kt-the, .the-khoa-hoc, .dv-the-a, .hk-to, .lt-the, .sd-the, .nh-the, .bt2-the):hover {
    border-color: var(--mau-chinh-sang);
    box-shadow: 0 10px 24px -14px rgba(14, 42, 30, .35);
    transform: translateY(-1px);
}
.directory-grid .rz-data-row.co-the-bam:hover > td { background: color-mix(in srgb, var(--mau-chinh-nhat) 70%, var(--nen-the)); }
@media (prefers-reduced-motion: reduce) { .co-the-bam:hover { transform: none !important; } }
/* Liên kết dạng ô (menu, chip, thẻ nhỏ) phủ kín ô của nó. */
.tag-tin, .muc-con, .module-menu-main, .o-bat-dau { display: flex; align-items: center; }
.tag-tin { display: inline-flex; min-height: 1.75rem; padding-inline: .625rem; }

/* 5. Điện thoại và máy tính bảng ------------------------------------------------ */
img, video, canvas, svg { max-width: 100%; }
img { height: auto; }
.content { overflow-wrap: anywhere; }
.content :is(table) { overflow-wrap: normal; }
/* Bảng rộng luôn cuộn ngang trong khung riêng, không làm trang cuộn ngang. */
.bang-cuon, .rz-data-grid, .rz-datatable-scrollable-wrapper { max-width: 100%; }
.rz-data-grid { overflow-x: auto; }
@media (max-width: 1100px) {
    .kt-so-sanh li { grid-template-columns: minmax(8rem, 1fr) minmax(6rem, 1.4fr) 6.5rem; }
}
@media (max-width: 759px) {
    .content { padding: 1rem .75rem 1.5rem; }
    .page-heading-row { margin-bottom: 1rem; }
    .page-heading h1 { font-size: 1.375rem; }
    .page-heading p { font-size: .875rem; }
    .thao-tac-dau-trang { display: flex; flex-wrap: wrap; gap: .5rem; }
    .thao-tac-dau-trang > .rz-button, .thao-tac-dau-trang > a, .thao-tac-dau-trang > button { flex: 1 1 auto; justify-content: center; }
    /* Hộp thoại chiếm gần trọn màn hình điện thoại; nút ở chân luôn thấy. */
    .rz-dialog { width: calc(100vw - 16px) !important; max-width: calc(100vw - 16px) !important; left: 8px !important; right: 8px !important; }
    .rz-dialog-content { max-height: calc(100dvh - 7rem); }
    .bieu-mau-chan { position: sticky; bottom: -1rem; z-index: 4; margin-inline: -1rem; padding: .75rem 1rem; background: var(--nen-the); border-top: 1px solid var(--vien-the); }
    .kt-tong { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kt-luoi, .luoi-the-lop { grid-template-columns: 1fr; }
    .top-row { padding-inline: .75rem; }
    .cong-cu-tai-khoan { gap: .25rem; }
    .cong-cu-tai-khoan .user-details { display: none; }
    /* Ô bấm tối thiểu 44px trên màn hình cảm ứng. */
    .nut-nho, .rz-button.rz-button-icon-only { min-width: 2.5rem; min-height: 2.5rem; }
}
@media (hover: none) {
    .co-the-bam:hover { transform: none !important; }
}

/* 6. Chi tiết nhỏ ---------------------------------------------------------------- */
/* Chân trang demo luôn cách khối cuối. */
.app-footer { margin-top: 2rem !important; }
/* Thanh cuộn bảng trong hộp thoại cũng mảnh. */
.bang-cuon, .rz-dialog-content { scrollbar-width: thin; }

/* 7. Mục "Sơ đồ tổ chức" ở nhóm Thông tin (đã đưa ra khỏi Quản lý khoa vì gồm cả nhánh Đào tạo). */
.module-menu-group[data-phan-he="so-do"] { --mm: #b9e3a2; }

/* 8. Trang đăng nhập: tắt sóng chạy khi người dùng chọn giảm chuyển động trong Cài đặt. */
:root[data-giam-chuyen-dong] .bgt-den::after, :root[data-giam-chuyen-dong] .bgt-song .s1 { animation: none !important; }
[data-giao-dien="toi"] .cot-dang-nhap { background: var(--nen-the); }

/* 9. Phòng thi: trang quy chế, hình mờ, lớp che khi thoát toàn màn hình (15/11/2026) */
.pt-cho { max-width: 46rem; margin: 0 auto; padding: 1.75rem; border: 1px solid var(--vien-the); border-radius: 18px; background: var(--nen-the); }
.pt-cho h1 { margin: .5rem 0 .25rem; font-family: var(--font-tieu-de); font-size: 1.625rem; }
.pt-cho h2 { margin: 1.5rem 0 .75rem; font-size: 1rem; }
.pt-cho-so { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 1.25rem 0 0; }
.pt-cho-so > div { padding: .75rem .875rem; border: 1px solid var(--vien-the); border-radius: 12px; background: var(--nen-dai, var(--mau-chinh-nhat)); }
.pt-cho-so dt { color: var(--chu-phu); font-size: .75rem; font-weight: 600; }
.pt-cho-so dd { margin: 0; font-family: var(--font-tieu-de); font-size: 1.125rem; font-weight: 700; }
.pt-quy-che { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.pt-quy-che li { display: flex; gap: .625rem; align-items: flex-start; font-size: .9375rem; line-height: 1.5; }
.pt-quy-che .rzi { flex: 0 0 auto; margin-top: .125rem; color: var(--tin-hieu); font-size: 1.25rem; }
.pt-cam-ket { display: flex; gap: .625rem; align-items: flex-start; margin: 1.25rem 0 1rem; padding: .875rem 1rem; border: 1px dashed var(--vien-o-nhap); border-radius: 12px; cursor: pointer; font-weight: 600; }
.pt-cam-ket input { width: 1.125rem; height: 1.125rem; margin-top: .1875rem; accent-color: var(--mau-chinh); }
.pt-goc { position: relative; -webkit-user-select: none; user-select: none; }
.pt-hinh-mo { position: absolute; inset: 0; z-index: 0; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4rem 3rem; overflow: hidden; padding: 6rem 1rem; pointer-events: none; }
.pt-hinh-mo span { transform: rotate(-24deg); color: var(--chu-chinh); opacity: .055; font-size: .875rem; font-weight: 700; white-space: nowrap; }
.pt-goc > :not(.pt-hinh-mo):not(.pt-che):not(.pt-thanh) { position: relative; z-index: 1; }
.pt-goc > .pt-thanh { position: sticky; z-index: 20; }
.pt-goc.can-toan-man-hinh > :not(.pt-hinh-mo):not(.pt-che) { filter: blur(10px); pointer-events: none; }
.pt-che { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; padding: 1.5rem; background: rgba(5, 18, 12, .82); color: #fff; text-align: center; }
.pt-che .rzi { font-size: 3rem; color: #5eead4; }
.pt-che h2 { margin: 0; color: #fff; font-size: 1.375rem; }
.pt-che p { margin: 0 0 .5rem; color: #cfe3d8; }
.pt-canh-bao.nguy { border-left-color: var(--mau-nguy-hiem); background: color-mix(in srgb, var(--loi-nen) 70%, var(--nen-the)); color: var(--loi-chu, var(--mau-nguy-hiem)); }
@media (max-width: 640px) { .pt-cho { padding: 1.25rem 1rem; } .pt-cho-so { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kt-chong-gian-lan { display: grid; gap: .5rem; margin: 1rem 0 0; padding: .75rem 1rem 1rem; border: 1px solid var(--vien-the); border-radius: 12px; background: color-mix(in srgb, var(--tin-hieu-nhat) 55%, var(--nen-the)); }
.kt-chong-gian-lan legend { display: flex; align-items: center; gap: .375rem; float: none; width: auto; margin: 0; padding: 0 .375rem; font-size: .875rem; font-weight: 700; }
.kt-chong-gian-lan .chon-khoa { margin: 0; }
.kt-chong-gian-lan legend .rzi { color: var(--tin-hieu); font-size: 1.125rem; }

/* 10. Bài tập theo hình thức, chấm bài, nhóm học tập (15/11/2026) */
.gb-hinh-thuc { margin: 0; padding: 0; border: 0; }
.gb-hinh-thuc legend { float: none; width: auto; margin-bottom: .5rem; font-size: .875rem; font-weight: 600; }
.gb-o-chon { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem; }
.gb-o-chon label { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; padding: .625rem .75rem; border: 1px solid var(--vien-the); border-radius: 12px; background: var(--nen-the); cursor: pointer; font-size: .8125rem; transition: border-color var(--tg-nhanh), box-shadow var(--tg-nhanh); }
.gb-o-chon label:hover { border-color: var(--mau-chinh-sang); }
.gb-o-chon label.dang-chon { border-color: var(--mau-chinh); box-shadow: inset 0 0 0 1px var(--mau-chinh); background: color-mix(in srgb, var(--mau-chinh-nhat) 60%, var(--nen-the)); }
.gb-o-chon input { position: absolute; opacity: 0; pointer-events: none; }
.gb-o-chon label:has(input:focus-visible) { outline: 2px solid var(--mau-chinh-sang); outline-offset: 2px; }
.gb-o-chon .rzi { color: var(--mau-chinh); font-size: 1.375rem; }
.gb-hinh-thuc .phu-dong { margin: .5rem 0 0; }
.gb-nhom { display: grid; grid-template-columns: 1.4fr 1fr; gap: .75rem; }
@media (max-width: 520px) { .gb-nhom { grid-template-columns: 1fr; } }
.bt-hinh-thuc { display: inline-flex !important; align-items: center; gap: .25rem; margin-top: .125rem; color: var(--chu-phu); font-size: .75rem; }
.bt-hinh-thuc .rzi { font-size: .9375rem; }
.bt-hinh-thuc.ht-nhom { color: var(--m-hoc-vien); }
.bt-hinh-thuc.ht-tieu-luan { color: var(--m-ban-tin); }
.bt-hinh-thuc.ht-chuan-bi-bai { color: var(--m-dao-tao); }
.bt-hinh-thuc.ht-tren-giay { color: var(--m-ca-nhan); }
.nut-lien-ket { display: inline-flex; align-items: center; gap: .375rem; text-decoration: none; }
.nb-thong-tin { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.nb-thong-tin .tt-nhan { display: inline-flex; align-items: center; gap: .25rem; }
.nb-yeu-cau { margin: 0; padding: .625rem .875rem; border-left: 3px solid var(--mau-chinh-sang); border-radius: 8px; background: var(--mau-chinh-nhat); white-space: pre-wrap; font-size: .875rem; }
.nb-nhom { display: flex; gap: .5rem; align-items: flex-start; margin: 0; color: var(--m-hoc-vien); font-weight: 600; font-size: .875rem; }
.nb-o-viet { min-height: 7rem; line-height: 1.6; resize: vertical; }
.nb-dem-tu { margin: -.25rem 0 0; color: var(--chu-phu); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.nb-dem-tu.thieu { color: var(--mau-nguy-hiem); font-weight: 600; }
.cb-thanh { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .75rem; }
.cb-thanh .tt-nhan { display: inline-flex; align-items: center; gap: .25rem; }
.cb-thanh-phai { display: flex; flex-wrap: wrap; gap: .5rem; margin-left: auto; }
.cb-nhap { position: relative; overflow: hidden; cursor: pointer; }
.cb-nhap input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cb-loi { margin: .375rem 0 0; padding-left: 1.25rem; font-size: .8125rem; }
.cb-noi-dung summary { cursor: pointer; color: var(--mau-chinh); font-size: .8125rem; }
.cb-noi-dung div { max-height: 12rem; overflow: auto; margin-top: .25rem; padding: .5rem; border-radius: 8px; background: var(--mau-chinh-nhat); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8125rem; }
.cb-tep { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin-top: .25rem; }
.cb-tep a { display: inline-flex; align-items: center; gap: .125rem; overflow-wrap: anywhere; }
.cb-tep .rzi { font-size: 1rem; }
.nh-chon-lop { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .875rem; }
.nh-chon-lop label { font-weight: 600; }
.nh-chon-lop .form-select { width: auto; min-width: 10rem; }
.nh-chia h2, .nh-chua-co h2 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 1rem; }
.nh-chia-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .75rem; }
.nh-chia-luoi label { display: flex; flex-direction: column; gap: .25rem; font-size: .8125rem; font-weight: 600; }
.nh-chia-luoi .toan-hang { grid-column: 1 / -1; }
.nh-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.nh-the { display: flex; flex-direction: column; gap: .625rem; padding: 1rem; border: 1px solid var(--vien-the); border-top: 3px solid var(--m-hoc-vien); border-radius: 14px; background: var(--nen-the); }
.nh-the.het-han { border-top-color: var(--vien-o-nhap); opacity: .75; }
.nh-the header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.nh-the h2 { margin: 0; font-size: 1.0625rem; }
.nh-the h2 small { color: var(--chu-phu); font-size: .75rem; font-weight: 500; }
.nh-the footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .5rem; border-top: 1px solid var(--vien-nhat); }
.nh-nhiem-vu { margin: 0; padding: .5rem .625rem; border-radius: 8px; background: var(--mau-chinh-nhat); font-size: .8125rem; }
.nh-bai { display: flex; align-items: center; gap: .375rem; margin: 0; font-size: .8125rem; }
.nh-nhan { display: flex; flex-direction: column; gap: .25rem; font-size: .8125rem; font-weight: 600; }
.nh-tv { display: flex; flex-direction: column; gap: .375rem; margin: 0; padding: 0; list-style: none; }
.nh-tv li { display: flex; align-items: center; gap: .5rem; font-size: .875rem; }
.nh-tv li > span:nth-child(2), .nh-tv-ngang li > span:first-child { flex: 1; min-width: 0; }
.nh-tv small { display: block; font-size: .6875rem; }
.nh-tv .user-avatar { flex: 0 0 auto; width: 1.75rem; height: 1.75rem; font-size: .75rem; }
.nh-tn { margin-left: .375rem; padding: .0625rem .375rem; border-radius: 999px; background: var(--dong-thau-nhat); color: var(--dong-thau); font-size: .6875rem; }
.nh-chuyen { max-width: 7.5rem; padding: .125rem .25rem; border: 1px solid var(--vien-o-nhap); border-radius: 6px; background: var(--nen-the); color: var(--chu-chinh); font-size: .75rem; }
.nh-tv-ngang { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem .875rem; }
.de-muc { display: flex; flex-wrap: wrap; gap: .25rem .875rem; padding-top: .375rem; }
.nhan-o { display: block; margin-bottom: .25rem; font-size: .875rem; font-weight: 600; }
.ol-hanh-dong { flex-wrap: wrap; }
.xk-luoi { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.xk-luoi section { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.xk-luoi h3 { margin: 0 0 .25rem; font-size: .9375rem; }
.xk-luoi label { display: flex; flex-direction: column; gap: .25rem; font-size: .8125rem; font-weight: 600; }
.xk-luoi .chon-khoa, .xk-luoi .de-muc label { flex-direction: row; align-items: center; font-weight: 500; }
.xk-nhanh { display: flex; flex-wrap: wrap; gap: .375rem; }
.xk-noi-dung { flex-direction: row !important; align-items: flex-start; gap: .625rem !important; padding: .5rem .625rem; border: 1px solid var(--vien-the); border-radius: 10px; cursor: pointer; }
.xk-noi-dung:has(input:checked) { border-color: var(--mau-chinh); background: color-mix(in srgb, var(--mau-chinh-nhat) 55%, var(--nen-the)); }
.xk-noi-dung input { margin-top: .1875rem; accent-color: var(--mau-chinh); }
.xk-noi-dung span { display: flex; flex-direction: column; gap: .125rem; }
.xk-noi-dung small { color: var(--chu-phu); font-weight: 400; line-height: 1.4; }
@media (max-width: 720px) { .xk-luoi { grid-template-columns: 1fr; } }

/* 11. Bản tin: tin tức báo chí từ RSS (ảnh thật, ghi nguồn, mở bài gốc) */
.bt-muc-ngoai { display: inline-flex; align-items: center; gap: .25rem; }
.bt-muc-ngoai .rzi { font-size: 1rem; }
.bt-tieu-de-khoi > span { display: inline-flex; align-items: center; gap: .375rem; }
.bt-ngoai-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.bt-ngoai-the { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--vien-the); border-radius: 14px; background: var(--nen-the); color: var(--chu-chinh); text-decoration: none; transition: border-color var(--tg-nhanh), box-shadow var(--tg-nhanh), transform var(--tg-nhanh); }
.bt-ngoai-the:hover, .bt-ngoai-the:focus-visible { border-color: var(--mau-chinh-sang); box-shadow: 0 12px 26px -16px rgba(14, 42, 30, .4); transform: translateY(-2px); }
.bt-ngoai-anh { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, var(--mau-chinh-nhat), color-mix(in srgb, var(--mau-chinh) 25%, var(--nen-the))); }
.bt-ngoai-anh img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--duong-cong-mem); }
.bt-ngoai-the:hover .bt-ngoai-anh img { transform: scale(1.04); }
.bt-ngoai-anh.loi::after { content: "public"; position: absolute; inset: 0; display: grid; place-items: center; font-family: "Material Symbols", "Material Icons", "Material Symbols Outlined"; font-size: 2.5rem; color: color-mix(in srgb, var(--mau-chinh) 55%, transparent); }
.bt-ngoai-nguon { position: absolute; left: .5rem; bottom: .5rem; padding: .125rem .5rem; border-radius: 999px; background: rgba(6, 20, 13, .78); color: #fff; font-size: .6875rem; font-weight: 700; letter-spacing: .02em; }
.bt-ngoai-than { display: flex; flex-direction: column; gap: .25rem; padding: .75rem .875rem 1rem; }
.bt-ngoai-than small { color: var(--chu-phu); font-size: .75rem; }
.bt-ngoai-than strong { font-size: .9375rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bt-ngoai-than em { color: var(--chu-phu); font-size: .8125rem; font-style: normal; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bt-loc-ngoai { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: 1rem; }
.nut-chip.dang-chon { border-color: var(--mau-chinh); background: var(--mau-chinh); color: var(--chu-tren-mau); }
.bt-ngoai-ghi { margin-top: 1rem; font-size: .75rem; }
.bt-ngoai-ds { display: flex; flex-direction: column; gap: .625rem; margin: 0; padding: 0; list-style: none; }
.bt-ngoai-ds a { color: var(--chu-chinh); font-size: .875rem; font-weight: 600; line-height: 1.4; text-decoration: none; }
.bt-ngoai-ds a:hover { color: var(--mau-chinh); }
.bt-ngoai-ds small { display: block; color: var(--chu-phu); font-size: .75rem; }
.bt-nguon-nho { color: var(--chu-phu); font-size: .6875rem; font-weight: 500; text-transform: none; }
@media (prefers-reduced-motion: reduce) { .bt-ngoai-the, .bt-ngoai-anh img { transition: none; } .bt-ngoai-the:hover { transform: none; } .bt-ngoai-the:hover .bt-ngoai-anh img { transform: none; } }
.nh-ten { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.nh-ten small { display: flex !important; align-items: center; gap: .375rem; flex-wrap: wrap; }
.nh-tn { margin-left: 0 !important; white-space: nowrap; }
.nh-chuyen { flex: 0 0 auto; width: 6.5rem; }
/* Hàng số liệu Kiểm tra: 6 ô vừa một hàng ở 1366px, máy tính bảng 3 ô, điện thoại 2 ô. */
.kt-tong { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.kt-tong strong { font-size: 1.5rem; }
@media (max-width: 759px) { .kt-tong { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .kt-so-sanh li { grid-template-columns: minmax(0, 1fr) auto; }
    .kt-ss-thanh { min-width: 0; width: 100%; }
    .kt-ss-ten { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* 12. Ô mật khẩu có nút con mắt hiện/ẩn chữ */
.o-mat-khau { position: relative; display: block; width: 100%; }
.o-mat-khau > input { width: 100%; padding-right: 3rem !important; }
.nut-mat-khau { position: absolute; top: 50%; right: .375rem; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--chu-phu); cursor: pointer; transform: translateY(-50%); }
.nut-mat-khau:hover { background: var(--mau-chinh-nhat); color: var(--mau-chinh); }
.nut-mat-khau:focus-visible { outline: 2px solid var(--mau-chinh-sang); outline-offset: 1px; }
.nut-mat-khau[aria-pressed="true"] { color: var(--mau-chinh); }
.nut-mat-khau .rzi { font-size: 1.25rem; }
/* Ẩn nút hiện mật khẩu riêng của Edge để không có hai con mắt. */
.o-mat-khau input::-ms-reveal, .o-mat-khau input::-ms-clear { display: none; }

/* 13. Nhóm học tập – bố cục mới (16/11/2026): thẻ rộng, hàng thành viên gọn, kéo thả hoặc chọn rồi chuyển. */
.nh-mau-0 { --nh: #1f7a4f; } .nh-mau-1 { --nh: #1f6f99; } .nh-mau-2 { --nh: #8f630b; }
.nh-mau-3 { --nh: #9b3f6e; } .nh-mau-4 { --nh: #4f6bb0; } .nh-mau-5 { --nh: #0f766e; }
:root[data-giao-dien="toi"] .nh-mau-0 { --nh: #7fd6a8; } :root[data-giao-dien="toi"] .nh-mau-1 { --nh: #8ccaf0; } :root[data-giao-dien="toi"] .nh-mau-2 { --nh: #f2c66d; }
:root[data-giao-dien="toi"] .nh-mau-3 { --nh: #f2a7c8; } :root[data-giao-dien="toi"] .nh-mau-4 { --nh: #a9bdf2; } :root[data-giao-dien="toi"] .nh-mau-5 { --nh: #5eead4; }

.nh-cong-cu { display: flex; flex-wrap: wrap; align-items: center; gap: .625rem .75rem; padding: .75rem; border: 1px solid var(--vien-the); border-radius: 14px; background: var(--nen-the); }
.nh-o-lop { display: flex; align-items: center; gap: .5rem; margin: 0; font-weight: 600; font-size: .875rem; }
.nh-o-lop .form-select { width: auto; min-width: 9rem; }
.nh-o-tim { position: relative; flex: 1 1 16rem; max-width: 24rem; margin: 0; }
.nh-o-tim .rzi { position: absolute; left: .625rem; top: 50%; transform: translateY(-50%); color: var(--chu-phu); font-size: 1.125rem; }
.nh-o-tim input { width: 100%; height: 2.375rem; padding: 0 .75rem 0 2.25rem; border: 1px solid var(--vien-o-nhap); border-radius: 10px; background: var(--nen-the); color: var(--chu-chinh); font-size: .875rem; }
.nh-so { padding: .25rem .625rem; border-radius: 999px; background: var(--mau-chinh-nhat); color: var(--chu-phu); font-size: .8125rem; white-space: nowrap; }
.nh-so b { color: var(--chu-chinh); font-variant-numeric: tabular-nums; }
.nh-so.canh-bao { background: #fef3c7; color: #92400e; }
.nh-che-do { display: inline-flex; margin-left: auto; padding: 2px; border: 1px solid var(--vien-the); border-radius: 10px; background: var(--mau-chinh-nhat); }
.nh-che-do button { display: inline-flex; align-items: center; gap: .25rem; padding: .3125rem .625rem; border: 0; border-radius: 8px; background: transparent; color: var(--chu-phu); font-size: .8125rem; font-weight: 600; }
.nh-che-do button.dang-chon { background: var(--nen-the); color: var(--chu-chinh); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.nh-che-do .rzi { font-size: 1rem; }
.nh-goi-y { display: flex; align-items: center; gap: .375rem; margin: 0; color: var(--chu-phu); font-size: .8125rem; }
.nh-goi-y .rzi { font-size: 1rem; }

/* Thẻ nhóm: rộng tối thiểu ~20rem để tên người không bị bẻ dòng. */
.nh-luoi { grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 1rem; align-items: start; }
.nh-the { gap: .75rem; padding: 0 0 .75rem; overflow: hidden; border-top: 1px solid var(--vien-the); border-left: 4px solid var(--nh, var(--m-hoc-vien)); transition: box-shadow var(--tg-nhanh), border-color var(--tg-nhanh), background var(--tg-nhanh); }
.nh-the.dang-tha { box-shadow: 0 0 0 2px color-mix(in srgb, var(--nh) 45%, transparent), 0 12px 28px -18px rgba(0,0,0,.4); background: color-mix(in srgb, var(--nh) 6%, var(--nen-the)); }
.nh-dau { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; padding: .875rem 1rem .125rem; }
.nh-dau h2 { margin: 0; color: var(--nh, var(--chu-chinh)); font-family: var(--font-tieu-de); font-size: 1.0625rem; }
.nh-phu { display: block; margin-top: .125rem; color: var(--chu-phu); font-size: .75rem; }
.nh-dau-phai { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.nh-dau-phai .nut-nho { width: 2rem; height: 2rem; min-width: 2rem; min-height: 2rem; opacity: .7; }
.nh-the:hover .nh-dau-phai .nut-nho, .nh-dau-phai .nut-nho:focus-visible { opacity: 1; }
.nh-dau-phai .tt-nhan { display: inline-flex; align-items: center; gap: .125rem; }
.nh-dau-phai .tt-nhan .rzi { font-size: .875rem; }
.nh-the .nh-nhiem-vu { display: flex; gap: .375rem; align-items: flex-start; margin: 0 1rem; }
.nh-the .nh-nhiem-vu .rzi { flex: 0 0 auto; color: var(--nh); font-size: 1rem; }
.nh-ds { display: flex; flex-direction: column; margin: 0; padding: 0 .5rem; list-style: none; }
.nh-ds li { border-radius: 10px; }
.nh-ds li.mo { opacity: .3; }
.nh-ds li.dang-keo { opacity: .4; }
.nh-hang { display: flex; align-items: center; gap: .625rem; width: 100%; min-height: 2.75rem; padding: .3125rem .5rem; border: 0; border-radius: 10px; background: transparent; color: var(--chu-chinh); text-align: left; cursor: grab; }
.nh-hang:hover { background: color-mix(in srgb, var(--nh, var(--mau-chinh)) 8%, var(--nen-the)); }
.nh-hang:disabled { cursor: default; }
.nh-ds li.dang-chon .nh-hang { background: color-mix(in srgb, var(--nh, var(--mau-chinh)) 14%, var(--nen-the)); box-shadow: inset 0 0 0 1.5px var(--nh, var(--mau-chinh)); }
.nh-hang .user-avatar { flex: 0 0 auto; width: 2rem; height: 2rem; background: color-mix(in srgb, var(--nh, var(--mau-chinh)) 16%, var(--nen-the)); color: var(--nh, var(--mau-chinh)); font-size: .8125rem; font-weight: 700; }
.nh-hang .nh-ten { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.nh-hang .nh-ten b { overflow: hidden; font-size: .875rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.nh-hang .nh-ten small { color: var(--chu-phu); font-size: .6875rem; font-variant-numeric: tabular-nums; }
.nh-vuong { display: grid; place-items: center; color: var(--dong-thau); }
.nh-vuong .rzi { font-size: 1.125rem; }
.nh-tay-keo { color: var(--chu-phu); font-size: 1.125rem; opacity: 0; transition: opacity var(--tg-nhanh); }
.nh-hang:hover .nh-tay-keo { opacity: .7; }
@media (hover: none) { .nh-tay-keo { display: none; } }
.nh-trong { padding: 1rem; border: 1.5px dashed var(--vien-o-nhap); color: var(--chu-phu); font-size: .8125rem; text-align: center; }
.nh-vao-day { display: flex; align-items: center; justify-content: center; gap: .375rem; margin: 0 .75rem; padding: .5rem; border: 1.5px dashed var(--nh); border-radius: 10px; background: color-mix(in srgb, var(--nh) 6%, var(--nen-the)); color: var(--nh); font-size: .8125rem; font-weight: 700; }
.nh-vao-day:hover { background: color-mix(in srgb, var(--nh) 14%, var(--nen-the)); }
.nh-chua-co { --nh: var(--chu-phu); border-left-style: dashed; background: color-mix(in srgb, var(--mau-chinh-nhat) 60%, var(--nen-the)); }
.nh-tn { display: inline-flex; align-items: center; gap: .125rem; }
.nh-tn .rzi { font-size: .875rem; }

/* Thanh thao tác khi đã chọn một học viên: dính trên đầu vùng nội dung. */
.nh-thanh-chon { position: sticky; top: calc(var(--chieu-cao-header) + .5rem); z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .625rem .875rem; border-radius: 14px; background: linear-gradient(150deg, #0e2a1e, #071a11); color: #dcebe2; box-shadow: 0 14px 30px -18px rgba(0,0,0,.6); }
.nh-thanh-ten { display: flex; align-items: center; gap: .5rem; }
.nh-thanh-ten .user-avatar { width: 2rem; height: 2rem; background: #5eead4; color: #052e2b; font-weight: 700; }
.nh-thanh-ten b { display: block; color: #fff; font-size: .875rem; }
.nh-thanh-ten small { color: #9fbfae; font-size: .75rem; }
.nh-thanh-nhan { color: #9fbfae; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.nh-thanh-dich { display: flex; flex-wrap: wrap; gap: .375rem; flex: 1; }
.nh-chip { display: inline-flex; align-items: center; gap: .375rem; padding: .3125rem .75rem; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.06); color: #fff; font-size: .8125rem; font-weight: 600; }
.nh-chip::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: #5eead4; }
.nh-chip.nh-mau-0::before { background: #7fd6a8; } .nh-chip.nh-mau-1::before { background: #8ccaf0; } .nh-chip.nh-mau-2::before { background: #f2c66d; }
.nh-chip.nh-mau-3::before { background: #f2a7c8; } .nh-chip.nh-mau-4::before { background: #a9bdf2; } .nh-chip.nh-mau-5::before { background: #5eead4; }
.nh-chip small { color: #9fbfae; font-weight: 500; }
.nh-chip:hover { background: rgba(255,255,255,.14); }
.nh-thanh-phai { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin-left: auto; }
.nh-thanh-phai .kt-nut.phu { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; }
.nh-thanh-phai .nut-nho { color: #dcebe2; }
.nh-sua { display: flex; flex-direction: column; gap: .625rem; padding: 1rem; }

/* Bảng */
.nh-bang .bang-diem td { vertical-align: middle; }
.nh-cham { display: inline-block; width: .625rem; height: .625rem; margin-right: .5rem; border-radius: 50%; background: var(--nh); vertical-align: middle; }
.nh-bang .nh-chuyen { width: 10rem; max-width: none; padding: .25rem .375rem; font-size: .8125rem; }

@media (max-width: 759px) {
    .nh-che-do { margin-left: 0; }
    .nh-o-tim { max-width: none; }
    .nh-thanh-chon { top: .5rem; }
    .nh-thanh-phai { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .nh-the, .nh-tay-keo { transition: none; } }
.nh-bang .nh-ma { color: var(--chu-phu); font-size: .8125rem; font-variant-numeric: tabular-nums; }
