/* ===================================================
   NX World Design System v2.0
   Next-Gen Enterprise Design Framework
   Inspired by Vercel, Linear, and Modern SaaS
   =================================================== */

/* ===== ROOT VARIABLES - DESIGN TOKENS ===== */
:root {
  /* === Color Palette === */
  
  /* Neutrals - Dark Mode (Default) */
  --nx-bg-base: #0a0a0a;
  --nx-bg-subtle: #111111;
  --nx-bg-muted: #171717;
  --nx-bg-elevated: #1a1a1a;
  --nx-bg-hover: #252525;
  --nx-bg-active: #2a2a2a;
  --nx-bg-overlay: rgba(0, 0, 0, 0.8);
  
  /* Surface Colors */
  --nx-surface-1: #0f0f0f;
  --nx-surface-2: #141414;
  --nx-surface-3: #1c1c1c;
  --nx-surface-4: #242424;
  
  /* Borders */
  --nx-border-subtle: rgba(255, 255, 255, 0.06);
  --nx-border-default: rgba(255, 255, 255, 0.1);
  --nx-border-muted: rgba(255, 255, 255, 0.15);
  --nx-border-emphasis: rgba(255, 255, 255, 0.2);
  --nx-border-strong: rgba(255, 255, 255, 0.3);
  
  /* Text Colors */
  --nx-text-primary: #fafafa;
  --nx-text-secondary: #a1a1a1;
  --nx-text-tertiary: #737373;
  --nx-text-muted: #525252;
  --nx-text-disabled: #3f3f3f;
  --nx-text-inverse: #0a0a0a;
  
  /* Brand Colors */
  --nx-brand-primary: #3b82f6;
  --nx-brand-primary-hover: #2563eb;
  --nx-brand-primary-active: #1d4ed8;
  --nx-brand-primary-subtle: rgba(59, 130, 246, 0.15);
  --nx-brand-primary-muted: rgba(59, 130, 246, 0.08);
  
  /* Accent Colors */
  --nx-accent-blue: #3b82f6;
  --nx-accent-cyan: #06b6d4;
  --nx-accent-teal: #14b8a6;
  --nx-accent-green: #22c55e;
  --nx-accent-lime: #84cc16;
  --nx-accent-yellow: #eab308;
  --nx-accent-orange: #f97316;
  --nx-accent-red: #ef4444;
  --nx-accent-pink: #ec4899;
  --nx-accent-purple: #8b5cf6;
  --nx-accent-violet: #a78bfa;
  --nx-accent-indigo: #6366f1;
  
  /* Semantic Colors */
  --nx-success: #22c55e;
  --nx-success-bg: rgba(34, 197, 94, 0.12);
  --nx-success-border: rgba(34, 197, 94, 0.3);
  
  --nx-warning: #f59e0b;
  --nx-warning-bg: rgba(245, 158, 11, 0.12);
  --nx-warning-border: rgba(245, 158, 11, 0.3);
  
  --nx-error: #ef4444;
  --nx-error-bg: rgba(239, 68, 68, 0.12);
  --nx-error-border: rgba(239, 68, 68, 0.3);
  
  --nx-info: #3b82f6;
  --nx-info-bg: rgba(59, 130, 246, 0.12);
  --nx-info-border: rgba(59, 130, 246, 0.3);
  
  /* Gradients */
  --nx-gradient-primary: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --nx-gradient-secondary: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  --nx-gradient-success: linear-gradient(135deg, #22c55e 0%, #14b8a6 100%);
  --nx-gradient-warning: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  --nx-gradient-error: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
  --nx-gradient-dark: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  --nx-gradient-glow: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
  --nx-gradient-mesh: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
  
  /* Shadows */
  --nx-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --nx-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --nx-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --nx-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --nx-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7);
  --nx-shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.8);
  --nx-shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  
  /* Glow Effects */
  --nx-glow-blue: 0 0 20px rgba(59, 130, 246, 0.4);
  --nx-glow-purple: 0 0 20px rgba(59, 130, 246, 0.4);
  --nx-glow-green: 0 0 20px rgba(34, 197, 94, 0.4);
  --nx-glow-red: 0 0 20px rgba(239, 68, 68, 0.4);
  
  /* === Typography === */
  --nx-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --nx-font-mono: 'SF Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  
  /* Font Sizes */
  --nx-text-xs: 0.75rem;     /* 12px */
  --nx-text-sm: 0.8125rem;   /* 13px */
  --nx-text-base: 0.875rem;  /* 14px */
  --nx-text-md: 1rem;        /* 16px */
  --nx-text-lg: 1.125rem;    /* 18px */
  --nx-text-xl: 1.25rem;     /* 20px */
  --nx-text-2xl: 1.5rem;     /* 24px */
  --nx-text-3xl: 1.875rem;   /* 30px */
  --nx-text-4xl: 2.25rem;    /* 36px */
  --nx-text-5xl: 3rem;       /* 48px */
  
  /* Font Weights */
  --nx-font-normal: 400;
  --nx-font-medium: 500;
  --nx-font-semibold: 600;
  --nx-font-bold: 700;
  
  /* Line Heights */
  --nx-leading-none: 1;
  --nx-leading-tight: 1.25;
  --nx-leading-snug: 1.375;
  --nx-leading-normal: 1.5;
  --nx-leading-relaxed: 1.625;
  
  /* Letter Spacing */
  --nx-tracking-tighter: -0.05em;
  --nx-tracking-tight: -0.025em;
  --nx-tracking-normal: 0;
  --nx-tracking-wide: 0.025em;
  --nx-tracking-wider: 0.05em;
  
  /* === Spacing === */
  --nx-space-0: 0;
  --nx-space-1: 0.25rem;   /* 4px */
  --nx-space-2: 0.5rem;    /* 8px */
  --nx-space-3: 0.75rem;   /* 12px */
  --nx-space-4: 1rem;      /* 16px */
  --nx-space-5: 1.25rem;   /* 20px */
  --nx-space-6: 1.5rem;    /* 24px */
  --nx-space-8: 2rem;      /* 32px */
  --nx-space-10: 2.5rem;   /* 40px */
  --nx-space-12: 3rem;     /* 48px */
  --nx-space-16: 4rem;     /* 64px */
  --nx-space-20: 5rem;     /* 80px */
  --nx-space-24: 6rem;     /* 96px */
  
  /* === Border Radius === */
  --nx-radius-none: 0;
  --nx-radius-sm: 4px;
  --nx-radius-md: 8px;
  --nx-radius-lg: 12px;
  --nx-radius-xl: 16px;
  --nx-radius-2xl: 20px;
  --nx-radius-3xl: 24px;
  --nx-radius-full: 9999px;
  
  /* === Transitions === */
  --nx-duration-instant: 50ms;
  --nx-duration-fast: 150ms;
  --nx-duration-normal: 250ms;
  --nx-duration-slow: 350ms;
  --nx-duration-slower: 500ms;
  
  --nx-ease-linear: linear;
  --nx-ease-in: cubic-bezier(0.4, 0, 1, 1);
  --nx-ease-out: cubic-bezier(0, 0, 0.2, 1);
  --nx-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --nx-ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Combined Transitions */
  --nx-transition-fast: var(--nx-duration-fast) var(--nx-ease-in-out);
  --nx-transition-normal: var(--nx-duration-normal) var(--nx-ease-in-out);
  --nx-transition-slow: var(--nx-duration-slow) var(--nx-ease-in-out);
  
  /* === Z-Index Scale === */
  --nx-z-base: 0;
  --nx-z-dropdown: 100;
  --nx-z-sticky: 200;
  --nx-z-fixed: 300;
  --nx-z-modal-backdrop: 400;
  --nx-z-modal: 500;
  --nx-z-popover: 600;
  --nx-z-tooltip: 700;
  --nx-z-toast: 800;
}

