/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* BODY */
body {
    font-family: 'Lexend', 'Segoe UI', Tahoma, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
}

/* TOP NAVBAR */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 0px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 999;
    display: flex;
    align-items: center;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 24px;
    height: 100%;
}

.navbar-brand h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.logout-btn {
    padding: 8px 16px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.25s ease;
}

.logout-btn:hover {
    background: #dc2626;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    transition: width 0.3s ease;
    overflow-x: hidden;
    top: 0px;
    left: 0;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 20px 16px;
    z-index: 1000;
    overflow-y: auto;
}
.sidebar.active {
    width: 80px;
}

.sidebar.active .nav a {
    justify-content: center;
}

/* --- Tambahkan kode ini --- */

/* Sembunyikan teks logo saat sidebar mengecil */
.sidebar.active .logo-text {
    display: none;
}

/* Sembunyikan label menu saat sidebar mengecil */
.sidebar.active .nav a .label {
    display: none;
}

/* Pastikan icon berada di tengah saat mengecil */
.sidebar.active .nav a {
    justify-content: center;
    padding: 10px 0; /* Memberi ruang yang pas untuk icon saja */
}

/* Hilangkan border-right active agar tidak menempel ke icon saat ciut */
.sidebar.active .nav a.active {
    border-right: none;
    background: #dcfce7; /* Tetap beri warna background agar tahu posisi aktif */
    border-radius: 10px; /* Kembalikan radius penuh */
}

/* Mengatur ulang logo wrap saat ciut agar icon sekolah di tengah */
.sidebar.active .logo-wrap {
    justify-content: center;
    padding: 12px 0;
}

/* Update bagian MAIN CONTENT */
.main-content {
    margin-left: 260px; /* Lebar default */
    width: calc(100% - 260px); /* Isi sisa layar */
    padding: 24px;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Update saat sidebar CIUT */
.sidebar.active ~ .main-content {
    margin-left: 80px;
    width: calc(100% - 80px); /* Melebar otomatis */
}

/* --- Toggle --- */
/* Styling dasar tombol toggle agar ukurannya mirip dengan menu nav */
.sidebar-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 10px 14px; /* Samakan dengan padding .nav a */
    margin-bottom: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #475569;
    gap: 12px; /* Samakan dengan gap .nav a */
}

.sidebar-toggle .material-symbols-outlined {
    font-size: 24px; /* Ukuran icon menu */
    color: #475569;
}

/* Saat sidebar mengecil (.active), buat tombol ke tengah */
.sidebar.active .sidebar-toggle {
    justify-content: center;
    padding: 10px 0;
}

/* Tambahkan efek hover supaya user tahu itu tombol */
.sidebar-toggle:hover {
    background: #f1f5f9;
    border-radius: 10px;
}

/* MOBILE */
/* MOBILE & TABLET */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%); /* Sembunyi default di HP */
        width: 260px !important; /* Paksa lebar penuh di HP */
        transition: transform 0.3s ease;
    }

    /* Munculkan sidebar saat di-toggle di HP */
    .sidebar.active {
        transform: translateX(0);
        width: 260px !important; /* Tetap lebar penuh saat muncul di HP */
    }

    /* --- KUNCI PERBAIKAN: Paksa teks muncul kembali khusus di HP --- */
    .sidebar.active .logo-text,
    .sidebar.active .nav a .label {
        display: block !important; /* Batalkan display:none dari mode desktop */
    }

    .sidebar.active .nav a {
        justify-content: flex-start !important; /* Icon kembali ke kiri */
        padding: 10px 14px !important;
    }

    .sidebar.active .logo-wrap {
        justify-content: flex-start !important;
        padding: 12px !important;
    }

    .sidebar.active .sidebar-toggle {
        justify-content: flex-start !important;
    }
    /* ------------------------------------------------------------- */

    /* Konten utama selalu penuh di HP */
    .main-content, 
    .sidebar.active ~ .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}
/* LOGO */
.logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 24px;
    overflow: hidden; /* Tambahkan ini agar teks tidak meluber keluar saat ciut */
    white-space: nowrap; /* Cegah teks turun ke bawah sebelum hilang */
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: #16a34a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.logo-text h2 {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.logo-text p {
    font-size: 10px;
    color: #64748b;
    font-weight: 500;
}

/* NAV */
.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* NAV LINK */
.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: all 0.25s ease;
}

/* ICON & LABEL */
.nav a .icon {
    font-size: 20px;
    color: #94a3b8;
}

.nav a .label {
    white-space: nowrap;
}

/* ICON */
.nav a .material-symbols-outlined {
    font-size: 20px;
    color: #94a3b8;
    transition: color 0.25s ease;
}

/* HOVER */
.nav a:hover {
    background: #ecfdf5;
    color: #16a34a;
}

.nav a:hover .material-symbols-outlined {
    color: #16a34a;
}

/* ACTIVE */
.nav a.active {
    background: #dcfce7;
    color: #16a34a;
    font-weight: 700;
    border-right: 4px solid #16a34a;
}

.nav a.active .material-symbols-outlined {
    color: #16a34a;
}

/* FOOTER MENU */
.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}


