/* Katalog Warung Mekaar — satu tema terang, dioptimalkan untuk cetak A4 */
:root {
  --canvas: #eaf1fa;
  --surface: #ffffff;
  --surface-2: #f6f9fd;
  --blue: #0b63b8;
  --blue-dark: #0a57a2;
  --text: #10233a;
  --muted: #64768c;
  --border: #dce6f2;
  --green: #00a651;
  --green-dark: #018a44;
  --green-soft: #e8f7ee;
  --amber: #f5a623;
  --red: #d93b36;
  --shadow: 0 1px 2px rgba(16, 35, 58, .06), 0 6px 20px rgba(16, 35, 58, .06);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
input, select, button, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- pita mode admin (hanya untuk admin yang sedang masuk) ---------- */
.pita-admin {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 20px;
  background: #0d2f52;
  color: #dbeafe;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .01em;
}
.pita-admin .titik {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .22);
}
.pita-admin strong { color: #fff; }
.pita-admin a {
  margin-left: auto;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
  color: #fff;
  font-weight: 700;
}
.pita-admin a + a { margin-left: 0; }
.pita-admin a:hover { background: rgba(255, 255, 255, .26); }

/* ---------- top navigation ---------- */
.topnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topnav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.topnav .brand { display: flex; align-items: center; -webkit-tap-highlight-color: transparent; }
/* umpan balik halus saat ketukan rahasia hampir lengkap */
.topnav .brand.kunci-dekat { opacity: .55; transition: opacity .15s ease; }
.topnav .links { display: flex; gap: 6px; margin-left: 8px; }
.topnav .links a {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
}
.topnav .links a:hover { background: var(--surface-2); color: var(--text); }
.topnav .links a[aria-current="page"] { color: var(--green); background: var(--green-soft); }
.topnav .spacer { flex: 1; }
.topnav .brand { --logo-h: 30px; }
.topnav .nav-mitra { --logo-h: 20px; --logo-gap: 18px; flex-wrap: nowrap; }
@media (max-width: 1120px) {
  .topnav .nav-mitra { --logo-h: 17px; --logo-gap: 12px; }
}
@media (max-width: 1023px) {
  .topnav .nav-mitra { display: none; }
}
@media (max-width: 720px) {
  .topnav .wrap { gap: 10px; height: 58px; }
  .topnav .brand { --logo-h: 25px; }
  .topnav .links a { padding: 8px 11px; font-size: 13px; }
}

/* ---------- logo resmi: satu ukuran untuk semua ----------
   Setiap berkas logo sudah dipangkas rapat ke tepi gambar, jadi tinggi yang
   sama menghasilkan tampilan yang sejajar dan sama besar. Wadah .logo-rail
   menentukan --logo-h; ubah satu nilai untuk mengubah seluruh baris. */
.logo-rail {
  --logo-h: 26px;
  display: flex; align-items: center; gap: var(--logo-gap, 16px);
  flex-wrap: wrap; min-width: 0;
}
.logo-img {
  display: block; flex: none;
  height: calc(var(--logo-h, 26px) * var(--logo-skala, 1));
  width: auto; max-width: 100%;
  object-fit: contain;
}
.logo-mekaar { --logo-skala: 1.06; }
.logo-pnm { --logo-skala: 1.02; }
.logo-chip {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 10px;
  padding: 5px 10px;
  box-shadow: 0 3px 10px rgba(6, 40, 78, .18);
}

/* ---------- blue brand band ---------- */
.band {
  position: relative;
  background-color: var(--blue);
  background-image: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='110' viewBox='0 0 200 110'><g fill='none' stroke='%230a57a2' stroke-width='2.4'><path d='M0 8 C 50 -12 150 28 200 8'/><path d='M0 22 C 50 4 150 40 200 22'/><path d='M0 36 C 50 18 150 54 200 36'/><path d='M0 50 C 50 30 150 70 200 50'/><path d='M0 64 C 50 46 150 82 200 64'/><path d='M0 78 C 50 58 150 98 200 78'/><path d='M0 92 C 50 74 150 110 200 92'/><path d='M0 106 C 50 88 150 124 200 106'/></g></svg>");
  background-size: 340px auto;
  color: #fff;
  overflow: hidden;
}
.band .wrap { position: relative; z-index: 2; }
.logo-pill {
  --logo-h: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff;
  border-radius: 999px;
  padding: 14px 34px;
  box-shadow: 0 8px 24px rgba(6, 40, 78, .28);
}
.band h1 {
  font-size: 40px;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(6, 40, 78, .35);
}
.band .period { font-weight: 700; font-size: 18px; opacity: .95; }
.rail {
  position: absolute;
  top: 24px; bottom: 24px;
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl;
  font-size: 13px; font-weight: 700;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .95);
  overflow: hidden; white-space: nowrap; pointer-events: none;
}
.rail.left { left: 14px; }
.rail.right { right: 14px; transform: rotate(180deg); }

