@import url("/fonts/resource-han-rounded-sc/resource-han-rounded-sc.css");

:root {
  --ref-ink: #17202a;
  --ref-muted: #4f5d66;
  --muted: #4f5d66;
  --ref-paper: #f4f1eb;
  --ref-card: #fffdfa;
  --ref-line: #d8d2c8;
  --ref-line-strong: #bdb5aa;
  --ref-accent: #ad4d25;
  --ref-accent-dark: #813716;
  --ref-accent-soft: #f3e3d9;
  --ref-navy: #202e37;
  --ref-navy-2: #18252d;
  --ref-good: #22644d;
  --ref-good-soft: #dcece5;
  --ref-warn: #845707;
  --ref-warn-soft: #f8e9c9;
  --ref-danger: #a02c30;
  --ref-danger-soft: #f5dfe0;
  --ref-info: #2e627f;
  --ref-info-soft: #dfeaf0;
  --system-muted: #4f5d66;
  --system-amber: #845707;
  --warn: #845707;
  --ref-font: "Resource Han Rounded SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ref-radius-panel: 12px;
  --ref-radius-control: 8px;
  --ref-control-height: 40px;
  --ref-control-padding-x: 12px;
  --ref-panel-padding: 16px;
  --ref-section-gap: 16px;
  --ref-toolbar: #eee9e1;
  --ref-subtle: #f7f4ef;
  --ref-table-head: #efebe5;
  --ref-command-card: #f6f3ee;
}

/*
 * Readability normalization: secondary information stays visually quieter than
 * primary text, but must remain legible on warm-white, blue-focus and soft
 * status surfaces. This token intentionally overrides ui-v7's pale #6f7d86.
 */

html,
body,
button,
input,
select,
textarea,
pre,
code {
  font-family: var(--ref-font) !important;
  font-synthesis: none;
}

html,
body {
  color: var(--ref-ink);
  background: #e8e3db;
}

body {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

strong,
b,
h1,
h2,
h3,
h4,
.primary-btn,
.secondary-btn,
.row-btn {
  font-weight: 400 !important;
}

.app-shell {
  grid-template-columns: 208px minmax(0, 1fr) !important;
  background: var(--ref-paper);
}

.sidebar {
  position: sticky;
  top: 0;
  width: auto !important;
  height: 100vh;
  padding: 22px 14px 16px !important;
  border-right: 1px solid #36434b !important;
  color: #fff;
  background: var(--ref-navy) !important;
}

.sidebar-head {
  min-height: auto !important;
  padding: 0 !important;
  border: 0 !important;
}

.sidebar .brand {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 6px 22px;
}

.sidebar .brand-mark {
  width: 37px !important;
  height: 37px !important;
  flex: 0 0 37px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .22) !important;
  border-radius: var(--ref-radius-control) !important;
  color: #fff4eb;
  background: var(--ref-accent) !important;
  font-size: 22px !important;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.sidebar .brand strong {
  color: #fff !important;
  font-size: 18px !important;
  letter-spacing: .08em;
}

.brand-copy small {
  color: #aebcc4;
  font-size: 10px;
  letter-spacing: .14em;
}

.nav {
  display: block !important;
  padding: 0 !important;
}

.nav-section-label {
  margin: 0 10px 8px;
  color: #8b9aa2;
  font-size: 10.5px;
  letter-spacing: .14em;
}

.nav-section-label-spaced {
  margin-top: 24px;
}

.sidebar .nav-item,
.sidebar .nav-utility {
  width: 100%;
  min-height: 42px !important;
  display: grid !important;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  padding: 0 11px !important;
  border: 1px solid transparent !important;
  border-radius: var(--ref-radius-control) !important;
  color: #c9d2d7 !important;
  background: transparent !important;
  text-align: left;
}

.sidebar .nav-item:hover,
.sidebar .nav-utility:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, .06) !important;
}

.sidebar .nav-item.active {
  color: #fff !important;
  background: #3a4851 !important;
  border-color: var(--ref-accent) !important;
  box-shadow: inset 4px 0 0 var(--ref-accent) !important;
}

.sidebar .nav-item span,
.sidebar .nav-utility span {
  font-size: 13px !important;
}

.sidebar-foot {
  display: grid !important;
  gap: 6px;
  margin-top: auto;
  padding: 0 !important;
  border: 0 !important;
}

.sidebar-account {
  min-height: 56px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #3d4b53;
  border-radius: var(--ref-radius-panel);
  color: #fff;
  background: #1b272e;
  text-align: left;
}

.sidebar-account-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--ref-radius-control);
  color: #fff;
  background: var(--ref-accent);
  font-size: 10px;
}

.sidebar-account-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.sidebar-account-copy strong,
.sidebar-account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account-copy strong {
  font-size: 12px;
}

.sidebar-account-copy small {
  color: #93a2aa;
  font-size: 10.5px;
}

.sidebar-foot .nav-utility {
  min-height: 34px !important;
  color: #92a2aa !important;
}

.workspace {
  min-width: 0;
  background: var(--ref-paper) !important;
}

.workspace.view-orders-active {
  background: var(--ref-paper) !important;
}

.topbar,
.workspace.view-orders-active > .topbar {
  position: sticky !important;
  top: 0;
  z-index: 60;
  min-height: 58px !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px !important;
  border-bottom: 1px solid var(--ref-line) !important;
  background: rgba(244, 241, 235, .97) !important;
  backdrop-filter: blur(12px);
}

.topbar-title {
  min-width: 0;
  align-items: center !important;
}

.topbar-breadcrumb {
  display: flex !important;
  align-items: center;
  gap: 9px;
  color: var(--ref-muted);
}

.topbar-breadcrumb > span {
  font-size: 11.5px;
  letter-spacing: .07em;
}

.topbar-breadcrumb > .lucide {
  width: 10px;
  height: 10px;
}

.topbar-breadcrumb h1 {
  display: block !important;
  margin: 0;
  color: var(--ref-ink);
  font-size: 12px !important;
  letter-spacing: .03em;
}

#pageTitle {
  display: block !important;
}

.topbar-system {
  display: flex !important;
  margin-left: auto;
}

.topbar-freshness {
  min-height: 36px;
  display: grid;
  align-content: center;
  gap: 0;
  padding: 0 12px;
  border: 1px solid var(--ref-line);
  border-radius: var(--ref-radius-control);
  background: var(--ref-card);
  text-align: center;
}

.topbar-freshness small {
  color: var(--ref-muted);
  font-size: 9.5px;
  line-height: 1.15;
}

.topbar-freshness strong {
  color: var(--ref-ink) !important;
  font-size: 11px;
  line-height: 1.15;
}

.ui-system-capacity-note small {
  color: #365f75 !important;
}

#topbarClock,
#userBadge,
#syncStatus,
#apkDownloadBtn {
  display: none !important;
}

.top-actions {
  gap: 8px !important;
}

.top-actions .icon-btn {
  width: 36px !important;
  height: 36px !important;
  border: 1px solid var(--ref-line) !important;
  border-radius: var(--ref-radius-control) !important;
  color: var(--ref-ink) !important;
  background: var(--ref-card) !important;
}

.workspace > .view {
  width: 100%;
  max-width: 1530px;
  margin: 0 auto;
  padding: 30px 30px 44px !important;
}

.panel,
.form-band,
.orders-filter-panel,
.quick-filter {
  border-color: var(--ref-line) !important;
  border-radius: var(--ref-radius-panel) !important;
  background: var(--ref-card) !important;
  box-shadow: 0 12px 26px rgba(59, 44, 31, .045) !important;
}

.eyebrow {
  color: var(--ref-accent) !important;
  font-size: 11px !important;
  letter-spacing: .12em !important;
}

.primary-btn,
.secondary-btn,
.row-btn,
.icon-btn,
input,
select,
textarea {
  border-radius: var(--ref-radius-control) !important;
}

.workspace input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.workspace select {
  min-height: var(--ref-control-height) !important;
  padding: 0 var(--ref-control-padding-x) !important;
  line-height: 1.35 !important;
  box-sizing: border-box;
}

.workspace select:not([hidden]) {
  height: var(--ref-control-height) !important;
  padding: 0 34px 0 var(--ref-control-padding-x) !important;
  border-radius: var(--ref-radius-control) !important;
  background-color: var(--ref-card) !important;
  background-image: url("./icons/chevron-down.svg") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 10px 12px !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.workspace textarea {
  padding: 10px var(--ref-control-padding-x) !important;
  line-height: 1.5 !important;
  box-sizing: border-box;
}

.workspace .primary-btn,
.workspace .secondary-btn {
  height: var(--ref-control-height) !important;
  min-height: var(--ref-control-height) !important;
  padding: 0 14px !important;
  border-radius: var(--ref-radius-control) !important;
}

.workspace .row-btn {
  border-radius: var(--ref-radius-control) !important;
}

.primary-btn {
  border-color: var(--ref-accent) !important;
  color: #fff !important;
  background: var(--ref-accent) !important;
}

.primary-btn:hover {
  border-color: var(--ref-accent-dark) !important;
  background: var(--ref-accent-dark) !important;
}

.secondary-btn,
.row-btn {
  border-color: var(--ref-line-strong) !important;
  color: var(--ref-ink) !important;
  background: var(--ref-card) !important;
}

/* Home */

#dashboardView.ui-system-home.active {
  display: flex !important;
  flex-direction: column;
  gap: 16px !important;
  background: var(--ref-paper) !important;
}

.ui-system-home-head {
  order: 1;
  min-height: 96px !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between;
  gap: 24px;
  margin: 0 !important;
  padding: 0 0 4px !important;
  border: 0 !important;
  background: transparent !important;
}

