/**
 * PN Stealth Dispatch — shared design tokens (Foundation PR B).
 *
 * Additive. Existing module variables in style.css / customer_card.css /
 * load-card scopes remain until those consumers are migrated.
 * Prefer these tokens in new shared components.
 */

:root {
  /* ---- Colors: brand & actions ---- */
  --color-brand-red: #c8102e;
  --color-primary: #c8102e;
  --color-primary-hover: #a10d25;
  --color-primary-pressed: #8f0b20;
  --color-success: #1f6b4a;
  --color-success-strong: #2f7d4f;
  --color-warning: #a66b12;
  --color-danger: #c8102e;
  --color-danger-strong: #7a0f1c;
  --color-info: #2f6fed;

  /* ---- Colors: text & surfaces ---- */
  --color-text: #161a1f;
  --color-text-muted: #66707a;
  --color-border: #d8dde3;
  --color-workspace-bg: #eef1f4;
  --color-workspace-accent: #e8ecf0;
  --color-card-surface: #ffffff;
  --color-sidebar-bg: #0b0d10;
  --color-sidebar-text: #f2f4f6;
  --color-sidebar-muted: rgba(242, 244, 246, 0.42);
  --color-sidebar-active-bg: rgba(200, 16, 46, 0.22);

  /* ---- Compatibility with existing style.css tokens ---- */
  --bg: var(--color-workspace-bg);
  --bg-accent: var(--color-workspace-accent);
  --panel: var(--color-card-surface);
  --ink: var(--color-text);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --brand: var(--color-primary);
  --brand-2: var(--color-primary-hover);
  --good: var(--color-success);
  --green: var(--color-success-strong);
  --amber: var(--color-warning);
  --red: var(--color-danger);
  --late: var(--color-danger-strong);
  --sidebar: var(--color-sidebar-bg);
  --sidebar-ink: var(--color-sidebar-text);

  /* ---- Typography scale ---- */
  --font: "DM Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --type-page-title: 1.55rem;
  --type-record-title: 1.45rem;
  --type-section-title: 1.05rem;
  --type-primary-tab: 0.95rem;
  --type-secondary-tab: 0.88rem;
  --type-label: 0.78rem;
  --type-body: 0.95rem;
  --type-table: 0.8125rem; /* 13px */
  --type-supporting: 0.84rem;
  --type-badge: 0.72rem;
  --type-nav: 0.95rem;
  --type-mobile-nav: 0.7rem;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ---- Spacing (4–32px) ---- */
  --space-1: 4px;
  --space-1_5: 6px;
  --space-2: 8px;
  --space-2_5: 10px;
  --space-3: 12px;
  --space-3_5: 14px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* ---- Shape ---- */
  --radius-sm: 8px;
  --radius-control: 10px;
  --radius-card: 10px;
  --radius-modal: 12px;
  --radius: var(--radius-card);
  --radius-pill: 999px;

  /* ---- Layout ---- */
  --sidebar-width: 240px;
  --topbar-height: 56px;
  --mobile-bottom-nav-height: 64px;
  --bottom-nav-height: var(--mobile-bottom-nav-height);
  --sticky-action-dock-height: 72px;
  --page-max-width: 1600px;
  --mobile-page-padding-x: 14px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --app-bottom-nav-offset: 0px;
  --keyboard-inset: 0px;
  --load-card-footer-clearance: var(--app-bottom-nav-offset);
  --load-card-actions-height: var(--sticky-action-dock-height);

  /* ---- Effects ---- */
  --border-subtle: 1px solid var(--color-border);
  --shadow-xs: 0 1px 2px rgba(16, 22, 28, 0.04);
  --shadow-sm: 0 2px 6px rgba(16, 22, 28, 0.05);
  --shadow: 0 4px 14px rgba(16, 22, 28, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 22, 28, 0.08);
  --shadow-card: var(--shadow);
  --shadow-drawer: 8px 0 28px rgba(0, 0, 0, 0.45);
  --focus-ring: 0 0 0 2px #fff, 0 0 0 4px rgba(200, 16, 46, 0.4);
  --focus-ring-outline: 2px solid rgba(200, 16, 46, 0.4);
  --transition-fast: 140ms ease;
  --transition-drawer: 200ms ease;

  /* ---- Touch ---- */
  --touch-target-min: 44px;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-drawer: 0ms;
  }
}
