/* Import Font Poppins dari Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #008060; /* Hijau Tua Unkhair */
    --primary-light: #00a86b; /* Hijau Muda */
    --primary-hover: #006a50;
    --secondary-color: #f0f2f5; /* Latar belakang abu-abu muda */
    --text-color: #333;
    --border-color: #ddd;
    --success-color: #28a745;
    --danger-color: #dc3545;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

.login-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-card .card-body {
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header img {
    max-width: 80px;
    margin-bottom: 1rem;
}

.login-header h3 {
    color: var(--primary-color);
    font-weight: 600;
}

.login-header p {
    color: #6c757d;
    font-size: 0.9rem;
}

.btn {
    border-radius: 50px; /* Membuat sudut sangat bulat (kapsul) */
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-size: 0.9rem; /* Memperkecil ukuran font */
    font-weight: 600;
    transition: all 0.3s ease; /* Menambahkan transisi halus */
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.form-control {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

/* === DASHBOARD LAYOUT === */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: #fff;
    flex-shrink: 0; /* Mencegah sidebar menyusut */
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    transition: width 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--secondary-color);
}
.sidebar-header img {
    max-width: 40px;
    margin-right: 1rem;
}
.sidebar-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--primary-color);
} 
.sidebar-header .logo-text {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.sidebar-menu {
    padding: 1rem 0;
}
.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #555;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}
.sidebar-menu .nav-link:hover {
    color: var(--primary-color);
    background-color: var(--secondary-color);
}
.sidebar-menu .nav-link.active {
    color: var(--primary-color);
    background-color: #e6f2ef;
    border-left-color: var(--primary-color);
}
.sidebar-menu .nav-link i {
    margin-right: 1rem;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}
.sidebar-menu .nav-link span {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 1;
    visibility: visible;
}

/* Sidebar Collapsed State */
.sidebar.sidebar-collapsed {
    width: 80px;
}

.sidebar.sidebar-collapsed .sidebar-header {
    justify-content: center;
}

.sidebar.sidebar-collapsed .sidebar-header img {
    margin-right: 0;
}

.sidebar.sidebar-collapsed .sidebar-header .logo-text {
    opacity: 0;
    visibility: hidden;
    position: absolute; /* Mencegah teks memakan ruang saat disembunyikan */
}

.sidebar.sidebar-collapsed .sidebar-menu .nav-link {
    justify-content: center;
}

.sidebar.sidebar-collapsed .sidebar-menu .nav-link span {
    opacity: 0;
    visibility: hidden;
    position: absolute; /* Mencegah span memakan ruang saat disembunyikan */
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}
.header #sidebar-toggle {
    color: white;
    padding: 0 0.5rem;
    margin-left: -1rem;
}

.user-profile .fw-bold {
    color: #fff;
}
.user-profile .text-muted {
    color: #e0e0e0 !important;
    opacity: 0.9;
}
.user-profile .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}

.profile-user-img {
    border-radius: 50% !important; /* Memastikan gambar menjadi lingkaran sempurna */
    border: 3px solid #adb5bd;
    padding: 3px;
}
.content-body {
    padding: 2rem;
    flex-grow: 1;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.footer {
    padding: 1rem 2rem;
    background-color: #fff;
    border-top: 1px solid var(--secondary-color);
    font-size: 0.9rem;
    color: #6c757d;
}

/* === BREADCRUMB === */
.breadcrumb {
    background-color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 0;
}
.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.breadcrumb-item a:hover {
    color: var(--primary-hover);
}
.breadcrumb-item.active {
    color: #6c757d;
}
.breadcrumb-item+.breadcrumb-item::before {
    color: var(--primary-light);
}

/* === RESPONSIVE DESIGN === */

/* Overlay untuk mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Tampilan Tablet dan Mobile */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -260px; /* Sembunyikan di luar layar */
        height: 100%;
        transition: left 0.3s ease;
    }

    .sidebar.sidebar-mobile-show {
        left: 0; /* Tampilkan sidebar */
    }

    /* Saat sidebar mobile terbuka, konten utama tidak bisa di-scroll */
    body.sidebar-open {
        overflow: hidden;
    }

    .main-content {
        transition: none; /* Hapus transisi margin-left di mobile */
    }
}