.ui-system-home-head h2 {
  margin: 5px 0 0 !important;
  color: var(--ref-ink) !important;
  font-size: 32px !important;
  line-height: 1.2 !important;
  letter-spacing: -.025em;
}

.ui-system-home-head p:last-child {
  max-width: 820px;
  margin: 8px 0 0 !important;
  color: var(--ref-muted) !important;
  font-size: 14px !important;
}

#dashboardView .dashboard-alert-rail {
  order: 2;
  min-height: 82px;
  display: grid !important;
  grid-template-columns: 165px repeat(5, minmax(0, 1fr)) !important;
  gap: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--ref-navy-2) !important;
  border-radius: var(--ref-radius-panel) !important;
  color: #fff;
  background: var(--ref-navy) !important;
  overflow: hidden !important;
}

#dashboardView .dashboard-alert-rail::before {
  content: "异常与风险\A当班优先处理";
  display: flex;
  min-height: 80px;
  align-items: center;
  padding: 0 16px !important;
  border-right: 1px solid #3b4951 !important;
  color: #e7a17b !important;
  background: var(--ref-navy-2) !important;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre;
}

#dashboardView .dashboard-alert-rail .dashboard-alert {
  min-width: 0;
  min-height: 80px !important;
  padding: 12px 16px !important;
  border: 0 !important;
  border-right: 1px solid #3b4951 !important;
  border-radius: 0 !important;
  color: #fff !important;
  background: transparent !important;
}

#dashboardView .dashboard-alert-rail .dashboard-alert:last-child {
  border-right: 0 !important;
}

#dashboardView .dashboard-alert-rail .dashboard-alert small,
#dashboardView .dashboard-alert-rail .dashboard-alert span {
  color: #aebbc2 !important;
}

.ui-system-home-grid {
  order: 3;
  grid-template-columns: minmax(0, 1fr) 300px !important;
  gap: 16px !important;
}

.ui-system-priority-head,
.ui-system-priority-row {
  grid-template-columns: 1.04fr 1.2fr .82fr .92fr .72fr !important;
}

.ui-system-priority-row {
  min-height: 78px !important;
}

.ui-system-home-bottom {
  order: 4;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
}

.ui-system-loop-panel {
  order: 5;
}

#notificationPanel {
  order: 6;
}

/* Orders */

.orders-erp-shell {
  display: block !important;
}

.orders-erp-sidebar {
  display: none !important;
}

#ordersView .orders-erp-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#ordersView .orders-page-head {
  order: 1 !important;
  min-height: 104px !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 6px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#ordersView .orders-page-head h1 {
  margin: 5px 0 0 !important;
  color: var(--ref-ink) !important;
  font-size: 32px !important;
  line-height: 1.2 !important;
  letter-spacing: -.025em;
}

#ordersView .orders-page-head .eyebrow {
  display: block !important;
  width: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#ordersView .orders-page-head p:not(.eyebrow) {
  display: block !important;
  max-width: 820px;
  margin: 8px 0 0 !important;
  color: var(--ref-muted) !important;
  font-size: 14px !important;
}

#ordersView .orders-head-actions {
  align-items: center !important;
  justify-content: flex-end;
}

.orders-auto-sync-pill,
#platformInboxSyncReadonlyTopBtn,
#orderAlertTopBtn,
#orderHelpTopBtn {
  display: none !important;
}

#ordersView #orderExportTopBtn,
#ordersView #newOrderTopBtn {
  display: inline-flex !important;
  min-height: var(--ref-control-height) !important;
  padding: 0 14px !important;
  border-radius: var(--ref-radius-control) !important;
}

#ordersView .orders-command-band {
  display: none !important;
}

#ordersView .orders-pipeline-stages {
  order: 2 !important;
  min-height: 74px !important;
  display: grid !important;
  grid-template-columns: 165px repeat(4, minmax(0, 1fr));
  align-items: stretch !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--ref-line) !important;
  border-radius: var(--ref-radius-panel) !important;
  background: var(--ref-card) !important;
  overflow: hidden;
}

#ordersView .orders-pipeline-stages::before {
  content: "履约阶段\A当前队列与下一步";
  display: flex;
  min-height: 72px;
  align-self: stretch;
  align-items: center;
  padding: 0 16px;
  border-right: 1px solid #3a4850;
  color: #fff;
  background: var(--ref-navy);
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre;
}

#ordersView .orders-pipeline-stages button {
  min-height: 72px !important;
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) 10px !important;
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  gap: 1px 8px !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-right: 1px solid var(--ref-line) !important;
  border-radius: 0 !important;
  color: var(--ref-muted) !important;
  background: transparent !important;
  text-align: left;
}

#ordersView .orders-pipeline-stages button::after {
  content: none !important;
  display: none !important;
}

#ordersView .orders-pipeline-stages button:last-child {
  border-right: 0 !important;
}

#ordersView .orders-pipeline-stages button.active {
  color: var(--ref-accent-dark) !important;
  background: var(--ref-accent-soft) !important;
  box-shadow: inset 0 -3px 0 var(--ref-accent) !important;
}

#ordersView .orders-pipeline-stages button strong {
  grid-column: 2;
  grid-row: 1;
  font-size: 12px !important;
}

#ordersView .orders-pipeline-stages button b {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--ref-radius-control);
  color: var(--ref-ink) !important;
  background: #ece7df;
  font-size: 10px !important;
}

#ordersView .orders-pipeline-stages button.active b {
  color: #fff !important;
  background: var(--ref-accent);
}

#ordersView .orders-pipeline-stages button small {
  grid-column: 2;
  grid-row: 2;
  overflow: hidden;
  color: var(--ref-muted) !important;
  font-size: 10px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ordersView .orders-pipeline-stages .orders-stage-chevron {
  grid-column: 3;
  grid-row: 1 / span 2;
  justify-self: end;
  width: 12px;
  height: 12px;
  color: #b7afa5;
}

#ordersView .orders-pipeline-stages button:last-child .orders-stage-chevron {
  visibility: hidden;
}

.orders-mobile-actions {
  order: 3;
}

.orders-mobile-filter-toggle {
  order: 4;
}

#ordersView .orders-filter-panel {
  order: 5;
  margin: 0 !important;
  padding: 12px !important;
  background: #eee9e1 !important;
  overflow: hidden;
}

#ordersView .orders-platform-chips {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#ordersView .orders-platform-chips button {
  min-height: 34px !important;
  padding: 0 10px !important;
  border: 1px solid var(--ref-line) !important;
  border-radius: var(--ref-radius-control) !important;
  background: var(--ref-card) !important;
}

#ordersView .orders-platform-chips button.active {
  border-color: var(--ref-accent) !important;
  color: var(--ref-accent-dark) !important;
  background: var(--ref-accent-soft) !important;
  box-shadow: none !important;
}

#ordersView .orders-filter-grid {
  grid-template-columns: 170px minmax(280px, 1fr) repeat(3, minmax(120px, 160px)) auto !important;
  gap: 8px !important;
}

#ordersView .orders-filter-grid > .search-box {
  grid-column: 2;
  grid-row: 1;
}

#ordersView .orders-filter-grid > .compact-field:nth-child(2) {
  grid-column: 1;
  grid-row: 1;
}

#ordersView .orders-filter-grid > .compact-field:nth-child(3) {
  grid-column: 3;
  grid-row: 1;
}

#ordersView .orders-filter-grid > .compact-field:nth-child(4) {
  grid-column: 4;
  grid-row: 1;
}

#ordersView .orders-filter-grid > .compact-field:nth-child(5) {
  grid-column: 5;
  grid-row: 1;
}

.orders-filter-grid input,
.orders-filter-grid select,
.order-search-control,
.order-search-btn {
  min-height: var(--ref-control-height) !important;
  border-radius: var(--ref-radius-control) !important;
}

.order-bulk-band {
  order: 6;
}

/* Keep the order workspace on the viewport scroll chain so sticky detail positioning
   does not leave a false blank strip above the table or inspector. */
html:has(#ordersView.view.active),
body:has(#ordersView.view.active) {
  overflow-x: clip !important;
}

#ordersView .orders-pipeline-workspace {
  order: 7;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 330px !important;
  gap: 0 !important;
  align-items: start;
  border: 1px solid var(--ref-line) !important;
  border-radius: var(--ref-radius-panel) !important;
  background: var(--ref-card) !important;
  overflow: visible;
}

#ordersView .orders-pipeline-list {
  min-width: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--ref-card);
  overflow: hidden;
}

.orders-table-wrap {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.orders-table-wrap:has(tbody td.empty),
#ordersPipelineInspector:has(.orders-inspector-empty) {
  overflow: hidden !important;
}

.orders-pipeline-table {
  min-width: 960px !important;
}

.orders-pipeline-table thead th {
  height: 38px !important;
  padding: 0 10px !important;
  border-bottom: 1px solid var(--ref-line) !important;
  color: var(--ref-muted) !important;
  background: #eee9e1 !important;
  font-size: 10px !important;
  line-height: 1.25;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: nowrap;
}

.orders-pipeline-table thead th:first-child input[type="checkbox"] {
  display: block;
  margin: 0 auto;
}

.orders-pipeline-table tbody tr {
  min-height: 80px;
  background: transparent !important;
}

.orders-pipeline-table tbody tr.is-focused {
  background: #f5eae2 !important;
  box-shadow: inset 3px 0 0 var(--ref-accent) !important;
}

.orders-pipeline-table td {
  padding: 10px !important;
  border-bottom: 1px solid #e7e1d8 !important;
  font-size: 12px !important;
  vertical-align: middle !important;
}

.order-task-buyer,
.order-task-product > span,
.order-task-deadline,
.order-task-preparation,
.order-task-fulfillment {
  gap: 3px !important;
}

