:root {
  --bg: #0a0a0d;
  --bg-card: #16141d;
  --bg-input: #1f1c29;
  --border: #2b2735;
  --purple: #9333ea;
  --purple-light: #a855f7;
  --purple-dark: #6b21a8;
  --white: #f5f5f7;
  --gray: #a5a1b3;
  --green: #22c55e;
  --red: #ef4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #17111f 0%, var(--bg) 55%);
  color: var(--white);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
}

a { color: var(--purple-light); }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: #0d0b12;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.logo .accent { color: var(--purple-light); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  opacity: 0.85;
}

.nav-links a:hover { opacity: 1; color: var(--purple-light); }

.nav-user { color: var(--gray); }

.container {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 0 1px rgba(147, 51, 234, 0.03), 0 12px 30px rgba(0, 0, 0, 0.35);
}

.card h1 { margin-top: 0; }

.auth-card {
  max-width: 380px;
  margin: 3rem auto;
  text-align: center;
}

.subtitle { color: var(--gray); margin-top: -0.5rem; }

form { display: flex; flex-direction: column; gap: 0.6rem; }

form.inline-form { display: inline-block; }

label { font-size: 0.85rem; color: var(--gray); margin-top: 0.4rem; }

input[type="text"],
input[type="password"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--white);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  font-size: 1rem;
  outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--purple-light);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
}

.checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  color: var(--white);
}

button, .btn-primary, .btn-secondary, .btn-danger, .btn-link {
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 8px;
  border: none;
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  transition: transform 0.05s ease, filter 0.15s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple-light), var(--purple-dark));
  color: white;
  margin-top: 0.5rem;
}

.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: transparent;
  color: var(--purple-light);
  border: 1px solid var(--purple);
  margin-top: 0.5rem;
}

.btn-secondary:hover { background: rgba(147, 51, 234, 0.12); }

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
}

.btn-danger:hover { background: rgba(239, 68, 68, 0.22); }

.btn-link {
  background: none;
  color: var(--gray);
  padding: 0.3rem 0.4rem;
  font-weight: 500;
}

.btn-link:hover { color: var(--white); }

.status {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

.status-ok { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.status-warn { background: rgba(168, 85, 247, 0.15); color: var(--purple-light); }

.hint { color: var(--gray); font-size: 0.85rem; }

code {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

.flashes { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }

.flash {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}

.flash-success { background: rgba(34, 197, 94, 0.12); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.3); }
.flash-error { background: rgba(239, 68, 68, 0.12); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }

.table-wrap { overflow-x: auto; }

.users-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.users-table th, .users-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.users-table th { color: var(--gray); font-weight: 600; }

.code-pending {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-small { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

.footer {
  text-align: center;
  color: var(--gray);
  font-size: 0.8rem;
  padding: 1.5rem;
}
