/* PoC Settlement - gaya bersama. Vanilla CSS, tanpa CDN, offline penuh. */
:root {
  --ink: #18181b; --ink-2: #3f3f46; --muted: #6b7280; --line: #e4e4e7; --line-strong: #d4d4d8;
  --bg: #f6f7f9; --card: #ffffff;
  --accent: #2456d6; --accent-dark: #1c46b5; --accent-soft: #eef2fd; --accent-ring: rgb(36 86 214 / .28);
  --ok-bg: #e5f6ec; --ok-tx: #14663b; --ok-line: #bfe6cf;
  --bad-bg: #fdeaea; --bad-tx: #a11d2b; --bad-line: #f5c6c9;
  --warn-bg: #fdf3d8; --warn-tx: #7c5a10; --warn-line: #f0dda4;
  --info-bg: #e7f2fb; --info-tx: #135684; --info-line: #c4dff2;
  --radius: 12px; --radius-sm: 8px;
  --shadow-pop: 0 12px 32px -8px rgb(24 24 27 / .22), 0 2px 8px -2px rgb(24 24 27 / .10);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5;
  caret-color: var(--accent);
}
::selection { background: var(--accent); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { height: 8px; width: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

h1, h2, h3 { margin: 0 0 .4rem; letter-spacing: -0.015em; line-height: 1.3; }
h1 { font-size: 1.25rem; } h2 { font-size: 1.05rem; } h3 { font-size: .95rem; }
p { margin: .3rem 0; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Kerangka ---------- */
.topbar {
  background: rgb(255 255 255 / .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: .6rem 1rem;
  display: flex; align-items: center; gap: .65rem; position: sticky; top: 0; z-index: 20;
}
.topbar .brand { font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: .5rem; }
.brand-mark {
  width: 1.6rem; height: 1.6rem; border-radius: .45rem; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 800; letter-spacing: .02em; flex: none;
}
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: .85rem; text-align: right; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 1.1rem 1rem 3rem; }
.wrap--sempit { max-width: 480px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin-bottom: 1rem;
}
.card h2 { margin-bottom: .55rem; }
.muted { color: var(--muted); font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em; }

/* ---------- Kontrol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  border-radius: var(--radius-sm); padding: .5rem .95rem; font: inherit; font-size: .9rem;
  font-weight: 500; cursor: pointer; text-decoration: none;
  transition: background-color .12s ease-out, border-color .12s ease-out, transform .06s ease-out;
}
.btn:hover { background: #f4f4f5; border-color: #b9b9c0; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn--sm { padding: .32rem .65rem; font-size: .8rem; }
.btn--blok { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.badge {
  display: inline-block; border-radius: 999px; padding: .14rem .6rem;
  font-size: .74rem; font-weight: 600; white-space: nowrap; letter-spacing: .005em;
}
.badge--ok { background: var(--ok-bg); color: var(--ok-tx); }
.badge--bad { background: var(--bad-bg); color: var(--bad-tx); }
.badge--warn { background: var(--warn-bg); color: var(--warn-tx); }
.badge--info { background: var(--info-bg); color: var(--info-tx); }
.badge--muted { background: #eceef1; color: var(--muted); }

.field { margin-bottom: .8rem; }
.field label { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-2); margin-bottom: .3rem; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .52rem .65rem; font: inherit; font-size: 16px; background: var(--card); color: var(--ink);
  transition: border-color .12s ease-out, box-shadow .12s ease-out;
}
.field input::placeholder, .field textarea::placeholder { color: #9ca3af; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
input[type="file"] { font-size: .85rem; }
input[type="file"]::file-selector-button {
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  border-radius: var(--radius-sm); padding: .35rem .7rem; margin-right: .6rem;
  font: inherit; font-size: .82rem; font-weight: 500; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: #f4f4f5; }

/* ---------- Tabel ---------- */
.tabel-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.tabel { border-collapse: collapse; width: 100%; font-size: .875rem; }
.tabel th {
  text-align: left; background: #f4f5f7; padding: .5rem .7rem; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.tabel td { padding: .52rem .7rem; border-top: 1px solid var(--line); vertical-align: top; }
.tabel td.angka, .tabel th.angka { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabel tr.klik { cursor: pointer; }
.tabel tbody tr { transition: background-color .1s ease-out; }
.tabel tr.klik:hover { background: var(--accent-soft); }
.tabel tr.baris-bad { background: #fdf1f1; }
.tabel tr.baris-bad.klik:hover { background: #fbe3e3; }
.tabel tr.baris-warn { background: #fdf8e9; }
.tabel tr.baris-warn.klik:hover { background: #faf0d2; }

/* ---------- Banner ---------- */
.banner {
  border-radius: var(--radius-sm); padding: .7rem .9rem; margin: .6rem 0;
  border: 1px solid var(--line); background: var(--card); font-size: .875rem; line-height: 1.45;
}
.banner b { display: block; margin-bottom: .18rem; letter-spacing: -0.005em; }
.banner--ok { background: var(--ok-bg); color: var(--ok-tx); border-color: var(--ok-line); }
.banner--bad { background: var(--bad-bg); color: var(--bad-tx); border-color: var(--bad-line); }
.banner--warn { background: var(--warn-bg); color: var(--warn-tx); border-color: var(--warn-line); }
.banner--info { background: var(--info-bg); color: var(--info-tx); border-color: var(--info-line); }

/* ---------- Tab ---------- */
.tabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button {
  border: none; background: none; padding: .55rem .95rem; font: inherit; font-size: .9rem;
  cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .12s ease-out;
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.aktif { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- Modal + toast ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgb(24 24 27 / .45);
  display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50;
  animation: fade-in .16s ease-out;
}
.modal {
  background: var(--card); border-radius: var(--radius); padding: 1.15rem;
  width: 100%; max-width: 34rem; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-pop);
  animation: pop-in .18s cubic-bezier(.16, 1, .3, 1);
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@media (prefers-reduced-motion: reduce) {
  .modal-back, .modal, .toast { animation: none; }
  * { transition: none !important; }
}

.toast {
  position: fixed; bottom: 1.1rem; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: var(--radius-sm);
  padding: .58rem 1rem; font-size: .85rem; z-index: 99; max-width: 92vw;
  box-shadow: var(--shadow-pop);
  animation: toast-in .2s cubic-bezier(.16, 1, .3, 1);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- KPI ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .65rem .85rem; }
.kpi .v { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: .75rem; color: var(--muted); }

/* ---------- Login ---------- */
.login-back {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background:
    radial-gradient(60rem 30rem at 85% -10%, var(--accent-soft), transparent 60%),
    var(--bg);
}
.login-card { width: 100%; max-width: 22rem; padding: 1.5rem 1.4rem; }
.login-card .brand-mark { width: 2.6rem; height: 2.6rem; border-radius: .8rem; font-size: 1.05rem; margin: 0 auto .7rem; display: flex; }

/* ---------- Lain-lain ---------- */
.foto-thumb { max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); display: block; }
.lembar-list { display: flex; flex-direction: column; gap: .5rem; }
.legend-aksi { margin-top: .6rem; }

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap { padding: .85rem .75rem 3rem; }
  .card { padding: .85rem .9rem; }
  .topbar .who { display: none; }
  .btn { padding: .55rem 1rem; }   /* target sentuh nyaman di HP */
  .btn--sm { padding: .4rem .7rem; }
}

/* Kartu aplikasi di gateway */
a.card { display: block; text-decoration: none; color: inherit; transition: border-color .12s ease-out, background-color .12s ease-out; }
a.card:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Foto bukti: selalu terlihat sebagai area, sekecil apa pun berkasnya */
.foto-thumb { width: 100%; max-width: 480px; min-height: 140px; background: #eef0f3; object-fit: contain; }
.foto-gagal {
  max-width: 480px; min-height: 140px; display: flex; flex-direction: column; gap: .4rem;
  align-items: center; justify-content: center; border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm); background: #f4f5f7; color: var(--muted);
  font-size: .85rem; padding: 1rem; text-align: center;
}