.order-task-buyer strong,
.order-task-buyer small,
.order-task-product strong,
.order-task-product small {
  font-size: 11px !important;
  line-height: 1.4 !important;
}

.order-task-phone {
  color: #33424d !important;
}

#ordersView .orders-pipeline-inspector {
  position: sticky !important;
  top: 72px !important;
  align-self: start;
  align-content: start;
  max-height: min(640px, calc(100dvh - 86px));
  margin: 0 !important;
  border: 0 !important;
  border-left: 1px solid var(--ref-line) !important;
  border-radius: 0 !important;
  background: var(--ref-card) !important;
  overflow: auto;
  scrollbar-gutter: stable;
  box-shadow: none !important;
}

.orders-inspector-head {
  color: #fff !important;
  background: var(--ref-navy) !important;
}

.orders-inspector-head small,
.orders-inspector-head span {
  color: #bac5ca;
}

.orders-inspector-head .order-live-change-pills span {
  color: var(--ref-warn) !important;
}

.orders-inspector-section {
  border-color: var(--ref-line) !important;
}

.platform-order-inbox-panel {
  order: 20;
  margin: 4px 0 0 !important;
}

.order-daily-summary-panel {
  order: 21;
  margin: 10px 0 0 !important;
}

/* Products */

.sku-ops-shell {
  display: flex !important;
  flex-direction: column;
  gap: 12px !important;
}

.sku-intro-panel {
  min-height: 104px;
  margin: 0 0 6px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.sku-intro-panel > .panel-head {
  min-height: 104px !important;
  align-items: flex-end !important;
  padding: 0 !important;
  border: 0 !important;
}

.sku-intro-panel > .panel-head > button {
  min-height: var(--ref-control-height) !important;
  padding: 0 14px !important;
  border-radius: var(--ref-radius-control) !important;
}

.sku-intro-panel .panel-head h2 {
  margin: 5px 0 0 !important;
  color: var(--ref-ink) !important;
  font-size: 32px !important;
  line-height: 1.2 !important;
  letter-spacing: -.025em;
}

.sku-intro-panel .panel-head p:not(.eyebrow) {
  max-width: 850px;
  margin: 8px 0 0 !important;
  color: var(--ref-muted) !important;
  font-size: 14px !important;
}

.sku-command-cards {
  display: none !important;
}

.sku-workspace-tabs {
  min-height: 76px !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--ref-line) !important;
  border-radius: var(--ref-radius-panel) !important;
  background: var(--ref-card) !important;
  overflow: hidden;
}

.sku-workspace-tabs button {
  min-height: 74px !important;
  display: grid !important;
  grid-template-columns: 1fr auto;
  align-content: center;
  gap: 3px 10px;
  padding: 0 16px !important;
  border: 0 !important;
  border-right: 1px solid var(--ref-line) !important;
  border-radius: 0 !important;
  color: var(--ref-muted) !important;
  background: transparent !important;
  text-align: left;
}

.sku-workspace-tabs button:last-child {
  border-right: 0 !important;
}

.sku-workspace-tabs button.active {
  color: var(--ref-accent-dark) !important;
  background: var(--ref-accent-soft) !important;
  box-shadow: inset 0 -3px 0 var(--ref-accent) !important;
}

.sku-workspace-tabs button span {
  font-size: 13px;
}

.sku-workspace-tabs button small {
  grid-column: 1;
  color: currentColor;
  font-size: 10px;
}

.sku-workspace-tabs button b {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 22px;
}

.sku-review-panel > .panel-head {
  display: none !important;
}

.sku-review-panel {
  padding: 0 !important;
  overflow: hidden !important;
}

.sku-review-panel .sku-toolbar {
  min-height: 64px;
  margin: 0 !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid var(--ref-line) !important;
  background: #eee9e1 !important;
}

.sku-review-panel .sku-toolbar .search-box {
  max-width: none !important;
}

.sku-review-panel .sku-toolbar input {
  min-height: var(--ref-control-height) !important;
  padding: 0 var(--ref-control-padding-x) !important;
  border-radius: var(--ref-radius-control) !important;
}

.reference-product-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  align-items: start;
}

.reference-product-list {
  min-width: 0;
  border-right: 1px solid var(--ref-line);
}

.reference-product-head,
.reference-product-row {
  display: grid;
  grid-template-columns: 1.52fr 1.08fr .62fr .95fr .64fr .74fr;
  align-items: center;
  gap: 10px;
}

.reference-product-head {
  min-height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--ref-line);
  color: var(--ref-muted);
  background: #eee9e1;
  font-size: 10px;
}

.reference-product-row {
  position: relative;
  min-height: 92px;
  padding: 10px 12px;
  border-bottom: 1px solid #e7e1d8;
  outline: 0;
  background: var(--ref-card);
  cursor: pointer;
}

.reference-product-row:hover {
  background: #fbf8f2;
}

.reference-product-row.is-selected {
  background: #f5eae2;
  box-shadow: inset 3px 0 0 var(--ref-accent);
}

.reference-product-row:focus-visible {
  outline: 2px solid var(--ref-info);
  outline-offset: -3px;
}

.reference-product-row > span,
.reference-product-row > span > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.reference-product-row strong,
.reference-product-row small,
.reference-product-row em {
  display: block;
  overflow: hidden;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-product-row strong {
  font-size: 12px;
}

.reference-product-row small,
.reference-product-row em {
  color: var(--ref-muted);
  font-size: 10.5px;
  font-style: normal;
}

.reference-product-main {
  grid-template-columns: 54px minmax(0, 1fr) !important;
  align-items: center;
  gap: 9px !important;
}

.reference-product-select {
  position: absolute;
  left: 7px;
  top: 7px;
  z-index: 2;
  opacity: 0;
  transition: opacity .16s ease;
}

.reference-product-row:hover .reference-product-select,
.reference-product-row.is-checked .reference-product-select,
.reference-product-select:focus-within {
  opacity: 1;
}

.reference-product-main .sku-thumb,
.reference-product-main .sku-thumb-empty {
  width: 52px !important;
  height: 52px !important;
  border: 1px solid var(--ref-line) !important;
  border-radius: var(--ref-radius-control) !important;
  object-fit: cover;
}

.reference-product-stock strong {
  color: var(--ref-ink);
  font-size: 20px;
}

.reference-product-completeness i {
  height: 4px;
  display: block;
  border-radius: 999px;
  background: #dfd8ce;
  overflow: hidden;
}

.reference-product-completeness i b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--ref-accent);
}

.reference-product-empty,
.reference-product-inspector-empty {
  min-height: 260px;
  display: grid;
  place-content: center;
  gap: 4px;
  color: var(--ref-muted);
  text-align: center;
}

.reference-product-inspector {
  position: sticky;
  top: 72px;
  min-width: 0;
  border-left: 1px solid var(--ref-line);
  border-radius: 0;
  background: var(--ref-card);
  overflow: hidden;
}

.reference-product-preview {
  min-height: 128px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  color: #fff;
  background: var(--ref-navy);
}

.reference-product-preview .sku-thumb,
.reference-product-preview .sku-thumb-empty {
  width: 92px !important;
  height: 92px !important;
  border: 1px solid #546069 !important;
  border-radius: 9px !important;
  object-fit: contain;
  padding: 4px;
  background: #f7f4ef;
}

.reference-product-preview > span:last-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.reference-product-preview small {
  color: #e3a07b;
  font-size: 9.5px;
  letter-spacing: .1em;
}

.reference-product-preview h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.reference-product-preview strong {
  overflow: hidden;
  color: #bbc5ca;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-product-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--ref-line);
}

.reference-product-facts > span {
  min-width: 0;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 9px 12px;
  border-right: 1px solid var(--ref-line);
  border-bottom: 1px solid var(--ref-line);
}

.reference-product-facts > span:nth-child(2n) {
  border-right: 0;
}

.reference-product-facts > span:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.reference-product-facts small {
  color: var(--ref-muted);
  font-size: 10px;
}

.reference-product-facts strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-product-transactions {
  padding: 13px 14px;
  border-bottom: 1px solid var(--ref-line);
}

.reference-product-transactions h3 {
  margin: 0 0 7px;
  color: var(--ref-muted);
  font-size: 10.5px;
  letter-spacing: .06em;
}

.reference-product-transactions > div {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #e7e1d8;
}

.reference-product-transactions > div:last-child {
  border-bottom: 0;
}

.reference-product-transactions > div > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.reference-product-alert {
  display: grid;
  gap: 2px;
  margin: 11px;
  padding: 10px;
  border: 1px solid var(--ref-line);
  border-radius: var(--ref-radius-control);
}

.reference-product-alert.success {
  border-color: #b7d5c6;
  color: var(--ref-good);
  background: var(--ref-good-soft);
}

.reference-product-alert.warning {
  border-color: #ead098;
  color: var(--ref-warn);
  background: var(--ref-warn-soft);
}

.reference-product-alert.danger {
  border-color: #dfb9bb;
  color: var(--ref-danger);
  background: var(--ref-danger-soft);
}

.reference-product-alert strong {
  font-size: 11.5px;
}

.reference-product-alert small {
  font-size: 10.5px;
}

.reference-product-inspector-footer {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #eee9e1;
}

.reference-product-inspector-footer > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reference-product-inspector-footer small {
  color: var(--ref-muted);
  font-size: 10px;
}

.reference-product-inspector-footer strong {
  font-size: 12px;
}

#skuErpPanel .sku-table-wrap,
#skuErpPanel #skuCards {
  display: none !important;
}

.product-intelligence-band {
  margin-top: 16px !important;
}

