:root {
  --nen: #F4F6F9; --mat: #FFFFFF; --vien: #E3E6EB; --vien-dam: #CDD2DA;
  --chu: #1A1F2B; --chu-phu: #5B6474; --chu-vua: #3D4555;
  --nhan: #1D5FD1; --nhan-dam: #174A9F; --nhan-nhat: #E8F0FD;
  --cam-nen: #FFF4E5; --cam-chu: #8A3F00; --cam-vien: #F5D9B3;
  --xanh-nen: #EAF7EE; --xanh-chu: #166534; --xanh-vien: #BFE3C9;
  --do-nen: #FDECEC; --do-chu: #9F1D1D;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--nen); color: var(--chu); font-family: 'Be Vietnam Pro', system-ui, sans-serif; font-size: 14px; }
button, input, textarea { font: inherit; }
.gian { flex: 1 1 auto; }
.phu { font-size: 13px; color: var(--chu-phu); }

.dau { background: var(--mat); border-bottom: 1px solid var(--vien); padding: 10px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.thuong-hieu { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--nhan); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.dieu-huong { display: flex; flex-wrap: wrap; gap: 4px; }
.dieu-huong a, .dieu-huong span { padding: 10px 14px; border-radius: 8px; text-decoration: none; color: var(--chu-vua); }
.dieu-huong .dang-mo { background: var(--nhan-nhat); color: var(--nhan-dam); font-weight: 600; }
.dieu-huong .sap-co { color: #8A93A3; cursor: default; }
.cong-tac-nho { display: flex; align-items: center; gap: 6px; color: var(--chu-vua); min-height: 44px; }
.nut-chung { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 22px; font-weight: 600; cursor: pointer; border: 1px solid var(--xanh-vien); background: var(--xanh-nen); color: var(--xanh-chu); }
.nut-chung::before { content: ""; width: 10px; height: 10px; border-radius: 5px; background: #16A34A; }
.nut-chung[aria-pressed="true"] { border-color: var(--cam-vien); background: var(--cam-nen); color: var(--cam-chu); }
.nut-chung[aria-pressed="true"]::before { background: #D97706; }
.bang-tu-dong { background: var(--cam-nen); color: var(--cam-chu); border-bottom: 1px solid var(--cam-vien); padding: 10px 24px; }
.thong-bao { background: var(--do-nen); color: var(--do-chu); padding: 10px 24px; }

.than { display: flex; flex-wrap: wrap; min-height: calc(100vh - 66px); }
.cot-trai { flex: 1 1 300px; max-width: 360px; min-width: 0; background: var(--mat); border-right: 1px solid var(--vien); display: flex; flex-direction: column; }
.loc { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--vien); }
.loc button { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--vien-dam); background: var(--mat); color: var(--chu-vua); cursor: pointer; font-size: 13px; }
.loc button[aria-pressed="true"] { border-color: var(--nhan); background: var(--nhan-nhat); color: var(--nhan-dam); font-weight: 600; }
.danh-sach { overflow-y: auto; }
.dong-ht { display: flex; gap: 12px; width: 100%; padding: 14px 16px; border: none; border-bottom: 1px solid #EEF0F3; background: var(--mat); text-align: left; cursor: pointer; color: inherit; }
.dong-ht.dang-mo { background: var(--nhan-nhat); box-shadow: inset 3px 0 0 var(--nhan); }
.anh { width: 40px; height: 40px; border-radius: 20px; background: #E9ECF1; color: var(--chu-vua); display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none; }
.noi-dung-dong { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hang-ten { display: flex; align-items: center; gap: 6px; }
.hang-ten .ten-dong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hang-ten .gio { margin-left: auto; font-size: 12px; color: var(--chu-phu); flex: none; }
.trich { font-size: 13px; color: var(--chu-vua); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.the { align-self: flex-start; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.the-kenh { background: var(--nhan-nhat); color: var(--nhan-dam); padding: 1px 6px; font-size: 11px; }
.the-cho_sep, .the-moi { background: var(--cam-nen); color: var(--cam-chu); }
.the-can_goi_lai { background: var(--do-nen); color: var(--do-chu); }
.the-ai_da_tra_loi { background: var(--xanh-nen); color: var(--xanh-chu); }
.the-sep_da_tra_loi { background: #EEF0F3; color: var(--chu-vua); }
.trong-ds { padding: 20px 16px; color: var(--chu-phu); }

.cot-giua { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; }
.trong { padding: 40px; color: var(--chu-phu); }
#hoi-thoai { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#hoi-thoai[hidden] { display: none; }
.dau-ht { background: var(--mat); border-bottom: 1px solid var(--vien); padding: 12px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.dau-ht .ten { font-weight: 600; font-size: 16px; }
.phan-doan { display: flex; border: 1px solid var(--vien-dam); border-radius: 8px; overflow: hidden; }
.phan-doan button { min-height: 40px; padding: 0 14px; border: none; background: var(--mat); color: var(--chu-vua); cursor: pointer; font-size: 13px; }
.phan-doan button[aria-pressed="true"] { background: var(--nhan); color: #fff; font-weight: 600; }
.tin { flex: 1 1 auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: calc(100vh - 380px); min-height: 200px; }
.bong { max-width: 70%; display: flex; flex-direction: column; gap: 4px; }
.bong .chu { padding: 10px 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.bong .ghi { font-size: 12px; color: var(--chu-phu); }
.bong-khach { align-self: flex-start; }
.bong-khach .chu { background: var(--mat); border: 1px solid var(--vien); border-radius: 12px 12px 12px 4px; }
.bong-ra { align-self: flex-end; align-items: flex-end; }
.bong-ra .chu { background: var(--nhan); color: #fff; border-radius: 12px 12px 4px 12px; }
.bong-ra.loi .chu { background: var(--do-nen); color: var(--do-chu); }
.khung-nhap { background: var(--mat); border-top: 1px solid var(--vien); padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.nhan-nhap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nhan-nhap .the { background: var(--nhan-nhat); color: var(--nhan-dam); }
textarea, input[type="text"] { border: 1px solid var(--vien-dam); border-radius: 8px; padding: 10px 12px; line-height: 1.5; }
textarea { resize: vertical; }
input[type="text"] { height: 44px; }
.hang-nut { display: flex; flex-wrap: wrap; gap: 8px; }
.nut-chinh { min-height: 44px; padding: 0 18px; border: none; border-radius: 8px; background: var(--nhan); color: #fff; font-weight: 600; cursor: pointer; }
.nut-phu { min-height: 44px; padding: 0 16px; border: 1px solid var(--vien-dam); border-radius: 8px; background: var(--mat); color: var(--chu); cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }

.cot-phai { flex: 1 1 260px; max-width: 320px; min-width: 0; background: var(--mat); border-left: 1px solid var(--vien); padding: 20px; }
.cot-phai h2 { font-size: 15px; margin: 0 0 14px; }
.cot-phai dl { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.cot-phai dt { font-size: 12px; color: var(--chu-phu); }
.cot-phai dd { margin: 2px 0 0; word-break: break-word; }

@media (max-width: 760px) {
  .cot-trai, .cot-phai { max-width: none; }
  .tin { max-height: none; }
}
