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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  color: #2c3e50;
  font-size: 2.5rem;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.card h3 {
  color: #7f8c8d;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.card p {
  font-size: 1.8rem;
  font-weight: bold;
}

#total-income {
  color: #27ae60;
}

#total-expenses {
  color: #e74c3c;
}

#balance {
  color: #3498db;
}

section {
  background: #fff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 25px;
}

section h2 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.form-section .form-group {
  margin-bottom: 15px;
}

.form-section label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #555;
}

.form-section input,
.form-section select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-section input:focus,
.form-section select:focus {
  outline: none;
  border-color: #3498db;
}

.form-section button {
  width: 100%;
  padding: 12px;
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

.form-section button:hover {
  background: #2980b9;
}

.chart-section {
  text-align: center;
}

#expenseChart {
  max-width: 400px;
  margin: 0 auto;
}

.filter {
  margin-bottom: 15px;
}

.filter input {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background: #f8f9fa;
  font-weight: 600;
  color: #555;
}

.type-income {
  color: #27ae60;
  font-weight: 500;
}

.type-expense {
  color: #e74c3c;
  font-weight: 500;
}

.delete-btn {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.3s;
}

.delete-btn:hover {
  background: #c0392b;
}

.export-section {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.export-section button {
  padding: 12px 25px;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

#export-btn {
  background: #27ae60;
  color: #fff;
}

#export-btn:hover {
  background: #219a52;
}

#clear-btn {
  background: #e74c3c;
  color: #fff;
}

#clear-btn:hover {
  background: #c0392b;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  header h1 {
    font-size: 1.8rem;
  }

  table {
    font-size: 0.85rem;
  }

  th,
  td {
    padding: 8px;
  }
}