.product-intelligence-actions .primary-btn,
.product-intelligence-actions .secondary-btn,
.pagination-bar .secondary-btn {
  min-height: var(--ref-control-height) !important;
  padding: 0 14px !important;
}

.pagination-size select {
  height: var(--ref-control-height) !important;
}

/* === FULL-SYSTEM WORKSPACE UNIFICATION === */

:is(
  #shippingView,
  #inventoryView,
  #purchasesView,
  #batchesView,
  #movementsView,
  #financeView,
  #reimbursementsView,
  #usersView,
  #exportsView,
  #platformsView
) :is(.shipping-shell, .stock-ops-shell, .flow-ops-shell, .finance-ops-shell, .admin-ops-shell) {
  gap: var(--ref-section-gap) !important;
}

:is(
  #shippingView .shipping-command-panel,
  #inventoryView .inventory-command-panel,
  #purchasesView .purchase-command-panel,
  #batchesView .flow-command-panel,
  #movementsView .flow-command-panel,
  #financeView .finance-command-panel,
  #reimbursementsView .reimbursement-command-panel,
  #usersView .admin-command-panel,
  #exportsView .admin-command-panel,
  #platformsView .admin-command-panel
) {
  padding: var(--ref-panel-padding) !important;
  border: 1px solid var(--ref-line) !important;
  border-radius: var(--ref-radius-panel) !important;
  background: var(--ref-card) !important;
  box-shadow: none !important;
  overflow: hidden;
}

:is(
  #shippingView .shipping-command-panel,
  #inventoryView .inventory-command-panel,
  #batchesView .flow-command-panel,
  #movementsView .flow-command-panel,
  #financeView .finance-command-panel,
  #reimbursementsView .reimbursement-command-panel,
  #usersView .admin-command-panel,
  #exportsView .admin-command-panel,
  #platformsView .admin-command-panel
) > .panel-head {
  min-height: 76px;
  align-items: center !important;
  gap: 16px !important;
  margin-bottom: 14px !important;
}

:is(
  #shippingView .shipping-command-panel,
  #inventoryView .inventory-command-panel,
  #batchesView .flow-command-panel,
  #movementsView .flow-command-panel,
  #financeView .finance-command-panel,
  #reimbursementsView .reimbursement-command-panel,
  #usersView .admin-command-panel,
  #exportsView .admin-command-panel,
  #platformsView .admin-command-panel
) > .panel-head > div:first-child {
  min-width: 0;
  max-width: 820px;
}

:is(
  #shippingView .shipping-command-panel,
  #inventoryView .inventory-command-panel,
  #batchesView .flow-command-panel,
  #movementsView .flow-command-panel,
  #financeView .finance-command-panel,
  #reimbursementsView .reimbursement-command-panel,
  #usersView .admin-command-panel,
  #exportsView .admin-command-panel,
  #platformsView .admin-command-panel
) > .panel-head :is(h1, h2) {
  margin: 2px 0 4px !important;
  color: var(--ref-ink) !important;
  font-size: 26px !important;
  line-height: 1.22 !important;
}

:is(
  #shippingView,
  #inventoryView,
  #purchasesView,
  #batchesView,
  #movementsView,
  #financeView,
  #reimbursementsView,
  #usersView,
  #exportsView,
  #platformsView
) .eyebrow {
  color: var(--ref-accent) !important;
  font-size: 10px !important;
  letter-spacing: .12em !important;
}

:is(
  #shippingView .shipping-command-panel,
  #inventoryView .inventory-command-panel,
  #batchesView .flow-command-panel,
  #movementsView .flow-command-panel,
  #financeView .finance-command-panel,
  #reimbursementsView .reimbursement-command-panel,
  #usersView .admin-command-panel,
  #exportsView .admin-command-panel,
  #platformsView .admin-command-panel
) > .panel-head p:not(.eyebrow) {
  margin: 0 !important;
  color: var(--ref-muted) !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

:is(
  #shippingView,
  #inventoryView,
  #purchasesView,
  #batchesView,
  #movementsView,
  #financeView,
  #reimbursementsView,
  #usersView,
  #exportsView,
  #platformsView
) :is(.panel, .form-band) {
  border-color: var(--ref-line) !important;
  border-radius: var(--ref-radius-panel) !important;
  background: var(--ref-card) !important;
  box-shadow: none !important;
}

:is(
  #shippingView,
  #inventoryView,
  #purchasesView,
  #batchesView,
  #movementsView,
  #financeView,
  #reimbursementsView,
  #usersView,
  #exportsView,
  #platformsView
) :is(.stock-command-card, .purchase-command-card, .shipping-kpis article, .shipping-kpis button) {
  min-height: 78px !important;
  padding: 11px 12px !important;
  border: 1px solid var(--ref-line) !important;
  border-radius: var(--ref-radius-control) !important;
  color: var(--ref-ink) !important;
  background: var(--ref-command-card) !important;
  box-shadow: none !important;
}

:is(
  #shippingView,
  #inventoryView,
  #purchasesView,
  #batchesView,
  #movementsView,
  #financeView,
  #reimbursementsView,
  #usersView,
  #exportsView,
  #platformsView
) :is(.stock-command-card, .purchase-command-card, .shipping-kpis button):is(:hover, :focus-visible, .active, .is-selected) {
  border-color: var(--ref-accent) !important;
  background: var(--ref-accent-soft) !important;
  box-shadow: inset 0 -2px 0 var(--ref-accent) !important;
  outline: none !important;
}

:is(
  #shippingView,
  #inventoryView,
  #purchasesView,
  #batchesView,
  #movementsView,
  #financeView,
  #reimbursementsView,
  #usersView,
  #exportsView,
  #platformsView
) :is(.stock-command-card, .purchase-command-card, .shipping-kpis article, .shipping-kpis button) strong {
  color: var(--ref-ink) !important;
  font-size: 22px !important;
  line-height: 1.05 !important;
}

:is(
  #shippingView,
  #inventoryView,
  #purchasesView,
  #batchesView,
  #movementsView,
  #financeView,
  #reimbursementsView,
  #usersView,
  #exportsView,
  #platformsView
) :is(.stock-command-card, .purchase-command-card, .shipping-kpis article, .shipping-kpis button) :is(span, small) {
  color: var(--ref-muted) !important;
}

#purchasesView .purchase-command-layout {
  align-items: center !important;
  gap: 18px !important;
  padding: 0 !important;
  color: var(--ref-ink) !important;
  background: transparent !important;
}

#purchasesView .purchase-command-copy h2 {
  margin: 2px 0 4px !important;
  color: var(--ref-ink) !important;
  font-size: 26px !important;
  line-height: 1.22 !important;
}

#purchasesView .purchase-command-copy > p {
  margin: 0 !important;
  color: var(--ref-muted) !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

#purchasesView .purchase-flow-line {
  width: fit-content;
  gap: 16px !important;
  margin-top: 12px !important;
  padding: 8px 10px !important;
  border: 1px solid var(--ref-line) !important;
  border-radius: var(--ref-radius-control) !important;
  color: var(--ref-muted) !important;
  background: var(--ref-subtle) !important;
  font-weight: 400 !important;
}

#purchasesView .purchase-flow-line b {
  color: var(--ref-accent) !important;
}

#purchasesView .purchase-command-actions .secondary-btn {
  border-color: var(--ref-line-strong) !important;
  color: var(--ref-ink) !important;
  background: var(--ref-card) !important;
}

#purchasesView .purchase-command-actions .secondary-btn:hover {
  border-color: var(--ref-accent) !important;
  color: var(--ref-accent-dark) !important;
  background: var(--ref-accent-soft) !important;
}

#purchasesView .purchase-command-grid {
  gap: 8px !important;
  padding: 14px 0 0 !important;
}

:is(#financeView .finance-command-cards, #reimbursementsView .reimbursement-command-cards) {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

#financeView .finance-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

#financeView .finance-kpi-grid .kpi,
#reimbursementsView .reimbursement-kpis .kpi {
  min-height: 100px !important;
  padding: 14px 16px !important;
  border-color: var(--ref-line) !important;
  border-radius: var(--ref-radius-panel) !important;
  background: var(--ref-card) !important;
  box-shadow: none !important;
}

#financeView .finance-kpi-grid .kpi strong,
#reimbursementsView .reimbursement-kpis .kpi strong {
  margin-top: 9px !important;
  font-size: 25px !important;
  line-height: 1.1 !important;
}

#financeView .finance-action-strip {
  gap: 10px !important;
}

#financeView .finance-action-card {
  min-height: 154px !important;
  padding: 16px !important;
}

#reimbursementsView .reimbursement-entry-panel {
  margin: 0 !important;
  padding: 14px 16px !important;
}

:is(
  #inventoryView .toolbar,
  #purchasesView .toolbar,
  #batchesView .toolbar,
  #movementsView .toolbar,
  #financeView .toolbar,
  #reimbursementsView .toolbar,
  #usersView .toolbar,
  #platformsView .toolbar
) {
  padding: 10px !important;
  border: 1px solid var(--ref-line) !important;
  border-radius: 10px !important;
  background: var(--ref-toolbar) !important;
}

:is(
  #inventoryView,
  #purchasesView,
  #batchesView,
  #movementsView,
  #financeView,
  #reimbursementsView,
  #usersView,
  #platformsView
) .table-wrap {
  border-color: var(--ref-line) !important;
  border-radius: 10px !important;
  background: var(--ref-card) !important;
}

:is(
  #inventoryView,
  #purchasesView,
  #batchesView,
  #movementsView,
  #financeView,
  #reimbursementsView,
  #usersView,
  #platformsView
) .table-wrap thead {
  background: var(--ref-table-head) !important;
}

