/* ============================================================
   NexaStore Design System
   Manrope font + custom Bootstrap 5 overrides + dark mode
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  /* Brand */
  --ns-primary: #6366f1;
  --ns-primary-hover: #4f46e5;
  --ns-primary-light: #eef2ff;
  --ns-secondary: #8b5cf6;
  --ns-accent: #f59e0b;

  /* Semantic */
  --ns-success: #10b981;
  --ns-success-light: #ecfdf5;
  --ns-warning: #f59e0b;
  --ns-warning-light: #fffbeb;
  --ns-danger: #ef4444;
  --ns-danger-light: #fef2f2;
  --ns-info: #3b82f6;
  --ns-info-light: #eff6ff;

  /* Neutrals */
  --ns-white: #ffffff;
  --ns-gray-50: #f9fafb;
  --ns-gray-100: #f3f4f6;
  --ns-gray-200: #e5e7eb;
  --ns-gray-300: #d1d5db;
  --ns-gray-400: #9ca3af;
  --ns-gray-500: #6b7280;
  --ns-gray-600: #4b5563;
  --ns-gray-700: #374151;
  --ns-gray-800: #1f2937;
  --ns-gray-900: #111827;

  /* Surface (light mode) */
  --ns-bg: #f8f9fc;
  --ns-surface: #ffffff;
  --ns-surface-raised: #ffffff;
  --ns-border: #e5e7eb;
  --ns-border-subtle: #f3f4f6;

  /* Text (light mode) */
  --ns-text-primary: #111827;
  --ns-text-secondary: #6b7280;
  --ns-text-tertiary: #9ca3af;
  --ns-text-inverse: #ffffff;

  /* Layout */
  --ns-sidebar-width: 260px;
  --ns-sidebar-collapsed: 72px;
  --ns-topbar-height: 64px;

  /* Radius */
  --ns-radius-xs: 4px;
  --ns-radius-sm: 8px;
  --ns-radius-md: 12px;
  --ns-radius-lg: 16px;
  --ns-radius-xl: 24px;
  --ns-radius-full: 9999px;

  /* Shadows */
  --ns-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, .05);
  --ns-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .08), 0 1px 2px -1px rgba(0, 0, 0, .06);
  --ns-shadow-md: 0 4px 12px -2px rgba(0, 0, 0, .08), 0 2px 4px -2px rgba(0, 0, 0, .05);
  --ns-shadow-lg: 0 10px 24px -4px rgba(0, 0, 0, .10), 0 4px 8px -4px rgba(0, 0, 0, .06);
  --ns-shadow-xl: 0 20px 40px -8px rgba(0, 0, 0, .12), 0 8px 16px -8px rgba(0, 0, 0, .06);

  /* Transitions */
  --ns-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ns-fast: 150ms;
  --ns-normal: 200ms;
  --ns-slow: 300ms;
  --ns-transition: var(--ns-normal) var(--ns-ease);

  /* Typography */
  --ns-font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ns-font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ── Dark Mode Variables ────────────────────────────────────── */
[data-theme="dark"] {
  --ns-bg: #0f1117;
  --ns-surface: #1a1d27;
  --ns-surface-raised: #21253a;
  --ns-border: #2d3148;
  --ns-border-subtle: #1e2235;

  --ns-text-primary: #f1f5f9;
  --ns-text-secondary: #94a3b8;
  --ns-text-tertiary: #64748b;
  --ns-text-inverse: #0f1117;

  --ns-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, .3);
  --ns-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .3), 0 1px 2px -1px rgba(0, 0, 0, .2);
  --ns-shadow-md: 0 4px 12px -2px rgba(0, 0, 0, .4), 0 2px 4px -2px rgba(0, 0, 0, .2);
  --ns-shadow-lg: 0 10px 24px -4px rgba(0, 0, 0, .5), 0 4px 8px -4px rgba(0, 0, 0, .3);
  --ns-shadow-xl: 0 20px 40px -8px rgba(0, 0, 0, .6), 0 8px 16px -8px rgba(0, 0, 0, .3);

  --ns-primary-light: #1e1b4b;
  --ns-success-light: #022c22;
  --ns-warning-light: #1c1200;
  --ns-danger-light: #1c0707;
  --ns-info-light: #071a3b;
}

