.attach-cell {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
  overflow: hidden;
  /* Фиксированная высота: до загрузки внутри ячейки только кнопка «+» (20px),
     после загрузки — кнопка + миниатюра (22px). Без явной height/min-height
     строка визуально «проседает на 1–2 px», когда у одной СЗ файлы есть,
     а у соседних — нет (это и видит пользователь как «дёргание» при upload). */
  height: 24px;
  /* Гарантия: cell не превышает родительский td даже если суммарная ширина
     flex-children (upload-btn + N миниатюр) больше ширины колонки. Без этого
     при загрузке файла visually видно «вылезание» за край ячейки. */
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  /* Изолируем layout-пересчёт внутри ячейки — изменения детей не дёргают
     ширину/высоту других td в таблице. */
  contain: layout;
}

.attach-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
  text-decoration: none;
  flex-shrink: 0;
}

.attach-img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: cover;
}

.attach-pdf {
  flex-direction: column;
  background: rgba(255,90,60,0.18);
  padding: 1px 4px;
  height: 22px;
  max-width: 60px;
  justify-content: center;
}

.attach-pdf-icon {
  font-size: 7px;
  font-weight: 700;
  color: #ff5a3c;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.attach-pdf-name {
  font-size: 6px;
  color: #ccc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 56px;
  display: block;
  line-height: 1.2;
}

.attach-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  border: none;
  color: #fff;
  background: #3d7fd4;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.attach-upload-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.12);
}

.attach-upload-btn.is-uploading {
  opacity: 1;
  cursor: wait;
  animation: attach-pulse 0.7s ease-in-out infinite alternate;
}

@keyframes attach-pulse {
  from { background: #3d7fd4; }
  to   { background: #1a4fa0; }
}

.attach-upload-btn input[type="file"] {
  display: none;
}

.attach-thumb-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.attach-del {
  opacity: 0;
  position: absolute;
  top: 0;
  right: 0;
  width: 13px;
  height: 13px;
  border-radius: 0 3px 0 3px;
  background: rgba(200, 30, 20, 0.88);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 9px;
  line-height: 13px;
  text-align: center;
  padding: 0;
  z-index: 2;
  transition: opacity 0.08s;
}

.attach-thumb-wrap:hover .attach-del {
  opacity: 1;
}

/* ── Фиксация брака/простоя мастером в колонке «Брак / простои» (in-work МР-строки) ──
 * Выпадашка в ЕДИНОМ стиле с «Режимом запуска» Плана (.plan-launch-select): мягкий
 * фиолетовый, мелкий шрифт (столбец не расширяется), нативный caret. app-prod-fact-loss.js. */
.fact-loss-select {
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 700;
  color: #ede9fe;
  background: rgba(109, 92, 178, 0.5);
  border: 1px solid rgba(167, 139, 250, 0.55);
  border-radius: 7px;
  padding: 2px 4px;
  min-height: 22px;
  max-width: 100%;
  cursor: pointer;
}
.fact-loss-select:focus {
  outline: none;
  border-color: rgba(177, 213, 255, 0.72);
}
.fact-loss-select option {
  color: #1f2937;
  background: #fff;
}
.fact-loss-select option:disabled {
  color: #9ca3af;
}

/* Активный простой/пауза у in-work МР-строки (app-prod-fact-loss.js): плашка + «Продолжить».
 * Янтарный — цвет потерь (как «простой» в Отчёте потерь). */
.fact-pause-active {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}
.fact-pause-resume {
  margin-left: 5px;
  padding: 2px 8px;
  border: 1px solid rgba(180, 83, 9, 0.5);
  border-radius: 7px;
  background: #d97706;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
  font-family: inherit;
}
.fact-pause-resume:hover {
  background: #b45309;
}

/* ── Сплит-кнопка «+ СЗ на производство» + стрелочка режимов (app-prod-plan.js) ──
 * Кнопка = стандартный режим (по умолчанию); ▾ → меню «Ручной режим мастера (МР)» /
 * «Внеплановое». Кнопка и стрелочка в одном блоке, но клики раздельные. */
.plan-send-split {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}
.plan-send-split .plan-send-main {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.plan-send-split .plan-send-caret {
  min-width: 0;
  width: 24px;
  padding: 5px 0;
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left-color: rgba(122, 171, 240, 0.6);
  font-size: 11px;
  line-height: 1;
}
.plan-send-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  display: none;
  flex-direction: column;
  min-width: 210px;
  padding: 4px;
  background: #0e2947;
  border: 1px solid rgba(125, 158, 209, 0.34);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
  z-index: 60;
}
.plan-send-split.open .plan-send-menu {
  display: flex;
}
.plan-send-item {
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #dce8fb;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.plan-send-item:hover {
  background: rgba(60, 109, 175, 0.45);
}
