:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --accent: #4f46e5;
  --income: #16a34a;
  --expense: #dc2626;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 6px 16px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
}

.logo { font-size: 2rem; }
.brand-name { letter-spacing: -0.02em; }
.tagline { color: var(--muted); margin-top: 0.25rem; }

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  flex: 1;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--surface);
  border-radius: 14px;
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: center;
}

.card-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.card-value { font-size: 1.4rem; font-weight: 700; }
.card--income .card-value { color: var(--income); }
.card--expense .card-value { color: var(--expense); }
.card--balance .card-value { color: var(--accent); }

.add-panel, .list-panel {
  background: var(--surface);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

h2 { font-size: 1.1rem; margin-bottom: 1rem; }

.tx-form {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 0.75rem;
}

.tx-form input, .tx-form select, .tx-form button {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.tx-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.tx-form button:hover { filter: brightness(1.08); }

.tx-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }

.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  border-left-width: 4px;
}
.tx-item.income { border-left-color: var(--income); }
.tx-item.expense { border-left-color: var(--expense); }

.tx-desc { font-weight: 600; }
.tx-meta { font-size: 0.8rem; color: var(--muted); }

.tx-right { display: flex; align-items: center; gap: 0.75rem; }
.tx-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.tx-amount.income { color: var(--income); }
.tx-amount.expense { color: var(--expense); }

.delete-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem;
  border-radius: 6px;
}
.delete-btn:hover { color: var(--expense); background: #fee2e2; }

.empty-state { color: var(--muted); text-align: center; padding: 1rem 0; }

.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 560px) {
  .summary { grid-template-columns: 1fr; }
  .tx-form { grid-template-columns: 1fr 1fr; }
  .tx-form button { grid-column: 1 / -1; }
}
