/* ════════════════════════════════════════════════════════════════════════
   NeuroArsho — OTP authentication screen (RTL / Persian)
   ────────────────────────────────────────────────────────────────────────
   Dark holographic neuro-tech theme. Only the login form + the five
   telemetry widgets (فعالیت عصبی / نواحی مغز / فعالیت سیناپسی /
   شبکه مغزی / سیگنال EEG). Everything else was removed.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  --nm-bg:        #050B18;
  --nm-card:      rgba(10, 22, 40, 0.66);

  --nm-cyan:      #00D4FF;
  --nm-cyan-soft: #4DD8FF;
  --nm-blue:      #3B6BFF;
  --nm-violet:    #8B5CF6;
  --nm-mint:      #22D3EE;

  --nm-text:      #E9F3FF;
  --nm-muted:     #8CA3C8;

  --nm-border:        rgba(255, 255, 255, 0.06);
  --nm-cyan-border:   rgba(0, 212, 255, 0.25);
  --nm-field-fill:    rgba(11, 22, 38, 0.9);

  --nm-danger:      #FF5A76;
  --nm-danger-text: #FF93A6;

  --nm-font: 'Vazirmatn', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --nm-radius-card: 20px;
  --nm-radius-field: 12px;
  --nm-radius-widget: 14px;

  --nm-gradient: linear-gradient(135deg, #19D3F3 0%, #3B6BFF 100%);
}

/* ── Base (RTL: rendered with <html dir="rtl" lang="fa">) ─────────────── */
* { box-sizing: border-box; }

html, body { height: 100%; }

/* Overscroll containment: prevents scroll-chaining and Android's
   pull-to-refresh from yanking the document inside the installed PWA. */
html { overscroll-behavior: contain; }

body.nm-auth {
  margin: 0;
  background: var(--nm-bg);
  color: var(--nm-text);
  font-family: var(--nm-font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a { color: inherit; }

.nm-shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

/* ── Ambient background glows ─────────────────────────────────────────── */
.nm-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
}
.nm-glow--cyan   { width: 520px; height: 520px; right: 4%;  top: -10%;   background: rgba(0, 170, 255, 0.16); }
.nm-glow--violet { width: 460px; height: 460px; left:  8%; bottom: -14%; background: rgba(124, 58, 237, 0.14); }

/* Neural particle web (canvas) */
.nm-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

/* ── Center — login form ──────────────────────────────────────────────── */
.nm-center {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px 32px;
}

.nm-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 40px 38px 30px;
  background: var(--nm-card);
  border: 1px solid var(--nm-cyan-border);
  border-radius: var(--nm-radius-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(0, 212, 255, 0.04),
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 48px rgba(0, 170, 255, 0.14);
}

.nm-eyebrow {
  margin: 0 0 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--nm-cyan);
}

.nm-title {
  margin: 0 0 10px;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.35;
}
.nm-title__grad {
  background: var(--nm-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  direction: ltr;
  unicode-bidi: embed;
}

.nm-subtitle {
  margin: 0 0 28px;
  font-size: 0.9rem;
  color: var(--nm-muted);
  line-height: 1.8;
}

/* Step transitions */
.nm-step { animation: nmStepIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
.nm-step[hidden] { display: none; }

/* Identifier field */
.nm-field { position: relative; margin-bottom: 6px; }

.nm-field__icon {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  color: var(--nm-muted);
  pointer-events: none;
  display: grid;
  place-items: center;
}
.nm-field__icon svg { width: 18px; height: 18px; }

.nm-field__label {
  position: absolute;
  top: 12px;
  right: 46px;
  font-size: 0.86rem;
  color: var(--nm-muted);
  pointer-events: none;
  transition: color 0.2s ease;
}

.nm-field__control {
  width: 100%;
  padding: 20px 46px 8px 16px;
  background: var(--nm-field-fill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--nm-radius-field);
  color: var(--nm-text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nm-field__control::placeholder { color: #54688C; }
.nm-field__control:focus {
  outline: none;
  border-color: var(--nm-cyan);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.14);
  background: rgba(8, 20, 38, 0.98);
}
.nm-field:focus-within .nm-field__label { color: var(--nm-cyan-soft); }

.nm-field__error {
  margin: 6px 2px 0;
  min-height: 1em;
  font-size: 0.8rem;
  color: var(--nm-danger-text);
  display: none;
}
.nm-field.is-invalid .nm-field__error { display: block; }
.nm-field.is-invalid .nm-field__control {
  border-color: var(--nm-danger);
  box-shadow: 0 0 0 4px rgba(255, 90, 118, 0.14);
}
.nm-field.nm-shake { animation: nmShake 0.4s ease; }

.nm-helper {
  margin: 14px 2px 22px;
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--nm-muted);
}

/* Buttons */
.nm-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 22px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #FFFFFF;
  background: var(--nm-gradient);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.nm-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 170, 255, 0.4);
  filter: brightness(1.08);
}
.nm-btn:active:not(:disabled) { transform: translateY(0); }
.nm-btn:disabled { opacity: 0.6; cursor: not-allowed; }
/* Inline PanelIcons SVGs carry a viewBox but no intrinsic size — without this
   the browser inflates them to ~150–210px inside flex buttons. 18px keeps the
   icon on the same rhythm as the 0.95rem label; more specific rules (e.g.
   .nc-detail__cta svg) still win. */
.nm-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.nm-btn.is-loading .nm-btn__label { visibility: hidden; }
.nm-btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: nmSpin 0.7s linear infinite;
}

