/* UA-ERP V3.1 WAREHOUSE DOCUMENT LIFECYCLE */

.wh-v31-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin: 18px 0;
  padding: 22px 24px;
  border: 1px solid rgba(72, 111, 87, 0.36);
  background:
    linear-gradient(
      118deg,
      rgba(249, 252, 250, 0.99) 0%,
      rgba(255, 255, 255, 0.99) 46%,
      rgba(226, 238, 230, 0.96) 100%);
  box-shadow:
    inset 4px 0 0 #476f57,
    0 18px 40px rgba(28, 48, 35, 0.09);
}

.wh-v31-entry > div {
  display: grid;
  gap: 6px;
}

.wh-v31-entry strong {
  color: #192b20;
  font-size: 16px;
  line-height: 1.35;
}

.wh-v31-entry small {
  color: #65736a;
  line-height: 1.5;
}

.modal.wh-v31-modal {
  width: min(1440px, calc(100vw - 30px));
  max-width: 1440px;
  height: min(950px, calc(100vh - 30px));
  max-height: calc(100vh - 30px);
}

.modal.wh-v31-modal .modal-body {
  padding: 0;
  overflow: auto;
}

.modal.wh-v31-modal .modal-footer {
  border-top: 1px solid #d6ded8;
}

.wh-v31-center,
.wh-v31-detail {
  min-width: 0;
  padding: 22px;
  background:
    linear-gradient(
      180deg,
      #f8fbf9 0%,
      #eef4f0 100%);
}

.wh-v31-hero,
.wh-v31-detail > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 24px;
  border: 1px solid rgba(72, 112, 87, 0.34);
  background:
    radial-gradient(
      circle at 88% 12%,
      rgba(104, 151, 119, 0.20),
      transparent 34%),
    linear-gradient(
      122deg,
      #ffffff 0%,
      #f0f6f2 58%,
      #e4eee7 100%);
  box-shadow:
    inset 4px 0 0 #477258,
    0 18px 44px rgba(29, 53, 37, 0.08);
}

.wh-v31-hero h3,
.wh-v31-detail h3 {
  margin: 5px 0 8px;
  color: #17291e;
  font-size: 22px;
  line-height: 1.3;
}

.wh-v31-hero p,
.wh-v31-detail header p {
  max-width: 900px;
  margin: 0;
  color: #647168;
  line-height: 1.58;
}

.wh-v31-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.wh-v31-metric {
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid #d3ddd6;
  background:
    linear-gradient(
      145deg,
      #ffffff 0%,
      #f3f8f5 100%);
  box-shadow:
    inset 0 -3px 0 rgba(76, 116, 89, 0.18),
    0 10px 24px rgba(36, 60, 43, 0.05);
}

.wh-v31-metric span,
.wh-v31-metric small {
  display: block;
  color: #758078;
}

.wh-v31-metric strong {
  display: block;
  margin: 5px 0;
  color: #1b3324;
  font-size: 24px;
  line-height: 1;
}

.wh-v31-filters {
  display: grid;
  grid-template-columns:
    minmax(190px, 1.4fr)
    minmax(170px, 1fr)
    minmax(180px, 1fr)
    minmax(210px, 1.3fr)
    minmax(140px, 0.8fr)
    minmax(140px, 0.8fr)
    auto;
  gap: 10px;
  align-items: end;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #d2dcd5;
  background: rgba(255, 255, 255, 0.92);
}

.wh-v31-filters label,
.wh-v31-lines-field,
.wh-v31-file-field {
  display: grid;
  gap: 7px;
}

.wh-v31-filters label > span,
.wh-v31-lines-field > span,
.wh-v31-file-field > span {
  color: #69766d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wh-v31-filters input,
.wh-v31-filters select,
.wh-v31-lines-field textarea,
.wh-v31-file-field input,
.wh-v31-form input,
.wh-v31-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c8d4cc;
  background: #fff;
}

.wh-v31-tabs {
  display: flex;
  gap: 0;
  margin-top: 16px;
  border: 1px solid #cfd9d2;
  background: #fff;
}

.wh-v31-tabs button {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-right: 1px solid #d7dfda;
  background: transparent;
  color: #5e6b62;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.wh-v31-tabs button.is-active {
  background:
    linear-gradient(
      180deg,
      #eff6f1,
      #e4efe7);
  color: #1d4f30;
  box-shadow: inset 0 -3px 0 #467458;
}

.wh-v31-content {
  min-height: 260px;
  margin-top: 12px;
}

.wh-v31-table-wrap {
  max-height: 500px;
  border: 1px solid #d4ddd7;
  background: #fff;
}

.wh-v31-table-wrap table {
  min-width: 1120px;
}

.wh-v31-table-wrap td small {
  display: block;
  margin-top: 4px;
  color: #7b857e;
}

.wh-v31-table-wrap .num,
.wh-v31-detail .num {
  text-align: right;
  white-space: nowrap;
}

.wh-v31-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  padding: 13px 16px;
  border: 1px solid #d4ddd7;
  background: rgba(255, 255, 255, 0.82);
  color: #6e7a72;
}

.wh-v31-acceptance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.wh-v31-acceptance article {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid #d4ddd7;
  background: #fff;
}

.wh-v31-acceptance article.is-good {
  box-shadow: inset 4px 0 0 #4d765b;
}

.wh-v31-acceptance article.is-bad {
  box-shadow: inset 4px 0 0 #9b3f3f;
}

.wh-v31-acceptance strong {
  font-size: 18px;
}

.wh-v31-import-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 28px;
  border: 1px solid #d1dbd4;
  background:
    linear-gradient(
      120deg,
      #ffffff,
      #edf5f0);
}

.wh-v31-import-panel h4 {
  margin: 6px 0;
  color: #20382a;
}

.wh-v31-import-panel p {
  margin: 0;
  color: #68756c;
  line-height: 1.55;
}

.wh-v31-form {
  margin-bottom: 16px;
}

.wh-v31-lines-field {
  margin-top: 12px;
}

.wh-v31-lines-field small {
  color: #6f7b73;
}

.wh-v31-lines-field textarea {
  min-height: 210px;
  padding: 12px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.5;
  resize: vertical;
}

.wh-v31-detail {
  display: grid;
  gap: 16px;
}

.wh-v31-detail > header {
  margin: -22px -22px 0;
}

.wh-v31-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.wh-v31-detail-grid > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d5ddd7;
  background: #fff;
}

.wh-v31-detail-grid span {
  display: block;
  color: #77827a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wh-v31-detail-grid strong {
  display: block;
  margin-top: 5px;
  color: #253a2c;
  overflow-wrap: anywhere;
}

.wh-v31-detail-grid .mono {
  font: 11px/1.4 Consolas, "Courier New", monospace;
}

.wh-v31-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 13px;
  border: 1px solid #d4ddd7;
  background: rgba(255, 255, 255, 0.88);
}

