/* =========================================================
   SIDEBAR CONTAINER
========================================================= */

.sidebar-box {
    background: #fff;

    padding: 20px;

    border-radius: 18px;

    border: 1px solid rgba(98, 0, 0, 0.07);

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.055);

    position: relative;

    /*
     * PENTING
     * Jangan gunakan overflow:hidden.
     * Dropdown harus boleh keluar dari box.
     */
    overflow: visible;

    margin-bottom: 20px;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;

    z-index: 100;
}


/* GARIS ATAS */

.sidebar-box::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 3px;

    background:
        linear-gradient(
            90deg,
            var(--primary),
            var(--primary-light)
        );

    border-radius: 18px 18px 0 0;
}


/* HOVER BOX */

.sidebar-box:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 30px rgba(98, 0, 0, 0.09);
}


/* =========================================================
   SIDEBAR TITLE
========================================================= */

.sidebar-title {
    display: flex;

    align-items: center;

    gap: 12px;

    padding-bottom: 15px;

    margin-bottom: 12px;

    border-bottom: 1px solid #eee;

    position: relative;

    z-index: 2;
}


.sidebar-icon {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            var(--primary-soft),
            #fff
        );

    color: var(--primary);

    font-size: 21px;

    box-shadow:
        inset 0 0 0 1px rgba(98, 0, 0, 0.05);
}


.sidebar-title h4 {
    margin: 0;

    font-size: 17px;

    font-weight: 800;

    color: #2d2d2d;

    line-height: 1.3;
}


.sidebar-title h4::after {
    content: "";

    display: block;

    width: 28px;
    height: 2px;

    margin-top: 5px;

    border-radius: 5px;

    background: var(--primary);
}


/* =========================================================
   SIDEBAR MENU
========================================================= */

.sidebar-menu {
    list-style: none;

    margin: 0;
    padding: 0;

    position: relative;

    z-index: 10;
}


.sidebar-menu > li {
    margin: 4px 0;

    position: relative;
}


/* =========================================================
   MENU BIASA
   Contoh:
   VMTS
   Riwayat Akreditasi
========================================================= */

.sidebar-menu > li:not(.sidebar-dropdown) > a {
    position: relative;

    display: flex;

    align-items: center;

    gap: 10px;

    width: 100%;

    padding: 11px 12px;

    border-radius: 10px;

    color: #555;

    font-size: 14px;

    font-weight: 500;

    text-decoration: none;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        padding 0.25s ease;
}


/*
 * ICON MENU BIASA
 */

.sidebar-menu > li:not(.sidebar-dropdown) > a > i {
    width: 22px;

    height: 22px;

    flex: 0 0 22px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: #999;

    font-size: 18px;

    transition:
        color 0.25s ease,
        transform 0.25s ease;
}


/*
 * PENTING:
 * Menu biasa TIDAK mempunyai tanda >
 */

.sidebar-menu > li:not(.sidebar-dropdown) > a::after {
    content: none !important;
}


/*
 * HOVER MENU BIASA
 */

.sidebar-menu > li:not(.sidebar-dropdown) > a:hover {
    background:
        linear-gradient(
            90deg,
            var(--primary-soft),
            #fff
        );

    color: var(--primary);

    padding-left: 16px;
}


.sidebar-menu > li:not(.sidebar-dropdown) > a:hover > i {
    color: var(--primary);

    transform: translateX(2px);
}


/* =========================================================
   MENU DROPDOWN
========================================================= */

.sidebar-dropdown {
    position: relative;

    margin: 4px 0;

    /*
     * Tidak boleh menambah tinggi
     * ketika submenu dibuka.
     */
    min-height: 0;
}


/* =========================================================
   DROPDOWN BUTTON
========================================================= */

.sidebar-dropdown-toggle {
    width: 100%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    padding: 11px 12px;

    border: none;

    border-radius: 10px;

    background: transparent;

    color: #555;

    font-family: inherit;

    font-size: 14px;

    font-weight: 600;

    text-align: left;

    cursor: pointer;

    position: relative;

    z-index: 20;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        padding 0.25s ease;
}