/* ===== LIGHT MODE ===== */
[data-theme="light"],
.light-mode,
.nx-theme-light {
  /* Backgrounds */
  --nx-bg-base: #ffffff;
  --nx-bg-subtle: #fafafa;
  --nx-bg-muted: #f5f5f5;
  --nx-bg-elevated: #ffffff;
  --nx-bg-hover: #f0f0f0;
  --nx-bg-active: #e8e8e8;
  --nx-bg-overlay: rgba(255, 255, 255, 0.9);
  
  /* Surfaces */
  --nx-surface-1: #ffffff;
  --nx-surface-2: #fafafa;
  --nx-surface-3: #f5f5f5;
  --nx-surface-4: #efefef;
  
  /* Borders */
  --nx-border-subtle: rgba(0, 0, 0, 0.04);
  --nx-border-default: rgba(0, 0, 0, 0.08);
  --nx-border-muted: rgba(0, 0, 0, 0.12);
  --nx-border-emphasis: rgba(0, 0, 0, 0.16);
  --nx-border-strong: rgba(0, 0, 0, 0.24);
  
  /* Text */
  --nx-text-primary: #171717;
  --nx-text-secondary: #525252;
  --nx-text-tertiary: #737373;
  --nx-text-muted: #a1a1a1;
  --nx-text-disabled: #d4d4d4;
  --nx-text-inverse: #fafafa;
  
  /* Shadows */
  --nx-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --nx-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --nx-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --nx-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --nx-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
  
  /* Semantic backgrounds */
  --nx-success-bg: rgba(34, 197, 94, 0.08);
  --nx-warning-bg: rgba(245, 158, 11, 0.08);
  --nx-error-bg: rgba(239, 68, 68, 0.08);
  --nx-info-bg: rgba(59, 130, 246, 0.08);
  
  --nx-brand-primary-subtle: rgba(59, 130, 246, 0.1);
  --nx-brand-primary-muted: rgba(59, 130, 246, 0.05);
}

/* ===== BASE STYLES ===== */
.nx-design-system {
  font-family: var(--nx-font-sans);
  font-size: var(--nx-text-base);
  line-height: var(--nx-leading-normal);
  color: var(--nx-text-primary);
  background-color: var(--nx-bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */

/* Headings */
.nx-h1, .nx-heading-1 {
  font-size: var(--nx-text-4xl);
  font-weight: var(--nx-font-bold);
  line-height: var(--nx-leading-tight);
  letter-spacing: var(--nx-tracking-tight);
  color: var(--nx-text-primary);
}

.nx-h2, .nx-heading-2 {
  font-size: var(--nx-text-3xl);
  font-weight: var(--nx-font-bold);
  line-height: var(--nx-leading-tight);
  letter-spacing: var(--nx-tracking-tight);
  color: var(--nx-text-primary);
}

.nx-h3, .nx-heading-3 {
  font-size: var(--nx-text-2xl);
  font-weight: var(--nx-font-semibold);
  line-height: var(--nx-leading-snug);
  color: var(--nx-text-primary);
}

.nx-h4, .nx-heading-4 {
  font-size: var(--nx-text-xl);
  font-weight: var(--nx-font-semibold);
  line-height: var(--nx-leading-snug);
  color: var(--nx-text-primary);
}

.nx-h5, .nx-heading-5 {
  font-size: var(--nx-text-lg);
  font-weight: var(--nx-font-semibold);
  line-height: var(--nx-leading-normal);
  color: var(--nx-text-primary);
}

.nx-h6, .nx-heading-6 {
  font-size: var(--nx-text-md);
  font-weight: var(--nx-font-semibold);
  line-height: var(--nx-leading-normal);
  color: var(--nx-text-primary);
}

/* Gradient Text */
.nx-text-gradient {
  background: var(--nx-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Body Text */
.nx-text-body {
  font-size: var(--nx-text-base);
  line-height: var(--nx-leading-relaxed);
  color: var(--nx-text-secondary);
}

.nx-text-small {
  font-size: var(--nx-text-sm);
  color: var(--nx-text-tertiary);
}

.nx-text-caption {
  font-size: var(--nx-text-xs);
  color: var(--nx-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--nx-tracking-wider);
  font-weight: var(--nx-font-semibold);
}

/* Monospace */
.nx-text-mono {
  font-family: var(--nx-font-mono);
}

/* ===== BUTTONS ===== */

/* Base Button */
.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--nx-space-2);
  padding: var(--nx-space-2) var(--nx-space-4);
  font-size: var(--nx-text-sm);
  font-weight: var(--nx-font-medium);
  line-height: var(--nx-leading-none);
  border-radius: var(--nx-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--nx-transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.nx-btn:focus-visible {
  outline: 2px solid var(--nx-brand-primary);
  outline-offset: 2px;
}

.nx-btn:disabled,
.nx-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Button Sizes */
.nx-btn-xs {
  padding: var(--nx-space-1) var(--nx-space-2);
  font-size: var(--nx-text-xs);
  border-radius: var(--nx-radius-sm);
}

.nx-btn-sm {
  padding: 0.375rem var(--nx-space-3);
  font-size: var(--nx-text-xs);
}

.nx-btn-md {
  padding: var(--nx-space-2) var(--nx-space-4);
  font-size: var(--nx-text-sm);
}

.nx-btn-lg {
  padding: var(--nx-space-3) var(--nx-space-6);
  font-size: var(--nx-text-base);
}

.nx-btn-xl {
  padding: var(--nx-space-4) var(--nx-space-8);
  font-size: var(--nx-text-md);
}

/* Primary Button */
.nx-btn-primary {
  background: var(--nx-gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: var(--nx-shadow-sm), 0 0 0 0 rgba(59, 130, 246, 0);
}

.nx-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--nx-shadow-md), var(--nx-glow-blue);
}

.nx-btn-primary:active {
  transform: translateY(0);
}

/* Secondary Button */
.nx-btn-secondary {
  background: var(--nx-bg-elevated);
  color: var(--nx-text-secondary);
  border-color: var(--nx-border-default);
}

.nx-btn-secondary:hover {
  background: var(--nx-bg-hover);
  color: var(--nx-text-primary);
  border-color: var(--nx-border-emphasis);
}

/* Ghost Button */
.nx-btn-ghost {
  background: transparent;
  color: var(--nx-text-secondary);
  border-color: transparent;
}

.nx-btn-ghost:hover {
  background: var(--nx-bg-hover);
  color: var(--nx-text-primary);
}

/* Outline Buttons */
.nx-btn-outline-primary {
  background: transparent;
  color: var(--nx-brand-primary);
  border-color: var(--nx-brand-primary);
}

.nx-btn-outline-primary:hover {
  background: var(--nx-brand-primary-subtle);
}

.nx-btn-outline-secondary {
  background: transparent;
  color: var(--nx-text-secondary);
  border-color: var(--nx-border-default);
}

.nx-btn-outline-secondary:hover {
  background: var(--nx-bg-hover);
  color: var(--nx-text-primary);
  border-color: var(--nx-border-emphasis);
}

/* Semantic Buttons */
.nx-btn-success {
  background: var(--nx-success);
  color: white;
}

.nx-btn-success:hover {
  background: #16a34a;
  box-shadow: var(--nx-glow-green);
}

.nx-btn-warning {
  background: var(--nx-warning);
  color: var(--nx-text-inverse);
}

.nx-btn-warning:hover {
  background: #d97706;
}

.nx-btn-danger {
  background: var(--nx-error);
  color: white;
}

.nx-btn-danger:hover {
  background: #dc2626;
  box-shadow: var(--nx-glow-red);
}

/* Outline Semantic */
.nx-btn-outline-success {
  background: transparent;
  color: var(--nx-success);
  border-color: var(--nx-success);
}

.nx-btn-outline-success:hover {
  background: var(--nx-success-bg);
}

.nx-btn-outline-danger {
  background: transparent;
  color: var(--nx-error);
  border-color: var(--nx-error);
}

.nx-btn-outline-danger:hover {
  background: var(--nx-error-bg);
}

/* Icon Button */
.nx-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--nx-radius-md);
}

.nx-btn-icon.nx-btn-sm {
  width: 28px;
  height: 28px;
}

.nx-btn-icon.nx-btn-lg {
  width: 44px;
  height: 44px;
}

/* Button Group */
.nx-btn-group {
  display: inline-flex;
}

.nx-btn-group .nx-btn {
  border-radius: 0;
}

.nx-btn-group .nx-btn:first-child {
  border-radius: var(--nx-radius-md) 0 0 var(--nx-radius-md);
}

.nx-btn-group .nx-btn:last-child {
  border-radius: 0 var(--nx-radius-md) var(--nx-radius-md) 0;
}

.nx-btn-group .nx-btn:not(:last-child) {
  border-right-width: 0;
}

/* ===== FORMS ===== */

/* Form Group */
.nx-form-group {
  margin-bottom: var(--nx-space-4);
}

/* Labels */
.nx-label {
  display: block;
  font-size: var(--nx-text-sm);
  font-weight: var(--nx-font-medium);
  color: var(--nx-text-primary);
  margin-bottom: var(--nx-space-2);
}

.nx-label-required::after {
  content: ' *';
  color: var(--nx-error);
}

/* Input Base */
.nx-input {
  width: 100%;
  padding: var(--nx-space-2) var(--nx-space-3);
  font-size: var(--nx-text-sm);
  line-height: var(--nx-leading-normal);
  color: var(--nx-text-primary);
  background: var(--nx-bg-elevated);
  border: 1px solid var(--nx-border-default);
  border-radius: var(--nx-radius-md);
  transition: all var(--nx-transition-fast);
}

.nx-input::placeholder {
  color: var(--nx-text-muted);
}

.nx-input:hover {
  border-color: var(--nx-border-emphasis);
}

.nx-input:focus {
  outline: none;
  border-color: var(--nx-brand-primary);
  box-shadow: 0 0 0 3px var(--nx-brand-primary-subtle);
}

.nx-input:disabled {
  background: var(--nx-bg-muted);
  color: var(--nx-text-disabled);
  cursor: not-allowed;
}

/* Input Sizes */
.nx-input-sm {
  padding: var(--nx-space-1) var(--nx-space-2);
  font-size: var(--nx-text-xs);
}

.nx-input-lg {
  padding: var(--nx-space-3) var(--nx-space-4);
  font-size: var(--nx-text-md);
}

/* Input States */
.nx-input-success {
  border-color: var(--nx-success);
}

.nx-input-success:focus {
  box-shadow: 0 0 0 3px var(--nx-success-bg);
}

.nx-input-error {
  border-color: var(--nx-error);
}

.nx-input-error:focus {
  box-shadow: 0 0 0 3px var(--nx-error-bg);
}

/* Input with Icon */
.nx-input-wrapper {
  position: relative;
}

.nx-input-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--nx-text-muted);
  pointer-events: none;
}