:is(
  #inventoryView,
  #purchasesView,
  #batchesView,
  #movementsView,
  #financeView,
  #reimbursementsView,
  #usersView,
  #platformsView
) .table-wrap th {
  min-height: 40px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  color: var(--ref-muted) !important;
  font-size: 11px !important;
}

:is(#batchesView .flow-create-panel, #movementsView .flow-create-panel) {
  padding: 16px !important;
}

:is(#batchesView .flow-create-panel, #movementsView .flow-create-panel) > .form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px !important;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ref-line);
}

:is(#batchesView .flow-create-panel, #movementsView .flow-create-panel) > .form-head h2 {
  margin: 0 0 4px !important;
  font-size: 18px !important;
}

:is(#batchesView .flow-create-panel, #movementsView .flow-create-panel) > .form-head p {
  margin: 0 !important;
  color: var(--ref-muted) !important;
  font-size: 12px !important;
}

#movementsView #movementForm > .primary-btn {
  grid-column: 3 / 5;
  width: min(100%, 320px);
  justify-self: end;
}

#usersView .admin-form-grid {
  grid-template-columns: minmax(0, 1.42fr) minmax(390px, .88fr) !important;
  gap: var(--ref-section-gap) !important;
}

#usersView :is(.admin-role-panel, .admin-user-form-panel) {
  padding: 16px !important;
}

#usersView .admin-role-panel .table-wrap.compact {
  max-height: 430px !important;
  overflow-x: hidden;
}

#usersView .admin-role-panel table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#usersView .admin-role-panel th:nth-child(1) { width: 88px; }
#usersView .admin-role-panel th:nth-child(2) { width: 176px; }
#usersView .admin-role-panel th:nth-child(3) { width: 190px; }
#usersView .admin-role-panel th:nth-child(4) { width: 70px; }
#usersView .admin-role-panel th:nth-child(5) { width: 54px; }
#usersView .admin-role-panel th:nth-child(6) { width: 108px; }
#usersView .admin-role-panel th:nth-child(7) { width: 58px; }

#usersView .role-chip-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

#usersView .role-chip-stack .role-chip {
  min-height: 22px;
  margin: 0;
  padding: 0 7px;
  font-size: 10px;
}

#usersView .role-chip-stack .role-chip.count {
  border: 1px solid var(--ref-line);
  color: var(--ref-muted);
  background: var(--ref-card);
}

#usersView .admin-role-panel td:nth-child(6) {
  white-space: normal;
  word-break: break-word;
}

#exportsView .export-grid {
  gap: 12px !important;
}

#exportsView .export-card {
  min-height: 104px !important;
  padding: 16px 18px !important;
  border-color: var(--ref-line) !important;
  border-radius: var(--ref-radius-panel) !important;
  background: var(--ref-card) !important;
  box-shadow: none !important;
}

#exportsView .export-card:hover,
#exportsView .export-card:focus-visible {
  border-color: var(--ref-accent) !important;
  background: var(--ref-accent-soft) !important;
  outline: none !important;
}

#exportsView .primary-export {
  border-color: var(--ref-navy) !important;
  color: #fff !important;
  background: var(--ref-navy) !important;
}

#exportsView .primary-export span {
  color: #c8d1d6 !important;
}

#platformsView .platform-management-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

#platformsView .platform-management-grid .platform-sync-card {
  grid-column: auto !important;
  min-width: 0;
  padding: 16px !important;
}

#platformsView .platform-management-grid .platform-sync-card :is(.platform-sync-summary, .platform-sync-status, .platform-sync-facts) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#platformsView .platform-management-grid .platform-sync-card .platform-sync-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#platformsView .platform-sync-actions {
  align-items: stretch !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
}

#platformsView .platform-sync-actions button {
  flex: 1 1 150px;
  min-width: 0;
  min-height: var(--ref-control-height);
  white-space: nowrap;
}

/* Order desk uses the available desktop canvas instead of keeping a 1530px cap. */
#ordersView {
  max-width: none !important;
}

#ordersView .orders-pipeline-table {
  min-width: 994px !important;
}

#ordersView .orders-table.orders-pipeline-table th:nth-child(2),
#ordersView .orders-table.orders-pipeline-table td:nth-child(2) {
  width: 190px !important;
  min-width: 190px !important;
}

/* Keep the platform name readable beside the full order ID on desktop rows. */
@media (min-width: 901px) {
  #ordersView .orders-pipeline-table .order-task-info {
    grid-template-columns: 62px minmax(0, 1fr) !important;
  }

  #ordersView .orders-pipeline-table .order-platform-stack {
    width: 62px;
    min-width: 62px;
    justify-items: center;
  }

  #ordersView .orders-pipeline-table .order-platform-stack small {
    width: 62px;
    max-width: 62px !important;
    overflow: visible;
    text-align: center;
    text-overflow: clip;
  }
}

/* Reserve enough room for the next-step control so it never creates a stray scrollbar. */
#ordersView .orders-table.orders-pipeline-table th:nth-child(8),
#ordersView .orders-table.orders-pipeline-table td:nth-child(8) {
  width: 112px !important;
  min-width: 112px !important;
}

#ordersView .orders-pipeline-table .order-id-copy-line .mono {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

/* Delivery-time changes belong to the ECD column (6), not preparation/risk (5). */
#ordersView .orders-pipeline-table tr.has-delivery-change:not(.is-focused):not(.is-live-focus) td:nth-child(5) {
  background: #fffaf1 !important;
}

#ordersView .orders-pipeline-table tr.has-delivery-change.is-focused:not(.is-live-focus) td:nth-child(5) {
  background: #edf5fb !important;
}

#ordersView .orders-pipeline-table tr.has-delivery-change:not(.is-live-focus) td:nth-child(6) {
  background: #fff2d8 !important;
}

#ordersView .orders-pipeline-table tr.has-delivery-change .order-task-deadline {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#ordersView .order-task-deadline.tone-warn strong {
  color: var(--ref-warn) !important;
}

#ordersView .order-task-buyer .order-task-address,
#ordersView .order-task-preparation small,
#ordersView .orders-filter-grid label,
#ordersView .order-search-box label {
  color: var(--ref-muted) !important;
}

.sku-thumb-empty {
  border-color: #56645f !important;
  background: #56645f !important;
}

/* Order detail inspector: one compact card system, aligned to the workspace track. */
#ordersView .orders-pipeline-inspector {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  box-sizing: border-box;
  display: grid;
  gap: 10px !important;
  padding: 0 12px !important;
  border-left: 1px solid var(--ref-line) !important;
  background: #f3efe9 !important;
  overflow-x: hidden;
  overflow-y: auto;
}

#ordersView .orders-pipeline-inspector > .orders-inspector-head {
  gap: 10px !important;
  margin: 0 -12px !important;
  padding: 0 12px 12px !important;
  border: 0 !important;
  color: var(--ref-ink) !important;
  background: transparent !important;
}

#ordersView .orders-pipeline-inspector .orders-inspector-identity,
.orders-mobile-detail-content .orders-inspector-identity {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  color: #ffffff;
  background: var(--ref-navy);
}

#ordersView .orders-pipeline-inspector .orders-inspector-identity {
  margin: 0 -12px;
  border-bottom: 1px solid #30414b;
}

#ordersView .orders-pipeline-inspector .orders-inspector-title-row,
.orders-mobile-detail-content .orders-inspector-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: start;
  gap: 10px;
}

