/* ==========================================
   GLOBAL RESET & VARIABEL
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: #f4f7f6;
    color: #333;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================
   SIDEBAR & RESPONSIVE TOGGLE
   ========================================== */
.sidebar {
    width: 260px;
    background: #1e293b;
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 25px 20px;
    background: #0f172a;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #334155;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 10px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
}

.sidebar-menu a:hover, 
.sidebar-menu a.active {
    background: #3b82f6;
    color: #fff;
}

.sidebar-menu a i {
    width: 20px;
    text-align: center;
}

/* ==========================================
   MAIN CONTENT & NAVBAR
   ========================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    width: 100%;
}

.top-navbar {
    background: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    min-height: 70px;
}

.top-navbar h2 {
    font-size: 18px;
    color: #1e293b;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.container {
    padding: 30px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* ==========================================
   LAYOUT GRID & CARDS
   ========================================== */
.content-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 25px;
}

.card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================
   FORM & INPUTS
   ========================================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: #f8fafc;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Checkbox Container (Multi-Kelas) */
.checkbox-container {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    color: #1e293b;
    font-weight: 500;
}

.checkbox-item input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}

/* ==========================================
   BUTTONS & BADGES
   ========================================== */
.btn {
    padding: 10px 18px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    background: #2563eb;
}

.btn-danger {
    background: #ef4444;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-back {
    background: #64748b;
    margin-bottom: 20px;
}

.btn-back:hover {
    background: #475569;
}

/* Alerts */
.alert {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap; /* Mencegah teks terpotong aneh di hp */
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
}

tr:hover td {
    background: #f8fafc;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #e0f2fe;
    color: #0369a1;
}

/* ==========================================
   RESPONSIVE DESIGN (UNTUK HP / TABLET)
   ========================================== */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr; /* Form dan tabel bertumpuk ke bawah di layar sedang/hp */
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column; /* Sidebar bergeser ke atas/bisa disembunyikan atau diringkas */
        overflow-y: auto;
        height: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 10px;
        gap: 5px;
    }

    .sidebar-menu li {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .sidebar-menu a {
        padding: 8px 12px;
        font-size: 13px;
    }

    .main-content {
        height: auto;
        overflow-y: visible;
    }

    .top-navbar {
        padding: 12px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .container {
        padding: 15px;
    }

    .card {
        padding: 15px;
    }
}