/* =========================================================
   BAGIAN KIRI DROPDOWN
========================================================= */

.sidebar-menu-left {
    display: flex;

    align-items: center;

    gap: 10px;

    min-width: 0;
}


.sidebar-menu-left > i {
    width: 22px;
    height: 22px;

    flex: 0 0 22px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: #999;

    font-size: 18px;

    transition:
        color 0.25s ease,
        transform 0.25s ease;
}


/* =========================================================
   PANAH DROPDOWN
========================================================= */

.sidebar-dropdown-arrow {
    width: 25px;
    height: 25px;

    flex: 0 0 25px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 7px;

    color: #999;

    font-size: 18px;

    transition:
        transform 0.3s ease,
        background 0.25s ease,
        color 0.25s ease;
}


/* =========================================================
   HOVER DROPDOWN
========================================================= */

.sidebar-dropdown-toggle:hover {
    background:
        linear-gradient(
            90deg,
            var(--primary-soft),
            #fff
        );

    color: var(--primary);

    padding-left: 16px;
}


.sidebar-dropdown-toggle:hover
.sidebar-menu-left > i {
    color: var(--primary);
}


.sidebar-dropdown-toggle:hover
.sidebar-dropdown-arrow {
    color: var(--primary);

    background:
        rgba(98, 0, 0, 0.06);
}


/* =========================================================
   SUBMENU
   PENTING:
   POSITION ABSOLUTE AGAR TIDAK MENDORONG SECTION
========================================================= */

.sidebar-submenu {
    list-style: none;

    /*
     * Jangan gunakan max-height.
     */
    margin: 0;

    padding: 8px 8px 8px 13px;

    border-left:
        2px solid rgba(98, 0, 0, 0.10);

    /*
     * KUNCI UTAMA
     */
    position: absolute;

    top: calc(100% + 2px);

    left: 15px;

    width: calc(100% - 15px);

    /*
     * Background submenu
     */
    background: #fff;

    border-radius: 0 0 10px 10px;

    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.12);

    /*
     * Di atas section lainnya
     */
    z-index: 999999;

    /*
     * CLOSED
     */
    visibility: hidden;

    opacity: 0;

    pointer-events: none;

    transform: translateY(-5px);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;
}


/* =========================================================
   SUBMENU OPEN
========================================================= */

.sidebar-dropdown.open > .sidebar-submenu {
    visibility: visible;

    opacity: 1;

    pointer-events: auto;

    transform: translateY(0);
}


/* =========================================================
   SUBMENU ITEM
========================================================= */

.sidebar-submenu > li {
    margin: 3px 0;

    position: relative;
}


/* =========================================================
   SUBMENU LINK
========================================================= */

.sidebar-submenu > li > a {
    display: flex;

    align-items: center;

    gap: 7px;

    width: 100%;

    padding: 9px 10px;

    border-radius: 8px;

    color: #666;

    font-size: 13px;

    line-height: 1.4;

    text-decoration: none;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        padding-left 0.25s ease;
}


/* =========================================================
   ICON SUBMENU
========================================================= */

.sidebar-submenu > li > a > i {
    width: 18px;

    flex: 0 0 18px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: #aaa;

    font-size: 16px;

    transition:
        color 0.25s ease,
        transform 0.25s ease;
}


/*
 * HILANGKAN pseudo arrow pada submenu
 * supaya tidak mendapat tanda tambahan.
 */

.sidebar-submenu > li > a::after {
    content: none !important;
}


/* =========================================================
   SUBMENU HOVER
========================================================= */

.sidebar-submenu > li > a:hover {
    background:
        var(--primary-soft);

    color: var(--primary);

    padding-left: 14px;
}


.sidebar-submenu > li > a:hover > i {
    color: var(--primary);

    transform: translateX(2px);
}


/* =========================================================
   SUBMENU AKTIF
========================================================= */

.sidebar-submenu > li > a.active {
    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-light)
        );

    color: #fff;

    font-weight: 700;

    box-shadow:
        0 5px 12px rgba(98, 0, 0, 0.15);
}


.sidebar-submenu > li > a.active > i {
    color: #fff;
}