.nx-input-icon-left {
  left: var(--nx-space-3);
}

.nx-input-icon-right {
  right: var(--nx-space-3);
}

.nx-input-wrapper .nx-input-icon-left + .nx-input {
  padding-left: calc(var(--nx-space-3) + 20px);
}

.nx-input-wrapper .nx-input.has-icon-right {
  padding-right: calc(var(--nx-space-3) + 20px);
}

/* Textarea */
.nx-textarea {
  min-height: 100px;
  resize: vertical;
}

/* Select */
.nx-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right var(--nx-space-3) center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: calc(var(--nx-space-3) + 20px);
}

/* Checkbox */
.nx-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: var(--nx-space-2);
  cursor: pointer;
}

.nx-checkbox {
  width: 18px;
  height: 18px;
  appearance: none;
  background: var(--nx-bg-elevated);
  border: 1px solid var(--nx-border-default);
  border-radius: var(--nx-radius-sm);
  cursor: pointer;
  transition: all var(--nx-transition-fast);
  position: relative;
}

.nx-checkbox:hover {
  border-color: var(--nx-border-emphasis);
}

.nx-checkbox:checked {
  background: var(--nx-brand-primary);
  border-color: var(--nx-brand-primary);
}

.nx-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Radio */
.nx-radio {
  width: 18px;
  height: 18px;
  appearance: none;
  background: var(--nx-bg-elevated);
  border: 1px solid var(--nx-border-default);
  border-radius: var(--nx-radius-full);
  cursor: pointer;
  transition: all var(--nx-transition-fast);
  position: relative;
}

.nx-radio:checked {
  border-color: var(--nx-brand-primary);
  border-width: 5px;
}

/* Switch/Toggle */
.nx-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--nx-bg-active);
  border-radius: var(--nx-radius-full);
  cursor: pointer;
  transition: background var(--nx-transition-fast);
}

.nx-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: var(--nx-radius-full);
  box-shadow: var(--nx-shadow-sm);
  transition: transform var(--nx-transition-fast);
}

.nx-switch.active,
.nx-switch:checked {
  background: var(--nx-brand-primary);
}

.nx-switch.active::after,
.nx-switch:checked::after {
  transform: translateX(20px);
}

/* Help Text */
.nx-help-text {
  font-size: var(--nx-text-xs);
  color: var(--nx-text-muted);
  margin-top: var(--nx-space-1);
}

.nx-error-text {
  font-size: var(--nx-text-xs);
  color: var(--nx-error);
  margin-top: var(--nx-space-1);
}

/* ===== CARDS ===== */

.nx-card {
  background: var(--nx-bg-elevated);
  border: 1px solid var(--nx-border-subtle);
  border-radius: var(--nx-radius-lg);
  overflow: hidden;
  transition: all var(--nx-transition-normal);
}

.nx-card:hover {
  border-color: var(--nx-border-default);
  box-shadow: var(--nx-shadow-md);
}

.nx-card-header {
  padding: var(--nx-space-4) var(--nx-space-5);
  background: var(--nx-surface-2);
  border-bottom: 1px solid var(--nx-border-subtle);
}

.nx-card-title {
  font-size: var(--nx-text-md);
  font-weight: var(--nx-font-semibold);
  color: var(--nx-text-primary);
  margin: 0;
}

.nx-card-subtitle {
  font-size: var(--nx-text-sm);
  color: var(--nx-text-secondary);
  margin-top: var(--nx-space-1);
}

.nx-card-body {
  padding: var(--nx-space-5);
}

.nx-card-footer {
  padding: var(--nx-space-4) var(--nx-space-5);
  background: var(--nx-surface-2);
  border-top: 1px solid var(--nx-border-subtle);
}

/* Card Variants */
.nx-card-elevated {
  box-shadow: var(--nx-shadow-lg);
  border: none;
}

.nx-card-interactive {
  cursor: pointer;
}

.nx-card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--nx-shadow-lg);
}

/* Stat Card */
.nx-stat-card {
  padding: var(--nx-space-5);
  text-align: center;
}

