* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

:root {
  --primary: #235aa3;
  --income: #16a34a;
  --expense: #dc2626;
  --background: #f4f4f5;
  --card: #ffffff;
  --text: #111827;
  --border: #e5e7eb;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.dark {
  --background: #0f172a;
  --card: #1e293b;
  --text: #f8fafc;
  --border: #334155;
}

body {
  background: var(--background);
  color: var(--text);
  padding: 90px 20px 20px;
  transition: 0.3s;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 40px;
  box-shadow: var(--shadow);
  z-index: 1000;
}

nav h2 {
  font-size: 24px;
}

.nav-links {
  display: flex;
  gap: 12px;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  cursor: pointer;
  transition: 0.2s;
}

button:hover {
  opacity: 0.9;
}

#dashboard {
  max-width: 1200px;
  margin: auto;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.card p {
  font-size: 30px;
  font-weight: 700;
}

.income {
  color: var(--income);
}

.expense {
  color: var(--expense);
}

#openModal {
  margin-bottom: 25px;
}

.chart-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
}

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

th {
  background: var(--primary);
  color: white;
}

th,
td {
  padding: 14px;
  border: 1px solid var(--border);
  text-align: center;
}

tbody tr:nth-child(even) {
  background: #f8fafc;
}

body.dark tbody tr:nth-child(even) {
  background: #263549;
}

#settings {
  max-width: 500px;
  margin: auto;
  background: var(--card);
  padding: 25px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

#settings input,
#settings select {
  width: 100%;
  margin-top: 8px;
  margin-bottom: 15px;
}

input,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
}

#modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

#modal.hidden {
  display: none;
}

.modal-box {
  background: var(--card);
  color: var(--text);
  width: 380px;
  border-radius: 12px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-shadow: var(--shadow);
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  body {
    padding: 120px 15px 20px;
  }

  nav {
    flex-direction: column;
    gap: 12px;
    padding: 15px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .filters {
    flex-direction: column;
  }

  table {
    font-size: 13px;
  }

  .modal-box {
    width: 90%;
  }
}
