:root {
  --bg-void: #060b12;
  --neon-green: #00ffa3;
  --neon-cyan: #00d9ff;
  --alert-red: #ff3b5c;
  --text-primary: #e8f4f2;
  --text-muted: #7c93a8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

::selection { background: rgba(0, 255, 163, 0.3); color: #04140f; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-void);
  background-image:
    radial-gradient(circle at 50% 20%, rgba(0, 150, 255, 0.08), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(0, 255, 163, 0.06), transparent 50%);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}

/* ---------- Background layers: live SOC telemetry feel ---------- */

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0, 255, 163, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 163, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, black, transparent 80%);
  animation: gridDrift 70s linear infinite;
}

@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 480px 480px, 480px 480px; }
}

.scanline {
  position: fixed;
  left: 0; right: 0;
  top: -140px;
  height: 140px;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
  background: linear-gradient(to bottom, transparent, rgba(0, 217, 255, 0.06), transparent);
  animation: scan 7s linear infinite;
}

@keyframes scan {
  0%   { top: -140px; }
  100% { top: 100%; }
}

.nodes { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.node {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px 2px var(--neon-cyan);
  opacity: 0.5;
  animation: float 9s ease-in-out infinite;
}
.n1 { top: 18%; left: 12%; animation-delay: 0s; }
.n2 { top: 70%; left: 8%;  background: var(--neon-green); box-shadow: 0 0 8px 2px var(--neon-green); animation-delay: 1.5s; }
.n3 { top: 30%; left: 88%; animation-delay: 3s; }
.n4 { top: 82%; left: 78%; background: var(--neon-green); box-shadow: 0 0 8px 2px var(--neon-green); animation-delay: 4.5s; }
.n5 { top: 8%;  left: 60%; animation-delay: 2s; }
.n6 { top: 55%; left: 94%; animation-delay: 5.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0);     opacity: 0.35; }
  50%      { transform: translateY(-18px); opacity: 0.8; }
}

/* ---------- Glass login card ---------- */

.login-box {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  background: rgba(13, 20, 32, 0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(0, 255, 200, 0.15);
  border-radius: 16px;
  padding: 0 32px 32px;
  text-align: center;
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.6), 0 0 40px -10px rgba(0, 255, 163, 0.15);
  animation: cardGlow 5s ease-in-out infinite;
}

@keyframes cardGlow {
  0%, 100% { box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.6), 0 0 40px -10px rgba(0, 255, 163, 0.15); }
  50%      { box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.6), 0 0 55px -8px rgba(0, 217, 255, 0.22); }
}

.termbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -32px 24px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.termbar-dots { display: flex; gap: 6px; }
.termbar-dots span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.15); }
.termbar-dots span:nth-child(1) { background: #ff5f56; }
.termbar-dots span:nth-child(2) { background: #ffbd2e; }
.termbar-dots span:nth-child(3) { background: #27c93f; }

.termbar-label {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--neon-green);
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 6px 2px var(--neon-green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}

/* ---------- Brand ---------- */

.brand { margin-bottom: 28px; padding-top: 4px; }
.brand h1 {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cursor {
  color: var(--neon-cyan);
  -webkit-text-fill-color: var(--neon-cyan);
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.subtitle {
  margin-top: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- Form fields ---------- */

.field { margin-bottom: 18px; text-align: left; }
.field label {
  display: block;
  margin-bottom: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.input-wrap { position: relative; }
.field-icon {
  position: absolute;
  top: 50%; left: 13px;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.25s ease;
}

.input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  background: rgba(5, 10, 16, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-primary);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.input-wrap input::placeholder { color: rgba(124, 147, 168, 0.55); }
.input-wrap input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.12), 0 0 16px -2px rgba(0, 217, 255, 0.35);
}
.input-wrap:focus-within .field-icon { color: var(--neon-cyan); }

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0px 1000px rgba(5, 10, 16, 0.9) inset;
  transition: background-color 9999s ease-in-out 0s;
}

/* ---------- Submit button ---------- */

button[type="submit"] {
  width: 100%;
  margin-top: 6px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #04140f;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 6px 24px -6px rgba(0, 255, 163, 0.45);
  transition: transform 0.15s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
button[type="submit"] svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
button[type="submit"]:hover { filter: brightness(1.08); box-shadow: 0 8px 30px -4px rgba(0, 217, 255, 0.55); }
button[type="submit"]:hover svg { transform: translateX(3px); }
button[type="submit"]:active { transform: scale(0.98); }
button[type="submit"]:focus-visible { outline: 2px solid var(--neon-cyan); outline-offset: 3px; }

/* ---------- Error message (reacts to JS writing text into #errorMsg) ---------- */

.error {
  display: block;
  margin-top: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  color: var(--alert-red);
  text-align: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.error:not(:empty) {
  opacity: 1;
  transform: translateY(0);
  animation: shake 0.4s ease;
}
.error:not(:empty)::before { content: "⚠ "; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}

/* ---------- Footer status line ---------- */

.footer-status {
  position: relative;
  z-index: 2;
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(124, 147, 168, 0.65);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 6px 2px var(--neon-green);
  animation: pulse 2s ease-in-out infinite;
}

/* ---------- Responsive (login) ---------- */

@media (max-width: 480px) {
  .login-box { padding: 0 22px 26px; border-radius: 14px; }
  .termbar { margin: 0 -22px 20px; padding: 12px 16px; }
  .brand h1 { font-size: 24px; }
}

/* =========================================================
   DASHBOARD (dashboard.html) — yeni əlavələr
   ========================================================= */

body.dashboard {
  display: block;
  align-items: initial;
  justify-content: initial;
  padding: 0;
}

/* ---------- Navbar ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(13, 20, 32, 0.6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(0, 255, 200, 0.12);
}

.nav-brand { display: flex; align-items: baseline; gap: 10px; }
.nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 19px;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 2px 6px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.logout-btn svg { width: 15px; height: 15px; }
.logout-btn:hover {
  color: var(--alert-red);
  border-color: rgba(255, 59, 92, 0.4);
  background: rgba(255, 59, 92, 0.08);
}
.logout-btn:focus-visible { outline: 2px solid var(--neon-cyan); outline-offset: 2px; }

/* ---------- Main grid + cards ---------- */

.dashboard-main {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
  padding: 36px 24px 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.card {
  background: rgba(13, 20, 32, 0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(0, 255, 200, 0.15);
  border-radius: 14px;
  padding: 20px 22px 24px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.55);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--neon-cyan);
}
.card-icon { width: 18px; height: 18px; flex-shrink: 0; }
.card-head h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  font-weight: 600;
}

.card-body { min-height: 56px; }

/* CSS-only "Yüklənir..." vəziyyəti — JS dolana qədər görünür, sonra avtomatik yox olur */
#profileBox:empty::before,
#usersBox:empty::before {
  content: "Yüklənir...";
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ---------- #profileBox daxili məzmun (dashboard.js: <p><b>Label:</b> dəyər</p>) ---------- */

#profileBox p {
  display: flex;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
}
#profileBox p:last-child { border-bottom: none; }
#profileBox b {
  min-width: 90px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--neon-cyan);
  font-weight: 600;
}
/* İkinci sətir (Rol) — status rəngi ilə fərqləndirilir */
#profileBox p:nth-of-type(2) { color: var(--neon-green); font-weight: 500; }

/* ---------- #usersBox daxili məzmun (dashboard.js: <p>...</p><ul><li>#id — user</li></ul>) ---------- */

#usersBox p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
#usersBox ul {
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}
#usersBox li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  margin-bottom: 4px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}
#usersBox li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 5px 1px var(--neon-green);
  flex-shrink: 0;
}
#usersBox li:hover {
  background: rgba(0, 217, 255, 0.06);
  border-color: rgba(0, 217, 255, 0.2);
}
#usersBox ul::-webkit-scrollbar { width: 6px; }
#usersBox ul::-webkit-scrollbar-track { background: transparent; }
#usersBox ul::-webkit-scrollbar-thumb { background: rgba(0, 255, 163, 0.25); border-radius: 3px; }

/* ---------- Responsive (dashboard) ---------- */

@media (max-width: 760px) {
  .navbar { padding: 14px 18px; }
  .dashboard-main { grid-template-columns: 1fr; padding: 24px 18px 48px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .grid-bg, .scanline, .node, .live-dot, .status-dot, .cursor, .login-box, .error:not(:empty) {
    animation: none !important;
  }
}
