/* =====================================================================
   HRM PMC - giao diện mới "Ấm áp & thư thái" (xanh rêu - be - kem)
   ===================================================================== */
:root {
    --kem: #F5F1EA;
    --kem-2: #EFE9DE;
    --giay: #FFFDF8;
    --reu-dam: #34493C;
    --reu: #4A6553;
    --reu-sang: #5E7B66;
    --xo: #8AA58C;
    --xo-nhat: #DFE7DA;
    --be: #C9A882;
    --be-dam: #A9855D;
    --be-nhat: #F0E5D5;
    --dat: #C27657;
    --dat-nhat: #F6E1D7;
    --vang: #D3A042;
    --vang-nhat: #F6EAD0;
    --tham: #8B6B7D;
    --tham-nhat: #EEE3E8;
    --chu: #2C3830;
    --chu-2: #59655C;
    --mo: #8C958D;
    --vien: #E6DED1;
    --bong-1: 0 1px 2px rgba(52, 73, 60, .05), 0 6px 18px rgba(52, 73, 60, .06);
    --bong-2: 0 2px 4px rgba(52, 73, 60, .06), 0 16px 36px rgba(52, 73, 60, .10);
    --bo: 20px;
    --bo-nho: 12px;
    --font: "Be Vietnam Pro", "Segoe UI", Roboto, Arial, sans-serif;
    --font-tieu-de: "Lora", Georgia, "Times New Roman", serif;
    --em: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--chu);
    background: var(--kem);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--reu); text-decoration: none; transition: color .2s; }
