/* =========================================================
   Sistem Rekrutmen PT Terang Parts Indonesia
   Tema: industrial — graphite / steel / amber
   ========================================================= */

:root {
  --graphite-900: #14181c;
  --graphite-800: #1b2126;
  --graphite-700: #242c32;
  --graphite-600: #333d45;
  --steel-500: #5b6b76;
  --steel-400: #7d8e99;
  --steel-300: #a6b4bd;
  --steel-200: #cfd8dd;
  --steel-100: #eef2f4;
  --amber-500: #f58634;
  --amber-600: #d96d1f;
  --amber-100: #fde3cc;
  --red-500: #e05a4f;
  --green-500: #3fa772;
  --radius: 8px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.28);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--steel-100); }
html, body {
  margin: 0;
  padding: 0;
  color: var(--graphite-900);
}

/* Watermark logo Protera (samar) di latar belakang semua halaman */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('img/protera-logo.png') center center / min(80vw, 900px) auto no-repeat;
  opacity: 0.10;
  pointer-events: none;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--amber-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--graphite-900);
  color: var(--steel-200);
  font-size: 12px;
  padding: 6px 24px;
  display: flex;
  justify-content: space-between;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--graphite-800);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-1);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand .logo-mark {
  width: 52px; height: 42px;
  display: flex; align-items: center; justify-content: center;
}
.brand .logo-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand .brand-wordmark { height: 30px; width: auto; display: block; }
.brand .brand-text strong { display: block; font-size: 15px; }
.brand .brand-text span { display: block; font-size: 11px; color: var(--steel-300); }

.main-nav { display: flex; gap: 8px; }
.main-nav button, .btn {
  border: none;
  cursor: pointer;
  font: inherit;
}

.nav-btn {
  background: transparent;
  color: var(--steel-200);
  padding: 8px 14px;
  border-radius: var(--radius);
}
.nav-btn:hover, .nav-btn.active { background: var(--graphite-700); color: #fff; }

.btn-primary {
  background: var(--amber-500);
  color: var(--graphite-900);
  padding: 9px 16px;
  border-radius: var(--radius);
  font-weight: 600;
}
.btn-primary:hover { background: var(--amber-600); }

.btn-outline {
  background: transparent;
  color: var(--steel-100);
  border: 1px solid var(--steel-500);
  padding: 8px 14px;
  border-radius: var(--radius);
}
.btn-outline:hover { background: var(--graphite-700); }

.btn-danger { background: var(--red-500); color: #fff; padding: 8px 14px; border-radius: var(--radius); }
.btn-ghost { background: transparent; color: var(--amber-600); padding: 6px 10px; }

/* ---------- Layout ---------- */
#main { flex: 1; max-width: 1080px; width: 100%; margin: 0 auto; padding: 28px 20px 60px; }

.site-footer {
  background: var(--graphite-900);
  color: var(--steel-400);
  text-align: center;
  font-size: 12px;
  padding: 16px;
}

/* ---------- Hero / Beranda ---------- */
.hero {
  background: var(--graphite-800);
  color: #fff;
  border-radius: 12px;
  padding: 48px 32px;
  margin-bottom: 28px;
}
.hero h1 { margin: 0 0 8px; font-size: 28px; }
.hero p { color: var(--steel-300); max-width: 560px; }
.hero .amber { color: var(--amber-500); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-top: 24px; }
.stat-card {
  background: var(--graphite-700);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--amber-500); }
.stat-card .label { font-size: 12px; color: var(--steel-300); }

/* ---------- Cards / Jobs ---------- */
.section-title { font-size: 20px; font-weight: 700; margin: 32px 0 14px; }

.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: #fff;
  border: 1px solid var(--steel-200);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-1);
}
.card:hover { box-shadow: var(--shadow-2); }
.job-card h3 { margin: 0 0 6px; font-size: 16px; }
.job-meta { font-size: 12px; color: var(--steel-500); display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.job-meta span { background: var(--steel-100); padding: 2px 8px; border-radius: 20px; }

.job-detail h2 { margin-top: 0; }
.qualif-list { padding-left: 18px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 14px; max-width: 520px; }
label { font-size: 13px; font-weight: 600; margin-bottom: 4px; display: block; color: var(--graphite-700); }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--steel-300);
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--amber-500); border-color: var(--amber-500); }

