/* styles-equipment.css — «Справочник оборудования»: лампа, учёт, доступ,
 * обслуживание, итог парка, меню наклеек, карточка станка.
 * Общее с соседними листами (таблица, выпадашки, кнопки) — из их же файлов. */

/* Ячейки таблицы режутся по ширине колонки, как у номенклатуры; выпадашки и
 * файлы — исключение (иначе меню обрезается по высоте строки). */
#prodEquipmentTable td { overflow: hidden; text-overflow: ellipsis; max-width: 0; }
#prodEquipmentTable td.eq-dd-td,
#prodEquipmentTable td.eq-access-td,
#prodEquipmentTable td.eq-files-td { overflow: visible; max-width: none; }
#prodEquipmentTable .archive-cell-menu { max-height: 260px; }
#prodEquipmentTable tr.eq-row-sold td { opacity: 0.6; }
#prodEquipmentTable tr.eq-row-sold td:first-child { opacity: 1; }

/* № и название — ссылка в карточку */
.eq-name-cell { display: flex; align-items: center; gap: 4px; min-width: 0; }
.eq-card-link {
  border: 0; background: transparent; padding: 0; font: inherit; color: #1f4f8f;
  cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.eq-name-link { font-weight: 600; flex: 1 1 auto; min-width: 0; }
.eq-card-link:hover { text-decoration: underline; }
.eq-name-pencil {
  flex: 0 0 auto; width: 20px; min-width: 20px; padding: 0; text-align: center;
  color: #7d8ea6; opacity: 0; transition: opacity 0.15s;
}
.eq-name-cell:hover .eq-name-pencil, .eq-name-pencil.is-editing { opacity: 1; }
#prodEquipmentTable .eq-name-pencil.is-editing { width: 100%; }

/* Учёт: рабочий / запасной */
.eq-status-pill {
  display: inline-flex; align-items: center; min-height: 15px; border-radius: 999px;
  padding: 0 7px; font-size: 10px; font-weight: 700;
}
.eq-status-pill.is-working { color: #e6f2ff; background: #3d73b2; }
.eq-status-pill.is-spare { color: #3f4a5c; background: #d9e0ea; }

/* Лампа: 🟢 работает · 🟡 на ремонте · 🔴 не работает · ⚪ запас / продан */
.eq-lamp { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.eq-lamp i { width: 10px; height: 10px; border-radius: 50%; background: #c3cad6; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05) inset; }
.eq-lamp.is-working { color: #1f7a4d; }
.eq-lamp.is-working i { background: #2fb36d; box-shadow: 0 0 0 3px rgba(47, 179, 109, 0.22); }
.eq-lamp.is-repair { color: #8a5a00; }
.eq-lamp.is-repair i { background: #f2b52d; box-shadow: 0 0 0 3px rgba(242, 181, 45, 0.25); }
.eq-lamp.is-idle { color: #a2262f; }
.eq-lamp.is-idle i { background: #e0454f; box-shadow: 0 0 0 3px rgba(224, 69, 79, 0.2); }
.eq-lamp.is-spare, .eq-lamp.is-sold { color: #6b7280; }

/* Обслуживание: ближайшее ТО / последнее */
.eq-svc-link { display: flex; flex-direction: column; gap: 1px; width: 100%; font-size: 11px; line-height: 1.25; }
.eq-svc-next { color: #1f4f8f; font-weight: 600; }
.eq-svc-next.is-overdue { color: #c0262e; }
.eq-svc-last, .eq-svc-empty { color: #6b7280; font-weight: 400; }

/* Даты — родные поля, в размер ячейки */
#prodEquipmentTable .eq-date { width: 100%; min-height: 24px; border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; font-size: 11px; color: inherit; padding: 0 4px; }
#prodEquipmentTable .eq-date:hover, #prodEquipmentTable .eq-date:focus { border-color: #9fb4cd; background: #f7f9fd; outline: none; }

/* Доступ: список с галочками и поиском */
.eq-access-wrap.open .eq-access-menu { display: block; }
.plan-cell-menu.eq-access-menu { min-width: 320px; max-height: 320px; overflow: auto; padding: 8px; }
.eq-access-search { width: 100%; min-height: 26px; border: 1px solid #9fb4cd; border-radius: 6px; background: #f7f9fd; padding: 0 8px; font: inherit; font-size: 12px; margin-bottom: 6px; }
.eq-access-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.eq-access-item:hover { background: #eef3fb; }
.eq-access-item input { margin: 0; }
.eq-access-all { width: 100%; text-align: left; margin-bottom: 4px; }

/* Своя категория — поле прямо в меню */
.eq-custom-wrap { padding: 2px; }
.eq-custom-input { width: 100%; }

/* Меню «Наклейки QR ▾» — тёмное, как «Скачать» у заказов */
.eq-dl-wrap { position: relative; display: inline-block; }
.eq-dl-menu {
  display: none; position: absolute; top: 100%; left: 0; margin-top: 4px; min-width: 250px; z-index: 100;
  background: #0e243f; border: 1px solid rgba(125, 158, 209, 0.35); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); overflow: hidden; padding: 4px 0;
}
.eq-dl-item { display: block; width: 100%; text-align: left; padding: 9px 16px; background: transparent; border: 0; color: #e9eef8; cursor: pointer; font: inherit; font-size: 13px; white-space: nowrap; }
.eq-dl-item:hover { background: rgba(125, 158, 209, 0.18); }
.eq-dl-divider { height: 1px; background: rgba(125, 158, 209, 0.25); margin: 4px 0; }
.eq-dl-note { padding: 6px 16px 8px; font-size: 11px; color: #7d9ed1; }

/* Подвал листа: пагинация слева, итог парка справа (классы Бухгалтерии) */
.eq-footer .accounting-footer-right { gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.eq-total-group { display: inline-flex; align-items: center; gap: 10px; padding: 3px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.55); border: 1px solid #c6d2df; }
.eq-total-lamp { gap: 5px; }
.eq-total-lamp .eq-lamp { gap: 0; }
.eq-total-lamp .eq-lamp i { width: 11px; height: 11px; }
.eq-total-lamp + .eq-total-lamp { margin-left: 4px; }

/* Карточка станка — полноэкранный вид листа (как «Состав ПЗ») */
.eq-cardpage-toolbar-title { margin-left: auto; font-size: 13px; font-weight: 700; color: #e9eef8; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq-cardpage-sheet { overflow: auto; }
.eq-cardpage { background: #fff; border-radius: 12px; padding: 18px 22px 22px; color: #1f2937; font-family: inherit; min-height: 100%; box-sizing: border-box; }
.eq-card-loading { padding: 30px; text-align: center; color: #6b7280; background: #fff; border-radius: 12px; }
.eq-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.eq-card-title { font-size: 18px; font-weight: 700; color: #111827; }
.eq-card-sub { font-size: 12.5px; color: #6b7280; margin-top: 2px; }
.eq-card-head-right { display: flex; align-items: center; gap: 10px; }
.eq-card-money { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.eq-card-money-item { border: 1px solid #e1e7f0; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; background: #f8fafd; }
.eq-card-money-item span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px; color: #6b7a90; }
.eq-card-money-item strong { font-size: 15px; color: #1a2a44; }
.eq-card-money-item em { font-style: normal; font-size: 11px; color: #6b7a90; }
.eq-card-money-item.is-total { background: #eaf3ff; border-color: #bcd3f1; }
.eq-card-money-item.is-sold { background: #fdf3e6; border-color: #f0d3a8; }
.eq-card-journal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.eq-card-journal-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: #111827; }
.eq-card-table-wrap { overflow: auto; border: 1px solid #e1e7f0; border-radius: 10px; }
.eq-card-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.eq-card-table th { text-align: left; font-size: 11px; color: #4b5a70; background: #f4f7fb; padding: 8px 10px; border-bottom: 1px solid #e1e7f0; }
.eq-card-table td { padding: 8px 10px; border-bottom: 1px solid #edf1f6; vertical-align: top; }
.eq-card-table tr:last-child td { border-bottom: 0; }
.eq-card-table .t-right { text-align: right; }
.eq-card-rec.is-open-repair td { background: #fff8e6; }
.eq-kind { display: inline-flex; border-radius: 999px; padding: 1px 8px; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.eq-kind.is-maintenance { background: #dcecff; color: #1f4f8f; }
.eq-kind.is-repair { background: #ffe4b8; color: #8a5a00; }
.eq-kind.is-parts { background: #e3f3e8; color: #1f7a4d; }
.eq-kind-open { font-size: 10px; color: #a2262f; margin-top: 2px; }
.eq-card-empty { text-align: center; color: #6b7280; padding: 18px !important; }
.eq-card-actions { white-space: nowrap; text-align: right; }
.eq-card-edit, .eq-card-del { border: 1px solid #d1d5db; background: #fff; border-radius: 6px; width: 26px; height: 26px; cursor: pointer; color: #374151; margin-left: 4px; font-size: 13px; }
.eq-card-del:hover { color: #b91c1c; border-color: #f0b4b4; }
.eq-card-input { width: 100%; box-sizing: border-box; min-height: 28px; border: 1px solid #cfd8e5; border-radius: 6px; padding: 0 8px; font: inherit; font-size: 12px; background: #fff; }
.eq-card-rec.is-editing td { background: #eaf3ff; }
.eq-card-journal-count { font-size: 12px; color: #6b7a90; }

/* Форма записи журнала — блок над таблицей, поля с подписями */
.eq-cardpage-form { border: 1px solid #bcd3f1; background: #f4f8fe; border-radius: 10px; padding: 12px 14px 10px; margin-bottom: 12px; }
.eq-cardpage-form-title { font-size: 12px; font-weight: 700; color: #1d4d8a; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.eq-cardpage-form-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 8px 12px; }
.eq-cardpage-form-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: #4b5a70; min-width: 0; }
.eq-cardpage-form-grid label.is-wide { grid-column: span 2; }
.eq-cardpage-form-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.eq-cardpage-form-actions .plan-btn { min-height: 28px; padding: 0 14px; font-size: 12.5px; }
.eq-cardpage-form-actions .plan-btn:not(.green) { background: #fff; color: #1f2937; border: 1px solid #cfd8e5; }
.eq-cardpage-form-hint { margin-left: auto; font-size: 11px; color: #6b7a90; }
@media (max-width: 900px) { .eq-cardpage-form-grid { grid-template-columns: repeat(2, 1fr); } }
