/* =========================================================
   LOKER SUBANG
   GLOBAL NAVBAR
========================================================= */


/* =========================================================
   NAVBAR
========================================================= */

.site-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;

    width: 100%;

    background: rgba(255, 255, 255, 0.96);

    border-bottom: 1px solid #eaecf0;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-navbar .container {
    max-width: 1140px;
}

.site-navbar-inner {
    position: relative;

    min-height: 68px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;
}


/* =========================================================
   BRAND
========================================================= */

.site-brand {
    display: inline-flex;
    align-items: center;

    flex-shrink: 0;

    color: #101828;

    text-decoration: none;
}

.site-brand:hover {
    color: #101828;
}

.site-brand-name {
    color: #101828;

    font-size: 20px;
    line-height: 1;

    font-weight: 800;

    letter-spacing: -0.7px;
}

.site-brand-name span {
    color: #2563eb;
}


/* =========================================================
   MAIN MENU
========================================================= */

.site-navbar-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;

    flex: 1;

    gap: 30px;
}

.site-navbar-links {
    display: flex;
    align-items: center;

    gap: 5px;
}


/* =========================================================
   PUBLIC LINKS
========================================================= */

.site-nav-link {
    position: relative;

    display: inline-flex;
    align-items: center;

    min-height: 68px;

    padding: 0 13px;

    color: #667085;

    font-size: 13px;
    line-height: 1;

    font-weight: 550;

    text-decoration: none;

    transition:
        color 0.15s ease,
        background 0.15s ease;
}

.site-nav-link:hover {
    color: #101828;
}

.site-nav-link.active {
    color: #2563eb;

    font-weight: 650;
}

.site-nav-link.active::after {
    content: "";

    position: absolute;

    left: 13px;
    right: 13px;
    bottom: 0;

    height: 2px;

    border-radius: 3px;

    background: #2563eb;
}


/* =========================================================
   NAVBAR ACTIONS
========================================================= */

.site-navbar-actions {
    display: flex;
    align-items: center;

    gap: 10px;

    flex-shrink: 0;
}


/* =========================================================
   THEME TOGGLE
========================================================= */

.site-theme-toggle {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid #e2e6ec;
    border-radius: 9px;

    background: #ffffff;

    color: #475467;

    font-family: inherit;
    font-size: 16px;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}

.site-theme-toggle:hover {
    background: #f5f7fa;

    border-color: #d0d5dd;

    color: #101828;
}

.site-theme-toggle:active {
    transform: scale(0.96);
}

.site-theme-toggle:focus,
.site-theme-toggle:focus-visible {
    outline: none;

    box-shadow: none;
}

.site-theme-icon {
    display: none;

    font-size: 16px;
    line-height: 1;
}

.site-theme-icon-light {
    display: inline-flex;
}


/* =========================================================
   ADMIN AREA
========================================================= */

.site-navbar-admin {
    position: relative;

    flex-shrink: 0;
}


/* =========================================================
   ADMIN BUTTON
========================================================= */

.site-admin-button {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    min-height: 40px;

    padding: 4px 8px 4px 5px;

    border: 1px solid transparent;
    border-radius: 9px;

    background: transparent;

    color: #475467;

    font-family: inherit;
    font-size: 12px;
    font-weight: 550;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.site-admin-button:hover,
.site-admin-button.active {
    background: #f5f7fa;

    border-color: #eaecf0;
}

.site-admin-button:focus,
.site-admin-button:focus-visible {
    outline: none;

    box-shadow: none;
}


/* =========================================================
   ADMIN AVATAR
========================================================= */

.site-admin-avatar {
    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 8px;

    background: #eef4ff;

    color: #2563eb;

    font-size: 12px;

    font-weight: 700;
}

.site-admin-name {
    white-space: nowrap;
}

.site-admin-arrow {
    display: flex;

    color: #98a2b3;

    transition: transform 0.15s ease;
}

.site-admin-button.active .site-admin-arrow {
    transform: rotate(180deg);
}


/* =========================================================
   ADMIN DROPDOWN
========================================================= */

.site-admin-dropdown {
    position: absolute;

    top: calc(100% + 9px);
    right: 0;

    width: 220px;

    padding: 7px;

    background: #ffffff;

    border: 1px solid #e2e6ec;
    border-radius: 12px;

    box-shadow:
        0 12px 30px rgba(16, 24, 40, 0.10);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-5px);

    transition:
        opacity 0.15s ease,
        visibility 0.15s ease,
        transform 0.15s ease;
}

.site-admin-dropdown.show {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}


/* =========================================================
   ADMIN DROPDOWN HEADER
========================================================= */

.site-admin-dropdown-header {
    padding: 8px 10px 7px;
}

.site-admin-dropdown-label {
    color: #98a2b3;

    font-size: 9px;
    line-height: 1.4;

    font-weight: 750;

    letter-spacing: 0.7px;
}


/* =========================================================
   ADMIN LINKS
========================================================= */

