:root {
  --bg: #f9f9f9;
  --text: #000;
  --input-bg: #fff;
  --border: #ccc;
  --button-bg: #28a745;
  --button-text: #fff;
  --hover-bg: #218838;
}

body.dark {
  --bg: #121212;
  --text: #eee;
  --input-bg: #1e1e1e;
  --border: #444;
  --button-bg: #3cba54;
  --button-text: #fff;
  --hover-bg: #2e9b45;
}

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

h1 {
  text-align: center;
  font-size: 1.5em;
  margin-bottom: 20px;
}

#toggle-dark {
  display: block;
  margin: 0 auto 20px;
  background: var(--button-bg);
  color: var(--button-text);
  padding: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.form-group {
  margin-bottom: 12px;
}

label {
  display: block;
  font-weight: bold;
  margin-bottom: 4px;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 12px;
  font-size: 1em;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  box-sizing: border-box;
}

button {
  width: 100%;
  background: var(--button-bg);
  color: var(--button-text);
  border: none;
  padding: 14px;
  font-size: 1em;
  border-radius: 8px;
  cursor: pointer;
}

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

.botoes-acao {
  text-align: center;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.botao-vermelho {
  background: #dc3545;
}

.botao-vermelho:hover {
  background: #c82333;
}

.botao-verde {
  background: #007bff;
}

.botao-verde:hover {
  background: #0056b3;
}

table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
  font-size: 0.95em;
}

table, th, td {
  border: 1px solid var(--border);
}

th, td {
  padding: 10px;
  text-align: left;
}

.total {
  font-size: 1.2em;
  text-align: right;
  margin-top: 15px;
  background-color: var(--bg);
  padding: 10px 20px;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
}

.remover-btn {
  background: #ff4d4d;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.remover-btn:hover {
  background: #e60000;
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.3em;
  }

  th, td {
    font-size: 0.9em;
    padding: 8px;
  }

  .total {
    font-size: 1em;
  }

  .botoes-acao {
    flex-direction: column;
  }
}
