body {
  color: #333;
  background-color: #fdfdfe;
  font-size: 18px;
  font:
    1.2rem/1.5 Century Gothic,
    sans-serif;
  max-width: 600px;
  max-width: 55ch;
  margin: 0 auto;
  padding: 2.5rem 1.75rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 2rem 0;
}

th {
  background-color: #f0f0f1;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #333;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #ddd;
}

/* Right-align numeric columns */
td:nth-child(2),
td:nth-child(3) {
  text-align: right;
}

/* Hover effect for better readability */
tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background-color: #f8f8f9;
}

table + div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

/* Form styling */
form {
  max-width: 400px;
  margin: 2rem 0;
}

label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  color: #333;
  box-sizing: border-box;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="password"]:focus {
  outline: 2px solid #5bf;
  outline-offset: 2px;
  border-color: #5bf;
}

input[type="submit"] {
  margin-top: 1.5rem;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

input[type="submit"]:hover {
  background-color: #555;
}

input[type="submit"]:active {
  background-color: #222;
}

/* Logout button - destructive styling */
#logoutButton {
  margin-top: 1.5rem;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  background-color: #c62828;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#logoutButton:hover {
  background-color: #e53935;
}

#logoutButton:active {
  background-color: #b71c1c;
}

#logoutButton:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error message styling */
#error-message {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 400px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background-color: #f8d7da;
  color: #c62828;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
}

#error-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #c62828;
  cursor: pointer;
  padding: 0;
  margin-left: 1.5rem;
  opacity: 0.7;
  flex-shrink: 0;
}

#error-close:hover {
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  body {
    color: #ddd;
    background: #123;
  }
  a:focus {
    outline: 0.2rem solid #fed;
  }
  a {
    color: #5bf;
  }

  th {
    background-color: #1a3a5a;
    border-bottom-color: #5bf;
  }

  td {
    border-bottom-color: #334;
  }

  tbody tr:hover {
    background-color: #1a2a3a;
  }

  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="password"] {
    background-color: #1a2a3a;
    border-color: #445;
    color: #ddd;
  }

  input[type="text"]:focus,
  input[type="number"]:focus,
  input[type="date"]:focus,
  input[type="password"]:focus {
    background-color: #223344;
    border-color: #5bf;
  }

  input[type="submit"] {
    background-color: #5bf;
    color: #123;
  }

  input[type="submit"]:hover {
    background-color: #7cf;
  }

  input[type="submit"]:active {
    background-color: #4ae;
  }

  #logoutButton {
    background-color: #ef5350;
    color: #123;
  }

  #logoutButton:hover {
    background-color: #ff6f6f;
  }

  #logoutButton:active {
    background-color: #e53935;
  }

  #error-message {
    background-color: #5a1a1a;
    color: #ef5350;
    border-color: #8b2e2e;
  }

  #error-close {
    color: #ef5350;
  }
}
