/* =====================================================
   LAYOUT
===================================================== */

body {
    font-family: "Poppins", sans-serif;
    background: #f4f6f9;
}

.layout {
    display: flex;
    min-height: 100vh;
}


/* =====================================================
   SIDEBAR DESKTOP
===================================================== */

.sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: 260px;
    height: 100vh;

    background: #1E5631;
    color: white;

    display: flex;
    flex-direction: column;

    flex-shrink: 0;

    z-index: 1000;

    transition: width .3s ease;

    /*
       Sidebar tidak ikut scroll ketika
       halaman utama di-scroll.
    */
    overflow: hidden;
}


/* =====================================================
   SIDEBAR HEADER
===================================================== */

.sidebar-header {
    text-align: center;

    padding: 30px 20px;

    flex-shrink: 0;
}



.sidebar-title,
.sidebar-subtitle {
    transition: .2s;
}


/* =====================================================
   SIDEBAR MENU
===================================================== */

.sidebar .nav {
    flex-grow: 1;
}

.sidebar .nav-link {
    color: white;

    padding: 14px 25px;
    margin: 4px 15px;

    border-radius: 12px;

    display: flex;
    align-items: center;

    gap: 15px;

    transition: .3s;
}


/*
   PERBAIKAN:
   sebelumnya selector :hover tidak lengkap
*/

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: white;

    color: #1E5631;

    font-weight: 600;

    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}


/* =====================================================
   SIDEBAR FOOTER
===================================================== */

.sidebar-footer {
    margin-top: auto;

    padding-bottom: 20px;

    flex-shrink: 0;
}

.sidebar-footer .logout:hover {
    background: #2E7D32 !important;
}


/* =====================================================
   COLLAPSE SIDEBAR
===================================================== */

.layout.collapsed .sidebar {
    width: 90px;
}

.layout.collapsed .sidebar-title,
.layout.collapsed .sidebar-subtitle {
    opacity: 0;

    visibility: hidden;

    height: 0;

    margin: 0;
}

.layout.collapsed .sidebar span {
    display: none;
}

.layout.collapsed .sidebar .nav-link {
    justify-content: center;

    padding: 14px;
}

.layout.collapsed .sidebar .nav-link i {
    margin-right: 0;

    font-size: 20px;
}




/* =====================================================
   MAIN
===================================================== */

.main {
    flex: 1;

    display: flex;
    flex-direction: column;

    min-height: 100vh;

    /*
       Desktop:
       sidebar = 260px
    */

    margin-left: 260px;

    transition: margin-left .3s ease;
}

.layout.collapsed .main {
    margin-left: 90px;
}


/* =====================================================
   CONTENT
===================================================== */

.container-fluid {
    flex: 1;
}


/* =====================================================
   NAVBAR
===================================================== */

.navbar {
    min-height: 75px;

    flex-shrink: 0;
}


/* =====================================================
   CARD
===================================================== */

.custom-card {
    border: none;

    border-radius: 18px;

    padding: 25px;

    background: white;

    box-shadow: 0 8px 20px rgba(0,0,0,.05);

    transition: .3s;
}

.custom-card:hover {
    transform: translateY(-3px);
}


/* =====================================================
   MOBILE SIDEBAR / OFFCANVAS
===================================================== */

.mobile-sidebar {
    background: #1E5631;

    color: white;

    width: 260px !important;
}


/*
   Isi offcanvas menjadi flex
   agar logout dapat berada di bawah.
*/

.mobile-sidebar .offcanvas-body {
    display: flex;

    flex-direction: column;

    padding: 0 !important;

    background: #1E5631;

    overflow-y: auto;
}


/* Header mobile */

.mobile-sidebar .sidebar-header {
    flex-shrink: 0;
}


/* Menu mobile */

.mobile-sidebar .nav {
    flex-grow: 1;
}

.mobile-sidebar .nav-link {
    color: white;

    margin: 5px 15px;

    padding: 14px 20px;

    border-radius: 10px;

    display: flex;

    align-items: center;

    gap: 15px;

    transition: .3s;
}


/*
   Hover dan active mobile
*/

.mobile-sidebar .nav-link:hover,
.mobile-sidebar .nav-link.active {
    background: white;

    color: #1E5631;

    font-weight: 600;
}


/* Footer mobile */

.mobile-sidebar .sidebar-footer {
    margin-top: auto;

    padding-bottom: 20px;

    flex-shrink: 0;
}

.mobile-sidebar .logout:hover {
    background: #2E7D32 !important;
}


/* =====================================================
   TABLE
===================================================== */

.table td {
    vertical-align: top;
}

.text-wrap-custom {
    max-width: 300px;

    white-space: normal;

    word-break: break-word;
}


/* =====================================================
   DASHBOARD
===================================================== */

