/*
 * Standlead Design System — Foundation Tokens
 * Restyled to the «Standlead — Аналитика» visual language (dashboard.html),
 * 2026-06-26. Source: Tailwind-based reference — Inter font, brand-blue
 * (#0088cc) accent, slate/ink neutral palette, navy navigation (#1E2C56),
 * rounded-2xl cards and soft card shadows.
 *
 * Use the SEMANTIC tokens (--fg-*, --bg-*, --accent-*, --success-*, etc.)
 * in components. The raw scales below are the source of truth they derive from.
 */
:root {
  /* ---- Brand / accent (brand-blue scale 50–700) ---- */
  /* Интерактивный акцент сдвинут brand-600 → brand-700 для AA-контраста: белый на
     #0088cc = 3.89:1 (провал WCAG 1.4.3), на #0072ab = 5.26:1. Синхронно с web-stub. */
  --accent-primary: #0072ab;   /* brand-700 — primary actions, active state, links (5.26:1 на белом) */
  --accent-secondary: #005f8f; /* brand-800 — усиленный акцент: текст на светлом */
  --accent-primary-hover: #005f8f; /* brand-800 — тёмный ховер (6.9:1) */
  --accent-primary-light: #45b2df; /* brand-400 — focus border, hover accents (нетекстовые) */
  --accent-container: #e1f3fb;  /* brand-50 — tinted backgrounds for accented surfaces */
  --border-blue: #c3e7f7;       /* brand-100 — focus ring */

  /* ---- Foreground (text) — slate/ink ---- */
  --fg-default: #0f172a;  /* ink-900 */
  --fg-soft: #334155;     /* ink-700 */
  --fg-muted: #64748b;    /* ink-500 */
  --fg-muted2: #94a3b8;   /* ink-400 */
  --fg-on-accent: #ffffff;
  --text-disabled: #94a3b8; /* ink-400 */

  /* ---- Surfaces / backgrounds — white + slate ---- */
  --bg-surface1: #ffffff;  /* cards, paper */
  --bg-surface2: #f8fafc;  /* slate-50 — input bg, subtle raised / hover */
  --bg-surface3: #f8fafc;  /* slate-50 — app background */
  --bg-row: #f8fafc;       /* slate-50 — table rows / list hover */
  --bg-disabled: #f1f5f9;  /* slate-100 */
  --bg-scrim: rgba(15, 23, 42, 0.40); /* ink-900 @ 40% — modal/drawer overlay */
  --bg-nav: #1E2C56;       /* navy navigation drawer */
  --bg-nav-elevated: #2a3a6a;

  /* ---- Borders — slate ---- */
  --border-default: #e2e8f0; /* slate-200 */
  --border-red: #fecdd3;     /* rose-200 */
  --border-green: #a7f3d0;   /* emerald-200 */

  /* ---- Status: success (emerald) ---- */
  --success-default: #10b981; /* emerald-500 */
  --success-hover: #059669;   /* emerald-600 */
  --success-active: #047857;  /* emerald-700 */
  --success-container: #ecfdf5; /* emerald-50 */

  /* ---- Status: warning (amber) ---- */
  --warning-default: #f59e0b; /* amber-500 */
  --warning-hover: #d97706;   /* amber-600 */
  --warning-container: #fffbeb; /* amber-50 */
  --warning-on: #78350f;      /* amber-900 */

  /* ---- Status: error (rose) ---- */
  --error-default: #f43f5e; /* rose-500 */
  --error-hover: #e11d48;   /* rose-600 */
  --error-active: #be123c;  /* rose-700 */
  --error-container: #fff1f2; /* rose-50 */

  /* ---- Neutral / slate scale ---- */
  --grey-50: #f8fafc;
  --grey-100: #f1f5f9;
  --grey-200: #e2e8f0;
  --grey-300: #cbd5e1;
  --grey-400: #94a3b8;
  --grey-500: #64748b;
  --grey-600: #475569;
  --grey-700: #334155;
  --grey-800: #1e293b;
  --grey-900: #0f172a;

  /* ---- Typography (Inter) ---- */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --font-h1: var(--fw-bold) 6rem/1.167 var(--font-family);
  --font-h2: var(--fw-bold) 3.75rem/1.2 var(--font-family);
  --font-h3: var(--fw-semibold) 3rem/1.167 var(--font-family);
  --font-h4: var(--fw-semibold) 2.125rem/1.235 var(--font-family);
  /* Компактная плотность под эталон dashboard.html (Tailwind text-base/sm/xs):
     заголовки/тело сведены к референсной шкале — title ≈18px, body ≈14px,
     лейблы/меню/шапки таблиц ≈12px, caption ≈11px. */
  --font-h5: var(--fw-semibold) 1.125rem/1.3 var(--font-family);   /* page titles ≈18px */
  --font-h6: var(--fw-semibold) 1rem/1.4 var(--font-family);       /* ≈16px */
  --font-subtitle1: var(--fw-regular) 0.875rem/1.6 var(--font-family);
  --font-subtitle2: var(--fw-semibold) 0.75rem/1.5 var(--font-family);   /* ≈12px */
  --font-body1: var(--fw-regular) 0.875rem/1.5 var(--font-family); /* base body ≈14px */
  --font-body2: var(--fw-regular) 0.8125rem/1.45 var(--font-family);/* secondary ≈13px */
  --font-button: var(--fw-medium) 0.8125rem/1.5 var(--font-family);
  --font-caption: var(--fw-regular) 0.6875rem/1.6 var(--font-family);/* ≈11px */

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

  /* ---- Radius (rounded-md/lg/xl/2xl → 6/8/12/16px) ---- */
  --radius-sm: 4px;
  --radius-md: 6px;   /* badges, ghost buttons, number tiles */
  --radius-lg: 8px;   /* default — inputs, buttons, selects */
  --radius-xl: 12px;  /* menus / popovers */
  --radius-2xl: 16px; /* cards / panels / modals */
  --radius-pill: 999px;
  --radius-circle: 50%;

  /* ---- Shadows (soft, ink-tinted) ---- */
  --shadow-card: 0 1px 2px 0 rgb(15 23 42 / 0.04), 0 1px 3px 0 rgb(15 23 42 / 0.06);
  --shadow-popover: 0 10px 30px -12px rgb(15 23 42 / 0.18); /* lift */
  --shadow-modal: 0 24px 50px -12px rgb(15 23 42 / 0.28),
                  0 10px 30px -12px rgb(15 23 42 / 0.18);

  /* ---- Z-index (from MUI) ---- */
  --z-appbar: 1100;
  --z-drawer: 1200;
  --z-modal: 1300;
  --z-snackbar: 1400;
  --z-tooltip: 1500;
}
