/* ═══════════════════════════════════════════════════════
   NEXTGEN — Premium Dark Design System
   Crystalline surfaces · Cyan accent · DM Sans
   ═══════════════════════════════════════════════════════ */

/* ── VARIABLES ───────────────────────────────────────── */
:root {
  --nx-bg:       #050508;
  --nx-surface:  hsla(240,6%,10%,.82);
  --nx-surface2: hsla(240,6%,12%,.92);
  --nx-border:   hsla(220,10%,24%,.35);
  --nx-border-h: hsla(220,10%,32%,.52);
  --nx-accent:   #06b6d4;
  --nx-accent2:  #22d3ee;
  --nx-violet:   #8b5cf6;
  --nx-green:    #22c55e;
  --nx-rose:     #f43f5e;
  --nx-amber:    #f59e0b;
  --nx-text:     #e2e8f0;
  --nx-text2:    #94a3b8;
  --nx-text3:    #64748b;
  --nx-r:        16px;
  --nx-r-sm:     12px;
  --nx-r-pill:   999px;
  --nx-shadow:   0 20px 60px -10px rgba(0,0,0,.7);
  --nx-shadow-sm:0 8px 24px rgba(0,0,0,.4);
  --nx-font:     'DM Sans', system-ui, -apple-system, sans-serif;
  --nx-mono:     'JetBrains Mono', ui-monospace, monospace;
  --nx-glass:    blur(20px) saturate(1.4);
  --nx-dur:      .2s;
  --nx-heading:  #fff;
  --nx-fg:       #fff;
  color-scheme: dark;
}

/* ── LIGHT THEME ─────────────────────────────────────── */
html[data-theme="light"] {
  --nx-bg:       #f8fafc;
  --nx-surface:  rgba(255,255,255,.92);
  --nx-surface2: rgba(255,255,255,.98);
  --nx-border:   rgba(15,23,42,.08);
  --nx-border-h: rgba(15,23,42,.18);
  --nx-text:     #0f172a;
  --nx-text2:    #475569;
  --nx-text3:    #64748b;
  --nx-heading:  #0f172a;
  --nx-fg:       #0f172a;
  --nx-shadow:   0 20px 60px -10px rgba(15,23,42,.12);
  --nx-shadow-sm:0 8px 24px rgba(15,23,42,.08);
  color-scheme: light;
}

html[data-theme="light"] .nx-noise { opacity: .015; }
html[data-theme="light"] .nx-aurora-a { opacity: .4; }
html[data-theme="light"] .nx-aurora-b { opacity: .35; }
html[data-theme="light"] .nx-body a:hover { color: var(--nx-fg); }
html[data-theme="light"] .nx-body ::selection { background: rgba(6,182,212,.2); color: #0f172a; }
html[data-theme="light"] .nx-rail { background: rgba(248,250,252,.9); }
html[data-theme="light"] .nx-topline { background: rgba(248,250,252,.85); }
html[data-theme="light"] .nx-user-pill { background: rgba(255,255,255,.9); }
html[data-theme="light"] .nx-nav-item.is-on::before { background: var(--nx-accent); }

/* ── RESET ───────────────────────────────────────────── */
.nx-body, .nx-body * { box-sizing: border-box; }
.nx-body {
  margin: 0; padding: 0;
  font-family: var(--nx-font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--nx-text);
  background: var(--nx-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

.nx-body h1,.nx-body h2,.nx-body h3,.nx-body h4 { margin: 0; color: var(--nx-heading); letter-spacing: -.02em; }
.nx-body h1 { font-size: clamp(22px,2.5vw,28px); font-weight: 700; }
.nx-body h2 { font-size: clamp(16px,1.8vw,20px); font-weight: 700; }
.nx-body h3 { font-size: clamp(14px,1.4vw,16px); font-weight: 600; }
.nx-body p { margin: 0 0 8px; } .nx-body p:last-child { margin-bottom: 0; }
.nx-body a { color: var(--nx-accent2); text-decoration: none; transition: color var(--nx-dur); }
.nx-body a:hover { color: var(--nx-fg); }
.nx-body ::selection { background: rgba(6,182,212,.25); color: var(--nx-fg); }

/* ── BACKGROUND ──────────────────────────────────────── */
.nx-noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

.nx-aurora {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.nx-aurora-a {
  position: absolute; width: 700px; height: 500px;
  top: -200px; left: -150px;
  background: radial-gradient(ellipse, rgba(6,182,212,.12), transparent 70%);
  filter: blur(60px);
  animation: aurora-drift 22s ease-in-out infinite;
}
.nx-aurora-b {
  position: absolute; width: 500px; height: 400px;
  bottom: -120px; right: -100px;
  background: radial-gradient(ellipse, rgba(139,92,246,.1), transparent 70%);
  filter: blur(60px);
  animation: aurora-drift 28s ease-in-out infinite reverse;
}
@keyframes aurora-drift {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(30px,-20px) scale(1.05); }
  66% { transform: translate(-20px,15px) scale(.97); }
}

/* ── LAYOUT ──────────────────────────────────────────── */
.nx-app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 240px minmax(0,1fr);
  min-height: 100vh;
}

/* ── SIDEBAR (RAIL) ──────────────────────────────────── */
.nx-rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 10px;
  background: hsla(240,6%,6%,.85);
  backdrop-filter: var(--nx-glass);
  border-right: 1px solid var(--nx-border);
  overflow-y: auto;
  scrollbar-width: none;
}
.nx-rail::-webkit-scrollbar { display: none; }

.nx-rail-inner { flex: 1; display: flex; flex-direction: column; }

.nx-rail-head {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.nx-rail-close {
  display: none; width: 30px; height: 30px;
  border-radius: 8px; border: 1px solid var(--nx-border);
  background: transparent; color: var(--nx-text2);
  cursor: pointer; align-items: center; justify-content: center;
  transition: var(--nx-dur);
}
.nx-rail-close:hover { color: var(--nx-fg); border-color: var(--nx-accent); }
.nx-rail-close svg { width: 14px; height: 14px; }

.nx-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--nx-r-sm);
  text-decoration: none; transition: background var(--nx-dur);
}
.nx-logo:hover { background: hsla(0,0%,100%,.04); }

