/* General Body and Layout (Untuk dashboard admin secara umum) */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f5f8; /* Lighter background for body */
    display: flex;
    min-height: 100vh; /* Ensure full viewport height */
    color: #333; /* Default text color */
    flex-direction: column; /* For overall page structure */
}

/* --- Login Page Specific Styles --- */
/* Kelas ini akan diterapkan ke body di login.php */
body.login-page-body {
    background: linear-gradient(to right, #fff, #fff); /* Latar belakang yang Anda inginkan untuk login */
    display: flex; /* Meng-override display: flex; dari body umum untuk menengahkan */
    flex-direction: column;
    justify-content: space-between; /* Untuk mendorong footer ke bawah */
    align-items: center; /* Untuk menengahkan container login secara horizontal */
    padding: 20px; /* Padding di sekitar body */
    box-sizing: border-box; /* Pastikan padding tidak menambah lebar */
    /* min-height: 100vh sudah ada di body umum, biarkan */
}

.login-container {
    background-color: #1D8A6B;
    padding: 40px;
    border-radius: 10px;
    width: fit-content; /* Lebar sesuai konten */
    height: fit-content; /* Tinggi sesuai konten */
    max-width: 500px;
    text-align: center;
    animation: fadeIn 1s ease-in-out;
    margin: auto; /* Untuk menengahkan container secara vertikal dan horizontal */
    display: flex; /* Untuk layout internal container */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
    box-sizing: border-box;
    flex-grow: 1; /* Penting agar container login bisa meregang dan menengahkan secara vertikal */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-container h2 {
    color: #fff;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

/* Form Group Styles untuk Login */
.login-page-body .form-group { /* Menargetkan form-group di halaman login */
    margin-bottom: 20px;
    text-align: left;
    width: 100%;
}

.login-page-body .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

.login-page-body .form-group input[type="text"],
.login-page-body .form-group input[type="password"] {
    width: calc(100% - 20px); /* Sesuaikan untuk padding */
    padding: 12px 10px;
    border: 1px solid #fff;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box; /* Penting untuk width calc */
}

.login-page-body .form-group input[type="text"]:focus,
.login-page-body .form-group input[type="password"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Button Styles untuk Login */
.login-page-body button[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    margin-top: 15px;
}

.login-page-body button[type="submit"]:hover {
    background-color: #007bff; /* Warna hover sama dengan normal jika tidak ada perubahan spesifik */
    transform: translateY(-2px);
}

/* Error Message Styles (ini untuk login saja, bukan alert umum) */
.error-message {
    color: #dc3545 !important; /* Force red for error messages */
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 15px;
}

/* --- Dashboard Wrapper (Main Layout Container) --- */
.dashboard-wrapper {
    display: flex;
    width: 100%;
    flex-grow: 1;
}

/* --- Sidebar --- */
.sidebar {
    width: 280px;
    background-color: #ffffff;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    padding: 20px 0;
    box-sizing: border-box;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 99;
    padding-top: 20px;
}

.sidebar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.sidebar-header .logo img {
    max-width: 85%;
    height: auto;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0 20px;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: #5a6a85;
    border-radius: 7px;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 0.95em;
    font-weight: 500;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: #ecf2ff;
    color: #5d87ff;
}

.sidebar-nav a i {
    margin-right: 12px;
    font-size: 1.1em;
}

.nav-caption {
    font-size: 0.8em;
    color: #8a96b1;
    text-transform: uppercase;
    padding: 15px 20px 5px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

/* --- Main Content Area --- */
.main-content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-left: 280px;
    box-sizing: border-box;
    padding-top: 80px;
}

.content-body {
    flex-grow: 1;
    padding: 30px;
    background-color: #f4f5f8;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Header (Top Navbar) --- */
.main-header {
    background-color: #1D8A6B;
    padding: 15px 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: fixed;
    width: calc(100% - 280px);
    top: 0;
    right: 0;
    z-index: 98;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 80px;
}

.header-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

.header-nav-left, .header-nav-right {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

.header-nav-right li {
    margin-left: 20px;
}

.profile-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    cursor: pointer;
}

.profile-avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
    transition: border-color 0.3s ease;
}

.profile-avatar:hover {
    border-color: #5d87ff;
}

.logout-button {
    display: block;
    padding: 10px 20px;
    background-color: #dc3545;
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 0 0 8px 8px;
    transition: background-color 0.2s ease;
}

.logout-button:hover {
    background-color: #c82333;
}


/* --- Card and Table Styling --- */
.dashboard-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 0;
}

.dashboard-full-width-card {
    width: 100%;
    flex: 1;
}

.card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.card-body {
    padding: 30px;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.card-title {
    color: #2a3547;
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
}

.card-header-select select {
    padding: 10px 18px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #f9fbfd;
    font-size: 0.95em;
    color: #5a6a85;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235a6a85'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    cursor: pointer;
}

.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0;
    font-size: 0.9em;
    background-color: #ffffff;
}

.data-table th, .data-table td {
    border: 1px solid #e0e0e0;
    padding: 14px 18px;
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}

.data-table thead {
    background-color: #f8f9fa;
}

.data-table tbody tr:nth-child(even) {
    background-color: #fcfdfe;
}

.data-table tbody tr:hover {
    background-color: #f0f4f7;
    cursor: pointer;
}

.doc-thumbnail {
    display: block;
    max-width: 60px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* --- Footer (untuk halaman admin secara umum) --- */
.main-footer {
    text-align: center;
    color: #fff;
    padding: 20px;
    margin-top: 30px; /* Jika diletakkan di akhir body flex column */
    background-color: #1D8A6B;
    border-top: 1px solid #fff;
    flex-shrink: 0;
    box-sizing: border-box;
    width: 100%; /* Pastikan footer mengambil lebar penuh */
}
.main-footer p {
    margin: 0;
    font-size: 0.9em;
    color: #fff;
}


/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .dashboard-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        padding-top: 20px;
    }

    .main-content-area {
        margin-left: 0;
        padding-top: 0;
    }

    .main-header {
        width: 100%;
        position: relative;
        top: 0;
        box-shadow: none;
    }

    .card-header-flex {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-header-select {
        margin-top: 15px;
    }

    /* Responsive untuk halaman login */
    .login-container {
        padding: 30px;
        max-width: 90%;
    }
    .login-container h2 {
        font-size: 24px;
    }
    .form-group input {
        font-size: 14px;
        padding: 10px;
    }
    button[type="submit"] {
        font-size: 16px;
        padding: 10px 20px;
    }
}

@media (max-width: 768px) {
    .content-body {
        padding: 15px;
    }

    .card-title {
        font-size: 1.6em;
    }

    .data-table th, .data-table td {
        padding: 10px;
        font-size: 0.8em;
    }

    .button {
        padding: 8px 12px;
        font-size: 0.8em;
    }

    .main-header {
        padding: 10px 15px;
        height: 70px;
    }

    .profile-avatar {
        width: 30px;
        height: 30px;
    }

    .profile-dropdown {
        top: 60px;
        right: 15px;
    }
}

/* --- Styling untuk elemen form dasar di admin dashboard (Baru/Diperbarui) --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2a3547;
}

/* Gaya dasar untuk input teks, number, select, textarea */
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1em;
    color: #495057;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box; /* Penting */
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control-file { /* Untuk input type="file" */
    display: block;
    width: 100%;
    padding: 12px 0; /* Sesuaikan padding untuk input file */
    color: #495057;
}

textarea.form-control {
    resize: vertical; /* Izinkan textarea di-resize vertikal */
}

/* --- Styling untuk tombol di admin dashboard --- */
/* (Bagian ini sudah ada di atas, pastikan tidak duplikat di bagian lain) */
.button {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
    font-weight: 500;
}

.primary-button {
    background-color: #5d87ff; /* Warna biru konsisten */
    color: white;
    box-shadow: 0 4px 10px rgba(93, 135, 255, 0.3);
}

.primary-button:hover {
    background-color: #456af0;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(93, 135, 255, 0.4);
}

.danger-button { /* Untuk tombol hapus */
    background-color: #dc3545; /* Merah */
    color: white;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

.danger-button:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(220, 53, 69, 0.4);
}

/* --- Alert Styles --- */
.alert {
  padding: 15px 20px;
  margin-bottom: 20px; /* Jarak bawah alert dari elemen berikutnya */
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  opacity: 1; /* Pastikan alert terlihat pada awalnya */
  transition: opacity 0.5s ease-out; /* Animasi fade-out */
}

.alert-success {
  background-color: #d1e7dd;
  color: #0f5132;
  border: 1px solid #badbcc;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}