:root {
  --color-bg: #0a0e17;
  --color-surface: #131826;
  --color-surface-2: #1a2036;
  --color-border: #232b42;
  --color-text: #e8ecf5;
  --color-text-muted: #8a93a8;
  --color-primary: #7c3aed;
  --color-primary-hover: #6d28d9;
  --color-income: #10b981;
  --color-expense: #f87171;
  --color-warning: #f59e0b;

  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);

  font-family: var(--font-body);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100vh; background: var(--color-bg); color: var(--color-text); }

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 1rem; padding-bottom: 100px; }

.brand-logo {
  width: 64px;
  height: 64px;
  margin: 2rem auto 1rem;
  display: block;
  background: linear-gradient(135deg, var(--color-primary), #a855f7);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
  position: relative;
}

.brand-logo::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 3px solid white;
  border-radius: 12px;
  border-bottom: none;
  border-right: none;
  transform: rotate(-45deg) translate(2px, -2px);
}

.brand-logo::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 3px solid white;
  border-radius: 12px;
  border-top: none;
  border-left: none;
  transform: rotate(-45deg) translate(-2px, 2px);
}

h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.tagline {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-input {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.btn {
  width: 100%;
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:hover { background: var(--color-primary-hover); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.link:hover { text-decoration: underline; }

.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

.divider {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin: 1.5rem 0;
  position: relative;
}

.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: var(--color-border);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-ok { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.status-warn { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.tx-list { list-style: none; }
.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
}
.tx-item:last-child { border-bottom: none; }

.tx-info { flex: 1; }
.tx-name { font-weight: 500; margin-bottom: 0.15rem; }
.tx-date { font-size: 0.8rem; color: var(--color-text-muted); }

.tx-amount { font-family: var(--font-mono); font-weight: 600; }
.tx-amount.income { color: var(--color-income); }
.tx-amount.expense { color: var(--color-expense); }

.balance-display {
  text-align: center;
  padding: 1.5rem 1rem;
}
.balance-label { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 0.25rem; }
.balance-amount {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
