
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, Segoe UI, Roboto, sans-serif; }
body { background: #f3f3ee; color: #13343b; }
.navbar { background: #133343; color: white; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; }
.navbar a { color: #e8f4f5; text-decoration: none; margin-left: 20px; font-size: 14px; }
.navbar .brand { font-weight: 700; font-size: 18px; }
/* Tanpa penanda ini "Arsip" dan "Terhapus" mudah tertukar - keduanya berisi laporan tidak
   aktif, hanya beda sebab - dan satu-satunya petunjuk lokasi adalah judul H1. */
.navbar a.active { border-bottom: 2px solid #e8f4f5; font-weight: 600; }
.container { max-width: 1000px; margin: 30px auto; padding: 0 20px; }
/* Halaman bertabel lebar (Report Inbox, 11 kolom) memakai batas lebih lebar. Dengan batas 1000px,
   kolom Aksi selalu harus digeser lebih dulu walau layar stafnya jauh lebih lebar - padahal
   meninjau laporan adalah pekerjaan harian yang paling sering diulang. */
.container-lebar { max-width: 1320px; }
.card { background: white; border-radius: 10px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px; }
.login-box { max-width: 380px; margin: 80px auto; }
h1 { font-size: 22px; margin-bottom: 4px; }
h2 { font-size: 17px; margin-bottom: 12px; color: #21808d; }
p.subtitle { color: #6b7280; margin-bottom: 20px; font-size: 14px; }
input, select, textarea { width: 100%; padding: 10px 12px; margin-bottom: 14px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 4px; color: #374151; }
button, .btn { background: #21808d; color: white; border: none; padding: 10px 18px; border-radius: 6px; cursor: pointer; font-size: 14px; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: #1a6873; }
.btn-danger { background: #c0152f; }
.btn-danger:hover { background: #9e1126; }
.btn-secondary { background: #6b7280; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid #e5e7eb; }
th { background: #f3f3ee; font-weight: 600; color: #374151; }
.badge { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-selected { background: #d1fae5; color: #065f46; }
.badge-not_selected { background: #e5e7eb; color: #374151; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-flagged { background: #fef3c7; color: #92400e; }
.flash { background: #e0e7ff; color: #3730a3; padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
/* Berhasil dan gagal harus terbaca berbeda dalam sekali lihat. Tanpa ini "Email atau password
   salah." dan "43 laporan berhasil dipulihkan." tampil dengan kotak biru yang persis sama. */
.flash-error { background: #fee2e2; color: #991b1b; border-left: 4px solid #c0152f; }
.flash-success { background: #d1fae5; color: #065f46; border-left: 4px solid #059669; }
.filter-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.filter-tabs a { padding: 8px 14px; border-radius: 6px; background: white; text-decoration: none; color: #374151; font-size: 13px; }
.filter-tabs a.active { background: #21808d; color: white; }
/* Antrean yang menunggu tindakan harus menonjol dari penghitung yang sekadar informatif. */
.filter-tabs a.tab-perlu-tindakan { background: #fef3c7; color: #92400e; font-weight: 600; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.metric-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.threshold-bar { background: #e5e7eb; height: 24px; border-radius: 12px; position: relative; margin: 12px 0; overflow: hidden; }
.threshold-fill { height: 100%; background: #21808d; }
.checklist label { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-bottom: 10px; }
.checklist input { width: auto; margin: 0; }
th.col-check, td.col-check { width: 34px; text-align: center; }
th.col-check input, td.col-check input { width: auto; margin: 0; cursor: pointer; }
.bulk-bar { display: none; align-items: center; gap: 12px; background: #eef7f8; border: 1px solid #cfe8ea; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; color: #21808d; font-weight: 600; }
.bulk-bar button { font-size: 13px; padding: 8px 14px; }
.period-range { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.period-range input { margin-bottom: 0; }
.period-range span { color: #6b7280; font-size: 13px; }
.filter-tabs a.btn-clear { background: none; color: #6b7280; text-decoration: underline; margin-left: auto; }
/* ---- Tabel lebar yang bisa digeser ----
   Container-nya sudah lama ada dan memang menggeser, tetapi tabel di dalamnya hanya `width: 100%`
   tanpa lantai lebar. Akibatnya pada layar sedang (mis. 760-900px) browser memilih memeras kolom
   ketimbang meluap: kolom Aksi terukur 99px sehingga ketiga tombolnya (Detail/PDF/Hapus) turun ke
   tiga baris dan selnya menjadi 138px tinggi - terbaca seperti kolom yang terpotong.

   min-width disetel PER HALAMAN sesuai jumlah kolomnya, sedekat mungkin dengan lebar alami
   isinya supaya tidak menambah geseran yang tidak perlu di layar lebar. */
.table-scroll { overflow-x: auto; width: 100%; }
.table-scroll > table { min-width: 100%; }
.table-scroll.tabel-inbox > table { min-width: 1040px; }     /* 11 kolom */
.table-scroll.tabel-terhapus > table { min-width: 940px; }   /* 9 kolom */
.table-scroll.tabel-arsip > table { min-width: 880px; }      /* 8 kolom */
.table-scroll.tabel-riwayat > table { min-width: 760px; }     /* 7 kolom */

/* Kolom aksi selalu di paling kanan dan isinya tombol - tidak boleh pernah dibungkus baris baru. */
.table-scroll th:last-child, .table-scroll td:last-child { white-space: nowrap; }
th.th-dropdown-wrap { position: relative; cursor: pointer; user-select: none; }
/* <button>, bukan <span>: header filter harus bisa dicapai keyboard dan dibaca sebagai
   kontrol. Gaya tombol bawaan dinetralkan agar tampilannya tetap seperti judul kolom. */
th .th-label { display: inline-block; white-space: nowrap; background: none; border: none;
  color: inherit; font: inherit; padding: 0; cursor: pointer; text-align: left; }
.th-dropdown-panel { display: none; position: absolute; top: 100%; left: 0; z-index: 30; background: white; border: 1px solid #d1d5db; border-radius: 8px; box-shadow: 0 6px 16px rgba(0,0,0,0.12); padding: 12px; min-width: 200px; font-weight: 400; text-transform: none; cursor: default; }
.th-dropdown-panel.show { display: block; }
.th-dropdown-panel label { display: block; font-size: 11px; font-weight: 600; color: #6b7280; margin: 6px 0 3px; }
.th-dropdown-panel input, .th-dropdown-panel select { width: 100%; margin-bottom: 6px; padding: 7px 9px; font-size: 13px; }
.th-dropdown-panel button { width: 100%; font-size: 13px; padding: 7px; margin-top: 2px; }
.dd-sort-links { display: flex; gap: 10px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f0f0f0; }
.dd-sort-links.dd-sort-vertical { flex-direction: column; gap: 6px; }
.dd-sort-links a { font-size: 12px; color: #21808d; text-decoration: none; white-space: nowrap; }
.dd-sort-links a:hover { text-decoration: underline; }
/* Penanda antrean di Report Inbox: baris yang sudah diputuskan admin hari ini. */
.sudah-ditinjau { font-size: 11px; color: #065f46; margin-top: 4px; white-space: nowrap; }
.kata-hilang { margin-top: 4px; color: #6b7280; }
.kata-hilang code { background: #f3f3ee; border-radius: 4px; padding: 1px 4px; }

/* Mencentang 20 kotak 13px berulang kali setiap hari melelahkan dan rawan meleset - dan
   meleset di Report Inbox berarti baris yang salah ikut terkena aksi massal.
   Selektor kontekstual ikut disebut satu per satu karena `th.col-check input` dan
   `.checklist input` lebih khusus daripada `input[type=checkbox]`, sehingga tanpa ini
   lebarnya tetap 13px walau tingginya sudah 18px. */
input[type=checkbox],
th.col-check input[type=checkbox],
td.col-check input[type=checkbox],
.checklist input[type=checkbox],
.th-dropdown-panel input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }
.checklist label { padding: 6px 0; }

/* Grid form Settings dijadikan kelas (bukan style inline) supaya bisa di-override media query. */
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.test-result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

/* ---- Responsif ----
   Mitra banyak mengirim laporan dari HP, jadi seluruh halaman harus terbaca di layar kecil. */
@media (max-width: 768px) {
  .navbar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 16px; }
  .navbar > div { display: flex; flex-wrap: wrap; gap: 4px 16px; }
  .navbar a { margin-left: 0; padding: 10px 0; display: inline-block; }
  .container { margin: 20px auto; padding: 0 14px; }
  .card { padding: 16px; }
  .login-box { margin: 40px auto; }

  .review-grid { grid-template-columns: 1fr; }
  .settings-grid, .test-result-grid { grid-template-columns: 1fr; }

  .filter-tabs { flex-wrap: wrap; }
  .filter-tabs a.btn-clear { margin-left: 0; }
  .period-range { flex-wrap: wrap; }

  /* Tabel lebar tetap bisa digeser horizontal walau tidak dibungkus .table-scroll. */
  table { display: block; overflow-x: auto; min-width: 100%; }

  /* Yang SUDAH dibungkus dikembalikan menjadi tabel biasa: kalau tidak, aturan di atas membuat
     tabelnya ikut jadi container geser sendiri, bersarang di dalam .table-scroll. Dua scrollbar
     bertumpuk untuk satu tabel, dan lantai lebar per halaman jadi tidak berlaku. */
  .table-scroll > table { display: table; overflow-x: visible; }
  th, td { padding: 8px 6px; }
  table { font-size: 12px; }

  /* Panel dropdown header dibuka ke kiri supaya tidak terpotong tepi layar. */
  .th-dropdown-panel { left: auto; right: 0; min-width: 180px; max-width: 78vw; }
}

@media (max-width: 420px) {
  h1 { font-size: 19px; }
  .navbar .brand { font-size: 16px; }
}
