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

body {
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app { flex: 1; display: flex; flex-direction: column; }

.view { display: none; flex-direction: column; flex: 1; }
.view.active { display: flex; }

/* Shared card */
.card {
  background: white;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
}

/* Shared button */
.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
}
.btn-secondary {
  background: transparent;
  border: 1.5px solid currentColor;
}

/* Amount display */
.amount { font-size: 28px; font-weight: 700; margin: 6px 0; }
.label  { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.6; }

/* Lock badge */
.lock-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  background: #fef9c3; color: #92400e;
  border-radius: 20px; padding: 3px 8px; margin-top: 4px;
}

/* Interest bar */
.interest-bar {
  border-radius: 8px; padding: 8px 10px;
  font-size: 12px; font-weight: 600; margin-top: 8px;
}

/* Transaction list */
.tx-list { list-style: none; }
.tx-item {
  display: flex; justify-content: space-between; align-items: start;
  padding: 10px 0; border-bottom: 1px solid #f0f0f0;
}
.tx-item:last-child { border-bottom: none; }
.tx-amount { font-weight: 700; white-space: nowrap; }
.tx-amount.positive { color: #059669; }
.tx-amount.negative { color: #dc2626; }
.tx-meta { font-size: 11px; opacity: 0.6; margin-top: 2px; }

/* Modal overlay */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); align-items: center; justify-content: center; z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: 16px;
  padding: 24px; width: min(380px, calc(100vw - 32px));
}
.modal h3 { margin-bottom: 16px; }
.modal input, .modal select {
  width: 100%; border: 1.5px solid #e2e8f0;
  border-radius: 8px; padding: 10px; font-size: 14px;
  margin-bottom: 10px;
}

/* Login form */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  flex: 1; padding: 24px;
}
.login-box {
  width: min(360px, 100%); background: white;
  border-radius: 20px; padding: 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.login-box h1 { margin-bottom: 4px; }
.login-box .subtitle { margin-bottom: 24px; opacity: 0.6; font-size: 14px; }
.login-box input {
  width: 100%; border: 1.5px solid #e2e8f0;
  border-radius: 10px; padding: 12px; font-size: 16px; margin-bottom: 12px;
}
.modal input:focus, .modal select:focus, .login-box input:focus {
  outline: 2px solid #667eea;
  outline-offset: 1px;
}
.error-msg { color: #dc2626; font-size: 13px; margin-bottom: 10px; min-height: 18px; }

/* Responsive container */
.container { max-width: 480px; margin: 0 auto; padding: 16px; width: 100%; }

/* Header bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; position: sticky; top: 0; z-index: 10;
}
.topbar h2 { font-size: 20px; }
.topbar .logout-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; opacity: 0.6;
}
