/* ==========================================================================
   Lapor Barang — design system v3
   Rasa aplikasi: app bar, chip filter, grid rapat, bottom tab bar.
   Tanpa build step, tanpa framework JS.
   ========================================================================== */

:root {
  /* Netral */
  --ink: #0b0d12;
  --ink-soft: #454b57;
  --ink-mute: #5f6672;
  --paper: #f4f4f5;
  --surface: #ffffff;
  --line: #e7e7ea;
  --line-strong: #d6d6db;

  /* Semantik: hilang = coral, temuan = teal */
  --hilang: #c2410c;
  --hilang-soft: #fff1e9;
  --temuan: #0b7a63;
  --temuan-soft: #e8f7f3;

  /* Status */
  --aktif: #1d4ed8;
  --aktif-soft: #eaefff;
  --selesai: #565d69;
  --selesai-soft: #eef0f3;
  --diklaim: #a16207;
  --diklaim-soft: #fdf4e3;

  /* Bentuk */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(11, 13, 18, .05);
  --shadow-sm: 0 1px 3px rgba(11, 13, 18, .06), 0 1px 2px rgba(11, 13, 18, .04);
  --shadow-md: 0 2px 4px rgba(11, 13, 18, .04), 0 12px 24px -16px rgba(11, 13, 18, .28);
  --shadow-lg: 0 4px 8px rgba(11, 13, 18, .05), 0 28px 48px -24px rgba(11, 13, 18, .38);

  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --tinggi-appbar: 60px;
  --tinggi-tabbar: 68px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  background-color: #eef1f5;
  background-image: linear-gradient(180deg, #f8f9fb 0%, #e9edf3 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
  scroll-behavior: smooth;
}

/* ---------- Tema: terang & gelap -----------------------------------------
   Dua tema saja, diganti lewat tombol matahari/bulan di app bar.
   Tema terang memakai latar mesh berwarna; tema gelap menyalakan mode malam
   penuh (kartu ikut gelap). Kelas dipasang di <body>.
   ------------------------------------------------------------------------ */

/* Terang: mesh warna lembut (teal, oranye, indigo, pink). */
body.tema-terang {
  background-color: #e6eef2;
  background-image:
    radial-gradient(44% 40% at 8% 0%, rgba(13, 148, 136, .55), transparent 60%),
    radial-gradient(40% 38% at 92% -2%, rgba(249, 115, 22, .46), transparent 60%),
    radial-gradient(54% 46% at 76% 98%, rgba(59, 91, 219, .46), transparent 64%),
    radial-gradient(44% 40% at 4% 96%, rgba(219, 39, 119, .32), transparent 62%),
    linear-gradient(180deg, #f2f8f9 0%, #e2eaf2 100%);
  background-attachment: fixed;
}

/* Gelap: mode malam penuh. */
body.tema-gelap {
  --ink: #eef1f6;
  --ink-soft: #b6bdc9;
  --ink-mute: #9aa3b2;
  --surface: #1c222c;
  --line: #313846;
  --line-strong: #414a5b;
  --hilang-soft: #2c1710;
  --temuan-soft: #0d2620;
  --aktif-soft: #141c33;
  --selesai-soft: #1b2029;
  --diklaim-soft: #2a2110;
  color-scheme: dark;
  color: var(--ink);
  background-color: #0b0e13;
  background-image:
    radial-gradient(50% 40% at 10% 0%, rgba(11, 122, 99, .34), transparent 60%),
    radial-gradient(45% 38% at 92% 4%, rgba(194, 65, 12, .26), transparent 60%),
    radial-gradient(60% 45% at 50% 100%, rgba(29, 78, 216, .24), transparent 62%),
    linear-gradient(180deg, #0d1117 0%, #080a0e 100%);
  background-attachment: fixed;
}

/* Penyesuaian komponen untuk tema gelap. */
body.tema-gelap .app-bar { background: rgba(15, 19, 26, .96); }
body.tema-gelap .merek__ikon { background: #eef1f6; color: #0b0d12; }
body.tema-gelap .ikon-tombol { background: #1b202a; border-color: #2b323e; color: #c9d0db; }
body.tema-gelap .ikon-tombol:hover { background: #232a36; color: #fff; }
body.tema-gelap .btn { --btn-bg: #eef1f6; --btn-fg: #0b0d12; --btn-bd: #eef1f6; }
body.tema-gelap .btn--garis { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line-strong); }
body.tema-gelap .btn--bahaya { --btn-bg: transparent; --btn-fg: #f0825e; --btn-bd: rgba(240, 130, 94, .4); }
body.tema-gelap .btn--temuan { --btn-bg: #0e8a72; --btn-fg: #fff; --btn-bd: #0e8a72; }
body.tema-gelap .chip { background: #1b202a; border-color: #2b323e; color: #b6bdc9; }
body.tema-gelap .chip.aktif { background: #eef1f6; border-color: #eef1f6; color: #0b0d12; }
body.tema-gelap .cari input[type="text"] { background: #1b202a; border-color: #2b323e; color: var(--ink); }
body.tema-gelap .cari button { background: #eef1f6; color: #0b0d12; }
body.tema-gelap input[type="text"],
body.tema-gelap input[type="tel"],
body.tema-gelap input[type="date"],
body.tema-gelap input[type="password"],
body.tema-gelap select,
body.tema-gelap textarea { background: #11151d; color: var(--ink); border-color: #2b323e; }
body.tema-gelap .badge { box-shadow: 0 1px 4px rgba(0, 0, 0, .55); }
body.tema-gelap .badge--kategori { background: #232a36; color: #eef1f6; border-color: #333a47; }
body.tema-gelap .kartu__media--kosong { background: linear-gradient(140deg, #1a1f29 0%, #141922 100%); color: #3a4250; }
body.tema-gelap .kartu__media:not(.kartu__media--kosong)::before {
  background: linear-gradient(100deg, #1a1f29 20%, #232a36 40%, #1a1f29 60%);
  background-size: 250% 100%;
}
body.tema-gelap table.tabel th { background: #141922; }
body.tema-gelap table.tabel tbody tr:hover { background: #1b202a; }
body.tema-gelap .tab-bawah { background: #10141b; border-color: #262c37; }
body.tema-gelap .tab-bawah a.tengah { background: #eef1f6; color: #0b0d12; }
body.tema-gelap .bar-aksi-hp { background: rgba(16, 20, 27, .96); }
body.tema-gelap .footer { background: #10141b; }
body.tema-gelap .sorotan { box-shadow: 0 24px 48px -28px rgba(0, 0, 0, .9); }
body.tema-gelap ::-webkit-scrollbar-track { background: #0b0e13; }
body.tema-gelap ::-webkit-scrollbar-thumb { background: #2b323e; border-color: #0b0e13; }

/* Tombol ganti tema di app bar. */
.tombol-tema svg { width: 18px; height: 18px; }
.tombol-tema .ikon-bulan { display: none; }
body.tema-gelap .tombol-tema .ikon-matahari { display: none; }
body.tema-gelap .tombol-tema .ikon-bulan { display: block; }

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.container--sempit { max-width: 720px; }

/* ---------- App bar ----------------------------------------------------- */

.app-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.app-bar__isi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--tinggi-appbar);
}

.merek { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 16px; letter-spacing: -.02em; }

.merek__ikon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
}

.merek__ikon svg { width: 17px; height: 17px; }

.merek small {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-mute);
  letter-spacing: .07em;
  text-transform: uppercase;
  line-height: 1.1;
}

.app-bar__aksi { display: flex; align-items: center; gap: 6px; }

.ikon-tombol {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.ikon-tombol:hover { background: #f6f6f7; color: var(--ink); border-color: var(--line-strong); }
.ikon-tombol svg { width: 18px; height: 18px; }

/* ---------- Tombol ------------------------------------------------------ */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  --btn-bd: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease, border-color .14s ease;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: 3px solid rgba(29, 78, 216, .35); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; }

.btn--kecil { padding: 8px 14px; font-size: 13px; }
.btn--lebar { width: 100%; }

.btn--temuan { --btn-bg: var(--temuan); --btn-bd: var(--temuan); }

.btn--garis { --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-strong); }
.btn--garis:hover { --btn-bd: var(--ink); }

.btn--bahaya { --btn-bg: transparent; --btn-fg: var(--hilang); --btn-bd: rgba(194, 65, 12, .32); box-shadow: none; }
.btn--bahaya:hover { --btn-bg: var(--hilang-soft); --btn-bd: var(--hilang); }

/* ---------- Sorotan (kartu gelap di atas) ------------------------------- */

.sorotan {
  position: relative;
  margin: 16px 0 18px;
  padding: 22px 20px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(11, 122, 99, .55) 0%, transparent 55%),
    radial-gradient(100% 120% at 0% 100%, rgba(194, 65, 12, .45) 0%, transparent 50%),
    #0b0d12;
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.sorotan__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 8px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.sorotan__label span.titik {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .22);
}

.sorotan h1 { font-size: clamp(22px, 4.4vw, 32px); max-width: 30ch; position: relative; }

.sorotan__hias {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 260px;
  height: 260px;
  opacity: .95;
  pointer-events: none;
}

.sorotan > *:not(.sorotan__hias) { position: relative; z-index: 1; }
.sorotan h1 em { font-style: normal; color: #7ee2c8; }

.sorotan p { margin-top: 8px; color: rgba(255, 255, 255, .72); font-size: 14px; max-width: 46ch; }

.sorotan__aksi { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.sorotan .btn--putih { --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: #fff; }
.sorotan .btn--kaca {
  --btn-bg: rgba(255, 255, 255, .12);
  --btn-fg: #fff;
  --btn-bd: rgba(255, 255, 255, .22);
  box-shadow: none;
}
.sorotan .btn--kaca:hover { --btn-bg: rgba(255, 255, 255, .2); }

/* ---------- Pencarian --------------------------------------------------- */

.cari { position: relative; margin-bottom: 12px; }

.cari svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-mute);
  pointer-events: none;
}

.cari input[type="text"] {
  width: 100%;
  height: 48px;
  padding: 0 96px 0 46px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-size: 14.5px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.cari input[type="text"]:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(11, 13, 18, .07);
}

.cari button {
  position: absolute;
  right: 5px;
  top: 5px;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.cari button:hover { background: #1b2130; }

/* ---------- Chip filter ------------------------------------------------- */

.chip-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin: 0 -2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chip-bar::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}

.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.aktif { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.aktif-hilang { background: var(--hilang); border-color: var(--hilang); color: #fff; }
.chip.aktif-temuan { background: var(--temuan); border-color: var(--temuan); color: #fff; }

.chip__ikon { width: 15px; height: 15px; }
.chip__hitung { opacity: .55; font-weight: 700; }

.chip-bar--kategori { flex-wrap: wrap; overflow: visible; padding-bottom: 14px; }

.chip-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 4px 0 6px;
}

/* ---------- Kepala daftar ---------------------------------------------- */

.kepala-daftar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 12px;
}

.kepala-daftar h2 { font-size: 17px; }
.kepala-daftar .hitung { font-size: 12.5px; color: var(--ink-mute); font-weight: 700; }

/* ---------- Kartu laporan ---------------------------------------------- */

.grid-laporan {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 14px;
}

.kartu {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.kartu:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.kartu:active { transform: scale(.995); }

.kartu__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #ececee;
  overflow: hidden;
}

/* Skeleton: kilau bergerak sampai foto selesai dimuat. */
.kartu__media:not(.kartu__media--kosong)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg, #ececee 20%, #f7f7f9 40%, #ececee 60%);
  background-size: 250% 100%;
  animation: kilau 1.3s ease-in-out infinite;
}

.kartu__media.selesai::before { display: none; }

.kartu__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: transform .35s ease, opacity .4s ease;
}

.kartu__media.selesai img { opacity: 1; }

@keyframes kilau {
  0% { background-position: 140% 0; }
  100% { background-position: -60% 0; }
}
.kartu:hover .kartu__media img { transform: scale(1.05); }

.kartu__media--kosong {
  display: grid;
  place-items: center;
  color: #b9b9c0;
  background: linear-gradient(140deg, #f3f3f5 0%, #e9e9ec 100%);
}

.kartu__media--kosong svg { width: 38px; height: 38px; }

.kartu__badges { position: absolute; top: 9px; left: 9px; display: flex; gap: 5px; flex-wrap: wrap; }

.kartu__isi { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }

.kartu__judul {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -.015em;
  /* Dua baris tetap: supaya meta di kartu sebelah sejajar. */
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kartu__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  font-size: 12px;
  color: var(--ink-mute);
  font-weight: 600;
}

.kartu__meta span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.kartu__meta svg { width: 12px; height: 12px; flex: none; }

.kartu__deskripsi {
  font-size: 12.5px;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Badge ------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}

.badge--hilang { background: var(--hilang); color: #fff; }
.badge--temuan { background: var(--temuan); color: #fff; }
.badge--kategori { background: #fff; color: var(--ink); border-color: rgba(11, 13, 18, .1); text-transform: none; letter-spacing: 0; font-weight: 700; }
.badge--aktif { background: var(--aktif-soft); color: var(--aktif); border-color: rgba(29, 78, 216, .18); }
.badge--selesai { background: var(--selesai-soft); color: var(--selesai); border-color: rgba(86, 93, 105, .18); }
.badge--diklaim { background: var(--diklaim-soft); color: var(--diklaim); border-color: rgba(161, 98, 7, .22); }

/* ---------- Kosong ------------------------------------------------------ */

.kosong {
  text-align: center;
  padding: 54px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--ink-soft);
}

.kosong svg { width: 56px; height: 56px; color: var(--line-strong); margin: 0 auto 12px; }
.kosong h3 { font-size: 16px; margin-bottom: 6px; }
.kosong p { font-size: 13.5px; color: var(--ink-mute); }

/* ---------- Pagination -------------------------------------------------- */

.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 26px 0 8px; }

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
}

.pagination a:hover { border-color: var(--ink); }
.pagination .nonaktif { color: var(--ink-mute); background: transparent; box-shadow: none; }
.pagination .posisi { border-color: transparent; background: transparent; box-shadow: none; color: var(--ink-mute); }

/* ---------- Tab bawah (khusus HP) -------------------------------------- */

.tab-bawah { display: none; }

/* ---------- Detail ------------------------------------------------------ */

.jejak {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-mute);
  font-weight: 700;
  padding: 16px 0 14px;
}

.jejak a { text-decoration: none; }
.jejak a:hover { color: var(--ink); }

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding-bottom: 40px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel__isi { padding: 20px; }

.detail__foto { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #ececee; }

.detail__samping { position: sticky; top: calc(var(--tinggi-appbar) + 12px); }

.detail h1 { font-size: clamp(22px, 3.2vw, 28px); margin: 12px 0 8px; }
.detail__deskripsi { color: var(--ink-soft); font-size: 15px; }

.daftar-info {
  margin: 20px 0 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.daftar-info div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  padding: 11px 14px;
  font-size: 13.5px;
}

.daftar-info dt { color: var(--ink-mute); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.daftar-info dd { margin: 0; font-weight: 700; text-align: right; }

.kontak { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.kontak .catatan { font-size: 12px; color: var(--ink-mute); text-align: center; }

/* Bar aksi yang menempel di bawah layar HP pada halaman detail. */
.bar-aksi-hp { display: none; }

/* ---------- Formulir ---------------------------------------------------- */

.form-kartu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.form-bagian { margin-bottom: 22px; }

.form-bagian__judul {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 12px;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .penuh { grid-column: 1 / -1; }

.medan { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.medan label { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }

input[type="text"],
input[type="tel"],
input[type="date"],
input[type="password"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

textarea { resize: vertical; min-height: 108px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(11, 13, 18, .07);
}

input::placeholder, textarea::placeholder { color: #8b909a; }

.bantuan { font-size: 12px; color: var(--ink-mute); }
.wajib { color: var(--hilang); }

.form-aksi {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* Tab pilih tipe */
.tab-tipe { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 20px; }

.tab-tipe a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-soft);
  box-shadow: var(--shadow-xs);
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.tab-tipe a svg { width: 16px; height: 16px; }
.tab-tipe a:hover { border-color: var(--line-strong); color: var(--ink); }
.tab-tipe a.aktif-hilang { background: var(--hilang); border-color: var(--hilang); color: #fff; }
.tab-tipe a.aktif-temuan { background: var(--temuan); border-color: var(--temuan); color: #fff; }

/* Honeypot: tidak terlihat mata, tetap ada di DOM untuk bot. */
.jebakan { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Notifikasi -------------------------------------------------- */

.notif {
  display: flex;
  gap: 11px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid;
  margin-bottom: 18px;
  font-size: 14px;
}

.notif svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.notif strong { display: block; margin-bottom: 4px; }
.notif ul { margin: 0; padding-left: 18px; }

.notif--gagal { background: var(--hilang-soft); border-color: rgba(194, 65, 12, .26); color: #8a2f0a; }
.notif--sukses { background: var(--temuan-soft); border-color: rgba(11, 122, 99, .26); color: #085a49; }
.notif--info { background: var(--aktif-soft); border-color: rgba(29, 78, 216, .2); color: #1a3fa8; }
.notif--peringatan { background: var(--diklaim-soft); border-color: rgba(161, 98, 7, .24); color: #74490a; }

/* ---------- Admin ------------------------------------------------------- */

.admin-kepala {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 22px 0 16px;
}

.admin-kepala h1 { font-size: 23px; }
.admin-kepala p { color: var(--ink-mute); font-size: 13px; font-weight: 600; }

.statistik { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 11px; margin-bottom: 18px; }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 15px;
  box-shadow: var(--shadow-xs);
}

.stat__angka { font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat__label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mute); margin-top: 3px; }
.stat--hilang .stat__angka { color: var(--hilang); }
.stat--temuan .stat__angka { color: var(--temuan); }

.tabel-bungkus {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

table.tabel { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }

table.tabel th {
  text-align: left;
  padding: 12px 15px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-mute);
  background: #fafafb;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.tabel td { padding: 12px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tabel tr:last-child td { border-bottom: 0; }
table.tabel tbody tr:hover { background: #fbfbfc; }

.tabel__judul { font-weight: 700; text-decoration: none; }
.tabel__judul:hover { text-decoration: underline; }
.tabel__sub { font-size: 12px; color: var(--ink-mute); margin-top: 2px; }

.aksi-baris { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }

/* ---------- Login ------------------------------------------------------- */

.login-bungkus { min-height: calc(100vh - 240px); display: grid; place-items: center; padding: 36px 0; }

.login-kartu {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
}

.login-kartu h1 { font-size: 21px; margin-bottom: 5px; }
.login-kartu .sub { color: var(--ink-mute); font-size: 13px; margin-bottom: 20px; }

/* ---------- Footer ------------------------------------------------------ */

.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0 32px; margin-top: 24px; }

.footer__isi {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-mute);
}

.footer__isi strong { color: var(--ink-soft); }

/* ---------- Animasi masuk ------------------------------------------------- */

@keyframes naik {
  from { opacity: 0; transform: translateY(14px) scale(.99); }
  to { opacity: 1; transform: none; }
}

@keyframes pudar {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.sorotan { animation: naik .5s cubic-bezier(.22, .61, .36, 1) both; }
.cari, .chip-label, .chip-bar, .kepala-daftar { animation: pudar .45s ease both; }
.cari { animation-delay: .05s; }
.chip-label { animation-delay: .09s; }
.chip-bar { animation-delay: .12s; }
.kepala-daftar { animation-delay: .16s; }

/* Kartu masuk berurutan; --i diisi dari loop di template. */
.kartu {
  animation: naik .5s cubic-bezier(.22, .61, .36, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms + 120ms);
}

.panel, .form-kartu, .tabel-bungkus, .stat, .login-kartu {
  animation: naik .45s cubic-bezier(.22, .61, .36, 1) both;
}

.stat { animation-delay: calc(var(--i, 0) * 55ms); }

/* ---------- Responsif --------------------------------------------------- */

@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .detail__samping { position: static; }
}

@media (max-width: 720px) {
  body { font-size: 15px; padding-bottom: calc(var(--tinggi-tabbar) + 44px + env(safe-area-inset-bottom)); }
  .container { padding: 0 14px; }
  .sorotan { margin: 12px 0 14px; padding: 18px 16px; border-radius: var(--r-md); }
  .sorotan p { display: none; }
  .sorotan__hias { display: none; }
  .sorotan__aksi { flex-direction: column; align-items: stretch; }
  .sorotan__aksi .btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-kartu, .panel__isi { padding: 16px; }
  .grid-laporan { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kartu__judul { font-size: 13.5px; }
  .kartu__deskripsi { display: none; }
  .kartu__isi { padding: 10px 11px 12px; }
  .badge { font-size: 9.5px; padding: 3px 7px; }
  .merek small { display: none; }
  .sembunyi-hp { display: none !important; }

  /* Tabel admin jadi daftar kartu di HP supaya tidak perlu geser horizontal. */
  .tabel-bungkus { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  table.tabel { display: block; min-width: 0; }
  table.tabel thead { display: none; }
  table.tabel tbody { display: block; }
  table.tabel tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-xs);
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  table.tabel td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border: 0; }
  table.tabel td::before {
    content: attr(data-label);
    flex: none;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-mute);
  }
  table.tabel td.kolom-utama { display: block; padding-bottom: 8px; }
  table.tabel td.kolom-utama::before { display: none; }
  table.tabel td.kolom-id { display: none; }
  .footer { margin-top: 10px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .footer__isi { font-size: 11.5px; }

  /* Tab bawah: rasa aplikasi di HP. */
  .tab-bawah {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    height: calc(var(--tinggi-tabbar) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px -14px rgba(11, 13, 18, .5);
  }

  .tab-bawah a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--ink-mute);
    text-decoration: none;
    padding: 8px 0;
  }

  .tab-bawah a svg { width: 21px; height: 21px; }
  .tab-bawah a.aktif { color: var(--ink); }

  .tab-bawah a.tengah {
    justify-self: center;
    width: 58px;
    height: 58px;
    margin-top: -22px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    justify-content: center;
    gap: 0;
    box-shadow: 0 10px 20px -8px rgba(11, 13, 18, .55);
  }

  .tab-bawah a.tengah svg { width: 24px; height: 24px; }
  .tab-bawah a.tengah span { display: none; }

  /* Detail: tombol WhatsApp menempel di atas tab bar. */
  .bar-aksi-hp {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--tinggi-tabbar) + env(safe-area-inset-bottom));
    z-index: 65;
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line);
  }

  .bar-aksi-hp .btn { flex: 1; }
  .detail { padding-bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Scrollbar senada palet (Chromium/WebKit). */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid var(--paper); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-mute); }

/* Pita penanda situs demo; hanya muncul kalau MODE_DEMO=1. */
.demo-bar {
  background: #fde68a;
  color: #422006;
  font-size: .8rem;
  line-height: 1.45;
  text-align: center;
  padding: .5rem 1rem;
  border-bottom: 1px solid rgba(245, 158, 11, .25);
}
.tema-gelap .demo-bar { background: #3a2f12; color: #fde68a; border-bottom-color: rgba(245, 158, 11, .35); }