.nx-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--nx-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--nx-space-3);
  font-size: var(--nx-text-xl);
}

.nx-stat-value {
  font-size: var(--nx-text-3xl);
  font-weight: var(--nx-font-bold);
  color: var(--nx-text-primary);
  line-height: var(--nx-leading-none);
  letter-spacing: var(--nx-tracking-tight);
}

.nx-stat-label {
  font-size: var(--nx-text-xs);
  color: var(--nx-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--nx-tracking-wider);
  margin-top: var(--nx-space-1);
}

.nx-stat-change {
  display: inline-flex;
  align-items: center;
  gap: var(--nx-space-1);
  font-size: var(--nx-text-xs);
  font-weight: var(--nx-font-medium);
  padding: var(--nx-space-1) var(--nx-space-2);
  border-radius: var(--nx-radius-full);
  margin-top: var(--nx-space-2);
}

.nx-stat-change.positive {
  background: var(--nx-success-bg);
  color: var(--nx-success);
}

.nx-stat-change.negative {
  background: var(--nx-error-bg);
  color: var(--nx-error);
}

/* ===== BADGES ===== */

.nx-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--nx-space-1);
  padding: var(--nx-space-1) var(--nx-space-2);
  font-size: var(--nx-text-xs);
  font-weight: var(--nx-font-medium);
  border-radius: var(--nx-radius-full);
  line-height: var(--nx-leading-none);
}

/* Badge Colors */
.nx-badge-default {
  background: var(--nx-bg-active);
  color: var(--nx-text-secondary);
}

.nx-badge-primary {
  background: var(--nx-brand-primary-subtle);
  color: var(--nx-brand-primary);
}

.nx-badge-success {
  background: var(--nx-success-bg);
  color: var(--nx-success);
}

.nx-badge-warning {
  background: var(--nx-warning-bg);
  color: var(--nx-warning);
}

.nx-badge-error {
  background: var(--nx-error-bg);
  color: var(--nx-error);
}

.nx-badge-info {
  background: var(--nx-info-bg);
  color: var(--nx-info);
}

/* Badge with Dot */
.nx-badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--nx-radius-full);
  background: currentColor;
}

/* Outline Badges */
.nx-badge-outline {
  background: transparent;
  border: 1px solid currentColor;
}

/* ===== TABLES ===== */

.nx-table-wrapper {
  background: var(--nx-bg-elevated);
  border: 1px solid var(--nx-border-subtle);
  border-radius: var(--nx-radius-lg);
  overflow: hidden;
}

.nx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--nx-text-sm);
}

.nx-table thead {
  background: var(--nx-surface-2);
}

.nx-table th {
  padding: var(--nx-space-3) var(--nx-space-4);
  text-align: left;
  font-size: var(--nx-text-xs);
  font-weight: var(--nx-font-semibold);
  color: var(--nx-text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--nx-tracking-wide);
  border-bottom: 1px solid var(--nx-border-subtle);
}

.nx-table td {
  padding: var(--nx-space-3) var(--nx-space-4);
  color: var(--nx-text-primary);
  border-bottom: 1px solid var(--nx-border-subtle);
}

.nx-table tbody tr {
  transition: background var(--nx-transition-fast);
}

.nx-table tbody tr:hover {
  background: var(--nx-bg-hover);
}

.nx-table tbody tr:last-child td {
  border-bottom: none;
}

/* Sortable */
.nx-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.nx-table th.sortable:hover {
  color: var(--nx-text-primary);
}

/* Striped */
.nx-table-striped tbody tr:nth-child(even) {
  background: var(--nx-surface-2);
}

/* Compact */
.nx-table-compact th,
.nx-table-compact td {
  padding: var(--nx-space-2) var(--nx-space-3);
}

/* ===== ALERTS ===== */

.nx-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--nx-space-3);
  padding: var(--nx-space-4);
  border-radius: var(--nx-radius-lg);
  border: 1px solid;
}

.nx-alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.nx-alert-content {
  flex: 1;
}

.nx-alert-title {
  font-weight: var(--nx-font-semibold);
  margin-bottom: var(--nx-space-1);
}

.nx-alert-message {
  font-size: var(--nx-text-sm);
  color: inherit;
  opacity: 0.9;
}

.nx-alert-close {
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--nx-transition-fast);
}

.nx-alert-close:hover {
  opacity: 1;
}

/* Alert Variants */
.nx-alert-info {
  background: var(--nx-info-bg);
  border-color: var(--nx-info-border);
  color: var(--nx-info);
}

.nx-alert-success {
  background: var(--nx-success-bg);
  border-color: var(--nx-success-border);
  color: var(--nx-success);
}

.nx-alert-warning {
  background: var(--nx-warning-bg);
  border-color: var(--nx-warning-border);
  color: var(--nx-warning);
}

.nx-alert-error {
  background: var(--nx-error-bg);
  border-color: var(--nx-error-border);
  color: var(--nx-error);
}

/* ===== TABS ===== */

.nx-tabs {
  border-bottom: 1px solid var(--nx-border-subtle);
}

.nx-tabs-list {
  display: flex;
  gap: var(--nx-space-1);
  padding: 0 var(--nx-space-2);
}

.nx-tab {
  padding: var(--nx-space-3) var(--nx-space-4);
  font-size: var(--nx-text-sm);
  font-weight: var(--nx-font-medium);
  color: var(--nx-text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: color var(--nx-transition-fast);
}

.nx-tab:hover {
  color: var(--nx-text-primary);
}

.nx-tab.active {
  color: var(--nx-text-primary);
}

.nx-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--nx-brand-primary);
  border-radius: var(--nx-radius-full) var(--nx-radius-full) 0 0;
}

/* Pill Tabs */
.nx-tabs-pills .nx-tabs-list {
  border: none;
  background: var(--nx-bg-muted);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-space-1);
  gap: var(--nx-space-1);
}

.nx-tabs-pills .nx-tab {
  border-radius: var(--nx-radius-md);
  padding: var(--nx-space-2) var(--nx-space-4);
}

.nx-tabs-pills .nx-tab.active {
  background: var(--nx-bg-elevated);
  box-shadow: var(--nx-shadow-sm);
}

.nx-tabs-pills .nx-tab.active::after {
  display: none;
}

/* Tab Content */
.nx-tab-content {
  padding: var(--nx-space-5);
}

.nx-tab-panel {
  display: none;
}

.nx-tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ===== MODALS ===== */

.nx-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--nx-bg-overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--nx-z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: all var(--nx-transition-normal);
}

.nx-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.nx-modal {
  background: var(--nx-bg-elevated);
  border: 1px solid var(--nx-border-subtle);
  border-radius: var(--nx-radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--nx-shadow-2xl);
  transform: scale(0.95) translateY(20px);
  transition: transform var(--nx-transition-normal);
}

.nx-modal-overlay.active .nx-modal {
  transform: scale(1) translateY(0);
}

.nx-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--nx-space-5);
  border-bottom: 1px solid var(--nx-border-subtle);
}

.nx-modal-title {
  font-size: var(--nx-text-lg);
  font-weight: var(--nx-font-semibold);
  color: var(--nx-text-primary);
}

.nx-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--nx-radius-md);
  color: var(--nx-text-secondary);
  cursor: pointer;
  transition: all var(--nx-transition-fast);
}

.nx-modal-close:hover {
  background: var(--nx-bg-hover);
  color: var(--nx-text-primary);
}

.nx-modal-body {
  padding: var(--nx-space-5);
  overflow-y: auto;
}

.nx-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--nx-space-3);
  padding: var(--nx-space-4) var(--nx-space-5);
  background: var(--nx-surface-2);
  border-top: 1px solid var(--nx-border-subtle);
}