#ordersView .orders-pipeline-inspector .orders-inspector-order-title,
.orders-mobile-detail-content .orders-inspector-order-title {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

#ordersView .orders-pipeline-inspector .orders-inspector-order-title .copyable-line,
.orders-mobile-detail-content .orders-inspector-order-title .copyable-line {
  max-width: none;
}

#ordersView .orders-pipeline-inspector .orders-inspector-order-title strong,
.orders-mobile-detail-content .orders-inspector-order-title strong {
  color: #ffffff;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .01em;
}

#ordersView .orders-pipeline-inspector .orders-inspector-identity .copy-inline-btn,
.orders-mobile-detail-content .orders-inspector-identity .copy-inline-btn {
  border-color: rgba(255, 255, 255, .28);
  color: #ffffff;
  background: rgba(255, 255, 255, .08);
}

#ordersView .orders-pipeline-inspector .orders-inspector-identity .icon-btn,
.orders-mobile-detail-content .orders-inspector-identity .icon-btn {
  border-color: rgba(255, 255, 255, .25);
  color: #ffffff;
  background: rgba(255, 255, 255, .08);
}

#ordersView .orders-pipeline-inspector .orders-inspector-identity .task-status-pill,
.orders-mobile-detail-content .orders-inspector-identity .task-status-pill {
  min-height: 24px;
  padding: 3px 8px;
  border-color: #e5bc83;
  color: #7b4b14;
  background: #fff3d8;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

#ordersView .orders-pipeline-inspector .orders-inspector-identity .task-status-pill.transit,
.orders-mobile-detail-content .orders-inspector-identity .task-status-pill.transit {
  border-color: #bbd4e3;
  color: #245b79;
  background: #e9f4fa;
}

#ordersView .orders-pipeline-inspector .orders-inspector-identity .task-status-pill.completed,
.orders-mobile-detail-content .orders-inspector-identity .task-status-pill.completed {
  border-color: #b8d8c8;
  color: #2d654a;
  background: #e8f4ed;
}

#ordersView .orders-pipeline-inspector .orders-inspector-platform-line,
.orders-mobile-detail-content .orders-inspector-platform-line {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: #d5dde1;
  font-size: 11.5px;
  font-weight: 550;
}

#ordersView .orders-pipeline-inspector .orders-inspector-platform-line span,
#ordersView .orders-pipeline-inspector .orders-inspector-platform-line small,
.orders-mobile-detail-content .orders-inspector-platform-line span,
.orders-mobile-detail-content .orders-inspector-platform-line small {
  min-width: 0;
  color: #d5dde1;
  font-size: 11.5px;
  font-weight: 500;
}

#ordersView .orders-pipeline-inspector .orders-inspector-platform-line small,
.orders-mobile-detail-content .orders-inspector-platform-line small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ordersView .orders-pipeline-inspector .order-live-change-pills,
.orders-mobile-detail-content .order-live-change-pills {
  margin: 0;
}

#ordersView .orders-pipeline-inspector .orders-inspector-quick-summary,
.orders-mobile-detail-content .orders-inspector-quick-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

#ordersView .orders-pipeline-inspector .orders-inspector-quick-summary > span,
.orders-mobile-detail-content .orders-inspector-quick-summary > span {
  min-width: 0;
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--ref-line);
  border-radius: 9px;
  background: #ffffff;
}

#ordersView .orders-pipeline-inspector .orders-inspector-quick-summary > span:last-child,
.orders-mobile-detail-content .orders-inspector-quick-summary > span:last-child {
  grid-column: 1 / -1;
  min-height: 48px;
}

#ordersView .orders-pipeline-inspector .orders-inspector-quick-summary small,
.orders-mobile-detail-content .orders-inspector-quick-summary small {
  color: var(--ref-muted) !important;
  font-size: 10.5px;
  font-weight: 500;
}

#ordersView .orders-pipeline-inspector .orders-inspector-quick-summary strong,
.orders-mobile-detail-content .orders-inspector-quick-summary strong {
  min-width: 0;
  color: var(--ref-ink) !important;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#ordersView .orders-pipeline-inspector .inspector-copy-outbound-btn,
.orders-mobile-detail-content .inspector-copy-outbound-btn {
  min-height: 40px;
  border-color: #cfc6ba;
  border-radius: 9px;
  color: var(--ref-ink);
  background: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

#ordersView .orders-pipeline-inspector > .orders-inspector-section,
.orders-mobile-detail-content > .orders-inspector-section {
  gap: 8px;
  margin: 0 !important;
  padding: 12px !important;
  border: 1px solid var(--ref-line) !important;
  border-radius: 10px !important;
  background: #ffffff !important;
}

#ordersView .orders-pipeline-inspector .orders-inspector-section-head h3,
#ordersView .orders-pipeline-inspector > .orders-inspector-section > h3,
.orders-mobile-detail-content .orders-inspector-section-head h3,
.orders-mobile-detail-content > .orders-inspector-section > h3 {
  margin: 0 !important;
  color: var(--ref-ink) !important;
  font-size: 13px !important;
  font-weight: 650 !important;
}

#ordersView .orders-pipeline-inspector .orders-inspector-section-head > span,
#ordersView .orders-pipeline-inspector .orders-inspector-collapsible summary b,
.orders-mobile-detail-content .orders-inspector-section-head > span,
.orders-mobile-detail-content .orders-inspector-collapsible summary b {
  color: var(--ref-muted);
  font-size: 11px;
  font-weight: 550;
}

#ordersView .orders-pipeline-inspector > .orders-inspector-buyer-section,
.orders-mobile-detail-content > .orders-inspector-buyer-section {
  border-left: 3px solid #3e718d !important;
  background: #f5f8fa !important;
}

#ordersView .orders-pipeline-inspector .orders-inspector-person,
.orders-mobile-detail-content .orders-inspector-person {
  gap: 3px;
}

#ordersView .orders-pipeline-inspector .orders-inspector-person strong,
.orders-mobile-detail-content .orders-inspector-person strong {
  color: #26343c;
  font-size: 13px;
  font-weight: 650;
}

#ordersView .orders-pipeline-inspector .orders-inspector-person span,
.orders-mobile-detail-content .orders-inspector-person span {
  color: #365f75;
  font-size: 12px;
  font-weight: 500;
}

#ordersView .orders-pipeline-inspector .orders-inspector-person p,
.orders-mobile-detail-content .orders-inspector-person p {
  margin-top: 4px;
  color: #5d6b73;
  font-size: 11.5px;
  line-height: 1.5;
}

#ordersView .orders-pipeline-inspector > .delivery-remark-section,
.orders-mobile-detail-content > .delivery-remark-section {
  border-left: 3px solid #b7772d !important;
  background: #fffaf2 !important;
}

#ordersView .orders-pipeline-inspector .orders-inspector-product-section .order-task-product,
.orders-mobile-detail-content .orders-inspector-product-section .order-task-product {
  padding: 8px;
  border: 1px solid #e4ded5;
  border-radius: 8px;
  background: #faf8f5;
}

#ordersView .orders-pipeline-inspector .orders-inspector-fulfillment-section .orders-inspector-facts,
.orders-mobile-detail-content .orders-inspector-fulfillment-section .orders-inspector-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

#ordersView .orders-pipeline-inspector .orders-inspector-fulfillment-section .orders-inspector-facts div,
.orders-mobile-detail-content .orders-inspector-fulfillment-section .orders-inspector-facts div {
  min-height: 52px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 4px;
  padding: 8px;
  border: 1px solid #e4ded5;
  border-radius: 8px;
  background: #faf8f5;
}

#ordersView .orders-pipeline-inspector .orders-inspector-fulfillment-section .orders-inspector-facts dd,
.orders-mobile-detail-content .orders-inspector-fulfillment-section .orders-inspector-facts dd {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
}

#ordersView .orders-pipeline-inspector .orders-inspector-fulfillment-section .task-status-pill,
.orders-mobile-detail-content .orders-inspector-fulfillment-section .task-status-pill {
  justify-self: start;
}

#ordersView .orders-pipeline-inspector .orders-inspector-collapsible > summary,
.orders-mobile-detail-content .orders-inspector-collapsible > summary {
  min-height: 32px;
  color: var(--ref-ink);
  font-size: 12.5px;
  font-weight: 650;
}

#ordersView .orders-pipeline-inspector .orders-inspector-map-line,
.orders-mobile-detail-content .orders-inspector-map-line {
  border: 1px solid #e4ded5;
  border-radius: 8px;
  background: #faf8f5;
}

#ordersView .orders-pipeline-inspector > .orders-inspector-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 0 -12px !important;
  padding: 12px !important;
  border-top: 1px solid var(--ref-line);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(10px);
}

#ordersView .orders-pipeline-inspector .orders-inspector-actions .row-btn {
  min-height: 38px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

#ordersView .orders-pipeline-inspector .orders-inspector-actions .row-btn[data-action="ship"] {
  min-height: 42px;
  border-color: var(--ref-accent);
  color: #ffffff;
  background: var(--ref-accent);
}

.orders-mobile-detail-content > .orders-inspector-head {
  gap: 10px;
  padding: 0 !important;
  border: 0 !important;
  color: var(--ref-ink) !important;
  background: transparent !important;
}

.orders-mobile-detail-content .orders-inspector-identity {
  border-radius: 10px;
}

@media (max-width: 1180px) {
  :is(#financeView .finance-command-cards, #reimbursementsView .reimbursement-command-cards) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  #financeView .finance-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  #usersView .admin-form-grid,
  #platformsView .platform-management-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 900px) {
  :is(
    #shippingView .shipping-command-panel,
    #inventoryView .inventory-command-panel,
    #batchesView .flow-command-panel,
    #movementsView .flow-command-panel,
    #financeView .finance-command-panel,
    #reimbursementsView .reimbursement-command-panel,
    #usersView .admin-command-panel,
    #exportsView .admin-command-panel,
    #platformsView .admin-command-panel
  ) > .panel-head,
  #purchasesView .purchase-command-layout {
    min-height: auto !important;
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  :is(
    #shippingView .shipping-command-panel,
    #inventoryView .inventory-command-panel,
    #batchesView .flow-command-panel,
    #movementsView .flow-command-panel,
    #financeView .finance-command-panel,
    #reimbursementsView .reimbursement-command-panel,
    #usersView .admin-command-panel,
    #exportsView .admin-command-panel,
    #platformsView .admin-command-panel
  ) > .panel-head :is(h1, h2),
  #purchasesView .purchase-command-copy h2 {
    font-size: 24px !important;
  }

  #purchasesView .purchase-command-actions,
  #shippingView .shipping-controls,
  :is(#inventoryView, #batchesView, #movementsView, #financeView, #reimbursementsView, #usersView, #platformsView) .panel-actions {
    width: 100%;
  }

  #purchasesView .purchase-command-actions > button,
  #shippingView .shipping-controls > button,
  #shippingView .shipping-controls > label,
  :is(#inventoryView, #batchesView, #movementsView, #financeView, #reimbursementsView, #usersView, #platformsView) .panel-actions > * {
    flex: 1 1 100%;
    width: 100%;
  }

  #purchasesView .purchase-flow-line {
    width: 100%;
    overflow-x: auto;
  }

  :is(
    #shippingView .shipping-kpis,
    #inventoryView .stock-command-cards,
    #purchasesView .purchase-command-grid,
    #batchesView .stock-command-cards,
    #movementsView .stock-command-cards,
    #financeView .finance-command-cards,
    #reimbursementsView .reimbursement-command-cards,
    #usersView .user-command-cards,
    #exportsView .export-command-cards,
    #platformsView .platform-command-cards,
    #financeView .finance-kpi-grid,
    #reimbursementsView .reimbursement-kpis
  ) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  :is(#batchesView #inboundOrderForm, #movementsView #movementForm) {
    grid-template-columns: 1fr !important;
  }

  :is(#batchesView #inboundOrderForm, #movementsView #movementForm) > * {
    grid-column: 1 !important;
  }

  #movementsView #movementForm > .primary-btn {
    width: 100%;
  }

  #usersView .admin-role-panel table {
    min-width: 700px;
  }

  #usersView .admin-role-panel .table-wrap.compact {
    overflow-x: auto;
  }

  #exportsView .export-grid {
    grid-template-columns: 1fr !important;
  }

  #reimbursementsView .reimbursement-entry-panel > .panel-head {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  #reimbursementsView .reimbursement-entry-panel #newReimbursementBtn {
    width: 100%;
    min-height: 42px;
    white-space: nowrap;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 190px minmax(0, 1fr) !important;
  }

  .ui-system-home-grid,
  .reference-product-workspace {
    grid-template-columns: 1fr !important;
  }

  .ui-system-home-rail {
    grid-template-columns: 1fr 1fr !important;
  }

  .reference-product-list {
    border-right: 0;
  }

  .reference-product-inspector {
    position: static;
    margin-top: 12px;
    border: 1px solid var(--ref-line);
    border-radius: 12px;
  }

  .reference-product-row,
  .reference-product-head {
    grid-template-columns: 1.45fr 1fr .6fr .8fr .68fr;
  }

  .reference-product-row > span:nth-child(4),
  .reference-product-head > span:nth-child(4) {
    display: none;
  }

  #ordersView .orders-pipeline-workspace {
    grid-template-columns: minmax(0, 1fr) 300px !important;
  }
}

