/* ═══════════════════════════════════════════════════
   NEXUS ADMIN — Mobile-First Light Theme
   Matches: light bg, purple accent, card-based layout
   ═══════════════════════════════════════════════════ */

/* Google Fonts import removed — self-hosted site, system font stack fallback. */

/* ── CSS Variables ─────────────────────────────── */
:root {
  --nx-purple:      #6C63FF;
  --nx-purple-dim:  rgba(108,99,255,0.10);
  --nx-purple-mid:  rgba(108,99,255,0.22);
  --nx-red:         #ef4444;
  --nx-red-dim:     rgba(239,68,68,0.10);
  --nx-red-mid:     rgba(239,68,68,0.22);
  --nx-amber:       #f59e0b;
  --nx-green:       #22c55e;
  --nx-green-dim:   rgba(34,197,94,0.12);
  --nx-blue:        #3b82f6;

  --nx-bg:          #f0f2f5;
  --nx-surface:     #ffffff;
  --nx-raised:      #f8f9fb;
  --nx-lift:        #eef0f4;
  --nx-rule:        rgba(0,0,0,0.06);
  --nx-rule-hard:   rgba(0,0,0,0.10);

  --nx-ink:         #1a1a2e;
  --nx-ink-2:       #4a4a6a;
  --nx-ink-3:       #9898b8;

  --nx-font-display: 'Inter', sans-serif;
  --nx-font-mono:    'JetBrains Mono', monospace;

  --nx-sidebar:     240px;
  --nx-topbar:      56px;
  --nx-radius:      10px;
  --nx-radius-lg:   14px;
  --nx-shadow:      0 1px 8px rgba(0,0,0,0.07);
  --nx-shadow-md:   0 4px 20px rgba(0,0,0,0.10);
}

/* ── Reset ─────────────────────────────────────── */
.nx-shell *, .nx-shell *::before, .nx-shell *::after { box-sizing: border-box; margin: 0; padding: 0; }
.nx-shell a      { text-decoration: none; color: inherit; }
.nx-shell img    { display: block; max-width: 100%; }
.nx-shell button { cursor: pointer; font-family: inherit; }
.nx-shell svg    { display: inline-block; vertical-align: middle; flex-shrink: 0; }

body:has(.nx-shell),
html:has(.nx-shell) { height: 100%; background: var(--nx-bg); }

body:has(.nx-shell) {
  font-family: var(--nx-font-display);
  background: var(--nx-bg);
  color: var(--nx-ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body:has(.nx-shell) ::-webkit-scrollbar       { width: 4px; height: 4px; }
body:has(.nx-shell) ::-webkit-scrollbar-track  { background: transparent; }
body:has(.nx-shell) ::-webkit-scrollbar-thumb  { background: var(--nx-purple); border-radius: 2px; }


/* ═══════════════════════════════════════════════════
   SHELL LAYOUT
   ═══════════════════════════════════════════════════ */
.nx-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--nx-bg);
}


/* ═══════════════════════════════════════════════════
   MAIN COLUMN
   ═══════════════════════════════════════════════════ */
.nx-main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}


/* ═══════════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════════ */
.nx-topbar {
  height: var(--nx-topbar);
  background: var(--nx-surface);
  border-bottom: 1px solid var(--nx-rule-hard);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  flex-shrink: 0;
  gap: 0.75rem;
}

.nx-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nx-topbar-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--nx-purple) 0%, #9b59b6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.nx-topbar-logo svg { width: 20px; height: 20px; }

.nx-topbar-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--nx-ink);
}

.nx-topbar-end {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.nx-topbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--nx-bg);
  border: 1px solid var(--nx-rule-hard);
  color: var(--nx-ink-2);
  cursor: pointer;
  text-decoration: none;
}
.nx-topbar-btn svg { width: 16px; height: 16px; }
.nx-topbar-btn.is-danger {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.2);
  color: var(--nx-red);
}

.nx-burger {
  display: none;
  background: var(--nx-bg);
  border: 1px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius);
  color: var(--nx-ink-2);
  width: 38px; height: 38px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
.nx-burger svg { width: 18px; height: 18px; }

.nx-topbar-user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-family: var(--nx-font-mono);
  color: var(--nx-ink-2);
  padding: 0 0.25rem;
}
.nx-topbar-user svg { width: 14px; height: 14px; color: var(--nx-ink-3); }


/* ═══════════════════════════════════════════════════
   MAIN NAV — horizontal tabs below topbar
   ═══════════════════════════════════════════════════ */
.nx-mainnav {
  display: flex;
  align-items: center;
  background: var(--nx-surface);
  border-bottom: 1px solid var(--nx-rule-hard);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  padding: 0 0.75rem;
  scrollbar-width: none;
  gap: 0;
}
.nx-mainnav::-webkit-scrollbar { display: none; }

.nx-mainnav-link {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.78rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--nx-ink-3);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  position: relative;
  top: 1px;
  flex-shrink: 0;
  text-decoration: none;
  transition: color 0.15s;
}
.nx-mainnav-link svg { width: 14px; height: 14px; flex-shrink: 0; }
.nx-mainnav-link:hover { color: var(--nx-ink); }
.nx-mainnav-link.is-active {
  color: var(--nx-purple);
  border-bottom-color: var(--nx-purple);
}


/* ═══════════════════════════════════════════════════
   SUBNAV — smaller context links below mainnav
   ═══════════════════════════════════════════════════ */
.nx-subnav {
  display: flex;
  align-items: center;
  background: var(--nx-raised);
  border-bottom: 1px solid var(--nx-rule-hard);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  padding: 0 1rem;
  scrollbar-width: none;
  gap: 0.1rem;
}
.nx-subnav::-webkit-scrollbar { display: none; }
.nx-subnav::before { display: none; }

.nx-subnav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--nx-font-mono);
  color: var(--nx-ink-3);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  position: relative;
  top: 1px;
  flex-shrink: 0;
  text-decoration: none;
  background: transparent;
  transition: color 0.15s;
}
.nx-subnav-link:hover { color: var(--nx-ink); background: transparent; }
.nx-subnav-link.is-active {
  color: var(--nx-purple);
  background: transparent;
  border-bottom-color: var(--nx-purple);
}

.nx-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  background: var(--nx-bg);
  border: 1px solid var(--nx-rule-hard);
  color: var(--nx-ink-2);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--nx-font-mono);
  text-decoration: none;
}
.nx-pill-btn svg { width: 12px; height: 12px; }



/* ── Scroll zone ───────────────────────────────── */
.nx-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 1rem;
  min-height: 0;
  background: var(--nx-bg);
}


/* ═══════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════ */
.nx-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.nx-page-eyebrow {
  font-size: 0.67rem;
  font-family: var(--nx-font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nx-ink-3);
  margin-bottom: 0.2rem;
}

.nx-page-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--nx-ink);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.nx-page-title svg { width: 20px; height: 20px; color: var(--nx-purple); }

.nx-page-sub {
  font-size: 0.77rem;
  color: var(--nx-ink-3);
  font-family: var(--nx-font-mono);
  margin-top: 0.2rem;
}

.nx-page-acts {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}


/* ═══════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════ */
.nx-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--nx-radius);
  font-family: var(--nx-font-display);
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.nx-btn svg { width: 14px; height: 14px; }

.nx-btn-solid {
  background: var(--nx-purple);
  color: #fff;
  border-color: var(--nx-purple);
  box-shadow: 0 2px 8px rgba(108,99,255,0.28);
}
.nx-btn-outline {
  background: transparent;
  color: var(--nx-purple);
  border-color: var(--nx-purple);
}
.nx-btn-ghost {
  background: var(--nx-surface);
  color: var(--nx-ink-2);
  border-color: var(--nx-rule-hard);
  box-shadow: var(--nx-shadow);
}
.nx-btn-danger {
  background: var(--nx-red-dim);
  color: var(--nx-red);
  border-color: var(--nx-red-mid);
}
.nx-btn-xl { padding: 0.7rem 1.5rem; font-size: 0.9rem; }
.nx-btn-xl svg { width: 16px; height: 16px; }
.nx-btn-sm { padding: 0.3rem 0.7rem; font-size: 0.75rem; }
.nx-btn-sm svg { width: 13px; height: 13px; }
.nx-btn-sm.is-active { background: var(--nx-purple); color: #fff; border-color: var(--nx-purple); }

.nx-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--nx-radius);
  background: var(--nx-bg);
  border: 1px solid var(--nx-rule-hard);
  color: var(--nx-ink-2);
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
}
.nx-icon-btn svg { width: 15px; height: 15px; }
.nx-icon-btn.is-danger {
  background: var(--nx-red-dim);
  border-color: var(--nx-red-mid);
  color: var(--nx-red);
}
.nx-icon-btn.is-purple {
  background: var(--nx-purple-dim);
  border-color: var(--nx-purple-mid);
  color: var(--nx-purple);
}


/* ═══════════════════════════════════════════════════
   DASHBOARD METRICS
   ═══════════════════════════════════════════════════ */
.nx-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.nx-metric {
  background: var(--nx-surface);
  border: 1px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius);
  padding: 1rem 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.nx-metric-top { display: flex; align-items: center; justify-content: space-between; }

.nx-metric-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--nx-radius);
  background: var(--nx-purple-dim);
  color: var(--nx-purple);
}
.nx-metric-icon svg { width: 16px; height: 16px; }

.nx-metric-tag {
  font-size: 0.62rem;
  font-family: var(--nx-font-mono);
  color: var(--nx-ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nx-metric-val {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--nx-ink);
}

.nx-metric-label {
  font-size: 0.72rem;
  color: var(--nx-ink-3);
  font-weight: 600;
  font-family: var(--nx-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nx-metric-foot {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-family: var(--nx-font-mono);
  color: var(--nx-ink-3);
  text-decoration: none;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--nx-rule);
}
a.nx-metric-foot { color: var(--nx-purple); }
a.nx-metric-foot:hover { text-decoration: underline; }
a.nx-metric-foot svg { flex-shrink: 0; }


/* ═══════════════════════════════════════════════════
   QUICK ACTIONS
   ═══════════════════════════════════════════════════ */
.nx-action-strip {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.nx-action-tile {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  background: var(--nx-surface);
  border: 1px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--nx-ink-2);
  box-shadow: var(--nx-shadow);
  text-decoration: none;
}
.nx-action-tile svg { width: 15px; height: 15px; }
.nx-action-tile.is-primary {
  background: var(--nx-purple);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(108,99,255,0.28);
}


/* ═══════════════════════════════════════════════════
   PANEL
   ═══════════════════════════════════════════════════ */
.nx-panel {
  background: var(--nx-surface);
  border: 1px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius-lg);
  margin-bottom: 1rem;
  box-shadow: var(--nx-shadow);
}

.nx-panel-danger { border-color: var(--nx-red-mid); }

.nx-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--nx-rule);
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nx-panel-title {
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--nx-ink-2);
}

