:root {
  --bg: #070a12;
  --ink: #eaf0ff;
  --muted: #9aa8c7;
  --line: rgba(255, 255, 255, 0.09);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.06);
  --brand: #7c9cff;
  --brand2: #63e6c8;
  --danger: #ff6b7d;
  --danger-bg: rgba(255, 107, 125, 0.12);
  --ok: #63e6c8;
  --ok-bg: rgba(99, 230, 200, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Aurora background */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.aurora::before, .aurora::after {
  content: ""; position: absolute; width: 70vw; height: 70vw;
  border-radius: 50%; filter: blur(90px); opacity: 0.45;
}
.aurora::before {
  background: radial-gradient(circle, #3f5bff 0%, transparent 60%);
  top: -25%; left: -12%; animation: drift1 22s ease-in-out infinite;
}
.aurora::after {
  background: radial-gradient(circle, #1ec9a3 0%, transparent 60%);
  bottom: -28%; right: -12%; animation: drift2 26s ease-in-out infinite;
}
@keyframes drift1 { 50% { transform: translate(15vw, 10vh) scale(1.15); } }
@keyframes drift2 { 50% { transform: translate(-12vw, -8vh) scale(1.1); } }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 560px; }

a { color: var(--brand); }

/* Nav */
nav.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 10, 18, 0.6);
  border-bottom: 1px solid var(--line);
}
nav.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; display: flex; gap: 9px; align-items: center; color: var(--ink); text-decoration: none; }
.logo .dot { width: 11px; height: 11px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand2)); box-shadow: 0 0 16px var(--brand); }
.navlinks { display: flex; align-items: center; gap: 8px; }
.navlinks a.link { color: var(--muted); text-decoration: none; font-size: 0.9rem; padding: 8px 12px; border-radius: 10px; transition: 0.2s; }
.navlinks a.link:hover { color: var(--ink); background: var(--glass); }
.navlinks a.link.active { color: var(--ink); background: var(--glass-2); }
.whoami { color: var(--muted); font-size: 0.85rem; display: flex; align-items: center; gap: 8px; }
.badge { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--brand2); background: var(--ok-bg); }
@media (max-width: 640px) { .navlinks a.link span.lbl { display: none; } .whoami .name { display: none; } }

/* Layout */
main { padding: 48px 0 80px; }
.page-head { margin-bottom: 32px; }
.eyebrow { color: var(--brand2); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; }
h1.page-title { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -0.02em; margin: 8px 0 6px; font-weight: 700; }
.page-head p.sub { color: var(--muted); max-width: 60ch; }

/* Cards / tiles */
.card {
  background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; backdrop-filter: blur(10px);
}
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.tile {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px; backdrop-filter: blur(10px);
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}
.tile:hover { transform: translateY(-4px); border-color: rgba(124, 156, 255, 0.45); background: var(--glass-2); }
.tile .ic {
  width: 54px; height: 54px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; background: linear-gradient(135deg, rgba(124, 156, 255, 0.25), rgba(99, 230, 200, 0.2));
  border: 1px solid var(--line); margin-bottom: 18px;
}
.tile h3 { font-size: 1.25rem; margin-bottom: 8px; letter-spacing: -0.01em; }
.tile p { color: var(--muted); font-size: 0.93rem; }
.tile .go { margin-top: 16px; color: var(--brand2); font-size: 0.85rem; font-weight: 600; }

/* Forms */
form.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.field input[type="text"], .field input[type="password"], .field input[type="search"] {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); color: var(--ink);
  font-size: 0.95rem; transition: border-color 0.2s, background 0.2s;
}
.field input:focus { outline: none; border-color: rgba(124, 156, 255, 0.6); background: rgba(0, 0, 0, 0.35); }
.field .hint { font-size: 0.78rem; color: var(--muted); opacity: 0.8; }
.check { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.9rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--brand), #5a78ff); color: #fff;
  padding: 11px 20px; border-radius: 999px; text-decoration: none; font-weight: 600;
  font-size: 0.92rem; border: 1px solid rgba(255, 255, 255, 0.15); cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 8px 26px rgba(90, 120, 255, 0.28);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(90, 120, 255, 0.4); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--glass); box-shadow: none; color: var(--ink); }
.btn.ghost:hover { background: var(--glass-2); }
.btn.danger { background: linear-gradient(135deg, var(--danger), #e0546a); box-shadow: 0 8px 26px rgba(255, 107, 125, 0.25); }
.btn.small { padding: 7px 13px; font-size: 0.82rem; }

/* Flash / alerts */
.alerts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.alert { padding: 12px 16px; border-radius: 12px; font-size: 0.9rem; border: 1px solid var(--line); }
.alert.ok { color: #bfeee1; background: var(--ok-bg); border-color: rgba(99, 230, 200, 0.3); }
.alert.err { color: #ffc3cb; background: var(--danger-bg); border-color: rgba(255, 107, 125, 0.3); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.users { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 640px; }
table.users th, table.users td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.users th { color: var(--muted); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; }
table.users tr:last-child td { border-bottom: none; }
table.users .uname { font-weight: 600; }
table.users .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 0.72rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag.admin { color: var(--brand2); background: var(--ok-bg); border-color: rgba(99, 230, 200, 0.3); }
.tag.you { color: var(--brand); border-color: rgba(124, 156, 255, 0.35); }

/* Auth (login) */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { text-align: center; margin-bottom: 26px; }
.auth-card .brand .dot { width: 13px; height: 13px; display: inline-block; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand2)); box-shadow: 0 0 16px var(--brand); vertical-align: middle; margin-right: 8px; }
.auth-card .brand .name { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.auth-card .brand .tag { display: block; margin-top: 8px; color: var(--muted); font-size: 0.85rem; border: none; padding: 0; }

.divider { height: 1px; background: var(--line); margin: 8px 0; border: none; }
.muted { color: var(--muted); }
.mt-lg { margin-top: 32px; }
.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; letter-spacing: -0.01em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

footer.foot { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 0.82rem; text-align: center; }
