body.template-b {
    --esms-shell-bg: #f0f6fd;
    --esms-shell-surface: rgba(248, 251, 255, 0.96);
    --esms-shell-surface-strong: #fafbfd;
    --esms-shell-border: rgba(59, 130, 246, 0.18);
    --esms-shell-border-strong: rgba(59, 130, 246, 0.28);
    --esms-shell-header-start: #2f97f2;
    --esms-shell-header-end: #87bff0;
    --esms-shell-topnav-start: rgba(248, 251, 255, 0.98);
    --esms-shell-topnav-end: rgba(240, 246, 253, 0.99);
    --esms-shell-title: #003d99;
    --esms-shell-text: #1e40af;
    --esms-shell-muted: #3b82f6;
    --esms-shell-accent: #0066cc;
    --esms-shell-accent-soft: rgba(0, 102, 204, 0.12);
    --esms-shell-success: #2d7f61;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 20rem),
        linear-gradient(180deg, #fafbfd 0%, #f0f6fd 34%, #e0f0ff 100%);
}

@media (max-width: 991.98px) {
    body.template-b .esms-sidebar-panel .nav-link {
        min-height: 38px;
        padding: .58rem .28rem;
        gap: .42rem;
    }

    body.template-b .esms-sidebar-panel .nav-link p {
        font-size: .84rem;
        line-height: 1.08;
    }

    body.template-b .esms-sidebar-panel .nav-link .nav-icon {
        width: 1rem;
        font-size: .82rem;
    }

    body.template-b .esms-sidebar-panel .nav-link .nav-arrow {
        font-size: .8rem;
    }

    body.template-b .esms-sidebar-panel .nav-treeview {
        padding: .02rem 0 .22rem;
    }

    body.template-b .esms-sidebar-panel .nav-treeview .nav-link {
        min-height: 26px;
        padding: .38rem .24rem .38rem .82rem;
        gap: .46rem;
    }

    body.template-b .esms-sidebar-panel .nav-treeview .nav-link p {
        font-size: .8rem;
        line-height: 1.08;
    }

    body.template-b .esms-sidebar-panel .nav-treeview .nav-icon {
        width: .78rem;
        height: .78rem;
        min-width: .78rem;
        margin-right: .18rem;
    }
}

body.template-b .esms-shell-header {
    background: linear-gradient(145deg, var(--esms-shell-header-start) 8%, var(--esms-shell-header-end) 100%) !important;
    box-shadow: 0 14px 28px rgba(0, 102, 204, 0.16);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    width: 100%;
}

body.template-b .esms-shell-header-main .dropdown-menu,
body.template-b .esms-shell-header-main .profile-menu,
body.template-b .esms-shell-header-main .navbar-notification-menu {
    z-index: 3050 !important;
}

body.template-b .esms-template-b-header-brand {
    min-width: 0;
    margin-left: 0.35rem;
}

body.template-b .esms-template-b-header-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.68rem;
    color: #fff;
    min-width: 0;
    max-width: min(68vw, 460px);
}

body.template-b .esms-template-b-header-brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 45% 35%, #ffffff 0%, #f8fbff 58%, #dbeafe 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.82) !important;
    overflow: hidden;
    transition: all 0.28s ease;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22), 0 0 18px rgba(255, 255, 255, 0.45), 0 8px 18px rgba(15, 23, 42, 0.22);
    padding: 0.18rem !important;
}

body.template-b .esms-template-b-header-brand-logo[data-bs-toggle="modal"]:hover,
body.template-b .esms-template-b-header-brand-logo[data-bs-toggle="modal"]:focus {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.48);
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 136, 229, 0.32), 0 0 12px rgba(0, 188, 212, 0.24);
}

body.template-b .esms-template-b-header-brand-logo[data-bs-toggle="modal"] {
    cursor: pointer;
}

body.template-b .esms-template-b-header-brand-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(14, 165, 233, 0.28)) saturate(1.12) contrast(1.06);
}

body.template-b .esms-template-b-header-brand-fallback {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #ffffff;
}

body.template-b .esms-template-b-header-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.1;
}

