/* ============================================================================
   QuickMenu.css  -  page title row + Quick Menu bar, as in Foundry ERP (2026-10-14)
   Part of App_Themes/Default (linked automatically on every page).
   Row (AdminMaster .page-title-box), left to right:
     1. page-crumb   page icon tile (assets/js/menu-icons.js) + "back to" pill
                     (.navigationlink) + page title (.navigationlbl)
     2. #qmBar       up to 5 numbered one-click pages, chosen in the Quick Menu
                     popup (assets/js/quick-menu.js -> Admin/QuickMenu.ashx)
     3. notification bar (master styles) takes the rest of the row
   Selectors start with "html body" so they win over Default.css / the master.
   ========================================================================== */

/* ---------------------------------------------------------------- 1. page title row */

html body .page-title-box {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 8px 14px;
}

html body .page-title-box > .page-crumb {
    flex: 0 1 auto;
    width: auto;
    max-width: 42%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
}

html body .page-crumb-icon {
    flex: 0 0 auto;
    display: inline-flex;
}

html body .page-crumb-icon:empty {
    display: none;
}

html body .page-crumb-icon i.fmi {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 19px;
}

html body .page-crumb-text {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* previous page as a small "back" pill */
html body .page-title-box .navigationlink {
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 210px;
    min-width: 0;
    padding: 3px 10px 3px 8px;
    border: 1px solid #e2e6ee;
    border-radius: 20px;
    background: #f8f9fc;
    color: #6b7280 !important;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none !important;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

html body .page-title-box .navigationlink::before {
    content: "";
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin: 0 1px 0 2px;
}

html body .page-title-box .navigationlink:hover,
html body .page-title-box .navigationlink:focus {
    border-color: #1565C0;
    background: #eaf3ff;
    color: #1565C0 !important;
}

/* current page title */
html body .page-title-box .navigationlbl {
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
    text-transform: none;
    color: #1f2440;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* notification bar takes what is left of the row (wraps to its own line when narrow) */
html body .page-title-box > .notification-col {
    flex: 1 1 300px;
    width: auto;
    max-width: none;
    min-width: 260px;
    padding: 0;
}

/* ---------------------------------------------------------------- 2. Quick Menu bar */

.qm-bar {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.qm-label {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #7b8fae;
    margin-right: 2px;
}

.qm-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}

.qm-links:empty {
    display: none;
}

.qm-link {
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 170px;
    min-width: 46px;
    padding: 3px 11px 3px 4px;
    border: 1px solid #d3e3fa;
    border-radius: 999px;
    background: #ffffff;
    color: #0F4C81 !important;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 76, 129, .06);
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.qm-link:hover,
.qm-link:focus {
    background: #1565C0;
    border-color: #1565C0;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(21, 101, 192, .25);
}

.qm-no {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(180deg, #0F4C81 0%, #1E88E5 100%);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
}

.qm-link:hover .qm-no,
.qm-link:focus .qm-no {
    background: #ffffff;
    color: #1565C0;
}

.qm-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* edit button: round pencil when the bar has pages, "Add pages" pill when empty */
.qm-edit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 26px;
    min-width: 26px;
    padding: 0 6px;
    border: 1px dashed #9db4d6;
    border-radius: 999px;
    background: #eef4fd;
    color: #1565C0;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.qm-edit i {
    font-size: 15px;
    line-height: 1;
}

.qm-edit .qm-edit-text {
    display: none;
    padding-right: 4px;
    white-space: nowrap;
}

.qm-links:empty + .qm-edit {
    padding: 0 8px 0 6px;
}

.qm-links:empty + .qm-edit .qm-edit-text {
    display: inline;
}

.qm-edit:hover,
.qm-edit:focus {
    background: #1565C0;
    border-color: #1565C0;
    border-style: solid;
    color: #ffffff;
    outline: none;
}

/* ---------------------------------------------------------------- popup */

.qm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050; /* under the select2 dropdown */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 9vh 16px 16px;
    background: rgba(15, 40, 75, .38);
    opacity: 0;
    transition: opacity .16s ease;
}

.qm-overlay.is-on {
    opacity: 1;
}

.qm-dialog {
    width: 560px;
    max-width: 100%;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(15, 40, 75, .28);
    transform: translateY(-8px);
    transition: transform .16s ease;
    overflow: hidden;
}

.qm-overlay.is-on .qm-dialog {
    transform: none;
}

.qm-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(90deg, #0F4C81 0%, #1E88E5 100%);
    color: #ffffff;
}

.qm-head h5 {
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}

.qm-head p {
    margin: 3px 0 0;
    font-size: 12.5px;
    opacity: .88;
}

.qm-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: .85;
}

.qm-close:hover {
    opacity: 1;
}

.qm-body {
    padding: 14px 18px 6px;
    overflow-y: auto;
}

.qm-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.qm-row .qm-no {
    width: 24px;
    height: 24px;
    font-size: 12px;
}

.qm-row .qm-pick {
    flex: 1 1 auto;
    min-width: 0;
}

.qm-clear {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 1px solid #e1e7f0;
    border-radius: 50%;
    background: #ffffff;
    color: #8193ad;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.qm-clear:hover {
    border-color: #e57373;
    background: #fdecea;
    color: #c62828;
}

.qm-msg {
    min-height: 18px;
    margin: 2px 0 6px;
    font-size: 12.5px;
    color: #c62828;
}

.qm-msg.is-info {
    color: #6b7c93;
}

.qm-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #edf1f7;
    background: #f8fafd;
}

.qm-btn {
    min-width: 90px;
    padding: 6px 16px;
    border: 1px solid #c9d6e8;
    border-radius: 6px;
    background: #ffffff;
    color: #33475f;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.qm-btn:hover {
    background: #eef4fd;
}

.qm-btn-primary {
    border-color: #1565C0;
    background: #1565C0;
    color: #ffffff;
}

.qm-btn-primary:hover {
    background: #0F4C81;
}

.qm-btn[disabled] {
    opacity: .6;
    cursor: default;
}

/* select2 list inside the popup. Each menu group is ONE select2 option (li[role=group]) holding its
   pages, and Default.css paints every hovered/highlighted option blue - so the whole group went blue
   with its heading hidden. Groups stay plain; only the page under the mouse is highlighted. */
html body .qm-dd .select2-dropdown {
    border: 1px solid #c9d6e8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(15, 40, 75, .18);
}

html body .qm-dd .select2-search--dropdown {
    padding: 8px;
    background: #f8fafd;
    border-bottom: 1px solid #edf1f7;
}

html body .qm-dd .select2-search--dropdown .select2-search__field {
    height: 32px;
    padding: 4px 10px;
    border: 1px solid #c9d6e8;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

html body .qm-dd .select2-search--dropdown .select2-search__field:focus {
    border-color: #1565C0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, .12);
}

html body .qm-dd .select2-results > .select2-results__options {
    max-height: 300px;
    padding: 0 0 4px;
}

/* group row: no padding, background or hover of its own */
html body .qm-dd .select2-results__option[role="group"],
html body .qm-dd .select2-results__option.select2-results__option--group,
html body .qm-dd .select2-results__option[role="group"]:hover,
html body .qm-dd .select2-results__option.select2-results__option--group:hover {
    padding: 0 !important;
    background: transparent !important;
    color: inherit !important;
    cursor: default !important;
}

/* group heading (menu path), stays on top while scrolling its group */
html body .qm-dd .select2-results__group {
    position: sticky;
    top: 0;
    z-index: 1;
    display: block;
    padding: 6px 12px 4px !important;
    background: #eef4fd;
    border-top: 1px solid #e1eaf6;
    border-bottom: 1px solid #e1eaf6;
    color: #1565C0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: default;
}

/* pages */
html body .qm-dd .select2-results__option:not([role="group"]):not(.select2-results__option--group) {
    margin: 1px 4px;
    padding: 6px 10px 6px 14px !important;
    border-radius: 6px;
    background: transparent !important;
    color: #334155 !important;
    font-size: 13px !important;
}

html body .qm-dd .select2-results__option[aria-selected="true"]:not([role="group"]),
html body .qm-dd .select2-results__option--selected:not(.select2-results__option--group) {
    background: #e3eefc !important;
    color: #0F4C81 !important;
    font-weight: 600;
}

html body .qm-dd .select2-results__option--highlighted:not([role="group"]):not(.select2-results__option--group),
html body .qm-dd .select2-results__option:not([role="group"]):not(.select2-results__option--group):hover {
    background: #1565C0 !important;
    color: #ffffff !important;
}

html body .qm-dd .select2-results__message {
    padding: 12px 10px !important;
    text-align: center;
    font-size: 12.5px !important;
    color: #8a94a8 !important;
}

/* the popup's page boxes fill their row (Default.css fixes select2 boxes at a set width) */
html body .qm-row .select2-container {
    width: 100% !important;
}

/* ---------------------------------------------------------------- narrow screens */

@media (max-width: 767.98px) {
    html body .page-title-box > .page-crumb {
        max-width: 100%;
    }

    .qm-bar {
        flex-wrap: wrap;
    }

    .qm-links {
        flex-wrap: wrap;
    }

    .qm-link {
        max-width: 150px;
    }
}
