/* =========================================================
   Lamar Mi — Gaya Neo-Brutalism Hangat & Ramah (Mobile-first)
   ========================================================= */

:root {
  --bg-cream: #fff4e4;
  --surface: #ffffff;
  --surface-soft: #fff9f0;
  --ink: #1a1a1a;
  --muted: #5f574f;
  --coral: #f95738;
  --coral-dark: #e04427;
  --sage: #38b26d;
  --sage-soft: #d9f5e5;
  --yellow: #f7c948;
  --yellow-soft: #fff2c6;
  --danger-soft: #ffe2dc;
  --border: 2.5px solid #1a1a1a;
  --shadow: 4px 4px 0px #1a1a1a;
  --shadow-sm: 2.5px 2.5px 0px #1a1a1a;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-cream);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.45;
  min-height: 100%;
}

.hidden {
  display: none !important;
}

.app-frame {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg-cream);
  position: relative;
}

/* ==================== KOMPONEN UMUM ==================== */

.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
}

.section-card {
  margin-bottom: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  padding: 13px 18px;
  border: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--coral);
  color: #ffffff;
}

.btn-secondary {
  background: var(--yellow);
  color: var(--ink);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
}

.btn-full {
  width: 100%;
}

.chip-btn {
  background: var(--yellow-soft);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 6px 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.chip-btn:active {
  transform: translate(1.5px, 1.5px);
  box-shadow: none;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:active {
  transform: translate(1.5px, 1.5px);
  box-shadow: none;
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
}

.badge-sage {
  background: var(--sage-soft);
  color: var(--ink);
}

.badge-yellow {
  background: var(--yellow);
  color: var(--ink);
}

.alert-box {
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
}

.alert-error {
  background: var(--danger-soft);
  color: #7c1808;
}

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
  max-width: 90%;
  text-align: center;
}

/* ==================== LAYAR LOGIN & PILIH PENGGUNA ==================== */

.screen {
  min-height: 100vh;
  padding: 28px 18px 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-wrap {
  width: 100%;
}

.brand-pill {
  display: inline-block;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
  box-shadow: 2px 2px 0 var(--ink);
}

.auth-title {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--muted);
}

.auth-card {
  padding: 20px 18px;
}

.field-group {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}

.input-box {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 14px;
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--ink);
  outline: none;
}

.input-box:focus {
  background: #ffffff;
  box-shadow: 3px 3px 0 var(--ink);
}