body.template-b .esms-template-b-header-brand-title,
body.template-b .esms-template-b-header-brand-subtitle,
body.template-b .esms-template-b-header-brand-org {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.template-b .esms-template-b-header-brand-title {
    font-size: 0.875rem;
    font-weight: 800;
    font-family: 'El Messiri', sans-serif;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

body.template-b .esms-template-b-header-brand-subtitle {
    margin-top: 0.08rem;
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.9);
}

body.template-b .esms-template-b-header-brand-org {
    margin-top: 0.08rem;
    font-size: 1.25rem;
    font-weight: 800;
    font-family: 'El Messiri', sans-serif;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6), 0 0 16px rgba(47, 151, 242, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

body.template-b .esms-sidebar-brand {
    display: none !important;
}

body.template-b .esms-topnav-link.is-active {
    color: #fff;
    border-color: rgba(29, 106, 194, 0.45);
    background: linear-gradient(135deg, #1f7fdf, #4fb3ee);
    box-shadow: 0 10px 22px rgba(31, 127, 223, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

body.template-b .esms-topnav-dropdown {
    border-color: rgba(47, 151, 242, 0.24);
    background: rgba(250, 253, 255, 0.99);
    box-shadow: 0 12px 28px rgba(47, 151, 242, 0.18);
    z-index: 3050;
}

body.template-b .esms-topnav-dropdown .dropdown-item {
    color: #1d4ea3;
}

body.template-b .esms-topnav-dropdown .dropdown-item:hover {
    background: rgba(47, 151, 242, 0.12);
    color: #154081;
}

body.template-b .esms-topnav-dropdown .dropdown-item.active {
    background: rgba(47, 151, 242, 0.2);
    color: #1f7fdf;
}

body.template-b .esms-topnav-nested-list {
    border-color: rgba(47, 151, 242, 0.24);
    background: rgba(250, 253, 255, 0.99);
    box-shadow: 0 12px 28px rgba(47, 151, 242, 0.18);
}

body.template-b .esms-topnav-nested-item.has-children:hover > .dropdown-item,
body.template-b .esms-topnav-nested-item.has-children:focus-within > .dropdown-item {
    background: rgba(47, 151, 242, 0.12);
    color: #154081;
}

body.template-b .esms-topnav-shell,
body.template-b .esms-topnav-inner,
body.template-b .esms-topnav-list,
body.template-b .esms-topnav-item,
body.template-b .esms-topnav-item .esms-topnav-link,
body.template-b .esms-topnav-panel,
body.template-b .esms-topnav-dropdown {
    overflow: visible !important;
}

body.template-b .esms-topnav-list {
    position: static !important;
}

body.template-b .esms-topnav-dropdown {
    display: none;
}

body.template-b .esms-topnav-item.show .esms-topnav-dropdown {
    display: block !important;
}

body.template-b .esms-topnav-shell {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 1048;
    width: 100%;
}

body.template-b .esms-shell-header-card {
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 15rem),
        linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(240, 246, 253, 0.96));
}

body.template-b .esms-shell-header-card .container-fluid {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

body.template-b .esms-shell-header-card .d-flex {
    padding: 0.85rem 0;
    align-items: center;
}

body.template-b .esms-shell-header-card .page-header-title {
    font-size: 13px;
    font-weight: 700;
    color: #003d99;
    margin: 0 !important;
    line-height: 1.2;
    white-space: nowrap;
}

body.template-b .esms-template-b-utility-shell {
    position: relative;
    z-index: 1030;
    margin: 0 auto;
    padding: 0.85rem 1rem 0;
}

body.template-b .esms-template-b-utility-inner {
    max-width: var(--esms-shell-max);
    margin: 0 auto;
    display: grid;
    gap: 0.85rem;
}

body.template-b .esms-template-b-dropdown-row {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(240, 246, 253, 0.95));
    box-shadow: 0 14px 30px rgba(0, 102, 204, 0.1);
}

body.template-b .esms-template-b-dropdown-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.template-b .esms-template-b-dropdown-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 102, 204, 0.1);
    color: #0066cc;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.template-b .esms-template-b-dropdown-title {
    margin: 0.65rem 0 0;
    color: #003d99;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

body.template-b .esms-template-b-dropdown-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-left: auto;
}

body.template-b .template-b-toolbar-trigger {
    position: relative;
    min-width: 220px;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(59, 130, 246, 0.16);
    box-shadow: 0 10px 22px rgba(0, 102, 204, 0.08);
    color: #003d99 !important;
}

body.template-b .template-b-toolbar-trigger:hover,
body.template-b .template-b-toolbar-trigger:focus {
    background: #fafbfd;
    color: #0052a3 !important;
}

body.template-b .template-b-toolbar-icon,
body.template-b .template-b-toolbar-avatar {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #0066cc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.template-b .template-b-toolbar-avatar {
    object-fit: cover;
}

body.template-b .template-b-toolbar-avatar-fallback {
    font-size: 0.95rem;
    font-weight: 800;
}

body.template-b .template-b-toolbar-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

body.template-b .template-b-toolbar-text strong {
    color: #003d99;
    font-size: 0.92rem;
    font-weight: 800;
}

body.template-b .template-b-toolbar-text small {
    margin-top: 0.22rem;
    color: #3b82f6;
    font-size: 0.74rem;
    font-weight: 600;
}

body.template-b .template-b-toolbar-chevron {
    margin-left: auto;
    color: #60a5fa;
    font-size: 0.78rem;
}

body.template-b .template-b-toolbar-trigger .navbar-notification-badge {
    top: 0.5rem;
    right: 0.55rem;
    border-color: #fafbfd;
}

body.template-b .esms-template-b-breadcrumb-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.15rem 1rem 0;
}