.nx-panel-id {
  font-size: 0.67rem;
  font-family: var(--nx-font-mono);
  color: var(--nx-ink-3);
  background: var(--nx-bg);
  border: 1px solid var(--nx-rule-hard);
  padding: 0.12rem 0.42rem;
  border-radius: 4px;
}

.nx-panel-body { padding: 1rem; }

.nx-panel-link {
  font-size: 0.75rem;
  font-family: var(--nx-font-mono);
  color: var(--nx-purple);
  font-weight: 600;
}


/* ═══════════════════════════════════════════════════
   DATA TABLE
   ═══════════════════════════════════════════════════ */
.nx-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.nx-table { width: 100%; min-width: 580px; border-collapse: collapse; font-size: 0.82rem; }

.nx-table th {
  text-align: left;
  padding: 0.55rem 0.9rem;
  font-size: 0.67rem;
  font-family: var(--nx-font-mono);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nx-ink-3);
  border-bottom: 1px solid var(--nx-rule-hard);
  white-space: nowrap;
  background: var(--nx-raised);
}

.nx-table td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--nx-rule);
  vertical-align: middle;
  color: var(--nx-ink);
}
.nx-table tr:last-child td { border-bottom: none; }

.nx-thumb {
  width: 36px; height: 48px;
  object-fit: cover;
  border-radius: 7px;
  display: block;
  box-shadow: var(--nx-shadow);
}
.nx-thumb-empty {
  width: 36px; height: 48px;
  background: var(--nx-bg);
  border-radius: 7px;
  border: 1px solid var(--nx-rule-hard);
  display: flex; align-items: center; justify-content: center;
  color: var(--nx-ink-3);
}
.nx-thumb-empty svg { width: 13px; height: 13px; }

.nx-row-link { font-weight: 600; color: var(--nx-ink); }
.nx-row-meta { display: block; font-size: 0.71rem; color: var(--nx-ink-3); font-family: var(--nx-font-mono); margin-top: 1px; }

.nx-chip {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  font-size: 0.67rem;
  font-weight: 700;
  font-family: var(--nx-font-mono);
  background: var(--nx-bg);
  color: var(--nx-ink-2);
  border: 1px solid var(--nx-rule-hard);
}

.nx-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-family: var(--nx-font-mono);
  font-weight: 600;
}
.nx-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nx-status.ongoing::before   { background: var(--nx-amber); }
.nx-status.completed::before { background: var(--nx-green); }
.nx-status.upcoming::before  { background: var(--nx-blue); }

.nx-row-acts { display: flex; gap: 0.3rem; align-items: center; }

.nx-empty-row {
  text-align: center; padding: 2.5rem;
  color: var(--nx-ink-3); font-family: var(--nx-font-mono); font-size: 0.78rem;
}
.nx-empty-row a { color: var(--nx-purple); }


/* ═══════════════════════════════════════════════════
   DASHBOARD ANIME LIST (Recently Added)
   ═══════════════════════════════════════════════════ */
.nx-alist {
  list-style: none;
  margin: 0; padding: 0;
}

.nx-alist-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--nx-rule);
}
.nx-alist-item:last-child { border-bottom: none; }
.nx-alist-item:hover { background: var(--nx-raised); }

.nx-alist-main {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  flex: 1;
}

.nx-alist-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.nx-alist-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--nx-ink);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nx-alist-title:hover { color: var(--nx-purple); }

.nx-alist-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nx-alist-meta-item {
  font-size: 0.74rem;
  color: var(--nx-ink-3);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nx-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
}
.nx-status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nx-status-badge.completed {
  background: rgba(34,197,94,0.12);
  color: #16a34a;
}
.nx-status-badge.completed::before { background: #22c55e; }
.nx-status-badge.ongoing {
  background: rgba(245,158,11,0.12);
  color: #b45309;
}
.nx-status-badge.ongoing::before { background: var(--nx-amber); animation: nx-pulse 1.4s ease-in-out infinite; }
.nx-status-badge.upcoming {
  background: rgba(0,0,0,0.06);
  color: var(--nx-ink-2);
}
.nx-status-badge.upcoming::before { background: var(--nx-ink-2); }

@keyframes nx-pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

.nx-alist-tag {
  color: var(--nx-ink-2);
  font-weight: 600;
}
.nx-alist-tag-hot {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(239,68,68,0.1);
  color: var(--nx-red);
  border: 1px solid rgba(239,68,68,0.2);
  font-size: 0.65rem;
  font-weight: 800;
  font-family: var(--nx-font-mono);
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.nx-alist-tag-hot {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(239,68,68,0.10);
  color: var(--nx-red);
  border: 1px solid rgba(239,68,68,0.2);
  font-size: 0.62rem;
  font-weight: 800;
  font-family: var(--nx-font-mono);
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.nx-alist-date {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-family: var(--nx-font-mono);
  color: var(--nx-ink-3);
}

.nx-alist-acts {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
  align-items: center;
}


.nx-alist-pager {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--nx-rule);
  flex-wrap: wrap;
}

.nx-page-ellipsis {
  font-size: 0.75rem;
  color: var(--nx-ink-3);
  padding: 0 0.15rem;
  font-family: var(--nx-font-mono);
}

.nx-page-info {
  margin-left: auto;
  font-size: 0.72rem;
  font-family: var(--nx-font-mono);
  color: var(--nx-ink-3);
}

.nx-panel-count {
  font-size: 0.72rem;
  font-family: var(--nx-font-mono);
  color: var(--nx-ink-3);
  background: var(--nx-bg);
  border: 1px solid var(--nx-rule-hard);
  padding: 0.12rem 0.45rem;
  border-radius: 5px;
}


/* ═══════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════ */
.nx-pager-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.nx-pager-info {
  font-size: 0.73rem;
  font-family: var(--nx-font-mono);
  color: var(--nx-ink-3);
}

.nx-pager, .nx-pagination {
  display: flex; gap: 0.3rem; padding: 0.85rem 0 0.2rem;
  align-items: center; flex-wrap: wrap;
}

.nx-pager-wrap .nx-pager { padding: 0; }

.nx-page-ellipsis {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 32px;
  font-size: 0.75rem; color: var(--nx-ink-3);
  font-family: var(--nx-font-mono);
}
.nx-page-num, .nx-page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; border-radius: 8px;
  background: var(--nx-surface); border: 1px solid var(--nx-rule-hard);
  font-size: 0.75rem; font-family: var(--nx-font-mono); font-weight: 600;
  color: var(--nx-ink-2); padding: 0 0.4rem; text-decoration: none;
  box-shadow: var(--nx-shadow);
}
.nx-page-num.is-current,
.nx-page-btn.is-active {
  background: var(--nx-purple); border-color: var(--nx-purple); color: #fff;
  box-shadow: 0 2px 8px rgba(108,99,255,0.28);
}


/* ═══════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════ */
.nx-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem; margin-bottom: 1rem; align-items: start;
}
.nx-form-col { display: flex; flex-direction: column; gap: 1rem; }
.nx-field-group { display: flex; flex-direction: column; gap: 0.35rem; }
.nx-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.75rem; }

.nx-label {
  font-size: 0.71rem; font-weight: 700; font-family: var(--nx-font-mono);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--nx-ink-2);
}
.nx-required { color: var(--nx-red); }

.nx-input, .nx-select, .nx-textarea {
  width: 100%; padding: 0.65rem 0.9rem;
  background: var(--nx-raised); border: 1.5px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius); color: var(--nx-ink);
  font-size: 0.85rem; font-family: var(--nx-font-display); outline: none;
  transition: border-color 0.15s;
}
.nx-input:focus, .nx-select:focus, .nx-textarea:focus {
  border-color: var(--nx-purple); background: var(--nx-surface);
}
.nx-input::placeholder, .nx-textarea::placeholder { color: var(--nx-ink-3); }
.nx-input[readonly] { opacity: 0.5; cursor: default; }
.nx-textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.nx-code-input { font-family: var(--nx-font-mono); font-size: 0.8rem; }

.nx-hint { font-size: 0.71rem; color: var(--nx-ink-3); font-family: var(--nx-font-mono); margin-top: 0.1rem; }
.nx-hint a { color: var(--nx-purple); }
.nx-divider { height: 1px; background: var(--nx-rule); margin: 0.85rem 0; }

.nx-cover-input-row { display: flex; gap: 0.75rem; align-items: flex-start; }
.nx-cover-input-row .nx-input { flex: 1; min-width: 0; }
.nx-cover-slot { flex-shrink: 0; }
.nx-cover-thumb { width: 64px; height: 90px; object-fit: cover; border-radius: var(--nx-radius); display: block; box-shadow: var(--nx-shadow); }
.nx-cover-empty {
  width: 64px; height: 90px; background: var(--nx-bg);
  border: 1.5px dashed var(--nx-rule-hard); border-radius: var(--nx-radius);
  display: flex; align-items: center; justify-content: center; color: var(--nx-ink-3);
}
.nx-cover-empty svg { width: 20px; height: 20px; }
.nx-cover-preview-wrap { margin-top: 0.65rem; border-radius: var(--nx-radius); overflow: hidden; border: 1px solid var(--nx-rule-hard); display: inline-block; }
.nx-cover-preview { display: block; width: 120px; height: 170px; object-fit: cover; }
.nx-banner-preview-wrap { margin-top: 0.65rem; border-radius: var(--nx-radius); overflow: hidden; border: 1px solid var(--nx-rule-hard); }
.nx-banner-preview { display: block; width: 100%; max-height: 120px; object-fit: cover; }
.nx-img-preview { max-width: 180px; border-radius: var(--nx-radius); margin-top: 0.6rem; }
.nx-img-preview.hidden { display: none; }

.nx-form-footer {
  display: flex; gap: 0.65rem; align-items: center; flex-wrap: wrap;
  margin-top: 0.25rem; padding-top: 1.1rem; border-top: 1px solid var(--nx-rule);
}
.nx-form-saved { font-size: 0.74rem; font-family: var(--nx-font-mono); color: var(--nx-green); margin-left: auto; }
.nx-input-error { border-color: var(--nx-red) !important; }
.nx-required-badge {
  display: inline-block; font-size: .6rem; font-family: var(--nx-font-mono);
  text-transform: uppercase; letter-spacing: .06em; background: var(--nx-red);
  color: #fff; padding: .1em .45em; border-radius: 4px; vertical-align: middle; margin-left: .35rem;
}


/* ═══════════════════════════════════════════════════
   SEARCH / FILTER BAR
   ═══════════════════════════════════════════════════ */
.nx-search-row {
  display: flex; gap: 0.5rem; margin-bottom: 1rem;
  align-items: center; flex-wrap: wrap;
}
.nx-search-row .nx-input  { flex: 1; min-width: 140px; }
.nx-search-row .nx-select { max-width: 220px; }


