/* Shared Vue inventory UI. Existing shell and page CSS remain authoritative. */
.vue-barcode-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(12, 18, 15, 0.72);
  backdrop-filter: blur(4px);
}
.vue-barcode-panel {
  width: min(100%, 460px);
  max-height: min(90vh, 720px);
  overflow: auto;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
}
.vue-barcode-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.vue-barcode-panel h2 { margin: 0; }
.vue-barcode-panel video {
  display: block;
  width: 100%;
  min-height: 210px;
  margin: 12px 0;
  border-radius: 8px;
  background: #111;
  object-fit: cover;
}
.vue-barcode-panel form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.vue-barcode-panel label { display: grid; gap: 6px; min-width: 0; }
.vue-barcode-panel input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
}
.vue-barcode-panel button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #d6ddd8;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}
.vue-barcode-panel form button { border-color: #d94f2b; background: #d94f2b; color: #fff; }
.vue-barcode-panel > button { width: 100%; margin-top: 10px; }
.vue-barcode-panel :focus-visible { outline: 2px solid #d94f2b; outline-offset: 2px; }
#mora-vue-page .has-difference,
#mora-vue-page .is-difference { color: #b42318; }
#mora-vue-page .sc-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  margin: 14px 0 12px;
  padding: 4px;
  border-radius: 8px;
  background: #e8ebe7;
}
#mora-vue-page .sc-tabs button {
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: #6b736e;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}
#mora-vue-page .sc-tabs button.is-active {
  color: #fff;
  background: #171b19;
}
#mora-vue-page .transfer-doc-panel textarea {
  width: 100%;
  min-height: 72px;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  resize: vertical;
}
#mora-vue-page .transfer-doc-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#mora-vue-page .transfer-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  color: #fff;
  background: #171b19;
}
#mora-vue-page .transfer-summary article {
  min-width: 0;
}
#mora-vue-page .transfer-summary span {
  display: block;
  color: rgba(255, 255, 255, .6);
  font-size: 9px;
}
#mora-vue-page .transfer-summary strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: #fff;
  font-size: 17px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#mora-vue-page .inventory-op-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}
#mora-vue-page .inventory-op-search label {
  display: grid;
  min-width: 0;
  flex: 1 1 220px;
  gap: 6px;
}
#mora-vue-page .inventory-op-search label > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}
#mora-vue-page .inventory-op-search input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  box-sizing: border-box;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}
#mora-vue-page .inventory-op-search .button {
  min-height: 40px;
  flex: 0 0 auto;
  white-space: nowrap;
}
#mora-vue-page .transfer-item-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
#mora-vue-page .transfer-history-list {
  display: grid;
  gap: 8px;
}
#mora-vue-page .transfer-range-tabs { gap: 3px; }
#mora-vue-page .transfer-range-tabs button {
  min-width: 0;
  min-height: 44px;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: #e8ebe7;
  font-size: 16px;
  line-height: 1.4;
}
#mora-vue-page .transfer-range-tabs button.is-active { background: #dce2dc; }
#mora-vue-page .transfer-history-actions .text-button {
  padding: 3px 8px;
  border: 0;
  border-radius: 999px;
  background: #eef0ed;
  color: var(--ink-soft);
  font-size: 9px;
}
#mora-vue-page .receive-item-card .transfer-item-copy small {
  overflow: visible;
  white-space: normal;
  line-height: 1.5;
}
#mora-vue-page .transfer-history-meta { flex-wrap: wrap; }
#mora-vue-page .transfer-history-meta > span:first-child { min-width: 0; overflow-wrap: anywhere; }
#mora-vue-page .transfer-history-actions { margin-left: auto; flex-wrap: wrap; }
#mora-vue-page .transfer-history-detail .history-detail-row > strong,
#mora-vue-page .transfer-history-detail .history-detail-row > span { overflow-wrap: anywhere; }
#mora-vue-page .transfer-summary-card > div { min-width: 0; }
#mora-vue-page .receive-summary .is-difference { color: var(--danger); }
#mora-vue-page .transfer-status { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
/* Keep the native scan button clear of the final row and submission controls. */
body[data-inventory-operation="transfer-ship"] .content,
body[data-inventory-operation="transfer-receive"] .content,
body[data-inventory-operation="warehouse-direct-receive"] .content,
body[data-inventory-operation="warehouse-allocation"] .content,
body[data-inventory-operation="warehouse-shipment"] .content { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
#mora-vue-page .stocktake-difference-actions { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); z-index: 5; }
@media (max-width: 420px) {
  .vue-barcode-panel form { grid-template-columns: 1fr; }
  #mora-vue-page .transfer-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #mora-vue-page .transfer-summary article:last-child {
    grid-column: 1 / -1;
  }
  #mora-vue-page .inventory-op-search {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }
  #mora-vue-page .inventory-op-search label {
    grid-column: 1 / -1;
  }
  #mora-vue-page .stocktake-setting-actions,
  #mora-vue-page .transfer-actions { align-items: stretch; }
}
@media (min-width: 900px) {
  body[data-inventory-operation] .transfer-scan-fab {
    right: max(28px, calc((100vw - 1080px) / 2 + 28px));
  }
  body[data-inventory-operation] .management-bottom-nav {
    right: auto;
    left: 50%;
    width: min(100%, 1080px);
    max-width: 1080px;
    transform: translateX(-50%);
  }
}