/* ---------- lembar katalog A4 (210x297mm @96dpi = 794x1123px) ----------
   Semua ukuran tetap agar isi lembar tidak pernah meluber:
   tinggi kartu dikunci --kartu-h, kapasitas dihitung di includes/config.php. */
:root { --kartu-h: 148px; --kartu-gap: 9px; }

.lembar-scroll { overflow-x: auto; overflow-y: hidden; padding: 0 12px 4px; }
.lembar-stack {
  --skala: 1;
  display: flex; flex-direction: column; align-items: center; gap: 26px;
  width: max-content; min-width: 100%; margin: 0 auto;
}
.lembar-slot {
  width: calc(794px * var(--skala));
  height: calc(1123px * var(--skala));
  flex: none;
}

/* dok zoom mengambang — ditaruh di kiri bawah agar tidak menutupi lembar */
.zoom-dock {
  position: sticky; bottom: 14px; z-index: 30;
  width: max-content; margin: 8px auto 0 14px;
  display: flex; align-items: center; gap: 2px;
  padding: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .93); backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(6, 40, 78, .22);
}
.zoom-dock button {
  height: 32px; min-width: 32px; padding: 0 9px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 700; font-size: 13px; color: var(--muted);
  background: transparent; border: 0; cursor: pointer;
}
.zoom-dock button:hover { background: var(--surface-2); color: var(--text); }
.zoom-dock button:disabled { opacity: .4; cursor: not-allowed; }
.zoom-dock .nilai { min-width: 58px; font-variant-numeric: tabular-nums; color: var(--text); }
.zoom-dock .teks { display: none; }
@media (min-width: 640px) { .zoom-dock .teks { display: inline; } }
.lembar {
  width: 794px; height: 1123px;
  transform: scale(var(--skala));
  transform-origin: top left;
}
.sheet {
  position: relative;
  background-color: var(--blue);
  background-image: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='110' viewBox='0 0 200 110'><g fill='none' stroke='%230a57a2' stroke-width='2.4'><path d='M0 8 C 50 -12 150 28 200 8'/><path d='M0 22 C 50 4 150 40 200 22'/><path d='M0 36 C 50 18 150 54 200 36'/><path d='M0 50 C 50 30 150 70 200 50'/><path d='M0 64 C 50 46 150 82 200 64'/><path d='M0 78 C 50 58 150 98 200 78'/><path d='M0 92 C 50 74 150 110 200 92'/><path d='M0 106 C 50 88 150 124 200 106'/></g></svg>");
  background-size: 340px auto;
  color: #fff;
  overflow: hidden;
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  border-radius: 6px;
  padding: 20px 44px 12px;
  box-shadow: 0 12px 44px rgba(6, 40, 78, .22);
}

/* Kepala lembar: tiga kolom simetris supaya pil Mekaar benar-benar di tengah
   dan logo kiri-kanan selalu sejajar berapa pun lebar masing-masing berkas. */
.sheet-bar {
  --logo-h: 20px; --logo-gap: 8px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 10px; flex: none; height: 46px;
}
.sheet-bar > :first-child { justify-self: start; }
.sheet-bar .mitra { --logo-gap: 8px; flex-wrap: nowrap; justify-self: end; }
.sheet-bar .logo-pill {
  --logo-h: 26px; justify-self: center;
  padding: 4px 20px; box-shadow: 0 6px 18px rgba(6, 40, 78, .3);
}
.sheet-bar .logo-chip { padding: 4px 9px; }

