/* ===== Beranda: header, pencarian, kartu profil =====
   Prioritas mandor: nomor kotak paling besar & paling mudah dicari,
   tanggal revisi jelas, status kurang lengkap menonjol. */

header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(43, 45, 49, .96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px 10px;
}
.h-row { display: flex; align-items: center; gap: 12px; max-width: 1080px; margin: 0 auto; }
.logo { width: 38px; height: 38px; border-radius: 9px; background: var(--wood); flex: none; display: grid; place-items: center; }
.logo svg { width: 22px; height: 22px; }
.h-title { min-width: 0; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: 19px; margin: 0; letter-spacing: .2px; }
.h-sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 1px; }
.h-row .pill { margin-left: auto; }
.h-row .pill + .pill { margin-left: 0; }

.searchbar { max-width: 1080px; margin: 10px auto 0; position: relative; }
.searchbar svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-faint); }
.searchbar input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); padding: 12px 40px 12px 38px;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); outline: none;
}
.searchbar input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .2); }
.searchbar input::placeholder { font-weight: 500; color: var(--ink-faint); }
.q-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 8px; font-size: 19px; color: var(--ink-soft); }
.q-clear:hover { background: var(--surface-2); }

.filter-row { max-width: 1080px; margin: 8px auto 0; display: flex; gap: 7px; }
.fchip {
  font-size: 12px; font-weight: 700; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
}
.fchip.on { background: #e8c268; border-color: #e8c268; color: #1e1f22; }

main { max-width: 1080px; margin: 0 auto; padding: 16px 20px 40px; }
.meta-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; color: var(--ink-soft); font-size: 12.5px; }
.meta-row b { color: var(--ink); font-size: 14px; }
#offline-info { color: var(--warn); font-weight: 600; }

.grid { display: block; }

/* ---- kartu ---- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-1); text-align: left;
  display: flex; flex-direction: column; padding: 0;
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }

/* pita nomor kotak: elemen paling menonjol pada kartu */
.card-kotak {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--wood); color: var(--champ); padding: 7px 12px;
}
.card-kotak .kode {
  font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: 1px;
  color: var(--gold); line-height: 1.05;
}
.card-kotak .kode.none { font-size: 11px; letter-spacing: .4px; color: var(--ink-faint);
  font-family: var(--font-body); font-weight: 600; }
.card-kotak .nsh { font-size: 10.5px; font-weight: 600; color: #a8977a; }

.card-img {
  position: relative; aspect-ratio: 4 / 3; background:
    repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px;
  display: grid; place-items: center; padding: 10px;
}
.card-img img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.card-img span { color: var(--ink-faint); font-size: 11.5px; }
.card-img .thumb-not-updated { color: #b36a22; font-weight: 700; font-size: 12px; text-align: center; padding: 10px; }
.card-img img + .thumb-not-updated { position: absolute; right: 7px; bottom: 7px;
  max-width: calc(100% - 14px); border-radius: 6px; padding: 4px 7px;
  color: #fff4df; background: rgba(105, 62, 20, .92); font-size: 10px; }

.card-body { padding: 10px 13px 12px; border-top: 1px solid var(--line); }
.card-name { font-weight: 700; font-size: 13.5px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.card-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.card-chips .chip.rev { font-size: 11px; padding: 3px 9px; }

.empty { padding: 56px 20px; text-align: center; color: var(--ink-faint); font-size: 14px; line-height: 1.6; }
.empty b { color: var(--ink-soft); }

.foot { max-width: 1080px; margin: 0 auto; padding: 0 20px 34px; color: var(--ink-faint);
  font-size: 11.5px; line-height: 1.6; }

@media (max-width: 640px) {
  header { padding: 10px 14px 8px; }
  main { padding: 12px 14px 30px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
  h1 { font-size: 16px; }
  .h-sub { font-size: 10px; }
  .h-row .pill { display: none; }
  .h-row .pill.offline-pill { display: inline-flex; }
  .card-kotak .kode { font-size: 18px; }
  .searchbar input { font-size: 16px; } /* cegah zoom paksa di iPhone */
}


/* Pengelompokan profil mengikuti folder induk arsip desktop. */
.folder-group { margin: 0 0 26px; }
.folder-heading { display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin:0 0 12px; padding:10px 13px; border:1px solid var(--line);
  border-left:4px solid var(--gold); border-radius:10px; background:var(--surface-2);
  color:var(--ink); font-size:14px; line-height:1.35; overflow-wrap:anywhere; }
.folder-heading small { flex:none; color:var(--ink-faint); font-size:11px; font-weight:600; }
.folder-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(235px,1fr)); gap:14px; }
@media (max-width:640px) { .folder-grid { grid-template-columns:repeat(auto-fill,minmax(158px,1fr)); gap:10px; } }
