:root {
  --primary: #0e4d92;
  --accent: #00b386;
  --bg: #f2f4f8;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #66707f;
  --error: #c0392b;
}

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #dfe4ec;
  color: var(--text);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 8px;
}

.phone {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--primary);
  color: #fff;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
header h1 { font-size: 1.3rem; }
header p { font-size: 0.8rem; opacity: 0.85; }
#brand-logo { font-size: 2rem; }

main { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 16px; }

.view { display: flex; flex-direction: column; gap: 16px; }
.hidden { display: none !important; }

form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }
input, select {
  padding: 10px 12px;
  border: 1px solid #cdd5e0;
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--primary); border-color: transparent; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button {
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: #e6eaf1;
  color: var(--text);
}
button.primary { background: var(--primary); color: #fff; }
button.ghost { background: transparent; color: var(--muted); }
button:hover { filter: brightness(1.08); }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card h3 { font-size: 1rem; }

.balance-card {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 16px;
  padding: 20px;
}
.balance-card .label { font-size: 0.8rem; opacity: 0.9; }
.balance { font-size: 2.2rem; font-weight: 700; margin-top: 4px; }
.key { font-size: 0.85rem; opacity: 0.9; margin-top: 8px; }

.history { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.history li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 1px solid #eef1f5;
  font-size: 0.9rem;
}
.history .in { color: var(--accent); font-weight: 600; }
.history .out { color: var(--error); font-weight: 600; }
.history .meta { color: var(--muted); font-size: 0.75rem; }

.error { color: var(--error); font-size: 0.85rem; }
.ok { color: var(--accent); }

footer { text-align: center; padding: 12px; color: var(--muted); }
