body {
    --headerh: 72px !important;
}

#main-header {
    position: relative !important;
    z-index: 20 !important;
    background: #fff !important;
    background-image: none !important;
    height: auto !important;
    min-height: 72px !important;
    flex: 0 0 auto;
    box-shadow: none !important;
    border: 0 !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
}

body.theader_transparent #main-header .header-inner2,
body.theader_transparent_light #main-header .header-inner2,
#main-header .header-innner,
#main-header .header-inner2 {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 72px !important;
    overflow: visible !important;
}

body.theader_transparent #page-header .inner,
body.theader_transparent_light #page-header .inner {
    margin-top: 0 !important;
}

#main-header.sticky-el,
#main-header.sticky-el #master-header,
#main-header.sticky-el .master-header-inner,
#main-header.sticky-el .master-header-inner-bg {
    background: #fff !important;
    background-image: none !important;
}

#master-header.sticky-el {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
}

#master-header,
#master-header .master-header-inner,
#master-header .master-header-inner-bg {
    background: #fff !important;
    background-image: none !important;
    height: auto !important;
    min-height: 72px !important;
    overflow: visible !important;
    max-height: none;
}

#master-header .container-fluid,
#master-header .flexcols {
    height: auto !important;
    min-height: 72px;
}

#master-header .iefp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    height: auto;
    padding: 0 80px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.iefp-header-start {
    display: flex;
    align-items: center;
    gap: 32px;
    min-width: 0;
}

#master-header .logo-wrap,
#master-header .iefp-header-logo-wrap {
    margin: 0 !important;
    max-width: none !important;
    width: auto !important;
    flex: 0 0 auto;
    position: relative;
}

#master-header .iefp-header-logo {
    display: flex;
    align-items: center;
    line-height: 0;
}

#master-header .iefp-header-logo img,
#master-header .iefp-header-logo svg {
    width: 46.47px !important;
    height: 40px !important;
    max-width: 46.47px !important;
    max-height: 40px !important;
    display: block;
}

.iefp-header-nav ul {
    display: flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.iefp-header-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    min-height: 38px;
    box-sizing: border-box;
    font-family: var(--font1) !important;
    font-weight: 400 !important;
    font-size: 16px !important;
    line-height: 22px !important;
    color: var(--muted) !important;
    border-radius: 4px;
    text-decoration: none !important;
    background: transparent !important;
}

.iefp-header-nav a:hover,
.iefp-header-nav a:focus,
.iefp-header-nav a:focus-visible,
.iefp-header-nav li.is-active a,
.iefp-header-nav a[aria-current="page"] {
    background: var(--csix) !important;
    color: var(--primary) !important;
}

.iefp-header-end {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 0 0 auto;
}

.iefp-header-editswitch {
    display: flex;
    align-items: center;
}

.iefp-header-editswitch .editmode-switch-form {
    margin: 0;
}

.iefp-header-editswitch .editmode-switch-form .input-group {
    align-items: center;
}

.iefp-header-editswitch .editmode-switch-form label {
    font-family: var(--font1) !important;
    font-weight: 400 !important;
    font-size: 14px !important;
    line-height: 20px !important;
    color: var(--muted) !important;
    margin: 0 !important;
    white-space: nowrap;
}

.iefp-header-toggle {
    display: none !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 20px;
    cursor: pointer;
}

.iefp-header-toggle .icon-close {
    display: none;
}

.iefp-header-toggle[aria-expanded="true"] .icon-open {
    display: none;
}

.iefp-header-toggle[aria-expanded="true"] .icon-close {
    display: inline-block;
}

.iefp-header-end {
    max-width: 100%;
    min-width: 0;
}

.iefp-header-tools {
    display: flex !important;
    align-items: center;
    gap: 20px;
    position: relative !important;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
}

.iefp-header-tools .theme-plugins {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    width: auto !important;
    min-width: 0;
}

