/* ==========================================================================
   Bổ sung mốc 1 (nạp sau app.css): tìm kiếm nhanh, lịch, điểm danh, điểm, trang cá nhân, nhật ký, hiệu ứng.
   Màu trạng thái đi theo token; chế độ tối đổi token ở cuối tệp. Hiệu ứng chỉ dùng transform/opacity
   và tắt khi người dùng chọn giảm chuyển động.
   ========================================================================== */
:root {
    --ok-chu: #166534; --ok-nen: #dcfce7;
    --canh-bao-chu: #92400e; --canh-bao-nen: #fef3c7;
    --loi-chu: #b91c1c; --loi-nen: #fee2e2;
    --tin-chu: #1e40af; --tin-nen: #dbeafe;
    --trung-tinh-nen: #eef0ec;
    --bong-noi: 0 10px 30px rgba(14, 42, 30, .14);
    --thoi-gian-nhanh: 180ms;
}

/* Chuyển trang: mờ dần và dịch nhẹ. */
@keyframes hien-len { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes hien-mo { from { opacity: 0; } to { opacity: 1; } }
@keyframes nhap-nhay { 0% { opacity: .55; } 50% { opacity: 1; } 100% { opacity: .55; } }
@keyframes rung-chuong { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-10deg); } 60% { transform: rotate(6deg); } 80% { transform: rotate(-3deg); } }
.content > * { animation: hien-len 200ms ease-out both; }
.content > *:nth-child(2) { animation-delay: 30ms; }
.content > *:nth-child(3) { animation-delay: 60ms; }
.content > *:nth-child(4) { animation-delay: 90ms; }
.the-so-lieu { transition: transform var(--thoi-gian-nhanh) ease, box-shadow var(--thoi-gian-nhanh) ease; }
.the-so-lieu:hover { transform: translateY(-3px); box-shadow: var(--bong-noi); }
.the-so-lieu-mui-ten { transition: transform var(--thoi-gian-nhanh) ease; }
.the-so-lieu:hover .the-so-lieu-mui-ten { transform: translate(3px, -3px); }
.nut-thong-bao.rz-link:hover .rzi { animation: rung-chuong 600ms ease; }
.directory-grid .rz-grid-table tbody tr > td { transition: background-color 120ms ease; }
:focus-visible { outline: 2px solid var(--mau-nhan); outline-offset: 2px; }

/* Menu con: bản cũ giới hạn 12rem nên nhóm nhiều mục (Quản lý đào tạo: 6 mục) bị cụt. Nới giới hạn và cho vùng menu
   tự cuộn khi màn hình thấp; chỉ áp dụng khi sidebar mở rộng để menu bay của chế độ thu gọn không bị cắt. */
