/* hkd.css — CSS riêng của phân hệ KENDU HKD. Mọi lớp có tiền tố hkd-. Không sửa giao_dien.css / hrm.css / khung_tuy_chinh.css. */

/* ── Logo (quy tắc chung mục 6): chỉ đặt chiều cao, chiều rộng tự theo tỉ lệ thật; không kéo giãn ── */
body.hrm header.dau-trang .logo img.hkd-logo-dau { height: 44px; width: auto; display: block; }
body.hrm footer.chan-trang .logo img.hkd-logo-chan { height: 30px; width: auto; display: block; }
body.hrm header.dau-trang { flex-wrap: wrap; gap: 8px 16px; }
.hkd-nhan-demo { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #fef3c7; color: #78350f;
  font-weight: 700; font-size: .8125rem; line-height: 1.4; }

/* ── Khung hẹp cho trang thông báo ── */
.hkd-khung-hep { max-width: 560px; margin: 32px auto; }

/* ── Trang chủ: thẻ chức năng ── */
.hkd-luoi-chuc-nang { margin-top: 16px; }
a.hkd-the-chuc-nang { text-decoration: none; color: inherit; align-items: center; transition: box-shadow .15s ease; }
a.hkd-the-chuc-nang:hover { box-shadow: 0 10px 28px rgba(11, 27, 51, 0.12); }
a.hkd-the-chuc-nang:focus-visible { outline: 3px solid #0b1b33; outline-offset: 3px; }
.hkd-ten-chuc-nang { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.hkd-mien-tru { max-width: 900px; margin: 16px auto; text-align: center; }
.hkd-khoa-ghi { max-width: 900px; margin: 8px auto; text-align: center; }

/* ── Bảng cấu hình thuế (Control Plane): thao tác ký/đóng/thêm phiên bản ở trang chi tiết từng dòng,
   bảng chỉ còn 7 cột gọn để không bị cắt ở 1280px; điện thoại cuộn ngang trong .bang-cuon ── */
table.bang.hkd-bang-cau-hinh { min-width: 960px; }
.hkd-bang-cau-hinh th, .hkd-bang-cau-hinh td { padding: 10px 12px; vertical-align: top; }
.hkd-khoa { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875rem; overflow-wrap: anywhere; }
.hkd-gia-tri { min-width: 240px; max-width: 320px; }
.hkd-bang-cau-hinh td.hkd-khoa { min-width: 130px; max-width: 170px; }
.hkd-bang-cau-hinh td.o-ghi-chu { min-width: 200px; text-align: left; }
.hkd-bang-cau-hinh td.hkd-hieu-luc { min-width: 96px; }
.hkd-trang-thai { min-width: 150px; }
.hkd-trang-thai .nhan { display: inline-block; margin: 0 0 6px; }
.hkd-cap { display: block; font-size: .875rem; overflow-wrap: anywhere; text-align: left; }
.hkd-cap-ten { color: var(--text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8125rem; }
.hkd-khoi { display: block; }
.hkd-nhan-uoc-tinh { white-space: nowrap; }
.hkd-thao-tac { white-space: nowrap; }
.bang-cuon { position: relative; }  /* nhãn ẩn (absolute) trong bảng cuộn không làm tràn trang */
.hkd-an-chu { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hkd-thao-tac .nut-nho, .hkd-hang-thao-tac .nut-nho { min-height: 36px; padding: 0 14px; font-size: .875rem; }
.hkd-form-dong { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 0; }
.hkd-form-dong input[type="date"] { width: auto; min-height: 36px; }
.hkd-tick-nho { font-size: .875rem; font-weight: 600; margin: 0; }
.hkd-hang-thao-tac { flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: center; }

/* ── Trang chi tiết: danh sách nhãn – giá trị ── */
.hkd-chi-tiet { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 24px; margin: 0; }
.hkd-chi-tiet div { border-bottom: 1px solid #e8eef8; padding: 6px 0; }
.hkd-chi-tiet dt { font-size: .8125rem; color: var(--text-muted); font-weight: 600; }
.hkd-chi-tiet dd { margin: 2px 0 0; overflow-wrap: anywhere; }

/* ── Khuyến cáo nhóm ngành chưa xác minh (R2-17) ── */
.hkd-khuyen-cao { max-width: 900px; margin: 8px auto 16px; text-align: center; }
.hkd-khuyen-cao-chon { margin: 8px 0 0; text-align: center; }
.hkd-khuyen-cao-chon[hidden] { display: none; }

/* ── Bán hàng, kho (HKD-010…013) ── */
table.bang.hkd-bang-nhap { min-width: 860px; }
.hkd-bang-nhap th, .hkd-bang-nhap td { padding: 8px 10px; }
.hkd-bang-nhap input, .hkd-bang-nhap select { width: 100%; min-height: 40px; box-sizing: border-box; }
.hkd-bang-nhap td:first-child { width: 32px; text-align: center; color: var(--text-muted); }
table.bang.hkd-bang-gon { min-width: 0; }
.hkd-pos-dau { margin-bottom: 12px; }
.hkd-chon-thu { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: center; margin: 0 0 12px; }
.hkd-chon-thu .nhan-tick { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.hkd-nguong { max-width: 900px; margin: 16px auto; }
.hkd-ds-nguong { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.hkd-ds-nguong li { text-align: center; }
.hkd-thanh-tim { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 0 auto 12px; max-width: 640px; }
.hkd-thanh-tim input[type="search"] { flex: 1 1 220px; min-height: 40px; }
.hkd-form-thu-no { margin-top: 16px; }
.hkd-luoi-hai { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.hkd-luoi-hai > .khung { margin: 0; min-width: 0; }

/* ── Trang trung gian về kendu-ai.com (không kế thừa khung) ── */
body.hkd-ve-goc { margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #041126; color: #e2e8f0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hkd-ve-goc-khung { text-align: center; padding: 24px 16px; }
.hkd-ve-goc-khung img { height: 44px; width: auto; }
.hkd-ve-goc-dong { font-size: 1.25rem; font-weight: 700; margin: 20px 0 4px; }
.hkd-ve-goc-dong-phu { color: #94a3b8; margin: 0 0 20px; }
.hkd-vong-quay { display: inline-block; width: 36px; height: 36px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .15);
  border-top-color: #22b8f0; animation: hkd-quay .9s linear infinite; }
.hkd-ve-goc-link { color: #5fdcf7; font-weight: 600; text-decoration: none; }
@keyframes hkd-quay { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hkd-vong-quay { animation: none; } }

/* ── Điện thoại ── */
@media (max-width: 640px) {
  body.hrm header.dau-trang { padding: 10px 16px; }
  body.hrm header.dau-trang .logo img.hkd-logo-dau { height: 36px; }
  body.hrm footer.chan-trang .logo img.hkd-logo-chan { height: 24px; }
  .hkd-nhan-demo { order: 3; width: 100%; text-align: center; }
  a.hkd-the-chuc-nang { padding: 14px 16px; }
}

/* ── Đợt 4: sổ TT 152, bảng điều khiển, biểu đồ SVG, cảnh báo ── */
:root { --bd-cot: #257de0; --bd-luoi: #e5e7eb; --bd-chu: #475569; --bd-goc: #94a3b8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bd-cot: #338ced; --bd-luoi: #334155; --bd-chu: #cbd5e1; --bd-goc: #64748b; } }
:root[data-theme="dark"] { --bd-cot: #338ced; --bd-luoi: #334155; --bd-chu: #cbd5e1; --bd-goc: #64748b; }
.hkd-bd-khung-svg { width: 100%; overflow: hidden; }
.hkd-bd-svg { display: block; width: 100%; height: auto; max-height: 320px; }
.hkd-bd-cot { fill: var(--bd-cot); }
.hkd-bd-luoi { stroke: var(--bd-luoi); stroke-width: 1; }
.hkd-bd-goc { stroke: var(--bd-goc); stroke-width: 1; }
.hkd-bd-truc, .hkd-bd-nhan, .hkd-bd-gia-tri { fill: var(--bd-chu); font-size: 11px; font-family: inherit; }
.hkd-bd-gia-tri { font-weight: 600; }
.hkd-bd-vung-cham { fill: transparent; }
.hkd-bd-moc:hover .hkd-bd-cot, .hkd-bd-moc:focus .hkd-bd-cot { opacity: .8; }
.hkd-bd-moc:hover .hkd-bd-vung-cham { fill: rgba(37, 125, 224, .08); }
.hkd-bd-loc { display: grid; gap: 8px 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.hkd-bd-loc .o-form { margin: 0; }
.hkd-bd-luoi-so { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 12px 0; }
.hkd-bd-luoi-so > .hkd-bd-o { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hkd-bd-so { font-size: 1.35rem; overflow-wrap: anywhere; }
.hkd-muc-cb { margin-right: 4px; }
.hkd-bam { font-size: .75rem; }
.hkd-so-mau { overflow: hidden; }
.hkd-so-dau { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.hkd-so-dau p { margin: 2px 0; }
.hkd-so-dau-phai { text-align: right; max-width: 420px; }
.hkd-so-tieu-de { text-align: center; font-size: 1.25rem; margin: 16px 0 6px; }
.hkd-so-dau-so, body.hrm p.hkd-so-dau-so { text-align: center; margin: 2px 0; }
.hkd-so-don-vi { text-align: right; margin: 4px 0 8px; font-style: italic; }
.hkd-so-bang th { text-align: center; vertical-align: middle; }
.hkd-so-ma-cot th { font-weight: 400; font-style: italic; }
.hkd-so-phan td, .hkd-so-dong-tieu_de td, .hkd-so-dong-tong td, .hkd-so-dong-tong_thue td, .hkd-so-dong-dau_ky td, .hkd-so-dong-cuoi_ky td { font-weight: 700; }
.hkd-so-chan { text-align: right; margin-top: 16px; }
.hkd-so-chan p { margin: 2px 0; }
.hkd-kh-o-ma { letter-spacing: .3em; font-size: 1.25rem; text-align: center; }
@media print {
  header.dau-trang, footer.chan-trang, nav, .duong-quay-lai, .hang-hanh-dong, .tab-ds { display: none !important; }
  .hkd-so-mau { border: 0; box-shadow: none; }
}
