.plan-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.plan-toolbar #planDuplicateBtn {
  margin-left: 24px;
}

.plan-toolbar-meta {
  margin: -2px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.plan-toolbar-note {
  color: #b7c7dc;
  font-size: 11px;
  line-height: 1.35;
}

.plan-inline-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(138, 167, 206, 0.28);
  background: rgba(10, 28, 52, 0.45);
  color: #dce8fb;
  font-size: 11px;
  font-weight: 650;
}

.plan-inline-status.is-ok {
  color: #d8fbe6;
  border-color: rgba(128, 206, 145, 0.34);
  background: rgba(53, 114, 79, 0.32);
}

.plan-inline-status.is-warn {
  color: #ffe2a8;
  border-color: rgba(243, 198, 117, 0.42);
  background: rgba(123, 89, 38, 0.3);
}

.plan-inline-status.is-error {
  color: #fde5f2;
  border-color: rgba(220, 161, 190, 0.42);
  background: rgba(121, 70, 100, 0.35);
}

.plan-btn {
  border: 1px solid rgba(125, 158, 209, 0.26);
  color: #dce8fb;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 5px 12px;
  min-width: 118px;
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(10, 28, 52, 0.62);
  /* contain:paint — против НАКОПИТЕЛЬНОГО «съедания» скруглённых углов кнопок (тёмный квадрат):
     при работе SPA (автообновление таблицы каждые ~10с + переходы по листам) Chrome под нагрузкой
     ронял обрезку угла у полупрозрачной кнопки над прокручиваемой таблицей; F5 лечил до следующего
     накопления (минуты). contain:paint = «рисуй кнопку самостоятельным блоком» → браузер держит её
     клип стабильным. Лёгкая подсказка (вид кнопки НЕ меняет, слабым ПК не вредит — наоборот).
     ⛔ НЕ слой/transform: translateZ на кнопку (d9949412) на части GPU САМ рисует тёмный угол;
     translateZ на кнопку/таблицу (попытки 2-3) и backdrop-filter (попытка 1) — мимо, НЕ возвращать. */
  contain: paint;
}

.plan-btn.green {
  border-color: rgba(128, 206, 145, 0.38);
  color: #d7f5e2;
  background: rgba(53, 114, 79, 0.4);
}

.plan-btn.blue {
  border-color: rgba(122, 171, 240, 0.4);
  color: #daebff;
  background: rgba(47, 87, 143, 0.42);
}

.plan-btn.blue.is-active {
  border-color: rgba(177, 213, 255, 0.72);
  background: rgba(60, 109, 175, 0.62);
}

.plan-btn.red {
  border-color: rgba(220, 161, 190, 0.42);
  color: #fde5f2;
  background: rgba(121, 70, 100, 0.43);
}

.plan-btn.purple {
  border-color: rgba(170, 149, 222, 0.42);
  color: #efe8ff;
  background: rgba(93, 74, 142, 0.44);
}

.plan-btn.yellow {
  margin-left: auto;
  border-color: rgba(243, 198, 117, 0.5);
  color: #ffe2a8;
  background: rgba(123, 89, 38, 0.35);
}

.plan-sheet {
  border: 1px solid #7ea2c4;
  border-radius: 10px;
  background: #e8edf5;
  overflow: hidden;
}


.plan-sheet-title {
  display: inline-flex;
  align-items: center;
  margin: 8px 0 0 8px;
  border-radius: 7px;
  background: #29557c;
  color: #ebf3ff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
}

.plan-table-wrap {
  margin-top: 0;
  overflow: auto;
}

.page-shell.accounting-mode {
  display: flex;
  flex-direction: column;
  height: var(--accounting-shell-height, calc(100vh - 172px));
  min-height: var(--accounting-shell-height, calc(100vh - 172px));
  overflow: hidden;
}

.page-shell.production-mode {
  display: flex;
  flex-direction: column;
  height: var(--production-shell-height, calc(100vh - 172px));
  min-height: var(--production-shell-height, calc(100vh - 172px));
  overflow: hidden;
}

.page-shell.employees-mode {
  display: flex;
  flex-direction: column;
  height: var(--employees-shell-height, calc(100vh - 172px));
  min-height: var(--employees-shell-height, calc(100vh - 172px));
  overflow: hidden;
}

.page-shell.report-employees-mode {
  display: flex;
  flex-direction: column;
  height: var(--report-employees-shell-height, calc(100vh - 172px));
  min-height: var(--report-employees-shell-height, calc(100vh - 172px));
  overflow: hidden;
}

