/* Product profile header: the product name already appears in the hero below. */
.product-profile-modal-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
}
.product-profile-modal-head > div:first-child {
  min-width: 0;
}
.product-profile-modal-head > div:first-child h2 {
  display: none !important;
}
.product-profile-modal-head > div:first-child p {
  margin: 4px 0 0 !important;
}
.product-profile-modal-head > div:last-child {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin-left: auto !important;
  flex: 0 0 auto;
}
.product-profile-modal-head .badge,
.product-profile-modal-head .icon-btn {
  margin: 0 !important;
}

/* The compact Warehouse inspector uses the same non-duplicated header anatomy. */
.warehouse-inspector > header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}
.warehouse-inspector > header > div:first-child h2 {
  display: none !important;
}
.warehouse-inspector-head-actions {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  margin-left: auto !important;
}

/* Products inspector follows the same header anatomy as Warehouse. */
.product-inspector > header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}
.product-inspector > header > div:first-child h2 {
  display: none !important;
}
.product-inspector-head-actions {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  margin-left: auto !important;
}

/* Products mounts the authoritative Warehouse editor without changing pages. */
.products-warehouse-editor-host .embedded-product-editor {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1250 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  width: 0 !important;
  height: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  pointer-events: none !important;
}
.products-warehouse-editor-host .embedded-product-editor > .topbar,
.products-warehouse-editor-host .embedded-product-editor > .warehouse-shell {
  display: none !important;
}
.products-warehouse-editor-host .embedded-product-editor .warehouse-product-builder-backdrop {
  pointer-events: auto !important;
}

/* One compact client-block action beside the name. */
.client-name-line .client-block-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
}
.client-name-line .client-block-icon:hover {
  color: #c43f55;
  border-color: rgba(196, 63, 85, .34);
  background: rgba(196, 63, 85, .07);
}
.client-name-line .client-block-icon.active {
  color: #c43f55;
  border-color: rgba(196, 63, 85, .4);
  background: rgba(196, 63, 85, .1);
}
.order-client-vip-label,
.block-customer-action,
.blocked-customer-alert {
  display: none !important;
}

/* Warehouse cards open a dedicated full-information workspace. */
.warehouse-location-card {
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.warehouse-location-card:hover,
.warehouse-location-card:focus-visible {
  border-color: rgba(79, 99, 237, .42) !important;
  box-shadow: 0 10px 28px rgba(34, 49, 91, .09);
  outline: none;
  transform: translateY(-1px);
}
.warehouse-location-detail-backdrop {
  z-index: 1300 !important;
  padding: 24px !important;
}
.warehouse-location-detail-modal {
  width: min(1180px, calc(100vw - 48px));
  height: min(860px, calc(100vh - 48px));
  border: 1px solid var(--border);
  border-radius: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(21, 31, 59, .28);
}
.warehouse-location-detail-modal > header {
  min-height: 78px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.warehouse-location-detail-modal > header h2 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.25;
}
.warehouse-location-detail-modal > header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.warehouse-location-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.warehouse-location-detail-body {
  min-height: 0;
  padding: 16px 20px 20px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}
.warehouse-location-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.warehouse-location-detail-stats > div {
  min-height: 64px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  display: grid;
  gap: 4px;
  background: var(--surface-subtle);
}
.warehouse-location-detail-stats span {
  color: var(--muted);
  font-size: 11px;
}
.warehouse-location-detail-stats strong {
  font-size: 17px;
}
.warehouse-location-detail-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(460px, 1.2fr);
  gap: 14px;
}
.warehouse-location-products,
.warehouse-location-documents {
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 13px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.warehouse-location-section-head {
  min-height: 48px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.warehouse-location-section-head h3 {
  margin: 0;
  font-size: 14px;
}
.warehouse-location-section-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.warehouse-location-product-list,
.warehouse-location-document-list {
  min-height: 0;
  padding: 8px;
  overflow: auto;
}
.warehouse-location-product-row {
  min-height: 54px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 92px;
  align-items: center;
  gap: 10px;
}
.warehouse-location-product-row:last-child {
  border-bottom: 0;
}
.warehouse-location-product-row > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.warehouse-location-product-row img {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}
.warehouse-location-product-row span {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.warehouse-location-product-row strong {
  font-size: 12px;
  line-height: 1.25;
}
.warehouse-location-product-row small {
  color: var(--muted);
  font-size: 11px;
}
.warehouse-location-product-row > b,
.warehouse-location-product-row > em {
  font-size: 12px;
  font-style: normal;
  text-align: right;
  white-space: nowrap;
}
.warehouse-location-product-row > em {
  color: var(--muted);
}
.warehouse-location-document {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.warehouse-location-document > summary {
  min-height: 62px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}
.warehouse-location-document > summary::-webkit-details-marker {
  display: none;
}
.warehouse-location-document > summary > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.warehouse-location-document > summary > span > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.warehouse-location-document > summary strong,
.warehouse-location-document > summary b {
  font-size: 12px;
}
.warehouse-location-document > summary small,
.warehouse-location-document > summary em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}
.warehouse-location-document-lines {
  padding: 5px 10px 8px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
}
.warehouse-location-document-lines > div {
  min-height: 44px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 88px;
  align-items: center;
  gap: 10px;
}
.warehouse-location-document-lines > div:last-child {
  border-bottom: 0;
}
.warehouse-location-document-lines span {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.warehouse-location-document-lines strong,
.warehouse-location-document-lines b,
.warehouse-location-document-lines em {
  font-size: 11px;
  font-style: normal;
}
.warehouse-location-document-lines small {
  color: var(--muted);
  font-size: 10px;
}
.warehouse-location-document-lines b,
.warehouse-location-document-lines em {
  text-align: right;
  white-space: nowrap;
}
.warehouse-location-empty {
  margin: 0;
  padding: 24px 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
@media (max-width: 980px) {
  .warehouse-location-detail-grid {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .warehouse-location-products,
  .warehouse-location-documents {
    min-height: 360px;
  }
}