/* Modal Sizes */
.nx-modal-sm {
  max-width: 400px;
}

.nx-modal-lg {
  max-width: 700px;
}

.nx-modal-xl {
  max-width: 900px;
}

.nx-modal-full {
  max-width: 95vw;
  height: 90vh;
}

/* ===== TOOLTIPS ===== */

.nx-tooltip {
  position: relative;
  display: inline-block;
}

.nx-tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: var(--nx-space-2) var(--nx-space-3);
  background: var(--nx-bg-active);
  color: var(--nx-text-primary);
  font-size: var(--nx-text-xs);
  border-radius: var(--nx-radius-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--nx-transition-fast);
  z-index: var(--nx-z-tooltip);
  box-shadow: var(--nx-shadow-lg);
}

.nx-tooltip:hover .nx-tooltip-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* ===== DROPDOWN ===== */

.nx-dropdown {
  position: relative;
  display: inline-block;
}

.nx-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  padding: var(--nx-space-2);
  background: var(--nx-bg-elevated);
  border: 1px solid var(--nx-border-subtle);
  border-radius: var(--nx-radius-lg);
  box-shadow: var(--nx-shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--nx-transition-fast);
  z-index: var(--nx-z-dropdown);
}

.nx-dropdown.active .nx-dropdown-menu,
.nx-dropdown:focus-within .nx-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.nx-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--nx-space-2);
  padding: var(--nx-space-2) var(--nx-space-3);
  font-size: var(--nx-text-sm);
  color: var(--nx-text-secondary);
  border-radius: var(--nx-radius-md);
  cursor: pointer;
  transition: all var(--nx-transition-fast);
}

.nx-dropdown-item:hover {
  background: var(--nx-bg-hover);
  color: var(--nx-text-primary);
}

.nx-dropdown-divider {
  height: 1px;
  background: var(--nx-border-subtle);
  margin: var(--nx-space-2) 0;
}

/* ===== PROGRESS ===== */

.nx-progress {
  height: 8px;
  background: var(--nx-bg-active);
  border-radius: var(--nx-radius-full);
  overflow: hidden;
}

.nx-progress-bar {
  height: 100%;
  background: var(--nx-gradient-primary);
  border-radius: var(--nx-radius-full);
  transition: width var(--nx-transition-slow);
}

.nx-progress-sm {
  height: 4px;
}

.nx-progress-lg {
  height: 12px;
}

/* ===== AVATAR ===== */

.nx-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--nx-radius-full);
  overflow: hidden;
  background: var(--nx-gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--nx-font-semibold);
  font-size: var(--nx-text-sm);
}

.nx-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nx-avatar-xs { width: 24px; height: 24px; font-size: var(--nx-text-xs); }
.nx-avatar-sm { width: 32px; height: 32px; font-size: var(--nx-text-xs); }
.nx-avatar-lg { width: 56px; height: 56px; font-size: var(--nx-text-lg); }
.nx-avatar-xl { width: 80px; height: 80px; font-size: var(--nx-text-2xl); }

/* Avatar Group */
.nx-avatar-group {
  display: flex;
}

.nx-avatar-group .nx-avatar {
  border: 2px solid var(--nx-bg-base);
  margin-left: -12px;
}

.nx-avatar-group .nx-avatar:first-child {
  margin-left: 0;
}

/* Avatar with Status */
.nx-avatar-wrapper {
  position: relative;
  display: inline-block;
}

.nx-avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: var(--nx-radius-full);
  border: 2px solid var(--nx-bg-base);
}

.nx-avatar-status.online { background: var(--nx-success); }
.nx-avatar-status.offline { background: var(--nx-text-muted); }
.nx-avatar-status.busy { background: var(--nx-error); }
.nx-avatar-status.away { background: var(--nx-warning); }

/* ===== LOADING / SPINNERS ===== */

.nx-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--nx-border-default);
  border-top-color: var(--nx-brand-primary);
  border-radius: var(--nx-radius-full);
  animation: nx-spin 0.8s linear infinite;
}

.nx-spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.nx-spinner-lg { width: 40px; height: 40px; border-width: 3px; }

@keyframes nx-spin {
  to { transform: rotate(360deg); }
}

/* Skeleton Loading */
.nx-skeleton {
  background: linear-gradient(
    90deg,
    var(--nx-bg-muted) 0%,
    var(--nx-bg-hover) 50%,
    var(--nx-bg-muted) 100%
  );
  background-size: 200% 100%;
  animation: nx-skeleton 1.5s ease infinite;
  border-radius: var(--nx-radius-md);
}

@keyframes nx-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.nx-skeleton-text {
  height: 14px;
  margin-bottom: var(--nx-space-2);
}

.nx-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--nx-radius-full);
}

.nx-skeleton-card {
  height: 200px;
}

/* ===== DIVIDERS ===== */

.nx-divider {
  height: 1px;
  background: var(--nx-border-subtle);
  margin: var(--nx-space-4) 0;
}

.nx-divider-vertical {
  width: 1px;
  height: 100%;
  background: var(--nx-border-subtle);
}

.nx-divider-text {
  display: flex;
  align-items: center;
  gap: var(--nx-space-4);
  color: var(--nx-text-muted);
  font-size: var(--nx-text-xs);
  text-transform: uppercase;
  letter-spacing: var(--nx-tracking-wide);
}

.nx-divider-text::before,
.nx-divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--nx-border-subtle);
}

/* ===== NAVIGATION ===== */

.nx-nav {
  display: flex;
  gap: var(--nx-space-1);
}

.nx-nav-item {
  padding: var(--nx-space-2) var(--nx-space-3);
  font-size: var(--nx-text-sm);
  font-weight: var(--nx-font-medium);
  color: var(--nx-text-secondary);
  border-radius: var(--nx-radius-md);
  transition: all var(--nx-transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.nx-nav-item:hover {
  background: var(--nx-bg-hover);
  color: var(--nx-text-primary);
}

.nx-nav-item.active {
  background: var(--nx-brand-primary-subtle);
  color: var(--nx-brand-primary);
}

/* Vertical Navigation */
.nx-nav-vertical {
  flex-direction: column;
}

.nx-nav-vertical .nx-nav-item {
  display: flex;
  align-items: center;
  gap: var(--nx-space-3);
}

/* Breadcrumb */
.nx-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--nx-space-2);
  font-size: var(--nx-text-sm);
}

.nx-breadcrumb-item {
  color: var(--nx-text-secondary);
  text-decoration: none;
  transition: color var(--nx-transition-fast);
}

.nx-breadcrumb-item:hover {
  color: var(--nx-text-primary);
}

.nx-breadcrumb-item.active {
  color: var(--nx-text-primary);
}

.nx-breadcrumb-separator {
  color: var(--nx-text-muted);
}

/* ===== TIMELINE ===== */

.nx-timeline {
  position: relative;
  padding-left: var(--nx-space-8);
}

.nx-timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--nx-border-subtle);
}

.nx-timeline-item {
  position: relative;
  padding-bottom: var(--nx-space-6);
}

.nx-timeline-item:last-child {
  padding-bottom: 0;
}

.nx-timeline-marker {
  position: absolute;
  left: calc(-1 * var(--nx-space-8) + 4px);
  width: 16px;
  height: 16px;
  background: var(--nx-bg-elevated);
  border: 2px solid var(--nx-border-emphasis);
  border-radius: var(--nx-radius-full);
}

.nx-timeline-marker.active {
  background: var(--nx-brand-primary);
  border-color: var(--nx-brand-primary);
}