/* Step 2 — recipient header */
.nm-recipient { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.nm-recipient__title { margin: 0; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--nm-muted); }
.nm-recipient__value { margin: 0; font-size: 0.98rem; font-weight: 700; color: var(--nm-text); direction: ltr; unicode-bidi: embed; word-break: break-all; }
.nm-recipient__edit {
  margin-right: auto;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--nm-cyan-soft);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.nm-recipient__edit:hover { background: rgba(0, 212, 255, 0.16); }

/* 6-box OTP input */
.nm-otp { display: flex; gap: 10px; justify-content: space-between; margin-bottom: 4px; }

.nm-otp__digit {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1 / 1;
  max-width: 54px;
  padding: 0;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--nm-text);
  background: var(--nm-field-fill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.nm-otp__digit:focus {
  outline: none;
  border-color: var(--nm-cyan);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.16);
  background: rgba(8, 20, 38, 0.98);
}
.nm-otp__digit.is-error {
  border-color: var(--nm-danger);
  animation: nmShake 0.4s ease;
}

.nm-otp__error { text-align: center; display: none; }
.nm-otp.is-invalid .nm-otp__error { display: block; }

/* Countdown / resend */
.nm-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 22px;
  font-size: 0.86rem;
  color: var(--nm-muted);
}
.nm-timer__count { font-weight: 700; color: var(--nm-cyan-soft); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: embed; }
.nm-timer__resend {
  display: none;
  padding: 4px 12px;
  margin-right: 4px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--nm-cyan-soft);
  background: transparent;
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.nm-timer__resend:hover { background: rgba(0, 212, 255, 0.12); }
.nm-timer__resend:disabled { display: none; }
.nm-timer.is-elapsed .nm-timer__label, .nm-timer.is-elapsed .nm-timer__count { display: none; }
.nm-timer.is-elapsed .nm-timer__resend { display: inline-block; }

.nm-link {
  padding: 0;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--nm-cyan-soft);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.nm-link:hover { text-decoration: underline; }
.nm-link--center { display: block; margin: 18px auto 0; }

.nm-footnote {
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.8;
  color: var(--nm-muted);
}

/* ── Telemetry widgets ───────────────────────────────────────────────── */
.nm-widgets {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.nm-widget {
  position: absolute;
  min-width: 216px;
  padding: 14px 16px;
  background: rgba(10, 22, 40, 0.6);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--nm-radius-widget);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.nm-widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.nm-widget__head h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--nm-text);
}
.nm-widget__live { font-size: 0.66rem; color: var(--nm-mint); display: inline-flex; align-items: center; gap: 5px; text-transform: uppercase; letter-spacing: 0.06em; }
.nm-widget__live i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--nm-mint);
  animation: nmBlink 1.6s ease-in-out infinite;
}

.nm-widget--activity { left: 3%; top: 15%; }
.nm-widget--network  { left: 6%; top: 54%; }
.nm-widget--regions  { right: 3%; top: 16%; }
.nm-widget--synapse  { right: 11%; top: 44%; }
.nm-widget--eeg      { right: 5%; bottom: 8%; }

canvas { display: block; }
.nm-widget--activity canvas { width: 100%; height: auto; }

.nm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nm-chip {
  padding: 4px 9px;
  font-size: 0.68rem;
  color: var(--nm-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  white-space: nowrap;
}
.nm-chip b { color: var(--nm-text); font-weight: 600; margin-right: 3px; direction: ltr; unicode-bidi: embed; }
.nm-chip--alpha::before, .nm-chip--beta::before, .nm-chip--gamma::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; vertical-align: middle;
}
.nm-chip--alpha::before { background: var(--nm-cyan); }
.nm-chip--beta::before  { background: var(--nm-blue); }
.nm-chip--gamma::before { background: var(--nm-violet); }
.nm-chips--stack { display: flex; flex-wrap: wrap; }

/* Brain regions widget */
.nm-regions__scan { width: 64px; margin: 0 auto 12px; color: rgba(0, 212, 255, 0.7); }
.nm-regions__scan svg { width: 100%; height: auto; }

