/* Токены (:root, --app-ui-radius и т.д.) подключаются в HTML как css/tokens.css до этого файла — см. Dockerfile (единый ?v=). */

/* Страница администратора — добавление ассортимента */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
  overflow-y: scroll;
}

/* Удерживаем место под вертикальный скроллбар, чтобы верстка не "прыгала"
   при смене фильтров/статусов и изменении высоты таблиц. */
html {
  scrollbar-gutter: stable;
  background: #f5f6fa;
}

/* Flex/grid: переполнение без смены внешнего вида (classic-plus) */
.layout > .content,
.blocks-row,
.characteristics-grid,
.characteristics-top,
.characteristics-bottom,
.characteristics-subrow,
.table-wrap,
.table-wrap--full {
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: #2c2c2c;
  color: #fff;
  padding: 0.7rem 0;
  flex-shrink: 0;
}

.nav-link {
  display: block;
  padding: 0.6rem 1.2rem;
  color: #ccc;
  text-decoration: none;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.nav-link--active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

.sidebar-nav {
  overflow-y: auto;
  padding-right: 0.2rem;
}

.nav-group {
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 0.2rem;
  margin-top: 0.2rem;
}

.nav-group:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.nav-group__title {
  display: block;
  padding: 0.28rem 0.8rem 0.2rem;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
}

.nav-sub-link {
  display: block;
  padding: 0.2rem 0.8rem 0.2rem 1.4rem;
  color: #d1d5db;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.2;
}

.nav-sub-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.nav-sub-link--active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

.nav-sub-link--disabled {
  color: #6b7280;
  cursor: default;
  pointer-events: none;
}

.nav-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 0.25rem;
}

.nav-footer-link {
  display: block;
  padding: 0.24rem 0.8rem;
  color: #d1d5db;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.2;
}

.nav-footer-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.nav-footer-link--danger {
  color: #fca5a5;
}

.nav-footer-link--disabled {
  color: #6b7280;
  pointer-events: none;
  cursor: default;
}

.nav-version {
  display: block;
  padding: 0.2rem 0.8rem 0.1rem;
  color: #9ca3af;
  font-size: 11px;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1.25rem;
  /* Горизонтальный скролл широких таблиц — внутри .table-wrap / .table-wrap--full, не на всём main */
  overflow-x: hidden;
}

.header {
  margin-bottom: 1.5rem;
}

.header__cost {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header__cost label {
  white-space: nowrap;
}

.input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.input--short {
  width: 120px;
}

.section {
  margin-bottom: 2rem;
}

.section__title {
  margin: 0 0 1rem;
  font-size: 15px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.badge-admin {
  font-size: 0.7rem;
  font-weight: 600;
  background: #fee2e2;
  color: #b91c1c;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --- Три блока в ряд --- */

.blocks-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  container-type: inline-size;
  container-name: vasilek-blocks-row;
}

.characteristics-grid {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.characteristics-top {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.characteristics-bottom {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.characteristics-bottom > .block {
  flex: 1;
}

.block-ops {
  flex: 2;
}

.block-upload-small {
  flex: 1;
  max-width: 420px;
}

.csv-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.csv-file-btn {
  cursor: pointer;
  margin: 0;
}

.csv-action-btn {
  width: auto;
  height: auto;
  padding: 0.5rem 0.8rem;
  font-size: 14px;
  line-height: 1.2;
}

.equipop-export {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.equip-op-row .equip-op-equip {
  flex: 1;
  min-width: 160px;
}

.equip-op-row .equip-op-operation {
  flex: 2;
  min-width: 260px;
}

.characteristics-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.characteristics-subrow {
  display: flex;
  gap: 1rem;
}

.characteristics-subrow > .block {
  flex: 1;
  min-width: 0;
}

.catalog-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.catalog-head-actions {
  margin-left: auto;
  flex-wrap: nowrap;
}

.block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.block--wide {
  flex: 3;
}

.block--narrow {
  flex: 1;
  max-width: 320px;
}

.block__title {
  margin: 0;
  font-size: 15px;
}

.block__sub {
  margin: 0;
  font-weight: normal;
  color: #666;
  font-size: 0.85em;
}

.input--uniform {
  width: 100%;
}

.btn--uniform {
  width: 100%;
}

/* --- Кнопки --- */

.btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: center;
}

.btn--primary {
  background: #2563eb;
  color: #fff;
}

.btn--primary:hover {
  background: #1d4ed8;
}

.btn--secondary {
  background: #e5e7eb;
  color: #374151;
}

.btn--secondary:hover {
  background: #d1d5db;
}

.btn--outline {
  background: #fff;
  color: #374151;
  border-color: #d1d5db;
}

.btn--outline:hover {
  background: #f3f4f6;
}

/* --- Строки операций (не используется сейчас, но оставлено для будущего) --- */

/* --- Таблица --- */

.table-wrap {
  overflow-x: auto;
  width: 100%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: var(--table-density-padding-y) var(--table-density-padding-x);
  text-align: left;
  border-bottom: 1px solid #eee;
}

.table th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
}

.table tbody tr:hover {
  background: #f9fafb;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table--empty tbody td {
  color: #9ca3af;
  font-style: italic;
}

/* --- Действия под таблицей --- */

.table-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn--danger {
  background: #dc2626;
  color: #fff;
}

.btn--danger:hover {
  background: #b91c1c;
}

/* --- Подсказка в хедере --- */

.header__hint {
  color: #9ca3af;
  font-size: 0.85em;
}

/* --- Подсказки в таблице финансов --- */

.pay-period-hint {
  color: #9ca3af;
  font-size: 0.85em;
}

.cost-hint {
  color: #6b7280;
  font-size: 0.8em;
  font-weight: normal;
  white-space: nowrap;
}

.finance-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.finance-head-row .section__title {
  margin-bottom: 0;
}

/* --- Формы (страница финансов) --- */

.form-row {
  margin-bottom: 0.6rem;
}

select.input {
  width: 100%;
  appearance: auto;
}

/* --- Строка добавления (input + кнопка) --- */

.add-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.add-row .btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

.btn--icon {
  font-size: 14px !important;
  border-radius: 8px;
}

.tag__remove-link {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  background: #fff;
}

.tag__remove-link:hover {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fee2e2;
}

/* --- Теги (размеры / цвета) --- */

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #e5e7eb;
  color: #374151;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 13px;
}

.tag__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.tag__remove:hover {
  color: #dc2626;
}

.tags-empty {
  color: #9ca3af;
  font-size: 0.85em;
  font-style: italic;
}
.tags-more {
  display: inline-block;
  color: #6b7280;
  font-size: 0.8em;
  font-style: italic;
  margin-right: 0.4rem;
  vertical-align: middle;
}

/* --- Статусы заказов --- */

.input--status {
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #d1d5db;
  cursor: pointer;
  width: auto;
}

.status--ready {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.status--active {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.status--paused {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.status--done {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.status--cancelled {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #d1d5db;
}

.status--rework {
  background: #efe9ff;
  color: #5b3db5;
  border-color: #d8c9ff;
}

.cell-code {
  font-family: inherit;
  font-size: 13px;
}

.batch-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}
.batch-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

/* --- Таблица заказов (широкая; политика скролла/min-width — токены) --- */

.table-wrap--full {
  overflow-x: auto;
}

.table--orders {
  table-layout: var(--table-orders-layout);
  width: 100%;
  min-width: var(--table-orders-min-width);
}

.table--orders th,
.table--orders td {
  padding: var(--table-orders-cell-padding-y) var(--table-orders-cell-padding-x);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  font-size: var(--table-orders-cell-font-size);
}

/* Столбцы допускающие перенос: Операция (2), Исполнитель (8), Код пачки (9) */
.table--orders th:nth-child(2),
.table--orders td:nth-child(2),
.table--orders th:nth-child(8),
.table--orders td:nth-child(8),
.table--orders th:nth-child(9),
.table--orders td:nth-child(9) {
  white-space: normal;
  word-break: break-word;
  overflow: visible;
  text-overflow: clip;
}

/* Ширины столбцов */
.table--orders col.col-model       { width: 9%; }
.table--orders col.col-operation   { width: 14%; }
.table--orders col.col-equipment   { width: 9%; }
.table--orders col.col-size        { width: 5%; }
.table--orders col.col-color       { width: 6%; }
.table--orders col.col-qty         { width: 5%; }
.table--orders col.col-status      { width: 13%; }
.table--orders col.col-workers     { width: 13%; }
.table--orders col.col-batch       { width: 12%; }
.table--orders col.col-time-batch  { width: 8%; }
.table--orders col.col-time-unit   { width: 8%; }

/* --- Пагинация --- */

.pagination {
  display: flex;
  gap: 0.4rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.btn--sm {
  padding: 0.3rem 0.6rem;
  font-size: 13px;
  min-width: 32px;
}

/* --- Исполнители (ячейка таблицы) --- */

.workers-cell {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 140px;
}

.workers-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.tag--sm {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.45rem;
  border-radius: 12px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

.tag__remove {
  background: none;
  border: none;
  color: #6366f1;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 2px;
}
.tag__remove:hover {
  color: #dc2626;
}

.input--worker-add {
  font-size: 12px;
  padding: 0.2rem 0.3rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #6b7280;
  max-width: 150px;
}

/* --- Кнопки-чипы (быстрый выбор) --- */

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.chip--active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.chip--active:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* --- Автокомплит --- */

.ac-wrap {
  position: relative;
}

.ac-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid #d1d5db;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ac-list--open {
  display: block;
}

.ac-item {
  padding: 0.5rem 0.75rem;
  font-size: 13px;
  cursor: pointer;
}

button.ac-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  border-radius: 6px;
}

button.ac-item:focus {
  outline: none;
}

button.ac-item:focus-visible {
  background: #e8f0ff;
  color: #1d4ed8;
}

.ac-item:hover {
  background: #eff6ff;
}

.ac-item--empty {
  color: #9ca3af;
  cursor: default;
  font-style: italic;
}

.ac-item--empty:hover {
  background: transparent;
}

.ac-picked {
  margin-top: 0.4rem;
}

.ac-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 13px;
}

.ac-tag__remove {
  background: none;
  border: none;
  color: #6366f1;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
}

.ac-tag__remove:hover {
  color: #dc2626;
}

.cart-actions {
  display: flex;
  gap: 0.3rem;
}

.order-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.btn-delete-status-order--disabled {
  pointer-events: none;
}

/* --- Поисковый выпадающий список (Ассортимент) --- */

.dropdown-search {
  position: relative;
}

.dropdown-search__list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid #d1d5db;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 0.15rem 0.28rem;
  box-sizing: border-box;
}

.dropdown-search__item {
  padding: 0.5rem 0.75rem;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
}

.dropdown-search__item:hover {
  background: #eff6ff;
}

.dropdown-search__empty {
  padding: 0.5rem 0.75rem;
  font-size: 13px;
  color: #9ca3af;
  font-style: italic;
}

.dropdown-search__picked {
  margin-top: 0.35rem;
}

.dropdown-search__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 13px;
}

.dropdown-search__tag-rm {
  background: none;
  border: none;
  color: #6366f1;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
}

.dropdown-search__tag-rm:hover {
  color: #dc2626;
}

/* --- Поиск и инлайн-редактирование --- */

.search-bar {
  margin-bottom: 1rem;
}

.input--sm {
  padding: 0.3rem 0.5rem;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  width: 100%;
}

select.input--sm {
  appearance: auto;
}

.row-editing {
  background: #fffbeb;
}

.row-editing td {
  vertical-align: middle;
}

/* Фикс: одинаковая высота строки при переключении просмотр/редактирование */
#tableOperations tbody td {
  min-height: 36px;
  vertical-align: middle;
}

/* Фикс: при редактировании не меняем ширины столбцов в "Все модели" */
#tableOperations {
  table-layout: fixed;
}

#tableOperations th:nth-child(1),
#tableOperations td:nth-child(1) { width: 14%; }
#tableOperations th:nth-child(2),
#tableOperations td:nth-child(2) { width: 8%; }
#tableOperations th:nth-child(3),
#tableOperations td:nth-child(3) { width: 14%; }
#tableOperations th:nth-child(4),
#tableOperations td:nth-child(4) { width: 15%; }
#tableOperations th:nth-child(5),
#tableOperations td:nth-child(5) { width: 22%; }
#tableOperations th:nth-child(6),
#tableOperations td:nth-child(6) { width: 9%; }
#tableOperations th:nth-child(7),
#tableOperations td:nth-child(7) { width: 8%; }
#tableOperations th:nth-child(8),
#tableOperations td:nth-child(8) { width: 10%; }

#tableOperations .row-editing .input--sm {
  height: 30px;
  font-size: 11px;
  line-height: 1.2;
  font-family: inherit;
}

/* --- Страница разрядов --- */

.grades-list .grade-card {
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--df-border);
  border-radius: 10px;
  background: #fff;
}

.page-grades .section {
  margin-bottom: 0.5rem;
}

.page-grades .grades-panel {
  max-width: 760px;
  gap: 0.35rem;
  padding: 0.55rem 0.62rem;
}

.page-grades .grades-add-row {
  align-items: center;
  gap: 0.42rem;
}

.page-grades .grades-row {
  align-items: center;
  gap: 0.36rem;
}

.page-grades .grade-card__name {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  font-size: 12px;
  color: #1f2a44;
}

.page-grades .grade-card__input-wrap {
  flex: 1;
  min-width: 150px;
}

.page-grades .grade-card__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.page-grades .btn-grade-delete {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  color: #64748b;
}

.page-grades .btn-grade-delete:hover {
  color: #b91c1c;
}

.page-grades .grades-empty {
  color: #9ca3af;
  font-style: italic;
  margin: 0.1rem 0;
}

.page-grades .grades-list .grade-card {
  padding: 0;
  margin-bottom: 0.22rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.page-grades .grades-list .grade-card:last-child {
  margin-bottom: 0;
}

.page-grades #gradesListWrap .grade-card,
.page-grades #gradesListWrap .block {
  border: 0;
  box-shadow: none;
}

.page-grades .grades-list .grade-card .blocks-row {
  gap: 0.36rem;
}

.page-grades .grades-list .btn-update-grade {
  min-width: 82px;
  min-height: 30px;
  padding: 0.24rem 0.5rem;
}

/* ============================================================
   Адаптивная вёрстка
   ============================================================ */

/* --- Средние экраны (≤1400px, ~13-14" ноутбуки) ---
   Ширина сайдбара и плотность таблиц — tokens.css (.sidebar/.content classic-plus ниже). */

@media (max-width: 1400px) {
  .nav-link {
    padding: 0.55rem 1rem;
    font-size: 13px;
  }

  /* Блоки переносятся по 2 в ряд */
  .blocks-row {
    flex-wrap: wrap;
  }
  .blocks-row > .block {
    min-width: calc(50% - 0.5rem);
    flex: 1 1 calc(50% - 0.5rem);
  }
  .characteristics-subrow {
    flex-wrap: wrap;
  }
  .characteristics-subrow > .block {
    min-width: calc(50% - 0.5rem);
    flex: 1 1 calc(50% - 0.5rem);
  }
  .characteristics-bottom {
    flex-wrap: wrap;
  }
  .characteristics-bottom > .block {
    min-width: calc(50% - 0.5rem);
    flex: 1 1 calc(50% - 0.5rem);
  }

  /* Таблица заказов — всегда горизонтальный скролл */
  .table-wrap--full {
    overflow-x: auto;
  }

  /* Таблицы — компактнее (плотность синхронизирована с tokens.css) */
  .table th,
  .table td {
    padding: var(--table-density-padding-y) var(--table-density-padding-x);
    font-size: var(--table-density-font-size);
  }
}

/* --- Малые экраны (≤1200px) --- */

@media (max-width: 1200px) {
  .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 12.5px;
  }
  .section__title {
    font-size: 1.1rem;
  }

  /* Блоки — по одному в ряд */
  .blocks-row > .block {
    min-width: 100%;
    flex: 1 1 100%;
  }
  .characteristics-grid {
    flex-direction: column;
  }
  .characteristics-top,
  .characteristics-bottom {
    flex-direction: column;
  }
  .characteristics-col {
    width: 100%;
  }
  .characteristics-subrow > .block {
    min-width: 100%;
    flex: 1 1 100%;
  }
  .characteristics-bottom > .block {
    min-width: 100%;
    flex: 1 1 100%;
  }
  .block--narrow {
    max-width: 100%;
  }

  /* Таблица финансов */
  .table th,
  .table td {
    padding: var(--table-density-padding-y) var(--table-density-padding-x);
    font-size: var(--table-density-font-size);
  }
}

/* --- Очень узкие экраны (≤1024px) --- */

@media (max-width: 1024px) {
  .nav-link {
    padding: 0.45rem 0.6rem;
    font-size: 12px;
  }
  .block {
    padding: 1rem;
  }
}

/* --- Узкие ноутбуки (≤900px) --- */

@media (max-width: 900px) {
  .nav-link {
    font-size: 11.5px;
    padding: 0.45rem 0.5rem;
  }
  .section__title {
    font-size: 1rem;
    gap: 0.45rem;
  }
  .table th,
  .table td {
    padding: var(--table-density-padding-y) var(--table-density-padding-x);
    font-size: var(--table-density-font-size);
  }
}

/* --- Совсем узкие экраны (≤768px) --- */

@media (max-width: 768px) {
  .nav-link {
    font-size: 11px;
    padding: 0.4rem 0.45rem;
  }
  .block {
    padding: 0.8rem;
    gap: 0.5rem;
  }
}

/* ============================================================
   Тема classic-plus (только внешний вид)
   ============================================================ */

:root {
  --df-bg: #f5f6fa;
  --df-surface: #ffffff;
  --df-surface-soft: #f9fafc;
  --df-border: #e5e9f2;
  --df-text: #1f2937;
  --df-muted: #6b7280;
  --df-primary: #0168fa;
  --df-primary-strong: #0050c7;
  --df-danger: #e8505b;
  --df-shadow: 0 10px 24px rgba(28, 39, 60, 0.06);
}

body {
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--df-text);
  background: var(--df-bg);
  /* Единое сглаживание: на macOS без этого основной текст часто выглядит «жирнее», чем на Windows */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input,
select,
textarea,
button {
  font-family: inherit;
  font-variant-numeric: normal;
}

.layout {
  min-height: 100vh;
  background: var(--df-bg);
}

.sidebar {
  width: var(--layout-sidebar-width);
  background: var(--df-surface);
  color: var(--df-text);
  border-right: 1px solid var(--df-border);
  box-shadow: none;
  /* Без padding-right: полоса справа от скролла у границы не нужна */
  padding: 0.7rem 0 0.7rem 0.55rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  flex-shrink: 0;
  transition: width 0.2s ease, padding 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 768px) {
  html.admin-nav-collapsed .sidebar {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border-right-color: transparent;
    overflow: hidden;
  }
}

.sidebar-nav {
  padding-right: 0;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.nav-group {
  border-top: none;
  margin-top: 0.16rem;
  padding-top: 0;
}

.nav-group__title {
  display: block;
  width: 100%;
  position: relative;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.42rem 1.45rem 0.42rem 0.52rem;
  color: #1f2937;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-group__title::after {
  content: "›";
  position: absolute;
  right: 0.52rem;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  color: #94a3b8;
  font-size: 15px;
  line-height: 1;
  transition: transform 0.15s ease, color 0.15s ease;
}

.nav-group--open .nav-group__title::after {
  transform: translateY(-50%) rotate(0deg);
  color: #64748b;
}

.nav-group__title:hover {
  background: #f3f6fb;
  color: #0f172a;
}

.nav-group:not(.nav-group--open) .nav-sub-link {
  display: none;
}

.nav-sub-link {
  margin: 0.06rem 0 0.06rem 0.5rem;
  border-radius: 0 8px 8px 0;
  border-left: 2px solid #e2e8f0;
  padding: 0.28rem 0.46rem 0.28rem 0.64rem;
  color: #334155;
  font-size: 11.5px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-sub-link:hover {
  background: #f5f8ff;
  color: #1e4fb8;
  border-left-color: #bfdbfe;
}

.nav-sub-link--active {
  background: #ecf3ff;
  color: #1d4ed8;
  border-left-color: #60a5fa;
  font-weight: 600;
}

.nav-sub-link--disabled {
  color: #94a3b8;
  border-left-color: #e2e8f0;
}

.nav-footer {
  border-top: 1px solid var(--df-border);
  margin-top: 0.35rem;
  padding-top: 0.28rem;
  padding-bottom: max(0.2rem, env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
}

.nav-footer-link {
  margin: 0.06rem 0;
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  color: #3a475b;
  font-size: 11px;
}

.nav-footer-link:hover {
  background: #f3f6fb;
  color: #3b4658;
}

.nav-footer-link--danger {
  color: var(--df-danger);
}

.nav-version {
  color: #6f7f97;
  font-size: 10px;
  padding: 0.28rem 0.5rem 0.12rem;
}

.nav-footer-row {
  margin: 0.06rem 0;
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  color: #3a475b;
  font-size: 11px;
  line-height: 1.2;
}

.nav-footer-row .nav-footer-link {
  display: inline;
  margin: 0;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.nav-footer-row .nav-footer-link:hover {
  background: transparent;
  color: inherit;
  text-decoration: underline;
}

.nav-footer-row .nav-footer-link--disabled {
  color: #3a475b;
}

.nav-footer-row .nav-footer-link--danger {
  color: var(--df-danger);
}

.nav-footer-sep {
  display: inline-block;
  margin: 0 0.2rem;
  color: #6f7f97;
}

.nav-footer-version {
  color: #6f7f97;
}

/* Мобильный drawer навигации (кнопка и бэкдроп создаётся в auth.js) */
.admin-nav-toggle {
  display: inline-flex;
  position: fixed;
  z-index: 60;
  top: 0.65rem;
  left: 0.5rem;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--df-border);
  border-radius: 10px;
  background: var(--df-surface);
  color: var(--df-text);
  cursor: pointer;
  box-shadow: var(--df-shadow);
  opacity: 1;
  transition: opacity 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, filter 0.16s ease;
}

.admin-nav-toggle__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
  transition: opacity 0.16s ease, filter 0.16s ease, transform 0.16s ease;
}

.admin-nav-toggle__icon svg {
  width: 100%;
  height: 100%;
}

.admin-nav-toggle:hover {
  background: #f3f6fb;
}

.admin-nav-toggle:focus-visible,
.admin-nav-toggle:hover {
  opacity: 1;
}

.admin-nav-toggle:active .admin-nav-toggle__icon {
  filter: grayscale(0.42) brightness(0.85);
  opacity: 0.76;
  transform: scale(0.95);
}

@media (min-width: 768px) {
  html:not(.admin-nav-collapsed) .admin-nav-toggle {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }
}

/* Полоса сворачивания меню (десктоп): ~5px у левого края экрана, серая → темнее при hover; разворот — по кнопке «меню» */
.sidebar-collapse-edge {
  display: none;
}

@media (min-width: 768px) {
  html:not(.admin-nav-collapsed) .sidebar-collapse-edge {
    display: block;
  }

  .sidebar-collapse-edge {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    width: 12px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-collapse-edge::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 5px;
    border-radius: 0 2px 2px 0;
    background: #e5e7eb;
    transition: background 0.28s ease, transform 0.2s ease;
  }

  .sidebar-collapse-edge:hover::before {
    background: #6b7280;
  }

  .sidebar-collapse-edge:active::before {
    transform: scaleX(1.08);
  }

  .sidebar-collapse-edge:focus-visible {
    outline: none;
  }

  .sidebar-collapse-edge:focus-visible::before {
    background: #575e68;
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.35);
  }
}

.admin-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

html.admin-nav-open .admin-nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 767px) {
  .admin-nav-backdrop {
    display: block;
  }

  html.admin-nav-open {
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(88vw, 280px);
    max-width: 280px;
    height: 100%;
    max-height: 100dvh;
    min-height: 0;
    z-index: 50;
    margin: 0;
    transform: translate3d(-102%, 0, 0);
    transition: transform 0.22s ease;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
    align-self: stretch;
  }

  html.admin-nav-open .sidebar {
    transform: translate3d(0, 0, 0);
  }

  .layout > .content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

.content {
  padding: var(--layout-content-padding-y) var(--layout-content-padding-x);
}

.section__title {
  margin-bottom: 0.9rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: #1f2a44;
}

.badge-admin {
  background: #edf4ff;
  color: #2563eb;
  border: 1px solid #d8e7ff;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.block,
.table-wrap {
  background: var(--df-surface);
  border: 1px solid var(--df-border);
  border-radius: 12px;
  box-shadow: var(--df-shadow);
}

.block {
  padding: 1rem 1rem;
}

.block__title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2a44;
}

.input,
.input--sm,
.input--status,
select.input {
  border: 1px solid #d8deea;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.input--sm:focus,
.input--status:focus,
select.input:focus {
  outline: none;
  border-color: #9fc0ff;
  box-shadow: 0 0 0 3px rgba(1, 104, 250, 0.12);
}

.btn {
  border-radius: 8px;
  font-weight: 600;
}

.icon-feather-print {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -2px;
}

.btn .icon-feather-print {
  margin-right: 4px;
}

.icon-feather-action {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.btn-icon-plain {
  border: none !important;
  background: transparent !important;
  color: #64748b;
  padding: 0.1rem 0.2rem;
  min-height: auto;
  min-width: auto;
}

.btn-icon-plain:hover {
  color: #1f2937;
  background: transparent !important;
}

.btn-icon-plain:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--df-primary);
}

.btn--primary:hover {
  background: var(--df-primary-strong);
}

.btn--secondary {
  border: 1px solid #d8deea;
  background: #fff;
  color: #3a475d;
}

.btn--secondary:hover {
  background: #f5f8ff;
  border-color: #c8d6f2;
}

.btn--danger {
  background: var(--df-danger);
}

.btn--danger:hover {
  background: #d43f4b;
}

.table th {
  background: var(--df-surface-soft);
  color: #5b6678;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.table th,
.table td {
  border-bottom: 1px solid #edf1f7;
}

.table tbody tr:hover {
  background: #f7faff;
}

.tag {
  background: #f3f7ff;
  color: #3b4f7c;
  border: 1px solid #dfebff;
}

.tag--sm {
  background: #eef4ff;
  color: #355188;
}

.chip {
  border: 1px solid #d7dfef;
  border-radius: 999px;
  background: #fff;
}

.chip:hover {
  background: #f5f8ff;
  border-color: #c9d8f4;
}

.chip--active {
  border-color: var(--df-primary);
  background: var(--df-primary);
}

.ac-list,
.dropdown-search__list {
  border: 1px solid #d7deeb;
  border-top: none;
  border-radius: 0 0 10px 10px;
  box-shadow: var(--df-shadow);
}

.ac-item:hover,
.dropdown-search__item:hover {
  background: #f3f8ff;
}

.pagination .btn--primary,
.w-page-btn--active {
  background: var(--df-primary);
  border-color: var(--df-primary);
}

/* Доп. полировка classic-plus для единообразия экранов */

.section {
  margin-bottom: 1.4rem;
}

.header__hint,
.pay-period-hint,
.cost-hint,
.tags-empty,
.ac-item--empty,
.dropdown-search__empty {
  color: #7b8699;
}

.search-bar .input {
  max-width: 520px;
  background: #fff;
}

.table-actions {
  margin-top: 0.8rem;
}

.cell-code {
  color: #3a475d;
}

.batch-link {
  color: #1a56c8;
}

.batch-link:hover {
  color: #0f3f9e;
}

.status--ready {
  background: #eef4ff;
  color: #1f57be;
  border-color: #d6e5ff;
}

.status--active {
  background: #fff7e8;
  color: #a16007;
  border-color: #ffe1ab;
}

.status--paused {
  background: #fff0f1;
  color: #b4232f;
  border-color: #ffcbd0;
}

.status--done {
  background: #ecfdf3;
  color: #0f8a4b;
  border-color: #b7efcf;
}

.status--cancelled {
  background: #f4f6fb;
  color: #566177;
  border-color: #d7ddea;
}

.status--rework {
  background: #f2ecff;
  color: #5b3db5;
  border-color: #dcccff;
}

/* Явно усиливаем цвета статусов в таблице Заказа на пошив */
.page-orders select.input--status.status--ready {
  background: #eaf2ff !important;
  color: #1e5bc6 !important;
  border-color: #c8dcff !important;
}

.page-orders select.input--status.status--active {
  background: #fff5de !important;
  color: #9a5b05 !important;
  border-color: #ffd99a !important;
}

.page-orders select.input--status.status--paused {
  background: #ffeef0 !important;
  color: #b4232f !important;
  border-color: #ffc5cc !important;
}

.page-orders select.input--status.status--done {
  background: #e8fbef !important;
  color: #0f8a4b !important;
  border-color: #abe8c4 !important;
}

.page-orders select.input--status.status--cancelled {
  background: #f1f4f9 !important;
  color: #566177 !important;
  border-color: #d4dbe8 !important;
}

.page-orders select.input--status.status--rework {
  background: #f2ecff !important;
  color: #5b3db5 !important;
  border-color: #dcccff !important;
}

.page-orders #tableOrders .input--status {
  border-radius: var(--app-ui-radius-status);
  min-height: 22px;
  height: 22px;
  padding: 0 1.05rem 0 0.48rem;
  font-size: 10px;
  line-height: 1;
}

.page-orders #tableOrders tbody td:nth-child(6) {
  position: relative;
  overflow: visible;
}

/* Обёртка без фона: иначе глобальные .status--* дают прямоугольник, видимый за скруглением кнопки */
.page-orders #tableOrders tbody .order-status-dropdown {
  position: relative;
  width: 100%;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
}

.page-orders #tableOrders tbody .order-status-dropdown.status--ready,
.page-orders #tableOrders tbody .order-status-dropdown.status--cancelled {
  background: transparent !important;
  color: inherit;
}

/* Редактируемые статусы: «Можно делать» — голубой; «Отменен» — красный (не как «На паузе»: пауза #ffeef0 / #b4232f / #ffc5cc) */
.page-orders #tableOrders tbody .order-status-dropdown__trigger {
  width: 100%;
  min-height: 24px;
  height: 24px;
  padding: 0.12rem 1.25rem 0.12rem 0.44rem;
  border: 1px solid #d8deea;
  border-radius: var(--app-ui-radius-status);
  background: #fff;
  color: #3a475d;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.page-orders #tableOrders tbody .order-status-dropdown.status--ready .order-status-dropdown__trigger {
  background: #eaf2ff;
  color: #1e5bc6;
  border-color: #c8dcff;
}

.page-orders #tableOrders tbody .order-status-dropdown.status--cancelled .order-status-dropdown__trigger {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

.page-orders #tableOrders tbody .order-status-dropdown.is-open .order-status-dropdown__trigger {
  border-color: #c8d6f2;
  box-shadow: 0 0 0 2px rgba(1, 104, 250, 0.08);
}

.page-orders #tableOrders tbody .order-status-dropdown.status--ready.is-open .order-status-dropdown__trigger {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.page-orders #tableOrders tbody .order-status-dropdown.status--cancelled.is-open .order-status-dropdown__trigger {
  border-color: #f87171;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}

.page-orders #tableOrders tbody .order-status-dropdown__trigger::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #7b8699;
  border-bottom: 1.5px solid #7b8699;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.page-orders #tableOrders tbody .order-status-dropdown__menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 140px;
  z-index: 9999;
  background: #fff;
  border: 1px solid #d8deea;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  padding: 0.15rem;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.page-orders #tableOrders tbody .order-status-dropdown.is-open .order-status-dropdown__menu {
  display: block;
}

.page-orders #tableOrders tbody .order-status-dropdown__option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  padding: 0.24rem 0.42rem;
  min-height: 24px;
  border-radius: 6px;
  cursor: pointer;
  white-space: normal;
}

.page-orders #tableOrders tbody .order-status-dropdown__option:hover {
  background: #f1f5f9;
}

.page-orders #tableOrders tbody .order-status-dropdown__option.is-active {
  background: #e8f0ff;
  color: #1d4ed8;
  font-weight: 600;
}

.page-orders .native-select-dropdown__source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.page-orders .native-select-dropdown {
  position: relative;
  width: 100%;
}

.page-orders .native-select-dropdown__trigger {
  width: 100%;
  min-height: 26px;
  height: 26px;
  padding: 0.12rem 1.25rem 0.12rem 0.44rem;
  border: 1px solid #d8deea;
  border-radius: 8px;
  background: #fff;
  color: #3a475d;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.page-orders .native-select-dropdown__trigger::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #7b8699;
  border-bottom: 1.5px solid #7b8699;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.page-orders .native-select-dropdown__menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  background: #fff;
  border: 1px solid #d8deea;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  padding: 0.15rem;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
}

.page-orders .native-select-dropdown.is-open .native-select-dropdown__menu {
  display: block;
}

.page-orders .native-select-dropdown__option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  padding: 0.24rem 0.42rem;
  min-height: 24px;
  border-radius: 6px;
  cursor: pointer;
  white-space: normal;
}

.page-orders .native-select-dropdown__option:hover {
  background: #f1f5f9;
}

.page-orders .native-select-dropdown__option.is-active {
  background: #e8f0ff;
  color: #1d4ed8;
  font-weight: 600;
}

.table th,
.table td {
  padding-top: 0.62rem;
  padding-bottom: 0.62rem;
}

/* Страницы: заказы, добавление модели, сотрудники, характеристики */

#tableOrders th > div {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#sectionCart .btn,
#tableOrders .btn,
#tableCart .btn {
  border-radius: var(--app-ui-radius);
}

#cartCount,
#fileName,
#modelsFileName,
#importResult,
#modelsImportResult,
#modelsOverviewImportResult {
  color: #7b8699 !important;
  font-size: 13px;
}

.grades-list .grade-card {
  border-radius: 12px;
}

.grades-list .grade-card .blocks-row {
  gap: 0.7rem;
}

.grades-list .btn-update-grade {
  min-width: 96px;
}

#gradesListWrap .grade-card,
#gradesListWrap .block {
  border: 1px solid var(--df-border);
  box-shadow: var(--df-shadow);
}

.form-row .input,
.form-row select.input {
  background: #fff;
}

#btnAddEmployee,
#btnSaveEmployee,
#btnResetDb,
#btnAddGrade,
#btnAdd,
#btnImport,
#btnSave,
#btnClearCart,
#btnSubmitAll,
#btnCartPrintAll {
  border-radius: 8px;
}

.characteristics-top .block,
.characteristics-bottom .block {
  min-height: 100%;
}

.equipop-export {
  border-top: 1px dashed #d8deea;
  padding-top: 0.7rem;
}

.csv-file-btn,
.csv-action-btn {
  border-radius: 8px;
}

.page-characteristics-equipop .block-upload-small .btn {
  padding: 0.34rem 0.62rem;
}

.page-characteristics-equipop .block-upload-small .btn-with-icon {
  gap: 0.28rem;
}

/* ── Оборудование и операции (компактный макет) ── */

.page-characteristics-equipop {
  --table-density-padding-y: 0.11rem;
  --table-density-padding-x: 0.32rem;
  --table-density-font-size: 11px;
}

.page-characteristics-equipop .content {
  padding: 0.65rem 1rem 0.9rem;
  line-height: 1.28;
  /* Иначе с main.overflow-x:hidden выпадашки внутри main обрезаются (появляется «внутренний» скролл) */
  overflow-x: visible;
  overflow-y: visible;
}

.page-characteristics-equipop .section {
  margin-bottom: 0.35rem;
}

.page-characteristics-equipop .equipop-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
}

.page-characteristics-equipop .section__title {
  font-size: 0.95rem;
  margin: 0;
  gap: 0.4rem;
}

.page-characteristics-equipop .block {
  padding: 0.35rem 0.5rem;
  gap: 0.18rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  overflow: visible;
}

.page-characteristics-equipop .block__title {
  font-size: 13px;
}

.page-characteristics-equipop .equipop-block > .block__title {
  text-align: left;
}

.page-characteristics-equipop .form-field-error.equipop-page-error {
  margin-bottom: 0.35rem;
  font-size: 12px;
}

/*
 * Карточки «Оборудование» / «Операции»: высота по контенту (без фикс. min-height), плотные отступы.
 */
.page-characteristics-equipop {
  /* Внутренние отступы верхних карточек: низ ≈ бокам, верх компактно */
  --equipop-card-inner-pad-x: 0.35rem;
  --equipop-card-inner-pad-bottom: 0.35rem;
  --equipop-card-inner-pad-top: 0.2rem;
  /* Зазор между колонками карточек и блоком кнопок (та же сетка, что equipop-top-row / mn-model-page-top) */
  --equipop-top-column-gap: 0.45rem;
  /* Полоса тегов: ровно 3 строки (по одному чипу на строку), без скролла; лишнее обрезается */
  --equipop-tag-chip-gap: 0.2rem;
  /* Одна строка чипа: padding + текст + border сверху/снизу (.tag { border: 1px }) — без +2px нижняя обводка 3-го тега режется overflow */
  --equipop-tag-line-box: calc(2 * 0.18rem + 0.75rem * 1.38 + 2px);
  --equipop-tags-strip-max-height: calc(
    3 * var(--equipop-tag-line-box) + 2 * var(--equipop-tag-chip-gap) + 0.42rem
  );
}

/* Карточки + кнопки; теги — отдельной полосой под строкой (см. .equipop-tags-strip) */
.equipop-page-top {
  margin-bottom: 0;
}

/* Оборудование уже, операции шире */
.equipop-top-row {
  display: grid;
  grid-template-columns: minmax(0, 0.74fr) minmax(0, 1.26fr);
  grid-template-rows: auto;
  column-gap: var(--equipop-top-column-gap);
  row-gap: 0;
  margin-bottom: 0;
  align-items: start;
}

.equipop-top-row > .equipop-top-col--equipment {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  box-sizing: border-box;
  overflow: visible;
}

.equipop-top-row > .equipop-top-col--equipment > .block.equipop-block--equipment {
  min-width: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: var(--equipop-card-inner-pad-top) var(--equipop-card-inner-pad-x) var(--equipop-card-inner-pad-bottom);
  gap: 0.24rem;
}

.equipop-top-row > .equipop-top-col--operations {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  box-sizing: border-box;
  overflow: visible;
}

.equipop-top-row > .equipop-top-col--operations > .block.equipop-block--operations {
  min-width: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: var(--equipop-card-inner-pad-top) var(--equipop-card-inner-pad-x) var(--equipop-card-inner-pad-bottom);
  gap: 0.24rem;
}

.equipop-top-row > .equipop-top-col--equipment,
.equipop-top-row > .equipop-top-col--operations {
  min-height: 0;
  max-height: none;
  box-sizing: border-box;
  overflow: visible;
  align-self: stretch;
}

/* Те же колонки, что у .equipop-top-row; полоса видна только при ненулевом черновике (класс из JS) */
.equipop-tags-strip {
  display: none;
  grid-template-columns: minmax(0, 0.74fr) minmax(0, 1.26fr);
  column-gap: var(--equipop-top-column-gap);
  margin-top: 0.14rem;
  min-height: 0;
  max-height: none;
  overflow: visible;
  box-sizing: border-box;
}

.equipop-tags-strip.equipop-tags-strip--has-picks {
  display: grid;
}

.equipop-tags-strip__cell {
  min-width: 0;
  height: auto;
  max-height: none;
  overflow: hidden;
}

.equipop-tags-strip .equipop-picked-tags.equipop-picked-tags--below-card {
  margin-top: 0;
}

/* Три слота по вертикали: один чип = одна строка, без переноса текста (ellipsis в .equipop-tag-label) */
.equipop-tags-strip .equipop-tags-strip__cell .equipop-picked-tags {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  align-content: flex-start;
  gap: var(--equipop-tag-chip-gap);
  margin-top: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  max-height: var(--equipop-tags-strip-max-height);
  overflow: hidden;
  box-sizing: border-box;
}

.equipop-tags-strip .equipop-tags-strip__cell .equipop-picked-tags .tag {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.22rem;
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  line-height: 1.38;
  overflow: hidden;
}

.equipop-tags-strip .equipop-tag-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipop-tags-strip .equipop-picked-tags .tag__remove {
  flex-shrink: 0;
}

.page-characteristics-equipop .equipop-block__desc {
  font-size: 11px;
  line-height: 1.42;
  color: #64748b;
  margin: 0;
  flex-shrink: 0;
  text-align: left;
}

/* Верхняя строка карточек: плотнее подпись и заголовок */
.page-characteristics-equipop .equipop-top-row .block__title {
  line-height: 1.2;
}

.page-characteristics-equipop .equipop-top-row .equipop-block__desc {
  line-height: 1.22;
}

.page-characteristics-equipop .equipop-block__middle {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: visible;
}

.page-characteristics-equipop .equipop-block__bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
  min-width: 0;
  flex-shrink: 0;
  overflow: visible;
}

/* Нижняя зона «Операции»: та же логика, что у «Оборудование» — блок по высоте строки, прижатие к низу через margin-top: auto (равные отступы до рамки) */
.page-characteristics-equipop .equipop-block--operations .equipop-block__bottom {
  flex: 0 0 auto;
  min-height: 0;
  margin-top: auto;
  justify-content: flex-start;
}

.page-characteristics-equipop .equipop-block--equipment .equipop-block__bottom {
  flex: 0 0 auto;
  margin-top: auto;
}

.page-characteristics-equipop .equipop-block--operations .equipop-op-main-row {
  flex: 0 0 auto;
  min-height: 0;
  align-items: center;
}

.page-characteristics-equipop .equipop-block--operations .equipop-ac-wrap {
  flex: 1;
  min-width: 0;
  align-self: center;
}

.page-characteristics-equipop .equipop-block--operations .equipop-ac-wrap .input.input--sm {
  width: 100%;
}

.page-characteristics-equipop .equipop-block--operations .equipop-op-inline-actions {
  align-items: center;
  align-self: center;
}

.page-characteristics-equipop .equipop-block--operations .equipop-op-inline-actions .btn.btn--sm {
  align-self: center;
}

.page-characteristics-equipop .equipop-picked-tags--in-card {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  margin-top: 0.08rem;
}

.page-characteristics-equipop .equipop-picked-tags.equipop-picked-tags--below-card {
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  margin-top: 0.32rem;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.page-characteristics-equipop .equipop-ac-wrap--dropdown .equipop-input-clear {
  position: absolute;
  right: 22px;
  top: 0;
  bottom: 0;
  z-index: 3;
  margin-top: auto;
  margin-bottom: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  /* символ × визуально тяжелее сверху — чуть меньше шрифт и нулевая строка для центра во flex */
  font-size: 16px;
  line-height: 0;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.page-characteristics-equipop .equipop-ac-wrap--dropdown .equipop-input-clear:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
}

.page-characteristics-equipop .equipop-ac-wrap--dropdown .equipop-input-clear:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 1px;
}

.page-characteristics-equipop .equipop-ac-wrap--dropdown::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #7b8699;
  border-bottom: 1.5px solid #7b8699;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  z-index: 1;
}

.page-characteristics-equipop .equipop-ac-wrap--dropdown:has([aria-expanded="true"])::after {
  transform: translateY(-35%) rotate(225deg);
}

.page-characteristics-equipop .equipop-block .equipop-ac-wrap--dropdown .input.input--sm {
  padding-right: 1.35rem;
}

.page-characteristics-equipop .equipop-top-files {
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  box-sizing: border-box;
}

.equipop-top-files .equipop-actions-stack {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  gap: 0.08rem;
}

.equipop-top-files .equipop-actions-stack > .btn,
.equipop-top-files .equipop-actions-stack > .csv-file-btn {
  flex: 1 1 0;
  min-height: 18px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}

.page-characteristics-equipop .equipop-title-files {
  margin-left: 0;
  width: auto;
  max-width: 100%;
}

.page-characteristics-equipop .equipop-title-files .equipop-actions-stack {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: auto;
  height: auto;
  gap: 0.22rem;
}

.page-characteristics-equipop .equipop-title-files .equipop-actions-stack > .btn,
.page-characteristics-equipop .equipop-title-files .equipop-actions-stack > .csv-file-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: none;
}

.page-characteristics-equipop .equipop-title-files .btn-with-icon {
  min-height: 32px !important;
  padding: 0.3rem 2ch !important;
  justify-content: center;
}

.equipop-op-main-row {
  align-items: center;
}

.equipop-op-inline-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
}

.page-characteristics-equipop .equipop-op-inline-actions .equipop-link-inline {
  flex-shrink: 0;
  white-space: nowrap;
  box-sizing: border-box;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  padding: 0 0.48rem;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-characteristics-equipop .equipop-link-inline:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.equipop-ac-row {
  display: flex;
  gap: 0.28rem;
  align-items: center;
  overflow: visible;
  min-width: 0;
}

.equipop-ac-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.equipop-dropdown.ac-list {
  position: absolute;
  z-index: 500;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 2px;
  max-height: none;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid #d7deeb;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--df-shadow);
}

/* Скролл внутри — скругление справа не «съедается» нативным скроллбаром */
.equipop-dropdown .equipop-dd-scroll {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.12rem 0.28rem;
  box-sizing: border-box;
}

/* Базовый .ac-list { display: none } скрывает список даже без .u-hidden — явно показываем при открытии */
.equipop-dropdown.ac-list:not(.u-hidden) {
  display: block;
}

.page-characteristics-equipop .equipop-dropdown .ac-item {
  padding: 0.3rem 0.5rem;
  font-size: 12px;
}

.page-characteristics-equipop .equipop-dropdown .ac-item.is-duplicate-link {
  background: #fff1f2;
  color: #9f1239;
}

.page-characteristics-equipop .equipop-dropdown .ac-item.is-duplicate-link:hover,
.page-characteristics-equipop .equipop-dropdown .ac-item.is-duplicate-link:focus-visible {
  background: #ffe4e6;
  color: #881337;
}

.equipop-picked-tags {
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.12rem;
}

.equipop-picked-tags:empty {
  margin-top: 0;
  min-height: 0;
}

.equipop-recent-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.2rem;
}

.equipop-picked-tags > .tag:first-child ~ .equipop-recent-row {
  margin-top: 0.28rem;
}

.page-characteristics-equipop .equipop-recent-chip {
  border: none;
  cursor: pointer;
  font: inherit;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.page-characteristics-equipop .equipop-recent-chip:hover {
  filter: brightness(0.97);
}

.page-characteristics-equipop .equipop-recent-chip.is-current {
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.45);
}

.equipop-dropdown .equipop-ac-hint {
  padding: 0.28rem 0.5rem 0.18rem;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.01em;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  pointer-events: none;
}

.equipop-tabs-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0;
}

.equipop-filter-input {
  width: 100%;
}

.page-characteristics-equipop .equipop-filter-input {
  min-height: 24px;
  padding: 0.12rem 0.35rem;
  font-size: 11px;
}

.equipop-table-wrap {
  margin-top: 0;
}

.equipop-links-table {
  width: 100%;
  table-layout: fixed;
}

.equipop-links-table th {
  vertical-align: middle;
}

.page-characteristics-equipop .equipop-cg-date {
  width: 132px;
}

/* Столбец «Оборудование»: шире, чтобы название в одну строку (таблица с гориз. прокруткой при узком окне) */
.page-characteristics-equipop .equipop-cg-equip {
  width: 36%;
  min-width: 280px;
}

.page-characteristics-equipop .equipop-cg-op {
  width: auto;
}

.page-characteristics-equipop .equipop-cg-actions {
  width: 140px;
}

.equipop-col-date {
  width: 132px;
  white-space: nowrap;
}

.equipop-col-equip {
  min-width: 280px;
}

.equipop-col-op {
  min-width: 0;
}

.equipop-col-actions {
  width: 140px;
  text-align: right;
}

.equipop-cell-box {
  display: inline;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  vertical-align: baseline;
}

.equipop-actions-cell {
  text-align: right;
  white-space: nowrap;
}

.page-characteristics-equipop .equipop-actions-cell .btn.btn--icon-only {
  min-height: 0;
  padding: 0.12rem;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #64748b;
}

.page-characteristics-equipop .equipop-actions-cell .btn.btn--icon-only:hover {
  background: transparent !important;
  color: #334155;
}

.page-characteristics-equipop .equipop-actions-cell .btn.btn--icon-only:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(1, 104, 250, 0.25);
}

/* Архив: «Восстановить» — компактная высота как у иконок; углы почти прямоугольные (не «таблетка») */
.page-characteristics-equipop .equipop-table-wrap .equipop-links-table:not(.mn-models-table) .equipop-actions-cell .btn.equipop-restore {
  box-sizing: border-box;
  padding: 0.1rem 0.42rem;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  min-height: 0;
  min-width: 0;
  border-radius: var(--app-ui-radius);
  white-space: nowrap;
}

/* Последний столбец при overflow-x: остаётся в зоне видимости */
.page-characteristics-equipop .equipop-table-wrap .equipop-links-table:not(.mn-models-table) thead th.equipop-col-actions,
.page-characteristics-equipop .equipop-table-wrap .equipop-links-table:not(.mn-models-table) tbody td.equipop-actions-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  box-sizing: border-box;
  box-shadow: -6px 0 10px -6px rgba(15, 23, 42, 0.1);
}

.page-characteristics-equipop .equipop-table-wrap .equipop-links-table:not(.mn-models-table) thead th.equipop-col-actions {
  z-index: 3;
  background: var(--df-surface-soft, #f5f7fb);
}

.page-characteristics-equipop .equipop-table-wrap .equipop-links-table:not(.mn-models-table) tbody td.equipop-actions-cell {
  background: var(--df-surface, #fff);
}

.page-characteristics-equipop .equipop-table-wrap .equipop-links-table:not(.mn-models-table) tbody tr:hover td.equipop-actions-cell {
  background: #f7faff;
}

.btn.btn--icon-only {
  padding: 0.28rem;
  min-width: 0;
  line-height: 1;
  border-radius: 8px;
}

.btn.btn--icon-only + .btn.btn--icon-only {
  margin-left: 0.2rem;
}

.equipop-action-svg,
.equipop-archive-svg {
  width: 14px;
  height: 14px;
  display: block;
}

.equipop-empty-cell {
  text-align: center;
  color: #64748b;
  padding: 0.5rem !important;
}

.equipop-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  padding-top: 0.32rem;
  border-top: 1px solid #e8edf5;
}

.equipop-pagination .pagination.equipop-page-nav {
  margin-top: 0;
}

.equipop-page-nav {
  margin-left: 0;
}

.page-characteristics-equipop .equipop-orders-dropdown {
  position: relative;
  width: 100%;
  min-width: 0;
}

.page-characteristics-equipop .equipop-orders-dropdown .orders-dropdown__trigger {
  width: 100%;
  min-height: 28px;
  padding: 0.2rem 1.35rem 0.2rem 0.42rem;
  border: 1px solid #d8deea;
  border-radius: 8px;
  background: #fff;
  color: #3a475d;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.page-characteristics-equipop .equipop-orders-dropdown .orders-dropdown__trigger::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #7b8699;
  border-bottom: 1.5px solid #7b8699;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

/* В строке таблицы — те же размер шрифта и высота, что у ячеек tbody (без «раздувания» строки) */
.page-characteristics-equipop .equipop-table-wrap .equipop-links-table tbody .equipop-orders-dropdown .orders-dropdown__trigger {
  min-height: 0;
  height: auto;
  padding: 0.2rem 1.15rem 0.2rem 0.32rem;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.18;
  color: var(--df-text);
  border-radius: 6px;
  border-color: #e5e9f2;
}

.page-characteristics-equipop .equipop-orders-dropdown.is-open .orders-dropdown__trigger {
  border-color: #c8d6f2;
  box-shadow: 0 0 0 2px rgba(1, 104, 250, 0.08);
}

.page-characteristics-equipop .equipop-orders-dropdown .orders-dropdown__menu {
  display: none;
  box-sizing: border-box;
}

/* Плавающее меню: фон и рамка обязательны — иначе просвечивает таблица («текст на тексте») */
.page-characteristics-equipop .equipop-orders-dropdown.is-open .orders-dropdown__menu {
  display: block;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  padding: 0.2rem;
  overflow-x: hidden;
}

.page-characteristics-equipop .equipop-orders-dropdown .orders-dropdown__option {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  padding: 0.32rem 0.45rem;
  min-height: 0;
  border-radius: 6px;
  cursor: pointer;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.page-characteristics-equipop .equipop-orders-dropdown .orders-dropdown__option:hover {
  background: #f1f5f9;
}

.page-characteristics-equipop .equipop-orders-dropdown .orders-dropdown__option.is-active {
  background: #e8f0ff;
  color: #1d4ed8;
  font-weight: 600;
}

.page-characteristics-equipop .equipop-orders-dropdown--searchable.is-open .orders-dropdown__menu {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0.2rem 0.2rem;
  gap: 0;
  overflow: hidden;
  border-radius: 10px;
}

.page-characteristics-equipop .equipop-dd-menu-search {
  flex-shrink: 0;
  padding: 0 0.1rem 0.35rem;
  margin: 0 0 0.2rem;
  border-bottom: 1px solid #edf1f7;
  background: #fff;
}

.page-characteristics-equipop .equipop-dd-search-input {
  width: 100%;
  min-height: 30px;
  font-size: 12px;
  font-weight: 500;
  box-sizing: border-box;
}

.page-characteristics-equipop .equipop-dd-options {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.22rem;
  box-sizing: border-box;
}

/* Скролл списка: скругление справа вместе с полосой прокрутки (родитель с overflow:hidden + radius) */
.page-characteristics-equipop .equipop-orders-dropdown--searchable .equipop-dd-options {
  border-radius: 0 8px 8px 0;
}

.page-characteristics-equipop tr.is-editing td.equipop-td-equip,
.page-characteristics-equipop tr.is-editing td.equipop-td-op {
  overflow: visible;
  vertical-align: middle;
}

/* Дропдаун выше текста в ячейке — компенсируем отрицательными полями, высота строки как у просмотра */
.page-characteristics-equipop .equipop-table-wrap .equipop-links-table tbody tr.is-editing td .equipop-orders-dropdown {
  margin-top: -0.18rem;
  margin-bottom: -0.18rem;
}

.page-characteristics-equipop tr.is-editing {
  position: relative;
  z-index: 4;
}

.page-characteristics-equipop .equipop-block .input.input--sm {
  min-height: 32px;
  padding: 0.26rem 0.5rem;
  font-size: 13px;
}

.page-characteristics-equipop .equipop-top-files .btn-with-icon {
  min-height: 18px !important;
  max-height: none;
  padding: 0.05rem 0.22rem !important;
  font-size: 11px;
  gap: 0.18rem;
  white-space: nowrap;
  text-align: center;
  line-height: 1.1;
  flex-wrap: nowrap;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.page-characteristics-equipop .equipop-top-files .equipop-actions-stack > .btn-with-icon {
  min-height: 18px !important;
}

.page-characteristics-equipop .equipop-top-files .btn-with-icon > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-characteristics-equipop .equipop-top-files .btn-with-icon .icon-feather-action {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.page-characteristics-equipop .equipop-title-files .btn-with-icon > span {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.page-characteristics-equipop .equipop-title-files .btn-with-icon .icon-feather-action {
  width: 15px;
  height: 15px;
}

.page-characteristics-equipop .equipop-top-files.equipop-title-files .btn-with-icon {
  min-height: 28px !important;
  padding: 0.14rem 2ch !important;
}

.page-characteristics-equipop .equipop-picked-tags .tag {
  box-sizing: border-box;
  padding: 0.18rem 0.5rem;
  font-size: 12px;
  gap: 0.22rem;
  border-radius: 10px;
}

.page-characteristics-equipop .equipop-picked-tags .tag.equipop-tag-equip {
  cursor: pointer;
}

.page-characteristics-equipop .equipop-picked-tags .tag.equipop-tag-equip.is-current {
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.45);
}

.page-characteristics-equipop .equipop-picked-tags .tag.equipop-tag-op {
  cursor: pointer;
}

.page-characteristics-equipop .equipop-picked-tags .tag.equipop-tag-op.is-current {
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.45);
}

.page-characteristics-equipop .equipop-picked-tags .tag.equipop-tag-op.is-duplicate {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.page-characteristics-equipop #equipopOpPicked.equipop-picked-tags--below-card {
  max-height: 12rem;
  overflow-y: auto;
}

.page-characteristics-equipop .equipop-ac-row .btn.btn--sm.btn--icon {
  min-height: 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 16px !important;
}

.page-characteristics-equipop .orders-status-tabs,
.page-characteristics-equipop .equipop-status-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  border-bottom: 1px solid #d7dde8;
  padding-left: 0;
  margin: 0 0 0.02rem 0;
  position: relative;
  border-bottom: 0;
}

.page-characteristics-equipop .orders-status-tab {
  border: 1px solid #d7dde8;
  border-radius: 5px 5px 0 0;
  background: #f3f6fb;
  color: #475569;
  min-height: 26px;
  padding: 0.22rem 0.95rem;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.15;
  cursor: pointer;
  margin-bottom: -1px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  position: relative;
}

/* Неактивная: полная рамка (вкл. низ) от border; активная: без нижней линии — стык с thead, см. ::after */
.page-characteristics-equipop .orders-status-tab + .orders-status-tab {
  margin-left: -1px;
}

.page-characteristics-equipop .orders-status-tab:hover {
  background: #eaf0fa;
  color: #334155;
}

.page-characteristics-equipop .orders-status-tab.is-active {
  border-bottom: none;
  background: var(--df-surface-soft, #f5f7fb);
  color: #1d4ed8;
  border-color: #d7dde8;
  font-weight: 600;
  z-index: 1;
}

/* Как на странице заказов: перекрыть верхнюю границу блока таблицы под активной вкладкой */
.page-characteristics-equipop .orders-status-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 3px;
  background: var(--df-surface-soft, #f5f7fb);
  pointer-events: none;
  z-index: 2;
}

/* Левая линия совпадает с левым краем первой вкладки (без лишнего смещения относительно таблицы) */
.page-characteristics-equipop .orders-status-tabs::before {
  display: none;
}

/* Таблица связок: без карточной рамки, вкладки вплотную к thead */
.page-characteristics-equipop .equipop-table-section {
  padding: 0;
  margin: var(--equipop-top-column-gap) 0 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.page-characteristics-mn .equipop-table-section {
  margin-top: var(--equipop-top-column-gap);
}

.page-characteristics-equipop .equipop-tabs-head {
  margin-bottom: 0;
  padding: 0;
  /* Выше верхней границы таблицы — иначе border карточки рисуется поверх вкладки и «линия таблицы» видна под активной вкладкой */
  position: relative;
  z-index: 2;
}

/* Как у «Статусы заказов» на странице Заказ на пошив: карточка таблицы со скруглением,
   верхний левый угол плоский — стык с вкладками.
   «~»: между вкладками и таблицей может быть скрытый span (напр. model-name — импорт). */
.page-characteristics-equipop .equipop-tabs-head ~ .table-wrap.equipop-table-wrap {
  margin-top: 0;
  overflow-x: auto;
  width: 100%;
  background: var(--df-surface);
  border: 1px solid var(--df-border);
  border-radius: 12px;
  border-top-left-radius: 0;
  box-shadow: var(--df-shadow);
  position: relative;
  z-index: 0;
}

/* Обёртка таблицы на страницах equip-op / название модели — то же скругление, что у вкладок */
.page-characteristics.page-characteristics-equipop .equipop-tabs-head ~ .table-wrap.equipop-table-wrap {
  border-radius: var(--ch-ui-radius);
  border-top-left-radius: 0;
}

.page-characteristics .equipop-pagination .pagination .btn.btn--sm {
  border-radius: var(--ch-ui-radius);
}

.page-characteristics .equipop-dropdown.ac-list {
  border-radius: var(--ch-ui-radius);
}

.page-characteristics .equipop-orders-dropdown .orders-dropdown__trigger {
  border-radius: var(--ch-ui-radius);
}

.page-characteristics .equipop-table-wrap .equipop-links-table tbody .equipop-orders-dropdown .orders-dropdown__trigger {
  border-radius: var(--ch-ui-radius);
}

.page-characteristics .equipop-orders-dropdown.is-open .orders-dropdown__menu {
  border-radius: var(--ch-ui-radius);
}

.page-characteristics .equipop-orders-dropdown .orders-dropdown__option {
  border-radius: var(--ch-ui-radius);
}

.page-characteristics .equipop-table-wrap .equipop-links-table thead .equipop-filter-input.input.input--sm {
  border-radius: var(--ch-ui-radius);
}

.page-characteristics .equipop-orders-dropdown--searchable.is-open .orders-dropdown__menu {
  border-radius: var(--ch-ui-radius);
}

.page-characteristics .equipop-dd-search-input {
  border-radius: var(--ch-ui-radius);
}

.page-characteristics .equipop-orders-dropdown--searchable .equipop-dd-options {
  border-radius: 0 var(--ch-ui-radius) var(--ch-ui-radius) 0;
}

.page-characteristics-equipop .equipop-links-table thead th {
  border-top: none;
}

/* Типографика как у таблицы «Статусы заказов» / #tableOrders на странице Заказ на пошив */
.page-characteristics-equipop .equipop-table-wrap .equipop-links-table {
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  font-variant-numeric: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-characteristics-equipop .equipop-table-wrap .equipop-links-table thead th {
  padding: 0.38rem 0.52rem;
  font-size: 12px;
  font-weight: 600;
  color: #5b6678;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
  text-align: left;
  background: var(--df-surface-soft, #f5f7fb);
  border-bottom: 1px solid var(--df-border, #edf1f7);
}

/* Поля фильтра на equip-op; не трогаем mn-models-table — там col-op это текст «Описание модели» */
.page-characteristics-equipop .equipop-table-wrap .equipop-links-table:not(.mn-models-table) thead th.equipop-col-equip,
.page-characteristics-equipop .equipop-table-wrap .equipop-links-table:not(.mn-models-table) thead th.equipop-col-op {
  text-transform: none;
}

.page-characteristics-equipop .equipop-table-wrap .equipop-links-table thead th .equipop-sort-btn {
  color: #5b6678;
  font-weight: 600;
  letter-spacing: inherit;
  text-transform: inherit;
}

.page-characteristics-equipop .equipop-sort-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.page-characteristics-equipop .equipop-sort-btn:hover {
  color: #2563eb;
}

.page-characteristics-equipop .equipop-col-date .equipop-sort-hint {
  font-size: 0.92em;
  opacity: 0.85;
  font-weight: 600;
}

.page-characteristics-equipop .equipop-table-wrap .equipop-links-table tbody td {
  padding: 0.43rem 0.52rem;
  font-size: 11px;
  line-height: 1.18;
  color: var(--df-text);
  font-weight: 400;
  vertical-align: middle;
}

.page-characteristics-equipop .equipop-table-wrap .equipop-links-table thead .equipop-filter-input.input.input--sm {
  min-height: 26px;
  height: 26px;
  padding-top: 0.14rem;
  padding-bottom: 0.14rem;
  font-size: 12px;
  font-weight: 500;
  color: #3a475d;
  line-height: 1;
  text-align: left;
}

.page-characteristics-equipop .equipop-table-wrap .equipop-links-table thead .equipop-filter-input.input.input--sm::placeholder {
  color: #6b7280;
  font-weight: 500;
}

.page-characteristics-equipop .equipop-table-section .equipop-empty-cell {
  font-size: 11px;
  line-height: 1.18;
  color: #64748b;
}

/* Цвета и бордюры строк как у глобальной .table / таблицы заказов */
.page-characteristics-equipop .equipop-table-wrap .equipop-links-table tbody tr:hover {
  background: #f7faff;
}

.page-characteristics-equipop .equipop-table-wrap .equipop-links-table.mn-models-table tbody tr.mn-row-editing:hover {
  background: #f0f7ff;
}

.page-characteristics-equipop .equipop-table-wrap .equipop-links-table th,
.page-characteristics-equipop .equipop-table-wrap .equipop-links-table td {
  border-bottom: 1px solid #edf1f7;
}

.page-characteristics-equipop .equipop-table-wrap .equipop-links-table tbody tr:last-child td {
  border-bottom: none;
}

.page-characteristics-equipop .equipop-table-wrap .equipop-links-table td.equipop-td-equip {
  white-space: nowrap;
  overflow: visible;
}

.page-characteristics-equipop .equipop-table-wrap .equipop-links-table td.equipop-td-equip .equipop-cell-view {
  white-space: nowrap;
}

.page-characteristics-equipop .equipop-pagination {
  margin-top: 0.35rem;
  padding-top: 0.28rem;
}

/* Пагинация как у таблицы заказов: компактные квадратные кнопки */
.page-characteristics-equipop .equipop-pagination .pagination .btn.btn--sm {
  min-width: 2.15rem;
  padding: 0.28rem 0.4rem;
  font-weight: 600;
  border-radius: 10px;
  line-height: 1.15;
}

@media (max-width: 1100px) {
  .equipop-top-row {
    grid-template-columns: 1fr;
  }

  .equipop-top-row > .equipop-top-col--equipment,
  .equipop-top-row > .equipop-top-col--operations {
    grid-column: 1;
    grid-row: auto;
  }

  .page-characteristics-equipop .equipop-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-characteristics-equipop .equipop-title-files {
    margin-left: 0;
    width: 100%;
  }

  .page-characteristics-equipop .equipop-title-files .equipop-actions-stack {
    justify-content: flex-start;
  }

  .equipop-tags-strip.equipop-tags-strip--has-picks {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.45rem;
    overflow: hidden;
  }

  .equipop-tags-strip__cell {
    flex: 1 1 42%;
    min-width: 0;
    max-height: var(--equipop-tags-strip-max-height);
    overflow: hidden;
  }

}

#tableHistory td,
#tableFinance td {
  color: #30394b;
}

.page-finance #tableFinance th,
.page-finance #tableFinance td {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  line-height: 1.1;
}

@media (max-width: 1200px) {
  #tableOrders {
    min-width: 920px;
  }
  #tableHistory,
  #tableFinance,
  #tableCart {
    min-width: 740px;
  }
}

/* Финальный pixel-pass classic-plus */

.content {
  line-height: 1.35;
}

.section__title,
.block__title {
  letter-spacing: 0.01em;
}

.input,
.input--sm,
select.input {
  min-height: 38px;
}

.input--status {
  min-height: 34px;
}

.btn {
  min-height: 36px;
  line-height: 1.2;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Поверх глобального pixel-pass: компактные контролы в карточках (кэш style.css ломал min-height) */
.page-characteristics-equipop .equipop-top-row .equipop-block .input.input--sm {
  min-height: 28px !important;
  max-height: 28px;
  height: 28px;
  box-sizing: border-box;
  padding: 0.18rem 0.42rem 0.18rem 0.42rem;
  line-height: 1.2;
  font-size: 13px;
}

.page-characteristics-equipop .equipop-top-row .equipop-block .equipop-ac-wrap--dropdown .input.input--sm {
  padding-right: 1.22rem;
}

.page-characteristics-equipop
  .equipop-top-row
  .equipop-block
  .equipop-ac-wrap--dropdown:has(.equipop-input-clear:not(.u-hidden))
  .input.input--sm {
  padding-right: 2.55rem;
}

.page-characteristics-equipop .equipop-top-row .equipop-block .btn.btn--sm {
  min-height: 28px !important;
  max-height: 28px;
  box-sizing: border-box;
  line-height: 1.2;
}

.page-characteristics-equipop .equipop-top-row .equipop-block .btn.btn--sm.btn--icon {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px !important;
  max-height: 28px;
  padding: 0;
  line-height: 1;
}

.page-characteristics-equipop .equipop-top-row .equipop-block .equipop-link-inline.btn.btn--sm {
  height: 28px;
  min-height: 28px !important;
  max-height: 28px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:focus-visible,
.input:focus-visible,
.input--sm:focus-visible,
select.input:focus-visible,
.nav-sub-link:focus-visible,
.nav-footer-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(1, 104, 250, 0.16);
}

.table {
  font-variant-numeric: normal;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

#tableOrders th,
#tableOrders td {
  vertical-align: top;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

#tableOrders td .input--status {
  min-width: 130px;
}

#tableOrders td .tag,
#tableOrders td .tag--sm {
  margin-bottom: 0.15rem;
}

.block__sub {
  color: #7b8699;
}

.nav-group + .nav-group {
  margin-top: 0.18rem;
}

/* Ширина .sidebar и padding .content classic-plus — tokens.css */

/* Утилиты для замены inline-стилей в шаблонах */

.u-w-full {
  width: 100%;
}

.u-hidden {
  display: none;
}

.form-field-error {
  margin-top: 0.25rem;
  min-height: 1em;
  font-size: 12px;
  line-height: 1.25;
  color: #b91c1c;
}

.input--error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.u-flex {
  display: flex;
}

.u-flex-col {
  flex-direction: column;
}

.u-flex-wrap {
  flex-wrap: wrap;
}

.u-items-center {
  align-items: center;
}

.u-items-start {
  align-items: flex-start;
}

.u-justify-between {
  justify-content: space-between;
}

.u-justify-end {
  justify-content: flex-end;
}

.u-gap-03 {
  gap: 0.3rem;
}

.u-gap-05 {
  gap: 0.5rem;
}

.u-gap-075 {
  gap: 0.75rem;
}

.u-mt-1 {
  margin-top: 1rem;
}

.u-mt-05 {
  margin-top: 0.5rem;
}

.u-mb-1 {
  margin-bottom: 1rem;
}

.u-maxw-100 {
  max-width: 100%;
}

.u-maxw-480 {
  max-width: 480px;
}

.u-maxw-600 {
  max-width: 600px;
}

.u-maxw-640 {
  max-width: 640px;
}

.u-flex-1 {
  flex: 1;
}

.u-flex-2 {
  flex: 2;
}

.u-minw-220 {
  min-width: 220px;
}

.u-minw-320 {
  min-width: 320px;
}

.u-w-170 {
  width: 170px;
}

.u-w-100 {
  width: 100px;
}

.u-btn-add {
  height: 38px;
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.u-action-col {
  width: 190px;
}

.u-label-file {
  cursor: pointer;
  margin: 0;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
}

.btn-icon-only .icon-feather-action {
  width: 20px;
  height: 20px;
}

.model-import-actions .btn {
  padding: 0.28rem 0.58rem;
}

.model-import-actions .btn-icon-only {
  width: 32px;
  height: 32px;
}

.model-import-actions #btnImport .import-btn-icon {
  width: 30px !important;
  height: 30px !important;
  stroke-width: 2 !important;
  display: block;
}


/* Заказ на пошив: код пачки, статусы сотрудников и компактность */

.batch-link {
  display: inline-block;
  line-height: 1.15;
}

.batch-code-sub {
  color: #7b8699;
  font-size: 11px;
  font-weight: 500;
}

.cell-qty {
  white-space: nowrap;
}

.worker-status-badge {
  display: inline-block;
  padding: 0.14rem 0.42rem;
  border-radius: var(--app-ui-radius-status);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  line-height: 1.2;
}

.worker-status-badge--assigned {
  background: #f4f6fb;
  color: #566177;
  border-color: #d7ddea;
}

.worker-status-badge--working {
  background: #fff7e8;
  color: #a16007;
  border-color: #ffe1ab;
}

.worker-status-badge--paused {
  background: #fff0f1;
  color: #b4232f;
  border-color: #ffcbd0;
}

.worker-status-badge--done {
  background: #ecfdf3;
  color: #0f8a4b;
  border-color: #b7efcf;
}

/* Значительно компактнее: Заказ на пошив */
.page-orders .content {
  padding: 1rem 1rem;
}

.page-orders .section {
  margin-bottom: 1rem;
}

.page-orders .section__title {
  margin-bottom: 0.65rem;
  font-size: 15px;
}

.page-orders .orders-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.2rem;
}

.page-orders .orders-status-head .section__title {
  margin-bottom: 0;
}

.page-orders #btnDownloadAllOrdersCsv {
  margin-left: auto;
  white-space: nowrap;
}

.page-orders .orders-status-tabs,
.page-warehouse .warehouse-tabs,
.page-employees .orders-status-tabs,
.summary-mid-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  border-bottom: 1px solid #d7dde8;
  padding-left: 0;
}

.page-orders .orders-status-tab,
.page-warehouse .warehouse-tabs .orders-status-tab,
.page-employees .orders-status-tab,
.summary-mid-tab {
  border: 1px solid #d7dde8;
  border-bottom: none;
  background: #f3f6fb;
  color: #475569;
  border-radius: var(--app-ui-radius) var(--app-ui-radius) 0 0;
  min-height: 29px;
  padding: 0.28rem 0.78rem;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.15;
  cursor: pointer;
  margin-bottom: -1px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.page-orders .orders-status-tab + .orders-status-tab,
.page-warehouse .warehouse-tabs .orders-status-tab + .orders-status-tab,
.page-employees .orders-status-tab + .orders-status-tab,
.summary-mid-tab + .summary-mid-tab {
  margin-left: -1px;
}

.page-orders .orders-status-tab:hover,
.page-warehouse .warehouse-tabs .orders-status-tab:hover,
.page-employees .orders-status-tab:hover,
.summary-mid-tab:hover {
  background: #eaf0fa;
  color: #334155;
}

.page-employees .orders-status-tab.is-active,
.summary-mid-tab.is-active {
  background: #fff;
  color: #1d4ed8;
  border-color: #d7dde8;
  border-bottom: 1px solid #fff;
  font-weight: 600;
}

/* Заказ на пошив, Отгрузка: активная вкладка без нижней линии (стык с блоком таблицы) */
.page-orders .orders-status-tab.is-active,
.page-warehouse .warehouse-tabs .orders-status-tab.is-active {
  background: #fff;
  color: #1d4ed8;
  border-color: #d7dde8;
  border-bottom: none;
  font-weight: 600;
  z-index: 1;
}

.page-orders .orders-status-tabs,
.page-warehouse .warehouse-tabs,
.page-employees .orders-status-tabs {
  margin: 0 0 0.02rem 0;
}

.page-orders .orders-status-tabs,
.page-employees .orders-status-tabs {
  position: relative;
  border-bottom: 0;
  z-index: 2;
}

.page-warehouse .warehouse-tabs {
  position: relative;
  border-bottom: 0;
  z-index: 2;
}

.page-orders .orders-status-tabs::before,
.page-employees .orders-status-tabs::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: -1px;
  width: 1px;
  background: var(--df-border);
  pointer-events: none;
}

.page-warehouse .warehouse-tabs::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: -1px;
  width: 1px;
  background: var(--df-border);
  pointer-events: none;
}

.page-orders .orders-status-tab,
.page-employees .orders-status-tab {
  position: relative;
}

.page-warehouse .warehouse-tabs .orders-status-tab {
  position: relative;
}

.page-employees .orders-status-tab.is-active::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: -1px;
  height: 2px;
  background: var(--df-surface);
  pointer-events: none;
}

.page-orders .orders-status-tab.is-active::after,
.page-warehouse .warehouse-tabs .orders-status-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 3px;
  background: var(--df-surface);
  pointer-events: none;
  z-index: 2;
}

.page-orders .orders-status-tab:not(.is-active),
.page-warehouse .warehouse-tabs .orders-status-tab:not(.is-active) {
  border-bottom: 1px solid #d7dde8;
}

.page-orders .orders-status-tabs + .table-wrap,
.page-employees .orders-status-tabs + .table-wrap {
  border-top-left-radius: 0;
  position: relative;
  z-index: 0;
}

.page-warehouse .warehouse-tabs + .block {
  border-top-left-radius: 0;
  position: relative;
  z-index: 0;
}

@media (max-width: 900px) {
  .page-orders .orders-status-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .page-orders #btnDownloadAllOrdersCsv {
    margin-left: 0;
  }
}

.page-orders .block {
  padding: 0.72rem 0.78rem;
  gap: 0.45rem;
}

.page-orders .blocks-row.u-mt-1 {
  align-items: stretch;
}

.page-orders .blocks-row.u-mt-1 > .block {
  display: flex;
  flex-direction: column;
}

.page-orders .block__title {
  font-size: 14px;
}

.page-orders .order-optional-size {
  margin-top: 0.35rem;
  display: grid;
  gap: 0.3rem;
}

.page-orders .order-optional-size__ask {
  font-size: 12px;
  color: #475569;
}

.page-orders .order-optional-size__toggles {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: nowrap;
}

.page-orders .order-optional-size__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 12px;
  color: #334155;
}

.page-orders .order-optional-size__toggle input {
  margin: 0;
}

/* Ещё компактнее только верхний блок "Заказ на пошив" (без блока "Статусы заказов"). */
.page-orders .section:first-of-type {
  margin-bottom: 0.72rem;
}

.page-orders .section:first-of-type .section__title {
  margin-bottom: 0.46rem;
}

.page-orders .section:first-of-type > .block {
  padding: 0.56rem 0.62rem;
  gap: 0.34rem;
}

.page-orders .section:first-of-type .blocks-row.u-mt-1 {
  gap: 0.72rem;
  margin-top: 0.62rem !important;
}

.page-orders .section:first-of-type .blocks-row.u-mt-1 > .block {
  padding: 0.56rem 0.62rem;
  gap: 0.32rem;
}

/* Форма «Заказ на пошив»: строка «Цвет / Размер / Кол-во / кнопки» не должна
   складываться в 2×2 при масштабе ~125% (viewport падает ниже 1400px CSS px).
   Глобальные правила .blocks-row для средних экранов отменяем только здесь. */
@media (max-width: 1400px) {
  .page-orders .section:first-of-type .blocks-row.u-mt-1 {
    flex-wrap: nowrap;
    gap: 0.52rem;
    margin-top: 0.52rem !important;
  }

  .page-orders .section:first-of-type .blocks-row.u-mt-1 > .block {
    min-width: 0;
    flex: 1 1 0;
    padding: 0.48rem 0.54rem;
    gap: 0.26rem;
  }

  /* Компактнее при «узком» viewport (масштаб 125–150%, ноутбук). */
  .page-orders .section:first-of-type > .block {
    padding: 0.48rem 0.54rem;
    gap: 0.28rem;
  }

  .page-orders .section:first-of-type .block__title {
    font-size: 13px;
    margin-bottom: 0.18rem;
  }

  .page-orders .section:first-of-type .chip-group {
    gap: 0.28rem;
  }

  .page-orders .section:first-of-type .chip {
    min-height: 1.32rem;
    padding: 0.14rem 0.4rem;
  }

  .page-orders .section:first-of-type .order-optional-size {
    margin-top: 0.16rem;
    gap: 0.16rem;
  }

  .page-orders .section:first-of-type .order-optional-size__ask,
  .page-orders .section:first-of-type .order-optional-size__toggle {
    font-size: 10.5px;
  }

  .page-orders .section:first-of-type .input,
  .page-orders .section:first-of-type .btn {
    min-height: 30px;
    font-size: 11.5px;
  }
}

@media (max-width: 1200px) {
  .page-orders .section:first-of-type .blocks-row.u-mt-1 {
    flex-wrap: nowrap;
  }
  .page-orders .section:first-of-type .blocks-row.u-mt-1 > .block {
    min-width: 0;
    flex: 1 1 0;
  }
}

.page-orders .section:first-of-type .block__title {
  margin-bottom: 0.22rem;
  font-size: 13.5px;
}

.page-orders .section:first-of-type .chip-group {
  gap: 0.34rem;
}

.page-orders .section:first-of-type .chip {
  min-height: 1.44rem;
  padding: 0.18rem 0.48rem;
  font-size: 0.72rem;
}

.page-orders .section:first-of-type .order-optional-size {
  margin-top: 0.2rem;
  gap: 0.2rem;
}

.page-orders .section:first-of-type .order-optional-size__ask,
.page-orders .section:first-of-type .order-optional-size__toggle {
  font-size: 11px;
}

.page-orders .section:first-of-type .input,
.page-orders .section:first-of-type .btn {
  min-height: 32px;
  font-size: 12px;
}

.page-orders #orderErrSize:empty,
.page-orders #orderErrHeight:empty,
.page-orders #orderErrFullness:empty {
  display: none;
}

.page-orders .input,
.page-orders .input--sm,
.page-orders .btn {
  min-height: 34px;
  font-size: 13px;
}

.page-orders .table th,
.page-orders .table td {
  padding: 0.43rem 0.52rem;
  font-size: 12px;
}

.page-orders #tableOrders thead th {
  white-space: nowrap;
  padding-top: 0.28rem;
  padding-bottom: 0.28rem;
  text-align: left;
  vertical-align: middle;
}

/* Высота строк «Статусы заказов» задаётся ниже (#tableOrders tbody … height), иначе перебивается. */

/* Начат / Завершён / Пошит — вторая строка ячейки */
.page-orders #tableOrders .orders-dt-subl {
  color: #6b7280;
  font-size: 11px;
}

.page-orders #tableCart thead th {
  white-space: nowrap;
  padding-top: 0.28rem;
  padding-bottom: 0.28rem;
  text-align: left;
  vertical-align: middle;
}

.page-orders #tableOrders thead .input--sm {
  min-height: 26px;
  height: 26px;
  padding-top: 0.14rem;
  padding-bottom: 0.14rem;
  font-size: 12px;
  font-weight: 500;
  color: #3a475d;
  line-height: 1;
  text-align: center;
}

.page-orders #tableOrders thead .input--sm::placeholder {
  color: #6b7280;
  font-weight: 500;
}

.page-orders #tableOrders thead #filterModelInput,
.page-orders #tableOrders thead #filterBatchInput {
  text-align: left;
}

.page-orders #tableOrders thead .orders-dropdown {
  position: relative;
  width: 100%;
}

.page-orders #tableOrders thead .orders-dropdown__trigger {
  width: 100%;
  min-height: 24px;
  height: 24px;
  padding: 0.12rem 1.25rem 0.12rem 0.44rem;
  border: 1px solid #d8deea;
  border-radius: 8px;
  background: #fff;
  color: #3a475d;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.page-orders #tableOrders thead .orders-dropdown__trigger-input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #3a475d;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 0;
}

.page-orders #tableOrders thead .orders-dropdown__trigger-input::placeholder {
  color: #6b7280;
}

.page-orders #tableOrders thead .orders-dropdown__trigger::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #7b8699;
  border-bottom: 1.5px solid #7b8699;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.page-orders #tableOrders thead .orders-dropdown.is-open .orders-dropdown__trigger {
  border-color: #c8d6f2;
  box-shadow: 0 0 0 2px rgba(1, 104, 250, 0.08);
}

.page-orders #tableOrders thead .orders-dropdown__menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  min-width: 0;
  width: 0;
  max-width: none;
  z-index: 9999;
  background: #fff;
  border: 1px solid #d8deea;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  padding: 0.15rem;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.page-orders #tableOrders thead .orders-dropdown__options {
  display: block;
}

.page-orders #tableOrders thead .orders-dropdown.is-open .orders-dropdown__menu {
  display: block;
}

.page-orders #tableOrders thead .orders-dropdown__option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  padding: 0.24rem 0.42rem;
  min-height: 24px;
  border-radius: 6px;
  cursor: pointer;
  white-space: normal;
}

.page-orders #tableOrders thead .orders-dropdown__option:hover {
  background: #f1f5f9;
}

.page-orders #tableOrders thead .orders-dropdown__option.is-active {
  background: #e8f0ff;
  color: #1d4ed8;
  font-weight: 600;
}

.page-orders #tableOrders thead .orders-dropdown__empty {
  padding: 0.3rem 0.42rem;
  color: #6b7280;
  font-size: 11px;
}

.page-orders .tag--sm {
  font-size: 11px;
  padding: 0.1rem 0.35rem;
}

.page-orders .workers-cell {
  display: inline-flex;
  width: auto;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.2rem;
  min-width: 122px;
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
}

.page-orders .workers-cell__names {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 104px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #334155;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  text-align: left;
}

.page-orders .workers-cell__empty {
  color: #9ca3af;
  font-size: 11px;
}

.page-orders .workers-more-btn {
  margin-left: 0.08rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #c8d6f2;
  background: #f5f8ff;
  color: #37568d;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.15;
  padding: 0.08rem 0.22rem;
  cursor: pointer;
}

.page-orders #tableOrders tbody .order-status-readonly {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  border-radius: var(--app-ui-radius-status);
  min-height: 24px;
  padding: 0.12rem 0.44rem;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  border: 1px solid #d8deea;
  background: #f8fafc;
  color: #334155;
}

.page-orders #tableOrders tbody .order-status-readonly.status--ready {
  background: #eaf2ff;
  color: #1e5bc6;
  border: 1px solid #c8dcff;
}

.page-orders #tableOrders tbody .order-status-readonly.status--active {
  background: #fff5de;
  color: #9a5b05;
  border: 1px solid #ffd99a;
}

.page-orders #tableOrders tbody .order-status-readonly.status--paused {
  background: #ffeef0;
  color: #b4232f;
  border: 1px solid #ffc5cc;
}

.page-orders #tableOrders tbody .order-status-readonly.status--done {
  background: #e8fbef;
  color: #0f8a4b;
  border: 1px solid #abe8c4;
}

.page-orders #tableOrders tbody .order-status-readonly.status--cancelled {
  background: #f1f4f9;
  color: #566177;
  border: 1px solid #d4dbe8;
}

.page-orders #tableOrders tbody .order-status-readonly.status--rework {
  background: #f2ecff;
  color: #5b3db5;
  border: 1px solid #dcccff;
}

.page-orders .batch-link--plain {
  color: #1f2937;
  text-decoration: none;
}

.orders-batch-qr-popover {
  position: fixed;
  z-index: 1300;
  width: 132px;
  padding: 6px;
  border: 1px solid #d1d5db;
  border-radius: var(--app-ui-radius-dropdown);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.orders-batch-qr-popover__title {
  font-size: 11px;
  color: #374151;
  text-align: center;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.orders-batch-qr-popover__canvas {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border: 1px solid #e5e7eb;
  border-radius: var(--app-ui-radius);
  overflow: hidden;
  background: #fff;
  line-height: 0;
  font-size: 0;
  position: relative;
}

.orders-batch-qr-popover__canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  vertical-align: top;
}

.orders-batch-qr-popover__canvas img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  vertical-align: top;
  object-fit: contain;
}

.orders-batch-qr-popover__canvas table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
}

.page-orders .order-deleted-meta {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  width: 100%;
}

.page-orders .order-deleted-meta__line {
  display: block;
  white-space: nowrap;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-orders .order-deleted-meta__sub {
  color: #94a3b8;
  font-size: 10px;
  white-space: nowrap;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-orders #tableOrders tbody tr {
  height: 32px;
}

.page-orders #tableOrders tbody td {
  height: 32px;
  max-height: 32px;
  padding-top: 0.08rem;
  padding-bottom: 0.08rem;
  overflow: hidden;
  vertical-align: middle;
  font-size: 11px;
  line-height: 1.18;
}

.page-orders #tableCart tbody td {
  height: 34px !important;
  max-height: 34px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden;
  vertical-align: middle;
  font-size: 11px;
}

.page-orders #tableCart tbody tr {
  height: 34px !important;
}

.page-orders #tableCart .input--sm {
  min-height: 26px;
  height: 26px;
  padding-top: 0.12rem;
  padding-bottom: 0.12rem;
  font-size: 11px;
  line-height: 1.1;
}

.page-orders #tableCart .btn--sm {
  min-height: 26px;
  height: 26px;
  font-size: 11px;
}

.page-orders #tableCart .cart-actions {
  display: inline-flex;
  align-items: center;
  height: 26px;
  gap: 0.25rem;
}

.page-orders #tableCart .cart-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  line-height: 1;
}

.page-orders #tableCart tbody td:last-child {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  vertical-align: middle !important;
}

.page-orders #tableCart thead th:first-child,
.page-orders #tableCart tbody td.cart-row-index {
  width: 44px;
  min-width: 44px;
  text-align: center;
  color: #475569;
  font-weight: 600;
}

.page-orders #tableOrders:not(.table-orders--deleted) tbody tr {
  height: 36px;
}

.page-orders #tableOrders:not(.table-orders--deleted) tbody td {
  height: 36px;
  max-height: 36px;
  padding-top: 0.05rem;
  padding-bottom: 0.05rem;
  line-height: 1.18;
}

.page-orders #tableOrders:not(.table-orders--deleted) thead th:nth-child(7),
.page-orders #tableOrders:not(.table-orders--deleted) tbody td:nth-child(7) {
  width: 144px !important;
  min-width: 144px !important;
  max-width: 144px !important;
}

.page-orders #tableOrders:not(.table-orders--deleted) thead th:nth-child(11),
.page-orders #tableOrders:not(.table-orders--deleted) tbody td:nth-child(11) {
  width: 146px !important;
  min-width: 146px !important;
  max-width: 146px !important;
}

.page-orders #tableOrders.table-orders--deleted tbody tr {
  height: 36px;
}

.page-orders #tableOrders.table-orders--deleted tbody td {
  height: 36px;
  max-height: 36px;
  padding-top: 0.08rem;
  padding-bottom: 0.08rem;
  overflow: hidden;
}

.page-orders #tableOrders.table-orders--deleted thead th:nth-child(12),
.page-orders #tableOrders.table-orders--deleted tbody td:nth-child(12) {
  width: 132px !important;
  min-width: 132px !important;
  max-width: 132px !important;
}

.page-orders #tableOrders.table-orders--deleted tbody td:nth-child(12) {
  overflow: hidden;
  vertical-align: middle;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 0.34rem;
  padding-right: 0.34rem;
}

.page-orders #tableOrders.table-orders--deleted tbody td:nth-child(12) .order-deleted-meta {
  display: block;
  width: 100%;
  text-align: left;
  line-height: 1.15;
  padding-left: 0;
}

.page-orders #tableOrders.table-orders--deleted {
  width: 100%;
  table-layout: fixed;
}

.page-orders #tableOrders.table-orders--deleted thead th:nth-child(2),
.page-orders #tableOrders.table-orders--deleted tbody td:nth-child(2) {
  width: 122px !important;
  min-width: 122px !important;
}

.page-orders #tableOrders.table-orders--deleted thead th:nth-child(7),
.page-orders #tableOrders.table-orders--deleted tbody td:nth-child(7) {
  width: 108px !important;
  min-width: 108px !important;
}

.page-orders #tableOrders.table-orders--deleted thead th:nth-child(8),
.page-orders #tableOrders.table-orders--deleted tbody td:nth-child(8),
.page-orders #tableOrders.table-orders--deleted thead th:nth-child(9),
.page-orders #tableOrders.table-orders--deleted tbody td:nth-child(9),
.page-orders #tableOrders.table-orders--deleted thead th:nth-child(10),
.page-orders #tableOrders.table-orders--deleted tbody td:nth-child(10) {
  width: 76px !important;
  min-width: 76px !important;
}

.page-orders #tableOrders.table-orders--deleted thead th:nth-child(11),
.page-orders #tableOrders.table-orders--deleted tbody td:nth-child(11) {
  width: 156px !important;
  min-width: 156px !important;
}

.page-orders #tableOrders thead th:nth-child(1),
.page-orders #tableOrders tbody td:nth-child(1) {
  width: 26px !important;
  min-width: 26px !important;
  max-width: 26px !important;
  text-align: center;
  padding: 0 !important;
  vertical-align: middle;
}

.page-orders #tableOrders th.cell-order-check,
.page-orders #tableOrders td.cell-order-check {
  width: 26px !important;
  min-width: 26px !important;
  max-width: 26px !important;
  padding: 0 !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.page-orders #tableOrders col.col-order-check {
  width: 26px;
}

.page-orders #ordersSelectAll,
.page-orders .orders-row-check {
  width: 12px;
  height: 12px;
  margin: 0 auto;
  display: block;
  vertical-align: middle;
}

.page-orders #tableOrders thead th:nth-child(7),
.page-orders #tableOrders tbody td:nth-child(7) {
  width: 138px;
  min-width: 138px;
  text-align: center;
  vertical-align: middle;
}

.page-orders #tableOrders thead th:nth-child(7) {
  text-align: left;
}

.page-orders #tableOrders thead th:nth-child(8),
.page-orders #tableOrders tbody td:nth-child(8),
.page-orders #tableOrders thead th:nth-child(9),
.page-orders #tableOrders tbody td:nth-child(9) {
  width: 94px;
  min-width: 94px;
  font-size: 11px;
  text-align: center;
}

.page-orders #tableOrders thead th:nth-child(10),
.page-orders #tableOrders tbody td:nth-child(10) {
  width: 94px;
  min-width: 94px;
  font-size: 11px;
  text-align: center;
}

.page-orders #tableOrders thead th:nth-child(11),
.page-orders #tableOrders tbody td:nth-child(11) {
  width: 168px;
  min-width: 168px;
}

.page-orders #tableOrders thead th:nth-child(2),
.page-orders #tableOrders tbody td:nth-child(2) {
  min-width: 168px;
  width: 17%;
  max-width: 280px;
}

.page-orders #tableOrders thead th:nth-child(5),
.page-orders #tableOrders tbody td:nth-child(5) {
  width: 5.5rem;
  min-width: 5.25rem;
  max-width: 5.75rem;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.page-orders #tableOrders thead th:nth-child(6),
.page-orders #tableOrders tbody td:nth-child(6) {
  width: 126px;
  min-width: 126px;
  max-width: 126px;
}

.page-orders #tableOrders thead th:nth-child(7),
.page-orders #tableOrders tbody td:nth-child(7),
.page-orders #tableOrders thead th:nth-child(8),
.page-orders #tableOrders tbody td:nth-child(8),
.page-orders #tableOrders thead th:nth-child(9),
.page-orders #tableOrders tbody td:nth-child(9),
.page-orders #tableOrders thead th:nth-child(10),
.page-orders #tableOrders tbody td:nth-child(10),
.page-orders #tableOrders thead th:nth-child(11),
.page-orders #tableOrders tbody td:nth-child(11) {
  padding-left: 0.34rem;
  padding-right: 0.34rem;
}

.page-orders #tableOrders thead th:nth-child(4),
.page-orders #tableOrders tbody td:nth-child(4) {
  width: 86px;
  min-width: 86px;
  max-width: 100px;
}

.page-orders #tableOrders tbody td:nth-child(2) {
  vertical-align: middle;
}

.page-orders #tableOrders tbody td:nth-child(2) {
  padding-top: 0;
  padding-bottom: 0;
}

.page-orders #tableOrders tbody td:nth-child(2) .order-model-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
  max-height: calc(2 * 1.15em);
  word-break: break-word;
}

.page-orders #tableOrders tbody td:nth-child(11) {
  vertical-align: middle;
  text-align: center;
  padding-top: 0;
  padding-bottom: 0;
}

.page-orders #tableOrders tbody td:nth-child(11) .batch-cell-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  vertical-align: middle;
  text-align: left;
  width: 100%;
  min-height: 100%;
  line-height: 1.15;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: #1f2937;
  gap: 3px;
}

.page-orders #tableOrders tbody td:nth-child(11) .batch-code-main {
  display: block;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
}

.page-orders #tableOrders tbody td:nth-child(11) a.batch-code-main {
  color: #1a56c8;
  text-decoration: none;
}

.page-orders #tableOrders tbody td:nth-child(11) a.batch-code-main:hover {
  text-decoration: underline;
}

.page-orders #tableOrders tbody td:nth-child(11) .batch-progress-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.page-orders #tableOrders tbody td:nth-child(11) .batch-progress {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 6px;
  border-radius: var(--app-ui-radius);
  background: #e5e7eb;
  overflow: hidden;
}

.page-orders #tableOrders tbody td:nth-child(11) .batch-progress__bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: #2563eb;
  border-radius: var(--app-ui-radius);
}

.page-orders #tableOrders tbody td:nth-child(11) .batch-progress__text {
  flex: 0 0 auto;
  min-width: 34px;
  font-size: 10px;
  line-height: 1;
  color: #64748b;
}

.page-orders #tableOrders thead th:nth-child(12),
.page-orders #tableOrders tbody td:nth-child(12) {
  width: 88px;
  min-width: 88px;
  text-align: center;
}

.page-orders .order-head-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 0.12rem;
  width: 100%;
}

.page-orders #tableOrders th > .order-head-actions {
  flex-direction: row;
  gap: 0.12rem;
}

.page-orders .order-head-actions .btn-icon-plain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
}

.workers-popover-data {
  display: none;
}

.workers-popover {
  position: fixed;
  z-index: 9999;
  width: 250px;
  max-height: 190px;
  overflow: auto;
  border: 1px solid #d7deeb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.18);
  padding: 0.55rem;
}

.workers-popover__title {
  font-size: 12px;
  font-weight: 700;
  color: #1f2a44;
}

.workers-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.workers-popover__close {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.workers-popover__body {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
}

/* Значительно компактнее: Список сотрудников */
.page-employees .content {
  padding: 0.75rem 0.8rem;
}

.page-employees .section {
  margin-bottom: 0.7rem;
}

.page-employees .section__title {
  margin-bottom: 0.4rem;
  font-size: 0.98rem;
}

.page-employees .block {
  padding: 0.5rem 0.56rem;
  gap: 0.3rem;
}

.page-employees .employees-adaptation-default {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.page-employees .employees-adaptation-default__label {
  font-size: 12px;
  font-weight: 600;
  color: #1f2a44;
}

.page-employees .employees-adaptation-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.page-employees .employees-adaptation-head > span {
  min-width: 0;
  line-height: 1.25;
}

.page-employees .employees-fio-privacy-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.page-employees .employees-fio-privacy-head > span {
  min-width: 0;
  line-height: 1.25;
}

.page-employees .employees-switch--privacy input:checked + .employees-switch__slider {
  background: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22);
}

.page-employees .employees-switch--privacy {
  cursor: pointer;
}

/* Размытие хвоста ФИО/телефона: глобально при включённом тоггле (не только .page-employees). */
body.employees-privacy-blur-active .emp-privacy-blur {
  filter: blur(2px);
  -webkit-filter: blur(2px);
  user-select: none;
  -webkit-user-select: none;
  display: inline;
}

.page-employees #tableEmployees tr:not(.is-editing) .emp-phone-privacy-view:not(.u-hidden) {
  display: block;
  min-height: 20px;
  color: #475569;
  font-size: 10.5px;
  line-height: 1.35;
  word-break: break-all;
}

.page-employees #tableEmployees tr:not(.is-editing) .emp-phone-privacy-view.u-hidden {
  display: none !important;
}

.page-employees .employees-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 34px;
  height: 18px;
  cursor: help;
}

.page-employees .employees-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.page-employees .employees-switch__slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.page-employees .employees-switch__slider::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.page-employees .employees-switch input:checked + .employees-switch__slider {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
}

.page-employees .employees-switch input:checked + .employees-switch__slider::before {
  transform: translateX(16px);
}

.page-employees .employees-add-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(92px, 1fr));
  gap: 0.35rem;
  align-items: center;
}

.page-employees .employees-add-scroll {
  overflow: visible;
  position: relative;
}

.page-employees .employees-add-form {
  display: block;
  width: 100%;
  min-width: 0;
}

.page-employees .employees-add-row {
  display: grid;
  gap: 0.35rem;
}

.page-employees .employees-add-row--primary {
  grid-template-columns: repeat(5, 150px);
}

.page-employees .employees-add-row--primary > * {
  width: 150px;
  min-width: 150px;
}

.page-employees .employees-add-row--secondary {
  grid-template-columns: 120px 120px 130px 170px;
}

.page-employees .employees-add-row--single {
  width: 100%;
  grid-template-columns:
    minmax(130px, 1.15fr)
    minmax(130px, 1.15fr)
    minmax(130px, 1.15fr)
    minmax(120px, 1.1fr)
    minmax(120px, 1.1fr)
    minmax(110px, 1fr)
    minmax(150px, 1.35fr)
    minmax(130px, 1.15fr)
    40px;
  align-items: center;
}

@media (max-width: 1540px) {
  .page-employees .employees-add-row--single {
    grid-template-columns:
      minmax(130px, 1.15fr)
      minmax(130px, 1.15fr)
      minmax(130px, 1.15fr)
      minmax(120px, 1.1fr)
      minmax(120px, 1.1fr)
      minmax(110px, 1fr)
      minmax(150px, 1.35fr)
      minmax(130px, 1.15fr)
      40px;
  }
}

@media (max-width: 1240px) {
  .page-employees .employees-add-row--single {
    grid-template-columns:
      minmax(130px, 1.15fr)
      minmax(130px, 1.15fr)
      minmax(130px, 1.15fr)
      minmax(120px, 1.1fr)
      minmax(120px, 1.1fr)
      minmax(110px, 1fr)
      minmax(150px, 1.35fr)
      minmax(130px, 1.15fr)
      40px;
  }
}

.page-employees .employees-add-row--single > * {
  min-width: 0;
}

.page-employees .employees-add-row--single #empPhone,
.page-employees .employees-add-row--single #empLastName {
  width: 100%;
}

.page-employees .employees-add-row--single #empFirstName,
.page-employees .employees-add-row--single #empMiddleName,
.page-employees .employees-add-row--single #empPassword {
  width: 100%;
}

.page-employees .employees-add-row--single #empPositionDropdown,
.page-employees .employees-add-row--single #empGradeDropdown {
  width: 100%;
}

.page-employees .employees-add-row--single #empStartDate {
  width: 100%;
}

.page-employees .input,
.page-employees .btn,
.page-employees select.input {
  min-height: 28px;
  font-size: 11px;
  font-family: inherit;
  font-variant-numeric: normal;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.page-employees .emp-inline-dropdown .orders-dropdown__trigger {
  font-family: inherit;
  font-variant-numeric: normal;
}

.page-employees .block__sub {
  margin-bottom: 0.15rem;
  font-size: 12px;
  line-height: 1.25;
}

.page-employees #btnAddEmployee {
  white-space: nowrap;
  width: 40px;
  min-width: 40px;
  padding-left: 0;
  padding-right: 0;
  font-size: 16px;
  line-height: 1;
}

.page-employees #empGrade,
.page-employees #empPosition,
.page-employees #empStartDate {
  width: 100%;
  min-width: 0;
}

.page-employees .emp-inline-dropdown {
  position: relative;
  width: 100%;
}

.page-employees .emp-inline-dropdown .orders-dropdown__trigger {
  width: 100%;
  min-height: 24px;
  height: 24px;
  padding: 0.12rem 1.25rem 0.12rem 0.44rem;
  border: 1px solid #d8deea;
  border-radius: 8px;
  background: #fff;
  color: #3a475d;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.page-employees .emp-inline-dropdown .orders-dropdown__trigger::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #7b8699;
  border-bottom: 1.5px solid #7b8699;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.page-employees .emp-inline-dropdown.is-open .orders-dropdown__trigger {
  border-color: #c8d6f2;
  box-shadow: 0 0 0 2px rgba(1, 104, 250, 0.08);
}

.page-employees .emp-inline-dropdown .orders-dropdown__menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  min-width: 0;
  max-width: none;
  z-index: 9999;
  background: #fff;
  border: 1px solid #64748b;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  padding: 0.15rem;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.page-employees .emp-inline-dropdown.is-open .orders-dropdown__menu {
  display: block;
}

.page-employees .emp-inline-dropdown .orders-dropdown__option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  padding: 0.24rem 0.42rem;
  min-height: 24px;
  border-radius: 6px;
  cursor: pointer;
}

.page-employees .emp-inline-dropdown .orders-dropdown__option:hover {
  background: #f1f5f9;
}

.page-employees .emp-inline-dropdown .orders-dropdown__option.is-active {
  background: #e8f0ff;
  color: #1d4ed8;
  font-weight: 600;
}

.page-employees select.input,
.page-employees #tableEmployees select.input {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 100%;
  min-height: 24px;
  height: 24px;
  padding: 0.12rem 1.25rem 0.12rem 0.44rem;
  border: 1px solid #d8deea;
  border-radius: 8px;
  background-color: #fff;
  color: #3a475d;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-image:
    linear-gradient(45deg, transparent 50%, #7b8699 50%),
    linear-gradient(135deg, #7b8699 50%, transparent 50%);
  background-position:
    calc(100% - 7px) calc(50% - 2px),
    calc(100% - 3px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.page-employees select.input:focus,
.page-employees #tableEmployees select.input:focus {
  border-color: #c8d6f2;
  box-shadow: 0 0 0 2px rgba(1, 104, 250, 0.08);
}

.page-employees select.input::-ms-expand,
.page-employees #tableEmployees select.input::-ms-expand {
  display: none;
}

.page-employees #tableEmployees th,
.page-employees #tableEmployees td {
  padding: 0.35rem 0.48rem;
  vertical-align: middle;
  min-width: 0;
}

.page-employees #tableEmployees th {
  white-space: normal;
  line-height: 1.25;
  overflow: visible;
  word-wrap: break-word;
}

/* «Должность», «Пароль»: заголовок в одну строку (ширина за счёт «Адаптация модели») */
.page-employees #tableEmployees thead th:nth-child(4),
.page-employees #tableEmployees thead th:nth-child(8) {
  white-space: nowrap;
  word-wrap: normal;
}

.page-employees #tableEmployees td {
  overflow: visible;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.page-employees .table-wrap--full {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.page-employees #tableEmployees {
  table-layout: fixed;
  width: 100%;
  /* Горизонтальный скролл у .table-wrap — таблица не сжимается ниже суммы min-width колонок */
  min-width: 80rem;
}

.page-employees #tableEmployees .employees-col-phone { width: 8%; min-width: 6.5rem; }
.page-employees #tableEmployees .employees-col-fio { width: 17%; min-width: 11rem; }
.page-employees #tableEmployees .employees-col-grade { width: 9%; min-width: 7.5rem; }
/* «Должность» в thead с white-space: nowrap — min-width не меньше ширины подписи (uppercase + letter-spacing) */
.page-employees #tableEmployees .employees-col-position { width: 7%; min-width: 9rem; }
.page-employees #tableEmployees .employees-col-start { width: 8%; min-width: 6.75rem; }
.page-employees #tableEmployees .employees-col-adaptation {
  width: 21%;
  min-width: 17.5rem;
}
.page-employees #tableEmployees .employees-col-model-adaptation { width: 15%; min-width: 10.5rem; }
.page-employees #tableEmployees .employees-col-password { width: 6%; min-width: 5.5rem; }
.page-employees #tableEmployees .employees-col-actions { width: 9%; min-width: 5.75rem; }

/* «Пароль»: визуальный зазор слева после длинной колонки «Адаптация модели» */
.page-employees #tableEmployees th:nth-child(8),
.page-employees #tableEmployees td:nth-child(8) {
  padding-left: 0.85rem;
}

.page-employees #tableEmployees .input:not(select) {
  min-height: 24px;
  height: 24px;
  font-size: 10.5px;
  padding: 0.12rem 0.28rem;
}

/* «Начало работы»: дата без рамки (alt flatpickr раньше не наследовал .emp-cell-input) */
.page-employees #tableEmployees td:nth-child(5) input.flatpickr-alt.emp-start-date {
  border: 0;
  background-color: transparent;
  box-shadow: none;
  border-radius: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: nowrap;
}

.page-employees #tableEmployees td:nth-child(5) input.flatpickr-alt.emp-start-date:focus,
.page-employees #tableEmployees td:nth-child(5) input.flatpickr-alt.emp-start-date:focus-visible {
  outline: none;
  border: 0;
  box-shadow: none;
}

.page-employees #tableEmployees .emp-view-value {
  min-width: 0;
  max-width: 100%;
  min-height: 1.25em;
  height: auto;
  display: block;
  color: #475569;
  font-size: 10.5px;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

.page-employees #tableEmployees .emp-row-dropdown {
  display: none;
}

.page-employees #tableEmployees .emp-cell-input:disabled,
.page-employees #tableEmployees .emp-adaptation:disabled {
  background: transparent;
  color: #475569;
  border-color: transparent;
  box-shadow: none;
  cursor: default;
}

.page-employees #tableEmployees tr.is-editing .emp-cell-input {
  background: #ffffff;
}

.page-employees #tableEmployees tr.is-editing .emp-view-value {
  display: none;
}

.page-employees #tableEmployees tr.is-editing .employees-model-adaptation-cell .emp-view-value--model-adaptation {
  display: flex;
}

.page-employees #tableEmployees tr.is-editing .emp-row-dropdown {
  display: block;
}

.page-employees #tableEmployees tr.is-editing .emp-password {
  display: block;
}

.page-employees #tableEmployees tr.is-editing .emp-adaptation-edit {
  display: inline-flex;
}

.page-employees #tableEmployees tr.is-editing td {
  vertical-align: middle;
}

.page-employees #tableEmployees tr.is-editing .emp-position {
  color: #1f2937;
  background-color: #ffffff;
  border: 1px solid #d8deea;
  font-weight: 600;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #7b8699 50%),
    linear-gradient(135deg, #7b8699 50%, transparent 50%) !important;
  background-position:
    calc(100% - 7px) calc(50% - 2px),
    calc(100% - 3px) calc(50% - 2px) !important;
  background-size: 6px 6px, 6px 6px !important;
  background-repeat: no-repeat !important;
  padding-right: 1.15rem !important;
}

.page-employees #tableEmployees tr.is-editing .emp-position:focus {
  border-color: #c8d6f2;
  box-shadow: 0 0 0 2px rgba(1, 104, 250, 0.08);
}

.page-employees #tableEmployees tr:not(.is-editing) .emp-cell-input:disabled {
  padding-left: 0;
  padding-right: 0;
  min-height: 20px;
  height: 20px;
}

.page-employees #tableEmployees tr:not(.is-editing) .emp-password {
  display: none;
}

.page-employees #tableEmployees tr:not(.is-editing) .emp-adaptation-edit {
  display: none;
}

.page-employees #tableEmployees tr:not(.is-editing) select.input.emp-cell-input:disabled {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: none !important;
  padding-right: 0 !important;
}

.page-employees .employees-adaptation-cell {
  text-align: left;
}

.page-employees .employees-adaptation-cell .emp-adaptation-edit {
  display: none;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.18rem 0.28rem;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.page-employees .employees-adaptation-cell .emp-adaptation {
  margin: 0;
  flex-shrink: 0;
}

.page-employees .employees-adaptation-cell .emp-adaptation-days,
.page-employees .employees-adaptation-cell .emp-adaptation-percent {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  flex: 0 0 auto;
  text-align: center;
  padding-left: 0.15rem !important;
  padding-right: 0.15rem !important;
}

.page-employees .employees-adaptation-cell .emp-adaptation-text {
  font-size: 10px;
  color: #475569;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.page-employees .employees-model-adaptation-cell {
  text-align: left;
}

.page-employees .employees-model-adaptation-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.22rem 0.35rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.page-employees .employees-model-adaptation-cell .emp-view-value--model-adaptation {
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 100%;
  min-height: 1.25em;
  height: auto;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

.page-employees .employees-model-adaptation-cell .emp-model-adaptation-flag {
  margin-top: 0;
  flex: 0 0 auto;
}

.page-employees .employees-actions {
  display: inline-flex;
  gap: 0.14rem;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

/* Список сотрудников: вкладки + table-wrap как «Статусы заказов» на пошиве */
.page-employees .employees-list-section {
  margin-top: 0.25rem;
}

.page-employees .employees-list-hint {
  margin-top: 0;
  margin-bottom: 0;
}

.page-employees .employees-list-hint:not(.u-hidden) {
  margin-bottom: 0.45rem;
}

.page-employees .employees-list-table-wrap.table-wrap {
  margin-top: 0;
}

.page-employees .employees-list-table-wrap .table th,
.page-employees .employees-list-table-wrap .table td {
  border-bottom-color: #edf1f7;
}

.page-employees #tableEmployees.is-fired-list thead .employees-adaptation-head .employees-switch {
  display: none !important;
}

.page-employees .emp-fired-meta {
  font-size: 10px;
  color: #64748b;
  margin-top: 0.22rem;
  line-height: 1.25;
}

.page-employees .emp-fired-fio {
  font-size: 10.5px;
  color: #475569;
  line-height: 1.35;
}

.page-employees .emp-fired-cell {
  font-size: 10.5px;
  color: #475569;
}

.page-employees .emp-fired-cell--wrap {
  display: block;
  white-space: normal;
  word-break: break-word;
}

.page-employees .emp-fired-actions {
  font-size: 11px;
  color: #94a3b8;
}

.page-employees .emp-fio-group {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  width: 100%;
}

.page-employees .emp-fio-group .emp-last-name {
  flex: 1 1 32%;
  min-width: 0;
}

.page-employees .emp-fio-group .emp-first-name,
.page-employees .emp-fio-group .emp-middle-name {
  flex: 1 1 34%;
  min-width: 0;
  text-align: left;
}

.page-employees #tableEmployees .emp-fio-view {
  min-width: 0;
  max-width: 100%;
  min-height: 1.25em;
  height: auto;
  display: block;
  color: #475569;
  font-size: 10.5px;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

.page-employees #tableEmployees tr:not(.is-editing) .emp-fio-group {
  display: none;
}

.page-employees #tableEmployees tr.is-editing .emp-fio-view {
  display: none;
}

.page-employees #tableEmployees tr.is-editing .emp-fio-group {
  display: flex;
}

.employees-modal {
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.employees-modal.u-hidden {
  display: none !important;
}

/* --- Адаптация --- */

.page-adaptation .adaptation-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.page-adaptation .employees-switch {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 22px;
}

.page-adaptation .employees-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.page-adaptation .employees-switch__slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #e2e8f0;
  border: 1px solid #94a3b8;
  transition: background-color 0.15s ease;
}

.page-adaptation .employees-switch__slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.22);
  transition: transform 0.15s ease;
}

.page-adaptation .employees-switch input:checked + .employees-switch__slider {
  background: #22c55e;
  border-color: #16a34a;
}

.page-adaptation .employees-switch input:checked + .employees-switch__slider::before {
  transform: translateX(18px);
}

.page-adaptation .adaptation-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 1.2rem;
  row-gap: 0.4rem;
  max-width: 900px;
  width: 100%;
}

.page-adaptation .adaptation-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-adaptation .adaptation-caption {
  margin: 0 0 0.32rem;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 400;
  color: #111827;
  min-height: 72px;
}

.page-adaptation .adaptation-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  white-space: nowrap;
}

.page-adaptation .adaptation-number {
  width: 50px;
  min-width: 50px;
  min-height: 24px;
  height: 24px;
  padding: 0.12rem 0.2rem;
  text-align: center;
  font-weight: 400;
  font-size: 13px;
}

.page-adaptation .adaptation-inline-text {
  font-size: 15px;
  line-height: 1;
  color: #6b7280;
  font-weight: 400;
}

.page-adaptation .adaptation-col--actions {
  grid-column: 1 / -1;
  align-self: auto;
  justify-content: flex-end;
  align-items: flex-end;
  margin-top: 0.28rem;
}

.page-adaptation .adaptation-save-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.page-adaptation #btnSaveAdaptation {
  min-height: 30px;
  padding: 0.22rem 0.7rem;
  font-size: 13px;
  width: auto;
  min-width: 0;
  align-self: flex-end;
  flex: 0 0 auto;
}

.page-adaptation .adaptation-status {
  min-height: 18px;
  margin-top: 6px;
  color: #0f766e;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 400;
  text-align: center;
}

.page-adaptation .adaptation-status.is-error {
  color: #b91c1c;
}

.page-adaptation .adaptation-note {
  margin-top: 0.8rem;
  font-size: 14px;
  line-height: 1.22;
  color: #4b5563;
  font-weight: 400;
}

/* --- Модели: адаптация --- */

.page-model-adaptation .model-adaptation-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.page-model-adaptation .employees-switch {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 22px;
}

.page-model-adaptation .employees-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.page-model-adaptation .employees-switch__slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #e2e8f0;
  border: 1px solid #94a3b8;
  transition: background-color 0.15s ease;
}

.page-model-adaptation .employees-switch__slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.22);
  transition: transform 0.15s ease;
}

.page-model-adaptation .employees-switch input:checked + .employees-switch__slider {
  background: #22c55e;
  border-color: #16a34a;
}

.page-model-adaptation .employees-switch input:checked + .employees-switch__slider::before {
  transform: translateX(18px);
}

.page-model-adaptation .model-adaptation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  column-gap: 1.2rem;
  row-gap: 0.45rem;
  max-width: 980px;
}

.page-model-adaptation .model-adaptation-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-model-adaptation .model-adaptation-caption {
  margin: 0 0 0.42rem;
  min-height: 88px;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 400;
  color: #111827;
}

.page-model-adaptation .model-adaptation-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  min-height: 24px;
}

.page-model-adaptation .model-adaptation-mode {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #1f2937;
  border-radius: 4px;
  overflow: hidden;
}

.page-model-adaptation .model-adaptation-mode__btn {
  border: 0;
  border-right: 1px solid #1f2937;
  background: #fff;
  color: #111827;
  font-size: 13px;
  line-height: 1;
  min-height: 24px;
  height: 24px;
  padding: 0.12rem 0.56rem;
  cursor: pointer;
}

.page-model-adaptation .model-adaptation-mode__btn:last-child {
  border-right: 0;
}

.page-model-adaptation .model-adaptation-mode__btn.is-active {
  background: #bfdbfe;
  color: #0f172a;
}

.page-model-adaptation .model-adaptation-number {
  width: 50px;
  min-width: 50px;
  min-height: 24px;
  height: 24px;
  padding: 0.12rem 0.2rem;
  text-align: center;
  font-size: 13px;
}

.page-model-adaptation .model-adaptation-inline-text {
  font-size: 15px;
  line-height: 1;
  color: #6b7280;
  font-weight: 400;
}

.page-model-adaptation .model-adaptation-mode-selected {
  min-height: 18px;
  margin-top: 6px;
  color: #0f766e;
  font-size: 12px;
}

.page-model-adaptation .model-adaptation-actions {
  margin-top: 0.55rem;
  max-width: 980px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-right: 14px;
}

.page-model-adaptation .model-adaptation-save-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.page-model-adaptation #btnSaveModelAdaptation {
  min-height: 30px;
  padding: 0.22rem 0.7rem;
  font-size: 13px;
  margin-right: 96px;
}

.page-model-adaptation .model-adaptation-status {
  min-height: 18px;
  margin-top: 6px;
  margin-right: 96px;
  color: #0f766e;
  font-size: 12px;
  text-align: center;
}

.page-model-adaptation .model-adaptation-status.is-error {
  color: #b91c1c;
}

.page-model-adaptation .model-adaptation-note {
  margin-top: 0.8rem;
  font-size: 14px;
  line-height: 1.24;
  color: #4b5563;
  font-weight: 400;
}

@media (max-width: 980px) {
  .page-model-adaptation .model-adaptation-caption {
    min-height: 0;
  }

  .page-model-adaptation .model-adaptation-actions {
    padding-right: 0;
  }

  .page-model-adaptation #btnSaveModelAdaptation {
    margin-right: 0;
  }

  .page-model-adaptation .model-adaptation-status {
    margin-right: 0;
  }
}

@media (max-width: 1280px) {
  .page-adaptation .adaptation-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .page-adaptation .adaptation-col--actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .page-adaptation .adaptation-form {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.55rem;
  }

  .page-adaptation .adaptation-caption {
    min-height: 0;
  }

  .page-adaptation .adaptation-col--actions {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .page-adaptation .adaptation-head {
    flex-wrap: wrap;
    row-gap: 0.3rem;
  }

  .page-adaptation .adaptation-inline {
    white-space: normal;
    flex-wrap: wrap;
  }
}

.employees-modal__card {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.28);
  padding: 0.9rem 1rem;
}

.employees-modal__title {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  color: #0f172a;
  font-weight: 700;
}

.employees-modal__text {
  display: none;
}

#ordersConfirmModal .employees-modal__text {
  display: block;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #0f172a;
  white-space: pre-line;
}

.employees-modal__actions {
  margin-top: 0.8rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

@media (max-width: 1700px) {
  .page-employees .employees-add-grid { grid-template-columns: repeat(9, minmax(92px, 1fr)); }
}

@media (max-width: 1200px) {
  .page-employees .employees-add-grid { grid-template-columns: repeat(9, minmax(92px, 1fr)); }
}

@media (max-width: 860px) {
  .page-employees .employees-add-grid { grid-template-columns: repeat(9, minmax(92px, 1fr)); }
}

@media (max-width: 560px) {
  .page-employees .employees-add-grid { grid-template-columns: repeat(9, minmax(92px, 1fr)); }
}

/* Значительно компактнее: Все модели */
.page-models .content {
  padding: 1rem 1rem;
}

.page-models .section {
  margin-bottom: 1rem;
}

.page-models .section__title {
  margin-bottom: 0.6rem;
  font-size: 15px;
}

/* Как «Название модели»: кнопки шаблона и импорта в строке заголовка у бейджа */
.page-models .models-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-bottom: 0.35rem;
}

.page-models .models-title-row .section__title {
  margin-bottom: 0;
}

.page-models .models-title-files {
  margin-left: 0;
  width: auto;
  max-width: 100%;
}

.page-models .models-title-files .equipop-actions-stack {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: auto;
  height: auto;
  max-height: none;
  flex: 0 0 auto;
  gap: 0.22rem;
}

.page-models .models-title-files .equipop-actions-stack > .btn,
.page-models .models-title-files .equipop-actions-stack > .csv-file-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: none;
}

.page-models .models-title-files .btn-with-icon {
  min-height: 28px !important;
  padding: 0.14rem 2ch !important;
  justify-content: center;
}

.page-models .models-title-files .btn-with-icon > span {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.page-models .models-title-files .btn-with-icon .icon-feather-action {
  width: 15px;
  height: 15px;
}

.page-models .search-bar {
  margin-bottom: 0.7rem;
}

.page-models .models-import-help {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 0;
  max-width: 52rem;
  line-height: 1.45;
}

.page-models .models-import-block {
  padding: 0.5rem 0.6rem;
}

.page-models .models-import-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.page-models .models-import-block .block__title {
  margin: 0;
  font-size: 0.9rem;
}

.page-models .input,
.page-models .input--sm,
.page-models .btn {
  min-height: 34px;
  font-size: 13px;
}

.page-models .table th,
.page-models .table td {
  padding: 0.42rem 0.5rem;
  font-size: 12px;
}

.page-models #tableOperations th,
.page-models #tableOperations td {
  padding: 0.32rem 0.4rem;
  font-size: 11px;
  line-height: 1.2;
}

.page-models #tableOperations th:nth-child(7),
.page-models #tableOperations td:nth-child(7) {
  width: 86px;
  white-space: nowrap;
}

.page-models #tableOperations th:nth-child(8),
.page-models #tableOperations td:nth-child(8) {
  width: 156px;
  white-space: nowrap;
}

.model-new-flag-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.ops-actions-cell {
  white-space: nowrap;
}

.ops-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: nowrap;
}

.page-models .ops-actions .btn {
  min-height: 24px;
  padding: 0.15rem 0.42rem;
  font-size: 11px;
  white-space: nowrap;
}

.btn-delete-icon {
  width: 24px;
  min-width: 24px;
  padding: 0;
  line-height: 1;
}


.page-models .mo-th-model {
  padding: 0.35rem 0.2rem !important;
  vertical-align: middle;
  white-space: normal;
}

.page-models .mo-th-model__search,
.page-models #searchInput.mo-th-model__search {
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  height: auto;
  box-sizing: border-box;
  padding: 0.28rem 0.45rem;
  font-size: 13px;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: normal;
}

.page-models #tableModelsOverview.table--compact th,
.page-models #tableModelsOverview.table--compact td {
  line-height: 1.2;
}

/* Высота строк как у обычной таблицы на странице моделей (.page-models .table) */
.page-models #tableModelsOverview.table--compact td {
  padding: 0.42rem 0.14rem;
  font-size: 12px;
}

/* Как у заголовков таблицы в manager-widget («Что шьет», «Время статуса») */
.page-models #tableModelsOverview.table--compact th {
  padding: 0.42rem 0.12rem;
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.15;
  text-align: left;
  vertical-align: middle;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  white-space: nowrap;
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 #eee;
}

.page-models #tableModelsOverview tbody tr:nth-child(even) {
  background: #f9fafb;
}

.page-models #tableModelsOverview tbody tr:hover {
  background: #f1f5f9;
}

.page-models .models-tabs-head {
  margin: 0 0 -1px 0;
  position: relative;
  z-index: 2;
}

.page-models .models-tabs-head.summary-mid-tabs-head {
  margin: 0 0 -1px 0;
}

.page-models .models-tabs-head .summary-mid-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-bottom: 1px solid #d7dde8;
}

.page-models .models-tabs-head .summary-mid-tabs .summary-mid-tab {
  justify-content: center;
  min-width: 0;
  padding: 0.28rem 0.62rem;
  box-sizing: border-box;
}

/* «Все модели»: ~2 пробела слева и справа от подписи */
.page-models .models-tabs-head .summary-mid-tabs .summary-mid-tab:first-child {
  padding-left: calc(0.62rem + 2ch);
  padding-right: calc(0.62rem + 2ch);
}

.page-models .models-tabs-head .summary-mid-tabs .summary-mid-tab__inner {
  justify-content: center;
  width: 100%;
}

.page-models .models-tabs-head .summary-mid-tab {
  position: relative;
}

.page-models .models-tabs-head .summary-mid-tab:not(.is-active) {
  border-bottom: 1px solid #d7dde8;
}

.page-models .models-tabs-head .summary-mid-tab.is-active {
  border-bottom: none;
}

.page-models .models-tabs-head .summary-mid-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 3px;
  background: var(--df-surface);
  pointer-events: none;
  z-index: 2;
}

.page-models .employees-switch {
  position: relative;
  display: inline-flex;
  width: 40px;
  height: 22px;
}

.page-models .employees-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.page-models .employees-switch__slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #e2e8f0;
  border: 1px solid #94a3b8;
  transition: background-color 0.15s ease;
}

.page-models .employees-switch__slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.22);
  transition: transform 0.15s ease;
}

.page-models .employees-switch input:checked + .employees-switch__slider {
  background: #22c55e;
  border-color: #16a34a;
}

.page-models .employees-switch input:checked + .employees-switch__slider::before {
  transform: translateX(18px);
}

.page-models .employees-switch--sm {
  transform: scale(0.85);
  transform-origin: left center;
}

.page-models .mo-photo-thumb-btn {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.page-models .mo-photo-thumb {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
  background: #f3f6fb;
  border: 1px solid #d7dde8;
  display: block;
}

.page-models .mo-photo-thumb--empty {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #f3f6fb;
  border: 1px dashed #cbd5e1;
  display: inline-block;
  box-sizing: border-box;
}

.page-models .mo-date {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
  font-size: 12px;
  color: #475569;
}

.page-models .table-wrap--models-overview {
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
  margin-top: 0;
}

.page-models #tableModelsOverview {
  table-layout: fixed;
  width: 100%;
}

/* 9 колонок: фото, дата, модель, адапт., оборуд., план, факт, пошив, действие */
.page-models #tableModelsOverview.table--compact thead th:nth-child(1) {
  padding-left: 0.85rem;
  padding-right: calc(0.12rem + 0.25cm);
  min-width: 2.85rem;
}

.page-models #tableModelsOverview.table--compact thead th:nth-child(2) {
  padding-right: calc(0.12rem + 0.25cm);
  min-width: 9.5rem;
}

/* Колонка «Поиск по модели»: не схлопывать под table-layout:fixed (раньше min-width:0 на th ломал ширину). */
.page-models #tableModelsOverview.table--compact thead th.mo-th-model {
  min-width: 11.5rem;
}
.page-models #tableModelsOverview.table--compact thead th:nth-child(n + 3):nth-child(-n + 7) {
  padding-left: calc(0.12rem + 0.25cm);
  padding-right: calc(0.12rem + 0.25cm);
}
.page-models #tableModelsOverview.table--compact thead th:nth-child(8) {
  padding-left: calc(0.12rem + 0.25cm);
  padding-right: calc(0.12rem + 0.5cm);
}

.page-models #tableModelsOverview.table--compact tbody td:nth-child(1) {
  padding-left: 0.75rem;
  padding-right: calc(0.14rem + 0.25cm);
}

.page-models #tableModelsOverview.table--compact tbody td:nth-child(2) {
  padding-right: calc(0.14rem + 0.25cm);
}
.page-models #tableModelsOverview.table--compact tbody td:nth-child(n + 3):nth-child(-n + 7) {
  padding-left: calc(0.14rem + 0.25cm);
  padding-right: calc(0.14rem + 0.25cm);
}
.page-models #tableModelsOverview.table--compact tbody td:nth-child(8) {
  padding-left: calc(0.14rem + 0.25cm);
  padding-right: calc(0.14rem + 0.5cm);
}

.page-models #tableModelsOverview col.mo-col--photo {
  width: 44px;
}
.page-models #tableModelsOverview col.mo-col--date {
  width: 120px;
}
.page-models #tableModelsOverview col.mo-col--model {
  width: 18%;
}
.page-models #tableModelsOverview col.mo-col--adapt {
  width: 46px;
}
.page-models #tableModelsOverview col.mo-col--eq {
  width: 28%;
}
.page-models #tableModelsOverview col.mo-col--plan {
  width: 7%;
}
.page-models #tableModelsOverview col.mo-col--fact {
  width: 7%;
}
.page-models #tableModelsOverview col.mo-col--sew {
  width: 7%;
}
.page-models #tableModelsOverview col.mo-col--del {
  width: 140px;
}

.page-models #tableModelsOverview th,
.page-models #tableModelsOverview td {
  vertical-align: top;
  text-align: left;
}

.page-models #tableModelsOverview td {
  min-width: 0;
}

.page-models #tableModelsOverview td:nth-child(1),
.page-models #tableModelsOverview td:nth-child(2),
.page-models #tableModelsOverview td:nth-child(3),
.page-models #tableModelsOverview td:nth-child(4),
.page-models #tableModelsOverview td:nth-child(6),
.page-models #tableModelsOverview td:nth-child(7),
.page-models #tableModelsOverview td:nth-child(8) {
  vertical-align: middle;
}

.page-models #tableModelsOverview thead th {
  text-align: left;
}

.page-models #tableModelsOverview th:nth-child(9),
.page-models #tableModelsOverview td:nth-child(9) {
  width: 140px;
  min-width: 132px;
  max-width: none;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  vertical-align: middle;
  overflow: visible;
  box-sizing: border-box;
  text-align: center;
  position: sticky;
  right: 0;
  z-index: 2;
  box-shadow: -6px 0 10px -6px rgba(15, 23, 42, 0.1);
}

.page-models #tableModelsOverview thead th:nth-child(9) {
  z-index: 3;
  background: #f9fafb;
}

.page-models #tableModelsOverview tbody td:nth-child(9) {
  background: var(--df-surface, #fff);
}

.page-models #tableModelsOverview tbody tr:nth-child(even) td:nth-child(9) {
  background: #f9fafb;
}

.page-models #tableModelsOverview tbody tr:hover td:nth-child(9) {
  background: #f1f5f9;
}

/* «Восстановить» — те же размеры/форма, что на «Оборудование и операции» */
.page-models #tableModelsOverview tbody td:nth-child(9) .btn.equipop-restore {
  box-sizing: border-box;
  padding: 0.1rem 0.42rem;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  min-height: 0;
  min-width: 0;
  border-radius: var(--app-ui-radius);
  white-space: nowrap;
}

.page-models #tableModelsOverview td:nth-child(6),
.page-models #tableModelsOverview td:nth-child(7),
.page-models #tableModelsOverview td:nth-child(8) {
  min-width: 5.25rem;
}

.page-models #tableModelsOverview .md-metric-time {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.06rem;
  max-width: 100%;
}

.page-models #tableModelsOverview .md-metric-time__line {
  display: block;
  white-space: normal;
  word-break: break-word;
  line-height: 1.15;
}

.page-models .btn-delete-model {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.page-models .model-link-placeholder {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  color: #111827;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

/* Кнопка в таблице — явный размер шрифта (крупнее для читаемости). */
.page-models #tableModelsOverview .model-link-placeholder {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  width: 100%;
  max-width: 100%;
  word-break: break-word;
  white-space: normal;
  text-align: left;
  display: inline-block;
  box-sizing: border-box;
}

.page-models #tableModelsOverview td:nth-child(1) .model-link-placeholder {
  text-align: left;
}

.page-models .model-link-placeholder:hover,
.page-models .model-link-placeholder:focus {
  color: #0f766e;
  outline: none;
}

.page-models #tableModelsOverview td:nth-child(5) .models-eq-item {
  align-items: flex-start;
}

.page-models #tableModelsOverview td:nth-child(5) .models-eq-inline-wrap {
  align-items: flex-start;
}

.page-models .models-eq-item,
.page-models .models-op-item,
.page-models .models-planned-line {
  min-height: 22px;
  display: flex;
  align-items: center;
}

.page-models .models-eq-inline-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 0.25rem 0.35rem;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  padding: 2px 0;
}

.page-models .models-eq-sep {
  flex: 0 0 auto;
  color: #94a3b8;
  font-weight: 600;
  user-select: none;
  padding: 0 0.06rem;
  line-height: 1;
}

.page-models .models-eq-group {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  overflow: visible;
}

.page-models .models-eq-inline-wrap .models-eq-chip.models-eq-group {
  flex: 0 0 auto;
  max-width: none;
}

.page-models .models-eq-label {
  flex: 0 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
}

.page-models .models-eq-inline-wrap .models-eq-group + .models-eq-group {
  margin-top: 0;
}

.page-models .models-op-row + .models-op-row {
  margin-top: 0;
}

.page-models #tableModelsOverview td:nth-child(3) {
  min-width: 0;
  vertical-align: middle;
}

.page-models .models-op-row {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

/* Чипы в ячейке «Оборудование»: без растягивания на всю ширину, перенос строк без скролла */
.page-models .models-eq-inline-wrap .models-op-row {
  width: auto;
  max-width: 100%;
}

.page-models .models-op-line-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.page-models .models-op-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.page-models .models-op-more {
  flex-shrink: 0;
  padding: 0 5px !important;
  min-height: 18px !important;
  height: 18px !important;
  font-size: 9px !important;
  line-height: 1 !important;
}

/* Попап со списком операций (+N) */
.models-op-popover.u-hidden {
  display: none !important;
}

.models-op-popover {
  position: fixed;
  z-index: 4000;
  max-width: min(360px, calc(100vw - 16px));
  max-height: min(320px, calc(100vh - 16px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.18);
}

.models-op-popover__inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.models-op-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 1px 8px 1px 10px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

.models-op-popover__title {
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.models-op-popover__close {
  flex-shrink: 0;
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  color: #64748b !important;
}

.models-op-popover__list {
  overflow-y: auto;
  padding: 6px 10px 8px;
  font-size: 10px;
  line-height: 1.35;
  color: #0f172a;
}

.models-op-popover__item {
  padding: 3px 0;
  border-bottom: 1px solid #f1f5f9;
}

.models-op-popover__item:last-child {
  border-bottom: none;
}

.models-op-popover__link {
  color: #2563eb;
  text-decoration: none;
}

.models-op-popover__link:hover {
  text-decoration: underline;
}

.md-op-history-link,
.od-op-title-link {
  color: #2563eb;
  text-decoration: none;
}

.md-op-history-link:hover,
.od-op-title-link:hover {
  text-decoration: underline;
}

.page-op-history .content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Чуть уже общего layout (~1.5rem), но без крайнего сжатия */
  padding-top: max(var(--layout-content-padding-y), env(safe-area-inset-top, 0px));
  padding-bottom: max(var(--layout-content-padding-y), env(safe-area-inset-bottom, 0px));
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.page-op-history .section--op-history {
  max-width: none;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 0.75rem;
}

.op-history-header {
  margin-bottom: 0;
  flex-shrink: 0;
}

.op-history-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: unset;
  padding: 0.12rem 0.5rem;
  font-size: 12px;
  line-height: 1.2;
  text-decoration: none !important;
  box-sizing: border-box;
}

.op-history-download:hover,
.op-history-download:focus {
  text-decoration: none !important;
}

/* Типографика как у виджета «Текущие дела» (.manager-widget__title / .manager-widget__table) */
.op-history-bc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.35rem;
  min-width: 0;
  font-size: 12px;
  line-height: 1.25;
  color: #64748b;
  margin: 0;
}

.op-history-bc__link {
  color: #2563eb;
  text-decoration: none;
  font-size: 12px;
}

.op-history-bc__link:hover {
  text-decoration: underline;
}

.op-history-bc__sep {
  margin: 0 0.3rem;
  color: #94a3b8;
  font-size: 12px;
}

.op-history-bc__current {
  font-size: 12px;
  font-weight: 600;
  color: #1f2430;
  line-height: 1.2;
}

/* Без карточки .block: только таблица, без внешней рамки/тени; скругление у обёртки */
.page-op-history .op-history-error:not(.u-hidden) {
  margin-bottom: 0.5rem;
}

.op-history-table-wrap {
  flex: 1 1 auto;
  min-height: calc(100vh - 220px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  /* Не overflow:hidden — иначе у border-radius съедается внешняя граница угловых ячеек */
  border-radius: 0;
  overflow: visible;
}

.op-history-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: 12px;
  box-sizing: border-box;
  /* Inset: граница угловых ячеек не попадает ровно в линию клипа border-radius */
  padding: 1px;
  background-clip: padding-box;
}

.page-op-history .op-history-table-wrap .op-history-table {
  width: 100%;
  flex: 1 1 auto;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: #fff;
}

/* 12 кол.: код пачки; цвет и размер; кол-во…ОТК */
.page-op-history .op-history-table th:nth-child(1),
.page-op-history .op-history-table td:nth-child(1) {
  width: 8%;
  min-width: 4rem;
}

.page-op-history .op-history-table th:nth-child(2),
.page-op-history .op-history-table td:nth-child(2) {
  width: 11%;
  min-width: 5.5rem;
}

.page-op-history .op-history-table th:nth-child(3),
.page-op-history .op-history-table td:nth-child(3) {
  width: 5%;
  min-width: 2.35rem;
}

.page-op-history .op-history-table th:nth-child(4),
.page-op-history .op-history-table td:nth-child(4) {
  width: 6.5%;
  min-width: 2.5rem;
  white-space: normal;
  word-break: break-word;
}

.page-op-history .op-history-table th:nth-child(5),
.page-op-history .op-history-table td:nth-child(5) {
  width: 4%;
  min-width: 2.35rem;
}

.page-op-history .op-history-table th:nth-child(6),
.page-op-history .op-history-table td:nth-child(6) {
  width: 17%;
  min-width: 9rem;
  white-space: nowrap;
}

.page-op-history .op-history-table th:nth-child(7),
.page-op-history .op-history-table td:nth-child(7),
.page-op-history .op-history-table th:nth-child(8),
.page-op-history .op-history-table td:nth-child(8),
.page-op-history .op-history-table th:nth-child(9),
.page-op-history .op-history-table td:nth-child(9),
.page-op-history .op-history-table th:nth-child(10),
.page-op-history .op-history-table td:nth-child(10) {
  width: 5.75%;
  min-width: 2.55rem;
  padding-left: 0.14rem;
  padding-right: 0.14rem;
}

.page-op-history .op-history-table th:nth-child(11),
.page-op-history .op-history-table td:nth-child(11) {
  width: 3.75%;
  min-width: 1.85rem;
  padding-left: 0.12rem;
  padding-right: 0.12rem;
  text-align: center;
}

.page-op-history .op-history-table th:nth-child(12),
.page-op-history .op-history-table td:nth-child(12) {
  width: 6%;
  min-width: 3.25rem;
  padding-left: 0.14rem;
  padding-right: 0.14rem;
  text-align: center;
}

/* Высота строк — в 1,5 раза ниже прежних ~1,45 см */
.page-op-history .op-history-table thead th {
  text-align: left;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.05;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  background: #f8fafc;
  border: none;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  padding: 0.24rem 0.38rem;
  vertical-align: middle;
}

.page-op-history .op-history-table thead th:first-child {
  border-left: 1px solid #e5e7eb;
  border-top-left-radius: 11px;
}

.page-op-history .op-history-table thead th:last-child {
  border-top-right-radius: 11px;
}

.page-op-history .op-history-table tbody tr {
  height: auto;
  min-height: calc(1.45cm / 1.5);
}

.page-op-history .op-history-table tbody td {
  height: auto;
  min-height: calc(1.45cm / 1.5);
  box-sizing: border-box;
  padding: 0.05rem 0.24rem;
  font-size: 11px;
  line-height: 1.18;
  vertical-align: middle;
  overflow: hidden;
  border: none;
  border-bottom: 1px solid #edf1f6;
  border-right: 1px solid #edf1f6;
  background: #fff;
  color: #1f2430;
}

.page-op-history .op-history-table tbody td:first-child {
  border-left: 1px solid #edf1f6;
}

.page-op-history .op-history-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 11px;
}

.page-op-history .op-history-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 11px;
}

.op-history-table th,
.op-history-table td {
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

.op-history-sec {
  color: #6b7280;
  font-size: 0.85em;
  line-height: 1.15;
}

.op-history-wait {
  color: #b45309;
  font-weight: 500;
}

.page-op-history .op-history-table tbody td.op-history-batch-cell {
  overflow: visible;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-height: none;
}

.op-history-batch-link {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.op-history-batch-link:hover {
  color: #1d4ed8;
}

.op-history-page-info {
  font-size: 12px;
  color: #6b7280;
  margin-right: 0.65rem;
  white-space: nowrap;
}

.op-history-pagination {
  margin-top: 1rem;
}

.op-history-pagination-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-start;
}

.page-models .models-op-item + .models-op-item {
  margin-top: 2px;
}

.page-models .models-planned-total {
  font-weight: 600;
  margin-bottom: 4px;
}

.page-models .models-planned-line + .models-planned-line {
  margin-top: 2px;
}

.page-models #modelDeleteModal .employees-modal__card {
  max-width: 420px;
}

.page-models #modelDeleteModal .employees-modal__text {
  display: block;
  margin-top: 0;
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #0f172a;
}

.page-model-detail .content {
  padding: 0.55rem 0.7rem 4.3rem 0.95rem;
  /* Нижний отступ как на «Добавить новую» — иначе фикс. «Сохранить» перекрывает иконки последней строки */
}

.page-model-detail .section {
  margin-bottom: 0.55rem;
}

.page-model-detail .section__title {
  margin-bottom: 0.45rem;
  font-size: 15px;
}

.page-model-detail .block {
  padding: 0.45rem 0.8rem 0.175rem;
  border-radius: 10px;
}

:is(.page-model-detail, .page-add-model) .model-detail-meta {
  padding-bottom: 0;
  height: auto;
  overflow: visible;
  /* было gap: 0.6rem от глобального .block — убрано 50% зазора (остаётся 0.3rem) */
  gap: 0.3rem;
}

/* Пустой .form-field-error: глобально min-height 1em — оставляем 50% */
:is(.page-model-detail, .page-add-model) .model-detail-meta .form-field-error:empty {
  min-height: 0.5em;
  margin-top: 0.125rem;
}

.page-model-detail .block__title {
  margin: 0 0 0.25rem;
  font-size: 13px;
}

.page-model-detail .input,
.page-model-detail .btn,
.page-model-detail .input--sm {
  min-height: 30px;
  font-size: 12px;
  padding-top: 0.16rem;
  padding-bottom: 0.16rem;
}

/* Без видимой рамки у полей ввода на странице модели (описание — отдельно, с рамкой) */
.page-model-detail textarea.input:not(.model-detail-desc),
.page-model-detail input.input,
.page-model-detail input.input--sm,
.page-model-detail select.input {
  border: none;
  background: transparent;
  box-shadow: none;
}

.page-model-detail textarea.input:not(.model-detail-desc):focus,
.page-model-detail textarea.input:not(.model-detail-desc):focus-visible,
.page-model-detail input.input:focus,
.page-model-detail input.input:focus-visible,
.page-model-detail input.input--sm:focus,
.page-model-detail input.input--sm:focus-visible,
.page-model-detail select.input:focus,
.page-model-detail select.input:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 1px;
}

:is(.page-model-detail, .page-add-model) .model-detail-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 520px);
  gap: 0.55rem;
  align-items: stretch;
  height: auto;
}

:is(.page-model-detail, .page-add-model) .model-detail-meta-grid > div {
  min-width: 0;
}

/* Фото + описание: колонка фото — по контенту; описание — тянется по высоте до низа фото */
:is(.page-model-detail, .page-add-model) .model-detail-meta-photos-desc {
  --model-photo-collage-size: clamp(76px, 44%, 158px);
  align-self: start;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 0.55rem;
  align-items: stretch;
  min-width: 0;
}

:is(.page-model-detail, .page-add-model) .model-detail-meta-photos-col,
:is(.page-model-detail, .page-add-model) .model-detail-meta-desc-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

:is(.page-model-detail, .page-add-model) .model-detail-meta-photos-col {
  align-self: start;
}

:is(.page-model-detail, .page-add-model) .model-detail-meta-desc-col {
  align-self: stretch;
}

:is(.page-model-detail, .page-add-model) .model-detail-meta-photos-col .block__title,
:is(.page-model-detail, .page-add-model) .model-detail-meta-desc-col .block__title {
  flex-shrink: 0;
}

:is(.page-model-detail, .page-add-model) .model-detail-meta-desc-col {
  margin-left: 0.35rem;
}

@media (max-width: 1360px) {
  :is(.page-model-detail, .page-add-model) .model-detail-meta-grid {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 460px);
  }
  .page-model-detail .model-detail-meta-grid {
    grid-template-columns: 1fr;
  }
  :is(.page-model-detail, .page-add-model) .model-detail-meta-photos-desc {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }
}

@media (max-width: 1120px) {
  :is(.page-model-detail, .page-add-model) .model-detail-meta-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  :is(.page-model-detail, .page-add-model) .model-detail-meta-photos-desc {
    grid-template-columns: 1fr;
  }
  :is(.page-model-detail, .page-add-model) .model-detail-meta-desc-col {
    margin-left: 0;
  }
  :is(.page-model-detail, .page-add-model) .model-detail-metrics {
    grid-template-columns: 1fr;
  }
  :is(.page-model-detail, .page-add-model) .model-detail-eq-metrics {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.28rem;
  }
  :is(.page-model-detail, .page-add-model) .model-detail-eq-metrics .model-detail-metric-col--plan,
  :is(.page-model-detail, .page-add-model) .model-detail-eq-metrics .model-detail-metric-col--fact,
  :is(.page-model-detail, .page-add-model) .model-detail-eq-metrics .model-detail-metric-col--cost {
    grid-column: auto;
  }
  :is(.page-model-detail, .page-add-model) .model-detail-summary {
    height: auto;
  }
  :is(.page-model-detail, .page-add-model) .model-detail-side-fields {
    margin-top: 0.4rem;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .page-model-detail .model-detail-side-fields {
    align-items: flex-start;
  }
  .page-model-detail .model-detail-side-times-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  :is(.page-model-detail, .page-add-model) .model-detail-meta {
    height: auto;
    overflow: visible;
  }

  .page-model-detail .model-detail-model-totals-row .model-detail-metrics--model {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.28rem;
  }

  .page-model-detail .model-detail-meta-grid > .model-detail-model-totals-row {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
    grid-column: auto;
    grid-row: auto;
    z-index: auto;
    align-self: stretch;
    pointer-events: auto;
  }

  .page-model-detail .model-detail-meta-grid > .model-detail-meta-photos-desc {
    grid-column: auto;
    grid-row: auto;
    z-index: auto;
    position: static;
  }

  .page-model-detail .model-detail-meta-grid > .model-detail-summary {
    grid-column: auto;
    grid-row: auto;
    z-index: auto;
    align-self: stretch;
    height: auto;
  }

  .page-model-detail .model-detail-model-totals-row .model-detail-metric-col--plan,
  .page-model-detail .model-detail-model-totals-row .model-detail-metric-col--fact,
  .page-model-detail .model-detail-model-totals-row .model-detail-metric-col--cost {
    grid-column: auto;
  }

  .page-model-detail .model-detail-side-fields.model-detail-side-fields--table-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .page-model-detail #modelOpsContainer .table-wrap .model-detail-eq-table {
    min-width: 720px;
  }

  .page-add-model .model-detail-metrics--model {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.28rem;
    margin-left: 0;
    justify-content: stretch;
  }

  .page-add-model .model-detail-metrics--model .model-detail-metric-col--plan .model-detail-chip,
  .page-add-model .model-detail-metrics--model .model-detail-metric-col--fact .model-detail-chip,
  .page-add-model .model-detail-metrics--model .model-detail-metric-col--cost .model-detail-chip {
    width: 100%;
    max-width: 100%;
  }

  .page-model-detail .model-detail-side-fields--table-grid .model-detail-side-fields__cell--plan,
  .page-model-detail .model-detail-side-fields--table-grid .model-detail-side-fields__cell--fact {
    grid-column: auto;
  }
}

:is(.page-model-detail, .page-add-model) .model-detail-desc {
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  resize: none;
  overflow: auto;
  font-size: 12px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
  box-shadow: none;
}

@media (min-width: 1121px) {
  :is(.page-model-detail, .page-add-model) .model-detail-meta-desc-col {
    min-height: 0;
    height: 100%;
  }

  :is(.page-model-detail, .page-add-model) .model-detail-desc {
    flex: 1 1 auto;
    min-height: 0;
    align-self: stretch;
  }
}

@media (max-width: 1120px) {
  :is(.page-model-detail, .page-add-model) .model-detail-desc {
    flex: 0 1 auto;
    min-height: 136px;
    height: 136px;
    max-height: 136px;
  }
}

:is(.page-model-detail, .page-add-model) .model-detail-desc:focus,
:is(.page-model-detail, .page-add-model) .model-detail-desc:focus-visible {
  outline: none;
  border-color: #94a3b8;
}

/* Вариант 2: крупное фото 1 + справа отдельная сетка 2×2 (без span строк — без наложений) */
:is(.page-model-detail, .page-add-model) .model-photos-list {
  margin-bottom: 0;
  width: 100%;
  max-width: 100%;
}

:is(.page-model-detail, .page-add-model) .model-photos-collage {
  /* Герой и 2×2 одного квадрата: пустой/заполненный слот и до/после загрузки img — без смены габаритов */
  --model-photo-collage-size: clamp(76px, 44%, 158px);
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

:is(.page-model-detail, .page-add-model) .model-photos-collage__hero {
  flex: 0 0 var(--model-photo-collage-size);
  width: var(--model-photo-collage-size);
  height: var(--model-photo-collage-size);
  max-width: var(--model-photo-collage-size);
  max-height: var(--model-photo-collage-size);
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  display: flex;
  box-sizing: border-box;
}

:is(.page-model-detail, .page-add-model) .model-photos-collage__hero .model-photo-slot {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  align-self: stretch;
  box-sizing: border-box;
  overflow: hidden;
}

:is(.page-model-detail, .page-add-model) .model-photos-collage__hero .model-photo-slot-num {
  font-size: 1.35rem;
}

:is(.page-model-detail, .page-add-model) .model-photos-collage__thumbs {
  flex: 0 0 var(--model-photo-collage-size);
  width: var(--model-photo-collage-size);
  height: var(--model-photo-collage-size);
  max-width: var(--model-photo-collage-size);
  max-height: var(--model-photo-collage-size);
  aspect-ratio: 1;
  min-width: 0;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  align-content: stretch;
}

:is(.page-model-detail, .page-add-model) .model-photos-collage__thumbs .model-photo-slot {
  position: relative;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 6px;
  overflow: hidden;
}

:is(.page-model-detail, .page-add-model) .model-photo-slot {
  position: relative;
  min-width: 0;
  min-height: 0;
  border-radius: 6px;
  overflow: hidden;
  box-sizing: border-box;
}

:is(.page-model-detail, .page-add-model) .model-photo-slot--filled {
  border: 1px solid var(--df-border);
  background: #000; /* поля при object-fit: contain для вертикали/горизонтали */
}

:is(.page-model-detail, .page-add-model) .model-photo-slot--empty {
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  color: #94a3b8;
  text-align: center;
  padding: 0.2rem;
}

:is(.page-model-detail, .page-add-model) .model-photo-slot--empty-active {
  cursor: pointer;
  border-color: #94a3b8;
  color: #64748b;
}

:is(.page-model-detail, .page-add-model) .model-photo-slot--empty-active:hover {
  border-color: #64748b;
  background: #f1f5f9;
  color: #475569;
}

:is(.page-model-detail, .page-add-model) .model-photo-slot--empty-active:focus {
  outline: 2px solid #94a3b8;
  outline-offset: 2px;
}

:is(.page-model-detail, .page-add-model) .model-photo-slot--empty-wait {
  cursor: not-allowed;
  opacity: 0.72;
}

:is(.page-model-detail, .page-add-model) .model-photo-slot-num {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  color: #64748b;
}

:is(.page-model-detail, .page-add-model) .model-photo-slot-hint {
  font-size: 9px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  max-width: 100%;
}

/* Картинка не участвует в расчёте размеров слота — нет сдвига при decode/load */
:is(.page-model-detail, .page-add-model) .model-photo-slot--filled .model-photo-link {
  position: absolute;
  inset: 0;
  display: block;
  background: #000;
}

:is(.page-model-detail, .page-add-model) .model-photo-slot--filled img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

:is(.page-model-detail, .page-add-model) .model-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

:is(.page-model-detail, .page-add-model) .model-photo-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
}

:is(.page-model-detail, .page-add-model) .model-photo-lightbox__dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 980px);
  max-height: 90vh;
  padding: 0.5rem;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

:is(.page-model-detail, .page-add-model) .model-photo-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  font-size: 20px;
  line-height: 1;
}

:is(.page-model-detail, .page-add-model) .model-photo-lightbox__nav--prev {
  left: 8px;
}

:is(.page-model-detail, .page-add-model) .model-photo-lightbox__nav--next {
  right: 8px;
}

:is(.page-model-detail, .page-add-model) .model-photo-lightbox__dialog img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 1rem);
  object-fit: contain;
}

:is(.page-model-detail, .page-add-model) .model-photo-lightbox__close {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.95);
}

:is(.page-model-detail, .page-add-model) .model-photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
  font-size: 17px;
  line-height: 1;
  padding: 0.14rem 0.32rem;
  min-width: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
}

:is(.page-model-detail, .page-add-model) .model-detail-chip {
  border: 1px solid var(--df-border);
  border-radius: 7px;
  padding: 0.3rem 0.42rem;
  font-weight: 600;
  font-size: 12px;
  background: #fff;
}

/* План/факт: без рамки; шрифт как у ячеек .table.table--compact td на той же странице */
.page-model-detail .model-detail-chip--metric-time {
  border: none;
  background: transparent;
  box-shadow: none;
  font-weight: 400;
  font-size: 10px;
  line-height: 1.15;
  padding: 0.08rem 0;
  color: #333;
  font-variant-numeric: normal;
}

.page-add-model .model-detail-chip--metric-time {
  border: none;
  background: transparent;
  box-shadow: none;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.15;
  padding: 0.08rem 0;
  color: #333;
  font-variant-numeric: normal;
}

.page-model-detail .model-detail-chip--metric-cost {
  border: none;
  background: transparent;
  box-shadow: none;
  font-weight: 400;
  font-size: 10px;
  line-height: 1.15;
  padding: 0.08rem 0;
  color: #333;
  font-variant-numeric: normal;
}

.page-add-model .model-detail-chip--metric-cost {
  border: none;
  background: transparent;
  box-shadow: none;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.15;
  padding: 0.08rem 0;
  color: #333;
  font-variant-numeric: normal;
}

:is(.page-model-detail, .page-add-model) .md-metric-time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.06rem;
}

:is(.page-model-detail, .page-add-model) .md-metric-time__line {
  display: block;
  white-space: nowrap;
}

:is(.page-model-detail, .page-add-model) .model-detail-summary {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: auto;
  gap: 0.45rem;
}

:is(.page-model-detail, .page-add-model) .model-detail-metrics {
  --metric-col-min: 132px;
  display: grid;
  grid-template-columns: repeat(3, minmax(var(--metric-col-min), 1fr));
  gap: 0.4rem;
  align-items: start;
}

:is(.page-model-detail, .page-add-model) .model-detail-metric-col {
  min-width: 0;
  text-align: left;
}

:is(.page-model-detail, .page-add-model) .model-detail-metric-col .block__title {
  margin-bottom: 0.16rem;
}

/* Заголовки сводок — как thead .table.table--compact th на той же странице */
.page-model-detail .model-detail-metric-title {
  font-size: 10px;
  line-height: 1.15;
  font-weight: 400;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  min-height: calc(2 * 1.15em);
  white-space: normal;
}

.page-model-detail h3.model-detail-metric-title.block__title,
.page-model-detail h4.model-detail-metric-title.block__title {
  font-weight: 400;
  color: #64748b;
}

.page-model-detail .model-detail-metrics .model-detail-chip {
  width: 100%;
  margin: 0;
  padding: 0.22rem 0.36rem;
  font-size: 10px;
  line-height: 1.15;
  font-weight: 400;
  color: #333;
  font-variant-numeric: normal;
}

.page-add-model .model-detail-metrics .model-detail-chip {
  width: 100%;
  margin: 0;
  padding: 0.22rem 0.36rem;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 400;
  color: #333;
  font-variant-numeric: normal;
}

/* Сводки план/факт/стоим.: общий .model-detail-metrics .model-detail-chip задаёт padding 0.22rem 0.36rem
   и перекрывает «голый» .model-detail-chip--metric-time — из-за этого цифры съезжают вправо от h4. */
.page-model-detail .model-detail-metrics .model-detail-chip--metric-time,
.page-model-detail .model-detail-metrics .model-detail-chip--metric-cost,
.page-add-model .model-detail-metrics .model-detail-chip--metric-time,
.page-add-model .model-detail-metrics .model-detail-chip--metric-cost {
  text-align: left;
  padding: 0.08rem 0;
}

:is(.page-model-detail, .page-add-model) .model-detail-model-flags {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

:is(.page-model-detail, .page-add-model) .model-detail-side-fields {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  gap: 0.65rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  padding-right: 0.34rem;
  padding-bottom: 0;
}

:is(.page-model-detail, .page-add-model) .model-detail-side-row {
  display: grid;
  grid-template-columns: 72px auto;
  align-items: center;
  gap: 0.35rem;
  font-size: 12px;
  justify-content: start;
  width: auto;
}

:is(.page-model-detail, .page-add-model) .model-detail-side-row--otk {
  grid-template-columns: auto auto;
  gap: 0.32rem;
}

:is(.page-model-detail, .page-add-model) .model-detail-side-row--checkbox {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  width: auto;
  margin-right: 0.45rem;
}

:is(.page-model-detail, .page-add-model) .model-detail-side-label {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

:is(.page-model-detail, .page-add-model) .model-detail-side-row input[type="number"] {
  width: 77px;
}

.page-model-detail #modelOtkTime,
.page-model-detail #modelPackagingTime {
  width: 49px !important;
  max-width: 100%;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
  box-shadow: none;
}

.page-model-detail #modelOtkTime:focus,
.page-model-detail #modelOtkTime:focus-visible,
.page-model-detail #modelPackagingTime:focus,
.page-model-detail #modelPackagingTime:focus-visible {
  outline: none;
  border-color: #94a3b8;
}

.page-model-detail .model-detail-side-fields {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.page-model-detail .model-detail-side-times-row {
  width: 100%;
  display: flex;
  align-items: center;
  column-gap: 0.6cm;
  justify-content: flex-end;
  flex-wrap: wrap;
  row-gap: 0.35rem;
}

.page-model-detail .model-detail-side-row--checkbox-inline {
  margin-right: 0;
}

.page-add-model #modelOtkTimeSeconds,
.page-add-model #modelPackagingTimeSeconds {
  width: 82px !important;
  max-width: 100%;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
  box-shadow: none;
}

.page-add-model #modelOtkTimeSeconds:focus,
.page-add-model #modelOtkTimeSeconds:focus-visible,
.page-add-model #modelPackagingTimeSeconds:focus,
.page-add-model #modelPackagingTimeSeconds:focus-visible {
  outline: none;
  border-color: #94a3b8;
}

:is(.page-model-detail, .page-add-model) .model-detail-side-row--checkbox .model-new-flag-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  justify-content: flex-start;
  white-space: nowrap;
}

.page-model-detail .model-detail-save-btn {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 70;
  min-width: 120px;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.24);
}

.page-model-detail #modelMetaResult {
  position: fixed;
  right: 16px;
  bottom: 54px;
  z-index: 71;
  margin: 0;
  min-height: 0;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.page-model-detail #modelMetaResult:empty {
  display: none;
}

.page-model-detail #modelMetaResult.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.page-model-detail #modelMetaResult.is-success {
  color: #15803d;
  background: #ecfdf5;
}

.page-model-detail #modelMetaResult.is-error {
  color: #b91c1c;
  background: #fef2f2;
}

/* Резерв по высоте: раньше его давала строка "Сохранено" в потоке */
.page-model-detail .model-detail-meta {
  padding-bottom: 0.8rem;
}

:is(.page-model-detail, .page-add-model) .model-detail-eq-block {
  margin-top: 0.8rem;
}

:is(.page-model-detail, .page-add-model) .model-detail-eq-title {
  margin: 0 0 0.3rem;
  font-size: 0.96rem;
  font-weight: 700;
  color: #1f2937;
  padding-bottom: 0;
  border-bottom: none;
}

:is(.page-model-detail, .page-add-model) .model-detail-eq-table {
  border-radius: 10px;
  overflow: hidden;
}

:is(.page-model-detail, .page-add-model) .model-detail-eq-metrics {
  margin-bottom: 0.2rem;
}

:is(.page-model-detail, .page-add-model) .model-detail-eq-metrics .block__title {
  margin-bottom: 0.08rem;
  line-height: 1.15;
}

:is(.page-model-detail, .page-add-model) .model-detail-eq-metrics .model-detail-chip {
  width: 100%;
}

/* Карточка модели: верхняя сетка — только фото+описание (без пустой правой колонки) */
.page-model-detail .model-detail-meta-grid {
  grid-template-columns: 1fr;
}

/* Сводка по модели: на всю ширину сетки + компенсация padding .block — та же ширина, что у #modelOpsContainer */
.page-model-detail .model-detail-meta-grid > .model-detail-model-totals-row {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-left: -0.8rem;
  margin-right: -0.8rem;
  width: calc(100% + 1.6rem);
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  flex-shrink: 0;
  align-self: stretch;
  box-sizing: border-box;
}

/* Восьмиколоночная сетка метрик только на широком экране — иначе ломает max-width:1120px */
@media (min-width: 1121px) {
  :is(.page-model-detail, .page-add-model) .model-detail-eq-metrics {
    display: grid;
    grid-template-columns: 16% 18% 24% 10% 10% 8% 6% 8%;
    gap: 0;
  }

  :is(.page-model-detail, .page-add-model) .model-detail-eq-metrics .model-detail-metric-col--plan {
    grid-column: 4;
    justify-self: start;
    text-align: left;
  }

  :is(.page-model-detail, .page-add-model) .model-detail-eq-metrics .model-detail-metric-col--fact {
    grid-column: 5;
    justify-self: start;
    text-align: left;
  }

  :is(.page-model-detail, .page-add-model) .model-detail-eq-metrics .model-detail-metric-col--cost {
    grid-column: 6;
    justify-self: start;
    text-align: left;
  }

  .page-model-detail .model-detail-side-fields.model-detail-side-fields--table-grid {
    margin-top: 0;
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 16% 18% 24% 10% 10% 8% 6% 8%;
    gap: 0;
    align-items: start;
    width: 100%;
    padding-right: 0;
    justify-content: stretch;
  }

  .page-model-detail .model-detail-side-fields--table-grid .model-detail-side-fields__cell--plan {
    grid-column: 4;
    justify-self: start;
    min-width: 0;
  }

  .page-model-detail .model-detail-side-fields--table-grid .model-detail-side-fields__cell--fact {
    grid-column: 5;
    justify-self: start;
    min-width: 0;
  }

  .page-model-detail .model-detail-side-fields--table-grid .model-detail-side-fields__cell {
    padding-left: 0;
    margin-left: 0;
  }

  .page-model-detail .model-detail-model-totals-row .model-detail-metrics--model {
    display: grid;
    grid-template-columns: 16% 18% 24% 10% 10% 8% 6% 8%;
    gap: 0;
    justify-content: stretch;
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    padding-top: 0.92rem;
    padding-top: 1lh;
  }

  .page-model-detail .model-detail-model-totals-row .model-detail-metric-col--plan {
    grid-column: 4;
    justify-self: start;
    text-align: left;
  }

  .page-model-detail .model-detail-model-totals-row .model-detail-metric-col--fact {
    grid-column: 5;
    justify-self: start;
    text-align: left;
  }

  .page-model-detail .model-detail-model-totals-row .model-detail-metric-col--cost {
    grid-column: 6;
    justify-self: start;
    text-align: left;
  }

  :is(.page-model-detail, .page-add-model) .model-detail-eq-metrics .model-detail-metric-col--plan .model-detail-chip,
  .page-model-detail .model-detail-model-totals-row .model-detail-metrics--model .model-detail-metric-col--plan .model-detail-chip {
    width: 119px;
    max-width: none;
  }

  :is(.page-model-detail, .page-add-model) .model-detail-eq-metrics .model-detail-metric-col--fact .model-detail-chip,
  .page-model-detail .model-detail-model-totals-row .model-detail-metrics--model .model-detail-metric-col--fact .model-detail-chip {
    width: 119px;
    max-width: none;
  }

  :is(.page-model-detail, .page-add-model) .model-detail-eq-metrics .model-detail-metric-col--cost .model-detail-chip,
  .page-model-detail .model-detail-model-totals-row .model-detail-metrics--model .model-detail-metric-col--cost .model-detail-chip {
    width: 124px;
    max-width: none;
  }

  .page-add-model .model-detail-metrics--model {
    display: grid;
    grid-template-columns: 119px 119px 124px;
    gap: 0.32rem;
    justify-content: start;
    margin-left: 57px;
  }

  .page-add-model .model-detail-metrics--model .model-detail-metric-col--plan,
  .page-add-model .model-detail-metrics--model .model-detail-metric-col--fact,
  .page-add-model .model-detail-metrics--model .model-detail-metric-col--cost {
    grid-column: auto;
  }

  .page-add-model .model-detail-metrics--model .model-detail-metric-col--plan .model-detail-chip,
  .page-add-model .model-detail-metrics--model .model-detail-metric-col--fact .model-detail-chip {
    width: 119px;
    max-width: none;
  }

  .page-add-model .model-detail-metrics--model .model-detail-metric-col--cost .model-detail-chip {
    width: 124px;
    max-width: none;
  }

  .page-add-model .model-detail-summary {
    height: 100%;
  }
}

.page-model-detail .table.table--compact th,
.page-model-detail .table.table--compact td {
  padding: 0.16rem 0.24rem;
  font-size: 10px;
  line-height: 1.15;
}

/* Верхний блок "Сумма план/факт/стоим." (только карточка модели):
   уменьшаем расстояния и делаем вертикальные строки как в нижнем eq-блоке. */
.page-model-detail .model-detail-metrics--model {
  gap: 0.22rem; /* было 0.32rem у базового правила */
}

.page-model-detail .model-detail-metrics--model .model-detail-metric-col .block__title {
  margin-bottom: 0.08rem;
  line-height: 1.15;
}

.page-model-detail .table.table--compact th {
  font-weight: 400;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.page-model-detail .table.table--compact {
  width: 100%;
  table-layout: fixed;
}

.page-model-detail #modelOpsContainer .table-wrap {
  padding-right: max(0.2rem, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

@media (max-width: 1120px) {
  .page-model-detail .table.table--compact th {
    white-space: normal;
  }
}

@media (min-width: 1121px) {
  .page-model-detail .table.table--compact th {
    white-space: nowrap;
  }
}

.page-model-detail #modelOpsContainer input.input.input--sm {
  box-sizing: border-box;
  margin: 0;
  min-height: var(--md-op-rail);
  height: var(--md-op-rail);
  font-size: 10px;
  padding: 0 0.24rem;
  line-height: 1.15;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #fafbfc;
}

.page-model-detail #modelOpsContainer textarea.input.input--sm {
  box-sizing: border-box;
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: calc(1.25em * 2 + 0.28rem);
  height: auto;
  font-size: 10px;
  line-height: 1.25;
  padding: 0.18rem 0.32rem;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #fafbfc;
  overflow-y: hidden;
  overflow-x: hidden;
  resize: none;
  max-height: min(70vh, calc(1.25em * 18 + 1rem));
  scrollbar-width: thin;
  scrollbar-color: #c5cdd8 transparent;
}

.page-model-detail #modelOpsContainer textarea.input.input--sm::-webkit-scrollbar {
  width: 5px;
}

.page-model-detail #modelOpsContainer textarea.input.input--sm::-webkit-scrollbar-track {
  background: transparent;
}

.page-model-detail #modelOpsContainer textarea.input.input--sm::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.page-model-detail #modelOpsContainer textarea.input.input--sm::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.page-model-detail #modelOpsContainer input[type="number"].md-edit {
  appearance: textfield;
  -moz-appearance: textfield;
}

.page-model-detail #modelOpsContainer input[type="number"].md-edit::-webkit-outer-spin-button,
.page-model-detail #modelOpsContainer input[type="number"].md-edit::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.page-model-detail #modelOpsContainer tr[data-editing="0"] .input.input--sm {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.page-model-detail #modelOpsContainer tr[data-editing="0"] .input.input--sm::placeholder {
  color: #6b7280;
  opacity: 1;
}

.page-model-detail #modelOpsContainer .md-op-actual {
  white-space: normal;
  vertical-align: middle;
  color: #111827;
  min-height: var(--md-op-rail);
  box-sizing: border-box;
}

.page-model-detail #modelOpsContainer .md-op-actual--clickable {
  cursor: pointer;
}

/* Высота строки операций: переменные на <tr> (em от шрифта строки = 10px у .table--compact td).
   min-height на <tr> в таблице часто не даёт эффекта — фиксируем высоту ячеек под «рельс» инпутов
   (как в режиме редактирования); у «факт» — только min-height, если две строки сек/время. */
.page-model-detail #modelOpsContainer tr[data-op-id] {
  --md-op-rail: calc(1.15em * 2 + 0.06rem);
  --md-op-row-h: calc(var(--md-op-rail) + 0.32rem);
}

.page-model-detail #modelOpsContainer tr[data-op-id] > td {
  vertical-align: middle;
  box-sizing: border-box;
}

.page-model-detail #modelOpsContainer tr[data-op-id].is-editing > td {
  vertical-align: top;
}

.page-model-detail #modelOpsContainer tr[data-op-id] > td:not(.md-op-actual):not(:nth-child(3)):not(:nth-child(7)) {
  height: var(--md-op-row-h);
}

.page-model-detail #modelOpsContainer tr[data-op-id].is-editing > td:nth-child(1),
.page-model-detail #modelOpsContainer tr[data-op-id].is-editing > td:nth-child(3) {
  height: auto;
  min-height: var(--md-op-row-h);
}

.page-model-detail #modelOpsContainer tr[data-op-id] > td:nth-child(3) {
  min-height: var(--md-op-row-h);
  height: auto;
}

.page-model-detail #modelOpsContainer tr[data-op-id] > td.md-op-actual,
.page-model-detail #modelOpsContainer tr[data-op-id] > td:nth-child(7) {
  min-height: var(--md-op-row-h);
  height: auto;
}

.page-model-detail #modelOpsContainer .md-view {
  display: inline-block;
  max-width: 100%;
  min-height: 1.15em;
  line-height: 1.15;
  vertical-align: middle;
}

/* Название операции: до двух строк; по вертикали по центру «рельсы», как план/время в соседней колонке */
.page-model-detail #modelOpsContainer .md-op-title-view {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: var(--md-op-rail);
  min-height: var(--md-op-rail);
  max-height: var(--md-op-rail);
  overflow: hidden;
  box-sizing: border-box;
}

.page-model-detail #modelOpsContainer .md-op-title-view .md-op-history-link {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.15;
  width: 100%;
  min-width: 0;
}

/* Таблица операций модели: первая колонка — тот же левый отступ, что у остальных (без +0.62rem),
   и без лишних полей у обёртки/ссылки, чтобы текст строки совпадал с заголовком «Операция». */
.page-model-detail #modelOpsContainer .model-detail-eq-table.table.table--compact th:first-child,
.page-model-detail #modelOpsContainer .model-detail-eq-table.table.table--compact td:first-child {
  padding-left: 0.24rem;
  text-align: left;
}

.page-model-detail #modelOpsContainer .model-detail-eq-table td:first-child .md-op-title-view,
.page-model-detail #modelOpsContainer .model-detail-eq-table td:first-child .md-op-history-link {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

/* Описание: полный текст; при одной строке — по вертикали как «Операция» (центр «рельсы» / строки). */
.page-model-detail #modelOpsContainer td:nth-child(3) > .md-op-desc-view {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: var(--md-op-rail);
  height: 100%;
  max-height: none;
  box-sizing: border-box;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
}

/* План. время: одна «рельса» под высоту инпута */
.page-model-detail #modelOpsContainer td:nth-child(4) > .md-view {
  height: var(--md-op-rail);
  min-height: var(--md-op-rail);
  max-height: var(--md-op-rail);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
}

.page-model-detail #modelOpsContainer .md-op-cost-view {
  height: var(--md-op-rail);
  min-height: var(--md-op-rail);
  max-height: var(--md-op-rail);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
}

.page-model-detail #modelOpsContainer .md-edit {
  display: none;
}

.page-model-detail #modelOpsContainer tr.is-editing .md-view {
  display: none;
}

.page-model-detail #modelOpsContainer tr.is-editing .md-view.md-view-keep {
  display: inline-flex;
}

/* flex — только для обёрток; на <input>/<textarea> inline-flex даёт «прыжок» высоты строки */
.page-model-detail #modelOpsContainer tr.is-editing .md-edit:not(.u-hidden):not(input):not(textarea) {
  display: inline-flex;
  width: 100%;
  align-items: center;
}

.page-model-detail #modelOpsContainer tr.is-editing input.md-edit:not(.u-hidden),
.page-model-detail #modelOpsContainer tr.is-editing textarea.md-edit:not(.u-hidden) {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.page-model-detail #modelOpsContainer tr.is-editing input.md-edit:not(.u-hidden):focus,
.page-model-detail #modelOpsContainer tr.is-editing input.md-edit:not(.u-hidden):focus-visible,
.page-model-detail #modelOpsContainer tr.is-editing textarea.md-edit:not(.u-hidden):focus,
.page-model-detail #modelOpsContainer tr.is-editing textarea.md-edit:not(.u-hidden):focus-visible {
  outline-offset: 0;
}

.page-model-detail #modelOpsContainer .md-op-video-edit {
  gap: 2px;
  flex-wrap: wrap;
}

/* 8 колонок: видео — 7-я, действия — последняя (раньше ошибочно было nth-child(9)). */
.page-model-detail #modelOpsContainer td:nth-child(7),
.page-model-detail #modelOpsContainer th:nth-child(7) {
  white-space: nowrap;
}

.page-model-detail #modelOpsContainer td:last-child,
.page-model-detail #modelOpsContainer th:last-child {
  white-space: nowrap;
  width: 1%;
  min-width: 5.75rem;
  padding-right: 0.36rem;
  box-sizing: border-box;
}

.page-model-detail #modelOpsContainer .md-op-video-view {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  white-space: nowrap;
  height: var(--md-op-rail);
  min-height: var(--md-op-rail);
  max-height: var(--md-op-rail);
  box-sizing: border-box;
  overflow: hidden;
}

.page-model-detail #modelOpsContainer .md-op-video-open {
  width: var(--md-op-rail);
  min-width: var(--md-op-rail);
  height: var(--md-op-rail);
  padding: 0;
  line-height: 0;
  color: #6b7280;
}

.page-model-detail #modelOpsContainer .md-op-video-open:hover,
.page-model-detail #modelOpsContainer .md-op-video-upload-btn:hover {
  color: #4b5563;
}

.page-model-detail #modelOpsContainer .md-op-video-upload-btn {
  color: #6b7280;
}

.md-op-video-upload-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.page-model-detail #modelOpsContainer .md-op-video-play-icon {
  width: calc(var(--md-op-rail) - 4px);
  height: calc(var(--md-op-rail) - 4px);
  max-width: 22px;
  max-height: 22px;
  display: block;
}

.page-model-detail #modelOpsContainer .md-op-video-edit {
  flex-wrap: nowrap;
  white-space: nowrap;
  width: auto;
  align-items: center;
  height: var(--md-op-rail);
  min-height: var(--md-op-rail);
  max-height: var(--md-op-rail);
  box-sizing: border-box;
}

.page-model-detail #modelOpsContainer .md-op-video-link {
  display: inline-flex;
  align-items: center;
}

.page-model-detail #modelOpsContainer .md-op-video-remove {
  margin-left: 0;
}

/* Внутри карточки модели у .u-hidden должен иметь абсолютный приоритет. */
.page-model-detail #modelOpsContainer .md-op-video-upload-btn.u-hidden,
.page-model-detail #modelOpsContainer .md-op-video-link.u-hidden,
.page-model-detail #modelOpsContainer .md-op-video-remove.u-hidden {
  display: none !important;
}

.page-model-detail #modelOpsContainer td:last-child .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.page-model-detail #modelOpsContainer td:last-child .btn.btn--sm.btn-icon-plain {
  padding: 0;
  width: var(--md-op-rail);
  height: var(--md-op-rail);
  min-width: var(--md-op-rail);
  min-height: var(--md-op-rail);
  max-height: var(--md-op-rail);
  box-sizing: border-box;
  line-height: 0;
}

.page-model-detail #modelOpsContainer td:last-child .btn.btn--sm.btn-icon-plain .icon-feather-action {
  display: block;
  flex-shrink: 0;
}

.page-model-detail #modelOpsContainer td:last-child .btn + .btn {
  margin-left: 0.16rem;
}

.page-model-detail #modelOpsContainer .md-op-video-upload-btn {
  width: var(--md-op-rail);
  min-width: var(--md-op-rail);
  height: var(--md-op-rail);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  vertical-align: middle;
  color: #6b7280;
}

.page-model-detail #modelOpsContainer .md-op-video-upload-btn__icon,
.page-model-detail #modelOpsContainer .md-op-video-upload-btn__spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-model-detail #modelOpsContainer .md-op-video-upload-btn__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: mdSpin 0.8s linear infinite;
  display: none;
}

.page-model-detail #modelOpsContainer .md-op-video-upload-btn.is-uploading .md-op-video-upload-btn__icon {
  display: none;
}

.page-model-detail #modelOpsContainer .md-op-video-upload-btn.is-uploading .md-op-video-upload-btn__spinner {
  display: inline-flex;
}

.page-model-detail #modelOpsContainer .md-op-video-upload-btn:hover {
  color: #4b5563;
}

.page-model-detail #modelOpsContainer tr.is-editing .md-op-video-link .md-op-video-open {
  color: #6b7280;
}

.page-model-detail #modelOpsContainer tr.is-editing .md-op-video-link .md-op-video-open:hover {
  color: #4b5563;
}

.page-model-detail #modelOpsContainer .md-op-video-upload-btn:has(.md-op-video-file:disabled) {
  color: #cbd5e1;
  cursor: not-allowed;
}

.page-model-detail #modelOpsContainer .md-op-video-upload-btn:has(.md-op-video-file:disabled):hover {
  color: #cbd5e1;
}

.page-model-detail #modelOpsContainer .md-op-video-status {
  display: none;
}

.page-model-detail #modelOpsContainer .md-op-video-status:not(:empty) {
  display: inline-flex !important;
}

.page-model-detail #modelOpsContainer .md-op-video-status[data-state="error"] {
  color: #b91c1c;
}

.page-model-detail #modelOpsContainer .md-op-video-status[data-state="success"] {
  color: #15803d;
}

.md-video-modal {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.md-video-modal.u-hidden {
  display: none !important;
}

.md-video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
}

.md-video-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 96vw);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 26px 60px rgba(2, 8, 23, 0.35);
}

.md-video-modal__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.md-video-modal__head h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  flex: 1 1 auto;
  min-width: 0;
}

.md-video-modal__controls {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}

.md-video-modal__field {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 11px;
  color: #475569;
}

.md-video-modal__field select {
  height: 24px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
  padding: 0 0.32rem;
}

.md-video-modal__close {
  min-height: auto;
  height: 22px;
  width: 22px;
  padding: 0;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .md-video-modal {
    padding: 0.5rem;
    align-items: flex-end;
  }

  .md-video-modal__dialog {
    width: 100%;
    max-height: min(92dvh, 100%);
    display: flex;
    flex-direction: column;
  }

  .md-video-modal__head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.55rem 0.6rem;
  }

  .md-video-modal__head h3 {
    flex: 1 1 calc(100% - 48px);
    min-width: 0;
    padding-right: 0.25rem;
  }

  .md-video-modal__close {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 1.1rem;
    border-radius: 8px;
  }

  .md-video-modal__controls {
    flex: 1 1 100%;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .md-video-modal__field {
    flex: 1 1 auto;
    min-width: min(160px, 46%);
  }

  .md-video-modal__field select {
    max-width: 100%;
    min-height: 36px;
    font-size: 13px;
  }

  .md-video-modal__body {
    padding: 0.45rem;
    flex: 1 1 auto;
    min-height: 0;
  }

  .md-video-modal__body video {
    max-height: min(58dvh, 520px);
  }
}

.md-video-modal__body {
  padding: 0.6rem;
  background: #0f172a;
  position: relative;
}

.md-video-modal__body video {
  display: block;
  width: 100%;
  max-height: min(74vh, 700px);
  background: #000;
  border-radius: 8px;
}

.md-video-modal__error {
  margin: 0.45rem 0 0;
  padding: 0 0.6rem 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #fecaca;
  background: #0f172a;
}

.page-model-detail #modelOpsContainer .md-op-compat-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  height: var(--md-op-rail);
  min-height: var(--md-op-rail);
  max-height: var(--md-op-rail);
  box-sizing: border-box;
  overflow: hidden;
}

.page-model-detail #modelOpsContainer .md-op-compat-open {
  margin-left: 0;
  min-height: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0 0.2rem;
  font-size: 10px;
  vertical-align: middle;
  flex: 0 0 auto;
}

/* Фикс: не менять высоту строки при выборе совместимых операций — резервируем место под 2 строки */
.page-model-detail #modelOpsContainer .md-op-compat-text {
  display: inline-block;
  margin-left: 0;
  color: #475569;
  max-width: 120px;
  min-height: var(--md-op-rail);
  line-height: 1.15;
  max-height: var(--md-op-rail);
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}


.page-model-detail #modelOpsContainer .md-op-compat-picker {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 25;
  margin-top: 0;
  padding: 0.35rem 0.35rem 0.3rem;
  border: 1px solid var(--df-border);
  border-radius: 8px;
  background: #fff;
  width: 220px;
  min-width: 170px;
  max-width: 280px;
  box-sizing: border-box;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  overflow-x: hidden;
}

.page-model-detail #modelOpsContainer .md-op-compat-picker.md-op-compat-picker--floating {
  position: fixed;
  right: auto;
  top: 0;
  left: 0;
}

.page-model-detail #modelOpsContainer .md-op-compat-list {
  display: grid;
  gap: 0.2rem;
  max-height: 132px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 22px;
  padding-right: 26px;
}

.page-model-detail #modelOpsContainer .md-compat-opt {
  font-size: 10px;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  cursor: pointer;
  min-width: 0;
}
.page-model-detail #modelOpsContainer .md-compat-opt input {
  flex-shrink: 0;
  margin-top: 0.15em;
}
.page-model-detail #modelOpsContainer .md-compat-opt__text {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.page-model-detail #modelOpsContainer .md-op-compat-close {
  position: absolute;
  right: 4px;
  top: 2px;
  min-height: 18px;
  height: 18px;
  width: 18px;
  padding: 0;
  line-height: 1;
  font-size: 11px;
}

.page-model-detail #modelOpsContainer td:nth-child(2) {
  position: relative;
  white-space: nowrap;
  overflow: visible;
}

:is(.page-model-detail, .page-add-model) .model-detail-static-row {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: wrap;
}

:is(.page-model-detail, .page-add-model) .model-detail-static-row label {
  font-size: 11px;
}

/* Размеры/роста/полноты: мягкий адаптив 3 -> 2 -> 1 */
.page-characteristics-sizes .characteristics-subrow {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 0.55rem;
  align-items: start;
}

.page-characteristics-sizes .characteristics-subrow > .block {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.55rem 0.65rem;
  gap: 0.18rem;
}

.page-characteristics-sizes .catalog-head-row {
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.page-characteristics-sizes .catalog-head-row .block__title {
  font-size: 15px;
}

.page-characteristics-sizes .block__sub {
  margin: 0;
  font-size: 11px;
}

.page-characteristics-sizes .add-row {
  gap: 0.35rem;
  width: 100%;
}

.page-characteristics-sizes .add-row .input {
  flex: 1 1 auto;
  width: auto;
  max-width: none;
  min-height: 28px;
  height: 28px;
  font-size: 12px;
}

.page-characteristics-sizes .add-row .btn {
  min-height: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 12px;
  padding: 0;
}

.page-characteristics-sizes .catalog-head-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  height: 26px;
  padding: 0 0.45rem;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
}

.page-characteristics-sizes .catalog-head-actions {
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-characteristics-sizes .catalog-head-actions .csv-file-btn {
  margin: 0;
}

.page-characteristics-sizes #fileSizesName,
.page-characteristics-sizes #fileSizeHeightsName,
.page-characteristics-sizes #fileSizeFullnessesName,
.page-characteristics-sizes #sizesImportResult,
.page-characteristics-sizes #sizeHeightsImportResult,
.page-characteristics-sizes #sizeFullnessesImportResult {
  font-size: 11px;
}

.page-characteristics-sizes #fileSizesName:empty,
.page-characteristics-sizes #fileSizeHeightsName:empty,
.page-characteristics-sizes #fileSizeFullnessesName:empty,
.page-characteristics-sizes #sizesImportResult:empty,
.page-characteristics-sizes #sizeHeightsImportResult:empty,
.page-characteristics-sizes #sizeFullnessesImportResult:empty {
  display: none;
}

@media (max-width: 920px) {
  .page-characteristics-sizes .characteristics-subrow {
    grid-template-columns: 1fr;
  }
  .page-characteristics-sizes .characteristics-subrow > .block {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

@media (max-width: 1460px) {
  .page-characteristics-sizes .characteristics-subrow {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

@media (max-width: 1180px) {
  .page-characteristics-sizes .catalog-head-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-characteristics-sizes .catalog-head-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
}

/* Аналитика сотрудников */
.page-analytics .content {
  padding: 0.6rem 0.75rem;
}

.page-analytics .section {
  margin-bottom: 0.4rem;
}

.page-analytics .section:first-child {
  margin-bottom: 0.2rem;
}

.page-analytics .section__title {
  margin-bottom: 0.45rem;
  font-size: 15px;
}

.page-analytics .block:not(.analytics-employees-block) {
  padding: 0.28rem 0.4rem;
  gap: 0.18rem;
}

.analytics-period-block {
  padding: 0.24rem 0.36rem;
}

.analytics-period-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 12px;
}

.analytics-period-row .input {
  min-width: 160px;
}

.page-analytics .input,
.page-analytics .btn,
.page-analytics select.input {
  min-height: 30px;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  font-size: 12px;
}

.analytics-chart-wrap {
  width: 100%;
  overflow-x: auto;
}

.analytics-chart {
  width: 100%;
  min-width: 900px;
  height: 230px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.analytics-legend {
  margin-top: 0.14rem;
  display: flex;
  gap: 0.28rem;
  flex-wrap: wrap;
}

.analytics-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.16rem 0.45rem;
  font-size: 11px;
  color: #334155;
}

.analytics-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.analytics-filters-row {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr;
  gap: 0.65rem;
  align-items: start;
}

.analytics-employees-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.analytics-employees-list {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  max-height: 118px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  align-content: start;
  row-gap: 0.22rem;
  column-gap: 0.5rem;
}

.analytics-emp-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 12px;
  height: 100%;
  min-width: 0;
  white-space: nowrap;
}

.analytics-emp-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.analytics-empty {
  color: #94a3b8;
  font-size: 11px;
}

.analytics-metrics-filter {
  display: grid;
  gap: 0.34rem;
  align-content: start;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: #f8fafc;
}

.analytics-metrics-filter label {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 12px;
  cursor: pointer;
}

.analytics-metrics-filter input[type="radio"] {
  accent-color: #2563eb;
}

.page-analytics .table-wrap {
  margin-top: 0;
}

@media (max-width: 1400px) {
  .analytics-employees-list {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
}

@media (max-width: 1100px) {
  .analytics-filters-row {
    grid-template-columns: 1fr;
  }
  .analytics-employees-list {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    max-height: 140px;
  }
}

@media (max-width: 760px) {
  .analytics-employees-list {
    grid-template-columns: 1fr;
  }
}

.page-analytics .table th,
.page-analytics .table td {
  padding: 0.32rem 0.44rem;
  font-size: 12px;
}

.page-analytics #analyticsSummaryTable th:nth-child(2),
.page-analytics #analyticsSummaryTable td:nth-child(2) {
  text-align: center;
  width: 56px;
}

.ea-link-name {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}

.ea-link-name:hover {
  text-decoration: underline;
}

.page-employee-analytics .ea-breadcrumb {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.page-employee-analytics .ea-breadcrumb__link {
  color: #2563eb;
  text-decoration: none;
}

.page-employee-analytics .ea-breadcrumb__link:hover {
  text-decoration: underline;
}

.page-employee-analytics .ea-breadcrumb__sep {
  margin: 0 0.28rem;
  color: #94a3b8;
}

.page-employee-analytics .ea-breadcrumb__current {
  color: #0f172a;
  font-weight: 600;
}

.page-employee-analytics .ea-granularity {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.page-employee-analytics .ea-tab {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  padding: 0.38rem 0.65rem;
  font-size: 12px;
  cursor: pointer;
  color: #334155;
}

.page-employee-analytics .ea-tab:hover {
  border-color: #cbd5e1;
}

.page-employee-analytics .ea-tab.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb inset;
  color: #1e3a8a;
  font-weight: 600;
}

.page-employee-analytics .ea-page-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
  box-sizing: border-box;
}

.page-employee-analytics .ea-chart-wrap {
  width: 100%;
}

.page-employee-analytics .ea-chart {
  min-height: 280px;
  height: min(36vh, 320px);
}

.page-employee-analytics .ea-chart-legend {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
  font-size: 11px;
  color: #475569;
}

.page-employee-analytics .ea-chart-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.page-employee-analytics .ea-chart-legend__item i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.page-employee-analytics .ea-section {
  margin-bottom: 0.65rem;
}

.page-employee-analytics .ea-section-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 0.4rem 0;
  color: #0f172a;
}

.page-employee-analytics .ea-sec-meta {
  font-weight: 400;
  color: #64748b;
  font-size: 13px;
}

.page-employee-analytics .ea-agg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 12px;
  color: #334155;
}

.page-employee-analytics .ea-section-empty {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.page-employee-analytics .ea-sections-empty {
  font-size: 13px;
  color: #64748b;
}

.page-employee-analytics .ea-tree-meta-line {
  font-size: 11px;
  color: #64748b;
  margin: 0 0 0.35rem 0;
  line-height: 1.35;
}

.page-employee-analytics .ea-section--drill .ea-tree-node.ea-tree-root {
  margin-top: 0;
}

.page-employee-analytics .ea-tree-root--dayflat {
  display: block;
}

.page-employee-analytics .ea-tree-day-head {
  padding: 0.12rem 0.08rem 0.28rem 0;
  margin: 0;
  border-bottom: 1px solid #e2e8f0;
}

.page-employee-analytics .ea-section--dayflat .ea-tree-root-expanded {
  padding-top: 0.28rem;
}

.page-employee-analytics .ea-tree-earn-line {
  display: block;
  margin: 0 0 0.28rem 0;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.page-employee-analytics .ea-tree-root-expanded {
  padding-top: 0.05rem;
}

.page-employee-analytics .ea-tree-node {
  margin-top: 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.2rem 0.45rem 0.45rem;
  background: #fafbff;
}

/* Свернутые узлы: ~−30% по вертикали и отступам карточки */
.page-employee-analytics #eaSectionsHost details.ea-tree-node:not([open]) {
  padding: calc(0.2rem * 0.7) calc(0.45rem * 0.7) calc(0.45rem * 0.7);
}

.page-employee-analytics #eaSectionsHost details.ea-tree-node.ea-tree-node--nested:not([open]) {
  margin-top: calc(0.45rem * 0.7);
}

.page-employee-analytics #eaSectionsHost details.ea-tree-root:not([open]) > .ea-tree-summary--root {
  padding: calc(0.12rem * 0.7) calc(0.08rem * 0.7) calc(0.2rem * 0.7) 0;
}

.page-employee-analytics #eaSectionsHost details.ea-tree-node--nested:not([open]) > .ea-tree-summary--nested {
  padding: calc(0.1rem * 0.7) 0;
}

.page-employee-analytics .ea-tree-node--nested {
  margin-top: 0.45rem;
  background: #fff;
}

.page-employee-analytics .ea-tree-summary {
  cursor: pointer;
  font-size: 12px;
  color: #1e40af;
  list-style: none;
}

.page-employee-analytics .ea-tree-summary::-webkit-details-marker,
.page-employee-analytics .ea-tree-summary::marker {
  display: none;
}

.page-employee-analytics .ea-tree-summary--root {
  display: block;
  list-style: none;
  font-weight: 400;
  color: #334155;
  padding: 0.12rem 0.08rem 0.2rem 0;
}

.page-employee-analytics .ea-tree-summary--root::-webkit-details-marker,
.page-employee-analytics .ea-tree-summary--root::marker {
  display: none;
}

.page-employee-analytics .ea-tree-summary--nested {
  display: block;
  font-weight: 400;
  color: #334155;
  padding: 0.1rem 0 0.12rem 0;
}

.page-employee-analytics .ea-tree-summary__head {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  margin-bottom: 0;
}

.page-employee-analytics details[open] > .ea-tree-summary--root .ea-tree-summary__head {
  margin-bottom: 0.32rem;
}

.page-employee-analytics .ea-tree-summary__head--nested {
  align-items: center;
  gap: 0.22rem;
}

.page-employee-analytics details[open] > .ea-tree-summary--nested .ea-tree-summary__head--nested {
  margin-bottom: 0.2rem;
}

.page-employee-analytics .ea-tree-summary__nest-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.28rem 0.45rem;
  min-width: 0;
  flex: 1;
}

.page-employee-analytics details[open] > .ea-tree-summary--root {
  padding-top: 0.14rem;
}

.page-employee-analytics .ea-tree-disclosure-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.page-employee-analytics .ea-tree-summary__head .ea-tree-disclosure-wrap {
  font-size: 14px;
  min-height: 1.25em;
}

.page-employee-analytics .ea-tree-summary__head--nested .ea-tree-disclosure-wrap {
  font-size: 12px;
  min-height: 1.35em;
}

.page-employee-analytics .ea-tree-disclosure {
  display: block;
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-top: 0.3rem solid transparent;
  border-bottom: 0.3rem solid transparent;
  border-left: 0.4rem solid #2563eb;
  transform-origin: 50% 50%;
  transition: transform 0.12s ease;
}

.page-employee-analytics #eaSectionsHost details.ea-tree-node:not([open]) .ea-tree-disclosure {
  transform: scale(0.82);
  transform-origin: 50% 50%;
}

.page-employee-analytics details[open] > .ea-tree-summary--root .ea-tree-disclosure,
.page-employee-analytics details[open] > .ea-tree-summary--nested .ea-tree-disclosure {
  transform: rotate(90deg);
}

@media (prefers-reduced-motion: reduce) {
  .page-employee-analytics .ea-tree-disclosure {
    transition: none;
  }
}

.page-employee-analytics .ea-tree-summary__date {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
}

.page-employee-analytics .ea-tree-summary__main {
  color: #0f172a;
}

.page-employee-analytics .ea-tree-body {
  margin-top: 0.45rem;
  padding-left: 0.15rem;
}

.page-employee-analytics .ea-tree-loading {
  font-size: 12px;
  color: #64748b;
  margin: 0.25rem 0;
}

.page-employee-analytics .ea-tree-error {
  color: #b91c1c;
}

.page-employee-analytics .ea-hour-block {
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #e2e8f0;
}

.page-employee-analytics .ea-hour-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.page-employee-analytics .ea-line-kind--time {
  color: #475569;
  font-weight: 600;
}

.page-employee-analytics .ea-tree-leaf {
  font-size: 12px;
  padding: 0.25rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.page-employee-analytics .ea-section .table-wrap {
  width: 100%;
}

/* Широкие таблицы: скролл у main.content; ea-page-wrap задаёт общую ширину = самому широкому блоку */
.page-employee-analytics .content {
  overflow-x: auto;
}

.page-employee-analytics .ea-detail-table-scroll {
  display: block;
  width: 100%;
  max-width: none;
  overflow-x: visible;
}

.page-employee-analytics .ea-detail-table {
  font-size: 10px;
  table-layout: fixed;
}

.page-employee-analytics .ea-detail-table--wide {
  width: auto;
  min-width: 1180px;
}

.page-employee-analytics .ea-detail-table th,
.page-employee-analytics .ea-detail-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
  padding: 0.14rem 0.2rem;
}

.page-employee-analytics .ea-detail-table td .ea-cell-clip {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.2;
  max-height: calc(1.2em * 2);
}

.page-employee-analytics .ea-detail-table td .ea-cell-clip--no-ellipsis {
  text-overflow: clip;
}

.page-employee-analytics .ea-detail-table th {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #64748b;
}

.page-employee-analytics .ea-detail-table th .ea-th-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.18;
  max-height: calc(1.18em * 2);
}

.page-employee-analytics .ea-detail-table--wide th:nth-child(1),
.page-employee-analytics .ea-detail-table--wide td:nth-child(1) {
  width: 7.5%;
  min-width: 72px;
}

.page-employee-analytics .ea-detail-table--wide th:nth-child(2),
.page-employee-analytics .ea-detail-table--wide td:nth-child(2) {
  width: 10%;
  min-width: 120px;
}

.page-employee-analytics .ea-detail-table--wide th:nth-child(3),
.page-employee-analytics .ea-detail-table--wide td:nth-child(3) {
  width: 9%;
  min-width: 88px;
}

.page-employee-analytics .ea-detail-table--wide th:nth-child(4),
.page-employee-analytics .ea-detail-table--wide td:nth-child(4) {
  width: 3.2%;
  min-width: 34px;
}

.page-employee-analytics .ea-detail-table--wide th:nth-child(5),
.page-employee-analytics .ea-detail-table--wide td:nth-child(5) {
  width: 4.5%;
  min-width: 44px;
}

.page-employee-analytics .ea-detail-table--wide th:nth-child(6),
.page-employee-analytics .ea-detail-table--wide td:nth-child(6) {
  width: 11%;
  min-width: 132px;
}

.page-employee-analytics .ea-detail-table--wide th:nth-child(7),
.page-employee-analytics .ea-detail-table--wide td:nth-child(7),
.page-employee-analytics .ea-detail-table--wide th:nth-child(8),
.page-employee-analytics .ea-detail-table--wide td:nth-child(8),
.page-employee-analytics .ea-detail-table--wide th:nth-child(9),
.page-employee-analytics .ea-detail-table--wide td:nth-child(9),
.page-employee-analytics .ea-detail-table--wide th:nth-child(10),
.page-employee-analytics .ea-detail-table--wide td:nth-child(10) {
  width: 5.8%;
  min-width: 66px;
  padding-left: 0.24rem;
  padding-right: 0.24rem;
}

.page-employee-analytics .ea-detail-table--wide th:nth-child(11),
.page-employee-analytics .ea-detail-table--wide td:nth-child(11),
.page-employee-analytics .ea-detail-table--wide th:nth-child(12),
.page-employee-analytics .ea-detail-table--wide td:nth-child(12),
.page-employee-analytics .ea-detail-table--wide th:nth-child(13),
.page-employee-analytics .ea-detail-table--wide td:nth-child(13),
.page-employee-analytics .ea-detail-table--wide th:nth-child(14),
.page-employee-analytics .ea-detail-table--wide td:nth-child(14) {
  width: 4.8%;
  min-width: 48px;
}

.page-employee-analytics .ea-detail-table--wide th:nth-child(15),
.page-employee-analytics .ea-detail-table--wide td:nth-child(15) {
  width: 5.5%;
  min-width: 56px;
}

.page-employee-analytics .ea-detail-table--wide th:nth-child(16),
.page-employee-analytics .ea-detail-table--wide td:nth-child(16) {
  width: 3.5%;
  min-width: 36px;
}

.page-employee-analytics .ea-td-chk {
  text-align: left;
  vertical-align: middle;
}

.page-employee-analytics .ea-ro-chk {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 2px;
  background: #f1f5f9;
  box-sizing: border-box;
  vertical-align: middle;
  position: relative;
  cursor: default;
  user-select: none;
  pointer-events: none;
}

.page-employee-analytics .ea-ro-chk[data-on="1"] {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.page-employee-analytics .ea-ro-chk[data-on="1"]::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.5px;
  width: 4px;
  height: 7px;
  border: solid #475569;
  border-width: 0 2px 2px 0;
  transform: rotate(38deg);
}

.page-employee-analytics .ea-hms-sub {
  display: block;
  color: #64748b;
  font-size: 9px;
  line-height: 1.2;
  margin-top: 0.06rem;
}

.page-employee-analytics .ea-twostep {
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
  line-height: 1.25;
  font-size: inherit;
  color: inherit;
}

.page-employee-analytics .ea-twostep > span,
.page-employee-analytics .ea-twostep__sub {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  line-height: inherit;
}

.page-employee-analytics .ea-fact-pending {
  color: #94a3b8;
  font-size: 10px;
  font-style: italic;
}

.btn--ghost {
  background: transparent;
  border: 1px dashed #cbd5e1;
  color: #64748b;
}

.btn--ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Финансы */
.page-finance .content {
  padding: 0.7rem 0.8rem;
}

.page-finance .section {
  margin-bottom: 0.45rem;
}

.page-finance .section__title {
  margin-bottom: 0;
  font-size: 15px;
}

.page-finance .finance-head-row {
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}

.page-finance #btnFinanceExport {
  min-height: 30px;
  padding: 0.24rem 0.58rem;
  font-size: 12px;
}

.page-finance .table-wrap {
  margin-top: 0;
}

.page-finance #tableFinance th,
.page-finance #tableFinance td {
  padding: 0.34rem 0.46rem;
  line-height: 1.15;
  font-size: 12px;
}

.page-finance .cost-hint,
.page-finance .pay-period-hint {
  font-size: 0.8em;
}

.page-finance #tableFinance td.finance-otk-diff--plus {
  color: #0f7a3d !important;
  font-weight: 600;
}

.page-finance #tableFinance td.finance-otk-diff--minus {
  color: #b42318 !important;
  font-weight: 600;
}

.page-finance #tableFinance td.finance-otk-diff--zero {
  color: #475467 !important;
}

/* Ставки разрядов */
.page-grades .content {
  padding: 0.7rem 0.8rem;
}

.page-grades .section {
  margin-bottom: 0.45rem;
}

.page-grades .section__title {
  margin-bottom: 0.45rem;
  font-size: 14px;
  font-weight: 500;
}

.page-grades .block__title {
  margin-bottom: 0.35rem;
  font-size: 13px;
  font-weight: 500;
}

.page-grades .grades-panel {
  max-width: 700px;
  gap: 0.26rem;
  padding: 0.42rem 0.5rem;
}

.page-grades .grades-add-row,
.page-grades .grades-row,
.page-grades .grades-list .grade-card .blocks-row {
  gap: 0.3rem;
}

.page-grades .input,
.page-grades select.input {
  min-height: 30px;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  font-size: 12px;
}

.page-grades .btn {
  min-height: 30px;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  font-size: 11px;
  font-weight: 500;
}

.page-grades .grades-list .grade-card {
  margin-bottom: 0.16rem;
}

.page-grades .grades-list .btn-update-grade {
  min-width: 76px;
  min-height: 28px;
  padding: 0.16rem 0.42rem;
  font-size: 11px;
  font-weight: 500;
}

.page-grades .btn-grade-delete {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  font-size: 12px;
}

.page-grades #tableHistory th,
.page-grades #tableHistory td {
  padding: 0.34rem 0.46rem;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 400;
}

.page-grades #tableHistory th {
  font-weight: 500;
}

/* Добавить новую модель */
.page-add-model .content {
  padding: 0.5rem 0.7rem;
  padding-bottom: 4.3rem;
}

.page-add-model .section {
  margin-bottom: 0.15rem;
}

.page-add-model .section__title {
  margin-bottom: 0.28rem;
  font-size: 15px;
}

.page-add-model .block {
  padding: 0.28rem 0.38rem;
}

.page-add-model .block--compact {
  padding-top: 0.24rem;
  padding-bottom: 0.24rem;
}

.page-add-model .add-model-top-block {
  padding-top: 0.22rem;
  padding-bottom: 0.28rem;
  gap: 0.08rem;
}

.page-add-model .add-model-top-block > .block__title {
  margin: 0 0 0.02rem !important;
}

.page-add-model .blocks-row {
  gap: 0.24rem;
}

.page-add-model .blocks-row--compact .block {
  min-height: auto;
}

.page-add-model .block__title {
  margin-bottom: 0.18rem;
  font-size: 13px;
}

.page-add-model .u-mt-075 {
  margin-top: 0.55rem;
}

.page-add-model .u-mb-075 {
  margin-bottom: 0.55rem;
}

.page-add-model .add-model-import-floating {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 65;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.2rem 0.3rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--df-border);
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
}

.page-add-model .add-model-import-floating .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  height: 30px;
  font-size: 12px;
  line-height: 1.1;
}

.page-add-model .add-model-import-floating #fileName {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-add-model .add-model-import-floating #importResult {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 220px;
  max-width: 320px;
  padding: 0.3rem 0.45rem;
  background: #fff;
  border: 1px solid var(--df-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
  font-size: 12px;
  display: none;
}

.page-add-model .add-model-import-floating #importResult:not(:empty) {
  display: block;
}

.page-add-model .u-text-12 {
  font-size: 12px;
}

.page-add-model .u-color-muted {
  color: #64748b;
}

.page-add-model .form-field-error {
  margin-top: 0.14rem;
  font-size: 12px;
  color: #dc2626;
}

.page-add-model .add-model-top-block .form-field-error {
  display: none;
  margin-top: 0;
  min-height: 0;
}

.page-add-model .add-model-top-block .form-field-error:not(:empty) {
  display: block;
  margin-top: 0.04rem;
}

.page-add-model .add-model-top-block .form-field-error:empty {
  display: none;
}

.page-add-model .input,
.page-add-model .btn,
.page-add-model select.input {
  min-height: 28px;
  padding-top: 0.16rem;
  padding-bottom: 0.16rem;
  font-size: 12px;
}

.page-add-model .dropdown-search__list {
  max-height: 160px;
}

.page-add-model #dsModelInput,
.page-add-model #dsEquipInput,
.page-add-model #dsOpInput {
  padding-right: 1.45rem;
}

.page-add-model .dropdown-search__clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: #e2e8f0;
  color: #334155;
  font-size: 9px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-add-model .dropdown-search__clear:hover {
  background: #e2e8f0;
}

.page-add-model .dropdown-search__clear.u-hidden {
  display: none;
}

.page-add-model .dropdown-search__picked {
  display: none;
}

.page-add-model .add-model-video-btn,
.page-add-model .add-model-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  min-width: 102px;
  justify-content: center;
  white-space: nowrap;
  min-height: 26px !important;
  height: 26px !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  padding: 0 0.42rem !important;
  vertical-align: middle;
}

.page-add-model .add-model-video-btn__icon {
  display: inline-flex;
}

.page-add-model .add-model-video-btn .md-op-video-upload-icon {
  width: 15px;
  height: 15px;
}

.page-add-model .add-model-video-btn__spinner {
  display: none;
}

.page-add-model .add-model-video-btn.is-uploading .add-model-video-btn__icon {
  display: none;
}

.page-add-model .add-model-video-btn.is-uploading .add-model-video-btn__spinner {
  display: inline-flex;
}

@keyframes mdSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.page-add-model .add-model-add-btn {
  min-width: 88px;
}

.page-add-model .add-model-add-btn--right {
  margin-left: auto;
}

.page-add-model #opVideoStatus {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Только «Добавить модель»: карточка «Все данные по модели» — единый зазор 3 мм снизу до контента */
.page-add-model .block.model-detail-meta.add-model-draft-card {
  padding-bottom: 3mm !important;
  box-sizing: border-box;
}

/* Черновик: flex + stretch — обе колонки одной высоты (сетка давала разную высоту из‑за align-self:start у колонки фото) */
.page-add-model .add-model-draft-card .model-detail-meta-photos-desc {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  align-self: stretch;
  gap: 0.55rem;
  min-width: 0;
  min-height: 0;
}

.page-add-model .add-model-draft-card .model-detail-meta-photos-col {
  flex: 0 1 320px;
  min-width: 260px;
  max-width: 320px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* заголовок → ошибка (над коллажом) → список фото на всю оставшуюся высоту — иначе полоса под коллажом ломает линию с textarea */
  grid-template-rows: auto auto minmax(0, 1fr);
  align-self: stretch;
  min-height: 0;
}

.page-add-model .add-model-draft-card #modelPhotoError:empty {
  display: none;
}

.page-add-model .add-model-draft-card #modelPhotoError:not(:empty) {
  margin-top: 0.12rem;
  margin-bottom: 0.2rem;
}

.page-add-model .add-model-draft-card .model-detail-meta-desc-col {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 0;
  margin-left: 0;
  align-self: stretch;
}

.page-add-model .add-model-draft-card .model-detail-meta-photos-col .model-photos-list {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  align-self: stretch;
}

@media (max-width: 1360px) {
  .page-add-model .add-model-draft-card .model-detail-meta-photos-col {
    flex-basis: 280px;
    min-width: 220px;
    max-width: 280px;
  }
}

@media (max-width: 1120px) {
  .page-add-model .add-model-draft-card .model-detail-meta-photos-desc {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .page-add-model .add-model-draft-card .model-detail-meta-photos-col {
    flex: 0 1 auto;
    max-width: none;
    width: 100%;
  }

  .page-add-model .add-model-draft-card .model-detail-meta-desc-col {
    flex: 0 1 auto;
    width: 100%;
  }
}

.page-add-model .block {
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

.page-add-model .block > .add-row.u-mt-05 {
  margin-top: 0.15rem;
}

.page-add-model .model-detail-meta .block__title {
  margin: 0 0 0.25rem;
  font-size: 13px;
}

/* Заголовки сводок — как .table--compact th (12px, как ячейки таблицы черновика) */
.page-add-model .model-detail-meta h3.model-detail-metric-title.block__title,
.page-add-model .model-detail-meta h4.model-detail-metric-title.block__title {
  font-size: 12px;
  line-height: 1.15;
  font-weight: 600;
  color: #374151;
  text-transform: none;
  letter-spacing: normal;
  min-height: 0;
  white-space: normal;
}

/* Добавить модель: только план + стоимость (без суммы факт. времени) */
.page-add-model .model-detail-metrics--add-draft {
  grid-template-columns: 119px 124px;
}

.page-add-model .draft-summary-line {
  font-size: 12px;
}

.page-add-model .add-model-new-flag-label {
  font-size: 12px;
}

.page-add-model #draftSaveResult {
  margin-top: 0.08rem;
  min-height: 0;
}

.page-add-model #draftSaveResult:empty {
  display: none;
}

.page-add-model .floating-save-btn {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 60;
  min-width: 136px;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.24);
}

.page-add-model .floating-save-btn:disabled {
  opacity: 0.72;
}

.page-add-model .floating-save-btn--ready {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22), 0 10px 22px rgba(37, 99, 235, 0.34);
  transform: translateY(-1px);
}

.page-add-model .table--compact th,
.page-add-model .table--compact td {
  padding: 0.26rem 0.32rem;
  font-size: 12px;
  line-height: 1.15;
}

.page-model-detail .table.table--compact th:first-child,
.page-model-detail .table.table--compact td:first-child,
.page-add-model .table--compact th:first-child,
.page-add-model .table--compact td:first-child {
  padding-left: 0.62rem;
}

.page-model-detail .table.table--compact th:last-child,
.page-model-detail .table.table--compact td:last-child,
.page-add-model .table--compact th:last-child,
.page-add-model .table--compact td:last-child {
  padding-right: 0.62rem;
}

/* Фикс: та же «рейка», что на карточке модели — без скачка высоты при inline-редактировании */
.page-add-model #draftTable {
  --draft-op-rail: 28px;
  --draft-time-cell-min: calc(1.15em * 2 + 0.1em);
}

.page-add-model #draftTable tbody tr[data-draft-id] > td {
  vertical-align: middle;
  min-height: calc(var(--draft-op-rail) + 0.28rem);
}

.page-add-model #draftTable td.draft-col-op:not(:has(.draft-inline-operation)),
.page-add-model #draftTable td.draft-col-desc:not(:has(.draft-inline-description)) {
  min-height: var(--draft-op-rail);
}

.page-add-model #draftTable td.draft-col-time .md-metric-time {
  display: inline-flex;
  flex-direction: column;
  gap: 0.06rem;
  justify-content: center;
  min-height: var(--draft-time-cell-min);
}

.page-add-model #draftTable .draft-inline-operation,
.page-add-model #draftTable .draft-inline-description {
  box-sizing: border-box;
  margin: 0;
  width: 100%;
  min-height: var(--draft-op-rail);
  height: var(--draft-op-rail);
  padding: 0 0.32rem;
  line-height: calc(var(--draft-op-rail) - 2px);
  border: 1px solid #d1d5db;
}

.page-add-model #draftTable .draft-inline-time {
  box-sizing: border-box;
  margin: 0;
  width: 100%;
  min-height: var(--draft-time-cell-min);
  height: var(--draft-time-cell-min);
  padding: 0 0.32rem;
  line-height: 1.15;
  border: 1px solid #d1d5db;
}

.page-add-model #draftTable td.draft-col-video {
  min-height: var(--draft-op-rail);
}

.page-add-model #draftTable td.draft-col-video .u-color-muted:only-child {
  display: inline-flex;
  align-items: center;
  min-height: var(--draft-op-rail);
}

.page-add-model #draftTable td.draft-col-cost {
  min-height: var(--draft-op-rail);
  white-space: nowrap;
}

.page-add-model #draftTable tbody tr:hover {
  background: transparent;
}

.page-add-model #draftTable tbody tr.draft-row--model-inner td {
  border-bottom: none;
}

.page-add-model #draftTable tbody td[rowspan] {
  border-bottom: 1px solid #eee;
}

/* Черновики: уже колонка действий (~половина от 72px), шире «Оборудование» */
.page-add-model #draftTable {
  table-layout: fixed;
  width: 100%;
}

.page-add-model #draftTable th:nth-child(1),
.page-add-model #draftTable td:nth-child(1) {
  width: 28%;
  min-width: 13.5rem;
}

.page-add-model #draftTable th:last-child,
.page-add-model #draftTable td:last-child {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  white-space: normal;
  text-align: center;
  vertical-align: middle;
  padding: 0.18rem 0.1rem;
  box-sizing: border-box;
}

.page-add-model .draft-edit,
.page-add-model .draft-delete,
.page-add-model .add-draft-video-open {
  width: var(--draft-op-rail, 28px);
  min-width: var(--draft-op-rail, 28px);
  height: var(--draft-op-rail, 28px);
  padding: 0;
  font-size: 16px;
  box-sizing: border-box;
}

/* В колонке действий две кнопки — в столбик, чтобы колонка оставалась узкой */
.page-add-model #draftTable td:last-child .draft-edit,
.page-add-model #draftTable td:last-child .draft-delete {
  width: var(--draft-op-rail, 28px);
  min-width: var(--draft-op-rail, 28px);
  height: var(--draft-op-rail, 28px);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.page-add-model #draftTable td:last-child .draft-edit {
  margin-bottom: 2px;
}

/* Иконки в таблице черновиков — как в карточке модели (контур play, feather) */
.page-add-model #draftTable .add-draft-video-open {
  color: #6b7280;
}

.page-add-model #draftTable .add-draft-video-open:hover {
  color: #374151;
}

.page-add-model #draftTable .add-draft-video-open .md-op-video-play-icon {
  width: 22px;
  height: 22px;
  display: block;
  margin: 0 auto;
}

.page-add-model #draftTable .draft-edit .icon-feather-action,
.page-add-model #draftTable .draft-delete .icon-feather-action {
  width: 13px;
  height: 13px;
  vertical-align: middle;
}

/* Сводка: рабочий стол */
.page-summary .content {
  padding: 1rem 1rem;
}

.summary-grid {
  display: grid;
  gap: 0.7rem;
}

.summary-grid--top {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-grid--mid {
  grid-template-columns: minmax(0, calc(58% - 3cm)) minmax(0, calc(42% + 3cm));
}

.summary-grid--bottom {
  grid-template-columns: 1.95fr 0.75fr;
  align-items: start;
}

.page-summary .summary-grid--top > .block {
  height: 244px;
  min-height: 244px;
  max-height: 244px;
  overflow: hidden;
}

.page-summary .summary-grid--mid > .block {
  height: 316px;
  min-height: 316px;
  max-height: 316px;
  overflow: hidden;
}

.page-summary .summary-grid--bottom > .block {
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.summary-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.summary-card-head .block__title {
  margin: 0;
  font-size: 13px;
}

.summary-card-head .input {
  width: 96px;
  min-height: 26px;
  height: 26px;
  font-size: 11px;
}

.summary-card-head__controls {
  display: flex;
  align-items: center;
  gap: 0.28rem;
}

.page-summary .summary-period-dropdown,
.page-summary .summary-position-dropdown {
  position: relative;
  width: 78px;
  flex: 0 0 78px;
}

.page-summary .summary-position-dropdown {
  width: 86px;
  flex: 0 0 86px;
}

.page-summary .summary-period-dropdown .orders-dropdown__trigger,
.page-summary .summary-position-dropdown .orders-dropdown__trigger {
  width: 100%;
  min-height: 24px;
  height: 24px;
  padding: 0.12rem 1.25rem 0.12rem 0.44rem;
  border: 1px solid #d8deea;
  border-radius: 8px;
  background: #fff;
  color: #3a475d;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.page-summary .summary-period-dropdown .orders-dropdown__trigger::after,
.page-summary .summary-position-dropdown .orders-dropdown__trigger::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #7b8699;
  border-bottom: 1.5px solid #7b8699;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.page-summary .summary-period-dropdown.is-open .orders-dropdown__trigger,
.page-summary .summary-position-dropdown.is-open .orders-dropdown__trigger {
  border-color: #c8d6f2;
  box-shadow: 0 0 0 2px rgba(1, 104, 250, 0.08);
}

.page-summary .summary-period-dropdown .orders-dropdown__menu,
.page-summary .summary-position-dropdown .orders-dropdown__menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  z-index: 20;
  background: #fff;
  border: 1px solid #64748b;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  padding: 0.15rem;
  max-height: 180px;
  overflow-y: auto;
}

.page-summary .summary-period-dropdown.is-open .orders-dropdown__menu,
.page-summary .summary-position-dropdown.is-open .orders-dropdown__menu {
  display: block;
}

.page-summary .summary-period-dropdown.is-drop-up .orders-dropdown__menu,
.page-summary .summary-position-dropdown.is-drop-up .orders-dropdown__menu {
  top: auto;
  bottom: calc(100% + 4px);
}

.page-summary .summary-period-dropdown .orders-dropdown__option,
.page-summary .summary-position-dropdown .orders-dropdown__option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  padding: 0.24rem 0.42rem;
  min-height: 24px;
  border-radius: 6px;
  cursor: pointer;
}

.page-summary .summary-period-dropdown .orders-dropdown__option:hover,
.page-summary .summary-position-dropdown .orders-dropdown__option:hover {
  background: #f1f5f9;
}

.page-summary .summary-period-dropdown .orders-dropdown__option.is-active,
.page-summary .summary-position-dropdown .orders-dropdown__option.is-active {
  background: #e8f0ff;
  color: #1d4ed8;
  font-weight: 600;
}

.summary-value {
  margin: 0.25rem 0 0.05rem;
  font-size: 15px;
  font-weight: 700;
  color: #1f2a44;
}

.summary-line {
  margin-top: 0.35rem;
  height: 58px;
  border-bottom: 2px solid #263041;
  border-radius: 6px;
  overflow: hidden;
}

.summary-line--prod {
  height: 110px;
  border-bottom: none;
}

.summary-line--avg {
  margin-top: calc(0.65rem + 12px);
  height: 110px;
  border-bottom: none;
}

.summary-line--pay {
  height: 110px;
  border-bottom: none;
}

.summary-line--overpay {
  height: 136px;
  border-bottom: none;
  position: relative;
}

.summary-line--overpay canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.summary-line canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.summary-chart canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ОТК > Проверка */
.page-otk-check .content {
  padding-top: 0.9rem;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

.page-otk-check .section {
  margin-bottom: 0.9rem;
}

/* «Проверка на брак»: одна карточка вокруг таблицы (без второго внешнего .block), как таблицы в заказе.
   Горизонтальный скролл: не `overflow: hidden` — иначе перебивает менее специфичное overflow-x из медиа и ломает узкие экраны. */
.page-otk-check:not(.page-otk-packaging) .table-wrap {
  width: 100%;
  background: var(--df-surface);
  border: 1px solid var(--df-border);
  border-radius: var(--app-ui-radius);
  box-shadow: var(--df-shadow);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.page-otk-check:not(.page-otk-packaging) #otkCheckTable {
  table-layout: fixed;
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
}

.page-otk-check:not(.page-otk-packaging) #otkCheckTable thead th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
}

.page-otk-check:not(.page-otk-packaging) #otkCheckTable tbody tr:nth-child(even) {
  background: #fafbfc;
}

.page-otk-check:not(.page-otk-packaging) #otkCheckTable tbody tr:hover {
  background: #f1f5f9;
}

.page-otk-check:not(.page-otk-packaging) #otkPagination {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

/* ОТК > Упаковка: одна карточка вокруг таблицы; горизонтальный скролл как на «Проверка». */
.page-otk-packaging .table-wrap {
  width: 100%;
  background: var(--df-surface);
  border: 1px solid var(--df-border);
  border-radius: var(--app-ui-radius);
  box-shadow: var(--df-shadow);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.page-otk-packaging #otkPackagingTable {
  table-layout: fixed;
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
}

.page-otk-packaging #otkPackagingTable thead th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
}

.page-otk-packaging #otkPackagingTable tbody tr:nth-child(even) {
  background: #fafbfc;
}

.page-otk-packaging #otkPackagingTable tbody tr:hover {
  background: #f1f5f9;
}

.page-otk-packaging #otkPackagingPagination {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.packaging-detail-incomplete {
  margin-top: 0.35rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--app-ui-radius);
}

.page-otk-check .table th,
.page-otk-check .table td {
  box-sizing: border-box;
  padding: 0.36rem 0.4rem;
  font-size: 0.72rem;
  vertical-align: middle;
}

.page-otk-check .table thead th {
  text-align: left;
  vertical-align: middle;
  font-size: 0.7rem;
  line-height: 1.2;
  font-weight: 600;
  color: #3a475d;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.page-otk-check #otkCheckTable thead th,
.page-otk-check #otkCheckTable thead th .otk-sort-header,
.page-otk-check #otkCheckTable thead th .otk-head-filter__input,
.page-otk-check #otkCheckTable thead th .otk-head-filter__select,
.page-otk-check #otkCheckTable thead th .otk-head-combobox__input,
.page-otk-packaging #otkPackagingTable thead th,
.page-otk-packaging #otkPackagingTable thead th .otk-sort-header,
.page-otk-packaging #otkPackagingTable thead th .otk-head-filter__input,
.page-otk-packaging #otkPackagingTable thead th .otk-head-filter__select,
.page-otk-packaging #otkPackagingTable thead th .otk-head-combobox__input {
  color: #3a475d;
  font-weight: 600;
}

/* Сортировка по дате этапа (ОТК Проверка / Упаковка). */
.page-otk-check .otk-sort-header,
.page-otk-packaging .otk-sort-header {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  white-space: normal;
}

.page-otk-check .otk-sort-header:focus-visible,
.page-otk-packaging .otk-sort-header:focus-visible {
  outline: 2px solid var(--color-accent, #2563eb);
  outline-offset: 2px;
}

.page-otk-check .otk-sort-header__label,
.page-otk-packaging .otk-sort-header__label {
  text-decoration: none;
}

.page-otk-check .otk-sort-header__arrows,
.page-otk-packaging .otk-sort-header__arrows {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  line-height: 0.55;
  font-size: 0.55rem;
  opacity: 0.88;
  flex-shrink: 0;
}

.page-otk-check .otk-sort-header__arr,
.page-otk-packaging .otk-sort-header__arr {
  opacity: 0.35;
  transition: opacity 0.12s ease;
}

.page-otk-check .otk-sort-header.is-sort-desc .otk-sort-header__arr-down,
.page-otk-packaging .otk-sort-header.is-sort-desc .otk-sort-header__arr-down,
.page-otk-check .otk-sort-header.is-sort-asc .otk-sort-header__arr-up,
.page-otk-packaging .otk-sort-header.is-sort-asc .otk-sort-header__arr-up {
  opacity: 1;
}

/* ОТК Проверка: фильтры в заголовках таблицы. */
.page-otk-check .otk-head-filter {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
}

.page-otk-check .otk-head-filter__label {
  display: block;
  min-height: 1em;
}

.page-otk-check .otk-head-filter__input,
.page-otk-check .otk-head-filter__select {
  width: 100%;
  min-height: 24px;
  height: 24px;
  padding: 0.1rem 0.36rem;
  border-radius: var(--app-ui-radius);
  border: 1px solid #d8deea;
  font-size: 11px;
  font-weight: 600;
  color: #3a475d;
  line-height: 1;
}

.page-otk-check .otk-head-filter__input::placeholder {
  color: #3a475d;
  opacity: 1;
}

.page-otk-check .otk-head-combobox__input::placeholder {
  color: #3a475d;
  opacity: 1;
}

.page-otk-check .otk-head-combobox__source {
  display: none !important;
}

.page-otk-check .otk-head-combobox {
  position: relative;
  width: 100%;
}

.page-otk-check .otk-head-combobox__field {
  width: 100%;
}

.page-otk-check .otk-head-combobox__input {
  width: 100%;
  min-height: 24px;
  height: 24px;
  padding: 0.1rem 1.25rem 0.1rem 0.36rem;
  border: 1px solid #d8deea;
  border-radius: var(--app-ui-radius);
  color: #3a475d;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.page-otk-check .otk-head-combobox__field::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #7b8699;
  border-bottom: 1.5px solid #7b8699;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.page-otk-check .otk-head-combobox__menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 140px;
  z-index: 5600;
  background: #fff;
  border: 1px solid #64748b;
  border-radius: var(--app-ui-radius-dropdown);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  padding: 0.15rem;
  max-height: min(220px, calc(100vh - 16px));
  overflow-y: auto;
  overflow-x: hidden;
}

.page-otk-check .otk-head-combobox.is-open .otk-head-combobox__menu {
  display: block;
}

.page-otk-check .otk-head-combobox.is-open .otk-head-combobox__input {
  border-color: #c8d6f2;
  box-shadow: 0 0 0 2px rgba(1, 104, 250, 0.08);
}

.page-otk-check .otk-head-combobox__option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  padding: 0.24rem 0.42rem;
  min-height: 24px;
  border-radius: var(--app-ui-radius);
  cursor: pointer;
}

.page-otk-check .otk-head-combobox__option:hover {
  background: #f1f5f9;
}

.page-otk-check .otk-head-combobox__option.is-active {
  background: #e8f0ff;
  color: #1d4ed8;
  font-weight: 600;
}

.page-otk-check .otk-head-combobox__empty {
  padding: 0.25rem 0.42rem;
  color: #64748b;
  font-size: 11px;
}

.page-otk-check .table-wrap,
.page-otk-packaging .table-wrap {
  overflow-x: auto;
}

.page-otk-check .otk-col-sewing-date { width: 7%; }
.page-otk-check .otk-col-model { width: 11%; }
.page-otk-check .otk-col-color { width: 6.2%; min-width: 4.8rem; }
.page-otk-check .otk-col-size { width: 6.2%; min-width: 4.8rem; }
.page-otk-check .otk-col-qty { width: 4%; }
.page-otk-check .otk-col-inspector { width: 9%; }
.page-otk-check .otk-col-status { width: 14%; min-width: 9.5rem; }
.page-otk-check .otk-col-defect { width: 5%; }
.page-otk-check .otk-col-nonfix { width: 6%; }
.page-otk-check .otk-col-sewn { width: 12%; }
.page-otk-check .otk-col-start { width: 7%; }
.page-otk-check .otk-col-finish { width: 8%; }
.page-otk-check .otk-col-batch { width: 14%; min-width: 7.5rem; }
/* Сумма = 100%: иначе при table-layout:fixed браузер «ломает» ширины и наезжают ячейки. */
.page-otk-packaging .otk-col-sewing-date { width: 8%; }
.page-otk-packaging .otk-col-model { width: 12%; }
.page-otk-packaging .otk-col-color { width: 5%; }
.page-otk-packaging .otk-col-size { width: 5%; }
.page-otk-packaging .otk-col-qty { width: 6%; min-width: 3.25rem; }
.page-otk-packaging .otk-col-inspector { width: 12%; }
.page-otk-packaging .otk-col-status { width: 10%; }
.page-otk-packaging .otk-col-packer { width: 13%; min-width: 10.5rem; }
.page-otk-packaging .otk-col-start { width: 8%; }
.page-otk-packaging .otk-col-finish { width: 8%; }
.page-otk-packaging .otk-col-batch { width: 13%; min-width: 7.5rem; }

/* ОТК > Упаковка: не даём тексту “перетекать” в соседние колонки на узких экранах. */
.page-otk-packaging .table th,
.page-otk-packaging .table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Перенос только у «Модель»; исполнители — flex+ellipsis внутри ячейки, без overflow:visible. */
.page-otk-packaging #otkPackagingTable th:nth-child(2),
.page-otk-packaging #otkPackagingTable td:nth-child(2) {
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  word-break: break-word;
}

/* Количество и код пачки — полностью в одну строку, без троеточий; таблица уезжает в горизонтальный скролл. */
.page-otk-packaging #otkPackagingTable th:nth-child(5),
.page-otk-packaging #otkPackagingTable td:nth-child(5),
.page-otk-packaging #otkPackagingTable th:nth-child(11),
.page-otk-packaging #otkPackagingTable td:nth-child(11) {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.page-otk-check .table td .input,
.page-otk-check .table td select.input {
  min-height: 1.7rem;
  padding: 0.16rem 0.26rem;
  font-size: 0.7rem;
}

/* Кастомный вид селектов как в Сводке (только внешний вид). */
.page-otk-check .table td select.otk-inline-select {
  width: 100%;
  min-height: 26px;
  height: 26px;
  padding: 0.12rem 1.2rem 0.12rem 0.44rem;
  border: 1px solid #d8deea;
  border-radius: var(--app-ui-radius);
  background-color: #fff;
  color: #3a475d;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #7b8699 50%),
    linear-gradient(135deg, #7b8699 50%, transparent 50%);
  background-position:
    calc(100% - 11px) calc(50% - 1px),
    calc(100% - 7px) calc(50% - 1px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  box-shadow: none;
}

.page-otk-check .table td select.otk-inline-select:focus {
  border-color: #c8d6f2;
  box-shadow: 0 0 0 2px rgba(1, 104, 250, 0.08);
  outline: none;
}

.page-otk-check .table td:nth-child(7) select {
  width: 100%;
}

.page-otk-check .table td:nth-child(6) select {
  width: 100%;
}

.page-otk-check .otk-inspector-dropdown {
  position: relative;
  width: 100%;
}

.page-otk-check .otk-inspector-dropdown__trigger {
  width: 100%;
  min-height: 24px;
  height: 24px;
  padding: 0.12rem 1.25rem 0.12rem 0.44rem;
  border: 1px solid #d8deea;
  border-radius: var(--app-ui-radius);
  background: #fff;
  color: #3a475d;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.page-otk-check .otk-inspector-dropdown__trigger::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #7b8699;
  border-bottom: 1.5px solid #7b8699;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.page-otk-check .otk-inspector-dropdown__menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 140px;
  z-index: 5000;
  background: #fff;
  border: 1px solid #d8deea;
  border-radius: var(--app-ui-radius-dropdown);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  padding: 0.15rem;
  max-height: min(280px, calc(100vh - 16px));
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.page-otk-check .otk-inspector-dropdown__menu::-webkit-scrollbar {
  width: 8px;
}

.page-otk-check .otk-inspector-dropdown__menu::-webkit-scrollbar-track {
  background: transparent;
}

.page-otk-check .otk-inspector-dropdown__menu::-webkit-scrollbar-thumb {
  background: #c6d0e0;
  border-radius: 999px;
}

.page-otk-check .otk-inspector-dropdown.is-open .otk-inspector-dropdown__menu {
  display: block;
}

.page-otk-check .otk-inspector-dropdown__option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  padding: 0.24rem 0.42rem;
  min-height: 24px;
  border-radius: var(--app-ui-radius);
  cursor: pointer;
}

.page-otk-check .otk-inspector-dropdown__option:hover {
  background: #f1f5f9;
}

.page-otk-check .otk-inspector-dropdown__option.is-active {
  background: #e8f0ff;
  color: #1d4ed8;
  font-weight: 600;
}

.page-otk-check .otk-inspector-dropdown.is-disabled .otk-inspector-dropdown__trigger {
  background: #f8fafc;
  color: #94a3b8;
  cursor: default;
}

.page-otk-check .table td:nth-child(1),
.page-otk-check .table td:nth-child(11),
.page-otk-check .table td:nth-child(12),
.page-otk-check .table td:nth-child(13) {
  white-space: nowrap;
  overflow-wrap: normal;
}

/* Фильтры "Цвет" и "Размер": текст/placeholder должны помещаться полностью. */
.page-otk-check #otkCheckTable th:nth-child(3),
.page-otk-check #otkCheckTable td:nth-child(3),
.page-otk-check #otkCheckTable th:nth-child(4),
.page-otk-check #otkCheckTable td:nth-child(4) {
  min-width: 5.2rem;
}

.page-otk-check .otk-dt {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.page-otk-check .otk-dt__time,
.page-otk-check .otk-dt__date {
  white-space: nowrap;
}

.page-otk-check .otk-dt__time {
  font-weight: 500;
}

.table-empty {
  margin-top: 0.55rem;
  color: #5f6d86;
  font-size: 0.8rem;
}

.page-otk-check .otk-model-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  max-height: calc(1.2em * 2);
}

.page-otk-check .workers-cell {
  display: block;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-align: left;
}

.page-otk-check .workers-cell__row {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%;
  min-width: 0;
}

.page-otk-check .workers-cell__names {
  flex: 0 1 auto;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-otk-check .table td:nth-child(10) {
  text-align: left;
  white-space: nowrap;
}

.page-otk-check .table td:nth-child(13) {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.page-otk-check .table td:nth-child(13) .otk-batch-link {
  display: inline-block;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  text-decoration: none;
}

.page-otk-check .table td:nth-child(13) .otk-batch-link:hover {
  text-decoration: underline;
}

.page-otk-packaging .table td:nth-child(1),
.page-otk-packaging .table td:nth-child(9),
.page-otk-packaging .table td:nth-child(10) {
  white-space: nowrap;
  overflow-wrap: normal;
}

.page-otk-packaging .table td:nth-child(11) .otk-batch-link {
  display: inline-block;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  text-decoration: none;
}

.page-otk-packaging .table td:nth-child(11) .otk-batch-link:hover {
  text-decoration: underline;
}

.page-otk-packaging .pagination-inline {
  margin-top: 0.6rem;
}

.page-otk-packaging .workers-cell {
  display: block;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-align: left;
}

.page-otk-packaging .workers-cell__row {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Не растягиваем имя на всю ячейку — кнопка +n сразу справа от фамилии */
.page-otk-packaging .workers-cell__names {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-otk-packaging .table td:nth-child(8) {
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  vertical-align: middle;
}

.page-otk-packaging .workers-more-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #c8d6f2;
  background: #f5f8ff;
  color: #37568d;
  border-radius: var(--app-ui-radius);
  font-size: 10px;
  line-height: 1.15;
  padding: 0.08rem 0.22rem;
  cursor: pointer;
  margin-left: 0;
  white-space: nowrap;
}

/* ОТК > Упаковка > [Заказ] */
.page-otk-packaging-detail .content {
  padding-top: 0.9rem;
  padding-bottom: calc(6rem + env(safe-area-inset-bottom));
}

.page-otk-packaging-detail .section {
  margin-bottom: 0.9rem;
}

.page-otk-packaging-detail .packaging-detail-meta {
  margin-top: 0.28rem;
  font-size: 0.78rem;
  line-height: 1.3;
  color: #1f2937;
}

.page-otk-packaging-detail .packaging-detail-meta strong {
  font-weight: 700;
}

.page-otk-packaging-detail .packaging-detail-actions {
  padding: 0.45rem 0.5rem 0.22rem;
  position: fixed;
  left: 260px;
  right: 10px;
  bottom: 8px;
  z-index: 1200;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--app-ui-radius-dropdown);
  box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.08);
}

.page-otk-packaging-detail .packaging-actions-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
  align-items: stretch;
}

.page-otk-packaging-detail .packaging-actions-row .btn {
  width: 100%;
  min-height: 2rem;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  font-family: inherit !important;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

.page-otk-packaging-detail .packaging-actions-row .btn:disabled,
.page-otk-packaging-detail .packaging-actions-row .btn:disabled:hover,
.page-otk-packaging-detail .packaging-actions-row .btn:disabled:focus {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.56;
  box-shadow: none !important;
  filter: none;
  transform: none;
  background: #e5e7eb !important;
  border-color: #d1d5db !important;
  color: #6b7280 !important;
}

.page-otk-packaging-detail .packaging-detail-hint {
  margin-top: 0.1rem;
  font-size: 0.72rem;
  color: #1e3a8a;
  min-height: 0;
  line-height: 1.1;
  padding-bottom: 0;
}

.page-otk-packaging-detail .packaging-detail-hint.is-error {
  color: #b91c1c;
}

@media (max-width: 900px) {
  .page-otk-packaging-detail .packaging-detail-actions {
    left: 176px;
  }
  .page-otk-packaging-detail .packaging-actions-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1400px) {
  .page-otk-packaging-detail .packaging-detail-actions {
    left: 236px;
  }
}

@media (max-width: 1200px) {
  .page-otk-packaging-detail .packaging-detail-actions {
    left: 214px;
  }
}

@media (max-width: 1024px) {
  .page-otk-packaging-detail .packaging-detail-actions {
    left: 194px;
  }
}

@media (max-width: 768px) {
  .page-otk-packaging-detail .packaging-detail-actions {
    left: 8px;
    right: 8px;
    bottom: 6px;
  }
  .page-otk-packaging-detail .packaging-actions-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-otk-packaging-detail .content {
    padding-bottom: calc(10.2rem + env(safe-area-inset-bottom));
  }
}

/* «Проверка на брак»: +n сразу после фамилии (без margin-left:auto — иначе уезжает к правому краю ячейки). */
.page-otk-check:not(.page-otk-packaging) .workers-more-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #c8d6f2;
  background: #f5f8ff;
  color: #37568d;
  border-radius: var(--app-ui-radius);
  font-size: 10px;
  line-height: 1.15;
  padding: 0.08rem 0.22rem;
  cursor: pointer;
  margin-left: 0.2rem;
  white-space: nowrap;
}

.otk-status {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  border-radius: var(--app-ui-radius-status);
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.page-otk-check #otkCheckTable td:nth-child(7) {
  vertical-align: middle;
}

.page-otk-check #otkCheckTable .otk-status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.18rem;
}

.page-otk-packaging #otkPackagingTable td:nth-child(7) {
  vertical-align: top;
}

.page-otk-packaging #otkPackagingTable .otk-status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
}

.page-otk-packaging #otkPackagingTable .otk-status {
  min-height: 26px;
  padding: 0.18rem 0.48rem;
}

.page-otk-packaging-detail .packaging-detail-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.page-otk-packaging-detail .packaging-detail-status-line .otk-status {
  min-height: 26px;
  padding: 0.18rem 0.48rem;
}

.page-otk-check #otkCheckTable .otk-status {
  min-height: 22px;
  padding: 0.08rem 0.48rem;
}

.otk-status--queue-wait {
  background: #eef2f7;
  border-color: #c5d0e3;
  color: #2c3d5c;
}

.otk-status--queue-active {
  background: #e6f4f7;
  border-color: #9dcdd9;
  color: #1a5c6e;
}

.otk-status--defect-recheck {
  background: #f1e8ff;
  border-color: #c4b5e8;
  color: #4c2f8f;
}

.otk-status--rework-queue {
  background: #faf3e3;
  border-color: #e0c9a0;
  color: #6b4a1f;
}

.otk-status--rework-fixed {
  background: #e3f2ec;
  border-color: #9cc9b3;
  color: #1f5a40;
}

.otk-status--handoff-pack {
  background: #e8f8ef;
  border-color: #a8dcb8;
  color: #1d6b3a;
}

.otk-status--handoff-warehouse {
  background: #e3edfa;
  border-color: #9eb7e0;
  color: #254a7a;
}

.otk-status--legacy-verified-packed {
  background: #ecf9e5;
  border-color: #b8dea5;
  color: #3d6628;
}

.otk-status--legacy-packed {
  background: #dff6f0;
  border-color: #8fd4c4;
  color: #0f5c52;
}

.otk-status--legacy-pack-pending {
  background: #fff0e5;
  border-color: #f0c29a;
  color: #8b4510;
}

.otk-status--session-pause {
  background: #fdeef3;
  border-color: #e8b8c8;
  color: #7a2d4a;
}

.otk-status--misc {
  background: #f3eef5;
  border-color: #d4c4da;
  color: #5c3d66;
}

/* ОТК > Проверка > [Пачка] */
.page-otk-check-detail .content {
  padding-top: 0.65rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.page-otk-check-detail .section {
  margin-bottom: 0.6rem;
}

.page-otk-check-detail .section__title {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.page-otk-check-detail .otk-detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.page-otk-check-detail .otk-detail-meta-row .otk-detail-meta-status {
  display: inline-flex;
  align-items: flex-start;
}

.page-otk-check-detail .otk-detail-meta-row .otk-status-stack--detail-header {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.page-otk-check-detail .otk-detail-meta-row .otk-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.2rem 0.55rem;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.page-otk-check-detail .otk-detail-timer {
  margin-top: 0.24rem;
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}

.page-otk-check-detail .block {
  padding: 0.5rem 0.58rem;
}

.otk-detail-head {
  display: block;
}

.otk-op-group {
  margin-bottom: 0.5rem;
}

.otk-op-group__title {
  font-weight: 600;
  margin-bottom: 0.22rem;
  font-size: 0.86rem;
}

.page-otk-check-detail .otk-op-table {
  table-layout: fixed;
  width: 100%;
}

.page-otk-check-detail tr.otk-op-row--rework-locked .input:disabled,
.page-otk-check-detail tr.otk-op-row--rework-locked .otk-op-step-btn:disabled {
  cursor: not-allowed;
}

.page-otk-check-detail .otk-op-table th,
.page-otk-check-detail .otk-op-table td {
  font-size: 11px;
  padding: 0.2rem 0.22rem;
  text-align: left;
  vertical-align: middle;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-otk-check-detail .otk-op-table th:nth-child(1),
.page-otk-check-detail .otk-op-table td:nth-child(1) { width: 3%; text-align: center; }
.page-otk-check-detail .otk-op-table th:nth-child(2),
.page-otk-check-detail .otk-op-table td:nth-child(2) { width: 13%; }
.page-otk-check-detail .otk-op-table th:nth-child(3),
.page-otk-check-detail .otk-op-table td:nth-child(3) { width: 12%; }
.page-otk-check-detail .otk-op-table th:nth-child(4),
.page-otk-check-detail .otk-op-table td:nth-child(4) { width: 14%; }
.page-otk-check-detail .otk-op-table th:nth-child(5),
.page-otk-check-detail .otk-op-table td:nth-child(5) { width: 10%; }
.page-otk-check-detail .otk-op-table th:nth-child(6),
.page-otk-check-detail .otk-op-table td:nth-child(6) { width: 10%; }
.page-otk-check-detail .otk-op-table th:nth-child(7),
.page-otk-check-detail .otk-op-table td:nth-child(7) { width: 16%; }
.page-otk-check-detail .otk-op-table th:nth-child(8),
.page-otk-check-detail .otk-op-table td:nth-child(8) { width: 14%; text-align: center; }
.page-otk-check-detail .otk-op-table th:nth-child(9),
.page-otk-check-detail .otk-op-table td:nth-child(9) { width: 5%; text-align: center; }
.page-otk-check-detail .otk-op-table th:nth-child(6) {
  white-space: normal;
  line-height: 1.12;
}

.page-otk-check-detail .otk-op-table td:nth-child(6),
.page-otk-check-detail .otk-op-table td:nth-child(7) {
  text-overflow: clip;
}

.page-otk-check-detail .otk-op-select {
  width: 14px;
  height: 14px;
}

/* Кастомный dropdown инспектора (как в Заказе на пошив). */
.page-otk-check-detail .otk-op-inspector-dropdown {
  position: relative;
  width: 100%;
}

.page-otk-check-detail .otk-op-inspector-dropdown__trigger {
  width: 100%;
  min-height: 20px;
  height: 20px;
  padding: 0.08rem 1rem 0.08rem 0.3rem;
  border: 1px solid #d8deea;
  border-radius: var(--app-ui-radius);
  background: #fff;
  color: #3a475d;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.page-otk-check-detail .otk-op-inspector-dropdown__trigger::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid #7b8699;
  border-bottom: 1.5px solid #7b8699;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.page-otk-check-detail .otk-op-inspector-dropdown__menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 140px;
  z-index: 5000;
  background: #fff;
  border: 1px solid #d8deea;
  border-radius: var(--app-ui-radius-dropdown);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  padding: 0.15rem;
  max-height: min(300px, calc(100vh - 16px));
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.page-otk-check-detail .otk-op-inspector-dropdown.is-open .otk-op-inspector-dropdown__menu {
  display: block;
}

.page-otk-check-detail .otk-op-inspector-dropdown__option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  padding: 0.24rem 0.42rem;
  min-height: 24px;
  border-radius: var(--app-ui-radius);
  cursor: pointer;
}

.page-otk-check-detail .otk-op-inspector-dropdown__option:hover {
  background: #f1f5f9;
}

.page-otk-check-detail .otk-op-inspector-dropdown__option.is-active {
  background: #e8f0ff;
  color: #1d4ed8;
  font-weight: 600;
}

.page-otk-check-detail .otk-op-inspector-dropdown.is-disabled .otk-op-inspector-dropdown__trigger {
  background: #f8fafc;
  color: #94a3b8;
  cursor: default;
}

/* Кастомный dropdown назначения на переделку (как у инспектора). */
.page-otk-check-detail .otk-op-rework-dropdown {
  position: relative;
  width: 100%;
}

.page-otk-check-detail .otk-op-rework-dropdown__trigger {
  width: 100%;
  min-height: 20px;
  height: 20px;
  padding: 0.08rem 1rem 0.08rem 0.3rem;
  border: 1px solid #d8deea;
  border-radius: var(--app-ui-radius);
  background: #fff;
  color: #3a475d;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  position: relative;
}

.page-otk-check-detail .otk-op-rework-dropdown__trigger::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid #7b8699;
  border-bottom: 1.5px solid #7b8699;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.page-otk-check-detail .otk-op-rework-dropdown__menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 140px;
  z-index: 5000;
  background: #fff;
  border: 1px solid #d8deea;
  border-radius: var(--app-ui-radius-dropdown);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  padding: 0.15rem;
  max-height: min(300px, calc(100vh - 16px));
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.page-otk-check-detail .otk-op-rework-dropdown.is-open .otk-op-rework-dropdown__menu {
  display: block;
}

.page-otk-check-detail .otk-op-rework-dropdown__option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  padding: 0.24rem 0.42rem;
  min-height: 24px;
  border-radius: var(--app-ui-radius);
  cursor: pointer;
}

.page-otk-check-detail .otk-op-rework-dropdown__option:hover {
  background: #f1f5f9;
}

.page-otk-check-detail .otk-op-rework-dropdown__option.is-active {
  background: #e8f0ff;
  color: #1d4ed8;
  font-weight: 600;
}

.page-otk-check-detail .otk-op-rework-dropdown.is-disabled .otk-op-rework-dropdown__trigger {
  background: #f8fafc;
  color: #94a3b8;
  cursor: default;
}

.page-otk-check-detail.otk-edit-locked .otk-op-defect:disabled,
.page-otk-check-detail.otk-edit-locked .otk-op-no-fix-qty:disabled,
.page-otk-check-detail.otk-edit-locked #otkActualQty:disabled {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #9ca3af;
  opacity: 1;
}

.page-otk-check-detail.otk-edit-locked .otk-op-select:disabled,
.page-otk-check-detail.otk-edit-locked #otkAutoReworkToggle:disabled {
  opacity: 0.45;
}

.page-otk-check-detail.otk-edit-locked .otk-rework-check,
.page-otk-check-detail.otk-edit-locked .otk-op-inspector-dropdown.is-disabled .otk-op-inspector-dropdown__trigger,
.page-otk-check-detail.otk-edit-locked .otk-op-rework-dropdown.is-disabled .otk-op-rework-dropdown__trigger {
  color: #9ca3af;
}

.otk-op-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.page-otk-check-detail .otk-op-defect,
.page-otk-check-detail .otk-op-no-fix-qty {
  /* до 3 цифр + padding (как нижний блок неопознанного брака) */
  width: 6.5ch !important;
  min-width: 6ch !important;
  max-width: 7.5ch !important;
  box-sizing: border-box;
  margin: 0 auto;
  -moz-appearance: textfield;
  appearance: textfield;
}

.page-otk-check-detail .otk-op-defect::-webkit-outer-spin-button,
.page-otk-check-detail .otk-op-defect::-webkit-inner-spin-button,
.page-otk-check-detail .otk-op-no-fix-qty::-webkit-outer-spin-button,
.page-otk-check-detail .otk-op-no-fix-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.page-otk-check-detail .otk-op-defect-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.page-otk-check-detail .otk-op-no-fix-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.page-otk-check-detail .otk-op-rework-loss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--app-ui-radius);
  background: #fff3cd;
  border: 1px solid #f59e0b;
  color: #92400e;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.page-otk-check-detail .otk-op-step-btn {
  width: 22px;
  min-width: 22px;
  height: 22px;
  border: 1px solid #d1d5db;
  border-radius: var(--app-ui-radius);
  background: #fff;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.page-otk-check-detail .otk-op-step-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
}

.page-otk-check-detail .otk-op-step-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.page-otk-check-detail .otk-op-rework-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.page-otk-check-detail .otk-op-rework-top {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 4px;
}

.page-otk-check-detail .otk-op-rework-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.page-otk-check-detail .otk-op-rework-item {
  font-size: 10px;
  color: #475569;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-otk-check-detail .otk-op-rework-tasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  max-width: 100%;
}

.page-otk-check-detail .otk-op-rework-taskline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 4px 6px;
  align-items: baseline;
  font-size: 10px;
  line-height: 1.25;
  color: #475569;
}

.page-otk-check-detail .otk-op-rework-taskline__user {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-otk-check-detail .otk-op-rework-taskline__qty {
  font-variant-numeric: tabular-nums;
  color: #334155;
}

.page-otk-check-detail .otk-op-rework-taskline__st {
  font-size: 9px;
  color: #64748b;
  white-space: nowrap;
}

.page-otk-check-detail .otk-op-print {
  width: auto;
  min-width: 30px;
  height: 20px;
  padding: 0 3px;
  margin-top: 0;
  white-space: nowrap;
  font-size: 8px;
  line-height: 1;
}

.page-otk-check-detail .otk-rw-status {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid #d8deea;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-otk-check-detail .otk-rw-status--work {
  background: #eef4ff;
  border-color: #c7d7ff;
  color: #1d4ed8;
}

.page-otk-check-detail .otk-rw-status--done {
  background: #ecfdf3;
  border-color: #bfe7cf;
  color: #15803d;
}

.page-otk-check-detail .otk-rw-status--consumed {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.page-otk-check-detail .otk-rw-status--reassign {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.page-otk-check-detail .otk-rw-status--defect {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #a16207;
}

.page-otk-check-detail .otk-rw-status--done-with-defect {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

.page-otk-check-detail .table-wrap {
  overflow-x: hidden;
}

.otk-detail-bottom {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.page-otk-check-detail .otk-detail-bottom--topline {
  grid-template-columns: minmax(0, 0.58fr) minmax(0, 1.38fr) minmax(0, 0.82fr) minmax(0, 1.22fr);
  align-items: stretch;
}

.page-otk-check-detail .otk-detail-bottom--topline > .otk-detail-bottom-col {
  padding: 0.24rem 0.34rem;
}

.page-otk-check-detail .otk-detail-qty-col,
.page-otk-check-detail .otk-detail-shipment-col,
.page-otk-check-detail .otk-detail-unknown-col,
.page-otk-check-detail .otk-detail-print-col {
  min-width: 0;
}

.page-otk-check-detail .otk-detail-qty-col {
  display: flex;
  flex-direction: column;
}

.page-otk-check-detail .otk-detail-qty-col .otk-detail-bottom-actions {
  margin-top: auto;
}

.page-otk-check-detail .otk-detail-shipment-col,
.page-otk-check-detail .otk-detail-unknown-col {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* Неопознанный брак: есть «Можно исправить», но не выбран исполнитель — мягкая подсветка до перемещения */
.page-otk-check-detail .otk-detail-unknown-col.is-assignee-required {
  border-radius: var(--app-ui-radius);
  padding: 0.45rem 0.55rem;
  margin: -0.3rem -0.35rem;
  border: 1px solid rgba(196, 120, 48, 0.42);
  background: rgba(196, 120, 48, 0.07);
}

.page-otk-check-detail .otk-unknown-head-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  flex-wrap: nowrap;
  column-gap: 0.12rem;
  row-gap: 0;
  margin-bottom: 0;
  line-height: 1.2;
}

.page-otk-check-detail .otk-unknown-head-row .block__sub {
  margin-bottom: 0;
  flex: 0 1 auto;
}

.page-otk-check-detail .otk-shipment-head-row {
  display: flex;
  align-items: center;
  gap: 0.18rem;
  min-height: 1.32rem;
  line-height: 1.2;
}

.page-otk-check-detail .otk-shipment-input-row {
  display: flex;
  align-items: center;
  gap: 0.18rem;
  min-height: 1.32rem;
}

.page-otk-check-detail .otk-nb-qty-wrap {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  flex: 0 0 auto;
}

.page-otk-check-detail .otk-nb-qty-steps {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 0.95rem;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.page-otk-check-detail .otk-nb-step-btn {
  flex: 1 1 50%;
  min-height: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: rgba(248, 250, 252, 0.92);
  cursor: pointer;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-otk-check-detail .otk-nb-step-btn::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  pointer-events: none;
}

.page-otk-check-detail .otk-nb-defect-plus::before,
.page-otk-check-detail .otk-nb-nofix-plus::before {
  border-bottom: 5px solid #64748b;
}

.page-otk-check-detail .otk-nb-defect-minus::before,
.page-otk-check-detail .otk-nb-nofix-minus::before {
  border-top: 5px solid #64748b;
}

.page-otk-check-detail .otk-nb-defect-plus:hover:not(:disabled)::before,
.page-otk-check-detail .otk-nb-nofix-plus:hover:not(:disabled)::before {
  border-bottom-color: #334155;
}

.page-otk-check-detail .otk-nb-defect-minus:hover:not(:disabled)::before,
.page-otk-check-detail .otk-nb-nofix-minus:hover:not(:disabled)::before {
  border-top-color: #334155;
}

.page-otk-check-detail .otk-nb-step-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.page-otk-check-detail .otk-nb-qty-wrap.is-disabled .otk-nb-qty-steps {
  display: none;
}

.page-otk-check-detail .otk-unknown-head-row #otkUnknownDefectQty,
.page-otk-check-detail .otk-nonfix-input-row #otkUnknownDefectQty,
.page-otk-check-detail .otk-nb-qty-wrap #otkUnknownDefectQty,
.page-otk-check-detail .otk-nb-qty-wrap #otkUnknownNonfixQty {
  /* три цифры + отступы; ch по ширине «0» в мелком шрифте */
  width: 8ch !important;
  min-width: 7.5ch !important;
  max-width: 10ch !important;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.06rem 1.15rem 0.06rem 0.28rem !important;
  font-size: 0.72rem !important;
  line-height: 1.2 !important;
  min-height: 0 !important;
  height: 1.32rem !important;
  background: #fff;
  border-color: #d8deea;
  color: #1f2937;
}

.page-otk-check-detail .otk-nonfix-input-row {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
}

.page-otk-check-detail .otk-unknown-recoverable-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
}

.page-otk-check-detail .otk-unknown-assignee-slot {
  flex: 1 1 7.5rem;
  min-width: 0;
  max-width: 100%;
  margin-left: 0;
}

.page-otk-check-detail .otk-unknown-assignee-slot .order-status-dropdown {
  position: relative;
  width: 100%;
  min-width: 0;
}

.page-otk-check-detail .otk-unknown-assignee-slot .order-status-dropdown__trigger {
  display: block;
  position: relative;
  width: 100%;
  text-align: left;
  padding-right: 1.2rem;
  border: 1px solid #d8deea;
  border-radius: var(--app-ui-radius);
  background: #fff;
  color: #1f2937;
  min-height: 1.32rem;
  height: 1.32rem;
  padding: 0.06rem 0.28rem;
  font-size: 0.72rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.page-otk-check-detail .otk-unknown-assignee-slot .order-status-dropdown.is-disabled .order-status-dropdown__trigger {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #d1d5db;
  cursor: not-allowed;
}

.page-otk-check-detail .otk-unknown-assignee-slot .order-status-dropdown__trigger::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transform: translateY(-40%);
  opacity: 0.65;
  pointer-events: none;
}

.page-otk-check-detail .otk-unknown-assignee-slot .order-status-dropdown__menu {
  display: none;
  position: fixed;
  z-index: 5000;
  background: #fff;
  border: 1px solid #d8deea;
  border-radius: var(--app-ui-radius-dropdown);
  padding: 6px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  max-height: min(300px, calc(100vh - 16px));
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.page-otk-check-detail .otk-unknown-assignee-slot .order-status-dropdown.is-open .order-status-dropdown__menu {
  display: block;
}

.page-otk-check-detail .otk-unknown-assignee-slot .order-status-dropdown__option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  border-radius: var(--app-ui-radius);
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1.2;
  color: #1f2937;
}

.page-otk-check-detail .otk-unknown-assignee-slot .order-status-dropdown__option:hover {
  background: #f1f5f9;
}

.page-otk-check-detail .otk-unknown-assignee-slot .order-status-dropdown__option.is-active {
  background: #e8f0ff;
  color: #1d4ed8;
}

.page-otk-check-detail .otk-unknown-assignee-slot .otk-unknown-search {
  width: 100%;
  margin-bottom: 6px;
}

.page-otk-check-detail .otk-nonfix-input-row #otkUnknownNonfixQty {
  width: 8ch !important;
  min-width: 7.5ch !important;
  max-width: 10ch !important;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.06rem 1.15rem 0.06rem 0.28rem !important;
  font-size: 0.72rem !important;
  line-height: 1.2 !important;
  min-height: 0 !important;
  height: 1.32rem !important;
  background: #fff;
  border-color: #d8deea;
  color: #1f2937;
}

.page-otk-check-detail #otkUnknownDefectQty:disabled,
.page-otk-check-detail #otkUnknownNonfixQty:disabled {
  background: #f3f4f6 !important;
  color: #9ca3af !important;
  border-color: #d1d5db !important;
  opacity: 1 !important;
}

/* Узкие number: убрать стрелки (WebKit/Firefox), чтобы не съедали место для цифр */
.page-otk-check-detail .otk-detail-bottom--topline input[type="number"]::-webkit-outer-spin-button,
.page-otk-check-detail .otk-detail-bottom--topline input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.page-otk-check-detail .otk-detail-bottom--topline input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.page-otk-check-detail #otkUnknownDefectQty::-webkit-outer-spin-button,
.page-otk-check-detail #otkUnknownDefectQty::-webkit-inner-spin-button,
.page-otk-check-detail #otkUnknownNonfixQty::-webkit-outer-spin-button,
.page-otk-check-detail #otkUnknownNonfixQty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.page-otk-check-detail #otkUnknownDefectQty,
.page-otk-check-detail #otkUnknownNonfixQty {
  -moz-appearance: textfield;
  appearance: textfield;
}

.page-otk-check-detail .otk-detail-print-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-otk-check-detail .otk-detail-print-col .otk-detail-bottom-actions {
  margin-top: auto;
  display: flex;
  width: 100%;
  align-items: stretch;
  gap: 0.28rem;
  flex-wrap: nowrap;
  min-width: 0;
}

.page-otk-check-detail .otk-detail-print-col .otk-detail-bottom-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.page-otk-check-detail .otk-detail-print-col .otk-select-all-defects-btn {
  min-width: 0;
}

.otk-detail-bottom-col {
  border: 1px solid #e5e7eb;
  border-radius: var(--app-ui-radius);
  padding: 0.38rem;
}

.otk-detail-bottom-col .block__sub {
  margin-bottom: 0.16rem;
  font-size: 0.72rem;
  line-height: 1.15;
}

.otk-detail-bottom-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: nowrap;
}

.otk-detail-bottom-actions .btn {
  white-space: nowrap;
}

.page-otk-check-detail .otk-detail-bottom-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.page-otk-check-detail .otk-plain-label {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
}

.page-otk-check-detail .otk-rework-check {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: #374151;
  white-space: nowrap;
  user-select: none;
}

.page-otk-check-detail .otk-rework-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #2563eb;
}

.page-otk-check-detail .otk-decision-btn.is-active {
  background: #e8f0ff;
  border-color: #c8dcff;
  color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.08);
}

.page-otk-check-detail .otk-decision-btn--mock {
  pointer-events: none;
  cursor: default;
  user-select: none;
}

.otk-detail-bottom-actions #otkActualQty {
  min-width: 0;
  width: 100%;
  max-width: 150px;
}

.page-otk-check-detail .otk-select-all-defects-btn {
  min-width: 230px;
}

.page-otk-check-detail .otk-defect-aggregates {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: #374151;
}

.otk-detail-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  align-items: start;
}

.page-otk-check-detail .otk-detail-actions {
  position: sticky;
  bottom: 0;
  z-index: 40;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--app-ui-radius-dropdown);
  padding: 0.24rem 0.42rem 0.36rem;
  box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.08);
}

.page-otk-check-detail .otk-action-timers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 0.02rem;
  min-height: 0.7rem;
  margin-bottom: -0.24rem;
}

.page-otk-check-detail .otk-action-timer {
  min-height: 0.7rem;
  font-size: 0.72rem;
  color: #4b5563;
  display: flex;
  align-items: center;
  line-height: 1;
}

.page-otk-check-detail .otk-action-timer--pause-col {
  margin-left: 0;
  justify-content: flex-start;
}

.page-otk-check-detail .otk-top-note {
  min-height: 1.2rem;
  font-size: 0.72rem;
  color: #4b5563;
  display: flex;
  align-items: center;
  margin-bottom: 0.05rem;
}

.page-otk-check-detail .otk-detail-actions > .btn {
  width: 100%;
  align-self: start;
}

.page-otk-check-detail .otk-finish-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.page-otk-check-detail .otk-actions-rows {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.12rem;
}

.page-otk-check-detail .otk-actions-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.04rem;
  align-items: start;
}

.page-otk-check-detail .otk-actions-col {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.page-otk-check-detail .otk-inline-timer {
  min-height: 0.62rem;
  margin-bottom: 0.06rem;
  font-size: 0.72rem;
  line-height: 1;
  color: #4b5563;
  font-family: inherit;
}

.page-otk-check-detail .otk-actions-col--pause {
  position: static;
}

.page-otk-check-detail .otk-actions-col .btn {
  width: 100%;
  min-height: 1.75rem;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  font-family: inherit !important;
}

.page-otk-check-detail .otk-actions-row {
  display: grid;
  gap: 0.35rem;
  align-items: start;
}

.page-otk-check-detail .otk-actions-row--start,
.page-otk-check-detail .otk-actions-row--complete {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch;
  gap: 0.35rem;
}

.page-otk-check-detail .otk-actions-row--start > *,
.page-otk-check-detail .otk-actions-row--complete > * {
  flex: 1 1 0;
  min-width: 0;
}

.page-otk-check-detail .otk-actions-row--pause {
  display: flex !important;
  flex-direction: row !important;
}

.page-otk-check-detail .otk-complete-last {
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
}

.page-otk-check-detail .otk-actions-row .btn {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  white-space: normal;
  line-height: 1.2;
  padding-top: 0.32rem;
  padding-bottom: 0.32rem;
}

.page-otk-check-detail .otk-start-hint {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: #4b5563;
}

.page-otk-check-detail .otk-action-btn.is-active {
  background: #e8f0ff;
  border-color: #c8dcff;
  color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.08);
}

.page-otk-check-detail .otk-actions-col--start .otk-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.page-otk-check-detail .otk-actions-col--pause .otk-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.page-otk-check-detail .otk-actions-col--complete #otkCompleteFlowBtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.page-otk-check-detail .otk-actions-col--complete .btn.is-active {
  background: #e8f0ff;
  border-color: #c8dcff;
  color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.08);
}

.page-otk-check-detail .otk-actions-col--complete .btn.is-choice-disabled,
.page-otk-check-detail .otk-actions-col--start .btn.is-choice-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.page-otk-check-detail .otk-actions-col--start #otkResumeBtn:disabled,
.page-otk-check-detail .otk-actions-col--start #otkResumeDefectBtn:disabled,
.page-otk-check-detail .otk-actions-col--start #otkStartFlowBtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.page-otk-check-detail #otkSelectAllDefects:disabled,
.page-otk-check-detail #otkPrintDefects:disabled,
.page-otk-check-detail .otk-op-print:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.1);
}

.page-otk-check-detail #otkStartBtn,
.page-otk-check-detail #otkResumeBtn,
.page-otk-check-detail #otkResumeDefectBtn,
.page-otk-check-detail #otkCompleteWaitRework,
.page-otk-check-detail #otkCompleteFinalize,
.page-otk-check-detail #otkCompleteRecovered,
.page-otk-check-detail #otkCompleteFinalizeWriteoff {
  display: none;
}

.page-otk-check-detail .otk-transfer-switch-wrap {
  margin-bottom: 0;
  transform: translateY(-3px);
}

.page-otk-check-detail .otk-transfer-switch {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  border: 1px solid #1f2937;
  border-radius: var(--app-ui-radius);
  overflow: hidden;
  background: #fff;
}

.page-otk-check-detail .otk-transfer-switch label {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 19px;
  padding: 0 0.12rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: #111827;
  text-align: center;
  cursor: pointer;
  border-right: 1px solid #1f2937;
  user-select: none;
  font-family: inherit !important;
}

.page-otk-check-detail .otk-action-timer,
.page-otk-check-detail .otk-defect-aggregates,
.page-otk-check-detail .otk-defect-aggregates strong {
  font-family: inherit !important;
}

.page-otk-check-detail .otk-defect-aggregates strong {
  font-weight: 600;
}

.page-otk-check-detail .otk-transfer-switch label:last-of-type {
  border-right: 0;
}

.page-otk-check-detail .otk-transfer-switch input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.page-otk-check-detail .otk-transfer-switch input[type="radio"]:checked + label {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}

.page-otk-check-detail .otk-transfer-switch-wrap.is-disabled {
  opacity: 0.55;
}

.page-otk-check-detail .otk-transfer-switch-wrap.is-disabled .otk-transfer-switch label {
  cursor: not-allowed;
}

.orders-qty-delta {
  color: #1d4ed8;
  font-weight: 600;
}

.od-sewing-target-match {
  color: #1d4ed8;
  font-weight: 600;
}

.page-otk-check-detail .otk-finish-hint {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: #4b5563;
}

.page-otk-check-detail .content {
  padding-bottom: calc(5.8rem + env(safe-area-inset-bottom));
}

.page-otk-check-detail .btn,
.page-otk-check-detail .input,
.page-otk-check-detail select.input {
  min-height: 1.75rem;
  font-size: 0.72rem;
  padding: 0.18rem 0.42rem;
}

.summary-avg-card {
  gap: 0.42rem;
}

.summary-avg-card .summary-card-head {
  margin-bottom: 0.18rem;
}

.summary-avg-card .block__sub {
  margin: 0;
  min-height: 1.2em;
}

.summary-avg-card .summary-value {
  margin: 0;
  line-height: 1.2;
}

.summary-prod-card {
  gap: 0.3rem;
}

.summary-prod-card .summary-card-head .block__title {
  line-height: 1.05;
}

.summary-prod-card .summary-value {
  margin: 0;
  line-height: 1.05;
}

.summary-prod-card .block__sub {
  margin: 0;
  line-height: 1.05;
}

.summary-pay-card {
  gap: 0.3rem;
}

.summary-pay-card .summary-card-head .block__title {
  line-height: 1.05;
}

.summary-pay-card .summary-value {
  margin: 0;
  line-height: 1.05;
}

.summary-pay-card .block__sub {
  margin: 0;
  line-height: 1.05;
}

.summary-pay-value__selected {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.summary-chart {
  margin-top: 0.45rem;
  height: 120px;
  border-bottom: 2px solid #263041;
  border-radius: 6px;
  overflow: hidden;
}

.summary-model-plan-card {
  display: grid;
  align-content: start;
  gap: 0.4rem;
}

.summary-chart--model-plan {
  margin-top: 0.1rem;
  height: 154px;
  border-bottom: none;
  border-radius: 10px;
  background: #f8fbff;
}

.summary-model-picker {
  display: grid;
  gap: 0.28rem;
}

.summary-model-search {
  width: 20%;
  min-width: 110px;
  min-height: 20px;
  height: 20px;
  max-height: 20px;
  font-size: 10px;
  line-height: 1;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 0.3rem;
  padding-right: 0.3rem;
}

.summary-model-picker-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.22rem 0.44rem;
  max-height: 52px;
  overflow: auto;
  padding-right: 0.2rem;
}

.summary-model-option {
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
  font-size: 11px;
  color: #334155;
  white-space: nowrap;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.summary-model-option.is-selected {
  font-weight: 600;
}

.summary-model-option__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
}

.summary-model-option__name {
  min-width: 0;
  flex: 0 1 auto;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-model-remove-btn {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 0;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  line-height: 1;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: 0.02rem;
  vertical-align: middle;
}

.summary-model-remove-btn:hover {
  background: #fecaca;
  color: #991b1b;
}

.summary-employees {
  margin: 0.35rem 0 0;
  font-size: 15px;
  font-weight: 700;
  color: #1f2a44;
}

.summary-chart-hints {
  margin-top: 0.2rem;
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 10px;
  color: #64748b;
}

.summary-mini-table th,
.summary-mini-table td {
  font-size: 11px;
  padding: 0.28rem 0.34rem;
}

.summary-table-scroll {
  max-height: 260px;
  overflow: auto;
}

.summary-table-scroll .summary-mini-table {
  min-width: 640px;
}

.summary-orders-block .summary-table-scroll,
.summary-mid-tabs-card .summary-table-scroll {
  overflow-x: hidden;
  overflow-y: auto;
}

.summary-grid--mid > .block:not(.summary-orders-block) .summary-table-scroll {
  overflow-x: hidden;
  overflow-y: auto;
}

.summary-orders-block .summary-mini-table,
.summary-mid-tabs-card .summary-mini-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.summary-orders-block .summary-mini-table th,
.summary-orders-block .summary-mini-table td,
.summary-mid-tabs-card .summary-mini-table th,
.summary-mid-tabs-card .summary-mini-table td {
  font-size: 10px;
  padding: 0.16rem 0.26rem;
}

.summary-orders-block .summary-mini-table tbody tr,
.summary-mid-tabs-card .summary-mini-table tbody tr {
  height: 30px;
}

.summary-orders-block .summary-mini-table--in-progress tbody td,
.summary-orders-block .summary-mini-table--done tbody td,
.summary-orders-block .summary-mini-table--old-orders tbody td,
.summary-mid-tabs-card .summary-mini-table--in-progress tbody td,
.summary-mid-tabs-card .summary-mini-table--done tbody td,
.summary-mid-tabs-card .summary-mini-table--old-orders tbody td,
.summary-mid-tabs-card .summary-mini-table--sew tbody td {
  vertical-align: middle;
}

.summary-orders-block .summary-mini-table--in-progress tbody td:nth-child(5),
.summary-orders-block .summary-mini-table--done tbody td:nth-child(6),
.summary-mid-tabs-card .summary-mini-table--in-progress tbody td:nth-child(5),
.summary-mid-tabs-card .summary-mini-table--done tbody td:nth-child(6),
.summary-mid-tabs-card .summary-mini-table--sew tbody td:nth-child(5) {
  vertical-align: top;
}

.summary-mini-table--in-progress th:nth-child(1),
.summary-mini-table--in-progress td:nth-child(1) { width: 20%; }
.summary-mini-table--in-progress th:nth-child(2),
.summary-mini-table--in-progress td:nth-child(2) { width: 14%; }
.summary-mini-table--in-progress th:nth-child(3),
.summary-mini-table--in-progress td:nth-child(3) { width: 12%; }
.summary-mini-table--in-progress th:nth-child(4),
.summary-mini-table--in-progress td:nth-child(4) { width: 12%; white-space: nowrap; }
.summary-mini-table--in-progress th:nth-child(5),
.summary-mini-table--in-progress td:nth-child(5) { width: 16%; }
.summary-mini-table--in-progress th:nth-child(6),
.summary-mini-table--in-progress td:nth-child(6) { width: 26%; }

/* Сводка — заказы на пошив: Модель, Размер, Цвет, Кол-во, Код пачки, Прогресс */
.summary-mini-table--sew th:nth-child(1),
.summary-mini-table--sew td:nth-child(1) { width: 20%; }
.summary-mini-table--sew th:nth-child(2),
.summary-mini-table--sew td:nth-child(2) { width: 14%; }
.summary-mini-table--sew th:nth-child(3),
.summary-mini-table--sew td:nth-child(3) { width: 12%; }
.summary-mini-table--sew th:nth-child(4),
.summary-mini-table--sew td:nth-child(4) { width: 12%; white-space: nowrap; }
.summary-mini-table--sew th:nth-child(5),
.summary-mini-table--sew td:nth-child(5) { width: 16%; }
.summary-mini-table--sew th:nth-child(6),
.summary-mini-table--sew td:nth-child(6) { width: 26%; }

.summary-mini-table--sew td:nth-child(1),
.summary-mini-table--sew td:nth-child(5) {
  word-break: break-word;
}

.summary-mini-table--done th:nth-child(1),
.summary-mini-table--done td:nth-child(1) { width: 16%; white-space: nowrap; }
.summary-mini-table--done th:nth-child(2),
.summary-mini-table--done td:nth-child(2) { width: 20%; }
.summary-mini-table--done th:nth-child(3),
.summary-mini-table--done td:nth-child(3) { width: 14%; }
.summary-mini-table--done th:nth-child(4),
.summary-mini-table--done td:nth-child(4) { width: 12%; }
.summary-mini-table--done th:nth-child(5),
.summary-mini-table--done td:nth-child(5) { width: 14%; white-space: nowrap; }
.summary-mini-table--done th:nth-child(6),
.summary-mini-table--done td:nth-child(6) { width: 24%; }

.summary-mini-table--in-progress td:nth-child(1),
.summary-mini-table--in-progress td:nth-child(5),
.summary-mini-table--done td:nth-child(2),
.summary-mini-table--done td:nth-child(6) {
  word-break: break-word;
}

.summary-mini-table--old-orders {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
}

.summary-mini-table--old-orders th,
.summary-mini-table--old-orders td {
  font-size: 10px;
  padding: 0.14rem 0.24rem;
}

.summary-mini-table--old-orders th:nth-child(1),
.summary-mini-table--old-orders td:nth-child(1) {
  width: 42%;
  word-break: break-word;
}

.summary-mini-table--old-orders th:nth-child(2),
.summary-mini-table--old-orders td:nth-child(2) {
  width: 58%;
  white-space: normal;
  word-break: break-word;
}

.summary-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.summary-orders-list {
  position: absolute;
  top: 2.2rem;
  left: 0.42rem;
  right: 0.42rem;
  bottom: 0.42rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #d8deea;
  border-radius: 10px;
  padding: 0.45rem;
  display: grid;
  align-content: start;
  gap: 0.25rem;
  overflow: auto;
  z-index: 2;
}

.summary-orders-list.u-hidden {
  display: none;
}

.summary-orders-item {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  font-size: 11px;
  color: #334155;
}

.summary-orders-grid {
  display: grid;
  gap: 0;
  font-size: 10px;
  color: #334155;
}

.summary-orders-grid--in-progress {
  grid-template-columns: 1.35fr 1fr 0.85fr 0.8fr 1.05fr 1fr;
}

.summary-orders-grid--done {
  grid-template-columns: 0.95fr 1.3fr 1fr 0.8fr 0.8fr 1.15fr;
}

.summary-orders-grid__head,
.summary-orders-grid__cell {
  padding: 0.12rem 0.22rem;
  border-bottom: 1px solid #edf1f7;
  word-break: break-word;
}

.summary-cell-two-lines {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.15;
  max-height: 2.3em;
  word-break: break-word;
}

.summary-orders-grid__head {
  font-weight: 700;
  color: #475569;
  position: sticky;
  top: 0;
  background: #f8fbff;
  z-index: 1;
}

.summary-orders-code {
  font-weight: 600;
  color: #1f2937;
  min-width: 160px;
}

.summary-orders-empty {
  font-size: 11px;
  color: #64748b;
}

.summary-orders-block {
  position: relative;
}

.summary-mid-tabs-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin-top: 0;
  height: 316px;
  min-height: 316px;
  max-height: 316px;
  overflow: hidden;
}

.summary-mid-tabs-card .summary-table-scroll {
  border: 1px solid var(--df-border);
  border-radius: 10px;
  border-top-left-radius: 0;
  background: var(--df-surface);
  overflow: hidden auto;
  max-height: none;
  height: 100%;
  position: relative;
  z-index: 0;
}

.summary-mid-tabs-card .summary-mini-table thead th {
  background: transparent;
  padding-top: 0.24rem;
  padding-bottom: 0.24rem;
  line-height: 1.2;
}

.summary-mid-tabs-card .summary-mini-table thead tr {
  background: var(--df-surface-soft);
}

.summary-mid-tabs-card .summary-mini-table thead th:first-child,
.summary-mid-tabs-card .summary-mini-table tbody td:first-child {
  padding-left: 0.7rem;
}

.summary-mid-tabs-card .summary-mini-table thead th:last-child,
.summary-mid-tabs-card .summary-mini-table tbody td:last-child {
  padding-right: 0.7rem;
}

.summary-mid-tabs-card .summary-mini-table thead th:last-child {
  padding-right: 0.26rem;
}


.summary-mid-tabs-card .summary-table-scroll::-webkit-scrollbar {
  width: 10px;
}

.summary-mid-tabs-card .summary-table-scroll::-webkit-scrollbar-track {
  background: transparent;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.summary-mid-tabs-card .summary-table-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
}

.summary-mid-tabs-card .summary-table-scroll::-webkit-scrollbar-corner {
  background: var(--df-surface-soft);
}

.summary-mid-tabs-head {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0;
  margin: 0 10px 0 0;
  position: relative;
  /* Выше верхней границы .summary-table-scroll — иначе border таблицы виден под активной вкладкой */
  z-index: 2;
}

.summary-mid-tabs-head::before {
  display: none;
}

.summary-mid-tabs-head .summary-mid-tabs {
  border-bottom: 0;
  display: grid;
  /* Первая — по длине «Заказы в работе»; три правые — по содержимому (узкие колонки). */
  grid-template-columns: auto repeat(3, max-content);
  width: fit-content;
  max-width: 100%;
  min-width: 0;
}

/* Сводка: неактивная — нижняя граница; активная — без (как «Название модели» / характеристики) */
.summary-mid-tabs-head .summary-mid-tab:not(.is-active) {
  border-bottom: 1px solid #d7dde8;
}

.summary-mid-tabs-head .summary-mid-tab.is-active {
  border-bottom: none;
}

.summary-mid-tabs-head .summary-mid-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  /* чуть больше воздуха справа от текста у всех четырёх вкладок */
  padding: 0.28rem 0.5rem 0.28rem 0.3rem;
}

.summary-mid-tabs-head .summary-mid-tab:first-child {
  min-width: min-content;
}

.summary-mid-tabs-head .summary-mid-tab:first-child .summary-mid-tab__label {
  overflow: visible;
  text-overflow: clip;
}

.summary-mid-tabs-head .summary-mid-tab__inner {
  gap: 0.22rem;
}

.summary-mid-tabs-head .summary-mid-tab:nth-child(n + 2) {
  min-width: min-content;
  padding: 0.28rem 0.5rem 0.28rem 0.22rem;
}

.summary-mid-tabs-head .summary-mid-tab:nth-child(n + 2) .summary-mid-tab__inner {
  gap: 0.18rem;
  min-width: min-content;
  max-width: none;
}

.summary-mid-tabs-head .summary-mid-tab:nth-child(n + 2) .summary-mid-tab__label {
  overflow: visible;
  text-overflow: clip;
}

.summary-mid-tabs-head .summary-mid-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--df-surface);
  pointer-events: none;
  z-index: 2;
}

.summary-mid-tab-panel {
  display: none;
  min-height: 0;
  height: 100%;
  position: relative;
  z-index: 0;
}

.summary-mid-tab-panel.is-active {
  display: grid;
  gap: 0.28rem;
  align-content: start;
}

.summary-mid-tab__inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  min-width: 0;
  max-width: 100%;
}

.summary-mid-tab__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.summary-mid-tab__icon {
  flex-shrink: 0;
  opacity: 0.88;
  color: inherit;
}

.summary-mid-tab.is-active .summary-mid-tab__icon {
  opacity: 1;
}

.summary-sew-panel {
  position: relative;
  display: block;
  min-height: 0;
  height: 100%;
}

.summary-sew-panel > .summary-table-scroll--sew {
  height: 100%;
  min-height: 0;
  background: var(--df-surface-soft);
}

.summary-mid-tabs-card .summary-mini-table tbody {
  background: #fff;
}

.summary-sew-head-progress {
  padding-right: 0.12rem;
}

.summary-sew-head-progress__inner {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
}

.summary-sew-panel__open {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin-left: auto;
  margin-right: 0;
  border-radius: 6px;
  color: #475569;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: none;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.summary-sew-panel__open:hover {
  color: #1d4ed8;
  background: #fff;
  border-color: #cbd5e1;
}

.summary-sew-panel__open-icon {
  display: block;
  width: 14px;
  height: 14px;
}

.summary-model-total-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 0.24rem;
  align-content: start;
}

#chartModelPlanFactTotal {
  margin-top: 0.38rem;
  height: 140px;
}

#summaryModelTotalKpi {
  margin-top: 0;
  margin-bottom: 0;
}

#summaryModelTotalInsight {
  margin-top: 0;
}

.page-summary .summary-grid--mid > .summary-model-total-card {
  overflow: visible;
  position: relative;
  z-index: 4;
}

.summary-model-total-controls {
  display: grid;
  grid-template-columns: minmax(170px, 220px) 1fr;
  gap: 0.5rem;
  align-items: start;
}

.summary-model-total-add {
  width: 100% !important;
  flex: none !important;
  position: relative;
  z-index: 5;
}

.summary-model-total-add.is-open {
  z-index: 30;
}

.summary-model-total-add .orders-dropdown__trigger {
  font-size: 11px;
}

.summary-model-total-search-trigger {
  padding-right: 1.4rem !important;
}

.summary-model-total-search-trigger::placeholder {
  color: #334155;
  opacity: 1;
}

.summary-model-total-add::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #7b8699;
  border-bottom: 1.5px solid #7b8699;
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.summary-model-total-add.is-open::after {
  transform: translateY(-50%) rotate(225deg);
}

.summary-model-total-add__menu {
  width: 320px !important;
  max-width: min(90vw, 320px);
  padding: 0.3rem !important;
  box-sizing: border-box;
  max-height: none !important;
  overflow: hidden !important;
  border-radius: 12px;
}

.summary-model-total-search {
  width: 100%;
  min-height: 26px !important;
  height: 26px !important;
  margin-bottom: 0;
}

.summary-model-total-search-list {
  display: grid;
  gap: 0.1rem;
  max-height: 156px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.1rem;
}

.summary-model-total-result {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: #fff;
  border-radius: 6px;
  text-align: left;
  font-size: 11px;
  color: #334155;
  min-height: 24px;
  padding: 0.1rem 0.38rem;
  cursor: pointer;
  line-height: 1.15;
}

.summary-model-total-result:hover {
  background: #f8fafc;
}

.summary-model-total-selected {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.26rem 0.34rem;
  max-height: 54px;
  overflow: auto;
  padding-right: 0.15rem;
}

.summary-model-total-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  font-size: 10px;
  color: #334155;
}

.summary-model-total-checkbox {
  width: 12px;
  height: 12px;
  margin: 0;
  flex: 0 0 auto;
}

.summary-model-total-chip__name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-model-total-remove-btn {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 0;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  line-height: 1;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.summary-model-total-remove-btn:hover {
  background: #fecaca;
  color: #991b1b;
}


.summary-orders-block .summary-card-head {
  margin-bottom: 0.35rem;
  position: relative;
  z-index: 3;
}

.summary-progress {
  display: grid;
  gap: 0.12rem;
}

.summary-progress__bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #edf2fb;
  border: 1px solid #d9e2f0;
  overflow: hidden;
}

.summary-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, #5a8cff, #2f6bff);
}

.summary-progress__text {
  font-size: 10px;
  color: #475569;
}

@media (max-width: 1024px) {
  .summary-grid--top,
  .summary-grid--bottom {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-grid--mid {
    grid-template-columns: 1fr;
  }
  .summary-grid--top > .block:nth-child(3),
  .summary-grid--bottom > .block:nth-child(2) {
    grid-column: 1 / -1;
  }
  .summary-model-total-controls {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .summary-model-total-selected {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 64px;
  }
}

@media (max-width: 760px) {
  .summary-model-total-selected {
    grid-template-columns: 1fr;
  }
  .summary-model-total-add__menu {
    width: 100% !important;
    max-width: 100%;
  }
}

/* Единый стиль breadcrumb-заголовков страниц */
body h1.section__title {
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif !important;
  font-size: 17px !important;
  font-weight: 600 !important;
  line-height: 1.25;
}

.page-grades h1.section__title {
  font-size: 14px !important;
  font-weight: 500 !important;
}

/* Дополнительный адаптивный слой для разных диагоналей */
@media (max-width: 1536px) {
  .page-orders .table-wrap,
  .page-finance .table-wrap,
  .page-grades .table-wrap,
  .page-otk-check .table-wrap,
  .page-characteristics-equipop .equipop-table-wrap {
    overflow-x: auto;
  }
}

@media (max-width: 1280px) {
  .page-otk-check .content {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .page-otk-check #otkCheckTable {
    min-width: 1080px;
  }
  .page-otk-check .table-wrap {
    overflow-x: auto;
  }
  .page-otk-check .table th,
  .page-otk-check .table td {
    font-size: 11px;
    padding: 0.28rem 0.3rem;
  }

  .page-otk-check-detail .otk-op-table th,
  .page-otk-check-detail .otk-op-table td {
    font-size: 11px;
    padding: 0.22rem 0.24rem;
  }
  .page-otk-check-detail .otk-op-table th:nth-child(1),
  .page-otk-check-detail .otk-op-table td:nth-child(1) { width: 4%; }
  .page-otk-check-detail .otk-op-table th:nth-child(2),
  .page-otk-check-detail .otk-op-table td:nth-child(2) { width: 15%; }
  .page-otk-check-detail .otk-op-table th:nth-child(3),
  .page-otk-check-detail .otk-op-table td:nth-child(3) { width: 15%; }
  .page-otk-check-detail .otk-op-table th:nth-child(4),
  .page-otk-check-detail .otk-op-table td:nth-child(4) { width: 14%; }
  .page-otk-check-detail .otk-op-table th:nth-child(5),
  .page-otk-check-detail .otk-op-table td:nth-child(5) { width: 11%; }
  .page-otk-check-detail .otk-op-table th:nth-child(6),
  .page-otk-check-detail .otk-op-table td:nth-child(6) { width: 11%; }
  .page-otk-check-detail .otk-op-table th:nth-child(7),
  .page-otk-check-detail .otk-op-table td:nth-child(7) { width: 14%; }
  .page-otk-check-detail .otk-op-table th:nth-child(8),
  .page-otk-check-detail .otk-op-table td:nth-child(8) { width: 15%; }
  .page-otk-check-detail .otk-op-table th:nth-child(9),
  .page-otk-check-detail .otk-op-table td:nth-child(9) { width: 4%; }
  .page-otk-check-detail .otk-op-defect,
  .page-otk-check-detail .otk-op-no-fix-qty {
    width: 6.5ch !important;
    min-width: 6ch !important;
    max-width: 7.5ch !important;
  }
  .page-otk-check-detail .otk-detail-bottom {
    grid-template-columns: minmax(0, 0.56fr) minmax(0, 1.46fr) minmax(0, 0.8fr) minmax(0, 1.18fr);
  }
  .page-otk-check-detail .otk-unknown-recoverable-row {
    display: grid;
    grid-template-columns: auto minmax(7ch, 9ch) auto;
    align-items: center;
    column-gap: 0.28rem;
    row-gap: 0.18rem;
  }
  .page-otk-check-detail .otk-unknown-assignee-slot {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
  .page-otk-check-detail .otk-unknown-assignee-slot .order-status-dropdown {
    width: 100%;
  }
  .page-otk-check-detail .otk-detail-actions {
    grid-template-columns: 1fr;
  }
  .page-otk-check-detail .otk-actions-row--start,
  .page-otk-check-detail .otk-actions-row--complete {
    display: flex !important;
    flex-direction: row !important;
  }
  .page-otk-check-detail .otk-actions-row--pause {
    display: flex !important;
    flex-direction: row !important;
  }
  .page-otk-check-detail .otk-action-timer--pause-col {
    margin-left: 0;
  }
  .page-otk-check-detail .otk-top-note {
    white-space: normal;
    line-height: 1.2;
  }

  .page-analytics .analytics-filters-row,
  .page-analytics .analytics-period-row,
  .page-finance .finance-head-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 980px) {
  .page-otk-check .content,
  .page-otk-check-detail .content {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }
  .page-otk-check #otkCheckTable {
    min-width: 980px;
  }
  .page-otk-check .section__title {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
  }
  .page-otk-check .table th,
  .page-otk-check .table td {
    font-size: 10.5px;
  }
  .page-otk-check-detail .otk-op-table th,
  .page-otk-check-detail .otk-op-table td {
    font-size: 11px;
    padding: 0.18rem 0.2rem;
  }
  .page-otk-check-detail .otk-detail-actions {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .page-otk-check-detail .otk-actions-row--start,
  .page-otk-check-detail .otk-actions-row--complete {
    display: flex !important;
    flex-direction: row !important;
  }
  .page-otk-check-detail .otk-actions-row--pause {
    display: flex !important;
    flex-direction: row !important;
  }
  .page-otk-check-detail .otk-action-timer--pause-col {
    margin-left: 0;
  }
  .page-otk-check-detail .otk-top-note {
    min-height: 0;
  }
  .page-otk-check-detail .otk-detail-bottom-actions {
    flex-wrap: wrap;
  }
  .page-otk-check-detail .otk-detail-bottom--topline {
    grid-template-columns: minmax(0, 0.58fr) minmax(0, 1.38fr) minmax(0, 0.82fr) minmax(0, 1.22fr);
    gap: 0.42rem;
  }
  .page-otk-check-detail .otk-action-timers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0;
  }
}

@media (max-width: 760px) {
  .page-otk-check .content,
  .page-otk-check-detail .content {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }
  .page-otk-check #otkCheckTable {
    min-width: 920px;
  }
  .page-otk-check .table th,
  .page-otk-check .table td {
    padding: 0.24rem 0.26rem;
    font-size: 10px;
  }
  .page-otk-check-detail .otk-detail-meta-row {
    gap: 0.28rem;
  }
  .page-otk-check-detail .otk-detail-unknown-col {
    text-align: left;
  }
  .page-otk-check-detail .otk-detail-print-col .otk-detail-bottom-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.28rem;
  }
  .page-otk-check-detail .otk-select-all-defects-btn {
    min-width: 0;
  }
  .page-otk-check-detail .otk-actions-columns {
    grid-template-columns: 1fr;
  }
  .page-otk-check-detail .otk-transfer-switch {
    width: 100%;
  }
  .page-otk-check-detail .otk-transfer-switch label {
    min-height: 21px;
    font-size: 0.72rem;
    padding: 0 0.14rem;
  }
  .page-otk-check-detail .otk-action-timers {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    margin-bottom: 0;
  }
  .page-otk-check-detail .content {
    padding-bottom: calc(9.4rem + env(safe-area-inset-bottom));
  }
}

@media (max-width: 1100px) {
  .page-orders .blocks-row.u-mt-1,
  .page-add-model .blocks-row,
  .page-grades .grades-add-row,
  .page-grades .grades-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .page-add-model .add-row {
    flex-wrap: wrap;
  }
}

/* Поверх правила выше: форма «Заказ на пошив» не в один столбец (grid 1fr при ≤1100px
   давала вертикальный стек при масштабе ~150%). Узкие телефоны — отдельно ниже. */
@media (max-width: 1100px) {
  .page-orders .section:first-of-type .blocks-row.u-mt-1 {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
  }

  .page-orders .section:first-of-type .blocks-row.u-mt-1 > .block {
    min-width: 0;
    flex: 1 1 0;
  }
}

@media (max-width: 560px) {
  .page-orders .section:first-of-type .blocks-row.u-mt-1 {
    flex-wrap: wrap;
  }

  .page-orders .section:first-of-type .blocks-row.u-mt-1 > .block {
    flex: 1 1 calc(50% - 0.28rem);
    min-width: calc(50% - 0.28rem);
  }
}

/* Диаграмма Ганта */
.page-gantt .gantt-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  align-items: end;
  gap: 0.45rem 0.55rem;
}

.page-gantt .gantt-filter {
  display: grid;
  gap: 0.14rem;
  font-size: 12px;
  color: #334155;
  min-width: 170px;
}

.page-gantt .gantt-filter--search {
  min-width: 0;
}

.page-gantt .gantt-toolbar__actions {
  display: inline-flex;
  gap: 0.35rem;
  grid-column: 1 / -1;
  justify-self: end;
}

.page-gantt #ganttSearchInput {
  min-height: 38px;
  height: 38px;
  max-height: 38px;
  width: 100%;
}

.page-gantt .gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.2rem;
}

.page-gantt .orders-status-tabs.gantt-status-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.16rem;
  margin: 0 0 -1px 0.5cm;
  border-bottom: 1px solid #d7dde8;
  padding-left: 0.05rem;
  position: relative;
  z-index: 3;
}

.page-gantt .orders-status-tab {
  border: 1px solid #d7dde8;
  border-bottom: none;
  background: #f3f6fb;
  color: #475569;
  border-radius: 6px 6px 0 0;
  min-height: 29px;
  padding: 0.28rem 0.78rem;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.15;
  cursor: pointer;
  margin-bottom: -1px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.page-gantt .orders-status-tab:hover {
  background: #eaf0fa;
  color: #334155;
}

.page-gantt .orders-status-tab.is-active {
  background: #fff;
  color: #1d4ed8;
  border-color: #d7dde8;
  border-bottom: 1px solid #fff;
  font-weight: 600;
}

.page-gantt .gantt-status-tabs + .block {
  border-top-left-radius: 12px;
}

.page-gantt .gantt-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 11px;
  color: #334155;
  background: #f6f8fb;
  border: 1px solid #d8e0eb;
  border-radius: 999px;
  padding: 0.14rem 0.42rem;
}

.page-gantt .gantt-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.page-gantt .gantt-color--working { background: #16a34a; }
.page-gantt .gantt-color--paused { background: #f59e0b; }
.page-gantt .gantt-color--assigned { background: #94a3b8; }
.page-gantt .gantt-color--partial { background: #2563eb; }
.page-gantt .gantt-color--done { background: #475569; }
.page-gantt .gantt-color--otk { background: #8b5cf6; }
.page-gantt .gantt-color--risk { background: #dc2626; }

.page-gantt .gantt-error {
  color: #b91c1c;
}

.page-gantt .gantt-empty {
  padding: 0.7rem;
  border: 1px dashed #cfd8e3;
  border-radius: 8px;
  background: #f9fbfd;
  color: #475569;
  font-size: 12px;
}

.page-gantt .gantt-empty-inline {
  margin: 0.35rem;
  padding: 0.55rem 0.65rem;
  border: 1px dashed #cfd8e3;
  border-radius: 8px;
  background: #f9fbfd;
  color: #475569;
  font-size: 12px;
  max-width: calc(100% - 0.7rem);
  white-space: normal;
  overflow-wrap: anywhere;
}

.page-gantt .gantt-board {
  margin-top: 0.2rem;
  min-width: 0;
}


.page-gantt .gantt-scroll {
  overflow: visible;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #fff;
}

.page-gantt .gantt-grid {
  display: grid;
  grid-template-columns: var(--gantt-left-pane-width) minmax(0, 1fr);
  overflow: visible;
}

.page-gantt {
  --gantt-col-model: 120px;
  --gantt-col-batch: 90px;
  --gantt-col-performer: 95px;
  --gantt-col-status: 135px;
  --gantt-head-bg: #f6f7fb;
  --gantt-tick-color: #e5ebf2;
  --gantt-now-line-color: #ef4444;
  --gantt-left-pane-width: calc(
    var(--gantt-col-model)
    + var(--gantt-col-batch)
    + var(--gantt-col-performer)
    + var(--gantt-col-status)
  );
}

.page-gantt .gantt-left-head,
.page-gantt .gantt-right-head {
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--gantt-head-bg);
  border-bottom: 1px solid #d8e0eb;
  min-height: 32px;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #334155;
}

.page-gantt .gantt-time {
  position: relative;
  min-height: 32px;
}

.page-gantt .gantt-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--gantt-tick-color);
}

.page-gantt .gantt-tick span {
  position: absolute;
  top: 8px;
  left: 1px;
  font-size: 10px;
  color: #5f7088;
  white-space: nowrap;
}

.page-gantt .gantt-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gantt-now-line-color);
  opacity: 0.5;
}

.page-gantt .gantt-row {
  display: contents;
}

.page-gantt .gantt-row.is-hidden {
  display: none;
}

.page-gantt .gantt-left-head {
  display: grid;
  grid-template-columns:
    var(--gantt-col-model)
    var(--gantt-col-batch)
    var(--gantt-col-performer)
    var(--gantt-col-status);
  border-right: 1px solid #d8e0eb;
}

.page-gantt .gantt-col-head {
  padding: 0.26rem 0.32rem;
  border-right: 1px solid #e7edf4;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-width: 0;
  box-sizing: border-box;
}

.page-gantt .gantt-col-head__title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #1f2a44;
}

.page-gantt .gantt-head-dropdown {
  position: relative;
  min-width: 0;
}

.page-gantt .gantt-head-dropdown .orders-dropdown__trigger {
  width: 100%;
  min-height: 25px;
  height: 25px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.2rem;
  padding: 0.15rem 1.35rem 0.15rem 0.34rem;
  position: relative;
  text-align: left;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-gantt .gantt-head-dropdown .orders-dropdown__trigger::after {
  content: '';
  position: absolute;
  right: 0.43rem;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #6b7c95;
  border-bottom: 1.5px solid #6b7c95;
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

.page-gantt .gantt-head-dropdown.is-open .orders-dropdown__trigger {
  border-color: #9fc0ff;
  box-shadow: 0 0 0 3px rgba(1, 104, 250, 0.12);
}

.page-gantt .gantt-head-dropdown.is-open .orders-dropdown__trigger::after {
  transform: translateY(-40%) rotate(-135deg);
}

.page-gantt .gantt-head-dropdown .orders-dropdown__trigger-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-size: 11px;
  padding: 0;
  min-width: 0;
}

.page-gantt .gantt-head-dropdown .orders-dropdown__trigger-text {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-gantt .gantt-head-dropdown .orders-dropdown__trigger-input::placeholder {
  color: #94a3b8;
}

.page-gantt .gantt-head-dropdown .orders-dropdown__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 50;
  background: #fff;
  border: 1px solid #d8deea;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
}

.page-gantt .gantt-head-dropdown.is-open .orders-dropdown__menu {
  display: block;
}

.page-gantt .gantt-head-dropdown .orders-dropdown__options {
  display: grid;
}

.page-gantt .gantt-head-dropdown .orders-dropdown__option {
  border: 0;
  border-top: 1px solid #eef2f7;
  background: #fff;
  color: #334155;
  text-align: left;
  padding: 0.28rem 0.38rem;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
}

.page-gantt .gantt-head-dropdown .orders-dropdown__option:first-child {
  border-top: 0;
}

.page-gantt .gantt-head-dropdown .orders-dropdown__option:hover,
.page-gantt .gantt-head-dropdown .orders-dropdown__option.is-active {
  background: #eef4ff;
  color: #1d4ed8;
}

.page-gantt .gantt-col {
  padding: 0.38rem 0.45rem;
  border-right: 1px solid #e7edf4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-gantt .gantt-col:last-child,
.page-gantt .gantt-col-head:last-child {
  border-right: none;
}

.page-gantt .gantt-right-head {
  overflow: hidden;
}

.page-gantt .gantt-left-row {
  min-height: 30px;
  display: grid;
  grid-template-columns:
    var(--gantt-col-model)
    var(--gantt-col-batch)
    var(--gantt-col-performer)
    var(--gantt-col-status);
  border-right: 1px solid #e1e8f1;
  border-bottom: 1px solid #edf2f7;
  font-size: 11px;
}

.page-gantt .gantt-right-row {
  border-bottom: 1px solid #edf2f7;
}

.page-gantt .gantt-track {
  position: relative;
  min-height: 30px;
}

.page-gantt .gantt-indent--1 .gantt-col--model { padding-left: 0.85rem; }
.page-gantt .gantt-indent--2 .gantt-col--model { padding-left: 1.65rem; }

.page-gantt .gantt-toggle,
.page-gantt .gantt-toggle-spacer {
  width: 16px;
  min-width: 16px;
  height: 16px;
}

.page-gantt .gantt-toggle {
  border: none;
  background: transparent;
  color: #1f2a44;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  margin-right: 0.16rem;
  padding: 0;
}

.page-gantt .gantt-toggle:hover {
  background: #ecf1f8;
}

.page-gantt .gantt-bar {
  position: absolute;
  top: 7px;
  height: 14px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  opacity: 0.92;
  overflow: hidden;
}

.page-gantt .gantt-bar:hover {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.06);
}

.page-gantt .gantt-bar.is-selected {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}

.page-gantt .gantt-bar__progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.2);
  pointer-events: none;
}

.page-gantt .gantt-bar--summary { background: #9aa8bf; }
.page-gantt .gantt-bar--working { background: #16a34a; }
.page-gantt .gantt-bar--paused { background: #f59e0b; }
.page-gantt .gantt-bar--assigned { background: #94a3b8; }
.page-gantt .gantt-bar--partial { background: #2563eb; }
.page-gantt .gantt-bar--done { background: #14b8a6; }
.page-gantt .gantt-bar--otk { background: #8b5cf6; }
.page-gantt .gantt-bar--risk { background: #dc2626; }

.page-gantt .gantt-status {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border-radius: 999px;
  padding: 0.1rem 0.42rem;
  font-size: 10px;
  border: 1px solid transparent;
  background: #f8fafc;
  white-space: nowrap;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.page-gantt .gantt-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.page-gantt .gantt-status__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-gantt .gantt-status--working { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.page-gantt .gantt-status--paused { color: #b45309; border-color: #fde68a; background: #fff7ed; }
.page-gantt .gantt-status--assigned { color: #475569; border-color: #cbd5e1; background: #f8fafc; }
.page-gantt .gantt-status--partial { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.page-gantt .gantt-status--done { color: #0f766e; border-color: #99f6e4; background: #f0fdfa; }
.page-gantt .gantt-status--otk { color: #6d28d9; border-color: #ddd6fe; background: #f5f3ff; }
.page-gantt .gantt-status--group { color: #334155; border-color: #cbd5e1; background: #f8fafc; }

@media (max-width: 1480px) {
  .page-gantt .gantt-toolbar {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
  .page-gantt .gantt-toolbar__actions {
    justify-self: start;
  }
}

/* Final OTK layout overrides (desktop): force-apply tight timers and aligned action row */
@media (min-width: 761px) {
  .page-otk-check-detail .otk-detail-actions .otk-actions-columns { margin-top: 0 !important; }
  .page-otk-check-detail .otk-detail-actions .otk-transfer-switch-wrap {
    transform: translateY(0) !important;
    margin-bottom: 0.06rem !important;
  }
  .page-otk-check-detail .otk-detail-actions,
  .page-otk-check-detail .otk-detail-actions * {
    font-family: inherit !important;
  }
}

/* Final typography unification for defect summary block */
.page-otk-check-detail .otk-detail-unknown-col,
.page-otk-check-detail .otk-detail-unknown-col .block__sub,
.page-otk-check-detail .otk-detail-qty-col .block__sub,
.page-otk-check-detail .otk-detail-shipment-col,
.page-otk-check-detail .otk-detail-shipment-col .block__sub,
.page-otk-check-detail .otk-detail-print-col .block__sub,
.page-otk-check-detail .otk-defect-aggregates,
.page-otk-check-detail .otk-defect-aggregates div,
.page-otk-check-detail .otk-defect-aggregates strong,
.page-otk-check-detail .otk-defect-aggregates span,
.page-otk-check-detail .otk-detail-bottom--topline .otk-shipment-head-row,
.page-otk-check-detail .otk-detail-bottom--topline .otk-shipment-head-row span {
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif !important;
  font-size: 0.72rem !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  color: #1f2937 !important;
  font-weight: 400 !important;
}

.page-otk-check-detail .otk-detail-bottom--topline .btn {
  font-weight: 400;
}

.page-otk-check-detail .otk-detail-bottom--topline #otkActualQty {
  font-weight: 400 !important;
}

.page-otk-check-detail .otk-defect-aggregates,
.page-otk-check-detail .otk-defect-aggregates div {
  font-weight: 400 !important;
}

.page-otk-check-detail .otk-defect-aggregates strong {
  font-weight: 400 !important;
}

.page-otk-check-detail .otk-detail-shipment-col strong,
.page-otk-check-detail .otk-shipment-head-row strong {
  font-weight: 400 !important;
}

/* OTK action bar: fixed bottom + strict one-line button alignment */
.page-otk-check-detail .otk-detail-actions {
  position: fixed !important;
  left: 260px !important;
  right: 10px !important;
  bottom: 8px !important;
  z-index: 1200 !important;
}

.page-otk-check-detail .otk-actions-columns {
  align-items: end !important;
}

.page-otk-check-detail .otk-actions-col {
  display: grid !important;
  grid-template-rows: auto auto auto;
  row-gap: 0.06rem !important;
}

.page-otk-check-detail .otk-actions-col--start .otk-inline-timer,
.page-otk-check-detail .otk-actions-col--pause .otk-inline-timer,
.page-otk-check-detail .otk-actions-col--complete .otk-transfer-switch-wrap {
  grid-row: 1;
}

.page-otk-check-detail .otk-actions-col--start .otk-inline-timer,
.page-otk-check-detail .otk-actions-col--pause .otk-inline-timer {
  margin-bottom: 0.14rem !important;
}

.page-otk-check-detail .otk-actions-col--start #otkStartFlowBtn,
.page-otk-check-detail .otk-actions-col--pause #otkPauseBtn,
.page-otk-check-detail .otk-actions-col--complete #otkCompleteFlowBtn {
  grid-row: 2;
}

.page-otk-check-detail .otk-actions-col--complete #otkCompleteResult {
  grid-row: 3;
  margin-top: 0 !important;
}

.page-otk-check-detail .content {
  padding-bottom: calc(8.6rem + env(safe-area-inset-bottom)) !important;
}

@media (max-width: 1400px) {
  .page-otk-check-detail .otk-detail-actions { left: 236px !important; }
}
@media (max-width: 1200px) {
  .page-otk-check-detail .otk-detail-actions { left: 214px !important; }
}
@media (max-width: 1024px) {
  .page-otk-check-detail .otk-detail-actions { left: 194px !important; }
}
@media (max-width: 900px) {
  .page-otk-check-detail .otk-detail-actions { left: 176px !important; }
}
@media (max-width: 768px) {
  .page-otk-check-detail .otk-detail-actions {
    left: 8px !important;
    right: 8px !important;
    bottom: 6px !important;
  }
  .page-otk-check-detail .otk-actions-columns {
    grid-template-columns: 1fr !important;
  }
  .page-otk-check-detail .content {
    padding-bottom: calc(13rem + env(safe-area-inset-bottom)) !important;
  }
}

/* Склад */
.page-warehouse .content {
  padding-top: 0.9rem;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}

.page-warehouse .section {
  margin-bottom: 0.9rem;
}

.page-warehouse .block {
  padding: 1.05rem;
}

.page-warehouse .table-wrap {
  overflow-x: auto;
}

.page-warehouse #warehouseTable {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.page-warehouse .table th,
.page-warehouse .table td {
  box-sizing: border-box;
  padding: 0.28rem 0.34rem;
  font-size: 0.72rem;
  line-height: 1.15;
  vertical-align: middle;
  font-family: inherit !important;
}

.page-warehouse .table thead th {
  font-size: 0.7rem;
  line-height: 1.15;
}

.page-warehouse .warehouse-model-name {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none !important;
  -webkit-text-decoration: none !important;
  position: relative;
  z-index: 1;
  line-height: 1.35;
}

.page-warehouse .warehouse-batch-code {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none !important;
  -webkit-text-decoration: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  background-image: none !important;
  position: relative;
  z-index: 1;
  line-height: 1.35;
}

/* Чтобы границы строк не выглядели как "прочерки" под текстом. */
.page-warehouse #warehouseTable td.warehouse-cell-model,
.page-warehouse #warehouseTable td.warehouse-cell-batch {
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
}

/* Жестко выключаем любые зачёркивания/подчеркивания в колонке кода пачки. */
.page-warehouse #warehouseTable td.warehouse-cell-batch,
.page-warehouse #warehouseTable td.warehouse-cell-batch *,
.page-warehouse #warehouseTable td.warehouse-cell-batch .warehouse-batch-code {
  text-decoration: none !important;
  text-decoration-line: none !important;
  -webkit-text-decoration-line: none !important;
  text-shadow: none !important;
  font-variant-ligatures: none;
}

.page-warehouse #warehouseThBatch {
  white-space: nowrap;
}

/* Явно держим колонку модели видимой (после скрытого столбца даты). */
.page-warehouse #warehouseTable thead th:nth-child(2),
.page-warehouse #warehouseTable tbody td:nth-child(2),
.page-warehouse #warehouseTable .warehouse-cell-model {
  display: table-cell !important;
}

.page-warehouse .warehouse-col-model { width: 16%; }
.page-warehouse .warehouse-col-color { width: 10%; }
.page-warehouse .warehouse-col-size { width: 8%; }
.page-warehouse .warehouse-col-balance { width: 9%; }
.page-warehouse .warehouse-col-total { width: 7%; }
.page-warehouse .warehouse-col-shipped { width: 9%; }
.page-warehouse .warehouse-col-available { width: 8%; }
.page-warehouse .warehouse-col-qty { width: 11%; }
.page-warehouse .warehouse-col-action { width: 10%; }
.page-warehouse .warehouse-col-batch { width: 21%; }
.page-warehouse .warehouse-col-date { width: 14%; }

/* Раскладка колонок во вкладке "Склад": занимаем всю ширину таблицы */
.page-warehouse #warehouseTable.is-warehouse .warehouse-col-date { width: 12%; }
.page-warehouse #warehouseTable.is-warehouse .warehouse-col-model { width: 16%; }
.page-warehouse #warehouseTable.is-warehouse .warehouse-col-color { width: 11%; }
.page-warehouse #warehouseTable.is-warehouse .warehouse-col-size { width: 8%; }
.page-warehouse #warehouseTable.is-warehouse .warehouse-col-balance { width: 10%; }
.page-warehouse #warehouseTable.is-warehouse .warehouse-col-qty { width: 11%; }
.page-warehouse #warehouseTable.is-warehouse .warehouse-col-action { width: 11%; }
.page-warehouse #warehouseTable.is-warehouse .warehouse-col-batch { width: 21%; }

.page-warehouse #warehouseTable.is-warehouse th.warehouse-head-date,
.page-warehouse #warehouseTable.is-warehouse td.warehouse-cell-date {
  white-space: nowrap;
}

/* Раскладка колонок во вкладке "Отгружено": без пустых служебных колонок */
.page-warehouse #warehouseTable.is-shipped .warehouse-col-date { width: 14%; }
.page-warehouse #warehouseTable.is-shipped .warehouse-col-model { width: 21%; }
.page-warehouse #warehouseTable.is-shipped .warehouse-col-color { width: 14%; }
.page-warehouse #warehouseTable.is-shipped .warehouse-col-size { width: 9%; }
.page-warehouse #warehouseTable.is-shipped .warehouse-col-balance { width: 9%; }
.page-warehouse #warehouseTable.is-shipped .warehouse-col-qty { width: 0%; }
.page-warehouse #warehouseTable.is-shipped .warehouse-col-action { width: 0%; }
.page-warehouse #warehouseTable.is-shipped .warehouse-col-batch { width: 33%; }

.page-warehouse .warehouse-filter-row th {
  padding-top: 0.16rem;
  padding-bottom: 0.2rem;
}

.page-warehouse .warehouse-filter-row th input {
  width: 100%;
  min-height: 1.5rem;
  font-size: 0.72rem;
  padding: 0.12rem 0.26rem;
}

.page-warehouse .warehouse-head-label {
  display: block;
  margin-bottom: 0.14rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.page-warehouse .warehouse-qty-input {
  width: 100%;
  min-height: 1.5rem;
  font-size: 0.72rem;
  padding: 0.12rem 0.26rem;
}

.page-warehouse .warehouse-filter-row th input,
.page-warehouse .warehouse-qty-input {
  border-radius: var(--app-ui-radius);
}

.page-warehouse .warehouse-add-btn {
  width: 100%;
  min-height: 1.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.12rem 0.32rem;
  line-height: 1.15;
  border-radius: var(--app-ui-radius);
}

.page-warehouse .pagination-inline {
  margin-top: 0.6rem;
}

.warehouse-widget {
  /* Единая высота поля количества и квадратной кнопки «×» в таблице виджета */
  --warehouse-widget-control-h: 1.5rem;
  position: fixed;
  width: 350px;
  min-width: 280px;
  min-height: 220px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow: hidden;
  resize: both;
  border: 1px solid #cfd8e7;
  border-radius: var(--app-ui-radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  z-index: 1300;
  display: flex;
  flex-direction: column;
}

.warehouse-widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.32rem 0.46rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
  cursor: move;
  user-select: none;
  background: #f8fafc;
}

.warehouse-widget__toggle {
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  border: 1px solid #c9d4e8;
  border-radius: var(--app-ui-radius);
  background: #fff;
  color: #1e3a8a;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.warehouse-widget__toggle:hover {
  background: #f1f5ff;
}

.warehouse-widget--collapsed {
  min-height: 0;
  height: auto !important;
  resize: none;
}

.warehouse-widget--collapsed .warehouse-widget__head {
  border-bottom: none;
}

.warehouse-widget--collapsed .warehouse-widget__body,
.warehouse-widget--collapsed .warehouse-widget__footer {
  display: none;
}

.warehouse-widget__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.32rem 0.4rem;
}

.warehouse-widget__empty {
  color: #64748b;
  font-size: 0.72rem;
}

.warehouse-widget-table th,
.warehouse-widget-table td {
  font-size: 0.72rem;
  padding: 0.2rem 0.26rem;
  line-height: 1.15;
  font-family: inherit !important;
  vertical-align: middle;
}

.warehouse-widget-table .warehouse-widget-qty {
  width: 100%;
  box-sizing: border-box;
  min-height: var(--warehouse-widget-control-h);
  font-size: 0.72rem;
  padding: 0.1rem 0.24rem;
  border-radius: var(--app-ui-radius);
}

.warehouse-widget-table .warehouse-widget-remove {
  box-sizing: border-box;
  width: var(--warehouse-widget-control-h);
  height: var(--warehouse-widget-control-h);
  min-width: var(--warehouse-widget-control-h);
  min-height: var(--warehouse-widget-control-h);
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--app-ui-radius);
  flex-shrink: 0;
}

.warehouse-widget__footer {
  border-top: 1px solid #e5e7eb;
  padding: 0.32rem 0.4rem;
  display: grid;
  gap: 0.26rem;
  margin-top: auto;
  flex: 0 0 auto;
}

.warehouse-widget__footer .btn {
  width: 100%;
  min-height: 1.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.15;
  padding: 0.12rem 0.32rem;
  border-radius: var(--app-ui-radius);
}

@media (max-width: 980px) {
  .page-warehouse .warehouse-col-model { width: 18%; }
  .page-warehouse .warehouse-col-batch { width: 16%; }
  .warehouse-widget {
    width: 310px;
  }
}

@media (max-width: 760px) {
  .warehouse-widget {
    width: calc(100vw - 16px);
  }
  .page-warehouse .table-wrap {
    overflow-x: auto;
  }
  .page-warehouse #warehouseTable {
    min-width: 960px;
  }
}

@media (max-width: 1280px) {
  .page-warehouse #warehouseTable {
    min-width: 960px;
  }
  .page-otk-check #otkCheckTable {
    min-width: 1020px;
  }
  .page-otk-packaging #otkPackagingTable {
    min-width: 980px;
  }
  .page-otk-packaging .content {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

@media (max-width: 980px) {
  .page-warehouse .content {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }
  .page-warehouse .block {
    padding: 0.86rem;
  }
  .page-warehouse #warehouseTable {
    min-width: 920px;
  }
  .page-otk-packaging #otkPackagingTable {
    min-width: 920px;
  }
  .page-otk-packaging .table th,
  .page-otk-packaging .table td {
    font-size: 10.5px;
    padding: 0.26rem 0.3rem;
  }
}

@media (max-width: 760px) {
  .page-warehouse .content {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }
  .page-warehouse .block {
    padding: 0.72rem;
  }
  .page-warehouse #warehouseTable {
    min-width: 860px;
  }
  .page-otk-packaging .content {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }
  .page-otk-packaging #otkPackagingTable {
    min-width: 860px;
  }
  .page-otk-packaging .table th,
  .page-otk-packaging .table td {
    font-size: 10px;
    padding: 0.24rem 0.26rem;
  }
}

/* Восстановление карточки модели после точечных правок */
@media (min-width: 1121px) and (max-width: 1360px) {
  .page-model-detail .model-detail-meta-grid {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 460px);
  }
  .page-model-detail .model-detail-side-fields {
    margin-top: auto;
  }
}

@media (min-width: 1361px) {
  .page-model-detail .model-detail-meta-grid {
    grid-template-columns: minmax(0, 1fr) minmax(430px, 520px);
  }
  .page-model-detail .model-detail-side-fields {
    margin-top: auto;
  }
}

@media (min-width: 1121px) {
  /* Одна строка сетки: суммы (слой снизу) + фото/описание сверху слева; справа только низ — ОТК, без перекрытия метрик */
  .page-model-detail .model-detail-meta-grid {
    grid-template-rows: auto;
  }

  .page-model-detail .model-detail-meta-grid > .model-detail-model-totals-row {
    grid-column: 1 / -1;
    grid-row: 1;
    z-index: 0;
    align-self: start;
    pointer-events: none;
  }

  .page-model-detail .model-detail-meta-grid > .model-detail-model-totals-row .model-detail-metrics--model {
    pointer-events: auto;
  }

  .page-model-detail .model-detail-meta-grid > .model-detail-meta-photos-desc {
    grid-column: 1;
    grid-row: 1;
    z-index: 1;
    position: relative;
    align-self: start;
  }

  .page-model-detail .model-detail-meta-grid > .model-detail-summary {
    grid-column: 2;
    grid-row: 1;
    z-index: 2;
    align-self: end;
    height: auto;
    min-height: 0;
  }

  .page-model-detail .model-detail-summary {
    height: auto;
  }
}

/* Адаптив: "Добавить модель" и "Детали модели" на средних/малых экранах */
@media (max-width: 1360px) {
  .page-add-model .content,
  .page-model-detail .content {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .page-add-model .block {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }

  /* Строка "Операции": уходим от фиксированных min-width, чтобы не ломать сетку */
  .page-add-model .add-model-top-block .add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
  }

  .page-add-model .add-model-top-block .add-row .u-minw-220,
  .page-add-model .add-model-top-block .add-row .u-minw-320 {
    min-width: 0 !important;
  }

  .page-add-model .add-model-top-block .add-row > * {
    min-width: 0;
  }

  .page-add-model .add-model-top-block .add-row .dropdown-search {
    grid-column: 1 / -1;
  }

  .page-add-model #opDescription {
    grid-column: 1 / span 2;
    min-width: 0 !important;
  }

  .page-add-model #opTimeSeconds {
    grid-column: 3;
    width: 100%;
    min-width: 108px;
  }

  .page-add-model .add-model-video-btn {
    grid-column: 1;
    justify-self: start;
  }

  .page-add-model #opVideoStatus {
    grid-column: 2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-add-model .add-model-add-btn {
    grid-column: 3;
    justify-self: end;
    margin-left: 0;
  }

  /* Таблица операций: даем аккуратный горизонтальный скролл вместо "развала" */
  .page-add-model .add-model-draft-table-wrap {
    overflow-x: auto;
  }

  .page-add-model #draftTable {
    min-width: 820px;
  }

  /* Метаданные модели (детали / добавление): в одну колонку на "узком десктопе" */
  :is(.page-model-detail, .page-add-model) .model-detail-meta-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto;
    gap: 0.55rem;
  }

  :is(.page-model-detail, .page-add-model) .model-detail-meta-grid > .model-detail-model-totals-row,
  :is(.page-model-detail, .page-add-model) .model-detail-meta-grid > .model-detail-meta-photos-desc,
  :is(.page-model-detail, .page-add-model) .model-detail-meta-grid > .model-detail-summary {
    grid-column: auto;
    grid-row: auto;
    position: static;
    z-index: auto;
    align-self: stretch;
    pointer-events: auto;
  }

  .page-add-model .blocks-row {
    flex-wrap: wrap;
  }

  .page-add-model .blocks-row > .block {
    flex: 1 1 320px;
    min-width: 260px;
  }

  :is(.page-model-detail, .page-add-model) .model-detail-side-fields {
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    padding-right: 0;
  }

  .page-model-detail .model-detail-side-times-row {
    justify-content: flex-start;
    column-gap: 0.45rem;
    row-gap: 0.35rem;
  }

  .page-add-model .model-detail-side-row--checkbox {
    margin-right: 0;
  }
}

@media (max-width: 980px) {
  .page-add-model .add-model-top-block .add-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .page-add-model #opDescription {
    grid-column: 1 / -1;
  }

  .page-add-model #opTimeSeconds,
  .page-add-model .add-model-video-btn,
  .page-add-model #opVideoStatus,
  .page-add-model .add-model-add-btn {
    grid-column: auto;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .page-add-model .block,
  .page-model-detail .block {
    padding-left: 0.62rem;
    padding-right: 0.62rem;
  }

  .page-add-model .add-model-top-block .add-row {
    grid-template-columns: 1fr;
  }

  .page-add-model #opDescription,
  .page-add-model #opTimeSeconds,
  .page-add-model .add-model-video-btn,
  .page-add-model #opVideoStatus,
  .page-add-model .add-model-add-btn {
    grid-column: 1;
    width: 100%;
  }

  .page-add-model .floating-save-btn,
  .page-model-detail .model-detail-save-btn {
    left: 12px;
    right: 12px;
    min-width: 0;
  }
}

/* ============================================================
   Floating worker menu (order-detail: add worker)
   ============================================================ */

.od-worker-menu {
  position: fixed;
  z-index: 1200;
  background: #fff;
  border: 1px solid #d8deea;
  border-radius: var(--app-ui-radius-dropdown);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  padding: 0.2rem;
  max-height: 280px;
  overflow: hidden;
}

.od-worker-menu__search {
  padding: 0.2rem 0.2rem 0.1rem;
}

.od-worker-menu__search-input {
  width: 100%;
  min-height: 30px;
  padding: 0.35rem 0.5rem;
  font-size: 12px;
}

.od-worker-menu__inner {
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
}

.od-worker-menu__empty {
  padding: 0.45rem 0.5rem;
  font-size: 12px;
  color: #6b7280;
}

.od-worker-menu__option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
  padding: 0.4rem 0.5rem;
  min-height: 30px;
  border-radius: var(--app-ui-radius);
  cursor: pointer;
  white-space: normal;
}

.od-worker-menu__option:hover {
  background: #f1f5f9;
}

.od-worker-menu__option.is-active {
  background: #e8f0ff;
  color: #1d4ed8;
  font-weight: 600;
}

.od-worker-menu__option:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Старт/завершение в таблице операций: две строки на всех ширинах (inline-спаны иначе слипаются при переносе даты/времени). */
.page-order-detail .od-worker-time-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  min-width: 0;
}

.page-order-detail .od-worker-time-cell__line {
  display: block;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.od-fact-unit-cell {
  cursor: pointer;
  background: #f8fbff;
  transition: background 0.15s ease;
}

.od-fact-unit-cell:hover,
.od-fact-unit-cell:focus {
  background: #eaf3ff;
  outline: none;
}

.od-fact-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.od-fact-modal.u-hidden {
  display: none !important;
}

.od-fact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}

.od-fact-modal__dialog {
  position: relative;
  width: min(1220px, 96vw);
  max-height: 92vh;
  z-index: 1;
}

.od-fact-modal__content {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 24px 56px rgba(2, 8, 23, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}

.od-fact-modal__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: 0.46rem 0.85rem 0.42rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.od-fact-modal__head h3 {
  margin: 0;
  font-size: 0.86rem;
  color: #111827;
  font-weight: 600;
}

.od-fact-modal__close {
  border: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.od-fact-modal__close:hover {
  background: #e2e8f0;
}

.od-fact-modal__head-right {
  margin-left: auto;
  min-width: 0;
}

.od-fact-modal__period--head {
  margin-left: 0.35rem;
  margin-right: 0.2rem;
}

.od-fact-modal__body {
  overflow: auto;
  padding-bottom: 0.2rem;
}

.od-fact-modal__filters {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  flex-wrap: nowrap;
}

.od-fact-modal__period {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 10px;
  color: #475569;
}

.od-fact-period-dropdown {
  position: relative;
}

.od-fact-period-dropdown__trigger {
  border: 1px solid #bfdbfe;
  background: #ffffff;
  color: #1e3a8a;
  border-radius: 8px;
  padding: 0.2rem 1.45rem 0.2rem 0.45rem;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  position: relative;
  min-width: 84px;
  text-align: left;
}

.od-fact-period-dropdown__trigger::after {
  content: "";
  position: absolute;
  right: 0.6rem;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid #1d4ed8;
  border-bottom: 2px solid #1d4ed8;
  transform: translateY(-62%) rotate(45deg);
  transition: transform 0.16s ease;
}

.od-fact-period-dropdown.is-open .od-fact-period-dropdown__trigger::after {
  transform: translateY(-20%) rotate(225deg);
}

.od-fact-period-dropdown__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 3;
  display: none;
  min-width: 100%;
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(30, 64, 175, 0.18);
  padding: 3px;
}

.od-fact-period-dropdown.is-open .od-fact-period-dropdown__menu {
  display: block;
}

.od-fact-period-dropdown__option {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 0.32rem 0.45rem;
  font-size: 11px;
  color: #0f172a;
}

.od-fact-period-dropdown__option:hover {
  background: #2563eb;
  color: #fff;
}

.od-fact-series-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 10px;
  color: #334155;
}

.od-mini-metric-switch {
  display: inline-flex;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  overflow: hidden;
  margin-left: 0.2rem;
}

.od-mini-metric-switch__btn {
  border: 0;
  background: #fff;
  color: #475569;
  font-size: 9px;
  padding: 0.12rem 0.34rem;
}

.od-mini-metric-switch__btn + .od-mini-metric-switch__btn {
  border-left: 1px solid #dbeafe;
}

.od-mini-metric-switch__btn.is-active {
  background: #2563eb;
  color: #fff;
}

.od-mini-metric-switch--in-column {
  margin-top: 0.2rem;
  margin-left: 0;
}

.od-fact-series-check {
  width: 12px;
  height: 12px;
  margin: 0;
}

.od-fact-series-check--plan { accent-color: #3b82f6; }
.od-fact-series-check--fact { accent-color: #16a34a; }
.od-fact-series-check--ops { accent-color: #f59e0b; }

.od-fact-modal__chart-wrap {
  position: relative;
  height: 250px;
  padding: 0.05rem 0.85rem 0.35rem;
}

.od-fact-performers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0 1rem 0.5rem;
  font-size: 10px;
}

.od-fact-performers__label {
  color: #475569;
  font-weight: 600;
}

.od-fact-performers__chip {
  background: #eef2ff;
  color: #1e3a8a;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 0.16rem 0.46rem;
}

.od-fact-performers__empty {
  color: #94a3b8;
}

.od-fact-modal__table td,
.od-fact-modal__table th {
  font-size: 10.5px;
  padding-top: 0.12rem;
  padding-bottom: 0.12rem;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  line-height: 1.1;
  white-space: normal;
  overflow-wrap: anywhere;
}

.od-fact-modal__table {
  width: 100%;
  table-layout: fixed;
}

.od-fact-modal__table th:nth-child(1),
.od-fact-modal__table td:nth-child(1) { width: 15%; }
.od-fact-modal__table th:nth-child(2),
.od-fact-modal__table td:nth-child(2) { width: 7%; }
.od-fact-modal__table th:nth-child(3),
.od-fact-modal__table td:nth-child(3) { width: 18%; }
.od-fact-modal__table th:nth-child(4),
.od-fact-modal__table td:nth-child(4) { width: 9%; }
.od-fact-modal__table th:nth-child(5),
.od-fact-modal__table td:nth-child(5) { width: 14%; }
.od-fact-modal__table th:nth-child(6),
.od-fact-modal__table td:nth-child(6) { width: 11%; }
.od-fact-modal__table th:nth-child(7),
.od-fact-modal__table td:nth-child(7) { width: 26%; }

.od-fact-modal__table td:nth-child(4),
.od-fact-modal__table td:nth-child(6) {
  white-space: nowrap;
}

.od-fact-modal__table tbody tr {
  height: 64px;
}

.od-fact-modal__table tbody td {
  height: 64px;
  vertical-align: middle;
}


.od-fact-table-shell {
  margin: 0.2rem 0.95rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.od-fact-modal .table-wrap {
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 0;
  margin: 0;
}

.od-fact-modal .pagination {
  padding: 0.65rem 1rem 0.95rem;
}

.od-mini-chart-wrap {
  width: 100%;
  max-width: none;
  height: 58px;
  margin-top: 1px;
  margin-bottom: 0;
}

.od-mini-chart-cell {
  vertical-align: bottom !important;
  padding-top: 0.14rem !important;
  padding-bottom: 0.02rem !important;
}

/* === Manager widget (admin pages) === */
.manager-widget {
  --mw-col-search: 138px;
  --mw-col-status: 110px;
  --mw-col-time: 72px;
  --mw-col-metric: 120px;
  --mw-col-what: calc(100% - var(--mw-col-search) - var(--mw-col-status) - var(--mw-col-time) - var(--mw-col-metric));
  position: fixed;
  top: 86px;
  right: 14px;
  width: 560px;
  min-width: 460px;
  min-height: 170px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow: hidden;
  resize: none;
  border: 1px solid #d8dbe2;
  border-radius: var(--app-ui-radius);
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.2), 0 3px 10px rgba(15, 23, 42, 0.12);
  z-index: 1300;
  display: flex;
  flex-direction: column;
}

.mw-resizer {
  position: absolute;
  z-index: 3;
  user-select: none;
  touch-action: none;
}

.mw-resizer--n,
.mw-resizer--s {
  left: 10px;
  right: 10px;
  height: 8px;
}

.mw-resizer--n { top: -4px; cursor: ns-resize; }
.mw-resizer--s { bottom: -4px; cursor: ns-resize; }

.mw-resizer--e,
.mw-resizer--w {
  top: 10px;
  bottom: 10px;
  width: 8px;
}

.mw-resizer--e { right: -4px; cursor: ew-resize; }
.mw-resizer--w { left: -4px; cursor: ew-resize; }

.mw-resizer--ne,
.mw-resizer--nw,
.mw-resizer--se,
.mw-resizer--sw {
  width: 12px;
  height: 12px;
}

.mw-resizer--ne { top: -6px; right: -6px; cursor: nesw-resize; }
.mw-resizer--sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.mw-resizer--nw { top: -6px; left: -6px; cursor: nwse-resize; }
.mw-resizer--se { bottom: -6px; right: -6px; cursor: nwse-resize; }

.manager-widget.is-collapsed .mw-resizer {
  display: none;
}

.manager-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0.32rem 0.46rem;
  border-bottom: 1px solid #e5e7eb;
  cursor: move;
  user-select: none;
  background: #f8fafc;
}

.manager-widget__title {
  font-weight: 600;
  font-size: 12px;
  color: #1f2430;
}

.manager-widget__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  border: 1px solid #c9d4e8;
  background: #fff;
  border-radius: var(--app-ui-radius);
  color: #1e3a8a;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.manager-widget__body {
  padding: 0.32rem 0.4rem;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.manager-widget__table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: 100%;
  overflow: auto;
}

.manager-widget__table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
}

.manager-widget__table th,
.manager-widget__table td {
  padding: 4px 5px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  vertical-align: top;
  font-size: 11px;
  line-height: 1.15;
  /* Явный фон ячеек: иначе при tr:hover фон «рвется» на колонке со ссылками (Что шьет). */
  background-color: #fff;
}

.manager-widget__table tbody td {
  vertical-align: middle;
}

.manager-widget__table tbody tr:hover td {
  background-color: #f1f5f9;
}

.manager-widget__table tbody td:first-child {
  overflow-x: hidden;
  overflow-y: visible;
  max-width: 138px;
}

.manager-widget__table thead th {
  height: 36px;
  padding-top: 3px;
  padding-bottom: 3px;
  vertical-align: middle;
  overflow: hidden;
}

.manager-widget__table thead th:nth-child(3),
.manager-widget__table thead th:nth-child(4),
.manager-widget__table thead th:nth-child(5) {
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.05;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

.manager-widget__table tbody tr {
  /* will-change: transform оставляло отдельный композитный слой — артефакты тени/обрезки при hover после анимации сортировки */
  background-color: transparent;
}

.manager-widget__th--search {
  width: var(--mw-col-search);
}

.manager-widget__th--status {
  width: var(--mw-col-status);
  min-width: var(--mw-col-status);
}

.manager-widget__th--time {
  width: var(--mw-col-time);
  text-align: right;
  white-space: normal;
  word-break: keep-all;
}

.manager-widget__th--metric {
  width: var(--mw-col-metric);
  text-align: right;
  white-space: nowrap;
}

.manager-widget__table th:nth-child(3),
.manager-widget__table td:nth-child(3) {
  width: var(--mw-col-what);
}

.manager-widget__metric-cell {
  text-align: right;
  white-space: nowrap;
}

.manager-widget__search {
  width: 100%;
  min-width: 0;
  height: 24px;
  min-height: 24px;
  border: 1px solid #d8deea;
  border-radius: var(--app-ui-radius);
  padding: 0.12rem 1.25rem 0.12rem 0.44rem;
  font-size: 12px;
  font-weight: 500;
  color: #3a475d;
  line-height: 1;
  text-align: left;
  outline: none;
}

.manager-widget__search::placeholder {
  color: #6b7280;
}

.manager-widget__search:focus {
  border-color: #c8d6f2;
  box-shadow: 0 0 0 2px rgba(1, 104, 250, 0.08);
}

.mw-status-filter {
  position: relative;
  width: 100%;
}

.mw-status-filter .orders-dropdown__trigger {
  min-height: 24px;
  height: 24px;
  font-size: 12px;
  padding: 0.12rem 1.25rem 0.12rem 0.44rem;
  border-radius: var(--app-ui-radius);
  border: 1px solid #d8deea;
  background: #fff;
  color: #3a475d;
  font-weight: 500;
  position: relative;
  display: flex;
  align-items: center;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mw-status-filter .orders-dropdown__trigger::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #7b8699;
  border-bottom: 1.5px solid #7b8699;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.mw-status-filter.is-open .orders-dropdown__trigger::after {
  transform: translateY(-35%) rotate(225deg);
}

.mw-status-filter.is-open .orders-dropdown__trigger {
  border-color: #c8d6f2;
  box-shadow: 0 0 0 2px rgba(1, 104, 250, 0.08);
}

/* Единый шрифт для фильтров с полем/дропдауном (orders + виджет). */
.page-orders #tableOrders thead .input--sm,
.page-orders #tableOrders thead .orders-dropdown__trigger,
.page-orders #tableOrders thead .orders-dropdown__trigger-input,
.manager-widget__search,
.mw-status-filter .orders-dropdown__trigger,
.mw-status-filter .orders-dropdown__trigger-input {
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif !important;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: #3a475d;
  text-transform: none;
}

.page-orders #tableOrders thead .input--sm::placeholder,
.page-orders #tableOrders thead .orders-dropdown__trigger-input::placeholder,
.manager-widget__search::placeholder {
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif !important;
  font-size: 12px;
  font-weight: 600;
  color: #3a475d;
  letter-spacing: 0;
  opacity: 1;
}

.mw-status-filter .orders-dropdown__menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: max-content;
  min-width: max-content;
  max-width: none;
  border-radius: var(--app-ui-radius-dropdown);
  border: 1px solid #d7ddea;
  background: #fff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
  padding: 0.2rem;
  z-index: 3000;
}

.mw-status-filter.is-open .orders-dropdown__menu {
  display: block;
}

.mw-status-filter__option {
  display: block;
  width: auto;
  border: 0;
  background: #fff;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #1f2937;
  border-radius: var(--app-ui-radius);
  min-height: 24px;
  padding: 0.24rem 0.44rem;
  cursor: pointer;
  white-space: nowrap;
}

.mw-status-filter__option:hover {
  background: #eef2ff;
}

.mw-status-filter__option.is-active {
  background: #e0ecff;
  color: #1d4ed8;
}

.mw-status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: var(--app-ui-radius-status);
  font-size: 10px;
  line-height: 1;
  padding: 3px 7px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.mw-status--working {
  background: #e8f7ef;
  color: #0c7c46;
  border-color: #b7e7cd;
}

/* Пауза: холодный сланец — не в тёплой кремовой гамме как «Брак в работе» */
.mw-status--paused {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #64748b;
}

.mw-status--done {
  background: #fafafa;
  color: #52525b;
  border-color: #e4e4e7;
}

.mw-status--defect {
  background: #ffecef;
  color: #a31b2f;
  border-color: #f4c3cb;
}

.mw-status--combined {
  background: #f5f3ff;
  color: #5b21b6;
  border-color: #ddd6fe;
}

/* «Брак + В работе» / «Брак + На паузе» — отдельные оттенки от общего «брак +» */
.mw-status--brk-plus-work {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}

.mw-status--brk-plus-pause {
  background: #faf5ff;
  color: #6d28d9;
  border-color: #d8b4fe;
}

/* Брак в работе: явно тёплый оранжевый, не пересекается с серой «На паузе» */
.mw-status--defect-active {
  background: #ffedd5;
  color: #9a3412;
  border-color: #ea580c;
}

.mw-status--time {
  background: #eff6ff;
  color: #1e3a8a;
  border-color: #93c5fd;
}

.mw-what-cell {
  display: block;
  color: inherit;
  text-decoration: none;
}

.mw-what-row + .mw-what-row {
  margin-top: 2px;
}

.mw-what-row-head {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.mw-what-lane {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 14px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid #cde6d7;
  background: #eaf8f0;
  color: #166534;
  font-size: 9px;
  line-height: 1;
  cursor: default;
  text-decoration: none !important;
  transition: none;
}

.mw-what-lane--defect {
  border-color: #f4c3cb;
  background: #ffecef;
  color: #a31b2f;
}

.mw-what-link {
  color: #1a4fbf;
}

.mw-what-link:hover {
  text-decoration: none;
}

.mw-what-link:hover .mw-what-top,
.mw-what-link:hover .mw-what-bottom {
  text-decoration: underline;
}

.mw-what-top,
.mw-what-bottom {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mw-what-top {
  flex: 1 1 auto;
  min-width: 0;
}

.mw-what-bottom {
  color: #5f6676;
}

.mw-user-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  /* Майка >72ч — тёмнее; нажатый дизлайк — отдельный контур SVG */
  --mw-widget-danger: #dc2626;
  --mw-defect-icon-line: #c62828;
  --mw-dislike-active-stroke: #ec6279;
  /* Общие фоны майки / дизлайка в виджете */
  --mw-widget-icon-hover-bg: rgba(148, 163, 184, 0.22);
  --mw-widget-icon-accent-bg: #fee2e2;
  --mw-widget-icon-accent-bg-hover: #fecaca;
}

.mw-defect-shirt-wrap {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}

.mw-defect-shirt {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  color: #475569;
  background: transparent;
  box-shadow: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.mw-defect-shirt:hover {
  color: #0f172a;
  background: var(--mw-widget-icon-hover-bg);
}

.mw-defect-shirt:focus {
  outline: none;
}

.mw-defect-shirt:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 1px;
  background: transparent;
}

/* >72ч: красный акцент (фон + иконка), без жирной обводки */
.mw-defect-shirt.is-stale {
  color: var(--mw-defect-icon-line);
  background: var(--mw-widget-icon-accent-bg);
  border: 0;
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 4px;
}

.mw-defect-shirt.is-stale:hover {
  color: var(--mw-defect-icon-line);
  background: var(--mw-widget-icon-accent-bg-hover);
}

.mw-defect-shirt.is-stale:focus-visible {
  outline: 2px solid var(--mw-defect-icon-line);
  outline-offset: 1px;
}

.mw-defect-shirt__img {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: contrast(1.04) brightness(1.02);
}

/* Монохромная иконка → --mw-defect-icon-line (нажатый дизлайк — отдельный, светлее --mw-dislike-active-stroke) */
.mw-defect-shirt.is-stale .mw-defect-shirt__img {
  filter: brightness(0) saturate(100%) invert(19%) sepia(96%) saturate(5200%) hue-rotate(339deg) brightness(0.94) contrast(1.04);
}

.mw-defect-popover {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10060;
  min-width: 220px;
  max-width: min(320px, 92vw);
  padding: 8px 10px;
  border-radius: 8px;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 11px;
  line-height: 1.35;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
  pointer-events: auto;
  text-align: left;
}

.mw-defect-popover.mw-defect-popover--visible {
  display: block;
}

.mw-defect-popover__title {
  font-weight: 600;
  margin-bottom: 6px;
  color: #fff;
}

.mw-defect-tip-line + .mw-defect-tip-line {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mw-defect-tip-meta {
  font-weight: 500;
}

.mw-status-cell {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.mw-defect-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fee2e2;
  color: #991b1b;
  cursor: default;
  text-decoration: none !important;
  transition: none;
}

.mw-defect-chip--status {
  flex-shrink: 0;
  line-height: 1.2;
}

.mw-defect-otk-link {
  font-size: 10px;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: underline;
}

.mw-defect-otk-link:hover {
  color: #1e40af;
}

.mw-status-filter__option--stub {
  opacity: 0.55;
  cursor: not-allowed;
}

.mw-user-cell__name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mw-dislike-btn {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 0;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  background: transparent;
  padding: 0;
  transform: translateZ(0);
}

.mw-dislike-btn svg {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  shape-rendering: geometricPrecision;
}

/* Нажатый: чуть толще линия + лёгкое «размытое» свечение по контуру */
.mw-dislike-btn.is-active svg {
  stroke: var(--mw-dislike-active-stroke);
  stroke-width: 1.28;
  filter: drop-shadow(0 0 0.45px rgba(236, 98, 121, 0.85)) drop-shadow(0 0 1.05px rgba(236, 98, 121, 0.4));
  shape-rendering: auto;
}

.mw-dislike-btn:hover:not(:disabled):not(.is-active) {
  color: #475569;
  background: var(--mw-widget-icon-hover-bg);
}

.mw-dislike-btn.is-active {
  color: var(--mw-dislike-active-stroke);
  background: var(--mw-widget-icon-accent-bg);
}

.mw-dislike-btn.is-active:hover:not(:disabled) {
  background: var(--mw-widget-icon-accent-bg-hover);
}

.mw-dislike-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.mw-dislike-btn.is-active:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.manager-widget__time-cell {
  text-align: right;
  white-space: nowrap;
}

.manager-widget__empty {
  text-align: center;
  color: #666f80;
  padding: 12px 8px;
  font-size: 11px;
}

.manager-widget.is-collapsed .manager-widget__header {
  border-bottom: 0;
  background: transparent;
  padding: 4px 2px 4px 4px;
  justify-content: flex-end;
  width: max-content;
  box-sizing: border-box;
}

.manager-widget.is-collapsed .manager-widget__title {
  display: none;
}

.manager-widget.is-collapsed {
  /* Схлопываем до ширины кнопки, иначе остаётся inline width развёрнутого виджета
     и «прибивание» к углу визуально ставит плюс в центр длинной полосы. */
  width: max-content !important;
  min-width: 0 !important;
  max-width: none !important;
  align-items: flex-start;
  height: auto !important;
  min-height: 0;
  resize: none;
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.manager-widget.is-collapsed .manager-widget__body {
  display: none;
}

.manager-widget.is-collapsed .manager-widget__toggle {
  position: relative;
  width: 1.85rem;
  height: 1.85rem;
  min-width: 1.85rem;
  min-height: 1.85rem;
  /* Текстовый «+» в шрифте часто визуально смещён; рисуем плюс псевдоэлементами. */
  font-size: 0;
  line-height: 0;
  color: transparent;
  user-select: none;
  border: 1px solid #cfe8fc;
  background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
  border-radius: var(--app-ui-radius-dropdown);
  box-shadow:
    0 0 0 1px rgba(148, 190, 233, 0.35),
    0 3px 12px rgba(100, 149, 200, 0.18);
}

.manager-widget.is-collapsed .manager-widget__toggle::before,
.manager-widget.is-collapsed .manager-widget__toggle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: #5b9fe8;
  border-radius: 0.5px;
  transform: translate(-50%, -50%);
}

.manager-widget.is-collapsed .manager-widget__toggle::before {
  width: 10px;
  height: 2px;
}

.manager-widget.is-collapsed .manager-widget__toggle::after {
  width: 2px;
  height: 10px;
}

@media (max-width: 1200px) {
  .manager-widget {
    width: 500px;
    --mw-col-search: 124px;
    --mw-col-status: 102px;
    --mw-col-time: 68px;
    --mw-col-metric: 120px;
  }
  .manager-widget__th--search {
    width: 124px;
  }
  .manager-widget__table tbody td:first-child {
    max-width: 124px;
  }
  .manager-widget__th--status {
    width: 102px;
    min-width: 102px;
  }
  .manager-widget__th--time {
    width: 68px;
  }
  .manager-widget__th--metric {
    width: 120px;
  }
}

@media (max-width: 760px) {
  .manager-widget {
    min-width: 0;
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 80px);
    right: 8px;
    top: 72px;
  }

  .mw-resizer {
    display: none;
  }

  .manager-widget__header {
    padding: 0.45rem 0.5rem;
    min-height: 44px;
  }

  .manager-widget__toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 1rem;
    z-index: 2;
  }

  .manager-widget.is-collapsed .manager-widget__toggle {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    font-size: 0;
  }

  .manager-widget.is-collapsed .manager-widget__toggle::before {
    width: 14px;
    height: 2.5px;
  }

  .manager-widget.is-collapsed .manager-widget__toggle::after {
    width: 2.5px;
    height: 14px;
  }

  .manager-widget__table-wrap {
    max-height: none;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .manager-widget__table {
    min-width: 0;
    table-layout: fixed;
  }

  .manager-widget__table thead {
    display: none;
  }

  .manager-widget__table tbody,
  .manager-widget__table tbody tr,
  .manager-widget__table tbody td {
    display: block;
    width: 100%;
  }

  .manager-widget__table tbody tr {
    border: 1px solid #e5e7eb;
    border-radius: var(--app-ui-radius);
    margin-bottom: 0.45rem;
    overflow: hidden;
    background: #fff;
  }

  .manager-widget__table tbody td[data-label] {
    border-bottom: 1px solid #edf1f6;
    padding: 0.34rem 0.46rem;
    max-width: none;
  }

  .manager-widget__table tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.18rem;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .manager-widget__table tbody td[data-label]:last-child {
    border-bottom: 0;
  }

  .manager-widget__cell--status,
  .manager-widget__cell--time,
  .manager-widget__cell--metric {
    text-align: left;
  }

  .manager-widget__metric-cell {
    white-space: normal;
  }

  .manager-widget__th--search,
  .manager-widget__th--status,
  .manager-widget__th--time,
  .manager-widget__th--metric,
  .manager-widget__table tbody td:first-child {
    width: auto;
    max-width: none;
  }

  .mw-what-top,
  .mw-what-bottom {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* Планшет 768–1024px (между десктопом и телефоном; не пересекается с max-width:767) */
@media (min-width: 768px) and (max-width: 1024px) {
  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  body h1.section__title {
    font-size: 16px !important;
    line-height: 1.3 !important;
  }

  .page-grades h1.section__title {
    font-size: 15px !important;
    font-weight: 500 !important;
  }

  /* Заказ на пошив */
  .page-orders .blocks-row {
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  .page-orders .orders-status-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Детали заказа на пошив */
  .page-order-detail .od-header {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .page-order-detail .od-meta {
    flex-wrap: wrap;
  }

  .page-order-detail .od-eq-table {
    min-width: 980px;
    table-layout: auto;
  }

  .page-order-detail .od-eq-table .od-col-worker-time {
    min-width: 19.5rem;
    width: 19.5rem;
    max-width: none;
    white-space: normal;
    vertical-align: middle;
    line-height: 1.28;
    box-sizing: border-box;
    overflow: visible;
    word-break: normal;
  }

  /* Финансы */
  .page-finance .finance-head-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .page-finance #tableFinance {
    min-width: 700px;
  }

  /* Сотрудники: не сбрасывать min-width таблицы — иначе fixed-layout сжимает колонки и режет текст */

  .page-employees .employees-add-row--primary,
  .page-employees .employees-add-row--secondary {
    flex-wrap: wrap;
  }

  /* Ставки */
  .page-grades #tableHistory {
    min-width: 540px;
  }

  /* Сводка */
  .page-summary .summary-card-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .page-summary .summary-period-dropdown,
  .page-summary .summary-position-dropdown {
    flex: 0 1 auto;
    min-width: 0;
  }

  /* Склад */
  .page-warehouse #warehouseTable {
    min-width: 680px;
  }

  /* ОТК */
  .page-otk-check #otkCheckTable {
    min-width: 980px;
  }

  .page-otk-packaging #otkPackagingTable {
    min-width: 760px;
  }

  /* Добавление модели */
  .page-add-model #draftTable {
    min-width: 600px;
  }

  /* Гант: сетка 2×2 вместо узкой 4-колоночной */
  .page-gantt .gantt-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .page-gantt .gantt-filter {
    min-width: 0;
  }

  .page-gantt .gantt-toolbar__actions {
    justify-self: stretch;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .page-gantt .orders-status-tabs.gantt-status-tabs {
    margin-left: 0;
    flex-wrap: wrap;
  }

  /* Аналитика */
  .page-analytics .analytics-filters-row,
  .page-analytics .analytics-period-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Характеристики и формы в блоках */
  .block .add-row {
    flex-wrap: wrap;
  }

  .characteristics-top,
  .characteristics-bottom {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* Мобильный слой: safe-area, горизонтальный скролл таблиц, крупные зоны нажатия */
@media (max-width: 767px) {
  .layout > .content {
    padding-top: calc(
      max(env(safe-area-inset-top, 0px), 0px) + var(--layout-content-padding-y) + 44px + 0.5rem
    ) !important;
    padding-left: max(var(--layout-content-padding-x), env(safe-area-inset-left, 0px)) !important;
    padding-right: max(var(--layout-content-padding-x), env(safe-area-inset-right, 0px)) !important;
    padding-bottom: max(var(--layout-content-padding-y), env(safe-area-inset-bottom, 0px)) !important;
  }

  /* История операции: чуть уже общего mobile-padding, без крайнего сжатия */
  body.page-op-history .layout > .content {
    padding-left: max(1rem, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(1rem, env(safe-area-inset-right, 0px)) !important;
  }

  .table-wrap {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  body h1.section__title {
    font-size: 15px !important;
    line-height: 1.35 !important;
    word-break: break-word;
  }

  .page-grades h1.section__title {
    font-size: 14px !important;
    font-weight: 500 !important;
  }

  .page-grades .section__title {
    font-size: 13px;
  }

  .page-grades .block__title {
    font-size: 12px;
  }

  .page-grades .grade-card__name {
    font-size: 11px;
  }

  .page-models .models-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-models .models-title-files {
    width: 100%;
  }

  .page-models .models-title-files .equipop-actions-stack {
    justify-content: flex-start;
  }

  .page-models .mo-th-model__search,
  .page-models #searchInput.mo-th-model__search {
    width: 100%;
    max-width: none;
    min-height: 44px;
  }

  .page-models .models-tabs-head .summary-mid-tabs {
    display: flex;
    width: 100%;
  }

  .page-models .models-tabs-head .summary-mid-tabs .summary-mid-tab {
    min-width: 0;
    flex: 1 1 0;
    padding: 0.36rem 0.55rem;
  }

  .page-models .models-tabs-head .summary-mid-tabs .summary-mid-tab:first-child {
    padding-left: calc(0.55rem + 2ch);
    padding-right: calc(0.55rem + 2ch);
  }

  .page-orders .blocks-row {
    flex-direction: column;
  }

  .page-orders .ac-wrap .input {
    min-height: 44px;
    font-size: 16px;
  }

  .page-orders .orders-status-tabs {
    flex-wrap: wrap;
    margin-left: 0;
    width: 100%;
  }

  /* Детали заказа на пошив */
  .page-order-detail .od-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .page-order-detail .od-header-qr-column {
    align-self: center;
  }

  .page-order-detail .od-meta {
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    font-size: 0.78rem;
  }

  .page-order-detail .od-meta span {
    white-space: normal;
  }

  .page-order-detail .od-group-title {
    font-size: 0.88rem;
    line-height: 1.3;
    word-break: break-word;
  }

  .page-order-detail .od-eq-table {
    min-width: 880px;
    table-layout: auto;
  }

  .page-order-detail .od-op-add-btn,
  .page-order-detail .od-op-worker-remove {
    min-width: 44px;
    min-height: 44px;
    padding: 0.25rem 0.5rem;
  }

  .page-order-detail .od-op-recalc-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .page-order-detail .od-op-worker-qty {
    min-height: 44px;
    width: 64px;
    font-size: 16px;
  }

  .page-order-detail .od-back {
    min-height: 44px;
    align-items: center;
  }

  /* Финансы */
  .page-finance .finance-head-row {
    flex-direction: column;
    align-items: stretch;
  }

  .page-finance #btnFinanceExport {
    min-height: 44px;
    width: 100%;
    font-size: 14px;
  }

  .page-finance #tableFinance {
    min-width: 680px;
  }

  /* Сотрудники: список и форма — таблица сохраняет min-width, скролл в .table-wrap--full */

  .page-employees .employees-add-row--primary,
  .page-employees .employees-add-row--secondary {
    flex-wrap: wrap;
  }

  .page-employees .input,
  .page-employees .btn,
  .page-employees select.input,
  .page-employees .emp-inline-dropdown .orders-dropdown__trigger {
    min-height: 44px;
    font-size: 16px;
  }

  .page-employees #btnAddEmployee {
    min-height: 44px;
    width: 100%;
    max-width: 100%;
  }

  /* Ставки разрядов */
  .page-grades .input,
  .page-grades select.input {
    min-height: 44px;
    font-size: 16px;
  }

  .page-grades .btn {
    min-height: 44px;
    font-size: 15px;
    font-weight: 500;
  }

  .page-grades .grades-list .btn-update-grade {
    min-height: 44px;
    min-width: 0;
    font-size: 15px;
    font-weight: 500;
  }

  .page-grades #tableHistory {
    min-width: 520px;
  }

  /* ОТК: упаковка — горизонтальный скролл (десктопный overflow:hidden обрезал таблицу) */
  .page-otk-packaging .table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .page-otk-packaging #otkPackagingTable {
    min-width: 720px;
  }

  /* Сводка: одна колонка карточек, крупнее контролы */
  .page-summary .summary-grid--top,
  .page-summary .summary-grid--bottom {
    grid-template-columns: 1fr;
  }

  .page-summary .summary-grid--top > .block:nth-child(3),
  .page-summary .summary-grid--bottom > .block:nth-child(2) {
    grid-column: auto;
  }

  .page-summary .summary-card-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .page-summary .summary-card-head .input,
  .page-summary .summary-period-dropdown .orders-dropdown__trigger,
  .page-summary .summary-position-dropdown .orders-dropdown__trigger {
    min-height: 44px;
    font-size: 16px;
  }

  .page-summary .summary-period-dropdown,
  .page-summary .summary-position-dropdown {
    width: auto;
    flex: 1 1 auto;
    min-width: 120px;
  }

  /* Склад */
  .page-warehouse #warehouseTable {
    min-width: 640px;
  }

  /* Добавление модели */
  .page-add-model .input:not([type="checkbox"]):not([type="radio"]),
  .page-add-model .btn,
  .page-add-model select.input {
    min-height: 44px;
    font-size: 16px;
  }

  .page-add-model #draftTable {
    min-width: 560px;
  }

  /* Диаграмма Ганта */
  .page-gantt .gantt-toolbar {
    grid-template-columns: 1fr;
  }

  .page-gantt .gantt-filter {
    min-width: 0;
    width: 100%;
  }

  .page-gantt #ganttSearchInput {
    min-height: 44px;
  }

  .page-gantt .gantt-toolbar__actions {
    justify-self: stretch;
    width: 100%;
    flex-wrap: wrap;
  }

  .page-gantt .gantt-toolbar__actions .btn {
    min-height: 44px;
  }

  /* Аналитика */
  .page-analytics .analytics-filters-row,
  .page-analytics .analytics-period-row {
    flex-direction: column;
    align-items: stretch;
  }

  .page-analytics .analytics-filters-row .input,
  .page-analytics .analytics-period-row .input,
  .page-analytics .analytics-filters-row .btn {
    min-height: 44px;
    width: 100%;
    max-width: none;
  }

  /* Характеристики и узкие «добавить в блоке» */
  .characteristics-grid .input,
  .characteristics-grid .btn,
  .characteristics-top .input,
  .characteristics-bottom .input {
    min-height: 44px;
    font-size: 16px;
  }

  .block .add-row {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .block .add-row .input:not([type="checkbox"]):not([type="radio"]) {
    min-height: 44px;
    font-size: 16px;
  }

  .block .add-row .btn {
    min-height: 44px;
  }

  /* Табы заказов / сводки / склада — зона нажатия ~44px */
  .page-orders .orders-status-tab,
  .page-warehouse .warehouse-tabs .orders-status-tab,
  .summary-mid-tab {
    min-height: 44px;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }
}

/* Название модели: кнопки в строке заголовка рядом с бейджем, как на equip-op */
.page-characteristics-mn .mn-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-bottom: 0.35rem;
}

.page-characteristics-mn .mn-title-row .section__title {
  margin: 0;
}

/* Строка карточек: «Модель» | «Описание» (до конца ширины) */
.page-characteristics-mn .mn-model-page-top {
  display: grid;
  grid-template-columns: minmax(0, 432px) minmax(0, 1fr);
  column-gap: var(--equipop-top-column-gap);
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

.page-characteristics-mn .mn-model-block-col {
  min-width: 0;
}

.page-characteristics-mn .mn-model-block-col--desc {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.32rem;
}

.page-characteristics-mn .mn-model-block-col--desc .equipop-block__bottom.mn-model-desc-card__bottom {
  margin-top: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.page-characteristics-mn .mn-model-desc-input {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  resize: none;
  line-height: 1.25;
  padding-top: 0.28rem;
  padding-bottom: 0.28rem;
}

.page-characteristics-mn .mn-model-add-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
  padding-right: var(--mn-model-card-pad-inline);
}

.page-characteristics-mn .mn-model-add-btn {
  min-height: 26px;
  padding: 0.12rem 0.65rem;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

/* Раздел «Характеристики»: алиас для старых правил (основной токен --app-ui-radius в tokens.css) */
.page-characteristics {
  --ch-ui-radius: var(--app-ui-radius);
}

/* Карточка «Модель»: компактная фиксированная высота; строка ввода прижата к низу */
.page-characteristics-mn {
  --mn-model-card-height: 5.35rem;
  /* Единые отступы контента до рамки: снизу = по бокам */
  --mn-model-card-pad-inline: 0.4rem;
  --mn-model-card-pad-bottom: 0.4rem;
}

.page-characteristics-mn .mn-model-block-col--name .block.equipop-block--equipment,
.page-characteristics-mn .mn-model-block-col--desc .block.equipop-block--equipment {
  min-width: 0;
  height: var(--mn-model-card-height);
  min-height: var(--mn-model-card-height);
  max-height: var(--mn-model-card-height);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 0.1rem var(--mn-model-card-pad-inline) var(--mn-model-card-pad-bottom);
  gap: 0.04rem;
  flex-shrink: 0;
}

.page-characteristics-mn .mn-model-block-col--name .equipop-block--equipment .equipop-block__bottom {
  margin-top: auto;
  flex-shrink: 0;
}

.page-characteristics-mn .mn-title-files {
  margin-left: 0;
  width: auto;
  max-width: 100%;
}

.page-characteristics-mn .mn-title-files .equipop-actions-stack {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: auto;
  height: auto;
  max-height: none;
  flex: 0 0 auto;
  gap: 0.22rem;
}

.page-characteristics-mn .mn-title-files .equipop-actions-stack > .btn,
.page-characteristics-mn .mn-title-files .equipop-actions-stack > .csv-file-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: none;
}

.page-characteristics-mn .mn-title-files .btn-with-icon {
  min-height: 28px !important;
  padding: 0.14rem 2ch !important;
  justify-content: center;
}

.page-characteristics-mn .mn-title-files .btn-with-icon > span {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.page-characteristics-mn .mn-title-files .btn-with-icon .icon-feather-action {
  width: 15px;
  height: 15px;
}

@media (max-width: 52rem) {
  .page-characteristics-mn .mn-model-page-top {
    grid-template-columns: 1fr;
    row-gap: var(--equipop-top-column-gap);
    align-items: start;
  }

  .page-characteristics-mn .mn-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-characteristics-mn .mn-title-files {
    margin-left: 0;
    width: 100%;
  }

  .page-characteristics-mn .mn-title-files .equipop-actions-stack {
    justify-content: flex-start;
  }

  .page-characteristics-mn .mn-model-block-col--desc .block.equipop-block--equipment {
    height: auto;
    max-height: none;
    min-height: 6.5rem;
  }

  .page-characteristics-mn .mn-model-desc-input {
    min-height: 4rem;
  }
}

.page-characteristics-mn .mn-sort-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.page-characteristics-mn .mn-sort-btn:hover {
  color: #2563eb;
}

.page-characteristics-mn .mn-models-table thead th.equipop-col-date .mn-sort-hint {
  font-size: 0.92em;
  opacity: 0.85;
  font-weight: 600;
}

/* Заголовки как на референсе «ДАТА ДОБАВЛЕНИЯ»: caps, приглушённый серо-синий, как у orders */
.page-characteristics-mn .equipop-table-wrap .mn-models-table thead th {
  padding: 0.46rem 0.52rem;
  font-size: 12px;
  font-weight: 600;
  color: #5b6678;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
  background: var(--df-surface-soft, #f5f7fb);
  border-bottom: 1px solid var(--df-border, #edf1f7);
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table thead th.equipop-col-date {
  font-size: 12px;
  letter-spacing: 0.03em;
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table thead th .mn-sort-btn {
  color: #5b6678;
  font-weight: 600;
  letter-spacing: inherit;
  text-transform: inherit;
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table thead th.equipop-col-equip {
  text-transform: none;
}

/* Импорт: сообщение под таблицей — вкладки вплотную к thead */
.page-characteristics-mn .mn-import-result {
  margin: 0.35rem 0 0;
  padding: 0;
  font-size: 13px;
  min-height: 0;
}

.page-characteristics-mn .mn-import-result:empty {
  margin: 0;
}

/* Уже «Название», шире «Описание»; столбец действий под две иконки без серого фона (как equip-op) */
.page-characteristics-mn .equipop-table-wrap .mn-models-table col.equipop-cg-equip {
  width: 28%;
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table col.equipop-cg-op {
  width: auto;
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table col.equipop-cg-actions {
  width: 140px;
}

/* Глобально .equipop-col-actions — синхронизация с col; 140px — «Восстановить» + padding ячейки */
.page-characteristics-mn .equipop-table-wrap .mn-models-table thead th.equipop-col-actions,
.page-characteristics-mn .equipop-table-wrap .mn-models-table tbody td.equipop-col-actions {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  box-sizing: border-box;
}

/* Иконки по центру столбца действий; sticky — кнопка «Восстановить» не уезжает за край при гориз. скролле */
.page-characteristics-mn .equipop-table-wrap .mn-models-table tbody td.equipop-col-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  padding-left: 0.52rem;
  padding-right: 0.52rem;
  box-shadow: -6px 0 10px -6px rgba(15, 23, 42, 0.1);
  background: var(--df-surface, #fff);
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table thead th.equipop-col-actions {
  position: sticky;
  right: 0;
  z-index: 3;
  box-shadow: -6px 0 10px -6px rgba(15, 23, 42, 0.1);
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table tbody tr:hover td.equipop-col-actions {
  background: #f7faff;
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table tbody tr.mn-row-editing td.equipop-col-actions {
  background: #f0f7ff;
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table tbody tr.mn-row-editing:hover td.equipop-col-actions {
  background: #f0f7ff;
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table tbody td.equipop-col-actions .mn-actions-anchor {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.2rem;
  z-index: 2;
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table tbody td.equipop-col-actions .mn-actions-anchor .btn.btn--icon-only + .btn {
  margin-left: 0;
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table .equipop-col-equip {
  min-width: 120px;
  max-width: 280px;
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table tbody td {
  padding: 0.65rem 0.52rem;
  font-size: 11px;
  line-height: 1.18;
  vertical-align: middle;
}

/* Inline-редактирование строки таблицы «Название модели» */
.page-characteristics-mn .mn-models-table tr.mn-row-editing {
  background: #f0f7ff;
}

/* Перебиваем .input--sm; высокое поле в строке правки */
.page-characteristics-mn .equipop-table-wrap .mn-models-table .mn-inline-name,
.page-characteristics-mn .equipop-table-wrap .mn-models-table .mn-inline-desc {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 0.22rem;
  padding-right: 0.22rem;
  margin: 0;
  font-size: inherit;
  line-height: 1.3;
  min-height: 0;
  height: 2.2em;
  max-height: 2.2em;
  border-radius: var(--ch-ui-radius);
}

.page-characteristics-mn .mn-models-table .mn-inline-name:focus,
.page-characteristics-mn .mn-models-table .mn-inline-name:focus-visible,
.page-characteristics-mn .mn-models-table .mn-inline-desc:focus,
.page-characteristics-mn .mn-models-table .mn-inline-desc:focus-visible {
  outline: none;
  border-color: #9fc0ff;
  box-shadow: inset 0 0 0 1px rgba(1, 104, 250, 0.35);
}

.page-characteristics-mn .mn-models-table .mn-inline-desc {
  overflow: hidden;
  text-overflow: ellipsis;
}

/*
 * Высота строки как у просмотра: обычная ячейка ≈ 2×0.65rem + строка текста (line-height 1.18em).
 * Инпут 2.2em выше текста — уменьшаем вертикальный padding на половину разницы.
 */
.page-characteristics-mn .equipop-table-wrap .mn-models-table tr.mn-row-editing td {
  vertical-align: middle;
  padding-top: max(0.12rem, calc(0.65rem - (2.2em - 1.18em) / 2));
  padding-bottom: max(0.12rem, calc(0.65rem - (2.2em - 1.18em) / 2));
  padding-left: 0.26rem;
  padding-right: 0.26rem;
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table tr.mn-row-editing td.equipop-col-equip.equipop-td-equip {
  max-width: none;
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table .equipop-actions-cell .btn.btn--icon-only {
  vertical-align: middle;
}

.page-characteristics-mn .equipop-table-wrap .mn-models-table .equipop-actions-cell .btn.mn-restore {
  box-sizing: border-box;
  padding: 0.1rem 0.42rem;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  min-height: 0;
  min-width: 0;
  border-radius: var(--ch-ui-radius);
  white-space: nowrap;
}

/* Разделы «Модели» / «Сотрудники»: алиас (общие правила — блок «Глобальное скругление .layout» в конце файла) */
.page-app-models,
.page-app-employees {
  --section-ui-radius: var(--app-ui-radius);
}

/* Глобальное скругление UI: все страницы с основным layout (заказы, сводка, ОТК, склад и т.д.) — токен --app-ui-radius в tokens.css */
.layout .block,
.layout .table-wrap {
  border-radius: var(--app-ui-radius);
}

.layout .input,
.layout .input--sm,
.layout select.input,
.layout .input.input--sm {
  border-radius: var(--app-ui-radius);
}

.layout .btn {
  border-radius: var(--app-ui-radius);
}

.layout .btn.btn--icon-only {
  border-radius: var(--app-ui-radius);
}

.layout .badge-admin {
  border-radius: var(--app-ui-radius);
}

.layout .orders-status-tab,
.layout .summary-mid-tab,
.layout .warehouse-tabs .orders-status-tab {
  border-radius: var(--app-ui-radius) var(--app-ui-radius) 0 0;
}

.layout .tags-list .tag {
  border-radius: var(--app-ui-radius);
}

/* -----------------------------------------------------------------------------
   Дропдауны и столбцы «Статус»: скругление как у карточек (tokens: --app-ui-radius-dropdown / --app-ui-radius-status)
   Перекрывают отдельные px в компонентах; при смене политики — править токены в tokens.css.
   ----------------------------------------------------------------------------- */

.layout select.input,
.layout select.input--sm,
.layout select.input.input--sm,
.orders-dropdown__trigger,
.orders-dropdown__menu,
.orders-dropdown__option,
.orders-dropdown__empty,
.order-status-dropdown__trigger,
.order-status-dropdown__menu,
.order-status-dropdown__option,
.native-select-dropdown__trigger,
.native-select-dropdown__menu,
.native-select-dropdown__option,
.equipop-dropdown.ac-list,
.ac-list,
.dropdown-search__list,
[class*="dropdown__trigger"],
[class*="dropdown__menu"],
[class*="dropdown__option"],
[class*="dropdown__empty"],
.summary-model-total-add__menu,
.summary-model-total-result,
.mw-status-filter .orders-dropdown__menu,
.mw-status-filter__option,
.page-otk-check .table td select.otk-inline-select {
  border-radius: var(--app-ui-radius-dropdown) !important;
}

.input--status,
select.input--status,
.page-orders #tableOrders .input--status,
.page-orders #tableOrders tbody .order-status-readonly,
.otk-status,
.mw-status-chip,
.mw-defect-chip--status,
.page-otk-check-detail .otk-rw-status {
  border-radius: var(--app-ui-radius-status) !important;
}

/* Чипы размеров: прямоугольник со скруглением как у блока, не «таблетка» (999px у глобального .chip) */
.page-orders .section:first-of-type .chip {
  border-radius: var(--app-ui-radius) !important;
}

.manager-widget.is-collapsed .manager-widget__toggle {
  border-radius: var(--app-ui-radius-dropdown) !important;
}

@media (max-width: 768px) {
  .page-models .content,
  .page-model-detail .content,
  .page-add-model .content,
  .page-model-adaptation .content,
  .page-characteristics .content {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .page-models .models-title-row,
  .page-characteristics-equipop .equipop-title-row,
  .page-characteristics-mn .mn-title-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .page-models .models-title-files,
  .page-characteristics-equipop .equipop-title-files,
  .page-characteristics-mn .mn-title-files {
    width: 100%;
    max-width: 100%;
  }

  .page-models .models-title-files .equipop-actions-stack,
  .page-characteristics-equipop .equipop-title-files .equipop-actions-stack,
  .page-characteristics-mn .mn-title-files .equipop-actions-stack {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .page-models .models-title-files .equipop-actions-stack > .btn,
  .page-models .models-title-files .equipop-actions-stack > .csv-file-btn,
  .page-characteristics-equipop .equipop-title-files .equipop-actions-stack > .btn,
  .page-characteristics-equipop .equipop-title-files .equipop-actions-stack > .csv-file-btn,
  .page-characteristics-mn .mn-title-files .equipop-actions-stack > .btn,
  .page-characteristics-mn .mn-title-files .equipop-actions-stack > .csv-file-btn {
    width: 100%;
    min-width: 0;
  }

  .page-models .models-tabs-head .summary-mid-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .page-models #tableModelsOverview {
    min-width: 980px;
  }

  .page-models #tableModelsOverview th:nth-child(9),
  .page-models #tableModelsOverview td:nth-child(9),
  .page-characteristics-mn .equipop-table-wrap .mn-models-table thead th.equipop-col-actions,
  .page-characteristics-mn .equipop-table-wrap .mn-models-table tbody td.equipop-col-actions {
    position: static;
    right: auto;
    box-shadow: none;
  }

  .page-model-detail #modelOpsContainer .table-wrap .model-detail-eq-table,
  .page-add-model #draftTable {
    min-width: 760px;
  }

  .page-model-detail .model-detail-side-fields,
  .page-add-model .model-detail-side-fields {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .page-model-detail .model-detail-save-btn {
    width: 100%;
  }

  .page-add-model .add-row.u-gap-075.u-items-start.u-flex-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .page-add-model .add-row.u-gap-075.u-items-start.u-flex-wrap > * {
    width: 100%;
    min-width: 0 !important;
  }

  .page-add-model .add-model-add-btn--right {
    align-self: stretch;
  }

  .page-add-model .floating-save-btn {
    left: 0.55rem;
    right: 0.55rem;
    width: auto;
  }

  .page-model-adaptation .model-adaptation-grid {
    grid-template-columns: 1fr;
    row-gap: 0.7rem;
  }

  .page-model-adaptation .model-adaptation-inline {
    white-space: normal;
    flex-wrap: wrap;
  }

  .page-model-adaptation .model-adaptation-mode {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .page-model-adaptation .model-adaptation-mode__btn {
    flex: 1 1 140px;
  }

  .page-model-adaptation .model-adaptation-note br {
    display: none;
  }

  .page-characteristics .section__title {
    word-break: break-word;
  }

  .page-characteristics .add-row {
    flex-wrap: wrap;
  }

  .page-characteristics .add-row > .input,
  .page-characteristics .add-row > .btn {
    width: 100%;
  }

  .page-characteristics-equipop .equipop-top-row,
  .page-characteristics-mn .mn-model-page-top {
    grid-template-columns: 1fr;
    row-gap: 0.5rem;
  }

  .page-characteristics-equipop .equipop-op-main-row {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.35rem;
  }

  .page-characteristics-equipop .equipop-op-inline-actions {
    width: 100%;
    justify-content: stretch;
  }

  .page-characteristics-equipop .equipop-op-inline-actions .btn {
    flex: 1 1 0;
  }

  .page-characteristics-equipop .equipop-table-wrap .equipop-links-table,
  .page-characteristics-mn .equipop-table-wrap .mn-models-table {
    min-width: 760px;
  }
}

@media (max-width: 560px) {
  .page-models .models-title-files .equipop-actions-stack,
  .page-characteristics-equipop .equipop-title-files .equipop-actions-stack,
  .page-characteristics-mn .mn-title-files .equipop-actions-stack {
    grid-template-columns: 1fr;
  }
}