/* Keep the original two-column difference filters styled like inventory forms. */
#mora-vue-page .stocktake-difference-filter select {
  min-height: 40px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 16px;
}

/* Restore the compact native entry layout without changing other inventory forms. */
#stocktakeEntryView .stocktake-entry-summary { grid-template-columns: minmax(64px, .7fr) minmax(0, 2fr); padding: 12px; }
#stocktakeEntryView #stocktakeEntryDocNo { font-size: 12px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
#stocktakeEntryView .stocktake-barcode-entry { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
#stocktakeEntryView .stocktake-barcode-entry button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 48px; min-height: 44px; padding: 0 9px; font-size: 12px; }
#stocktakeEntryView .stocktake-barcode-entry input { min-height: 44px; }
#stocktakeEntryView #stocktakeEntryScan { background: var(--ink); }
#stocktakeEntryView svg, #physicalEntryView .transfer-actions svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.8; }
#stocktakeEntryView .stocktake-save-bar { display: flex; align-items: center; }
#stocktakeEntryView .stocktake-save-bar > strong { margin-right: auto; white-space: nowrap; font-size: 14px; }
#stocktakeEntryView .stocktake-save-bar .button { width: auto; min-height: 44px; }
#stocktakeEntryView .stocktake-save-bar #stocktakeEntrySave { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
body[data-inventory-operation="stocktake"] #mora-vue-page .transfer-item-copy > span { white-space: normal; overflow-wrap: anywhere; }
body[data-inventory-operation="physical-adjust"] #mora-vue-page .inventory-op-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
body[data-inventory-operation="physical-adjust"] #mora-vue-page .inventory-op-search label { grid-column: auto; }
#physicalEntryView .physical-adjust-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#physicalEntryView .inventory-operation-panel { margin-top: 10px; gap: 12px; }
#physicalEntryView .inventory-operation-panel label { min-width: 0; font-size: 12px; }
body[data-inventory-operation="physical-adjust"] #mora-vue-page .inventory-op-search label > span { font-size: 12px; }
#physicalEntryView .inventory-operation-panel :is(input, select, textarea) { min-width: 0; min-height: 44px; font-family: inherit; font-size: 16px; }
#physicalEntryView .inventory-op-product { min-width: 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
#physicalEntryView .inventory-op-product strong { font-size: 14px; }
#physicalEntryView .inventory-op-note { font-size: 11px; }
#physicalEntryView .inventory-operation-panel .button { min-height: 44px; }
#physicalEntryView .transfer-actions { margin-top: 0; }
#physicalEntryView .transfer-actions .button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
#physicalEntryView .inventory-draft-card :is(span, small) { white-space: normal; overflow-wrap: anywhere; }
body:is([data-inventory-operation="stocktake"], [data-inventory-operation="physical-adjust"]) #mora-vue-page .transfer-history-detail > p { overflow-wrap: anywhere; }

#mora-vue-page .difference-choice-panel {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid #efc8bd;
  border-radius: 8px;
  background: #fff8f5;
}

#mora-vue-page .difference-choice-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

#mora-vue-page .difference-choice-panel p b {
  color: var(--accent);
}

#mora-vue-page .difference-choice-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

#mora-vue-page .difference-choice-panel .button {
  width: 100%;
  min-height: 44px;
  padding: 7px 10px;
  white-space: normal;
  line-height: 1.3;
  touch-action: manipulation;
}

#mora-vue-page .difference-choice-cancel {
  min-height: 44px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  touch-action: manipulation;
}

