/*
=================================
File: style.css
Fungsi: Mengatur seluruh tampilan dan layout aplikasi.
=================================
*/

/* --- 1. GLOBAL, VARIABEL & RESET --- */
:root {
    --primary-color: #4a6cf7;
    --dark-color: #1e293b;
    --dark-secondary-color: #2d3748;
    --grey-color: #64748b;
    --light-grey-color: #e2e8f0;
    --background-color: #f8fafc;
    --white-color: #ffffff;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
    --font-family: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* --- 2. LAYOUT UTAMA (SIDEBAR & KONTEN) --- */
.app-layout {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--dark-color);
    color: var(--white-color);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    transition: width 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 1rem 0.5rem;
    color: var(--primary-color);
}

.sidebar-menu {
    list-style: none;
    flex-grow: 1;
    margin-top: 2rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    color: #a0aec0;
    text-decoration: none;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background-color: var(--dark-secondary-color);
    color: var(--white-color);
}

.sidebar-link.active {
    background-color: var(--primary-color);
    color: var(--white-color);
    font-weight: 500;
}

.sidebar-link i {
    font-size: 1.25rem;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0.5rem;
    border-top: 1px solid var(--dark-secondary-color);
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 600; }
.user-role { font-size: 0.8rem; color: #a0aec0; }
.logout-button { color: #a0aec0; font-size: 1.5rem; text-decoration: none; transition: color 0.2s ease; }
.logout-button:hover { color: var(--danger-color); }
.main-content-wrapper { flex-grow: 1; overflow-y: auto; padding: 2rem; }
.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.content-header h1 { font-size: 1.75rem; }
.loader { display: flex; justify-content: center; align-items: center; font-size: 1.5rem; color: var(--grey-color); gap: 1rem; height: 50vh; }

/* --- 3. KOMPONEN UMUM (KARTU, TOMBOL, FORM) --- */
.card { background-color: var(--white-color); border-radius: var(--border-radius); box-shadow: var(--box-shadow); padding: 1.5rem; margin-bottom: 2rem; }
.card h2 { font-size: 1.25rem; margin-bottom: 1.5rem; color: var(--dark-color); display: flex; align-items: center; gap: 0.5rem; }
.button-primary { background-color: var(--primary-color); color: var(--white-color); padding: 0.6rem 1.2rem; text-decoration: none; border: none; border-radius: var(--border-radius); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; transition: background-color 0.3s ease; }
.button-primary:hover { background-color: #3556e0; }
.button-submit { background-color: var(--success-color); color: var(--white-color); padding: 0.75rem 1.5rem; border: none; border-radius: var(--border-radius); cursor: pointer; font-size: 1rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.5rem; transition: background-color 0.3s ease; }
.button-submit:hover { background-color: #16a34a; }
.button-delete { background: #fee2e2; color: var(--danger-color); border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: all 0.3s ease; }
.button-delete:hover { background: var(--danger-color); color: var(--white-color); }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--grey-color); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.75rem; border: 1px solid var(--light-grey-color); border-radius: var(--border-radius); font-family: var(--font-family); font-size: 1rem; transition: all 0.3s ease; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.2); }
.form-grid { display: grid; gap: 1rem; }

/* --- 4. MODAL & NOTIFIKASI --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(30, 41, 59, 0.5); display: flex; justify-content: center; align-items: center; z-index: 2000; padding: 1rem; }
.modal-content { background: var(--white-color); border-radius: var(--border-radius); width: 100%; max-width: 500px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); animation: slide-down 0.3s ease-out; }
@keyframes slide-down { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--light-grey-color); }
.modal-header h2 { font-size: 1.2rem; margin: 0; }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--grey-color); }
.modal-body { padding: 1.5rem; }
.form-actions { text-align: right; margin-top: 1rem; }
.alert { padding: 1rem; border-radius: var(--border-radius); margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; font-weight: 500; }
.alert-success { background-color: #d1fae5; color: #059669; }
.alert-danger { background-color: #fee2e2; color: #b91c1c; }

/* --- 5. HALAMAN SPESIFIK --- */
.login-card { max-width: 400px; width: 100%; margin: auto; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; align-items: flex-start; }
.summary-main .welcome-message h1 { font-size: 2rem; font-weight: 600; }
.summary-main .welcome-message p { font-size: 1rem; color: var(--grey-color); margin-top: 0.5rem; }
.highlight-card { background: linear-gradient(135deg, var(--primary-color) 0%, #3049b0 100%); color: var(--white-color); padding: 1.5rem 2rem; border-radius: var(--border-radius); margin: 2rem 0; display: flex; align-items: center; gap: 1.5rem; box-shadow: 0 10px 20px -5px rgba(74, 108, 247, 0.4); }
.highlight-icon { font-size: 3rem; opacity: 0.8; }
.highlight-info { display: flex; flex-direction: column; }
.highlight-number { font-size: 2.5rem; font-weight: 700; line-height: 1; }
.highlight-label { font-size: 1rem; opacity: 0.9; }
.secondary-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.secondary-stat-card { display: flex; align-items: center; gap: 1rem; background-color: var(--white-color); padding: 1rem; border-radius: var(--border-radius); border: 1px solid var(--light-grey-color); }
.secondary-stat-card i { font-size: 1.5rem; }
.quick-actions { margin-top: 2rem; }
.summary-chart .card { height: 100%; }
.user-management-layout { display: flex; gap: 2rem; align-items: flex-start; }
.form-card-user { flex: 1; min-width: 300px; }
.user-list-card { flex: 2; }
.filter-form .form-grid { margin-top: 1rem; }
.date-range { display: flex; align-items: center; gap: 1rem; }
.report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.report-header h2 { margin-bottom: 0; }
.report-actions { display: flex; gap: 1rem; }

/* --- 6. GAYA TABEL JADWAL VERTIKAL --- */
.table-section-header { margin-bottom: 1rem !important; }
.table-section-header i { font-size: 1.25rem; vertical-align: middle; margin-right: 0.5rem; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--light-grey-color); vertical-align: middle; }
thead th { background-color: #f8fafc; font-weight: 600; color: var(--grey-color); text-transform: uppercase; font-size: 0.8rem; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background-color: #f8fafc; }
.empty-data { text-align: center; padding: 2rem; color: var(--grey-color); }
.task-title-table { font-weight: 600; color: var(--dark-color); }
.task-date-table { font-size: 0.85rem; color: var(--grey-color); margin-top: 4px; }
.task-date-table.deadline-soon { color: var(--warning-color); font-weight: 500; }
.task-date-table.deadline-overdue { color: var(--danger-color); font-weight: 500; }
.priority-tag-table { padding: 0.2rem 0.8rem; font-size: 0.8rem; font-weight: 600; color: var(--white-color); border-radius: 15px; text-align: center; }
.priority-tag-table.priority-tinggi { background-color: var(--danger-color); }
.priority-tag-table.priority-normal { background-color: var(--primary-color); }
.priority-tag-table.priority-rendah { background-color: var(--success-color); }
.task-avatars { display: flex; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background-color: var(--primary-color); color: var(--white-color); display: flex; justify-content: center; align-items: center; font-size: 0.8rem; font-weight: 600; border: 2px solid var(--white-color); margin-left: -10px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.avatar:first-child { margin-left: 0; }
.task-action-btn { font-size: 0.85rem !important; padding: 0.4rem 0.8rem !important; }

/* --- 7. RESPONSIVE & PRINT --- */
@media print {
    body { background-color: #fff; }
    .sidebar, .content-header, .filter-form, .report-actions, .card h2 { display: none !important; }
    .app-layout { display: block; }
    .main-content-wrapper { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    @page { size: A4 landscape; margin: 20mm; }
}
@media (max-width: 768px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; flex-direction: row; justify-content: space-between; }
    .sidebar-menu { display: flex; gap: 0.5rem; margin-top: 0; }
    .sidebar-link span { display: none; }
    .sidebar-header span { display: none; }
    .sidebar-footer .user-info { display: none; }
    .main-content-wrapper { padding: 1rem; }
    .content-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .user-management-layout { flex-direction: column; }
    thead { display: none; }
    tr { display: block; margin-bottom: 1rem; border: 1px solid var(--light-grey-color); border-radius: var(--border-radius); }
    td { display: block; text-align: right !important; position: relative; padding-left: 50%; border-bottom: 1px solid var(--light-grey-color); }
    td:last-child { border-bottom: none; }
    td::before { content: attr(data-label); position: absolute; left: 10px; width: calc(50% - 20px); padding-right: 10px; font-weight: 600; text-align: left; color: var(--dark-color); }
    td:first-child { padding-left: 1rem; text-align: left !important; font-weight: bold; background-color: #f8fafc; }
    td:first-child::before, td:last-child::before { content: ""; }
}
/* Gaya untuk Keterangan di dalam Tabel */
.task-description-table {
    font-size: 0.85rem;
    color: var(--grey-color);
    margin-top: 6px;
    margin-bottom: 6px;
    padding-left: 10px;
    border-left: 2px solid var(--light-grey-color);
    white-space: pre-wrap; /* Memastikan baris baru di keterangan ditampilkan */
}
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.button-edit {
    background: #eef2ff;
    color: var(--primary-color);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}
.button-edit:hover {
    background: var(--primary-color);
    color: var(--white-color);
}
/* === REDESIGNED SUMMARY PAGE STYLES === */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    align-items: flex-start;
}

.summary-main .welcome-message h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--dark-color);
}
.summary-main .welcome-message p {
    font-size: 1rem;
    color: var(--grey-color);
    margin-top: 0.5rem;
}

.highlight-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3049b0 100%);
    color: var(--white-color);
    padding: 1.5rem 2rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 10px 20px -5px rgba(74, 108, 247, 0.4);
}
.highlight-icon {
    font-size: 3rem;
    opacity: 0.8;
}
.highlight-info {
    display: flex;
    flex-direction: column;
}
.highlight-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}
.highlight-label {
    font-size: 1rem;
    opacity: 0.9;
}

.secondary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.secondary-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--white-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--light-grey-color);
}
.secondary-stat-card i {
    font-size: 1.5rem;
}

.quick-actions {
    margin-top: 2rem;
}

.summary-chart .card {
    height: 100%;
}
<style>
/* === REPORTING PAGE STYLES === */
.filter-form .form-grid {
    margin-top: 1rem;
}
.date-range {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.report-header h2 {
    margin-bottom: 0;
}
.report-actions {
    display: flex;
    gap: 1rem;
}

/* === PRINT STYLES === */
@media print {
    body {
        background-color: #fff !important;
        -webkit-print-color-adjust: exact; /* Penting untuk warna di Chrome */
        print-color-adjust: exact;
    }
    .sidebar, .content-header, .card:first-of-type, .report-actions, .swal2-container {
        display: none !important;
    }
    .app-layout {
        display: block;
    }
    .main-content-wrapper {
        padding: 0;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        margin: 0;
        padding: 0;
    }
    @page {
        size: A4 landscape;
        margin: 20mm;
    }
    #laporan-area {
        display: block !important;
    }
    #laporan-area h2 {
        text-align: center;
        margin-bottom: 1.5rem;
    }
}
</style>

