/* Tin báo (tiền tố tb-) và Tổng quan (tiền tố tq-). Màu, cỡ chữ theo design/TinBao.dc.html, TongQuan.dc.html, TongQuanPC.dc.html. */

/* ================= Tin báo ================= */
.tb-form-chan .nut-chung.chinh, .tb-ct-muc .nut-chung.chinh, .tq-dong-nut .nut-chung.chinh { flex: none; }

.tb-trang { display: flex; gap: 20px; height: 100%; min-height: 0; }
.tb-cot { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }

/* Ngăn tạo tin (cột trái 350px) */
.tb-form { width: 350px; flex: none; min-height: 0; max-height: 100%; background: #fff; border: 1px solid var(--vien); border-radius: 16px; display: flex; flex-direction: column; }
.tb-form-tieu-de { margin: 0; padding: 18px 18px 2px; font-size: calc(16px * var(--co-chu)); font-weight: 700; color: var(--xanh-dam); flex: none; }
.tb-form-than { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 18px 14px; display: flex; flex-direction: column; gap: 12px; }
.tb-form-than > * { flex: none; }
.tb-form-chan { flex: none; padding: 8px 18px 18px; }
.tb-o { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.tb-nhan { font-size: calc(13px * var(--co-chu)); font-weight: 700; color: var(--nau); }
.tb-nhan i { color: #C0392B; font-style: normal; }
.tb-chip-nhom { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-chip-nhom .chip { height: 32px; padding: 0 12px; font-size: calc(13px * var(--co-chu)); font-weight: 500; border-width: 1.5px; gap: 6px; }
.tb-nhap { height: 44px; width: 100%; border-radius: 10px; border: 1.5px solid var(--vien-dam); background: var(--ban-ghi); padding: 0 12px; font-size: calc(14.5px * var(--co-chu)); color: var(--chu); }
.tb-nhap::placeholder { color: #A39C8B; }
.tb-nhap:focus { border-color: var(--xanh-rung); outline: none; background: #fff; box-shadow: 0 0 0 3px rgba(45, 102, 53, .15); }
.tb-nhap.co-loi { border-color: #D9534F; background: #FFF5F4; }
.tb-vung { height: 78px; padding: 10px 12px; resize: none; line-height: 1.4; font-family: inherit; }
.tb-anh-hang { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tb-anh-xem { position: relative; width: 56px; height: 56px; border-radius: 10px; flex: none; }
.tb-anh-xem img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.tb-anh-xem button { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--chu); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.nut-chung.tb-them-anh { flex: 1; min-width: 130px; height: 56px; border: 1.5px dashed #CFC9B8; border-radius: 12px; color: var(--chu-phu); font-size: calc(13px * var(--co-chu)); font-weight: 500; background: none; }
.tb-chon { position: relative; display: block; min-width: 0; }
.tb-chon select { width: 100%; height: 40px; border-radius: 10px; border: 1.5px solid var(--vien-dam); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237A7363' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none; appearance: none; padding: 0 32px 0 12px; font-size: 14px; font-weight: 500; color: var(--chu); text-overflow: ellipsis; }
.tb-chon select:focus { border-color: var(--xanh-rung); outline: none; box-shadow: 0 0 0 3px rgba(45, 102, 53, .15); }
.tb-chon-dai select { height: 44px; font-weight: 500; }

/* Thanh lọc */
.tb-loc { display: flex; flex-direction: column; gap: 8px; flex: none; }
.tb-chip-loai { gap: 6px; padding: 2px 2px 4px; }
.tb-chip-loai .chip { height: 36px; padding: 0 14px; font-size: calc(14px * var(--co-chu)); }
.tb-loc-phu { display: flex; gap: 8px; align-items: center; }
.tb-loc-phu .o-tim { flex: 1; height: 40px; min-width: 150px; }
.tb-loc-phu .tb-chon { flex: none; width: 170px; }

/* Danh sách và thẻ tin */
.tb-ds { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px 2px 8px; }
.tb-the { flex: none; display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; background: #fff; border: 1px solid var(--vien); border-radius: 16px; color: inherit; }
.tb-the:hover { border-color: var(--vien-dam); }
.tb-the.dang-mo { border-color: var(--xanh-rung); box-shadow: 0 0 0 1.5px var(--xanh-rung) inset; }
.tb-icon-loai { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.tb-the-giua { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tb-the-dau { display: flex; align-items: center; gap: 8px; }
.tb-tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap; flex: none; }
.tb-cham-do { width: 8px; height: 8px; border-radius: 50%; background: var(--cam); flex: none; }
.tb-gio { margin-left: auto; font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); white-space: nowrap; }
.tb-tieu-de { font-size: calc(15px * var(--co-chu)); line-height: 1.3; overflow-wrap: anywhere; }
.tb-noi-dung { font-size: calc(13.5px * var(--co-chu)); color: #4A4436; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tb-meta { display: flex; gap: 8px; align-items: center; font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); min-width: 0; margin-top: 1px; }
.tb-meta-chu { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-meta-tt { margin-left: auto; flex: none; }
.tb-anh-nho { position: relative; width: 64px; height: 64px; border-radius: 10px; background: #EFEDE5; color: #A39C8B; display: flex; align-items: center; justify-content: center; flex: none; }
.tb-anh-nho b { position: absolute; right: 4px; bottom: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--xanh-rung); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }

/* Chi tiết */
.tb-ct { display: flex; flex-direction: column; gap: 14px; }
.tb-ct-dau { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-ct-tieu-de { margin: 0; font-size: calc(18px * var(--co-chu)); line-height: 1.3; color: var(--chu); overflow-wrap: anywhere; }
.tb-ct-noi-dung { margin: 0; font-size: calc(15px * var(--co-chu)); line-height: 1.5; color: #4A4436; white-space: pre-wrap; overflow-wrap: anywhere; }
.tb-ct-anh { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tb-ct-anh button { padding: 0; border: 1px solid var(--vien); border-radius: 12px; overflow: hidden; background: #EFEDE5; aspect-ratio: 1; }
.tb-ct-anh img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tb-ct-luoi { display: flex; flex-direction: column; border: 1px solid #EEEAE0; border-radius: 12px; background: var(--ban-ghi); }
.tb-ct-dong { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; padding: 10px 14px; font-size: calc(14px * var(--co-chu)); }
.tb-ct-dong + .tb-ct-dong { border-top: 1px solid #EEEAE0; }
.tb-ct-dong span { color: var(--chu-phu); flex: none; }
.tb-ct-dong b { text-align: right; overflow-wrap: anywhere; font-weight: 500; }
.tb-ct-muc { display: flex; flex-direction: column; gap: 10px; }
.tb-buoc { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.tb-buoc li { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 6px 8px; border-radius: 12px; border: 1.5px solid var(--vien-dam); background: #fff; color: var(--chu-phu); font-weight: 700; font-size: calc(13.5px * var(--co-chu)); text-align: center; line-height: 1.2; }
.tb-buoc li.qua { background: var(--kem); color: var(--xanh-rung); border-color: var(--vien); }
.tb-buoc li.dang { background: #E8F4EA; border-color: var(--xanh-rung); color: var(--xanh-dam); }
.tb-buoc-so { width: 22px; height: 22px; border-radius: 50%; background: var(--vien); color: var(--chu-phu); display: inline-flex; align-items: center; justify-content: center; font-size: calc(12px * var(--co-chu)); flex: none; }
.tb-buoc li.qua .tb-buoc-so { background: var(--xanh-rung); color: #fff; }
.tb-buoc li.dang .tb-buoc-so { background: var(--xanh-rung); color: #fff; }
.tb-ghi-chu { margin: 0; font-size: calc(13.5px * var(--co-chu)); color: var(--chu-phu); line-height: 1.45; }
.tb-ghi-chu.tb-xong { display: flex; align-items: center; gap: 6px; color: var(--xanh-rung); font-weight: 700; }
.tb-da-xem { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid #EEEAE0; border-radius: 12px; }
.tb-da-xem li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: calc(14px * var(--co-chu)); }
.tb-da-xem li + li { border-top: 1px solid #EEEAE0; }
.tb-da-xem li span.so { margin-left: auto; font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); white-space: nowrap; }
.tb-av { width: 28px; height: 28px; border-radius: 50%; background: var(--avatar); color: var(--xanh-rung); font-weight: 700; font-size: calc(13px * var(--co-chu)); display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* Xem ảnh phóng to */
.tb-phong-to { position: fixed; inset: 0; z-index: 80; background: rgba(10, 20, 12, .9); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tb-phong-to img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.tb-phong-to button { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .18); color: #fff; display: flex; align-items: center; justify-content: center; }
.tb-phong-to button:disabled { opacity: .3; }
.tb-pt-dong { top: 16px; right: 16px; }
.tb-pt-truoc { left: 16px; top: 50%; margin-top: -24px; }
.tb-pt-sau { right: 16px; top: 50%; margin-top: -24px; }
.tb-pt-dem { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-weight: 700; font-size: calc(14px * var(--co-chu)); background: rgba(0, 0, 0, .4); padding: 4px 12px; border-radius: 999px; }

/* iPad: chip lọc sát như thiết kế để 7 chip vừa một hàng */
@media (min-width: 768px) and (max-width: 1299px) {
  .tb-chip-loai .chip { height: 34px; padding: 0 8px; font-size: calc(13px * var(--co-chu)); }
  .tb-chip-loai { gap: 5px; }
  .tb-loc-phu .tb-chon { width: 150px; }
}

/* Điện thoại: một cột, trang cuộn chung */
@media (max-width: 767px) {
  .tb-trang { flex-direction: column; height: auto; gap: 12px; }
  .tb-cot { gap: 10px; }
  .tb-ds { overflow: visible; }
  .tb-loc-phu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .tb-loc-phu .o-tim { grid-column: 1 / -1; min-width: 0; }
  .tb-loc-phu .tb-chon { width: auto; }
  .tb-meta { flex-wrap: wrap; row-gap: 6px; }
  .tb-meta-chu { white-space: normal; flex: 1 1 140px; }
  .tb-chon select, .tb-chon-dai select { font-size: 16px; }
  .tb-nhap { font-size: calc(16px * var(--co-chu)); }
  .tb-the { padding: 12px; gap: 12px; }
  .tb-noi-dung { font-size: calc(14px * var(--co-chu)); }
  .tb-meta { font-size: calc(13px * var(--co-chu)); }
  .tb-ct-noi-dung { font-size: calc(15.5px * var(--co-chu)); }
  .tb-trang-tao { gap: 0; }
  .tb-trang-tao .tb-form-tieu-de { display: none; }   /* thanh trên đã ghi "Tạo tin báo" */
  .tb-trang-tao .tb-form-than { padding-top: 16px; }
  .tb-form { width: 100%; max-height: none; }
  .tb-form-than { overflow: visible; }
  .tb-form-chan { position: sticky; bottom: -16px;   /* -16px bù lề dưới 16px của .noi-dung-dt */
    background: #fff; border-radius: 0 0 16px 16px; border-top: 1px solid #EEEAE0; padding-bottom: 14px; }
  .tb-chip-nhom .chip { height: 38px; font-size: calc(14px * var(--co-chu)); }
}

/* ================= Tổng quan (tiền tố tq-) ================= */
.tq-trang { display: flex; flex-direction: column; gap: 16px; }
.tq-trang.dang-doi .tq-hang { opacity: .55; transition: opacity .15s; }
.tq-hang { display: grid; gap: 16px; min-width: 0; }
.tq-hang-so { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tq-hang-bd { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tq-hang-duoi { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch; }
.tq-hang-duoi.hai { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tq-h2 { margin: 0; font-size: calc(16px * var(--co-chu)); font-weight: 700; color: var(--xanh-dam); }

/* Thanh công cụ: ngày, khu, cập nhật */
.tq-thanh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tq-ngay { display: flex; align-items: center; gap: 6px; }
.tq-vien { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid var(--vien-dam); font-size: calc(13.5px * var(--co-chu)); font-weight: 500; color: var(--chu); white-space: nowrap; }
.tq-vien:focus-within { border-color: var(--xanh-rung); box-shadow: 0 0 0 3px rgba(45, 102, 53, .15); }
.tq-ngay-nhan { cursor: pointer; }
.tq-ngay-nhan input[type='date'] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; }
.tq-ngay-nut { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--vien-dam); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--chu); flex: none; }
.tq-ngay-nut:disabled { opacity: .4; cursor: default; }
.tq-ve-nay { height: 40px; padding: 0 12px; border-radius: 999px; border: 0; background: none; color: var(--xanh-rung); font-weight: 700; font-size: calc(13.5px * var(--co-chu)); }
.tq-chon-khu { padding-right: 36px; }
.tq-chon-khu select { -webkit-appearance: none; appearance: none; border: 0; background: none; font: inherit; font-weight: 500; color: inherit; height: 100%; padding: 0 4px 0 0; outline: none; cursor: pointer; }
.tq-chon-khu > svg { position: absolute; right: 12px; pointer-events: none; }
.tq-cap-nhat { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); }

/* 4 ô số lớn */
.tq-o-so { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tq-o-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tq-o-nhan { font-size: calc(13px * var(--co-chu)); font-weight: 500; color: var(--chu-phu); }
.tq-o-icon { color: var(--xanh-rung); display: inline-flex; }
.tq-o-so-lon { font-size: calc(26px * var(--co-chu)); font-weight: 700; color: var(--xanh-dam); white-space: nowrap; line-height: 1.2; }
.tq-o-phu { font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); line-height: 1.35; }
.tq-ss.tang { color: var(--xanh-rung); font-weight: 500; }
.tq-ss.giam { color: var(--canh-bao); font-weight: 500; }
.tq-tien-do { height: 6px; border-radius: 3px; background: #EEEAE0; overflow: hidden; }
.tq-tien-do i { display: block; height: 100%; border-radius: 3px; background: var(--xanh-rung); }
.tq-chua-thu { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--kem); color: var(--chu-phu); font-size: calc(12.5px * var(--co-chu)); font-weight: 500; }
.tq-chua-thu.co { background: #FDE6E3; color: var(--canh-bao); }

/* Biểu đồ */
.tq-the-bd { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-height: 250px; min-width: 0; }
.tq-bd-dau { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tq-chu-thich { font-size: calc(12px * var(--co-chu)); color: var(--chu-phu); text-align: right; }
.tq-khu-ds { display: flex; flex-direction: column; gap: 12px; }
.tq-khu-dong { display: flex; align-items: center; gap: 10px; font-size: calc(13px * var(--co-chu)); }
.tq-khu-ten { width: 150px; flex: none; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tq-khu-nen { flex: 1; min-width: 0; height: 14px; border-radius: 7px; background: #F2F0E8; overflow: hidden; }
.tq-khu-nen i { display: block; height: 100%; border-radius: 7px; min-width: 4px; }
.tq-khu-tien { width: 96px; flex: none; text-align: right; font-weight: 700; color: var(--xanh-dam); white-space: nowrap; }
.tq-cot-vung { --cao: 139px; flex: 1; display: flex; gap: 4px; align-items: flex-end; min-height: 160px; }
.tq-cot { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.tq-cot-so { font-size: 10.5px; font-weight: 700; color: var(--xanh-dam); line-height: 1; }
.tq-cot-so.mo { color: #A39C8B; }
.tq-cot-thanh { display: block; width: 70%; height: max(calc(var(--cao) * var(--t)), 2px); border-radius: 5px 5px 2px 2px; background: var(--xanh-rung); }
.tq-cot-thanh.nay { background: #E0663A; }
.tq-cot-thanh.du-kien { background: repeating-linear-gradient(135deg, #CFE3D2 0 4px, #EAF4EB 4px 8px); }
.tq-cot-gio { font-size: 11px; color: var(--chu-phu); line-height: 1; }

/* Hàng dưới: Đặt lịch hôm nay, Cần quản lý xử lý, Nguồn khách */
.tq-the-duoi { padding: 14px 18px; display: flex; flex-direction: column; min-height: 290px; min-width: 0; }
.tq-mo-ta { color: var(--chu-phu); font-size: calc(13px * var(--co-chu)); line-height: 1.35; overflow-wrap: anywhere; }
.tq-mo-ta.do { color: var(--canh-bao); font-weight: 500; }
.tq-luu-y { font-style: italic; }
.tq-lk-hd { color: var(--xanh-rung); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.tq-lich-dong { display: flex; gap: 10px; align-items: center; min-height: 52px; padding: 8px 0; border-bottom: 1px solid #F0ECE2; color: inherit; font-size: calc(13px * var(--co-chu)); }
.tq-the-lich .tq-h2 { margin-bottom: 2px; }
.tq-lich-dong.co-lk { color: var(--chu); }
.tq-lich-dong.co-lk:hover { background: var(--bac-ha); }
.tq-lich-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--bac-ha); color: var(--xanh-rung); display: flex; align-items: center; justify-content: center; flex: none; }
.tq-lich-chu { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tq-lich-chu b { font-size: calc(13.5px * var(--co-chu)); }
.tq-the-nguon { gap: 9px; }
.tq-nguon-thanh { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #F2F0E8; }
.tq-nguon-thanh i { display: block; height: 100%; }
.tq-nguon-dong { display: flex; align-items: center; gap: 8px; font-size: calc(13px * var(--co-chu)); }
.tq-nguon-dong > i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tq-nguon-dong b { margin-left: auto; }
.tq-ktv { justify-content: space-between; }
.tq-gach { height: 1px; background: #EEEAE0; margin: 2px 0; flex: none; }
.tq-nhan-nho { font-size: calc(13px * var(--co-chu)); font-weight: 700; color: #8A8372; }
.tq-trong { margin: 0; font-size: calc(13px * var(--co-chu)); color: var(--chu-phu); }

/* Cần quản lý xử lý */
.tq-the-xu-ly { max-height: 620px; }   /* danh sách dài thì cuộn trong khung, hàng dưới vẫn đều nhau */
.tq-xu-ly-than { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -8px; padding: 0 8px; overscroll-behavior: contain; }
.tq-xu-ly-dau { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tq-tag-so { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: #D2452F; color: #fff; font-size: 11.5px; font-weight: 700; }
.tq-nhom { margin-top: 8px; }
.tq-nhom-tieu { margin: 0; padding: 6px 0 2px; font-size: calc(13px * var(--co-chu)); font-weight: 700; color: var(--canh-bao); display: flex; align-items: center; gap: 8px; }
.tq-nhom-dem { height: 20px; padding: 0 8px; border-radius: 999px; background: #FDE6E3; font-size: 11.5px; display: inline-flex; align-items: center; }
.tq-dong { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid #F0ECE2; }
.tq-dong-chu { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: calc(13px * var(--co-chu)); line-height: 1.35; }
.tq-dong-chu > b { font-size: calc(13.5px * var(--co-chu)); overflow-wrap: anywhere; }
.tq-dong-nut { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.nut-chung.tq-nut-cao { height: 40px; font-size: calc(13.5px * var(--co-chu)); padding: 0 14px; }
.tq-dong-doc { flex-direction: column; align-items: stretch; }
.tq-dong-doc .tq-dong-chu { flex: none; }
.tq-dong-doc .tq-dong-nut { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tq-dong-doc .tq-dong-nut > :nth-child(3) { grid-column: 1 / -1; }
.tq-dong-doc .nut-chung.tq-nut-cao { padding: 0 8px; font-size: calc(13.5px * var(--co-chu)); white-space: normal; line-height: 1.15; }
.tq-dong.do { background: #FFF7F6; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; border-bottom-color: transparent; }
.tq-dong-anh { flex-wrap: nowrap; align-items: flex-start; gap: 12px; }
.tq-dong-anh .tq-dong-nut { margin-top: 6px; }
.tq-anh-nho { width: 64px; height: 64px; flex: none; padding: 0; border: 1px solid var(--vien); border-radius: 10px; overflow: hidden; background: #EFEDE5; }
.tq-anh-nho img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tq-anh-het { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 10.5px; color: #A39C8B; padding: 4px; line-height: 1.2; }
.tq-tag-do { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; margin-left: 6px; border-radius: 6px; background: #FDE6E3; color: var(--canh-bao); font-size: 11.5px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.tq-nv-tu-van { display: inline-flex; align-items: center; gap: 4px; }
.tq-nv-tu-van b { color: var(--chu); }
.tq-xem-them { align-self: flex-start; height: 40px; margin-top: 2px; padding: 0 2px; border: 0; background: none; color: var(--xanh-rung); font-weight: 700; font-size: calc(13.5px * var(--co-chu)); }
.tq-con-nua { margin: 4px 0 0; font-size: calc(12.5px * var(--co-chu)); color: var(--chu-phu); }
.tq-het-viec { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 12px; text-align: center; color: var(--chu-phu); font-size: calc(13.5px * var(--co-chu)); }
.tq-het-viec svg { color: var(--xanh-rung); }
.tq-het-viec b { color: var(--chu); font-size: calc(15px * var(--co-chu)); }

/* Hộp thoại (hết ngày, nghi sai) */
.tq-hop { display: flex; flex-direction: column; gap: 10px; }
.tq-hop-tom { font-size: calc(14.5px * var(--co-chu)); }
.tq-hop-luu-y { margin: 0; font-size: calc(13.5px * var(--co-chu)); color: #4A4436; line-height: 1.45; background: var(--ban-ghi); border: 1px solid #EEEAE0; border-radius: 10px; padding: 10px 12px; }
.tq-hop-goi-y { display: flex; flex-wrap: wrap; gap: 8px; }
.tq-hop-nhan { font-size: calc(13px * var(--co-chu)); font-weight: 700; color: var(--nau); }
.tq-hop-nhan i { color: #C0392B; font-style: normal; }
.tq-nhap { width: 100%; min-height: 78px; border-radius: 10px; border: 1.5px solid var(--vien-dam); background: var(--ban-ghi); padding: 10px 12px; font-family: inherit; font-size: 15px; line-height: 1.4; color: var(--chu); resize: none; }
.tq-nhap:focus { border-color: var(--xanh-rung); outline: none; background: #fff; box-shadow: 0 0 0 3px rgba(45, 102, 53, .15); }
.tq-nhap.co-loi { border-color: #D9534F; background: #FFF5F4; }

/* Phóng to ảnh bằng chứng */
.tq-phong-to { position: fixed; inset: 0; z-index: 80; background: rgba(10, 20, 12, .9); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tq-phong-to figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tq-phong-to img { max-width: 100%; max-height: calc(100vh - 150px); min-width: 240px; min-height: 160px; object-fit: contain; border-radius: 8px; background: #fff; }
.tq-phong-to .tq-anh-het { width: 280px; height: 200px; background: #fff; border-radius: 8px; font-size: calc(14px * var(--co-chu)); }
.tq-phong-to figcaption { color: #fff; font-size: calc(14px * var(--co-chu)); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; text-align: center; }
.tq-pt-dong { position: absolute; top: 16px; right: 16px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .18); color: #fff; display: flex; align-items: center; justify-content: center; }

/* Hàng liên kết nhanh tới màn quản trị: thẻ nhỏ một dòng */
.tq-lien-ket { display: flex; flex-wrap: wrap; gap: 10px; }
.tq-lk { display: inline-flex; gap: 10px; align-items: center; height: 46px; padding: 0 16px 0 8px; color: var(--chu); border-radius: 14px; }
.tq-lk b { font-size: calc(14px * var(--co-chu)); white-space: nowrap; }
.tq-lk:hover { border-color: var(--xanh-rung); }
.tq-lk-icon { width: 32px; height: 32px; border-radius: 10px; background: var(--bac-ha); color: var(--xanh-rung); display: flex; align-items: center; justify-content: center; flex: none; }

/* iPad: ô số gọn lại để 4 ô vừa 1 hàng */
@media (min-width: 768px) and (max-width: 1299px) {
  .tq-khu-ten { width: 110px; }
}

/* Điện thoại: xếp dọc, "Cần xử lý" lên đầu */
@media (max-width: 767px) {
  .tq-trang { gap: 12px; }
  .tq-hang-bd, .tq-hang-duoi, .tq-hang-duoi.hai { display: contents; }
  .tq-hang-so { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; order: -1; }
  .tq-thanh { order: -3; }
  .tq-the-xu-ly { order: -2; max-height: none; }
  .tq-xu-ly-than { overflow: visible; margin: 0; padding: 0; }
  .tq-lien-ket { order: -3; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
  .tq-lien-ket::-webkit-scrollbar { display: none; }
  .tq-lk { flex: none; }
  .tq-thanh { gap: 8px; }
  .tq-cap-nhat { margin-left: auto; }
  .tq-o-so { padding: 14px; }
  .tq-o-so-lon { font-size: calc(21px * var(--co-chu)); }
  .tq-o-nhan { font-size: calc(13px * var(--co-chu)); }
  .tq-o-phu { font-size: calc(13px * var(--co-chu)); }
  .tq-the-duoi { min-height: 0; }
  .tq-the-bd { min-height: 0; padding: 14px; }
  .tq-khu-ten { width: 92px; font-size: calc(13.5px * var(--co-chu)); }
  .tq-khu-tien { width: 88px; font-size: calc(13.5px * var(--co-chu)); }
  .tq-khu-dong { font-size: calc(13.5px * var(--co-chu)); }
  .tq-cot-vung { --cao: 100px; min-height: 130px; gap: 2px; }
  .tq-cot-so { font-size: 10px; }
  .tq-cot-gio { font-size: 10px; }
  .tq-mo-ta, .tq-dong-chu, .tq-nguon-dong, .tq-lich-dong, .tq-trong { font-size: calc(14px * var(--co-chu)); }
  .tq-dong-chu > b, .tq-lich-chu b { font-size: calc(14.5px * var(--co-chu)); }
  .tq-dong:not(.tq-dong-anh) { flex-direction: column; align-items: stretch; }
  .tq-dong:not(.tq-dong-anh) .tq-dong-chu { flex: none; }
  .tq-dong:not(.tq-dong-anh) .tq-dong-nut { width: 100%; }
  .tq-dong:not(.tq-dong-anh) .tq-dong-nut > * { flex: 1; }
  .nut-chung.tq-nut-cao { height: 44px; font-size: calc(14px * var(--co-chu)); }
  .tq-dong-anh .tq-dong-nut > * { flex: 1; }
  .tq-phong-to img { max-height: calc(100vh - 190px); }
}
.tq-lan-cuoi { background: var(--ban-ghi); border: 1px solid #EEEAE0; border-radius: 8px; padding: 4px 8px; margin-top: 2px; }
