.operations-planning {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.operations-planning > .selected-query-header {
  align-items: center;
  margin: 0;
}

.operations-schedule-backdrop {
  position: fixed;
  z-index: 10003;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 18px;
  background: rgba(18, 19, 18, .76);
}

.operations-calibration-layer {
  position: fixed;
  z-index: 10003;
  inset: 0;
}

.operations-calibration-menu {
  position: absolute;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 12px;
}

.operations-calibration-menu .selected-query-header { margin: 0; padding-bottom: 5px; border-bottom: 1px solid rgba(255, 255, 255, .22); }
.operations-calibration-menu .selected-query-header h3 { margin: 0; font-size: 1rem; }
.operations-calibration-menu .field { display: grid; gap: 4px; margin: 0; }
.operations-calibration-menu .field > span { font-size: .72rem; }
.operations-calibration-menu .field input { min-height: 32px; padding: 6px 8px; }
.operations-calibration-menu > .primary-button { justify-self: end; min-width: 92px; }

.operations-reset-forecast {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 38px;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  cursor: pointer;
}

.operations-reset-forecast > span:first-child { font-size: .82rem; }
.operations-reset-forecast input {
  position: absolute;
  inset-inline-end: 0;
  z-index: 1;
  width: 38px;
  height: 22px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.operations-toggle {
  position: relative;
  direction: ltr;
  width: 38px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  background: #292a28;
  transition: background 130ms ease, border-color 130ms ease;
}

.operations-toggle::after {
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d1d2cf;
  content: "";
  transition: transform 130ms ease, background 130ms ease;
}

.operations-reset-forecast input:checked + .operations-toggle { border-color: #c67c7c; background: #8f3434; }
.operations-reset-forecast input:checked + .operations-toggle::after { background: #fff; transform: translateX(16px); }
.operations-reset-forecast input:focus-visible + .operations-toggle { outline: 2px solid #fff; outline-offset: 2px; }

.operations-schedule-editor {
  display: grid;
  gap: 12px;
  width: min(820px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 16px;
}

.operations-kanban {
  display: grid;
  grid-auto-columns: minmax(280px, 310px);
  grid-auto-flow: column;
  align-items: stretch;
  gap: 12px;
  min-height: 430px;
  max-height: min(72vh, 760px);
  min-width: 0;
  overflow: auto hidden;
  overscroll-behavior-inline: contain;
  padding: 4px 4px 14px;
  scroll-snap-type: inline proximity;
  scrollbar-color: rgba(255, 255, 255, .42) transparent;
}

.operations-kanban-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 410px;
  max-height: 72vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 8px;
  background: #30312f;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .16);
  scroll-snap-align: start;
}

.operations-kanban-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 62px;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .045);
}

.operations-kanban-column > header > div {
  min-width: 0;
}

.operations-kanban-column > header h4 {
  margin: 0;
  overflow: hidden;
  font-size: .92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operations-kanban-column > header small {
  display: block;
  margin-top: 4px;
  color: #c8cac5;
  font-size: .68rem;
}

.operations-column-count {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 99px;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  font-size: .75rem;
  font-weight: 700;
}

.operations-needs-planning > header {
  border-top: 3px solid #dfa94e;
}

.operations-slaughtered > header {
  border-top: 3px solid #7ca786;
}

.operations-facility-days,
.operations-kanban-column > .operations-kanban-cards {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: 9px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  scrollbar-color: rgba(255, 255, 255, .35) transparent;
}

.operations-day-lane {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 6px;
  background: rgba(255, 255, 255, .035);
}

.operations-day-lane > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px 6px;
  color: #f5f5f3;
  font-size: .74rem;
}

.operations-day-lane > header small {
  color: #bfc1bc;
  font-size: .66rem;
}

.operations-kanban-cards {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 42px;
  padding: 7px;
}

.operations-kanban-cards[data-drop-target="true"]:empty::before {
  display: grid;
  min-height: 56px;
  place-items: center;
  padding: 5px;
  border: 1px dashed rgba(255, 255, 255, .2);
  border-radius: 5px;
  color: #aeb0ac;
  content: attr(data-empty-label);
  font-size: .7rem;
  text-align: center;
}

.operations-kanban-cards.is-drop-target-active {
  background: rgba(255, 255, 255, .08);
  outline: 1px solid rgba(255, 255, 255, .42);
  outline-offset: -1px;
}

.operations-day-lane .operations-kanban-cards:empty {
  background: rgba(255, 255, 255, .015);
}

.operations-flock-card {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 10px 9px 13px;
  border: 1px solid rgba(255, 255, 255, .21);
  border-inline-start: 3px solid #98a9b8;
  border-radius: 6px;
  background: #444542;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .14);
  font-size: .74rem;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.operations-flock-card[data-movable="true"] { cursor: grab; }
.operations-flock-card[data-movable="true"]:active { cursor: grabbing; }

.operations-flock-card:hover {
  border-color: rgba(255, 255, 255, .4);
  background: #4b4c49;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .2);
}

.operations-flock-card > strong {
  padding-inline-start: 16px;
  overflow: hidden;
  font-size: .81rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operations-flock-card > span:not(.operations-card-grip) {
  color: #dedfdb;
}

.operations-flock-card > small {
  color: #c5c7c2;
  line-height: 1.35;
}

.operations-card-grip {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  color: #bfc1bc;
  cursor: grab;
  font-size: .9rem;
  line-height: 1;
  user-select: none;
}

.operations-flock-card[data-movable="false"] .operations-card-grip {
  display: none;
}

.operations-flock-card.sortable-chosen {
  cursor: grabbing;
  border-color: rgba(255, 255, 255, .68);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .32);
}

.operations-flock-card.sortable-ghost {
  border: 1px dashed rgba(255, 255, 255, .58);
  background: rgba(255, 255, 255, .08);
  box-shadow: none;
}

.operations-flock-card.is-complete {
  border-inline-start-color: #7ca786;
}

.operations-flock-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}

.operations-flock-actions .operations-calibrate-button {
  border-color: rgba(224, 86, 86, .65);
  color: #ffd0d0;
  background: rgba(158, 38, 38, .24);
}

.operations-flock-actions .operations-calibrate-button:hover {
  border-color: rgba(240, 112, 112, .9);
  background: rgba(172, 40, 40, .45);
}

.operations-slaughtered > .ghost-button {
  align-self: stretch;
  margin: 0 10px 10px;
}

@media (max-width: 720px) {
  .operations-calibration-menu,
  .operations-schedule-editor { max-height: calc(100dvh - 24px); }

  .operations-kanban {
    grid-auto-columns: minmax(270px, 84vw);
    min-height: 390px;
    max-height: 68vh;
  }

  .operations-kanban-column {
    min-height: 370px;
    max-height: 68vh;
  }
}
