/* ===== FinZem UI Kit v3.1 — слой дизайн-токенов ===== */
/* Источник: finzem-ui-kit-v3.1-source/app/globals.css (без Tailwind/shadcn). */
/* Это единственный источник значений токенов. Подключается ПОСЛЕ legacy-CSS */
/* (common.css / finzem-system.css), чтобы новые значения перекрывали старые. */
/* Шрифт Manrope объявлен в /assets/vendor/fonts.css (локально, без внешних CDN). */

:root {
  /* Семантика */
  --background: #f4f7f4;
  --foreground: #10231c;
  --card: #ffffff;
  --card-foreground: #10231c;
  --popover: #ffffff;
  --popover-foreground: #10231c;
  --primary: #159a68;
  --primary-foreground: #ffffff;
  --secondary: #edf3ef;
  --secondary-foreground: #173d30;
  --muted: #eef2ef;
  --muted-foreground: #61736b;
  --accent: #e7f5ed;
  --accent-foreground: #106b49;
  --destructive: #c84b4b;
  --border: #d8e1dc;
  --input: #cdd9d2;
  --ring: #159a68;
  --radius: 0.625rem;

  /* Бренд и типографика */
  --brand: #159a68;
  --brand-dark: #0d704c;
  --brand-soft: #e7f5ed;
  --brand-pale: #f0faf5;
  --brand-air: #fafefc;
  --ink: #10231c;
  --ink-2: #334b41;
  --muted-2: #61736b;
  --line: #d8e1dc;
  --line-strong: #bfcdc5;
  --field: #f4f7f4;
  --surface: #ffffff;

  /* Смысловые статусы */
  --paid: #8b3fc7;
  --paid-soft: #f7effc;
  --risk: #c84b4b;
  --risk-soft: #fff1f0;
  --warning: #a86f08;
  --warning-soft: #fff7df;
  --info: #286e9b;
  --info-soft: #edf7fc;

  /* Глубина */
  --shadow-float: 0 16px 36px rgba(16, 35, 28, .10);

  /* Шрифты и шкала */
  --font-sans: "Manrope", "Onest", "Segoe UI", Arial, sans-serif;
  --font-display: "Manrope", "Onest", "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --background: #101713;
  --foreground: #eaf2ed;
  --card: #121814;
  --card-foreground: #eaf2ed;
  --popover: #17201b;
  --popover-foreground: #eaf2ed;
  --primary: #42c991;
  --primary-foreground: #082b1e;
  --secondary: #223028;
  --secondary-foreground: #eaf2ed;
  --muted: #223028;
  --muted-foreground: #9db0a6;
  --accent: #203d30;
  --accent-foreground: #9ce5c3;
  --destructive: #ef7777;
  --border: #314239;
  --input: #405249;
  --ring: #42c991;

  --brand: #42c991;
  --brand-dark: #8de0bb;
  --brand-soft: #203d30;
  --brand-pale: #182920;
  --brand-air: #1a1e1c;
  --ink: #eaf2ed;
  --ink-2: #c6d3cc;
  --muted-2: #9db0a6;
  --line: #314239;
  --line-strong: #45594e;
  --field: #101713;
  --surface: #121814;

  --paid: #c47aff;
  --paid-soft: #2d2038;
  --risk: #ef7777;
  --risk-soft: #342021;
  --warning: #e5b54e;
  --warning-soft: #302a1c;
  --info: #73b9e4;
  --info-soft: #1b2b35;

  --shadow-float: 0 18px 44px rgba(0, 0, 0, .28);
  color-scheme: dark;
}

/* ===== Маппинг legacy-токенов на значения v3.1 ===== */
/* Позволяет существующим страницам (common.css, finzem-system.css) получить */
/* новый бренд #159a68 без правки каждой страницы. Работает только если этот */
/* файл подключён после legacy-CSS (см. порядок в шаблоне). */
:root {
  --paper: #f4f7f4;
  --white: #ffffff;
  --ink: #10231c;
  --ink-soft: #61736b;
  --line: #d8e1dc;
  --line-strong: #bfcdc5;
  --green: #159a68;
  --green-dark: #0d704c;
  --green-pale: #e7f5ed;
  --sand: #d8c9ae;
  --display: "Manrope", "Onest", Arial, sans-serif;
  --body: "Manrope", "Onest", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --bg: #f4f7f4;
  --bg2: #edf3ef;
  --bg3: #ffffff;
  --card: #ffffff;
  --input: #ffffff;
  --primary: #159a68;
  --primary-hover: #0d704c;
  --brand: #159a68;
  --turquoise: #159a68;
  --primary-soft: #e7f5ed;
  --text: #10231c;
  --muted: #61736b;
  --border: #d8e1dc;
  --danger: #c84b4b;
  --warning: #a86f08;
  --warning-soft: #fff7df;
  --info: #286e9b;
  --info-soft: #edf7fc;
  --info-blue: #286e9b;
  --success: #0d704c;
  --radius: 10px;
  --shadow: 0 18px 50px rgba(16, 35, 28, .10);
  --card-bg: #ffffff;
  --invert-bg: #10231c;
  --invert-fg: #ffffff;
}

:root[data-theme="dark"] {
  --paper: #101713;
  --surface: #17201b;
  --white: #17201b;
  --ink: #eaf2ed;
  --ink-soft: #9db0a6;
  --line: #314239;
  --line-strong: #45594e;
  --green: #42c991;
  --green-dark: #8de0bb;
  --green-pale: #203d30;
  --bg: #101713;
  --bg2: #17201b;
  --bg3: #17201b;
  --card: #17201b;
  --input: #223028;
  --primary: #42c991;
  --primary-hover: #9ce5c3;
  --brand: #42c991;
  --primary-soft: #203d30;
  --text: #eaf2ed;
  --muted: #9db0a6;
  --border: #314239;
  --danger: #ef7777;
  --warning: #e5b54e;
  --warning-soft: #302a1c;
  --info: #73b9e4;
  --info-soft: #1b2b35;
  --success: #8de0bb;
  --shadow: 0 18px 44px rgba(0, 0, 0, .28);
  --card-bg: #17201b;
  --invert-bg: #eaf2ed;
  --invert-fg: #101713;
}

/* Набор токенов finzem-system.css (--fz-*) → новые значения. */
:root {
  --fz-paper: #f4f7f4;
  --fz-surface: #ffffff;
  --fz-ink: #10231c;
  --fz-muted: #61736b;
  --fz-line: #d8e1dc;
  --fz-green: #159a68;
  --fz-green-text: #0d704c;
  --fz-primary-button: #159a68;
  --fz-primary-button-hover: #0d704c;
  --fz-deep: #10231c;
  --fz-sand: #d8c9ae;
  --fz-warn: #a86f08;
  --fz-danger: #c84b4b;
  --fz-shadow: 0 16px 36px rgba(16, 35, 28, .10);
}

:root[data-theme="dark"] {
  --fz-paper: #101713;
  --fz-surface: #17201b;
  --fz-ink: #eaf2ed;
  --fz-muted: #9db0a6;
  --fz-line: #314239;
  --fz-green: #42c991;
  --fz-green-text: #8de0bb;
  --fz-primary-button: #42c991;
  --fz-primary-button-hover: #9ce5c3;
  --fz-deep: #eaf2ed;
  --fz-sand: #d8c9ae;
  --fz-warn: #e5b54e;
  --fz-danger: #ef7777;
  --fz-shadow: 0 18px 44px rgba(0, 0, 0, .28);
}