.nx-logo-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--nx-accent), var(--nx-violet));
  box-shadow: 0 6px 20px rgba(6,182,212,.25), inset 0 1px 0 rgba(255,255,255,.15);
  color: #fff; flex-shrink: 0;
}
.nx-logo-mark svg { width: 16px; height: 16px; }

.nx-logo-text {
  font-size: 15px; font-weight: 700;
  color: var(--nx-fg); letter-spacing: -.03em;
}

/* Navigation */
.nx-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nx-nav-section { margin-bottom: 6px; }

.nx-nav-heading {
  display: block; padding: 10px 10px 4px;
  font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--nx-text3);
}

.nx-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: var(--nx-r-sm);
  font-size: 13px; font-weight: 500;
  color: var(--nx-text2);
  text-decoration: none;
  transition: all var(--nx-dur);
  border: 1px solid transparent;
  position: relative;
}
.nx-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .55; transition: opacity var(--nx-dur); }
.nx-nav-item:hover { color: var(--nx-fg); background: hsla(0,0%,100%,.04); }
.nx-nav-item:hover svg { opacity: .9; }
.nx-nav-item.is-on {
  color: var(--nx-fg);
  background: linear-gradient(135deg, rgba(6,182,212,.12), rgba(139,92,246,.08));
  border-color: rgba(6,182,212,.2);
}
.nx-nav-item.is-on svg { opacity: 1; color: var(--nx-accent); }
.nx-nav-item.is-on::before {
  content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0;
  background: var(--nx-accent);
}

/* Sidebar foot */
.nx-rail-foot {
  padding: 8px 0 0;
  border-top: 1px solid var(--nx-border);
  margin-top: auto;
}
.nx-rail-foot form { margin: 0; }

.nx-signout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px;
  border-radius: var(--nx-r-sm);
  border: 0; background: transparent;
  color: var(--nx-text3); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: var(--nx-dur);
}
.nx-signout:hover { color: var(--nx-rose); background: rgba(244,63,94,.06); }
.nx-signout svg { width: 15px; height: 15px; }

/* Shade overlay */
.nx-shade {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
}
.nx-shade[hidden] { display: none; }

/* ── MAIN ────────────────────────────────────────────── */
.nx-main { min-width: 0; display: flex; flex-direction: column; }

.nx-topline {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 6px 20px;
  border-bottom: 1px solid var(--nx-border);
  background: hsla(240,6%,4%,.7);
  backdrop-filter: var(--nx-glass);
}
.nx-topline-spacer { flex: 1; }