/* ── Base Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--ns-font);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ns-text-primary);
  background-color: var(--ns-bg);
  transition: background-color var(--ns-slow) var(--ns-ease),
    color var(--ns-slow) var(--ns-ease);
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--ns-font);
  font-weight: 700;
  color: var(--ns-text-primary);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.display-1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.04em;
}

.display-2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: -0.03em;
}

p {
  color: var(--ns-text-secondary);
}

a {
  color: var(--ns-primary);
  text-decoration: none;
  transition: color var(--ns-fast) var(--ns-ease);
}

a:hover {
  color: var(--ns-primary-hover);
}

/* ── Card Components ────────────────────────────────────────── */
.ns-card {
  background: var(--ns-surface);
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-radius-lg);
  box-shadow: var(--ns-shadow-sm);
  transition: box-shadow var(--ns-normal) var(--ns-ease),
    border-color var(--ns-normal) var(--ns-ease);
}

.ns-card:hover {
  box-shadow: var(--ns-shadow-md);
}

.ns-card-elevated {
  background: var(--ns-surface-raised);
  border: 1px solid var(--ns-border-subtle);
  border-radius: var(--ns-radius-lg);
  box-shadow: var(--ns-shadow-md);
}

.ns-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--ns-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ns-card-body {
  padding: 1.5rem;
}

.ns-card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--ns-border);
  background: var(--ns-gray-50);
  border-radius: 0 0 var(--ns-radius-lg) var(--ns-radius-lg);
}

[data-theme="dark"] .ns-card-footer {
  background: var(--ns-border-subtle);
}

/* Stat Cards */
.ns-stat-card {
  background: var(--ns-surface);
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--ns-shadow-sm);
  transition: transform var(--ns-normal) var(--ns-ease),
    box-shadow var(--ns-normal) var(--ns-ease);
}

.ns-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ns-shadow-md);
}

.ns-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--ns-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.ns-stat-value {
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.ns-stat-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ns-text-secondary);
  margin-top: 0.25rem;
}

.ns-stat-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--ns-radius-full);
}

.ns-stat-change.up {
  background: var(--ns-success-light);
  color: var(--ns-success);
}

.ns-stat-change.down {
  background: var(--ns-danger-light);
  color: var(--ns-danger);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  font-family: var(--ns-font);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  border-radius: var(--ns-radius-sm);
  padding: 0.5rem 1rem;
  transition: all var(--ns-fast) var(--ns-ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1.5px solid transparent;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--ns-primary);
  border-color: var(--ns-primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(99, 102, 241, .3);
}

.btn-primary:hover {
  background: var(--ns-primary-hover);
  border-color: var(--ns-primary-hover);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-secondary {
  background: var(--ns-surface);
  border-color: var(--ns-border);
  color: var(--ns-text-primary);
}

.btn-secondary:hover {
  background: var(--ns-gray-50);
  border-color: var(--ns-gray-300);
  color: var(--ns-text-primary);
}

[data-theme="dark"] .btn-secondary {
  background: var(--ns-surface-raised);
  border-color: var(--ns-border);
  color: var(--ns-text-primary);
}

[data-theme="dark"] .btn-secondary:hover {
  background: var(--ns-border);
}

.btn-danger {
  background: var(--ns-danger);
  border-color: var(--ns-danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  transform: translateY(-1px);
}

.btn-success {
  background: var(--ns-success);
  border-color: var(--ns-success);
  color: #fff;
}

.btn-success:hover {
  background: #059669;
  border-color: #059669;
  color: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ns-text-secondary);
}

.btn-ghost:hover {
  background: var(--ns-gray-100);
  color: var(--ns-text-primary);
}

[data-theme="dark"] .btn-ghost:hover {
  background: var(--ns-border);
}

.btn-sm {
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--ns-radius-xs);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--ns-radius-md);
}

