:root {
  --bg: #f6f6f3;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e7e5df;
  --emerald: #047857;
  --emerald-bg: #d1fae5;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --rose: #be123c;
  --rose-bg: #ffe4e6;
  --grey-bg: #eceae4;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 4px 14px rgba(17, 24, 39, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
}
.app { max-width: 1180px; margin: 0 auto; padding: 16px; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
h1 { font-size: 22px; font-weight: 800; margin: 0; }
.rentang { display: flex; gap: 8px; flex-wrap: wrap; }
.rentang label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
input[type=date] {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px;
  min-height: 44px; padding: 0 10px;
}
.tabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; }
.tab {
  font: inherit; font-weight: 700; font-size: 13px; color: var(--muted);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  min-height: 44px; padding: 0 16px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab.active { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.badge {
  background: var(--rose-bg); color: var(--rose); border-radius: 999px;
  font-size: 11px; font-weight: 800; padding: 1px 8px;
}
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.tab.active .badge { background: #fff; }

.isi { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 16px; align-items: start; }
.daftar { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.detail { min-width: 0; position: sticky; top: 12px; }

.baris {
  background: var(--card); border: 1px solid transparent; border-radius: 16px;
  box-shadow: var(--shadow); padding: 12px 14px; min-height: 44px;
  cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%;
  display: block;
}
.baris.aktif { border-color: var(--emerald); }
.baris .nama { font-weight: 800; font-size: 15px; overflow-wrap: anywhere; }
.baris .info { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.baris .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.baris.batal .nama, .baris.batal .info { text-decoration: line-through; color: var(--muted); }

.chip { display: inline-flex; align-items: center; border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 3px 10px; }
.chip.hijau { background: var(--emerald-bg); color: var(--emerald); }
.chip.abu { background: var(--grey-bg); color: var(--muted); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.rose { background: var(--rose-bg); color: var(--rose); }
.chip.kecil { font-size: 10.5px; padding: 2px 8px; }

.kartu { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 18px; }
.kartu h2 { font-size: 22px; font-weight: 800; margin: 0 0 4px; overflow-wrap: anywhere; }
.kartu .meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.kartu .meta a { color: var(--emerald); font-weight: 700; text-decoration: none; }
.kartu .meta a:hover { text-decoration: underline; }
.seksi { margin-top: 18px; }
.seksi h3 { font-size: 11px; font-weight: 800; letter-spacing: .07em; color: var(--muted); margin: 0 0 8px; text-transform: uppercase; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 14px; }
.kv .k { color: var(--muted); }
.kv .v { overflow-wrap: anywhere; font-weight: 500; }
.kv .total { font-weight: 800; font-size: 16px; }
.btn-kembali {
  display: none; font: inherit; font-weight: 700; color: var(--emerald);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  min-height: 44px; padding: 0 16px; cursor: pointer; margin-bottom: 12px;
}
.btn {
  font: inherit; font-weight: 700; color: #fff; background: var(--emerald);
  border: 0; border-radius: 12px; min-height: 44px; padding: 0 18px; cursor: pointer;
}
.pesan { text-align: center; color: var(--muted); padding: 40px 12px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); }
.pesan.galat { color: var(--rose); }
.pesan .btn { margin-top: 12px; }
.pesan-detail { color: var(--muted); padding: 40px 12px; text-align: center; }
.skel { height: 72px; border-radius: 16px; background: linear-gradient(90deg, #ecebe6 25%, #f4f3ef 50%, #ecebe6 75%); background-size: 200% 100%; animation: kilau 1.2s infinite; }
@keyframes kilau { to { background-position: -200% 0; } }

@media (max-width: 759px) {
  .app { padding: 12px 16px; }
  .isi { display: block; }
  .detail { display: none; position: static; }
  body.lihat-detail .daftar { display: none; }
  body.lihat-detail .detail { display: block; }
  body.lihat-detail .tabs, body.lihat-detail .top { display: none; }
  .btn-kembali { display: inline-flex; align-items: center; }
  .rentang { width: 100%; }
  .rentang label { flex: 1; min-width: 0; }
  .rentang input { width: 100%; min-width: 0; }
  .kv { grid-template-columns: 96px 1fr; }
}