/* =========================================================
   DROPDOWN OPEN STATE
========================================================= */

.sidebar-dropdown.open
> .sidebar-dropdown-toggle {
    background:
        var(--primary-soft);

    color: var(--primary);
}


.sidebar-dropdown.open
> .sidebar-dropdown-toggle
.sidebar-menu-left > i {
    color: var(--primary);
}


.sidebar-dropdown.open
> .sidebar-dropdown-toggle
.sidebar-dropdown-arrow {
    transform: rotate(180deg);

    color: var(--primary);

    background:
        var(--primary-soft);
}


/* =========================================================
   MENU AKTIF BIASA
========================================================= */

.sidebar-menu > li:not(.sidebar-dropdown) > a.active {
    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-light)
        );

    color: #fff;

    font-weight: 700;

    box-shadow:
        0 6px 15px rgba(98, 0, 0, 0.20);
}


.sidebar-menu > li:not(.sidebar-dropdown) > a.active > i {
    color: #fff;
}


/* =========================================================
   SIDEBAR NEWS & PENGUMUMAN
========================================================= */

.fh-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fh-sidebar-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-decoration: none;
    padding: 10px;
    border-radius: 12px;
    transition: background 0.3s ease;
    border: 1px solid transparent;
}

.fh-sidebar-item:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.fh-sidebar-thumb {
    width: 85px;
    height: 70px;
    flex: 0 0 85px;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
}

.fh-sidebar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.fh-sidebar-item:hover .fh-sidebar-thumb img {
    transform: scale(1.05);
}

.sidebar-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 24px;
}

.fh-sidebar-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fh-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #334155;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.fh-sidebar-item:hover .fh-title {
    color: var(--primary);
}

.fh-sidebar-text small {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sidebar-empty {
    text-align: center;
    padding: 30px 20px;
    color: #94a3b8;
}

.sidebar-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* =========================================================
   SIDEBAR STICKY
========================================================= */

@media (min-width: 992px) {

    /*
     * Seluruh kolom sidebar sticky.
     */
    .content-section .col-lg-4 {
        position: sticky;

        top: 100px;

        align-self: flex-start;

        z-index: 100;
    }
}


/* =========================================================
   AGAR DROPDOWN TIDAK TERPOTONG
========================================================= */

.content-section {
    position: relative;

    overflow: visible !important;
}


.content-section .container {
    position: relative;

    overflow: visible !important;
}


.content-section .row {
    position: relative;

    overflow: visible !important;
}


.content-section .col-lg-4 {
    overflow: visible !important;
}


/* =========================================================
   SECTION DI BAWAH
========================================================= */

.masa-jabatan-section {
    position: relative;

    z-index: 1;
}


/* =========================================================
   RESPONSIVE TABLET
========================================================= */

@media (max-width: 991px) {

    .content-section .col-lg-4 {
        position: relative;

        top: auto;

        z-index: 100;
    }


    .sidebar-box {
        margin-top: 20px;
    }


    .sidebar-submenu {
        left: 10px;

        width: calc(100% - 10px);
    }
}


/* =========================================================
   RESPONSIVE MOBILE
========================================================= */

@media (max-width: 575px) {

    .sidebar-box {
        padding: 17px;

        border-radius: 15px;
    }


    .sidebar-title {
        padding-bottom: 13px;
    }


    .sidebar-icon {
        width: 38px;
        height: 38px;

        flex-basis: 38px;

        font-size: 19px;
    }


    .sidebar-title h4 {
        font-size: 16px;
    }


    .sidebar-menu > li > a,
    .sidebar-dropdown-toggle {
        font-size: 13px;

        padding: 10px 11px;
    }


    .fh-sidebar-thumb {
        width: 75px;
        height: 60px;

        flex-basis: 75px;
    }


    .fh-title {
        font-size: 12px;
    }


    /* SUBMENU MOBILE */

    .sidebar-submenu {
        left: 8px;

        width: calc(100% - 8px);

        padding:
            7px 7px 7px 10px;
    }


    .sidebar-submenu > li > a {
        padding: 8px 9px;

        font-size: 12px;
    }
}