/* =========================================================================
 *
 * VARIABEL & GLOBAL
 *
 * ========================================================================= */
:root {
    --green: #198754;
    --black: #111;
    --muted: #666;
    --bg: #f6f8f9;
    --card: #fff;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    --accent: #f8f9fa;
    --danger: #dc3545;
    --warning: #ffc107;
    --primary-color: #4c51bf; /* Biru untuk tab aktif */
    --border-color: #e2e8f0;

    /* VARIABEL WARNA BARU DISESUAIKAN DENGAN BACKGROUND (GAMBAR 2) */
    --theme-card-bg-color: rgba(255, 255, 255, 0.1); /* Latar belakang card semi-transparan */
    --theme-card-border-color: rgba(255, 255, 255, 0.3); /* Border card */
    --theme-primary-color: #004D40; /* Dark teal untuk border input focus, button, title */
    --theme-primary-hover: #00695C; /* Teal lebih terang untuk button hover */
    --theme-text-color: #004D40; /* Warna teks utama (dark teal) */
    --theme-input-border: rgba(0, 77, 64, 0.5); /* Border input */
    --theme-input-bg: rgba(255, 255, 255, 0.8); /* Background input */
    --theme-placeholder-color: rgba(0, 77, 64, 0.6); /* Warna placeholder */

    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* * ======================================================
 * BAGIAN INI DIPERBARUI SESUAI PERMINTAAN GAMBAR BARU
 * ======================================================
 */
body {
    color: var(--black);
    line-height: 1.5;

    /* GANTI INI: Pastikan PATH INI BENAR!
      Ini adalah path ke file 'background.jpg' yang baru Anda unggah.
      Sesuaikan jika Anda menyimpannya di folder lain.
      (Contoh: '../uploads/gambar/background.jpg')
    */
    background-image: url('../uploads/gambar/background.jpg'); /* Pastikan path ini benar */

    background-size: cover; /* Diubah kembali ke cover agar memenuhi layar */
    background-position: center;
    background-attachment: fixed; /* Membuat background tetap saat scroll */
    background-repeat: no-repeat; /* Diubah kembali ke no-repeat agar tidak berulang */
    /* Fallback jika gambar tidak ada */
    background-color: #f0f8f0; /* Warna solid hijau muda sebagai fallback */

    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
/* ====================================================== */


a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}


/* =========================================================================
 *
 * STRUKTUR UTAMA
 *
 * ========================================================================= */
.app {
    display: flex;
    min-height: 100vh;
    position: relative;
}



/* --- Main Content --- */
.main {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Card hanya berlaku di main content, bukan login */
.main .card {
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 2rem;
}


/* =========================================================================
 *
 * KOMPONEN UI
 *
 * ========================================================================= */

/* --- Header & Divider --- */
.header-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.header-row h1 {
    font-size: 1.75rem;
}

.header-row .sub {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.header-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--black);
}

/* --- Tabs --- */
.tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s, border-bottom-color 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--black);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* --- Forms & Grid --- */
.form-group {
    margin-bottom: 1.25rem;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--black);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: var(--card);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--black);
}

.form-control:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.2);
}

