.needs-mass-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:12px 16px; border-bottom:1px solid #e4eaf3; background:#f8faff; }
.needs-mass-actions[hidden] { display:none; }
.needs-mass-actions label, .need-case-select { display:inline-flex; align-items:center; gap:7px; color:#405777; font-size:11px; }
.needs-mass-actions input[type=checkbox], .need-list-check, .need-list-case-check { width:17px; height:17px; margin:0; vertical-align:middle; accent-color:#2563eb; }
.need-list-check { margin-right:7px; }
.need-case-select { margin-bottom:7px; }
.need-case-selected { border-color:#7da6e8; box-shadow:0 0 0 1px #dbe8ff; }
.needs-table tr.need-list-selected td, .need-case-positions tr.need-list-selected td { background:#edf4ff; }
.need-case-positions td:first-child { white-space:nowrap; }

.need-case-list {
  display: grid;
  gap: 10px;
  padding: 12px 14px 16px;
  background: #f7f9fc;
}

.need-case {
  overflow: hidden;
  border: 1px solid #d8e1ee;
  border-left: 4px solid #5d8ee6;
  border-radius: 8px;
  background: #fff;
}

.need-case.priority-critical { border-left-color: #d62f2f; }
.need-case.priority-high { border-left-color: #e99a16; }
.need-case.case-complete { border-left-color: #65a87a; }

.need-case-head {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(340px, 2fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
}

.need-case-title,
.need-case-meta {
  min-width: 0;
}

.need-case-title strong {
  display: block;
  overflow: hidden;
  color: #10264b;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.need-case-title small,
.need-case-meta small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #687892;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.need-case-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 6px 12px;
}

.need-case-meta span {
  min-width: 0;
  overflow: hidden;
  color: #263a5e;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.need-case-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.need-case-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 11px;
}

.need-case-summary span {
  padding: 4px 7px;
  border-radius: 10px;
  background: #edf2f9;
  color: #405777;
  font-size: 10px;
  font-weight: 650;
}

.need-case-summary .case-open { background: #fff0cf; color: #875700; }
.need-case-summary .case-done { background: #e7f7eb; color: #27703a; }
.need-case-summary .case-closed,
.need-case-summary .case-close-reason { background: #fff0e6; color: #9a4815; }
.need-case-summary .case-unread { background: #e8f0ff; color: #1557c8; }

.needs-close-filter {
  display: grid;
  gap: 3px;
  min-width: 170px;
  color: #63748f;
  font-size: 9px;
}

.needs-close-filter select {
  height: 32px;
  border: 1px solid #cbd6e7;
  border-radius: 6px;
  background: #fff;
  padding: 0 28px 0 9px;
  color: #213653;
  font: inherit;
  font-size: 11px;
}

.need-stat-reasons { flex-wrap: wrap; }
.need-reason-filter {
  border: 1px solid #ccd8ea;
  border-radius: 12px;
  background: #f5f8fd;
  padding: 3px 8px;
  color: #31547e;
  font-size: 10px;
  cursor: pointer;
}
.need-reason-filter.active {
  border-color: #2765cc;
  background: #e7f0ff;
  color: #164fae;
  font-weight: 700;
}

.need-case-progress {
  display: flex;
  align-items: flex-start;
  padding: 2px 14px 12px;
}

.need-case-step {
  position: relative;
  display: grid;
  flex: 1;
  justify-items: center;
  gap: 4px;
  min-width: 80px;
  color: #8592a6;
  text-align: center;
}

.need-case-step:not(:last-child)::after {
  position: absolute;
  top: 6px;
  left: calc(50% + 8px);
  width: calc(100% - 16px);
  height: 2px;
  background: #dfe6ef;
  content: "";
}

.need-case-step i {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
}

.need-case-step small { font-size: 9px; font-weight: 650; }
.need-case-step.done,
.need-case-step.current { color: #1f5dc2; }
.need-case-step.done i,
.need-case-step.current i { border-color: #3d74d8; background: #3d74d8; }
.need-case-step.done:not(:last-child)::after { background: #7ea4e6; }
.need-case-step.current i { box-shadow: 0 0 0 3px #dfeaff; }

.need-case-documents {
  display: grid;
  gap: 6px;
  margin: 0 14px 12px;
  padding: 8px;
  border: 1px solid #dfe6f0;
  border-radius: 7px;
  background: #f8faff;
}

.need-case-document {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(360px, 2fr);
  align-items: center;
  gap: 10px;
}

.need-case-document + .need-case-document {
  padding-top: 7px;
  border-top: 1px solid #e4eaf3;
}

.need-case-document-info { min-width: 0; }
.need-case-document-title {
  display: block;
  max-width: 100%;
  overflow: hidden;
  border: 0;
  background: transparent;
  padding: 0;
  color: #1557c8;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.need-case-document-info small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #718096;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.need-case-document-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}
.need-case-document-actions .document-actions { display: contents; }

.purchase-case-context {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 7px 5px 10px;
  border-radius: 6px;
  background: #e8f0ff;
  color: #1e55b4;
  font-size: 11px;
}

.purchase-case-context[hidden] { display: none; }
.purchase-case-context button {
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: #2459c4;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 650;
}

.need-case-positions {
  border-top: 1px solid #e4eaf3;
  background: #fbfcfe;
}

.need-case-positions table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  table-layout: fixed;
}

.need-case-positions th,
.need-case-positions td {
  box-sizing: border-box;
  padding: 8px 10px;
  border-bottom: 1px solid #e8edf4;
  color: #263a5e;
  font-size: 10px;
  text-align: left;
  vertical-align: middle;
}

.need-case-positions th {
  background: #f2f5fa;
  color: #687892;
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.need-case-positions th:nth-child(1) { width: 128px; }
.need-case-positions th:nth-child(2) { width: 94px; }
.need-case-positions th:nth-child(4) { width: 72px; }
.need-case-positions th:nth-child(5) { width: 116px; }
.need-case-positions th:nth-child(6) { width: 125px; }
.need-case-positions th:nth-child(7) { width: 150px; }
.need-case-positions tr:last-child td { border-bottom: 0; }

.need-case-product {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.need-case-empty {
  padding: 22px;
  color: #718096;
  text-align: center;
}

.need-batch-resolution {
  grid-column: 1 / -1;
  max-height: 360px;
  overflow: auto;
  border: 1px solid #dce4ef;
  border-radius: 7px;
}

.need-batch-resolution table {
  width: 100%;
  min-width: 620px;
  table-layout: fixed;
}

.need-batch-resolution th,
.need-batch-resolution td {
  padding: 8px 10px;
  border-bottom: 1px solid #e8edf4;
  font-size: 11px;
}

.need-batch-resolution th:first-child { width: auto; }
.need-batch-resolution th:nth-child(2) { width: 155px; }
.need-batch-resolution th:nth-child(3) { width: 130px; }
.need-batch-resolution td:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.need-batch-resolution select,
.need-batch-resolution input {
  width: 100%;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  padding: 0 8px;
  color: #1f2f49;
}

.need-batch-resolution select:disabled,
.need-batch-resolution input:disabled {
  background: #f1f4f8;
  color: #8a96a8;
}

@media (max-width: 1280px) {
  .need-case-head { grid-template-columns: 1fr auto; }
  .need-case-meta { grid-column: 1 / -1; grid-row: 2; }
  .need-case-actions { grid-column: 2; grid-row: 1; }
  .need-case-progress { overflow-x: auto; }
  .need-case-document { grid-template-columns: 1fr; }
  .need-case-document-actions { justify-content: flex-start; }
}
.need-pagination { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; padding: 12px 0; }
.need-pagination label { display: grid; gap: 4px; font-size: 12px; color: #5d6b7d; }
.need-pagination input, .need-pagination select { min-height: 34px; border: 1px solid #d6dde7; border-radius: 6px; padding: 6px 9px; background: #fff; color: #182a43; }
.need-pagination .need-search { min-width: 240px; flex: 1; max-width: 460px; }
.need-pagination [role="status"] { align-self: center; font-size: 12px; color: #5d6b7d; }
.need-update-fields input[type="checkbox"] { width: auto; min-height: auto; }
#orderReleaseItems{grid-column:1/-1;margin:0;padding-left:20px;line-height:1.5}
#orderReleaseItems:empty{display:none}
#orderReleaseError{background:#fff3ed;color:#9a3412}
#orderReleaseError[hidden]{display:none}
#orderReleaseDialog .dialog-footer{flex-wrap:wrap}
