/* Pemeriksaan BPBL — gaya mengikuti "foto desain": netral hangat, kartu membulat, tab pill, tombol ikon bulat. */
:root {
  --bg: #f4f4f2;
  --bg-deep: #e9e9e6;
  --surface: #ffffff;
  --card: #ececea;
  --card-press: #e3e3e0;
  --line: #e2e2de;
  --line-strong: #d3d3ce;
  --ink: #111111;
  --ink-2: #4f4f4a;
  --ink-3: #6f6f69;
  --dark: #111111;
  --green: #1f9d55;
  --green-ink: #157a40;
  --green-bg: #e2f2e7;
  --red: #e0443e;
  --red-ink: #b42f2a;
  --red-bg: #fbe5e4;
  --amber: #b7791f;
  --amber-ink: #86560f;
  --amber-bg: #faefd9;
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --sh-1: 0 1px 2px rgba(17, 17, 17, 0.06), 0 4px 14px rgba(17, 17, 17, 0.05);
  --sh-2: 0 10px 40px rgba(17, 17, 17, 0.16);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 68px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Kerangka ---------- */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  overflow-x: clip;
}
@media (min-width: 520px) {
  #app { box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(0, 0, 0, 0.06); }
}
.screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
/* Animasi hanya di isi layar: transform pada induk membuat menu bawah (fixed) ikut bergeser */
.screen > .content { animation: screen-in 0.28s var(--ease) backwards; }
.screen.has-nav .content { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 28px); }
.screen.has-bar .content { padding-bottom: calc(96px + var(--safe-b)); }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.content { flex: 1; padding: 4px 20px 28px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-t) + 14px) 16px 10px;
  background: linear-gradient(var(--bg) 70%, rgba(244, 244, 242, 0));
}
.topbar-title { text-align: center; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar > :last-child { justify-self: end; }
.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--surface);
  box-shadow: var(--sh-1);
  display: grid;
  place-items: center;
  position: relative;
  color: var(--ink);
  transition: transform 0.15s var(--ease), background 0.2s;
}
.icon-btn:active { transform: scale(0.94); background: var(--card); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--amber);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
}
.icon-btn.spin svg { animation: spin 1s linear infinite; }
.icon-btn.ghost { background: transparent; box-shadow: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Judul besar ---------- */
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 10px 0 18px; }
.page-title { font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -0.025em; }
.page-meta { color: var(--ink-2); font-size: 15px; white-space: nowrap; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.link-btn { border: 0; background: none; padding: 8px 0; color: var(--ink-2); font-size: 15px; min-height: 44px; }
.link-btn:active { color: var(--ink); }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Offline / status strip ---------- */
.status-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-1);
  font-size: 14px;
  color: var(--ink-2);
}
.status-strip svg { width: 18px; height: 18px; flex: none; }
.status-strip.warn { background: var(--amber-bg); color: var(--amber-ink); box-shadow: none; }
.status-strip.bad { background: var(--red-bg); color: var(--red-ink); box-shadow: none; }
.status-strip .grow { flex: 1; }
.status-strip button { border: 0; background: none; font-weight: 600; color: inherit; padding: 6px 0; min-height: 36px; }

