/* pestix-polish.css v3.0 — UI polish overlay for pestIX (nginx-injected, app untouched).
 * v3 (t130): WCAG-контраст вторичного текста через переопределение ЛИТЕРАЛЬНЫХ
 *   утилит Tailwind (компилируются в константы, поэтому v1-ремап переменной
 *   --color-stone-400 не действовал). Правила ограничены модификаторами темы:
 *   светлая — :root:not(.dark), тёмная — .dark (там stone-400 читаем и не трогается).
 * Rollback: cp /root/backups/t130-ui-p0/pestix-polish.css /var/www/pestix/mobile-nav-assets/ */

/* 1) Светлая тема: вторичный текст до AA (на белом #f7f7f6/#fff)
 *    stone-400 #a8a29e = 2.52:1 FAIL  -> #78716c = 4.6:1 PASS
 *    gray-400  #9ca3af = 2.84:1 FAIL  -> #6b7280 = 4.8:1 PASS
 *    teal-600  #0d9488 = 3.94:1 FAIL (текстовые кнопки 13–14px) -> #0f766e = 5.4:1 PASS */
:root:not(.dark) .text-stone-400 { color: #78716c !important; }
:root:not(.dark) .text-gray-400  { color: #6b7280 !important; }
:root:not(.dark) .text-teal-600  { color: #0f766e !important; }

/* 2) Тёмная тема: светлые литералы, оставшиеся от light-ветки
 *    stone-600 #44403c на #0c0a09 = 1.5:1 FAIL -> #a8a29e = 8.0:1 PASS
 *    stone-500 #78716c на #0c0a09 = 3.3:1 FAIL -> #a8a29e PASS
 *    amber-600 dark-вариант #92400e = 2.4:1 FAIL -> #d97706 = 6.4:1 PASS (чипы с
 *    пастельной подложкой не задеваем — там свои классы bg-amber-100+text-amber-800) */
.dark .text-stone-600 { color: #a8a29e !important; }
.dark .text-stone-500 { color: #a8a29e !important; }
.dark .text-gray-500  { color: #9ca3af !important; }
.dark .text-amber-600, .dark .text-amber-700 { color: #d97706 !important; }
.dark .text-teal-600, .dark .text-teal-700  { color: #2dd4bf !important; }

/* 3) Ремап переменной оставлен из v1 — не мешает, помогает утилитам на var() */
:root {
  --color-stone-400: #78716c;
}

/* 4) pestIX brand: тайл на экранах входа — монограмма вместо generic-иконки
 * (селектор уникален: h-12 w-12 rounded-xl bg-teal-600 shadow-sm; лого
 *  организаций рендерится через <img> из БД и этим правилом не задевается) */
div.flex.h-12.w-12.items-center.justify-center.rounded-xl.bg-teal-600.text-white.shadow-sm {
  background: #f4f4f5 url(/pestix-icon.png) center/cover no-repeat !important;
}
div.flex.h-12.w-12.items-center.justify-center.rounded-xl.bg-teal-600.text-white.shadow-sm > svg {
  display: none !important;
}

/* ── v3.1 (t130.2): оверлеи с собственными цветами (не Tailwind-утилиты) ── */
/* сайдбар-заголовки групп (pestix-sidebar.js, инлайн color:#a8a29e) */
:root:not(.dark) span[style*="168, 162, 158"] { color: #78716c !important; }
/* дашборд-виджеты (pestix-dash-editor.js: .px-rep-note/.px-chart-meta/.px-lgpct) */
:root:not(.dark) .px-rep-note, :root:not(.dark) .px-chart-meta,
:root:not(.dark) .px-lgpct { color: #78716c !important; }
:root:not(.dark) .pxux2-daycreate { color: #0f766e !important; }
/* px-leads «Заявки с сайта»: карточка с инлайн background:#fff в обеих темах */
[data-pxleads-card] div[style*="9ca3af"] { color: #6b7280 !important; }
.dark [data-pxleads-card] { background: #1c1917 !important; border-color: #44403c !important; color: #e7e5e4 !important; }
.dark [data-pxleads-card] div[style*="9ca3af"] { color: #a8a29e !important; }
.dark [data-pxleads-card] span[style*="6b7280"] { color: #a8a29e !important; }
.dark [data-pxleads-card] button { background: #292524 !important; border-color: #44403c !important; color: #e7e5e4 !important; }
/* px-wn «Что нового»: dark.css темнит карточку, инлайн-тексты остаются светлыми */
.dark #px-wn-root li { color: #d6d3d1 !important; }
.dark #px-wn-root div[style*="color:#1c1917"] { color: #e7e5e4 !important; }
.dark #px-wn-root div[style*="color:#78716c"] { color: #a8a29e !important; }
.dark #px-wn-root div[style*="color:#0d9488"] { color: #5eead4 !important; }
/* dark.css ремапит --color-stone-300 → #44403c: цифры календаря на тёмных карточках невидимы */
.dark .text-stone-300 { color: #d6d3d1 !important; }

/* ── v3.2 (t130.3): дочистка по повторному замеру ── */
/* дашборд-виджеты: пустые состояния и подписи KPI */
:root:not(.dark) .px-rep-empty { color: #78716c !important; }
.dark .px-rep-empty, .dark .px-lg { color: #a8a29e !important; }
/* geo-enhance: подписи недельной ленты (светлая тема) */
:root:not(.dark) .geo-wk-note, :root:not(.dark) .geo-wk-scope { color: #78716c !important; }
/* teal-600 инлайн-ссылки/заголовки на белом (12–13px) */
:root:not(.dark) a[style*="0d9488"], :root:not(.dark) div[style*="0d9488"] { color: #0f766e !important; }
#px-wn-root div[style*="color:#0d9488"] { color: #0f766e !important; }
.dark #px-wn-root div[style*="color:#0d9488"] { color: #5eead4 !important; }
/* кнопка «+ Создать наряд на этот день» в тёмной теме */
.dark .pxux2-daycreate { color: #2dd4bf !important; }
/* «Где смотреть: …» в виджете рейтинга (светлая тема) */
:root:not(.dark) .px-rt-more a { color: #0f766e !important; }

/* ── v4.0 (t131): P1 — типографика кабинета, бренд-кнопки dark (решение владельца),
 *    остатки контраста my-org/reports, кегль данных ≥12px ── */

/* 1) Единая типографика: Manrope (тот же вариативный шрифт 200–800, что на витрине).
 *    Скоуп — только кабинет Next: body имеет связку font-sans+antialiased+bg-background+
 *    text-foreground; лендинг/legal/calc/hub/market имеют <body> без классов. */
@font-face{font-family:'Manrope';font-style:normal;font-weight:200 800;font-display:swap;
  src:url(/manrope-lat.woff2) format('woff2');
  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:'Manrope';font-style:normal;font-weight:200 800;font-display:swap;
  src:url(/manrope-cyr.woff2) format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;}
body.font-sans.antialiased.bg-background.text-foreground {
  font-family:'Manrope',Inter,ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif !important;
}

/* 2) Кегль данных ≥12px: Tailwind-литерал text-[11px] (календарь работ) + подписи
 *    виджетов дашборда (dash-editor). SVG-подписи графиков и kbd не трогаем —
 *   метрики/раскладка чартов зафиксированы. */
.text-\[11px\] { font-size: 12px !important; }
.px-chart-meta, .px-lgpct, .px-lg, .px-chart-legend, .px-pill button { font-size: 12px !important; }

/* 3) Остатки контраста светлой темы (my-org, reports) — инлайн-цвета оверлеев:
 *    stone-400 #a8a29e 2.52:1 → #78716c 4.80:1; gray-400 #9ca3af 2.84:1 → #6b7280 4.83:1;
 *    .pxtgs-badge.pxtgs-off slate-500 на #f1f5f9 4.34:1 → #475569 6.92:1 */
:root:not(.dark) .pxmo-hintv { color: #78716c !important; font-size: 12px !important; }
:root:not(.dark) .pxcat-hint { color: #78716c !important; }
:root:not(.dark) .pxtgs-hint { color: #6b7280 !important; font-size: 12px !important; }
.pxtgs-badge { font-size: 12px !important; }
:root:not(.dark) .pxtgs-badge.pxtgs-off { color: #475569 !important; }
:root:not(.dark) span[style*="a8a29e"], :root:not(.dark) div[style*="a8a29e"],
:root:not(.dark) span[style*="168, 162, 158"] { color: #78716c !important; }
:root:not(.dark) div[style*="9ca3af"], :root:not(.dark) span[style*="156, 163, 175"],
:root:not(.dark) div[style*="156, 163, 175"] { color: #6b7280 !important; }

/* 4) Брендовые кнопки в тёмной теме: teal-600 → teal-700 (решение владельца, t131;
 *    белый на #0d9488 = 3.74:1 FAIL → на #0f766e = 5.47:1 PASS).
 *    Праймари-переменные правятся в pestix-dark.css, здесь — литеральные bg-teal-600
 *    и активный период графиков dash-editor. «Экспорт» на /работах: teal-700 текст
 *    на #0c0a09 = 3.61:1 → #2dd4bf = 10.61:1. */
.dark .bg-teal-600 { background-color: #0f766e !important; }
.dark .px-pill button.on { background: #0f766e !important; color: #fff !important; }
.dark #pxc-export-btn { color: #2dd4bf !important; border-color: #2dd4bf !important; }

/* ── v4.1 (t131): дочистка мелких кеглей — инлайн-стили компилята Next ──
 *    метки групп сайдбара («Основное», «Компания», …), подпись «пока нет оценок»,
 *    ссылка «открыть каталог», 2FA-бейдж. Счётчик уведомлений и шевроны не трогаем
 *   (декоративные, фиксированные контейнеры). */
span[style*="font-size: 11px"][style*="letter-spacing: 0.05em"] { font-size: 12px !important; }
span[style*="font-size: 11px"][style*="--muted-foreground"] { font-size: 12px !important; }
a[style*="font-size:11px"] { font-size: 12px !important; }
.px2-badge { font-size: 12px !important; }
