/* Визуальная чистка раздела (аудит 28.09.2026). Подключается после visual-polish.css. */

/* ---------- Общее: пустая таблица ---------- */
/* «Нет данных» — строка внутри таблицы, с тем же отступом, что у ячеек,
   а не текст, прилипший к рамке */
.pusk-generic-pane td.empty,
.pusk-logic-center td.empty {
  padding: 14px 16px !important;
  color: var(--text-tertiary, var(--muted, #8a867f));
  font-style: normal;
}

/* Раскрывашка «+ Добавить …»: плюс уже говорит «раскрыть» — треугольник
   перед ним (двойной маркер «▶ +») не рисуем */
summary.pc-plus { list-style: none !important; }
summary.pc-plus::-webkit-details-marker { display: none !important; }
summary.pc-plus::marker { content: "" !important; }
summary.pc-plus::before { content: none !important; }

/* Чип-ссылка или серая подсказка в строке «поля + кнопка» — по центру
   кнопки (кнопка 36–38px, чип 22px), а не по нижней линии */
form.inline > .pc-tag-mid,
form.inline > .pc-hint-mid {
  align-self: flex-end;
  margin-bottom: 8px;
}

/* ---------- Хлебные крошки ---------- */
/* Старое правило style.css «nav a» (кнопки вкладок) цепляло и крошки:
   два пункта были кнопками с рамкой, а последний — текстом. Крошки — текст,
   как и задумано в pusk-system.css; скрепка — тихая, в тон тексту */
body.pusk-generic .pusk-generic-pane > nav.crumbs a {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  font-size: 13px;
}
body.pusk-generic .pusk-generic-pane > nav.crumbs .crumb-pin button {
  filter: grayscale(1);
  opacity: .55;
}
body.pusk-generic .pusk-generic-pane > nav.crumbs .crumb-pin button:hover,
body.pusk-generic .pusk-generic-pane > nav.crumbs .crumb-pin button.on { opacity: 1; filter: none; }

/* ---------- /clients ---------- */
/* Чипы «адрес / контакт / папка» и «висит …» — с зазором по вертикали */
table.clients-compact td > div > .tag { margin: 2px 0; }
/* «Не заполнено»: чипы переносятся ровно, зазор 4px в обе стороны */
table.clients-compact .pc-chips { display: flex; flex-wrap: wrap; gap: 4px; }
table.clients-compact .pc-chips > .tag { margin: 0 !important; white-space: nowrap; }
/* колонке с чипами — больше места, чтобы они не шли по одному в строку */
table.clients-compact th:nth-child(1) { width: 21% !important; }
table.clients-compact th:nth-child(2) { width: 18% !important; }
table.clients-compact th:nth-child(3) { width: 14% !important; }
table.clients-compact th:nth-child(4) { width: 20% !important; }
table.clients-compact th:nth-child(5) { width: 27% !important; }
/* «Деньги» и соседние колонки: все строки одним кеглем, серые — тоже */
table.clients-compact td.small :is(div, a, span:not(.tag)) { font-size: inherit !important; }

/* ---------- /clients/{id}: реквизиты ровной сеткой ---------- */
form.pc-req-grid {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px 12px;
  align-items: end;
}
form.pc-req-grid > div { min-width: 0; }
form.pc-req-grid > div > :is(input, select, textarea) {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}
form.pc-req-grid > .c2 { grid-column: span 2; }
form.pc-req-grid > .c3 { grid-column: span 3; }
form.pc-req-grid > .c4 { grid-column: span 4; }
form.pc-req-grid > .c6 { grid-column: span 6; }
form.pc-req-grid > .c8 { grid-column: span 8; }
form.pc-req-grid > .c9 { grid-column: span 9; }
form.pc-req-grid > .c12 { grid-column: 1 / -1; }
/* разделитель у подписи раздела уже свой (border-top у .block-label) */
form.pc-req-grid > .pc-sect { margin-top: 8px; }
form.pc-req-grid > .pc-sect .block-label { margin: 0; }
@media (max-width: 760px) {
  form.pc-req-grid > div { grid-column: 1 / -1 !important; }
}
/* Строка «кнопка + серая подсказка»: подсказка по центру кнопки */
.pc-row { display: flex !important; flex-wrap: wrap; align-items: center !important; gap: 8px 12px; }
.pc-row > .small { margin: 0; }
/* Поля даты — тем же шрифтом и кеглем, что остальные поля, а не системным */
.pusk-generic-pane input[type=date],
.pusk-generic-pane input[type=datetime-local],
.pusk-generic-pane input[type=time] { font-family: inherit !important; font-size: inherit; }

/* Карточка «Переписка» на странице клиента: заголовок на одной линии
   с кнопкой «начать обсуждение», без пустоты снизу */
.pusk-generic-pane:has(.pc-client-h1) .chat-block .col-head {
  align-items: center !important;
  margin-bottom: 6px !important;
}
.pusk-generic-pane:has(.pc-client-h1) .chat-block .col-head h3 { margin: 0 !important; }
.pusk-generic-pane:has(.pc-client-h1) .chat-block > .empty { margin: 0 !important; padding: 4px 0 0 !important; }

/* ---------- Мелочи общего вида ---------- */
.pc-nowrap { white-space: nowrap; }
/* обычная ссылка — как все ссылки, а не тёмный текст с подчёркиванием */
a.pc-link { color: var(--text-accent, var(--teal, #137f79)) !important; font-size: 13px; }
/* карточка с заголовком: отступ сверху и снизу одинаковый */
.pc-tpl-panel > h3 { margin-top: 0 !important; }
.pc-tpl-panel > :last-child { margin-bottom: 0 !important; }
.pc-tpl-panel > form + details { margin-top: 16px; }

/* ---------- /tariffs, /prices: колонки одной ширины во всех таблицах ---------- */
table.pc-tariffs, table.pc-prices { table-layout: fixed; width: 100%; }
table.pc-tariffs th:nth-child(1) { width: 7%; }
table.pc-tariffs th:nth-child(2) { width: 30%; }
table.pc-tariffs th:nth-child(3) { width: 14%; }
table.pc-tariffs th:nth-child(4) { width: 20%; }
table.pc-tariffs th:nth-child(5) { width: 21%; }
table.pc-tariffs th:nth-child(6) { width: 8%; }
table.pc-prices th:nth-child(1) { width: 7%; }
table.pc-prices th:nth-child(2) { width: 40%; }
table.pc-prices th:nth-child(3) { width: 9%; }
table.pc-prices th:nth-child(4) { width: 10%; }
table.pc-prices th:nth-child(5) { width: 26%; }
table.pc-prices th:nth-child(6) { width: 8%; }
table.pc-tariffs td, table.pc-prices td { overflow-wrap: break-word; }

/* ---------- Строка «поля + кнопка»: всё одной высоты 36, центры на одной линии ---------- */
form.inline.pc-align { align-items: flex-end !important; }
form.inline.pc-align > div > :is(input:not([type=checkbox]):not([type=radio]), select),
form.inline.pc-align > :is(button, .btn-main, .btn-plain) {
  height: 36px !important;
  min-height: 36px !important;
  box-sizing: border-box !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
form.inline.pc-align > :is(button, .btn-main, .btn-plain) {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center;
}

/* ---------- /me/connections: ЭДО ---------- */
table.pc-edo td:nth-child(3) { white-space: nowrap; width: 200px; }
table.pc-edo td:nth-child(3) > div { display: flex; align-items: center; gap: 6px; margin: 2px 0; }

/* ---------- /settings/categories: обе карточки одной высоты ---------- */
.cats { align-items: stretch !important; }

/* ---------- /me/notifications: флажок в строке полей ---------- */
label.check.pc-check-box {
  display: flex !important;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin: 0 !important;
  white-space: nowrap;
}

/* ---------- /casebook: код — моноширинным шрифтом ---------- */
textarea.pc-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  white-space: pre;
}

/* ---------- /users ---------- */
table.pc-users th { white-space: nowrap; }
table.pc-users td:nth-child(5) { white-space: nowrap; }
/* статус и «отключить» — столбиком от одного левого края */
.pc-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.pc-stack > form { margin: 0; }
.pc-stack .link-btn { padding: 0 !important; margin: 0 !important; }

/* ---------- /settings (хаб) ---------- */
/* Место «под карандаш» (crm-conformance.css) — а карандаша здесь нет:
   значения справа висели посередине карточки */
.hub .hub-card { padding-right: 20px !important; }
.hub .hub-card > h3 { margin-top: 0 !important; }
.hub .hub-card li { position: relative; }

/* ---------- /engagements/{id} ---------- */
/* Смена статуса акта: select и «ОК» одной высоты, в одну линию */
form.pc-status-form { display: flex; align-items: center; gap: 6px; margin: 0; }
form.pc-status-form > select { height: 36px !important; min-height: 36px !important; margin: 0 !important; }
form.pc-status-form > button {
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 14px !important;
  margin: 0 !important;
  font-size: 13px !important;
  box-shadow: none !important;
}
table.pc-acts td > details.mini-form { margin-top: 6px; }
form.pc-status-form.pc-wrap { flex-wrap: wrap; }
form.pc-status-form > input:not([type=hidden]) {
  height: 36px !important; min-height: 36px !important; margin: 0 !important; box-sizing: border-box;
}
form.pc-status-form > input[type=date] { width: 150px; }
form.pc-status-form > input[name=approved_by] { width: 110px; min-width: 0 !important; }

/* ---------- /hr/acts: колонки «Кадры» и «Охрана труда» совпадают ---------- */
table.pc-hr-acts { table-layout: fixed; width: 100%; }
table.pc-hr-acts th:nth-child(1) { width: 22%; }
table.pc-hr-acts th:nth-child(2) { width: 17%; }
table.pc-hr-acts th:nth-child(3) { width: 11%; }
table.pc-hr-acts th:nth-child(4) { width: 10%; }
table.pc-hr-acts th:nth-child(5) { width: 10%; }
table.pc-hr-acts th:nth-child(6) { width: 30%; }
table.pc-hr-acts td { overflow-wrap: break-word; }
/* «Экономика проекта»: таблица без своей рамки внутри карточки */
body.pusk-generic .pusk-generic-pane .panel.economy > table.econ.econ:not(.cal):not(.cal-grid):not(.month) {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  margin: 0;
}
.pusk-generic-pane .panel.economy > table.econ td:first-child { padding-left: 0 !important; }
.pusk-generic-pane .panel.economy > details.add-task { margin-top: 12px; }

/* ---------- /logic/journal: шапка как у /logic ---------- */
.logic-journal-head { margin-bottom: 12px; }
.logic-journal-head h1 { margin: 0 !important; font-size: 26px !important; }
.logic-journal-head > p { margin: 6px 0 0; max-width: 820px; }
.logic-journal-tabs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.logic-journal-tabs a {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-muted, #f2efe9);
  text-decoration: none !important;
  border: 0 !important;
  color: inherit;
  font-size: 13px;
  line-height: 1.3;
}
.logic-journal-tabs a.on { background: var(--bg-accent, #168f89); color: #fff !important; }

/* ---------- /contracts: реестр договоров ---------- */
/* Все ячейки — по верху: строка читается слева направо с одной линии */
table.contracts-reg > tbody > tr > td,
table.contracts-reg > tr > td { vertical-align: top !important; }
/* Статус целиком: «Действует», а не «Действуе» */
table.contracts-reg .status-pick {
  min-width: 124px !important;
  width: auto !important;
  padding-right: 28px !important;
  text-overflow: clip;
}
/* Чипы «файл не привязан» / «подписи нет» — с зазором, а не вплотную */
table.contracts-reg td > div.small + div.small,
table.contracts-reg td > div.small + div { margin-top: 4px; }
/* «редакции», «✎» и «✕»: один столбик по центру, кнопки одного вида */
table.contracts-reg td.tools-cell { text-align: center; }
table.contracts-reg td.tools-cell > a.tag { margin: 0 auto; }
table.contracts-reg td.tools-cell .row-tools {
  justify-content: center !important;
  gap: 6px !important;
  margin-top: 6px;
}
table.contracts-reg .row-tools :is(.edit-btn, button.del) {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ds-border, #eae6de) !important;
  border-radius: 999px !important;
  background: var(--bg-surface, #fff) !important;
  font-size: 13px !important;
  line-height: 1 !important;
  box-shadow: none !important;
  opacity: 1 !important;
}
table.contracts-reg .row-tools .edit-btn { color: var(--text-secondary, #5c5953) !important; }
table.contracts-reg .row-tools button.del { color: var(--text-danger, #8f4a52) !important; }
table.contracts-reg .row-tools button.del:hover { background: #faeef0 !important; }
table.contracts-reg .row-tools .del-form { margin: 0; display: inline-flex; }