/* ═══════════════════════════════════════════════════
   ANIME CARD GRID  (2-col poster cards like screenshot)
   ═══════════════════════════════════════════════════ */
.nx-anime-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.nx-anime-card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius-lg);
  overflow: hidden;
  box-shadow: var(--nx-shadow);
  transition: box-shadow 0.18s;
}
.nx-anime-card:hover { box-shadow: var(--nx-shadow-md); }

.nx-thumbnail-container {
  width: 100%;
  position: relative;
  padding-top: 130%;
  overflow: hidden;
  background: var(--nx-lift);
}
.nx-anime-thumb {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.3s;
}
.nx-anime-card:hover .nx-anime-thumb { transform: scale(1.04); }

.nx-thumb-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--nx-ink-3);
}

.nx-anime-content { padding: 0.7rem 0.75rem 0.7rem; }

.nx-anime-title {
  font-size: 0.84rem; font-weight: 700; color: var(--nx-ink);
  margin-bottom: 0.55rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.2rem;
}

.nx-status-tags-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.45rem; gap: 0.25rem; flex-wrap: wrap;
}
.nx-tags-container { display: flex; gap: 0.2rem; flex-wrap: wrap; }

.nx-tag-badge {
  padding: 0.15rem 0.45rem; border-radius: 4px;
  font-size: 0.62rem; font-weight: 700; font-family: var(--nx-font-mono);
  display: inline-flex; align-items: center; gap: 0.2rem;
}
.nx-tag-hot { background: rgba(239,68,68,0.10); color: var(--nx-red); border: 1px solid rgba(239,68,68,0.2); }
.nx-tag-new { background: rgba(108,99,255,0.10); color: var(--nx-purple); border: 1px solid var(--nx-purple-mid); }

.nx-card-meta-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.55rem; font-size: 0.69rem; color: var(--nx-ink-3);
  font-family: var(--nx-font-mono); gap: 0.3rem;
}
.nx-card-meta-row span { display: flex; align-items: center; gap: 0.25rem; }

.nx-card-actions-row {
  display: flex; gap: 0.25rem;
  padding-top: 0.5rem; border-top: 1px solid var(--nx-rule);
}
.nx-card-icon-btn {
  display: flex; align-items: center; justify-content: center;
  flex: 1; height: 32px; border-radius: 7px;
  background: var(--nx-bg); border: 1px solid var(--nx-rule-hard);
  color: var(--nx-ink-2); cursor: pointer; text-decoration: none;
}
.nx-card-icon-btn svg { width: 14px; height: 14px; }
.nx-card-icon-btn.is-purple { background: var(--nx-purple-dim); color: var(--nx-purple); border-color: var(--nx-purple-mid); }
.nx-card-icon-btn.is-danger { background: var(--nx-red-dim); color: var(--nx-red); border-color: var(--nx-red-mid); }
.nx-card-icon-btn.is-add    { background: rgba(34,197,94,0.08); color: var(--nx-green); border-color: rgba(34,197,94,0.22); }


/* ── Prev / Next Pagination ────────────────────── */
.nx-pagination-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.1rem 0;
}

.nx-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--nx-radius);
  background: var(--nx-surface);
  border: 1px solid var(--nx-rule-hard);
  color: var(--nx-ink-2);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--nx-shadow);
  transition: background 0.15s, color 0.15s;
}
.nx-nav-btn:hover:not(.is-disabled) {
  background: var(--nx-purple);
  color: #fff;
  border-color: var(--nx-purple);
}
.nx-nav-btn.is-disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

.nx-pagination-info {
  font-size: 0.78rem;
  font-family: var(--nx-font-mono);
  color: var(--nx-ink-3);
  white-space: nowrap;
}
.nx-pagination-info strong { color: var(--nx-ink); }

/* ── Page count label ───────────────────────────── */
.nx-page-count {
  font-size: .85rem; font-weight: 600;
  color: var(--nx-ink-3); font-family: var(--nx-font-mono);
}


/* ═══════════════════════════════════════════════════
   EPISODE CARDS  (full-width cards like screenshot)
   ═══════════════════════════════════════════════════ */
.nx-ep-cards { display: flex; flex-direction: column; gap: 0.5rem; }

.nx-ep-card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius-lg);
  padding: 0.85rem 1rem;
  box-shadow: var(--nx-shadow);
}

.nx-ep-card-top {
  display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.4rem;
}

.nx-ep-play-icon {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--nx-purple);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.nx-ep-play-icon svg { width: 12px; height: 12px; margin-left: 1px; }

.nx-ep-num { font-size: 0.95rem; font-weight: 800; color: var(--nx-ink); letter-spacing: -0.02em; }
.nx-ep-title-text { font-size: 0.78rem; color: var(--nx-ink-2); font-weight: 500; }

.nx-ep-meta { display: flex; flex-direction: column; gap: 0.18rem; margin-bottom: 0.5rem; }
.nx-ep-meta-row {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.75rem; color: var(--nx-ink-3); font-family: var(--nx-font-mono);
}
.nx-ep-meta-row svg { width: 12px; height: 12px; flex-shrink: 0; }
.nx-ep-meta-row strong { color: var(--nx-ink-2); font-weight: 600; }

.nx-ep-card-foot {
  display: flex; gap: 0.85rem;
  padding-top: 0.45rem; border-top: 1px solid var(--nx-rule);
}

.nx-ep-text-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.8rem; font-weight: 700; cursor: pointer;
  background: none; border: none; padding: 0; text-decoration: none;
  font-family: var(--nx-font-display); color: var(--nx-ink-2);
}
.nx-ep-text-btn svg { width: 14px; height: 14px; }
.nx-ep-text-btn.is-danger { color: var(--nx-red); }


/* ═══════════════════════════════════════════════════
   USER CARDS  (avatar + info cards like screenshot)
   ═══════════════════════════════════════════════════ */
.nx-user-cards { display: flex; flex-direction: column; gap: 0.6rem; }

.nx-user-card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius-lg);
  padding: 0.9rem 1rem;
  display: flex; align-items: flex-start; gap: 0.85rem;
  box-shadow: var(--nx-shadow);
}

.nx-avatar {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, var(--nx-purple) 0%, #9b59b6 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95rem; flex-shrink: 0; font-family: var(--nx-font-mono);
}

.nx-user-info { flex: 1; min-width: 0; }

.nx-user-main {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.15rem; flex-wrap: wrap;
}

.nx-username { font-size: 0.9rem; font-weight: 700; color: var(--nx-ink); }

.nx-user-email {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.75rem; font-family: var(--nx-font-mono);
  color: var(--nx-ink-3); margin-bottom: 0.45rem;
}
.nx-user-email svg { width: 12px; height: 12px; }

.nx-user-meta { display: flex; flex-direction: column; gap: 0.28rem; }

.nx-meta-item {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.76rem; font-family: var(--nx-font-mono);
}
.nx-meta-item svg { width: 13px; height: 13px; color: var(--nx-ink-3); flex-shrink: 0; }
.nx-meta-label { color: var(--nx-ink-3); font-weight: 600; }
.nx-meta-value { color: var(--nx-ink-2); font-weight: 600; }

.nx-card-actions {
  display: flex; flex-direction: column; gap: 0.35rem;
  margin-left: auto; flex-shrink: 0;
}

/* Pill badges */
.nx-pill {
  padding: 0.2rem 0.55rem; border-radius: 6px;
  font-size: 0.65rem; font-weight: 700; font-family: var(--nx-font-mono);
  display: inline-flex; align-items: center; gap: 0.2rem;
}
.nx-pill-admin  { background: var(--nx-red-dim);  color: var(--nx-red); }
.nx-pill-active { background: var(--nx-green-dim); color: var(--nx-green); }
.nx-pill-member { background: rgba(245,158,11,0.12); color: var(--nx-amber); }
.nx-pill-none   { background: var(--nx-bg); color: var(--nx-ink-3); border: 1px solid var(--nx-rule-hard); }


/* ═══════════════════════════════════════════════════
   MEMBERSHIP STAT BOXES
   ═══════════════════════════════════════════════════ */
.nx-stats-row {
  display: flex; gap: 0.65rem; margin-bottom: 1.1rem; flex-wrap: wrap;
}

.nx-stat-box {
  background: var(--nx-surface);
  border: 1px solid var(--nx-rule-hard);
  border-left: 3px solid var(--nx-purple);
  padding: 0.85rem 1rem;
  border-radius: var(--nx-radius-lg);
  flex: 1; min-width: 110px;
  box-shadow: var(--nx-shadow);
  display: flex; flex-direction: column; gap: 0.2rem;
}
.nx-stat-box h3 {
  font-size: 1.55rem; font-weight: 800; color: var(--nx-ink);
  letter-spacing: -0.04em; line-height: 1;
  display: flex; align-items: center; gap: 0.4rem;
}
.nx-stat-box h3 svg { width: 20px; height: 20px; color: var(--nx-purple); }
.nx-stat-box p {
  font-size: 0.68rem; font-weight: 600; font-family: var(--nx-font-mono);
  color: var(--nx-ink-3); letter-spacing: 0.04em; text-transform: uppercase;
}


/* ═══════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════ */
.nx-alert {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 1rem; border-radius: var(--nx-radius);
  font-size: 0.82rem; font-family: var(--nx-font-mono);
  margin-bottom: 1rem; border-left: 3px solid;
}
.nx-alert svg { width: 15px; height: 15px; flex-shrink: 0; }
.nx-alert-err { background: var(--nx-red-dim); color: var(--nx-red); border-color: var(--nx-red); }
.nx-alert-ok  { background: var(--nx-green-dim); color: var(--nx-green); border-color: var(--nx-green); }


/* ═══════════════════════════════════════════════════
   SETTINGS TABS
   ═══════════════════════════════════════════════════ */
.nx-tab-rail {
  display: flex; overflow-x: auto; margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--nx-rule-hard);
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.nx-tab-rail::-webkit-scrollbar { display: none; }

.nx-tab-pill {
  padding: 0.6rem 1rem; border: none; background: none;
  color: var(--nx-ink-3); font-family: var(--nx-font-display);
  font-size: 0.8rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; border-bottom: 2px solid transparent;
  position: relative; top: 1px;
}
.nx-tab-pill.is-active { color: var(--nx-purple); border-bottom-color: var(--nx-purple); }

.nx-tab-pane           { display: none; }
.nx-tab-pane.is-active { display: block; }

.nx-color-row { display: flex; gap: 0.5rem; align-items: center; }
.nx-color-swatch { width: 40px; height: 36px; border: 1.5px solid var(--nx-rule-hard); border-radius: var(--nx-radius); cursor: pointer; padding: 2px; background: var(--nx-bg); }
.nx-color-text { flex: 1; }

