:root {
    --primary-color: #3b5998;
    --secondary-color: #8b9dc3;
    --accent-color: #dfe3ee;
    --text-color: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: var(--text-color);
    overflow-x: hidden; /* ?? Jaga-jaga global */
    width: 100vw;
    margin: 0;
    padding: 0;
}

/* --- LAYOUT FIX: Sidebar & Content Scrollable --- */

/* Navbar tetap */
.navbar {
    background-color: var(--primary-color);
    height: 56px; /* Pastikan tinggi navbar konsisten */
}
/* --- Fix Navbar Dropdown ke Kiri --- */
.navbar-nav .dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
}

/* Jika ingin benar-benar ke kiri (fallback jika masih ke kanan) */
.navbar-nav .dropdown-menu {
    left: auto !important;
    right: 0 !important;
}


/* Sidebar: fixed, tinggi penuh dikurangi navbar */
/* --- Sidebar Layout & Visibility Fix --- */

.sidebar {
    background-color: var(--secondary-color);
    width: 250px;
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    padding: 20px 10px;
    overflow-y: auto;
    overflow-x: hidden; /* ?? Tambahkan ini */
    z-index: 1050;
    border-right: 1px solid rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.sidebar .list-group-item {
    color: #ffffff;
    background-color: rgba(0,0,0,0.1); /* Background default agar teks putih terlihat */
    padding: 12px 20px;
    margin: 5px 10px;
    border-radius: 5px;
    border: none;
    transition: all 0.2s ease;
}

.sidebar .list-group-item:hover,
.sidebar .list-group-item.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

/* Submenu */
.list-group-submenu .list-group-item {
    padding-left: 3rem;
    font-size: 0.95rem;
    border-left: 3px solid #0d6efd;
    margin: 2px 10px;
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.list-group-submenu .list-group-item:hover {
    background: rgba(255,255,255,0.2);
}

.menu-parent[aria-expanded="true"] {
    background-color: var(--primary-color);
    color: white;
}

.menu-parent[aria-expanded="true"] i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Konten */
.content-wrapper {
    margin-left: 0 !important; /* karena sudah diatur di HTML */
    margin-top: 56px;
    padding: 20px;
    min-height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden; /* ?? Ini kunci utama! */
    background-color: #f5f5f5;
    max-width: 100%; /* jangan biarkan melebar */
    box-sizing: border-box;
}
.content-wrapper > .container-fluid,
.content-wrapper > .row {
    max-width: 100%;
    overflow-x: hidden;
}


.content-wrapper::-webkit-scrollbar {
    width: 6px;
}

.content-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 3px;
}
/* Fix Chart.js agar tidak melebar */
#jurusanChart {
    max-width: 100% !important;
    height: auto !important;
}

/* Fix tabel agar responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


.menu-parent[aria-expanded="true"] {
    background-color: var(--primary-color);
    color: white;
}

.menu-parent[aria-expanded="true"] i.fa-chevron-down {
    transform: rotate(180deg);
}

.card {
    overflow: hidden;
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 10px 10px 0 0 !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #2d4373;
    border-color: #2d4373;
}

.stat-card {
    text-align: center;
    padding: 20px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.dashboard-header {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.action-buttons .btn {
    margin-right: 10px;
}

/* Login Page Styles */
/* --- LOGIN PAGE � FINAL STABLE VERSION --- */
body.login-page {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-wrapper {
    width: 100%;
    max-width: 400px; /* ?? Tidak terlalu lebar */
    padding: 20px;
    box-sizing: border-box;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: none;
}

.login-header {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 30px 20px;
}

.login-header i {
    font-size: 2.5rem; /* Ukuran tetap, tidak terlalu kecil */
    margin-bottom: 15px;
    display: block;
}

.login-header h2 {
    margin: 0;
    font-weight: 600;
    font-size: 1.5rem;
}

.login-header p {
    margin: 8px 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.login-body {
    padding: 30px 25px;
}

.form-control {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 18px;
    border: 2px solid #ddd;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(59, 89, 152, 0.25);
}

.input-group-text {
    background: white;
    border: 2px solid #ddd;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 8px 8px 0;
}

.btn-login {
    background-color: var(--primary-color);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
    margin-top: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-login:hover {
    background-color: #2d4373;
    transform: translateY(-1px);
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    font-size: 0.9rem;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.login-footer {
    text-align: center;
    padding: 20px;
    background-color: var(--accent-color);
    font-size: 0.9rem;
}

.divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.divider span {
    padding: 0 15px;
    color: #777;
    font-weight: 500;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .login-wrapper {
        padding: 15px;
        max-width: 95%; /* Lebih fleksibel di mobile */
    }

    .login-header {
        padding: 25px 15px;
    }
    
    .login-header i {
        font-size: 2.2rem;
    }
    
    .login-body {
        padding: 25px 20px;
    }
    
    .form-control {
        font-size: 0.95rem;
        padding: 10px 12px;
    }
    
    .btn-login {
        font-size: 0.95rem;
        padding: 10px;
    }
    
    .login-footer {
        padding: 15px;
        font-size: 0.85rem;
    }
}

/* Small height devices */
@media (max-height: 600px) {
    .login-header {
        padding: 20px 15px;
    }
    .login-body {
        padding: 20px 20px;
    }
    .login-footer {
        padding: 15px;
    }
}
.alert {
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
}
.list-group-submenu .list-group-item {
        padding-left: 2.5rem;
        font-size: 0.95rem;
        border-left: 3px solid #0d6efd;
    }
    .menu-parent[aria-expanded="true"] {
        background-color: #0d6efd;
        color: white;
    }
    .menu-parent[aria-expanded="true"] i.fa-chevron-down {
        transform: rotate(180deg);
    }
.dropdown-menu-start {
    right: auto !important;
    left: 0 !important;
}	
	
/* Responsif: mobile */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }
    .content-wrapper {
        margin-left: 0;
        margin-top: 0;
        padding: 15px;
    }
}

/* Untuk mobile, biarkan tetap di tengah */
@media (max-width: 576px) {
    .navbar-nav .dropdown-menu {
        right: auto !important;
        left: 0 !important;
        transform: none !important;
    }
}    
/* --- PERBAIKAN INPUT GROUP � BORDER NYAMBUNG SEMPURNA --- */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .input-group-text {
    background-color: white;
    border: 2px solid #ddd;
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0; /* Hilangkan margin */
}

.input-group .form-control {
    border: 2px solid #ddd;
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 12px 15px;
    flex: 1;
    min-width: 0;
    margin: 0; /* Hilangkan margin */
}

/* Hilangkan celah antar elemen */
.input-group > * {
    margin: 0 !important;
}

/* Hover & Focus */
.input-group .form-control:focus,
.input-group .form-control:focus ~ .input-group-text {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(59, 89, 152, 0.25);
}

.input-group .form-control:focus {
    z-index: 3;
}

/* Pastikan tidak ada gap karena floating point rendering */
.input-group .input-group-text,
.input-group .form-control {
    flex-shrink: 0;
}
.input-group .input-group-text {
    margin-right: -1px;
}

.input-group .form-control {
    margin-left: -1px;
}