.sheet-hero { text-align: center; flex: none; }
.sheet-hero .judul {
  font-size: 20px; line-height: 24px; font-weight: 800; letter-spacing: .14em; margin-top: 8px;
  text-shadow: 0 2px 12px rgba(6, 40, 78, .45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-hero .periode { font-size: 33px; font-weight: 800; line-height: 35px; text-shadow: 0 2px 12px rgba(6, 40, 78, .45); }
.sheet-hero img.ilus {
  display: block; height: 150px; width: auto; max-width: 620px;
  object-fit: contain; margin: 0 auto;
}

.sheet .card { border: 0; background: #fff; color: var(--text); box-shadow: 0 3px 10px rgba(6, 40, 78, .22); }
.sheet .card.product { height: var(--kartu-h); overflow: hidden; }
.sheet-note {
  flex: none; height: 22px; line-height: 16px; color: rgba(255, 255, 255, .95);
  font-weight: 700; font-size: 12px; letter-spacing: .06em; text-align: center;
  text-transform: uppercase; padding-top: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-foot {
  flex: none; height: 24px; line-height: 14px; margin-top: auto; padding-top: 10px;
  text-align: center; color: #ffd98a; font-weight: 700; font-size: 11px; letter-spacing: .04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* daftar regional di lembar sampul halaman depan */
.sampul-daftar {
  flex: 1; min-height: 0; margin-top: 12px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: min-content; align-content: start; gap: 9px;
}
.sampul-item {
  display: flex; align-items: center; gap: 10px;
  background: #fff; color: var(--text); border-radius: 10px; padding: 9px 12px;
  box-shadow: 0 3px 10px rgba(6, 40, 78, .22); font-size: 13px;
  transition: transform .12s ease;
}
.sampul-item:hover { transform: translateY(-2px); }
.sampul-item .nomor {
  flex: none; width: 26px; height: 26px; border-radius: 8px; color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
  overflow: hidden;
}
.sampul-item .nomor.foto { background: var(--surface-2); }
.sampul-item .nomor img { width: 100%; height: 100%; object-fit: cover; }

.segmen { display: inline-flex; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-weight: 600; font-size: 13px; white-space: nowrap;
}
.chip.on { border-color: var(--green); color: var(--green); background: var(--green-soft); }

/* ---------- generic surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section-head {
  display: flex; align-items: flex-end; gap: 16px;
  flex-wrap: wrap;
  margin: 26px 0 16px;
}
.section-head h2 { font-size: 26px; font-weight: 800; }
.section-head .tools { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }

.field {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  height: 40px;
}
.field input, .field select { border: 0; background: transparent; outline: none; height: 100%; min-width: 0; }
.field input { width: 260px; }
.field svg { flex: none; color: var(--muted); }
.input, select.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
.input:focus, select.input:focus, .field:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 166, 81, .18); }
label.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s, background .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { color: var(--green); border-color: rgba(0, 166, 81, .45); background: transparent; }
.btn-outline:hover { background: var(--green-soft); }
.btn-blue { color: var(--blue); border-color: rgba(11, 99, 184, .4); background: transparent; }
.btn-danger { color: var(--red); border-color: rgba(217, 59, 54, .4); background: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  border: 1px solid var(--border);
}
.badge-new { color: var(--green); border-color: rgba(0, 166, 81, .4); background: var(--green-soft); }
.badge-warn { color: #a76a04; border-color: rgba(245, 166, 35, .5); background: rgba(245, 166, 35, .12); }
.badge-mute { color: var(--muted); }
.badge-biru { color: var(--blue); border-color: rgba(11, 99, 184, .4); background: rgba(11, 99, 184, .1); }
.badge-putih { color: #fff; border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .2); }

.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
}
.alert-ok { color: var(--green); border-color: rgba(0, 166, 81, .4); background: var(--green-soft); }
.alert-warn { color: #a76a04; border-color: rgba(245, 166, 35, .5); background: rgba(245, 166, 35, .12); }
.alert-err { color: var(--red); border-color: rgba(217, 59, 54, .4); background: rgba(217, 59, 54, .08); }
.alert svg { flex: none; }

/* ---------- regional cards ---------- */
.regional-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1000px) { .regional-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .regional-grid { grid-template-columns: 1fr; } }
.regional-card { display: flex; gap: 14px; padding: 16px; align-items: flex-start; }
.regional-card:hover { border-color: rgba(0, 166, 81, .55); }
.avatar {
  flex: none;
  width: 54px; height: 54px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 19px;
  letter-spacing: .02em;
}
.regional-card .name { font-size: 15px; font-weight: 700; }
.regional-card .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.regional-card .count { font-weight: 600; font-size: 13px; margin-top: 2px; }
.regional-card .go { margin-top: 10px; }

/* ---------- product sheet ---------- */
.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 14px 0;
}
.toolbar .grow { flex: 1 1 200px; min-width: 0; }
.toolbar .grow input { width: 100%; }
.segmen { display: flex; gap: 6px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.segmen .chip { height: 32px; border: 0; background: transparent; }
.segmen .chip.on { background: var(--surface); color: var(--green); box-shadow: 0 2px 8px rgba(6, 40, 78, .12); }
@media (max-width: 760px) {
  .toolbar { gap: 8px; }
  .toolbar .btn, .toolbar .field { height: 42px; }
  .toolbar .grow { flex: 1 1 100%; order: -1; }
  .toolbar .segmen { flex: 1 1 100%; }
  .toolbar .segmen .chip { flex: 1; justify-content: center; height: 36px; }
  .toolbar .cetak { flex: 1 1 auto; }
}

.sheet-grid {
  flex: 1; min-height: 0; overflow: hidden;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: var(--kartu-h); align-content: start;
  gap: var(--kartu-gap); margin-top: 10px;
}

/* Kartu produk: nama melebar penuh di atas, lalu foto + daftar harga. */
.product {
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px 9px;
}
.produk-isi { display: flex; gap: 8px; flex: 1; min-height: 0; }
.product .thumb {
  flex: none;
  width: 58px; height: 92px;
  border-radius: 8px;
  background: #fff;
  display: grid; place-items: center;
  overflow: hidden;
}
.product .thumb img { width: 100%; height: 100%; object-fit: contain; }
.product .thumb.empty { background: var(--surface-2); border: 1px dashed var(--border); color: var(--muted); font-size: 10px; text-align: center; padding: 6px; }
.product .pname {
  font-size: 12px; font-weight: 800; line-height: 15px; letter-spacing: -.005em;
  min-height: 30px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.harga-list { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.price-row {
  display: flex; align-items: center; gap: 5px; height: 21px;
  padding: 0 5px 0 2px; border-radius: 7px; background: #fff8ec;
}
.price-row.kosong { background: transparent; }
.koin { flex: none; display: block; }
.price-val { font-weight: 900; font-size: 14px; letter-spacing: -.02em; color: #10365e; }
.price-row.kosong .price-val { font-weight: 700; color: var(--muted); }
.price-cap {
  margin-left: auto;
  font-size: 8.5px; font-weight: 800;
  letter-spacing: .06em;
  color: #5c7794;
  white-space: nowrap;
}

.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 22px 0 40px; }
.pager .pages { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.pager a, .pager span.pg {
  min-width: 36px; height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid; place-items: center;
  font-weight: 600;
}
.pager .on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- footer partners ---------- */
.partners {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 34px;
}
.partners .wrap { display: flex; align-items: center; gap: 20px; padding: 22px 20px; flex-wrap: wrap; }
.partners .logos {
  --logo-h: clamp(20px, 4.6vw, 30px); --logo-gap: clamp(14px, 3.4vw, 26px);
  margin-left: auto; justify-content: flex-end;
}
.partners .sep { width: 1px; height: calc(var(--logo-h) + 8px); background: var(--border); flex: none; }
@media (max-width: 640px) {
  .partners .wrap { justify-content: center; text-align: center; }
  .partners .logos { margin: 0 auto; justify-content: center; }
  .partners .sep { display: none; }
}

/* ---------- admin shell ---------- */
.admin-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  height: 62px; padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.admin-top .brand { display: flex; align-items: center; --logo-h: 26px; }
.admin-top .spacer { flex: 1; }
.admin-top .burger { display: none; }
.admin-top .who { display: flex; align-items: center; gap: 10px; }
.admin-top .who-avatar {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--blue); color: #fff; font-weight: 800; font-size: 13px;
}
.admin-top .who-teks { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.admin-top .who-teks b { font-size: 13px; }
.admin-top .who-teks small { color: var(--muted); font-size: 11px; }

.admin-body { display: flex; align-items: flex-start; min-height: calc(100vh - 62px); }
.sidebar {
  position: sticky; top: 62px;
  width: 238px; flex: none;
  height: calc(100vh - 62px);
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
}
.sidebar-head { display: none; align-items: center; justify-content: space-between; padding: 4px 8px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.sidebar a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  border-radius: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 3px;
}
.sidebar a svg { flex: none; }
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.on { background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(0, 166, 81, .28); }
.sidebar hr { border: 0; border-top: 1px solid var(--border); margin: 14px 4px; }
.sidebar-kaki {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 12px 4px 0;
  font-size: 11.5px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--muted);
}
.sidebar-kaki svg { flex: none; margin-top: 1px; }
.sidebar-scrim { position: fixed; inset: 0; background: rgba(9, 25, 43, .45); z-index: 44; }
.admin main { flex: 1; min-width: 0; padding: 22px 24px 70px; }

@media (max-width: 900px) {
  .admin-top .burger { display: inline-flex; }
  .admin-top .who-teks { display: none; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100vh;
    z-index: 45; width: 264px;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 12px 0 36px rgba(16, 35, 58, .18);
  }
  body.menu-buka .sidebar { transform: none; }
  .sidebar-head { display: flex; }
  .admin main { padding: 18px 14px 80px; }
}
@media (min-width: 901px) { .sidebar-scrim { display: none !important; } }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .stats, .stats[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 420px) { .stats, .stats[style] { grid-template-columns: 1fr !important; } }
.stat { padding: 16px; }
.stat .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat .k { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }

table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); }
table.data th a { display: inline-flex; gap: 5px; align-items: center; }
table.data td.r, table.data th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

.drop {
  border: 2px dashed var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 34px 20px;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.drop.hot { border-color: var(--green); background: var(--green-soft); }
.drop .big { font-weight: 700; font-size: 16px; margin-top: 12px; }

/* ---- hapus latar belakang foto ---- */
.kotak-alpha { display: inline-block; border-radius: 10px; padding: 4px;
  background-color: #fff;
  background-image: linear-gradient(45deg, #e6ecf2 25%, transparent 25%), linear-gradient(-45deg, #e6ecf2 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e6ecf2 75%), linear-gradient(-45deg, transparent 75%, #e6ecf2 75%);
  background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0; }
.kartu-latar { border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); padding: 12px 14px; margin-top: 12px; }
.sakelar { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.sakelar input { position: absolute; opacity: 0; width: 0; height: 0; }
.sakelar-rel { flex: 0 0 auto; width: 42px; height: 24px; border-radius: 999px; background: var(--border); position: relative; transition: background .18s; margin-top: 1px; }
.sakelar-rel::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(11,31,51,.28); transition: transform .18s; }
.sakelar input:checked + .sakelar-rel { background: var(--green); }
.sakelar input:checked + .sakelar-rel::after { transform: translateX(18px); }
.sakelar input:focus-visible + .sakelar-rel { outline: 2px solid var(--green); outline-offset: 2px; }
.sakelar b { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.sakelar small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.4; }
.lbl-geser { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 700; color: var(--muted); margin: 14px 0 5px; }
.lbl-geser .num { color: var(--ink); font-variant-numeric: tabular-nums; }
.geser { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--border); outline: none; }
.geser:disabled { opacity: .45; }
.geser::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--green); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(11,31,51,.3); cursor: pointer; }
.geser::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--green); border: 3px solid #fff; cursor: pointer; }
.catatan-latar { margin: 8px 0 0; font-size: 12px; font-weight: 600; line-height: 1.45; color: var(--green); }
.catatan-latar.awas { color: #b45309; }
.chip-latar.on { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.latar-banding { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.latar-banding figure { margin: 0; text-align: center; }
.latar-banding figcaption { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 5px; text-transform: uppercase; letter-spacing: .05em; }
.latar-banding img { max-height: 108px; object-fit: contain; display: block; margin: 0 auto; }
.progress { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; margin: 16px auto 0; max-width: 620px; }
.progress > i { display: block; height: 100%; background: var(--green); width: 0; transition: width .3s; }

.map-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1000px) { .map-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.map-card { padding: 12px; }
.map-card .k { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.map-card .sel { display: flex; align-items: center; gap: 8px; }

.photo-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1200px) { .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.photo-card { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.photo-card .box { aspect-ratio: 1; border-radius: 10px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.photo-card .box img { width: 100%; height: 100%; object-fit: contain; }
.photo-card .box.empty { background: var(--surface-2); border: 1px dashed var(--border); color: var(--muted); font-size: 11px; }
.photo-card .t { font-size: 12px; font-weight: 700; line-height: 1.35; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600; font-size: 13px;
}
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.on { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.chip.on .n { color: var(--green); }

.bar-list { display: grid; gap: 12px; }
.bar-list .row { display: grid; grid-template-columns: 170px 1fr 70px; gap: 12px; align-items: center; font-size: 13px; }
.bar-list .bar { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; }
.bar-list .bar > i { display: block; height: 100%; background: var(--blue); }

.sticky-bar {
  position: sticky; bottom: 0;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 0 0;
  margin-top: 18px;
  background: linear-gradient(to top, var(--canvas) 70%, transparent);
}
.sticky-bar .right { margin-left: auto; display: flex; gap: 10px; }

.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

/* slide-over panel */
.panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 360px; max-width: 92vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(16, 35, 58, .18);
  padding: 20px;
  overflow-y: auto;
  z-index: 60;
}
.panel .ph { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.panel h3 { font-size: 18px; font-weight: 800; }
.scrim { position: fixed; inset: 0; background: rgba(9, 25, 43, .38); z-index: 50; }



/* ---------- kontrol form tambahan ---------- */
.field-blok { width: 100%; height: 46px; }
.field-blok input { flex: 1; width: 100%; }
.field .lihat {
  flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
}
.field .lihat:hover { background: var(--surface-2); color: var(--text); }
.field .lihat.on { color: var(--green); }
.btn-blok { width: 100%; justify-content: center; }
.btn-ikon { padding: 0; width: 40px; justify-content: center; }
.btn-sm.btn-ikon { width: 32px; }
.grid-dua { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.saklar {
  display: flex !important; align-items: center; gap: 10px;
  margin-top: 18px; font-size: 13px; color: var(--text); cursor: pointer;
}
.saklar input { width: 18px; height: 18px; accent-color: var(--green); }

.palet { display: flex; gap: 8px; flex-wrap: wrap; }
.sw-wrap { cursor: pointer; }
.sw-wrap input { position: absolute; opacity: 0; pointer-events: none; }
.sw { display: block; width: 34px; height: 34px; border-radius: 10px; outline-offset: 2px; }
.sw-wrap input:checked + .sw { outline: 3px solid var(--text); }

.pilih-peran { display: grid; gap: 10px; }
.pilih-peran .opsi {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; background: var(--surface);
}
.pilih-peran .opsi:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.pilih-peran .opsi.on { border-color: var(--green); background: var(--green-soft); }
.pilih-peran input { margin-top: 3px; accent-color: var(--green); }
.pilih-peran b { display: block; font-size: 13px; }
.pilih-peran small { display: block; font-size: 12px; margin-top: 2px; }

/* ---------- halaman masuk ---------- */
.login-page { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.login-art { display: flex; align-items: center; padding: 48px; }
.login-art-in { position: relative; z-index: 2; max-width: 460px; }
.login-art h1 { font-size: 42px; line-height: 1.1; font-weight: 800; margin-top: 26px; text-shadow: 0 3px 16px rgba(6, 40, 78, .4); }
.login-art p { color: rgba(255, 255, 255, .92); font-size: 15px; line-height: 1.6; margin-top: 14px; }
.login-art .logo-pill { --logo-h: 34px; }
.login-mitra { --logo-h: 20px; --logo-gap: 10px; margin-top: 32px; }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--canvas); }
.login-card {
  width: 100%; max-width: 390px; padding: 30px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow);
}
.login-mark { display: flex; justify-content: center; margin-bottom: 14px; --logo-h: 32px; }
.login-card h2 { font-size: 22px; text-align: center; }
.login-kaki {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--muted);
}
.login-kaki svg { flex: none; margin-top: 2px; }
.login-card > .muted { text-align: center; margin: 6px 0 0; font-size: 13px; }
@media (max-width: 880px) {
  .login-page { grid-template-columns: 1fr; }
  .login-art { padding: 30px 22px; min-height: auto; }
  .login-art h1 { font-size: 28px; margin-top: 18px; }
  .login-art p { font-size: 14px; }
  .login-art .logo-pill { --logo-h: 26px; padding: 10px 22px; }
  .login-mitra { margin-top: 20px; --logo-h: 17px; }
  .login-form { padding: 26px 16px 60px; }
  .login-card { padding: 22px; }
}

/* ---------- kartu kepala regional ---------- */
.kepala-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
  gap: 16px; margin-top: 16px;
}
.kepala-card { position: relative; padding-bottom: 14px; overflow: hidden; text-align: center; }
.kepala-atas { height: 68px; display: flex; align-items: flex-start; justify-content: space-between; padding: 10px 12px; }
.kepala-atas .nomor { color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .05em; }
.kepala-card .kepala-foto {
  margin: -40px auto 0; border: 4px solid var(--surface);
  box-shadow: 0 6px 18px rgba(16, 35, 58, .16);
}
.kepala-isi { padding: 10px 14px 0; }
.kepala-isi .nama { font-weight: 800; font-size: 15px; line-height: 1.3; }
.kepala-aksi { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 12px 12px 0; }
.kepala-aksi form { display: contents; }

.avatar-foto { padding: 0; overflow: hidden; background: var(--surface-2); }
.avatar-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar { border-radius: 16px; }

.drop-avatar { padding: 20px 16px; }
.drop-avatar .pratinjau {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  display: block; margin: 0 auto 10px; background: var(--surface-2);
}
.drop-avatar .ikon-kosong {
  display: grid; place-items: center; width: 96px; height: 96px; margin: 0 auto 10px;
  border-radius: 50%; background: var(--surface-2); color: var(--muted);
}

/* ---------- daftar info & profil ---------- */
.profil-head { display: flex; align-items: center; gap: 14px; padding-bottom: 6px; }
.info-list { margin: 14px 0 0; display: grid; gap: 0; }
.info-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.info-list > div:last-child { border-bottom: 0; }
.info-list dt { color: var(--muted); font-size: 13px; }
.info-list dd { margin: 0; font-weight: 700; font-size: 13px; text-align: right; }

.pratinjau-kepala {
  margin-top: 18px; border-radius: 12px; padding: 16px; text-align: center; color: #fff;
  background: var(--blue);
}
.pratinjau-kepala .judul { font-size: 13px; font-weight: 800; letter-spacing: .14em; text-shadow: 0 2px 10px rgba(6, 40, 78, .45); }
.pratinjau-kepala .periode { font-size: 26px; font-weight: 800; line-height: 1.1; margin-top: 2px; text-shadow: 0 2px 10px rgba(6, 40, 78, .45); }

/* tombol token untuk templat judul lembar */
.token-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.token {
  height: 28px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.token:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.pratinjau-ilus { border-radius: 12px; padding: 8px; }
.pratinjau-ilus img { width: 100%; display: block; border-radius: 8px; }
.mitra-preview { --logo-h: clamp(22px, 5vw, 30px); --logo-gap: 14px; }
.mitra-preview .logo-chip { background: var(--surface-2); box-shadow: none; border: 1px solid var(--border); padding: 10px 14px; flex: 1 1 180px; }

.sel-baris { display: flex; gap: 10px; align-items: center; }
.aksi-baris { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* tabel berubah jadi kartu di layar kecil */
@media (max-width: 720px) {
  table.tabel-kartu, table.tabel-kartu tbody, table.tabel-kartu tr, table.tabel-kartu td { display: block; width: 100%; }
  table.tabel-kartu thead { display: none; }
  table.tabel-kartu tr { border-bottom: 1px solid var(--border); padding: 12px 14px; }
  table.tabel-kartu tr:last-child { border-bottom: 0; }
  table.tabel-kartu td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  table.tabel-kartu td::before {
    content: attr(data-l); color: var(--muted); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; flex: none;
  }
  table.tabel-kartu td[data-l="Pengguna"]::before { display: none; }
  table.tabel-kartu td.r { text-align: left; }
  .aksi-baris { justify-content: flex-end; }
  .grid-dua { grid-template-columns: 1fr; }
  .section-head h2 { font-size: 21px; }
  .section-head .tools { margin-left: 0; width: 100%; }
  .section-head .tools > *, .section-head .tools form { flex: 1; }
  .panel { width: 100%; max-width: 100%; }
}

/* ---------- print ---------- */
@media print {
  @page { size: A4 portrait; margin: 0; }
  .topnav, .toolbar, .pager, .partners, .section-head, .pita-admin, .no-print { display: none !important; }
  html, body { background: #fff; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .lembar-scroll { overflow: visible; padding: 0; }
  .lembar-stack { display: block; gap: 0; padding: 0; width: auto; min-width: 0; }
  .lembar-slot { width: 794px; height: 1123px; max-width: none; }
  .lembar { transform: none; break-after: page; }
  .lembar:last-child { break-after: auto; }
  .sheet { border-radius: 0; box-shadow: none; }
  .card { box-shadow: none; break-inside: avoid; }
}