.nx-user-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--nx-r-pill);
  border: 1px solid var(--nx-border);
  background: var(--nx-surface);
  transition: border-color var(--nx-dur);
}
.nx-user-pill:hover { border-color: var(--nx-border-h); }

.nx-user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--nx-accent), var(--nx-violet));
  font-size: 11px; font-weight: 700; color: var(--nx-fg);
}

.nx-user-name { font-size: 12px; font-weight: 600; color: var(--nx-text2); }

.nx-menu-trigger {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--nx-r-sm);
  border: 1px solid var(--nx-border);
  background: transparent; color: var(--nx-text);
  cursor: pointer; align-items: center; justify-content: center;
  transition: var(--nx-dur);
}
.nx-menu-trigger:hover { border-color: var(--nx-accent); color: var(--nx-accent); }
.nx-menu-trigger svg { width: 18px; height: 18px; }

.nx-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--nx-r-sm);
  border: 1px solid var(--nx-border);
  background: transparent; color: var(--nx-text);
  cursor: pointer;
  transition: var(--nx-dur); position: relative;
}
.nx-theme-toggle:hover { border-color: var(--nx-accent); color: var(--nx-accent); }
.nx-theme-toggle .nx-theme-sun, .nx-theme-toggle .nx-theme-moon { display: inline-flex; align-items: center; justify-content: center; }
.nx-theme-toggle .nx-theme-sun svg, .nx-theme-toggle .nx-theme-moon svg { width: 16px; height: 16px; }
.nx-theme-moon { display: none !important; }
.nx-theme-sun { display: inline-flex !important; }
html[data-theme="light"] .nx-theme-sun { display: none !important; }
html[data-theme="light"] .nx-theme-moon { display: inline-flex !important; }

.nx-viewport {
  flex: 1; max-width: 1200px; width: 100%;
  margin: 0 auto; padding: 20px;
}

/* ── TOPBAR (PAGE HEAD) ──────────────────────────────── */
.nx-body .m2-topbar,
.nx-body .nx-page-head {
  background: transparent;
  border: 0; border-radius: 0;
  padding: 4px 0 12px;
  box-shadow: none;
  margin-bottom: 6px;
}

.nx-body .m2-topbar-title,
.nx-body .nx-page-title {
  font-size: clamp(20px,2.2vw,26px); font-weight: 700;
  color: var(--nx-fg); letter-spacing: -.03em;
}

.nx-body .m2-topbar-sub,
.nx-body .nx-page-sub {
  font-size: 13px; color: var(--nx-text3); margin-top: 2px;
}

.nx-body .m2-topbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── CARDS ───────────────────────────────────────────── */
.nx-body .m2-card,
.nx-body .card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-r);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--nx-shadow-sm);
  backdrop-filter: blur(8px);
  transition: border-color var(--nx-dur), box-shadow var(--nx-dur);
}
.nx-body .m2-card:hover, .nx-body .card:hover {
  border-color: var(--nx-border-h);
}

.nx-body .inner,
.nx-body .m2-tariff-item,
.nx-body .m2-app-card,
.nx-body .m2-install-sidebar,
.nx-body .m2-install-main,
.nx-body .m2-auth-side,
.nx-body .m2-auth-main {
  background: hsla(240,6%,8%,.6);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-r);
}

.nx-body .m2-tariff-item,
.nx-body .m2-install-sidebar,
.nx-body .m2-install-main,
.nx-body .m2-app-card,
.nx-body .m2-auth-side,
.nx-body .m2-auth-main { padding: 20px; }

/* Hero card */
.nx-body .m2-hero-card {
  display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
  position: relative; overflow: hidden;
  background:
    radial-gradient(600px 250px at 5% 20%, rgba(6,182,212,.1), transparent 60%),
    var(--nx-surface);
  border-color: rgba(6,182,212,.15);
}
.nx-body .m2-hero-card::after {
  content: ""; position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,.12), transparent 65%);
  pointer-events: none;
}

/* Metric card */
.nx-body .m2-metric-card {
  min-height: 100px; position: relative; overflow: hidden;
}
.nx-body .m2-metric-card::before {
  content: ""; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--nx-accent), var(--nx-violet));
  opacity: .5;
}

.nx-body .m2-kicker {
  color: var(--nx-text3); font-size: 10px;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
}