body.template-b .esms-template-b-breadcrumb-label {
    color: #0066cc;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.template-b .esms-template-b-breadcrumb-row .page-breadcrumb {
    padding: 0.65rem 0.9rem;
    background: rgba(248, 251, 255, 0.88);
    border: 1px solid rgba(59, 130, 246, 0.14);
    box-shadow: 0 10px 20px rgba(0, 102, 204, 0.06);
}

/* Modal styling - ensure modal appears above dropdown menu */
body.template-b .floating-work-modal .modal,
body.template-b .floating-work-modal .modal-dialog {
    z-index: 1070 !important;
}

body.template-b .floating-work-modal .modal-backdrop {
    z-index: 1069 !important;
}

@media (min-width: 992px) {
    body.template-b .esms-shell-wrapper {
        margin-top: 180px;
        display: grid;
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        align-items: start;
        column-gap: 0;
        row-gap: 0;
    }

    body.template-b .esms-shell-header {
        grid-column: 1;
        grid-row: 1;
    }

    body.template-b .esms-shell-header .container-fluid,
    body.template-b .esms-shell-footer-bar .container-fluid {
        max-width: var(--esms-shell-max) !important;
        margin: 0 auto;
    }

    body.template-b .esms-topnav-shell {
        grid-column: 1;
        grid-row: 2;
    }

    body.template-b .esms-template-b-utility-shell {
        grid-column: 1;
        grid-row: 3;
    }

    body.template-b .esms-sidebar-panel {
        display: none !important;
    }

    body.template-b .esms-shell-main-panel {
        grid-column: 1;
        grid-row: 4;
        flex: 1 1 0;
        min-width: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    body.template-b .esms-shell-footer-bar {
        grid-column: 1;
        grid-row: 5;
    }

    body.template-b .esms-template-b-dropdown-actions {
        display: none;
    }

    body.template-b .sidebar-wrapper {
        height: calc(100vh - 9.75rem);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    body.template-b .esms-shell-wrapper {
        margin-top: 130px;
    }
}

@media (max-width: 991.98px) {
    body.template-b .esms-shell-header {
        background: linear-gradient(145deg, var(--esms-shell-header-start) 8%, var(--esms-shell-header-end) 100%) !important;
        height: 70px;
        min-height: 70px;
        box-shadow: none;
        border-bottom: 1px solid rgba(255,255,255,.08) !important;
    }

    body.template-b .esms-shell-header .container-fluid {
        height: 70px;
        min-height: 70px;
        padding-inline: 0.08rem 0.72rem;
    }

    body.template-b .esms-template-b-header-brand {
        margin-left: -0.12rem;
    }

    body.template-b .esms-template-b-header-brand-link {
        max-width: min(70vw, 340px);
        gap: 0.18rem;
    }

    body.template-b .esms-template-b-header-brand-copy {
        margin-left: 0.22rem;
    }

    body.template-b .esms-template-b-header-brand-logo {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    body.template-b .esms-template-b-header-brand-title {
        font-size: 0.875rem;
        font-family: 'El Messiri', sans-serif;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        letter-spacing: 0.5px;
    }

    body.template-b .esms-template-b-header-brand-subtitle {
        font-size: 0.625rem;
    }

    body.template-b .esms-template-b-header-brand-org {
        font-size: 1.25rem;
        font-weight: 800;
        font-family: 'El Messiri', sans-serif;
        color: #ffffff;
        text-shadow: 0 0 8px rgba(255, 255, 255, 0.6), 0 0 16px rgba(47, 151, 242, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
        letter-spacing: 0.5px;
    }

    body.template-b .esms-shell-toggle {
        width: 28px;
        height: 34px;
        background: transparent;
        border: 0;
        border-radius: .5rem;
        cursor: pointer;
        z-index: 1041;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin-right: -0.18rem;
        transform: translateY(16px);
        transition: transform 0.2s ease, color 0.2s ease;
    }

    body.template-b .esms-shell-toggle i {
        font-size: 0.9rem;
        text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
        transition: transform 0.22s ease, opacity 0.22s ease;
    }

    body.template-b .esms-template-b-header-brand-link,
    body.template-b .esms-template-b-header-brand-logo,
    body.template-b .esms-template-b-header-brand-copy {
        pointer-events: none;
    }

    body.template-b .esms-shell-toggle i[data-esms-direction="right"] {
        transform: translate(-1px, 0) rotate(0deg);
    }

    body.template-b .esms-shell-toggle i[data-esms-direction="down"],
    body.template-b.esms-sidebar-mobile-open .esms-shell-toggle i {
        transform: translate(-1px, 1px) rotate(90deg);
    }

    body.template-b .navbar-profile {
        flex-direction: column;
        align-items: center !important;
        gap: 0 !important;
    }

    body.template-b .navbar-profile .fa-chevron-down {
        margin-left: 0 !important;
        font-size: 0.62rem !important;
        line-height: 1;
        margin-top: -0.08rem;
        display: block;
        transition: transform 0.22s ease, opacity 0.22s ease;
    }

    body.template-b .nav-link[aria-expanded="true"] .navbar-profile .fa-chevron-down {
        transform: rotate(180deg);
    }

    body.template-b .navbar-notification-trigger {
        margin-right: -0.12rem;
        padding-right: 0.05rem !important;
    }

    body.template-b .esms-template-b-breadcrumb-row {
        gap: 0.45rem;
        padding: 0.08rem 0.7rem 0;
    }

    body.template-b .esms-template-b-breadcrumb-label {
        font-size: 0.66rem;
        letter-spacing: 0.06em;
    }

    body.template-b .esms-template-b-breadcrumb-row .page-breadcrumb {
        padding: 0.38rem 0.62rem;
        max-width: calc(100vw - 2.4rem);
    }

    body.template-b .esms-sidebar-panel {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 250px;
        height: 100vh;
        margin: 0;
        overflow: hidden;
        z-index: 1035;
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform 0.3s ease;
        background: #24292f !important;
        border-right: 1px solid rgba(255,255,255,.08);
    }

    body.template-b.esms-sidebar-mobile-open .esms-sidebar-panel {
        transform: translateX(0);
        visibility: visible;
    }

    body.template-b .esms-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0);
        z-index: 1034;
        display: none;
        pointer-events: none;
        transition: background-color 0.3s ease;
    }

    body.template-b.esms-sidebar-mobile-open .esms-sidebar-overlay {
        display: block;
        pointer-events: auto;
        background: rgba(0, 0, 0, 0.5);
    }

    body.template-b .esms-sidebar-brand {
        display: flex;
        height: 70px;
        padding: .4rem .95rem;
        background: #24292f;
        border-bottom: 1px solid rgba(255,255,255,.1) !important;
        align-items: center;
        box-sizing: border-box;
        margin: 0;
    }

    body.template-b .esms-sidebar-brand .esms-brand-link {
        min-height: 0;
        width: 100%;
        gap: .78rem;
        padding: 0;
        align-items: center;
    }

    body.template-b .esms-sidebar-brand .esms-brand-logo-shell {
        width: 48px;
        height: 48px;
        margin: 0;
        border-radius: 1rem;
        background: #fff;
        box-shadow: none;
        flex-shrink: 0;
    }

    body.template-b .esms-sidebar-brand .esms-brand-image.esms-brand-image-lg,
    body.template-b .esms-sidebar-brand .esms-brand-image-fallback {
        width: 48px;
        height: 48px;
        max-width: 48px;
        max-height: 48px;
    }

    body.template-b .esms-sidebar-brand .esms-brand-title {
        font-size: 1.95rem !important;
        font-weight: 800 !important;
        line-height: .92;
        color: #fff !important;
    }

    body.template-b .esms-sidebar-brand .esms-brand-subtitle {
        max-width: 150px;
        margin-top: .18rem;
        font-size: .74rem !important;
        font-weight: 500;
        line-height: 1.16;
        color: rgba(255,255,255,.76) !important;
    }

    body.template-b .sidebar-wrapper {
        height: calc(100vh - 70px);
        overflow-y: auto;
        scrollbar-color: rgba(255,255,255,.24) rgba(255,255,255,.04);
        scrollbar-width: thin;
    }

    body.template-b .sidebar-wrapper::-webkit-scrollbar {
        width: 9px;
    }

    body.template-b .sidebar-wrapper::-webkit-scrollbar-track {
        background: rgba(255,255,255,.04);
        border-radius: 999px;
    }

    body.template-b .sidebar-wrapper::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,.22);
        border-radius: 999px;
        border: 2px solid rgba(36, 41, 47, .98);
    }

    body.template-b .sidebar-wrapper::-webkit-scrollbar-thumb:hover {
        background: rgba(255,255,255,.3);
    }

    body.template-b .esms-sidebar-menu {
        padding: .4rem 0 0;
    }

    body.template-b .esms-sidebar-menu .nav-link {
        margin: .2rem 0 .2rem .8rem;
        padding: .68rem .3rem;
        border-radius: .95rem;
        color: rgba(255,255,255,.9);
        min-height: 42px;
        display: flex;
        align-items: center;
        gap: .5rem;
        background: transparent;
        border: 1px solid transparent;
        transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
        cursor: pointer;
    }

    body.template-b .esms-sidebar-panel .nav-link:hover {
        background: rgba(15, 109, 178, 0.25);
        border-color: rgba(15, 109, 178, 0.4);
        box-shadow: 0 0 12px rgba(15, 109, 178, 0.3), inset 0 0 8px rgba(15, 109, 178, 0.15);
        color: #fff;
    }

    body.template-b .esms-sidebar-panel .nav-item.menu-open > .nav-link,
    body.template-b .esms-sidebar-panel .nav-link.active {
        background: rgba(15, 109, 178, 0.35);
        border-color: rgba(15, 109, 178, 0.5);
        color: #fff;
        box-shadow: 0 0 16px rgba(15, 109, 178, 0.4), inset 0 0 12px rgba(15, 109, 178, 0.2);
    }

    body.template-b .esms-sidebar-panel .nav-link p,
    body.template-b .esms-sidebar-panel .nav-link .nav-icon {
        color: inherit;
        font-weight: 700;
    }

    body.template-b .esms-sidebar-panel .nav-link p {
        font-size: .93rem;
        line-height: 1.12;
        margin: 0;
    }

    body.template-b .esms-sidebar-panel .nav-link .nav-icon {
        width: 1.12rem;
        text-align: center;
        margin-right: .24rem;
        font-size: .9rem;
    }

    body.template-b .esms-sidebar-panel .nav-link .nav-arrow {
        font-size: .88rem;
        opacity: .92;
    }

    body.template-b .esms-sidebar-panel .nav-treeview {
        padding: .04rem 0 .3rem;
    }

    body.template-b .esms-sidebar-panel .nav-treeview .nav-link {
        margin: .08rem 0 .08rem .8rem;
        padding: .48rem .3rem .48rem .92rem;
        border-radius: 0;
        color: rgba(255,255,255,.8);
        background: transparent;
        border: 0;
        min-height: 30px;
        display: flex;
        align-items: center;
        gap: .56rem;
        box-shadow: none;
        transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
        cursor: pointer;
    }

    body.template-b .esms-sidebar-panel .nav-treeview .nav-link:hover {
        background: rgba(15, 109, 178, 0.18);
        color: #fff;
        box-shadow: inset 0 0 8px rgba(15, 109, 178, 0.2);
    }

    body.template-b .esms-sidebar-panel .nav-treeview .nav-link.active {
        background: rgba(15, 109, 178, 0.28);
        color: #fff;
        box-shadow: 0 0 12px rgba(15, 109, 178, 0.35), inset 0 0 10px rgba(15, 109, 178, 0.25);
    }

    body.template-b .esms-sidebar-panel .nav-treeview .nav-link p {
        font-size: .88rem;
        font-weight: 600;
        line-height: 1.15;
    }

    body.template-b .esms-sidebar-panel .nav-treeview .nav-icon {
        width: .9rem;
        height: .9rem;
        min-width: .9rem;
        border: 2px solid rgba(255,255,255,.78);
        border-radius: 999px;
        font-size: 0;
        margin-right: .22rem;
        opacity: .92;
    }

    body.template-b .esms-shell-main-panel {
        width: auto !important;
        margin: 0 !important;
        display: block;
        padding: 0;
    }

    body.template-b .esms-topnav-shell,
    body.template-b .esms-template-b-utility-shell {
        display: none !important;
    }

    body.template-b .esms-shell-toggle {
        display: inline-flex !important;
    }

    body.template-b .esms-shell-page {
        padding-top: 1.15rem;
    }

    body.template-b .esms-shell-header-card {
        border-radius: 22px;
    }

    body.template-b .esms-shell-content {
        padding-top: 1.1rem;
    }

    body.template-b .sidebar-wrapper + .px-3.py-4 {
        padding: 1.05rem 1.05rem 1.2rem !important;
        border-top: 2px solid transparent;
        background: linear-gradient(#24292f, #24292f) padding-box,
                    linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent) border-box;
        box-shadow: 0 -8px 16px rgba(0,0,0,.2);
        position: sticky;
        bottom: 0;
        z-index: 2;
    }

    body.template-b .sidebar-wrapper + .px-3.py-4 .fw-semibold {
        font-size: .95rem !important;
        line-height: 1.25;
        margin-bottom: .42rem;
        color: #fff;
    }

    body.template-b .sidebar-wrapper + .px-3.py-4 div:last-child {
        font-size: .79rem !important;
        line-height: 1.5;
        color: rgba(255,255,255,.6);
    }
}

