:root {
  --bg: #0b1220;
  --surface: #121b2e;
  --surface-2: #19243b;
  --text: #eef2f8;
  --muted: #8d99ae;
  --accent: #3b82f6;
  --danger: #ef4444;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  padding-bottom: env(safe-area-inset-bottom);
}

.hidden { display: none !important; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top)) 16px 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}

.topbar h1 {
  font-size: 18px;
  margin: 0;
}

.icon-btn {
  background: var(--surface);
  border: none;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

main {
  padding: 0 16px 32px;
  max-width: 480px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}

.centered {
  text-align: center;
}

.card h2 { margin-top: 0; }

p.muted, .muted { color: var(--muted); }
.small { font-size: 13px; }

button {
  font-family: inherit;
  font-size: 15px;
  border-radius: 12px;
  padding: 13px 18px;
  border: none;
  width: 100%;
  margin-top: 10px;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

button.secondary {
  background: var(--surface-2);
  color: var(--text);
}

button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

button.small {
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
}

input[type="text"] {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--surface-2);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  margin-top: 10px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 8px 0 16px;
  font-weight: 600;
}

.total-card { text-align: center; }
.total-label { color: var(--muted); font-size: 13px; }
.total-amount { font-size: 34px; font-weight: 700; margin: 6px 0 10px; }

.bank-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.bank-card .bank-info { display: flex; align-items: center; gap: 12px; }

.bank-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bank-name { font-weight: 600; }
.bank-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.bank-amount { font-weight: 700; font-size: 17px; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  z-index: 20;
}

.modal {
  background: var(--surface);
  width: 100%;
  max-height: 75vh;
  overflow-y: auto;
  border-radius: 18px 18px 0 0;
  padding: 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  margin-bottom: 12px;
}

.txn-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-2);
  font-size: 14px;
}

.txn-row:last-child { border-bottom: none; }
.txn-merchant { font-weight: 500; }
.txn-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