.nm-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.nm-bars li { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; }
.nm-bar__dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.nm-bar__row {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.nm-bar__row i { display: block; height: 100%; border-radius: 3px; background: currentColor; animation: nmGrow 1.2s ease both; }
.nm-bars li:nth-child(1) { color: var(--nm-cyan); }
.nm-bars li:nth-child(2) { color: var(--nm-blue); }
.nm-bars li:nth-child(3) { color: var(--nm-violet); }
.nm-bars li:nth-child(4) { color: var(--nm-mint); }
.nm-bars li:nth-child(5) { color: #A78BFA; }
.nm-bar__name { font-size: 0.7rem; color: var(--nm-muted); white-space: nowrap; }
.nm-bar__name b { color: var(--nm-text); font-weight: 600; margin-right: 4px; direction: ltr; unicode-bidi: embed; }

/* Synapse widget stats */
.nm-widget--synapse canvas { width: 100%; height: auto; margin: 4px 0 8px; }
.nm-stats { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.07); display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nm-stats li { display: grid; gap: 2px; }
.nm-stats b { font-size: 0.95rem; font-weight: 800; color: var(--nm-cyan-soft); }
.nm-stats span { font-size: 0.6rem; color: var(--nm-muted); }

/* Brain network radar */
.nm-radar { margin: 0 auto; width: 130px; }
.nm-radar svg { width: 100%; height: auto; }

/* EEG mini card */
.nm-widget--eeg .nm-eeg__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.nm-eeg__meta span { font-size: 0.68rem; color: var(--nm-muted); }
.nm-eeg__meta b { font-size: 1.05rem; font-weight: 800; color: var(--nm-cyan-soft); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: embed; }
.nm-widget--eeg canvas { width: 100%; height: auto; }

/* ── Toast ────────────────────────────────────────────────────────────── */
.nm-toast {
  position: fixed;
  z-index: 60;
  bottom: 26px;
  right: 50%;
  transform: translateX(50%) translateY(16px);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: min(92vw, 460px);
  padding: 12px 16px;
  font-size: 0.86rem;
  color: var(--nm-text);
  background: rgba(13, 26, 48, 0.9);
  border: 1px solid var(--nm-cyan-border);
  border-right: 3px solid var(--nm-cyan);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.nm-toast[hidden] { display: none; }
.nm-toast.is-show { opacity: 1; transform: translateX(50%) translateY(0); pointer-events: auto; }
.nm-toast.is-error { border-right-color: var(--nm-danger); }
.nm-toast__msg { flex: 1; }
.nm-toast__close {
  border: none;
  background: none;
  color: var(--nm-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.nm-toast__close:hover { color: var(--nm-text); }

/* ── Focus visibility (WCAG) ──────────────────────────────────────────── */
:where(a, button, input, [role="button"]):focus-visible {
  outline: 2px solid var(--nm-cyan);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1440px) {
  .nm-widget--activity { left: 2%; }
  .nm-widget--network  { left: 4%; }
  .nm-widget--regions  { right: 2%; }
  .nm-widget--synapse  { right: 7%; }
  .nm-widget--eeg      { right: 4%; }
}

/* Below wide screens the floating widgets would crowd the form → hide. */
@media (max-width: 1100px) {
  .nm-widgets { display: none; }
}

@media (max-width: 768px) {
  body.nm-auth { overflow: auto; }

  .nm-center { align-items: flex-start; padding: 64px 18px 48px; }
  .nm-card { padding: 32px 22px 26px; }
  .nm-title { font-size: 1.35rem; }
}

/* ── Motion preferences (WCAG 2.3.3) ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   NeuroArsho — post-login pages (VerifyOtp / OtpExpired / AccessDenied /
   Dashboard / AdminDemo). Additive rules only; they never touch the
   LoginOtp form above.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Server-side validation summary (tag helpers) ─────────────────────── */
.field-validation-error {
  color: var(--nm-danger-text);
  font-size: 0.8rem;
  display: block;
  margin-top: 4px;
}
.input-validation-error { border-color: var(--nm-danger) !important; }
.nm-validation-summary {
  color: var(--nm-danger-text);
  font-size: 0.84rem;
  margin: 4px 0 14px;
  padding: 10px 14px;
  list-style: none;
  background: rgba(255, 90, 118, 0.08);
  border: 1px solid rgba(255, 90, 118, 0.35);
  border-radius: 10px;
}
.nm-validation-summary ul { margin: 0; padding-right: 18px; }

/* ── VerifyOtp: recipient + demo chip ─────────────────────────────────── */
.nm-inline-count { color: var(--nm-cyan-soft); font-weight: 700; }
.nm-recipient-inline {
  display: inline-block;
  color: var(--nm-cyan-soft);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.nm-demo-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--nm-muted);
  background: rgba(0, 212, 255, 0.08);
  border: 1px dashed var(--nm-cyan-border);
  border-radius: 999px;
}
.nm-demo-chip b {
  color: var(--nm-cyan-soft);
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
}

/* ── Status pages (OtpExpired / AccessDenied) ─────────────────────────── */
.nm-status { text-align: center; }
.nm-status__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  color: var(--nm-cyan-soft);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid var(--nm-cyan-border);
  border-radius: 18px;
}
.nm-status__icon svg { width: 34px; height: 34px; }
.nm-status__icon--danger {
  color: var(--nm-danger-text);
  background: rgba(255, 90, 118, 0.1);
  border-color: rgba(255, 90, 118, 0.35);
}
.nm-status__actions {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

/* ── Button variants ──────────────────────────────────────────────────── */
.nm-btn--ghost {
  color: var(--nm-cyan-soft);
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid var(--nm-cyan-border);
}
.nm-btn--ghost:hover:not(:disabled) {
  background: rgba(0, 212, 255, 0.12);
  filter: none;
  box-shadow: 0 10px 28px rgba(0, 170, 255, 0.2);
}

/* ── Dashboard main page ──────────────────────────────────────────────── */
body.nm-auth.nm-dash-page { overflow: auto; height: auto; }

.nm-dash {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 108px 28px 64px;
}

.nm-dash__topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: rgba(5, 11, 24, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nm-dash__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.nm-dash__brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--nm-gradient);
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.7);
}
.nm-dash__topbar-actions { display: flex; align-items: center; gap: 14px; }

.nm-dash__user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--nm-muted);
  direction: ltr;
}
.nm-dash__user-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--nm-text);
  background: var(--nm-gradient);
  border-radius: 50%;
}
.nm-dash__logout {
  padding: 8px 18px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--nm-danger-text);
  background: rgba(255, 90, 118, 0.08);
  border: 1px solid rgba(255, 90, 118, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.nm-dash__logout:hover { background: rgba(255, 90, 118, 0.16); }

.nm-dash__head { margin-bottom: 30px; }
.nm-dash__title { margin: 0 0 10px; font-size: 2rem; font-weight: 800; }

.nm-dash__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 34px;
}
.nm-dash-card {
  padding: 18px 20px;
  background: var(--nm-card);
  border: 1px solid var(--nm-cyan-border);
  border-radius: var(--nm-radius-card);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}
