:root {
  --bg-light: #f9fafb;
  --bg-dark: #1f2937;
  --text-light: #111827;
  --text-dark: #f9fafb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #6b7280;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 0.75rem;
}

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

body.dark {
  background: var(--bg-dark);
  color: var(--text-dark);
}

.container {
  max-width: 420px;
  margin: 4rem auto;
  padding: 2rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center; /* center child elements */
}

.container form {
  width: 100%;
}

input, button {
  width: 100%;
  box-sizing: border-box;
}


body.dark .container {
  background: #374151;
}

h1, h2, h3 {
  margin-bottom: 1rem;
}

input, button {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid #d1d5db;
  margin-bottom: 1rem;
  font-size: 1rem;
}

body.dark input {
  background: #4b5563;
  border: 1px solid #6b7280;
  color: white;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

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

.error {
  color: var(--danger);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 0.5rem;
}

.explaination {
  background: #e0f2fe;
  border-left: 4px solid var(--primary);
  padding: 1rem;
  margin-top: 1rem;
  border-radius: var(--radius);
}

.link {
  color: var(--primary);
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover {
  background: var(--primary);
}
.theme-toggle:focus {
  outline: none;
}

.home-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  text-decoration: none;
  font-size: 1.5rem;
  background: var(--secondary);
  color: white;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  transition: background 0.2s;
}
.home-btn:hover {
  background: var(--primary);
}

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}
body.dark th, body.dark td {
  border-color: #4b5563;
}
tr:hover {
  background: rgba(0,0,0,0.05);
}

button.logout {
  background: var(--danger);
}
button.logout:hover {
  background: #b91c1c;
}
