* { box-sizing: border-box; }
body {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #f4f6f8;
    margin: 0;
    color: #1f2933;
}

/* ===== NAVBAR ===== */
.navbar { background: #0f766e; color: #fff; }
.navbar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
}
.brand { font-weight: 600; font-size: 16px; }
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}
.nav-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 14px;
    flex-wrap: wrap;
    gap: 10px;
}
.nav-links, .nav-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.navbar a { color: #fff; text-decoration: none; font-size: 14px; }
.navbar a:hover { text-decoration: underline; }
.nav-user { font-size: 13px; }

/* ----- Navbar rapi (desktop): baris 1 = brand + info user, baris 2 = menu ----- */
.navbar .nav-user .text-muted { color: rgba(255,255,255,.7); font-size: 12px; }
.navbar .nav-links a, .navbar .nav-right a { white-space: nowrap; }
@media (min-width: 721px) {
    .navbar { position: relative; }
    .navbar-top { padding: 12px 20px; min-height: 24px; }
    .nav-menu {
        display: block;
        padding: 6px 14px 8px;
        border-top: 1px solid rgba(255,255,255,.18);
    }
    .nav-links { gap: 2px; }
    .nav-links a {
        padding: 7px 12px;
        border-radius: 6px;
        font-size: 14px;
    }
    .nav-links a:hover { background: rgba(255,255,255,.15); text-decoration: none; }
    .nav-links a.active { background: rgba(255,255,255,.25); font-weight: 600; }
    .nav-right {
        position: absolute;
        top: 0; right: 20px;
        height: 48px;
        gap: 6px;
        flex-wrap: nowrap;
    }
    .nav-right .nav-user {
        padding-right: 10px;
        margin-right: 4px;
        border-right: 1px solid rgba(255,255,255,.3);
    }
    .nav-right a { padding: 5px 10px; border-radius: 6px; font-size: 13px; }
    .nav-right a:hover { background: rgba(255,255,255,.15); text-decoration: none; }
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
}
.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
h1, h2, h3 { color: #0f172a; }

/* ===== TABLE (scrollable on small screens) ===== */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; min-width: 480px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #e5e7eb; font-size: 14px; vertical-align: top; }
th { background: #f9fafb; font-size: 12px; text-transform: uppercase; color: #6b7280; white-space: nowrap; }

/* ===== FORM ELEMENTS ===== */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
}
.btn-primary { background: #0f766e; color: #fff; }
.btn-primary:hover { background: #0b5c56; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #111827; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
input[type=text], input[type=number], input[type=email], input[type=password],
input[type=month], input[type=date], textarea, select {
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    color: #111827;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 4px;
    background: #fff;
}
label { display: block; font-size: 13px; font-weight: 500; color: #374151; }
.form-group { margin-bottom: 14px; }
.item-row {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    position: relative;
    background: #fafafa;
}
.item-row .remove-item {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #dc2626;
    cursor: pointer;
    font-size: 13px;
    background: none;
    border: none;
}
.grid-2 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-skip { background: #e5e7eb; color: #6b7280; }
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.reason-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    color: #991b1b;
    margin-top: 6px;
}
.login-wrap { max-width: 380px; margin: 60px auto; padding: 0 16px; }
.text-muted { color: #6b7280; font-size: 13px; }
.reject-reason-field { display: none; margin-top: 8px; }

.step-timeline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.step-pill {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    min-width: 130px;
}
.step-pill .role-name { font-weight: 600; display: block; margin-bottom: 2px; }
.step-pill .time { color: #6b7280; font-size: 11px; display: block; margin-top: 2px; }

.filter-bar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 10px; }
.filter-bar .form-group { margin-bottom: 0; min-width: 140px; flex: 1 1 150px; }
.filter-bar .form-group.grow { flex: 2 1 260px; }
.filter-bar .btn { height: 38px; display: inline-flex; align-items: center; }
.filter-bar > .btn { flex: 0 0 auto; }

/* ===== RESPONSIVE (HP) ===== */
@media (max-width: 720px) {
    .nav-toggle { display: block; }
    .nav-menu {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        padding-top: 8px;
    }
    .nav-menu.open { display: flex; }
    .nav-links, .nav-right { flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; }

    .container { margin: 12px auto; padding: 0 10px; }
    .card { padding: 16px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .form-group { min-width: 0; }
    .login-wrap { margin: 30px auto; }
    table { min-width: 620px; } /* tetap scroll horizontal di tabel data, jangan dipaksa muat */
}

/* ===== TAMBAHAN VERSI SEDERHANA ===== */
.badge-done { background: #dbeafe; color: #1e40af; }
.grid-attach { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.total-box {
    background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 8px;
    padding: 10px 14px; font-size: 14px; margin-top: 10px;
}
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px; margin-bottom: 8px; }
.meta-grid div span { display: block; font-size: 12px; color: #6b7280; }
.approval-box { border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; margin-bottom: 16px; background: #fff; }
.num { text-align: right; white-space: nowrap; }
.btn-success { background: #16a34a; color: #fff; }
@media (max-width: 720px) { .grid-4, .grid-attach { grid-template-columns: 1fr; } }
.grid-ratio { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
@media (max-width: 720px) { .grid-ratio { grid-template-columns: 1fr; } }