.wh-v31-accounting {
  padding: 16px;
  border: 1px solid #d1dbd4;
  background:
    linear-gradient(
      120deg,
      #fff,
      #f0f5f2);
}

.wh-v31-accounting h4,
.wh-v31-detail h4 {
  margin: 0 0 10px;
  color: #263b2d;
}

.wh-v31-accounting p {
  margin: 0;
  color: #5f6d64;
}

.wh-v31-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.wh-v31-two-column > section {
  min-width: 0;
  padding: 16px;
  border: 1px solid #d4ddd7;
  background: rgba(255, 255, 255, 0.92);
}

.wh-v31-row-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #e0e6e2;
}

.wh-v31-row-card:last-child {
  border-bottom: 0;
}

.wh-v31-row-card strong,
.wh-v31-row-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wh-v31-row-card span {
  grid-column: 1;
  color: #768179;
  font-size: 12px;
}

.wh-v31-row-card .button {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.wh-v31-row-card.is-muted {
  opacity: 0.62;
}

.wh-v31-attachment-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.wh-v31-attachment-upload input {
  min-width: 0;
  min-height: 39px;
  border: 1px solid #cbd6ce;
  background: #fff;
}

.wh-v31-history {
  display: grid;
  gap: 8px;
}

.wh-v31-history article {
  display: grid;
  grid-template-columns: 190px 180px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #d7dfda;
  background: #fff;
}

.wh-v31-history strong {
  color: #294432;
}

.wh-v31-history span,
.wh-v31-history small {
  color: #6e7a72;
}

.wh-v31-history small {
  text-align: right;
}

.empty-state.compact {
  min-height: 70px;
  padding: 18px;
}

@media (max-width: 1180px) {
  .wh-v31-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .wh-v31-metrics,
  .wh-v31-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .wh-v31-entry,
  .wh-v31-hero,
  .wh-v31-detail > header,
  .wh-v31-import-panel {
    grid-template-columns: 1fr;
  }

  .wh-v31-center,
  .wh-v31-detail {
    padding: 14px;
  }

  .wh-v31-detail > header {
    margin: -14px -14px 0;
  }

  .wh-v31-filters,
  .wh-v31-metrics,
  .wh-v31-detail-grid,
  .wh-v31-acceptance,
  .wh-v31-two-column {
    grid-template-columns: 1fr;
  }

  .wh-v31-tabs {
    overflow-x: auto;
  }

  .wh-v31-tabs button {
    flex: 0 0 auto;
  }

  .wh-v31-attachment-upload {
    grid-template-columns: 1fr;
  }

  .wh-v31-history article {
    grid-template-columns: 1fr;
  }

  .wh-v31-history small {
    text-align: left;
  }
}