.form-control[readonly],
.form-control:disabled {
    background-color: var(--accent);
    cursor: default;
    color: var(--black);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.foto img {
    width: 150px;
    height: 200px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.small {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: inline-block;
    color: var(--black);
}

/* --- Buttons --- */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn-primary { background: var(--green); color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: #198754; color: white; }

.btn-icon {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.btn-icon.delete-btn { color: var(--danger); }
.btn-icon:hover { background-color: var(--accent); }
.btn-icon:disabled { color: #ccc; cursor: not-allowed; }
.btn-icon:disabled:hover { background-color: transparent; }

.text-yellow {
    color: #ece000 !important;
}

/* --- Tables --- */
.table-container {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0 1rem;
}
.data-table th, .data-table td {
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    text-align: left;
    white-space: nowrap;
}
.data-table th {
    background-color: var(--accent);
    font-weight: 600;
}
.data-table tbody tr:nth-child(even) {
    background-color: var(--accent);
}
.table-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

/* --- Modal --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal.show, .modal:target {
    display: flex;
    opacity: 1;
}
.modal-content {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal.show .modal-content {
    transform: scale(1);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 1.25rem; }
.close-btn { font-size: 1.75rem; line-height: 1; border: none; background: none; cursor: pointer; color: var(--muted); }
.modal-body { padding: 1.5rem; }
.modal-footer { display: flex; gap: 0.75rem; justify-content: flex-end; padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); }

/* --- Alerts --- */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}
.alert-success { background-color: #d1e7dd; border-color: #badbcc; color: #0f5132; }
.alert-danger { background-color: #f8d7da; border-color: #f5c2c7; color: #842029; }
.alert-warning { background-color: #fff3cd; border-color: #ffecb5; color: #664d03; }

.add-form .form-group.action-buttons {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    margin-bottom: 1.25rem;
}


/* * =========================================================================
 *
 * BLOK LOGIN (Sesuai gambar, flat design, underline input)
 *
 * =========================================================================
 */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    /* Background image sudah diatur di body */
}

.login-card-center {
    background-color: rgba(240, 249, 246, 0.9); /* Latar belakang card semi-transparan (putih kehijauan) */
    border: 2px solid #006442;  /* Border hijau tua */
    border-radius: 8px;
    padding: 2.5rem 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: padding 0.3s ease; /* Tambahkan transisi untuk padding */
}

.login-logo-section {
    text-align: center;
    margin-bottom: 2rem;
    color: #006442; /* Warna teks hijau tua */
    transition: margin-bottom 0.3s ease; /* Tambahkan transisi */
}

/* Gambar logo disembunyikan */
.login-logo-section img {
    display: none;
}

.login-logo-section h1.text-yellow {
    font-size: 2rem;
    margin-bottom: 0.3rem;
    color: #006442 !important; /* Ganti dari kuning ke hijau tua */
    text-shadow: none;
    transition: font-size 0.3s ease; /* Tambahkan transisi */
    /* CATATAN: Teks 'SIM-YNH' berasal dari login.php */
}

.login-logo-section p {
    /* Teks paragraf ditampilkan kembali */
    font-size: 0.85rem;
    line-height: 1.4;
    color: #006442;
    opacity: 0.85;
    transition: font-size 0.3s ease; /* Tambahkan transisi */
}


/* Styling form */
.login-card-center .form-group {
    margin-bottom: 1.5rem;
    transition: margin-bottom 0.3s ease; /* Tambahkan transisi */
}

.login-card-center .form-group label {
    font-weight: 500;
    color: #006442; /* Label hijau tua */
    font-size: 0.9rem;
    transition: font-size 0.3s ease; /* Tambahkan transisi */
}

/* REVISI: Ubah form-control jadi underline */
.login-card-center .form-control {
    border: none;
    border-radius: 0;
    background-color: transparent;
    color: #006442;
    padding: 0.8rem 0.2rem 0.5rem 0.2rem;
    border-bottom: 2px solid #006442;
    box-shadow: none;
    transition: padding 0.3s ease, border-bottom-width 0.3s ease; /* Tambahkan transisi */
}
.login-card-center .form-control::placeholder {
    color: #006442;
    opacity: 0.5;
}

.login-card-center .form-control:focus {
    border: none;
    box-shadow: none;
    background-color: transparent;
    border-bottom: 2px solid #3e9c42; /* Warna fokus lebih cerah */
}

/* Styling tombol */
.login-card-center .btn-primary {
    background-color: #4caf50; /* Warna tombol hijau */
    border: none;
    font-size: 1rem;
    padding: 0.8rem;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s, padding 0.3s ease, font-size 0.3s ease; /* Tambahkan transisi */
}

.login-card-center .btn-primary:hover {
    background-color: #45a049; /* Hijau lebih gelap saat hover */
    transform: translateY(0);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Style untuk toggle password */
.password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #006442; /* Warna ikon hijau tua */
    font-size: 1.2rem;
    transition: right 0.3s ease; /* Tambahkan transisi */
}
.password-toggle:hover {
    color: #4caf50;
}
/* =========================================================================
 *
 * AKHIR BLOK LOGIN YANG DIPERBARUI
 *
 * ========================================================================= */


/* =========================================================================
 *
 * SISA CSS (RIWAYAT SK, DLL.)
 *
 * ========================================================================= */

/* --- Riwayat SK --- */
.sk-container {
    display: flex;
    gap: 2rem;
}
.sk-list-wrapper {
    width: 300px;
    flex-shrink: 0;
}
.sk-list-wrapper h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}
.sk-list-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.sk-list-item:hover {
    background-color: var(--accent);
}
.sk-list-item.active {
    background-color: rgba(25, 135, 84, 0.09);
    border-color: var(--green);
    font-weight: 600;
}
.sk-list-item .sk-title {
    font-weight: 600;
}
.sk-list-item .sk-date-range {
    font-size: 0.85rem;
    color: var(--muted);
}
.sk-list-item .sk-status {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--danger);
    margin-top: 0.25rem;
}

.sk-detail-wrapper {
    flex: 1;
}
.sk-detail-content {
    display: none;
}
.sk-detail-content.active {
    display: block;
}
.sk-detail-content h3 {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* --- Lampiran Kepegawaian --- */
.lampiran-section {
    margin-bottom: 2rem;
}
.lampiran-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--green);
}
.lampiran-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.lampiran-item {
    background: var(--accent);
    padding: 1rem;
    border-radius: 8px;
}
.lampiran-item label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}
.lampiran-item .value {
    font-size: 1.1rem;
    font-weight: 500;
}

/* --- Input File Kustom --- */
.custom-file-container {
    position: relative;
}

.file-default-view, .file-uploaded-view {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    padding: 0.375rem 0.5rem;
    cursor: pointer;
    background-color: var(--card);
}

.btn-choose-file {
    padding: 0.3rem 0.8rem;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    color: #333;
}

.custom-file-container *:not([data-disabled="true"]) .btn-choose-file:hover {
    background-color: #e2e2e2;
}

.file-default-view .default-text {
    font-size: 0.9rem;
    color: var(--muted);
}

.file-uploaded-view .file-name-text {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--black);
}

.file-uploaded-view .file-actions {
    display: flex;
    gap: 0.25rem;
}

.custom-file-container.no-file .file-uploaded-view,
.custom-file-container.has-file .file-default-view {
    display: none;
}
.custom-file-container.has-file .file-uploaded-view,
.custom-file-container.no-file .file-default-view {
    display: flex;
}

.custom-file-container [data-disabled="true"] {
     background-color: var(--accent);
     cursor: not-allowed;
}

.custom-file-container [data-disabled="true"] .btn-choose-file,
.custom-file-container [data-disabled="true"] .file-name-text,
.custom-file-container [data-disabled="true"] .default-text,
.custom-file-container [data-disabled="true"] .btn-icon {
    opacity: 0.7;
}

.file-input-hidden {
    display: none;
}

/* --- Notifikasi Kelengkapan Data --- */
.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    padding-bottom: 0.5rem;
}

