/*
  CHELABS Unified UI v2 — tokens
  Version: 2.0.0 (see ../VERSION next to this file, and the header of
  docs/DESIGN_SYSTEM.md)

  The single source of every design value used by the system. Root
  Owner decision of 2026-09-14/15: this is the one master design system
  of the CHELABS ecosystem; every product uses it by default, and a
  product-specific visual style needs a separate, explicit Root Owner
  decision (docs/adr/ADR-016-unified-ui-v2-supersedes-design-system-v1.md).

  Values come from the approved reference,
  docs/design-system/v2-reference/chelabs-ui.css: its :root block is
  ported verbatim (the --cl-* names are the reference's own), and every
  literal colour, shadow and structural dimension the reference spells
  out inside a component rule is lifted here under a role-named token,
  so that base.css / layout.css / components.css contain no colour
  literal at all. Nothing in this file is a taste decision — a value
  not in the reference is marked "(not in the reference)" and says why.

  Contract: control-plane/core/tests_design_system.py fails the build
  on a colour literal outside this file, on an external URL anywhere in
  the system, and on a drift between this file and the copy vendored
  into a product.
*/

:root {
  /* ---------- Core surfaces (reference :root, verbatim) ---------- */
  --cl-page: #f6f6fa;
  --cl-surface: #ffffff;
  --cl-surface-soft: #fbfaff;
  --cl-sidebar: #ffffff;
  --cl-line: #ececf2;
  --cl-line-strong: #dedee7;

  /* ---------- Text (reference :root, verbatim) ---------- */
  --cl-ink: #1e1b2e;
  --cl-text: #2a263c;
  --cl-muted: #938da8;
  --cl-muted-2: #b2adc2;

  /* ---------- Brand / accent (reference :root, verbatim) ---------- */
  --cl-purple: #7a36ec;
  --cl-purple-2: #6e2bdc;
  --cl-purple-hover: #6825d4;
  --cl-purple-soft: #f1ecfe;
  --cl-purple-soft-2: #faf8ff;
  --cl-purple-line: #e4d8ff;

  /* ---------- Semantics (reference :root, verbatim) ---------- */
  --cl-blue: #12a4df;
  --cl-pink: #eb3f92;
  --cl-green: #1fac68;
  --cl-green-soft: #e7f8ef;
  --cl-orange: #f59e2e;
  --cl-orange-soft: #fff3df;
  --cl-red: #ef4e50;
  --cl-red-soft: #fff0f0;
  --cl-yellow-soft: #fff6e6;

  /* ---------- Effects (reference :root, verbatim) ---------- */
  --cl-shadow-card: 0 10px 30px rgba(36, 28, 70, 0.055), 0 1px 2px rgba(36, 28, 70, 0.025);
  --cl-shadow-float: 0 16px 40px rgba(36, 28, 70, 0.13), 0 3px 10px rgba(36, 28, 70, 0.06);
  --cl-shadow-purple: 0 12px 24px rgba(122, 54, 236, 0.20);
  --cl-gradient: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);

  /* ---------- Shape (reference :root, verbatim) ---------- */
  --cl-r-sm: 10px;
  --cl-r-md: 14px;
  --cl-r-lg: 18px;
  --cl-r-xl: 22px;
  --cl-r-pill: 999px;

  /* ---------- Layout (reference :root, verbatim) ---------- */
  --cl-sidebar-w: 282px;
  --cl-content-max: 1500px;

  /* ---------- Motion (reference :root, verbatim) ---------- */
  --cl-ease: cubic-bezier(.2,.8,.2,1);
  --cl-fast: 150ms var(--cl-ease);
  --cl-normal: 220ms var(--cl-ease);

  /* ---------- Typography ----------
     The reference's own stack. Inter is served from ./fonts (see
     base.css); no request ever leaves the origin (Security Baseline:
     no external font/script loads). */
  --cl-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  /* (not in the reference) The reference has no monospace text; the
     Control Plane shows slugs, keys and fingerprints, which need one. */
  --cl-font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* ---------- Colours the reference spells out inside components ----------
     Each one is a literal from chelabs-ui.css, named by the role the
     reference uses it for, so components can reference it by role. */

  /* shell */
  --cl-sidebar-line: #efeff4;        /* .sidebar border-right */
  --cl-brand: #5f29b9;               /* .brand-name */
  --cl-nav-label: #aaa5b8;           /* .nav-label */
  --cl-nav-text: #817b98;            /* .nav-item */
  --cl-nav-hover: #5d37b7;           /* .nav-item:hover colour */
  --cl-nav-hover-bg: #faf8ff;        /* .nav-item:hover background (= --cl-purple-soft-2) */
  --cl-nav-active: #6f2ee1;          /* .nav-item.active colour */
  --cl-profile-sub: #9f99b1;         /* .profile-link span */
  --cl-avatar-text: #7140df;         /* .avatar */
  --cl-subtitle: #9993aa;            /* .page-subtitle, .bonus-hero .label */

  /* buttons */
  --cl-ghost-text: #817a97;          /* .btn.ghost */

  /* cards */
  --cl-card-line: #eeeef4;           /* .card border */
  --cl-card-head-line: #f0eff5;      /* .card-head border-bottom */

  /* tables */
  --cl-th-text: #9993a9;             /* .data-table th (also .pos.gray text) */
  --cl-th-line: #efeff4;             /* .data-table th border-bottom */
  --cl-td-text: #29253a;             /* .data-table td, .input colour */
  --cl-td-line: #f0f0f4;             /* .data-table td border-bottom */
  --cl-row-hover: #fcfbff;           /* .data-table tbody tr:hover */
  --cl-strong-text: #242035;         /* .query */
  --cl-muted-text: #9d97aa;          /* .muted */
  --cl-gray-soft: #f4f3f7;           /* .pos.gray background */

  /* badges (.badge.orange / .red / .green / .purple) */
  --cl-badge-orange-bg: #fff2dd;
  --cl-badge-orange-text: #df8b20;
  --cl-badge-red-bg: #ffeaea;
  --cl-badge-red-text: #ef5558;
  --cl-badge-green-bg: #e5f8ee;
  --cl-badge-green-text: #20a35d;
  --cl-badge-purple-bg: #f1eaff;
  --cl-badge-purple-text: #743be4;

  /* notice (.notice — the amber one; the other tones reuse the semantic
     soft colours above) */
  --cl-notice-line: #f1d8a8;
  --cl-notice-bg: #fff7e8;
  --cl-notice-text: #a35d0b;
  --cl-notice-strong: #8e5009;
  /* (not in the reference) The reference has only the amber notice; for
     14px body text on the green / red soft backgrounds the semantic
     --cl-green / --cl-red measure 2.7:1 / 3.1:1, below WCAG AA. These are
     the same hues darkened the way the reference darkens its amber
     (#f59e2e -> #a35d0b); the icon keeps the undarkened semantic colour. */
  --cl-message-success-text: #157a4b;
  --cl-message-error-text: #c0393b;

  /* forms */
  --cl-label: #302b43;               /* .label */
  --cl-input-line: #e9e8f0;          /* .input border */
  --cl-input-focus-line: #b89af8;    /* .input:focus border */
  --cl-input-disabled-bg: #f5f4f8;   /* .input:disabled */
  --cl-input-disabled-text: #aaa5b4;
  --cl-placeholder: #a9a3b4;         /* .search input::placeholder */

  /* lists / detail */
  --cl-link: #7537e6;                /* .project-name */
  --cl-caption: #aaa4b3;             /* .project-domain */
  --cl-info-key: #9993a7;            /* .info-key */
  --cl-info-value: #282438;          /* .info-value */
  --cl-row-line: #f0eff4;            /* .project-row / .info-row border-top */
  --cl-status-dot: #19ad63;          /* .status-dot */

  /* auth */
  --cl-auth-sub: #77718d;            /* .auth-sub */
  --cl-auth-muted: #706a80;          /* the secondary auth link -- chelabs-ui.html's own inline
                                        style on the "Нет аккаунта?" line, not chelabs-ui.css */
  --cl-auth-check: #29e579;          /* .check */
  --cl-auth-right: radial-gradient(circle at 30% 20%, #8f43f0 0, transparent 36%), linear-gradient(145deg, #7c3aed 0%, #5822b6 100%);
  --cl-on-accent: #ffffff;
  --cl-on-accent-soft: rgba(255, 255, 255, .83);
  --cl-on-accent-strong: rgba(255, 255, 255, .9);

  /* selection / focus */
  --cl-selection: #dfd1ff;                       /* ::selection */
  --cl-focus-outline: rgba(122, 54, 236, .25);   /* :focus-visible */
  --cl-input-focus-ring: 0 0 0 4px rgba(122, 54, 236, .08);

  /* shadows the reference gives to individual components */
  --cl-shadow-brand: 0 6px 14px rgba(122, 54, 236, .18);        /* .brand-mark */
  --cl-shadow-btn: 0 7px 14px rgba(122, 54, 236, .14);          /* .btn */
  --cl-shadow-btn-active: 0 5px 12px rgba(122, 54, 236, .13);   /* .btn:active */
  --cl-shadow-secondary: 0 5px 14px rgba(36, 28, 70, .04);      /* .btn.secondary */
  --cl-shadow-secondary-hover: 0 8px 18px rgba(36, 28, 70, .06);
  --cl-shadow-input: 0 1px 0 rgba(30, 20, 60, .02);             /* .input */
  --cl-shadow-accent-card: 0 14px 28px rgba(106, 42, 219, .16); /* .stat-card.accent */

  /* ---------- Structural dimensions ----------
     Lifted from the reference's component rules so layout and control
     sizes are declared once. */
  --cl-content-pad: 40px 44px 56px;   /* .content */
  --cl-card-pad: 28px;                /* .card.pad, .form-card */
  --cl-gap: 24px;                     /* grid / stack gap */
  --cl-control-h: 44px;               /* .btn */
  --cl-control-h-sm: 37px;            /* .btn.sm */
  --cl-input-h: 47px;                 /* .input */
  --cl-auth-input-h: 61px;            /* .auth-form .input / .btn */
  --cl-nav-item-h: 48px;              /* .nav-item */
  --cl-brand-h: 68px;                 /* .brand */
  --cl-avatar-size: 38px;             /* .avatar */
  --cl-topbar-h: 56px;                /* mobile top bar (not in the reference: the
                                         reference hides the sidebar below 640px with
                                         no way to open it; the drawer needs a bar) */

  /* radii the reference assigns to specific components */
  --cl-r-btn: 11px;                   /* .btn, .input, .select-like */
  --cl-r-btn-sm: 10px;                /* .btn.sm */
  --cl-r-nav: 12px;                   /* .nav-item, .profile-link, .search */
  --cl-r-badge: 8px;                  /* .badge */
  --cl-r-notice: 13px;                /* .notice, auth inputs/button */
  --cl-r-xs: 6px;                     /* inline code chips (not in the reference:
                                         the reference has no inline code element) */

  /* type sizes the reference assigns to specific components */
  --cl-text-body: 15px;               /* body */
  --cl-text-page-title: 30px;         /* .page-title */
  --cl-text-page-title-sm: 26px;      /* .page-title at <=640px */
  --cl-text-card-title: 18px;         /* .card-title, .info-title */
  --cl-text-auth-title: 34px;         /* .auth-title */
  --cl-text-brand: 22px;              /* .brand-name */
}