.btn-xl {
  padding: 1rem 2rem;
  font-size: 1.0625rem;
  border-radius: var(--ns-radius-md);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--ns-radius-sm);
  font-size: 1rem;
}

.btn-icon.btn-sm {
  width: 30px;
  height: 30px;
  font-size: 0.875rem;
}

.btn-icon.btn-lg {
  width: 44px;
  height: 44px;
  font-size: 1.125rem;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ns-text-primary);
  margin-bottom: 0.375rem;
}

.form-label .required {
  color: var(--ns-danger);
  margin-left: 2px;
}

.form-control, .form-select {
  font-family: var(--ns-font);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ns-text-primary);
  background: var(--ns-surface);
  border: 1.5px solid var(--ns-border);
  border-radius: var(--ns-radius-sm);
  padding: 0.5625rem 0.875rem;
  transition: border-color var(--ns-fast) var(--ns-ease),
    box-shadow var(--ns-fast) var(--ns-ease);
  line-height: 1.5;
}

.form-control::placeholder {
  color: var(--ns-text-tertiary);
}

.form-control:focus, .form-select:focus {
  border-color: var(--ns-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
  outline: none;
  background: var(--ns-surface);
  color: var(--ns-text-primary);
}

.form-control:hover:not(:focus), .form-select:hover:not(:focus) {
  border-color: var(--ns-gray-400);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background: var(--ns-surface-raised);
  border-color: var(--ns-border);
  color: var(--ns-text-primary);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  background: var(--ns-surface-raised);
}

.form-control-lg {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: var(--ns-radius-md);
}

.form-control-sm {
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
}

.form-text {
  font-size: 0.8125rem;
  color: var(--ns-text-tertiary);
  margin-top: 0.3rem;
}

.invalid-feedback, .form-error {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ns-danger);
  margin-top: 0.3rem;
}

.form-control.is-invalid {
  border-color: var(--ns-danger);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .15);
}

/* Input group */
.input-group .form-control {
  border-radius: 0;
}

.input-group .form-control:first-child {
  border-radius: var(--ns-radius-sm) 0 0 var(--ns-radius-sm);
}

.input-group .form-control:last-child {
  border-radius: 0 var(--ns-radius-sm) var(--ns-radius-sm) 0;
}

.input-group-text {
  background: var(--ns-gray-50);
  border: 1.5px solid var(--ns-border);
  color: var(--ns-text-secondary);
  font-size: 0.9375rem;
  padding: 0.5625rem 0.875rem;
}

[data-theme="dark"] .input-group-text {
  background: var(--ns-border);
  border-color: var(--ns-border);
  color: var(--ns-text-secondary);
}

/* ── Badges / Status Pills ──────────────────────────────────── */
.ns-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--ns-radius-full);
  white-space: nowrap;
}

.ns-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ns-badge-primary {
  background: var(--ns-primary-light);
  color: var(--ns-primary);
}

.ns-badge-success {
  background: var(--ns-success-light);
  color: var(--ns-success);
}

.ns-badge-warning {
  background: var(--ns-warning-light);
  color: #b45309;
}

.ns-badge-danger {
  background: var(--ns-danger-light);
  color: var(--ns-danger);
}

.ns-badge-info {
  background: var(--ns-info-light);
  color: var(--ns-info);
}

.ns-badge-neutral {
  background: var(--ns-gray-100);
  color: var(--ns-gray-600);
}

[data-theme="dark"] .ns-badge-primary {
  background: #1e1b4b;
  color: #a5b4fc;
}

[data-theme="dark"] .ns-badge-success {
  background: #022c22;
  color: #6ee7b7;
}

[data-theme="dark"] .ns-badge-warning {
  background: #1c1200;
  color: #fcd34d;
}

[data-theme="dark"] .ns-badge-danger {
  background: #1c0707;
  color: #fca5a5;
}

[data-theme="dark"] .ns-badge-info {
  background: #071a3b;
  color: #93c5fd;
}

