
/* style.css */
:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --secondary-color: #6c757d;
    --secondary-hover: #5c636a;
    --status-open-bg: #d1e7dd;
    --status-open-text: #0f5132;
    --status-upcoming-bg: #cff4fc;
    --status-upcoming-text: #055160;
    --status-closed-bg: #f8d7da;
    --status-closed-text: #842029;
    --body-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --hover-bg: #f1f3f5;
    --main-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition-speed: 0.2s;
}

body {
    font-family: var(--main-font);
    background-color: var(--body-bg);
    color: var(--text-dark);
    margin: 0;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    box-sizing: border-box;
}

/* 2. LAYOUT & KOMPONEN UTAMA */
.container { max-width: 1200px; margin: 0 auto; }
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
}
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}
.header-title { margin: 0; font-size: 1.75rem; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 15px; }
.info-bar {
    background-color: #e7f1ff;
    border: 1px solid #b6d4fe;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #0a58ca;
}
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}
.page-title { font-size: 1.5rem; font-weight: 600; margin: 0; }
.action-bar-group { display: flex; align-items: center; gap: 20px; }

/* 3. ELEMEN INTERAKTIF (Tombol, Link, Filter) */
.btn {
    padding: 10px 16px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-speed) ease-in-out;
}
.btn-primary { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-hover); border-color: var(--primary-hover); }
.btn-secondary { background-color: var(--secondary-color); color: white; border-color: var(--secondary-color); }
.btn-secondary:hover { background-color: var(--secondary-hover); }
.task-link { color: var(--primary-color); font-weight: 500; text-decoration: none; }
.task-link:hover { text-decoration: underline; color: var(--primary-hover); }
.filter-nav { display: flex; gap: 10px; }
.filter-nav a {
    padding: 6px 14px; text-decoration: none; font-weight: 700; font-size: 0.8rem;
    border-radius: 9999px; border: 1.5px solid; transition: all var(--transition-speed) ease-in-out;
}
.filter-nav a.filter-open { background-color: var(--status-open-bg); color: var(--status-open-text); border-color: var(--status-open-text); }
.filter-nav a.filter-upcoming { background-color: var(--status-upcoming-bg); color: var(--status-upcoming-text); border-color: var(--status-upcoming-text); }
.filter-nav a.filter-closed { background-color: var(--status-closed-bg); color: var(--status-closed-text); border-color: var(--status-closed-text); }
.filter-nav a.active { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); }
.filter-nav a:not(.active):hover { opacity: 0.8; }

/* 4. GAYA TABEL */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
thead { background-color: var(--hover-bg); }
tbody tr:hover { background-color: var(--hover-bg); }
.kolom-deskripsi { max-width: 350px; word-wrap: break-word; }
.status {
    padding: 5px 12px; border-radius: 9999px; font-size: 0.8rem;
    font-weight: 700; white-space: nowrap;
}
.status-open { background-color: var(--status-open-bg); color: var(--status-open-text); }
.status-upcoming { background-color: var(--status-upcoming-bg); color: var(--status-upcoming-text); }
.status-closed { background-color: var(--status-closed-bg); color: var(--status-closed-text); }
.text-center { text-align: center; }
.action-links { white-space: nowrap; }
.action-links a {
    color: var(--primary-color); text-decoration: none; font-weight: 600;
    margin-right: 15px; transition: color var(--transition-speed);
}
.action-links a:hover { color: var(--primary-hover); text-decoration: underline; }

/* 5. GAYA FORM */
.task-form .form-group { margin-bottom: 16px; }
.task-form label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.task-form input[type="text"],
.task-form input[type="datetime-local"],
.task-form-select {
    width: 100%; padding: 10px; border: 1px solid var(--border-color);
    border-radius: var(--border-radius); box-sizing: border-box;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}
.task-form input:focus,
.task-form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: none;
}
.form-group-inline { display: flex; gap: 20px; }
.form-group-inline .form-group { flex: 1; }
.form-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 12px; }

/* 6. DROPDOWN ARSIP & BUG FIX */
.archive-dropdown { position: relative; }
.archive-button {
    background-color: #e9ecef; color: #495057; padding: 8px 16px; font-size: 14px;
    font-weight: 600; border: 1px solid var(--border-color); border-radius: var(--border-radius);
    cursor: pointer; display: flex; align-items: center; gap: 8px; transition: all var(--transition-speed);
}
.archive-button:hover { background-color: #dee2e6; }
.dropdown-content {
    display: none; position: absolute; right: 0; background-color: var(--card-bg);
    min-width: 220px; box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: var(--border-radius); padding: 8px 0; border: 1px solid var(--border-color);
    z-index: 100;
}
.dropdown-content a { color: var(--text-dark); padding: 12px 16px; text-decoration: none; display: block; font-size: 14px; }
.dropdown-content a:hover { background-color: var(--hover-bg); }
.dropdown-divider { height: 1px; margin: 8px 0; background-color: var(--border-color); }
.archive-dropdown:hover .dropdown-content { display: block; }

/* 8. RESPONSIVE DESIGN UNTUK MOBILE */
@media screen and (max-width: 768px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    tr {
        margin-bottom: 1.5rem;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
        background-color: var(--card-bg);
    }
    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 45%;
        text-align: left;
    }
    td:last-child {
        border-bottom: 0;
    }
    td::before {
        content: attr(data-label);
        position: absolute;
        left: 14px;
        width: 40%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: var(--text-muted);
    }
    .action-links {
        display: flex;
        gap: 15px;
        flex-wrap: wrap;
    }
}

/* --- GAYA TUGAS SELESAI --- */
.status-done {
    background-color: #198754;
    color: #ffffff;
    border: 1px solid #146c43;
}

/* Efek coret dan memudar pada baris tugas yang sudah selesai */
.task-row-done td {
    opacity: 0.65;
    background-color: #f8f9fa;
}

/* Coret teks, kecuali pada kolom status dan aksi */
.task-row-done td:not([data-label="Status"]):not([data-label="Aksi"]) {
    text-decoration: line-through;
}

/* Warna link tombol aksi selesai */
.action-links a.btn-done {
    color: #198754; /* Hijau */
}
.action-links a.btn-done:hover {
    color: #146c43;
}
.action-links a.btn-undo {
    color: #fd7e14; /* Oranye */
}
.action-links a.btn-undo:hover {
    color: #e8590c;
}