/* Phần riêng của app XML BHYT trên nền WebHIS (không sửa his.css / kit.css để còn cập nhật bộ kit). */

/* ---- thanh đầu trang: tìm nhanh + tiến độ kiểm tra + quản trị ---- */
.bh-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.bh-quick { position: relative; display: flex; gap: 6px; flex: 1 1 420px; max-width: 820px; margin: 0; }
.bh-quick > .bi-search { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--k-phu, #6a7a90); pointer-events: none; }
.bh-quick input.form-control { flex: 1; min-width: 0; padding-left: 30px; height: 32px; font-size: 13px; }
.bh-quick .btn { height: 32px; }
#jobbox:empty, #authbox:empty { display: none; }
#jobbox .job { display: flex; flex-direction: column; justify-content: center; min-width: 220px; font-size: 12.5px; color: #10335e; background: #fff; border: 1px solid var(--k-vien, #c9d6e8); border-radius: 6px; padding: 4px 10px; }
#jobbox .k-thanh { margin-top: 3px; }
#authbox { display: flex; gap: 6px; align-items: center; }
#gearBtn { margin-left: auto; height: 32px; }
#gearBtn.on { color: #fff; background: var(--his-blue, #0b4fa0); border-color: var(--his-blue, #0b4fa0); }
.bh-quay { display: inline-block; animation: bh-quay 1s linear infinite; }
@keyframes bh-quay { to { transform: rotate(360deg); } }

/* thông báo bản quyền / cập nhật */
#appbar:empty { display: none; }
#appbar > .k-hop { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }

/* ---- menu ---- */
.his-menu .admin-hidden { display: none !important; }
.his-menu-item.bh-dong > .his-dropdown { display: none !important; }
.his-dropdown a.on { background: #e7f0fb; }
.his-dropdown a.on .ten { color: var(--his-blue, #0b4fa0); font-weight: 700; }

/* nội dung trang */
#main { min-height: 200px; }
#main .loading { padding: 40px; text-align: center; color: var(--k-phu, #6a7a90); }

/* hộp thoại cũ của app nằm trên menu WebHIS */
.modal-bg { z-index: 1500; }

/* Bootstrap .progress dùng ở màn hình Nhập dữ liệu (kiểu cũ) */
.progress { display: block; height: 8px; }

.page-title .text-none { text-transform: none; }

/* ---- Tổng quan ---- */
.bh-loc .ngay { width: 150px; flex: 0 0 auto; }
.bh-loc .pham-vi { margin-left: auto; color: var(--k-phu, #6a7a90); }
.bh-loc .pham-vi b { color: #10335e; }
.bh-tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.bh-tiles .k-tile { padding: 10px 10px 8px; gap: 10px; }
.bh-tiles .k-tile .ic { width: 36px; height: 36px; font-size: 17px; }
.bh-tiles .k-tile .gt { font-size: 24px; }
.bh-tiles .k-tile > div:last-child { min-width: 0; }
.bh-tiles .k-tile .nhan, .bh-tiles .k-tile .phu { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1250px) { .bh-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .bh-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bh-tiles .k-tile .gt { font-variant-numeric: tabular-nums; }
.bh-luoi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.bh-luoi > .panel { margin: 0; min-width: 0; }
.bh-luoi .panel-head { display: flex; align-items: center; gap: 6px; }
.bh-luoi .panel-head a { margin-left: auto; font-weight: normal; font-size: 12.5px; text-transform: none; }
.bh-luoi .panel-body { padding: 0; }
.bh-luoi .panel-body.dem { padding: 10px 12px; }
.bh-luoi .k-bang { border: 0; border-radius: 0; max-height: 420px; }
.bh-luoi .k-trong { margin: 0; border: 0; }
.k-bang td.num, .k-bang th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.k-bang td.nw { white-space: nowrap; }

/* thanh tỷ lệ theo loại KCB: đỏ = có lỗi */
.bh-hang { display: grid; grid-template-columns: 190px 1fr 76px; gap: 10px; align-items: center; padding: 5px 0; color: inherit; text-decoration: none; border-bottom: 1px dashed #e6ecf4; }
.bh-hang:last-child { border-bottom: 0; }
.bh-hang:hover { background: #f4f8fd; color: inherit; text-decoration: none; }
.bh-hang .ten { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-hang .tr { display: flex; height: 12px; background: #edf1f6; border-radius: 3px; overflow: hidden; }
.bh-hang .tr i { display: block; height: 100%; background: var(--his-blue, #0b4fa0); }
.bh-hang .tr i.e { background: var(--k-do, #c62828); }
.bh-hang .so { text-align: right; font-variant-numeric: tabular-nums; color: var(--k-phu, #6a7a90); }
.bh-hang .so b { color: var(--k-do, #c62828); }

/* ---- bảng: tiêu đề bấm sắp xếp, phân trang ---- */
.k-bang th.bh-sx { cursor: pointer; user-select: none; }
.k-bang th.bh-sx i { margin-left: 4px; font-size: 10px; opacity: .55; }
.k-bang th.bh-sx.on i { opacity: 1; }
.k-bang th.bh-sx:hover { background: #1b4a80; }
.k-bang th .form-check-input, .k-bang td .form-check-input { margin: 0; }
.k-bang .k-trong { margin: 0; border: 0; }
.bh-trang { display: flex; align-items: center; gap: 8px; }
.bh-trang .form-select { width: auto; }
.bh-trang .btn-group .btn { padding: 2px 8px; }

/* ---- Hồ sơ: danh sách ---- */
.bh-loc .bh-tu-khoa { width: 300px; }
.bh-loc .bh-quy-tac { max-width: 280px; }
.bh-loc .khoa-in { display: inline-block; width: auto; flex: 0 0 auto; }
.k-bang td.bh-nb { min-width: 195px; }
.k-bang td.bh-nb .ten { white-space: nowrap; }

/* ---- Hồ sơ: chi tiết ---- */
.bh-hs-dau { gap: 8px; flex-wrap: wrap; }
.bh-hs-dau .k-tt { font-size: 12px; text-transform: none; }
.bh-tt { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 16px; }
.bh-tt > div { min-width: 0; overflow-wrap: anywhere; }
.bh-tt > div > span { display: block; font-size: 11.5px; color: var(--k-phu, #6a7a90); }
.bh-tt > div > b { color: #10233f; font-weight: 600; }
.bh-luoi .panel-head .k-tt { font-size: 11.5px; text-transform: none; font-weight: 600; }
.bh-hien-bq { display: inline-flex; gap: 5px; align-items: center; font-weight: normal; text-transform: none; cursor: pointer; margin: 0; }
.bh-hien-bq .form-check-input { margin: 0; }
.bh-loi-ds { max-height: 420px; }
.bh-loi-ds .erritem { padding: 8px 12px; border-bottom: 1px solid #eef1f5; align-items: flex-start; }
.bh-loi-ds .erritem:hover { background: #f5f8fd; }
.bh-loi-ds .erritem > .k-tt { flex: 0 0 auto; margin-top: 1px; }
.bh-loi-ds .erritem .g { color: var(--k-phu, #6a7a90); }
.bh-loi-ds .erritem .m { overflow-wrap: anywhere; }
.bh-loi-ds .bh-bq { flex: 0 0 auto; padding: 1px 8px; font-size: 12px; }
.bh-bang-xml { margin-bottom: 12px; }
.bh-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; background: #f5f8fc; padding: 4px 8px 0; align-items: center; }
.bh-tabs .nav-link { white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; font-size: 12.5px; }
.bh-tabs .nav-link .k-tt { font-size: 11px; padding: 0 6px; }
.bh-tabs .form-select { width: auto; margin: 0 0 4px; }
.bh-tab-than { padding: 10px; }
.bh-tab-than > .k-bang { max-height: 70vh; }
.bh-tab-than .k-bang td { white-space: nowrap; font-size: 12.5px; }
.bh-xml1 { margin: 0; }
.bh-xml1 .k-tt2 td:first-child { width: 220px; }
.bh-tieu-de { font-weight: 700; color: var(--k-xanh-dam, #10335e); padding: 4px 8px 6px; }

/* ---- Lỗi & cảnh báo ---- */
.bh-loi-luoi { grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); }
.bh-luoi .k-bang tr.chon td { background: #e3eefb; }
.k-bang tr.bh-mo td { opacity: .55; }
.k-bang td.bh-nd { min-width: 260px; }
.k-bang td.bh-nd .m { display: block; overflow-wrap: anywhere; }
.k-bang td .phu b { font-weight: 600; color: #3d5370; }
.k-bang .bh-bq { padding: 1px 8px; font-size: 12px; }

/* hộp Chi tiết lỗi */
.app-modal .modal-f .btn { min-width: 90px; }
.bh-ctl-dau { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bh-ctl-dau .k-tt { text-transform: none; }
.bh-ctl-nd { margin: 8px 0 10px; font-size: 15px; font-weight: 600; color: #10233f; overflow-wrap: anywhere; }
.bh-ctl-g { color: var(--k-phu, #6a7a90); margin-bottom: 4px; overflow-wrap: anywhere; }
.bh-ctl-hs { margin: 12px 0 4px; padding: 10px 12px; background: #f5f8fc; border: 1px solid #e3e9f2; border-radius: 6px; }
.bh-ctl .bh-tieu-de { padding: 10px 0 6px; }
table.k-tt2.bh-ctl-dong, table.k-tt2.bh-trung-bang { margin-bottom: 10px; table-layout: fixed; }
table.k-tt2.bh-ctl-dong td, table.k-tt2.bh-trung-bang td { overflow-wrap: anywhere; }
table.k-tt2.bh-ctl-dong tr.hl td { background: #fff3cd; }
.bh-trung-cau { margin-bottom: 8px; line-height: 1.5; }
table.k-tt2.bh-trung-bang { background: #fff; border-radius: 4px; }
table.k-tt2.bh-trung-bang td:first-child { width: 130px; }

/* ---- Tìm BN theo mã máy / kết quả chuyên đề ---- */
.bh-loc .bh-ma-may { width: 340px; flex: 0 1 340px; min-width: 0; }
.bh-loc .bh-nb-tim { width: 240px; flex: 0 1 240px; min-width: 0; }
.bh-tiles.bh-tiles-kq { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.bh-ghi-chu { margin-bottom: 10px; overflow-wrap: anywhere; }
.bh-kq { margin-bottom: 0; }
.bh-kq .k-bang { border: 0; border-radius: 0; }
.bh-kq .k-bang td { white-space: nowrap; font-size: 12.5px; }
.k-bang tr.bh-sai td { background: #fdecea; }
.k-bang tr.bh-sai:hover td { background: #fbdcd8; }

/* ---- Chuyên đề & báo cáo ---- */
.bh-cd-tabs { flex-wrap: wrap; margin-bottom: 10px; border-bottom-color: var(--k-vien, #c9d6e8); }
.bh-cd-tabs .nav-link { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; padding: 6px 12px; color: #3d5370; }
.bh-cd-tabs .nav-link.active { color: var(--his-blue, #0b4fa0); font-weight: 600; }
.bh-chk-nhom { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.bh-mau01 .panel-body > .k-loc { margin-bottom: 0; }

/* ---- Nhập dữ liệu ---- */
.bh-nhap-luoi { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.bh-nhap-luoi .panel-body { padding: 12px; }
.bh-tha { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 150px; padding: 18px; text-align: center;
  border: 2px dashed #9fb6d6; border-radius: 8px; background: #f5f8fc; cursor: pointer; transition: background .15s, border-color .15s; }
.bh-tha:hover, .bh-tha:focus-visible, .bh-tha.over { background: #e7f0fb; border-color: var(--his-blue, #0b4fa0); outline: none; }
.bh-tha > .bi { font-size: 34px; color: var(--his-blue, #0b4fa0); line-height: 1; }
.bh-tha-chu { font-size: 15px; font-weight: 700; color: #10335e; }
.bh-tha-phu { font-size: 12.5px; color: var(--k-phu, #6a7a90); }
.bh-thu-muc { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.bh-thu-muc .bh-rong { grid-column: 1 / -1; }
.bh-thu-muc .mono { font-size: 12.5px; }
.bh-thanh-nhap { height: 8px; margin-top: 8px; }
.bh-kq-nhap .panel-head .btn { padding: 1px 8px; }
.bh-kq-nhap .k-bang, .bh-ds-file .k-bang, .panel > .panel-body.p-0 > .k-bang { border: 0; border-radius: 0; }
.bh-ds-file { margin-bottom: 0; }
.k-bang td.bh-ten-file { min-width: 220px; overflow-wrap: anywhere; }
.k-bang td.bh-ghi { min-width: 200px; }
.k-bang td .bh-pre { white-space: pre-wrap; max-width: 420px; }
.k-bang td.bh-nut { text-align: right; }
.k-bang td.bh-nut .btn { padding: 1px 7px; font-size: 12px; margin-left: 3px; }

/* ---- Danh mục ---- */
.bh-dm .k-bang { border: 0; border-radius: 0; }
.bh-dm-dau { flex-wrap: wrap; row-gap: 6px; }
.bh-dm-dau .actions { flex-wrap: wrap; }
.k-bang td.bh-ten-muc { min-width: 220px; }
/* lưới ô nhập trong hộp thoại */
.bh-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.bh-form.bh-form-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bh-form .s2 { grid-column: span 2; }
.bh-form .s3 { grid-column: 1 / -1; }
.bh-fo { min-width: 0; }
.bh-fo .form-label { font-size: 12px; font-weight: 600; color: #3d5370; margin-bottom: 3px; }
.bh-tt-ds { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.bh-tt-dong { display: flex; gap: 6px; width: 100%; }
.bh-tt-dong .k { flex: 1 1 0; min-width: 0; }
.bh-tt-dong .v { flex: 2 1 0; min-width: 0; }
.k-bang.bh-nhap-dm td { white-space: nowrap; font-size: 12.5px; }
.k-bang.bh-nhap-dm td .form-control { min-width: 140px; }

/* ---- Quy tắc ---- */
.bh-qt-nhom { margin-bottom: 12px; }
.bh-qt-nhom .k-bang { border: 0; border-radius: 0; }
.bh-qt-nhom .panel-head .k-tt { font-weight: 600; }
tr.bh-tat td { background: #f6f7f9; color: #8a96a3; }
tr.bh-tat td a { color: #6c7a89; }
.bh-cong-tac { margin: 0; min-height: 0; }
.bh-cong-tac .form-check-input { cursor: pointer; }
.k-bang td.bh-ten-qt { min-width: 260px; }
.k-bang td.bh-bang-qt { max-width: 150px; overflow-wrap: anywhere; }
.bh-form .s3c { grid-column: span 3; }
.bh-qt-ten { text-transform: none; min-width: 0; overflow-wrap: anywhere; }
.bh-chon-bang { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-top: 4px; }
.bh-dang-dung { padding-top: 5px; }
.bh-loc .bh-thu-lk { flex: 1 1 320px; width: auto; min-width: 0; }
.bh-qt-each { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.bh-qt-each .bh-fo { flex: 1; }
.bh-qt .cg { border-left-color: #1565c0; border-radius: 3px; }
.bh-qt .cg .cg { border-left-color: #7aa9d6; }
.bh-qt .ci { border-radius: 3px; }
.bh-qt .cg-h select, .bh-qt .ci input:not([type=checkbox]), .bh-qt .ci select {
  font-size: 12px; padding: 3px 6px; border: 1px solid #ced4da; border-radius: 2px; height: 28px; line-height: 1.4; background-color: #fff; }
.bh-qt .cg-h select:focus, .bh-qt .ci input:focus, .bh-qt .ci select:focus { outline: 0; border-color: #86b7fe; box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15); }
.bh-qt .ci .btn, .bh-qt .cg-h .btn { height: 28px; padding-top: 2px; padding-bottom: 2px; }
.bh-qt .ci label.opt { padding-top: 5px; }
.bh-qt-con { flex-basis: 100%; padding-left: 18px; }

/* ---- Cấu hình ---- */
.bh-ch-luoi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; align-items: start; }
.bh-ch-luoi > .panel { margin: 0; min-width: 0; }
.panel.bh-ch { margin-bottom: 12px; }
.bh-ch-luoi > .panel.bh-ch { margin-bottom: 0; }
.bh-ch .panel-head { display: flex; align-items: center; gap: 6px; }
.bh-ch .panel-head .k-tt { font-size: 11.5px; text-transform: none; font-weight: 600; }
.bh-ch .panel-body { min-width: 0; }
.bh-ch-tt { width: 100%; margin-bottom: 10px; table-layout: fixed; }
.bh-ch-tt td { overflow-wrap: anywhere; vertical-align: middle; }
.bh-ch-tt td:first-child { width: 150px; }
.bh-ma-may-ch { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bh-ma-may-ch code { overflow-wrap: anywhere; }
.bh-ma-may-ch .btn { padding: 1px 7px; font-size: 12px; }
.bh-ch-nut { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bh-ch-ghi { margin-top: 8px; line-height: 1.5; }
.bh-ch-tb { margin: 10px 0 0; }
.bh-ch-o { margin-top: 4px; }
.bh-ch-dang { font-size: 12.5px; color: #5a6b7d; margin-bottom: 8px; overflow-wrap: anywhere; }
.bh-ch-loai { margin-bottom: 10px; }
.bh-sw { margin: 0; min-height: 0; padding-top: 3px; }
.bh-sw .form-check-input { cursor: pointer; }
.bh-sw .form-check-label { cursor: pointer; font-size: 13px; }
.bh-ch-sw { display: flex; align-items: flex-end; padding-bottom: 4px; }
.bh-dir .form-control { min-width: 0; }
.bh-ch-tt-quet { margin-top: 10px; font-size: 12.5px; color: #5a6b7d; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; overflow-wrap: anywhere; }
.bh-ch-cau-truc { margin-top: 10px; display: block; }
.bh-ch-cau-truc .bh-ch-tt { margin: 6px 0; background: transparent; }
.bh-ch-cau-truc .bh-ch-tt td:first-child { width: 110px; }
.bh-ch-goi { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.bh-ch-ghi-goi { white-space: pre-wrap; margin-top: 4px; font-size: 12.5px; }
.bh-ch .k-bang { margin-top: 10px; }
.bh-ch-them { margin: 14px 0 6px; }
.bh-ch-them-nut { display: flex; align-items: flex-end; }
.bh-chon-tm .input-group { margin-bottom: 8px; }
.bh-fs.fs-list { border: 1px solid #ced4da; border-radius: 3px; max-height: 320px; overflow: auto; background: #fff; }
.bh-fs .fs-i { padding: 5px 10px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #eef1f4; overflow-wrap: anywhere; }
.bh-fs .fs-i:hover { background: #f1f6fc; }
.bh-fs .fs-i.on { background: #e3eefb; color: #0d47a1; font-weight: 600; }
.bh-fs .fs-i .bi-folder-fill { color: #e0a526; }
.bh-fs .fs-i.up { color: #5a6b7d; }
.bh-chon-tm .bh-ch-nut { margin: 8px 0; }
.bh-chon-tm .k-hop { margin: 0; }
.bh-ch-kd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }

@media (max-width: 1100px) { .bh-luoi, .bh-loi-luoi, .bh-ch-luoi { grid-template-columns: minmax(0, 1fr); } }
.bh-luoi > *, .bh-bang-xml { min-width: 0; }
.bh-xml1 .k-tt2 { display: table; table-layout: fixed; margin: 0; }
.bh-xml1 table.k-tt2 td, .bh-xml1 table.k-tt2 td:first-child { overflow-wrap: anywhere; white-space: normal; }
@media (max-width: 760px) {
  .bh-quick { flex-basis: 100%; }
  .bh-quick .btn .chu { display: none; }
  .bh-loc .ngay { width: 132px; }
  .bh-loc .pham-vi { margin-left: 0; flex-basis: 100%; }
  .bh-hang { grid-template-columns: 110px 1fr 60px; }
  .bh-loc .bh-tu-khoa, .bh-loc .bh-quy-tac, .bh-loc .bh-ma-may, .bh-loc .bh-nb-tim { width: 100%; max-width: none; flex-basis: 100%; }
  .bh-tiles.bh-tiles-kq { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bh-form, .bh-form.bh-form-4 { grid-template-columns: minmax(0, 1fr); }
  .bh-form .s2, .bh-form .s3c { grid-column: auto; }
  .bh-qt .ci input.f, .bh-qt .ci select.op, .bh-qt .ci input.v, .bh-qt .ci .opt { width: 100%; }
  .bh-qt-con { padding-left: 6px; }
  .bh-qt-each { flex-wrap: wrap; }
  .bh-cd-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
  .bh-cd-tabs .nav-link { white-space: nowrap; }
  .bh-tiles.bh-tiles-kq .k-tile .gt { font-size: 17px; overflow-wrap: anywhere; }
  .bh-tiles.bh-tiles-kq .k-tile .ic { width: 30px; height: 30px; font-size: 15px; }
  .bh-trang { flex-wrap: wrap; }
  .bh-xml1 .k-tt2 td:first-child { width: 40%; }
  .bh-ch-tt td:first-child { width: 38%; }
  .bh-ch-cau-truc .bh-ch-tt td:first-child { width: 90px; }
}