.nx-timeline-content {
  background: var(--nx-bg-elevated);
  border: 1px solid var(--nx-border-subtle);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-space-4);
}

/* ===== TOAST/NOTIFICATION ===== */

.nx-toast-container {
  position: fixed;
  bottom: var(--nx-space-6);
  right: var(--nx-space-6);
  display: flex;
  flex-direction: column;
  gap: var(--nx-space-3);
  z-index: var(--nx-z-toast);
}

.nx-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--nx-space-3);
  min-width: 300px;
  max-width: 450px;
  padding: var(--nx-space-4);
  background: var(--nx-bg-elevated);
  border: 1px solid var(--nx-border-subtle);
  border-radius: var(--nx-radius-lg);
  box-shadow: var(--nx-shadow-xl);
  animation: nx-toast-in 0.3s ease;
}

@keyframes nx-toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nx-toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.nx-toast-content {
  flex: 1;
}

.nx-toast-title {
  font-weight: var(--nx-font-semibold);
  color: var(--nx-text-primary);
  margin-bottom: var(--nx-space-1);
}

.nx-toast-message {
  font-size: var(--nx-text-sm);
  color: var(--nx-text-secondary);
}

/* Toast Variants */
.nx-toast-success { border-left: 3px solid var(--nx-success); }
.nx-toast-warning { border-left: 3px solid var(--nx-warning); }
.nx-toast-error { border-left: 3px solid var(--nx-error); }
.nx-toast-info { border-left: 3px solid var(--nx-info); }

/* ===== LIST ===== */

.nx-list {
  display: flex;
  flex-direction: column;
  gap: var(--nx-space-1);
}

.nx-list-item {
  display: flex;
  align-items: center;
  gap: var(--nx-space-3);
  padding: var(--nx-space-3) var(--nx-space-4);
  background: var(--nx-bg-elevated);
  border: 1px solid var(--nx-border-subtle);
  border-radius: var(--nx-radius-md);
  transition: all var(--nx-transition-fast);
}

.nx-list-item:hover {
  background: var(--nx-bg-hover);
  border-color: var(--nx-border-default);
}

.nx-list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--nx-radius-md);
  background: var(--nx-bg-active);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nx-text-secondary);
}

.nx-list-item-content {
  flex: 1;
  min-width: 0;
}

.nx-list-item-title {
  font-weight: var(--nx-font-medium);
  color: var(--nx-text-primary);
}

.nx-list-item-subtitle {
  font-size: var(--nx-text-sm);
  color: var(--nx-text-secondary);
  margin-top: var(--nx-space-1);
}

/* ===== EMPTY STATE ===== */

.nx-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--nx-space-12);
  text-align: center;
}

.nx-empty-state-icon {
  width: 64px;
  height: 64px;
  color: var(--nx-text-muted);
  margin-bottom: var(--nx-space-4);
  opacity: 0.5;
}

.nx-empty-state-title {
  font-size: var(--nx-text-lg);
  font-weight: var(--nx-font-semibold);
  color: var(--nx-text-primary);
  margin-bottom: var(--nx-space-2);
}

.nx-empty-state-description {
  font-size: var(--nx-text-sm);
  color: var(--nx-text-secondary);
  max-width: 400px;
  margin-bottom: var(--nx-space-6);
}

/* ===== ANIMATIONS ===== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.nx-animate-fade-in { animation: fadeIn 0.3s ease; }
.nx-animate-fade-in-up { animation: fadeInUp 0.3s ease; }
.nx-animate-fade-in-down { animation: fadeInDown 0.3s ease; }
.nx-animate-slide-in-right { animation: slideInRight 0.3s ease; }
.nx-animate-pulse { animation: pulse 2s ease infinite; }
.nx-animate-bounce { animation: bounce 1s ease infinite; }

/* ===== UTILITIES ===== */

/* Display */
.nx-hidden { display: none !important; }
.nx-block { display: block; }
.nx-inline-block { display: inline-block; }
.nx-flex { display: flex; }
.nx-inline-flex { display: inline-flex; }
.nx-grid { display: grid; }

/* Flex */
.nx-flex-row { flex-direction: row; }
.nx-flex-col { flex-direction: column; }
.nx-flex-wrap { flex-wrap: wrap; }
.nx-flex-1 { flex: 1; }
.nx-flex-shrink-0 { flex-shrink: 0; }
.nx-items-start { align-items: flex-start; }
.nx-items-center { align-items: center; }
.nx-items-end { align-items: flex-end; }
.nx-justify-start { justify-content: flex-start; }
.nx-justify-center { justify-content: center; }
.nx-justify-end { justify-content: flex-end; }
.nx-justify-between { justify-content: space-between; }
.nx-gap-1 { gap: var(--nx-space-1); }
.nx-gap-2 { gap: var(--nx-space-2); }
.nx-gap-3 { gap: var(--nx-space-3); }
.nx-gap-4 { gap: var(--nx-space-4); }
.nx-gap-6 { gap: var(--nx-space-6); }
.nx-gap-8 { gap: var(--nx-space-8); }

/* Spacing */
.nx-m-0 { margin: 0; }
.nx-m-1 { margin: var(--nx-space-1); }
.nx-m-2 { margin: var(--nx-space-2); }
.nx-m-3 { margin: var(--nx-space-3); }
.nx-m-4 { margin: var(--nx-space-4); }
.nx-mt-0 { margin-top: 0; }
.nx-mt-2 { margin-top: var(--nx-space-2); }
.nx-mt-4 { margin-top: var(--nx-space-4); }
.nx-mt-6 { margin-top: var(--nx-space-6); }
.nx-mb-2 { margin-bottom: var(--nx-space-2); }
.nx-mb-4 { margin-bottom: var(--nx-space-4); }
.nx-mb-6 { margin-bottom: var(--nx-space-6); }

.nx-p-0 { padding: 0; }
.nx-p-1 { padding: var(--nx-space-1); }
.nx-p-2 { padding: var(--nx-space-2); }
.nx-p-3 { padding: var(--nx-space-3); }
.nx-p-4 { padding: var(--nx-space-4); }
.nx-p-5 { padding: var(--nx-space-5); }
.nx-p-6 { padding: var(--nx-space-6); }

/* Border Radius */
.nx-rounded-none { border-radius: 0; }
.nx-rounded-sm { border-radius: var(--nx-radius-sm); }
.nx-rounded { border-radius: var(--nx-radius-md); }
.nx-rounded-lg { border-radius: var(--nx-radius-lg); }
.nx-rounded-xl { border-radius: var(--nx-radius-xl); }
.nx-rounded-full { border-radius: var(--nx-radius-full); }

/* Text */
.nx-text-left { text-align: left; }
.nx-text-center { text-align: center; }
.nx-text-right { text-align: right; }
.nx-font-normal { font-weight: var(--nx-font-normal); }
.nx-font-medium { font-weight: var(--nx-font-medium); }
.nx-font-semibold { font-weight: var(--nx-font-semibold); }
.nx-font-bold { font-weight: var(--nx-font-bold); }
.nx-uppercase { text-transform: uppercase; }
.nx-lowercase { text-transform: lowercase; }
.nx-capitalize { text-transform: capitalize; }
.nx-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Colors */
.nx-text-primary { color: var(--nx-text-primary); }
.nx-text-secondary { color: var(--nx-text-secondary); }
.nx-text-muted { color: var(--nx-text-muted); }
.nx-text-success { color: var(--nx-success); }
.nx-text-warning { color: var(--nx-warning); }
.nx-text-error { color: var(--nx-error); }
.nx-text-info { color: var(--nx-info); }