/* ---------- Login Chooser ---------- */
.login-wrap { max-width: 420px; margin: 0 auto; }
.role-tabs { display: flex; border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; border: 1px solid var(--steel-300); }
.role-tabs button {
  flex: 1;
  padding: 12px;
  background: #fff;
  font-weight: 600;
  color: var(--steel-500);
}
.role-tabs button.active { background: var(--graphite-800); color: #fff; }

/* ---------- Status badges ---------- */
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge.wait { background: #fef3c7; color: #92400e; }
.badge.progress { background: #dbeafe; color: #1e40af; }
.badge.success { background: #dcfce7; color: #166534; }
.badge.fail { background: #fee2e2; color: #991b1b; }

/* ---------- Status timeline ---------- */
.status-track { display: flex; flex-wrap: wrap; gap: 0; margin: 20px 0; }
.status-step {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 10px 6px;
  border-bottom: 4px solid var(--steel-300);
  font-size: 12px;
  color: var(--steel-500);
}
.status-step.done { border-color: var(--green-500); color: var(--green-500); font-weight: 700; }
.status-step.current { border-color: var(--amber-500); color: var(--amber-600); font-weight: 700; }

/* ---------- Test / Tes ---------- */
.test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--graphite-800);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  position: sticky;
  top: 70px;
  z-index: 10;
}
.timer { font-size: 20px; font-weight: 800; color: var(--amber-500); font-family: monospace; }
.timer.danger { color: var(--red-500); }

.soal-block { margin-bottom: 22px; }
.soal-block .kategori-label {
  display: inline-block;
  background: var(--amber-100);
  color: var(--amber-600);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.soal-item { background: #fff; border: 1px solid var(--steel-200); border-radius: var(--radius); padding: 16px; margin-bottom: 10px; }
.soal-item .pertanyaan { font-weight: 600; margin-bottom: 10px; }
.opsi-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.opsi-list label:hover { background: var(--steel-100); }
.opsi-list input { width: auto; margin: 0; }

/* ---------- Admin dashboard ---------- */
.admin-shell { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.admin-tabs { display: flex; flex-direction: column; gap: 4px; }
.admin-tabs button {
  text-align: left;
  background: transparent;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--graphite-700);
  font-weight: 600;
}
.admin-tabs button.active { background: var(--graphite-800); color: #fff; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--steel-200); text-align: left; font-size: 13px; }
th { background: var(--steel-100); font-weight: 700; color: var(--graphite-700); }
tr:hover td { background: #fafbfc; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 24, 28, 0.6);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-box {
  background: #fff; border-radius: 10px; padding: 24px; width: 90%; max-width: 480px;
  max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow-2);
}
.modal-box h3 { margin-top: 0; }

/* ---------- Toast ---------- */
#toastRoot { position: fixed; bottom: 20px; right: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--graphite-900); color: #fff; padding: 12px 16px; border-radius: var(--radius);
  box-shadow: var(--shadow-2); font-size: 13px; min-width: 220px;
}
.toast.success { border-left: 4px solid var(--green-500); }
.toast.error { border-left: 4px solid var(--red-500); }

/* ---------- Utility ---------- */
.muted { color: var(--steel-500); }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--steel-500); }

@media (max-width: 720px) {
  .admin-shell { grid-template-columns: 1fr; }
  .site-header { flex-wrap: wrap; gap: 10px; }
}

/* =========================================================
   Tambahan untuk versi PHP multi-halaman
   ========================================================= */
a.btn, a.btn-primary, a.btn-outline, a.nav-btn, a.btn-ghost { display: inline-block; text-decoration: none; }
.btn, .btn-primary, .btn-outline, .btn-danger { border: none; cursor: pointer; font: inherit; }
.btn-primary { border: none; }
.btn-outline { border: 1px solid var(--steel-500); }
.btn-outline-dark { color: var(--graphite-800); border: 1px solid var(--graphite-600); background: transparent; padding: 8px 14px; border-radius: var(--radius); display: inline-block; text-decoration: none; cursor: pointer; font: inherit; }
.btn-outline-dark:hover { background: var(--steel-100); }
.btn-amber-outline { background: transparent; color: var(--amber-600); border: 1px solid var(--amber-500); padding: 8px 14px; border-radius: var(--radius); display: inline-block; text-decoration: none; cursor: pointer; font: inherit; }
.btn-amber-outline:hover { background: var(--amber-100); text-decoration: none; }
.btn-link-danger { background: transparent; border: none; color: var(--red-500); padding: 6px 10px; cursor: pointer; font: inherit; }
.inline-form { display: inline; margin: 0; }
.brand { color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.nav-btn { text-decoration: none; }
.nav-btn:hover { text-decoration: none; }
.main-nav { align-items: center; }
.role-tabs a { flex: 1; padding: 12px; background: #fff; font-weight: 600; color: var(--steel-500); text-align: center; text-decoration: none; }
.role-tabs a.active { background: var(--graphite-800); color: #fff; }
.admin-tabs a { text-align: left; padding: 10px 12px; border-radius: var(--radius); color: var(--graphite-700); font-weight: 600; text-decoration: none; }
.admin-tabs a:hover { background: var(--steel-200); }
.admin-tabs a.active { background: var(--graphite-800); color: #fff; }
.admin-shell > div:last-child { min-width: 0; }
.table-wrap { overflow-x: auto; }
.badge.closed { background: var(--steel-200); color: var(--graphite-600); }
.form-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; border-radius: var(--radius); padding: 10px 12px; font-size: 13px; }
.form-error ul { margin: 0; padding-left: 18px; }
.hint { font-size: 12px; color: var(--steel-500); margin-top: 4px; }
.history { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; }
.history li { padding: 6px 0; border-bottom: 1px solid var(--steel-200); }
.card .job-meta + .muted { margin: 0 0 12px; }
.stat-card.dark { background: var(--graphite-700); }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-bar select { width: auto; min-width: 220px; }
.test-header { top: 74px; }

/* Sortir kolom tabel pelamar */
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover, .sort-link.active { color: var(--amber-600, #d97706); }

/* ---------- Form Data Pribadi Pelamar ---------- */
.dp-h { margin: 0 0 6px; padding-bottom: 8px; border-bottom: 2px solid var(--amber-500); }
.dp-sec { margin-top: 20px; }
.dp-sec h4, .dv h4 { margin: 18px 0 8px; font-size: 15px; }
.dp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 16px; margin-top: 12px; }
.dp-grid .full { grid-column: 1 / -1; }
.dp-radio { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 6px; }
.dp-radio label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.dp-radio input { width: auto; }
.lain-input { margin-top: 6px; }
.req { color: #c0392b; }
.dp-table-wrap { overflow-x: auto; }
.dp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dp-table th, .dp-table td { border: 1px solid var(--steel-300); padding: 4px; vertical-align: top; }
.dp-table thead th { background: var(--steel-100); text-align: center; }
.dp-table th.dp-label { background: var(--steel-100); text-align: left; white-space: nowrap; font-weight: 600; }
.dp-table input, .dp-table select { padding: 5px 6px; font-size: 13px; min-width: 90px; }
.dp-blok { border: 1px solid var(--steel-300); border-radius: var(--radius); padding: 4px 14px 14px; margin-top: 12px; }
.dp-blok h4 { margin: 10px 0 0; }
.dp-dua { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dp-foto { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.dp-foto-box { width: 120px; height: 160px; border: 1px dashed var(--steel-400); border-radius: 6px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; overflow: hidden; background: var(--steel-100); }
.dp-foto-box img { width: 100%; height: 100%; object-fit: cover; }
.dp-aksi { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin: 18px 0 40px; }

/* Tampilan data pribadi untuk admin / cetak */
.dv-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 10px; margin-top: 12px; }
.dv-foto { width: 90px; height: 120px; object-fit: cover; border: 1px solid #000; }
.dv-foto-kosong { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; color: var(--steel-500); }
.dv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 20px; }
.dv-item { display: flex; flex-direction: column; border-bottom: 1px dotted var(--steel-300); padding: 3px 0; font-size: 13px; }
.dv-item span { color: var(--steel-500); font-size: 12px; }
.dv-blok { border: 1px solid var(--steel-300); border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; }
@media print {
    .topbar, .site-header, .site-footer, .admin-tabs, .no-print, #toastRoot, .section-title { display: none !important; }
    body::before { display: none; }
    .admin-shell { display: block !important; }
    .card { box-shadow: none !important; border: 0 !important; padding: 0 !important; max-width: none !important; }
    .dp-table th, .dp-table td { border-color: #000; }
}

.dv-nama { font-size: 20px; font-weight: 800; color: var(--graphite-900); }
.dv-posisi { font-size: 13px; color: var(--steel-500); }
