
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #4f46e5;
  --background: #f5f7fb;
  --text: #172033;
  --muted: #7b8498;
  --border: #e8ebf2;
  --green: #059669;
  --red: #e11d48;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 28px 22px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 45px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 14px;
  font-size: 26px;
  font-weight: 800;
}

.brand h1 {
  font-size: 23px;
  line-height: 1.2;
}

.brand p, .subtitle {
  color: var(--muted);
  font-size: 13px;
}

input, select, button {
  font: inherit;
}

header input {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  color: var(--text);
}

.welcome {
  margin-bottom: 30px;
}

.welcome h2 {
  font-size: clamp(25px, 4vw, 36px);
  letter-spacing: -1px;
}

.welcome p {
  color: var(--muted);
  margin-top: 5px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: white;
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: 17px;
  box-shadow: 0 5px 22px rgba(25, 35, 70, 0.03);
}

.stat-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.stat-card h2 {
  font-size: clamp(24px, 3vw, 32px);
  margin: 10px 0;
  overflow-wrap: anywhere;
}

.stat-card p {
  color: var(--muted);
  font-size: 12px;
}

.income-card h2 { color: var(--green); }
.expense-card h2 { color: var(--red); }
.balance-card h2 { color: var(--primary); }

.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 28px;
  box-shadow: 0 5px 22px rgba(25, 35, 70, 0.03);
}

.panel h3 {
  font-size: 19px;
}

.panel .subtitle {
  margin: 3px 0 22px;
}

form {
  display: flex;
  flex-direction: column;
}

form label {
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 6px;
}

form input, form select,
.budget-input input, .section-heading select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--text);
}

input:focus, select:focus {
  border-color: var(--primary);
}

.primary-btn {
  margin-top: 23px;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.primary-btn:hover {
  background: #3730a3;
}

.budget-input {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.budget-input button {
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 9px;
  cursor: pointer;
}

.budget-info {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 10px;
}

.progress-track {
  height: 11px;
  background: #edf0f7;
  border-radius: 20px;
  overflow: hidden;
}

#budgetProgress {
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: 20px;
  transition: width 0.3s ease;
}

.budget-status {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
}

.chart-section {
  margin-top: 40px;
}

.category-chart {
  margin-top: 18px;
}

.chart-row {
  margin-bottom: 18px;
}

.chart-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 7px;
  gap: 10px;
}

.chart-bar {
  background: #edf0f7;
  height: 9px;
  border-radius: 20px;
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 20px;
}

.transactions {
  margin-bottom: 25px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.section-heading select {
  width: auto;
  min-width: 160px;
}

.transaction-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 0;
  border-top: 1px solid var(--border);
}

.transaction-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.transaction-meta {
  color: var(--muted);
  font-size: 12px;
}

.transaction-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.transaction-amount {
  font-weight: 700;
  white-space: nowrap;
}

.positive { color: var(--green); }
.negative { color: var(--red); }

.delete-btn {
  background: #fff1f2;
  color: var(--red);
  border: none;
  border-radius: 7px;
  padding: 7px 10px;
  cursor: pointer;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 35px 10px;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 15px 0;
}

@media (max-width: 800px) {
  .summary {
    grid-template-columns: 1fr;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 18px 13px;
  }

  header {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 30px;
  }

  .panel {
    padding: 20px;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading select {
    width: 100%;
  }

  .transaction-item {
    align-items: flex-start;
  }

  .transaction-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
  }
}