@media (max-width: 900px) {
  body {
    padding-bottom: 72px;
  }

  .app-shell {
    display: block !important;
  }

  .sidebar {
    width: min(86vw, 320px) !important;
  }

  .topbar,
  .workspace.view-orders-active > .topbar {
    min-height: 52px !important;
    padding: 0 10px !important;
  }

  .topbar-breadcrumb > span,
  .topbar-breadcrumb > .lucide,
  #changelogBtn,
  .topbar-system {
    display: none !important;
  }

  .topbar-breadcrumb h1 {
    font-size: 11px !important;
  }

  .top-actions .icon-btn {
    width: 40px !important;
    height: 40px !important;
  }

  .workspace > .view {
    padding: 15px 10px 28px !important;
  }

  .ui-system-home-head,
  .orders-page-head,
  .sku-intro-panel,
  .sku-intro-panel > .panel-head {
    min-height: auto !important;
    align-items: flex-start !important;
  }

  .ui-system-home-head,
  .orders-page-head,
  .sku-intro-panel > .panel-head {
    flex-direction: column;
    gap: 14px;
  }

  .ui-system-home-head h2,
  .orders-page-head h1,
  .sku-intro-panel .panel-head h2 {
    font-size: 27px !important;
  }

  .dashboard-command-actions,
  .orders-head-actions,
  .sku-intro-panel .panel-head > button {
    width: 100%;
  }

  .dashboard-command-actions > button,
  .orders-head-actions > button,
  .sku-intro-panel .panel-head > button {
    min-height: 44px !important;
    flex: 1;
  }

  #dashboardView .dashboard-alert-rail {
    display: flex !important;
    overflow-x: auto !important;
  }

  #dashboardView .dashboard-alert-rail::before {
    min-width: 130px;
  }

  #dashboardView .dashboard-alert-rail .dashboard-alert {
    min-width: 150px;
  }

  .ui-system-home-grid,
  .ui-system-home-bottom,
  .ui-system-home-rail {
    grid-template-columns: 1fr !important;
  }

  #ordersView .orders-pipeline-stages {
    display: flex !important;
    overflow-x: auto !important;
  }

  #ordersView .orders-pipeline-stages::before {
    min-width: 140px;
  }

  #ordersView .orders-pipeline-stages button {
    min-width: 126px;
  }

  #ordersView .orders-pipeline-workspace {
    display: block !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #ordersView .orders-pipeline-list {
    width: 100%;
    border-radius: 10px;
  }

  #ordersView .orders-pipeline-inspector {
    display: none !important;
  }

  .orders-platform-chips {
    display: flex !important;
    overflow-x: auto;
  }

  .orders-filter-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .order-search-box {
    grid-column: 1 / -1;
  }

  .sku-workspace-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .sku-workspace-tabs button {
    min-width: 0;
    padding: 0 9px !important;
  }

  .sku-workspace-tabs button span {
    font-size: 11px;
  }

  .sku-workspace-tabs button small {
    display: none;
  }

  .sku-workspace-tabs button b {
    font-size: 16px;
  }

  .reference-product-head {
    display: none;
  }

  .reference-product-rows {
    display: grid;
    gap: 8px;
    padding: 8px;
    background: #eee9e1;
  }

  .reference-product-row {
    min-height: 190px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--ref-line);
    border-radius: 8px;
  }

  .reference-product-main {
    grid-column: 1 / -1;
    grid-template-columns: 54px minmax(0, 1fr) !important;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--ref-line);
  }

  .reference-product-row > span:nth-child(4) {
    display: grid;
  }

  .reference-product-inspector {
    margin-top: 10px;
  }

  .reference-product-inspector-footer {
    position: sticky;
    bottom: 70px;
    z-index: 5;
  }

  .product-intelligence-band {
    margin-top: 12px !important;
  }
}

/* Mobile density pass: preserve information without squeezing desktop tracks. */
@media (max-width: 900px) {
  #dashboardView .dashboard-command,
  #dashboardView .dashboard-pipeline,
  #dashboardView .ops-kpi-grid,
  #dashboardView .dashboard-ops-grid {
    width: 100% !important;
    max-width: 100% !important;
  }

  #dashboardView .dashboard-alert-rail {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  #dashboardView .dashboard-alert-rail::before {
    content: none !important;
    display: none !important;
  }

  #dashboardView .dashboard-alert-rail .dashboard-alert {
    min-width: 0 !important;
    min-height: 68px !important;
    padding: 10px 12px !important;
    border-right: 1px solid #3b4951 !important;
    border-bottom: 1px solid #3b4951 !important;
  }

  #dashboardView .dashboard-alert-rail .dashboard-alert:nth-child(even) {
    border-right: 0 !important;
  }

  #dashboardView .dashboard-alert-rail .dashboard-alert:last-child {
    grid-column: 1 / -1;
    border-right: 0 !important;
    border-bottom: 0 !important;
  }

  #dashboardView .ui-system-priority-row {
    grid-template-columns: minmax(0, 1fr) minmax(104px, .7fr) !important;
    gap: 8px 12px !important;
    padding: 12px !important;
  }

  #dashboardView .ui-system-priority-row > span {
    min-width: 0;
  }

  #dashboardView .ui-system-priority-row > span:nth-child(1) {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  #dashboardView .ui-system-priority-row > span:nth-child(2) {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    padding-left: 42px !important;
  }

  #dashboardView .ui-system-priority-row > span:nth-child(2) small,
  #dashboardView .ui-system-priority-row > span:nth-child(4) strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  #dashboardView .ui-system-priority-row > span:nth-child(3) {
    grid-column: 1 !important;
    grid-row: 3 !important;
    padding-left: 42px !important;
  }

  #dashboardView .ui-system-priority-row > span:nth-child(4) {
    grid-column: 2 !important;
    grid-row: 3 !important;
    align-self: start;
    text-align: left;
  }

  #dashboardView .ui-system-priority-row > span:nth-child(5) {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
  }

  #ordersView .orders-page-head .eyebrow {
    display: none !important;
  }

  #ordersView .orders-pipeline-stages {
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    overflow: hidden !important;
  }

  #ordersView .orders-pipeline-stages::before {
    content: none !important;
    display: none !important;
  }

  #ordersView .orders-pipeline-stages button {
    min-width: 0 !important;
    min-height: 54px !important;
    padding: 9px 12px !important;
    border-right: 1px solid var(--ref-line) !important;
    border-bottom: 1px solid var(--ref-line) !important;
    justify-content: start !important;
  }

  #ordersView .orders-pipeline-stages button:nth-of-type(even) {
    border-right: 0 !important;
  }

  #ordersView .orders-pipeline-stages button:nth-of-type(n + 3) {
    border-bottom: 0 !important;
  }

  #ordersView .orders-pipeline-stages button.active {
    border-bottom-color: var(--ref-line) !important;
    background: var(--ref-accent-soft) !important;
    box-shadow: inset 3px 0 0 var(--ref-accent) !important;
  }

  #ordersView .orders-pipeline-stages button strong {
    font-size: 11.5px !important;
  }

  #ordersView .orders-pipeline-stages button small,
  #ordersView .orders-pipeline-stages .orders-stage-chevron {
    display: none !important;
  }

  #inventoryView .inventory-warehouse-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    overflow: hidden !important;
  }

  #inventoryView .inventory-warehouse-tabs button {
    min-width: 0 !important;
    padding-inline: 6px !important;
    white-space: normal;
  }

  #purchasesView .purchase-command-card {
    min-height: 96px;
  }

  #purchasesView .purchase-command-card small {
    min-height: 28px;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
}

/* 202607212341: mobile order filters must fit inside their rounded panel. */
@media (max-width: 760px) {
  #ordersView .orders-filter-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  #ordersView .orders-platform-chips {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  #ordersView .orders-platform-chips button {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    flex: initial !important;
    justify-content: flex-start !important;
    padding-inline: 10px !important;
    border-radius: var(--ref-radius-control) !important;
    box-sizing: border-box !important;
  }

  #ordersView .orders-platform-chips button > span {
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  #ordersView .orders-platform-chips button > b {
    margin-left: auto;
    flex: 0 0 auto;
  }

  #ordersView .orders-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  #ordersView .orders-filter-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
    grid-row: auto !important;
    box-sizing: border-box !important;
  }

  #ordersView .orders-filter-grid > .search-box {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    order: 0 !important;
  }

  #ordersView .orders-filter-grid > .compact-field:nth-child(2),
  #ordersView .orders-filter-grid > .compact-field:nth-child(3),
  #ordersView .orders-filter-grid > .compact-field:nth-child(4),
  #ordersView .orders-filter-grid > .compact-field:nth-child(5) {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  #ordersView .order-search-control {
    grid-template-columns: minmax(0, 1fr) auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  #ordersView #orderSearch,
  #ordersView .order-search-btn,
  #ordersView .orders-filter-grid input,
  #ordersView .orders-filter-grid select {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #ordersView #orderSearch {
    width: 100% !important;
    font-size: 16px !important;
  }

  #ordersView .order-custom-date-fields,
  #ordersView .compact-filter-btn {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
}