.dashboard-stat-card {
    background: #ffffff;

    border-radius: 18px;

    padding: 28px;

    min-height: 170px;

    display: flex;

    align-items: flex-start;

    gap: 20px;

    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);

    border: 1px solid #f0f0f0;
}

.stat-icon {
    width: 58px;
    height: 58px;

    min-width: 58px;

    border-radius: 50%;

    background: #e8f5ed;

    color: #198754;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 27px;
}

.stat-content {
    flex: 1;
}

.stat-title {
    font-size: 16px;

    font-weight: 600;

    margin-bottom: 5px;
}

.stat-value {
    font-size: 36px;

    font-weight: 700;

    color: #198754;

    line-height: 1.2;

    margin-bottom: 8px;
}

.stat-description {
    font-size: 14px;

    color: #6c757d;

    line-height: 1.5;
}


/* =====================================================
   DISTRIBUSI ISU
===================================================== */

.issue-bar-row {
    display: grid;

    grid-template-columns: 210px 1fr 60px;

    align-items: center;

    gap: 15px;

    margin-bottom: 20px;
}

.issue-label {
    font-size: 14px;

    font-weight: 500;

    text-align: right;
}

.issue-bar-wrapper {
    height: 18px;

    background: #f0f2f4;

    border-radius: 10px;

    overflow: hidden;
}

.issue-bar {
    height: 100%;

    background: #198754;

    border-radius: 10px;

    min-width: 2px;
}

.issue-percentage {
    font-size: 14px;

    font-weight: 600;
}


/* =====================================================
   TABEL PEMETAAN
===================================================== */

.custom-card .table {
    margin-bottom: 0;
}

.custom-card .table thead th {
    font-size: 13px;

    font-weight: 600;

    color: #495057;

    border-bottom: 1px solid #dee2e6;

    white-space: nowrap;
}

.custom-card .table tbody td {
    font-size: 14px;

    vertical-align: middle;

    padding-top: 14px;

    padding-bottom: 14px;
}

.custom-card .table tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 7px 12px;

    font-weight: 500;

    border-radius: 7px;
}


/* =====================================================
   RESPONSIVE - TABLET / LAYAR KECIL
===================================================== */

@media (max-width: 991.98px) {

    /*
       Bootstrap d-lg-flex akan membuat
       sidebar desktop menjadi display:none.

       Main harus ikut memenuhi seluruh layar.
    */

    .sidebar {
        display: none !important;
    }

    .main,
    .layout.collapsed .main {
        margin-left: 0;

        width: 100%;
    }


    /*
       Padding content
    */

    .container-fluid {
        padding-left: 20px !important;

        padding-right: 20px !important;
    }


    /*
       Dashboard statistic card
    */

    .dashboard-stat-card {
        min-height: 145px;

        padding: 22px;
    }

    .stat-icon {
        width: 52px;
        height: 52px;

        min-width: 52px;

        font-size: 24px;
    }

    .stat-title {
        font-size: 15px;
    }

    .stat-value {
        font-size: 32px;
    }

    .stat-description {
        font-size: 13px;
    }


    /*
       Distribusi isu
    */

    .issue-bar-row {
        grid-template-columns: 180px 1fr 55px;

        gap: 12px;

        margin-bottom: 16px;
    }

    .issue-label {
        font-size: 13px;
    }

    .issue-percentage {
        font-size: 13px;
    }

}


/* =====================================================
   RESPONSIVE - MOBILE
===================================================== */

@media (max-width: 767.98px) {

    /*
       Content
    */

    .container-fluid {
        padding-left: 15px !important;

        padding-right: 15px !important;
    }


    /*
       Dashboard cards
    */

    .dashboard-stat-card {
        min-height: auto;

        padding: 20px;

        gap: 16px;

        border-radius: 16px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;

        min-width: 50px;

        font-size: 22px;
    }

    .stat-title {
        font-size: 15px;

        margin-bottom: 4px;
    }

    .stat-value {
        font-size: 30px;
    }

    .stat-description {
        font-size: 12px;
    }


    /*
       Distribusi isu menjadi vertikal
    */

    .issue-bar-row {
        grid-template-columns: 1fr;

        gap: 7px;

        margin-bottom: 18px;
    }

    .issue-label {
        text-align: left;

        font-size: 13px;
    }

    .issue-bar-wrapper {
        height: 14px;
    }

    .issue-percentage {
        text-align: left;

        font-size: 12px;
    }


    /*
       Card
    */

    .custom-card {
        padding: 20px;

        border-radius: 16px;
    }


    /*
       Tabel tetap dapat di-scroll horizontal
       jika kolom terlalu banyak.
    */

    .custom-card .table {
        min-width: 650px;
    }

    .custom-card .table-responsive {
        overflow-x: auto;
    }

}

/* ==========================================================
   GLOBAL LOADING
========================================================== */

.global-loading {

    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background: rgba(255, 255, 255, 0.85);

    display: flex;

    align-items: center;
    justify-content: center;

    z-index: 9999;

}