.tab-count-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--danger);
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 10px;
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
}

.tab-count-badge.filled {
    color: var(--green);
    background-color: #d1e7dd;
    border-color: #badbcc;
}

/* --- Responsive --- */
.mobile-tab-nav {
    display: none;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 1.5rem;
    background-color: var(--accent);
}

.mobile-tab-nav .arrow {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0 1rem;
    color: var(--muted);
    text-decoration: none;
}

.mobile-tab-nav .arrow:hover {
    color: var(--primary-color);
}

#current-tab-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--black);
}

@media (max-width: 992px) {
    .sidebar {
        width: 250px;
    }
    .sk-container {
        flex-direction: column;
    }
    .sk-list-wrapper {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .app {
        flex-direction: column;
        overflow-x: hidden; /* Mencegah scroll horizontal saat sidebar tersembunyi */
        position: relative; /* Diperlukan agar sidebar bisa absolute */
    }
    .sidebar {
        /* Ubah posisi menjadi absolute atau fixed untuk overlay */
        position: fixed; /* Atau absolute */
        top: 0;
        left: 0;
        bottom: 0;
        width: 250px; /* Atau lebar yang diinginkan */
        height: 100vh; /* Tinggi penuh */
        z-index: 1000;
        border-right: 1px solid var(--border-color);
        border-bottom: none;
        transform: translateX(-100%); /* Sembunyikan ke kiri secara default */
        transition: transform 0.3s ease;
        overflow-y: auto; /* Aktifkan scroll jika konten panjang */
    }
    .sidebar.sidebar-mobile-visible {
        transform: translateX(0); /* Tampilkan sidebar */
    }

    .main {
        padding: 0.5rem;
        /* Tambahkan padding-top jika header fixed */
        padding-top: 5rem; /* Sesuaikan dengan tinggi header + tombol menu */
        width: 100%; /* Pastikan main content mengambil lebar penuh */
        transition: margin-left 0.3s ease; /* Transisi jika diperlukan */
    }
    /* Jika ingin main content tergeser saat sidebar muncul (opsional) */
    /* .app.sidebar-mobile-visible .main {
        margin-left: 250px;
    } */

    .sidebar-toggle-btn {
        display: none; /* Sembunyikan tombol panah di mobile */
    }
     .mobile-menu-toggle {
        display: block; /* Tampilkan tombol hamburger di mobile */
    }

    /* Penyesuaian header di mobile */
    .main .header-row { /* Target spesifik agar tidak mempengaruhi login */
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 0;
    }
    .main .header-buttons { /* Target spesifik */
        width: 100%;
        margin-top: 1.5rem;
    }
    .main .header-buttons .btn { /* Target spesifik */
        flex: 1;
    }

    /* Sembunyikan tab desktop, tampilkan navigasi tab mobile */
    .tabs {
        display: none;
    }
    .mobile-tab-nav {
        display: flex;
    }

    /* Pusatkan foto di mobile */
    .foto {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    /* Penyesuaian login card di mobile */
    .login-wrapper {
        padding: 1rem; /* Kurangi padding wrapper */
    }
    .login-card-center {
        padding: 1.5rem 1rem; /* Kurangi padding card */
        max-width: 95%; /* Izinkan kartu sedikit lebih lebar */
    }
    .login-logo-section {
        margin-bottom: 1.5rem; /* Kurangi margin bawah logo section */
    }
    .login-logo-section h1.text-yellow {
        font-size: 1.8rem; /* Kecilkan sedikit judul */
    }
    .login-logo-section p {
        font-size: 0.8rem; /* Kecilkan sedikit paragraf */
    }
    .login-card-center .form-group {
        margin-bottom: 1.2rem; /* Kurangi margin bawah form group */
    }
     .login-card-center .form-group label {
        font-size: 0.85rem; /* Kecilkan label */
    }
    .login-card-center .form-control {
        padding-top: 0.6rem; /* Kurangi padding input */
        padding-bottom: 0.4rem;
        font-size: 0.9rem; /* Kecilkan font input */
    }
    .login-card-center .btn-primary {
        font-size: 0.9rem; /* Kecilkan font tombol */
        padding: 0.7rem; /* Kurangi padding tombol */
    }
    .password-toggle {
        right: 0.2rem; /* Geser ikon sedikit ke kiri */
    }
}


.form-control-static {
    padding: 0.75rem 0; /* Sesuaikan dengan padding .form-control */
    margin: 0;
    min-height: calc(1.5em + 1.5rem + 2px); /* Menyamakan tinggi dengan input */
    display: flex;
    align-items: center;
    word-break: break-word;
}

.edit-view {
    display: none;
}

/* =========================================================================
 * SIDEBAR & NAVIGASI BARU
 * ========================================================================= */

/* --- Sidebar Container --- */
.sidebar {
    width: 260px; /* Lebar sidebar sedikit dikurangi agar proporsional */
    background: #fff; /* Pastikan background putih bersih */
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column; /* Susunan vertikal (Atas: Logo/Profil, Tengah: Menu, Bawah: Logout) */
    height: 100vh;
    position: fixed; /* Fixed agar tetap terlihat saat scroll konten utama */
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

/* Sesuaikan margin konten utama agar tidak tertutup sidebar fixed */
.main {
    margin-left: 260px; /* Sama dengan lebar sidebar */
    width: calc(100% - 260px);
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* --- 1. Brand / Logo (Paling Atas) --- */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #fff;
}

.brand img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.brand h3 {
    font-weight: 700;
    font-size: 1rem;
    color: var(--theme-primary-color); /* Menggunakan warna tema */
    margin-bottom: 0;
    line-height: 1.2;
}

/* --- 2. User Profile Section (Di Bawah Logo) --- */
.user-profile-section {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background-color: #fcfcfc; /* Sedikit beda warna */
    border-bottom: 1px solid var(--border-color);
}

.profile-img-container img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid #e2e8f0;
}

.profile-info {
    overflow: hidden;
}

.profile-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: var(--black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: 0.75rem;
    color: var(--muted);
    display: block;
    margin-top: 2px;
}

/* --- 3. Menu Navigasi (Tengah - Scrollable) --- */
.menu {
    flex: 1; /* Mengisi sisa ruang kosong */
    overflow-y: auto; /* Scroll jika menu panjang */
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

/* Scrollbar halus untuk menu */
.menu::-webkit-scrollbar {
    width: 5px;
}
.menu::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 4px;
}

/* Label Kategori Menu (Data Pribadi, Admin, dll) */
.menu-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #888;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 1.2rem 0 0.5rem 0.5rem;
}
/* Hilangkan margin untuk label pertama */
.menu-label:first-child {
    margin-top: 0;
}

/* Link Menu */
.menu-link {
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem;
    color: #555;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.menu-link svg {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

/* Hover State */
.menu-link:hover {
    background-color: #f3f4f6;
    color: var(--theme-primary-color);
    text-decoration: none;
}
.menu-link:hover svg {
    opacity: 1;
}

/* Active State */
.menu-link.active {
    background-color: rgba(0, 77, 64, 0.08); /* Warna tema transparan */
    color: var(--theme-primary-color);
    font-weight: 600;
}
.menu-link.active svg {
    opacity: 1;
    stroke-width: 2.5; /* Ikon sedikit lebih tebal */
}

/* --- 4. Footer Sidebar (Logout - Paling Bawah) --- */
.menu-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background-color: #fff;
}

.logout-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--danger); /* Merah */
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.logout-link svg {
    width: 18px;
    height: 18px;
    margin-right: 12px;
}

