* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  background: #0f172a;
  color: #e5e7eb;
  display: flex;
  justify-content: center;
  padding: 2rem;
}

.container {
  width: 100%;
  max-width: 1100px;
  background: #020617;
  border-radius: 0.75rem;
  padding: 1.5rem 2rem 2rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.8);
}

h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #f9fafb;
}

h2 {
  margin-bottom: 0.75rem;
  color: #e5e7eb;
}

.summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: #020617;
  border: 1px solid #1f2937;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.summary-item span {
  font-size: 0.85rem;
  color: #9ca3af;
}

.summary-item strong {
  font-size: 1rem;
}

.filters,
.form-section,
.table-section,
.charts-section {
  background: #020617;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid #1f2937;
  margin-bottom: 1rem;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-item {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

.filter-item label {
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

.filter-actions {
  justify-content: flex-end;
  align-items: flex-end;
}

.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
}

.form-row label {
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

input,
select {
  padding: 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
}

input:focus,
select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

button {
  cursor: pointer;
  border-radius: 0.5rem;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

#addExpenseBtn {
  background: #22c55e;
  color: #022c22;
  font-weight: 600;
}

#addExpenseBtn:hover {
  background: #16a34a;
}

.secondary-btn {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #374151;
}

.secondary-btn:hover {
  background: #1f2937;
}

.delete-btn {
  background: #b91c1c;
  color: #fee2e2;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.delete-btn:hover {
  background: #991b1b;
}

.table-section table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.table-section th,
.table-section td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #1f2937;
  text-align: left;
}

.table-section thead {
  background: #020617;
}

.table-section th {
  color: #9ca3af;
  font-weight: 500;
}

.table-section tbody tr:nth-child(even) {
  background: #020617;
}

.table-section tbody tr:nth-child(odd) {
  background: #020617;
}

.income-amount {
  color: #4ade80;
}

.expense-amount {
  color: #f97373;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.chart-card {
  background: #020617;
  border-radius: 0.75rem;
  border: 1px solid #1f2937;
  padding: 0.75rem;
}

.chart-card h3 {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

canvas {
  width: 100% !important;
  max-height: 260px;
}

@media (max-width: 900px) {
  .summary {
    flex-direction: column;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }
}