.nx-body .m2-metric {
  margin-top: 8px;
  font-size: clamp(22px,2vw,28px);
  font-weight: 700; color: var(--nx-fg);
  font-feature-settings: 'tnum';
}

/* ── BUTTONS ─────────────────────────────────────────── */
.nx-body .m2-btn, .nx-body .btn {
  border: 0; border-radius: var(--nx-r-pill);
  min-height: 40px; padding: 9px 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  line-height: 1.3; text-align: center;
  white-space: normal; word-break: break-word; max-width: 100%;
  text-decoration: none; cursor: pointer;
  font-weight: 600; font-size: 13px;
  font-family: var(--nx-font);
  background: linear-gradient(135deg, var(--nx-accent), rgba(6,182,212,.7));
  color: #fff;
  box-shadow: 0 4px 16px rgba(6,182,212,.2), inset 0 1px 0 rgba(255,255,255,.12);
  transition: transform var(--nx-dur), box-shadow var(--nx-dur), opacity var(--nx-dur);
}
.nx-body .m2-btn:hover, .nx-body .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(6,182,212,.3), inset 0 1px 0 rgba(255,255,255,.12);
}
.nx-body .m2-btn:active { transform: translateY(0); }

.nx-body .m2-btn-ghost {
  background: hsla(0,0%,100%,.04);
  border: 1px solid var(--nx-border-h);
  color: var(--nx-text); box-shadow: none;
}
.nx-body .m2-btn-ghost:hover {
  background: hsla(0,0%,100%,.08);
  border-color: var(--nx-accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(6,182,212,.1);
}

.nx-body .m2-btn-danger {
  background: rgba(244,63,94,.08);
  border: 1px solid rgba(244,63,94,.25);
  color: #fda4af; box-shadow: none;
}
.nx-body .m2-btn-danger:hover { background: rgba(244,63,94,.14); border-color: rgba(244,63,94,.4); }

.nx-body .m2-actions-wrap .m2-btn,
.nx-body .m2-inline-form .m2-btn {
  min-height: 32px; padding: 5px 12px; font-size: 12px;
}
.nx-body .m2-actions-wrap .m2-input,
.nx-body .m2-inline-form .m2-input {
  min-height: 32px; padding: 4px 8px; font-size: 12px;
}

/* ── FORMS ───────────────────────────────────────────── */
.nx-body .m2-form-grid { display: grid; gap: 14px; }

.nx-body .m2-field { display: grid; gap: 5px; font-size: 13px; color: var(--nx-text2); min-width: 0; }
.nx-body .m2-field > span { font-weight: 600; color: var(--nx-text); margin-bottom: 1px; }

.nx-body .m2-input,
.nx-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.nx-body select,
.nx-body textarea,
.nx-body .admin-input {
  width: 100%; box-sizing: border-box;
  min-height: 42px; padding: 9px 14px;
  border-radius: var(--nx-r-sm);
  border: 1px solid var(--nx-border);
  background: hsla(240,6%,8%,.8);
  color: var(--nx-text);
  font-family: var(--nx-font); font-size: 14px;
  transition: border-color var(--nx-dur), box-shadow var(--nx-dur);
}
.nx-body input:focus, .nx-body select:focus, .nx-body textarea:focus,
.nx-body .m2-input:focus, .nx-body .admin-input:focus {
  border-color: var(--nx-accent);
  box-shadow: 0 0 0 3px rgba(6,182,212,.12);
  outline: none;
}
.nx-body input::placeholder, .nx-body textarea::placeholder { color: var(--nx-text3); }
.nx-body input[type="checkbox"], .nx-body input[type="radio"] {
  width: auto; min-height: 0; height: auto;
  padding: 0; border: 0; background: transparent;
  box-shadow: none; accent-color: var(--nx-accent);
}
.nx-body textarea { min-height: 90px; resize: vertical; }

/* ── NOTICES ─────────────────────────────────────────── */
.nx-body .m2-notice, .nx-body .notice {
  margin-bottom: 12px; padding: 12px 16px;
  border-radius: var(--nx-r-sm);
  border-left: 3px solid var(--nx-accent);
  background: rgba(6,182,212,.06);
  font-size: 13px;
}
.nx-body .m2-success, .nx-body .notice.success {
  border-left-color: var(--nx-green);
  background: rgba(34,197,94,.06);
}
.nx-body .m2-error, .nx-body .notice.error {
  border-left-color: var(--nx-rose);
  background: rgba(244,63,94,.06);
}

/* ── PILLS & CHIPS ───────────────────────────────────── */
.nx-body .m2-kpi-pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; border-radius: var(--nx-r-pill); padding: 0 12px;
  background: rgba(6,182,212,.08);
  border: 1px solid rgba(6,182,212,.2);
  font-size: 11px; font-weight: 700; color: var(--nx-accent2);
  letter-spacing: .02em; text-transform: uppercase;
}

