:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f2f2f2;
  --gray-200: #e5e5e5;
  --gray-400: #a3a3a3;
  --gray-600: #525252;
  --gray-800: #262626;
  --radius: 16px;
  --radius-sm: 10px;
  --success: #16a34a;
  --danger: #dc2626;
  --warn: #d97706;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  background: var(--white);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 76px; /* bottom nav space */
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}
.topbar .brand { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 9px; }
.topbar .brand img, .topbar .brand .logo-mark { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; }
.topbar a { transition: opacity .15s ease; }
.topbar a:active { opacity: .5; }

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo-lockup { display: flex; align-items: center; gap: 10px; }
.logo-lockup .name { font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }

/* ===== Cards ===== */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: box-shadow .15s ease, transform .15s ease;
}

.balance-card {
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px 22px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}
.balance-card::after {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.06), transparent 70%);
  pointer-events: none;
}
.balance-card .label { font-size: 13px; color: var(--gray-400); margin-bottom: 4px; }
.balance-card .amount { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }

.action-row { display: flex; gap: 10px; margin-top: 16px; }
.action-row .btn { flex: 1; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity .15s ease, transform .1s ease, box-shadow .15s ease;
  width: 100%;
}
.btn:active { transform: scale(0.97); }
.btn-primary { box-shadow: 0 4px 12px -4px rgba(0,0,0,0.3); }
.btn-primary { background: var(--black); color: var(--white); }
.btn-outline { background: var(--white); color: var(--black); border-color: var(--black); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ===== Forms ===== */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--gray-800); }
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--gray-50);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--black); background: var(--white); }
.hint { font-size: 12px; color: var(--gray-600); margin-top: 4px; }
.error-msg { color: var(--danger); font-size: 13px; margin-bottom: 10px; }
.success-msg { color: var(--success); font-size: 13px; margin-bottom: 10px; }

/* ===== Grid nominal ===== */
.nominal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.nominal-opt {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
}
.nominal-opt.active { background: var(--black); color: var(--white); border-color: var(--black); }

/* ===== Menu grid ===== */
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
.menu-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease;
}
.menu-item:active { transform: scale(0.97); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.menu-item .icon {
  font-size: 22px;
  margin: 0 auto 10px;
  width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--black);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
}

/* ===== Status badge ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-pending { background: #fef3c7; color: var(--warn); }
.badge-approved { background: #dcfce7; color: var(--success); }
.badge-rejected { background: #fee2e2; color: var(--danger); }

/* ===== History list ===== */
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.history-item:last-child { border-bottom: none; }
.history-item .type { font-weight: 600; font-size: 14px; }
.history-item .date { font-size: 12px; color: var(--gray-600); }
.history-item .amt { font-weight: 700; }

/* ===== Bottom navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  z-index: 20;
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 10px 0 8px;
  font-size: 11px;
  color: var(--gray-600);
}
.bottom-nav a.active { color: var(--black); font-weight: 700; }
.bottom-nav .icon { display: block; font-size: 20px; margin-bottom: 2px; }

/* ===== Banner ===== */
.banner {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: center;
}

/* ===== QRIS box ===== */
.qris-box { text-align: center; padding: 20px; }
.qris-box img, .qris-box canvas { max-width: 220px; width: 100%; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); }

/* ===== Scratch card ===== */
.scratch-wrap { position: relative; width: 100%; max-width: 320px; margin: 0 auto; }
.scratch-result {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  background: var(--black); color: var(--white);
  border-radius: var(--radius);
}
.scratch-canvas { position: absolute; inset: 0; border-radius: var(--radius); touch-action: none; }

/* ===== Table (admin) ===== */
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin-table th, table.admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--gray-200); text-align: left; }
table.admin-table th { background: var(--gray-50); font-weight: 700; }

.empty-state { text-align: center; color: var(--gray-600); padding: 30px 0; font-size: 14px; }

.disclaimer {
  font-size: 11px;
  color: var(--gray-600);
  border-top: 1px solid var(--gray-200);
  padding-top: 12px;
  margin-top: 20px;
  line-height: 1.5;
}

.demo-banner {
  background: var(--black);
  color: var(--white);
  text-align: center;
  font-size: 12px;
  padding: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