.input-pin {
  letter-spacing: 0.18em;
  font-size: 18px;
  font-weight: 800;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-footer-note {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

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

.user-pick-card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px 12px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.12s ease;
}

.user-pick-card:hover {
  background: var(--yellow-soft);
}

.user-pick-card:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.user-avatar {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: var(--border);
  background: var(--coral);
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-pick-card:nth-child(2) .user-avatar {
  background: var(--sage);
}

.user-pick-name {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}

.user-pick-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ==================== APP SHELL & TOP BAR ==================== */

.app-shell {
  padding-bottom: 92px;
}

.pull-indicator {
  margin: 10px 16px 0;
  padding: 8px 12px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  transition: background 0.15s ease, transform 0.12s ease;
}

.pull-indicator.is-ready {
  background: var(--sage-soft);
}

.top-bar {
  padding: 18px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.greeting-sub {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.top-title {
  margin: 2px 0 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading-pill {
  margin: 0 16px 12px;
  padding: 8px 12px;
  background: var(--yellow-soft);
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.main-content {
  padding: 0 16px;
}

/* ==================== KARTU TIKET BERANDA ==================== */

.ticket-card {
  position: relative;
  background: var(--coral);
  color: #ffffff;
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  margin-bottom: 14px;
  overflow: hidden;
}

.ticket-notch {
  position: absolute;
  top: 56%;
  width: 18px;
  height: 18px;
  background: var(--bg-cream);
  border: var(--border);
  border-radius: 50%;
  transform: translateY(-50%);
}

.ticket-notch-left {
  left: -11px;
}

.ticket-notch-right {
  right: -11px;
}

.ticket-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.ticket-label {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.95;
}

.ticket-date-pill {
  font-family: inherit;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  font-size: 11px;
  font-weight: 700;
  background: rgba(26, 26, 26, 0.22);
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.ticket-footer-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.ticket-cek-link {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  padding: 2px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-mini-btn {
  background: transparent;
  border: none;
  color: var(--coral-dark);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  padding: 2px 4px;
}

.ticket-amount {
  margin-top: 6px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.ticket-subnote {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.ticket-divider {
  margin: 14px 0;
  border-top: 2px dashed rgba(255, 255, 255, 0.45);
}

.ticket-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ticket-stat-box {
  background: rgba(255, 255, 255, 0.18);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  padding: 8px 9px;
}

.ticket-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.92;
}

.ticket-stat-value {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
  word-break: break-word;
}

/* ==================== KARTU PROGRES & EMPTY STATE ==================== */

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.progress-caption {
  margin: 8px 0 10px;
  font-size: 14px;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 16px;
  background: var(--surface-soft);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--sage);
  border-right: 2px solid var(--ink);
  transition: width 0.25s ease;
}

.empty-card {
  text-align: center;
  padding: 24px 18px;
}

.empty-emoji {
  font-size: 36px;
  margin-bottom: 6px;
}

.empty-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
}

.empty-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.muted-text {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ==================== NAVIGASI BAWAH ==================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 70px;
  background: var(--surface);
  border-top: var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 0 6px 4px;
  z-index: 50;
}

.nav-item {
  background: transparent;
  border: none;
  font-family: inherit;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  cursor: pointer;
}

.nav-item.active {
  color: var(--ink);
}

.nav-item.active .nav-label {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2.5px;
  text-underline-offset: 3px;
}

.nav-icon {
  font-size: 18px;
  line-height: 1;
}

.nav-label {
  font-size: 11px;
  font-weight: 700;
}

.nav-item-fab {
  position: relative;
  top: -14px;
}

.nav-fab-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--coral);
  color: #ffffff;
  border: var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.nav-item-fab:active .nav-fab-circle {
  transform: translate(2px, 2px);
  box-shadow: none;
}

/* ==================== DAFTAR BELANJA (LANGKAH 4) ==================== */

.list-header-block {
  margin-bottom: 12px;
}

.section-heading {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.list-progress-sub {
  margin: 4px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.progress-track-sm {
  height: 11px;
}

.filter-panel {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  pointer-events: none;
}

.search-input {
  padding-left: 38px;
  background: var(--surface);
  font-size: 14px;
}

.status-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.status-pills::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex: 0 0 auto;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.filter-pill.active {
  background: var(--ink);
  color: #ffffff;
}

.select-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.select-box {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 10px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.category-card {
  margin-bottom: 14px;
  padding: 14px 14px 6px;
}

.category-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}

.category-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.category-card-subtotal {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.item-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1.5px dashed #d7cbbd;
}

.item-row:last-child {
  border-bottom: none;
}

.item-row.is-cancelled {
  opacity: 0.55;
}

.check-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border-radius: 8px;
  border: 2.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.check-btn.is-checked {
  background: var(--sage);
  color: #ffffff;
}

.check-btn.is-dp {
  background: var(--yellow);
  color: var(--ink);
  font-size: 10px;
}

.check-btn:active {
  transform: scale(0.94);
}

.item-main {
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
}

.item-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.item-name {
  font-size: 14px;
  font-weight: 800;
  word-break: break-word;
}

.item-row.is-cancelled .item-name {
  text-decoration: line-through;
}

.item-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.item-diff-line {
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 800;
}

.diff-hemat {
  color: #1d7a46;
}

.diff-mahal {
  color: #c23318;
}

.item-actions-inline {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.item-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  text-decoration: none;
}

.item-link-pill:hover {
  background: var(--yellow-soft);
}

.item-author-tag {
  font-size: 11px;
  color: var(--muted);
}

.item-price-col {
  flex: 0 0 auto;
  text-align: right;
  max-width: 132px;
}

.item-price {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.item-planned-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.badge-sm {
  font-size: 10.5px;
  padding: 2px 8px;
  border-width: 1.5px;
}

.badge-coral {
  background: var(--danger-soft);
  color: #7c1808;
}

/* ==================== MODAL ==================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(26, 26, 26, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
}

@media (min-width: 520px) {
  .modal-backdrop {
    align-items: center;
  }
}

.modal-card {
  width: 100%;
  max-width: 450px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 18px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.icon-btn-sm {
  width: 32px;
  height: 32px;
  font-size: 14px;
  border-radius: 10px;
}

.purchase-item-title {
  margin: 10px 0 0;
  font-size: 16px;
  font-weight: 800;
}

.diff-preview-box {
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
}

.diff-preview-box.is-hemat {
  background: var(--sage-soft);
  color: #145b33;
}

.diff-preview-box.is-mahal {
  background: var(--danger-soft);
  color: #7c1808;
}

.diff-preview-box.is-sama {
  background: var(--surface-soft);
  color: var(--ink);
}

.alert-warning {
  background: var(--yellow-soft);
  color: var(--ink);
}

.checkbox-confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.checkbox-confirm-row input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1.5px dashed #e1d7ca;
  font-size: 13px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--muted);
  font-weight: 600;
}

.detail-value {
  font-weight: 800;
  text-align: right;
  word-break: break-word;
}

/* ==================== LANGKAH 5: FORM, SUMBER DANA, PENGATURAN ==================== */

.chip-btn-coral {
  background: var(--coral);
  color: #ffffff;
}

.income-chips-wrap {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.income-chip-card {
  flex: 0 0 auto;
  min-width: 145px;
  background: var(--surface-soft);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

.income-chip-card:hover {
  background: var(--yellow-soft);
}

.income-chip-source {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.income-chip-amount {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.income-chip-meta {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.subtab-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.subtab-btn {
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 9px 6px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}

.subtab-btn.active {
  background: var(--yellow);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sub-box {
  background: var(--surface-soft);
  border: 2px dashed var(--ink);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}

.guard-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-danger-outline {
  background: var(--danger-soft);
  color: #7c1808;
}

.alert-success {
  background: var(--sage-soft);
  color: #145b33;
}

.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-soft);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 700;
}

.tag-remove-btn {
  background: transparent;
  border: none;
  color: #a1200a;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
}

.inline-add-row {
  display: flex;
  gap: 8px;
}

.btn-sm-inline {
  flex: 0 0 auto;
  padding: 10px 14px;
  font-size: 13px;
}

.glossary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.glossary-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface-soft);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12.5px;
}

.glossary-term {
  font-weight: 800;
  color: var(--ink);
}

.glossary-meaning {
  color: var(--muted);
  margin-top: 2px;
}

.restore-steps {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--muted);
}

.restore-steps li {
  margin-bottom: 4px;
}

/* ==================== FASE 2A: CATAT CEPAT (CHAT & KARTU KONFIRMASI) ==================== */

.subtab-bar-4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.subtab-bar-4 .subtab-btn {
  font-size: 11.5px;
  padding: 8px 4px;
}

.smart-chat-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.smart-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quick-chips-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.quick-chips-row::-webkit-scrollbar {
  display: none;
}

.example-chip {
  flex: 0 0 auto;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.example-chip:hover {
  background: var(--yellow-soft);
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px 2px 8px;
}

.chat-bubble {
  max-width: 88%;
  padding: 10px 13px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: 2.5px 2.5px 0 var(--ink);
  word-break: break-word;
  white-space: pre-line;
}

.chat-bubble-user {
  align-self: flex-end;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
  border-bottom-right-radius: 4px;
}

.chat-bubble-bot {
  align-self: flex-start;
  background: var(--surface);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.chat-bubble-rejected {
  align-self: flex-start;
  background: var(--surface);
  color: var(--muted);
  border: 2px dashed var(--ink);
  border-radius: 16px;
  padding: 10px 13px;
  font-size: 13px;
  max-width: 90%;
  white-space: pre-line;
}

.confirm-card {
  width: 100%;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px;
}

.confirm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.confirm-card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
}

.confirm-engine-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.confirm-item-row {
  padding: 8px 0;
  border-bottom: 1.5px dashed #d7cbbd;
}

.confirm-item-row:last-of-type {
  border-bottom: none;
}

.confirm-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.confirm-item-name {
  font-size: 14px;
  font-weight: 800;
}

.confirm-item-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.confirm-item-price {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.confirm-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 2px solid var(--ink);
  font-size: 14.5px;
  font-weight: 800;
}

.confirm-warning-pill {
  margin-top: 9px;
  padding: 8px 10px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.confirm-choice-row {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.confirm-edit-box {
  margin-top: 8px;
  padding: 8px;
  background: var(--surface-soft);
  border: 1.5px dashed var(--ink);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.confirm-edit-box input,
.confirm-edit-box select {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: #ffffff;
}

.confirm-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-confirm-sm {
  padding: 8px 13px;
  font-size: 13px;
  border-radius: 11px;
}

.btn-ink {
  background: var(--ink);
  color: #ffffff;
}

.confirm-status-done {
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 800;
  border: 1.5px solid var(--ink);
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  padding: 5px 6px 5px 14px;
}

.chat-text-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.mic-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--yellow-soft);
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mic-btn.is-recording {
  background: var(--coral);
  color: #ffffff;
}

.voice-recording-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: var(--danger-soft);
  border: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.voice-rec-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coral-dark);
  animation: pulseDot 1s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.voice-rec-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-send-btn {
  background: var(--coral);
  color: #ffffff;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.chat-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==================== FASE 2C: IMPOR WHATSAPP ==================== */

.subtab-bar-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.subtab-bar-scroll::-webkit-scrollbar {
  display: none;
}

.subtab-bar-scroll .subtab-btn {
  flex: 0 0 auto;
  padding: 8px 11px;
  font-size: 12px;
}

.wa-textarea {
  resize: vertical;
  min-height: 120px;
  font-size: 13.5px;
  line-height: 1.45;
}

.wa-row-card {
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--surface);
  padding: 10px 11px;
  margin-bottom: 9px;
}

.wa-row-card.is-uncertain {
  background: var(--yellow-soft);
}

.wa-row-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.wa-row-checkbox {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.wa-row-main {
  flex: 1 1 auto;
  min-width: 0;
}

.wa-row-title-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.wa-mini-actions {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wa-mini-btn {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.wa-mini-btn-warn {
  background: var(--yellow);
}

.wa-term-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  background: var(--surface-soft);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  margin-bottom: 8px;
}

.wa-term-input-row {
  display: flex;
  gap: 6px;
}

/* ==================== FASE 3 LANGKAH 1: MASKOT LAMI & BERANDA LENGKAP ==================== */

.template-chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: none;
}

.template-chips-row::-webkit-scrollbar {
  display: none;
}

.template-chip {
  flex: 0 0 auto;
  background: var(--surface-soft);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 13px;
  box-shadow: 2px 2px 0 var(--ink);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.template-chip:active {
  transform: translate(1.5px, 1.5px);
  box-shadow: none;
}

.lami-card-header {
  display: flex;
  align-items: center;
  gap: 11px;
}

.lami-avatar-wrap {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  background: var(--bg-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
}

.lami-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.reminders-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-soft);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 9px 11px;
}

.reminder-row.is-urgent {
  background: var(--yellow-soft);
}

.reminder-title {
  font-size: 13px;
  font-weight: 800;
}

.reminder-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.meter-track {
  position: relative;
  height: 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #38b26d 0%, #f7c948 75%, #f95738 100%);
  margin: 4px 0;
}

.meter-pointer {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--ink);
  transform: translate(-50%, -50%);
  transition: left 0.25s ease;
}

.meter-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.cat-bar-row {
  margin-bottom: 11px;
}

.cat-bar-row:last-child {
  margin-bottom: 0;
}

.cat-bar-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  margin-bottom: 4px;
}

.cat-bar-name {
  font-weight: 800;
}

.cat-bar-val {
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.cat-bar-track {
  height: 11px;
  background: var(--surface-soft);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  background: var(--coral);
  transition: width 0.25s ease;
}

.cat-bar-fill.is-over {
  background: #d92d20;
}

.activity-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1.5px dashed #e1d7ca;
  font-size: 12.5px;
}

.activity-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-title {
  font-weight: 800;
}

.activity-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.activity-amount {
  font-weight: 800;
  white-space: nowrap;
}

.cat-budget-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cat-budget-row {
  display: grid;
  grid-template-columns: 1fr 130px;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
}

/* ==================== FASE 3 LANGKAH 2: LAPORAN ==================== */

.report-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.report-stat-tile {
  background: var(--surface-soft);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 9px 10px;
}

.report-stat-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.report-stat-val {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 800;
}

.report-stat-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.report-row-btn {
  width: 100%;
  text-align: left;
  background: var(--surface-soft);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 10px 11px;
  margin-bottom: 8px;
  font-family: inherit;
  cursor: pointer;
}

.report-row-btn:last-child {
  margin-bottom: 0;
}

.report-row-btn:hover {
  background: var(--yellow-soft);
}

.report-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
}

.report-row-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ==================== FASE 3 LANGKAH 3: RIWAYAT PERUBAHAN & UNDO ==================== */

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--surface-soft);
  margin-bottom: 8px;
}

.history-row:last-child {
  margin-bottom: 0;
}

.history-row.is-undone {
  opacity: 0.58;
  background: #f5efe6;
}

.history-summary {
  font-size: 12.5px;
  font-weight: 800;
}

.history-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}







