/* Stock-item detail refinements: obvious document links, split slider and photo management. */
.recent-row,
.recent-row .doc-chip,
.recent-row .recent-main,
.recent-row .recent-main strong,
.recent-row .recent-meta {
  cursor: pointer;
}

.stock-photo-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.stock-photo-heading span {
  color: var(--muted);
  font-size: .75rem;
}

.stock-photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stock-photo-item {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  border-radius: 14px;
  background: #efeff1;
}

.stock-photo-item .photo-thumb {
  width: 100%;
  height: 100%;
  min-height: 150px;
  border-radius: 0;
}

.stock-photo-item:first-child:nth-last-child(odd) {
  grid-column: 1 / -1;
  min-height: 230px;
}

.stock-photo-item:first-child:nth-last-child(odd) .photo-thumb {
  min-height: 230px;
}

.stock-photo-delete-form {
  position: absolute;
  z-index: 3;
  right: 7px;
  bottom: 7px;
  margin: 0 !important;
}

.stock-photo-delete {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  background: rgba(20, 20, 22, .52);
  color: #fff;
  font-size: .65rem;
  cursor: pointer;
  opacity: .8;
  backdrop-filter: blur(8px);
  transition: opacity .14s ease, background .14s ease, transform .14s ease;
}

.stock-photo-delete:hover,
.stock-photo-delete:focus-visible {
  background: rgba(167, 53, 53, .92);
  opacity: 1;
  transform: scale(1.06);
}

#photo-modal .photo-modal-content,
#photo-modal #photo-modal-image {
  pointer-events: none;
}

.quick-photo-form {
  margin: 12px 0 18px;
}

.quick-photo-form .upload-zone {
  min-height: 82px;
}

.stock-location-summary {
  align-items: center;
}

.stock-location-value {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
  flex-wrap: wrap;
}

.stock-location-warehouse {
  margin-right: 2px;
  color: #2f3034;
  font-weight: 700;
}

.stock-location-badge {
  min-width: 32px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0 9px;
  border-radius: 9px;
  color: #fff;
  font-size: .84rem;
  font-weight: 800;
  line-height: 1;
}

.stock-location-rack {
  background: #f2a33a;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(95, 54, 0, .08);
}

.stock-location-shelf {
  background: #c94a47;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(90, 0, 0, .08);
}

.summary-row .stock-location-badge {
  color: #fff;
  font-weight: 800;
}

.stock-lineage {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid #e3e3e7;
  border-radius: 16px;
  background: #fafafa;
}

.stock-lineage-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.stock-lineage-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: .72rem;
}

.stock-lineage-total {
  text-align: right;
  white-space: nowrap;
}

.stock-lineage-total span {
  display: block;
  color: var(--muted);
  font-size: .67rem;
}

.stock-lineage-total strong {
  display: block;
  font-size: 1.05rem;
}

.stock-lineage-list {
  display: grid;
  border-top: 1px solid #e7e7ea;
}

.stock-lineage-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(120px, .9fr);
  gap: 10px;
  align-items: center;
  padding: 9px 7px;
  color: #252529;
  border-bottom: 1px solid #ececef;
  border-radius: 9px;
}

.stock-lineage-row:last-child {
  border-bottom: 0;
}

.stock-lineage-row:hover,
.stock-lineage-row.is-current {
  background: #f0f0f3;
  color: #111;
}

.stock-lineage-id {
  min-width: 0;
}

.stock-lineage-id .mono {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-lineage-id small {
  color: var(--muted);
  font-size: .62rem;
  text-transform: uppercase;
}

.stock-lineage-row > span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: .72rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split-toggle-button,
.split-submit-button {
  background: #3273dc !important;
  border-color: #3273dc !important;
  color: #fff !important;
}

.split-toggle-button:hover,
.split-submit-button:hover {
  background: #2865c2 !important;
  border-color: #2865c2 !important;
  color: #fff !important;
}

.mismatch-toggle-button,
.mismatch-submit-button {
  background: #ed8a19 !important;
  border-color: #ed8a19 !important;
  color: #fff !important;
}

.mismatch-toggle-button:hover,
.mismatch-submit-button:hover {
  background: #d9790f !important;
  border-color: #d9790f !important;
  color: #fff !important;
}

.split-values {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.split-values .field {
  margin-bottom: 0;
}

.split-arrow {
  display: grid;
  place-items: center;
  height: 40px;
  color: #8a8a90;
}

.split-range-wrap {
  margin: 14px 0 16px;
}

.split-range {
  --split-percent: 50%;
  width: 100%;
  height: 8px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(to right, #d8d8dd 0 var(--split-percent), #3273dc var(--split-percent) 100%);
  cursor: ew-resize;
}

.split-range::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  appearance: none;
  -webkit-appearance: none;
  border: 4px solid #fff;
  border-radius: 999px;
  background: #3273dc;
  box-shadow: 0 2px 9px rgba(0,0,0,.2);
  cursor: grab;
}

.split-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 4px solid #fff;
  border-radius: 999px;
  background: #3273dc;
  box-shadow: 0 2px 9px rgba(0,0,0,.2);
  cursor: grab;
}

.split-range-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  color: var(--muted);
  font-size: .68rem;
}

.split-range-caption strong {
  color: #555;
  font-weight: 700;
}

.is-disabled-split {
  opacity: .7;
}

@media (max-width: 620px) {
  .stock-photo-gallery {
    grid-template-columns: 1fr;
  }

  .stock-photo-item,
  .stock-photo-item .photo-thumb,
  .stock-photo-item:first-child:nth-last-child(odd),
  .stock-photo-item:first-child:nth-last-child(odd) .photo-thumb {
    min-height: 210px;
  }

  .stock-photo-item:first-child:nth-last-child(odd) {
    grid-column: auto;
  }

  .stock-location-summary {
    align-items: flex-start;
  }

  .stock-location-value {
    justify-content: flex-start;
  }

  .stock-lineage-heading {
    flex-direction: column;
  }

  .stock-lineage-total {
    text-align: left;
  }

  .stock-lineage-row {
    grid-template-columns: 1fr auto;
  }

  .stock-lineage-row > span:last-child {
    grid-column: 1 / -1;
    text-align: left;
  }

  .split-values {
    grid-template-columns: 1fr;
  }

  .split-arrow {
    height: 20px;
    transform: rotate(90deg);
  }

  .split-range-caption strong {
    display: none;
  }
}