.nx-body .m2-chip {
  display: inline-flex; min-height: 22px; padding: 0 10px;
  border-radius: var(--nx-r-pill); align-items: center;
  background: rgba(6,182,212,.06);
  border: 1px solid rgba(6,182,212,.18);
  color: var(--nx-accent2); font-size: 11px; font-weight: 700;
  letter-spacing: .02em;
}

/* ── CHIP-ROW NAV ────────────────────────────────────── */
.nx-body .m2-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.nx-body .m2-chip-link, .nx-body .top-link {
  border: 1px solid var(--nx-border); border-radius: var(--nx-r-pill);
  min-height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 14px;
  color: var(--nx-text2); text-decoration: none;
  background: transparent;
  transition: var(--nx-dur); font-weight: 600; font-size: 12px;
  line-height: 1.2; text-align: center; white-space: normal; word-break: break-word;
}
.nx-body .m2-chip-link:hover, .nx-body .top-link:hover {
  border-color: var(--nx-border-h); color: var(--nx-fg);
  background: hsla(0,0%,100%,.04);
}
.nx-body .m2-chip-link.is-active, .nx-body .top-link.is-active {
  color: var(--nx-fg); border-color: var(--nx-accent);
  background: rgba(6,182,212,.1);
  box-shadow: 0 0 16px rgba(6,182,212,.1);
}

/* ── TABLES ──────────────────────────────────────────── */
.nx-body .m2-table-wrap { overflow: auto; border-radius: var(--nx-r); }

.nx-body .m2-table, .nx-body table {
  width: 100%; border-collapse: collapse; min-width: 640px;
}

.nx-body .m2-table th, .nx-body th {
  padding: 10px 12px; border-bottom: 1px solid var(--nx-border-h);
  text-align: left; vertical-align: top;
  color: var(--nx-text3); font-size: 10px;
  letter-spacing: .06em; text-transform: uppercase; font-weight: 700;
  background: hsla(240,6%,10%,.5);
}
.nx-body .m2-table th:first-child, .nx-body th:first-child { border-radius: var(--nx-r) 0 0 0; }
.nx-body .m2-table th:last-child, .nx-body th:last-child { border-radius: 0 var(--nx-r) 0 0; }

.nx-body .m2-table td, .nx-body td {
  padding: 9px 12px; border-bottom: 1px solid var(--nx-border);
  text-align: left; vertical-align: top; color: var(--nx-text); font-size: 13px;
}

.nx-body .m2-table tbody tr:hover td, .nx-body tbody tr:hover td {
  background: hsla(0,0%,100%,.02);
}

/* ── PROPS LIST ──────────────────────────────────────── */
.nx-body .m2-props p {
  margin: 0; display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--nx-border); padding: 9px 0;
}
.nx-body .m2-props p:last-child { border-bottom: 0; }
.nx-body .m2-props span { color: var(--nx-text2); font-size: 13px; }
.nx-body .m2-props b { color: var(--nx-fg); font-family: var(--nx-mono); font-size: 13px; font-weight: 500; }

/* ── UTILITY ─────────────────────────────────────────── */
.nx-body .m2-muted, .nx-body .muted { color: var(--nx-text2); }
.nx-body .m2-stack-16 { margin-top: 14px; }
.nx-body .m2-row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nx-body .m2-break-all, .nx-body .break-all { word-break: break-all; }
.nx-body .m2-break-all, .nx-body .break-all,
.nx-body td, .nx-body th,
.nx-body .m2-props p { overflow-wrap: anywhere; }

/* ── GRID ────────────────────────────────────────────── */
.nx-body .m2-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.nx-body .m2-grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.nx-body .m2-grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }

/* ── AUTH LAYOUT ─────────────────────────────────────── */
.nx-body .m2-auth-layout {
  display: grid;
  grid-template-columns: minmax(260px,360px) minmax(0,1fr);
  gap: 14px; align-items: start;
}