.site-admin-link {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 38px;

    padding: 0 10px;

    border-radius: 7px;

    color: #475467;

    font-family: inherit;
    font-size: 12px;
    line-height: 1.4;

    font-weight: 500;

    text-decoration: none;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.site-admin-link:hover {
    background: #f5f7fa;

    color: #101828;
}


/* =========================================================
   LOGOUT
   Logout menggunakan <a> agar tampil sama seperti link biasa
========================================================= */

.site-admin-logout-form {
    display: none;
}

.site-admin-logout {
    color: #b42318;
}

.site-admin-logout:hover {
    background: #fef3f2;

    color: #b42318;
}


/* =========================================================
   DIVIDER
========================================================= */

.site-admin-divider {
    height: 1px;

    margin: 6px 5px;

    background: #eaecf0;
}


/* =========================================================
   MOBILE TOGGLE
========================================================= */

.site-navbar-toggle {
    display: none;

    width: 40px;
    height: 40px;

    padding: 0;

    border: 1px solid #e2e6ec;
    border-radius: 9px;

    background: #ffffff;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
}

.site-navbar-toggle:focus,
.site-navbar-toggle:focus-visible {
    outline: none;

    box-shadow: none;
}

.site-navbar-toggle span {
    display: block;

    width: 17px;
    height: 2px;

    margin: 3px auto;

    border-radius: 5px;

    background: #475467;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;
}

.site-navbar-toggle.active span:nth-child(1) {
    transform:
        translateY(5px)
        rotate(45deg);
}

.site-navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.site-navbar-toggle.active span:nth-child(3) {
    transform:
        translateY(-5px)
        rotate(-45deg);
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 991px) {

    .site-navbar-inner {
        min-height: 64px;
    }

    .site-navbar-menu {
        gap: 15px;
    }

    .site-nav-link {
        min-height: 64px;

        padding: 0 9px;
    }

    .site-nav-link.active::after {
        left: 9px;
        right: 9px;
    }

    .site-admin-name {
        display: none;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

    /*
     * Mencegah halaman melebar ke samping
     */

    html,
    body {
        overflow-x: hidden;
    }


    /*
     * Saat menu mobile terbuka,
     * halaman belakang tidak ikut scroll.
     */

    body.navbar-mobile-open {
        overflow: hidden;
    }


    /* =====================================================
       NAVBAR
    ====================================================== */

    .site-navbar {
        position: sticky;
        top: 0;

        z-index: 1000;
    }

    .site-navbar-inner {
        min-height: 62px;
    }


    /* =====================================================
       BRAND
    ====================================================== */

    .site-brand-name {
        font-size: 19px;
    }


    /* =====================================================
       MOBILE TOGGLE
    ====================================================== */

    .site-navbar-toggle {
        display: block;

        flex-shrink: 0;
    }


    /* =====================================================
       MOBILE MENU
    ====================================================== */

    .site-navbar-menu {
        position: absolute;

        top: calc(100% + 1px);

        left: 0;
        right: 0;

        display: none;

        flex-direction: column;
        align-items: stretch;

        gap: 0;

        /*
         * Tinggi maksimal mengikuti layar.
         * Jadi menu tidak mendorong halaman.
         */

        max-height: calc(100vh - 63px);

        /*
         * Scroll hanya di dalam navbar.
         */

        overflow-y: auto;
        overflow-x: hidden;

        /*
         * Mencegah scroll diteruskan
         * ke halaman utama.
         */

        overscroll-behavior: contain;

        /*
         * Scroll lebih halus di iPhone.
         */

        -webkit-overflow-scrolling: touch;

        padding: 9px;

        background: #ffffff;

        border: 1px solid #e2e6ec;
        border-top: 0;

        border-radius:
            0 0 13px 13px;

        box-shadow:
            0 12px 25px rgba(16, 24, 40, 0.08);
    }

    .site-navbar-menu.show {
        display: flex;
    }


    /* =====================================================
       PUBLIC LINKS
    ====================================================== */

    .site-navbar-links {
        display: flex;

        flex-direction: column;
        align-items: stretch;

        gap: 2px;

        flex-shrink: 0;
    }

    .site-nav-link {
        min-height: 44px;

        padding: 0 12px;

        border-radius: 8px;

        font-size: 13px;
    }

    .site-nav-link:hover {
        background: #f5f7fa;
    }

    .site-nav-link.active {
        background: #eef4ff;

        color: #2563eb;
    }

    .site-nav-link.active::after {
        display: none;
    }


    /* =====================================================
       ACTIONS
    ====================================================== */

    .site-navbar-actions {
        width: 100%;

        display: flex;

        flex-direction: column;
        align-items: stretch;

        gap: 7px;

        flex-shrink: 0;
    }


    /* =====================================================
       THEME TOGGLE
    ====================================================== */

    .site-theme-toggle {
        align-self: flex-start;

        flex-shrink: 0;
    }


    /* =====================================================
       ADMIN
    ====================================================== */

    .site-navbar-admin {
        width: 100%;

        margin-top: 7px;
        padding-top: 7px;

        border-top: 1px solid #eaecf0;

        flex-shrink: 0;
    }

    .site-admin-button {
        width: 100%;

        justify-content: flex-start;

        min-height: 45px;

        padding: 5px 8px;
    }

    .site-admin-name {
        display: block;

        flex: 1;

        text-align: left;
    }

    .site-admin-arrow {
        margin-left: auto;
    }


    /* =====================================================
       ADMIN DROPDOWN MOBILE
    ====================================================== */

    .site-admin-dropdown {
        position: static;

        display: none;

        width: 100%;

        margin-top: 5px;

        padding: 5px;

        border: 0;
        border-radius: 9px;

        background: #f8f9fb;

        box-shadow: none;

        opacity: 1;
        visibility: visible;

        transform: none;

        /*
         * Jangan mengambil scroll sendiri.
         * Parent .site-navbar-menu yang melakukan scroll.
         */

        overflow: visible;

        flex-shrink: 0;
    }

    .site-admin-dropdown.show {
        display: block;
    }

    .site-admin-dropdown-header {
        padding: 7px 10px;
    }


    /* =====================================================
       ADMIN LINKS MOBILE
    ====================================================== */

    .site-admin-link {
        width: 100%;

        min-height: 37px;

        padding: 0 10px;
    }

    .site-admin-logout {
        width: 100%;

        min-height: 37px;
    }


    /* =====================================================
       DIVIDER MOBILE
    ====================================================== */

    .site-admin-divider {
        margin: 6px 5px;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 400px) {

    .site-navbar .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .site-brand-name {
        font-size: 18px;
    }

    .site-navbar-menu {
        max-height: calc(100vh - 63px);
    }
}


/* =========================================================
   DARK MODE
========================================================= */


/* =========================================================
   NAVBAR
========================================================= */

[data-theme="dark"] .site-navbar {
    background: rgba(15, 20, 28, 0.96);

    border-bottom-color: #293241;
}


/* =========================================================
   BRAND
========================================================= */

[data-theme="dark"] .site-brand-name {
    color: #f2f4f7;
}

[data-theme="dark"] .site-brand-name span {
    color: #4f7cff;
}

[data-theme="dark"] .site-brand:hover {
    color: #f2f4f7;
}


/* =========================================================
   PUBLIC LINKS
========================================================= */

[data-theme="dark"] .site-nav-link {
    color: #98a2b3;
}

[data-theme="dark"] .site-nav-link:hover {
    color: #f2f4f7;
}

[data-theme="dark"] .site-nav-link.active {
    color: #4f7cff;
}

[data-theme="dark"] .site-nav-link.active::after {
    background: #4f7cff;
}


/* =========================================================
   THEME BUTTON
========================================================= */

[data-theme="dark"] .site-theme-toggle {
    background: #161d27;

    border-color: #293241;

    color: #f2f4f7;
}

[data-theme="dark"] .site-theme-toggle:hover {
    background: #1d2633;

    border-color: #344054;

    color: #ffffff;
}


/* =========================================================
   ADMIN BUTTON
========================================================= */

[data-theme="dark"] .site-admin-button {
    color: #d0d5dd;
}

[data-theme="dark"] .site-admin-button:hover,
[data-theme="dark"] .site-admin-button.active {
    background: #161d27;

    border-color: #293241;
}

[data-theme="dark"] .site-admin-avatar {
    background: #1d2b4a;

    color: #7da2ff;
}

[data-theme="dark"] .site-admin-arrow {
    color: #98a2b3;
}


/* =========================================================
   ADMIN DROPDOWN
========================================================= */

[data-theme="dark"] .site-admin-dropdown {
    background: #161d27;

    border-color: #293241;

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.30);
}

[data-theme="dark"] .site-admin-dropdown-label {
    color: #667085;
}


/* =========================================================
   ADMIN LINKS
========================================================= */

[data-theme="dark"] .site-admin-link {
    color: #d0d5dd;
}

[data-theme="dark"] .site-admin-link:hover {
    background: #1d2633;

    color: #ffffff;
}


/* =========================================================
   LOGOUT
========================================================= */

[data-theme="dark"] .site-admin-logout {
    color: #f97066;
}

[data-theme="dark"] .site-admin-logout:hover {
    background: #3a1f20;

    color: #ff8a80;
}


/* =========================================================
   DIVIDER
========================================================= */

[data-theme="dark"] .site-admin-divider {
    background: #293241;
}


/* =========================================================
   MOBILE DARK MODE
========================================================= */

@media (max-width: 767px) {

    [data-theme="dark"] .site-navbar-menu {
        background: #0f141c;

        border-color: #293241;

        box-shadow:
            0 12px 25px rgba(0, 0, 0, 0.25);
    }

    [data-theme="dark"] .site-nav-link:hover {
        background: #161d27;
    }

    [data-theme="dark"] .site-nav-link.active {
        background: #1d2b4a;

        color: #7da2ff;
    }

    [data-theme="dark"] .site-navbar-admin {
        border-top-color: #293241;
    }

    [data-theme="dark"] .site-navbar-toggle {
        background: #161d27;

        border-color: #293241;
    }

    [data-theme="dark"] .site-navbar-toggle span {
        background: #d0d5dd;
    }

    [data-theme="dark"] .site-admin-dropdown {
        background: #161d27;
    }
}