.iefp-header-tools .popover-region {
    position: relative !important;
    display: flex !important;
    align-items: center;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    flex: 0 0 auto;
}

/* Collapsed Moodle popovers keep width:380px + visibility:hidden, which
   overflows the viewport (parent also sets right:-20px). Hide them fully. */
.iefp-header-tools .popover-region.collapsed .popover-region-container {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    right: auto !important;
    left: auto !important;
    margin: 0 !important;
}

.iefp-header-tools .popover-region:not(.collapsed) .popover-region-container {
    display: block !important;
    right: 0 !important;
    left: auto !important;
    margin-left: 0 !important;
    top: 100% !important;
    width: 380px;
    max-width: min(380px, calc(100vw - 32px));
}

.iefp-header-tools [data-region="popover-region-messages"] {
    display: none !important;
}

#main-header .iefp-header-tools .popover-region-container {
    right: 0 !important;
    left: auto !important;
    margin-left: 0 !important;
}

.iefp-header-tools .popover-region-notifications .popover-region-toggle,
.iefp-header-tools .popover-region-notifications .popover-region-toggle .icon,
.iefp-header-tools .popover-region-notifications .popover-region-toggle i,
.iefp-header-tools #nav-notification-popover-container .popover-region-toggle i {
    color: var(--primary) !important;
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
    line-height: 20px !important;
    background: transparent !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}

.iefp-header-tools #nav-notification-popover-container .popover-region-toggle i:before,
.iefp-header-tools .popover-region-notifications .popover-region-toggle i:before {
    content: "\f0f3" !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
    color: var(--primary) !important;
}

.iefp-header-tools .popover-region-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.iefp-header-tools .popover-region .text1,
.iefp-header-tools .theme-plugins .text1 {
    display: none !important;
}

.iefp-header-tools .count-container,
.iefp-header-tools .unread-count-container {
    background: var(--primary) !important;
}

.iefp-header-tools .tool-search,
.iefp-header-tools .tool-signup,
.iefp-header-tools .header-mtools-link,
.iefp-header-tools .mtool-login {
    display: none !important;
}

.iefp-header-tools .tool-login {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    height: auto !important;
    min-height: 0 !important;
    color: var(--muted) !important;
    text-decoration: none !important;
    cursor: pointer;
}

.iefp-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--csix);
    color: var(--primary);
    font-family: var(--font1) !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    line-height: 1 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
}

.iefp-header-username {
    font-family: var(--font1) !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    line-height: 22px !important;
    color: var(--muted) !important;
    white-space: nowrap;
}

#main-header .top-bar,
#main-header .site-menu,
#main-header #main-navigation,
#main-header .header-content,
#main-header .social-list,
#main-header .header-buttons,
#master-header .main-logo .logo-light,
#master-header .main-logo .logo-dark {
    display: none !important;
}

@media (max-width: 1439px) {
    #master-header .iefp-header {
        padding: 0 40px;
    }
}

@media (max-width: 991px) {
    #master-header .iefp-header {
        padding: 0 16px;
    }

    .iefp-header-toggle {
        display: flex !important;
    }

    .iefp-header-start {
        gap: 16px;
    }

    .iefp-header-nav {
        display: none !important;
        position: fixed;
        top: var(--headerh, 72px);
        left: 0;
        right: 0;
        width: 100%;
        background: #fff;
        padding: 8px 16px 16px;
        z-index: 1030;
        box-shadow: 0 8px 16px rgba(0, 48, 23, 0.08);
        max-height: calc(100vh - var(--headerh, 72px));
        overflow-y: auto;
    }

    .iefp-header-nav.is-open,
    .iefp-header:has(.iefp-header-toggle[aria-expanded="true"]) .iefp-header-nav {
        display: block !important;
    }

    .iefp-header-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .iefp-header-nav a {
        justify-content: flex-start;
        width: 100%;
    }

    .iefp-header-username {
        display: none;
    }
}