.page-shell.dashboard-mode {
  display: flex;
  flex-direction: column;
  height: var(--dashboard-shell-height, calc(100vh - 172px));
  min-height: var(--dashboard-shell-height, calc(100vh - 172px));
  overflow: hidden;
}

.page-shell.dashboard-mode.panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.production-sheet {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.employees-sheet {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.report-employees-sheet {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.production-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* GPU-изоляция: скролл-контейнеры таблиц — в собственный композитный слой.
   Скролл/перерисовка sticky-шапок и строк живёт внутри слоя таблицы и больше не
   инвалидирует тайлы тулбара над ней — у кнопок (.plan-btn) не «съедаются» углы
   тёмным квадратом (GPU-артефакт клиппинга border-radius, лечим первоисточник).
   Контейнеры прямоугольные (без border-radius) — собственных угловых артефактов
   слой не даёт. position:fixed-потомков внутри нет (тултип живёт в body). */
.production-table-wrap,
.employees-table-wrap,
.accounting-table-wrap,
.report-employees-table-wrap {
  transform: translateZ(0);
}

.employees-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.employees-table-wrap #empListTable thead th {
  position: sticky;
  top: 0;
  z-index: 6;
}

.employees-table-wrap #empListTable thead th.report-emp-gear-col {
  z-index: 7;
}

.employees-table-wrap #empLeadTable thead th {
  position: sticky;
  top: 0;
  z-index: 6;
}

.employees-table-wrap #empLeadTable thead th.report-emp-gear-col {
  z-index: 7;
}

.production-table-wrap .plan-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
}

.production-table-wrap .plan-table thead th.report-emp-gear-col {
  z-index: 7;
}

.accounting-table-wrap #reportAccountingTable thead th {
  position: sticky;
  top: 0;
  z-index: 6;
}

.accounting-table-wrap #reportAccountingTable thead th.report-acc-gear-col {
  z-index: 7;
}

.report-employees-table-wrap #reportEmployeesTable thead th,
.report-employees-table-wrap #reportLossesTable thead th {
  position: sticky;
  top: 0;
  z-index: 6;
}

.report-employees-table-wrap #reportEmployeesTable thead th.report-emp-gear-col,
.report-employees-table-wrap #reportLossesTable thead th.report-emp-gear-col {
  z-index: 7;
}

.report-employees-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.production-sheet .plan-pagination {
  flex: 0 0 auto;
}

.employees-sheet .plan-pagination {
  flex: 0 0 auto;
}

.report-employees-sheet .plan-pagination {
  flex: 0 0 auto;
}


.plan-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #1d2a3b;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 10px;
}


.plan-table th,
.plan-table td {
  border-right: 1px solid #c6d2df;
  border-bottom: 1px solid #c6d2df;
  padding: 3px 5px;
  white-space: nowrap;
}