a:hover { color: var(--reu-dam); }
h1, h2, h3, h4 { font-family: var(--font-tieu-de); color: var(--chu); margin: 0; font-weight: 600; letter-spacing: -.1px; }
::selection { background: rgba(138, 165, 140, .35); }
.ic { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic-nho { width: 16px; height: 16px; }
.an { display: none !important; }

/* ---------------- Khung ---------------- */
.khung { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }

/* ---------------- Menu trái ---------------- */
.menu {
    position: sticky; top: 0; height: 100vh; overflow: hidden;
    display: flex; flex-direction: column;
    background: linear-gradient(175deg, #3A5244 0%, #2F4437 100%);
    color: #E9E4D8;
}
.menu .la-trang-tri { position: absolute; color: rgba(255, 255, 255, .045); pointer-events: none; }
.menu .la-trang-tri.a { width: 220px; height: 290px; right: -90px; top: 120px; transform: rotate(28deg); }
.menu .la-trang-tri.b { width: 200px; height: 150px; left: -70px; bottom: 90px; transform: rotate(-12deg); }
.menu-dau { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 22px 18px 16px; position: relative; }
.menu-dau .logo { width: 100%; max-width: 190px; height: 84px; padding: 10px 14px; border-radius: 16px; background: var(--giay); display: grid; place-items: center; box-shadow: 0 6px 14px rgba(0, 0, 0, .18); }
.menu-dau .logo img { max-width: 100%; max-height: 64px; width: auto; height: auto; object-fit: contain; }
.menu-dau strong { font-family: var(--font-tieu-de); font-size: 16px; color: #FFF8EC; display: block; line-height: 1.3; overflow-wrap: anywhere; }
.menu-dau span { font-size: 11.5px; color: #B8C6B6; }
.menu-cuon { flex: 1; overflow-y: auto; padding: 4px 14px 16px; position: relative; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.menu-nhom { margin-top: 14px; }
.menu-nhom > span { display: block; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: #9FB29F; font-weight: 600; padding: 0 10px 6px; }
.menu-muc {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 10px; margin: 2px 0; border-radius: 12px;
    color: #E9E4D8; font-size: 13.8px; font-weight: 500;
    transition: background .2s var(--em), color .2s, transform .2s var(--em);
}
.menu-muc:hover { background: rgba(255, 255, 255, .07); color: #FFF8EC; transform: translateX(2px); }
.menu-muc .chip {
    width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
    background: rgba(255, 255, 255, .08); transition: transform .25s var(--em);
}
.menu-muc:hover .chip { transform: scale(1.06) rotate(-4deg); }
.menu-muc .chip .ic { width: 17px; height: 17px; }
.chip.reu { color: #B9D5BC; } .chip.xo { color: #CFE2C6; } .chip.be { color: #E9CDA6; }
.chip.dat { color: #F0B49A; } .chip.vang { color: #F1CC7D; } .chip.tham { color: #DDB9CC; }
.menu-muc .cu { margin-left: auto; opacity: .45; width: 14px; height: 14px; }
.menu-muc.chon { background: var(--kem); color: var(--reu-dam); font-weight: 600; box-shadow: 0 8px 18px rgba(0, 0, 0, .18); }
.menu-muc.chon .chip { background: var(--reu); color: #F5F1EA; }
.menu-chan { padding: 12px 14px 16px; border-top: 1px solid rgba(255, 255, 255, .08); position: relative; }
.ban-than { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.ban-than .ten { font-weight: 600; color: #FFF8EC; font-size: 13.5px; line-height: 1.3; }
.ban-than .nhom { font-size: 11.5px; color: #9FB29F; }
.nut-dang-xuat {
    margin-top: 8px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px; border-radius: 12px; border: 1px solid rgba(240, 180, 154, .35);
    background: rgba(194, 118, 87, .12); color: #F4C2AC; font: 600 13.5px var(--font); cursor: pointer;
    transition: background .2s, color .2s, transform .2s var(--em);
}
.nut-dang-xuat:hover { background: var(--dat); color: #fff; transform: translateY(-1px); }

/* ---------------- Vùng chính ---------------- */
.chinh { min-width: 0; display: flex; flex-direction: column; }
.thanh-tren {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 14px;
    padding: 14px 32px; background: rgba(245, 241, 234, .86);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(230, 222, 209, .7);
}
.nut-menu { display: none; border: 0; background: var(--giay); width: 40px; height: 40px; border-radius: 12px; color: var(--reu); cursor: pointer; box-shadow: var(--bong-1); }
.tim-nhanh { flex: 1; max-width: 420px; position: relative; }
.tim-nhanh .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mo); width: 18px; height: 18px; }
.tim-nhanh input { width: 100%; height: 42px; padding: 0 16px 0 42px; border-radius: 999px; border: 1px solid var(--vien); background: var(--giay); font: 14px var(--font); color: var(--chu); transition: border-color .2s, box-shadow .2s; }
.tim-nhanh input:focus { outline: none; border-color: var(--xo); box-shadow: 0 0 0 4px rgba(138, 165, 140, .22); }
.thanh-tren .phai { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.huy-hieu-cu { font-size: 12px; color: var(--chu-2); background: var(--be-nhat); padding: 6px 12px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center; }
.anh-dai-dien {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--be), var(--be-dam)); color: #fff; font-weight: 700; font-size: 14px;
    box-shadow: 0 4px 10px rgba(169, 133, 93, .3);
}
.anh-dai-dien.nho { width: 34px; height: 34px; font-size: 12.5px; }
.anh-dai-dien.xanh { background: linear-gradient(135deg, var(--xo), var(--reu-sang)); box-shadow: 0 4px 10px rgba(74, 101, 83, .25); }
.anh-dai-dien.dat { background: linear-gradient(135deg, #D69378, var(--dat)); }
.anh-dai-dien.lon { width: 84px; height: 84px; font-size: 28px; border-radius: 26px; }

.noi-dung { padding: 26px 32px 48px; }
.tieu-de-trang { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.tieu-de-trang h1 { font-size: 28px; line-height: 1.2; }
.tieu-de-trang p { margin: 6px 0 0; color: var(--chu-2); }

/* ---------------- Thẻ ---------------- */
.the {
    background: var(--giay); border: 1px solid var(--vien); border-radius: var(--bo);
    box-shadow: var(--bong-1); padding: 22px 24px;
    transition: box-shadow .3s var(--em), transform .3s var(--em);
}
.the:hover { box-shadow: var(--bong-2); }
.the-dau { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.the-dau h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.the-dau .phu { color: var(--mo); font-size: 12.5px; }
.bieu-tuong { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; }
.bieu-tuong.reu { background: var(--xo-nhat); color: var(--reu); }
.bieu-tuong.be { background: var(--be-nhat); color: var(--be-dam); }
.bieu-tuong.dat { background: var(--dat-nhat); color: var(--dat); }
.bieu-tuong.vang { background: var(--vang-nhat); color: #A97A1F; }
.bieu-tuong.tham { background: var(--tham-nhat); color: var(--tham); }
.luoi { display: grid; gap: 20px; }
.luoi.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.luoi.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.luoi.c2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.luoi.c1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------------- Khối chào mừng ---------------- */
.chao {
    position: relative; overflow: hidden; border-radius: 26px; padding: 30px 34px;
    background: linear-gradient(120deg, #3F5848 0%, #4E6B58 55%, #5F7C67 100%);
    color: #F5F1EA; box-shadow: 0 18px 40px rgba(52, 73, 60, .22); margin-bottom: 22px;
}
.chao .la { position: absolute; color: rgba(245, 241, 234, .10); }
.chao .la.a { --g: 24deg; width: 190px; height: 250px; right: 40px; top: -60px; transform: rotate(var(--g)); animation: dua 9s ease-in-out infinite; }
.chao .la.b { --g: -18deg; width: 170px; height: 130px; right: 220px; bottom: -60px; transform: rotate(var(--g)); color: rgba(201, 168, 130, .22); animation: dua 11s ease-in-out infinite reverse; }
.chao .ngay { font-size: 13px; color: #CFDCCB; display: flex; align-items: center; gap: 8px; }
.chao h1 { color: #FFF8EC; font-size: 30px; margin: 8px 0 8px; }
.chao p { margin: 0; color: #DDE6D9; max-width: 560px; }
.chao .hanh-dong { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; position: relative; }

/* ---------------- Ô số liệu (theo mẫu: be / xanh đậm / xanh xô / kem) ---------------- */
.o-so { position: relative; overflow: hidden; border-radius: var(--bo); padding: 20px 22px; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; transition: transform .3s var(--em), box-shadow .3s var(--em); box-shadow: var(--bong-1); }
.o-so:hover { transform: translateY(-3px); box-shadow: var(--bong-2); }
.o-so .nhan { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; opacity: .92; }
.o-so .so { font-family: var(--font-tieu-de); font-size: 36px; font-weight: 700; line-height: 1.1; }
.o-so .ghi-chu { font-size: 12.5px; opacity: .8; }
.o-so .la-goc { position: absolute; right: -18px; bottom: -26px; width: 92px; height: 120px; opacity: .14; transform: rotate(-20deg); }
.o-so.be { background: linear-gradient(140deg, #CDAE8A, #B8956C); color: #2E2418; }
.o-so.reu { background: linear-gradient(140deg, #3F5848, #34493C); color: #F5F1EA; }
.o-so.xo { background: linear-gradient(140deg, #9BB39C, #7F9B82); color: #1F2B22; }
.o-so.kem { background: var(--giay); color: var(--chu); border: 1px solid var(--vien); }
.o-so.kem .la-goc { color: var(--xo); opacity: .25; }

/* ---------------- Danh sách trong thẻ ---------------- */
.ds-dong { list-style: none; margin: 0; padding: 0; }
.ds-dong li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px dashed var(--vien); }
.ds-dong li:last-child { border-bottom: 0; }
.ds-dong .ten { font-weight: 600; color: var(--chu); line-height: 1.3; }
.ds-dong .phu { font-size: 12.5px; color: var(--mo); }
.ds-dong .phai { margin-left: auto; text-align: right; }
.trong { color: var(--mo); text-align: center; padding: 26px 10px; font-size: 13.5px; }
.thanh { margin: 12px 0; }
.thanh .dong { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.thanh .dong b { color: var(--chu); font-weight: 600; }
.thanh .ray { height: 10px; border-radius: 999px; background: var(--be-nhat); overflow: hidden; }
.thanh .ray i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--xo), var(--reu-sang)); transform-origin: left; animation: mo-rong .9s var(--em) both; }

/* ---------------- Nhãn ---------------- */
.nhan-mau { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.nhan-mau.reu { background: var(--xo-nhat); color: var(--reu-dam); }
.nhan-mau.dat { background: var(--dat-nhat); color: #9B5034; }
.nhan-mau.vang { background: var(--vang-nhat); color: #87601A; }
.nhan-mau.be { background: var(--be-nhat); color: #7A5C3A; }
.nhan-mau.xam { background: #ECE8E1; color: var(--chu-2); }

/* ---------------- Nút ---------------- */
.nut {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
    font: 600 14px var(--font); cursor: pointer; white-space: nowrap;
    background: var(--reu); color: #FFF8EC; box-shadow: 0 6px 14px rgba(52, 73, 60, .18);
    transition: background .2s, transform .2s var(--em), box-shadow .2s;
}
.nut:hover { background: var(--reu-dam); color: #FFF8EC; transform: translateY(-1px); box-shadow: 0 10px 20px rgba(52, 73, 60, .24); }
.nut:active { transform: translateY(0) scale(.98); }
.nut:focus-visible, .o-nhap:focus-visible { outline: 3px solid rgba(138, 165, 140, .45); outline-offset: 2px; }
.nut.be { background: var(--be); color: #2E2418; box-shadow: 0 6px 14px rgba(169, 133, 93, .25); }
.nut.be:hover { background: #BE9A71; }
.nut.vien { background: transparent; color: var(--reu); border-color: var(--vien); box-shadow: none; }
.nut.vien:hover { background: var(--giay); border-color: var(--xo); }
.nut.trong-suot { background: rgba(255, 248, 236, .14); color: #FFF8EC; border-color: rgba(255, 248, 236, .25); box-shadow: none; }
.nut.trong-suot:hover { background: rgba(255, 248, 236, .24); }
.nut.nho { height: 34px; padding: 0 14px; font-size: 13px; }

/* ---------------- Form ---------------- */
.o-nhap, select.o-nhap {
    height: 42px; width: 100%; padding: 0 14px; border-radius: var(--bo-nho);
    border: 1px solid var(--vien); background: var(--giay); color: var(--chu);
    font: 14px var(--font); transition: border-color .2s, box-shadow .2s;
}
.o-nhap:hover { border-color: #D6CBB8; }
.o-nhap:focus { outline: none; border-color: var(--xo); box-shadow: 0 0 0 4px rgba(138, 165, 140, .22); }
label.nhan-o { display: block; font-size: 13px; font-weight: 600; color: var(--chu-2); margin-bottom: 6px; }
.bo-loc { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(150px, 1fr)) auto; gap: 12px; align-items: end; }
.thong-bao { padding: 12px 16px; border-radius: var(--bo-nho); font-size: 14px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.thong-bao.loi { background: var(--dat-nhat); color: #8E4529; border: 1px solid #EDC6B5; }
.thong-bao.ok { background: var(--xo-nhat); color: var(--reu-dam); border: 1px solid #C9D8C4; }

/* ---------------- Bảng ---------------- */
.bang-boc { overflow-x: auto; border-radius: 16px; border: 1px solid var(--vien); }
table.bang { width: 100%; border-collapse: collapse; background: var(--giay); font-size: 14px; }
.bang th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--reu); background: var(--kem-2); padding: 12px 14px; font-weight: 700; white-space: nowrap; }
.bang td { padding: 12px 14px; border-top: 1px solid #EFE8DC; vertical-align: middle; }
.bang tbody tr { transition: background .15s; }
.bang tbody tr:hover { background: #F8F3EA; }
.bang .nguoi { display: flex; align-items: center; gap: 12px; }
.bang .nguoi .ten { font-weight: 600; color: var(--chu); }
.bang .nguoi .ma { font-size: 12px; color: var(--mo); }
.phan-trang { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; color: var(--chu-2); font-size: 13.5px; }
.phan-trang .trang { display: flex; gap: 6px; }
.phan-trang a, .phan-trang span.hien-tai {
    min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; display: inline-grid; place-items: center;
    border: 1px solid var(--vien); background: var(--giay); color: var(--chu-2); font-weight: 600;
}
.phan-trang a:hover { border-color: var(--xo); color: var(--reu); }
.phan-trang span.hien-tai { background: var(--reu); color: #FFF8EC; border-color: var(--reu); }

/* ---------------- Hồ sơ chi tiết ---------------- */
.ho-so-dau { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.ho-so-dau h1 { font-size: 26px; }
.ho-so-dau .the-tag { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.cap-thong-tin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }
.cap-thong-tin div { padding: 9px 0; border-bottom: 1px dashed var(--vien); display: flex; justify-content: space-between; gap: 16px; }
.cap-thong-tin dt { color: var(--mo); font-size: 13px; }
.cap-thong-tin dd { margin: 0; font-weight: 500; text-align: right; color: var(--chu); }
.dong-thoi-gian { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--xo-nhat); }
.dong-thoi-gian li { position: relative; padding: 0 0 16px 14px; }
.dong-thoi-gian li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--giay); border: 3px solid var(--xo); }
.dong-thoi-gian .tg { font-size: 12.5px; color: var(--mo); }
.dong-thoi-gian .nd { font-weight: 600; color: var(--chu); }

/* ---------------- Đăng nhập ---------------- */
.dn { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--kem); }
.dn-trai {
    position: relative; overflow: hidden; padding: 36px 52px; color: #F5F1EA;
    background: linear-gradient(150deg, #3F5848 0%, #34493C 60%, #2C3F33 100%);
    display: flex; flex-direction: column; justify-content: space-between;
}
.dn-trai .la { position: absolute; }
.dn-trai .la.a { --g: 22deg; width: 300px; height: 400px; right: -80px; top: -40px; color: rgba(138, 165, 140, .20); transform: rotate(var(--g)); animation: dua 10s ease-in-out infinite; }
.dn-trai .la.b { --g: -14deg; width: 260px; height: 200px; left: -60px; bottom: 40px; color: rgba(201, 168, 130, .22); transform: rotate(var(--g)); animation: dua 12s ease-in-out infinite reverse; }
.dn-trai .la.c { width: 120px; height: 160px; right: 30%; bottom: -40px; color: rgba(245, 241, 234, .08); transform: rotate(40deg); }
.dn-trai > * { position: relative; }
.dn-trai .logo-dong { display: flex; align-items: center; gap: 12px; }
.dn-trai .logo-dong .logo { width: 50px; height: 50px; border-radius: 16px; background: var(--giay); display: grid; place-items: center; }
.dn-trai .logo-dong .logo img { width: 40px; }
.dn-trai .logo-dong strong { font-family: var(--font-tieu-de); font-size: 20px; display: block; }
.dn-trai .logo-dong span { font-size: 12.5px; color: #C2CFBF; }
.dn-trai h1 { color: #FFF8EC; font-size: 40px; line-height: 1.2; max-width: 520px; }
.dn-trai h1 em { font-style: italic; color: #E7CFA9; }
.dn-trai .mo-ta { color: #D3DDCF; max-width: 480px; margin-top: 14px; font-size: 15px; }
.dn-trai .diem { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 560px; margin-top: 26px; }
.dn-trai .diem div { background: rgba(245, 241, 234, .08); border: 1px solid rgba(245, 241, 234, .14); border-radius: 16px; padding: 14px; font-size: 13px; color: #E2E9DE; }
.dn-trai .diem b { display: block; font-family: var(--font-tieu-de); font-size: 15px; color: #FFF8EC; margin-bottom: 2px; }
.dn-trai .chan { font-size: 12px; color: #A9B9A6; }
.dn-phai { display: flex; align-items: center; justify-content: center; padding: 32px 24px; position: relative; }
.dn-the { width: 100%; max-width: 410px; background: var(--giay); border: 1px solid var(--vien); border-radius: 26px; padding: 34px 32px; box-shadow: 0 24px 60px rgba(52, 73, 60, .12); animation: len .6s var(--em) both; }
.dn-the h2 { font-size: 28px; }
.dn-the .phu { color: var(--chu-2); margin: 6px 0 22px; }
.dn-the .truong { margin-bottom: 14px; }
.dn-the .o-icon { position: relative; }
.dn-the .o-icon .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mo); width: 18px; height: 18px; }
.dn-the .o-icon .o-nhap { padding-left: 42px; height: 46px; }
.dn-the .nut { width: 100%; height: 48px; margin-top: 8px; font-size: 15px; }
.dn-the .ghi-chu { text-align: center; color: var(--mo); font-size: 12.5px; margin-top: 18px; }

/* ---------------- Trang lỗi ---------------- */
.trang-loi { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.trang-loi .la { width: 90px; height: 120px; color: var(--xo); opacity: .6; }
.trang-loi h1 { font-size: 30px; margin: 10px 0 6px; }

/* ---------------- Hiệu ứng ---------------- */
.hien { animation: len .55s var(--em) both; }
.hien:nth-child(2) { animation-delay: .06s; } .hien:nth-child(3) { animation-delay: .12s; } .hien:nth-child(4) { animation-delay: .18s; }
@keyframes len { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes dua { 0%, 100% { transform: rotate(var(--g, 20deg)) translateY(0); } 50% { transform: rotate(calc(var(--g, 20deg) + 4deg)) translateY(8px); } }
@keyframes mo-rong { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------------- Màn hình nhỏ ---------------- */
@media (max-width: 1200px) {
    .luoi.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bo-loc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .khung { grid-template-columns: 1fr; }
    .menu { position: fixed; z-index: 50; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .3s var(--em); }
    body.mo-menu .menu { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .25); }
    body.mo-menu::after { content: ""; position: fixed; inset: 0; background: rgba(30, 40, 33, .4); z-index: 40; }
    .nut-menu { display: grid; place-items: center; }
    .luoi.c2-1, .luoi.c1-1, .luoi.c3 { grid-template-columns: 1fr; }
    .noi-dung, .thanh-tren { padding-left: 18px; padding-right: 18px; }
    .huy-hieu-cu { display: none; }
    .dn { grid-template-columns: 1fr; }
    .dn-trai { padding: 26px 22px 70px; }
    .dn-trai h1 { font-size: 26px; }
    .dn-trai .diem, .dn-trai .mo-ta, .dn-trai .chan { display: none; }
    .dn-the { margin-top: -50px; }
    .cap-thong-tin { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .luoi.c4 { grid-template-columns: 1fr; }
    .bo-loc { grid-template-columns: 1fr; }
    .chao { padding: 24px 22px; } .chao h1 { font-size: 24px; }
}

/* =====================================================================
   PHONG CÁCH NỔI (kính mờ, khối lơ lửng) - giữ bảng màu rêu / be / kem
   ===================================================================== */
:root {
    --kinh: rgba(255, 252, 246, .64);
    --kinh-dam: rgba(255, 252, 246, .82);
    --kinh-vien: rgba(255, 255, 255, .78);
    --noi: inset 0 1px 0 rgba(255, 255, 255, .85), inset 0 -1px 0 rgba(52, 73, 60, .04),
           0 1px 2px rgba(52, 73, 60, .05), 0 10px 24px rgba(52, 73, 60, .08), 0 28px 56px rgba(52, 73, 60, .08);
    --noi-cao: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 4px rgba(52, 73, 60, .06), 0 16px 34px rgba(52, 73, 60, .12), 0 36px 70px rgba(52, 73, 60, .10);
    --lom: inset 0 2px 5px rgba(52, 73, 60, .10), inset 0 -1px 0 rgba(255, 255, 255, .7);
    --mo-kinh: blur(18px) saturate(150%);
}
body {
    background:
        radial-gradient(1100px 620px at 8% -8%, #E3EBDD 0%, transparent 62%),
        radial-gradient(900px 520px at 100% 0%, #F2E2CC 0%, transparent 58%),
        radial-gradient(900px 640px at 55% 112%, #DEE7D9 0%, transparent 60%),
        #F2EDE4;
    background-attachment: fixed;
}

/* Khung: menu và vùng chính tách rời, lơ lửng */
.khung { padding: 16px; gap: 18px; grid-template-columns: 264px minmax(0, 1fr); }
.menu {
    top: 16px; height: calc(100vh - 32px); border-radius: 30px;
    background: linear-gradient(170deg, rgba(64, 90, 74, .94) 0%, rgba(46, 66, 54, .96) 100%);
    backdrop-filter: var(--mo-kinh); -webkit-backdrop-filter: var(--mo-kinh);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .20), 0 4px 10px rgba(30, 44, 35, .14), 0 26px 60px rgba(30, 44, 35, .26);
}
.menu-muc { border-radius: 16px; padding: 7px 10px; }
.menu-muc .chip {
    width: 30px; height: 30px; border-radius: 50%; color: #fff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 8px rgba(0, 0, 0, .18);
}
.menu-muc .chip .ic { width: 16px; height: 16px; stroke-width: 2.1; }
.chip.reu { background: #6E9A7A; } .chip.xo { background: #8DAA8F; } .chip.be { background: #C4A07A; }
.chip.dat { background: #C9795A; } .chip.vang { background: #D3A042; } .chip.tham { background: #957487; }
.menu-muc.chon {
    background: rgba(255, 252, 246, .94); color: var(--reu-dam);
    box-shadow: inset 0 1px 0 #fff, 0 6px 16px rgba(0, 0, 0, .20);
}
.menu-muc.chon .chip { background: var(--reu); }
.menu-chan { border-top-color: rgba(255, 255, 255, .10); }
.ban-than { background: rgba(255, 255, 255, .06); border-radius: 18px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.nut-dang-xuat { border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10); }

/* Thanh trên: thanh kính dạng viên thuốc */
.thanh-tren {
    top: 16px; margin-bottom: 20px; padding: 10px 12px 10px 14px; border-radius: 26px;
    background: var(--kinh); border: 1px solid var(--kinh-vien);
    backdrop-filter: var(--mo-kinh); -webkit-backdrop-filter: var(--mo-kinh);
    box-shadow: var(--noi);
}
.tim-nhanh input { border: 0; background: rgba(52, 73, 60, .06); box-shadow: var(--lom); height: 42px; }
.tim-nhanh input:focus { background: rgba(255, 255, 255, .85); box-shadow: var(--lom), 0 0 0 4px rgba(138, 165, 140, .25); }
.huy-hieu-cu { background: var(--kinh-dam); box-shadow: var(--noi); border: 1px solid var(--kinh-vien); }
.nut-menu { background: var(--kinh-dam); box-shadow: var(--noi); border-radius: 50%; }

/* Thẻ: kính mờ nổi */
.the {
    background: var(--kinh); border: 1px solid var(--kinh-vien); border-radius: 28px;
    backdrop-filter: var(--mo-kinh); -webkit-backdrop-filter: var(--mo-kinh);
    box-shadow: var(--noi); transition: box-shadow .3s, transform .3s;
}
.the:hover { box-shadow: var(--noi-cao); transform: translateY(-2px); }
.bieu-tuong { border-radius: 50%; color: #fff !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 10px rgba(52, 73, 60, .18); }
.bieu-tuong.reu { background: #6E9A7A; } .bieu-tuong.be { background: #C4A07A; } .bieu-tuong.dat { background: #C9795A; }
.bieu-tuong.vang { background: #D3A042; } .bieu-tuong.tham { background: #957487; }
.ds-dong li { border-bottom: 1px solid rgba(52, 73, 60, .07); padding: 11px 8px; border-radius: 14px; transition: background .2s; }
.ds-dong li:hover { background: rgba(255, 255, 255, .6); }

/* Khối chào và ô số liệu: nổi với viền sáng */
.chao { border-radius: 32px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 14px rgba(52, 73, 60, .14), 0 30px 60px rgba(52, 73, 60, .22); }
.o-so { border-radius: 28px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 10px rgba(52, 73, 60, .10), 0 22px 44px rgba(52, 73, 60, .14); }
.o-so:hover { transform: translateY(-4px); }
.o-so.kem { background: var(--kinh); border: 1px solid var(--kinh-vien); backdrop-filter: var(--mo-kinh); -webkit-backdrop-filter: var(--mo-kinh); box-shadow: var(--noi); }
.thanh .ray { background: rgba(52, 73, 60, .08); box-shadow: var(--lom); height: 12px; }
.thanh .ray i { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }

/* Nút: viên thuốc nổi */
.nut { background: linear-gradient(180deg, #58745F 0%, #46614F 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 10px rgba(52, 73, 60, .20), 0 12px 24px rgba(52, 73, 60, .14); }
.nut:hover { background: linear-gradient(180deg, #4E6A56 0%, #3C5545 100%); }
.nut.be { background: linear-gradient(180deg, #D4B48F 0%, #BF9A70 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 4px 10px rgba(169, 133, 93, .25), 0 12px 24px rgba(169, 133, 93, .18); }
.nut.vien { background: var(--kinh-dam); border: 1px solid var(--kinh-vien); box-shadow: var(--noi); }
.nut.vien:hover { background: #fff; }
.nut.trong-suot { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.nhan-mau { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }

/* Ô nhập: lõm vào trong */
.o-nhap, select.o-nhap { border: 0; background-color: rgba(52, 73, 60, .055); box-shadow: var(--lom); border-radius: 14px; }
.o-nhap:hover { background-color: rgba(52, 73, 60, .075); }
.o-nhap:focus { background-color: rgba(255, 255, 255, .9); box-shadow: var(--lom), 0 0 0 4px rgba(138, 165, 140, .25); }

/* Bảng: khối kính nổi, hàng tách nhẹ */
.bang-boc {
    border: 1px solid var(--kinh-vien); border-radius: 28px; background: var(--kinh);
    backdrop-filter: var(--mo-kinh); -webkit-backdrop-filter: var(--mo-kinh); box-shadow: var(--noi); padding: 8px;
}
table.bang { background: transparent; border-collapse: separate; border-spacing: 0 4px; }
.bang th { background: transparent; color: var(--reu-sang); padding: 10px 16px 6px; border: 0; }
.bang td { border-top: 0; border-bottom: 0; background: rgba(255, 255, 255, .45); padding: 12px 16px; transition: background .2s; }
.bang td:first-child { border-radius: 16px 0 0 16px; }
.bang td:last-child { border-radius: 0 16px 16px 0; }
.bang tbody tr:hover { background: transparent; }
.bang tbody tr:hover td { background: rgba(255, 255, 255, .88); }
.phan-trang a, .phan-trang span.hien-tai { border-radius: 50%; border: 1px solid var(--kinh-vien); background: var(--kinh-dam); box-shadow: var(--noi); }
.phan-trang span.hien-tai { background: linear-gradient(180deg, #58745F, #46614F); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 12px rgba(52, 73, 60, .2); }
.cap-thong-tin div { border-bottom-color: rgba(52, 73, 60, .07); }
.thong-bao { border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }

/* Đăng nhập: thẻ kính nổi trên nền có mảng màu */
.dn { padding: 16px; gap: 16px; }
.dn-trai { border-radius: 32px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 26px 60px rgba(30, 44, 35, .22); }
.dn-the { background: var(--kinh); border: 1px solid var(--kinh-vien); backdrop-filter: var(--mo-kinh); -webkit-backdrop-filter: var(--mo-kinh); border-radius: 32px; box-shadow: var(--noi-cao); }

@media (max-width: 980px) {
    .khung { padding: 10px; }
    .menu { top: 10px; left: 10px; height: calc(100vh - 20px); }
    .thanh-tren { top: 10px; }
    .dn { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { .the:hover, .o-so:hover { transform: none; } }
.menu .la-trang-tri { color: rgba(255, 255, 255, .03); }
.menu .la-trang-tri.a { right: -130px; }
.bang td:has(> .nguoi) { min-width: 220px; }
.bang td .ma { word-break: break-word; }
.bang td:first-child:has(> .chon-dong), .bang th:first-child:has(> [data-chon-tat]) { width: 36px; }
.bang .nguoi .ten { white-space: nowrap; }

/* ---------------- Sơ đồ tổ chức ---------------- */
.sd-cay { position: relative; margin-bottom: 22px; display: flex; flex-direction: column; align-items: center; }
.sd-goc {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 18px 26px; border-radius: 26px;
    color: #fff; background: linear-gradient(150deg, #4E6B57 0%, #34493C 100%); max-width: 720px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 14px rgba(52, 73, 60, .14), 0 24px 48px rgba(52, 73, 60, .22);
}
.sd-goc .phu { color: rgba(255, 255, 255, .72); }
.sd-goc .bieu-tuong { flex: none; background: rgba(255, 255, 255, .16) !important; }
.sd-goc-ten { font-family: 'Lora', serif; font-size: 18px; font-weight: 600; line-height: 1.3; }
.sd-goc .la-goc { position: absolute; right: -24px; bottom: -30px; width: 110px; height: 110px; color: rgba(255, 255, 255, .07); }
.sd-nhanh { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 34px; padding-top: 22px; width: 100%; }
.sd-nhanh::before { content: ""; position: absolute; top: -34px; left: 50%; width: 2px; height: 34px; background: linear-gradient(#5E7B66, #8AA58C); }
.sd-nhanh::after { content: ""; position: absolute; top: 0; left: 8%; right: 8%; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #8AA58C 12%, #8AA58C 88%, transparent); }
.sd-cn {
    position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 190px; max-width: 240px; flex: 1 1 190px;
    padding: 14px 18px; border-radius: 22px; text-decoration: none; color: var(--chu);
    background: var(--kinh); border: 1px solid var(--kinh-vien); box-shadow: var(--noi);
    backdrop-filter: var(--mo-kinh); -webkit-backdrop-filter: var(--mo-kinh); transition: transform .25s, box-shadow .25s, background .25s;
}
.sd-cn::before { content: ""; position: absolute; top: -22px; left: 50%; width: 2px; height: 22px; background: #8AA58C; }
.sd-cn:hover { transform: translateY(-3px); box-shadow: var(--noi-cao); }
.sd-cn.chon { color: #fff; background: linear-gradient(160deg, #D0AE88 0%, #B38E64 100%); border-color: rgba(255, 255, 255, .35); }
.sd-cn-ten { font-weight: 600; line-height: 1.35; }
.sd-cn-so { font-size: 12.5px; color: var(--mo); }
.sd-cn.chon .sd-cn-so { color: rgba(255, 255, 255, .85); }
.sd-cong-cu { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sd-cong-cu .o-nhap { width: 280px; max-width: 100%; height: 40px; }
.sd-dia-chi { margin: -6px 0 10px; }
.sd-nhom { margin-top: 18px; }
.sd-nhom-dau { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.sd-nhom-dau h4 { margin: 0; font-family: 'Lora', serif; font-size: 16px; font-weight: 600; color: var(--reu-dam); }
.sd-cham { width: 10px; height: 10px; border-radius: 50%; background: var(--xo); box-shadow: 0 0 0 4px rgba(138, 165, 140, .25); }
.sd-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.sd-pb {
    display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 20px; text-decoration: none; color: var(--chu);
    background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .85);
    box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(52, 73, 60, .05), 0 10px 22px rgba(52, 73, 60, .06); transition: transform .2s, box-shadow .2s, background .2s;
}
.sd-pb:hover { background: rgba(255, 255, 255, .92); transform: translateY(-2px); box-shadow: inset 0 1px 0 #fff, 0 14px 28px rgba(52, 73, 60, .12); }
.sd-pb-dau { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.sd-pb-ten { font-weight: 600; line-height: 1.35; }
.sd-pb-so {
    flex: none; min-width: 34px; height: 26px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center;
    font-size: 12.5px; font-weight: 700; color: #fff; background: linear-gradient(180deg, #6E9A7A, #557A61); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.sd-pb-ql { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--mo); line-height: 1.45; }
.sd-pb-ql .ic { flex: none; margin-top: 2px; color: var(--be-dam); }
.sd-to { display: flex; flex-wrap: wrap; gap: 6px; }
.sd-to span { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--be-nhat); color: #7A5F40; }
.sd-to span b { font-weight: 700; margin-left: 2px; }
.sd-to span.them { background: var(--xo-nhat); color: var(--reu); }
@media (max-width: 560px) { .sd-nhanh::after, .sd-cn::before { display: none; } .sd-cn { max-width: none; } }
[hidden] { display: none !important; }
.sd-nhanh { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.sd-cn { max-width: none; min-width: 0; padding: 13px 15px; }
.sd-cn-ten { font-size: 14px; }
/* Menu trái đậm hơn để chữ trắng nổi rõ */
.menu { background: linear-gradient(170deg, rgba(46, 68, 54, .97) 0%, rgba(30, 46, 36, .98) 100%); }
.menu-nhom > span { color: rgba(236, 228, 210, .62); }
.menu-muc { color: rgba(255, 255, 255, .92); }
.menu-muc:hover:not(.chon) { background: rgba(255, 255, 255, .09); }

/* ================= Thành phần nhập / sửa / xóa ================= */
/* Hộp thoại kính nổi */
dialog.hop {
    border: 1px solid var(--kinh-vien); border-radius: 28px; padding: 0; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
    background: rgba(255, 252, 246, .94); color: var(--chu); box-shadow: var(--noi-cao);
    backdrop-filter: var(--mo-kinh); -webkit-backdrop-filter: var(--mo-kinh); overflow: hidden;
}
dialog.hop.rong { width: min(1080px, calc(100vw - 24px)); }
dialog.hop.hep { width: min(480px, calc(100vw - 24px)); }
dialog.hop[open] { display: flex; flex-direction: column; animation: hop-mo .22s ease-out; }
dialog.hop::backdrop { background: rgba(38, 52, 43, .38); backdrop-filter: blur(4px); }
@keyframes hop-mo { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.hop form { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 34px); }
.hop-dau { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 12px; border-bottom: 1px solid rgba(52, 73, 60, .08); }
.hop-dau h3 { margin: 0; font-family: 'Lora', serif; font-size: 19px; font-weight: 600; color: var(--reu-dam); }
.hop-than { padding: 16px 22px; overflow: auto; }
.hop-chan { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 18px; border-top: 1px solid rgba(52, 73, 60, .08); }
.nut-dong { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: rgba(52, 73, 60, .07); color: var(--reu); }
.nut-dong:hover { background: rgba(52, 73, 60, .14); }
.hop.dang-nap .hop-than { opacity: .45; pointer-events: none; }

/* Lưới trường nhập */
.luoi-o { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.luoi-o.ba { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.luoi-o.bon { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.luoi-o .ca-dong { grid-column: 1 / -1; }
.truong { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.truong > label, .truong > .nhan-o { font-size: 12.5px; font-weight: 600; color: var(--reu-sang); }
.truong .bat-buoc::after { content: " *"; color: var(--dat); }
.truong textarea.o-nhap { min-height: 84px; resize: vertical; padding-top: 10px; }
.truong .goi-y { font-size: 12px; color: var(--mo); }
.o-chon { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.o-chon input { width: 18px; height: 18px; accent-color: var(--reu); }
.nhom-chon { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 8px 0; }
.tieu-de-phan { grid-column: 1 / -1; margin: 8px 0 0; padding-top: 10px; border-top: 1px dashed rgba(52, 73, 60, .14); font-size: 13px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--be-dam); }

/* Thanh công cụ trang danh sách */
.thanh-cong-cu { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.thanh-cong-cu .trai, .thanh-cong-cu .phai { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bo-loc.mo-rong { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) auto; }

/* Nút biểu tượng trong bảng */
.nut-ic {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--kinh-vien); cursor: pointer; display: inline-grid; place-items: center;
    background: var(--kinh-dam); color: var(--reu); box-shadow: inset 0 1px 0 #fff, 0 3px 8px rgba(52, 73, 60, .08); transition: transform .15s, background .15s;
}
.nut-ic:hover { transform: translateY(-1px); background: #fff; }
.nut-ic .ic { width: 16px; height: 16px; }
.nut-ic.do { color: var(--dat); }
.nut-ic.vang { color: #A87A1E; }
.nut-ic.reu { color: #fff; background: linear-gradient(180deg, #6E9A7A, #557A61); border-color: transparent; }
.nut-ic:disabled { opacity: .5; cursor: default; }
.cot-hd { white-space: nowrap; text-align: right; }
.cot-hd .nut-ic + .nut-ic { margin-left: 4px; }
.nut.do { background: linear-gradient(180deg, #CF8566, #B9694B); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 10px rgba(185, 105, 75, .25); }
.nut.nho { padding: 7px 14px; font-size: 13px; }
.bang td.so, .bang th.so { text-align: right; font-variant-numeric: tabular-nums; }
.bang td.giua, .bang th.giua { text-align: center; }
.bang .chon-dong, .bang [data-chon-tat] { width: 17px; height: 17px; accent-color: var(--reu); }
.bang-cuon { overflow: auto; }
.bang.gon td { padding: 8px 10px; font-size: 13px; }
.bang.gon th { padding: 8px 10px 4px; font-size: 11.5px; }
.bang tr.tong td { font-weight: 700; background: rgba(223, 231, 218, .75); }

/* Thông báo nổi */
.vung-bao { position: fixed; right: 18px; bottom: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.bao {
    padding: 13px 18px; border-radius: 18px; font-size: 14px; font-weight: 500; color: #fff; animation: bao-vao .25s ease-out;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 12px 30px rgba(30, 44, 35, .25); background: linear-gradient(180deg, #58745F, #46614F);
}
.bao.loi { background: linear-gradient(180deg, #CF8566, #B5654A); }
.bao.an { opacity: 0; transform: translateY(8px); transition: .35s; }
@keyframes bao-vao { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Thẻ thống kê nhỏ trong trang */
.the-nho-hang { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.the-nho { padding: 14px 16px; border-radius: 20px; background: var(--kinh); border: 1px solid var(--kinh-vien); box-shadow: var(--noi); }
.the-nho .nhan { font-size: 12.5px; color: var(--mo); }
.the-nho .so { font-family: 'Lora', serif; font-size: 24px; font-weight: 600; color: var(--reu-dam); }
.tab-hang { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(52, 73, 60, .06); box-shadow: var(--lom); width: fit-content; margin-bottom: 14px; }
.tab-hang a, .tab-hang button { border: 0; background: transparent; cursor: pointer; padding: 8px 16px; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--reu); text-decoration: none; }
.tab-hang .chon { background: #fff; box-shadow: inset 0 1px 0 #fff, 0 4px 10px rgba(52, 73, 60, .12); color: var(--reu-dam); }
.tab-danh-muc { max-width: 100%; border-radius: 18px; }
.tab-danh-muc a:hover { background: rgba(255, 255, 255, .65); }
.tab-danh-muc a:focus-visible { outline: 2px solid var(--reu); outline-offset: 2px; }
.phieu-luong { margin-bottom: 20px; }
@media print {
    .menu, .thanh-tren, .an-khi-in, .tab-danh-muc { display: none !important; }
    .khung, .chinh { display: block !important; margin: 0 !important; padding: 0 !important; }
    .noi-dung { padding: 0 !important; }
    body, .the { background: white !important; color: black !important; box-shadow: none !important; }
    .phieu-luong { break-after: page; border: 0; }
    .phieu-luong:last-child { break-after: auto; }
    .phieu-luong .luoi-o { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) { .luoi-o, .luoi-o.ba, .luoi-o.bon { grid-template-columns: 1fr; } }

/* ---------------- Cấu hình hệ thống ---------------- */
.ch-tabs { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; padding: 6px; margin-bottom: 16px; border-radius: 22px; background: var(--kinh); border: 1px solid var(--kinh-vien); box-shadow: var(--noi); scrollbar-width: thin; }
.ch-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; padding: 7px 14px 7px 7px; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--reu); background: transparent; white-space: nowrap; transition: background .2s; }
.ch-tab .chip { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.ch-tab .chip .ic { width: 15px; height: 15px; }
.ch-tab:hover { background: rgba(255, 255, 255, .6); }
.ch-tab.chon { background: #fff; color: var(--reu-dam); box-shadow: inset 0 1px 0 #fff, 0 4px 12px rgba(52, 73, 60, .12); }
.ch-nhom { margin: 18px 0 10px; font-family: 'Lora', serif; font-size: 16px; font-weight: 600; color: var(--reu-dam); }
.ch-nhom:first-child { margin-top: 0; }
.ch-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px 16px; }
.ch-o { display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .85); }
.ch-o.rong { grid-column: 1 / -1; }
.ch-nhan { font-size: 13.5px; font-weight: 600; color: var(--chu); }
.ch-ma { font-size: 11px; color: var(--mo); font-family: ui-monospace, Consolas, monospace; }
.ch-bat { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.ch-bat input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cong-tac { flex: none; width: 42px; height: 24px; border-radius: 999px; background: rgba(52, 73, 60, .18); box-shadow: var(--lom); position: relative; transition: background .2s; }
.cong-tac::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .2); transition: transform .2s; }
.ch-bat input:checked + .cong-tac { background: linear-gradient(180deg, #6E9A7A, #557A61); }
.ch-bat input:checked + .cong-tac::after { transform: translateX(18px); }
.ch-bat input:focus-visible + .cong-tac { outline: 3px solid rgba(138, 165, 140, .45); outline-offset: 2px; }
.ch-luu { display: flex; justify-content: flex-end; margin-top: 18px; position: sticky; bottom: 12px; }
.ch-moc { display: inline-flex; align-items: center; gap: 4px; margin: 2px 6px 2px 0; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--be-nhat); font-size: 12.5px; }
.ch-xoa { border: 0; background: transparent; cursor: pointer; color: var(--dat); font-size: 15px; line-height: 1; width: 20px; height: 20px; border-radius: 50%; }
.ch-xoa:hover { background: rgba(194, 118, 87, .15); }
.ch-bieu-thue { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.ch-bt { padding: 12px; border-radius: 18px; background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .85); }
.ch-bt-dau { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ch-chu-thich { display: grid; gap: 4px; font-size: 12.5px; color: var(--chu-2); margin-bottom: 12px; }
.ch-gt { max-width: 280px; word-break: break-word; }
#btDong .o-nhap { height: 36px; }
.nut-tt { border: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: rgba(52, 73, 60, .08); color: var(--mo); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.nut-tt.bat { background: var(--xo-nhat); color: var(--reu-dam); }
.nut-tt:hover { filter: brightness(.96); }

/* ---------------- Định biên ---------------- */
.db-cuon { max-height: calc(100vh - 300px); }
.db-bang thead th { position: sticky; top: 0; z-index: 2; background: rgba(250, 247, 240, .97); }
.db-bang thead tr:nth-child(2) th { top: 34px; }
.db-bang .db-ghim { position: sticky; left: 0; z-index: 1; min-width: 220px; max-width: 260px; background: rgba(250, 247, 240, .97) !important; }
.db-bang thead .db-ghim { z-index: 3; }
.db-nhom { border-left: 2px solid rgba(52, 73, 60, .1); white-space: normal; min-width: 150px; }
.db-o { width: 46px; height: 30px; text-align: center; border: 0; border-radius: 10px; font: inherit; font-weight: 600; background: transparent; color: var(--chu); }
.db-o:not(:disabled) { background: rgba(52, 73, 60, .06); box-shadow: var(--lom); }
.db-o.doi { background: #FFF1C9 !important; box-shadow: inset 0 0 0 2px var(--vang); }
.db-tt { display: inline-block; min-width: 32px; padding: 3px 8px; border-radius: 999px; font-weight: 700; }
.db-tt.du { background: var(--xo-nhat); color: var(--reu-dam); }
.db-tt.thieu { background: #FBEBC8; color: #8A6514; }
.db-tt.vuot { background: #F6DCD1; color: #A2512F; }
.db-trong { color: var(--mo); }
.db-them { border: 1px dashed rgba(52, 73, 60, .3); background: transparent; color: var(--reu); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 16px; }
.db-them:hover { background: #fff; }
.chu-thich-db { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 10px; font-size: 12.5px; color: var(--chu-2); }
.chu-thich-db span { display: inline-flex; align-items: center; gap: 6px; }
.o-mau { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.o-mau.du { background: var(--xo-nhat); } .o-mau.thieu { background: #FBEBC8; } .o-mau.vuot { background: #F6DCD1; }
.tt-hien-tai { min-height: 42px; display: flex; align-items: center; padding: 8px 14px; border-radius: 14px; background: var(--be-nhat); color: #6E5536; font-size: 13.5px; }
.hang-in { display: flex; gap: 10px; flex-wrap: wrap; }
.hang-in .o-nhap { max-width: 320px; }
.ch-kiem-tra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }

/* ---------------- Menu nhiều cấp ---------------- */
.menu-cuon { display: flex; flex-direction: column; gap: 2px; }
details.menu-nhom { padding: 0; margin: 0; }
details.menu-nhom > summary { list-style: none; cursor: pointer; }
details.menu-nhom > summary::-webkit-details-marker { display: none; }
.menu-muc .tien-do { margin-left: auto; font-size: 10.5px; font-weight: 600; color: rgba(236, 228, 210, .55); padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .06); }
.menu-muc .mui { width: 14px; height: 14px; flex: none; opacity: .6; transition: transform .2s; }
details[open] > summary .mui { transform: rotate(90deg); }
.menu-muc.mo { background: rgba(255, 255, 255, .07); }
.menu-con { display: flex; flex-direction: column; gap: 1px; margin: 4px 0 8px 22px; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .12); }
.menu-con-nhom { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; }
.menu-con-nhom > span { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: rgba(236, 228, 210, .5); font-weight: 600; padding: 4px 10px 2px; }
.menu-la { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; font-size: 13px; color: rgba(255, 255, 255, .88); text-decoration: none; transition: background .15s; }
.menu-la:hover { background: rgba(255, 255, 255, .08); }
.menu-la.chon { background: rgba(255, 252, 246, .94); color: var(--reu-dam); font-weight: 600; }
.menu-la.chua { color: rgba(255, 255, 255, .5); }
.menu-la .cho { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: rgba(211, 160, 66, .7); flex: none; }
.bo-loc.mo-rong > button[type="submit"] { justify-self: start; min-width: 120px; }

/* ---------------- Quyết định & hợp đồng ---------------- */
.nhom-nut { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tieu-muc { font-size: 15px; margin: 20px 0 10px; padding-top: 14px; border-top: 1px dashed var(--vien, rgba(0,0,0,.12)); color: var(--reu-dam, inherit); display: flex; align-items: center; }
.luoi-o .ca-hai { grid-column: span 2; }
.o-kem-nut { display: flex; gap: 6px; align-items: stretch; }
.o-kem-nut .o-nhap { flex: 1; min-width: 0; }
.o-kem-nut select.o-nhap { flex: 0 0 92px; }
.hang-chon { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 8px; }
.ds-mau-in { display: grid; gap: 8px; }
.ds-mau-in a { display: flex; align-items: center; gap: 8px; }
dialog.hop.chi-xem [data-nut-luu] { display: none; }
@media (max-width: 760px) { .luoi-o .ca-hai { grid-column: auto; } }
.bang-qd td.khong-xuong { white-space: nowrap; }
.bang-qd td.cot-loai { min-width: 150px; }
.bang-qd td, .bang-qd th { vertical-align: middle; }
:root .bang-phan-ca th, :root .bang-phan-ca td { min-width: 76px; }
:root .bang-phan-ca th:nth-child(2), :root .bang-phan-ca td:nth-child(2) { min-width: 220px; }
:root .bang-phan-ca th:first-child, :root .bang-phan-ca td:first-child { min-width: 42px; }
.bang-phan-ca .o-nhap { width: 72px; min-width: 72px; padding: 8px 6px; }
.bang-phan-ca .o-nhap.pc-da-doi { background: #f0e5d5; box-shadow: inset 0 0 0 2px #a9855d; }

/* Xem lại dữ liệu nhập Excel */
.dong-loi td { background: color-mix(in srgb, var(--dat, #c0392b) 9%, transparent); }
.chu-loi { color: var(--dat, #c0392b); font-weight: 600; white-space: normal; min-width: 220px; }
.chu-ok { color: var(--reu, #2e7d32); }
.bao-loi { color: var(--dat, #c0392b); font-weight: 600; }
.bao-ok { color: var(--reu, #2e7d32); font-weight: 600; }

/* Chọn ngôn ngữ */
.chon-ngon-ngu { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--kem, #f5f1ea); margin-right: 10px; vertical-align: middle; }
.chon-ngon-ngu a { padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: inherit; opacity: .7; }
.chon-ngon-ngu a.chon { background: var(--reu, #4A6553); color: #fff; opacity: 1; }
.dn-the .chon-ngon-ngu { float: right; }
/* Trang ngôn ngữ */
.bang-dich td { vertical-align: top; }
.bang-dich .chuoi-goc { white-space: pre-wrap; word-break: break-word; }
.o-dich { display: flex; gap: 6px; align-items: flex-start; }
.o-dich textarea { flex: 1; min-height: 34px; resize: vertical; }
.noi-dong { display: inline; }
tr.dang-chon td { background: color-mix(in srgb, var(--reu, #4A6553) 8%, transparent); }
/* Cấu hình nâng cao: logo công ty */
.hang-logo{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin-bottom:12px}
.logo-xem{max-height:64px;max-width:200px;border:1px solid var(--vien,#ddd);border-radius:6px;padding:4px;background:#fff}

/* Quản lý công ty: nhật ký tiến độ việc chạy nền */
.nhat-ky-viec { margin: 8px 0 0; padding-left: 0; list-style: none; font: 13px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--chu-2); }
.nhat-ky-viec li { padding: 2px 0; border-bottom: 1px dashed rgba(0, 0, 0, .06); }
[data-ket-qua] { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--vang-nhat); font-weight: 600; }
/* Cấu hình nâng cao: form thông tin công ty sửa trực tiếp */
.form-cong-ty { margin-top: 14px; }
.form-cong-ty .luoi-o { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 16px; }
.form-cong-ty label { display: block; font-size: 12.5px; font-weight: 600; color: var(--chu-2); margin-bottom: 4px; }
.hang-nut { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
/* Các khung (.the) xếp liền nhau thì cách nhau, không dính */
.the + .the, .the + section.the, section.the + .the { margin-top: 14px; }
/* Bảng dài: ô tìm nhanh (public/js/bang-dai.js) */
.bang-tim { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; flex-wrap: wrap; }
.bang-tim .o-nhap { max-width: 320px; }
/* Nút Xóa / Khóa / Đóng: chữ đỏ (public/js/app.js gắn lớp chu-do) */
:root { --do-nguy: #C62828; --do-nguy-nhat: #FDECEC; }
.chu-do, .nut.vien.chu-do, .nut-dong.chu-do, .phan-trang a.chu-do { color: var(--do-nguy) !important; }
.nut.chu-do:not(.vien) { background: var(--do-nguy-nhat); box-shadow: inset 0 0 0 1px rgba(198, 40, 40, .28); }
.nut.chu-do:hover { background: var(--do-nguy) !important; color: #fff !important; }
.nut-dong.chu-do:hover { background: var(--do-nguy-nhat); }