.nx-body .m2-feature-list {
  margin: 0; padding-left: 16px;
  display: grid; gap: 6px; color: var(--nx-text); font-size: 13px;
}

/* ── KEYS / INSTALL ──────────────────────────────────── */
.nx-body .m2-keys-header {
  display: flex; align-items: center;
  justify-content: space-between; gap: 14px;
}

.nx-body .m2-install-top-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.nx-body .m2-install-grid {
  margin-top: 14px; display: grid;
  grid-template-columns: 280px minmax(0,1fr); gap: 14px;
}

.nx-body .m2-platform-tabs { display: flex; flex-wrap: wrap; gap: 6px; }

.nx-body .m2-platform-tab, .nx-body .m2-app-btn {
  border: 1px solid var(--nx-border); border-radius: var(--nx-r-pill);
  background: transparent; color: var(--nx-text2);
  min-height: 34px; padding: 6px 12px;
  cursor: pointer; transition: var(--nx-dur); font-weight: 600; font-size: 12px;
  line-height: 1.2; text-align: center; white-space: normal; word-break: break-word;
  font-family: var(--nx-font);
}
.nx-body .m2-platform-tab:hover, .nx-body .m2-app-btn:hover { border-color: var(--nx-border-h); color: var(--nx-fg); }
.nx-body .m2-platform-tab.is-active, .nx-body .m2-app-btn.is-active {
  color: var(--nx-fg); border-color: var(--nx-accent);
  background: rgba(6,182,212,.1);
}

.nx-body .m2-apps-grid { display: grid; grid-template-columns: 1fr; gap: 4px; }

/* ── STEPS ───────────────────────────────────────────── */
.nx-body .m2-list-steps {
  margin: 0; padding-left: 18px; display: grid; gap: 6px;
  color: var(--nx-text); font-size: 13px;
}
.nx-body .m2-list-steps li::marker { color: var(--nx-accent); font-weight: 700; }

