/* ==========================================================================
   ERPDocs Design Tokens — single source of truth
   --------------------------------------------------------------------------
   Brand: "Ocean" (chosen Oct 2026) · Typeface: IBM Plex Sans
   Every color, size, radius, shadow and duration used by the UI must come
   from a --ds-* token below. Never hardcode a hex value in a template or
   component stylesheet. If a value is missing, add a token here first.

   Prefix --ds-* is deliberate: legacy files (admin.css --erp-*, Bootstrap
   --bs-*) define their own vars; --ds-* never collides with them.

   Docs: .claude/skills/design-system/SKILL.md · AGENTS.md
   ========================================================================== */

:root {
  /* ---- Brand ---------------------------------------------------------- */
  --ds-primary:          #0369a1;  /* buttons, links, focus, active state   */
  --ds-primary-hover:    #075985;
  --ds-primary-active:   #0c4a6e;
  --ds-primary-soft:     #f0f9ff;  /* tinted backgrounds, selected rows     */
  --ds-primary-soft-2:   #e0f2fe;  /* hover on soft, progress tracks        */
  --ds-primary-border:   #bae6fd;
  --ds-primary-text:     #0c4a6e;  /* text on primary-soft                  */
  --ds-on-primary:       #ffffff;  /* text on primary fill (5.9:1)          */
  --ds-accent:           #059669;  /* "signed / complete" moments only      */
  --ds-primary-on-dark:  #7dd3fc;  /* links, icons on --ds-dark (9.9:1)      */
  /* RGB triplets for rgba(var(--…-rgb), a) and Bootstrap's --bs-*-rgb vars */
  --ds-primary-rgb:       3, 105, 161;  /* = --ds-primary       */
  --ds-primary-hover-rgb: 7, 89, 133;   /* = --ds-primary-hover */

  /* ---- Neutrals (ocean-tinted slate) ---------------------------------- */
  --ds-ink:              #0c1e3d;  /* headings, body text                   */
  --ds-text:             #1f2f4a;  /* long-form body                        */
  --ds-muted:            #4c5b76;  /* secondary text (6.9:1 on white)       */
  --ds-subtle:           #64718a;  /* captions, placeholders (4.9:1 white)  */
  --ds-disabled:         #a3adbf;
  --ds-border-strong:    #c3cfdc;
  --ds-border:           #dde6ef;
  --ds-border-soft:      #eaf0f6;
  --ds-surface-alt:      #f4f8fb;  /* page sections, table headers          */
  --ds-surface:          #ffffff;  /* cards, inputs                         */
  --ds-bg:               #ffffff;
  --ds-dark:             #0c1e3d;  /* dark bands, app sidebar               */
  --ds-dark-2:           #132a52;
  --ds-dark-deep:        #06122a;  /* hero / immersive dark backgrounds     */
  --ds-sky:              #38bdf8;  /* highlights on dark only (glows, ink)  */
  --ds-on-dark:          #ffffff;
  --ds-on-dark-muted:    rgba(255, 255, 255, 0.72);

  /* ---- Status (badges, alerts) — never use for decoration ------------- */
  --ds-success:          #047857;  --ds-success-bg: #e8f6ef;  --ds-success-text: #05603a;
  --ds-warning:          #b45309;  --ds-warning-bg: #fdf3e2;  --ds-warning-text: #8a4b06;
  --ds-warning-border:   #fde68a;  /* beta chips, warning outlines; also chip text on dark */
  --ds-danger:           #b91c1c;  --ds-danger-bg:  #fdecec;  --ds-danger-text:  #991b1b;
  --ds-info:             var(--ds-primary); --ds-info-bg: var(--ds-primary-soft); --ds-info-text: var(--ds-primary-text);
  --ds-neutral-bg:       #eef2f6;  --ds-neutral-text: #475569;
  --ds-success-on-dark:  #6ee7b7;  --ds-danger-on-dark: #fca5a5;  /* status icons on --ds-dark (toasts) */

  /* SignPack pipeline stages (dashboard bar + legend keys; non-text marks only) */
  --ds-stage-draft:      var(--ds-border-strong);
  --ds-stage-sent:       var(--ds-primary-border);
  --ds-stage-viewed:     #38bdf8;
  --ds-stage-partial:    var(--ds-primary);
  --ds-stage-done:       var(--ds-accent);

  /* ---- Typography ----------------------------------------------------- */
  --ds-font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ds-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Signature visuals only — same script faces signers pick in sign_complete.html */
  --ds-font-signature: "Great Vibes", "Alex Brush", "Dancing Script", cursive;

  /* Fixed scale (px values in comments). Display sizes are fluid.         */
  --ds-text-xs:   0.75rem;    /* 12 — badges, captions                      */
  --ds-text-sm:   0.875rem;   /* 14 — secondary, table cells                */
  --ds-text-base: 1rem;       /* 16 — body                                  */
  --ds-text-lg:   1.125rem;   /* 18 — lead paragraph, card titles           */
  --ds-text-xl:   1.25rem;    /* 20 — page titles in app                    */
  --ds-text-2xl:  1.5rem;     /* 24                                         */
  --ds-text-3xl:  clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem);   /* 28→40 section */
  --ds-text-4xl:  clamp(2.25rem, 1.4rem + 3.2vw, 3.75rem);  /* 36→60 hero    */

  --ds-weight-regular: 400;
  --ds-weight-medium:  500;
  --ds-weight-semi:    600;
  --ds-weight-bold:    700;

  --ds-leading-tight: 1.1;
  --ds-leading-snug:  1.3;
  --ds-leading-body:  1.6;
  --ds-tracking-tight: -0.022em;  /* headings ≥ 24px */
  --ds-tracking-caps:   0.08em;   /* uppercase eyebrows */

  /* ---- Spacing (4px grid) --------------------------------------------- */
  --ds-space-1: 0.25rem;  /*  4 */
  --ds-space-2: 0.5rem;   /*  8 */
  --ds-space-3: 0.75rem;  /* 12 */
  --ds-space-4: 1rem;     /* 16 */
  --ds-space-5: 1.25rem;  /* 20 */
  --ds-space-6: 1.5rem;   /* 24 */
  --ds-space-8: 2rem;     /* 32 */
  --ds-space-10: 2.5rem;  /* 40 */
  --ds-space-12: 3rem;    /* 48 */
  --ds-space-16: 4rem;    /* 64 */
  --ds-space-section: clamp(4rem, 3rem + 4vw, 7rem); /* marketing section rhythm */

  /* ---- Radius --------------------------------------------------------- */
  --ds-radius-sm:   6px;   /* badges, small inputs   */
  --ds-radius:      8px;   /* buttons, inputs        */
  --ds-radius-lg:   12px;  /* cards                  */
  --ds-radius-xl:   16px;  /* feature panels, modals */
  --ds-radius-full: 999px; /* avatars, eyebrow pills */

  /* ---- Elevation ------------------------------------------------------ */
  --ds-shadow-xs: 0 1px 2px rgba(12, 30, 61, 0.05);
  --ds-shadow-sm: 0 1px 2px rgba(12, 30, 61, 0.04), 0 2px 6px rgba(12, 30, 61, 0.05);
  --ds-shadow-md: 0 2px 4px rgba(12, 30, 61, 0.04), 0 8px 20px -4px rgba(12, 30, 61, 0.10);
  --ds-shadow-lg: 0 2px 6px rgba(12, 30, 61, 0.05), 0 24px 48px -12px rgba(12, 30, 61, 0.20);
  /* From --ds-primary-rgb, so a tenant brand (signer pages, placement frame) gets its own ring. */
  --ds-focus-ring: 0 0 0 3px rgba(var(--ds-primary-rgb), 0.28);
  --ds-scrim:      rgba(6, 18, 42, 0.5);   /* behind dialogs and the phone menu */

  /* ---- Motion (spec: docs/DESIGN_SYSTEM.md §2.5) ----------------------
     App motion is functional: it shows where something came from or went.
     fast = hover/press/toggle colour · base = things appearing (menus,
     dialogs, toasts, tab content) · exit = things leaving (always quicker)
     · slow = layout (panel collapse, drawer). Nothing in the app UI runs
     longer than slow except loading indicators. */
  --ds-dur-fast: 120ms;
  --ds-dur:      200ms;
  --ds-dur-exit: 150ms;
  --ds-dur-slow: 400ms;
  --ds-dur-highlight: 1.2s;                     /* one-shot "this changed" tint */
  --ds-dur-spin: 0.8s;                          /* inline spinner revolution */
  --ds-ease:     cubic-bezier(0.2, 0, 0, 1);    /* standard: moves within the screen */
  --ds-ease-out: cubic-bezier(0.16, 1, 0.3, 1); /* enter: decelerate into place */
  --ds-ease-in:  cubic-bezier(0.4, 0, 1, 1);    /* exit: accelerate away */
  --ds-shift:    4px;                           /* menus/popovers travel */
  --ds-shift-lg: 8px;                           /* dialogs/toasts travel */

  /* ---- Layout --------------------------------------------------------- */
  --ds-container:      1200px;
  --ds-container-narrow: 760px;
  --ds-gutter:         clamp(1rem, 0.5rem + 2vw, 2rem);
  --ds-nav-height:     64px;
  --ds-z-nav: 1030; --ds-z-dropdown: 1040; --ds-z-modal: 1050; --ds-z-toast: 1080;
  --ds-z-top: 100000;   /* DS dialogs + toasts: above every legacy overlay (9999–99999) */
}