[data-theme="dark"] .ns-badge-neutral {
  background: var(--ns-border);
  color: var(--ns-text-secondary);
}

/* ── Tables ─────────────────────────────────────────────────── */
.ns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.ns-table thead th {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ns-text-tertiary);
  border-bottom: 1px solid var(--ns-border);
  white-space: nowrap;
  background: var(--ns-gray-50);
}

[data-theme="dark"] .ns-table thead th {
  background: var(--ns-border-subtle);
}

.ns-table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--ns-border-subtle);
  color: var(--ns-text-primary);
  vertical-align: middle;
}

.ns-table tbody tr:hover td {
  background: var(--ns-gray-50);
}

[data-theme="dark"] .ns-table tbody tr:hover td {
  background: var(--ns-border-subtle);
}

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

/* ── Alerts ─────────────────────────────────────────────────── */
.ns-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--ns-radius-md);
  font-size: 0.875rem;
  border: 1px solid transparent;
}

.ns-alert-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.ns-alert-success {
  background: var(--ns-success-light);
  border-color: rgba(16, 185, 129, .2);
  color: #065f46;
}

.ns-alert-warning {
  background: var(--ns-warning-light);
  border-color: rgba(245, 158, 11, .2);
  color: #92400e;
}

.ns-alert-danger {
  background: var(--ns-danger-light);
  border-color: rgba(239, 68, 68, .2);
  color: #991b1b;
}

.ns-alert-info {
  background: var(--ns-info-light);
  border-color: rgba(59, 130, 246, .2);
  color: #1e40af;
}

[data-theme="dark"] .ns-alert-success {
  color: #6ee7b7;
}

[data-theme="dark"] .ns-alert-warning {
  color: #fcd34d;
}

[data-theme="dark"] .ns-alert-danger {
  color: #fca5a5;
}

[data-theme="dark"] .ns-alert-info {
  color: #93c5fd;
}

/* ── Modals ─────────────────────────────────────────────────── */
.modal-content {
  background: var(--ns-surface);
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-radius-xl);
  box-shadow: var(--ns-shadow-xl);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--ns-border);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ns-text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--ns-border);
  gap: 0.5rem;
}

.btn-close {
  width: 28px;
  height: 28px;
  border-radius: var(--ns-radius-xs);
  opacity: 0.5;
  transition: opacity var(--ns-fast) var(--ns-ease);
}

.btn-close:hover {
  opacity: 1;
}

/* ── Divider ────────────────────────────────────────────────── */
.ns-divider {
  border: none;
  border-top: 1px solid var(--ns-border);
  margin: 1.25rem 0;
}

/* ── Dropdown ───────────────────────────────────────────────── */
.dropdown-menu {
  background: var(--ns-surface);
  border: 1px solid var(--ns-border);
  border-radius: var(--ns-radius-md);
  box-shadow: var(--ns-shadow-lg);
  padding: 0.375rem;
  min-width: 180px;
  font-size: 0.875rem;
}

.dropdown-item {
  border-radius: var(--ns-radius-xs);
  color: var(--ns-text-primary);
  padding: 0.4375rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  transition: background var(--ns-fast) var(--ns-ease);
}

.dropdown-item:hover {
  background: var(--ns-gray-100);
  color: var(--ns-text-primary);
}

[data-theme="dark"] .dropdown-item:hover {
  background: var(--ns-border);
}

.dropdown-divider {
  border-color: var(--ns-border);
  margin: 0.25rem 0;
}

.dropdown-header {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ns-text-tertiary);
  padding: 0.5rem 0.75rem 0.25rem;
}

/* ── Pagination ─────────────────────────────────────────────── */
.ns-pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ns-pagination .page-link {
  background: var(--ns-surface);
  border: 1px solid var(--ns-border);
  color: var(--ns-text-secondary);
  border-radius: var(--ns-radius-sm);
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--ns-fast);
  min-width: 36px;
  text-align: center;
}

.ns-pagination .page-link:hover {
  border-color: var(--ns-primary);
  color: var(--ns-primary);
}