.nx-radio-cluster { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.nx-radio-tile {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem; border: 1.5px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius); cursor: pointer;
  font-size: 0.8rem; font-weight: 600; color: var(--nx-ink-2); background: var(--nx-surface);
}
.nx-radio-tile:has(input:checked) { border-color: var(--nx-purple); background: var(--nx-purple-dim); color: var(--nx-purple); }
.nx-radio-tile input { display: none; }

.nx-toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.nx-toggle input { opacity: 0; width: 0; height: 0; }
.nx-toggle-track { position: absolute; inset: 0; background: var(--nx-bg); border: 1.5px solid var(--nx-rule-hard); border-radius: 12px; cursor: pointer; }
.nx-toggle-track::before { content: ''; position: absolute; width: 16px; height: 16px; top: 2px; left: 2px; background: var(--nx-ink-3); border-radius: 50%; transition: transform 0.2s; }
.nx-toggle input:checked + .nx-toggle-track { background: var(--nx-purple-dim); border-color: var(--nx-purple); }
.nx-toggle input:checked + .nx-toggle-track::before { background: var(--nx-purple); transform: translateX(20px); }

.nx-link-entry { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }
.nx-link-entry .nx-input { flex: 1; min-width: 0; }


/* ═══════════════════════════════════════════════════
   SERVER BLOCKS (episode forms)
   ═══════════════════════════════════════════════════ */
.nx-server-block {
  background: var(--nx-bg); border: 1.5px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius-lg); padding: 0.9rem;
  margin-bottom: 0.65rem; border-left: 3px solid var(--nx-purple);
}
.nx-server-block:nth-child(even) { border-left-color: var(--nx-blue); }

.nx-server-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.7rem; }

.nx-server-badge {
  font-size: 0.67rem; font-family: var(--nx-font-mono); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--nx-ink-3);
  border: 1px solid var(--nx-rule-hard); padding: 0.15rem 0.5rem;
  border-radius: 4px; background: var(--nx-surface);
}

.nx-server-foot { display: flex; gap: 0.4rem; margin-top: 0.55rem; }

.nx-preview-frame-wrap { margin-top: 0.65rem; border-radius: var(--nx-radius); overflow: hidden; background: #000; display: none; }
.nx-preview-iframe { width: 100%; height: 210px; border: none; display: block; }


/* ═══════════════════════════════════════════════════
   EDIT HERO
   ═══════════════════════════════════════════════════ */
.nx-edit-hero {
  display: flex; align-items: flex-start; gap: 1rem;
  background: var(--nx-surface); border: 1px solid var(--nx-rule-hard);
  border-left: 3px solid var(--nx-purple); border-radius: var(--nx-radius-lg);
  padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--nx-shadow);
}
.nx-edit-hero-thumb { width: 60px; height: 84px; object-fit: cover; border-radius: var(--nx-radius); flex-shrink: 0; box-shadow: var(--nx-shadow); }
.nx-edit-hero-thumb-empty {
  width: 60px; height: 84px; background: var(--nx-bg); border: 1.5px dashed var(--nx-rule-hard);
  border-radius: var(--nx-radius); display: flex; align-items: center; justify-content: center;
  color: var(--nx-ink-3); flex-shrink: 0;
}
.nx-edit-hero-info { flex: 1; min-width: 0; }
.nx-edit-hero-alt { font-size: 0.78rem; color: var(--nx-ink-3); font-family: var(--nx-font-mono); margin-top: 0.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-edit-hero-meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.45rem; flex-wrap: wrap; }
.nx-ep-hero-num {
  width: 54px; height: 54px; background: var(--nx-purple-dim); border: 1.5px solid var(--nx-purple-mid);
  border-radius: var(--nx-radius); display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800; color: var(--nx-purple); font-family: var(--nx-font-mono); flex-shrink: 0;
}
.nx-ep-hero { align-items: center; }


/* ═══════════════════════════════════════════════════
   BREADCRUMB
   ═══════════════════════════════════════════════════ */
.nx-edit-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; gap: 1rem; flex-wrap: wrap; }
.nx-breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.77rem; font-family: var(--nx-font-mono); }
.nx-breadcrumb-link { color: var(--nx-purple); }
.nx-breadcrumb-sep  { color: var(--nx-ink-3); }
.nx-breadcrumb-cur  { color: var(--nx-ink-2); }


/* ═══════════════════════════════════════════════════
   MISC HELPERS
   ═══════════════════════════════════════════════════ */
.nx-section-label, .nx-section-title {
  font-size: 0.75rem; font-weight: 700; font-family: var(--nx-font-mono);
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--nx-ink-2);
  margin: 1.25rem 0 0.85rem; display: flex; align-items: center; gap: 0.5rem;
}
.nx-section-label:first-of-type, .nx-section-title:first-of-type { margin-top: 0; }

.nx-slug-preview {
  font-size: 0.75rem; font-family: var(--nx-font-mono); color: var(--nx-ink-3);
  background: var(--nx-bg); padding: 0.5rem 0.85rem; border-radius: var(--nx-radius);
  margin: 0.35rem 0 1rem; word-break: break-all; display: flex; align-items: center;
  gap: 0.5rem; border: 1px solid var(--nx-rule-hard);
}

.nx-info-box {
  background: rgba(59,130,246,0.06); border-left: 3px solid var(--nx-blue);
  padding: 0.75rem 1rem; margin-bottom: 1rem; border-radius: var(--nx-radius);
  font-size: 0.8rem; font-family: var(--nx-font-mono); color: var(--nx-blue);
  display: flex; align-items: flex-start; gap: 0.5rem;
}
.nx-info-box svg { flex-shrink: 0; margin-top: 1px; }

.nx-anime-badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--nx-purple-dim); color: var(--nx-purple); border: 1px solid var(--nx-purple-mid);
  padding: 0.4rem 0.85rem; border-radius: var(--nx-radius);
  font-size: 0.78rem; font-weight: 700; font-family: var(--nx-font-mono); margin-bottom: 1rem;
}

.nx-status-badge { padding: 0.18rem 0.55rem; border-radius: 6px; font-size: 0.65rem; font-weight: 700; font-family: var(--nx-font-mono); display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.nx-status-badge.ongoing   { background: rgba(245,158,11,0.12); color: var(--nx-amber); }
.nx-status-badge.completed { background: var(--nx-green-dim); color: var(--nx-green); }
.nx-status-badge.other     { background: var(--nx-bg); color: var(--nx-ink-3); border: 1px solid var(--nx-rule-hard); }

.nx-tag-badge { padding: 0.15rem 0.45rem; border-radius: 4px; font-size: 0.62rem; font-weight: 700; font-family: var(--nx-font-mono); display: inline-flex; align-items: center; gap: 0.2rem; }
.nx-tag-hot { background: var(--nx-red-dim);  color: var(--nx-red); }
.nx-tag-new { background: var(--nx-green-dim); color: var(--nx-green); }

.nx-anime-header { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--nx-rule-hard); }
.nx-anime-poster-sm { width: 58px; height: 82px; object-fit: cover; border-radius: var(--nx-radius); flex-shrink: 0; box-shadow: var(--nx-shadow); }
.nx-anime-header-info { flex: 1; min-width: 0; }
.nx-anime-header-info h1 { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; color: var(--nx-ink); margin-bottom: 0.3rem; }
.nx-anime-stats { display: flex; gap: 0.85rem; align-items: center; flex-wrap: wrap; }
.nx-anime-stats span { font-size: 0.73rem; font-family: var(--nx-font-mono); color: var(--nx-ink-3); display: flex; align-items: center; gap: 0.3rem; }
.nx-anime-stats svg { color: var(--nx-purple); width: 12px; height: 12px; }

.nx-action-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.75rem; }
.nx-empty-state {
  text-align: center; padding: 2rem 1rem; color: var(--nx-ink-3);
  font-size: 0.82rem; font-family: var(--nx-font-mono); background: var(--nx-bg);
  border-radius: var(--nx-radius); margin-bottom: 1rem; border: 1.5px dashed var(--nx-rule-hard);
}
.nx-empty-state svg { width: 28px; height: 28px; margin: 0 auto 0.65rem; display: block; opacity: 0.4; }

.nx-button-group { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.nx-episode-range { display: flex; align-items: flex-end; gap: 0.8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.nx-episode-range .nx-field-group { margin-bottom: 0; }
.nx-episode-range .nx-range-sep { color: var(--nx-ink-3); font-weight: 600; font-size: 0.9rem; padding-bottom: 0.65rem; }

.nx-combined-checkbox { margin-bottom: 1rem; }
.nx-combined-checkbox label { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; font-weight: 600; font-size: 0.84rem; }
.nx-combined-checkbox input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; margin: 0; accent-color: var(--nx-purple); }

.nx-server-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem; border: 1.5px solid var(--nx-rule-hard); border-radius: var(--nx-radius); margin-bottom: 0.7rem; background: var(--nx-bg); }
.nx-server-fields { flex: 1; display: flex; gap: 0.8rem; align-items: center; }
.nx-server-fields .nx-field-group { flex: 1; margin-bottom: 0; min-width: 160px; }
.nx-server-controls { display: flex; flex-direction: column; gap: 0.3rem; min-width: 50px; flex-shrink: 0; }
.nx-server-default { min-width: 80px; flex-shrink: 0; }
.nx-server-default-radio { display: flex; align-items: center; gap: 0.4rem; height: 28px; }
.nx-server-default-radio input[type="radio"] { margin: 0; cursor: pointer; width: 16px; height: 16px; accent-color: var(--nx-purple); }
.nx-server-default-radio label { font-size: 0.73rem; font-family: var(--nx-font-mono); color: var(--nx-ink-3); cursor: pointer; white-space: nowrap; }
.nx-server-control-btn { background: var(--nx-surface); border: 1px solid var(--nx-rule-hard); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--nx-ink-3); padding: 0; flex-shrink: 0; }
.nx-server-control-btn svg { width: 12px; height: 12px; }
.nx-remove-btn { background: var(--nx-red-dim); color: var(--nx-red); border: 1px solid var(--nx-red-mid); width: 30px; height: 30px; border-radius: var(--nx-radius); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; }
.nx-remove-btn svg { width: 13px; height: 13px; }
.nx-download-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem; border: 1.5px solid var(--nx-rule-hard); border-radius: var(--nx-radius); margin-bottom: 0.7rem; background: var(--nx-bg); }
.nx-download-fields { flex: 1; display: flex; gap: 0.8rem; align-items: center; }
.nx-download-fields .nx-field-group { flex: 1; margin-bottom: 0; min-width: 160px; }

.nx-dash-time { font-size: 0.73rem; font-family: var(--nx-font-mono); color: var(--nx-ink-3); letter-spacing: 0.06em; }
.nx-mono  { font-family: var(--nx-font-mono); }
.nx-muted { color: var(--nx-ink-3); }
.nx-accent { color: var(--nx-purple); }
.hidden   { display: none !important; }
td.nx-action-cell { display: flex; gap: 0.3rem; align-items: center; }