/* Operational pages compact utility override. Keep breadcrumb close to content on tall desktop screens. */
@media (min-width: 992px) {
    body.template-b:has(.esms-standard-page) .esms-template-b-utility-shell {
        padding-top: .45rem !important;
        padding-bottom: 0 !important;
    }

    body.template-b:has(.esms-standard-page) .esms-template-b-utility-inner {
        gap: .35rem !important;
    }

    body.template-b:has(.esms-standard-page) .esms-template-b-dropdown-row {
        display: none !important;
    }

    body.template-b:has(.esms-standard-page) .esms-template-b-breadcrumb-row {
        padding-top: .15rem !important;
    }
}

/* Final compact shell for operational modules. Remove the desktop utility spacer completely. */
@media (min-width: 992px) {
    body.template-b:has(.esms-standard-page) .esms-shell-wrapper {
        margin-top: 116px !important;
    }

    body.template-b:has(.esms-standard-page) .esms-template-b-utility-shell {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    body.template-b:has(.esms-standard-page) .esms-shell-page {
        padding-top: .45rem !important;
    }

    body.template-b:has(.esms-standard-page) .esms-shell-content {
        padding-top: .45rem !important;
    }

    body.template-b:has(.esms-standard-page) .esms-shell-content-header {
        padding-top: .35rem !important;
        padding-bottom: .35rem !important;
    }

    body.template-b:has(.esms-standard-page) .esms-shell-content-header::before {
        inset: .28rem 1rem .28rem !important;
    }
}

/* Explicit compact spacing for mail operational pages, aligned with the good Approval layout. */
@media (min-width: 992px) {
    body.template-b.page-mail-operasional .esms-shell-wrapper {
        margin-top: 130px !important;
    }

    body.template-b.page-mail-operasional .esms-template-b-utility-shell {
        display: none !important;
    }

    body.template-b.page-mail-operasional .esms-shell-page {
        padding-top: 1rem !important;
    }

    body.template-b.page-mail-operasional .esms-shell-content-header {
        padding: .65rem 0 .55rem !important;
    }

    body.template-b.page-mail-operasional .esms-shell-content-header::before {
        inset: .55rem 1rem .55rem !important;
    }

    body.template-b.page-mail-operasional .esms-shell-content {
        padding-top: 1rem !important;
    }
}

/* Mail pages final offset: match the previously correct Surat Masuk spacing. */
@media (min-width: 992px) {
    body.template-b.page-mail-operasional .esms-shell-wrapper {
        margin-top: 96px !important;
    }

    body.template-b.page-mail-operasional .esms-shell-page {
        padding-top: .65rem !important;
    }

    body.template-b.page-mail-operasional .esms-shell-content-header {
        padding-top: .4rem !important;
        padding-bottom: .4rem !important;
    }

    body.template-b.page-mail-operasional .esms-shell-content-header::before {
        inset: .35rem 1rem .35rem !important;
    }

    body.template-b.page-mail-operasional .esms-shell-content {
        padding-top: .65rem !important;
    }
}

/* Mail operational pages: remove fixed-header leftover offset below the top navigation. */
@media (min-width: 992px) {
    body.template-b.page-mail-operasional .esms-shell-wrapper {
        margin-top: 116px !important;
    }

    body.template-b.page-mail-operasional .esms-shell-main-panel {
        grid-row: 3 !important;
    }

    body.template-b.page-mail-operasional .esms-shell-page {
        padding-top: .35rem !important;
    }
}

/* Spacing khusus Modul Ruang Meeting & Surat Masuk/Keluar untuk merapatkan jarak atas di bawah Navigasi Utama */
@media (min-width: 992px) {
    body.template-b.esms-shell-body.page-room-meeting .esms-shell-wrapper,
    body.template-b.esms-shell-body.page-room-meeting-calendar .esms-shell-wrapper,
    body.template-b.esms-shell-body.page-room-meeting-approval .esms-shell-wrapper,
    body.template-b.esms-shell-body.page-incoming-mail .esms-shell-wrapper,
    body.template-b.esms-shell-body.page-outgoing-mail .esms-shell-wrapper,
    body.template-b.esms-shell-body.page-archives-loans .esms-shell-wrapper {
        margin-top: 116px !important;
    }

    body.template-b.esms-shell-body.page-room-meeting .esms-shell-main-panel,
    body.template-b.esms-shell-body.page-room-meeting-calendar .esms-shell-main-panel,
    body.template-b.esms-shell-body.page-room-meeting-approval .esms-shell-main-panel,
    body.template-b.esms-shell-body.page-incoming-mail .esms-shell-main-panel,
    body.template-b.esms-shell-body.page-outgoing-mail .esms-shell-main-panel,
    body.template-b.esms-shell-body.page-archives-loans .esms-shell-main-panel {
        grid-row: 3 !important;
    }

    body.template-b.esms-shell-body.page-room-meeting .esms-shell-page,
    body.template-b.esms-shell-body.page-room-meeting-calendar .esms-shell-page,
    body.template-b.esms-shell-body.page-room-meeting-approval .esms-shell-page,
    body.template-b.esms-shell-body.page-incoming-mail .esms-shell-page,
    body.template-b.esms-shell-body.page-outgoing-mail .esms-shell-page,
    body.template-b.esms-shell-body.page-archives-loans .esms-shell-page {
        padding-top: .35rem !important;
    }
}

/* Approvals page needs extra top gap so dropdown nav doesn't overlap content */
@media (min-width: 992px) {
    body.template-b.esms-shell-body.page-room-meeting-approval .esms-shell-wrapper {
        margin-top: 70px !important;
    }
    body.template-b.esms-shell-body.page-room-meeting-approval .esms-shell-page {
        padding-top: 1rem !important;
    }
}


/* ========================================================
   e-SMS Unified Spacing Framework (EUSF) - Utility Classes
   ======================================================== */
@media (min-width: 992px) {
    /* 1. TIPE COMPACT (Rapat - 56px) */
    body.template-b.esms-density-compact .esms-shell-wrapper {
        margin-top: 56px !important;
    }
    body.template-b.esms-density-compact .esms-shell-page {
        padding-top: 65px !important;
    }
    body.template-b.esms-density-compact .esms-shell-content-header {
        padding-top: 3px !important;
    }
    body.template-b.esms-density-compact .esms-shell-content-header::before {
        inset-top: 3px !important;
    }

    /* 2. TIPE MEDIUM (Sedang - 85px) */
    body.template-b.esms-density-medium .esms-shell-wrapper {
        margin-top: 85px !important;
    }
    body.template-b.esms-density-medium .esms-shell-page {
        padding-top: 36px !important;
    }
    body.template-b.esms-density-medium .esms-shell-content-header {
        padding-top: 10px !important;
    }
    body.template-b.esms-density-medium .esms-shell-content-header::before {
        inset-top: 6px !important;
    }

    /* 3. TIPE COMFORTABLE (Lega - 130px) */
    body.template-b.esms-density-comfortable .esms-shell-wrapper {
        margin-top: 130px !important;
    }
    body.template-b.esms-density-comfortable .esms-shell-page {
        padding-top: 26px !important;
    }
    body.template-b.esms-density-comfortable .esms-shell-content-header {
        padding-top: 10.4px !important;
    }
    body.template-b.esms-density-comfortable .esms-shell-content-header::before {
        inset-top: 8.8px !important;
    }
}


/* ========================================================
   Custom Spacing Overrides for Specific Master Data Pages
   ======================================================== */
@media (min-width: 992px) {
    /* Pejabat, Tahun Akademik, Ruangan -> 70px */
    body.template-b.esms-shell-body.page-master-pejabat .esms-shell-wrapper {
        /* margin-top: 60px !important; removed to fix breadcrumb */
    }
    body.template-b.esms-shell-body.page-master-academic-years .esms-shell-wrapper {
        margin-top: 50px !important;
    }
    body.template-b.esms-shell-body.page-master-rooms .esms-shell-wrapper {
        margin-top: 50px !important;
    }

    /* Data Tendik -> 80px */
    body.template-b.esms-shell-body.page-master-data-tendik .esms-shell-wrapper {
        margin-top: 80px !important;
    }
}


/* ========================================================
   Mobile Responsive Optimizations for Master Data & Vehicle Pages
   ======================================================== */
@media (max-width: 767.98px) {
    /* 1. Kurangi padding di mobile untuk memaksimalkan area konten */
    body.template-b.esms-shell-body[class*="page-master-"] .content-panel,
    body.template-b.esms-shell-body.page-vehicle-management .content-panel {
        padding-left: .45rem !important;
        padding-right: .45rem !important;
        padding-top: .5rem !important;
    }
    body.template-b.esms-shell-body[class*="page-master-"] .filter-card,
    body.template-b.esms-shell-body.page-vehicle-management .filter-card {
        padding: .85rem !important;
        margin-bottom: .85rem !important;
        border-radius: .65rem !important;
    }
    body.template-b.esms-shell-body[class*="page-master-"] .mail-table-card,
    body.template-b.esms-shell-body.page-vehicle-management .mail-table-card {
        border-radius: .5rem !important;
    }

    /* 2. Paksa tabel agar bisa di-scroll secara horizontal, kolom tidak penyet */
    body.template-b.esms-shell-body[class*="page-master-"] .table-responsive,
    body.template-b.esms-shell-body.page-vehicle-management .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: .5rem !important;
    }
    body.template-b.esms-shell-body[class*="page-master-"] .table,
    body.template-b.esms-shell-body.page-vehicle-management .table {
        min-width: 900px !important;
        width: 900px !important;
    }
    
    /* 3. Atur susunan tombol agar rapi di layar sentuh HP */
    body.template-b.esms-shell-body[class*="page-master-"] .organization-list-head,
    body.template-b.esms-shell-body.page-vehicle-management .organization-list-head {
        flex-direction: column;
        align-items: flex-start !important;
        gap: .5rem;
    }
    
    body.template-b.esms-shell-body[class*="page-master-"] .organization-filter-actions,
    body.template-b.esms-shell-body.page-vehicle-management .organization-filter-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: .35rem !important;
    }
}


