/* Giao diện web CSDL Huấn luyện CSCĐ — bảng màu cố định giống bản desktop. */
:root {
    --nen: #F3F6FA;
    --nen-thu-vien: #F5F6F8;
    --the: #FFFFFF;
    --vien: #D7DEE8;
    --vien-nhat: #E1E4EA;
    --chu: #172033;
    --chu-dam: #101828;
    --chu-phu: #5B6472;
    --chu-mo: #98A2B3;
    --xanh-dam: #102A43;
    --xanh-chinh: #13294B;
    --xanh-nut: #1D5D8F;
    --xanh-nhan: #2F6FED;
    --xanh-nhat: #EEF4FF;
    --do: #C81E1E;
    --do-dam: #B42318;
    --xanh-la: #1E6B43;
    --bo-goc: 8px;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--nen); color: var(--chu); font-size: 14px; line-height: 1.45; }
h1 { font-size: 26px; font-weight: 600; color: var(--xanh-dam); margin: 0 0 6px; }
h1.nho { font-size: 22px; font-weight: 700; color: var(--chu-dam); }
h2 { font-size: 18px; font-weight: 600; color: var(--chu-dam); margin: 8px 0; }
h3 { font-size: 16px; margin: 0 0 6px; }
hr { border: 0; border-top: 1px solid var(--vien-nhat); margin: 10px 0; width: 100%; }
button { font: inherit; }
progress { width: 100%; max-width: 260px; height: 9px; accent-color: #1D4ED8; }
input[type="range"] { width: 100%; accent-color: #1D4ED8; }
fieldset { border: 0; padding: 0; margin: 0; }
fieldset:disabled { opacity: .6; }
details > summary { cursor: pointer; }

/* ---------- Khởi động & lỗi ---------- */
.khoi-dong { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--chu-phu); }
.khoi-dong img { width: 90px; height: auto; }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: 10px 16px; background: #FEF3C7; box-shadow: 0 -1px 4px rgba(0,0,0,.15); }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

/* ---------- Ô nhập & nút ---------- */
.nhan { display: block; font-weight: 600; font-size: 13px; color: #334155; margin: 8px 0 4px; }
.nhan.nho { font-size: 12px; color: var(--chu-phu); }
.o-nhap {
    width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid #94A3B8; border-radius: 6px;
    background: #FFFFFF; color: var(--chu); font: inherit;
}
.o-nhap:focus { outline: 2px solid #BFDBFE; border-color: #1769AA; }
.o-nhap[readonly] { background: #F8FAFC; }
.o-nhap.lon { min-height: 44px; font-size: 16px; padding: 8px 12px; }
.o-nhap.so { max-width: 140px; }
textarea.o-nhap { resize: vertical; }
select.o-nhap { padding-right: 28px; }
.o-chi-doc { background: #FFF; border: 1px solid #BFDBFE; border-radius: 7px; padding: 9px 12px; font-weight: 600; }
.o-chon { display: inline-flex; align-items: center; gap: 6px; margin: 6px 12px 6px 0; cursor: pointer; }

.nut {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 36px; padding: 7px 14px; border-radius: 6px; border: 1px solid transparent;
    cursor: pointer; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.nut:disabled { opacity: .55; cursor: not-allowed; }
.nut.lon { min-height: 44px; font-size: 16px; }
.nut.nho { min-height: 28px; padding: 3px 9px; font-size: 12px; }
.nut.day { width: 100%; }
.nut-chinh { background: var(--xanh-chinh); border-color: var(--xanh-chinh); color: #FFF; }
.nut-chinh:hover:not(:disabled) { background: #0B1D33; }
.nut-phu { background: #FFF; border-color: #C9CFD8; color: var(--chu-dam); }
.nut-phu:hover:not(:disabled) { background: #F5F6F8; border-color: #98A2B3; }
.nut-xam { background: #E8EDF4; border-color: #A8B4C4; color: var(--chu); }
.nut-xam:hover:not(:disabled) { background: #D7E0EB; }
.nut-do { background: #B71C1C; border-color: #8E1414; color: #FFF; }
.nut-do:hover:not(:disabled) { background: #C62828; }
.nut-xanh-la { background: var(--xanh-la); border-color: #17492D; color: #FFF; }
.nut-xanh-la:hover:not(:disabled) { background: #278252; }
.nut-nguy-hiem { background: var(--do); border-color: #991B1B; color: #FFF; }
.nut-nguy-hiem:hover:not(:disabled) { background: #E03030; }
.nhom-nut { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nhom-nut.doc { flex-direction: column; align-items: stretch; }
.nhom-nut.phai { justify-content: flex-end; }
.nhom-nut.giua, .giua { justify-content: center; display: flex; }

/* ---------- Đăng nhập ---------- */
.dang-nhap-nen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.dang-nhap-the {
    width: 100%; max-width: 620px; background: #F8FAFC; border: 1px solid var(--vien);
    border-radius: 18px; padding: 30px 38px; box-shadow: 0 10px 30px rgba(16, 42, 67, .08);
}
.dang-nhap-logo { display: flex; justify-content: space-around; align-items: center; margin-bottom: 8px; }
.dang-nhap-logo img { height: 104px; width: auto; max-width: 42%; object-fit: contain; }
.dang-nhap-don-vi { text-align: center; }
.dv-1 { font-size: 22px; font-weight: 700; color: var(--chu); }
.dv-2 { font-size: 18px; font-weight: 600; color: #26334D; }
.dang-nhap-tieu-de {
    margin: 14px 0 6px; padding: 13px 18px; border-radius: 8px; background: #B71C1C; color: #FFF;
    font-size: 20px; font-weight: 700; text-align: center;
}
.o-mat-khau { position: relative; }
.o-mat-khau .o-nhap { padding-right: 48px; }
.nut-mat {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
    border: 0; border-radius: 6px; background: transparent; color: #475569; cursor: pointer;
}
.nut-mat:hover { background: #E8EDF4; color: #1769AA; }
.hang-2-cot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.dang-nhap-thong-bao { margin-top: 12px; padding: 10px 12px; border-radius: 6px; background: #FDECEC; color: #8B1E1E; }

/* ---------- Khung chính ---------- */
.khung { min-height: 100vh; display: flex; flex-direction: column; }
.thanh-tieu-de {
    background: var(--xanh-dam); color: #FFF; padding: 10px 20px; display: grid;
    grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; position: sticky; top: 0; z-index: 50;
}
.tieu-de-trai { display: flex; align-items: center; gap: 10px; }
.logo-nho { height: 48px; width: auto; }
.td-1 { font-weight: 700; font-size: 16px; }
.td-2 { font-size: 12px; color: #C9D8E8; }
.tieu-de-giua { text-align: center; font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.tieu-de-phai { display: flex; align-items: center; gap: 12px; }
.nut-chuong {
    position: relative; background: #173B5E; border: 1px solid #3D668C; color: #FFF; border-radius: 6px;
    padding: 7px 10px; cursor: pointer; display: inline-flex;
}
.nut-chuong:disabled { opacity: .6; cursor: default; }
.so-chua-doc {
    position: absolute; top: -8px; right: -10px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    background: #D92D20; color: #FFF; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.nguoi-dung { text-align: right; }
.nd-ten { font-weight: 600; }
.nd-vai-tro { font-size: 12px; color: #FFD166; }

.bo-cuc { flex: 1; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; padding: 20px 24px; align-items: start; }
.menu-chuc-nang {
    background: var(--the); border: 1px solid var(--vien); border-radius: 10px; padding: 14px;
    display: flex; flex-direction: column; gap: 10px; position: sticky; top: 92px;
}
.menu-tieu-de { color: var(--xanh-nut); font-weight: 700; }
.menu-muc {
    display: flex; flex-direction: column; gap: 2px; text-align: left; min-height: 72px; padding: 10px 12px;
    border-radius: 6px; border: 1px solid #0077B6; background: #D9F1FF; color: #003E66; cursor: pointer;
}
.menu-muc:hover:not(:disabled) { background: #BDE8FF; }
.menu-muc:disabled { opacity: .6; cursor: default; }
.menu-muc.thu-vien { background: #E0F2FE; border-color: #0284C7; color: #0C4A6E; }
.menu-muc.quan-tri { background: #F3E8FF; border-color: #A855F7; color: #581C87; }
.menu-muc.dang-chon { box-shadow: inset 5px 0 0 #B71C1C; padding-left: 18px; }
.mm-ten { font-size: 14px; font-weight: 700; }
.mm-mo-ta { font-size: 11px; color: #075985; }
.menu-muc.quan-tri .mm-mo-ta { color: #7E22CE; }
.vung-noi-dung { min-width: 0; }
.noi-dung-don { padding: 24px 16px; display: flex; justify-content: center; }
.thanh-trang-thai {
    background: #F8FAFC; border-top: 1px solid #E2E8F0; padding: 8px 18px; font-size: 12px; color: #334155;
    position: sticky; bottom: 0; z-index: 40;
}

/* ---------- Thành phần chung ---------- */
.trang { background: var(--nen-thu-vien); border-radius: 10px; }
.trang-trang { background: var(--the); border: 1px solid var(--vien-nhat); border-radius: 10px; padding: 20px; }
.the { background: var(--the); border: 1px solid var(--vien-nhat); border-radius: 10px; padding: 14px; }
.mo-ta { color: #526277; font-size: 15px; margin: 4px 0 14px; }
.ghi-chu { color: var(--chu-phu); font-size: 12px; }
.thong-bao-nho { color: #334155; font-size: 13px; margin: 6px 0 10px; }
.dau-trang { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.dau-trang > div:first-child { min-width: 0; }
.co-gian { flex: 1; min-width: 0; }
.cot { display: flex; flex-direction: column; gap: 6px; }
.hang-2 { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; }
.can-phai { text-align: right; }
.luoi-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.luoi-2.rong { gap: 16px; margin-top: 14px; }
.luoi-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.luoi-3.nho { gap: 10px; margin: 12px 0; }
.luoi-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.td-ten { font-size: 17px; font-weight: 600; color: var(--xanh-dam); overflow-wrap: anywhere; }
.td-phu { font-size: 13px; color: #526277; overflow-wrap: anywhere; }
.td-nho { font-size: 12px; color: #64748B; }
.td-nho.mo { color: var(--chu-mo); }
.td-dam { font-weight: 600; color: var(--chu-dam); overflow-wrap: anywhere; }
.td-dam.nho, .nho { font-size: 12px; }
.td-dam.sang { color: #FFF; }
.td-tien-do { font-size: 12px; font-weight: 700; color: #1D4ED8; margin-top: 4px; }
.tieu-de-nho { font-size: 15px; font-weight: 600; color: var(--chu-dam); }
.tieu-de-nho.xanh, .xanh { color: var(--xanh-nut); }
.xanh-ngoc-chu { color: #0F766E; }
.tim-chu { color: #6D28D9; }
.chu-do { color: var(--do-dam); }
.chu-xanh-la { color: #027A48; }
.chu-cam { color: #B54708; }
.loi { color: var(--do-dam); font-size: 12px; }
.nhan-xanh { color: #1D4ED8; font-size: 12px; font-weight: 700; }
.nhan-xanh.nho { font-size: 10px; }
.nhan-loai { display: inline-block; background: var(--xanh-nhat); color: var(--xanh-nhan); border-radius: 10px; padding: 3px 8px; font-size: 11px; font-weight: 600; }
.nhan-loai.lon { font-size: 12px; padding: 4px 10px; }
.nhan-tim { color: #6D28D9; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; }
.so-tien-do { font-size: 18px; font-weight: 700; color: #1D4ED8; }
.gioi-han-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-dong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thanh-tai { height: 3px; margin-top: 6px; border-radius: 2px; background: linear-gradient(90deg, transparent, #1D4ED8, transparent); background-size: 200% 100%; animation: chay 1.2s linear infinite; }
@keyframes chay { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.dang-tai { opacity: .55; pointer-events: none; }
.hop-thong-bao { background: #F1F5F9; border-radius: 6px; padding: 10px; font-size: 12px; color: #344054; margin-top: 10px; }
.hop-thong-bao.xanh { background: #EAF1FB; color: #24456F; font-size: 13px; margin: 0 0 12px; }
.rong { text-align: center; padding: 28px 16px; color: var(--chu-phu); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rong.nho { padding: 14px; background: #F5F6F8; border: 1px solid var(--vien-nhat); border-radius: 8px; }
.rong-icon { width: 46px; height: 46px; border-radius: 23px; background: var(--xanh-nhat); color: var(--xanh-nhan); font-size: 22px; display: flex; align-items: center; justify-content: center; }

/* Ô tìm kiếm và gợi ý */
.o-tim { position: relative; margin: 6px 0; }
.hang-tim { display: flex; gap: 8px; margin-bottom: 10px; }
.hang-tim .o-nhap { flex: 1; }
.goi-y { background: #FFF; border: 1px solid #CBD5E1; border-radius: 8px; padding: 4px; margin-top: 4px; }
.goi-y-dong { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: #334155; text-align: left; cursor: pointer; }
.goi-y-dong:hover { background: var(--xanh-nhat); }
.goi-y-icon { font-size: 16px; color: var(--chu-phu); }

/* Phân trang */
.phan-trang { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 5px; margin: 12px 0 4px; }
.phan-trang-nhan { padding: 0 6px; font-size: 13px; color: #344054; }

/* Biểu mẫu khung màu */
.form-khung { border: 1px solid #CBD5E1; border-radius: 10px; padding: 16px; margin: 10px 0; background: #F8FAFC; display: flex; flex-direction: column; gap: 2px; }
.form-khung .nhom-nut { margin-top: 10px; }
.form-khung.xanh-duong { background: #EFF6FF; border-color: #60A5FA; }
.form-khung.xanh-duong h3 { color: #1E3A8A; }
.form-khung.xanh-ngoc { background: #F0FDFA; border-color: #2DD4BF; }
.form-khung.xanh-ngoc h3 { color: #134E4A; }
.form-khung.cam { background: #FFF7ED; border-color: #FB923C; }
.form-khung.cam h3 { color: #7C2D12; }
.form-khung.xam { background: #F3F6FA; border-color: var(--vien); }
.form-khung.xanh-la-nhat { background: #ECFDF3; border-color: #6CE9A6; }
.form-khung.vang-nhat { background: #FFFAEB; border-color: #FEC84B; }
.form-khung.do-nhat { background: #FFF1F0; border-color: #FDA29B; }
.hang-chon-tep { display: flex; gap: 8px; flex-wrap: wrap; }
.hang-chon-tep .o-nhap { flex: 1; min-width: 180px; }

/* ---------- Tổ huấn luyện ---------- */
.the-lon {
    display: flex; flex-direction: column; gap: 8px; text-align: left; min-height: 160px; padding: 22px;
    border-radius: 8px; border: 1px solid; color: #FFF; cursor: pointer;
}
.the-lon.tim { background: #4F46E5; border-color: #3730A3; }
.the-lon.tim:hover { background: #3730A3; }
.the-lon.xanh-ngoc { background: #00897B; border-color: #00695C; }
.the-lon.xanh-ngoc:hover { background: #00695C; }
.the-lon.cam { background: #E8590C; border-color: #C2410C; }
.the-lon.cam:hover { background: #C2410C; }
.tl-ten { font-size: 19px; font-weight: 700; }
.tl-mo-ta { font-size: 13px; opacity: .9; }
.the-dong { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 16px; margin: 8px 0; border: 1px solid; border-radius: 8px; flex-wrap: wrap; }
.the-dong.xanh-nhat { background: #E0F2FE; border-color: #38BDF8; }
.the-dong.xanh-nhat .td-ten { color: #0C4A6E; }
.the-dong.xanh-nhat-2 { background: #EEF5FF; border-color: #7DD3FC; }
.the-dong.xanh-nhat-2 .td-ten { color: #0C4A6E; }
.the-dong.xam { background: #F8FAFC; border-color: #CBD5E1; }
.the-dong.trang-vien { background: #FFF; border-color: #CBD5E1; }
.the-dong.xanh-ngoc-nhat { background: #E6FFFB; border-color: #14B8A6; }
.the-dong.xanh-ngoc-nhat .td-ten { color: #134E4A; }
.the-dong.cam-nhat { background: #FFF7ED; border-color: #F97316; }
.the-dong.cam-nhat .td-ten { color: #7C2D12; }
.khung-noi-dung { padding: 22px; border-radius: 10px; border: 1px solid; font-size: 16px; white-space: pre-wrap; margin-bottom: 10px; }
.khung-noi-dung.cam-nhat { background: #FFF7ED; border-color: #F97316; color: #7C2D12; }
.the-thuc-hien {
    display: flex; gap: 16px; align-items: center; padding: 18px; margin: 8px 0; border-radius: 12px;
    background: #EFF6FF; border: 2px solid #2563EB; flex-wrap: wrap;
}
.the-thuc-hien.lon { max-width: 760px; align-items: flex-start; padding: 24px; }
.the-thuc-hien.nho { padding: 12px; gap: 10px; align-items: flex-start; }
.dau-tich { width: 52px; height: 52px; border-radius: 26px; background: #DBEAFE; color: #1D4ED8; font-size: 25px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.dau-tich.lon { width: 64px; height: 64px; border-radius: 32px; font-size: 31px; }
.the-thuc-hien.nho .dau-tich { width: 38px; height: 38px; font-size: 19px; }

/* ---------- Thư viện ---------- */
.thu-vien { padding: 4px 0; }
.thu-vien-luoi { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 14px; align-items: start; }
.cay-thu-vien { position: sticky; top: 92px; max-height: calc(100vh - 150px); overflow: auto; }
.cay, .cay ul { list-style: none; margin: 0; padding: 0; }
.cay ul { padding-left: 14px; }
.cay-dong { display: flex; align-items: flex-start; gap: 2px; border-radius: 6px; }
.cay-dong.dang-chon { background: #DCE8FF; }
.cay-mui-ten { width: 22px; min-height: 30px; border: 0; background: transparent; cursor: pointer; color: #475569; flex: none; }
.cay-mui-ten.trong { display: inline-block; }
.cay-ten { flex: 1; text-align: left; border: 0; background: transparent; padding: 6px 4px; border-radius: 6px; cursor: pointer; color: var(--chu-dam); font-size: 13px; overflow-wrap: anywhere; }
.cay-ten:hover { background: var(--xanh-nhat); color: var(--xanh-chinh); }
.thu-vien-chinh { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chi-tiet-thu-vien { border-color: #B9CCF8; scroll-margin-top: 90px; }
.xac-nhan-xoa { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 10px; border: 1px solid #D92D20; border-radius: 10px; }
.hop-icon { width: 48px; height: 48px; border-radius: 24px; background: #FEE4E2; color: #D92D20; font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.danh-sach-truong { margin: 0; }
.danh-sach-truong dt { font-size: 11px; color: var(--chu-phu); margin-top: 6px; }
.danh-sach-truong dd { margin: 0; font-size: 13px; color: var(--chu-dam); overflow-wrap: anywhere; white-space: pre-wrap; }
.tep-dinh-kem { display: flex; gap: 8px; align-items: center; padding: 10px; margin: 6px 0; background: #F5F6F8; border: 1px solid var(--vien-nhat); border-radius: 8px; flex-wrap: wrap; }
.bo-loc { margin-top: 10px; border-top: 1px solid var(--vien-nhat); padding-top: 8px; }
.bo-loc > summary { display: flex; flex-direction: column; gap: 1px; list-style: none; }
.bo-loc > summary::before { content: "▸ "; display: none; }
.bo-loc-noi-dung { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.danh-sach-nguon { display: flex; flex-wrap: wrap; background: #F5F6F8; border: 1px solid var(--vien-nhat); border-radius: 8px; padding: 6px 10px; max-height: 120px; overflow: auto; }
.danh-sach-nguon .o-chon { width: 190px; font-size: 13px; }
.hang-pham-vi { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pham-vi { color: var(--xanh-nhan); }
.thanh-quan-ly-nguon { display: flex; gap: 12px; align-items: center; background: var(--xanh-nhat); border-color: #B9CCF8; flex-wrap: wrap; }
.icon-vuong { width: 40px; height: 40px; border-radius: 10px; background: #DCE8FF; color: #1D4ED8; font-size: 21px; display: flex; align-items: center; justify-content: center; }
.ket-qua-thu-vien { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.ket-qua-thu-vien .td-ten { font-size: 14px; color: var(--chu-dam); }

/* Lớp phủ, hộp thoại, xem ảnh */
.lop-phu { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.lop-phu.toi { background: rgba(0, 0, 0, .85); }
.hop-thoai { background: #FFF; border-radius: 12px; padding: 24px; max-width: 440px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.xem-anh { max-width: 96vw; max-height: 94vh; display: flex; flex-direction: column; gap: 10px; }
.xem-anh img { max-width: 94vw; max-height: 82vh; object-fit: contain; background: #000; }

/* ---------- Quản lý nguồn ---------- */
.luoi-quan-ly { display: grid; gap: 16px; align-items: start; }
.luoi-quan-ly.hai-cot { grid-template-columns: minmax(0, 1fr) 360px; }
.luoi-quan-ly.ba-cot { grid-template-columns: 220px minmax(0, 1fr) 300px; }
.luoi-quan-ly.ba-cot.rong-giua { grid-template-columns: 270px 360px minmax(0, 1fr); }
.luoi-quan-ly > .form-khung { margin: 0; }
.danh-sach-chon { display: flex; flex-direction: column; border: 1px solid var(--vien); border-radius: 8px; background: #FFF; max-height: 560px; overflow: auto; }
.danh-sach-chon.ngan { max-height: 300px; margin-bottom: 10px; }
.dong-chon { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 8px 12px; border: 0; border-bottom: 1px solid #EEF2F6; background: transparent; cursor: pointer; color: var(--chu); }
.dong-chon:hover { background: #F5F8FC; }
.dong-chon.dang-chon { background: #DCE8FF; box-shadow: inset 3px 0 0 var(--xanh-nut); }

/* ---------- Tổng quan ---------- */
.the-so { padding: 16px; border-radius: 8px; }
.the-so.xanh-duong { background: #E7F0F8; }
.the-so.xanh-ngoc { background: #E6FAF5; }
.the-so.vang { background: #FFF5DB; }
.the-so.tim { background: #F3E8FF; }
.ts-nhan { color: #526277; }
.ts-so { font-size: 26px; font-weight: 700; color: var(--xanh-dam); }
.the-so.xanh-ngoc .ts-so { color: #047857; }
.the-so.vang .ts-so { color: #9A6700; }
.the-so.tim .ts-so { color: #6D28D9; }
.dong-thong-ke { padding: 8px; border-bottom: 1px solid #E2E8F0; }
.dong-thong-ke.hang { display: flex; gap: 12px; align-items: center; }
.ba-so { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; }

/* ---------- Quản trị ---------- */
.quan-tri { background: var(--nen); }
.tab-dau { display: flex; gap: 4px; border-bottom: 1px solid var(--vien); margin-bottom: 16px; flex-wrap: wrap; }
.tab-dau button { border: 0; background: transparent; padding: 10px 14px; cursor: pointer; font-size: 14px; color: #475569; border-bottom: 3px solid transparent; }
.tab-dau button.dang-chon { color: #2453A6; border-bottom-color: #2453A6; font-weight: 600; }
.luoi-quan-tri { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.cot-quan-tri { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 90px; }
.the-quan-tri { background: #FFF; border: 1px solid #DAE2ED; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.the-quan-tri.vien-do { border-color: #FECDCA; }
.the-quan-tri .danh-sach-chon { max-height: 430px; }
.hop-tim { background: #F5F3FF; color: #6D28D9; border-radius: 8px; padding: 12px; font-size: 12px; }
.danh-sach-nhat-ky { max-height: 560px; overflow: auto; }
.dong-nhat-ky { border-bottom: 1px solid #E2E8F0; padding: 8px 0 12px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- Nhắc việc ---------- */
.nhac-viec { padding: 2px 0; }
.thong-bao-xanh { color: #175CD3; font-size: 12px; }
.bo-loc-nv { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; padding: 9px 12px; }
.chip-nhom { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid #D0D5DD; background: #FFF; color: #344054; border-radius: 14px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.chip:hover:not(:disabled) { background: var(--xanh-nhat); border-color: #84ADFF; }
.chip.dang-chon { background: var(--xanh-nhan); border-color: var(--xanh-nhan); color: #FFF; }
.nv-luoi { display: grid; grid-template-columns: 190px minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
.nv-danh-muc { display: flex; flex-direction: column; gap: 4px; }
.nv-muc { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 42px; padding: 6px 11px; border: 0; border-radius: 7px; background: transparent; color: #344054; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
.nv-muc:hover:not(:disabled) { background: var(--xanh-nhat); color: var(--xanh-chinh); }
.nv-muc.dang-chon { background: var(--xanh-chinh); color: #FFF; }
.dem { background: #E4E7EC; color: #344054; border-radius: 10px; min-width: 24px; padding: 2px 6px; font-size: 11px; text-align: center; }
.nv-giua { min-height: 300px; }
.nv-phai { scroll-margin-top: 90px; }
.o-so { border: 1px solid; border-radius: 9px; padding: 13px; }
.os-so { font-size: 25px; font-weight: 700; }
.os-nhan { font-size: 12px; font-weight: 600; }
.os-phu { font-size: 11px; }
.o-so.do { background: #FFF1F0; border-color: #FDA29B; color: #B42318; }
.o-so.vang { background: #FFFAEB; border-color: #FEC84B; color: #B54708; }
.o-so.xanh { background: #EEF4FF; border-color: #84ADFF; color: #175CD3; }
.o-so.tim { background: #F4F3FF; border-color: #BDB4FE; color: #6938EF; }
.o-so.xam { background: #F8FAFC; border-color: #D0D5DD; color: #475467; }
.o-so.xanh-la { background: #ECFDF3; border-color: #6CE9A6; color: #027A48; }
.the-cong-viec { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; padding: 13px; margin-bottom: 8px; background: #FFF; border: 1px solid var(--vien-nhat); border-radius: 8px; cursor: pointer; color: var(--chu-dam); }
.the-cong-viec:hover { background: #F8FAFC; border-color: #84ADFF; }
.the-cong-viec.dang-chon { background: var(--xanh-nhat); border-color: var(--xanh-nhan); }
.the-nho { border-radius: 10px; padding: 3px 7px; font-size: 10px; font-weight: 600; }
.the-nho.do { background: #FEE4E2; color: #B42318; }
.the-nho.xanh { background: var(--xanh-nhat); color: #175CD3; }
.the-nho.xam { background: #F2F4F7; color: #344054; }
.the-nho.xanh-nhat { background: #F0F9FF; color: #026AA2; }
.the-thong-bao { display: flex; gap: 10px; align-items: center; padding: 12px; margin-bottom: 8px; border: 1px solid var(--vien-nhat); border-radius: 8px; background: #FFF; }
.cham { width: 9px; height: 9px; border-radius: 5px; background: var(--xanh-nhan); flex: none; align-self: flex-start; margin-top: 6px; }
.cham.an { visibility: hidden; }
.luoi-thong-tin { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 10px 0; }
.luoi-thong-tin dt { color: #667085; }
.luoi-thong-tin dd { margin: 0; color: #344054; overflow-wrap: anywhere; }
.luoi-thong-tin.nho { font-size: 12px; }
.ho-so-ca-nhan { max-width: 680px; width: 100%; text-align: center; }
.ho-so-ca-nhan .luoi-thong-tin { text-align: left; }
.khoi-nho { margin: 6px 0; }
.dong-lich-su { display: flex; gap: 8px; margin: 6px 0 9px; }

/* ---------- Màn hình hẹp ---------- */
@media (max-width: 1280px) {
    .nv-luoi { grid-template-columns: 180px minmax(0, 1fr); }
    .nv-phai { grid-column: 1 / -1; }
    .luoi-quan-ly.ba-cot.rong-giua { grid-template-columns: 260px minmax(0, 1fr); }
    .luoi-quan-ly.ba-cot.rong-giua > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
    .thanh-tieu-de { grid-template-columns: 1fr auto; }
    .tieu-de-giua { display: none; }
    .bo-cuc { grid-template-columns: 1fr; padding: 12px; }
    .menu-chuc-nang { position: static; flex-direction: row; flex-wrap: wrap; }
    .menu-tieu-de { width: 100%; }
    .menu-muc { flex: 1 1 180px; min-height: 60px; }
    .thu-vien-luoi { grid-template-columns: 1fr; }
    .cay-thu-vien { position: static; max-height: 320px; }
    .luoi-quan-ly.hai-cot, .luoi-quan-ly.ba-cot { grid-template-columns: 1fr; }
    .luoi-quan-tri { grid-template-columns: 1fr; }
    .luoi-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    body { font-size: 14px; }
    .thanh-tieu-de { padding: 8px 12px; gap: 8px; }
    .tieu-de-don-vi, .nguoi-dung { display: none; }
    .logo-nho { height: 36px; }
    .trang-trang { padding: 14px; }
    .luoi-3, .luoi-2, .luoi-4 { grid-template-columns: 1fr; }
    .nv-luoi { grid-template-columns: 1fr; }
    .hang-2-cot { grid-template-columns: 1fr; }
    .dang-nhap-the { padding: 20px 16px; }
    .dang-nhap-logo img { height: 76px; }
    h1 { font-size: 22px; }
    .menu-muc { flex-basis: 140px; }
    .the-dong, .ket-qua-thu-vien { flex-direction: column; align-items: stretch; }
    .nhom-nut.doc { flex-direction: row; flex-wrap: wrap; }
}
