:root {
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f8fafc;
    --dark-bg: #1e293b;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============ SIDEBAR STYLING ============ */
#wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

#sidebar-wrapper {
    min-height: 100vh;
    width: 16rem;
    background: var(--dark-bg);
    margin-left: 0; /* UBAH dari -16rem menjadi 0 */
    transition: margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

/* State: Sidebar disembunyikan */
#wrapper.toggled #sidebar-wrapper {
    margin-left: -16rem; /* UBAH dari 0 menjadi -16rem */
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.5rem 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#sidebar-wrapper .sidebar-heading::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

#sidebar-wrapper .list-group {
    width: 100%;
    padding: 0.75rem 0.5rem;
}

#sidebar-wrapper .list-group-item {
    padding: 0.875rem 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    font-size: 0.95rem;
}

#sidebar-wrapper .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(4px);
}

#sidebar-wrapper .list-group-item.active {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

#sidebar-wrapper .list-group-item i {
    width: 1.25rem;
    text-align: center;
    font-size: 1rem;
}

/* ============ NAVBAR STYLING ============ */
.navbar-light {
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: relative;
    z-index: 100; /* TAMBAHKAN INI */
}

.navbar-light .btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer; /* TAMBAHKAN INI */
    z-index: 101; /* TAMBAHKAN INI */
    position: relative;
}

.navbar-light .btn-primary:hover {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.navbar-light .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.navbar-light .nav-link:hover {
    color: var(--primary-color);
}

.navbar-light .dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: 0.75rem;
    animation: slideDown 0.15s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar-light .dropdown-item:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

/* ============ PAGE CONTENT ============ */
#page-content-wrapper {
    flex: 1;
    min-width: 0;
    transition: margin-left 0.3s ease;
    position: relative;
    z-index: 1;
}

/* DESKTOP: Sidebar selalu visible */
@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0 !important;
        position: relative;
        z-index: auto;
    }
    
    #page-content-wrapper {
        margin-left: 0;
    }

    /* Disable toggle pada desktop */
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0 !important;
    }

    #sidebarToggle {
        display: none;
    }
}

/* MOBILE: Sidebar bisa di-toggle */
@media (max-width: 767px) {
    #sidebar-wrapper {
        position: fixed;
        margin-left: 0;
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: -16rem;
    }

    #page-content-wrapper {
        width: 100%;
    }
}
/* ============ CARD STYLING ============ */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    background: var(--card-bg);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem;
}

/* ============ TABLE STYLING ============ */
.table {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.table thead {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 2px solid var(--border-color);
}

.table thead th {
    color: var(--text-primary);
    font-weight: 600;
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border: none;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--text-primary);
}

.table-responsive {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
}

/* ============ SORTING LINKS ============ */
.table thead th a {
    color: var(--text-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.table thead th a:hover {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.table thead th a i {
    font-size: 0.75rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.table thead th a:hover i {
    opacity: 1;
}

/* ============ BUTTONS ============ */
.btn {
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.btn-info {
    background-color: #0ea5e9;
    color: white;
}

.btn-info:hover {
    background-color: #0284c7;
    transform: translateY(-2px);
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* ============ BADGES ============ */
.badge {
    padding: 0.4em 0.75em;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.85em;
    letter-spacing: 0.3px;
}

.badge.bg-info {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4) !important;
    color: white;
}

.badge.bg-secondary {
    background-color: #94a3b8 !important;
    color: white;
}

.badge.bg-success {
    background: linear-gradient(135deg, #10b981, #14b8a6) !important;
    color: white;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b, #f97316) !important;
    color: white;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ef4444, #f43f5e) !important;
    color: white;
}

/* ============ ALERTS ============ */
.alert {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.2s ease;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #065f46;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #7f1d1d;
}

/* ============ FORMS ============ */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: white;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-secondary);
}

/* ============ HEADINGS ============ */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

/* ============ FOOTER ============ */
.footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
}

/* ============ UTILITIES ============ */
.container-fluid {
    padding: 1.5rem 2rem;
}

.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

.text-center {
    text-align: center;
}

/* ============ LOGIN PAGE ============ */
body.bg-light {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.card.shadow {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 420px;
    padding: 2.5rem;
    background: white;
}

.card-title {
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* ============ TOAST NOTIFICATIONS ============ */
.toast-container {
    z-index: 1050;
}

.toast {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    animation: slideInRight 0.3s ease;
}

.toast-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1rem;
}

.toast-body {
    padding: 1rem;
    font-weight: 500;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============ LOADING SPINNER ============ */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.spinner-overlay .spinner-border {
    color: white;
    width: 3rem;
    height: 3rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 767px) {
    .container-fluid {
        padding: 1rem;
    }
    
    #sidebar-wrapper {
        width: 14rem;
        margin-left: -14rem;
    }
    
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table th, .table td {
        padding: 0.75rem 0.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .table-responsive {
        overflow-x: auto;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

#page-content-wrapper {
    flex: 1;
    min-width: 0;
    transition: margin-left 0.3s ease;
    position: relative;
    z-index: 1;
    /* TAMBAHKAN INI UNTUK LAYOUT VERTICAL */
    display: flex;
    flex-direction: column;
}

/* Ini akan membuat .container-fluid (konten utama) mengisi sisa ruang */
/* Pastikan elemen yang menampung konten utama Anda (.container-fluid) memiliki flex-grow */
#page-content-wrapper .container-fluid {
    flex-grow: 1;
}

/* ============ FOOTER ============ */
.footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: auto;
}

/* START: CSS untuk Social Icons di Footer */
.footer .social-icons a {
    color: var(--text-secondary); /* Warna default ikon */
    transition: all 0.3s ease; /* Efek transisi halus */
    text-decoration: none; /* Hilangkan garis bawah */
    padding: 0.3rem; /* Sedikit padding untuk area klik */
    display: inline-block; /* Agar padding dan margin berfungsi */
}

.footer .social-icons a:hover {
    transform: translateY(-3px); /* Efek melayang saat hover */
}

.footer .social-icons .whatsapp:hover {
    color: #25d366; /* Warna brand WhatsApp */
}

.footer .social-icons .instagram:hover {
    /* Gradien khas Instagram */
    background: -webkit-linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
/* END: CSS untuk Social Icons di Footer */


/* ============ UTILITIES ============ */
.container-fluid {
    padding: 1.5rem 2rem;
}