:root {
  --nen: #f2f5f9; --mat: #ffffff; --chu: #1c2430; --phu: #5d6878; --vien: #dfe4ea;
  --menu: #123a6b; --menu-dam: #0d2c52; --menu-chu: #cfdcec; --chinh: #1665c1; --chinh-dam: #0f4f9a; --chinh-nhat: #e8f1fc;
  --xanh: #1a9a55; --do: #d43a3a; --xam: #8a94a3; --vang: #e09b0d; --cam: #f07b22; --tim: #7b4ddb;
  --bo: 10px; --bong: 0 1px 3px rgba(20, 32, 46, .08);
  font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; color: var(--chu);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--nen); }
[hidden] { display: none !important; }
a { color: var(--chinh); }
h1 { font-size: 18px; margin: 0; font-weight: 600; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 600; }

/* ---------- Đăng nhập ---------- */
.dang-nhap { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 20% 20%, #2a6fc0 0, transparent 40%), radial-gradient(circle at 80% 80%, #f07b22 0, transparent 35%), linear-gradient(135deg, #0d2c52, #123a6b); }
.the-dang-nhap { background: var(--mat); padding: 32px; border-radius: 16px; width: 100%; max-width: 380px; display: grid; gap: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.logo-dn { width: 110px; height: auto; margin: 0 auto 2px; display: block; }
.ten-ht { text-align: center; font-size: 24px; font-weight: 800; color: #123a6b; letter-spacing: 2px; }
.khau-hieu { text-align: center; margin: -8px 0 0; color: var(--cam); font-weight: 600; }
.mo-ta { margin: 0 0 8px; color: var(--phu); text-align: center; font-size: 11px; font-weight: 600; }
.goi-y { font-size: 12px; color: var(--phu); background: var(--chinh-nhat); padding: 8px 10px; border-radius: 6px; }

/* ---------- Bố cục ---------- */
.ung-dung { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.menu { background: var(--menu); color: var(--menu-chu); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 20; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; padding: 14px 16px; }
.logo img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; flex: none; }
.logo div { display: grid; line-height: 1.25; min-width: 0; }
.logo b { font-size: 15px; letter-spacing: 1px; }
.logo span { font-size: 12px; color: #c9d3df; }
.logo small { font-size: 11px; color: #8ea3bd; }
nav { display: flex; flex-direction: column; flex: 1; overflow: auto; padding: 4px 0; }
nav a { color: var(--menu-chu); text-decoration: none; padding: 9px 18px; border-left: 3px solid transparent; display: flex; align-items: center; gap: 10px; }
nav a i { font-style: normal; width: 20px; text-align: center; }
nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
nav a.dang-xem { background: rgba(255,255,255,.1); color: #fff; border-left-color: var(--cam); }
.menu-con summary { color: var(--menu-chu); padding: 9px 18px; border-left: 3px solid transparent; display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.menu-con summary::-webkit-details-marker { display: none; }
.menu-con summary i { font-style: normal; width: 20px; text-align: center; }
.menu-con summary::after { content: "▸"; margin-left: auto; transition: transform .15s; }
.menu-con[open] summary::after { transform: rotate(90deg); }
.menu-con summary:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu-con a { padding-left: 34px; }
.nhom-menu { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #8ea3bd; padding: 14px 18px 4px; }
.dem { margin-left: auto; background: var(--do); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 7px; font-weight: 700; }
.nguoi-dung { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.toi-nut { display: flex; gap: 10px; align-items: center; background: none; border: 0; color: #fff; cursor: pointer; padding: 0; text-align: left; width: 100%; font: inherit; }
.toi-nut b { display: block; } .toi-nut small { color: #8ea3bd; }
.lien-ket-nho { margin-top: 8px; }
.nut-link { background: none; border: 0; color: #8fc1ff; padding: 0; cursor: pointer; font: inherit; }
main { min-width: 0; display: flex; flex-direction: column; }
.thanh-tren { display: flex; align-items: center; gap: 10px; padding: 12px 24px; background: var(--mat); border-bottom: 1px solid var(--vien); position: sticky; top: 0; z-index: 10; }
.thanh-tren h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nut-menu { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; padding: 0 4px; }
.ket-noi { width: 10px; height: 10px; border-radius: 50%; background: var(--xam); flex: none; }
.ket-noi.on { background: var(--xanh); }
.chip-tt, .chip-xu { border: 1px solid var(--vien); background: #fff; border-radius: 20px; padding: 5px 12px; font: inherit; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--chu); }
.chip-xu { background: #fff8e6; border-color: #f3d58a; }
.noi-dung { padding: 20px 24px; display: grid; gap: 16px; align-content: start; flex: 1; min-height: 0; }

/* ---------- Thành phần ---------- */
.the { background: var(--mat); border: 1px solid var(--vien); border-radius: var(--bo); padding: 16px; box-shadow: var(--bong); min-width: 0; }
.the-dau { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.the-dau h2 { margin: 0; flex: 1; }
.luoi-the { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.hai-cot { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cot { display: grid; gap: 16px; min-width: 0; }
.cong-cu { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cong-cu .gian { flex: 1; }
input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid var(--vien); border-radius: 6px; background: #fff; color: var(--chu); min-width: 0; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc5f5; border-color: var(--chinh); }
label { display: grid; gap: 4px; font-size: 13px; color: var(--phu); }
label.ngang { display: flex; align-items: center; gap: 6px; color: var(--chu); }
.nut { font: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--vien); background: #fff; cursor: pointer; color: var(--chu); white-space: nowrap; }
.nut:hover { background: #f0f3f7; }
.nut.chinh { background: var(--chinh); border-color: var(--chinh); color: #fff; }
.nut.chinh:hover { background: var(--chinh-dam); }
.nut.cam { background: var(--cam); border-color: var(--cam); color: #fff; }
.nut.nguy { color: var(--do); border-color: #f0c4c4; }
.nut.rong { width: 100%; padding: 10px; justify-content: center; }
.nut.nho { padding: 3px 9px; font-size: 12px; }
.nut:disabled { opacity: .5; cursor: default; }
.loi { color: var(--do); min-height: 1em; font-size: 13px; }
.nho { font-size: 12px; color: var(--phu); }
.rong-trong { color: var(--phu); text-align: center; padding: 24px; }
.the-tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: #eef2f7; color: var(--phu); white-space: nowrap; }
.the-tag.do { background: #fde8e8; color: var(--do); } .the-tag.xanh { background: #e3f6ec; color: var(--xanh); } .the-tag.vang { background: #fff4d6; color: #a06c00; }

.bang-cuon { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--vien); vertical-align: middle; }
th { font-size: 12px; color: var(--phu); font-weight: 600; background: #f8fafc; position: sticky; top: 0; white-space: nowrap; }
tbody tr.bam { cursor: pointer; } tbody tr.bam:hover { background: #f5f9ff; }
td.so, th.so { text-align: right; }

/* ---------- Ảnh đại diện + trạng thái ---------- */
.anh { --c: 36px; width: var(--c); height: var(--c); border-radius: 50%; flex: none; position: relative; display: inline-grid; place-items: center;
  font-weight: 700; color: #fff; font-size: calc(var(--c) * .4); background: var(--chinh); background-size: cover; background-position: center; }
.anh.nho { --c: 26px; } .anh.lon { --c: 72px; } .anh.vua { --c: 44px; }
.anh[data-tt]::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: calc(var(--c) * .3); height: calc(var(--c) * .3); min-width: 9px; min-height: 9px; border-radius: 50%; border: 2px solid #fff; background: var(--xam); }
.anh[data-tt="dang_lam"]::after { background: var(--xanh); } .anh[data-tt="hop"]::after, .anh[data-tt="ban"]::after { background: var(--do); }
.anh[data-tt="nghi_trua"]::after, .anh[data-tt="cong_tac"]::after, .anh[data-tt="nghi_phep"]::after { background: var(--vang); }
.anh[data-tt="offline"]::after { background: #c3cad3; }
.cham-tt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #c3cad3; margin-right: 5px; }
.cham-tt.dang_lam { background: var(--xanh); } .cham-tt.hop, .cham-tt.ban { background: var(--do); } .cham-tt.nghi_trua, .cham-tt.cong_tac, .cham-tt.nghi_phep { background: var(--vang); }
.nguoi-dong { display: flex; gap: 10px; align-items: center; min-width: 0; }
.nguoi-dong > div { min-width: 0; }
.nguoi-dong b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Sảnh chính ---------- */
.chao { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; color: #fff; border: 0;
  background: linear-gradient(120deg, #123a6b, #1665c1 60%, #2a85e0); }
.chao h2 { font-size: 22px; margin: 0 0 4px; }
.chao p { margin: 0; color: #d7e6f8; }
.chao .so-lieu-nho { display: flex; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.chao .so-lieu-nho div { background: rgba(255,255,255,.12); padding: 6px 12px; border-radius: 8px; }
.chao .so-lieu-nho b { font-size: 18px; display: block; }
.nut-vao-lam { font: inherit; border: 0; cursor: pointer; border-radius: 50%; width: 132px; height: 132px; color: #fff; font-weight: 800; font-size: 16px;
  background: radial-gradient(circle at 30% 30%, #ffb15c, #f07b22 60%, #c9560a); box-shadow: 0 0 0 8px rgba(255,255,255,.15), 0 10px 25px rgba(0,0,0,.25);
  display: grid; place-items: center; line-height: 1.2; animation: nhip 2.2s infinite; }
.nut-vao-lam span { font-size: 34px; display: block; }
@keyframes nhip { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.da-vao { text-align: center; background: rgba(255,255,255,.12); padding: 12px 16px; border-radius: 12px; min-width: 200px; }
.da-vao .que-muc { font-size: 20px; font-weight: 800; color: #ffd36b; }
.van-phong { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.phong { min-width: 0; overflow: hidden; border-radius: 12px; padding: 12px; background: #f7f9fc; border: 2px solid var(--vien); cursor: pointer; display: grid; gap: 8px; align-content: start; min-height: 110px; transition: transform .1s; }
.phong:hover { transform: translateY(-2px); border-color: var(--chinh); }
.phong.cua-toi { border-color: var(--cam); background: #fff7ef; }
.phong-dau { display: flex; align-items: center; gap: 8px; }
.phong-dau .bt { font-size: 22px; }
.phong-dau b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phong-nguoi { display: flex; flex-wrap: wrap; gap: 4px; }
.phong-nguoi .anh { --c: 28px; font-size: 11px; }
.phong-nguoi .anh[data-tt="offline"] { opacity: .35; filter: grayscale(1); }
.ds-gon { display: grid; gap: 10px; }
.muc-tb { border-left: 3px solid var(--chinh); padding: 4px 10px; cursor: pointer; }
.muc-tb.quan_trong { border-left-color: var(--do); }
.muc-tb.chua-doc b::before { content: "● "; color: var(--cam); }
.xep-hang-dong { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--vien); }
.xep-hang-dong:last-child { border-bottom: 0; }
.hang { width: 26px; text-align: center; font-weight: 800; color: var(--phu); flex: none; }
.hang.h1 { color: #d4a106; font-size: 18px; } .hang.h2 { color: #8a99ab; font-size: 16px; } .hang.h3 { color: #b0703b; font-size: 15px; }
.xep-hang-dong .diem { margin-left: auto; font-weight: 700; color: #a06c00; white-space: nowrap; }
.he-thong-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.o-he-thong { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; border: 1px solid var(--vien); background: #fff; text-decoration: none; color: var(--chu); box-shadow: var(--bong); }
.o-he-thong:hover { border-color: var(--chinh); background: #f8fbff; }
.o-he-thong .bt { font-size: 28px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: var(--chinh-nhat); flex: none; }
.o-he-thong b { display: block; }
.khen-the { background: linear-gradient(135deg, #fff8ec, #fff); border: 1px solid #f6dfb8; border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; }
.khen-the .loai { font-weight: 700; color: #b5600e; }
.sinh-nhat { background: linear-gradient(135deg, #fde7f3, #fff); border-color: #f5c6de; }

/* ---------- Trò chuyện ---------- */
.noi-dung.chat-mode { padding: 0; gap: 0; }
.chat { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - 57px); background: #fff; }
.ds-kenh { border-right: 1px solid var(--vien); display: flex; flex-direction: column; min-height: 0; }
.ds-kenh .tim { padding: 10px; border-bottom: 1px solid var(--vien); display: flex; gap: 6px; }
.ds-kenh .tim input { flex: 1; }
.ds-kenh .cuon { overflow: auto; flex: 1; }
.nhom-kenh { font-size: 11px; text-transform: uppercase; color: var(--phu); padding: 10px 14px 4px; letter-spacing: .5px; }
.muc-kenh { display: flex; gap: 10px; align-items: center; padding: 8px 14px; cursor: pointer; border-left: 3px solid transparent; }
.muc-kenh:hover { background: #f5f8fc; }
.muc-kenh.dang-xem { background: var(--chinh-nhat); border-left-color: var(--chinh); }
.muc-kenh .bt { width: 36px; height: 36px; border-radius: 10px; background: #eef2f7; display: grid; place-items: center; font-size: 18px; flex: none; }
.muc-kenh .tt { flex: 1; min-width: 0; }
.muc-kenh .tt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.muc-kenh .tt small { display: block; color: var(--phu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muc-kenh.co-moi .tt b, .muc-kenh.co-moi .tt small { font-weight: 700; color: var(--chu); }
.khung-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-dau { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--vien); }
.chat-dau .tt { flex: 1; min-width: 0; }
.chat-dau .tt b { display: block; }
.chat-dau .quay-lai { display: none; }
.ds-tin { flex: 1; overflow: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; background: #f7f9fc; }
.tin { display: flex; gap: 8px; align-items: flex-end; max-width: 78%; position: relative; }
.tin.cua-toi { align-self: flex-end; flex-direction: row-reverse; }
.tin .anh { --c: 30px; font-size: 12px; }
.tin .an-anh { visibility: hidden; }
.bong-tin { background: #fff; border: 1px solid var(--vien); border-radius: 14px; padding: 7px 11px; min-width: 0; overflow-wrap: anywhere; position: relative; }
.tin.cua-toi .bong-tin { background: #dcebff; border-color: #c4dcfb; }
.bong-tin .ten { font-size: 12px; font-weight: 700; color: var(--chinh); margin-bottom: 2px; }
.bong-tin .nd { white-space: pre-wrap; }
.bong-tin .gio { font-size: 11px; color: var(--phu); margin-top: 2px; text-align: right; }
.bong-tin.da-xoa { font-style: italic; color: var(--phu); background: transparent; }
.bong-tin .tra-loi { border-left: 3px solid var(--chinh); background: rgba(0,0,0,.04); padding: 3px 8px; border-radius: 4px; font-size: 12px; margin-bottom: 4px; color: var(--phu); }
.bong-tin img.anh-tin { max-width: 260px; max-height: 260px; border-radius: 8px; display: block; cursor: zoom-in; }
.tep-tin { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(0,0,0,.04); border-radius: 8px; text-decoration: none; color: var(--chu); }
.cam-xuc { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.cam-xuc button { border: 1px solid var(--vien); background: #fff; border-radius: 12px; padding: 0 7px; font-size: 12px; cursor: pointer; }
.cam-xuc button.toi { border-color: var(--chinh); background: var(--chinh-nhat); }
.thao-tac-tin { position: absolute; top: -14px; right: 6px; display: none; background: #fff; border: 1px solid var(--vien); border-radius: 8px; box-shadow: var(--bong); z-index: 2; }
.tin.cua-toi .thao-tac-tin { right: auto; left: 6px; }
.tin:hover .thao-tac-tin, .tin.mo-tt .thao-tac-tin { display: flex; }
.thao-tac-tin button { background: none; border: 0; cursor: pointer; padding: 3px 6px; font-size: 14px; }
.ngay-chia { align-self: center; font-size: 12px; color: var(--phu); background: #e9eef5; padding: 2px 10px; border-radius: 10px; margin: 10px 0 6px; }
.tin + .tin.lien { margin-top: -0px; }
.tin-ghim-ico { font-size: 11px; color: var(--cam); }
.dang-go { font-size: 12px; color: var(--phu); padding: 2px 16px; min-height: 18px; background: #f7f9fc; }
.soan { border-top: 1px solid var(--vien); padding: 8px 12px; display: grid; gap: 6px; }
.chi-xem { border-top: 1px solid var(--vien); padding: 12px; text-align: center; font-size: 13px; color: var(--phu); }
.soan .hang-soan { display: flex; gap: 6px; align-items: flex-end; }
.soan textarea { flex: 1; resize: none; max-height: 140px; min-height: 38px; border-radius: 18px; padding: 8px 14px; }
.soan .tra-loi-cho, .soan .tep-cho { font-size: 12px; background: var(--chinh-nhat); padding: 4px 10px; border-radius: 6px; display: flex; gap: 8px; align-items: center; }
.soan .tra-loi-cho span, .soan .tep-cho span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nut-tron { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #eef2f7; cursor: pointer; font-size: 17px; flex: none; }
.nut-tron.chinh { background: var(--chinh); color: #fff; }
.bang-emoji { display: flex; gap: 2px; flex-wrap: wrap; }
.bang-emoji button { font-size: 20px; background: none; border: 0; cursor: pointer; padding: 4px; border-radius: 6px; }
.bang-emoji button:hover { background: #eef2f7; }
.nhac { color: var(--chinh); font-weight: 600; }
.tin.nhac-toi .bong-tin { box-shadow: 0 0 0 2px #ffcf8a; }
.goi-y-nhac { position: absolute; bottom: 100%; left: 12px; background: #fff; border: 1px solid var(--vien); border-radius: 8px; box-shadow: var(--bong); max-height: 220px; overflow: auto; min-width: 220px; z-index: 5; }
.goi-y-nhac div { padding: 6px 10px; cursor: pointer; } .goi-y-nhac div.chon, .goi-y-nhac div:hover { background: var(--chinh-nhat); }

/* ---------- Thông báo ---------- */
.tb-the { display: grid; gap: 8px; }
.tb-the.chua-doc { border-left: 4px solid var(--cam); }
.tb-the.quan_trong { border-left: 4px solid var(--do); }
.tb-the .nd { white-space: pre-wrap; line-height: 1.5; }
.tb-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--phu); }
.binh-chon { display: grid; gap: 6px; }
.lc-bc { position: relative; border: 1px solid var(--vien); border-radius: 8px; padding: 7px 10px; cursor: pointer; overflow: hidden; background: #fff; text-align: left; font: inherit; display: flex; gap: 8px; }
.lc-bc i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--chinh-nhat); z-index: 0; }
.lc-bc span, .lc-bc b { position: relative; z-index: 1; } .lc-bc span { flex: 1; }
.lc-bc.da-chon { border-color: var(--chinh); font-weight: 600; }
.tien-do { height: 8px; border-radius: 4px; background: var(--vien); overflow: hidden; }
.tien-do i { display: block; height: 100%; background: var(--xanh); }

/* ---------- Gắn kết ---------- */
.tab { display: flex; gap: 4px; border-bottom: 1px solid var(--vien); flex-wrap: wrap; }
.tab button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 14px; cursor: pointer; font: inherit; color: var(--phu); }
.tab button.chon { color: var(--chinh); border-bottom-color: var(--chinh); font-weight: 600; }
.cau-do { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px dashed var(--vien); }
.cau-do:last-child { border-bottom: 0; }
.cau-do .lc { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.cau-do .lc button { text-align: left; font: inherit; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--vien); background: #fff; cursor: pointer; }
.cau-do .lc button:hover:not(:disabled) { border-color: var(--chinh); background: #f8fbff; }
.cau-do .lc button.dung { background: #e3f6ec; border-color: var(--xanh); font-weight: 600; }
.cau-do .lc button.sai { background: #fde8e8; border-color: var(--do); }
.cau-do .lc button:disabled { cursor: default; }
.giai-thich { font-size: 13px; background: #f4f8fd; padding: 8px 10px; border-radius: 6px; }
.huy-hieu-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.huy-hieu { text-align: center; padding: 12px 8px; border-radius: 12px; border: 1px solid var(--vien); background: #fff; }
.huy-hieu .bt { font-size: 34px; }
.huy-hieu b { display: block; font-size: 13px; }
.huy-hieu.chua { opacity: .4; filter: grayscale(1); }
.tam-trang { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tam-trang button { font-size: 30px; background: #f4f6fa; border: 2px solid transparent; border-radius: 12px; padding: 6px 10px; cursor: pointer; display: grid; justify-items: center; }
.tam-trang button small { font-size: 11px; color: var(--phu); }
.tam-trang button.chon { border-color: var(--cam); background: #fff3e6; }
.que { text-align: center; padding: 18px; border-radius: 14px; background: linear-gradient(160deg, #fff6e5, #ffe7c4); border: 2px solid #f1c27d; }
.que .muc { font-size: 26px; font-weight: 800; color: #b5470b; letter-spacing: 1px; }
.que .loi { color: #6b3a10; font-size: 15px; margin-top: 6px; }
.ds-thuong { display: grid; gap: 4px; margin-top: 10px; }
.ds-thuong div { display: flex; justify-content: space-between; background: #fff8e6; padding: 5px 10px; border-radius: 6px; }

/* ---------- Hộp thoại ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog.rong { width: min(900px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(10, 20, 35, .45); }
.hop-dau { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--vien); position: sticky; top: 0; background: #fff; z-index: 1; }
.hop-dau h2 { margin: 0; flex: 1; }
.hop-than { padding: 16px 18px; display: grid; gap: 12px; }
.hop-chan { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--vien); position: sticky; bottom: 0; background: #fff; }
.luoi-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.luoi-form .ca-dong { grid-column: 1 / -1; }
.chon-nhieu { max-height: 220px; overflow: auto; border: 1px solid var(--vien); border-radius: 6px; padding: 6px 10px; display: grid; gap: 4px; }
.ho-so-dau { display: flex; gap: 16px; align-items: center; }
.ho-so-dau h2 { margin: 0; font-size: 18px; }

/* ---------- Thông báo nổi ---------- */
.thong-bao-noi { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; max-width: min(380px, calc(100vw - 32px)); }
.thong-bao-noi > div { background: #1c2430; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); cursor: pointer; animation: vao .2s; }
.thong-bao-noi > div.loi-tb { background: var(--do); }
.thong-bao-noi > div.vui { background: linear-gradient(120deg, #f07b22, #e0a10d); }
@keyframes vao { from { transform: translateY(10px); opacity: 0; } }
.phao-hoa { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.phao-hoa i { position: absolute; top: -20px; font-style: normal; font-size: 22px; animation: roi linear forwards; }
@keyframes roi { to { transform: translateY(110vh) rotate(540deg); } }

/* ---------- Điện thoại ---------- */
@media (max-width: 900px) {
  .ung-dung { grid-template-columns: 1fr; }
  .menu { position: fixed; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .menu.mo { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .nut-menu { display: block; }
  .thanh-tren { padding: 10px 16px; }
  .noi-dung { padding: 16px; }
  .hai-cot { grid-template-columns: 1fr; }
  .chao { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .chao .so-lieu-nho { justify-content: center; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - 53px); }
  .chat.dang-mo .ds-kenh { display: none; }
  .chat:not(.dang-mo) .khung-chat { display: none; }
  .chat-dau .quay-lai { display: inline-flex; }
  .tin { max-width: 92%; }
  .luoi-form { grid-template-columns: 1fr; }
  .chip-tt .chu { display: none; }
}
@media (max-width: 480px) { .chip-xu { padding: 5px 8px; } }

/* ---------- Văn phòng 3D ---------- */
.vp { position: relative; height: calc(100vh - 57px); overflow: hidden; background: #dfe7ee; user-select: none; }
.vp-khung { position: absolute; inset: 0; }
.vp-khung canvas { display: block; }
.vp-tren-trai { position: absolute; left: 12px; top: 12px; display: grid; gap: 6px; max-width: calc(100% - 140px); }
.vp-the { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: rgba(40, 18, 10, .78); color: #fff; padding: 7px 12px; border-radius: 22px; border: 1px solid rgba(255, 200, 120, .35); box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.vp-the select { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 14px; padding: 3px 8px; }
.vp-the select option { color: #222; }
.vp-so { font-size: 12px; color: #d8f5df; display: inline-flex; align-items: center; }
.vp-hd { font-size: 12px; border-radius: 10px; background: rgba(40, 18, 10, .6); }
.vp-tren-phai { position: absolute; right: 12px; top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vp-nut { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 200, 120, .4); background: rgba(40, 18, 10, .75); color: #fff; font-size: 20px; cursor: pointer; }
.vp-duoi { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100% - 24px); }
.vp-hanh-dong { width: 62px; height: 62px; border-radius: 16px; border: 2px solid #f3c27a; cursor: pointer; font-size: 24px; color: #fff; display: grid; place-items: center; align-content: center;
  background: linear-gradient(160deg, #c0392b, #8e1f16); box-shadow: 0 6px 16px rgba(0,0,0,.25); line-height: 1.1; }
.vp-hanh-dong small { font-size: 11px; font-weight: 600; }
.vp-hanh-dong.nho { width: 46px; height: 46px; font-size: 22px; border-radius: 50%; background: rgba(40, 18, 10, .7); border-width: 1px; align-self: center; }
.vp-hanh-dong.cam { background: linear-gradient(160deg, #ffb15c, #e0670f); }
.vp-hanh-dong:active { transform: scale(.94); }
.vp-joy { position: absolute; left: 20px; bottom: 20px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.35); border: 2px solid rgba(255,255,255,.7); touch-action: none; display: grid; place-items: center; }
.vp-joy i { width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 2px 8px rgba(0,0,0,.25); pointer-events: none; }
@media (max-width: 900px) {
  .vp { height: calc(100vh - 53px); }
  .vp-hd { display: none; }
  .vp-duoi { bottom: 150px; }
  .vp-hanh-dong { width: 52px; height: 52px; font-size: 20px; }
  .vp-hanh-dong.nho { width: 40px; height: 40px; font-size: 18px; }
  .vp-joy { width: 110px; height: 110px; }
}
@media (hover: hover) and (min-width: 901px) { .vp-joy { opacity: .55; } }
.vp-hanh-dong.xanh { background: linear-gradient(160deg, #52b788, #2d6a4f); }
.vp-thanh-sua { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; background: rgba(40, 18, 10, .82); padding: 10px 12px; border-radius: 16px; border: 1px solid rgba(255, 200, 120, .35); max-width: min(1000px, calc(100vw - 260px)); }
.vp-thanh-sua .nhom { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.vp-thanh-sua .nhom.chon { background: rgba(240, 123, 34, .25); padding: 4px 8px; border-radius: 10px; color: #fff; }
.vp-thanh-sua select { max-width: 200px; }
.luoi-vat { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.o-vat { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--vien); background: #fff; cursor: pointer; font: inherit; }
.o-vat:hover:not(:disabled) { border-color: var(--cam); background: #fff7ef; }
.o-vat:disabled { opacity: .45; cursor: default; }
.o-vat .bt { font-size: 32px; }
.o-vat small { color: #a06c00; }
@media (max-width: 900px) { .vp-thanh-sua { max-width: calc(100vw - 24px); } .vp-duoi:has(.vp-thanh-sua) { bottom: 12px; } }
.vp-o-phong { position: absolute; left: 12px; top: 110px; background: rgba(40, 18, 10, .85); color: #fff; border: 1px solid rgba(255, 200, 120, .45); border-radius: 16px; padding: 10px 12px; display: grid; gap: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25); animation: vao .2s; }
.vp-o-phong .tieu-de { display: flex; gap: 10px; align-items: center; }
.vp-o-phong .tieu-de b { color: #ffd36b; }
.vp-o-phong .hang { display: flex; gap: 8px; flex-wrap: wrap; }
.o-tim { display: grid; justify-items: center; width: 74px; padding: 6px 4px; border-radius: 12px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; cursor: pointer; font: inherit; font-size: 22px; line-height: 1.15; }
.o-tim b { font-size: 14px; } .o-tim small { font-size: 10px; color: #f3dcc0; }
.o-tim:hover:not(:disabled) { background: rgba(255,255,255,.2); } .o-tim:disabled { opacity: .6; cursor: default; } .o-tim.da { border-color: #ffd36b; background: rgba(240, 123, 34, .35); }
@media (max-width: 900px) { .vp-o-phong { top: 64px; left: 8px; right: 8px; } }

/* ---------- Tiện ích: quay số, mã QR ---------- */
.qs-san { display: grid; gap: 14px; }
.qs-thanh select { max-width: 220px; padding: 3px 8px; font-size: 12px; }
.qs-dia { position: relative; display: grid; place-items: center; padding-top: 10px; }
.qs-dia canvas { display: block; border-radius: 50%; box-shadow: 0 10px 30px rgba(13,44,82,.35); }
.qs-kim { position: absolute; top: 0; left: 50%; z-index: 2; width: 0; height: 0; margin-left: -17px; transform-origin: 50% 0;
  border-left: 17px solid transparent; border-right: 17px solid transparent; border-top: 36px solid #d62828; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); }
.qs-kim.rung { animation: qs-rung .12s ease-out; }
@keyframes qs-rung { 50% { transform: rotate(-14deg); } }
.qs-chuc-mung { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; display: flex; align-items: center; gap: 14px; cursor: pointer;
  min-width: min(340px, 90%); max-width: 92%; padding: 16px 20px; border-radius: 16px; background: linear-gradient(135deg, #fff6d6, #ffe08a);
  box-shadow: 0 0 0 4px #f5b400, 0 16px 40px rgba(0,0,0,.35); animation: qs-noi .5s ease-out; }
.qs-chuc-mung b { display: block; font-size: 22px; color: #8a4b00; line-height: 1.25; }
.qs-chuc-mung > div { min-width: 0; }
@keyframes qs-noi { 0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; } 60% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); } }
.qs-san:fullscreen { background: radial-gradient(circle at 30% 20%, #2a6fc0 0, transparent 45%), linear-gradient(135deg, #0d2c52, #123a6b); border: 0; border-radius: 0;
  align-content: center; justify-items: center; overflow: auto; padding: 24px; }
.qs-san:fullscreen .qs-cai, .qs-san:fullscreen #qs-tom-tat { display: none; }
.qs-san:fullscreen .qs-thanh { width: 100%; max-width: 900px; }
.qs-san:fullscreen .qs-dia { width: 100%; }
.qs-cd.bat { position: relative; }
.qs-cd.bat::after { content: ""; position: absolute; top: 2px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--xanh); }
.cd-ds { margin: 10px 0; padding-left: 22px; display: grid; gap: 4px; }
.cd-ds li > * { vertical-align: middle; }
.cd-ds li { padding: 4px 0; border-bottom: 1px solid var(--vien); }
.cd-ds li .gian { display: inline-block; min-width: 55%; }
.the-tag.canh-bao { background: #fde2e2; color: var(--do); }
.nh-dong { padding: 6px 0; border-bottom: 1px solid var(--vien); }
.qs-nut { font: inherit; font-size: 20px; font-weight: 800; letter-spacing: 1px; color: #fff; border: 0; border-radius: 40px; padding: 14px 28px; cursor: pointer; justify-self: center;
  background: linear-gradient(180deg, #ff9a3d, var(--cam)); box-shadow: 0 5px 0 #b9520d, 0 8px 18px rgba(240,123,34,.4); }
.qs-nut:active { transform: translateY(3px); box-shadow: 0 2px 0 #b9520d; }
.qs-nut:disabled { opacity: .6; cursor: default; }
.qs-loc summary { cursor: pointer; color: var(--chinh); font-weight: 600; }
.qs-xem { background: #f5f7fa; border-radius: 6px; padding: 10px; max-height: 240px; overflow: auto; white-space: pre-wrap; font: inherit; font-size: 13px; }
.qr-xem { display: grid; gap: 12px; justify-items: center; position: sticky; top: 16px; }
.qr-xem canvas { width: 100%; max-width: 340px; height: auto; border: 1px solid var(--vien); border-radius: 8px; }
.vp-loa { position: absolute; right: 14px; bottom: 18px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 200, 120, .35); cursor: pointer;
  background: rgba(40, 18, 10, .45); color: #fff; font-size: 18px; opacity: .45; transition: opacity .2s; z-index: 2; }
.vp-loa:hover, .vp-loa:focus-visible { opacity: 1; }
.vp-loa.tat { opacity: .3; }
.vp-loa.ql { right: 60px; width: 32px; height: 32px; bottom: 22px; font-size: 14px; opacity: .3; }
.xs-cua { max-width: 520px; margin: 40px auto; text-align: center; display: grid; gap: 10px; justify-items: center; }
.xs-cua .xs-bt { font-size: 56px; line-height: 1; }
.xs-cua p { margin: 0; }
.vp-hanh-dong.xs-vk { background: rgba(40, 18, 10, .7); font-size: 22px; }
.vp-hanh-dong.xs-vk.chon { background: linear-gradient(160deg, #ffb15c, #e0670f); box-shadow: 0 0 0 3px #ffd36b; }
.vp-hanh-dong.xs-vk small { font-size: 9.5px; line-height: 1.1; }

/* ---------- Trợ lý Claude ---------- */
.cl-khung { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 110px); max-width: 860px; margin: 0 auto; }
.cl-dau { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cl-log { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--mat); border: 1px solid var(--vien); border-radius: var(--bo); }
.cl-tin { max-width: 88%; padding: 9px 13px; border-radius: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.cl-tin.toi { align-self: flex-end; background: var(--chinh); color: #fff; white-space: pre-wrap; }
.cl-tin.ai { align-self: flex-start; background: #f2f5f9; }
.cl-tin.ai pre { background: #16202e; color: #e6edf5; padding: 10px; border-radius: 8px; overflow: auto; margin: 6px 0; white-space: pre; }
.cl-tin.ai code { background: rgba(20,32,46,.08); border-radius: 4px; padding: 0 4px; font-size: 13px; }
.cl-tin.ai pre code { background: none; padding: 0; }
.cl-tin.loi { align-self: center; background: #fde2e2; color: var(--do); }
.cl-trong { margin: auto; text-align: center; color: var(--phu); max-width: 420px; }
.cl-trong b { display: block; font-size: 40px; }
.cl-nhap { display: flex; gap: 8px; align-items: flex-end; }
.cl-nhap textarea { flex: 1; resize: none; max-height: 160px; font: inherit; }
@media (max-width: 760px) { .cl-khung { height: calc(100vh - 90px); } .cl-tin { max-width: 96%; } }

/* ---------- Khảo sát ---------- */
.noi-dung.ks-toan { padding: 0; gap: 0; display: flex; flex-direction: column; }
.ks-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.ks-the { border-radius: 16px; overflow: hidden; background: var(--mat); border: 1px solid var(--vien); box-shadow: var(--bong); display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
a.ks-the:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(20,32,46,.16); }
.ks-bia { height: 96px; background-size: cover; background-position: center; position: relative; }
.ks-bia .the-tag { position: absolute; top: 10px; left: 10px; background: rgba(255,255,255,.92); color: var(--chu); }
.ks-than { padding: 12px 14px; display: grid; gap: 6px; flex: 1; align-content: start; }
.ks-than h3 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.ks-chan { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 12px; }
/* trang làm bài */
.ks-san { position: relative; flex: 1; min-height: calc(100vh - 57px); display: flex; flex-direction: column; background-size: cover; background-position: center; background-attachment: local; --ks: #1665c1; }
.ks-lop { position: absolute; inset: 0; background: #000; pointer-events: none; }
.ks-tien { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 24px; color: #fff; font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.45); }
.ks-tien .ks-thanh { flex: 1; height: 6px; border-radius: 6px; background: rgba(255,255,255,.3); overflow: hidden; }
.ks-tien .ks-thanh b { display: block; height: 100%; background: #fff; border-radius: 6px; transition: width .3s; }
.ks-giua { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 20px 28px; }
.ks-phieu { width: min(720px, 100%); background: rgba(255,255,255,.95); color: var(--chu); border-radius: 22px; padding: 34px 38px 26px; box-shadow: 0 24px 60px rgba(10,20,40,.35); backdrop-filter: blur(10px); animation: ks-vao .28s ease; }
.ks-phieu.lui { animation-name: ks-lui; }
@keyframes ks-vao { from { opacity: 0; transform: translateY(18px); } }
@keyframes ks-lui { from { opacity: 0; transform: translateY(-18px); } }
@media (prefers-reduced-motion: reduce) { .ks-phieu { animation: none; } }
.ks-phieu h1 { margin: 0; font-size: 26px; line-height: 1.3; overflow-wrap: anywhere; }
.ks-phieu h2 { margin: 0; font-size: 21px; line-height: 1.35; overflow-wrap: anywhere; }
.ks-mota { color: var(--phu); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.ks-nhan { display: inline-block; font-size: 12px; font-weight: 700; color: var(--ks); background: color-mix(in srgb, var(--ks) 12%, transparent); padding: 3px 10px; border-radius: 20px; margin-bottom: 10px; }
.ks-sao-do { color: var(--do); }
.ks-media { max-width: 100%; max-height: 260px; border-radius: 12px; display: block; margin: 0 auto 16px; }
.ks-cau.can-trai { text-align: left; } .ks-cau.can-giua { text-align: center; } .ks-cau.can-phai { text-align: right; }
.ks-cau.trai-phai { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.ks-tl { text-align: left; }
.ks-lc { display: grid; gap: 9px; }
.ks-lc button { font: inherit; text-align: left; display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--vien); background: #fff; cursor: pointer; color: inherit; transition: border-color .12s, background .12s; overflow-wrap: anywhere; }
.ks-lc button:hover { border-color: var(--ks); }
.ks-lc button.chon { border-color: var(--ks); background: color-mix(in srgb, var(--ks) 10%, #fff); font-weight: 600; }
.ks-lc .chu-cai { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: #eef1f5; color: var(--phu); }
.ks-lc button.chon .chu-cai { background: var(--ks); color: #fff; }
.ks-lc.anh { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ks-lc.anh button { flex-direction: column; align-items: stretch; padding: 8px; text-align: center; }
.ks-lc.anh img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; background: #eef1f5; }
.ks-o { font: inherit; width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--vien); background: #fff; color: inherit; }
.ks-o:focus { outline: none; border-color: var(--ks); }
textarea.ks-o { min-height: 120px; resize: vertical; }
textarea.ks-o.code { font-family: Consolas, "Courier New", monospace; font-size: 13px; background: #16202e; color: #e6edf5; border-color: #16202e; min-height: 180px; tab-size: 2; }
.ks-hai { display: grid; gap: 9px; }
.ks-sao { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.ks-sao button { background: none; border: 0; font-size: 36px; line-height: 1; cursor: pointer; color: #d5dbe3; padding: 2px; transition: transform .1s; }
.ks-sao button:hover { transform: scale(1.15); }
.ks-sao button.sang { color: #f5b301; }
.ks-truot { display: grid; gap: 6px; }
.ks-truot output { font-size: 30px; font-weight: 800; color: var(--ks); text-align: center; }
.ks-truot input { width: 100%; accent-color: var(--ks); }
.ks-truot small { display: flex; justify-content: space-between; color: var(--phu); }
.ks-xep { display: grid; gap: 7px; }
.ks-xep div { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1.5px solid var(--vien); border-radius: 12px; background: #fff; overflow-wrap: anywhere; }
.ks-xep b { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--ks); color: #fff; font-size: 12px; }
.ks-xep span { flex: 1; min-width: 0; }
.ks-tai { display: flex; align-items: center; gap: 10px; padding: 16px; border: 1.5px dashed var(--vien); border-radius: 12px; cursor: pointer; justify-content: center; }
.ks-tai:hover { border-color: var(--ks); }
.ks-tai img { max-height: 120px; border-radius: 8px; }
.ks-nut-di { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 26px; }
.ks-nut { font: inherit; font-weight: 700; padding: 10px 26px; border-radius: 12px; border: 0; background: var(--ks); color: #fff; cursor: pointer; }
.ks-nut:hover { filter: brightness(1.08); }
.ks-nut:disabled { opacity: .55; cursor: default; }
.ks-lui-nut { font: inherit; background: none; border: 0; color: var(--phu); cursor: pointer; padding: 8px; }
.ks-loi { color: var(--do); font-size: 13px; margin-top: 8px; min-height: 18px; text-align: left; }
.ks-dong-ho { position: relative; font-variant-numeric: tabular-nums; }
.ks-dong-ho.gap { color: #ffd2d2; }
/* trình soạn */
.ks-soan { display: grid; grid-template-columns: 240px minmax(0, 1fr) 300px; flex: 1; min-height: 0; height: calc(100vh - 57px); background: var(--nen); }
.ks-trai, .ks-phai { background: var(--mat); overflow: auto; padding: 12px; display: grid; gap: 8px; align-content: start; }
.ks-trai { border-right: 1px solid var(--vien); } .ks-phai { border-left: 1px solid var(--vien); }
.ks-giua-soan { position: relative; overflow: auto; display: flex; flex-direction: column; min-width: 0; }
.ks-thanh-soan { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--mat); border-bottom: 1px solid var(--vien); flex-wrap: wrap; }
.ks-thanh-soan input { flex: 1; min-width: 180px; font: inherit; font-weight: 700; border: 1px solid transparent; border-radius: 6px; padding: 5px 8px; }
.ks-thanh-soan input:hover, .ks-thanh-soan input:focus { border-color: var(--vien); }
.ks-tab { display: flex; gap: 4px; background: #eef1f5; padding: 3px; border-radius: 9px; }
.ks-tab button { font: inherit; font-size: 12px; font-weight: 600; flex: 1; border: 0; background: none; padding: 5px 8px; border-radius: 7px; cursor: pointer; color: var(--phu); white-space: nowrap; }
.ks-tab button.chon { background: #fff; color: var(--chinh); box-shadow: var(--bong); }
.ks-dong { font: inherit; text-align: left; display: flex; gap: 8px; align-items: center; width: 100%; padding: 7px 8px; border: 1px solid transparent; border-radius: 9px; background: none; cursor: pointer; color: inherit; min-width: 0; }
.ks-dong:hover { background: #f2f5f9; }
.ks-dong.chon { background: var(--chinh-nhat); border-color: var(--chinh); }
.ks-dong b { flex: none; width: 22px; font-size: 12px; color: var(--phu); text-align: center; }
.ks-dong span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ks-dong small { flex: none; font-size: 10px; color: var(--cam); font-weight: 700; }
.ks-muc { display: grid; gap: 5px; padding-bottom: 10px; border-bottom: 1px solid var(--vien); }
.ks-muc > h4 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--phu); display: flex; justify-content: space-between; align-items: center; }
.ks-muc input[type=range] { width: 100%; }
.ks-muc select, .ks-muc input[type=number], .ks-muc input[type=text], .ks-muc input[type=datetime-local], .ks-muc textarea { font: inherit; width: 100%; padding: 6px 8px; border: 1px solid var(--vien); border-radius: 6px; background: #fff; }
.ks-bat { position: relative; width: 38px; height: 22px; flex: none; }
.ks-bat input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.ks-bat i { position: absolute; inset: 0; border-radius: 22px; background: #cdd4dd; transition: background .15s; }
.ks-bat i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.ks-bat input:checked + i { background: var(--xanh); } .ks-bat input:checked + i::after { left: 19px; }
.ks-bat input:focus-visible + i { outline: 2px solid var(--chinh); outline-offset: 2px; }
.ks-hang { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.ks-re { display: grid; grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); gap: 5px; align-items: center; font-size: 12px; }
.ks-re span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ks-sua-phieu { width: min(720px, 100%); }
.ks-sua-phieu .ks-tieu, .ks-sua-phieu textarea.ks-mo { font: inherit; width: 100%; border: 0; border-bottom: 1px dashed transparent; background: none; color: inherit; padding: 2px 0; text-align: inherit; resize: none; }
.ks-sua-phieu .ks-tieu { font-size: 21px; font-weight: 700; }
.ks-sua-phieu textarea.ks-mo { color: var(--phu); min-height: 26px; }
.ks-sua-phieu .ks-tieu:hover, .ks-sua-phieu .ks-tieu:focus, .ks-sua-phieu textarea.ks-mo:hover, .ks-sua-phieu textarea.ks-mo:focus { outline: none; border-bottom-color: var(--ks); }
.ks-sua-lc { display: flex; align-items: center; gap: 7px; }
.ks-sua-lc input[type=text] { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border: 1.5px solid var(--vien); border-radius: 10px; }
.ks-sua-lc img { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; flex: none; }
.ks-icon { flex: none; background: none; border: 0; cursor: pointer; font-size: 15px; padding: 3px; border-radius: 6px; }
.ks-icon:hover { background: #eef1f5; }
.ks-icon.bat { background: #d9f4e4; }
.ks-mau-nen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ks-mau-nen button { height: 44px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; background-size: cover; }
.ks-mau-nen button.chon { border-color: var(--chinh); box-shadow: 0 0 0 2px #fff inset; }
.ks-nhan-mau { display: flex; gap: 6px; flex-wrap: wrap; }
.ks-nhan-mau button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.ks-nhan-mau button.chon { box-shadow: 0 0 0 2px var(--chinh); border-color: #fff; }
.ks-loai-nhom { font-size: 12px; font-weight: 700; color: var(--phu); text-transform: uppercase; letter-spacing: .4px; margin: 14px 0 7px; }
.ks-loai-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 9px; }
.ks-loai { font: inherit; display: flex; align-items: center; gap: 11px; text-align: left; padding: 10px 12px; border-radius: 13px; border: 1px solid var(--vien); background: #fff; cursor: pointer; font-weight: 600; font-size: 13px; color: inherit; }
.ks-loai:hover, .ks-loai.chon { border-color: var(--xanh); background: #f1fbf6; }
.ks-loai i { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-style: normal; background: #e6f7ee; font-size: 17px; }
/* kết quả */
.ks-bieu { display: grid; gap: 6px; }
.ks-bieu > div { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 3px 10px; font-size: 13px; }
.ks-bieu span { overflow-wrap: anywhere; }
.ks-bieu em { font-style: normal; text-align: right; color: var(--phu); }
.ks-bieu u { grid-column: 1 / -1; display: block; height: 9px; border-radius: 5px; background: #eef1f5; overflow: hidden; text-decoration: none; }
.ks-bieu u b { display: block; height: 100%; background: var(--chinh); border-radius: 5px; }
.ks-bieu .dung u b { background: var(--xanh); }
.ks-chu-ds { display: grid; gap: 5px; max-height: 240px; overflow: auto; font-size: 13px; }
.ks-chu-ds div { background: #f5f7fa; border-radius: 6px; padding: 6px 9px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ks-so-lon { font-size: 28px; font-weight: 800; color: var(--chinh); line-height: 1.1; }
@media (max-width: 1000px) {
  .ks-soan { grid-template-columns: 1fr; height: auto; }
  .ks-trai { border-right: 0; border-bottom: 1px solid var(--vien); max-height: 190px; }
  .ks-phai { border-left: 0; border-top: 1px solid var(--vien); }
}
@media (max-width: 640px) {
  .ks-phieu { padding: 22px 18px 18px; border-radius: 16px; }
  .ks-phieu h1 { font-size: 21px; } .ks-phieu h2 { font-size: 18px; }
  .ks-cau.trai-phai { grid-template-columns: minmax(0, 1fr); }
  .ks-tien { padding: 12px 16px; } .ks-giua { padding: 6px 12px 18px; }
}
.ks-bao { height: calc(100vh - 57px); display: flex; flex-direction: column; min-height: 0; }
.ks-bao .ks-soan { height: auto; flex: 1; min-height: 0; }
@media (max-width: 1000px) { .ks-bao { height: auto; } }
.ks-sua-phieu .ks-tieu { overflow: hidden; display: block; }
.ks-dy { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.45; cursor: pointer; }
.ks-dy input { appearance: auto; flex: none; width: 18px; height: 18px; margin: 1px 0 0; padding: 0; border-radius: 3px; accent-color: var(--ks); }

/* ---------- Khảo sát: tông dịu ---------- */
.ks-chill { --chinh: #3f8f83; --chinh-dam: #2f7369; --chinh-nhat: #e3f2ee; --nen: #f3f6f2; --vien: #e3e9e2; --chu: #2b3a36; --phu: #6c7c77; --bo: 18px; --bong: 0 8px 24px rgba(58, 88, 78, .07); background: linear-gradient(160deg, #f6f8f3, #eef4f1 55%, #f4f1ec); }
.ks-chill .the { border-color: transparent; }
.ks-chill .nut { border-radius: 11px; }
.ks-chill .nut.nho { border-radius: 9px; }
.ks-chill .the-tag { border-radius: 20px; }
.ks-dau-trang { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ks-tab-lon { background: rgba(255,255,255,.7); padding: 4px; border-radius: 13px; box-shadow: var(--bong); }
.ks-tab-lon button { font-size: 13px; padding: 7px 16px; border-radius: 10px; }
.ks-chill .ks-tab button.chon { background: var(--chinh); color: #fff; box-shadow: none; }
.ks-chill .ks-the { border-color: transparent; border-radius: 20px; box-shadow: var(--bong); }
.ks-chill a.ks-the:hover { box-shadow: 0 14px 30px rgba(58,88,78,.13); }
.ks-di { color: var(--chinh); font-weight: 600; white-space: nowrap; } .ks-xong { color: var(--phu); font-weight: 600; }
.ks-trong { text-align: center; color: var(--phu); padding: 48px 20px; background: rgba(255,255,255,.6); border-radius: 20px; }
.ks-trong b { display: block; font-size: 40px; margin-bottom: 8px; }
.ks-bc-ds { display: grid; gap: 10px; }
.ks-bc { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--mat); border-radius: 16px; box-shadow: var(--bong); text-decoration: none; color: inherit; transition: transform .15s; min-width: 0; }
.ks-bc:hover { transform: translateY(-2px); }
.ks-bc-mau { flex: none; width: 44px; height: 44px; border-radius: 13px; background-size: cover; }
.ks-bc-ten { flex: 1; min-width: 0; display: grid; } .ks-bc-ten b { overflow-wrap: anywhere; } .ks-bc-ten small { color: var(--phu); }
.ks-so-hang { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ks-so { background: var(--mat); border-radius: 18px; padding: 14px 18px; box-shadow: var(--bong); display: grid; gap: 2px; }
.ks-so b { font-size: 28px; line-height: 1.15; color: var(--chinh); } .ks-so span { font-size: 12px; color: var(--phu); }
.ks-kq-luoi { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.ks-bieu u { height: 8px; background: #edf1ec; } .ks-bieu u b { background: linear-gradient(90deg, #7fc2b3, var(--chinh)); }
.ks-bieu .dung u b { background: linear-gradient(90deg, #a7cf8f, #6b9f58); }
.ks-chu-ds div { background: #f4f7f3; border-radius: 10px; }
.ks-chill select, .ks-chill #ks-tim { font: inherit; padding: 7px 11px; border: 1px solid var(--vien); border-radius: 11px; background: #fff; max-width: 100%; }
.ks-bang-bao { overflow: auto; max-height: calc(100vh - 290px); background: var(--mat); border-radius: 18px; box-shadow: var(--bong); }
.ks-bang { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.ks-bang th { position: sticky; top: 0; background: #edf4f0; color: var(--chu); text-align: left; font-weight: 600; white-space: nowrap; padding: 9px 12px; z-index: 1; }
.ks-bang td { padding: 8px 12px; border-top: 1px solid var(--vien); max-width: 300px; overflow-wrap: anywhere; vertical-align: top; }
.ks-bang tbody tr:hover { background: #f6f9f5; }
/* trang soạn: thanh tab đứng yên khi cuộn */
.ks-chill .ks-trai, .ks-chill .ks-phai, .ks-chill .ks-thanh-soan { background: rgba(255,255,255,.82); border-color: var(--vien); }
.ks-phai { padding: 0 12px 12px; }
.ks-phai-tab { position: sticky; top: 0; z-index: 5; margin: 0 -12px; padding: 12px 12px 10px; background: #fbfcfa; border-bottom: 1px solid var(--vien); }
.ks-chill .ks-tab { background: #eef3ee; }
.ks-chill .ks-dong { border-radius: 12px; } .ks-chill .ks-dong.chon { background: var(--chinh-nhat); border-color: transparent; }
.ks-chill .ks-loai:hover, .ks-chill .ks-loai.chon { border-color: var(--chinh); background: var(--chinh-nhat); }
.ks-chill .ks-bat input:checked + i { background: var(--chinh); }
.ks-muc { border-bottom-color: #eef2ed; }
/* trang làm bài */
.ks-san.troi { background-size: 220% 220% !important; animation: ks-troi 26s ease-in-out infinite alternate; }
@keyframes ks-troi { from { background-position: 0% 40%; } to { background-position: 100% 60%; } }
@media (prefers-reduced-motion: reduce) { .ks-san.troi { animation: none; } }
.ks-phieu { background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.65); border-radius: 28px; box-shadow: 0 18px 50px rgba(50,70,70,.14); backdrop-filter: blur(18px); padding: 38px 42px 28px; animation-duration: .45s; animation-timing-function: cubic-bezier(.2,.7,.2,1); }
.ks-phieu h1, .ks-phieu h2 { font-weight: 600; letter-spacing: -.1px; color: #2b3a36; }
.ks-tien { color: #2f4540; text-shadow: none; }
.ks-tien > span { background: rgba(255,255,255,.6); padding: 3px 11px; border-radius: 20px; }
.ks-tien .ks-thanh { background: rgba(255,255,255,.5); } .ks-tien .ks-thanh b { background: var(--ks); }
.ks-dong-ho.gap { color: #b3392f; }
.ks-lc button, .ks-o, .ks-xep div { border-radius: 15px; border-color: rgba(60,90,80,.14); background: rgba(255,255,255,.8); }
.ks-lc button:hover { transform: translateY(-1px); }
.ks-lc button { transition: border-color .15s, background .15s, transform .15s; }
.ks-lc .chu-cai { border-radius: 10px; background: rgba(60,90,80,.08); }
.ks-nut { border-radius: 15px; padding: 11px 28px; font-weight: 600; box-shadow: 0 6px 16px color-mix(in srgb, var(--ks) 30%, transparent); }
@media (max-width: 640px) { .ks-phieu { padding: 24px 18px 18px; border-radius: 22px; } .ks-kq-luoi { grid-template-columns: minmax(0, 1fr); } }