/* ── ACTIONS & SPACING ───────────────────────────────── */
.nx-body .m2-actions, .nx-body .m2-actions-wrap, .nx-body .m2-inline-form,
.nx-body .admin-actions, .nx-body .profile-menu {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.nx-body .m2-actions > *, .nx-body .m2-actions-wrap > *, .nx-body .m2-chip-row > *,
.nx-body .m2-inline-form > *, .nx-body .admin-actions > *, .nx-body .profile-menu > * {
  flex: 0 1 auto;
}

.nx-body .m2-card .m2-actions, .nx-body .m2-card .m2-actions-wrap,
.nx-body .m2-card .m2-chip-row { margin-top: 10px; }
.nx-body .m2-card .m2-btn, .nx-body .card .m2-btn { margin-top: 6px; }
.nx-body .m2-chip-row + .m2-form-grid { margin-top: 14px; }
.nx-body .m2-form-grid > .m2-btn, .nx-body .m2-form-grid > button,
.nx-body .m2-form-grid > .m2-actions, .nx-body .m2-form-grid > .m2-actions-wrap { margin-top: 4px; }

.nx-body .m2-quick-panel { display: flex; flex-direction: column; }
.nx-body .m2-dashboard-hero-grid { align-items: stretch; }
.nx-body .m2-payments-top-grid { align-items: stretch; }
.nx-body .m2-payment-info-card { display: flex; flex-direction: column; }

/* ── CHART ───────────────────────────────────────────── */
.nx-body .m2-chart-wrap { position: relative; width: 100%; min-height: 220px; height: 260px; max-height: 260px; }
.nx-body .m2-chart-wrap canvas { width: 100% !important; height: 100% !important; display: block; }

/* ── LUCIDE ICONS ────────────────────────────────────── */
.nx-body [data-lucide] { width: 18px; height: 18px; stroke-width: 1.8; }

/* ── TOAST ───────────────────────────────────────────── */
.nx-body .wc-toast-container {
  position: fixed; top: 14px; right: 14px;
  width: min(92vw,380px); display: grid; gap: 8px;
  z-index: 9999; pointer-events: none;
}

.nx-body .wc-toast {
  pointer-events: auto;
  display: grid; grid-template-columns: 1fr auto;
  align-items: start; gap: 10px;
  padding: 14px 16px; border-radius: var(--nx-r);
  border: 1px solid var(--nx-border-h);
  background: var(--nx-surface2);
  color: var(--nx-text); backdrop-filter: var(--nx-glass);
  box-shadow: var(--nx-shadow);
  font-size: 13px;
  opacity: 0; transform: translateX(16px);
  transition: opacity .25s, transform .25s cubic-bezier(.4,0,.2,1);
}
.nx-body .wc-toast.is-visible { opacity: 1; transform: translateX(0); }
.nx-body .wc-toast.is-hiding { opacity: 0; transform: translateX(16px); }
.nx-body .wc-toast-success { border-left: 3px solid var(--nx-green); }
.nx-body .wc-toast-error { border-left: 3px solid var(--nx-rose); }
.nx-body .wc-toast-close {
  border: 0; background: transparent; color: var(--nx-text3);
  cursor: pointer; padding: 0; font-size: 18px; line-height: 1;
  min-height: auto; box-shadow: none;
}
.nx-body .wc-toast-close:hover { color: var(--nx-fg); transform: none; box-shadow: none; }

/* ── SCROLLBAR ───────────────────────────────────────── */
.nx-body ::-webkit-scrollbar { width: 5px; height: 5px; }
.nx-body ::-webkit-scrollbar-track { background: transparent; }
.nx-body ::-webkit-scrollbar-thumb { background: rgba(6,182,212,.12); border-radius: 99px; }
.nx-body ::-webkit-scrollbar-thumb:hover { background: rgba(6,182,212,.25); }

/* ── MOBILE TABLE ────────────────────────────────────── */
@media (max-width: 760px) {
  .nx-body .m2-table.keys-table, .nx-body .m2-table.keys-table thead,
  .nx-body .m2-table.keys-table tbody, .nx-body .m2-table.keys-table tr,
  .nx-body .m2-table.keys-table td { display: block; width: 100%; }
  .nx-body .m2-table.keys-table { min-width: 0 !important; border: 0; }
  .nx-body .m2-table.keys-table thead { display: none; }
  .nx-body .m2-table.keys-table tr {
    margin-bottom: 8px; padding: 10px 12px;
    border-radius: var(--nx-r-sm);
    border: 1px solid var(--nx-border);
    background: var(--nx-surface);
  }
  .nx-body .m2-table.keys-table td { border: 0; padding: 4px 0; }
  .nx-body .m2-table.keys-table td::before {
    content: attr(data-label); display: block;
    font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--nx-text3); margin-bottom: 2px; font-weight: 700;
  }
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 960px) {
  .nx-app { display: block; }

  .nx-rail {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(260px,85vw); z-index: 90;
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
  }
  .nx-rail.is-open { transform: translateX(0); }
  .nx-rail-close, .nx-menu-trigger { display: inline-flex !important; align-items: center; justify-content: center; }
  .nx-viewport { padding: 14px; }
}

@media (max-width: 900px) {
  .nx-body .m2-grid-3, .nx-body .m2-grid-2, .nx-body .m2-auth-layout,
  .nx-body .m2-dashboard-hero-grid, .nx-body .m2-payments-top-grid { grid-template-columns: 1fr; }
  .nx-body .m2-install-grid { grid-template-columns: 1fr; }
  .nx-body .m2-hero-card, .nx-body .m2-keys-header, .nx-body .m2-topbar-main {
    flex-direction: column; align-items: flex-start;
  }
  .nx-body .m2-btn, .nx-body .btn, .nx-body .m2-chip-link, .nx-body .m2-platform-tab,
  .nx-body .m2-app-btn, .nx-body .top-link { width: 100%; }
  .nx-body .m2-inline-form, .nx-body .m2-actions-wrap, .nx-body .admin-actions { width: 100%; }
  .nx-body .m2-inline-form > *, .nx-body .m2-actions-wrap > *, .nx-body .admin-actions > * { width: 100%; }
}

@media (max-width: 640px) {
  .nx-viewport { padding: 8px; }
  .nx-body .m2-card, .nx-body .card { padding: 14px; border-radius: 14px; }
  .nx-body .m2-topbar-title, .nx-body .nx-page-title { font-size: 18px; }
  .nx-body .m2-metric { font-size: 22px; }
  .nx-body .m2-btn, .nx-body .btn { min-height: 38px; padding: 8px 14px; font-size: 13px; }
  .nx-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  .nx-body select, .nx-body textarea { font-size: 16px; }
  .nx-body .m2-table { min-width: 540px; }
  .nx-topline { padding: 6px 10px; min-height: 46px; }
}