/* Backgrounds */
.nx-bg-base { background-color: var(--nx-bg-base); }
.nx-bg-elevated { background-color: var(--nx-bg-elevated); }
.nx-bg-muted { background-color: var(--nx-bg-muted); }
.nx-bg-success { background-color: var(--nx-success-bg); }
.nx-bg-warning { background-color: var(--nx-warning-bg); }
.nx-bg-error { background-color: var(--nx-error-bg); }

/* Width/Height */
.nx-w-full { width: 100%; }
.nx-h-full { height: 100%; }
.nx-min-h-screen { min-height: 100vh; }

/* Cursor */
.nx-cursor-pointer { cursor: pointer; }
.nx-cursor-not-allowed { cursor: not-allowed; }

/* Visibility */
.nx-opacity-0 { opacity: 0; }
.nx-opacity-50 { opacity: 0.5; }
.nx-opacity-100 { opacity: 1; }

/* Transition */
.nx-transition { transition: all var(--nx-transition-normal); }
.nx-transition-fast { transition: all var(--nx-transition-fast); }
.nx-transition-slow { transition: all var(--nx-transition-slow); }

/* Shadow */
.nx-shadow-sm { box-shadow: var(--nx-shadow-sm); }
.nx-shadow { box-shadow: var(--nx-shadow-md); }
.nx-shadow-lg { box-shadow: var(--nx-shadow-lg); }
.nx-shadow-none { box-shadow: none; }

/* ===== CODE BLOCK ===== */

.nx-code {
  font-family: var(--nx-font-mono);
  font-size: var(--nx-text-sm);
  padding: var(--nx-space-1) var(--nx-space-2);
  background: var(--nx-bg-muted);
  border-radius: var(--nx-radius-sm);
  color: var(--nx-accent-pink);
}

.nx-code-block {
  font-family: var(--nx-font-mono);
  font-size: var(--nx-text-sm);
  padding: var(--nx-space-4);
  background: var(--nx-surface-1);
  border: 1px solid var(--nx-border-subtle);
  border-radius: var(--nx-radius-lg);
  overflow-x: auto;
  line-height: var(--nx-leading-relaxed);
}

/* ===== USER COMPONENTS ===== */
/* Standardized user display with custom profile colors */

/* --- User Chip (Compact inline display) --- */
.nx-user-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--nx-space-2);
  padding: var(--nx-space-1) var(--nx-space-3) var(--nx-space-1) var(--nx-space-1);
  background: var(--nx-bg-elevated);
  border: 1px solid var(--nx-border-subtle);
  border-radius: var(--nx-radius-full);
  text-decoration: none;
  transition: all var(--nx-transition-fast);
  cursor: pointer;
}

.nx-user-chip:hover {
  background: var(--nx-bg-hover);
  border-color: var(--nx-border-default);
  transform: translateY(-1px);
}

.nx-user-chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--nx-radius-full);
  object-fit: cover;
  border: 2px solid var(--nx-border-default);
  flex-shrink: 0;
  transition: border-color var(--nx-transition-fast);
}

/* Avatar border uses custom color via style attribute */
.nx-user-chip:hover .nx-user-chip-avatar {
  box-shadow: var(--nx-shadow-sm);
}

.nx-user-chip-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.nx-user-chip-username {
  font-size: var(--nx-text-sm);
  font-weight: var(--nx-font-semibold);
  transition: color var(--nx-transition-fast);
}

/* Username uses custom color via style attribute */

.nx-user-chip-name {
  font-size: var(--nx-text-xs);
  color: var(--nx-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chip Sizes */
.nx-user-chip-sm {
  padding: 2px var(--nx-space-2) 2px 2px;
  gap: var(--nx-space-1);
}

.nx-user-chip-sm .nx-user-chip-avatar {
  width: 22px;
  height: 22px;
}

.nx-user-chip-sm .nx-user-chip-username {
  font-size: var(--nx-text-xs);
}

.nx-user-chip-lg {
  padding: var(--nx-space-2) var(--nx-space-4) var(--nx-space-2) var(--nx-space-2);
  gap: var(--nx-space-3);
}

.nx-user-chip-lg .nx-user-chip-avatar {
  width: 36px;
  height: 36px;
}

.nx-user-chip-lg .nx-user-chip-username {
  font-size: var(--nx-text-base);
}

/* --- User Inline (Row display for tables/lists) --- */
.nx-user-inline {
  display: flex;
  align-items: center;
  gap: var(--nx-space-3);
  text-decoration: none;
  transition: all var(--nx-transition-fast);
}

.nx-user-inline:hover {
  opacity: 0.9;
}

.nx-user-inline-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--nx-radius-full);
  object-fit: cover;
  border: 2.5px solid var(--nx-border-default);
  box-shadow: var(--nx-shadow-xs);
  flex-shrink: 0;
  transition: all var(--nx-transition-fast);
}

.nx-user-inline:hover .nx-user-inline-avatar {
  box-shadow: var(--nx-shadow-sm);
  transform: scale(1.05);
}

.nx-user-inline-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nx-user-inline-username {
  font-size: var(--nx-text-sm);
  font-weight: var(--nx-font-semibold);
  line-height: 1;
  transition: color var(--nx-transition-fast);
}

.nx-user-inline-fullname {
  font-size: var(--nx-text-xs);
  color: var(--nx-text-muted);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inline Sizes */
.nx-user-inline-sm .nx-user-inline-avatar {
  width: 28px;
  height: 28px;
  border-width: 2px;
}

.nx-user-inline-sm .nx-user-inline-username {
  font-size: var(--nx-text-xs);
}

.nx-user-inline-lg .nx-user-inline-avatar {
  width: 44px;
  height: 44px;
  border-width: 3px;
}

.nx-user-inline-lg .nx-user-inline-username {
  font-size: var(--nx-text-base);
}

/* --- User Card (Full card display) --- */
.nx-user-card {
  background: var(--nx-bg-elevated);
  border: 1px solid var(--nx-border-subtle);
  border-radius: var(--nx-radius-xl);
  overflow: hidden;
  transition: all var(--nx-transition-normal);
  cursor: pointer;
  position: relative;
}

.nx-user-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--nx-shadow-lg);
  border-color: var(--nx-border-default);
}

.nx-user-card-header {
  position: relative;
  padding: var(--nx-space-6) var(--nx-space-5) var(--nx-space-4);
  text-align: center;
  overflow: hidden;
}

/* Gradient background using user's color */
.nx-user-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  opacity: 0.2;
  transition: opacity var(--nx-transition-normal);
}

.nx-user-card:hover .nx-user-card-bg {
  opacity: 0.35;
}

.nx-user-card-avatar {
  position: relative;
  display: inline-block;
  margin-bottom: var(--nx-space-3);
  z-index: 1;
}

.nx-user-card-avatar img {
  width: 80px;
  height: 80px;
  border-radius: var(--nx-radius-full);
  object-fit: cover;
  border: 4px solid var(--nx-bg-elevated);
  box-shadow: var(--nx-shadow-md);
  transition: all var(--nx-transition-normal);
}

.nx-user-card:hover .nx-user-card-avatar img {
  transform: scale(1.05);
}

/* Color indicator dot */
.nx-user-card-color {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: var(--nx-radius-full);
  border: 3px solid var(--nx-bg-elevated);
  box-shadow: var(--nx-shadow-sm);
}

.nx-user-card-body {
  padding: 0 var(--nx-space-5) var(--nx-space-4);
  text-align: center;
}

.nx-user-card-name {
  font-size: var(--nx-text-lg);
  font-weight: var(--nx-font-bold);
  color: var(--nx-text-primary);
  margin-bottom: var(--nx-space-1);
  transition: color var(--nx-transition-fast);
}

