/* Tombol, form, bottom sheet, toast, dan komponen fitur (alokasi, jurnal, AI). */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 0.92rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.soft { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 0.82rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-row.three { grid-template-columns: 1fr 1fr 1fr; }

input, select, textarea {
  font: inherit; font-size: 16px; /* 16px: iOS tidak zoom saat fokus */
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; width: 100%; min-width: 0; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input:disabled, select:disabled { opacity: 0.6; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input[type="date"], input[type="month"] { -webkit-appearance: none; appearance: none; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label, label.field { display: flex; flex-direction: column; gap: 5px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 > * { min-width: 0; }
.check { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 500 !important; color: var(--ink) !important; cursor: pointer; min-height: 40px; }
.check input { width: 20px; height: 20px; min-height: 0; flex: none; accent-color: var(--primary); }
.search { position: relative; }
.search input { padding-left: 38px; border-radius: 99px; background: var(--surface); }
.search::before { content: '🔍'; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 0.9rem; opacity: 0.6; pointer-events: none; }
.amount-input { font-size: 1.9rem !important; font-weight: 800; text-align: center; padding: 14px !important; letter-spacing: -0.01em; }
.inline-input { min-height: 36px; padding: 6px 10px; font-size: 15px; }

/* ---------- bottom sheet ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(30, 15, 25, 0.42);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  width: 100%; max-width: 560px; max-height: calc(100dvh - var(--safe-t) - 24px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 0 16px calc(20px + var(--safe-b));
  animation: sheet-up 0.22s ease-out;
}
.modal.full { height: calc(100dvh - var(--safe-t) - 12px); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.modal-head {
  position: sticky; top: 0; z-index: 2; background: var(--bg);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 18px 0 10px; margin-bottom: 4px;
}
.modal-head::before { content: ''; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 99px; background: var(--line); }
.modal-head .close { flex: none; width: 36px; height: 36px; border-radius: 99px; border: 0; background: var(--surface-2); color: var(--ink); font-size: 1.3rem; cursor: pointer; line-height: 1; }
.sheet-foot { position: sticky; bottom: calc(-20px - var(--safe-b)); background: var(--bg); padding: 10px 0 calc(20px + var(--safe-b)); margin-bottom: calc(-20px - var(--safe-b)); border-top: 1px solid var(--line); z-index: 2; }

/* Menu "Lainnya" */
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.menu-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 14px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); font-size: 0.8rem; font-weight: 600; min-height: 86px; position: relative;
}
.menu-tile .ico { font-size: 1.5rem; }
.menu-tile.active { border-color: var(--primary); background: var(--primary-softer); color: var(--primary); }
.menu-tile .badge { position: absolute; top: 6px; right: 6px; }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 12px; right: 12px; top: calc(10px + var(--safe-t)); z-index: 90; display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: 536px; margin: 0 auto; }
.toast { padding: 12px 14px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 0.9rem; font-weight: 600; box-shadow: var(--shadow); animation: sheet-up 0.2s ease-out; }
.toast.success { background: var(--mint-ink); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(24px + var(--safe-t)) 20px calc(24px + var(--safe-b)); gap: 18px; }
.auth-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.auth-hero .brand-mark { width: 64px; height: 64px; border-radius: 20px; font-size: 1.8rem; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.8rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- buku ---------- */
.book-ico { width: 42px; height: 42px; border-radius: 13px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.3rem; flex: none; }

/* ---------- alokasi ---------- */
.alloc-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.alloc-row { display: grid; grid-template-columns: 1fr 120px 40px; gap: 6px; align-items: center; }
.alloc-row .row-error { grid-column: 1 / -1; }
.alloc-row .btn { min-height: 44px; padding: 0; }
.choice-box { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: var(--peach); }
.alloc-line { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.bulk-bar {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); z-index: 10;
  display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--primary-soft); box-shadow: 0 8px 24px rgba(60, 20, 40, 0.18);
}

/* ---------- editor jurnal ---------- */
.jrow { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.jrow .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jtotal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.memo-edit { cursor: pointer; border-bottom: 1px dashed var(--line); }
.line-card { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.line-card:first-child { border-top: 0; }
.dc { display: inline-block; min-width: 18px; font-size: 0.68rem; font-weight: 800; color: var(--muted); }

/* ---------- AI ---------- */
.code-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.code-box .mono { overflow-wrap: anywhere; font-size: 0.85rem; }
.snippet { margin: 8px 0 0; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 0.78rem; overflow-x: auto; white-space: pre; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.prompt-chip { display: block; padding: 10px 12px; border-radius: 12px; background: var(--lavender); color: var(--lavender-ink); font-size: 0.86rem; }

/* ---------- pasang aplikasi ---------- */
.install-banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: linear-gradient(135deg, var(--primary-soft), var(--lavender)); }
