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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 2rem 1rem;
}

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

header {
  text-align: center;
  color: white;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.balance-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.balance-item {
  text-align: center;
}

.balance-item h3 {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  font-weight: 600;
}

.balance-item p {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1f2937;
}

.balance-amount {
  color: #667eea !important;
}

.income p {
  color: #10b981 !important;
}

.expense p {
  color: #ef4444 !important;
}

.form-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-card h2 {
  margin-bottom: 1.5rem;
  color: #1f2937;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #4b5563;
  font-weight: 600;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-add {
  width: 100%;
  background: #667eea;
  color: white;
  margin-top: 1rem;
}

.btn-add:hover {
  background: #5568d3;
}

.filter-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.filter-card h3 {
  margin-bottom: 1rem;
  color: #1f2937;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #6b7280;
  transition: all 0.3s;
}

.filter-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

.filter-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.transactions-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.transactions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.transactions-header h2 {
  color: #1f2937;
}

.btn-clear {
  background: #ef4444;
  color: white;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-clear:hover {
  background: #dc2626;
}

.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.empty-message {
  text-align: center;
  color: #9ca3af;
  padding: 2rem;
  font-style: italic;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid;
  background: #f9fafb;
  transition: transform 0.2s;
}

.transaction-item:hover {
  transform: translateX(5px);
}

.transaction-item.income {
  border-left-color: #10b981;
}

.transaction-item.expense {
  border-left-color: #ef4444;
}

.transaction-info {
  flex: 1;
}

.transaction-description {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.transaction-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: #6b7280;
}

.transaction-amount {
  font-size: 1.25rem;
  font-weight: 700;
  margin-right: 1rem;
}

.transaction-amount.income {
  color: #10b981;
}

.transaction-amount.expense {
  color: #ef4444;
}

.transaction-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-edit,
.btn-delete {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-edit {
  background: #3b82f6;
  color: white;
}

.btn-delete {
  background: #ef4444;
  color: white;
}

.btn-edit:hover,
.btn-delete:hover {
  opacity: 0.8;
}

.summary-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.summary-card h2 {
  margin-bottom: 1.5rem;
  color: #1f2937;
}

.category-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.category-name {
  min-width: 120px;
  font-weight: 600;
  color: #4b5563;
  text-transform: capitalize;
}

.category-bar-container {
  flex: 1;
  background: #e5e7eb;
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.category-bar-fill {
  height: 100%;
  background: #667eea;
  border-radius: 12px;
  transition: width 0.5s ease;
}

.category-amount {
  min-width: 80px;
  text-align: right;
  font-weight: 600;
  color: #1f2937;
}

@media (max-width: 768px) {
  .balance-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .filter-buttons {
    flex-direction: column;
  }

  .transaction-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .transaction-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .category-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .category-bar-container {
    width: 100%;
  }
}
