* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #111827;
  --green: #047857;
  --red: #b91c1c;
  --amber: #b45309;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
}

body {
  min-height: 100vh;
}

header.app {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--brand);
  color: #fff;
}

header.app .nama {
  margin-left: auto;
  font-size: 14px;
  opacity: .85;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 20px;
  margin: 0 0 16px;
}

h2 {
  font-size: 16px;
  margin: 24px 0 8px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.besar {
  font-size: 20px;
  font-weight: 700;
}

.hijau { color: var(--green); }
.merah { color: var(--red); }
.amber { color: var(--amber); }

button, .tombol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

button.utama, .tombol.utama {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

button.bahaya {
  color: var(--red);
  border-color: #fecaca;
}

button:disabled {
  opacity: .5;
  cursor: default;
}

label {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}

input, select, textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 80px;
}

.baris {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.baris:first-child {
  border-top: 0;
}

.baris .isi {
  flex: 1;
  min-width: 0;
}

.baris .judul {
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.badge.jatuh_tempo { background: #fef3c7; color: var(--amber); }
.badge.lunas { background: #d1fae5; color: var(--green); }
.badge.sengketa { background: #fee2e2; color: var(--red); }
.badge.dibatalkan { background: var(--line); color: var(--muted); }

.banner {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: var(--amber);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-weight: 600;
}

.galat {
  color: var(--red);
  font-size: 14px;
  margin: 8px 0;
}

dialog {
  width: min(560px, calc(100vw - 24px));
  border: 0;
  border-radius: 16px;
  padding: 20px;
  background: var(--card);
  color: var(--text);
}

dialog::backdrop {
  background: rgb(0 0 0 / .45);
}

dialog .aksi {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.aksi-baris {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

@media (max-width: 380px) {
  .grid2 { grid-template-columns: 1fr; }
}
