/* ════════════════════════════════════════════════════════════════════════
   matrix-dark.css — v29.15 optional DARK "WORKSPACE" skin (opt-in).

   Restores the v28.11 dark/lime CRM palette as a token-override layer
   scoped to `html.theme-dark`.  matrix.css stays the DEFAULT Enterprise
   Light theme (and keeps its v29.9 palette-lock contract — no dark hexes
   live there); this file only re-declares the :root tokens plus a handful
   of component tints whose light values don't invert cleanly.

   Activation: the /matrix/profile Appearance toggle writes
   localStorage["wf345_theme"]; a first-paint loader in matrix_base.html
   adds .theme-dark to <html> before the body renders (no flash).  Public
   standalone pages (landing / login / register / terms) never load this
   file, so the marketing surface is always Enterprise Light.

   `html.theme-dark` (type + class) out-specifies `:root` (single pseudo-
   class), so every component that reads the tokens reskins at once.
   ════════════════════════════════════════════════════════════════════════ */

html.theme-dark {
  /* ── Dark "WORKSPACE" palette (v28.11 heritage) ────────────────────────── */
  --bg-app: #0b0b0d;            /* near-black workspace canvas               */
  --bg-surface: #18181b;        /* elevated content card                     */
  --bg-elevated: #1f1f23;       /* nested surface inside a card              */
  --bg-elevated-hi: #27272a;    /* hover / higher elevation                  */
  --text-main: #f4f4f5;         /* crisp primary text                        */
  --text-strong: #ffffff;       /* headline emphasis                         */
  --text-muted: #a1a1aa;        /* secondary / ancillary labels              */
  --border-color: #2a2a30;      /* low-opacity divider stroke                */
  --border-light: rgba(255, 255, 255, 0.07);

  /* Bright lime-green accent (the deck's signature colour) + supports        */
  --primary: #c3f53c;
  --primary-hover: #b2ea2c;
  --primary-ink: #14160c;       /* near-black text ON the lime accent        */
  --accent-cyan: #7ee7d6;
  --danger: #f26b5e;
  --success: #c3f53c;

  /* Legacy inline-template vars remapped to the dark skin.                   */
  --matrix-text-dim: #71717a;
  --matrix-blue-hi: #c3f53c;
  --matrix-cyan: #7ee7d6;

  /* App-shell surfaces + dark-depth shadows.                                 */
  --bg-shell: #101013;
  --bg-topbar: rgba(11, 11, 13, 0.82);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.40);
  --shadow-md: 0 8px 24px -6px rgb(0 0 0 / 0.55), 0 2px 6px -2px rgb(0 0 0 / 0.4);
}

/* ── Component tints whose LIGHT values don't invert via tokens ──────────── */

/* Neutral pill badge: white-alpha wash instead of slate-alpha. */
html.theme-dark .mx-badge { background: rgba(255, 255, 255, 0.08); }
html.theme-dark .mx-compliance-unknown { background: rgba(255, 255, 255, 0.06); }

/* Navy-tinted chips → lime-tinted on dark (text already follows --primary). */
html.theme-dark .mx-credit-pill,
html.theme-dark .mx-credit-nav,
html.theme-dark .mx-sigcard-badge,
html.theme-dark .mx-feature-ico { background: rgba(195, 245, 60, 0.10); }
html.theme-dark .mx-input:focus,
html.theme-dark .mx-select:focus { box-shadow: 0 0 0 3px rgba(195, 245, 60, 0.25); }

/* Status chips tuned for dark surfaces (light-ink variants). */
html.theme-dark .mx-status-processing { background: rgba(99, 102, 241, 0.20); color: #a5b4fc; }
html.theme-dark .mx-status-draft { background: rgba(245, 166, 35, 0.18); }

/* PDF verification iframe letterbox reads better dark. */
html.theme-dark .mx-iframe-container { background: #1f1f23; }

/* NOTE — deliberately UNCHANGED in dark mode (established contracts):
   .mx-input/.mx-select white fields, the .mx-progress-container and
   .mx-error forced-light callouts, and the Super Admin red control-plane
   chrome (its hardcoded red surfaces are theme-independent by design). */
