/* crm-ds 0.2.0 — дизайн-система нового UI CRM */
/* Google Sans — интерфейс; Google Sans Code — номера, артикулы, коды. 600 — только латиница и кириллица. */
@font-face { font-family: 'Google Sans'; src: url(fonts/GoogleSans-Regular.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Google Sans'; src: url(fonts/GoogleSans-Medium.woff2) format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Google Sans'; src: url(fonts/GoogleSans-SemiBold-latin.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Google Sans'; src: url(fonts/GoogleSans-SemiBold-cyrillic.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Google Sans'; src: url(fonts/GoogleSans-Bold.woff2) format('woff2'); font-weight: 700 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Google Sans Code'; src: url(fonts/GoogleSansCode-Regular.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Google Sans Code'; src: url(fonts/GoogleSansCode-Medium.woff2) format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Google Sans Code'; src: url(fonts/GoogleSansCode-SemiBold.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Google Sans Code'; src: url(fonts/GoogleSansCode-Bold.woff2) format('woff2'); font-weight: 700 800; font-style: normal; font-display: swap; }

:root, .cx-app {
  --cx-text: #1c1c1e;
  --cx-text-2: #3a3a3c;
  --cx-text-3: #48484a;
  --cx-muted: #6e6e73;
  --cx-secondary: #8e8e93;
  --cx-tertiary: #aeaeb2;
  --cx-quaternary: #c7c7cc;
  --cx-blue: #0a7aff;
  --cx-blue-hover: #0062d6;
  --cx-blue-strong: #0a6ee6;
  --cx-blue-tint: rgba(10,122,255,0.10);
  --cx-blue-tint-hover: rgba(10,122,255,0.16);
  --cx-blue-gradient: linear-gradient(180deg,#2b8cff,#0a6ee6);
  --cx-green: #30b15a;
  --cx-green-gradient: linear-gradient(180deg,#34b862,#1f9a4a);
  --cx-red: #ff3b30;
  --cx-orange: #ff9500;
  --cx-indigo: #5e5ce6;
  --cx-purple: #af52de;
  --cx-stripe: #635bff;
  --cx-paypal: #003087;
  --cx-line: rgba(20,24,40,0.06);
  --cx-line-2: rgba(20,24,40,0.08);
  --cx-line-3: rgba(20,24,40,0.10);
  --cx-fill: rgba(20,24,40,0.05);
  --cx-fill-2: rgba(20,24,40,0.06);
  --cx-fill-hover: rgba(20,24,40,0.07);
  --cx-well: rgba(20,24,40,0.035);
  --cx-ground: #eef0f4;
  --cx-ground-image: radial-gradient(900px 500px at 10% -10%,#f6f8fc 0,transparent 60%),radial-gradient(700px 400px at 100% 100%,#e9ecf3 0,transparent 60%);
  --cx-canvas: #f5f6f9;
  --cx-card: #ffffff;
  --cx-glass: rgba(255,255,255,0.82);
  --cx-glass-pop: rgba(255,255,255,0.92);
  --cx-glass-border: rgba(255,255,255,0.90);
  --cx-capsule: linear-gradient(180deg,rgba(255,255,255,0.95),rgba(255,255,255,0.75));
  --cx-tile: linear-gradient(180deg,rgba(255,255,255,0.95),rgba(255,255,255,0.80));
  --cx-scrim: rgba(30,34,48,0.06);
  --cx-scrim-modal: rgba(30,34,48,0.30);
  --cx-scrim-drawer: rgba(30,34,48,0.16);
  --cx-skeleton: linear-gradient(90deg,rgba(20,24,40,0.06) 25%,rgba(20,24,40,0.12) 37%,rgba(20,24,40,0.06) 63%);
  --cx-track: rgba(120,120,128,0.22);
  --cx-row-hover: rgba(20,24,40,0.028);
  --cx-row-selected: rgba(10,122,255,0.07);
  --cx-shadow-panel: 0 1px 2px rgba(20,24,40,0.04),0 8px 24px -12px rgba(20,24,40,0.12);
  --cx-shadow-card: 0 0 0 0.5px rgba(20,24,40,0.08),0 6px 18px -10px rgba(20,24,40,0.18);
  --cx-shadow-sheet: 0 1px 2px rgba(20,24,40,0.04),0 6px 20px -10px rgba(20,24,40,0.10);
  --cx-shadow-pop: 0 1px 2px rgba(20,24,40,0.06),0 24px 60px -20px rgba(20,24,40,0.30);
  --cx-shadow-capsule: inset 0 1px 0 #fff,0 0 0 0.5px rgba(20,24,40,0.08),0 4px 14px -4px rgba(20,24,40,0.14);
  --cx-shadow-tile: inset 0 1px 0 #fff,0 0 0 0.5px rgba(20,24,40,0.10),0 3px 10px -4px rgba(20,24,40,0.16);
  --cx-shadow-tile-hover: inset 0 1px 0 #fff,0 0 0 1px rgba(10,122,255,0.35),0 4px 12px -4px rgba(10,122,255,0.30);
  --cx-shadow-seg: 0 1px 3px rgba(20,24,40,0.12),0 0 0 0.5px rgba(20,24,40,0.04);
  --cx-glow-blue: inset 0 1px 0 rgba(255,255,255,0.3),0 4px 12px -4px rgba(10,110,230,0.6);
  --cx-glow-blue-sm: inset 0 1px 0 rgba(255,255,255,0.35),0 2px 8px -2px rgba(10,122,255,0.55);
  --cx-shadow-menu: 0 0 0 0.5px rgba(20,24,40,0.10),0 2px 6px rgba(20,24,40,0.06),0 18px 44px -14px rgba(20,24,40,0.28);
  --cx-shadow-dialog: 0 0 0 0.5px rgba(20,24,40,0.10),0 10px 30px -10px rgba(20,24,40,0.22),0 40px 100px -30px rgba(20,24,40,0.45);
  --cx-shadow-field: inset 0 0 0 1px rgba(20,24,40,0.12),0 1px 2px rgba(20,24,40,0.04);
  --cx-shadow-field-hover: inset 0 0 0 1px rgba(20,24,40,0.24),0 1px 2px rgba(20,24,40,0.04);
  --cx-shadow-field-focus: inset 0 0 0 1.5px #0a7aff,0 0 0 3px rgba(10,122,255,0.16);
  --cx-shadow-field-invalid: inset 0 0 0 1.5px #ff3b30,0 0 0 3px rgba(255,59,48,0.13);
  --cx-shadow-knob: 0 1px 1px rgba(20,24,40,0.10),0 2px 6px rgba(20,24,40,0.18);
  --cx-note: #fff6c9;
  --cx-note-open: #fff3b8;
  --cx-note-band: linear-gradient(180deg,#fffbea,#fff8de);
  --cx-note-ink: #8a6d1a;
  --cx-note-ink-2: #7a5d0f;
  --cx-note-ink-3: #b39a5a;
  --cx-note-fill: rgba(180,140,20,0.12);
  --cx-note-fill-hover: rgba(180,140,20,0.20);
  --cx-r-xs: 5px;
  --cx-r-sm: 7px;
  --cx-r-md: 10px;
  --cx-r-lg: 12px;
  --cx-r-xl: 14px;
  --cx-r-panel: 16px;
  --cx-r-pop: 14px;
  --cx-r-dialog: 20px;
  --cx-gap: 10px;
  --cx-font: 'Google Sans','Product Sans',Roboto,system-ui,sans-serif;
  --cx-mono: 'Google Sans Code','Geist Mono',ui-monospace,monospace;
  --cx-ease: cubic-bezier(.2,.8,.2,1);
  --cx-tone-teal-solid: linear-gradient(180deg,#24b8bd,#0f9a9f);
  --cx-tone-teal-tint: #ddf6f6;
  --cx-tone-teal-ink: #0a6e72;
  --cx-tone-teal-ring: rgba(15,154,159,0.35);
  --cx-tone-teal-dot: #0f9a9f;
  --cx-tone-green-solid: linear-gradient(180deg,#34b862,#1f9a4a);
  --cx-tone-green-tint: #dff5e6;
  --cx-tone-green-ink: #16733a;
  --cx-tone-green-ring: rgba(31,154,74,0.35);
  --cx-tone-green-dot: #30b15a;
  --cx-tone-blue-solid: linear-gradient(180deg,#2b8cff,#0a6ee6);
  --cx-tone-blue-tint: #e1edff;
  --cx-tone-blue-ink: #0a56b8;
  --cx-tone-blue-ring: rgba(10,110,230,0.32);
  --cx-tone-blue-dot: #0a7aff;
  --cx-tone-indigo-solid: linear-gradient(180deg,#7472f0,#5e5ce6);
  --cx-tone-indigo-tint: #e9e8fd;
  --cx-tone-indigo-ink: #4b49c9;
  --cx-tone-indigo-ring: rgba(94,92,230,0.32);
  --cx-tone-indigo-dot: #5e5ce6;
  --cx-tone-purple-solid: linear-gradient(180deg,#bf6ee8,#af52de);
  --cx-tone-purple-tint: #f4ebfb;
  --cx-tone-purple-ink: #8a35b8;
  --cx-tone-purple-ring: rgba(175,82,222,0.32);
  --cx-tone-purple-dot: #af52de;
  --cx-tone-orange-solid: linear-gradient(180deg,#ffa733,#ff9500);
  --cx-tone-orange-tint: #fff4e0;
  --cx-tone-orange-ink: #b25e00;
  --cx-tone-orange-ring: rgba(255,149,0,0.35);
  --cx-tone-orange-dot: #ff9500;
  --cx-tone-red-solid: linear-gradient(180deg,#ff5a50,#ff3b30);
  --cx-tone-red-tint: #fff0ef;
  --cx-tone-red-ink: #d7261d;
  --cx-tone-red-ring: rgba(255,59,48,0.32);
  --cx-tone-red-dot: #ff3b30;
  --cx-tone-yellow-solid: linear-gradient(180deg,#ffd257,#f5b800);
  --cx-tone-yellow-tint: #fff3d6;
  --cx-tone-yellow-ink: #b7791f;
  --cx-tone-yellow-ring: rgba(183,121,31,0.30);
  --cx-tone-yellow-dot: #f5b800;
  --cx-tone-gray-solid: linear-gradient(180deg,#9a9aa0,#8e8e93);
  --cx-tone-gray-tint: rgba(20,24,40,0.06);
  --cx-tone-gray-ink: #6e6e73;
  --cx-tone-gray-ring: rgba(20,24,40,0.14);
  --cx-tone-gray-dot: #8e8e93;
}

/* База светлого DOM crm-ds: фон приложения, стеклянные панели, утилиты текста.
   Компоненты <cx-*> живут в Shadow DOM и берут отсюда только токены и шрифт. */

.cx-app {
  margin: 0;
  min-height: 100vh;
  background-color: var(--cx-ground);
  background-image: var(--cx-ground-image);
  background-attachment: fixed;
  color: var(--cx-text);
  font-family: var(--cx-font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.cx-app *, .cx-app *::before, .cx-app *::after { box-sizing: border-box; }
.cx-app [hidden] { display: none !important; }
.cx-app a { color: var(--cx-blue); text-decoration: none; }
.cx-app a:hover { color: var(--cx-blue-hover); }
.cx-app ::-webkit-scrollbar { width: 8px; height: 8px; }
.cx-app ::-webkit-scrollbar-thumb { background: #d4d6dc; border-radius: 8px; }
.cx-app ::-webkit-scrollbar-track { background: transparent; }

/* Стеклянная панель — основной слой экрана. --solid — белая без размытия. */
.cx-panel {
  min-width: 0;
  min-height: 0;
  border-radius: var(--cx-r-panel);
  background: var(--cx-glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--cx-glass-border);
  box-shadow: var(--cx-shadow-panel);
}
.cx-panel--solid { background: var(--cx-card); backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Счётчик в ссылке меню разделов */
cx-section a small { font-size: 12px; color: var(--cx-tertiary); font-variant-numeric: tabular-nums; font-weight: 400; }

/* Белая карточка на стекле */
.cx-card { background: var(--cx-card); border-radius: var(--cx-r-panel); box-shadow: var(--cx-shadow-card); }

/* Раскладки */
.cx-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cx-stack { display: flex; flex-direction: column; gap: 10px; }
.cx-page { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px; }

/* Текст */
.cx-h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.cx-h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.cx-caption { font-size: 12px; letter-spacing: 0.06em; font-weight: 600; color: var(--cx-secondary); text-transform: uppercase; }
.cx-muted { color: var(--cx-secondary); }
.cx-mono { font-family: var(--cx-mono); }
.cx-num { font-variant-numeric: tabular-nums; }
.cx-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Таблица (светлые классы): <table class="cx-table">. Шапка капсом 11px, строки с hover, дни, выбор, плотный режим, липкая шапка.
   Поведение выбора строк — обёртка <cx-table selectable> (src/components/cx-table). */
cx-table { display: block; min-width: 0; overflow: auto; }
.cx-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; color: var(--cx-text); }
.cx-table th { padding: 9px 12px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cx-tertiary);
  white-space: nowrap; border-bottom: 1px solid var(--cx-line); background: var(--cx-card); }
.cx-table td { padding: 10px 12px; border-bottom: 1px solid var(--cx-line); vertical-align: middle; line-height: 1.35; transition: background 0.12s ease; }
.cx-table th:first-child, .cx-table td:first-child { padding-left: 16px; }
.cx-table th:last-child, .cx-table td:last-child { padding-right: 16px; }
.cx-table--flush th:first-child, .cx-table--flush td:first-child { padding-left: 0; }
.cx-table--flush th:last-child, .cx-table--flush td:last-child { padding-right: 0; }
.cx-table tbody tr:last-child td { border-bottom: 0; }
.cx-table tbody tr:not(.cx-tr-day):hover td { background: var(--cx-row-hover); }
.cx-table tbody tr.is-selected td, .cx-table tbody tr.is-selected:hover td { background: var(--cx-row-selected); }
.cx-table tr.is-link { cursor: pointer; }
.cx-table tr.is-muted td { color: var(--cx-secondary); }
.cx-table tr.is-muted td > * { opacity: 0.6; }
.cx-table tr.is-muted:hover td > * { opacity: 1; }
.cx-table .cx-td-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-table .cx-td-check { width: 34px; padding-right: 0; line-height: 0; }
.cx-table .cx-td-actions { width: 1%; text-align: right; white-space: nowrap; }
.cx-table .cx-td-sub { margin-top: 1px; font-size: 12px; color: var(--cx-secondary); }
.cx-table th.is-sortable { cursor: pointer; user-select: none; }
.cx-table th.is-sortable:hover { color: var(--cx-muted); }
.cx-table th[aria-sort] { color: var(--cx-text-2); }
.cx-table th[aria-sort]::after { content: ''; display: inline-block; margin-left: 5px; vertical-align: 1px; border: 3.5px solid transparent; }
.cx-table th[aria-sort="ascending"]::after { border-bottom-color: currentColor; border-top-width: 0; }
.cx-table th[aria-sort="descending"]::after { border-top-color: currentColor; border-bottom-width: 0; }
.cx-table--dense th { padding-top: 7px; padding-bottom: 7px; }
.cx-table--dense td { padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.cx-table--sticky thead th { position: sticky; top: 0; z-index: 2; }
.cx-table--sticky .cx-tr-day td { position: sticky; top: 33px; z-index: 1; }
.cx-table--sticky.cx-table--dense .cx-tr-day td { top: 29px; }
/* строка-заголовок дня: подпись, дата, счётчик, чипы статистики */
.cx-table .cx-tr-day td { padding-top: 7px; padding-bottom: 7px; background: var(--cx-canvas); }
.cx-day { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--cx-secondary); }
.cx-day b { font-size: 12px; letter-spacing: 0.06em; font-weight: 600; text-transform: uppercase; color: var(--cx-text-2); }
.cx-day-count { min-width: 18px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--cx-fill-2); color: var(--cx-muted); font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
