/* Thanh nội bộ trên trang module cũ. Chỉ nạp khi nhân viên đã đăng nhập. Mọi lớp có tiền tố nbt.
   Nút Đăng nhập cho khách nằm ở includes/noibo/thanh.php để khách không phải tải tệp này.
   Màu phân hệ, biểu tượng, lối tắt dùng chung với /noi-bo (DESIGN_NOIBO.md). */
:root { --nbt-nen: #fff; --nbt-vien: #dce5ec; --nbt-chu: #5b6876; --nbt-dam: #0054a6; --nbt-mat2: #f4f7fa; --nbt-chu-dam: #1f2d3d; }
@media (prefers-color-scheme: dark) {
    :root { --nbt-nen: #182733; --nbt-vien: #2a3d4d; --nbt-chu: #a3b5c4; --nbt-dam: #79c0f2; --nbt-mat2: #142230; --nbt-chu-dam: #e4edf4; }
}

/* Màu phân hệ: --m chữ, biểu tượng; --mn nền nhạt. Đều đạt WCAG AA */
:is(.nbt, .nbt-lt-hop, .nbt-dau, .s2-nav) .m-xanh, [data-m="xanh"] { --m: #0054a6; --mn: #e8f1fb; }
:is(.nbt, .nbt-lt-hop, .nbt-dau, .s2-nav) .m-ngoc, [data-m="ngoc"] { --m: #0e7490; --mn: #e2f3f7; }
:is(.nbt, .nbt-lt-hop, .nbt-dau, .s2-nav) .m-cham, [data-m="cham"] { --m: #3f51b5; --mn: #eceefb; }
:is(.nbt, .nbt-lt-hop, .nbt-dau, .s2-nav) .m-luc, [data-m="luc"] { --m: #17803d; --mn: #e5f5ea; }
:is(.nbt, .nbt-lt-hop, .nbt-dau, .s2-nav) .m-cam, [data-m="cam"] { --m: #b45309; --mn: #fdf1e3; }
:is(.nbt, .nbt-lt-hop, .nbt-dau, .s2-nav) .m-tim, [data-m="tim"] { --m: #6d3fb8; --mn: #f0eafa; }
:is(.nbt, .nbt-lt-hop, .nbt-dau, .s2-nav) .m-do, [data-m="do"] { --m: #b42318; --mn: #fdecea; }
@media (prefers-color-scheme: dark) {
    :is(.nbt, .nbt-lt-hop) :is(.m-xanh, .m-ngoc, .m-cham, .m-luc, .m-cam, .m-tim, .m-do), :is(.nbt, .nbt-lt-hop)[data-m] { --mn: rgba(255, 255, 255, .07); }
    :is(.nbt, .nbt-lt-hop) .m-xanh, :is(.nbt, .nbt-lt-hop)[data-m="xanh"] { --m: #79c0f2; }
    :is(.nbt, .nbt-lt-hop) .m-ngoc, :is(.nbt, .nbt-lt-hop)[data-m="ngoc"] { --m: #6fd0e4; }
    :is(.nbt, .nbt-lt-hop) .m-cham, :is(.nbt, .nbt-lt-hop)[data-m="cham"] { --m: #a9b4f5; }
    :is(.nbt, .nbt-lt-hop) .m-luc, :is(.nbt, .nbt-lt-hop)[data-m="luc"] { --m: #7ad69a; }
    :is(.nbt, .nbt-lt-hop) .m-cam, :is(.nbt, .nbt-lt-hop)[data-m="cam"] { --m: #f2b870; }
    :is(.nbt, .nbt-lt-hop) .m-tim, :is(.nbt, .nbt-lt-hop)[data-m="tim"] { --m: #c6a8f5; }
    :is(.nbt, .nbt-lt-hop) .m-do, :is(.nbt, .nbt-lt-hop)[data-m="do"] { --m: #f6a8a1; }
}
.nbt-bt { width: 22px; height: 22px; flex: none; transform-box: fill-box; transform-origin: center; }

/* Thanh: máy tính nổi giữa đáy, điện thoại sát đáy */
.nbt { position: fixed; left: 50%; bottom: 14px; z-index: 99990; display: flex; align-items: stretch; gap: 2px; max-width: calc(100vw - 24px); padding: 4px; background: var(--nbt-nen); border: 1px solid var(--nbt-vien); border-radius: 14px; box-shadow: 0 6px 22px rgba(10, 22, 33, .22); transform: translateX(-50%); font: 13px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
.nbt a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 76px; min-height: 48px; padding: 5px 8px 4px; border-radius: 10px; color: var(--nbt-chu); text-decoration: none; }
.nbt a .nbt-bt { color: var(--m, var(--nbt-chu)); }
.nbt a:hover, .nbt a:focus-visible { background: var(--mn, rgba(0, 84, 166, .1)); color: var(--m, var(--nbt-dam)); }
.nbt a:focus-visible, .nbt-lt-hop a:focus-visible, .nbt-lt-dong:focus-visible { outline: 2px solid var(--nbt-dam); outline-offset: 2px; }
.nbt i { position: absolute; top: 2px; left: calc(50% + 4px); min-width: 18px; padding: 0 5px; border-radius: 9px; background: #c9281c; color: #fff; font-size: 13px; font-style: normal; font-weight: 600; line-height: 18px; text-align: center; }
.nbt i[hidden] { display: none; }
.nbt .nbt-mo .nbt-bt { color: var(--m); }
.nbt .nbt-ra .nbt-bt { color: var(--nbt-chu); }
/* Ô "đang ở phân hệ nào": màu của module đang mở */
.nbt-dang { display: flex; align-items: center; gap: 8px; max-width: 220px; margin-right: 4px; padding: 0 12px; border-radius: 10px; background: var(--mn); color: var(--m); font-size: 13px; }
.nbt-dang b { overflow: hidden; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.nbt[hidden] { display: none !important; }
/* Khối giữ chỗ đặt sau cùng trang: cuối trang luôn cuộn lên được trên thanh nổi, không che chân trang, nút cuối trang */
.nbt-cho { display: block; clear: both; height: 84px; }
/* Máy hẹp hoặc chữ to: bớt chữ ô "đang ở" để thanh không tràn */
@media (min-width: 900px) and (max-width: 1100px) {
    .nbt-dang b { display: none; }
    .nbt a { min-width: 64px; }
}
/* Nút Phân hệ gắn vào thanh tab của Giao ban: mang kiểu của chính thanh đó, chỉ chỉnh biểu tượng cho cùng cỡ */
.s2-nav .nbt-s2 .nbt-bt { width: 1.15em; height: 1.15em; vertical-align: -.15em; }
/* Thanh tab điện thoại của Giao ban chia 5 cột: thêm một cột cho nút Phân hệ để không rớt xuống dòng dưới */
@media (max-width: 899px) { .s2-nav:has(> .nbt-s2) { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; } .s2-nav:has(> .nbt-s2) > a span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; } }

/* Bảng chuyển phân hệ: giữa màn hình trên máy tính, trượt từ đáy trên điện thoại; luôn nằm gọn trong màn hình */
.nbt-lt-hop { width: min(720px, calc(100vw - 32px)); max-height: min(80vh, 720px); max-height: min(80dvh, 720px); margin: auto; padding: 0; border: 1px solid var(--nbt-vien); border-radius: 16px; background: var(--nbt-nen); color: var(--nbt-chu-dam); box-shadow: 0 24px 60px rgba(10, 22, 33, .3); overflow: auto; overscroll-behavior: contain; font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
.nbt-lt-hop::backdrop { background: rgba(10, 22, 33, .5); }
.nbt-lt-hop *, .nbt-lt-hop *::before, .nbt-lt-hop *::after { box-sizing: border-box; }
.nbt-lt-dau { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--nbt-vien); background: var(--nbt-nen); }
.nbt-lt-dau b { font-size: 16px; }
.nbt-lt-dau small { color: var(--nbt-chu); }
.nbt-lt-dong { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: auto; border: 0; border-radius: 50%; background: none; color: var(--nbt-chu); cursor: pointer; }
.nbt-lt-dong:hover { background: var(--nbt-mat2); }
.nbt-lt-hop a.nbt-lt-ra { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-left: auto; padding: 0 12px; border: 1px solid var(--nbt-vien); border-radius: 22px; color: var(--nbt-chu-dam); font-weight: 600; text-decoration: none; }
.nbt-lt-hop a.nbt-lt-ra:hover { background: var(--nbt-mat2); }
.nbt-lt-hop a.nbt-lt-ra + .nbt-lt-dong { margin-left: 0; }
.nbt-lt-ra .nbt-bt { width: 18px; height: 18px; }
.nbt-lt-tieu { margin: 14px 18px 8px; color: var(--nbt-chu); font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.nbt-lt-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 0 18px; }
.nbt-lt-luoi:last-child { padding-bottom: 18px; }
.nbt-lt-hop a.nbt-lt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px; border: 1px solid var(--nbt-vien); border-radius: 12px; background: var(--nbt-nen); color: var(--nbt-chu-dam); font-weight: 500; line-height: 1.25; text-decoration: none; }
.nbt-lt-hop a.nbt-lt:hover { border-color: var(--m); background: var(--mn); }
.nbt-lt-hop a.nbt-lt.dang { border-color: var(--m); background: var(--mn); color: var(--m); font-weight: 700; }
.nbt-lt-bt { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--mn); color: var(--m); }
.nbt-lt-bt .nbt-bt { width: 20px; height: 20px; }
.nbt-lt-ten { min-width: 0; overflow-wrap: anywhere; }

/* Đầu trang gọn cùng màu chân trang chung, thay khung website khi nhân viên đã đăng nhập */
.nbt-dau { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 24px; padding: 8px 24px; background: linear-gradient(100deg, #123f6e 0%, #165083 45%, #17627a 100%); color: #fff; font: 14px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
.nbt-dau::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--m, #0a74b0); }
.nbt-dau a { color: #fff !important; text-decoration: none; }
.nbt-dau-hieu { display: flex; align-items: center; gap: 10px; }
.nbt-dau-hieu img { width: 34px; height: 34px; padding: 2px; border-radius: 50%; background: #fff; object-fit: contain; }
.nbt-dau-hieu b, .nbt-dau-hieu small { display: block; }
.nbt-dau-hieu small { color: rgba(255, 255, 255, .8); font-size: 13px; }
.nbt-dau nav { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.nbt-dau nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 10px; border-radius: 8px; font-weight: 500; }
.nbt-dau nav .nbt-bt { width: 18px; height: 18px; opacity: .85; }
.nbt-dau nav a:hover, .nbt-dau nav a:focus-visible { background: rgba(255, 255, 255, .16); }
/* Viền tiêu điểm trên dải nền đậm: màu trắng mới nhìn rõ */
.nbt-dau a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.nbt-dau nav a[aria-current="page"] { background: #fff; color: var(--m, #0054a6) !important; font-weight: 700; }
.nbt-dau nav a[aria-current="page"] .nbt-bt { opacity: 1; }
.nbt-dau-mo { border: 1px solid rgba(255, 255, 255, .35); }
body:has(> .nbt-dau) > header:not(.nbt-dau), body:has(> .nbt-dau) .section-nav, body:has(> .nbt-dau) nav.third-nav, body:has(> .nbt-dau) #solid-footer { display: none !important; }

/* Điện thoại: thanh tab sát đáy, thay thanh liên hệ dành cho khách */
@media (max-width: 899px) {
    .nbt { right: 0; left: 0; bottom: 0; max-width: none; padding: 0 0 env(safe-area-inset-bottom); border-width: 1px 0 0; border-radius: 0; box-shadow: none; transform: none; }
    .nbt a { flex: 1 1 0; min-width: 0; min-height: 60px; padding: 6px 2px 4px; border-radius: 0; font-size: 13px; }
    .nbt a span { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .nbt-dang, .nbt .nbt-ra { display: none; }
    .hl-appbar { display: none !important; }
    .nbt-cho { height: calc(76px + env(safe-area-inset-bottom)); } /* đợt 30: thanh cao 61px, chừa thêm 15px để dòng cuối (SHKH, giao diện điện thoại) không sát thanh */
    .nbt-lt-hop { width: 100%; max-width: 100%; max-height: 86vh; max-height: 86dvh; margin: auto 0 0; border-width: 1px 0 0; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
    .nbt-lt-luoi { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 14px; }
    .nbt-lt-tieu { margin: 14px 14px 8px; font-size: 16px; }
    .nbt-lt-hop, .nbt-lt-dau small, .nbt-dau, .nbt-dau-hieu small { font-size: 16px; }
    .nbt-dau { padding: 8px 14px; }
}
/* Chữ to hoặc máy hẹp: bớt chữ trên thanh máy tính để không tràn */

/* Hiệu ứng động: chỉ transform, chạy một lần khi rê chuột, focus hoặc chạm; tắt khi máy đặt giảm chuyển động */
@media (prefers-reduced-motion: no-preference) {
    .nbt a, .nbt-lt-hop a.nbt-lt { transition: background-color .15s, border-color .15s, transform .16s, opacity .15s; }
    .nbt-lt-hop a.nbt-lt:hover { transform: translateY(-2px); }
    .nbt a:active, .nbt-lt-hop a.nbt-lt:active { transform: scale(.96); }
    :is(.nbt, .nbt-lt-hop, .nbt-dau, .s2-nav) a:is(:hover, :focus-visible, :active) .nbt-bt { animation: nbt-noi .42s cubic-bezier(.3, .7, .4, 1); }
    :is(.nbt, .nbt-lt-hop, .nbt-dau, .s2-nav) a:is(:hover, :focus-visible, :active) .nbt-bt-tb { transform-origin: 50% 12%; animation: nbt-chuong .6s ease-in-out; }
    :is(.nbt, .nbt-lt-hop, .nbt-dau, .s2-nav) a:is(:hover, :focus-visible, :active) :is(.nbt-bt-quantri, .nbt-bt-tienich) { animation: nbt-xoay .5s cubic-bezier(.3, .7, .4, 1); }
    :is(.nbt, .nbt-lt-hop, .nbt-dau, .s2-nav) a:is(:hover, :focus-visible, :active) :is(.nbt-bt-danhba, .nbt-bt-lienhe) { animation: nbt-lac .5s ease-in-out; }
    :is(.nbt, .nbt-lt-hop, .nbt-dau, .s2-nav) a:is(:hover, :focus-visible, :active) :is(.nbt-bt-ra, .nbt-bt-media) { animation: nbt-phai .42s ease-out; }
    .nbt-lt-hop[open] { animation: nbt-mo .2s cubic-bezier(.2, .7, .3, 1); }
    .nbt-lt-hop[open] .nbt-lt { animation: nbt-vao .26s cubic-bezier(.2, .7, .3, 1) backwards; }
    .nbt-lt-hop[open] .nbt-lt:nth-child(2) { animation-delay: .02s; }
    .nbt-lt-hop[open] .nbt-lt:nth-child(3) { animation-delay: .04s; }
    .nbt-lt-hop[open] .nbt-lt:nth-child(n+4) { animation-delay: .06s; }
}
@keyframes nbt-noi { 40% { transform: translateY(-2px) scale(1.12); } }
@keyframes nbt-chuong { 20% { transform: rotate(14deg); } 40% { transform: rotate(-11deg); } 60% { transform: rotate(6deg); } 80% { transform: rotate(-3deg); } }
@keyframes nbt-xoay { to { transform: rotate(90deg); } }
@keyframes nbt-lac { 25% { transform: rotate(-12deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-5deg); } }
@keyframes nbt-phai { 50% { transform: translateX(3px); } }
@keyframes nbt-mo { from { opacity: 0; transform: translateY(12px); } }
@keyframes nbt-vao { from { opacity: 0; transform: translateY(6px); } }

@media print { .nbt, .nbt-cho, .nbt-lt-hop, .nbt-dau { display: none !important; } }

/* Đợt 45: nút "Nội bộ" về thẳng Hệ thống nội bộ trên thanh của Giao ban và thanh đầu của Sinh hoạt khoa học */
.shkh-tren__nb .nbt-bt { width: 16px; height: 16px; vertical-align: -3px; }
.shkh-tren__nb { margin-right: 6px; }
@media (max-width: 899px) { .s2-nav > .nbt-s2-ve { display: none !important; } }
/* Có nút Nội bộ thì nút Website thu về biểu tượng để tên module không bị cắt */
.shkh-tren__nb + .shkh-tren__web span { display: none; }
.shkh-tren__nb + .shkh-tren__web { padding-left: 10px; padding-right: 10px; }

/* Đợt 46: thanh nổi dưới đáy chỉ dành cho điện thoại. Máy tính đã có lối về Nội bộ trên đầu trang (nút "Nội bộ", nút "Phân hệ", tab "Cổng nội bộ") */
@media (min-width: 900px) { .nbt, .nbt-cho { display: none !important; } }
/* Đợt 47: đầu trang gọn dùng cho cả khách ở Văn bản, Đội ngũ bác sĩ, Tiện ích, Giá dịch vụ (máy tính). Nút Đăng nhập nằm trong đầu trang */
.nbt-dau-khach nav { margin-left: auto; }
.nbt-dau .nbt-dn { position: static; flex: none; min-height: 40px; margin-left: 4px; box-shadow: none; }
.nbt-dau a.nbt-dn { color: #0054a6 !important; }
.nbt-dau a.nbt-dn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* Đợt 58: đổi vai trò đang dùng ngay trong bảng "Chuyển phân hệ"; vai trò áp chung cho mọi phân hệ */
.nbt-vt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--nbt-vien); background: color-mix(in srgb, var(--mn, #e8f1fb) 55%, var(--nbt-nen)); }
.nbt-vt > b { font-size: 14px; color: var(--nbt-chu-dam); }
.nbt-vt-ds { display: flex; flex-wrap: wrap; gap: 6px; }
.nbt-vt-ds button { min-height: 44px; padding: 0 14px; border: 1px solid var(--nbt-vien); border-radius: 22px; background: var(--nbt-nen); color: var(--nbt-chu-dam); font: inherit; font-weight: 600; cursor: pointer; }
.nbt-vt-ds button:hover { border-color: var(--m, #0054a6); }
.nbt-vt-ds button[aria-pressed="true"] { border-color: var(--m, #0054a6); background: var(--m, #0054a6); color: #fff; }
.nbt-vt-ds button:focus-visible { outline: 2px solid var(--m, #0054a6); outline-offset: 2px; }
.nbt-vt > small { flex-basis: 100%; color: var(--nbt-chu); }
@media (max-width: 899px) { .nbt-vt > b, .nbt-vt-ds button, .nbt-vt > small { font-size: 16px; } }