/* Hộp thư hồ sơ đăng ký: thư mục | danh sách | khung đọc. Chỉ dùng biến màu của style.css. */
.ht-dau { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ht-dau .page-title { margin: 0; }
.ht-dau-nut { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ht-dau-nut input[type=search] { min-width: 240px; }
.ht-cach { margin-bottom: 10px; }
.ht-cach summary { cursor: pointer; color: var(--seal); font-size: var(--fs-m); }
.ht { display: grid; grid-template-columns: 170px minmax(260px, 360px) minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-height: 68vh; overflow: hidden; }
.ht-thu-muc { border-right: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.ht-tm { display: flex; justify-content: space-between; gap: 8px; font: inherit; text-align: left; border: 0; background: none; color: var(--ink); padding: 7px 10px; border-radius: var(--radius); cursor: pointer; }
.ht-tm:hover { background: var(--seal-soft); }
.ht-tm.on { background: var(--seal-soft); color: var(--seal); font-weight: 600; }
.ht-so { font-size: var(--fs-xs); opacity: .75; }
.ht-so-moi { background: var(--seal); color: var(--surface); border-radius: 999px; padding: 0 7px; opacity: 1; font-weight: 700; }
.ht-ds { border-right: 1px solid var(--line); overflow-y: auto; max-height: 78vh; min-width: 0; }
.ht-rong { padding: 12px; margin: 0; }
.ht-dong { display: block; width: 100%; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; cursor: pointer; }
.ht-dong:hover { background: var(--bg); }
.ht-dong.on { background: var(--seal-soft); box-shadow: inset 3px 0 0 var(--seal); }
.ht-d1 { display: flex; justify-content: space-between; gap: 8px; }
.ht-ten { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-moi .ht-ten { font-weight: 700; }
.ht-ngay { font-size: var(--fs-xs); opacity: .7; white-space: nowrap; }
.ht-d2 { font-size: var(--fs-xs); color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 2px 0; }
.ht-d3 { display: flex; gap: 8px; align-items: center; font-size: var(--fs-xs); min-width: 0; }
.ht-trich { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.ht-the { display: inline-block; font-size: var(--fs-xs); padding: 0 7px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.ht-tt-CHO_DUYET { color: var(--warn); } .ht-tt-DA_DUYET { color: var(--ok); }
.ht-tt-TU_CHOI { color: var(--err); } .ht-tt-CAN_BO_SUNG { color: var(--seal); }
.ht-thu-DA_GUI { color: var(--ok); } .ht-thu-HONG { color: var(--err); } .ht-thu-CHO_GUI { color: var(--warn); }
.ht-doc { padding: 14px 18px; overflow-y: auto; max-height: 78vh; min-width: 0; }
.ht-chua-chon { padding: 24px 0; }
.ht-quay { display: none; margin-bottom: 8px; }
.ht-tieu-de { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
/* NGUYÊN NHÂN GỐC của hàng nút bị cắt: style.css có quy tắc chung cho phần tử `header` (thanh đầu
   trang: sticky, top 0, z-index 5, nền đục, padding 14px 20px, viền dưới). Tiêu đề hồ sơ là một
   <header class="ht-tieu-de"> nên NHẬN NGUYÊN quy tắc ấy: nó dính ở mép trên khung đọc và hàng nút
   hành động, đứng ngay dưới nó, trượt vào SAU nó khi khung đọc cuộn — nút bị che/cắt. Trả nó về
   một tiêu đề thường. */
.ht-tieu-de { position: static; z-index: auto; background: none; border-bottom: 0; padding: 0; }
.ht-tieu-de h2 { margin: 0 0 4px; font-size: 1.15rem; }
.ht-hanh-dong { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0 12px; }
.ht-hanh-dong a.act { text-decoration: none; display: inline-flex; align-items: center; }
.ht-luong { display: flex; flex-direction: column; gap: 10px; }
.ht-thu { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ht-den { padding: 10px 14px; border-left: 3px solid var(--seal); }
.ht-thu-dau { position: static; z-index: auto; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ht-thu-to { margin: 2px 0 8px; font-size: var(--fs-s); color: var(--ink-soft); }
.ht-tom-tat { font-size: var(--fs-m); }
.ht-dinh-kem { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
#dk-luong-thu { display: flex; flex-direction: column; gap: 10px; }
.ht-di > summary { cursor: pointer; padding: 9px 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; list-style: none; }
.ht-di > summary::-webkit-details-marker { display: none; }
.ht-di[open] > summary { border-bottom: 1px solid var(--line); }
.ht-tieu { font-weight: 600; flex: 1 1 260px; min-width: 0; }
.ht-thu-dau2 { font-size: var(--fs-s); color: var(--ink-soft); }
.ht-than { margin: 0; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: var(--fs-m); }
.ht-di .dk-luu-y { margin: 8px 14px 0; }
.ht-chua-thu { margin: 0; }
.ht-quyet { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.ht-quyet h3 { margin: 0 0 6px; }
.ht-quyet textarea { width: 100%; box-sizing: border-box; }
.ht-tra-loi { margin-top: 14px; }
/* Cửa sổ đối chiếu: chỉ hiện khi bấm nút. */
.ht-hop-doi-chieu { width: min(1200px, 96vw); max-height: 92vh; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.ht-hop-doi-chieu::backdrop { background: rgba(0, 0, 0, .45); }
.ht-hop-dau { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.ht-hop-dau h3 { margin: 0; }
@media (max-width: 1000px) {
  .ht { grid-template-columns: 150px minmax(0, 1fr); }
  .ht-doc { display: none; grid-column: 1 / -1; }
  .ht.co-chon .ht-thu-muc, .ht.co-chon .ht-ds { display: none; }
  .ht.co-chon .ht-doc { display: block; grid-column: 1 / -1; }
  .ht-quay { display: inline-block; }
}
@media (max-width: 560px) {
  .ht { grid-template-columns: minmax(0, 1fr); }
  .ht-thu-muc { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .ht-ds { border-right: 0; }
  .ht-dau-nut input[type=search] { min-width: 0; flex: 1 1 100%; }
}
.ht-tom-tat { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 14px; margin: 0; }
.ht-tom-tat dt { color: var(--ink-soft); }
.ht-tom-tat dd { margin: 0; overflow-wrap: anywhere; }
/* Số thư đã gửi trên dòng danh sách; mang màu cảnh báo khi có lá chưa gửi được (tổng > đã gửi). */
.ht-so-thu { font-size: var(--fs-xs); white-space: nowrap; color: var(--ink-soft); flex: 0 0 auto; }
.ht-so-thu-canh-bao { color: var(--warn); font-weight: 600; }
/* Băng "nộp lại" gập một dòng với hồ sơ đã duyệt. */
.ht-nop-lai-gap > summary { cursor: pointer; font-size: var(--fs-s); color: var(--warn); font-weight: 600; }
.ht-nop-lai-gap[open] > summary { margin-bottom: 6px; }
/* Nút Soạn thư ở cuối luồng thư (chuẩn hộp thư). */
.ht-tra-loi-nut { display: flex; gap: 8px; margin-top: 2px; }
