:root {
  --primary: #0047ab;
  --bg: #ffffff;
  --text: #222;
  --input-bg: #f4f4f4;
  --accent: #eaf1ff;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.dark {
  --bg: #121212;
  --text: #f4f4f4;
  --input-bg: #1e1e1e;
  --accent: #1a2d4a;
  --shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  padding: 1rem;
}
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  text-align: center;
  padding-bottom: 1rem;
}

h1 {
  color: var(--primary);
  font-size: 1.8rem;
  margin-bottom: 0.2rem;
}

input, select, button {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.8rem;
  font-size: 1rem;
  border: none;
  border-radius: 5px;
  background: var(--input-bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

input:focus, select:focus {
  outline: 2px solid var(--primary);
}

button {
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease;
}

button:hover {
  transform: scale(1.02);
}

section {
  background: var(--accent);
  padding: 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  transition: background 0.3s;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  padding: 0.7rem;
  text-align: left;
  border-bottom: 1px solid #ccc;
}

th {
  background: var(--primary);
  color: white;
}

tfoot {
  font-weight: bold;
}

.total-summary {
  margin-top: 1rem;
  font-size: 1.1rem;
  text-align: right;
}

footer {
  text-align: center;
  font-size: 0.9rem;
  margin-top: 2rem;
  color: var(--text);
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.filter-controls label {
  flex: 1 1 150px;
}

.dark-mode-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--primary);
  color: white;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 999;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--primary);
  transition: 0.4s;
  border-radius: 34px;
}

.slider::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

/* Move the circle to the right when checked */
.switch input:checked + .slider::before {
  transform: translateX(22px);
}

/* Dark background for dark mode switch */
body.dark .slider {
  background-color: #888;
}


@media screen and (max-width: 600px) {
  h1 {
    font-size: 1.5rem;
  }

  .filter-controls {
    flex-direction: column;
  }

  .dark-mode-toggle {
    top: auto;
    bottom: 1rem;
    right: 1rem;
  }
}