.ns-pagination .page-item.active .page-link {
  background: var(--ns-primary);
  border-color: var(--ns-primary);
  color: white;
}

/* ── Checkbox & Radio ───────────────────────────────────────── */
.form-check-input {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--ns-border);
  background: var(--ns-surface);
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--ns-primary);
  border-color: var(--ns-primary);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
  border-color: var(--ns-primary);
}

.form-check-label {
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--ns-text-primary);
}

/* ── Toggle Switch ──────────────────────────────────────────── */

/* Legacy helper (login page "remember me") */
.ns-toggle .form-check-input {
  width: 2.25rem;
  height: 1.25rem;
  border-radius: 999px;
}

.ns-toggle .form-check-input:checked {
  background-color: var(--ns-primary);
}

/* New ToggleWidget — .ns-tw wraps input + track */
.ns-tw {
  display: inline-flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.ns-ti {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.ns-tt {
  width: 44px;
  height: 24px;
  background: var(--ns-gray-300);
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--ns-normal) var(--ns-ease),
    box-shadow var(--ns-fast) var(--ns-ease);
}

[data-theme="dark"] .ns-tt {
  background: var(--ns-border);
}

.ns-th {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  transition: transform var(--ns-normal) var(--ns-ease);
  pointer-events: none;
}

/* Checked state */
.ns-ti:checked+.ns-tt {
  background: var(--ns-primary);
}

.ns-ti:checked+.ns-tt .ns-th {
  transform: translateX(20px);
}

/* Focus ring */
.ns-ti:focus-visible+.ns-tt {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .25);
  outline: none;
}

/* Disabled */
.ns-ti:disabled+.ns-tt {
  opacity: .5;
  cursor: not-allowed;
}

/* Toggle row — layout helper for field + label side by side */
.ns-toggle-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.ns-toggle-row .ns-toggle-text {
  font-size: .875rem;
  font-weight: 500;
  color: var(--ns-text-primary);
  cursor: pointer;
  user-select: none;
  line-height: 1.4;
}

/* ── Tooltip ────────────────────────────────────────────────── */
.tooltip-inner {
  background: var(--ns-gray-900);
  border-radius: var(--ns-radius-xs);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 0.625rem;
}

/* ── Progress ───────────────────────────────────────────────── */
.progress {
  background: var(--ns-gray-100);
  border-radius: var(--ns-radius-full);
  height: 6px;
}

[data-theme="dark"] .progress {
  background: var(--ns-border);
}

.progress-bar {
  background: var(--ns-primary);
  border-radius: var(--ns-radius-full);
}

/* ── Skeleton Loader ────────────────────────────────────────── */
.ns-skeleton {
  background: linear-gradient(90deg,
      var(--ns-gray-100) 25%,
      var(--ns-gray-200) 37%,
      var(--ns-gray-100) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--ns-radius-sm);
}

[data-theme="dark"] .ns-skeleton {
  background: linear-gradient(90deg,
      var(--ns-border-subtle) 25%,
      var(--ns-border) 37%,
      var(--ns-border-subtle) 63%);
  background-size: 400% 100%;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* ── Utility classes ────────────────────────────────────────── */
.text-primary-color {
  color: var(--ns-primary) !important;
}

.text-muted-ns {
  color: var(--ns-text-secondary) !important;
}

.bg-surface {
  background: var(--ns-surface) !important;
}

.bg-base {
  background: var(--ns-bg) !important;
}

.border-ns {
  border-color: var(--ns-border) !important;
}

.ns-divider-v {
  width: 1px;
  background: var(--ns-border);
  align-self: stretch;
  margin: 0 0.5rem;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--ns-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ns-gray-400);
}


/* ── Theme Toggle Animation ─────────────────────────────────── */
.ns-theme-icon {
  transition: transform var(--ns-normal) var(--ns-ease);
}

[data-theme="dark"] .ns-theme-icon {
  transform: rotate(180deg);
}

/* ── Focus Visible ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ns-primary);
  outline-offset: 2px;
}

