/* TD-027 (7.0.0): thẻ con trong trang (Ra vào cổng), thanh thẻ mục con (Nhà ăn), Trung tâm báo cáo, Xem menu như vai trò */
.tabs.sub-tabs { margin-top: -6px; border-bottom: 0; gap: 6px; flex-wrap: wrap; }
.tabs.sub-tabs a { font-size: 14px; padding: 6px 12px; border: 1px solid var(--line, #e4e2dd); border-radius: 999px; }
.tabs.sub-tabs a.on { background: var(--brand-soft, #fdebd8); border-color: var(--brand, #b4530a); color: var(--brand-ink, #8a3f06); }
.hub-tabs { margin-bottom: 10px; }
.bc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.bc-card .list .item { display: flex; align-items: center; gap: 6px; }
.mx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mx-grp h4 { margin: 8px 0 4px; color: var(--muted, #5f6b7a); text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }
.mx-grp li { margin: 2px 0; }
/* 7.0.0 TD-013: màu trạng thái thống nhất (rà soát phần 5 mục 7) */
.chip.td-xam { background: #eceae6; color: #4a4f57; }
.chip.td-vang { background: #fdf0c8; color: #7a5a00; }
.chip.td-xanh { background: #dbeafe; color: #1e4fa3; }
.chip.td-la { background: #dcf3e2; color: #1d6b37; }
.chip.td-do { background: #fde2e1; color: #a1271f; }
.chip.td-den { background: #e3e3e3; color: #2b2b2b; }
/* Danh sách phiếu trên điện thoại: thẻ xếp dọc */
.td-cards { display: grid; gap: 10px; }
.td-card { display: block; padding: 12px 14px; border: 1px solid var(--line, #e4e2dd); border-radius: 12px; background: var(--surface, #fff); color: inherit; text-decoration: none; }
.td-card .r1, .td-hop-the .r1, .td-line .r1, .td-ck .r1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
/* Hộp duyệt dạng thẻ */
.td-hop { display: grid; gap: 10px; }
.td-hop-the ul { margin: 6px 0; padding-left: 18px; }
.td-hop-the .actions .btn { min-height: 44px; }
/* Phiếu nhiều vị trí: mỗi vị trí một thẻ */
.td-lines { display: grid; gap: 10px; margin: 8px 0; }
.td-line { border: 1px solid var(--line, #e4e2dd); border-radius: 12px; padding: 10px 12px; background: var(--surface-2, #faf9f7); }
.td-line .td-info { margin: 4px 0 8px; line-height: 1.5; }
.td-line-f { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .td-line-f { grid-template-columns: 1fr 1fr; } }
.td-line .td-vuot input { border-color: #c0392b; }
.td-line input.bad { border-color: #c0392b; box-shadow: 0 0 0 2px rgba(192, 57, 43, .15); }
.td-vuot label { color: #a1271f; font-weight: 600; }
.td-them { margin-top: 10px; }
.td-sua { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* Chưa khớp Tin Việt */
.td-ck .td-hd { background: var(--brand-soft, #fdebd8); border-radius: 8px; padding: 8px 10px; margin: 8px 0; line-height: 1.5; }
.td-cd-nhom h4 { margin: 14px 0 4px; color: var(--brand-ink, #8a3f06); }
.td-cd-nhom .form { padding: 0; }
.td-tim { margin: 0 0 8px; }
.td-tim input { width: 100%; min-height: 44px; font-size: 16px; }
.td-chips { margin: 0 0 10px; }
/* TD-031: Thưởng giới thiệu: mỗi tên vị trí một dòng bấm chọn, đủ lớn cho điện thoại */
.td-gt-ds { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.td-gt-vt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: 100%; min-height: 48px; padding: 8px 12px; text-align: left; font: inherit; color: var(--fg); background: var(--surface); border: 1.5px solid var(--line3); border-radius: 8px; cursor: pointer; }
.td-gt-vt[aria-pressed="true"] { border-color: var(--brand, #b4530a); background: var(--brand-soft, #fdebd8); color: var(--brand-ink, #8a3f06); }
.td-gt-dau { margin-left: auto; font-size: 13px; font-weight: 600; white-space: nowrap; }
.td-gt-muc { display: flex; flex-wrap: wrap; gap: 4px; min-width: 150px; }
/* TD-030: cột Vị trí ở Đăng ký qua web */
.td-vt-mm { min-width: 150px; }
.td-vt-mm .chip { display: inline-block; white-space: nowrap; }
.td-vt-mm .btn { margin-top: 4px; white-space: nowrap; }
/* TD-032: chọn từ năm, đến năm ở form khai hộ */
.td-nam-2 { display: flex; align-items: center; gap: 8px; }
.td-nam-2 select { flex: 1 1 0; min-width: 0; }
/* TD-033: Kế hoạch mục tiêu */
.td-kh-tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.td-kh-loc { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 14px; }
.td-kh-loc-o { min-width: 160px; }
.td-kh-loc-o .field { margin: 0; }
.td-kh-bang td { vertical-align: top; }
.td-kh-hang.td-kh-do { background: #fdf1ef; }
.td-kh-vt { display: inline-block; text-decoration: none; }
.td-kh-moc { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.td-kh-moc .chip { white-space: nowrap; }
.td-kh-nhanh { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.td-kh-form .btn.sm { margin-top: 6px; }
.td-kh-form .full { grid-column: 1 / -1; }
.td-kh-so-ds { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 4px 16px; margin-bottom: 8px; }
.td-kh-ky { align-self: center; }
.td-kh-do-the { border-color: #c0392b; }
@media (max-width: 760px) { .td-kh-hang .row-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; } .td-kh-hang .row-acts .btn { min-height: 44px; flex: 1 1 auto; } }
/* TD-039: hộp Vòng 2, tên vị trí dài không làm tràn khung trên điện thoại */
.td-v2-vt { min-width: 0; }
.td-v2-vt select { width: 100%; max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.td-v2-goi-y { overflow-wrap: anywhere; }
/* TD-127 (8.7.2): thẻ mục chung Sản xuất cùng khối tiêu đề trang (h1 + thẻ viên thuốc). Thẻ xuống dòng khi hết chỗ (không cuộn ngang, không cắt chữ); thẻ gọn để cùng dòng tiêu đề khi đủ chỗ */
.hub-hd { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; flex: 1 1 auto; min-width: 0; max-width: 100%; }
#main .hub-hd > h1 { flex: 0 1 auto; min-width: 0; margin: 0; }
.hub-pills { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; max-width: 100%; margin: 0; }
.hub-pills a { flex: 0 1 auto; max-width: 100%; display: inline-flex; align-items: center; min-height: 30px; padding: 3px 10px; font-size: 13px; font-weight: 500; line-height: 1.2; white-space: nowrap; color: inherit; text-decoration: none; border: 1px solid var(--line, #e4e2dd); border-radius: 999px; background: var(--surface, #fff); }
.hub-pills a.on { background: var(--brand-soft, #fdebd8); border-color: var(--brand, #b4530a); color: var(--brand-ink, #8a3f06); font-weight: 700; }
@media (max-width: 899px) { .hub-pills a { min-height: 40px; padding: 4px 12px; font-size: 14px; } }
/* điện thoại: khối tiêu đề trải ra cho thẻ chiếm trọn một dòng ngay dưới tiêu đề (nút bên phải như Xuất Excel, TV vẫn ở dòng tiêu đề) */
@media (max-width: 700px) {
  .hub-hd { display: contents; }
  #main .hub-hd > h1 { flex: 1 1 0; }
  .hub-hd > .hub-pills { flex: 1 1 100%; order: 5; margin-top: 4px; }
  .dh-top .r1:has(> .hub-hd) { flex-wrap: wrap; }
}

/* TD-129 (8.9.0): menu hai tầng – tầng 1 phân hệ, phân hệ đang xem mở menu con (tầng 2); trang chủ phân hệ */
nav.side .grp.ph { gap: 2px; }
nav.side a.ph-hd { font-weight: 600; }
nav.side a.ph-hd.ph-cur { color: var(--brand-ink, #8a3f06); }
nav.side a.ph-hd .chev { margin-left: auto; font-style: normal; font-size: 12px; color: #6B7077; padding-left: 6px; }
nav.side a.ph-hd .cnt + .chev { margin-left: 6px; }
nav.side .ph-sub { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px 14px; padding-left: 8px; border-left: 2px solid var(--line, #e6e3de); }
nav.side .ph-sub a { min-height: 38px; font-size: 14px; }
/* TD-176: đường kẻ mảnh ngăn nhóm trong menu (phân hệ Nhân sự) */
nav.side .ph-ke { flex: none; height: 0; margin: 5px 8px; border-top: 1px solid var(--line, #e6e3de); }
.ph-home h2.ph-sec { font-size: 15px; margin: 18px 0 8px; color: #4A4F55; }
.ph-home .ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-items: start; }
.ph-home .ph-tile { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line, #e6e3de); border-radius: var(--r, 10px); background: var(--card, #fff); color: inherit; text-decoration: none; font-weight: 500; }
.ph-home .ph-tile:hover { background: var(--soft, #f6f4f1); }
.ph-home .ph-tile .cnt { margin-left: auto; min-width: 22px; height: 22px; border-radius: 11px; background: var(--yellow, #ffd75e); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.ph-home .ph-card { border: 1px solid var(--line, #e6e3de); border-radius: var(--r, 10px); padding: 10px; background: var(--card, #fff); }
.ph-home .ph-ct { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ph-home .ph-links { display: flex; flex-direction: column; gap: 6px; }
.ph-home .ph-links .ph-tile { min-height: 40px; border-color: transparent; background: var(--soft, #f6f4f1); }
.ph-home .ph-note { margin-top: 14px; }
.ph-home .ph-giao { margin-top: 12px; } .ph-home .ph-giao summary { cursor: pointer; font-weight: 600; } .ph-giao-ds { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
@media (max-width: 899px) { .ph-home .ph-grid { grid-template-columns: 1fr; } nav.side .ph-sub a { min-height: 44px; } }
/* TD-146 (8.9.1): ô Đăng ký cho bộ phận kèm ngày hết hạn */
.dkbp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; } .dkbp-han { display: inline-flex; align-items: center; gap: 6px; } .dkbp-den { width: 9.5em; max-width: 100%; padding: 2px 4px; font-size: 13px; } .dkbp-td { white-space: nowrap; }