.nx-user-card:hover .nx-user-card-name {
  /* Color changes to user's color on hover */
}

.nx-user-card-username {
  font-size: var(--nx-text-sm);
  font-weight: var(--nx-font-medium);
  margin-bottom: var(--nx-space-3);
  transition: color var(--nx-transition-fast);
}

/* Role badge */
.nx-user-card-role {
  display: inline-flex;
  align-items: center;
  gap: var(--nx-space-1);
  padding: var(--nx-space-1) var(--nx-space-3);
  border-radius: var(--nx-radius-full);
  font-size: var(--nx-text-xs);
  font-weight: var(--nx-font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--nx-tracking-wide);
}

/* Default role styling - background uses user color with alpha */
.nx-user-card-role-default {
  background: var(--nx-bg-muted);
  color: var(--nx-text-secondary);
}

.nx-user-card-footer {
  padding: var(--nx-space-3) var(--nx-space-5);
  background: var(--nx-surface-2);
  border-top: 1px solid var(--nx-border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nx-user-card-stat {
  display: flex;
  align-items: center;
  gap: var(--nx-space-1);
  font-size: var(--nx-text-xs);
  color: var(--nx-text-muted);
}

.nx-user-card-stat i {
  font-size: 0.875rem;
}

.nx-user-card-action {
  font-size: var(--nx-text-xs);
  color: var(--nx-text-muted);
  display: flex;
  align-items: center;
  gap: var(--nx-space-1);
  opacity: 0;
  transition: all var(--nx-transition-fast);
}

.nx-user-card:hover .nx-user-card-action {
  opacity: 1;
}

/* --- User Badge (Floating badge style) --- */
.nx-user-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--nx-space-3);
  padding: var(--nx-space-2) var(--nx-space-4) var(--nx-space-2) var(--nx-space-2);
  background: var(--nx-bg-elevated);
  backdrop-filter: blur(12px);
  border: 1px solid var(--nx-border-default);
  border-radius: var(--nx-radius-full);
  box-shadow: var(--nx-shadow-md);
  transition: all var(--nx-transition-fast);
}

.nx-user-badge:hover {
  box-shadow: var(--nx-shadow-lg);
  transform: translateY(-2px);
}

.nx-user-badge-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--nx-radius-full);
  object-fit: cover;
  border: 2.5px solid var(--nx-border-default);
  box-shadow: var(--nx-shadow-sm);
}

.nx-user-badge-content {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.nx-user-badge-username {
  font-size: var(--nx-text-sm);
  font-weight: var(--nx-font-bold);
}

.nx-user-badge-name {
  font-size: var(--nx-text-xs);
  color: var(--nx-text-secondary);
}

/* --- User Avatar Group with Colors --- */
.nx-user-stack {
  display: flex;
  align-items: center;
}

.nx-user-stack .nx-user-stack-item {
  margin-left: -10px;
  position: relative;
  transition: all var(--nx-transition-fast);
}

.nx-user-stack .nx-user-stack-item:first-child {
  margin-left: 0;
}

.nx-user-stack .nx-user-stack-item:hover {
  z-index: 10;
  transform: translateY(-2px);
}

.nx-user-stack-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--nx-radius-full);
  object-fit: cover;
  border: 2px solid var(--nx-bg-base);
  box-shadow: var(--nx-shadow-xs);
}

.nx-user-stack-more {
  width: 32px;
  height: 32px;
  border-radius: var(--nx-radius-full);
  background: var(--nx-bg-active);
  border: 2px solid var(--nx-bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--nx-text-xs);
  font-weight: var(--nx-font-semibold);
  color: var(--nx-text-secondary);
}

/* --- User Select Option (for dropdowns/selects) --- */
.nx-user-option {
  display: flex;
  align-items: center;
  gap: var(--nx-space-3);
  padding: var(--nx-space-2) var(--nx-space-3);
  border-radius: var(--nx-radius-md);
  cursor: pointer;
  transition: all var(--nx-transition-fast);
}

.nx-user-option:hover {
  background: var(--nx-bg-hover);
}

.nx-user-option.selected {
  background: var(--nx-brand-primary-subtle);
}

.nx-user-option-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--nx-radius-full);
  object-fit: cover;
  border: 2px solid var(--nx-border-default);
  flex-shrink: 0;
}

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

.nx-user-option-name {
  font-size: var(--nx-text-sm);
  font-weight: var(--nx-font-medium);
  color: var(--nx-text-primary);
}

.nx-user-option-meta {
  font-size: var(--nx-text-xs);
  color: var(--nx-text-muted);
}

.nx-user-option-check {
  color: var(--nx-brand-primary);
  opacity: 0;
  transition: opacity var(--nx-transition-fast);
}

.nx-user-option.selected .nx-user-option-check {
  opacity: 1;
}

/* --- Profile Header (Large display for profile pages) --- */
.nx-profile-header {
  position: relative;
  padding: var(--nx-space-8) var(--nx-space-6);
  text-align: center;
  border-radius: var(--nx-radius-xl);
  overflow: hidden;
  background: var(--nx-bg-elevated);
  border: 1px solid var(--nx-border-subtle);
}

.nx-profile-header-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  opacity: 0.25;
}

.nx-profile-header-content {
  position: relative;
  z-index: 1;
}

.nx-profile-header-avatar {
  width: 120px;
  height: 120px;
  border-radius: var(--nx-radius-full);
  object-fit: cover;
  border: 5px solid var(--nx-bg-elevated);
  box-shadow: var(--nx-shadow-lg);
  margin-bottom: var(--nx-space-4);
}

.nx-profile-header-name {
  font-size: var(--nx-text-2xl);
  font-weight: var(--nx-font-bold);
  color: var(--nx-text-primary);
  margin-bottom: var(--nx-space-1);
}

.nx-profile-header-username {
  font-size: var(--nx-text-lg);
  font-weight: var(--nx-font-semibold);
  margin-bottom: var(--nx-space-3);
}

.nx-profile-header-role {
  display: inline-flex;
  align-items: center;
  gap: var(--nx-space-2);
  padding: var(--nx-space-2) var(--nx-space-4);
  border-radius: var(--nx-radius-full);
  font-size: var(--nx-text-sm);
  font-weight: var(--nx-font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--nx-tracking-wide);
}

/* ===== KEYBOARD SHORTCUTS ===== */

.nx-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 var(--nx-space-2);
  font-family: var(--nx-font-mono);
  font-size: var(--nx-text-xs);
  font-weight: var(--nx-font-medium);
  color: var(--nx-text-secondary);
  background: var(--nx-bg-muted);
  border: 1px solid var(--nx-border-default);
  border-radius: var(--nx-radius-sm);
  box-shadow: 0 1px 0 var(--nx-border-emphasis);
}

/* ===== SCROLLBAR ===== */

.nx-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.nx-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.nx-scrollbar::-webkit-scrollbar-thumb {
  background: var(--nx-border-default);
  border-radius: var(--nx-radius-full);
}

.nx-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--nx-border-emphasis);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
  :root {
    --nx-text-base: 0.8125rem;
    --nx-text-lg: 1rem;
    --nx-text-xl: 1.125rem;
    --nx-text-2xl: 1.25rem;
    --nx-text-3xl: 1.5rem;
    --nx-text-4xl: 1.875rem;
  }

  .nx-hide-mobile { display: none !important; }
  .nx-show-mobile { display: block !important; }
}

@media (min-width: 769px) {
  .nx-hide-desktop { display: none !important; }
  .nx-show-desktop { display: block !important; }
}