/* Custom select */
.nx-custom-select { position: relative; width: 100%; }
.nx-select-search { width: 100%; padding: 0.65rem 2.2rem 0.65rem 0.9rem; background: var(--nx-raised); border: 1.5px solid var(--nx-rule-hard); border-radius: var(--nx-radius); color: var(--nx-ink); font-size: 0.85rem; font-family: var(--nx-font-display); outline: none; cursor: pointer; }
.nx-select-search:focus { border-color: var(--nx-purple); }
.nx-select-arrow { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--nx-ink-3); pointer-events: none; width: 14px; height: 14px; }
.nx-select-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--nx-surface); border: 1.5px solid var(--nx-rule-hard); border-radius: var(--nx-radius); max-height: 290px; overflow-y: auto; z-index: 200; display: none; box-shadow: var(--nx-shadow-md); }
.nx-select-dropdown.active { display: block; }
.nx-select-search-input { padding: 0.6rem; border-bottom: 1px solid var(--nx-rule-hard); background: var(--nx-bg); }
.nx-select-search-input input { width: 100%; padding: 0.45rem 0.7rem; background: var(--nx-surface); border: 1.5px solid var(--nx-rule-hard); border-radius: 6px; font-size: 0.8rem; font-family: var(--nx-font-display); color: var(--nx-ink); outline: none; }
.nx-select-search-input input:focus { border-color: var(--nx-purple); }
.nx-select-options { max-height: 230px; overflow-y: auto; }
.nx-select-option { padding: 0.65rem 1rem; cursor: pointer; font-size: 0.84rem; color: var(--nx-ink-2); border-bottom: 1px solid var(--nx-rule); }
.nx-select-option:last-child { border-bottom: none; }
.nx-select-option:hover { background: var(--nx-bg); }
.nx-select-option.selected { background: var(--nx-purple-dim); color: var(--nx-purple); font-weight: 600; }
.nx-select-option.selected::after { content: "✓"; float: right; color: var(--nx-purple); }
.nx-no-results { padding: 1rem; text-align: center; color: var(--nx-ink-3); font-size: 0.78rem; font-family: var(--nx-font-mono); }

/* ImgBB */
.nx-imgbb-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.nx-imgbb-row .nx-input { flex: 1; min-width: 0; }
.nx-imgbb-actions { display: flex; flex-direction: column; gap: 0.3rem; align-items: center; flex-shrink: 0; }
.nx-imgbb-file-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--nx-radius); background: var(--nx-bg); border: 1.5px solid var(--nx-rule-hard); color: var(--nx-ink-3); cursor: pointer; flex-shrink: 0; }
.nx-imgbb-upload-btn { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0 0.65rem; height: 32px; border-radius: var(--nx-radius); background: var(--nx-bg); border: 1.5px solid var(--nx-rule-hard); color: var(--nx-ink-2); font-size: 0.73rem; font-weight: 700; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.nx-imgbb-status { font-size: 0.72rem; font-family: var(--nx-font-mono); display: inline-flex; align-items: center; gap: 0.28rem; white-space: nowrap; color: var(--nx-ink-3); }
.nx-imgbb-status.is-ok  { color: var(--nx-green); }
.nx-imgbb-status.is-err { color: var(--nx-red); }
.nx-imgbb-spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--nx-rule-hard); border-top-color: var(--nx-purple); border-radius: 50%; animation: nx-spin 0.6s linear infinite; }
@keyframes nx-spin { to { transform: rotate(360deg); } }
.nx-imgbb-badge { display: inline-block; font-size: 0.58rem; font-family: var(--nx-font-mono); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; background: var(--nx-purple-dim); color: var(--nx-purple); border: 1px solid var(--nx-purple-mid); padding: 0.08em 0.42em; border-radius: 3px; vertical-align: middle; margin-left: 0.4rem; }

.nx-search-box-standalone { width: 100%; padding: 0.75rem 1.1rem; border-radius: var(--nx-radius); border: 1.5px solid var(--nx-rule-hard); background: var(--nx-surface); color: var(--nx-ink); font-family: var(--nx-font-display); outline: none; margin-bottom: 1rem; font-size: 0.85rem; }
.nx-search-box-standalone:focus { border-color: var(--nx-purple); }

/* Modal */
.nx-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); backdrop-filter: blur(4px); z-index: 2000; padding: 1rem; align-items: center; justify-content: center; }
.nx-modal.is-open { display: flex; }
.nx-modal-inner { background: var(--nx-surface); border: 1px solid var(--nx-rule-hard); border-radius: var(--nx-radius-lg); padding: 1.4rem; width: 100%; max-width: 400px; box-shadow: var(--nx-shadow-md); }
.nx-modal-inner h3 { font-size: 0.95rem; font-weight: 800; margin-bottom: 1rem; color: var(--nx-ink); }
.nx-f-group { margin-bottom: 0.75rem; }
.nx-f-group label { display: block; font-size: 0.68rem; font-weight: 700; font-family: var(--nx-font-mono); margin-bottom: 0.3rem; color: var(--nx-ink-3); text-transform: uppercase; letter-spacing: 0.07em; }
.nx-f-group input { width: 100%; padding: 0.6rem 0.85rem; background: var(--nx-raised); border: 1.5px solid var(--nx-rule-hard); border-radius: var(--nx-radius); color: var(--nx-ink); font-size: 0.83rem; outline: none; font-family: var(--nx-font-display); }
.nx-f-group input:focus { border-color: var(--nx-purple); }
.nx-btn-submit { width: 100%; padding: 0.65rem; background: var(--nx-purple); color: #fff; border: none; border-radius: var(--nx-radius); font-weight: 700; margin-top: 0.5rem; font-size: 0.83rem; cursor: pointer; font-family: var(--nx-font-display); }
.nx-btn-cancel2 { width: 100%; padding: 0.65rem; background: var(--nx-bg); color: var(--nx-ink-2); border: 1.5px solid var(--nx-rule-hard); border-radius: var(--nx-radius); font-weight: 600; margin-top: 0.4rem; font-size: 0.83rem; cursor: pointer; font-family: var(--nx-font-display); }


/* ═══════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════ */
.nx-auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; min-height: 100dvh; background: var(--nx-bg); background-image: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(108,99,255,0.08) 0%, transparent 70%); }
.nx-auth-box { width: 100%; max-width: 400px; padding: 1.5rem; }
.nx-auth-card { background: var(--nx-surface); border: 1px solid var(--nx-rule-hard); border-radius: var(--nx-radius-lg); padding: 2rem; box-shadow: var(--nx-shadow-md); }
.nx-auth-logo { text-align: center; margin-bottom: 2rem; }
.nx-auth-logo h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.04em; color: var(--nx-purple); }
.nx-auth-logo p { font-family: var(--nx-font-mono); font-size: 0.75rem; color: var(--nx-ink-3); margin-top: 0.35rem; }
.nx-input-icon { position: relative; }
.nx-input-icon svg { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--nx-ink-3); pointer-events: none; }
.nx-input-icon .nx-input { padding-left: 2.2rem; }


/* ═══════════════════════════════════════════════════
   CONFIRM / DELETE MODAL
   ═══════════════════════════════════════════════════ */
.nxm-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); backdrop-filter: blur(4px); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 1rem; }
.nxm-backdrop.is-open { display: flex; }

.nxm-confirm {
  background: var(--nx-surface); border: 1px solid var(--nx-rule-hard); border-top: 3px solid var(--nx-red);
  border-radius: var(--nx-radius-lg); width: 100%; max-width: 360px;
  padding: 2rem 1.75rem; text-align: center; box-shadow: var(--nx-shadow-md);
  animation: nxSlideIn 0.18s ease;
}
@keyframes nxSlideIn { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }

.nxm-confirm-ring { width: 50px; height: 50px; background: var(--nx-red-dim); border: 1px solid var(--nx-red-mid); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; color: var(--nx-red); }
.nxm-confirm-ring svg { width: 22px; height: 22px; }
.nxm-confirm-heading { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.7rem; color: var(--nx-ink); }
.nxm-confirm-body { font-size: 0.84rem; color: var(--nx-ink-2); line-height: 1.75; margin-bottom: 1.4rem; font-family: var(--nx-font-mono); }
.nxm-confirm-body strong { color: var(--nx-ink); font-weight: 700; font-family: var(--nx-font-display); }
.nxm-confirm-row { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.nxm-del-btn { background: var(--nx-red) !important; border-color: var(--nx-red) !important; }


.nx-label-hint { font-size: 0.67rem; text-transform: none; letter-spacing: 0; font-family: var(--nx-font-mono); }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 860px) {
  .nx-scroll        { padding: 1rem 0.85rem; }
  .nx-form-grid     { grid-template-columns: 1fr; }
  .nx-mainnav-link  { padding: 0.78rem 0.65rem; }
}