.plan-table th {
  position: relative;
  background: linear-gradient(180deg, #2f5f8a, #284d72);
  color: #ebf3ff;
  font-weight: 650;
  font-size: 10px;
  line-height: 1.15;
  white-space: normal;
  text-transform: none;
}

.plan-table td {
  position: relative;
  background: #f9fbfe;
  font-size: 10px;
  line-height: 1.25;
  overflow: visible;
}

.plan-table tbody tr:nth-child(even) td {
  background: #f2f6fb;
}

.plan-table .t-center {
  text-align: center;
}

.plan-check {
  width: 12px;
  height: 12px;
  cursor: pointer;
}

.plan-table tbody tr.plan-empty-row td,
.plan-table tbody tr.archive-empty-row td,
.plan-table tbody tr.brigade-empty-row td {
  height: 26px;
}

.plan-empty-check,
.archive-empty-check,
.brigade-empty-check,
.employee-empty-check,
.employee-lead-empty-check {
  opacity: 0.35;
}

.brigade-empty-row .brigade-lead-check {
  opacity: 0.35;
}

.col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

.col-resizer:hover {
  background: rgba(255, 255, 255, 0.24);
}

.cell-select {
  min-height: 16px;
  border-radius: 999px;
  padding: 0 6px;
  background: #e9eef5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.cell-value {
  font-size: 10px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-select.empty {
  color: #9aa7b9;
}

.plan-empty-cell {
  min-height: 22px;
  border-radius: 8px;
  background: #eef3f9;
}

.plan-select-shell {
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  min-height: 22px;
  border: 1px solid #c7d3e2;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff, #ebf1f8);
  overflow: hidden;
}

.plan-select-shell.is-disabled {
  background: linear-gradient(180deg, #eef2f7, #e4eaf1);
  opacity: 0.78;
}

.plan-status-shell {
  border-color: transparent;
}

.plan-status-shell.status-new {
  background: #6d58aa;
}

.plan-status-shell.status-work {
  background: #3d73b2;
}

.plan-status-shell.status-failed {
  background: #c05a81;
}

.plan-status-shell.status-partial {
  background: #e6cc78;
}

.plan-status-shell.status-done {
  background: #2f9268;
}

.plan-status-shell.status-overfulfilled {
  background: #2191a6;
}

.plan-status-shell.status-wait {
  background: #de9a52;
}

/* «остаток» — нейтральный перенос на следующую смену (не проблема). Холодный
   слейт-серый, отличается от синего «в работе» и не похож на тёплый/красный. */
.plan-status-shell.status-remainder {
  background: #6e7b88;
}

.plan-cell-select,
.plan-cell-input {
  width: 100%;
  min-width: 0;
  min-height: 22px;
  border: 0;
  outline: none;
  background: transparent;
  color: #213852;
  font: inherit;
  font-size: 10px;
  padding: 0 7px;
}

.plan-cell-select {
  appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #617387 50%), linear-gradient(135deg, #617387 50%, transparent 50%);
  background-position: calc(100% - 10px) 9px, calc(100% - 6px) 9px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  padding-right: 18px;
}

.plan-cell-select:disabled {
  color: #7f90a4;
  cursor: default;
}

.plan-cell-input::placeholder {
  color: #8b9aad;
}

.plan-status-select {
  color: #ffffff;
  font-weight: 700;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.92) 50%), linear-gradient(135deg, rgba(255, 255, 255, 0.92) 50%, transparent 50%);
}

.plan-status-shell.status-partial .plan-status-select,
.plan-status-shell.status-wait .plan-status-select {
  color: #4f3d18;
  background-image: linear-gradient(45deg, transparent 50%, rgba(79, 61, 24, 0.9) 50%), linear-gradient(135deg, rgba(79, 61, 24, 0.9) 50%, transparent 50%);
}

.cell-caret {
  color: #607287;
  font-size: 8px;
}

.plan-status-wrap {
  position: relative;
}

.plan-status-wrap.open {
  z-index: 20;
}

.plan-status-button {
  border: 0;
  background: transparent;
  width: 100%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  cursor: pointer;
}

.status-caret {
  color: #607287;
  font-size: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 15px;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
}

.plan-status-static {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-new {
  color: #f4edff;
  background: #6d58aa;
}

.status-work {
  color: #e6f2ff;
  background: #3d73b2;
}

.status-failed {
  color: #ffe9f0;
  background: #c05a81;
}

.status-partial {
  color: #4f3d18;
  background: #e6cc78;
}

.status-done {
  color: #e7fff2;
  background: #2f9268;
}

.status-overfulfilled {
  color: #e6faff;
  background: #2191a6;
}

.status-wait {
  color: #5a3a13;
  background: #de9a52;
}

.status-remainder {
  color: #eef2f6;
  background: #6e7b88;
}

.status-empty-cell {
  background: #f9fbfe;
}

/* Статус ПЗ (список «Производственный заказ»): новый — фиолетовый,
   в работе — синий (как status-work), завершён — зелёный (как status-done). */
.pz-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 640;
  line-height: 1;
  white-space: nowrap;
}
.pz-stat-new { color: #efe9fb; background: #6f54a8; }
.pz-stat-work { color: #e6f2ff; background: #3d73b2; }
.pz-stat-done { color: #e7fff2; background: #2f9268; }
.pz-stat-default { color: #eef2f6; background: #6e7b88; }

.archive-saved {
  color: #2b8e49;
  font-weight: 700;
}

.archive-unsaved {
  color: #b83b30;
  font-weight: 700;
}

/* «Состояние записи»: мелкая причина под chip (например «сумма ≠ 100%»).
   Это НЕ состояние записи — состояние показывает chip «не сохранено». */
.rec-state-reason {
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.2;
  color: #b42318;
}

.plan-op-menu {
  min-width: 280px;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
}

.plan-op-wrap.open .plan-op-menu {
  display: block;
}

.plan-op-search-wrap {
  position: sticky;
  top: 0;
  background: #ffffff;
  padding-bottom: 6px;
  z-index: 2;
  border-bottom: 1px solid #e0e6ef;
  margin-bottom: 6px;
}

.plan-op-search {
  width: 100%;
  min-height: 26px;
  border: 1px solid #9fb4cd;
  border-radius: 6px;
  background: #f7f9fd;
  color: #1d3353;
  padding: 0 8px;
  font: inherit;
  font-size: 11px;
  outline: none;
}

.plan-op-search:focus {
  border-color: #4779b6;
  background: #ffffff;
}

.plan-op-section[hidden] {
  display: none;
}

.plan-op-section-title {
  color: #6a7b91;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 2px 2px;
}

.plan-op-section {
  display: grid;
  gap: 2px;
  padding-bottom: 4px;
}

.plan-op-option[hidden] {
  display: none;
}

.plan-op-empty {
  color: #7a8ba3;
  font-size: 11px;
  padding: 10px 6px;
  text-align: center;
  font-style: italic;
}

.plan-op-empty[hidden] {
  display: none;
}

/* Колонки, которые ресайзер должен реально сжимать. max-width:0 +
   overflow:hidden — единственный способ заставить table-layout:fixed
   слушать col[style.width=Xpx]: без этого col при getBoundingClientRect
   возвращает «минимальную по контенту» ширину (по самому длинному
   <button> с nowrap или по flex-цепочке миниатюр), ресайзер сохраняет
   эту защищённую ширину обратно в state и колонка визуально возвращается.
   Селекторы прибиты к конкретным таблицам (а не общим .plan-table),
   чтобы не задевать одноимённые позиции в Plan/Fact с разным смыслом.

   2026-05-25 PLAN-1: индексы сдвинулись после b28bbe30 (+4 кол. в Plan: №ПЗ
   на idx 3, Участок на 7, №МК/Тип ОП в конец) и f1f9d5b8 (+3 кол. в Fact:
   №ПЗ на 3, Участок на 7, Тип СЗ в конец). nth-child(11) в Plan теперь
   указывал на «основной сотрудник» — overflow:hidden обрезал .plan-cell-menu
   (position:absolute), выпадашка не открывалась и блокировала назначение
   сотрудника на СЗ. Аналогично nth-child(15) в Fact указывал на «бригада».
   Новые индексы: Plan comment=13, attach=14; Fact workerComment=17, attach=18. */
#prodPlanTable tbody td:nth-child(13),  /* Plan: комментарии */
#prodPlanTable tbody td:nth-child(14),  /* Plan: файлы СЗ */
#prodFactTable tbody td:nth-child(17),  /* Fact: комментарии от рабочих */
#prodFactTable tbody td:nth-child(18) { /* Fact: файлы СЗ */
  max-width: 0;
  overflow: hidden;
}

/* Readonly-ячейка с подсказкой при наведении (используется для
   «комментарии от рабочих» в Факте: то же поведение, что у редактируемой
   комментарии в Плане, но без cursor:text и без editable behavior). */
.plan-cell-readonly {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: #1d3353;
  padding: 0 3px;
  cursor: default;
}

/* Кастомный popover-tooltip для длинных комментариев. Реализация через JS-
   узел в `<body>` (см. planCellTooltipInit в app-prod-edit.js), а не через
   `::after` на кнопке: у кнопки и её td стоит `overflow:hidden` (для ellipsis
   и сжатия столбца), и любой absolute-псевдо-элемент будет обрезан по краю
   ячейки — popover не виден. */
.plan-cell-tooltip {
  position: fixed;
  z-index: 9999;
  display: none;
  width: max-content;
  max-width: 260px;
  padding: 6px 8px;
  border-radius: 5px;
  background: #1f2937;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(15, 30, 60, 0.25);
}

/* ── Employee search dropdown (mirrors plan-op) ── */
/* Двойной класс — специфичнее, чем общий .plan-cell-menu { min-width: 220px },
   иначе длинные ФИО типа «E-001 Длинная-Фамилия Имя Отчество» снова
   обрезаются: 220 < нужного места под «ID Фамилия Имя + чип режима». */
.plan-cell-menu.plan-emp-menu {
  min-width: 340px;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
}

.plan-emp-wrap.open .plan-emp-menu {
  display: block;
}

.plan-emp-search {
  width: 100%;
  min-height: 26px;
  border: 1px solid #9fb4cd;
  border-radius: 6px;
  background: #f7f9fd;
  color: #1d3353;
  padding: 0 8px;
  font: inherit;
  font-size: 11px;
  outline: none;
}

.plan-emp-search:focus {
  border-color: #4779b6;
  background: #ffffff;
}

.plan-emp-empty {
  color: #7a8ba3;
  font-size: 11px;
  padding: 10px 6px;
  text-align: center;
  font-style: italic;
}

.plan-emp-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.plan-emp-opt-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-emp-opt-chip {
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 600;
  color: #2752a8;
  background: #e7eefb;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.4;
}

.plan-emp-opt-chip.is-empty {
  color: #9aa6bb;
  background: transparent;
  font-weight: 400;
}

.plan-emp-option[hidden] {
  display: none;
}

.plan-emp-empty[hidden] {
  display: none;
}
