:root {
  --bg: #060a12;
  --bg-card: rgba(18, 26, 44, 0.78);
  --border: rgba(148, 163, 184, 0.1);
  --text: #f8fafc;
  --muted: #8b9cb3;
  --accent: #38bdf8;
  --danger: #fb7185;
  --success: #34d399;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

.orb-a {
  width: 420px;
  height: 420px;
  top: -120px;
  left: 10%;
  background: rgba(56, 189, 248, 0.22);
}

.orb-b {
  width: 360px;
  height: 360px;
  bottom: -80px;
  right: 5%;
  background: rgba(94, 234, 212, 0.12);
}

.auth-shell {
  position: relative;
  width: min(100%, 420px);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  backdrop-filter: blur(12px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auth-brand img {
  width: 44px;
  height: 44px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 1.35rem;
}

.auth-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-form label {
  display: block;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-form input,
.auth-form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(6, 10, 18, 0.65);
  color: var(--text);
  font: inherit;
}

.auth-form input:focus,
.auth-form select:focus {
  outline: 2px solid rgba(56, 189, 248, 0.35);
  border-color: rgba(56, 189, 248, 0.45);
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.remember-row input {
  width: auto;
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary {
  width: 100%;
  background: linear-gradient(135deg, #38bdf8, #5eead4);
  color: #041018;
}

.btn.secondary {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}

.btn.danger {
  background: rgba(251, 113, 133, 0.18);
  color: var(--danger);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(251, 113, 133, 0.12);
  color: var(--danger);
  font-size: 0.9rem;
}

.auth-error.hidden,
.hidden { display: none; }

.auth-links {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.auth-links a {
  color: var(--accent);
  text-decoration: none;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.user-table th,
.user-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.user-table th {
  color: var(--muted);
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
}

.badge.disabled {
  background: rgba(251, 113, 133, 0.15);
  color: var(--danger);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-actions .btn {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.admin-section {
  margin-top: 24px;
}

.admin-section h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(120%);
  background: rgba(18, 26, 44, 0.95);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 12px;
  transition: transform 0.25s ease;
  z-index: 20;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(52, 211, 153, 0.35); color: var(--success); }
.toast.error { border-color: rgba(251, 113, 133, 0.35); color: var(--danger); }
