/* ==================== VARIABEL WARNA & FONT ==================== */
:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #95a5a6;
    --secondary-dark: #7f8c8d;
    --success-color: #2ecc71;
    --success-dark: #27ae60;
    --warning-color: #f39c12;
    --warning-dark: #e67e22;
    --danger-color: #e74c3c;
    --danger-dark: #c0392b;
    
    --light-bg: #f0f2f5;
    --white: #ffffff;
    --dark-text: #2c3e50;
    --muted-text: #7f8c8d;
    --border-color: #dce1e3;
    --table-hover: #f8f9fa;

    --font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --border-radius: 10px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --sidebar-width: 250px;
}

/* ==================== RESET & GAYA DASAR ==================== */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--light-bg);
    color: var(--dark-text);
    margin: 0;
    padding: 0;
    font-size: 18px;
    line-height: 1.6;
}

/* ==================== LAYOUT UTAMA DASHBOARD (SIDEBAR) ==================== */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

#sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 999;
    background: #343a40;
    color: #fff;
    transition: all 0.3s;
    overflow-y: auto;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: #495057;
    text-align: center;
}

#sidebar .sidebar-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.5em;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 15px;
    font-size: 1.1em;
    display: block;
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.3s;
}

#sidebar ul li a:hover {
    color: #fff;
    background: #495057;
}

#sidebar ul li.active > a {
    color: #fff;
    background: #2a2e32;
}

/* Gaya khusus untuk item logout */
#sidebar .logout-item {
    margin-top: 20px; /* Beri jarak dari menu di atasnya */
    border-top: 1px solid #47748b; /* Garis pemisah */
}

#sidebar .logout-item a {
    color: #f8d7da; /* Warna merah muda untuk menandai logout */
    font-weight: bold;
}

#sidebar .logout-item a:hover {
    background-color: var(--danger-color); /* Warna merah saat hover */
    color: var(--white);
}


/* Konten Utama Halaman */
.dashboard-content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    /* PERBAIKAN: Padding dikurangi agar konten lebih ke atas dan melebar */
    padding: 1rem !important;
    transition: all 0.3s;
}

/* PERBAIKAN: Pembungkus konten agar lebih lebar dan tetap di tengah */
.content-inner {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 1.5rem; /* Beri sedikit jarak di dalam agar tidak mepet */
    /*max-width: 1600px; /* PERUBAHAN: Diperbesar dari 1200px */
    margin-left: 0;
    margin-right: auto; /* atau 0 */
    /*margin: 0 auto; /* PERUBAHAN: Diaktifkan kembali agar tetap di tengah */
    background-color: var(--white);
    padding: 40px; /* PERUBAHAN: Diaktifkan kembali untuk jarak dalam */
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}


/* ==================== KOMPONEN ==================== */
h1, h2, h3 {
    color: var(--dark-text);
    font-weight: 600;
    margin-top: 0;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.5em; }

hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--border-color), rgba(0, 0, 0, 0));
    margin: 30px 0;
}

/* --- KOMPONEN FORM --- */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-text);
    font-size: 1em;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
    font-family: var(--font-family);
    transition: var(--transition);
    background-color: var(--white);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* --- KOMPONEN TOMBOL --- */
button, .btn {
    padding: 15px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    font-family: var(--font-family);
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    line-height: 1.4;
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
}

button:disabled, .btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.btn-success { background-color: var(--success-color); color: var(--white); }
.btn-success:hover { background-color: var(--success-dark); }

.btn-primary { background-color: var(--primary-color); color: var(--white); }
.btn-primary:hover { background-color: var(--primary-dark); }

.btn-secondary { background-color: var(--secondary-color); color: var(--white); }
.btn-secondary:hover { background-color: var(--secondary-dark); }

/* --- KOMPONEN TABEL --- */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: var(--white);
}

th, td {
    padding: 18px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
}