@media (max-width: 640px) {
  .nx-page-head { flex-direction: column; gap: 0.65rem; margin-bottom: 1rem; align-items: flex-start; }
  .nx-page-title { font-size: 1.15rem; }
  .nx-page-acts  { flex-wrap: wrap; }
  .nx-search-row { flex-direction: column; align-items: stretch; }
  .nx-search-row .nx-input, .nx-search-row .nx-select { max-width: 100%; }
  .nx-search-row .nx-btn { width: 100%; justify-content: center; }
  .nx-metrics { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .nx-metric-val { font-size: 1.5rem; }
  .nx-action-strip { flex-direction: column; }
  .nx-action-tile  { width: 100%; justify-content: center; }
  .nx-panel-head   { flex-wrap: wrap; gap: 0.5rem; }
  .nx-scroll-x     { overflow-x: visible; }
  .nx-table        { min-width: 0 !important; width: 100%; }
  .nx-table thead  { display: none; }
  .nx-table tbody  { display: block; }
  .nx-table tr     { display: grid; grid-template-columns: 1fr; background: var(--nx-surface); border: 1px solid var(--nx-rule-hard); border-radius: var(--nx-radius-lg); margin-bottom: 0.6rem; padding: 0.8rem 0.9rem; box-shadow: var(--nx-shadow); }
  .nx-table td     { display: flex; align-items: flex-start; gap: 0.45rem; padding: 0.3rem 0; border-bottom: 1px solid var(--nx-rule); font-size: 0.82rem; flex-wrap: wrap; }
  .nx-table td:last-child  { border-bottom: none; padding-bottom: 0; }
  .nx-table td:first-child { padding-top: 0; }
  .nx-table td::before { content: attr(data-label); font-size: 0.62rem; font-family: var(--nx-font-mono); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nx-ink-3); min-width: 68px; flex-shrink: 0; padding-top: 2px; }
  .nx-table tr:nth-child(even) td { background: transparent; }
  .nx-row-acts     { gap: 0.35rem; flex-wrap: wrap; }
  .nx-stats-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .nx-stat-box     { min-width: 0; }
  .nx-field-row    { grid-template-columns: 1fr; }
  .nx-form-footer  { flex-direction: column; align-items: stretch; }
  .nx-form-footer .nx-btn { width: 100%; justify-content: center; }
  .nx-edit-hero    { flex-wrap: wrap; }
  .nx-tab-pill     { padding: 0.5rem 0.75rem; font-size: 0.73rem; }
  .nx-pager, .nx-pagination { flex-wrap: wrap; }
  .nx-server-block .nx-field-row { grid-template-columns: 1fr; }
  .nx-server-item  { flex-wrap: wrap; }
  .nx-server-fields { flex-direction: column; flex-basis: 100%; order: 3; margin-top: 0.75rem; gap: 0.6rem; }
  .nx-server-fields .nx-field-group { width: 100%; min-width: auto; }
  .nx-scroll       { padding: 0.9rem 0.75rem; }
  .nx-anime-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .nx-topbar-title { font-size: 0.85rem; }
  .nx-topbar       { padding: 0 0.75rem; }
  .nx-episode-range { flex-direction: column; align-items: stretch; gap: 0.65rem; }
  .nx-anime-grid   { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
}
/* ═══════════════════════════════════════════════════
   MAL ID FIELD — anime_edit.php
   ═══════════════════════════════════════════════════ */
.nx-mal-row { display: flex; gap: .5rem; align-items: center; }
.nx-mal-row .nx-input { flex: 1; min-width: 0; }

.nx-mal-preview { margin-top: .6rem; }

.nx-mal-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--nx-raised);
  border: 1px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius);
  padding: .55rem .75rem;
}
.nx-mal-thumb {
  width: 42px;
  height: 58px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
  background: var(--nx-lift);
}
.nx-mal-info { display: flex; flex-direction: column; gap: .18rem; min-width: 0; }
.nx-mal-title { font-size: .86rem; color: var(--nx-ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-mal-sub   { font-size: .74rem; color: var(--nx-ink-3); font-family: var(--nx-font-mono); }
.nx-mal-meta  { display: flex; flex-wrap: wrap; gap: .28rem; align-items: center; font-size: .72rem; color: var(--nx-ink-2); margin-top: .1rem; }
.nx-mal-ok    { color: var(--nx-green); font-weight: 600; }
.nx-mal-err   { font-size: .79rem; color: var(--nx-red); font-family: var(--nx-font-mono); }
.nx-mal-loading { font-size: .79rem; color: var(--nx-ink-3); font-family: var(--nx-font-mono); }

/* ═══════════════════════════════════════════════════
   MAL IMPORT PAGE — mal_import.php
   ═══════════════════════════════════════════════════ */

/* Search bar */
.nx-mal-import-search {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
.nx-mal-import-search .nx-input { flex: 1; }

/* Results grid */
.nx-mal-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .85rem;
  margin-bottom: 1.5rem;
  min-height: 60px;
}

/* Single result card */
.nx-mal-result-card {
  background: var(--nx-surface);
  border: 1.5px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s;
  position: relative;
}
.nx-mal-result-card:hover  { border-color: var(--nx-purple); box-shadow: 0 0 0 3px var(--nx-purple-dim); }
.nx-mal-result-card.selected { border-color: var(--nx-purple); box-shadow: 0 0 0 3px var(--nx-purple-mid); }

.nx-mal-result-cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  background: var(--nx-lift);
}
.nx-mal-result-cover-ph {
  width: 100%;
  aspect-ratio: 2/3;
  background: var(--nx-lift);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nx-ink-3);
}
.nx-mal-result-body { padding: .5rem .55rem .6rem; }
.nx-mal-result-title { font-size: .76rem; font-weight: 700; color: var(--nx-ink); line-height: 1.3; margin-bottom: .25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nx-mal-result-meta  { font-size: .68rem; color: var(--nx-ink-3); font-family: var(--nx-font-mono); display: flex; gap: .3rem; flex-wrap: wrap; }
.nx-mal-result-score { color: var(--nx-amber); font-weight: 600; }

/* Selected tick badge */
.nx-mal-result-card.selected::after {
  content: '✓';
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  background: var(--nx-purple);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 22px;
  text-align: center;
}

/* Import preview panel */
.nx-mal-import-preview {
  background: var(--nx-surface);
  border: 1.5px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius-lg);
  overflow: hidden;
  display: none;
}
.nx-mal-import-preview.is-visible { display: block; }

.nx-mal-import-preview-head {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--nx-rule-hard);
  background: var(--nx-raised);
}
.nx-mal-import-preview-cover {
  width: 56px;
  height: 78px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--nx-lift);
}
.nx-mal-import-preview-info { flex: 1; min-width: 0; }
.nx-mal-import-preview-title { font-size: .96rem; font-weight: 800; color: var(--nx-ink); margin-bottom: .2rem; }
.nx-mal-import-preview-sub   { font-size: .75rem; color: var(--nx-ink-3); font-family: var(--nx-font-mono); margin-bottom: .35rem; }
.nx-mal-import-preview-chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.nx-mal-import-preview-chip  { font-size: .66rem; font-family: var(--nx-font-mono); font-weight: 700; padding: .18em .55em; border-radius: 4px; background: var(--nx-purple-dim); color: var(--nx-purple); border: 1px solid var(--nx-purple-mid); letter-spacing: .03em; text-transform: uppercase; }

.nx-mal-import-preview-body { padding: 1rem 1.1rem; }
.nx-mal-import-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem 1rem; margin-bottom: .9rem; }
.nx-mal-import-field { display: flex; flex-direction: column; gap: .2rem; }
.nx-mal-import-field label { font-size: .67rem; font-family: var(--nx-font-mono); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--nx-ink-3); }
.nx-mal-import-field input,
.nx-mal-import-field select,
.nx-mal-import-field textarea { width: 100%; padding: .48rem .75rem; background: var(--nx-raised); border: 1.5px solid var(--nx-rule-hard); border-radius: var(--nx-radius); color: var(--nx-ink); font-size: .82rem; font-family: var(--nx-font-display); outline: none; }
.nx-mal-import-field input:focus,
.nx-mal-import-field select:focus,
.nx-mal-import-field textarea:focus { border-color: var(--nx-purple); }
.nx-mal-import-field textarea { resize: vertical; min-height: 80px; }
.nx-mal-import-field-full { grid-column: 1 / -1; }

.nx-mal-import-footer {
  display: flex;
  gap: .6rem;
  align-items: center;
  padding-top: .85rem;
  border-top: 1px solid var(--nx-rule);
  flex-wrap: wrap;
}

/* Loading / empty / error states */
.nx-mal-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--nx-ink-3);
  font-size: .83rem;
  font-family: var(--nx-font-mono);
}
.nx-mal-state svg { display: block; margin: 0 auto .6rem; opacity: .4; }

/* Skeleton cards */
.nx-mal-skeleton-card {
  background: var(--nx-surface);
  border: 1.5px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius);
  overflow: hidden;
}
.nx-mal-skeleton-cover {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(90deg, var(--nx-raised) 25%, var(--nx-lift) 50%, var(--nx-raised) 75%);
  background-size: 200% 100%;
  animation: nx-mal-shimmer 1.3s infinite;
}
.nx-mal-skeleton-line {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--nx-raised) 25%, var(--nx-lift) 50%, var(--nx-raised) 75%);
  background-size: 200% 100%;
  animation: nx-mal-shimmer 1.3s infinite;
  margin: .55rem .55rem .3rem;
}
.nx-mal-skeleton-line.short { width: 55%; }
@keyframes nx-mal-shimmer { 0% { background-position: 200% center; } 100% { background-position: -200% center; } }

@media (max-width: 640px) {
  .nx-mal-results { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; }
  .nx-mal-import-fields { grid-template-columns: 1fr; }
  .nx-mal-import-preview-head { flex-wrap: wrap; }
  .nx-mal-import-search { flex-wrap: wrap; }
  .nx-mal-import-search .nx-input { width: 100%; }
}

/* ═══════════════════════════════════════════════════
   MAL IMPORT — ImgBB notice banners
   ═══════════════════════════════════════════════════ */
.nx-mal-imgbb-notice { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.nx-mal-imgbb-notice-warn { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.3); color: var(--nx-amber); }
.nx-mal-settings-link { color: var(--nx-purple); font-weight: 600; margin-left: .35rem; text-decoration: underline; }
.nx-mal-required { color: var(--nx-red); }

/* ═══════════════════════════════════════════════════
   MAL IMPORT — upload progress panel
   ═══════════════════════════════════════════════════ */
.nx-mal-upload-progress { margin-bottom: 1rem; }
.nx-mal-upload-body { display: flex; flex-direction: column; gap: .35rem; max-height: 220px; overflow-y: auto; }

.nx-mal-upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .3rem .2rem;
  border-bottom: 1px solid var(--nx-rule);
  font-size: .78rem;
}
.nx-mal-upload-row:last-child { border-bottom: none; }
.nx-mal-upload-label { color: var(--nx-ink-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Status chips inside progress rows */
.nx-mal-upload-status     { font-size: .7rem; font-family: var(--nx-font-mono); white-space: nowrap; flex-shrink: 0; }
.nx-mal-upload-pending    { color: var(--nx-ink-3); }
.nx-mal-upload-uploading  { color: var(--nx-purple); display: inline-flex; align-items: center; gap: .25rem; }
.nx-mal-upload-ok         { color: var(--nx-green); display: inline-flex; align-items: center; gap: .25rem; }
.nx-mal-upload-skip       { color: var(--nx-ink-3); }
.nx-mal-upload-fail       { color: var(--nx-red); }

/* ═══════════════════════════════════════════════════
   MAL IMPORT — Characters & Staff media section
   ═══════════════════════════════════════════════════ */
.nx-mal-import-media-section {
  margin: .85rem 0 .5rem;
  border: 1px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius);
  overflow: hidden;
}

/* Tabs */
.nx-mal-import-media-tabs {
  display: flex;
  border-bottom: 1px solid var(--nx-rule-hard);
  background: var(--nx-raised);
}
.nx-mal-import-media-tab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .6rem 1rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--nx-ink-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.nx-mal-import-media-tab:hover  { color: var(--nx-ink); }
.nx-mal-import-media-tab.active { color: var(--nx-purple); border-bottom-color: var(--nx-purple); }

/* Panes */
.nx-mal-import-media-pane       { display: none; }
.nx-mal-import-media-pane.active { display: block; }

/* Horizontal scroll track */
.nx-mal-import-media-scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--nx-rule-hard) transparent;
  padding: .75rem;
}
.nx-mal-import-media-scroll::-webkit-scrollbar { height: 3px; }
.nx-mal-import-media-scroll::-webkit-scrollbar-thumb { background: var(--nx-rule-hard); border-radius: 3px; }

/* Inner flex row */
.nx-mal-import-media-inner {
  display: flex;
  gap: .65rem;
  width: max-content;
}
.nx-mal-import-media-inner-staff {
  flex-wrap: nowrap;
}

