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

body {
  background: #f4f6fc;
  font-family: 'Inter', sans-serif;
  color: #1a2634;
  padding: 24px 20px;
}

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

/* Header & Role Switcher */
.header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  gap: 16px;
}

.title-section h1 {
  font-size: 1.8rem;
  font-weight: 600;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  letter-spacing: -0.3px;
}

.title-section p {
  font-size: 0.85rem;
  color: #5b6e8c;
  margin-top: 4px;
}

.role-card {
  background: white;
  padding: 8px 16px;
  border-radius: 60px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  border: 1px solid #e2e8f0;
}

.role-card span {
  font-weight: 500;
  font-size: 0.85rem;
  color: #2c3e66;
}

.role-select {
  background: #f0f2f8;
  border: none;
  padding: 6px 12px;
  border-radius: 40px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  cursor: pointer;
  transition: 0.2s;
}

.role-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px #2a529880;
}

/* Summary Cards Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.card {
  background: white;
  border-radius: 24px;
  padding: 20px 18px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.02), 0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
  border: 1px solid #edf2f7;
}

.card:hover {
  transform: translateY(-3px);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #5f7f9e;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-amount {
  font-size: 2rem;
  font-weight: 700;
  color: #1e2f41;
}

.income-amount { color: #2b7e3a; }
.expense-amount { color: #c2412c; }
.balance-amount { color: #1e3c72; }

/* Charts Row */
.charts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
}

.chart-box {
  flex: 1;
  min-width: 240px;
  background: white;
  border-radius: 24px;
  padding: 18px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
  border: 1px solid #eef2f8;
}

.chart-box h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #2c3e66;
  display: flex;
  align-items: center;
  gap: 8px;
}

canvas {
  max-height: 200px;
  width: 100%;
}

/* Transactions + Insights Layout */
.transactions-insights {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
}

.transactions-section {
  flex: 2;
  min-width: 280px;
  background: white;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.02);
  border: 1px solid #eef2f8;
}

.insights-section {
  flex: 1.2;
  min-width: 260px;
  background: white;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.02);
  border: 1px solid #eef2f8;
}

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

.filter-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-input, .sort-select, .search-input {
  padding: 8px 12px;
  border-radius: 32px;
  border: 1px solid #cfdfed;
  background: #fafcff;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
}

.transaction-list {
  max-height: 380px;
  overflow-y: auto;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ecf3fa;
  padding: 12px 0;
  flex-wrap: wrap;
}

.transaction-info {
  display: flex;
  gap: 20px;
  align-items: baseline;
  flex-wrap: wrap;
}

.transaction-date {
  font-size: 0.75rem;
  color: #6b85a2;
  min-width: 85px;
}

.transaction-category {
  background: #eef3fc;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 500;
}

.transaction-amount {
  font-weight: 600;
}

.expense {
  color: #c2412c;
}

.income {
  color: #2b7e3a;
}

.transaction-actions {
  display: flex;
  gap: 12px;
}

.edit-btn, .delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: #7f8fa4;
  transition: 0.2s;
}

.edit-btn:hover { color: #2a5298; }
.delete-btn:hover { color: #c2412c; }

.add-transaction {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.add-input {
  padding: 8px 12px;
  border-radius: 32px;
  border: 1px solid #cfdfed;
  flex: 1;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: #1e3c72;
  border: none;
  color: white;
  padding: 8px 18px;
  border-radius: 40px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}

.btn-primary:hover {
  background: #2a5298;
}

.btn-primary:disabled {
  background: #b8c7e0;
  cursor: not-allowed;
}

.insight-card {
  background: #f8fafd;
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 16px;
}

.insight-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.empty-message {
  text-align: center;
  color: #8ba0bc;
  padding: 32px 0;
}

footer {
  text-align: center;
  font-size: 0.7rem;
  margin-top: 32px;
  color: #8ba0bc;
}

/* Responsive Design */
@media (max-width: 768px) {
  body { padding: 16px; }
  .card-amount { font-size: 1.6rem; }
  .transaction-info { gap: 8px; }
  .section-header { flex-direction: column; align-items: stretch; }
  .filter-controls { justify-content: space-between; }
}

@media (max-width: 480px) {
  .transaction-item { flex-direction: column; align-items: flex-start; gap: 8px; }
  .transaction-actions { align-self: flex-end; }
}