:root {
  --bg-color: #f0f4f8;
  --text-color: #222;
  --table-header: #007acc;
  --button-bg: #007acc;
  --button-hover: #005f99;
  --input-bg: white;
}

body.dark {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --table-header: #222;
  --button-bg: #333;
  --button-hover: #444;
  --input-bg: #1e1e1e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  transition: background 0.3s, color 0.3s;
}

.container {
  max-width: 960px;
  margin: auto;
  padding: 2rem;
  text-align: center;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.darkmode-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.input-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.input-group input {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 120px;
  background: var(--input-bg);
  color: var(--text-color);
}

.single-line {
  margin-bottom: 1.5rem;
}

.button-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

button {
  padding: 0.6rem 1.2rem;
  background: var(--button-bg);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background: var(--button-hover);
}

table {
  width: 100%;
  margin-top: 2rem;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  border: 1px solid #ccc;
  padding: 0.6rem;
}

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

@media (max-width: 600px) {
  .input-group {
    flex-direction: column;
    align-items: center;
  }

  table {
    font-size: 0.8rem;
  }

  .container {
    padding: 1rem;
  }
}
