/* GURU PVZ — общий слой UX-переработки (ноябрь 2026). Подключается после redesign.css и menu.css.
   Здесь только правила, проверенные на реальном приложении: контраст, активное состояние, мобильная раскладка, выбранные переключатели.
   Расчёты, права, данные и обработчики не затрагиваются; разделы дополняют это в css/ux-*.css. */

/* ---------- B2. Контраст меток и статусов (WCAG 1.4.3: текст ≥ 4,5:1) ---------- */
/* «Частично», предупреждения табеля: янтарный #d97706 на светлой подложке давал 2,6–2,8:1 → тёмный янтарь из токенов (5,5–5,9:1) */
:root:not([data-theme="dark"]) .st.part,
:root:not([data-theme="dark"]) .ts-warn,
:root:not([data-theme="dark"]) .ts-warn b{color:var(--amber-text,#8F4A00);}
/* «Оплачено» в сводке аренды: зелёный #16a34a на белом 3,3:1 → тёмный зелёный (5,4:1) */
:root:not([data-theme="dark"]) .rp-tile.ok b{color:var(--ok-text,#0E7A37);}
/* Тёмная тема: белый текст на светлом акценте #5B88FF давал 3,3:1 → заливка #3A66E8 (4,95:1), как у главной кнопки */
:root[data-theme="dark"] .avatar,
:root[data-theme="dark"] .shiftcell.on,
:root[data-theme="dark"] .ch-av-ozon{background:#3A66E8;}
:root[data-theme="dark"] .ch-av-wb{background:#B32DB9;}            /* белый 5,3:1 (было 3,3:1) */
:root[data-theme="dark"] .ch-chip-n{background:#C42F2F;}           /* белый 5,5:1 (было 3,5:1) */

/* Табель: «Требует расчёта или данных» отличалось от «Отработал» только цветом (WCAG 1.4.1) → метка «!» в углу ячейки и в легенде */
.ts-c.ts-norate{border:1px solid currentColor;}
.ts-c.ts-norate::before{content:"!";position:absolute;top:-6px;left:-5px;width:13px;height:13px;border-radius:50%;
  background:var(--amber-text,#8F4A00);color:#fff;font-size:9px;font-weight:800;line-height:13px;text-align:center;pointer-events:none;}
:root[data-theme="dark"] .ts-c.ts-norate::before{background:#f0a030;color:#1a1200;}

/* ---------- B4. Нижняя панель: активен ровно один пункт ---------- */
/* «Заполнить» был окрашен акцентом и жирным на каждом экране, рядом с настоящим текущим разделом */
#bottomNav .bn-cta:not(.active) .bn-ico,
#bottomNav .bn-cta:not(.active) .bn-lbl{color:inherit;font-weight:500;}
:root[data-theme="dark"] #bottomNav .bn-cta:not(.active) .bn-ico,
:root[data-theme="dark"] #bottomNav .bn-cta:not(.active) .bn-lbl{color:inherit;}

/* ---------- B6. Видимое выбранное состояние переключателей ---------- */
/* «Ежедневные отчёты / Приёмка» в «Отчётах»: aria-pressed уже был, видимого отличия не было */
.report-heading [data-report-scope][aria-pressed="true"]{background:var(--accent-soft,rgba(21,87,255,.10));border-color:var(--accent);color:var(--accent-ink,#0B44D6);}
.report-heading [data-report-scope]{min-height:36px;}
/* Раскрывающиеся блоки без стрелки (display:flex убирает маркер summary): «ПВЗ: все (N)», «Ещё показателей» в аналитике */
.an-points>summary,.an-more>summary{list-style:none;gap:10px;}
.an-points>summary::-webkit-details-marker,.an-more>summary::-webkit-details-marker{display:none;}
.an-points>summary::before,.an-more>summary::before{content:"";flex:none;width:7px;height:7px;margin:0 2px 0 4px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;
  transform:rotate(-45deg);transition:transform .15s ease-out;}
.an-points[open]>summary::before,.an-more[open]>summary::before{transform:rotate(45deg);}
@media (prefers-reduced-motion:reduce){.an-points>summary::before,.an-more>summary::before{transition:none;}}

/* ---------- B5. Переносы по буквам, сжатые колонки, мобильные кнопки ---------- */
/* «Мои ПВЗ» ≤ 800 px: вторая колонка была auto и забирала всю ширину, колонка рейтинга сжималась до 0, текст шёл по одной букве */
@media (max-width:800px){
  .pt-list .pt-row,.pt-list.pt-with-legal .pt-row,.pt-list:not(.pt-with-legal) .pt-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
  .pt-list .pt-rating,.pt-list .pt-status{overflow-wrap:normal;word-break:normal;}
  .pt-list .pt-rating .pt-sub,.pt-list .pt-status .pt-sub{overflow-wrap:break-word;hyphens:auto;}
}
/* «Зарплата» → «Требует внимания»: кнопка «Исправить» сжималась в столбец букв */
.sx-prob>div{flex:1 1 auto;min-width:0;}
.sx-prob>.btn{flex:none;white-space:nowrap;}
/* Фильтры «Отчётов» и «Аналитики» на телефоне: даты рядом, ПВЗ и статус рядом — первый экран не уходит под фильтры */
@media (max-width:600px){
  .report-filters .rp-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .report-filters .rp-grid>:nth-child(n+3){grid-column:1/-1;}   /* ПВЗ и статус — во всю ширину: «Все ПВЗ кабинета» не обрезается */
  .an-dates.rp-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .report-filters .rp-grid input[type=date],.an-dates input[type=date]{min-width:0;padding-left:8px;padding-right:6px;}
  .report-heading .row{flex-wrap:wrap;}
}
/* Цели касания на телефоне: чипы периода и малые кнопки в шапке отчётов были 26–32 px */
@media (max-width:900px){
  .an-presets .chip{min-height:40px;display:inline-flex;align-items:center;padding:0 12px;}
  .report-heading .btn.sm,.report-heading .btn.secondary.sm{min-height:40px;}
}

/* ---------- Помощь: кнопка «? Как пользоваться» и пошаговые инструкции (js/ux-help.js) ---------- */
.sh-button .sh-label::before{content:"?";display:inline-grid;place-items:center;width:20px;height:20px;margin-right:8px;border-radius:50%;
  border:1.5px solid currentColor;font-size:12px;font-weight:700;line-height:1;}
.uxh-tours{margin:16px 0 4px;padding:14px;border:1px solid var(--border);border-radius:12px;background:var(--bg);}
.uxh-tours h3{margin:0 0 4px;font-size:16px;}
.uxh-note{margin:0 0 10px;color:var(--muted);font-size:13.5px;line-height:1.45;}
.uxh-list{display:flex;flex-direction:column;gap:8px;}
.uxh-start{display:flex;align-items:center;gap:10px;justify-content:flex-start;text-align:left;min-height:44px;width:100%;font-weight:600;}
.uxh-i{font-size:11px;color:var(--accent);}
.uxh-ready{margin:10px 0 0;padding:10px 12px;border-radius:10px;background:var(--warn-bg,#FDF3E1);color:var(--text);font-size:14px;}
.uxt{position:fixed;inset:0;z-index:210;pointer-events:none;}
.uxt-dim{position:fixed;background:rgba(8,14,28,.55);pointer-events:auto;}
.uxt-ring{position:fixed;border-radius:10px;outline:3px solid #FFB020;outline-offset:0;box-shadow:0 0 0 6px rgba(255,176,32,.25);pointer-events:none;}
.uxt-tip{position:fixed;pointer-events:auto;box-sizing:border-box;background:var(--card);color:var(--text);border:1px solid var(--border);border-radius:14px;
  padding:14px 16px;box-shadow:0 12px 32px rgba(0,0,0,.3);max-height:calc(100dvh - 24px);overflow:auto;}
.uxt-head{display:flex;gap:8px;align-items:baseline;justify-content:space-between;font-size:12.5px;color:var(--muted);}
.uxt-name{font-weight:600;text-align:right;}
.uxt-tip h2{font-size:17px;margin:6px 0;line-height:1.3;}
.uxt-tip p{margin:0 0 10px;font-size:15px;line-height:1.5;}
.uxt-wait{padding:8px 10px;border-radius:8px;background:var(--accent-soft,rgba(21,87,255,.1));color:var(--accent-ink,#0B44D6);font-size:14px !important;font-weight:600;}
.uxt-act{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.uxt-act .uxt-sp{flex:1;}
.uxt-act .btn{min-height:44px;}
.uxt-act button:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
:root[data-theme="dark"] .uxt-wait{color:#B3CAFF;}
@media (prefers-reduced-motion:reduce){.uxt *{transition:none !important;}}