/* ── Character pair card ────────────────────────── */
.nx-mal-media-char-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 178px;
  flex-shrink: 0;
  border: 1px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius);
  overflow: hidden;
  background: var(--nx-surface);
  transition: border-color .15s;
}
.nx-mal-media-char-card:hover { border-color: var(--nx-purple); }

.nx-mal-media-pair {
  display: flex;
  flex-direction: row;
  flex: 1;
}
.nx-mal-media-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 50%;
  padding: .55rem .4rem .6rem;
  gap: .3rem;
}
.nx-mal-media-person + .nx-mal-media-person {
  border-left: 1px solid var(--nx-rule);
  background: var(--nx-raised);
}
.nx-mal-media-person-va { background: var(--nx-raised) !important; }

/* ── Staff mini card ────────────────────────────── */
.nx-mal-staff-mini-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
  flex-shrink: 0;
  border: 1px solid var(--nx-rule-hard);
  border-radius: var(--nx-radius);
  padding: .6rem .45rem .65rem;
  gap: .3rem;
  text-align: center;
  background: var(--nx-surface);
  transition: border-color .15s;
}
.nx-mal-staff-mini-card:hover { border-color: var(--nx-purple); }

/* ── Shared image styles ────────────────────────── */
.nx-mal-media-img {
  width: 62px;
  height: 78px;
  object-fit: cover;
  border-radius: 5px;
  background: var(--nx-lift);
  display: block;
  flex-shrink: 0;
}
.nx-mal-media-img-round  { border-radius: 50%; width: 58px; height: 58px; }
.nx-mal-media-img-ph {
  width: 62px; height: 78px;
  border-radius: 5px;
  background: var(--nx-lift);
  flex-shrink: 0;
}
.nx-mal-media-img-ph.nx-mal-media-img-round { border-radius: 50%; width: 58px; height: 58px; }

.nx-mal-media-name {
  font-size: .68rem;
  font-weight: 700;
  color: var(--nx-ink);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}
.nx-mal-media-role {
  font-size: .62rem;
  color: var(--nx-ink-3);
  text-align: center;
  line-height: 1.3;
}
.nx-mal-media-role-va { color: var(--nx-purple); font-weight: 600; }

/* ── ImgBB hosted badge on card ─────────────────── */
.nx-mal-media-badge {
  position: absolute;
  top: 4px; right: 4px;
  font-size: .55rem;
  font-family: var(--nx-font-mono);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--nx-green);
  color: #fff;
  padding: .12em .4em;
  border-radius: 3px;
  line-height: 1.4;
  pointer-events: none;
}

@media (max-width: 640px) {
  .nx-mal-upload-body { max-height: 160px; }
  .nx-mal-media-img, .nx-mal-media-img-ph { width: 52px; height: 66px; }
  .nx-mal-media-char-card { width: 148px; }
  .nx-mal-staff-mini-card { width: 86px; }
}
/* ═══════════════════════════════════════════════════
   RUENG BRIDGE — Anisora "Nexus" look for the Rueng
   admin's own markup (rendered by static/js/admin.js).
   Light theme, purple accent, same radius/shadows.
   ═══════════════════════════════════════════════════ */

