/**
 * HR mega-menu — lightweight premium ERP navigation.
 * Tokens: --primary-rgb, --primary-color (theme).
 */

.header-nav-menu .dropdown-menu.erp-mega-panel.erp-mega-panel--hr {
    min-width: min(920px, 96vw) !important;
    max-width: min(1140px, 98vw) !important;
    max-height: min(70vh, 32rem) !important;
    width: min(1140px, 98vw) !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.erp-mega-panel--hr .erp-mega-hr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 11rem !important;
    gap: 0.75rem !important;
    padding: 0.75rem 0.875rem !important;
    align-items: start !important;
    width: 100% !important;
}

.erp-mega-panel--hr .erp-mega-hr__main {
    min-width: 0 !important;
}

.erp-mega-panel--hr .erp-mega-hr__rail {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    min-width: 0 !important;
    border-inline-start: 1px solid rgba(var(--primary-rgb), 0.08) !important;
    padding-inline-start: 0.75rem !important;
}

.erp-mega-panel--hr .erp-mega-hr-rail-panel {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.erp-mega-panel--hr .erp-mega-hr-rail-panel .erp-mega-section-title {
    margin-block-end: 0.35rem !important;
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    line-height: 1.2 !important;
    color: var(--bs-secondary-color) !important;
}

.erp-mega-panel--hr .erp-mega-quick-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
}

.erp-mega-panel--hr a.mega-quick-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0.4rem 0.55rem !important;
    border-radius: 0.5rem !important;
    border: 0 !important;
    background: rgba(var(--primary-rgb), 0.06) !important;
    color: var(--primary-color) !important;
    text-decoration: none !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease !important;
}

.erp-mega-panel--hr a.mega-quick-btn i {
    font-size: 0.875rem !important;
    flex-shrink: 0 !important;
}

.erp-mega-panel--hr a.mega-quick-btn:hover {
    background: rgba(var(--primary-rgb), 0.12) !important;
    color: var(--primary-color) !important;
}

.erp-mega-panel--hr .erp-mega-hr-rail-panel .mega-signal-link,
.erp-mega-panel--hr .erp-mega-hr-rail-panel .mega-recent-link {
    display: flex !important;
    width: 100% !important;
    padding: 0.2rem 0.25rem !important;
    border-radius: 0.35rem !important;
    font-size: 0.75rem !important;
    line-height: 1.25 !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

.erp-mega-panel--hr .erp-mega-hr-rail-panel .mega-signal-link:hover,
.erp-mega-panel--hr .erp-mega-hr-rail-panel .mega-recent-link:hover {
    background: rgba(var(--primary-rgb), 0.06) !important;
    text-decoration: none !important;
}

.erp-mega-panel--hr .erp-mega-hr-rail-panel--signals {
    max-height: 10rem !important;
    overflow-y: auto !important;
}

.erp-mega-panel--hr .erp-mega-browse-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    column-gap: 1.25rem !important;
    row-gap: 1.15rem !important;
    align-items: start !important;
    width: 100% !important;
}

.erp-mega-panel--hr .erp-mega-browse-card {
    display: flex !important;
    flex-direction: column !important;
    height: fit-content !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.erp-mega-panel--hr .erp-mega-browse-card__title {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: start !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: var(--bs-body-color) !important;
    line-height: 1.25 !important;
}

.erp-mega-panel--hr .erp-mega-browse-card__title i {
    font-size: 0.95rem !important;
    color: var(--primary-color) !important;
    opacity: 0.85 !important;
    flex-shrink: 0 !important;
}

.erp-mega-panel--hr .erp-mega-browse-card__divider {
    display: block !important;
    height: 1px !important;
    width: 100% !important;
    margin-block: 0.35rem 0.3rem !important;
    background: rgba(var(--primary-rgb), 0.1) !important;
    border: 0 !important;
}

.erp-mega-panel--hr .erp-mega-browse-card__links {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.05rem !important;
    margin: 0 !important;
    padding: 0 !important;
}

.erp-mega-panel--hr .erp-mega-browse-card--wide {
    grid-column: span 2 !important;
}

.erp-mega-panel--hr .erp-mega-browse-card--wide .erp-mega-browse-card__links {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 0.75rem !important;
    row-gap: 0.05rem !important;
}

.erp-mega-panel--hr a.mega-nav-link--dense {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.25rem !important;
    margin: 0 !important;
    padding: 0.2rem 0.4rem !important;
    border-radius: 0.4rem !important;
    color: var(--bs-body-color) !important;
    text-decoration: none !important;
    font-size: 0.8125rem !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    min-height: 1.55rem !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

.erp-mega-panel--hr a.mega-nav-link--dense:hover {
    background: rgba(var(--primary-rgb), 0.08) !important;
    color: var(--primary-color) !important;
}

.erp-mega-panel--hr a.mega-nav-link--dense.is-active {
    background: rgba(var(--primary-rgb), 0.1) !important;
    font-weight: 600 !important;
    color: var(--primary-color) !important;
}

@media (min-width: 1200px) {
    .erp-mega-panel--hr .erp-mega-browse-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        column-gap: 1.5rem !important;
        row-gap: 1.25rem !important;
    }
}

@media (max-width: 1099.98px) {
    .erp-mega-panel--hr .erp-mega-hr {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .erp-mega-panel--hr .erp-mega-hr__rail {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        border-inline-start: 0 !important;
        border-block-start: 1px solid rgba(var(--primary-rgb), 0.08) !important;
        padding-inline-start: 0 !important;
        padding-block-start: 0.65rem !important;
    }

    .erp-mega-panel--hr .erp-mega-hr-rail-panel {
        flex: 1 1 10rem !important;
    }
}

@media (max-width: 899.98px) {
    .header-nav-menu .dropdown-menu.erp-mega-panel.erp-mega-panel--hr {
        min-width: min(96vw, 640px) !important;
        width: min(96vw, 640px) !important;
    }

    .erp-mega-panel--hr .erp-mega-browse-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        column-gap: 1rem !important;
        row-gap: 1rem !important;
    }

    .erp-mega-panel--hr .erp-mega-browse-card--wide {
        grid-column: span 2 !important;
    }
}

.erp-mega-browse-search {
    display: flex !important;
    flex-direction: column !important;
}

.erp-mega-browse-search__input {
    position: relative !important;
    margin-block-end: 0.6rem !important;
}

.erp-mega-browse-search__input i {
    position: absolute !important;
    inset-inline-start: 0.6rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--bs-secondary-color, #6c757d) !important;
    font-size: 0.8125rem !important;
    pointer-events: none !important;
}

.erp-mega-browse-search__input .form-control {
    padding-inline-start: 1.8rem !important;
    font-size: 0.8125rem !important;
}

.erp-mega-browse-search__empty {
    display: block !important;
}

.erp-mega-browse-search__empty[hidden] {
    display: none !important;
}
