* { 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; }

/* ===== 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], textarea, select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 4px;
    background: #fff;
}
label { 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; }

/* ===== 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 */
}

/* ===== TOMBOL NONAKTIF (anti double-submit) ===== */
.btn:disabled, .btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ===== PENCARIAN BARANG ===== */
.search-wrap { position: relative; }
.search-results {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    z-index: 20;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0,0,0,.12);
    max-height: 240px;
    overflow-y: auto;
    margin-top: 2px;
}
.search-item { padding: 9px 10px; font-size: 14px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.search-item:last-child { border-bottom: none; }
.search-item:hover, .search-item.active { background: #ecfdf5; }
.search-item .cat-tag { font-size: 11px; color: #6b7280; margin-left: 6px; }
.search-empty { padding: 9px 10px; font-size: 13px; color: #6b7280; }

/* ===== HAPUS PERMINTAAN ===== */
.cancel-form { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 12px; }
.cancel-form input[type=text] { max-width: 420px; margin-bottom: 8px; }
