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

body {
  font-family: 'Segoe UI', sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  padding: 30px 16px;
}

.container {
  max-width: 520px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  font-size: 1.7rem;
  margin-bottom: 24px;
  color: #f8fafc;
}

/* Summary Cards */
.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.card {
  background: #1e293b;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  border-top: 3px solid transparent;
}

.income-card { border-top-color: #22c55e; }
.balance-card { border-top-color: #6366f1; }
.expense-card { border-top-color: #ef4444; }

.card .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 6px;
}

.card .amount {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
}

.income-card .amount { color: #22c55e; }
.balance-card .amount { color: #818cf8; }
.expense-card .amount { color: #ef4444; }

/* Form */
.form-section {
  background: #1e293b;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
}

.form-section h3 {
  margin-bottom: 14px;
  font-size: 1rem;
  color: #cbd5e1;
}

.form-group { margin-bottom: 10px; }

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 14px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus { border-color: #6366f1; }
input::placeholder { color: #475569; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

#addBtn {
  width: 100%;
  padding: 11px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

#addBtn:hover { background: #818cf8; }

/* History */
.history-section { }

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-header h3 { color: #cbd5e1; }

#clearAllBtn {
  background: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

#clearAllBtn:hover { background: #ef4444; color: #fff; }

#transactionList { list-style: none; }

#emptyMsg {
  text-align: center;
  color: #475569;
  padding: 30px 0;
  font-size: 0.9rem;
}

.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e293b;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-left: 4px solid transparent;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.tx-item.income { border-left-color: #22c55e; }
.tx-item.expense { border-left-color: #ef4444; }

.tx-info { flex: 1; }
.tx-desc { font-size: 0.9rem; color: #f1f5f9; }
.tx-meta { font-size: 0.75rem; color: #64748b; margin-top: 2px; }

.tx-right { display: flex; align-items: center; gap: 14px; }

.tx-amount {
  font-weight: 700;
  font-size: 0.95rem;
}

.tx-item.income .tx-amount { color: #22c55e; }
.tx-item.expense .tx-amount { color: #ef4444; }

.tx-delete {
  background: none;
  border: none;
  color: #475569;
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.2s;
}

.tx-delete:hover { color: #ef4444; }