thead th {
    background-color: var(--dark-text);
    color: var(--white);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:nth-of-type(even) {
    background-color: #f8f9fa;
}

tbody tr:hover {
    background-color: var(--table-hover);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* --- KOMPONEN MODAL --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background-color: var(--white);
    margin: 3% auto;
    padding: 0;
    border: none;
    width: 95%;
    max-width: 900px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideIn 0.4s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
    padding: 25px;
    background-color: var(--dark-text);
    color: var(--white);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: var(--white);
}

.close {
    color: var(--white);
    font-size: 30px;
    font-weight: 300;
    cursor: pointer;
    line-height: 20px;
    transition: var(--transition);
}
.close:hover, .close:focus { color: #ccc; transform: rotate(90deg); }

.modal-body { padding: 30px; }
.modal-footer {
    padding: 20px 25px;
    background-color: #f8f9fa;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    text-align: right;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
}

/* --- MODAL GAMBAR --- */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease-out;
}

.modal-content-image {
    position: relative;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 900px;
    animation: slideIn 0.4s ease-out;
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.modal-close:hover, .modal-close:focus { color: #bbb; }

/* ==================== GAYA KHUSUS HALAMAN ==================== */

/* --- GAYA UNTUK LOGIN PAGE --- */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--light-bg);
}

.login-container {
    background-color: var(--white);
    padding: 50px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.login-container h2 {
    margin-bottom: 25px;
    color: var(--dark-text);
    font-size: 28px;
}

.login-button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

/* --- GAYA UNTUK DRD CONTENT --- */
.drd-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 25px;
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.drd-content table { width: 100%; border-collapse: collapse; margin-top: 0; }
.drd-content th, .drd-content td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #ddd; }
.drd-content thead th { background-color: #343a40; color: white; font-weight: 600; }
.drd-content tbody tr:nth-of-type(even) { background-color: #f8f9fa; }
.drd-content tbody tr:hover { background-color: #e9ecef; }

/* --- GAYA UNTUK BARIS TOTAL --- */
.total-row {
    font-weight: bold;
    background-color: #e9ecef;
    border-top: 2px solid var(--dark-text);
}
.total-row td {
    padding: 15px;
    color: var(--dark-text);
}

/* ==================== UTILITAS ==================== */
.text-center {
    text-align: center;
    color: var(--muted-text);
    font-style: italic;
    font-size: 1.1em;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    font-size: 16px;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    #sidebar {
        position: relative;
        width: 100%;
        height: auto;
        margin-bottom: 0;
    }

    .dashboard-content {
        width: 100%;
        margin-left: 0;
        padding: 20px; /* Padding dikurangi di layar kecil */
    }
    
    /* PERBAIKAN: Inner container tidak perlu max-width di layar kecil */
    .content-inner {
        max-width: 100%;
        padding: 20px;
    }

    .dashboard-wrapper {
        flex-direction: column;
    }
    
    .login-container, .modal-content { width: 98%; padding: 20px; border-radius: 0; }
    th, td { padding: 12px 10px; font-size: 14px; }
    .drd-filter-form { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.8em; }
    button, .btn { width: 100%; }
    .modal-header { padding: 15px 20px; }
    .modal-body, .modal-footer { padding: 20px; }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .no-print, #sidebar {
        display: none !important;
    }
    .dashboard-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body {
        background: #fff !important;
        font-size: 10pt;
    }
    .dashboard-wrapper, .dashboard-container {
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .table-container {
        box-shadow: none;
    }
    table {
        border-collapse: collapse;
        width: 100%;
    }
    th, td {
        border: 1px solid #000 !important;
        padding: 5px !important;
    }
    th {
        background-color: #f2f2f2 !important;
    }
    .total-row {
        background-color: #e9ecef !important;
    }
    h2 {
        text-align: center;
    }
}

/* --- Gaya untuk Status Standarisasi --- */
.status-baru {
    background-color: #d4edda; /* Hijau Muda */
    color: #155724;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

.status-proses {
    background-color: #fff3cd; /* Kuning Muda */
    color: #856404;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

/* ==================== GAYA MODAL POP-UP ==================== */

/* Overlay latar belakang */
.modal {
    display: none; /* Tersembunyi secara default */
    position: fixed; /* Tetap di tempat meski di-scroll */
    z-index: 1000; /* Berada di atas konten lainnya */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Aktifkan scroll jika diperlukan */
    background-color: rgba(0,0,0,0.6); /* Warna hitam dengan opacity */
}

/* Konten Modal */
.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 5% dari atas, dan auto horizontal untuk menengahkan */
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

/* Tombol Tutup (X) */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Gaya Form di dalam Modal */
.modal-form .form-group {
    margin-bottom: 15px;
}

.modal-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* Gaya untuk daftar checklist */
.checklist-group {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
}

.checklist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item .radio-group {
    display: flex;
    gap: 20px; /* Jarak antara Y dan N */
}

.radio-group label {
    font-weight: normal;
    cursor: pointer;
}

/* Gaya Tombol di Footer Modal */
.modal-footer {
    text-align: right;
    margin-top: 20px;
}

.modal-footer .btn {
    margin-left: 10px;
}

/* Baris tabel yang bisa diklik */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover {
    background-color: #e9ecef;
}

/* --- Style untuk Dropzone --- */
.dropzone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    background-color: #f9f9f9;
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.dropzone:hover, .dropzone.drag-over {
    border-color: #007bff;
    background-color: #e9f5ff;
    color: #007bff;
}

.dropzone .dz-message p {
    margin: 0;
    font-size: 16px;
}

.dropzone .file-list {
    margin-top: 15px;
    text-align: left;
}

.dropzone .file-item {
    background-color: #e9ecef;
    padding: 5px 10px;
    border-radius: 4px;
    margin-bottom: 5px;
    font-size: 14px;
    color: #495057;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropzone .file-item .remove-file {
    color: #dc3545;
    cursor: pointer;
    font-weight: bold;
}