body {
  font-family: Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  margin: 0;
  padding: 20px;
  transition: background 0.3s, color 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

body.light {
  background: #f0f4f8;
  color: #0f172a;
}

h1, h2, h3 {
  text-align: center;
  margin-bottom: 20px;
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.auth-card {
  background: #1e293b;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  max-width: 400px;
  width: 100%;
  text-align: center;
  margin: 0 auto;
}

body.light .auth-card {
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: #1e293b;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
  transition: background 0.3s;
}

body.light .card {
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card.full {
  grid-column: 1 / -1;
}

input, select, button {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  transition: background 0.3s, color 0.3s;
}

body.light input, body.light select {
  background: #e2e8f0;
  color: #0f172a;
}

button {
  background: #38bdf8;
  color: black;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

button:hover {
  background: #0ea5e9;
}

canvas {
  max-width: 100%;
  height: 300px !important;
  margin: 10px 0;
}

ul {
  list-style: none;
  padding: 0;
}

li {
  margin: 8px 0;
  font-size: 0.9rem;
}

a {
  color: #38bdf8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

#themeToggle {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

#groupSplitResult {
  white-space: pre-line;
}

#totalExpenseDisplay {
  margin: 10px 0;
  font-weight: bold;
}

@media (max-width: 600px) {
  body {
    padding: 10px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  h1, h2, h3 {
    font-size: 1.5rem;
  }
  input, select, button {
    padding: 8px;
    font-size: 0.9rem;
  }
  canvas {
    height: 250px !important;
  }
  .auth-card {
    padding: 20px;
    max-width: 90%;
  }
}