/**
 * Nexorion design tokens — single source of truth for the theme layer.
 * Loaded before component/shell CSS. Extends Ace/Bootstrap without replacing them.
 */
:root {
  /* Brand */
  --nx-navy: #0f2744;
  --nx-navy-deep: #0a1b30;
  --nx-navy-mid: #16355a;
  --nx-teal: #0d9488;
  --nx-teal-dark: #0f766e;
  --nx-teal-soft: #ccfbf1;
  --nx-gold: #c4a35a;
  --nx-gold-soft: rgba(196, 163, 90, 0.16);

  /* Semantic */
  --nx-success: #059669;
  --nx-success-soft: #ecfdf5;
  --nx-warning: #d97706;
  --nx-warning-soft: #fffbeb;
  --nx-danger: #dc2626;
  --nx-danger-soft: #fef2f2;
  --nx-info: #0284c7;
  --nx-info-soft: #f0f9ff;

  /* Surfaces */
  --nx-bg: #f3f1ed;
  --nx-bg-elevated: #f8f7f4;
  --nx-surface: #ffffff;
  --nx-border: #e5e7eb;
  --nx-border-strong: #d1d5db;
  --nx-divider: #eef0f3;

  /* Text */
  --nx-text: #1f2a37;
  --nx-text-secondary: #64748b;
  --nx-text-muted: #94a3b8;
  --nx-text-inverse: #f8fafc;

  /* Typography */
  --nx-font: "Open Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --nx-font-mono: Consolas, Monaco, "Courier New", monospace;
  --nx-fs-xs: 11px;
  --nx-fs-sm: 12px;
  --nx-fs-md: 13px;
  --nx-fs-base: 14px;
  --nx-fs-lg: 16px;
  --nx-fs-xl: 20px;
  --nx-fs-2xl: 26px;
  --nx-fw-regular: 400;
  --nx-fw-medium: 600;
  --nx-fw-bold: 700;
  --nx-lh: 1.45;

  /* Shape */
  --nx-radius-sm: 6px;
  --nx-radius: 10px;
  --nx-radius-lg: 12px;
  --nx-radius-pill: 999px;

  /* Shadow */
  --nx-shadow-xs: 0 1px 2px rgba(15, 39, 68, 0.04);
  --nx-shadow-sm: 0 1px 3px rgba(15, 39, 68, 0.06);
  --nx-shadow-md: 0 4px 14px rgba(15, 39, 68, 0.08);

  /* Spacing (8px system) */
  --nx-space-1: 4px;
  --nx-space-2: 8px;
  --nx-space-3: 12px;
  --nx-space-4: 16px;
  --nx-space-5: 20px;
  --nx-space-6: 24px;
  --nx-space-8: 32px;

  /* Form/list page outer gap (approved Organization Profile standard) */
  --nx-form-outer-gap: 12px;

  /* Controls */
  --nx-input-height: 42px;
  --nx-btn-height: 40px;
  --nx-btn-height-sm: 34px;
  --nx-row-height: 50px;

  /* Shell */
  --nx-header-height: 64px;
  --nx-sidebar-width: 256px;
  --nx-sidebar-collapsed: 72px;

  /* Motion / focus / z */
  --nx-transition: 160ms ease;
  --nx-focus-ring: 0 0 0 3px rgba(13, 148, 136, 0.28);
  --nx-z-header: 1030;
  --nx-z-sidebar: 1027;
  /*
   * Portaled overlays (Chosen / action menus) must sit above Bootstrap modals
   * (shell modal ≈ 1050, token modal 1060) and below toasts.
   * Layer: page < backdrop < modal < dropdown < toast
   */
  --nx-z-dropdown: 1070;
  --nx-z-modal: 1060;
  --nx-z-toast: 1080;

  /* Bridge legacy SMS tokens used by scroll-form / shell */
  --sms-primary: var(--nx-navy-mid);
  --sms-primary-dark: var(--nx-navy);
  --sms-secondary: var(--nx-bg-elevated);
  --sms-border: var(--nx-border);
  --sms-text: var(--nx-text);
  --sms-muted: var(--nx-text-secondary);
  --sms-danger: var(--nx-danger);
  --sms-success: var(--nx-success);
  --sms-navbar-height: var(--nx-header-height);
  --sms-shell-v2-navbar-height: var(--nx-header-height);
  --sms-sidebar-width: var(--nx-sidebar-width);
  --sms-sidebar-min-width: var(--nx-sidebar-collapsed);
}
