:root {
  --bg: #0f172a;
  --card: #111827;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --text: #e2e8f0;
  --border: #1f2937;
  --danger: #ef4444;
  --success: #22c55e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 20%, #1e293b, #0b1220);
  color: var(--text);
}
.shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.shell-view {
  flex: 1;
  display: flex;
}
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}
h1 { margin: 0 0 4px; font-size: 30px; }
h2 { margin: 0 0 8px; }
.subtitle { color: var(--muted); margin: 0; }
.muted { color: var(--muted); font-size: 14px; margin-top: -4px; }
.muted.small-note { font-size: 12px; margin-top: 8px; }
.card {
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.auth-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px;
}
.auth-left {
  justify-content: space-between;
  background: radial-gradient(circle at 0% 0%, rgba(56,189,248,0.18), transparent 60%), radial-gradient(circle at 80% 100%, rgba(59,130,246,0.22), transparent 55%);
  border-right: 1px solid rgba(15,23,42,0.8);
}
.auth-right {
  align-items: center;
  justify-content: center;
}
.brand {
  max-width: 420px;
}
.brand h1 {
  font-size: 34px;
  margin-bottom: 8px;
}
.brand p {
  color: var(--muted);
  margin: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,0.8);
  border: 1px solid rgba(148,163,184,0.4);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #e5e7eb;
  margin-bottom: 18px;
}
.auth-illustration {
  height: 220px;
  border-radius: 18px;
  border: 1px solid rgba(51,65,85,0.7);
  background-image: linear-gradient(135deg, rgba(56,189,248,0.45), rgba(129,140,248,0.1)), radial-gradient(circle at 10% 0%, rgba(15,23,42,0.9), transparent 55%);
  box-shadow: 0 26px 60px rgba(15,23,42,0.9);
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.small-stack {
  gap: 6px;
}
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0;
  font-size: 12px;
  color: var(--muted);
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: radial-gradient(circle, rgba(148,163,184,0.7), transparent);
}
.divider span {
  white-space: nowrap;
}
.remember-row span {
  font-weight: 500;
}

label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
  color: #dbeafe;
}
input, select, button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
  font-size: 15px;
}
input:focus, select:focus {
  outline: 2px solid var(--accent);
}
button {
  cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  border: none;
  font-weight: 700;
  transition: transform 0.05s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }
button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
}
button.ghost {
  width: auto;
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
}
.ghost.small {
  padding-inline: 10px;
  font-size: 13px;
}
.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.inline-row { display: flex; gap: 8px; }
.inline-row button { width: auto; white-space: nowrap; }
.top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr);
  gap: 16px;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.admin-column h3 {
  margin: 0 0 8px;
}
.admin-table {
  font-size: 13px;
}
.admin-table th,
.admin-table td {
  white-space: nowrap;
}
.admin-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  max-height: 200px;
  overflow-y: auto;
  font-size: 14px;
}
.admin-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(15,23,42,0.7);
}
.admin-list button {
  width: auto;
  padding-inline: 8px;
  font-size: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
th, td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th { color: #cbd5e1; }
.hidden { display: none; }
.register summary { cursor: pointer; margin: 10px 0; color: var(--accent); }
.register form { margin-top: 8px; }
#toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #0f172a;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  max-width: 320px;
}
#toast.error { border-color: var(--danger); color: #fecaca; }
#toast.success { border-color: var(--success); color: #dcfce7; }

@media (max-width: 640px) {
  .shell { display: block; }
  .shell-view { display: block; }
  .auth-side { padding: 20px 16px; }
  .auth-left {
    border-right: none;
    border-bottom: 1px solid rgba(15,23,42,0.9);
  }
  .auth-illustration { display: none; }
  .app-header { flex-direction: column; align-items: flex-start; }
  .inline-row { flex-direction: column; }
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  button.ghost, .ghost.small { width: 100%; }
}

