/* ============================================
   UI fixes found in the 2026-11-12 audit.
   The top menu (.horizontal-menu) is position:fixed with z-index 1050, and the
   active section's sub-menu is an always-open dropdown inside it.
   ============================================ */

/* 1. Combobox lists (bootstrap-select, z-index 1035) and validation prompts
      (validationEngine .formError, z-index 990) opened under the fixed top menu,
      e.g. a list that opens upward near the top of the screen. Keep them above it. */
.bootstrap-select.btn-group .dropdown-menu,
.bootstrap-select.btn-group.open .dropdown-menu {
    z-index: 1060 !important;
}
.formError,
.formError .formErrorContent,
.formError .formErrorArrow {
    z-index: 1081 !important;
}

/* 1b. (audit 2026-11-17) Dialogs (bootstrap-dialog .modal, z-index 1050) tied with the
      fixed top menu, so the menu covered the dialog title and close button
      (e.g. Quản lý khách hàng → Thêm mới). Put dialogs and their backdrop above the menu. */
.modal-backdrop {
    z-index: 1065 !important;
}
.modal {
    z-index: 1070 !important;
}

/* 2. The always-open sub-menu wrapped to two lines on narrower desktop screens,
      making the fixed header taller than the 120px the page reserves and covering
      the page title. Keep it on one line and scroll sideways when it does not fit.
      Below 992px the whole menu is the off-canvas drawer (css/mobile-menu.css),
      because the top-level items (~930px) no longer fit on one line there. */
@media (min-width: 992px) {
    .horizontal-menu .navbar .navbar-nav > li > ul.mega-dropdown-menu.open {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
    }
    .horizontal-menu .navbar .navbar-nav > li > ul.mega-dropdown-menu.open > li {
        float: none;
        flex: 0 0 auto;
    }
}

/* 3. Indicator detail (ChiTieuXetNghiemChiTiet): while editing a method row the two
      comboboxes and three number boxes pushed the table to ~970px inside a ~630px
      panel, so the row's Save button sat off-screen. Fit the table to its panel. */
table[id$=grvPhuongPhap] {
    table-layout: fixed;
    width: 100% !important;
}
[id$=grvPhuongPhap] th,
[id$=grvPhuongPhap] td {
    width: auto !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    white-space: normal;
}
[id$=grvPhuongPhap] tr > :nth-child(1) { width: 6% !important; }
[id$=grvPhuongPhap] tr > :nth-child(2) { width: 21% !important; }
[id$=grvPhuongPhap] tr > :nth-child(3) { width: 25% !important; }
[id$=grvPhuongPhap] tr > :nth-child(4) { width: 11% !important; }
[id$=grvPhuongPhap] tr > :nth-child(5) { width: 13% !important; }
[id$=grvPhuongPhap] tr > :nth-child(6) { width: 14% !important; }
[id$=grvPhuongPhap] tr > :nth-child(7) { width: 10% !important; }
[id$=grvPhuongPhap] .bootstrap-select:not(.input-group-btn),
[id$=grvPhuongPhap] .bootstrap-select > .dropdown-toggle,
[id$=grvPhuongPhap] td input[type=text] {
    width: 100% !important;
    min-width: 0 !important;
}
[id$=grvPhuongPhap] .bootstrap-select .filter-option {
    white-space: normal;
}

/* P2-HDSD-20261118: nút "Hướng dẫn sử dụng" cạnh nút cài đặt trên menu */
.horizontal-menu .navbar .navbar-right > li.m-guide > a { color: #fff; }
.horizontal-menu .navbar .navbar-right > li.m-guide > a:hover { background: rgba(255,255,255,.15); }
@media (min-width: 992px) {
    .horizontal-menu .navbar .navbar-right > li.m-guide > a { padding: 15px 14px 0 !important; height: 50px; white-space: nowrap; }
    .horizontal-menu .navbar .navbar-right > li.m-guide > a > i { display: inline-block !important; font-size: 20px !important; vertical-align: -3px; margin-right: 6px; }
    .m-guide-text { font-size: 14px; }
}
@media (max-width: 991px) {
    .horizontal-menu .navbar .js-navbar-collapse .navbar-right > li.m-guide > a {
        display: flex !important; align-items: center; margin: 2px 10px; padding: 12px !important;
        border-radius: 10px; color: #263238 !important; font-size: 14px; text-align: left !important;
    }
    .horizontal-menu .navbar .js-navbar-collapse .navbar-right > li.m-guide > a > i {
        display: inline-block !important; width: 26px; margin-right: 14px; font-size: 18px !important; color: #1565c0; text-align: center;
    }
    .m-guide-text { display: inline; }
}