/* ---------- Segmented (tab pill) ---------- */
.seg { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 4px 20px 6px; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.seg button .count { color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.seg button[aria-pressed="true"] .count { color: var(--ink-2); }

/* ---------- Kartu & baris ---------- */
.card { background: var(--card); border-radius: var(--r-lg); padding: 16px; }
.card.white { background: var(--surface); box-shadow: var(--sh-1); }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.rows { border-top: 1px solid var(--line); }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
}
.row .row-label { color: var(--ink); }
.row .row-sub { display: block; font-size: 14px; color: var(--ink-2); }
.row .row-value { display: flex; align-items: center; gap: 8px; font-weight: 500; font-variant-numeric: tabular-nums; }
.row .delta { font-size: 15px; font-weight: 400; color: var(--ink-2); }
.row button.row-btn { border: 0; background: none; padding: 0; display: contents; }
.arrow { width: 20px; height: 20px; flex: none; }
.arrow.up { color: var(--green); }
.arrow.down { color: var(--red); }
.arrow.flat { color: var(--ink-3); }

.list-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  min-height: 76px;
  transition: background 0.15s;
}
.list-card:active { background: var(--card-press); }
.list-card .lc-body { flex: 1; min-width: 0; }
.list-card .lc-title, .list-card .lc-sub { display: block; }
.list-card .lc-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-card .lc-sub { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.list-card .lc-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.list-card .lc-value { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.avatar {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px var(--line);
}
.avatar.dark { background: var(--dark); color: #fff; box-shadow: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 20px; }
.group-label { font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 22px 4px 10px; text-transform: none; }
.group-label:first-child { margin-top: 6px; }

/* ---------- Pill status ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.pill svg { width: 15px; height: 15px; }
.pill.ok { background: var(--green-bg); color: var(--green-ink); box-shadow: none; }
.pill.bad { background: var(--red-bg); color: var(--red-ink); box-shadow: none; }
.pill.warn { background: var(--amber-bg); color: var(--amber-ink); box-shadow: none; }
.pill.info { background: var(--card); color: var(--ink-2); box-shadow: none; }
.pill.dark { background: var(--dark); color: #fff; box-shadow: none; }
button.pill { border: 0; min-height: 40px; height: auto; padding: 0 14px; font-size: 14px; }
.mat-no svg { width: 16px; height: 16px; }
.sync-dot { width: 18px; height: 18px; color: var(--ink-3); }
.sync-dot.pending { color: var(--amber); }
.sync-dot.error { color: var(--red); }
.sync-dot.done { color: var(--green); }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 24px;
  border-radius: 999px;
  border: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.15s var(--ease), opacity 0.2s, background 0.2s;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 20px; height: 20px; }
.btn-block { width: 100%; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-white { background: #fff; color: var(--ink); }
.btn-light { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.btn-soft { background: var(--card); color: var(--ink); }
.btn-danger { background: var(--red-bg); color: var(--red-ink); }
.btn-sm { height: 44px; padding: 0 18px; font-size: 15px; }
.btn[disabled], .btn.is-busy { opacity: 0.55; pointer-events: none; }
/* Terkunci sampai isian lengkap; tetap bisa diketuk untuk menunjukkan isian yang kurang */
.btn.is-disabled { background: #d3d3ce; color: #4a4a46; box-shadow: none; }
.btn .spinner { width: 20px; height: 20px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* Bilah aksi bawah (form) */
.bottom-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 30;
  padding: 14px 20px calc(14px + var(--safe-b));
  background: linear-gradient(rgba(244, 244, 242, 0), var(--bg) 30%);
}
.bottom-bar .hint { text-align: center; font-size: 13px; color: var(--ink-2); margin-top: 8px; }

/* ---------- Navigasi bawah ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(8px + var(--safe-b));
  background: rgba(250, 250, 249, 0.92);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 52px;
  padding-top: 4px;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  position: relative;
}
.tabbar a svg { width: 26px; height: 26px; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar .tab-badge {
  position: absolute;
  top: 0;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--amber);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ---------- Hero / login ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100dvh; background: #1a1a1a; color: #fff; overflow: hidden; display: flex; flex-direction: column; }
.hero-art { position: absolute; inset: 0; }
.hero-art svg { width: 100%; height: 100%; display: block; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.72) 78%, rgba(0,0,0,0.9) 100%); }
.hero-top { position: relative; padding: calc(var(--safe-t) + 20px) 24px 0; display: flex; }
.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 14px;
  font-weight: 600;
}
.brand-chip svg { width: 18px; height: 18px; }
.hero-copy { position: relative; margin-top: auto; padding: 0 24px calc(var(--safe-b) + 28px); }
.hero-copy h1 { font-size: 38px; line-height: 1.08; font-weight: 600; letter-spacing: -0.035em; max-width: 12ch; }
.hero-copy .lede { margin: 16px 0 28px; font-size: 17px; line-height: 1.45; color: rgba(255, 255, 255, 0.82); max-width: 32ch; }
.hero-copy .foot { margin-top: 16px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, 0.6); }

/* ---------- Form ---------- */
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field > span, .field-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--red-ink); }
.input, .field input, .field select, .field textarea {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.field textarea { padding: 14px 16px; min-height: 96px; resize: vertical; line-height: 1.45; }
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08); }
.field.invalid input, .field.invalid textarea { border-color: var(--red); }
.field .err { font-size: 14px; color: var(--red-ink); }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 56px; }
.input-wrap .input-icon { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; background: none; display: grid; place-items: center; color: var(--ink-2); }
.input-wrap .input-icon svg { width: 22px; height: 22px; }
.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ink-3); pointer-events: none; }
.search input { width: 100%; height: 52px; border-radius: 999px; border: 0; background: var(--surface); box-shadow: var(--sh-1); padding: 0 18px 0 46px; font-size: 16px; }
.search input:focus { outline: none; box-shadow: 0 0 0 2px var(--ink); }
.form-error { background: var(--red-bg); color: var(--red-ink); border-radius: var(--r-sm); padding: 12px 14px; font-size: 15px; margin-bottom: 16px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; padding: 6px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); margin: 1px 0 0; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip[aria-pressed="true"] { background: var(--dark); color: #fff; border-color: var(--dark); }
.chip .spec-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* ---------- Beranda ---------- */
.progress-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.big-num { font-size: 52px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.big-num small { font-size: 22px; letter-spacing: -0.02em; margin-left: 2px; }
.stack-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--card); margin: 18px 0 12px; gap: 3px; }
.stack-bar span { display: block; height: 100%; border-radius: 999px; transition: width 0.5s var(--ease); }
.stack-bar .s-ok { background: var(--green); }
.stack-bar .s-bad { background: var(--red); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--ink-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.legend .l-ok { background: var(--green); }
.legend .l-bad { background: var(--red); }
.legend .l-none { background: var(--line-strong); }
.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.mini-card {
  flex: 0 0 min(64%, 230px);
  scroll-snap-align: start;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px;
  min-height: 176px;
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 0;
}
.mini-card:active { background: var(--card-press); }
.mini-card .mc-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-card .mc-meta { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.mini-card .mc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 16px; }
.empty-card { background: var(--card); border-radius: var(--r-lg); padding: 22px 18px; text-align: center; color: var(--ink-2); font-size: 15px; }
.empty-card svg { width: 30px; height: 30px; margin: 0 auto 10px; color: var(--ink-3); }
.empty-card strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.empty-card .btn { margin-top: 16px; }

/* Grafik batang (mengikuti layar Analytics) */
.kpi { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 6px; }
.kpi-value { font-size: 36px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 8px; }
.kpi-delta { font-size: 15px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 2px; letter-spacing: 0; }
.kpi-label { color: var(--ink-2); font-size: 15px; }
.chart { position: relative; height: 240px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; align-items: end; padding-top: 48px; margin-top: 8px; }
.chart .bar-col { display: flex; flex-direction: column; align-items: stretch; height: 100%; justify-content: flex-end; gap: 10px; border: 0; background: none; padding: 0; position: relative; min-width: 0; }
.chart .bar {
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #ebebe8 0%, #e2e2de 100%);
  min-height: 6px;
  position: relative;
  transition: height 0.5s var(--ease), background 0.2s;
}
.chart .bar-col[aria-pressed="true"] .bar { background: linear-gradient(180deg, #d9d8d4 0%, #cfcec9 100%); box-shadow: inset 0 3px 0 rgba(17, 17, 17, 0.18); }
.chart .bar-label { font-size: 12px; color: var(--ink-3); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart .bar-col[aria-pressed="true"] .bar-label { color: var(--ink); font-weight: 600; }
.chart .tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: var(--dark);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- Detail penerima / pemeriksaan ---------- */
.detail-name { font-size: 28px; line-height: 1.15; font-weight: 600; letter-spacing: -0.025em; margin: 8px 0 6px; }
.detail-sub { color: var(--ink-2); font-size: 15px; }
.kv { display: grid; grid-template-columns: 38% 1fr; gap: 10px 14px; font-size: 15px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.result-card { display: flex; align-items: center; gap: 14px; border-radius: var(--r-lg); padding: 18px; }
.result-card.ok { background: var(--green-bg); color: var(--green-ink); }
.result-card.bad { background: var(--red-bg); color: var(--red-ink); }
.result-card.none { background: var(--card); color: var(--ink-2); }
.result-card .rc-icon { width: 48px; height: 48px; border-radius: 50%; background: currentColor; display: grid; place-items: center; flex: none; }
.result-card .rc-icon svg { width: 26px; height: 26px; color: #fff; }
.result-card.none .rc-icon { background: var(--surface); }
.result-card.none .rc-icon svg { color: var(--ink-2); }
.result-card .rc-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.result-card .rc-sub { font-size: 14px; opacity: 0.9; margin-top: 2px; }
.result-card ul { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
.mat-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.mat-row:last-child { border-bottom: 0; }
.mat-row .mr-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.mat-row .mr-name { font-size: 16px; font-weight: 600; line-height: 1.35; }
.mat-row .mr-spec { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.mat-row .mr-note { font-size: 14px; color: var(--ink-2); margin-top: 6px; font-style: italic; }
.mat-row .thumbs { margin-top: 10px; }

/* ---------- Form pemeriksaan ---------- */
.form-progress { position: sticky; top: calc(var(--safe-t) + 72px); z-index: 15; margin: 0 -20px 6px; padding: 8px 20px 10px; background: var(--bg); }
.form-progress .fp-top { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }
.form-progress .fp-top strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.progress { height: 6px; border-radius: 999px; background: var(--card); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ink); border-radius: 999px; transition: width 0.3s var(--ease); }
.form-name { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
#f-nik { font-size: 22px; font-weight: 600; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
#f-nik::placeholder { font-size: 17px; font-weight: 400; letter-spacing: 0; color: var(--ink-3); }
.pen-head { display: flex; align-items: center; gap: 12px; }
.pen-title { flex: 1; min-width: 0; }
.pen-ok { width: 26px; height: 26px; color: var(--green); flex: none; }
.mat {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--sh-1);
  scroll-margin-top: 140px;
  transition: box-shadow 0.2s;
}
.mat + .mat { margin-top: 12px; }
.mat.invalid { box-shadow: 0 0 0 2px var(--red), var(--sh-1); }
.mat-head { display: flex; gap: 12px; align-items: flex-start; }
.mat-no { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--card); font-size: 13px; font-weight: 600; display: grid; place-items: center; color: var(--ink-2); margin-top: 1px; }
.mat-title { flex: 1; min-width: 0; }
.mat-title h3 { font-size: 16px; font-weight: 600; line-height: 1.35; letter-spacing: -0.005em; }
.mat-title p { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.mat-title p b { color: var(--ink); font-weight: 600; }
.mat-body { margin-top: 14px; display: grid; gap: 12px; }
.mat-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; background: var(--card); border-radius: 999px; padding: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); display: grid; place-items: center; }
.stepper button svg { width: 20px; height: 20px; }
.stepper button:active { background: var(--card-press); }
.stepper label { display: flex; align-items: baseline; justify-content: center; gap: 4px; min-width: 96px; padding: 0 6px; }
.stepper input { width: 58px; border: 0; background: transparent; text-align: right; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 8px 0; }
.stepper input:focus { outline: none; }
.stepper .unit { font-size: 14px; color: var(--ink-2); }
.quick-fill { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px dashed var(--line-strong); background: transparent; font-size: 14px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.quick-fill svg { width: 16px; height: 16px; }
.quick-fill:active { background: var(--card); }
.mat-msg { font-size: 14px; color: var(--amber-ink); display: flex; gap: 6px; align-items: center; }
.mat-msg.bad { color: var(--red-ink); }
.mat-msg svg { width: 16px; height: 16px; flex: none; }
.note-toggle { border: 0; background: none; padding: 4px 0; min-height: 36px; color: var(--ink-2); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.note-toggle svg { width: 16px; height: 16px; }
.note-input { width: 100%; min-height: 48px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); padding: 12px 14px; font-size: 16px; resize: vertical; }
.note-input:focus { outline: none; border-color: var(--ink); }

/* Foto */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: var(--card);
  border: 0;
  padding: 0;
  flex: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .t-state { position: absolute; right: 4px; bottom: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; display: grid; place-items: center; }
.thumb .t-state svg { width: 13px; height: 13px; }
.thumb.sm { width: 56px; height: 56px; border-radius: 12px; }
.thumb.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 24px; height: 24px; border: 3px solid var(--ink-3); border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
.add-photo {
  min-width: 76px;
  padding: 0 12px;
  height: 76px;
  border-radius: 14px;
  border: 1.5px dashed var(--line-strong);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  flex: none;
}
.add-photo svg { width: 24px; height: 24px; color: var(--ink); }
.add-photo:active { background: var(--card); }

/* ---------- Sheet (panel bawah) ---------- */
.backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(17, 17, 17, 0.38); opacity: 0; transition: opacity 0.25s; }
.backdrop.open { opacity: 1; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 91;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px 20px calc(24px + var(--safe-b));
  transform: translate(-50%, 100%);
  transition: transform 0.32s var(--ease);
  box-shadow: var(--sh-2);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-handle { width: 40px; height: 5px; border-radius: 999px; background: var(--line-strong); margin: 0 auto 18px; }
.sheet-head { margin-bottom: 20px; }
.sheet-head h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.sheet-head p { color: var(--ink-2); margin-top: 4px; font-size: 15px; }
.sheet .menu { display: grid; gap: 8px; }
.menu-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 0 18px; border: 0; border-radius: var(--r-md); background: var(--surface); font-size: 17px; font-weight: 500; text-align: left; }
.menu-item svg { width: 22px; height: 22px; }
.menu-item.danger { color: var(--red-ink); }
.menu-item:active { background: var(--card); }
.center-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 8px auto 16px; }
.center-icon svg { width: 36px; height: 36px; }
.center-icon.ok { background: var(--green-bg); color: var(--green-ink); }
.center-icon.warn { background: var(--amber-bg); color: var(--amber-ink); }
.center-icon.bad { background: var(--red-bg); color: var(--red-ink); }
.center-text { text-align: center; }
.center-text h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.center-text p { color: var(--ink-2); margin: 8px auto 24px; max-width: 34ch; }

/* Penampil foto */
.viewer { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; flex-direction: column; animation: fade 0.2s both; }
.viewer img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.viewer-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; padding: calc(var(--safe-t) + 14px) 16px; }
.viewer-bar .icon-btn { background: rgba(255, 255, 255, 0.16); color: #fff; box-shadow: none; }
.viewer-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 20px calc(var(--safe-b) + 18px); color: rgba(255, 255, 255, 0.85); font-size: 14px; text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-t) + 12px);
  z-index: 120;
  transform: translate(-50%, -140%);
  max-width: min(440px, calc(100% - 32px));
  background: var(--dark);
  color: #fff;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  box-shadow: var(--sh-2);
  transition: transform 0.3s var(--ease);
  display: flex;
  gap: 10px;
  align-items: center;
}
#toast.show { transform: translate(-50%, 0); }
#toast svg { width: 18px; height: 18px; flex: none; }
#toast.ok svg { color: #5fd38d; }
#toast.bad svg { color: #ff8a84; }

/* ---------- Impor ---------- */
.map-grid { display: grid; gap: 12px; }
.map-row { display: grid; grid-template-columns: 40% 1fr; gap: 10px; align-items: center; }
.map-row label { font-size: 15px; font-weight: 600; }
.map-row select { width: 100%; min-height: 48px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); padding: 0 12px; font-size: 15px; }
.preview-table { font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--sh-1); }
.stat b { display: block; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--ink-2); }

.skeleton { background: linear-gradient(90deg, var(--card) 25%, var(--card-press) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }
.sentinel { height: 1px; }
.fine { font-size: 13px; color: var(--ink-2); text-align: center; margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
