
/* Daily COM / arrivals comparison: a compact read-only report, NOT a large squeezed table. */
dialog.modal-daily-diff {
  width: min(86vw, 1400px);
  max-width: 96vw;
  max-height: 92dvh;
  overflow: hidden;
}
dialog.modal-daily-diff[open] { display: flex; flex-direction: column; }
.modal-daily-diff .modal-head { padding: 15px 23px; flex: 0 0 auto; }
.modal-daily-diff .modal-head h2 { font-size: 19px; }
.modal-daily-diff .modal-body { padding: 0; overflow: hidden; min-height: 0; }
.daily-diff-report { display: flex; flex-direction: column; min-height: 0; }
.daily-diff-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 22px 10px;
}
.daily-diff-metric {
  min-width: 0;
  padding: 11px 16px;
  border: 1px solid var(--line);
  background: #faf8f5;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.daily-diff-metric > span { font-size: 12px; color: #776b62; }
.daily-diff-metric strong { font-size: 22px; font-weight: 700; color: var(--wine); font-variant-numeric: tabular-nums; white-space: nowrap; }
.daily-diff-metric small { font-size: 11px; font-weight: 400; color: var(--muted); }
.daily-diff-hint { margin: 0; padding: 5px 23px 14px; font-size: 12px; line-height: 1.6; color: #756b63; }
.daily-diff-hint strong { color: var(--wine); }
.daily-diff-table-wrap {
  min-height: 0;
  max-height: min(56dvh, 530px);
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.daily-diff-table { width: 100%; min-width: 1010px; table-layout: fixed; border-collapse: collapse; }
.daily-diff-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #f3eee6;
  color: #564640;
  font-size: 11px;
  padding: 12px 11px;
  white-space: normal;
  line-height: 1.35;
}
.daily-diff-table td {
  padding: 12px 11px;
  font-size: 12px;
  line-height: 1.5;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.daily-diff-table tbody tr:nth-child(even) { background: #fdfbf8; }
.daily-diff-product strong { display: block; font-weight: 650; line-height: 1.45; }
.daily-diff-ean { display: block; color: #77706b; font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; margin-top: 3px; }
.daily-diff-category { font-size: 11px; color: var(--wine); font-weight: 600; }
.daily-diff-comparison { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; font-variant-numeric: tabular-nums; }
.daily-diff-comparison strong { font-size: 13px; font-weight: 700; white-space: nowrap; }
.daily-diff-before { font-size: 12px; color: #77706b; }
.daily-diff-arrow { color: #b3a89d; white-space: nowrap; }
.daily-diff-delta { font-size: 11px; font-weight: 700; white-space: nowrap; }
.daily-diff-delta.is-up { color: #24765c; }
.daily-diff-delta.is-down { color: #a4503e; }
.daily-diff-unknown { font-size: 10.5px; font-weight: 600; color: #9a6e3e; }
.daily-diff-total { color: #5e504b; }
.daily-diff-reason-preview {
  font-size: 11px;
  line-height: 1.45;
  color: #514641;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.daily-diff-reason details { margin-top: 5px; font-size: 11px; }
.daily-diff-reason summary { cursor: pointer; color: var(--wine); font-weight: 600; width: fit-content; }
.daily-diff-reason-detail { margin-top: 6px; padding: 8px; background: #faf7f1; border-radius: 6px; color: #665a51; }
.daily-diff-reason-detail p { margin: 0; }
.daily-diff-reason-detail p + p { margin-top: 7px; }
.daily-diff-empty { padding: 28px 24px; background: #fcfbf9; color: #766e66; text-align: center; }
.daily-diff-overflow { margin: 5px 22px; font-size: 11px; color: #a15a4a; }
.daily-diff-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 23px;
  background: #fff;
  color: #80746d;
  font-size: 11px;
}
.daily-diff-foot button { flex: 0 0 auto; padding: 9px 19px; }
@media (max-width: 820px) {
  .export-language-grid { grid-template-columns: 1fr; }
  dialog.modal-daily-diff { width: 96vw; max-height: 94dvh; }
  .modal-daily-diff .modal-head { padding: 12px 15px; }
  .modal-daily-diff .modal-head h2 { font-size: 16px; }
  .daily-diff-overview { gap: 7px; padding: 12px 12px 8px; }
  .daily-diff-metric { padding: 9px; display: block; }
  .daily-diff-metric > span { display: block; font-size: 10px; }
  .daily-diff-metric strong { font-size: 18px; }
  .daily-diff-hint { padding: 4px 13px 12px; }
  .daily-diff-foot { padding: 12px 13px; }
}

/* Instant acknowledgement of asynchronous actions; prevent accidental double submission. */
button.action-pending, input[type="submit"].action-pending {
  opacity: .78;
  cursor: progress !important;
  position: relative;
}
button.action-pending::after, input[type="submit"].action-pending::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 7px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: bsv-spin .7s linear infinite;
}
@keyframes bsv-spin { to { transform: rotate(360deg); } }
.arrival-inline-table .arrival-highlight-toggle.is-active {
  background: #fff1bc;
  border-color: #b98c2b;
  color: #805300;
}
.arrival-inline-table .row-actions .arrival-highlight-toggle { margin-top: 5px; }

/* COM own-stock internal reference prices: display only, no input or buttons. */
:is(.staff-products, .arrival-inline-table).staff-own-market-reference .market-stock-readonly {
  text-align: center;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #594536;
  background: #f8f5ee;
  white-space: nowrap;
}
:is(.staff-products, .arrival-inline-table).staff-own-market-reference .market-stock-author {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 400;
  color: #7b6e64;
  overflow-wrap: anywhere;
}
:is(.staff-products, .arrival-inline-table).staff-own-market-reference th[data-col="14"],
:is(.staff-products, .arrival-inline-table).staff-own-market-reference th[data-col="15"] {
  background: #674334;
  text-align: center;
}

/* V5: fit the COM stock 16-column staff sheet to the browser viewport. */
body[data-workspace="true"] .admin-main { min-width: 0; }
body[data-workspace="true"] .admin-main .quote-table-wrap { max-width: 100%; width: 100%; }
:is(.staff-products, .arrival-inline-table).staff-own-market-reference { table-layout: fixed; }
:is(.staff-products, .arrival-inline-table).staff-own-market-reference th,
:is(.staff-products, .arrival-inline-table).staff-own-market-reference td { padding-left: 4px; padding-right: 4px; font-size: 11px; }
:is(.staff-products, .arrival-inline-table).staff-own-market-reference th { font-size: 10px; }
:is(.staff-products, .arrival-inline-table).staff-own-market-reference .product-name { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
:is(.staff-products, .arrival-inline-table).staff-own-market-reference .brand-cell { min-width: 0; overflow-wrap: anywhere; }
:is(.staff-products, .arrival-inline-table).staff-own-market-reference .currency-cell { min-width: 0; }
:is(.staff-products, .arrival-inline-table).staff-own-market-reference .quote-input { max-width: 100%; min-width: 0; }
:is(.staff-products, .arrival-inline-table).staff-own-market-reference .currency-amount { white-space: normal; }
:is(.staff-products, .arrival-inline-table).staff-own-market-reference .row-actions button,
:is(.staff-products, .arrival-inline-table).staff-own-market-reference .price-actions button { padding: 3px 4px; font-size: 10px; }
:is(.staff-products, .arrival-inline-table).staff-own-market-reference .market-stock-readonly { white-space: normal; overflow-wrap: anywhere; }

/* Internal COM tables share the exact same 16-column sizing and scroll layout. */
.arrival-inline-table.staff-own-market-reference .arrival-quote-input {
  max-width: 100%;
  min-width: 0;
}

/* V2.2: staff-only visibility for COM arrivals without saleable formal stock. */
.arrival-inline-table .arrival-auto-hidden-row > td { background: #faf7f2; }
.arrival-inline-table .arrival-auto-hidden-note {
  display: block; margin-top: 5px; font-size: 11px; color: #a14a26;
  white-space: normal; overflow-wrap: anywhere; font-weight: 600;
}
.arrival-inline-table .arrival-auto-hidden-row .sheet-publish { opacity: .86; }
.arrival-inline-table .arrival-auto-hidden-row input[type="checkbox"]:disabled { cursor: not-allowed; }
.staff-products .occupied-stock-readonly > td { background: #faf8f1; padding: 10px 15px; }
.occupied-stock-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.occupied-stock-line b { font-weight: 700; }
.occupied-stock-line code { font-size: 12px; }
.occupied-stock-line small { color: #8a5c29; }
.occupied-stock-line strong { white-space: nowrap; }

/* V2.2.2 - discreet name provenance marker (only HK manual Chinese overrides). */
.name-modified-tag {
  display: inline-block;
  vertical-align: baseline;
  margin-inline-start: 6px;
  padding: 1px 4px;
  border: 1px solid #d8d3cb;
  border-radius: 3px;
  background: #f6f4f1;
  color: #756d66;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  letter-spacing: 0;
}
.name-modified-tag.staff-name-modified {
  margin: 2px 0 2px 3px;
  font-size: 10px;
}