.nm-dash-card--accent { border-color: rgba(139, 92, 246, 0.4); }
.nm-dash-card__label { display: block; font-size: 0.76rem; color: var(--nm-muted); margin-bottom: 6px; }
.nm-dash-card__value { display: block; font-size: 1.7rem; font-weight: 800; color: var(--nm-text); }
.nm-dash-card__unit { font-size: 0.9rem; color: var(--nm-cyan-soft); margin-right: 4px; }
.nm-dash-card__foot { display: block; margin-top: 4px; font-size: 0.72rem; color: var(--nm-muted); }

/* Widgets get a static grid placement on the dashboard. */
.nm-dash__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  align-items: stretch;
}
.nm-dash__grid .nm-widget { position: static; width: 100%; min-width: 0; }
.nm-dash__grid .nm-widget--eeg { grid-column: span 2; }

.nm-dash__admin {
  margin-top: 34px;
  padding: 22px 24px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--nm-radius-card);
}
.nm-dash__admin-title { margin: 0 0 6px; font-size: 1rem; font-weight: 700; }
.nm-dash__admin-text { margin: 0 0 16px; font-size: 0.84rem; color: var(--nm-muted); line-height: 1.9; }
.nm-dash__admin-btn { width: auto; }

.nm-dash__admin-ok { text-align: center; padding: 40px 24px; }
.nm-dash__admin-ok-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  color: #34D399;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 18px;
}
.nm-dash__admin-ok-icon svg { width: 30px; height: 30px; }
.nm-dash__admin-ok h2 { margin: 18px 0 6px; font-size: 1.25rem; }
.nm-dash__admin-ok p { margin: 0 0 22px; color: var(--nm-muted); font-size: 0.86rem; }

/* ── Dashboard responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nm-dash { padding: 96px 18px 48px; }
  .nm-dash__topbar { padding: 14px 18px; }
  .nm-dash__title { font-size: 1.6rem; }
  .nm-dash__grid .nm-widget--eeg { grid-column: auto; }
  .nm-dash__user { display: none; }
}

/* ── Keyframes ────────────────────────────────────────────────────────── */
@keyframes nmSpin   { to { transform: rotate(360deg); } }
@keyframes nmBlink  { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes nmGrow   { from { width: 0; } }
@keyframes nmStepIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: translateX(0); } }
@keyframes nmShake  { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }