/* Tighter stack for Customer / Project / Location in the New form. */
#warehouseNewForm .locates-grid > .locates-field:not(.locates-field--full) {
  margin-bottom: 10px;
  gap: 4px;
}

#warehouseNewForm .locates-grid > .locates-field:not(.locates-field--full) .locates-hint {
  margin-top: 0;
  min-height: 0;
}

#warehouseNewForm .locates-grid > .locates-field:not(.locates-field--full) .locates-hint:empty {
  display: none;
}

.wh-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 5px;
}

.wh-tab {
  flex: 1;
  padding: 9px 8px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.wh-tab.active {
  background: var(--accent);
  color: #fff;
}

.wh-card {
  position: relative;
}

.locates-submit.is-loading:disabled {
  background: var(--accent);
  opacity: 0.9;
  cursor: wait;
}

.wh-add-confirmation-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 130, 0, 0.28);
  background: rgba(255, 130, 0, 0.08);
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
}

.wh-confirm-pickup-wrap {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: min(240px, calc(100% - 28px));
}

.wh-confirm-pickup-wrap .wh-add-confirmation-btn {
  position: static;
}

.wh-confirm-pickup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
}

.wh-confirm-pickup-btn.is-loading {
  cursor: wait;
  pointer-events: none;
  opacity: 0.85;
}

.wh-btn-spinner {
  display: none;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255, 130, 0, 0.28);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: appV2Spin 0.65s linear infinite;
  flex-shrink: 0;
}

.wh-confirm-pickup-btn.is-loading .wh-btn-spinner {
  display: inline-block;
}

.wh-confirm-pickup-error {
  margin: 0;
  color: #b42318;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: right;
}

.wh-confirmation-wrap {
  margin-top: 10px;
}

.wh-confirmation-text {
  width: 100%;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #fff;
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  padding: 12px;
  resize: vertical;
  min-height: 110px;
}

.wh-confirmation-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.wh-confirmation-save {
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 96px;
}

.wh-confirmation-save:disabled,
.wh-confirmation-save.is-disabled {
  background: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
  opacity: 1;
  pointer-events: none;
}

.wh-confirmation-save.is-loading {
  cursor: wait;
  pointer-events: none;
  opacity: 0.9;
  background: var(--accent);
  color: #fff;
}

.wh-confirmation-save.is-loading .wh-btn-spinner {
  display: inline-block;
}

.wh-btn-spinner--on-accent {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

.wh-confirmation-cancel {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.wh-confirmation-cancel:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.wh-confirmation-error {
  margin: 8px 0 0;
  color: #b42318;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.wh-materials-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  margin-top: 8px;
}

.wh-material-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
}

.wh-material-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  background: #fff;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.wh-material-row.is-checked {
  border-color: rgba(255, 130, 0, 0.28);
  background: rgba(255, 130, 0, 0.04);
}

.wh-material-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  min-width: 0;
  word-break: break-word;
}

.wh-material-qty {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.wh-material-amount {
  width: 72px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0 10px;
  font-size: 14px;
  font-family: var(--font);
  box-sizing: border-box;
  text-align: right;
}

.wh-material-amount:disabled {
  opacity: 0.45;
  background: #f2f2f7;
}

.wh-material-amount:focus {
  outline: none;
  border-color: rgba(255, 130, 0, 0.45);
}

.locates-pill--status-submitted {
  background: rgb(84, 156, 201);
  border-color: rgba(84, 156, 201, 0.65);
  color: #fff;
}

.locates-pill--status-ready {
  background: rgb(243, 191, 115);
  border-color: rgba(243, 191, 115, 0.7);
  color: #111;
}

.locates-pill--status-picked,
.locates-pill--status-returned {
  background: rgb(106, 208, 150);
  border-color: rgba(106, 208, 150, 0.65);
  color: #111;
}

/* Confirmation materials editor (Request only) */
.wh-confirm-materials-field .locates-hint {
  margin: 4px 0 0;
}

.wh-confirm-materials-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  margin-top: 8px;
}

.wh-confirm-add-product {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.wh-confirm-add-product:hover {
  text-decoration: underline;
}

.wh-confirm-material-row {
  display: grid;
  grid-template-columns: auto minmax(0, 0.85fr) 72px minmax(200px, 2.2fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
}

.wh-confirm-material-row.is-custom {
  grid-template-columns: auto minmax(0, 1.1fr) 72px minmax(170px, 1.8fr) auto;
}

.wh-confirm-material-remove {
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.wh-confirm-material-remove:hover {
  border-color: rgba(180, 35, 24, 0.35);
  color: #b42318;
}

.wh-confirm-material-product-wrap {
  position: relative;
  display: block;
  min-width: 0;
  z-index: 1;
}

.wh-confirm-material-product-wrap.is-open {
  z-index: 5;
}

.wh-confirm-material-row.is-checked {
  border-color: rgba(255, 130, 0, 0.35);
  background: rgba(255, 130, 0, 0.04);
}

.wh-confirm-material-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  background: #fff;
  accent-color: var(--accent);
}

.wh-confirm-material-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  min-width: 0;
  word-break: break-word;
}

.wh-confirm-material-amount {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0 10px;
  font-size: 14px;
  font-family: var(--font);
  box-sizing: border-box;
  text-align: right;
}

.wh-confirm-material-amount:disabled {
  opacity: 0.45;
  background: #f5f5f5;
}

.wh-confirm-material-amount:focus {
  outline: none;
  border-color: rgba(255,130,0,0.45);
  box-shadow: 0 0 0 3px rgba(255,130,0,0.12);
}

.wh-confirm-material-project-wrap {
  position: relative;
  display: block;
  min-width: 0;
  z-index: 1;
}

.wh-confirm-material-project-wrap.is-open {
  z-index: 5;
}

.wh-confirm-material-project {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 8px 34px 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  box-sizing: border-box;
  text-align: left;
  cursor: pointer;
  color: #111;
  font: inherit;
}

.wh-confirm-material-project-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

.wh-confirm-material-project-chevron {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 12px;
  height: 8px;
  margin-top: -4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75L6 6.25L10.5 1.75' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
  pointer-events: none;
}

.wh-confirm-project-spinner {
  display: none;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 130, 0, 0.28);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: appV2Spin 0.65s linear infinite;
  pointer-events: none;
}

.wh-confirm-material-project-wrap.is-loading .wh-confirm-project-spinner,
.wh-confirm-material-product-wrap.is-loading .wh-confirm-project-spinner {
  display: inline-block;
}

.wh-confirm-material-project-wrap.is-loading .wh-confirm-material-project-chevron,
.wh-confirm-material-product-wrap.is-loading .wh-confirm-material-project-chevron {
  display: none;
}

.wh-confirm-material-project:hover:not(:disabled) {
  border-color: rgba(0, 0, 0, 0.28);
}

.wh-confirm-material-project:disabled {
  opacity: 0.55;
  background: #f5f5f5;
  cursor: not-allowed;
  color: #6b7280;
}

.wh-confirm-material-project:focus {
  outline: none;
  border-color: rgba(255, 130, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 130, 0, 0.12);
}

.wh-confirm-material-project-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  z-index: 10050;
}

.wh-confirm-material-project-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  cursor: pointer;
}

.wh-confirm-material-project-option:hover,
.wh-confirm-material-project-option.is-selected {
  background: rgba(255, 130, 0, 0.1);
}

.wh-confirm-material-project-status {
  padding: 8px 10px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .wh-confirm-material-row,
  .wh-confirm-material-row.is-custom {
    grid-template-columns: auto minmax(0, 1fr) 80px;
  }

  .wh-confirm-material-project-wrap,
  .wh-confirm-material-product-wrap {
    grid-column: 1 / -1;
  }

  .wh-confirm-material-remove {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.wh-inv-lead {
  margin: 0 0 12px;
  color: var(--text-muted, #6b7280);
  font-size: 13px;
  line-height: 1.45;
}

.wh-inv-project {
  min-width: 0;
  max-width: 220px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}

.wh-inv-summary {
  margin: 0 0 10px;
  color: var(--text-muted, #6b7280);
  font-size: 14px;
  font-weight: 650;
}

.wh-inv-summary strong {
  color: var(--text, #111);
  font-size: 18px;
}

.wh-inv-summary span {
  margin-left: 12px;
}

.wh-inv-board {
  overflow: auto;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  background: var(--surface, #fff);
}

.wh-inv-board.is-refreshing {
  opacity: 0.6;
}

.wh-inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.wh-inv-table th,
.wh-inv-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  text-align: left;
  vertical-align: middle;
}

.wh-inv-table th {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
}

.wh-inv-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  white-space: nowrap;
}

.wh-inv-num--neg,
.wh-inv-summary strong.wh-inv-num--neg {
  color: #b42318;
}

.wh-inv-num--muted {
  color: var(--text-muted, #6b7280);
  font-weight: 650;
}

.wh-inv-expand {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}

.wh-inv-detail td {
  background: rgba(15, 23, 42, 0.025);
}

.wh-inv-moves {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wh-inv-moves li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.wh-inv-move__name {
  font-weight: 700;
}

.wh-inv-move__meta {
  flex: 1;
  color: var(--text-muted, #6b7280);
}

.wh-inv-empty {
  margin: 0;
  color: var(--text-muted, #6b7280);
}

@media (max-width: 720px) {
  .wh-inv-project {
    max-width: none;
    flex: 1 1 140px;
  }

  .wh-inv-table thead {
    display: none;
  }

  .wh-inv-table,
  .wh-inv-table tbody,
  .wh-inv-table tr,
  .wh-inv-table td {
    display: block;
    width: 100%;
  }

  .wh-inv-line {
    padding: 8px 0;
  }

  .wh-inv-line td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 0;
    padding: 3px 12px;
  }

  .wh-inv-line td:nth-child(2)::before { content: "Product"; }
  .wh-inv-line td:nth-child(3)::before { content: "Project"; }
  .wh-inv-line td:nth-child(4)::before { content: "On hand"; }
  .wh-inv-line td:nth-child(5)::before { content: "Picked up"; }
  .wh-inv-line td:nth-child(6)::before { content: "Returned"; }
  .wh-inv-line td:nth-child(7)::before { content: "Pending"; }

  .wh-inv-line td::before {
    color: var(--text-muted, #6b7280);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .wh-inv-line td:first-child::before {
    content: none;
  }

  .wh-inv-detail td {
    border-bottom: 1px solid var(--border, #e5e7eb);
  }
}
