/* ============================================================
   NexusCT Sales Dashboard — tokens.css
   Brand-tier design tokens. Loaded AFTER styles.css so :root
   definitions here override the in-file defaults.

   Load order (index.html):
     styles.css           → component styles + defaults
     tokens.css           → brand-tier mapping (this file)
     tokens-tenant.css    → optional per-deploy override

   ----------------------------------------------------------------
   TENANT OVERRIDE PATTERN (Phase 7 — app.nexusct.com)
   ----------------------------------------------------------------
   Production deploy can ship a `tokens-tenant.css` that re-defines
   only the brand-tier vars below. Example for partner.nexusct.com:

     :root {
       --nx-brand-name:    'Partner Brand';
       --nx-brand-primary: #2dd4bf;
       --nx-brand-accent:  #fb7185;
       --nx-brand-logo-url: url('/branding/partner-logo.svg');
       --nx-brand-radius:  0.75rem;
     }

   All --nx-* color tokens below derive from the brand tier, so a
   single override file recolors the whole dashboard.
   ============================================================ */

:root {
  /* ── Brand identity tier (override these in tokens-tenant.css) ── */
  --nx-brand-name:           'NexusCT';
  --nx-brand-primary:        #3b82f6;    /* CTA / focus rings */
  --nx-brand-primary-hover:  #2563eb;
  --nx-brand-primary-dim:    color-mix(in srgb, var(--nx-brand-primary) 15%, transparent);
  --nx-brand-accent:         #00d4ff;    /* secondary highlight */
  --nx-brand-accent-warm:    #f97316;    /* tertiary highlight / warmth */
  --nx-brand-success:        #22c55e;
  --nx-brand-warning:        #eab308;
  --nx-brand-error:          #ef4444;

  --nx-brand-radius:         0.375rem;
  --nx-brand-radius-sm:      6px;
  --nx-brand-radius-lg:      12px;

  --nx-brand-font-sans:      Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --nx-brand-font-mono:      "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --nx-brand-logo-url:       url('logo-nav.png');
  --nx-brand-logo-height:    20px;

  --nx-brand-shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.08);
  --nx-brand-shadow-md:      0 4px 12px rgba(0, 0, 0, 0.12);
  --nx-brand-shadow-lg:      0 12px 32px rgba(0, 0, 0, 0.18);

  /* ── Map existing tokens to brand tier (component tier) ── */
  /* styles.css defines these earlier in cascade; these overrides win. */
  --nx-primary:              var(--nx-brand-primary);
  --nx-blue:                 var(--nx-brand-primary);
  --nx-blue-dim:             var(--nx-brand-primary-dim);
  --nx-blue-hover:           var(--nx-brand-primary-hover);
  --nx-success:              var(--nx-brand-success);
  --nx-green:                var(--nx-brand-success);
  --nx-warning:              var(--nx-brand-warning);
  --nx-error:                var(--nx-brand-error);
  --radius:                  var(--nx-brand-radius);
  --radius-sm:               var(--nx-brand-radius-sm);
  --font-sans:               var(--nx-brand-font-sans);
  --font-mono:               var(--nx-brand-font-mono);

  /* ── Shell z-index scale ──
     Semantic stacking tiers for the shell chrome (styles.css, index.html).
     Mirrors the naming convention in tools/shared/tokens.css. Bottom to
     top: structural chrome → transient dropdowns → side panels/drawers →
     modals → tours/popovers → toasts → persistent floating controls →
     tooltips → critical system-level overlays (session/offline banners,
     skip link) that must always win regardless of what else is open. */
  --nx-z-dropdown:           20;   /* transient popovers: notif dropdown, search results, in-flow tooltips */
  --nx-z-sticky:             30;   /* sticky structural chrome: topbar, sidebar, mobile bottom nav */
  --nx-z-nxnav:              40;   /* top mega-menu nav + its own dropdown */
  --nx-z-panel:              45;   /* side panels/drawers: activity feed, notif drawer, context menu, mobile sidebar overlay */
  --nx-z-modal-backdrop:     50;
  --nx-z-modal:              60;   /* all modal overlays: confirm dialogs, shortcuts modal, session modal */
  --nx-z-tour:               65;   /* onboarding tour overlay + tooltip */
  --nx-z-popover:            68;   /* contextual help popover, "what's new" announcement */
  --nx-z-toast:              70;
  --nx-z-floating-controls:  75;   /* persistent utility controls: back-to-top, zoom controls, focus toggle, card context menu, ripple */
  --nx-z-tooltip:            80;
  --nx-z-critical:           90;   /* must always be visible: skip link, session-expiry warning, offline banner */
}

/* ============================================================
   Hooks for tools embedded inside another site (Phase 7).
   When the iframe shell is loaded from app.nexusct.com inside
   a parent page that already defines `--site-*` variables on
   <html data-host="nexusct">, we inherit those values.

   Activate by setting a class on the documentElement:
     document.documentElement.classList.add('nx-embed');
   ============================================================ */

.nx-embed {
  /* Inherit primary brand from parent site if a CSS custom prop
     was injected via the embed shim (see PHASE-7 SSO doc). */
  --nx-brand-primary:        var(--site-primary,   #3b82f6);
  --nx-brand-primary-hover:  var(--site-primary-h, #2563eb);
  --nx-brand-accent:         var(--site-accent,    #00d4ff);
  --nx-brand-radius:         var(--site-radius,    0.375rem);
  --nx-brand-font-sans:      var(--site-font,      Inter, system-ui, sans-serif);
}