#mora-vue-page .warehouse-allocation-summary,
#mora-vue-page .warehouse-shipment-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  color: #fff;
  background: #171b19;
}
#mora-vue-page .warehouse-allocation-summary > div,
#mora-vue-page .warehouse-shipment-summary > div {
  min-width: 0;
}
#mora-vue-page .warehouse-allocation-summary span,
#mora-vue-page .warehouse-shipment-summary span {
  display: block;
  color: rgba(255, 255, 255, .62);
  font-size: 9px;
}
#mora-vue-page .warehouse-allocation-summary strong,
#mora-vue-page .warehouse-shipment-summary strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: #fff;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#mora-vue-page .warehouse-target-panel {
  margin-top: 10px;
}
#mora-vue-page .warehouse-target-search {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  margin-bottom: 9px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
#mora-vue-page .warehouse-target-search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--muted);
}
#mora-vue-page .warehouse-target-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 12px;
}
#mora-vue-page .warehouse-target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
#mora-vue-page .warehouse-target-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
#mora-vue-page .warehouse-target-option:has(input:checked) {
  border-color: #e9a68e;
  background: #fff5f1;
}
#mora-vue-page .warehouse-target-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}
#mora-vue-page .warehouse-target-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}
#mora-vue-page .warehouse-allocation-items-head {
  flex-wrap: wrap;
}
#mora-vue-page .warehouse-allocation-bulk {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}
#mora-vue-page .warehouse-allocation-bulk button,
#mora-vue-page .warehouse-link-button,
#mora-vue-page .warehouse-remove-button,
#mora-vue-page .warehouse-doc-footer > button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: #fff;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
#mora-vue-page .warehouse-allocation-bulk button:disabled,
#mora-vue-page .warehouse-remove-button:disabled {
  opacity: .45;
  cursor: default;
}
#mora-vue-page .warehouse-allocation-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
#mora-vue-page .warehouse-allocation-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 11px;
}
#mora-vue-page .warehouse-allocation-table th,
#mora-vue-page .warehouse-allocation-table td {
  padding: 8px;
  border-bottom: 1px solid #eceeea;
  text-align: left;
  vertical-align: middle;
}
#mora-vue-page .warehouse-allocation-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f4f6f3;
  font-size: 9px;
  white-space: nowrap;
}
#mora-vue-page .warehouse-allocation-table tbody tr:last-child td {
  border-bottom: 0;
}
#mora-vue-page .warehouse-product-cell {
  display: flex;
  min-width: 220px;
  align-items: center;
  gap: 8px;
}
#mora-vue-page .warehouse-product-cell img {
  width: 42px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: #eef0ed;
  object-fit: cover;
}
#mora-vue-page .warehouse-product-cell > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}
#mora-vue-page .warehouse-product-cell strong,
#mora-vue-page .warehouse-product-cell small {
  overflow-wrap: anywhere;
}
#mora-vue-page .warehouse-product-cell small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}
#mora-vue-page .warehouse-qty-input {
  width: 58px;
  min-height: 38px;
  box-sizing: border-box;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 16px;
  text-align: center;
}
#mora-vue-page .warehouse-filter-panel {
  margin-top: 10px;
}
#mora-vue-page .warehouse-doc-card {
  display: grid;
  gap: 10px;
}
#mora-vue-page .warehouse-doc-head,
#mora-vue-page .warehouse-doc-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}
#mora-vue-page .warehouse-doc-head > span {
  display: grid;
  min-width: 0;
  gap: 4px;
}
#mora-vue-page .warehouse-doc-head strong,
#mora-vue-page .warehouse-doc-head small,
#mora-vue-page .warehouse-doc-footer span {
  overflow-wrap: anywhere;
}
#mora-vue-page .warehouse-doc-head small {
  color: var(--muted);
  font-size: 9px;
}
#mora-vue-page .warehouse-doc-head > b {
  margin-left: auto;
  white-space: nowrap;
}
#mora-vue-page .warehouse-doc-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#mora-vue-page .warehouse-doc-targets span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #4f5a53;
  background: #eef1ed;
  font-size: 9px;
}
#mora-vue-page .warehouse-doc-footer {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 9px;
}
#mora-vue-page .warehouse-doc-footer .button {
  width: auto;
  min-height: 36px;
  margin-left: auto;
  padding-inline: 12px;
}
#mora-vue-page .warehouse-status {
  padding: 4px 8px;
  border-radius: 999px;
  color: #755c13;
  background: #fff4cf;
  font-weight: 800;
}
#mora-vue-page .warehouse-status.is-shipped,
#mora-vue-page .warehouse-status.is-partially_received {
  color: #8b421b;
  background: #ffeadf;
}
#mora-vue-page .warehouse-status.is-completed,
#mora-vue-page .warehouse-status.is-submitted {
  color: #25623a;
  background: #e4f5e9;
}
#mora-vue-page .warehouse-status.is-cancelled {
  color: #6d7370;
  background: #eceeeb;
}
#mora-vue-page .warehouse-store-progress {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f5f7f4;
}
#mora-vue-page .warehouse-store-progress > div {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  font-size: 10px;
}
#mora-vue-page .warehouse-store-progress span {
  color: var(--muted);
}
#mora-vue-page .warehouse-receipt-note {
  margin-top: 10px;
}
#mora-vue-page .warehouse-receipt-note label {
  display: grid;
  gap: 6px;
}
#mora-vue-page .warehouse-receipt-note span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}
#mora-vue-page .warehouse-receipt-note textarea {
  width: 100%;
  min-height: 76px;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  resize: vertical;
}
#mora-vue-page .warehouse-receipt-history-note {
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
@media (max-width: 520px) {
  #mora-vue-page .warehouse-allocation-bulk {
    width: 100%;
    margin-left: 0;
  }
  #mora-vue-page .warehouse-allocation-bulk button {
    flex: 1;
  }
  #mora-vue-page .warehouse-doc-footer .button {
    width: 100%;
    margin-left: 0;
  }
}
