/* 1. Import Google Fonts (Inter) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* 2. Custom Variables (Untuk Referensi Warna) */
:root {
    --bs-primary-rgb: 79, 70, 229;
    --bs-secondary-rgb: 100, 116, 139;
    --bs-success-rgb: 16, 185, 129;
    --bs-info-rgb: 14, 165, 233;
    --bs-warning-rgb: 245, 158, 11;
    --bs-danger-rgb: 239, 68, 68;
    --bs-light-rgb: 243, 244, 246;
    --bs-dark-rgb: 17, 24, 39;
    
    --bs-font-sans-serif: 'Inter', system-ui, -apple-system, sans-serif;
    
    --sidebar-bg: #312e81;
    --sidebar-width: 280px;
}

/* 3. Custom CSS Global */
body {
    background-color: #f8fafc;
    font-size: 0.875rem; /* 14px */
    font-family: var(--bs-font-sans-serif);
}

.fs-7 { font-size: 0.9rem !important; }
.fs-8 { font-size: 0.75rem !important; }

/* Custom Badge Colors (Mirip Tailwind) */
.bg-success-subtle { background-color: #dcfce7 !important; }
.bg-danger-subtle { background-color: #fee2e2 !important; }
.bg-warning-subtle { background-color: #fef3c7 !important; }
.bg-primary-subtle { background-color: #e0e7ff !important; }
.bg-secondary-subtle { background-color: #f1f5f9 !important; }

/* === SIDEBAR STYLING === */
.sidebar-wrapper {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    font-family: 'Inter', sans-serif;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease-in-out;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0,0,0,0.1);
}

.sidebar-header .logo-box {
    width: 2.5rem;
    height: 2.5rem;
    background-color: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-header .logo-box img {
    width: 65%;
    height: auto;
}

.sidebar-header .app-title {
    line-height: 1.1;
}
.sidebar-header .app-title h1 {
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0;
    color: white;
}
.sidebar-header .app-title p {
    font-size: 0.65rem;
    color: #a5b4fc;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-menu {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-menu .nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 10px 20px !important;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
    font-size: 0.85rem !important;  
    border: none;
    width: 100%;
    text-align: left;
    color: #c7d2fe;
    background-color: transparent;
}
.sidebar-menu .nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}
.sidebar-menu .nav-item:hover {
    background-color: #3730a3;
    color: white;
}
.sidebar-menu .nav-item.active {
    background-color: #4338ca;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.sidebar-footer {
    padding: 1rem;
    margin-top: auto;
}
.sidebar-footer .info-card {
    background-color: #3730a3;
    border: 1px solid #4338ca;
    border-radius: 0.75rem;
    padding: 1rem;
}
.sidebar-footer .info-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.sidebar-footer .info-label i {
    font-size: 1rem;
    color: #a5b4fc;
}
.sidebar-footer .info-label span {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a5b4fc;
}
.sidebar-footer .user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    margin: 0;
}
.sidebar-footer .user-dept {
    font-size: 0.75rem;
    color: #818cf8;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.sidebar-footer .logout-btn {
    margin-top: 0.75rem;
    width: 100%;
    background: transparent;
    color: #a5b4fc;
    border: 1px solid transparent;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.sidebar-footer .logout-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #ef4444;
}

.main-content {
    margin-left: 280px;
    padding: 2rem;
    min-height: 100vh;
    background-color: #f3f4f6;
    transition: margin-left 0.3s ease;
}

.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -1px rgb(0 0 0 / 0.05);
    background: white;
    
    .card-header {
        background: transparent;
        border-bottom: 1px solid #f1f5f9;
        padding: 1.25rem 1.5rem;
        font-weight: 600;
        color: #1e293b;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

@media (max-width: 991.98px) {
    
    /* 1. Sembunyikan Sidebar ke Kiri Layar */
    .sidebar-wrapper {
        left: -280px; 
    }

    /* 2. Jika ada class 'show', Munculkan Sidebar */
    .sidebar-wrapper.show {
        left: 0;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }

    /* 3. Reset Margin Konten Utama (Full Width) */
    .main-content {
        padding: 1rem;
        margin-left: 0;
    }

    /* 4. Tampilkan Overlay saat Sidebar Muncul */
    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040; /* Di bawah sidebar, di atas konten */
        opacity: 0;
        transition: opacity 0.3s ease;
    }
}

.login-page {
    background-color: #312e81;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-family: 'Inter', sans-serif;

    .login-card {
        width: 100%;
        max-width: 450px;
        background: white;
        border-radius: 1.5rem;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
        overflow: hidden;
        border: none;

        .login-header {
            background-color: #4f46e5;
            padding: 3rem 2rem 2.5rem;
            text-align: center;
            color: white;
            position: relative;

            .header-bg {
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                opacity: 0.1;
                pointer-events: none;
            }

            .logo-box {
                width: 80px;
                height: 80px;
                background: white;
                border-radius: 1rem;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                color: #4f46e5;
                margin-bottom: 1.5rem;
                box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
                transform: rotate(-6deg);
                transition: transform 0.3s ease;

                &:hover {
                    transform: rotate(0deg);
                }

                img {
                    width: 65%;
                    height: auto;
                    object-fit: contain;
                    filter: drop-shadow(0 4px 3px rgba(0,0,0,0.1));
                }
            }

            h4 { font-weight: 700; margin-bottom: 0.25rem; }
            p { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.8; margin: 0; }
        }

        .login-body {
            padding: 2.5rem;

            label {
                font-size: 0.75rem;
                font-weight: 700;
                color: #9ca3af;
                text-transform: uppercase;
                letter-spacing: 0.05em;
                margin-bottom: 0.5rem;
                display: block;
            }

            .input-wrapper {
                position: relative;
                
                i {
                    position: absolute;
                    left: 1rem;
                    top: 50%;
                    transform: translateY(-50%);
                    color: #9ca3af;
                    font-size: 1.1rem;
                }

                .form-control {
                    padding: 0.8rem 1rem 0.8rem 3rem;
                    background-color: #f9fafb;
                    border: 1px solid #f3f4f6;
                    border-radius: 1rem;
                    font-size: 0.95rem;
                    color: #1f2937;
                    transition: all 0.2s;

                    &::placeholder { color: #d1d5db; }
                    
                    &:focus {
                        background-color: white;
                        border-color: #4f46e5;
                        box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
                    }
                }
            }

            .btn-login {
                background-color: #4f46e5;
                color: white;
                font-weight: 700;
                padding: 1rem;
                border-radius: 1rem;
                width: 100%;
                border: none;
                box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
                transition: all 0.2s;

                &:hover {
                    background-color: #4338ca;
                    transform: translateY(-2px);
                }
                &:active { transform: translateY(0); }
            }
        }
    }
}

.qr-card {
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background-color: #312e81; 
    color: white;
}

.qr-header {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-box {
    width: 5rem; 
    height: 5rem;
    background-color: white;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: #312e81;
    font-size: 2.5rem;
}

.qr-body {
    background-color: white;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-frame {
    padding: 1rem;
    background-color: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
}

.qr-footer {
    background-color: #3730a3; 
    padding: 1rem;
    text-align: center;
}


.modal-backdrop.show {
    opacity: 0.7;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
    .my-pagination .small.text-muted {
        display: none !important;
    }
   
    .my-pagination nav > div.d-sm-flex {
        justify-content: center !important;
    }
  
    .my-pagination nav > div.d-sm-flex > div:first-child {
        display: none !important;
    }

:root {
    --indigo-600: #4f46e5;
    --indigo-50: #eef2ff;
    --indigo-100: #e0e7ff;
}

.text-indigo { color: var(--indigo-600) !important; }
.bg-indigo { background-color: var(--indigo-600) !important; }
.bg-indigo-50 { background-color: var(--indigo-50) !important; }
.border-indigo-100 { border-color: var(--indigo-100) !important; }

.rounded-xl { border-radius: 0.75rem !important; } 
.rounded-2xl { border-radius: 1rem !important; }    
.rounded-3xl { border-radius: 1.5rem !important; } 

.shadow-soft { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important; }

/* Custom Nav Pills */
.nav-pills-custom .nav-link {
    color: #4b5563; 
    background: transparent;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 0.75rem;
    margin-right: 0.5rem;
    transition: all 0.2s;
}
.nav-pills-custom .nav-link:hover {
    background-color: #f3f4f6;
}
.nav-pills-custom .nav-link.active {
    background-color: var(--indigo-600);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.4);
}

/* Dashed Border untuk Upload */
.border-dashed {
    border-style: dashed !important;
    border-width: 2px !important;
}

/* Sticky Table untuk Rekap */
.table-matrix-container {
    max-height: 600px;
    overflow: auto;
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
}
.sticky-col { position: sticky; background: white; z-index: 10; }
.sticky-header { position: sticky; top: 0; background: #f3f4f6; z-index: 20; }

@media (max-width: 991.98px) {
    .sidebar-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px; 
        height: 100vh;
        z-index: 2000;
        transform: translateX(-100%); 
        transition: transform 0.3s ease-in-out; 
    }

    .sidebar-wrapper.show {
        transform: translateX(0);
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }

    .sidebar-overlay {
        display: block; 
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}
.my-pagination .d-sm-none {
    display: none !important;
}

.my-pagination .d-none.d-sm-flex {
    display: flex !important;
    justify-content: center !important;
}
.my-pagination .pagination {
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}
.my-pagination .page-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
}