/* ==========================================================
   SPINNER
========================================================== */

.global-loading-spinner {

    width: 40px;
    height: 40px;

    border: 4px solid #e9ecef;

    border-top-color: #198754;

    border-radius: 50%;

    animation: globalLoadingSpin 0.8s linear infinite;

}


/* ==========================================================
   ANIMATION
========================================================== */

@keyframes globalLoadingSpin {

    from {

        transform: rotate(0deg);

    }

    to {

        transform: rotate(360deg);

    }

}

/* ==========================================================
   LOGIN PAGE
========================================================== */

.login-page {
    min-height: 100vh;
    background: #f7f8fa;
}


/* ==========================================================
   LOGIN WRAPPER
========================================================== */

.login-wrapper {
    min-height: 100vh;
    display: flex;
}


/* ==========================================================
   LEFT SIDE
========================================================== */

.login-left {
    flex: 0 0 50%;
    width: 50%;
    height: 100vh;

    overflow: hidden;

    background: #ffffff;
}


/* Gambar ilustrasi login */

.login-illustration {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
    object-position: center;
}


/* ==========================================================
   RIGHT SIDE
========================================================== */

.login-right {
    flex: 0 0 50%;
    width: 50%;

    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 50px;

    box-sizing: border-box;

    background: #f8f9fb;
}


/* ==========================================================
   LOGIN FORM WRAPPER
========================================================== */

.login-form-wrapper {
    width: 100%;

    max-width: 430px;
}


/* ==========================================================
   LOGIN HEADER
========================================================== */

.login-header {
    margin-bottom: 10px;
}


.login-header h3 {
    margin-bottom: 8px;

    font-size: 30px;

    color: #1f2937;
}


.login-header p {
    font-size: 15px;

    line-height: 1.6;
}


/* ==========================================================
   LOGIN FORM
========================================================== */

.login-form .form-label {
    margin-bottom: 8px;

    font-size: 14px;

    color: #1f2937;
}


/* Input */

.login-input {
    height: 52px;

    padding-left: 15px;

    border-radius: 10px;

    border: 1px solid #d9dee5;

    font-size: 14px;

    box-shadow: none;
}


.login-input::placeholder {
    color: #9ca3af;
}


.login-input:focus {
    border-color: #198754;

    box-shadow:
        0 0 0 0.2rem
        rgba(25, 135, 84, 0.12);
}


/* ==========================================================
   PASSWORD INPUT
========================================================== */

.input-group .login-input {
    border-radius: 10px 0 0 10px;
}


.login-password-toggle {
    min-width: 52px;

    border-color: #d9dee5;

    border-radius: 0 10px 10px 0;

    background: #ffffff;

    color: #6c757d;
}


.login-password-toggle:hover {
    background: #f3f5f7;

    border-color: #198754;

    color: #198754;
}


/* ==========================================================
   LOGIN BUTTON
========================================================== */

.login-button {
    height: 52px;

    border-radius: 10px;

    font-size: 15px;

    font-weight: 600;
}


/* ==========================================================
   LOGIN FOOTER
========================================================== */

.login-footer {
    margin-top: 26px;

    margin-bottom: 0;

    text-align: center;

    font-size: 13px;

    color: #8a9199;
}


/* ==========================================================
   LOGIN RESPONSIVE - TABLET
========================================================== */

@media (max-width: 991.98px) {

    .login-wrapper {
        flex-direction: column;
    }


    .login-left {
        width: 100%;

        height: 420px;
    }


    .login-right {
        width: 100%;

        padding: 45px 25px;
    }

}


/* ==========================================================
   LOGIN RESPONSIVE - MOBILE
========================================================== */

@media (max-width: 575.98px) {

    .login-left {
        height: 300px;
    }


    .login-right {
        padding: 38px 20px;
    }


    .login-header h3 {
        font-size: 25px;
    }


    .login-form-wrapper {
        max-width: 100%;
    }

}
/* =====================================================
   SIDEBAR BRAND / LOGO SIPILIH
===================================================== */

.sidebar-logo-wrapper {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 10px;
}

.sidebar-logo-img {
    width: 92px;
    height: 92px;

    display: block;
    object-fit: contain;
}

.sidebar-title {
    margin-bottom: 4px;

    font-size: 24px;
    font-weight: 700;

    color: #ffffff;

    transition: .2s;
}

.sidebar-subtitle {
    display: block;

    font-size: 14px;
   

    color: rgba(
        255,
        255,
        255,
        0.85
    );

    transition: .2s;
}

/* =====================================================
   LOGO SAAT SIDEBAR COLLAPSE
===================================================== */

.layout.collapsed .sidebar-logo-wrapper {
    width: 55px;
    height: 55px;

    margin-bottom: 0;
}


.layout.collapsed .sidebar-logo-img {
    width: 50px;
    height: 50px;
}