/* Perjalanan Dinas — bento abu-abu/putih, aksen merah DOSE. Hanya mode terang. */
:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --card: #ffffff;
  --ink: #111111;
  --ink2: #6e6e73;
  --ink3: #a1a1a6;
  --line: #e5e5e2;
  --soft: #e8e8e5;
  --dark: #161616;
  --red: #dc423a;
  --red-press: #c23630;
  --warn: #b0702a;
  --r-tile: 26px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px; line-height: 1.35; -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; flex-shrink: 0; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

#app { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px calc(120px + var(--safe-b)); }

/* ---------- Atas ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; }
.trip-pill { display: flex; flex-direction: column; min-width: 0; }
.trip-pill .s { font-size: 12px; color: var(--ink2); }
.trip-pill .t { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 70vw; }
.trip-pill .t svg { width: 15px; height: 15px; vertical-align: -2px; color: var(--ink2); }
.logo { height: 26px; width: auto; flex-shrink: 0; }

.badge { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 50%; transform: translateX(-50%); z-index: 30;
  background: var(--dark); color: #fff; font-size: 12px; padding: 5px 12px; border-radius: 20px; }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: block; border-radius: var(--r-tile); padding: 16px; background: var(--card); position: relative; overflow: hidden; min-width: 0; width: 100%; }
button.tile { transition: transform .12s; }
button.tile:active { transform: scale(.98); }
.tile.span2 { grid-column: span 2; }
.tile.red { background: var(--red); color: #fff; }
.tile.grey { background: var(--soft); }
.tile .lbl { font-size: 12.5px; color: var(--ink2); font-weight: 500; display: block; }
.tile.red .lbl { color: rgba(255,255,255,.82); }
.tile .lbl.mt { margin-top: 22px; }
.tile .val { font-size: 19px; font-weight: 600; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { font-size: 11.5px; color: var(--ink3); margin-top: 3px; }
.tile-head { display: flex; justify-content: space-between; align-items: center; }
.tile .hero { font-size: 34px; font-weight: 600; margin-top: 6px; letter-spacing: -0.03em; }
.tile .hero.sm { font-size: 24px; }
.tile .bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.3); margin-top: 14px; overflow: hidden; }
.tile .bar i { display: block; height: 100%; background: #fff; border-radius: 3px; }
.tile-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: rgba(255,255,255,.82); margin-top: 8px; }
.chip { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); }
.chip.grey { background: var(--bg); }
.chip.red { background: var(--red); color: #fff; }
.tile.add { display: flex; flex-direction: column; justify-content: space-between; min-height: 140px; }
.add-lbl { font-size: 17px; font-weight: 600; line-height: 1.2; }

/* ---------- Daftar pengeluaran ---------- */
.sect { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 2px 6px; }
.sect h3 { font-size: 15px; font-weight: 600; margin: 0; }
.sect > span { font-size: 12.5px; color: var(--ink2); }
.tx { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tx:active { background: rgba(0,0,0,.03); }
.tx.pending { opacity: .6; }
.ti { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; color: var(--ink2); }
.ti img { width: 100%; height: 100%; object-fit: cover; }
.tm { flex: 1; min-width: 0; }
.tm b { display: block; font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm span { font-size: 12px; color: var(--ink2); }
.ta { text-align: right; font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.rc { display: block; font-size: 10.5px; color: var(--ink3); font-weight: 400; margin-top: 1px; }
.rc.warn { color: var(--warn); }

.empty { text-align: center; padding: 40px 20px; color: var(--ink2); }
.empty.big { padding-top: 18vh; }
.empty .icon svg { width: 44px; height: 44px; color: var(--ink3); }
.empty h3 { color: var(--ink); margin: 10px 0 6px; font-size: 17px; }
.empty p { margin: 0 0 18px; font-size: 14px; }

/* ---------- Laporan ---------- */
.card { background: var(--card); border-radius: 20px; }
.note { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 12px 14px; border-radius: 16px; background: #fbefe2; color: #8a5318; font-size: 13px; }
.doc { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 20px; padding: 14px; margin-bottom: 8px; }
.doc:active { background: #fafafa; }
.fi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.fi.pdf { background: var(--red); color: #fff; }
.fi.xls { background: var(--soft); color: var(--ink); }
.dt { flex: 1; min-width: 0; }
.dt b { display: block; font-size: 14.5px; font-weight: 500; }
.dt span { font-size: 12px; color: var(--ink2); }
.dl { width: 34px; height: 34px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; }
.kv-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv-list > div:last-child { border-bottom: 0; }
.kv-list span { color: var(--ink2); flex-shrink: 0; }
.kv-list b { font-weight: 500; text-align: right; }
.kv-list small { display: block; color: var(--ink2); font-weight: 400; font-size: 12px; }
.notes { width: 100%; border: 0; padding: 14px 16px; resize: vertical; font-size: 14px; outline: none; display: block; }
.link { font-size: 14px; font-weight: 500; color: var(--red); }
.link.muted { color: var(--ink2); font-weight: 400; }
.link.red { color: var(--red); font-weight: 600; }
.link.attn::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-left: 5px; vertical-align: 1px; }
.danger-text { color: var(--red) !important; }
.center { display: block; width: 100%; text-align: center; padding: 12px 0; }
.actions { display: grid; gap: 8px; margin-top: 26px; }

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 22px; border-radius: 25px;
  background: var(--card); font-weight: 600; font-size: 15px; }
.btn:active { opacity: .8; }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:active { background: var(--red-press); }
.btn.block { width: 100%; }

/* ---------- Navigasi bawah ---------- */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + var(--safe-b)); width: min(524px, calc(100% - 36px));
  display: flex; gap: 10px; align-items: center; z-index: 20; }
.nav .pill { flex: 1; height: 60px; background: var(--dark); border-radius: 30px; display: flex; padding: 5px; gap: 4px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }
.nav .pill button { flex: 1; border-radius: 25px; display: flex; align-items: center; justify-content: center; gap: 6px; color: #8d8d8d; font-size: 13.5px; font-weight: 500; }
.nav .pill button.on { background: #fff; color: var(--ink); }
.fab { width: 60px; height: 60px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 30px -10px rgba(220,66,58,.7); }
.fab:active { background: var(--red-press); }
.fab svg { width: 26px; height: 26px; }

/* ---------- Sheet ---------- */
dialog { border: 0; padding: 10px 18px calc(22px + var(--safe-b)); margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--bg); color: var(--ink); border-radius: 30px 30px 0 0; }
dialog.full { height: 92vh; }
dialog.full[open] { display: flex; flex-direction: column; }
dialog.full[open] > form { display: flex; flex-direction: column; flex: 1; }
dialog[open] { animation: up .28s cubic-bezier(.2,.8,.2,1); }
dialog::backdrop { background: rgba(0,0,0,.3); }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.grab { width: 38px; height: 5px; border-radius: 3px; background: #c7c7c7; margin: 0 auto 12px; flex-shrink: 0; }
.sh-head { display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; margin-bottom: 14px; }
.sh-head h4 { margin: 0; text-align: center; font-size: 16px; font-weight: 600; }
.sh-head > :last-child { text-align: right; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; flex-shrink: 0; }
.chips::-webkit-scrollbar { display: none; }
.chips button { white-space: nowrap; font-size: 13px; padding: 8px 13px; border-radius: 20px; background: var(--card); color: var(--ink2); border: 1px solid var(--line); }
.chips button.on { background: var(--red); border-color: var(--red); color: #fff; }

.amount { text-align: center; margin: 20px 0 16px; }
.amount small { display: block; font-size: 12px; color: var(--ink2); margin-bottom: 4px; }
.amount .big { font-size: 44px; font-weight: 600; letter-spacing: -0.04em; display: inline-flex; align-items: center; }
.amount .rp { font-size: 22px; color: var(--ink3); margin-right: 6px; font-weight: 500; }
.amount .caret { width: 2.5px; height: 40px; background: var(--red); margin-left: 3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.meta { background: var(--card); border-radius: 18px; }
.meta label, .meta .meta-row { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--ink2); }
.meta .meta-row { padding: 0; gap: 0; border-bottom: 0; }
.meta .meta-row label { border-bottom: 0; }
.meta label.grow { flex: 1; }
.meta input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 15px; color: var(--ink); height: 44px; }
.meta input::placeholder { color: var(--ink3); }
.photo-btn { border-left: 1px solid var(--line); cursor: pointer; font-size: 14px; color: var(--ink); }
.photo-btn.has { color: var(--red); }
.photo-btn input { display: none; }
.rcpt { margin-top: 10px; display: flex; align-items: center; gap: 12px; }
.rcpt img { height: 64px; width: 64px; object-fit: cover; border-radius: 12px; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: auto; padding-top: 12px; }
.keypad button { height: 52px; border-radius: 16px; background: var(--card); display: grid; place-items: center; font-size: 22px; font-weight: 500; text-align: center; }
.keypad button:active { background: var(--soft); }
.keypad button.fn { background: var(--soft); font-size: 17px; }
.keypad button.fn:active { background: #d9d9d5; }
.keypad svg { width: 22px; height: 22px; }

.trip-list { flex: 1; overflow-y: auto; }
.grp-lbl { font-size: 12px; color: var(--ink2); margin: 12px 4px 8px; text-transform: uppercase; letter-spacing: .05em; }
.trip { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; background: var(--card); border-radius: 20px; margin-bottom: 8px; }
.trip.sel { box-shadow: 0 0 0 2px var(--red) inset; }
.tb { flex: 1; min-width: 0; }
.tb b { display: block; font-size: 15px; font-weight: 600; }
.tb span { font-size: 12px; color: var(--ink2); }
.st { font-size: 11px; padding: 4px 9px; border-radius: 12px; background: var(--soft); color: var(--ink2); }
.st.on { background: var(--red); color: #fff; }
dialog .btn.primary.block { margin-top: 12px; flex-shrink: 0; }

.form { background: var(--card); border-radius: 20px; margin-bottom: 10px; flex-shrink: 0; }
.form label { display: block; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.form label:last-child { border-bottom: 0; }
.form small { display: block; font-size: 11.5px; color: var(--ink2); margin-bottom: 2px; }
.form input, .form textarea { width: 100%; border: 0; outline: none; background: none; font-size: 16px; padding: 0; resize: none; }
.form input::placeholder, .form textarea::placeholder { color: var(--ink3); }
.form .two { display: flex; }
.form .two label { flex: 1; border-bottom: 0; min-width: 0; }
.form .two label + label { border-left: 1px solid var(--line); }
.form-title { font-size: 12px; color: var(--ink2); padding: 12px 16px 0; text-transform: uppercase; letter-spacing: .05em; }
.adv b { font-size: 18px; font-weight: 600; }
.hint { font-size: 12px; color: var(--ink2); margin: 0 6px; line-height: 1.45; }

/* ---------- Login ---------- */
.login { max-width: 340px; margin: 16vh auto 0; text-align: center; display: grid; gap: 12px; }
.login-logo { height: 56px; margin: 0 auto 10px; }
.login h2 { margin: 0; font-size: 24px; }
.login p { margin: 0 0 8px; color: var(--ink2); }
.field { height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); padding: 0 16px; font-size: 16px; outline: none; }
.field:focus { border-color: var(--ink3); }

/* ---------- Toast ---------- */
#toast { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 50%; transform: translate(-50%, -80px); z-index: 100;
  background: var(--dark); color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px; transition: transform .3s; max-width: 90vw; text-align: center; }
#toast.show { transform: translate(-50%, 0); }

/* ---------- Dana ---------- */
.fund-list { margin-bottom: 10px; }
.fund { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.fund:last-child { border-bottom: 0; }
.fund .fl { flex: 1; min-width: 0; }
.fund .fl b { display: block; font-weight: 500; }
.fund .fl span { font-size: 12px; color: var(--ink2); }
.fund > .num { font-weight: 500; }
.fund.total { font-weight: 600; }
.fund.total .fl b, .fund.total .num { font-weight: 600; }
.fund .x { color: var(--ink3); padding: 4px; margin-right: -6px; }
dialog:not(.full) .btn.primary.block { margin-top: 14px; }

/* ---------- Mode lihat saja ---------- */
.rcpt-full { display: block; width: 100%; border-radius: 18px; margin-top: 10px; }
.role-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; background: var(--soft); color: var(--ink2); margin-left: 6px; vertical-align: 1px; }
