* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f0f2f5;
}

/* ========== LAYOUT FLEX: SIDEBAR KIRI, KONTEN KANAN ========== */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ========== SIDEBAR (SEBELAH KIRI) ========== */
#sidebar {
    width: 280px;
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: #fff;
    height: 100vh;
    position: sticky;
    top: 0;
    left: 0;
    overflow-y: auto;
    flex-shrink: 0;
}

/* Di HP, sidebar bisa disembunyikan */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        left: -280px;
        z-index: 1000;
        transition: left 0.3s;
    }
    #sidebar.active {
        left: 0;
    }
}

#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar .sidebar-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: white;
}

#sidebar .sidebar-header small {
    font-size: 0.7rem;
    opacity: 0.7;
    color: #ccc;
}

/* Menu Utama */
#sidebar ul.components {
    list-style: none;
    padding: 20px 0;
    margin: 0;
}

#sidebar ul.components > li > a {
    padding: 12px 20px;
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
}

#sidebar ul.components > li > a:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 30px;
}

#sidebar ul.components > li.active > a {
    background: #667eea;
    border-left: 4px solid #ffc107;
}

#sidebar ul.components > li > a i {
    margin-right: 12px;
    width: 25px;
    text-align: center;
}

/* ========== DROPDOWN / SUBMENU (MENJOROK KE DALAM) ========== */
#sidebar ul.components li.nav-item {
    position: relative;
}

#sidebar ul.components li.nav-item > a.dropdown-toggle {
    position: relative;
}

#sidebar ul.components li.nav-item > a.dropdown-toggle::after {
    content: "\f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s;
}

#sidebar ul.components li.nav-item > a.dropdown-toggle[aria-expanded="true"]::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Submenu - MENJOROK KE DALAM */
#sidebar ul.components ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#sidebar ul.components ul li {
    list-style: none;
}

#sidebar ul.components ul li a {
    padding: 10px 20px 10px 55px;
    font-size: 0.9rem;
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.2);
}

#sidebar ul.components ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 65px;
}

#sidebar ul.components ul li.active a {
    background: #667eea;
    color: white;
    border-left: 4px solid #ffc107;
}

#sidebar ul.components ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* ========== KONTEN (SEBELAH KANAN) ========== */
#content {
    flex: 1;
    padding: 20px;
    min-height: 100vh;
    background: #f0f2f5;
}

/* Tombol toggle menu (hanya di HP) */
#sidebarCollapse {
    display: none;
    background: #667eea;
    border: none;
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    #sidebarCollapse {
        display: inline-block;
    }
}

/* Overlay untuk HP */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* ========== CARD STYLES ========== */
.card {
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    border: none;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 15px 20px;
    font-weight: 600;
}

.card-header h4, .card-header h5 {
    margin: 0;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 10px 25px;
    font-weight: 500;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    border-radius: 10px;
    padding: 10px 25px;
    font-weight: 500;
    cursor: pointer;
}

.btn-danger {
    background: linear-gradient(135deg, #ee5a5a 0%, #c0392b 100%);
    border: none;
    border-radius: 10px;
    padding: 5px 15px;
    font-weight: 500;
    cursor: pointer;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border: none;
    border-radius: 10px;
    padding: 5px 15px;
    font-weight: 500;
    cursor: pointer;
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    border: none;
    border-radius: 10px;
    padding: 5px 15px;
    font-weight: 500;
    cursor: pointer;
    color: white;
}

/* ========== TABEL RESPONSIVE ========== */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 10px;
    vertical-align: middle;
}

.table-dark {
    background: #2c3e50;
    color: white;
}

/* ========== STAR DISPLAY ========== */
.star-display {
    color: #ffc107;
    font-size: 18px;
    letter-spacing: 2px;
}

.star-display .star-full {
    color: #ffc107;
}

.star-display .star-empty {
    color: #ddd;
}

/* ========== CHECKBOX GROUP ========== */
.guru-checkbox-group {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    background: #fafafa;
}

.form-check {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 8px;
}

.form-check:hover {
    background: #e9ecef;
}

.form-check-input {
    margin-right: 10px;
}

/* ========== RATING BINTANG ========== */
.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 5px;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 30px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #ffc107;
}

/* ========== BADGE ========== */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.bg-success {
    background: #28a745;
    color: white;
}

.bg-danger {
    background: #dc3545;
    color: white;
}

.bg-warning {
    background: #ffc107;
    color: #333;
}

.bg-info {
    background: #17a2b8;
    color: white;
}

.bg-secondary {
    background: #6c757d;
    color: white;
}

.bg-primary {
    background: #667eea;
    color: white;
}

/* ========== ALERT ========== */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

.alert-info {
    background: #e3f2fd;
    border: 1px solid #b8e1fc;
    color: #0c5460;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* ========== FORM CONTROL ========== */
.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border 0.2s;
}

.form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
}

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 768px) {
    .card-header h4 {
        font-size: 1.1rem;
    }
    
    .star-rating label {
        font-size: 24px;
    }
    
    .btn-primary, .btn-success {
        width: 100%;
        margin-bottom: 10px;
    }
    
    table {
        font-size: 12px;
    }
    
    .table th, .table td {
        padding: 8px 5px;
    }
    
    #sidebar ul.components ul li a {
        padding: 10px 20px 10px 45px;
        font-size: 0.85rem;
    }
}

/* ========== SCROLLBAR SIDEBAR ========== */
#sidebar::-webkit-scrollbar {
    width: 5px;
}

#sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

#sidebar::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

/* ========== TEXT UTILITIES ========== */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.text-white {
    color: white;
}

.text-dark {
    color: #333;
}

/* ========== MARGIN & PADDING ========== */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }
.ms-2 { margin-left: 8px; }
.p-3 { padding: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }
.px-3 { padding-left: 16px; padding-right: 16px; }

/* ========== FLEX ========== */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.gap-2 {
    gap: 8px;
}

/* ========== OPACITY ========== */
.opacity-50 {
    opacity: 0.5;
}

/* ========== DROPDOWN / SUBMENU SIDEBAR ========== */
#sidebar ul.components li.nav-item {
    position: relative;
}

#sidebar ul.components li.nav-item > a.dropdown-toggle {
    position: relative;
}

#sidebar ul.components li.nav-item > a.dropdown-toggle::after {
    content: "\f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s;
}

#sidebar ul.components li.nav-item > a.dropdown-toggle[aria-expanded="true"]::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Submenu - menjorok ke dalam */
#sidebar ul.components ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#sidebar ul.components ul li {
    list-style: none;
}

#sidebar ul.components ul li a {
    padding: 10px 20px 10px 55px;
    font-size: 0.9rem;
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.2);
}

#sidebar ul.components ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 65px;
}

#sidebar ul.components ul li.active a {
    background: #667eea;
    color: white;
    border-left: 4px solid #ffc107;
}

#sidebar ul.components ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Tombol toggle menu (hanya di HP) */
#sidebarCollapse {
    display: none;
    background: #667eea;
    border: none;
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    #sidebarCollapse {
        display: inline-block;
    }
}

/* Overlay untuk HP */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

@media (min-width: 769px) {
    .sidebar-overlay {
        display: none !important;
    }
}