body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020617;
  color: #e5e7eb;
}

.app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
}

h1 {
  margin-bottom: 24px;
}

/* Layout */

.top-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}

/* Month nav */

.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #0f172a;
  border-radius: 16px;
  border: 1px solid #1e293b;
}

.month-nav button {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 13px;
}

.month-nav button.secondary {
  border-color: #4b5563;
  font-size: 12px;
}

#monthLabel {
  font-weight: 600;
}

/* Summary cards */

.summary-cards {
  display: flex;
  flex: 1;
  gap: 8px;
}

.card.summary {
  flex: 1;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #1e293b;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card.summary .label {
  font-size: 13px;
  color: #9ca3af;
}

.card.summary .value {
  font-size: 20px;
  font-weight: 600;
}

.card.summary.income .value {
  color: #22c55e;
}

.card.summary.expense .value {
  color: #f97316;
}

.card.summary.balance .value {
  color: #38bdf8;
}

/* Generic card */

.card {
  background: #0f172a;
  border-radius: 16px;
  border: 1px solid #1e293b;
  padding: 16px;
  margin-top: 16px;
}

/* Savings goal */

.goal-card h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.goal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.goal-row .field {
  flex: 1;
}

.goal-row button {
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: #22c55e;
  color: #022c22;
  font-weight: 600;
  cursor: pointer;
}

.goal-row button:hover {
  opacity: 0.9;
}

.goal-status-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.goal-bar-bg {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #020617;
  border: 1px solid #1f2937;
  overflow: hidden;
}

.goal-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #22c55e, #22c55e, #22c55e);
  transition: width 0.3s ease-out;
}

.goal-status-text {
  color: #9ca3af;
}

/* Form */

.form-card h2 {
  margin-top: 0;
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
  margin-bottom: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label {
  font-size: 13px;
  color: #9ca3af;
}

input,
select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #4b5563;
  background: #020617;
  color: #e5e7eb;
}

button#addBtn {
  margin-top: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: #3b82f6;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

button#addBtn:hover {
  opacity: 0.9;
}

.error {
  color: #f97373;
  font-size: 13px;
  margin-top: 4px;
}

/* Category list */

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: #020617;
  font-size: 13px;
}

.category-chip .cat-name {
  font-weight: 500;
}

.category-chip .cat-values {
  color: #9ca3af;
  font-size: 12px;
}

/* Transactions table */

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-row select {
  min-width: 120px;
}

.tx-table {
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  overflow: hidden;
}

.tx-table-header,
.tx-table-row {
  display: grid;
  grid-template-columns: 110px 90px 140px 1fr 120px 60px;
  gap: 4px;
  padding: 8px 10px;
  font-size: 13px;
  align-items: center;
}

.tx-table-header {
  background: #020617;
  border-bottom: 1px solid #1f2937;
  font-weight: 500;
}

.tx-table-row:nth-child(odd) {
  background: #020617;
}

.tx-table-row:nth-child(even) {
  background: #020617ee;
}

.tx-amount.income {
  color: #22c55e;
}

.tx-amount.expense {
  color: #f97316;
}

.tx-type-pill {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  text-align: center;
}

.tx-type-pill.income {
  background: #14532d;
  color: #bbf7d0;
}

.tx-type-pill.expense {
  background: #7c2d12;
  color: #fed7aa;
}

/* Delete button */

.delete-btn {
  padding: 4px 8px;
  border-radius: 999px;
  border: none;
  background: #b91c1c;
  color: white;
  font-size: 11px;
  cursor: pointer;
}

.delete-btn:hover {
  opacity: 0.9;
}

/* Footer */

.footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}