/* ========================================================
   Custom Spacing & Mobile Overrides for User Module
   ======================================================== */
@media (min-width: 992px) {
    /* Set spasi desktop nyaman di 60px */
    body.template-b.esms-shell-body.page-users-index .esms-shell-wrapper,
    body.template-b.esms-shell-body.page-users-registrations .esms-shell-wrapper,
    body.template-b.esms-shell-body.page-users-form .esms-shell-wrapper {
        /* margin-top: 60px !important; removed to fix breadcrumb */
    }
}

@media (max-width: 767.98px) {
    /* Tampilan HP: Minimalkan padding & aktifkan horizontal scroll pada tabel Anggota */
    body.template-b.esms-shell-body.page-users-index .content-panel,
    body.template-b.esms-shell-body.page-users-registrations .content-panel {
        padding-left: .45rem !important;
        padding-right: .45rem !important;
        padding-top: .5rem !important;
    }
    
    body.template-b.esms-shell-body.page-users-index .filter-card,
    body.template-b.esms-shell-body.page-users-registrations .filter-card {
        padding: .85rem !important;
        margin-bottom: .85rem !important;
        border-radius: .65rem !important;
    }
    
    body.template-b.esms-shell-body.page-users-index .user-table-wrap,
    body.template-b.esms-shell-body.page-users-registrations .registration-list-card {
        border-radius: .5rem !important;
    }

    body.template-b.esms-shell-body.page-users-index .table-responsive,
    body.template-b.esms-shell-body.page-users-registrations .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: .5rem !important;
    }
    
    body.template-b.esms-shell-body.page-users-index .table,
    body.template-b.esms-shell-body.page-users-registrations .table {
        min-width: 900px !important;
        width: 900px !important;
    }
}


/* GLOBAL GAP & ALIGNMENT OVERRIDES (FINAL) */
@media (min-width: 992px) {
    /* Set wrapper margin exactly to fixed header height to remove huge gap */
    body.template-b .esms-shell-wrapper,
    body.template-b.esms-density-comfortable .esms-shell-wrapper {
        margin-top: 136px !important;
    }
    
    /* Ensure page padding is minimal so card isn't squished */
    body.template-b .esms-shell-page {
        padding: 0 1.5rem !important;
    }
    
    /* Minimal top padding for utility shell (breadcrumb) so it sits right under header */
    body.template-b .esms-template-b-utility-shell {
        padding-top: 0.25rem !important;
    }
    
    /* Ensure card padding aligns internal content perfectly with header logo */
    body.template-b .esms-shell-content-card {
        padding: 1.5rem !important;
    }
}