.logout-link:hover {
    background-color: #fff1f2; /* Merah sangat muda */
    color: #b91c1c;
    text-decoration: none;
}

/* --- Tombol Toggle Sidebar (Desktop) --- */
/* Tombol panah kecil untuk collapse sidebar di desktop */
.sidebar-toggle-btn {
    position: fixed;
    top: 50%;
    left: 245px; /* Menempel di tepi sidebar */
    width: 24px;
    height: 24px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 101; /* Di atas sidebar */
    transition: left 0.3s ease, transform 0.3s ease;
    font-size: 12px;
    color: var(--muted);
}

.sidebar-toggle-btn:hover {
    background-color: var(--accent);
    color: var(--black);
}

/* --- State: Sidebar Collapsed (Tertutup di Desktop) --- */
.app.sidebar-collapsed .sidebar {
    transform: translateX(-260px); /* Geser sidebar keluar layar kiri */
}

.app.sidebar-collapsed .main {
    margin-left: 0; /* Konten utama melebar penuh */
    width: 100%;
}

.app.sidebar-collapsed .sidebar-toggle-btn {
    left: 10px; /* Tombol menempel di kiri layar */
    transform: rotate(180deg) translateY(-50%); /* Putar panah */
}

/* --- 2. User Profile Section (Di Bawah Logo) --- */
.user-profile-section {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background-color: #fcfcfc;
    border-bottom: 1px solid var(--border-color);
    /* Tambahkan ini untuk memastikan konten tidak melebar */
    overflow: hidden; 
}