@media (max-width: 380px) {
  #ordersView .orders-filter-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #ordersView .orders-filter-grid > .search-box,
  #ordersView .orders-filter-grid > .compact-field,
  #ordersView .order-custom-date-fields,
  #ordersView .compact-filter-btn {
    grid-column: 1 !important;
  }
}

/* 202607212354: keep the boss daily report reachable on mobile. */
@media (max-width: 760px) {
  #ordersView .order-daily-summary-panel {
    display: grid !important;
    order: 6 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 0 10px !important;
    padding: 12px !important;
    box-sizing: border-box !important;
    border-radius: var(--ref-radius-panel) !important;
  }

  #ordersView .order-daily-summary-controls .primary-btn,
  #ordersView .order-daily-summary-controls .secondary-btn {
    min-height: 44px !important;
  }

  #ordersView .order-daily-summary-metrics,
  #ordersView .order-daily-summary-body > div:first-child {
    display: none !important;
  }

  #ordersView .order-daily-summary-body {
    display: block !important;
    min-width: 0 !important;
  }

  #ordersView .order-daily-copy-preview {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 112px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

/* 202607221545: keep one intentional focus rail on mobile order cards. */
@media (max-width: 760px) {
  #ordersView .mobile-task-footer > div:first-child {
    border: 0 !important;
    border-radius: var(--ref-radius-control) !important;
    background: var(--ref-subtle) !important;
    box-shadow: none !important;
  }
}

/* 202607221603: use one continuous card outline instead of a protruding focus rail. */
@media (max-width: 760px) {
  #ordersView .order-mobile-task-card.is-focused {
    box-shadow: 0 4px 12px rgba(46, 111, 158, 0.1) !important;
  }
}

/* 20260722: finish the three product workspaces as one visual system. */
#platformOnlineProductsPanel {
  overflow: hidden !important;
  border: 1px solid var(--ref-line) !important;
  border-radius: var(--ref-radius-panel) !important;
  color: var(--ref-ink) !important;
  background: var(--ref-card) !important;
  box-shadow: none !important;
}

#platformOnlineProductsPanel .platform-online-command-area {
  border-bottom: 1px solid var(--ref-line) !important;
  color: var(--ref-ink) !important;
  background: var(--ref-card) !important;
}

#platformOnlineProductsPanel .platform-online-command-head {
  padding: var(--ref-panel-padding) 18px 12px !important;
}

#platformOnlineProductsPanel .platform-online-command-head .eyebrow {
  color: var(--ref-accent) !important;
  letter-spacing: .08em;
}

#platformOnlineProductsPanel .platform-online-command-head h2 {
  color: var(--ref-ink) !important;
  font-size: 20px !important;
}

#platformOnlineProductsPanel .platform-online-command-head p:last-child {
  color: var(--ref-muted) !important;
}

#platformOnlineProductsPanel .platform-online-command-actions .review-count {
  border-color: var(--ref-line-strong) !important;
  color: var(--ref-ink) !important;
  background: var(--ref-subtle) !important;
}

#platformOnlineProductsPanel .platform-online-command-actions .secondary-btn {
  border-color: var(--ref-line-strong) !important;
  color: var(--ref-ink) !important;
  background: var(--ref-card) !important;
}

#platformOnlineProductsPanel .inventory-sync-status-bar {
  margin: 0 18px !important;
  border-color: var(--ref-line) !important;
  border-radius: var(--ref-radius-control) !important;
  color: var(--ref-ink) !important;
  background: var(--ref-subtle) !important;
}

#platformOnlineProductsPanel .inventory-sync-status-bar > div {
  border-right-color: var(--ref-line) !important;
}

#platformOnlineProductsPanel .inventory-sync-status-bar span,
#platformOnlineProductsPanel .inventory-sync-status-bar small {
  color: var(--ref-muted) !important;
}

#platformOnlineProductsPanel .inventory-sync-status-bar strong,
#platformOnlineProductsPanel .inventory-sync-safety-note span {
  color: var(--ref-ink) !important;
}

#platformOnlineProductsPanel .inventory-sync-safety-note.is-danger {
  border-left-color: var(--ref-danger) !important;
  background: var(--ref-danger-soft) !important;
}

#platformOnlineProductsPanel .platform-online-platform-nav {
  padding: 10px 18px 12px !important;
}

#platformOnlineProductsPanel .platform-online-platform-nav button {
  border-color: transparent !important;
  color: var(--ref-muted) !important;
  background: transparent !important;
}

#platformOnlineProductsPanel .platform-online-platform-nav button:hover,
#platformOnlineProductsPanel .platform-online-platform-nav button.active {
  border-color: var(--ref-line-strong) !important;
  color: var(--ref-ink) !important;
  background: var(--ref-toolbar) !important;
}

#platformOnlineProductsPanel .platform-online-platform-nav strong,
#platformOnlineProductsPanel .platform-online-platform-nav button.active strong {
  color: inherit !important;
  background: var(--ref-card) !important;
}

#platformOnlineProductsPanel .platform-online-filter-board,
#platformOnlineProductsPanel .platform-online-command-cards,
#platformOnlineProductsPanel .platform-online-action-strip,
#platformOnlineProductsPanel .platform-online-table-wrap {
  border-color: var(--ref-line) !important;
  background: var(--ref-card) !important;
}

#platformOnlineProductsPanel .platform-online-filter-board {
  border-radius: var(--ref-radius-control) !important;
}

#platformOnlineProductsPanel .platform-online-metric {
  border-right-color: var(--ref-line) !important;
  background: var(--ref-card) !important;
}

#platformOnlineProductsPanel .platform-online-metric.active {
  background: var(--ref-accent-soft) !important;
  box-shadow: inset 0 -3px 0 var(--ref-accent) !important;
}

#platformOnlineProductsPanel .platform-online-action-strip {
  background: var(--ref-subtle) !important;
}

#platformOnlineProductsPanel .platform-online-table-wrap thead th {
  color: var(--ref-muted) !important;
  background: var(--ref-table-head) !important;
}

#platformOnlineProductsPanel .platform-online-product-group-row td {
  border-color: var(--ref-line) !important;
  background: var(--ref-subtle) !important;
}

@media (max-width: 760px) {
  #platformOnlineProductsPanel .platform-online-command-head {
    padding: 14px !important;
  }

  #platformOnlineProductsPanel .inventory-sync-status-bar {
    margin: 0 14px !important;
  }

  #platformOnlineProductsPanel .platform-online-platform-nav {
    padding: 10px 14px 12px !important;
  }
}

/* 202607221643: restore the filled mobile title bar on the order workspace. */
@media (max-width: 900px) {
  .workspace.view-orders-active > .topbar {
    border-bottom-color: #18394a !important;
    background: #102a3a !important;
    backdrop-filter: none !important;
  }
}

/* 202607231016: keep the ERP product inspector available while browsing long lists. */
@media (min-width: 1181px) {
  #skuErpPanel .reference-product-list {
    max-height: clamp(480px, calc(100dvh - 400px), 640px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  #skuErpPanel .reference-product-head {
    position: sticky;
    top: 0;
    z-index: 4;
  }
}

/* 202607231611: make inbound orders the primary workspace and demote auxiliary procurement tracking. */
#batchesView .inbound-command-actions,
#batchesView .inbound-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

#batchesView .inbound-command-actions :is(.primary-btn, .secondary-btn),
#batchesView .inbound-secondary-actions .secondary-btn {
  min-height: var(--ref-control-height) !important;
  white-space: nowrap;
}

#batchesView .inbound-create-panel {
  scroll-margin-top: 16px;
}

#batchesView .inbound-create-panel.is-collapsed {
  display: none !important;
}

#batchesView .inbound-create-panel > .form-head > div {
  min-width: 0;
}

#batchesView .inbound-create-panel > .form-head > .secondary-btn {
  flex: 0 0 auto;
}

#batchesView .inbound-review-panel {
  scroll-margin-top: 16px;
}

#batchesView .inbound-transit-panel {
  padding: 0 !important;
  overflow: hidden;
}

#batchesView .inbound-transit-panel > .panel-head {
  min-height: 72px;
  margin: 0 !important;
  padding: 14px 16px;
}

#batchesView .inbound-transit-panel > .panel-head p:not(.eyebrow) {
  max-width: 720px;
  margin: 4px 0 0 !important;
  color: var(--ref-muted) !important;
  font-size: 12px !important;
}

#batchesView .inbound-transit-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--ref-line);
}

#batchesView .inbound-transit-body[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  #batchesView .inbound-command-actions {
    width: 100%;
  }

  #batchesView .inbound-command-actions :is(.primary-btn, .secondary-btn) {
    flex: 1 1 0;
  }

  #batchesView .inbound-create-panel > .form-head,
  #batchesView .inbound-transit-panel > .panel-head {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  #batchesView .inbound-create-panel > .form-head > .secondary-btn {
    width: 100%;
  }

  #batchesView .inbound-secondary-actions {
    width: 100%;
    justify-content: space-between;
  }
}
