/* ── Планирование по операциям ─────────────────────────── */
#sched-board-wrap {
  position: relative;
  overflow-x: auto;
  overflow-y: auto;
  height: calc(100vh - 194px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 8px);
  background: var(--bg2);
  cursor: grab;
  user-select: none;
}

#sched-board-wrap.sched-dragging {
  cursor: grabbing;
}

.sched-date-badge-anchor {
  position: sticky;
  left: 0;
  top: 0;
  height: 0;
  z-index: 20;
}

.sched-date-badge {
  position: absolute;
  top: 6px;
  left: 208px;
  background: var(--accent, #3b82f6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius, 6px);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.sched-scroll {
  position: relative;
  min-width: min-content;
}

.sched-header-row {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg2);
  border-bottom: 1px solid var(--border2);
}

.sched-row-label-spacer {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  left: 0;
  background: var(--bg2);
  z-index: 6;
}

.sched-hours {
  display: flex;
}

.sched-hour-tick {
  flex-shrink: 0;
  font-size: 9px;
  color: var(--text3);
  padding: 6px 0 6px 4px;
  border-left: 1px solid var(--border);
  box-sizing: border-box;
}

.sched-hour-tick b {
  color: var(--accent);
  font-size: 10px;
}

.sched-row {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.sched-row-label {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  left: 0;
  background: var(--bg2);
  z-index: 4;
  padding: 8px 10px;
  border-right: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sched-drag-handle {
  flex-shrink: 0;
  cursor: grab;
  color: var(--text3);
  font-size: 15px;
  line-height: 1;
  user-select: none;
}

.sched-drag-handle:active {
  cursor: grabbing;
}

.sched-row.sortable-ghost {
  opacity: 0.35;
}

.sched-machine-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.sched-machine-load {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
}

.sched-row-track {
  position: relative;
  min-height: 48px;
}

.sched-block {
  position: absolute;
  top: 6px;
  bottom: 6px;
  background: var(--accent-glow, rgba(59,130,246,0.18));
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 3px 6px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 4px;
  transition: filter 0.1s;
}

.sched-block:hover {
  filter: brightness(1.25);
}

.sched-block-overdue {
  border-color: var(--red-text, #ef4444);
  background: var(--red-bg, rgba(239,68,68,0.15));
}

.sched-block-pinned {
  border-style: dashed;
}

.sched-pin-btn {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  line-height: 14px;
  font-size: 9px;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 3px;
  cursor: pointer;
  color: var(--text2);
}

.sched-pin-btn:hover {
  background: rgba(0, 0, 0, 0.65);
}

.sched-block-narad {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sched-block-op {
  font-size: 9px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sched-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--red-text, #ef4444);
  z-index: 3;
  pointer-events: none;
}

#sched-order-filter,
#sched-narad-filter {
  width: 170px;
  flex-shrink: 0;
}

/* ── Фильтр по станкам (чекбокс-дропдаун) ──────────────── */
.sched-mfilter {
  position: relative;
}

.sched-mfilter-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 220px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius, 6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  padding: 6px;
}

.sched-mfilter-menu.show {
  display: block;
}

.sched-mfilter-search {
  width: 100%;
  margin-bottom: 6px;
  font-size: 12px;
}

.sched-mfilter-actions {
  display: flex;
  gap: 10px;
  padding: 2px 6px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.sched-mfilter-actions a {
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
}

.sched-mfilter-actions a:hover {
  text-decoration: underline;
}

.sched-mfilter-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 6px;
  border-radius: var(--radius, 4px);
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
}

.sched-mfilter-item:hover {
  background: var(--bg4);
  color: var(--text);
}

.sched-mfilter-item input {
  cursor: pointer;
}