@media (min-width: 641px) {
    .app-shell:not(.sidebar-thu-gon) .menu-con { max-height: 32rem; }
    .app-shell:not(.sidebar-thu-gon) .sidebar-menu { height: 100vh; }
    .app-shell:not(.sidebar-thu-gon) .nav-scrollable { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
}

/* Nhóm Hệ thống tách khỏi vùng menu cuộn bằng đường kẻ, không dính vào mục cuối. */
.menu-tro-giup { padding-top: .75rem; border-top: 1px solid var(--vien-tren-nen-toi); }
.nav-scrollable { padding-bottom: 1rem; }

/* Nhãn dạng thẻ dùng chung (bản scoped cũ chỉ áp trong bảng thông báo). */
.tags-tin { display: flex; flex-wrap: wrap; gap: .375rem; }
.tag-tin { display: inline-flex; align-items: center; padding: .125rem .5rem; border: 1px solid var(--vien-the); border-radius: 999px; background: var(--nen-the); color: var(--mau-chinh); font-size: var(--cc-12); white-space: nowrap; }
a.tag-tin:hover { border-color: var(--mau-chinh-sang); background: var(--mau-chinh-nhat); }

/* Khung xương khi đang tải. */
.khung-xuong { border-radius: 8px; background: var(--trung-tinh-nen); animation: nhap-nhay 1.2s ease-in-out infinite; }
.dong-xuong { height: 2.5rem; margin-bottom: .5rem; }
.o-xuong { min-height: 6rem; }
.khung-xuong-bang { padding: .5rem 0; }

/* Thanh tab con có biểu tượng. */
.dieu-huong-phan-he a { display: inline-flex; align-items: center; gap: .375rem; transition: background-color var(--thoi-gian-nhanh), color var(--thoi-gian-nhanh); }
.dieu-huong-phan-he a .rzi { font-size: 1.125rem; }

/* ---- Tìm kiếm nhanh (Ctrl+K) ---- */
.nut-tim-nhanh { display: inline-flex; align-items: center; gap: .5rem; min-width: 13rem; height: 2.25rem; padding: 0 .5rem 0 .75rem; border: 1px solid var(--vien-the); border-radius: 8px; background: var(--nen-the); color: var(--chu-phu); font-size: var(--cc-13); cursor: pointer; }
.nut-tim-nhanh:hover { border-color: var(--mau-chinh-sang); color: var(--chu-chinh); }
.chu-tim-nhanh { flex: 1; text-align: left; }
.nut-tim-nhanh kbd, .hop-tim-nhanh kbd { padding: .0625rem .375rem; border: 1px solid var(--vien-the); border-radius: 4px; background: var(--nen-dai); color: var(--chu-phu); font: 600 .6875rem/1.4 var(--font); box-shadow: none; }
.phu-tim-nhanh { position: fixed; inset: 0; z-index: 1090; background: rgba(8, 20, 14, .45); animation: hien-mo 150ms ease-out; }
.hop-tim-nhanh { position: fixed; z-index: 1091; top: 10vh; left: 50%; width: min(680px, calc(100vw - 2rem)); transform: translateX(-50%); display: flex; flex-direction: column; max-height: 76vh; border: 1px solid var(--vien-the); border-radius: 14px; background: var(--nen-the); box-shadow: 0 24px 60px rgba(0, 0, 0, .28); overflow: hidden; }
.o-tim-nhanh { display: flex; align-items: center; gap: .625rem; padding: .875rem 1rem; border-bottom: 1px solid var(--vien-nhat); }
.o-tim-nhanh .rzi { color: var(--mau-chinh); }
.o-tim-nhanh input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--chu-chinh); font-size: var(--cc-15); }
.ket-qua-tim-nhanh { flex: 1; overflow-y: auto; padding: .5rem; }
.goi-y-tim-nhanh { margin: 1rem; color: var(--chu-phu); }
.nhom-tim-nhanh { padding: .5rem .625rem .25rem; color: var(--chu-phu); font-size: var(--cc-12); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.muc-tim-nhanh { display: flex; width: 100%; align-items: center; gap: .75rem; padding: .5rem .625rem; border: 0; border-radius: 8px; background: transparent; color: var(--chu-chinh); text-align: left; cursor: pointer; }
.muc-tim-nhanh > .rzi:first-child { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; background: var(--mau-chinh-nhat); color: var(--mau-chinh); font-size: 1.125rem; }
.muc-tim-nhanh.dang-chon { background: var(--mau-chinh-nhat); }
.chu-muc-tim { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.chu-muc-tim strong { font-weight: 600; }
.chu-muc-tim small { overflow: hidden; color: var(--chu-phu); text-overflow: ellipsis; white-space: nowrap; }
.mui-ten-tim { color: var(--chu-phu); opacity: 0; transform: translateX(-4px); transition: opacity var(--thoi-gian-nhanh), transform var(--thoi-gian-nhanh); }
.muc-tim-nhanh.dang-chon .mui-ten-tim, .loi-vao:hover .mui-ten-tim { opacity: 1; transform: none; }
.chan-tim-nhanh { display: flex; gap: 1rem; padding: .5rem 1rem; border-top: 1px solid var(--vien-nhat); color: var(--chu-phu); font-size: var(--cc-12); }
@media (max-width: 760px) { .chu-tim-nhanh, .nut-tim-nhanh kbd { display: none; } .nut-tim-nhanh { min-width: 0; } }

/* ---- Hồ sơ: dữ liệu cá nhân dạng che ---- */
.nut-hien-du { display: inline-flex; align-items: center; gap: .25rem; margin-left: auto; padding: .125rem .5rem; border: 1px solid var(--vien-the); border-radius: 999px; background: var(--nen-the); color: var(--mau-chinh); font-size: var(--cc-12); font-weight: 600; cursor: pointer; }
.nut-hien-du .rzi { font-size: 1rem; }
.nhom-ho-so h3 { display: flex; align-items: center; gap: .5rem; }
.gia-tri-che { letter-spacing: .06em; color: var(--chu-phu); }

/* ---- Nhãn trạng thái bổ sung ---- */
.nhan-trang-thai.canh-bao { background: var(--canh-bao-nen); color: var(--canh-bao-chu); }
.nhan-trang-thai + .nhan-trang-thai { margin-left: .25rem; }
.nut-so-luong { display: inline-flex; align-items: center; gap: .25rem; padding: .125rem .625rem; border: 1px solid var(--vien-the); border-radius: 999px; background: var(--nen-the); color: var(--mau-chinh); font-weight: 600; cursor: pointer; }
.nut-so-luong:hover { border-color: var(--mau-chinh-sang); }
.nut-so-luong.canh-bao { background: var(--canh-bao-nen); color: var(--canh-bao-chu); }
.nut-so-luong .rzi { font-size: 1rem; }

/* ---- Danh sách chọn (giáo viên đủ điều kiện) ---- */
.danh-sach-chon { display: grid; gap: .375rem; max-height: 50vh; margin: .75rem 0; overflow-y: auto; }
.muc-chon { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; border: 1px solid var(--vien-nhat); border-radius: 8px; cursor: pointer; transition: border-color var(--thoi-gian-nhanh), background-color var(--thoi-gian-nhanh); }
.muc-chon.da-chon { border-color: var(--mau-chinh-sang); background: var(--mau-chinh-nhat); }
.muc-chon > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.muc-chon small { color: var(--chu-phu); }
.loi-bieu-mau { color: var(--mau-nguy-hiem); }

/* ---- Lịch đào tạo ---- */
.thanh-lich { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.dieu-khien-tuan { display: flex; align-items: center; gap: .375rem; }
.ten-tuan { min-width: 13rem; text-align: center; font-size: var(--cc-15); }
.chon-che-do { display: inline-flex; margin-left: auto; border: 1px solid var(--vien-the); border-radius: 8px; overflow: hidden; }
.chon-che-do button { display: inline-flex; align-items: center; gap: .375rem; padding: .375rem .75rem; border: 0; background: var(--nen-the); color: var(--chu-phu); cursor: pointer; }
.chon-che-do button.dang-chon { background: var(--mau-chinh); color: var(--chu-tren-mau); }
.goi-y-loc { color: var(--canh-bao-chu); }
.luoi-lich { display: grid; grid-template-columns: 4.5rem repeat(6, minmax(10rem, 1fr)); gap: 1px; border: 1px solid var(--vien-nhat); border-radius: 10px; background: var(--vien-nhat); overflow-x: auto; }
.luoi-lich > * { background: var(--nen-the); }
.o-goc { background: var(--nen-dai) !important; }
.dau-ngay { display: flex; flex-direction: column; align-items: center; padding: .5rem; background: var(--nen-dai) !important; }
.dau-ngay span { color: var(--chu-phu); font-size: var(--cc-12); }
.dau-ngay.hom-nay { background: var(--mau-chinh) !important; color: var(--chu-tren-mau); }
.dau-ngay.hom-nay span { color: var(--mau-nhan-sang); }
.ten-buoi { display: grid; place-items: center; background: var(--nen-dai) !important; color: var(--chu-phu); font-weight: 600; writing-mode: vertical-rl; transform: rotate(180deg); }
.o-lich { display: flex; flex-direction: column; gap: .375rem; min-height: 6rem; padding: .375rem; }
.o-lich.hom-nay { background: color-mix(in srgb, var(--mau-chinh-nhat) 55%, var(--nen-the)); }
.the-buoi { display: flex; flex-direction: column; gap: .125rem; padding: .5rem .625rem; border: 1px solid var(--vien-nhat); border-left: 4px solid var(--mau-chinh-sang); border-radius: 8px; background: var(--nen-the); font-size: var(--cc-13); transition: transform var(--thoi-gian-nhanh), box-shadow var(--thoi-gian-nhanh); animation: hien-len 200ms ease-out both; }
.the-buoi:hover { transform: translateY(-2px); box-shadow: var(--bong-noi); }
.the-buoi.da-diem-danh { border-left-color: var(--ok-chu); }
.the-buoi.chua-diem-danh { border-left-color: var(--canh-bao-chu); }
.the-buoi.hom-nay { border-left-color: var(--mau-nhan); }
.the-buoi.sap-toi { border-left-color: var(--tin-chu); }
.the-buoi header, .the-buoi footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .125rem .5rem; }
.ma-lop-buoi { color: var(--mau-chinh); font-weight: 700; text-decoration: none; }
.tiet-buoi { color: var(--chu-phu); font-size: var(--cc-12); }
.cd-buoi { font-weight: 600; line-height: 1.3; }
.phu-buoi { display: flex; align-items: center; gap: .25rem; color: var(--chu-phu); }
.phu-buoi .rzi { font-size: .9375rem; }
.nhan-buoi { padding: .0625rem .5rem; border-radius: 999px; background: var(--trung-tinh-nen); color: var(--chu-phu); font-size: var(--cc-12); font-weight: 600; white-space: nowrap; }
.da-diem-danh .nhan-buoi, .nhan-buoi.co-mat { background: var(--ok-nen); color: var(--ok-chu); }
.chua-diem-danh .nhan-buoi, .nhan-buoi.di-muon { background: var(--canh-bao-nen); color: var(--canh-bao-chu); }
.the-buoi.hom-nay .nhan-buoi, .nhan-buoi.vang-cp { background: var(--tin-nen); color: var(--tin-chu); }
.nhan-buoi.vang-kp { background: var(--loi-nen); color: var(--loi-chu); }
.thao-tac-buoi { display: inline-flex; gap: .125rem; }
.nut-nho { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border: 0; border-radius: 6px; background: transparent; color: var(--mau-chinh); cursor: pointer; text-decoration: none; }
.nut-nho:hover { background: var(--mau-chinh-nhat); }
.nut-nho.nguy-hiem { color: var(--mau-nguy-hiem); }
.nut-nho .rzi { font-size: 1.0625rem; }
.dau-nhom-ngay { display: flex; align-items: baseline; gap: .5rem; margin: 1rem 0 .5rem; font-size: var(--cc-15); }
.dau-nhom-ngay small { color: var(--chu-phu); font-weight: 400; }
.dau-nhom-ngay.hom-nay::before { content: "Hôm nay"; padding: .0625rem .5rem; border-radius: 999px; background: var(--mau-nhan); color: #1b1408; font-size: var(--cc-12); }
.danh-sach-buoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; }

/* Biểu mẫu buổi học: kết quả kiểm tra quy tắc. */
.ket-qua-kiem-tra { min-height: 2.5rem; margin: .75rem 0; }
.dang-kiem-tra { display: inline-flex; align-items: center; gap: .5rem; color: var(--chu-phu); }
.hop-ok, .hop-loi { padding: .625rem .875rem; border-radius: 8px; animation: hien-len 160ms ease-out; }
.hop-ok { display: flex; align-items: center; gap: .5rem; background: var(--ok-nen); color: var(--ok-chu); }
.hop-loi { background: var(--loi-nen); color: var(--loi-chu); }
.hop-loi strong { display: flex; align-items: center; gap: .375rem; }
.hop-loi ul { margin: .375rem 0 0; padding-left: 1.25rem; }

/* ---- Trang lớp: tab, điểm danh, điểm ---- */
.tab-lop.rz-tabview { margin-top: .25rem; border: 1px solid var(--vien-the); border-radius: 10px; background: var(--nen-the); }
.tab-lop .rz-tabview-panels { padding: 1rem; }
.chon-buoi { min-width: 22rem; max-width: 100%; }
.tom-tat-diem-danh { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .25rem 0 .75rem; }
.o-tom-tat { display: inline-flex; align-items: baseline; gap: .375rem; padding: .375rem .75rem; border-radius: 8px; background: var(--trung-tinh-nen); color: var(--chu-phu); font-size: var(--cc-13); }
.o-tom-tat strong { color: var(--chu-chinh); font-size: var(--cc-18); }
.o-tom-tat.co-mat { background: var(--ok-nen); color: var(--ok-chu); }
.o-tom-tat.di-muon { background: var(--canh-bao-nen); color: var(--canh-bao-chu); }
.o-tom-tat.vang-cp { background: var(--tin-nen); color: var(--tin-chu); }
.o-tom-tat.vang-kp { background: var(--loi-nen); color: var(--loi-chu); }
.o-tom-tat.co-mat strong, .o-tom-tat.di-muon strong, .o-tom-tat.vang-cp strong, .o-tom-tat.vang-kp strong { color: inherit; }
.bang-diem-danh { display: grid; gap: 1px; border: 1px solid var(--vien-nhat); border-radius: 10px; background: var(--vien-nhat); overflow: hidden; }
.dong-diem-danh { display: grid; grid-template-columns: 2.5rem minmax(12rem, 1fr) auto auto; align-items: center; gap: .75rem; padding: .375rem .75rem; background: var(--nen-the); transition: background-color 120ms; }
.dong-diem-danh:hover { background: var(--nen-dai); }
.dong-diem-danh.chua { background: color-mix(in srgb, var(--canh-bao-nen) 35%, var(--nen-the)); }
.dong-diem-danh.da-doi { box-shadow: inset 3px 0 0 var(--mau-nhan); }
.stt-dd { color: var(--chu-phu); text-align: center; }
.ten-dd { display: flex; flex-direction: column; }
.ten-dd small { color: var(--chu-phu); }
.nhan-tu-dd { display: inline-flex; align-items: center; gap: .25rem; color: var(--tin-chu); font-size: var(--cc-12); }
.nhan-tu-dd .rzi { font-size: 1rem; }
.nhom-trang-thai { display: inline-flex; grid-column: 4; border: 1px solid var(--vien-the); border-radius: 8px; overflow: hidden; }
.nut-tt { min-width: 4.25rem; padding: .3125rem .5rem; border: 0; border-right: 1px solid var(--vien-nhat); background: var(--nen-the); color: var(--chu-phu); font-size: var(--cc-12); font-weight: 600; cursor: pointer; transition: background-color 120ms, color 120ms; }
.nut-tt:last-child { border-right: 0; }
.nut-tt:disabled { cursor: default; }
.nut-tt.dang-chon.co-mat { background: var(--ok-chu); color: #fff; }
.nut-tt.dang-chon.di-muon { background: var(--canh-bao-chu); color: #fff; }
.nut-tt.dang-chon.vang-cp { background: var(--tin-chu); color: #fff; }
.nut-tt.dang-chon.vang-kp { background: var(--loi-chu); color: #fff; }
@media (max-width: 760px) { .dong-diem-danh { grid-template-columns: 2rem 1fr; } .nhom-trang-thai { grid-column: 1 / -1; } .nut-tt { min-width: 0; flex: 1; } .chon-buoi { min-width: 0; width: 100%; } }
.bang-cuon { overflow-x: auto; }
.bang-diem { width: 100%; border-collapse: collapse; font-size: var(--cc-13); }
.bang-diem th { position: sticky; top: 0; padding: .5rem .625rem; background: var(--mau-chinh-nhat); color: var(--chu-chinh); font-size: var(--cc-12); text-align: left; text-transform: uppercase; letter-spacing: .03em; }
.bang-diem td { padding: .4375rem .625rem; border-bottom: 1px solid var(--vien-nhat); vertical-align: middle; }
.bang-diem td small { display: block; }
.bang-diem td.so { text-align: center; font-variant-numeric: tabular-nums; }
.bang-diem tr.da-doi td { background: color-mix(in srgb, var(--mau-nhan-sang) 25%, var(--nen-the)); }
.o-diem { width: 6rem; }
.ghi-chu-diem { color: var(--canh-bao-chu); font-size: var(--cc-12); }
.nhan-xep-loai { display: inline-block; padding: .0625rem .5rem; border-radius: 999px; background: var(--trung-tinh-nen); color: var(--chu-phu); font-size: var(--cc-12); font-weight: 700; white-space: nowrap; }
.nhan-xep-loai.xuat-sac { background: var(--ok-chu); color: #fff; }
.nhan-xep-loai.gioi { background: var(--ok-nen); color: var(--ok-chu); }
.nhan-xep-loai.kha { background: var(--tin-nen); color: var(--tin-chu); }
.nhan-xep-loai.dat { background: var(--canh-bao-nen); color: var(--canh-bao-chu); }
.nhan-xep-loai.khong-dat { background: var(--loi-nen); color: var(--loi-chu); }

/* ---- Trang cá nhân (giảng viên, học viên) ---- */
.the-ca-nhan { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: 1rem 1.25rem; border-radius: 12px; background: linear-gradient(120deg, var(--mau-chinh-dam), #1b4b34); color: #fff; }
.the-ca-nhan > div { display: flex; flex-direction: column; gap: .125rem; }
.the-ca-nhan strong { font-size: var(--cc-18); }
.the-ca-nhan span { color: var(--chu-tren-nen-toi); }
.the-ca-nhan a { color: var(--mau-nhan-sang); }
.the-ca-nhan .record-code { align-self: flex-start; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.14); color: #fff; }
.luoi-ca-nhan { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.the-muc.rz-card { padding: 1rem 1.25rem; border: 1px solid var(--vien-the); background: var(--nen-the); box-shadow: none; }
.the-muc.rong { grid-column: 1 / -1; }
.the-muc h2 { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; font-size: var(--cc-15); }
.the-muc h2 .rzi { color: var(--mau-chinh); }
.danh-sach-gon { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.danh-sach-gon li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .25rem; border-bottom: 1px solid var(--vien-nhat); }
.danh-sach-gon li > a, .danh-sach-gon li > span:first-child { display: flex; flex-direction: column; color: var(--chu-chinh); text-decoration: none; }
.danh-sach-gon li span span, .danh-sach-gon li a span { color: var(--chu-phu); font-size: var(--cc-12); }
.lien-ket-nhanh { display: inline-flex; gap: .5rem; }
.lien-ket-nhanh a { padding: .125rem .5rem; border: 1px solid var(--vien-the); border-radius: 999px; color: var(--mau-chinh); font-size: var(--cc-12); text-decoration: none; }
.the-tu-diem-danh.rz-card { margin-bottom: 1rem; }
.the-tu-diem-danh.dang-mo { border-color: var(--mau-nhan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mau-nhan) 25%, transparent); }

/* ---- Nhật ký ---- */
.chi-tiet-nhat-ky { padding: .5rem 1rem 1rem; }
.gia-tri-cu { color: var(--loi-chu); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--loi-chu) 40%, transparent); }
.gia-tri-moi { color: var(--ok-chu); }
.nhan-hanh-dong { display: inline-block; padding: .0625rem .5rem; border-radius: 999px; font-size: var(--cc-12); font-weight: 700; }
.nhan-hanh-dong.them { background: var(--ok-nen); color: var(--ok-chu); }
.nhan-hanh-dong.sua { background: var(--tin-nen); color: var(--tin-chu); }
.nhan-hanh-dong.xoa { background: var(--loi-nen); color: var(--loi-chu); }
.nhan-hanh-dong.xem { background: var(--canh-bao-nen); color: var(--canh-bao-chu); }

/* ---- Biểu mẫu lớp: mã tự sinh ---- */
.o-ma-tu-sinh { display: flex; flex-direction: column; justify-content: center; gap: .25rem; padding: .5rem .75rem; border: 1px dashed var(--vien-o-nhap); border-radius: 8px; background: var(--nen-dai); }
.o-ma-tu-sinh span { color: var(--chu-phu); font-size: var(--cc-12); }
.o-ma-tu-sinh .record-code { align-self: flex-start; font-size: var(--cc-15); }
.loi-nho { color: var(--mau-nguy-hiem); }

/* ---- Trang chủ: dải học vụ ---- */
.dai-hoc-vu { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .75rem; margin: 1.25rem 0; }
.o-hoc-vu { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border: 1px solid var(--vien-the); border-radius: 12px; background: var(--nen-the); color: var(--chu-chinh); text-decoration: none; transition: transform var(--thoi-gian-nhanh), box-shadow var(--thoi-gian-nhanh), border-color var(--thoi-gian-nhanh); }
.o-hoc-vu:hover { transform: translateY(-2px); box-shadow: var(--bong-noi); border-color: var(--mau-chinh-sang); }
.o-hoc-vu > .rzi:first-child { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 10px; background: var(--mau-chinh-nhat); color: var(--mau-chinh); }
.o-hoc-vu span { display: flex; flex: 1; flex-direction: column; color: var(--chu-phu); font-size: var(--cc-13); }
.o-hoc-vu strong { color: var(--chu-chinh); font-size: var(--cc-22); line-height: 1.2; }
.o-hoc-vu.loi-vao strong { font-size: var(--cc-15); }
.o-hoc-vu.canh-bao > .rzi:first-child { background: var(--canh-bao-nen); color: var(--canh-bao-chu); }
.o-hoc-vu.tot > .rzi:first-child { background: var(--ok-nen); color: var(--ok-chu); }

/* ---- Chế độ tối cho phần bổ sung ---- */
:root[data-giao-dien="toi"] {
    --ok-chu: #86efac; --ok-nen: #173b26;
    --canh-bao-chu: #fcd34d; --canh-bao-nen: #3d3115;
    --loi-chu: #fca5a5; --loi-nen: #45201f;
    --tin-chu: #93c5fd; --tin-nen: #1c2f4d;
    --trung-tinh-nen: #26372d;
    --bong-noi: 0 10px 30px rgba(0, 0, 0, .45);
}
[data-giao-dien="toi"] .nut-tt.dang-chon, [data-giao-dien="toi"] .nhan-xep-loai.xuat-sac { color: #0d1a12; }
[data-giao-dien="toi"] .chon-che-do button.dang-chon, [data-giao-dien="toi"] .dau-ngay.hom-nay { color: #102719; }
[data-giao-dien="toi"] .dau-ngay.hom-nay span { color: #102719; }

/* Tôn trọng lựa chọn giảm chuyển động: tắt mọi hiệu ứng bổ sung, dữ liệu vẫn hiện đúng. */
@media (prefers-reduced-motion: reduce) {
    .content > *, .the-buoi, .phu-tim-nhanh, .hop-ok, .hop-loi, .khung-xuong, .nut-thong-bao.rz-link:hover .rzi { animation: none !important; }
    .the-so-lieu, .the-buoi, .o-hoc-vu, .mui-ten-tim, .the-so-lieu-mui-ten { transition: none !important; }
    .the-so-lieu:hover, .the-buoi:hover, .o-hoc-vu:hover { transform: none; }
}

/* Tiếng Lào: dùng font có chữ Lào (Leelawadee UI có sẵn trên Windows), giữ font Việt cho phần còn lại. */
:root[lang="lo"] { --font: "Segoe UI", "Leelawadee UI", "Phetsarath OT", "Noto Sans Lao", "IBM Plex Sans", Arial, sans-serif; }
:root[lang="lo"] body { font-family: var(--font); }

/* Thẻ xem nhanh (TheXemNhanh): hồ sơ cán bộ, học viên, lớp, khoa, tổ khi rê chuột */
.the-ho-so-noi {
    position: fixed;
    inset: auto;
    margin: 0;
    width: min(34rem, calc(100vw - 24px));
    max-height: min(70vh, 36rem);
    overflow: auto;
    padding: 1rem;
    border: 1px solid var(--vien);
    border-radius: .8rem;
    background: var(--nen-the, #fff);
    color: var(--mau-chu);
    box-shadow: 0 12px 36px rgba(20, 50, 35, .18);
    text-align: left;
    font-size: .9rem;
}
.the-ho-so-noi[hidden] { display: none; }
/* Tiêu đề thẻ nổi chỉ là nhãn nhỏ: phần nổi bật là tên cán bộ ở đầu phiếu ngay bên dưới. */
.the-ho-so-noi h2 { margin: 0 0 .625rem; color: var(--chu-phu); font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.the-ho-so-noi:focus-visible { outline: 2px solid var(--xanh-la-chinh); outline-offset: 2px; }

.neo-xem-nhanh { cursor: help; border-radius: 3px; text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: .2rem; }
.neo-xem-nhanh:hover { text-decoration-style: solid; }
.neo-xem-nhanh:focus-visible { outline: 2px solid var(--mau-chinh-sang); outline-offset: 2px; }
.neo-xem-nhanh.ten-can-bo { display: inline; padding: 0; color: var(--mau-chinh); font-weight: 500; cursor: pointer; }
.the-xem-nhanh { width: min(26rem, calc(100vw - 24px)); }
.the-xem-nhanh:has(.ho-so-can-bo), .the-xem-nhanh:has(.nhom-ho-so) { width: min(34rem, calc(100vw - 24px)); }
.xn-dau { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; padding: .75rem; border-radius: 10px; background: var(--mau-chinh-nhat); }
.xn-dau strong { display: block; font-size: 1.0625rem; }
.xn-dau small { color: var(--chu-phu); }
.xn-avatar { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--mau-chinh); color: var(--chu-tren-mau); font-size: 1.125rem; font-weight: 700; }
.xn-avatar.vuong { border-radius: 10px; }
.xn-luoi { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem; margin: 0 0 .75rem; }
.xn-luoi div { min-width: 0; }
.xn-luoi .toan-hang { grid-column: 1 / -1; }
.xn-luoi dt { color: var(--chu-phu); font-size: var(--cc-12); font-weight: 400; }
.xn-luoi dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.xn-lien-ket { font-size: var(--cc-13); font-weight: 600; }

/* ===================== Cài đặt hiển thị cá nhân (CaiDatGiaoDien + tuy-chon-giao-dien.js) ===================== */
/* Nội dung giãn theo cửa sổ (mặc định): khi thu nhỏ trình duyệt, lưới thẻ/bảng tự thêm cột thay vì co lại giữa màn hình. */
.content { max-width: var(--rong-noi-dung, none); }
:root[data-do-rong="vua"] { --rong-noi-dung: 1440px; }
@media (min-width: 2000px) { .content { padding-inline: clamp(2rem, 3vw, 4rem); } }
/* Cỡ chữ tự động: lớn dần theo độ rộng khung nhìn (màn hình rộng hoặc thu nhỏ trình duyệt), giữ trong 15–21px. */
:root[data-co-chu="tu-dong"] { font-size: clamp(15px, calc(10px + .36vw), 21px); }

/* Màu chủ đạo (sáng) */
:root[data-mau="xanh-duong"] { --mau-chinh: #1d4e89; --mau-chinh-dam: #0f2a4d; --mau-chinh-tam: #163b69; --mau-chinh-sang: #2f6fb5; --mau-chinh-nhat: #edf3fa; }
:root[data-mau="do-do"] { --mau-chinh: #8b1e2b; --mau-chinh-dam: #4a0d15; --mau-chinh-tam: #6b1520; --mau-chinh-sang: #b0344a; --mau-chinh-nhat: #fbeff1; }
:root[data-mau="tim"] { --mau-chinh: #4b3a8c; --mau-chinh-dam: #241a4d; --mau-chinh-tam: #372a6b; --mau-chinh-sang: #6a57b5; --mau-chinh-nhat: #f1eefa; }
:root[data-mau="nau"] { --mau-chinh: #7a4a1f; --mau-chinh-dam: #3d230c; --mau-chinh-tam: #5c3716; --mau-chinh-sang: #a5662f; --mau-chinh-nhat: #f8f1ea; }
:root[data-mau="xam"] { --mau-chinh: #37474f; --mau-chinh-dam: #1c2529; --mau-chinh-tam: #2b383e; --mau-chinh-sang: #546e7a; --mau-chinh-nhat: #eef2f4; }
/* Màu chủ đạo (tối): màu chữ/nhấn sáng hơn để đủ tương phản trên nền tối */
:root[data-giao-dien="toi"][data-mau="xanh-duong"] { --mau-chinh: #9cc3f0; --mau-chinh-sang: #6fa6e6; --mau-chinh-nhat: #22324a; --mau-chinh-dam: #0b1a2e; }
:root[data-giao-dien="toi"][data-mau="do-do"] { --mau-chinh: #f2a7b2; --mau-chinh-sang: #e07a8b; --mau-chinh-nhat: #43242a; --mau-chinh-dam: #2a0b10; }
:root[data-giao-dien="toi"][data-mau="tim"] { --mau-chinh: #c3b6f2; --mau-chinh-sang: #9f8de6; --mau-chinh-nhat: #2f2a47; --mau-chinh-dam: #161029; }
:root[data-giao-dien="toi"][data-mau="nau"] { --mau-chinh: #e8c09a; --mau-chinh-sang: #d29a66; --mau-chinh-nhat: #3d2f22; --mau-chinh-dam: #22150a; }
:root[data-giao-dien="toi"][data-mau="xam"] { --mau-chinh: #b8c7cf; --mau-chinh-sang: #90a4ae; --mau-chinh-nhat: #2c363b; --mau-chinh-dam: #111719; }

/* Mật độ */
:root[data-mat-do="gon"] { --kc-3: .5rem; --kc-4: .75rem; --kc-5: 1rem; --kc-6: 1.125rem; --kc-8: 1.25rem; }
:root[data-mat-do="gon"] .directory-grid .rz-grid-table td, :root[data-mat-do="gon"] .bang-diem td { padding-top: .25rem; padding-bottom: .25rem; }
:root[data-mat-do="thoang"] { --kc-3: 1rem; --kc-4: 1.25rem; --kc-5: 1.5rem; --kc-6: 1.875rem; --kc-8: 2.5rem; }
:root[data-mat-do="thoang"] .directory-grid .rz-grid-table td, :root[data-mat-do="thoang"] .bang-diem td { padding-top: .75rem; padding-bottom: .75rem; }

/* Bo góc */
:root[data-bo-goc="vuong"] { --bo-goc: 3px; --bo-goc-the: 4px; --bo-goc-lon: 6px; }
:root[data-bo-goc="tron"] { --bo-goc: 12px; --bo-goc-the: 16px; --bo-goc-lon: 20px; }

/* Phông chữ */
:root[data-phong="he-thong"] { --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
:root[data-phong="de-doc"] { --font: Verdana, Tahoma, "Segoe UI", Arial, sans-serif; }
:root[data-phong="serif"] { --font: "Times New Roman", "IBM Plex Serif", Georgia, serif; }

/* Hỗ trợ tiếp cận */
:root[data-tuong-phan] { --chu-phu: #2f3a33; --vien-the: #8f9b92; --vien-nhat: #aab4ac; --vien-o-nhap: #6c776f; }
:root[data-tuong-phan][data-giao-dien="toi"] { --chu-phu: #dbe7de; --vien-the: #7d9585; --vien-nhat: #66806f; }
:root[data-tuong-phan] :focus-visible { outline-width: 3px !important; outline-offset: 3px; }
:root[data-gach-chan] a, :root[data-gach-chan] .rz-link { text-decoration: underline !important; text-underline-offset: .18em; }
:root[data-giam-chuyen-dong] *, :root[data-giam-chuyen-dong] *::before, :root[data-giam-chuyen-dong] *::after { animation-duration: 0s !important; transition-duration: 0s !important; scroll-behavior: auto !important; }

/* Hộp cài đặt mở rộng */
.hop-cai-dat.hop-cai-dat-rong { width: min(24rem, calc(100vw - 1.5rem)); padding: 0; display: flex; flex-direction: column; max-height: min(80vh, 44rem); }
.hop-cai-dat-rong header { padding: 1rem 1.25rem .5rem; margin: 0; }
.cd-cuon { overflow-y: auto; padding: 0 1.25rem 1rem; }
.cd-nhom { margin: 1rem 0 .25rem; color: var(--chu-phu); font-size: var(--cc-12); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cd-nhom:first-child { margin-top: 0; }
.hop-cai-dat-rong label { margin: .625rem 0 .3rem; font-size: var(--cc-13); }
.cd-gia-tri { display: inline !important; margin: 0 0 0 .375rem !important; font-weight: 400; }
.cd-chon { display: flex; flex-wrap: wrap; gap: .375rem; }
.cd-chon button { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 2.125rem; padding: .25rem .625rem; border: 1px solid var(--vien-the); border-radius: var(--bo-goc); background: var(--nen-the); color: var(--chu-chinh); font-size: var(--cc-13); cursor: pointer; }
.cd-chon button .rzi { font-size: 1.05rem; }
.cd-chon button:hover { border-color: var(--mau-chinh-sang); }
.cd-chon button.dang-chon { border-color: var(--mau-chinh); background: var(--mau-chinh-nhat); color: var(--mau-chinh); font-weight: 600; box-shadow: inset 0 0 0 1px var(--mau-chinh); }
.cd-co-chu button { min-width: 2.25rem; font-weight: 700; }
.cd-goc-vuong { border-radius: 2px !important; } .cd-goc-tron { border-radius: 999px !important; }
.cd-mau { display: grid; grid-template-columns: repeat(3, 1fr); gap: .375rem; }
.cd-mau button { display: flex; align-items: center; gap: .375rem; padding: .375rem .5rem; border: 1px solid var(--vien-the); border-radius: var(--bo-goc); background: var(--nen-the); color: var(--chu-chinh); cursor: pointer; }
.cd-mau button span { flex: none; width: 1.25rem; height: 1.25rem; border-radius: 50%; box-shadow: inset 0 0 0 2px rgb(255 255 255 / .5); }
.cd-mau button small { margin: 0 !important; font-size: var(--cc-12); line-height: 1.2; color: inherit !important; text-align: left; }
.cd-mau button.dang-chon { border-color: var(--mau-chinh); box-shadow: inset 0 0 0 1px var(--mau-chinh); font-weight: 600; }
.cd-bat-tat { display: flex !important; align-items: flex-start; gap: .625rem; padding: .5rem .625rem; border: 1px solid var(--vien-nhat); border-radius: var(--bo-goc); cursor: pointer; font-weight: 400 !important; }
.cd-bat-tat input { margin-top: .2rem; width: 1rem; height: 1rem; accent-color: var(--mau-chinh); }
.cd-bat-tat span { display: flex; flex-direction: column; }
.cd-bat-tat small { margin: 0 !important; font-size: var(--cc-12); }
.cd-xem-truoc { margin-top: 1rem; padding: .75rem; border: 1px dashed var(--vien-o-nhap); border-radius: var(--bo-goc-the); background: var(--nen-trang); }
.cd-xem-truoc p { margin: .375rem 0; font-size: .9375rem; }
.cd-nut-mau { display: inline-block; padding: .375rem .875rem; border-radius: var(--bo-goc); background: var(--mau-chinh); color: var(--chu-tren-mau); font-size: var(--cc-13); font-weight: 600; }
[data-giao-dien="toi"] .cd-nut-mau { color: #10170f; }
.cd-chan { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .625rem 1.25rem; border-top: 1px solid var(--vien-nhat); }
.cd-chan small { margin: 0 !important; font-size: var(--cc-12); }

/* Phóng to trình duyệt (khung nhìn hẹp 760–1280px): thanh tiêu đề giữ một dòng, thanh bên hẹp lại */
@media (min-width: 760px) and (max-width: 1280px) {
    .chu-tim-nhanh, .nut-tim-nhanh kbd { display: none; }
    .nut-tim-nhanh { min-width: 0; }
    .user-details { display: none; }
    .top-row-trai { flex-basis: 12rem; }
}
@media (min-width: 760px) and (max-width: 1150px) { :root { --chieu-rong-sidebar: 15rem; } }
.sidebar { border-right-color: color-mix(in srgb, var(--mau-chinh-dam) 70%, #000); }

/* Ô tìm nhanh: báo khi kết quả chỉ là gần đúng */
.goi-y-tim-nhanh.gan-dung { display: flex; align-items: center; gap: .375rem; margin: .25rem .5rem .5rem; padding: .375rem .625rem; border-radius: 8px; background: var(--canh-bao-nen); color: var(--canh-bao-chu); }