/* Container Foto: Ini kuncinya agar ukuran tetap */
.profile-img-container {
    width: 45px;        /* Lebar Pasti */
    height: 45px;       /* Tinggi Pasti */
    min-width: 45px;    /* Mencegah mengecil */
    margin-right: 12px; /* Jarak ke teks */
    border-radius: 50%; /* Membuat lingkaran */
    overflow: hidden;   /* Memotong gambar yang kotak */
    border: 2px solid #e2e8f0; /* Garis tepi */
    display: flex;      /* Membantu pemusatan */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;     /* PENTING: Mencegah foto gepeng/mengecil */
}

/* Gambar di dalam container */
.profile-img-container img {
    width: 100%;        /* Mengikuti ukuran container */
    height: 100%;       /* Mengikuti ukuran container */
    object-fit: cover;  /* Memastikan foto zoom-in & tidak gepeng */
    display: block;
    margin: 0;          /* Reset margin bawaan jika ada */
    border: none;       /* Border sudah di container */
}

.profile-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden; /* Mencegah teks panjang merusak layout */
}

.profile-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: var(--black);
    white-space: nowrap;      /* Teks satu baris */
    overflow: hidden;         /* Sembunyikan kelebihan teks */
    text-overflow: ellipsis;  /* Tambahkan '...' jika nama kepanjangan */
    line-height: 1.2;
}

.profile-role {
    font-size: 0.75rem;
    color: var(--muted);
    display: block;
    margin-top: 2px;
}

/* =========================================================================
 * RESPONSIVE (MOBILE)
 * ========================================================================= */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%); /* Default sembunyi di mobile */
        width: 260px; /* Lebar tetap */
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.sidebar-mobile-visible {
        transform: translateX(0); /* Tampilkan saat toggle diklik */
    }

    .main {
        margin-left: 0; /* Di mobile, konten selalu full width */
        width: 100%;
        padding-top: 4rem; /* Ruang untuk tombol hamburger */
    }

    /* Sembunyikan tombol toggle desktop di mobile */
    .sidebar-toggle-btn {
        display: none;
    }

    /* Tombol Hamburger Mobile */
    .mobile-menu-toggle {
        display: flex; /* Munculkan */
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 6px;
        padding: 6px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    .mobile-menu-toggle svg {
        width: 24px;
        height: 24px;
        stroke: #333;
    }
}