/* --- login (Anisora al-card, dark) --- */
.al-wrap-page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:1.5rem;background:#0b0b0f;background-image:radial-gradient(ellipse 60% 40% at 50% 0%,rgba(108,99,255,.12) 0%,transparent 70%);font-family:var(--nx-font-display)}
.al-card{width:100%;max-width:370px;background:#111118;border:1px solid rgba(255,255,255,.1);border-radius:14px;padding:2.25rem 1.75rem 2rem;box-shadow:0 24px 60px rgba(0,0,0,.5);color:#eeeef5}
.al-logo{text-align:center;margin-bottom:2rem}
.al-logo img{height:36px;margin:0 auto .75rem;display:block}
.al-logo h1{font-size:1.65rem;font-weight:800;letter-spacing:-.04em;color:var(--nx-purple);margin-bottom:.25rem}
.al-logo p{font-size:.68rem;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:#6b6b76}
.al-field{display:flex;flex-direction:column;gap:.3rem;margin-bottom:.85rem}
.al-field label{font-size:.67rem;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:#6b6b76}
.al-wrap{position:relative;display:flex;align-items:center}
.al-wrap svg{position:absolute;left:.8rem;width:15px;height:15px;color:#6b6b76;pointer-events:none;flex-shrink:0}
.al-input{width:100%;background:#18181f;border:1px solid rgba(255,255,255,.1);border-radius:8px;padding:.7rem .9rem .7rem 2.4rem;color:#eeeef5;font-family:inherit;font-size:.875rem;outline:none}
.al-input:focus{border-color:var(--nx-purple);box-shadow:0 0 0 3px rgba(108,99,255,.18)}
.al-input::placeholder{color:#6b6b76}
.al-error{display:flex;align-items:center;gap:.55rem;background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.35);border-left:3px solid var(--nx-red);color:#ff7b93;border-radius:8px;padding:.65rem .85rem;font-size:.82rem;font-weight:500;margin-bottom:1.25rem;line-height:1.4}
.al-error svg{width:15px;height:15px;flex-shrink:0}
.al-btn{width:100%;padding:.8rem;background:var(--nx-purple);color:#fff;border:none;border-radius:9px;font-family:inherit;font-size:.9rem;font-weight:700;letter-spacing:.02em;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:.5rem;box-shadow:0 4px 18px rgba(108,99,255,.3);margin-top:.35rem}
.al-btn svg{width:16px;height:16px;flex-shrink:0}
.al-btn:hover{opacity:.88}
.al-note{margin-top:16px;text-align:center;font-size:.8rem;line-height:1.5;color:#6b6b76}

/* --- shell bits the Anisora css does not cover --- */
.nx-topbar-search{flex:1;max-width:420px;min-width:0;margin:0 12px}
#topbar-search-toggle{display:none}
.btn-wrap{flex:0 0 auto;align-self:flex-end}
#admin-shell .nx-main{padding:0 0 40px}
#admin-shell section{padding:0}
#admin-shell section h2{margin:0 0 4px;font-size:22px;font-weight:800;letter-spacing:-.02em;color:var(--nx-ink)}
#admin-shell section>.muted{margin:0 0 18px}
.hidden{display:none!important}

/* --- generic text helpers --- */
.muted{color:var(--nx-ink-3)}
.small{font-size:12px}
.hint{color:var(--nx-ink-3);font-size:12px;margin-top:6px}
.nowrap{white-space:nowrap}
.empty{color:var(--nx-ink-3);font-size:13px;padding:10px 0}

/* --- buttons (old class names, Nexus look) --- */
.btn{border:0;border-radius:999px;padding:11px 20px;cursor:pointer;font-weight:700;font-size:14px;font-family:inherit;transition:opacity .15s;background:var(--nx-purple);color:#fff}
.btn:hover{opacity:.9}
.btn-light{background:#fff;color:var(--nx-ink);border:1px solid var(--nx-rule-hard)}
.btn-ghost{background:transparent;color:var(--nx-ink);border:1px solid var(--nx-rule-hard)}
.btn-red{background:var(--nx-red);color:#fff}
.btn-accent{background:var(--nx-purple);color:#fff}
.btn.small,.btn-sm{padding:7px 14px;font-size:13px}
.act{border:1px solid var(--nx-rule-hard);background:transparent;color:var(--nx-ink);border-radius:999px;padding:6px 12px;cursor:pointer;font-size:13px;white-space:nowrap;font-family:inherit}
.act:hover{background:var(--nx-lift)}
.act.danger,.danger-btn{color:var(--nx-red);border-color:rgba(239,68,68,.4)}

/* --- cards / stats / grids --- */
.card{background:var(--nx-surface);border:1px solid var(--nx-rule);border-radius:var(--nx-radius-lg);padding:18px;box-shadow:var(--nx-shadow)}
.card h3{margin:0 0 12px;font-size:16px;color:var(--nx-ink)}
.card-sub{color:var(--nx-ink-3);font-size:13px;margin:0 0 12px;line-height:1.5}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}
.stat{background:var(--nx-surface);border:1px solid var(--nx-rule);border-radius:var(--nx-radius-lg);padding:18px;box-shadow:var(--nx-shadow)}
.stat b{font-size:27px;display:block;color:var(--nx-ink)}
.stat span{color:var(--nx-ink-3);font-size:13px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:14px}
.row{display:flex;gap:12px;flex-wrap:wrap}
.row>div{flex:1;min-width:200px}
.row.align-end{align-items:flex-end}
.bar-row{display:flex;align-items:center;gap:10px;padding:8px 0}
.bar-row .bar{flex:1;height:8px;background:var(--nx-lift);border-radius:99px;overflow:hidden}
.bar-row .fill{height:100%;background:var(--nx-purple);border-radius:99px}

/* --- forms --- */
#admin-shell label{display:block;font-size:13px;color:var(--nx-ink-2);margin:14px 0 6px;font-weight:600}
#admin-shell input[type=email],#admin-shell input[type=password],#admin-shell input[type=text],#admin-shell input[type=url],#admin-shell input[type=number],#admin-shell input[type=date],#admin-shell input[type=color],#admin-shell select,#admin-shell textarea{width:100%;background:var(--nx-surface);border:1px solid var(--nx-rule-hard);color:var(--nx-ink);border-radius:10px;padding:11px 13px;outline:none;font-family:inherit;font-size:14px}
#admin-shell input:focus,#admin-shell select:focus,#admin-shell textarea:focus{border-color:var(--nx-purple);box-shadow:0 0 0 3px var(--nx-purple-dim)}
#admin-shell input:disabled{opacity:.55}
#admin-shell input[type=color]{padding:4px;height:42px}
.toggle{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--nx-rule)}
.toggle span small{display:block;color:var(--nx-ink-3);font-weight:400}
.switch{position:relative;width:46px;height:26px;flex-shrink:0}
.switch input{opacity:0;width:100%;height:100%;position:absolute;margin:0;cursor:pointer;z-index:2}
.switch .track{position:absolute;inset:0;background:#d4d4de;border-radius:99px;transition:background .2s}
.switch .track:after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;background:#fff;border-radius:50%;transition:left .2s}
.switch input:checked+.track{background:var(--nx-purple)}
.switch input:checked+.track:after{left:23px}
.tabs{display:flex;gap:8px;margin-bottom:16px;flex-wrap:wrap}
.tab{border:1px solid var(--nx-rule-hard);background:transparent;color:var(--nx-ink-2);border-radius:999px;padding:9px 16px;cursor:pointer;font-weight:600;font-family:inherit;font-size:13px}
.tab.active{background:var(--nx-ink);color:#fff;border-color:var(--nx-ink)}
.searchbar{display:flex;align-items:stretch;flex:1;min-width:0}
.searchbar input{flex:1;margin:0!important;border-radius:10px 0 0 10px!important;min-width:0}
.searchbar button{border:1px solid var(--nx-rule-hard);border-left:0;background:var(--nx-raised);color:var(--nx-ink);border-radius:0 10px 10px 0;padding:0 16px;cursor:pointer;display:flex;align-items:center}
.searchbar button:hover{background:var(--nx-lift)}

/* --- messages / tags / chips --- */
.msg{border-radius:10px;padding:11px 14px;font-size:13px;font-weight:600;margin:12px 0}
.msg.success{background:var(--nx-green-dim);color:#15803d}
.msg.error{background:var(--nx-red-dim);color:#b91c1c}
.msg.warn{background:rgba(245,158,11,.12);color:#92400e}
.tag{display:inline-block;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:700;background:var(--nx-lift);color:var(--nx-ink-2)}
.tag.green{background:var(--nx-green-dim);color:#15803d}
.tag.amber{background:rgba(245,158,11,.14);color:#92400e}
.tag.red{background:var(--nx-red-dim);color:#b91c1c}
.tag.blue{background:rgba(59,130,246,.12);color:#1d4ed8}
.tag.yellow{background:rgba(245,158,11,.14);color:#92400e}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{border:1px solid var(--nx-rule-hard);background:var(--nx-surface);color:var(--nx-ink-2);border-radius:999px;padding:7px 13px;cursor:pointer;font-weight:600;font-size:13px;font-family:inherit}
.chip.active{background:var(--nx-ink);color:#fff;border-color:var(--nx-ink)}
.count{background:var(--nx-purple);color:#fff;font-size:11px;font-weight:800;padding:2px 8px;border-radius:999px;margin-left:4px}
.swatch{display:inline-block;width:26px;height:26px;border-radius:8px;border:1px solid var(--nx-rule-hard);vertical-align:middle;margin-right:8px}

/* --- tables / lists / cards rendered by JS --- */
.table-wrap{overflow-x:auto}
#admin-shell table{width:100%;border-collapse:collapse;font-size:14px}
#admin-shell th{color:var(--nx-ink-3);text-align:left;font-weight:600;padding:10px 8px;border-bottom:1px solid var(--nx-rule);white-space:nowrap}
#admin-shell td{padding:10px 8px;border-bottom:1px solid var(--nx-rule);vertical-align:middle}
.mini{display:flex;align-items:center;gap:10px}
.mini img{width:36px;height:52px;object-fit:cover;border-radius:7px}
.kv{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--nx-rule);font-size:13px}
.kv:last-child{border-bottom:0}
.kv b{color:var(--nx-ink)}
.kv span{color:var(--nx-ink-2);text-align:right;word-break:break-all}
.log-list{display:flex;flex-direction:column}
.log-row{display:flex;gap:10px;padding:8px 0;border-bottom:1px solid var(--nx-rule);font-size:13px}
.log-row:last-child{border-bottom:0}
.log-row .ts{color:var(--nx-ink-3);white-space:nowrap}
.title-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px;margin-top:14px}
.title-card{background:var(--nx-surface);border:1px solid var(--nx-rule);border-radius:14px;overflow:hidden;display:flex;flex-direction:column;box-shadow:var(--nx-shadow)}
.title-card img.cover{width:100%;aspect-ratio:3/4;object-fit:cover;display:block;background:var(--nx-lift)}
.title-card .t-title{padding:12px 12px 4px;font-weight:700;font-size:15px;line-height:1.35;color:var(--nx-ink)}
.title-card .t-meta{padding:4px 12px;display:flex;gap:6px;flex-wrap:wrap;align-items:center;font-size:12px;color:var(--nx-ink-3)}
.title-card .t-actions{display:flex;gap:8px;padding:10px 12px 14px;margin-top:auto}
.title-card .t-actions .act{flex:1;text-align:center}
.jikan-card{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--nx-rule);align-items:center}
.jikan-card img{width:52px;height:74px;object-fit:cover;border-radius:8px}
.jikan-card .j-body{flex:1;min-width:0}
.jikan-card .j-title{font-weight:700;color:var(--nx-ink)}
.jikan-card .j-sum{font-size:13px;color:var(--nx-ink-2);margin-top:2px}
.jikan-card .j-meta{font-size:12px;color:var(--nx-ink-3);margin-top:4px}
.ch-results{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.ch-result{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--nx-rule-hard);border-radius:12px;cursor:pointer;background:var(--nx-surface)}
.ch-result:hover{border-color:var(--nx-purple)}
.ch-result img{width:30px;height:44px;object-fit:cover;border-radius:6px}
.ch-result.picked{border-color:var(--nx-purple);background:var(--nx-purple-dim)}
.nx-topbar-btn.is-danger{color:var(--nx-red)}

/* --- global search dropdown --- */
.gsearch{position:relative}
.gsearch-ic{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--nx-ink-3);display:flex}
.gsearch-ic svg{width:16px;height:16px}
#gsearch-input{width:100%;background:var(--nx-raised);border:1px solid var(--nx-rule-hard);color:var(--nx-ink);border-radius:999px;padding:9px 14px 9px 36px;outline:none;font-size:13px;font-family:inherit}
#gsearch-input:focus{border-color:var(--nx-purple);background:#fff}
.gresults{position:absolute;top:calc(100% + 8px);left:0;right:0;background:#fff;border:1px solid var(--nx-rule-hard);border-radius:14px;box-shadow:var(--nx-shadow-md);display:none;z-index:60;overflow:hidden;max-height:340px;overflow-y:auto}
.gresults.show{display:block}
.gresult{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:transparent;border:0;border-bottom:1px solid var(--nx-rule);padding:10px 12px;cursor:pointer;font-family:inherit}
.gresult:hover{background:var(--nx-raised)}
.gresult img{width:30px;height:42px;object-fit:cover;border-radius:6px}
.gr-title{font-weight:600;font-size:13px;color:var(--nx-ink);display:block}
.gr-meta{font-size:12px;color:var(--nx-ink-3);display:block}
.gr-empty{color:var(--nx-ink-3);font-size:13px}

/* --- toast / modal --- */
.toast{position:fixed;left:50%;bottom:100px;transform:translateX(-50%);background:var(--nx-ink);color:#fff;padding:13px 20px;border-radius:999px;font-weight:600;box-shadow:0 10px 30px rgba(0,0,0,.25);display:none;z-index:80;max-width:92vw;text-align:center;font-size:14px}
.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.5);display:none;align-items:center;justify-content:center;z-index:90;padding:16px}
.modal-backdrop.show{display:flex}
.modal{background:#fff;border-radius:16px;padding:22px;max-width:420px;width:100%;box-shadow:var(--nx-shadow-md)}
.modal p{margin:0 0 18px;font-size:15px;line-height:1.5;color:var(--nx-ink)}
.modal-actions{display:flex;gap:10px;justify-content:flex-end}

/* --- mobile bottom nav + more sheet (Anisora has none; Nexus-styled) --- */
.bottomnav{display:none}
.more-sheet-backdrop{display:none}
.more-sheet{display:none}
@media(max-width:860px){
  #admin-shell .nx-main{padding-bottom:110px}
  .stats{grid-template-columns:repeat(2,1fr)}
  .grid2{grid-template-columns:1fr}
  .row>div{min-width:100%}
  .nx-topbar-search{display:none}
  /* mobile admin polish: long upload-hint buttons wrap instead of overflowing the card */
  .btn-wrap{flex:1 1 100%}
  #poster-upload-btn, #st-logo-upload{white-space:normal;width:100%;height:auto;line-height:1.45;text-align:center}
  /* mobile search toggle: icon button in the topbar opens a full-width search row below it */
  #topbar-search-toggle{display:inline-flex}
  body.msearch-open .nx-topbar-search{display:flex;position:fixed;top:64px;left:12px;right:12px;z-index:65;max-width:none;margin:0}
  /* scrollable tab strips: subtle right fade so it is clear the row scrolls */
  .nx-mainnav, .nx-subnav{-webkit-mask-image:linear-gradient(to right,#000 94%,transparent 100%);mask-image:linear-gradient(to right,#000 94%,transparent 100%)}
  .nx-topbar-user span{display:none}
  .bottomnav{display:flex;position:fixed;left:12px;right:12px;bottom:12px;z-index:70;background:#fff;border:1px solid var(--nx-rule-hard);border-radius:999px;padding:8px 10px calc(8px + env(safe-area-inset-bottom));justify-content:space-around;box-shadow:0 12px 30px rgba(0,0,0,.18)}
  .bottomnav button{background:transparent;border:0;color:var(--nx-ink-3);display:flex;flex-direction:column;align-items:center;gap:3px;font-size:11px;font-weight:700;cursor:pointer;padding:6px 10px;border-radius:16px;min-width:54px;font-family:inherit}
  .bottomnav button .icon{width:22px;height:22px}
  .bottomnav button.active{color:var(--nx-purple);background:var(--nx-purple-dim)}
  .more-sheet-backdrop{display:block;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:75;opacity:0;pointer-events:none;transition:opacity .2s}
  .more-sheet-backdrop.on{opacity:1;pointer-events:auto}
  .more-sheet{display:block;position:fixed;left:0;right:0;bottom:0;z-index:76;background:#fff;border-radius:20px 20px 0 0;padding:12px 16px calc(20px + env(safe-area-inset-bottom));transform:translateY(105%);transition:transform .25s;box-shadow:0 -10px 40px rgba(0,0,0,.2)}
  .more-sheet.on{transform:translateY(0)}
  .more-sheet .grab{width:40px;height:4px;border-radius:99px;background:#d4d4de;margin:0 auto 12px}
  .more-sheet h3{margin:0 0 12px;font-size:16px}
  .more-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .more-item{display:flex;align-items:center;gap:10px;background:var(--nx-raised);border:1px solid var(--nx-rule);border-radius:12px;padding:12px;cursor:pointer;font-weight:600;font-size:13px;color:var(--nx-ink);font-family:inherit;text-align:left}
  .more-item .icon{width:18px;height:18px;color:var(--nx-purple)}
  .toast{bottom:110px}
  #admin-shell table,#admin-shell thead,#admin-shell tbody,#admin-shell tr,#admin-shell th,#admin-shell td{display:block;width:100%}
  #admin-shell thead{display:none}
  #admin-shell tr{border:1px solid var(--nx-rule);border-radius:14px;margin-bottom:10px;padding:6px 10px;background:var(--nx-surface)}
  #admin-shell td{border-bottom:0;padding:7px 0;display:flex;justify-content:space-between;gap:12px;text-align:right}
  #admin-shell td:before{content:attr(data-label);color:var(--nx-ink-3);font-weight:600;text-align:left}
  #admin-shell td .mini{text-align:left}
}
@media(max-width:480px){
  .stats{grid-template-columns:1fr}
  #admin-shell .nx-main{padding-bottom:118px}
}
