/* Văn phòng Khoa · giao diện */
:root {
  --nen: #f5f7fa;
  --the: #ffffff;
  --vien: #e3e8ef;
  --chu: #1c2430;
  --chu-phu: #5b6675;
  --chinh: #1d4e89;
  --chinh-nhat: #e8f0fa;
  --xanh: #0f7a5c;
  --xanh-nhat: #e3f5ee;
  --vang: #a66300;
  --vang-nhat: #fff3dc;
  --do: #b42318;
  --do-nhat: #fdecea;
  --tim: #6941c6;
  --tim-nhat: #f1ecfb;
  --bo: 10px;
  --bong: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: "Inter", "Segoe UI", -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--chu); background: var(--nen); line-height: 1.45; }
a { color: var(--chinh); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.bt { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.an { display: none !important; }
.nho { font-size: 12.5px; color: var(--chu-phu); }

/* ===== Khung ===== */
.dau { position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--the); border-bottom: 1px solid var(--vien); }
.dau .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--chu); }
.dau .logo .o { width: 30px; height: 30px; border-radius: 8px; background: var(--chinh); color: #fff; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; letter-spacing: .2px; }
.dau .logo small { display: block; font-weight: 500; font-size: 11.5px; color: var(--chu-phu); }
.dau .logo .o.clb { background: #b4232a; }
.dau .chon-don-vi { height: 32px; max-width: 300px; margin-left: 8px; padding: 0 28px 0 10px; border: 1px solid var(--vien); border-radius: 8px; background: var(--nen, #f5f7fa); font: inherit; font-size: 13px; font-weight: 600; color: var(--chu); }
.dau .gian { flex: 1; }
.dau .nut-mo-menu { display: none; }
.khung { display: grid; grid-template-columns: 236px 1fr; min-height: calc(100vh - 56px); }
.ben { background: var(--the); border-right: 1px solid var(--vien); padding: 12px 10px 24px; overflow-y: auto; position: sticky; top: 56px; height: calc(100vh - 56px); }
.ben .nhom { margin: 14px 8px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #8a94a3; }
.ben a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--chu); font-weight: 500; }
.ben a:hover { background: var(--nen); text-decoration: none; }
.ben a.dang { background: var(--chinh-nhat); color: var(--chinh); }
.ben a .dem { margin-left: auto; font-size: 11.5px; background: var(--chinh); color: #fff; border-radius: 10px; padding: 0 7px; }
.ben a .vai { margin-left: auto; font-size: 10.5px; color: var(--chu-phu); }
.chinh-giua { padding: 22px 26px 60px; max-width: 1180px; width: 100%; }
.tieu-de-trang { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tieu-de-trang h1 { font-size: 20px; margin: 0; }
.tieu-de-trang .mo-ta { width: 100%; margin: -6px 0 0; color: var(--chu-phu); }
.tieu-de-trang .gian { flex: 1; }

/* ===== Thành phần ===== */
.nut { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--vien); background: var(--the); cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.nut:hover { background: var(--nen); }
.nut.chinh { background: var(--chinh); border-color: var(--chinh); color: #fff; }
.nut.chinh:hover { background: #173f70; }
.nut.do { color: var(--do); }
.nut.nho-gon { height: 28px; padding: 0 9px; font-size: 12.5px; }
.nut.tron { width: 36px; padding: 0; justify-content: center; border-color: transparent; position: relative; }
.nut[disabled] { opacity: .55; cursor: not-allowed; }
.the { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo); box-shadow: var(--bong); }
.the.dem-lot { padding: 16px; }
.luoi { display: grid; gap: 14px; }
.luoi.c4 { grid-template-columns: repeat(4, 1fr); }
.luoi.c3 { grid-template-columns: repeat(3, 1fr); }
.luoi.c2 { grid-template-columns: 1.4fr 1fr; }
.so-lieu { padding: 14px 16px; }
.so-lieu b { display: block; font-size: 24px; margin-top: 2px; }
.so-lieu span { color: var(--chu-phu); font-size: 12.5px; }
.nhan { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--nen); color: var(--chu-phu); white-space: nowrap; }
.nhan.lanh_dao, .nhan.quan_tri { background: var(--tim-nhat); color: var(--tim); }
.nhan.thanh_vien { background: var(--chinh-nhat); color: var(--chinh); }
.nhan.moi { background: var(--chinh-nhat); color: var(--chinh); }
.nhan.dang_lam { background: var(--vang-nhat); color: var(--vang); }
.nhan.cho_duyet { background: var(--tim-nhat); color: var(--tim); }
.nhan.xong { background: var(--xanh-nhat); color: var(--xanh); }
.nhan.huy, .nhan.tam_khoa { background: #f2f4f7; color: #667085; }
.nhan.cao { background: var(--do-nhat); color: var(--do); }
.nhan.qua-han { background: var(--do-nhat); color: var(--do); }
.o-nhap, select.o-nhap, textarea.o-nhap { width: 100%; height: 36px; padding: 0 10px; border: 1px solid #cfd6e0; border-radius: 8px; background: #fff; }
textarea.o-nhap { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; }
.o-nhap:focus { outline: 2px solid #b9d0ee; border-color: var(--chinh); }
label.truong { display: block; margin-bottom: 12px; }
label.truong > span { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 4px; }
label.truong > span em { font-style: normal; font-weight: 500; color: var(--vang); margin-left: 4px; }
.hang { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hang.giua { justify-content: space-between; }
.tab { display: flex; gap: 4px; border-bottom: 1px solid var(--vien); margin-bottom: 14px; overflow-x: auto; }
.tab a { padding: 9px 12px; color: var(--chu-phu); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab a.dang { color: var(--chinh); border-bottom-color: var(--chinh); }
.tab a:hover { text-decoration: none; color: var(--chu); }
.trong { padding: 36px 16px; text-align: center; color: var(--chu-phu); }
.thong-bao-loi { background: var(--do-nhat); color: var(--do); border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; }
.ghi-chu { background: var(--chinh-nhat); color: #23466f; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.ghi-chu.vang { background: var(--vang-nhat); color: #7a4a00; }

/* Bảng */
.bang { width: 100%; border-collapse: collapse; }
.bang th { text-align: left; font-size: 12px; font-weight: 600; color: var(--chu-phu); padding: 9px 12px; border-bottom: 1px solid var(--vien); background: #fafbfc; white-space: nowrap; }
.bang td { padding: 10px 12px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.bang tr.bam { cursor: pointer; }
.bang tr.bam:hover td { background: #f8fafd; }
.bang tr:last-child td { border-bottom: 0; }
.bang td.ten { font-weight: 600; }
.cuon-ngang { overflow-x: auto; }

/* Danh sách việc */
.viec { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid #eef1f5; cursor: pointer; }
.viec:hover { background: #f8fafd; }
.viec:last-child { border-bottom: 0; }
.viec .cham { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--chinh); }
.viec .cham.dang_lam { background: #f0a020; }
.viec .cham.cho_duyet { background: var(--tim); }
.viec .cham.xong { background: var(--xanh); }
.viec .cham.huy { background: #c0c6d0; }
.viec .noi { flex: 1; min-width: 0; }
.viec .noi b { display: block; }
.viec .noi .nho { margin-top: 2px; }
.viec .phai { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Ô công cụ */
.o-cong-cu { display: flex; gap: 12px; padding: 14px; align-items: flex-start; color: var(--chu); }
.o-cong-cu:hover { text-decoration: none; border-color: #c3d3e8; }
.o-cong-cu .bieu { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--chinh-nhat); color: var(--chinh); flex: none; }
.o-cong-cu .bieu svg.bt { width: 20px; height: 20px; }
.o-cong-cu b { display: block; margin-bottom: 2px; }

/* Chuông */
.chuong-so { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; border-radius: 9px; background: #d92d20; color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; }
.bang-chuong { position: absolute; top: 50px; right: 12px; width: 370px; max-height: 70vh; overflow: auto; z-index: 40; }
.bang-chuong .dong { display: block; padding: 10px 14px; border-bottom: 1px solid #eef1f5; color: var(--chu); }
.bang-chuong .dong:hover { background: #f8fafd; text-decoration: none; }
.bang-chuong .dong.chua { background: #f3f8ff; }
.bang-chuong .dong b { display: block; font-size: 13.5px; }
.anh-dai-dien { width: 32px; height: 32px; border-radius: 50%; background: #dfe7f2; color: var(--chinh); font-weight: 700; font-size: 12.5px; display: grid; place-items: center; flex: none; }
.menu-toi { position: absolute; top: 50px; right: 12px; width: 260px; z-index: 40; padding: 6px; }
.menu-toi a, .menu-toi button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; border: 0; background: none; color: var(--chu); cursor: pointer; }
.menu-toi a:hover, .menu-toi button:hover { background: var(--nen); text-decoration: none; }

/* Ngăn kéo bên phải + hộp thoại */
.man-toi { position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 50; }
.ngan-keo { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: #fff; z-index: 51; display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(16, 24, 40, .12); }
.ngan-keo header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--vien); }
.ngan-keo header h2 { font-size: 16px; margin: 0; flex: 1; }
.ngan-keo .than { padding: 16px 18px; overflow-y: auto; flex: 1; }
.ngan-keo footer { padding: 12px 18px; border-top: 1px solid var(--vien); display: flex; gap: 8px; justify-content: flex-end; }
.chon-nguoi { max-height: 190px; overflow: auto; border: 1px solid #cfd6e0; border-radius: 8px; padding: 4px; }
.chon-nguoi label { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.chon-nguoi label:hover { background: var(--nen); }

/* Ma trận phân quyền */
.ma-tran th.cc { min-width: 128px; text-align: center; }
.ma-tran td.o { text-align: center; padding: 6px; }
.ma-tran select { height: 30px; border-radius: 7px; border: 1px solid #cfd6e0; padding: 0 6px; font-size: 12.5px; background: #fff; }
.ma-tran select.v-quan_tri { background: var(--tim-nhat); border-color: #d3c4f5; color: var(--tim); font-weight: 600; }
.ma-tran select.v-thanh_vien { background: var(--chinh-nhat); border-color: #c3d6ee; color: var(--chinh); font-weight: 600; }
.ma-tran td.nguoi { min-width: 210px; }
.ma-tran td.nguoi .nho { display: block; }
.ma-tran tr.ngoai-le td { background: #fafbfc; }
.ma-tran th.tat { color: #98a2b3; }
.cong-tac { position: relative; display: inline-block; width: 34px; height: 20px; vertical-align: middle; }
.cong-tac input { opacity: 0; width: 0; height: 0; }
.cong-tac span { position: absolute; inset: 0; background: #cfd6e0; border-radius: 20px; cursor: pointer; transition: .15s; }
.cong-tac span::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.cong-tac input:checked + span { background: var(--xanh); }
.cong-tac input:checked + span::before { transform: translateX(14px); }

/* Trao đổi */
.trao-doi { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef1f5; }
.trao-doi:last-child { border-bottom: 0; }
.trao-doi .noi { white-space: pre-wrap; }
.tep-dong { display: flex; gap: 8px; align-items: center; padding: 6px 0; }

/* Đăng nhập */
.trang-dang-nhap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #eef3fa 0%, #f7f9fc 60%); }
.hop-dang-nhap { width: min(420px, 100%); padding: 28px; }
.hop-dang-nhap h1 { font-size: 20px; margin: 14px 0 4px; }
.hop-dang-nhap .logo .o { width: 42px; height: 42px; border-radius: 11px; background: var(--chinh); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }

/* Toast */
.bao-nhanh { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #1c2430; color: #fff; padding: 9px 16px; border-radius: 8px; z-index: 80; font-size: 13.5px; box-shadow: var(--bong); }

/* Dải xem thử */
.dai-xem-thu { background: #fff7e0; border-bottom: 1px solid #f3dfa6; padding: 7px 16px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dai-xem-thu select { height: 28px; border-radius: 6px; border: 1px solid #e3cf8f; background: #fff; }

/* ===== Điện thoại ===== */
@media (max-width: 900px) {
  .luoi.c4 { grid-template-columns: repeat(2, 1fr); }
  .luoi.c3, .luoi.c2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .dau .nut-mo-menu { display: inline-flex; }
  .khung { grid-template-columns: 1fr; }
  .ben { position: fixed; top: 56px; left: 0; bottom: 0; width: 270px; z-index: 30; transform: translateX(-102%); transition: transform .18s; height: auto; box-shadow: 8px 0 24px rgba(16,24,40,.12); }
  .ben.mo { transform: none; }
  .chinh-giua { padding: 16px 14px 60px; }
  .dau .logo small { display: none; }
  .dau .chon-don-vi { max-width: 150px; margin-left: 0; }
  .bang-chuong { left: 8px; right: 8px; width: auto; }
  .an-dt { display: none; }
  .bang td, .bang th { padding: 9px 8px; }
}

/* ===== Bản 0.3: công cụ mở rộng, bảng điều hành, sự kiện ===== */
.dau .logo .o.su_kien { background: #6d28d9; }
.hang-qua-han td:first-child { box-shadow: inset 3px 0 0 var(--do); }
.o-tinh { display: flex; flex-wrap: wrap; gap: 10px 22px; background: var(--nen); border-radius: 8px; padding: 10px 12px; margin: 4px 0 10px; }
.o-tinh > span { display: flex; flex-direction: column; }
.o-tinh b { font-size: 17px; }
.nut-them { flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.phan-duoi { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--vien); }
.phan-duoi:empty { display: none; }
.goi-y-ten { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.nhac { color: var(--chinh); font-weight: 600; }
.tra-loi { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--chinh-nhat); cursor: pointer; }
.tra-loi.phu { background: var(--nen); }
.tra-loi blockquote { margin: 6px 0 0; padding-left: 10px; border-left: 3px solid var(--chinh); font-style: italic; }
.dau-the { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--vien); }
.dong-dh { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--vien); color: inherit; }
.dong-dh:last-child { border-bottom: 0; }
a.dong-dh:hover { background: var(--nen); text-decoration: none; }
a.the.so-lieu { color: inherit; }
a.the.so-lieu:hover { text-decoration: none; border-color: var(--chinh); }
.tieu-de-nho { font-size: 14px; margin: 0 0 10px; color: var(--chu-phu); text-transform: uppercase; letter-spacing: .3px; }
.so-tt { color: var(--chu-phu); font-weight: 600; font-size: 11.5px; }
/* Không để bảng rộng đẩy lưới tràn màn hình điện thoại */
.luoi > *, .khung > * { min-width: 0; }
@media (max-width: 760px) { .khung { grid-template-columns: minmax(0, 1fr); } .dau .logo { white-space: nowrap; } .dau .logo .o { flex: none; } }

/* ===== Bản 0.4: Truyền thông (lịch tuần, đăng một chạm, hiệu quả) và CRM đối tác ===== */
.chuyen-xem { display: inline-flex; background: var(--the); border: 1px solid var(--vien); border-radius: 8px; padding: 2px; margin-right: 10px; }
.chuyen-xem a { padding: 5px 12px; border-radius: 6px; color: var(--chu-phu); font-weight: 600; font-size: 13px; }
.chuyen-xem a.dang { background: var(--chinh-nhat); color: var(--chinh); }
.chuyen-xem a:hover { text-decoration: none; }
.lich-dau { margin-bottom: 10px; gap: 10px; flex-wrap: wrap; }
.lich-tuan { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.cot-ngay { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo); padding: 8px; min-height: 220px; display: flex; flex-direction: column; gap: 6px; }
.cot-ngay.hom-nay { border-color: var(--chinh); box-shadow: inset 0 3px 0 var(--chinh); }
.dau-ngay { display: flex; justify-content: space-between; font-size: 12px; color: var(--chu-phu); padding-bottom: 4px; border-bottom: 1px solid var(--vien); }
.dau-ngay b { color: var(--chu); }
.trong-nho { font-size: 12px; color: #a0a8b4; text-align: center; padding: 18px 0; border: 1px dashed var(--vien); border-radius: 8px; }
.the-lich, .the-buoc { background: var(--the); border: 1px solid var(--vien); border-radius: 8px; padding: 7px 9px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; font-size: 13px; box-shadow: var(--bong); }
.the-lich:hover, .the-buoc:hover { border-color: var(--chinh); }
.the-lich.keo, .the-buoc.keo { cursor: grab; }
.dang-keo { opacity: .45; }
.tha-vao { outline: 2px dashed var(--chinh); outline-offset: -2px; background: var(--chinh-nhat); }
.the-lich .kenh { font-size: 11px; font-weight: 700; color: var(--chinh); text-transform: uppercase; letter-spacing: .2px; }
.the-lich b { font-weight: 600; line-height: 1.3; }
.tt { font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; color: var(--chu-phu); }
.tt::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #a0a8b4; }
.tt.vang::before { background: var(--vang); } .tt.tim::before { background: var(--tim); } .tt.xanh::before { background: var(--xanh); }
.tt.xanh-duong::before { background: var(--chinh); } .tt.do::before { background: var(--do); }
.chua-xep { background: var(--the); border: 1px dashed var(--vien); border-radius: var(--bo); padding: 10px; margin-bottom: 8px; }
.hang-the { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hang-the .the-lich { width: 210px; }
.thong-ke-tt { margin-bottom: 12px; }
.o-so-tt { display: flex; gap: 28px; padding: 10px 14px; border-bottom: 1px solid var(--vien); }
.o-so-tt > span { display: flex; flex-direction: column; } .o-so-tt b { font-size: 20px; }
.top-bai { padding: 10px 0; border-left: 1px solid var(--vien); }
.top-bai > b { display: block; padding: 0 14px 4px; }
.top-bai .dong-dh { cursor: pointer; }
.bang-buoc { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(176px, 1fr); gap: 10px; padding-bottom: 6px; }
.cot-buoc { background: #eef1f5; border-radius: var(--bo); padding: 8px; display: flex; flex-direction: column; gap: 7px; min-height: 260px; }
.dau-buoc { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 4px; font-size: 13px; }
.the-buoc .hang { gap: 6px; flex-wrap: wrap; }
.dang-mot-cham { margin-top: 12px; background: var(--chinh-nhat); border-radius: 10px; padding: 12px; }
.link-td { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.link-td code { background: var(--the); border: 1px solid var(--vien); border-radius: 6px; padding: 5px 8px; font-size: 12.5px; word-break: break-all; user-select: all; }
.nhom-lq { margin-bottom: 10px; }
.nhom-lq .dong-dh { cursor: pointer; border: 1px solid var(--vien); border-radius: 8px; margin-top: 6px; }
@media (max-width: 760px) {
  .lich-tuan { grid-template-columns: minmax(0, 1fr); }
  .cot-ngay { min-height: 0; }
  .top-bai { border-left: 0; border-top: 1px solid var(--vien); }
}
.luoi.c2.doi-deu { grid-template-columns: 1fr 1fr; } @media (max-width: 900px) { .luoi.c2.doi-deu { grid-template-columns: 1fr; } }

.thong-ke-tt .chi-dt { display: none; }
@media (max-width: 760px) { .xem-lich-trang .thong-ke-tt .tk-chi-tiet { display: none; } .xem-lich-trang .thong-ke-tt .chi-dt { display: block; } }
.chon-bat-dau { display: grid; gap: 10px; }
.nut-chon { text-align: left; padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; font: inherit; border: 1px solid var(--vien, #e3e6ea); }
.nut-chon:hover { border-color: var(--chinh, #1f4e8c); }

/* ===== Hướng dẫn từng bước + Trợ lý (bản 0.5) ===== */
.nut.tron-chu { height: 36px; border-radius: 18px; padding: 0 12px; gap: 6px; display: inline-flex; align-items: center; font-weight: 600; }
#nut-hd { font-weight: 800; font-size: 16px; }
#hd-lop { position: fixed; inset: 0; z-index: 900; }
#hd-lop.khong-chi { background: rgba(15, 23, 42, .55); }
.hd-sang { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55); outline: 2px solid #fff; pointer-events: none; transition: all .2s ease; }
.hd-the { position: fixed; background: #fff; border-radius: 12px; padding: 14px 16px 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25); max-width: calc(100vw - 24px); }
.hd-the p { margin: 6px 0 12px; line-height: 1.5; }
.hd-dem { font-size: 12px; color: var(--chu-phu); margin-bottom: 4px; }
.hd-nut { display: flex; gap: 6px; align-items: center; }
.tl-khung { position: fixed; right: 18px; bottom: 18px; width: 380px; max-width: calc(100vw - 24px); height: min(620px, calc(100vh - 100px)); z-index: 800; display: flex; flex-direction: column; box-shadow: 0 16px 48px rgba(0,0,0,.2); overflow: hidden; }
.tl-dau { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--vien); }
.tl-noi { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--nen); }
.tl-tin { padding: 9px 12px; border-radius: 12px; max-width: 92%; line-height: 1.5; font-size: 13.5px; }
.tl-tin p { margin: 0 0 6px; } .tl-tin p:last-child { margin: 0; } .tl-tin ul { margin: 4px 0; padding-left: 18px; }
.tl-tin.may { background: #fff; border: 1px solid var(--vien); align-self: flex-start; }
.tl-tin.nguoi { background: var(--chinh); color: #fff; align-self: flex-end; white-space: pre-wrap; }
.tl-nguon { margin-top: 6px; border-top: 1px dashed var(--vien); padding-top: 5px; }
.tl-goi-y { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-goi-y .nut { height: auto; padding: 6px 10px; white-space: normal; text-align: left; }
.tl-o { display: flex; gap: 8px; padding: 10px 12px 4px; border-top: 1px solid var(--vien); }
.tl-o textarea { flex: 1; resize: none; min-height: 38px; max-height: 110px; }
.tl-chan { margin: 0; padding: 0 12px 10px; font-size: 11.5px; }
.tl-cho i { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--chu-phu); animation: tl-nhay 1s infinite; }
.tl-cho i:nth-child(2) { animation-delay: .15s; } .tl-cho i:nth-child(3) { animation-delay: .3s; }
@keyframes tl-nhay { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (max-width: 760px) { .tl-khung { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; border-radius: 0; } }
@media (max-width: 760px) {
  .dau { gap: 6px; }
  .dau .logo > div:not(.o) { display: none; }
  .dau .chon-don-vi { max-width: 120px; min-width: 0; flex: 0 1 auto; }
  .dau .nut.tron, .dau .nut.tron-chu { width: 34px; height: 34px; padding: 0; justify-content: center; flex: none; }
  #nut-toi { width: 34px !important; padding: 0 !important; }
}
