:root {
  --blue: #1677ff;
  --blue-dark: #0958d9;
  --green: #178b57;
  --red: #f5222d;
  --amber: #b7791f;
  --ink: #1f2937;
  --muted: #8c8c8c;
  --line: #d9dfe8;
  --panel: #f5f7fa;
  --row: #fffdf1;
  --row-alt: #f8fafc;
  --erp-head: #f2f5f9;
  --erp-hover: #eaf4ff;
  --erp-focus: rgba(22, 119, 255, 0.14);
  --erp-radius: 3px;
  --settings-check-size: 16px;
  --settings-radio-size: 16px;
  --settings-switch-width: 32px;
  --settings-switch-height: 18px;
  --settings-1920-content-width: 1832px;
}

/* production summary: align dense toolbars with the confirmed product summary behavior */
.production-view .production-erp-filter-panel {
  min-height: 74px;
  max-height: 74px;
  padding: 9px 10px 8px;
  overflow: hidden;
  background: #f4f7fb;
  border-bottom-color: #ccd8e6;
  box-shadow: inset 0 -1px 0 #e8eef5;
}

.production-erp-filter-grid {
  grid-template-columns:
    minmax(0, 150fr)
    minmax(0, 132fr)
    minmax(0, 132fr)
    minmax(0, 132fr)
    minmax(0, 132fr)
    minmax(0, 132fr)
    minmax(0, 132fr)
    minmax(0, 132fr)
    minmax(0, 132fr)
    minmax(0, 132fr)
    minmax(0, 108fr)
    minmax(0, 108fr);
  grid-auto-rows: 30px;
  gap: 6px;
  overflow: hidden;
}

.production-erp-filter-grid input,
.production-erp-filter-grid select {
  min-width: 0;
  padding-inline: 4px;
  border-color: #c5d1df;
  color: #26384f;
  font-size: clamp(10px, 0.65vw, 12px);
}

.production-action-strip {
  height: 30px;
  overflow-x: hidden;
  overflow-y: hidden;
}

.production-action-strip > button,
.production-action-strip > .production-action-toggle {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  padding-inline: clamp(4px, 0.55vw, 12px);
  overflow: hidden;
  border-color: #c8d3df;
  background: #f9fbfd;
  color: #30445c;
  font-size: clamp(10px, 0.65vw, 12px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-action-strip .primary {
  border-color: #176fb8;
  background: #176fb8;
  color: #fff;
}

.production-action-strip .primary:hover:not(:disabled) {
  border-color: #0f5e9f;
  background: #0f5e9f;
  color: #fff;
}

.production-erp-toolbar {
  display: flex;
  align-items: center;
  gap: 0 !important;
  background: #f7f9fc;
}

.production-erp-toolbar .table-tabs {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  padding-left: 6px;
  gap: 3px;
  overflow: hidden;
}

.production-erp-toolbar .table-tabs button,
.production-toolbar-quick-filter .quick-filter-chip {
  box-sizing: border-box;
  flex: 0 1 auto;
  min-width: 0;
  height: 22px !important;
  min-height: 22px;
  max-height: 22px;
  margin: 0;
  padding: 0 clamp(5px, 0.55vw, 12px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-color: transparent #d5deea !important;
  border-radius: 0;
  background: #f8fafc !important;
  color: #41546b;
  font-size: clamp(10px, 0.65vw, 12px);
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none !important;
  outline: none;
}

.production-erp-toolbar .table-tabs button[data-production-tab] {
  min-width: 0;
  margin: 0;
}

.production-erp-toolbar .table-tabs button.active,
.production-toolbar-quick-filter .quick-filter-chip.active,
.production-toolbar-quick-filter .quick-filter-chip[aria-pressed="true"] {
  border-color: transparent #d5deea !important;
  background: #d8e8f8 !important;
  color: #153b66;
  font-weight: 500;
}

.production-toolbar-quick-filter {
  flex: 0 1 360px;
  width: auto;
  max-width: 360px;
  height: 28px;
  padding: 0 6px;
  overflow: hidden;
  background: transparent;
}

.production-toolbar-quick-filter .quick-filter-chip {
  position: relative;
  max-width: 180px;
  padding-right: 20px;
}

.production-toolbar-quick-filter .quick-filter-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-toolbar-quick-filter .quick-filter-chip > em {
  position: absolute;
  top: 2px;
  right: 3px;
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  color: #6f8195;
  font-size: 12px;
  line-height: 16px;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.production-toolbar-quick-filter .quick-filter-chip:hover > em,
.production-toolbar-quick-filter .quick-filter-chip:focus-visible > em {
  opacity: 0.72;
}

.production-toolbar-quick-filter .quick-filter-chip > em:hover {
  background: #dbe6f1;
  color: #294f78;
  opacity: 1;
}

.production-erp-toolbar .column-order-open {
  flex: 0 0 86px;
  min-width: 86px;
}

.production-bottom-toolbar {
  overflow: hidden;
}

.production-bottom-toolbar .production-data-meta {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(9px, 0.58vw, 11px);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.production-bottom-toolbar .production-data-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  background: #eef2f7;
}

body.auth-pending .sidebar,
body.auth-pending .sidebar-submenu,
body.auth-pending .app,
body.authenticated .login-view {
  display: none;
}

.login-view {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2f7;
}

.login-panel {
  width: min(380px, calc(100vw - 32px));
  border: 1px solid #cfd9e8;
  background: #fff;
  box-shadow: 0 18px 42px rgba(31, 47, 70, 0.16);
  padding: 28px;
  display: grid;
  gap: 14px;
}

.login-panel strong {
  color: var(--blue);
}

.login-panel h1 {
  margin: 8px 0 4px;
  font-size: 24px;
}

.login-panel p {
  margin: 0;
  color: var(--muted);
}

.login-panel label {
  display: grid;
  gap: 6px;
  color: #526174;
}

.login-panel input {
  width: 100%;
  height: 34px;
  border: 1px solid #cfd7e3;
  padding: 0 9px;
}

.login-error {
  border: 1px solid #efb4b4;
  background: #fff1f1;
  color: #b42318;
  padding: 8px 10px;
}

.current-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  border-left: 1px solid #d7dfeb;
  color: #24364b;
  padding: 0 8px 0 12px;
  white-space: nowrap;
}

.current-user-badge strong {
  color: #142b45;
}

.current-user-badge span {
  color: #65758a;
}

.current-user-badge .user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1988d8;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.current-user-badge .user-account {
  color: #8a97a8;
  font-size: 12px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  height: 30px;
  padding: 0 12px;
}

button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.primary:hover {
  background: var(--blue-dark);
  color: #fff;
}

.ghost {
  background: #fff;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 72px;
  background: #0f8ee8;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  color: #fff;
  z-index: 10;
  overflow-y: auto;
}

.brand {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}

.nav {
  height: 48px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #fff;
  padding: 0 8px;
}

.nav.active,
.nav:hover {
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
}

.sidebar-data-nav {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.data-root-nav {
  width: 100%;
}

.sidebar-submenu {
  position: fixed;
  inset: 0 auto 0 72px;
  width: 280px;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 24px rgba(19, 37, 62, 0.12);
  z-index: 60;
  display: flex;
  flex-direction: column;
  color: var(--ink);
}

.submenu-head {
  flex: 0 0 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid #eef2f7;
}

.submenu-head strong {
  font-size: 15px;
}

.submenu-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  color: #5f6f83;
  background: transparent;
  font-size: 18px;
  line-height: 28px;
}

.submenu-close:hover {
  background: #f3f7fb;
  color: var(--blue);
}

.submenu-list {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 10px 18px;
}

.data-subnav {
  width: 100%;
  min-height: 38px;
  height: auto;
  border: 0;
  background: transparent;
  color: #1f2a3d;
  padding: 6px 10px;
  text-align: left;
  font-size: 13px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 9px;
}

.data-subnav::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid #9fb3c8;
  background:
    linear-gradient(#9fb3c8, #9fb3c8) 4px 5px / 10px 1px no-repeat,
    linear-gradient(#9fb3c8, #9fb3c8) 4px 9px / 10px 1px no-repeat,
    linear-gradient(#9fb3c8, #9fb3c8) 4px 13px / 7px 1px no-repeat;
}

.data-subnav.active,
.data-subnav:hover {
  background: #eef6ff;
  color: var(--blue);
}

.data-subnav.active::before,
.data-subnav:hover::before {
  border-color: var(--blue);
  background:
    linear-gradient(var(--blue), var(--blue)) 4px 5px / 10px 1px no-repeat,
    linear-gradient(var(--blue), var(--blue)) 4px 9px / 10px 1px no-repeat,
    linear-gradient(var(--blue), var(--blue)) 4px 13px / 7px 1px no-repeat;
}

.data-subnav-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 12px 8px;
}

.settings-submenu-list {
  padding-top: 10px;
}

.settings-submenu-group {
  padding: 4px 0 10px;
  border-bottom: 1px solid #eef2f7;
}

.settings-submenu-group:last-child {
  border-bottom: 0;
}

.settings-submenu-title {
  color: #6b7687;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px 4px;
}

.submenu-list .data-subnav > span {
  min-width: 0;
  flex: 1 1 auto;
}

.settings-dev-badge {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid #efc7c2;
  background: #fff5f3;
  color: #c4473a;
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  line-height: 16px;
}

.settings-submenu-list .data-subnav.is-pending:hover .settings-dev-badge {
  border-color: #e8aaa2;
  background: #fff;
}

.background-import-panel {
  padding: 10px 12px 12px;
}

.background-import-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.inventory-report-view {
  padding: 0 10px 10px;
  overflow: hidden;
}

.inventory-report-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(140px, 200px) 64px 64px;
  gap: 6px;
  align-items: center;
  padding: 8px 0 6px;
}

.inventory-report-toolbar input,
.inventory-report-toolbar select {
  width: 100%;
  min-width: 0;
  height: 30px;
}

.inventory-report-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-top: 1px solid #e7edf5;
  border-bottom: 1px solid #e7edf5;
  padding: 5px 0;
  overflow: hidden;
}

.inventory-report-actions button {
  flex: 0 0 auto;
}

.inventory-report-meta {
  color: #607086;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 6px;
}

.inventory-report-table .subtle-cell {
  color: #8794a8;
  font-size: 12px;
}

.inventory-report-table .rate-high {
  color: #c62828;
  font-weight: 700;
}

.return-rate-stack {
  display: inline-grid;
  gap: 2px;
  min-width: 112px;
  justify-items: start;
  line-height: 1.25;
}

.return-rate-line {
  display: grid;
  grid-template-columns: 18px minmax(48px, auto);
  gap: 4px;
  align-items: baseline;
  color: #202b3c;
}

.return-rate-line strong {
  color: inherit;
}

.return-rate-line.primary-platform {
  color: #0b63ce;
  font-weight: 800;
}

.return-rate-line.primary-platform .return-platform {
  color: #0b63ce;
  font-weight: 800;
}

.return-platform,
.return-qty {
  color: #8794a8;
  font-size: 12px;
  font-weight: 400;
}

.inventory-report-wrap {
  height: calc(100vh - 200px);
  overflow: auto;
  background: #fff;
}

.inventory-report-table {
  min-width: 1680px;
}

.inventory-report-table th,
.inventory-report-table td {
  text-align: center;
  vertical-align: middle;
}

.inventory-report-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.inventory-report-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #fff;
  font-weight: 700;
}

.hint-cell {
  text-align: left;
  color: var(--muted);
  padding: 16px;
}

.background-import-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
  min-height: 176px;
}

.background-card-head,
.background-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.background-card-head strong {
  font-size: 15px;
}

.status-ok,
.status-empty,
.status-warn,
.status-danger {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #b7d7c5;
  color: var(--green);
  background: #f0fbf5;
}

.status-empty {
  border-color: #d7dce5;
  color: var(--muted);
  background: #f8fafc;
}

.status-warn {
  border-color: #f3c56b;
  color: #a35d00;
  background: #fff7e6;
}

.status-danger {
  border-color: #f0a8a8;
  color: #b42318;
  background: #fff1f1;
}

.background-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
  margin: 14px 0 12px;
}

.background-card-meta div {
  min-width: 0;
}

.background-card-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.background-card-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.background-relation {
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
}

@media (max-width: 1280px) {
  .background-import-grid {
    grid-template-columns: 1fr;
  }
}

.app {
  margin-left: 72px;
  height: 100vh;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  flex: 0 0 44px;
  background: #f5f7fb;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 0;
  gap: 8px;
}

.topbar-title {
  display: none;
}

.topbar h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
}

.topbar p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex: 0 0 auto;
}

#openImportModalBtn,
#goSummaryBtn {
  display: none;
}

.open-tabs {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #f5f7fb;
  border-bottom: 0;
  padding: 6px 8px 0 10px;
  scrollbar-width: thin;
  scrollbar-color: #c8d3e1 transparent;
}

.workspace-tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  position: relative;
  height: 38px;
  min-width: 104px;
  max-width: 184px;
  border: 1px solid #d9e2ee;
  border-bottom-color: #cfd8e6;
  border-radius: 4px 4px 0 0;
  background: #eef3f8;
  color: #405063;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.workspace-tab:hover {
  background: #f9fbfe;
  border-color: #c3d5ea;
}

.workspace-tab.active {
  background: #fff;
  border-color: #b9d7ff;
  border-bottom-color: #fff;
  box-shadow: 0 -1px 0 rgba(22, 119, 255, 0.08);
}

.workspace-tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--blue);
  border-radius: 999px;
}

.workspace-tab-main {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 8px 0 12px;
  text-align: left;
  color: inherit;
  font-size: 13px;
  line-height: 36px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.workspace-tab.active .workspace-tab-main {
  color: var(--blue);
  font-weight: 700;
}

.workspace-tab-close {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin-right: 4px;
  border: 0;
  border-radius: var(--erp-radius);
  background: transparent;
  color: #8c9aae;
  padding: 0;
  font-size: 14px;
  line-height: 24px;
  cursor: pointer;
}

.workspace-tab-close:hover {
  background: #edf3fa;
  color: var(--red);
}

.workspace-tab-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  margin-left: auto;
  padding: 0 4px 0 10px;
  background: linear-gradient(90deg, rgba(245, 247, 251, 0), #f5f7fb 12px);
}

.workspace-tab-actions button {
  height: 28px;
  border: 1px solid #cfd8e6;
  border-radius: 3px;
  background: #fff;
  color: #526174;
  padding: 0 9px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.workspace-tab-actions button:hover:not(:disabled) {
  border-color: #91bdf4;
  color: var(--blue);
}

.workspace-tab-actions button:disabled {
  color: #a7b2c1;
  cursor: not-allowed;
}

.open-tabs::-webkit-scrollbar {
  height: 6px;
}

.open-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.open-tabs::-webkit-scrollbar-thumb {
  background: #c8d3e1;
  border-radius: 999px;
}

.import-log-table {
  min-width: 1420px;
}

.section-head.task-center-head { display: block; margin: 2px 0 8px; }
.task-center-actions { display: flex; align-items: center; gap: 10px; color: #738196; font-size: 12px; }
.task-runtime-grid { display: grid; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.task-runtime-section, .task-queue-summary { border: 1px solid #d7e0eb; background: #fff; }
.task-runtime-section + .task-runtime-section { border-left: 0; }
.task-runtime-title { display: flex; min-height: 34px; padding: 7px 10px; align-items: center; justify-content: space-between; border-bottom: 1px solid #e1e7ef; background: #f6f8fb; color: #768398; }
.task-runtime-title > div { display: flex; min-width: 0; align-items: baseline; gap: 9px; }
.task-runtime-title strong { color: #243750; font-size: 12px; }
.task-runtime-title span, .task-runtime-title small { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.task-service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.task-service-item { min-width: 0; padding: 9px 10px 10px; border-right: 1px solid #e2e8f0; }
.task-service-item:last-child { border-right: 0; }
.task-service-head, .task-service-head > span, .task-runtime-value, .task-host-item > div { display: flex; align-items: center; justify-content: space-between; }
.task-service-head > span { min-width: 0; justify-content: flex-start; gap: 6px; }
.task-service-head i { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #31a36f; box-shadow: 0 0 0 2px #e0f3ea; }
.task-service-head strong { color: #263a53; font-size: 12px; }
.task-service-head b { color: #4f8d70; font-size: 10px; font-weight: 600; }
.task-runtime-value { margin-top: 8px; gap: 8px; }
.task-runtime-value strong { max-width: 48%; overflow: hidden; color: #1f3148; font-size: 14px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.task-runtime-value span { min-width: 0; flex: 1; overflow: hidden; color: #8793a4; font-size: 10px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.task-runtime-track { height: 3px; margin-top: 7px; overflow: hidden; background: #e9edf3; }
.task-runtime-track i { display: block; height: 100%; background: #347fc4; transition: width .2s ease; }
.task-service-item.warning .task-service-head i { background: #d4972f; box-shadow: 0 0 0 2px #fbefd7; }
.task-service-item.warning .task-service-head b { color: #a36a12; }
.task-service-item.warning .task-runtime-track i, .task-host-item.warning .task-runtime-track i { background: #d4972f; }
.task-service-item.danger .task-service-head i { background: #cf5656; box-shadow: 0 0 0 2px #f8e1e1; }
.task-service-item.danger .task-service-head b { color: #b43d3d; }
.task-service-item.danger .task-runtime-track i, .task-host-item.danger .task-runtime-track i { background: #cf5656; }
.task-host-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.task-host-item { min-width: 0; padding: 9px 10px 10px; border-right: 1px solid #e2e8f0; }
.task-host-item:last-child { border-right: 0; }
.task-host-item span { color: #44566f; font-size: 11px; font-weight: 600; }
.task-host-item strong { color: #253951; font-size: 13px; font-variant-numeric: tabular-nums; }
.task-host-item small { display: block; margin-top: 6px; overflow: hidden; color: #7e8b9d; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.task-runtime-empty { grid-column: 1 / -1; min-height: 64px; padding: 22px 12px; color: #8491a3; font-size: 11px; text-align: center; }
.task-runtime-error { color: #b24a4a; background: #fff8f8; }
.task-center-tabs { display: flex; min-height: 42px; align-items: stretch; border: 1px solid #d8e0ea; background: #f7f9fc; }
.task-center-tabs .task-center-actions { margin-left: auto; padding: 0 8px; border-left: 1px solid #d8e0ea; }
.task-center-tabs button { display: flex; width: 270px; min-width: 270px; flex: 0 0 270px; min-height: 42px; padding: 8px 14px; align-items: center; gap: 6px; border: 0; border-right: 1px solid #d8e0ea; border-bottom: 2px solid transparent; background: transparent; color: #40516a; font-weight: 700; text-align: left; cursor: pointer; }
.task-center-tabs button span { margin-left: auto; color: #7d899a; font-size: 11px; font-weight: 500; white-space: nowrap; }
.task-title-help { position: relative; display: inline-flex; width: 15px; height: 15px; margin-left: 4px; align-items: center; justify-content: center; border: 1px solid #aebbd0; border-radius: 50%; color: #657890; font-size: 10px; font-style: normal; font-weight: 700; line-height: 1; vertical-align: 1px; cursor: help; }
.task-title-help::after { position: absolute; z-index: 40; top: calc(100% + 8px); left: -10px; width: 290px; padding: 8px 10px; border: 1px solid #cfd9e6; background: #fff; color: #43536a; box-shadow: 0 4px 12px rgba(30, 49, 72, .12); content: attr(data-tooltip); font-size: 11px; font-weight: 400; line-height: 1.6; opacity: 0; pointer-events: none; transform: translateY(-3px); transition: opacity .12s ease, transform .12s ease; white-space: normal; }
.task-title-help:hover::after, .task-title-help:focus::after { opacity: 1; transform: translateY(0); }
.task-title-help:focus { outline: 2px solid rgba(49, 128, 196, .25); outline-offset: 2px; }
.task-center-tabs button.active { border-bottom-color: var(--blue); background: #fff; color: var(--blue); }
.task-center-panel { display: none; min-height: 0; flex: 1; flex-direction: column; }
.task-center-panel.active { display: flex; }
.task-center-table-wrap { flex: 1; min-height: 280px; margin-top: 10px; overflow: auto; }
.task-center-table { table-layout: fixed; }
.task-center-table th, .task-center-table td { max-width: 260px; height: 48px; padding: 7px 9px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; }
.task-center-table thead th { position: sticky; top: 0; z-index: 2; }
.task-text-cell strong, .task-text-cell small, .task-stage-hint { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-text-cell small, .task-stage-hint { margin-top: 3px; color: #7a8798; font-size: 11px; font-weight: 400; }
.task-result-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-inline-progress { display: grid; grid-template-columns: minmax(70px, 1fr) 38px; gap: 7px; align-items: center; }
.task-inline-progress > div { height: 5px; overflow: hidden; background: #e7edf4; }
.task-inline-progress i { display: block; height: 100%; background: #2d83cf; }
.task-inline-progress strong { color: #2b5f91; font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.task-error-text { color: #b74343 !important; }
.task-id-cell { max-width: 160px !important; font-family: Consolas, monospace; font-size: 11px; }
.task-actions-cell { overflow: visible !important; }
.task-mini-btn { display: inline-flex; min-width: 0; height: 26px; padding: 0 8px; align-items: center; justify-content: center; font-size: 11px; text-decoration: none; }
.task-mini-btn.disabled, .task-mini-btn:disabled { border-color: #e0e5ec; color: #a1abba; cursor: not-allowed; pointer-events: none; }
.worker-task-table { min-width: 1260px; }
.worker-task-section-row td { height: 34px !important; padding: 7px 12px !important; background: #f5f8fc; color: #506b87; font-size: 12px; letter-spacing: .02em; }
.worker-task-section-row strong { color: #274f76; }
.worker-task-section-row span { margin-left: 8px; color: #8493a4; font-size: 11px; font-weight: 400; }
.worker-task-parent-row { background: #fffdf5; }
.worker-task-parent-row.worker-task-current { background: #f8fbff; }
.worker-task-parent-row.worker-task-failed { background: #fff8f7; }
.worker-task-parent-row td { border-top: 1px solid #dce7f1; }
.worker-task-child-row td { height: 42px !important; background: #fff; color: #526171; }
.worker-task-child-row .num { color: #94a5b7; }
.worker-task-source-cell { position: relative; padding-right: 38px !important; }
.worker-task-toggle { position: absolute; top: 50%; right: 10px; width: 22px; height: 22px; margin: 0; padding: 0; transform: translateY(-50%); border: 1px solid #cdd9e5; border-radius: 3px; background: #fff; color: #3574a8; font-size: 11px; line-height: 18px; cursor: pointer; }
.worker-task-toggle:hover { border-color: #77a9d0; background: #f2f8fd; }
.export-task-table { min-width: 1720px; }

@media (max-width: 1280px) {
  .task-center-tabs button { width: 230px; min-width: 230px; flex-basis: 230px; }
}

.view {
  display: none;
  padding: 14px 16px 24px;
  min-height: 0;
  min-width: 0;
  overflow: auto;
}

.view.active {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.notice {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border: 1px solid #b7d7ff;
  background: #eef6ff;
  color: #175c9d;
}

.notice.error {
  background: #fff1f1;
  border-color: #ffc9c9;
  color: #a33333;
}

.hidden {
  display: none !important;
}

.overview-view {
  gap: 8px;
  padding: 8px 12px;
}

.overview-metric-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(112px, 1fr));
  gap: 8px;
}

.overview-metric {
  min-height: 66px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px 12px;
}

.overview-metric span,
.overview-metric em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.overview-metric span {
  margin-bottom: 6px;
}

.overview-metric strong {
  display: block;
  color: #132235;
  font-size: 22px;
  line-height: 1.1;
}

.overview-metric em {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-line;
}

.overview-chart-panel,
.overview-panel {
  background: #fff;
  border: 1px solid var(--line);
}

.overview-chart-panel {
  min-height: 500px;
}

.overview-chart-panel + .overview-chart-panel {
  margin-top: 20px;
}

.overview-panel-head {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.overview-panel-head h2 {
  margin: 0;
  font-size: 15px;
}

.overview-panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.overview-chart-tools select {
  height: 28px;
  min-width: 138px;
  border: 1px solid #cfd7e3;
  background: #fff;
}

.overview-chart-tools {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.overview-range-tools {
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  min-height: 42px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.overview-daily-tools {
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 8px;
  border: 1px solid #d8e0eb;
  background: #f7f9fc;
}

.overview-daily-tools .overview-scope-filters {
  gap: 6px;
  padding: 0;
}

.overview-daily-tools .overview-scope-row {
  display: grid;
  gap: 2px;
}

.overview-daily-tools .overview-scope-row span {
  color: #748399;
  font-size: 10px;
  line-height: 1;
}

.overview-daily-tools .overview-scope-row select {
  width: 132px;
  height: 30px;
  padding: 0 28px 0 9px;
  border-color: #c8d3e1;
  color: #22334a;
  font-size: 12px;
}

.overview-daily-tools .overview-filter-field {
  display: grid;
  gap: 2px;
  margin: 0;
}

.overview-daily-tools #overviewTrendMode {
  width: 138px;
  min-width: 138px;
  height: 30px;
}

.overview-plan-order-tools {
  position: relative;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 8px;
  border: 1px solid #d8e0eb;
  background: #f7f9fc;
}

.overview-filter-caption {
  margin-right: 2px;
  color: #53657c;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.overview-plan-order-tools .overview-filter-field {
  display: grid;
  gap: 2px;
  margin: 0;
}

.overview-filter-label {
  color: #748399;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.overview-plan-order-tools select {
  width: 138px;
  min-width: 138px;
  height: 30px;
  padding: 0 28px 0 9px;
  border-color: #c8d3e1;
  color: #22334a;
  font-size: 12px;
}

.overview-multi-filter {
  position: relative;
}

.overview-multi-filter summary {
  box-sizing: border-box;
  display: flex;
  width: 158px;
  height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 0 10px;
  border: 1px solid #c8d3e1;
  background: #fff;
  color: #22334a;
  font-size: 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.overview-multi-filter summary::-webkit-details-marker {
  display: none;
}

.overview-multi-filter summary:hover,
.overview-multi-filter[open] summary {
  border-color: #5b9bea;
  box-shadow: 0 0 0 1px rgba(37, 115, 204, 0.08);
}

.overview-filter-chevron {
  color: #6f8198;
  font-size: 11px;
  transition: transform 120ms ease;
}

.overview-multi-filter[open] .overview-filter-chevron {
  transform: rotate(180deg);
}

.overview-filter-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  right: 0;
  width: 226px;
  padding: 8px;
  border: 1px solid #bcc9da;
  background: #fff;
  box-shadow: 0 8px 22px rgba(46, 67, 92, 0.16);
}

.overview-filter-popover-year {
  left: 0;
  right: auto;
  width: 248px;
}

.overview-filter-popover-month {
  width: 248px;
}

.overview-filter-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1px 2px 7px;
  border-bottom: 1px solid #e3e8f0;
}

.overview-filter-popover-head strong {
  color: #26384f;
  font-size: 12px;
}

.overview-filter-popover-head span {
  color: #8996a8;
  font-size: 10px;
}

.overview-filter-options {
  display: grid;
  gap: 2px;
  max-height: 210px;
  padding: 6px 0;
  overflow: auto;
}

.overview-month-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-height: none;
}

.overview-year-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: none;
}

.overview-chart-tools .overview-filter-option {
  display: flex;
  min-height: 27px;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  color: #34465d;
  font-size: 12px;
  cursor: pointer;
}

.overview-chart-tools .overview-filter-option:hover {
  background: #f0f5fb;
}

.overview-chart-tools .overview-filter-option input {
  width: 14px;
  min-width: 14px;
  height: 14px;
  margin: 0;
}

.overview-filter-empty {
  padding: 12px 4px;
  color: #8996a8;
  font-size: 12px;
  text-align: center;
}

.overview-filter-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  padding-top: 7px;
  border-top: 1px solid #e3e8f0;
}

.overview-filter-popover-actions button {
  height: 25px;
  padding: 0 9px;
  border: 1px solid #cbd6e3;
  background: #fff;
  color: #31577f;
  font-size: 11px;
  cursor: pointer;
}

.overview-filter-popover-actions button:hover {
  border-color: #74a8e6;
  background: #f0f6fd;
}

.overview-chart-tools label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
}

.overview-chart-tools select[multiple] {
  height: 64px;
  min-width: 112px;
}

.overview-trend-chart {
  position: relative;
  height: clamp(420px, 42vh, 560px);
  padding: 8px 10px 10px;
}

.overview-trend-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.overview-axis,
.overview-axis-right {
  stroke: #cfd7e3;
  stroke-width: 1;
}

.overview-axis-title,
.overview-axis-label,
.overview-legend,
.overview-rate-label {
  fill: #607086;
  font-size: 12px;
}

.overview-axis-title-right {
  text-anchor: end;
}

.overview-axis-label {
  text-anchor: middle;
}

.overview-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
}

.overview-line-sales {
  stroke: #1976d2;
}

.overview-line-shipment {
  stroke: #178b5b;
}

.overview-line-rate {
  stroke: #f59f00;
  stroke-dasharray: 4 3;
}

.overview-sales-forecast-tools {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 8px;
  border: 1px solid #d8e0eb;
  background: #f7f9fc;
  max-width: 100%;
  /*
   * Do not make this toolbar a horizontal scroll container. The year/month
   * selectors own absolutely positioned popovers and CSS turns overflow-y
   * into `auto` whenever overflow-x scrolls, which clips those menus.
   * The compact breakpoints below keep both filter groups on one row instead.
   */
  overflow: visible;
}

.overview-sales-forecast-head,
#overviewSalesForecastPanel {
  overflow: visible;
}

#overviewSalesForecastPanel {
  position: relative;
}

.overview-forecast-rule {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 9px;
  margin-top: 7px;
  color: #5f6f84;
  font-size: 12px;
}

.overview-forecast-rule span {
  padding: 2px 7px;
  border-radius: 999px;
  background: #e8f1ff;
  color: #2563a6;
  font-weight: 700;
}

.overview-forecast-rule strong {
  color: #22334a;
}

.overview-forecast-rule em {
  color: #708198;
  font-style: normal;
}

.overview-forecast-tool-group {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.overview-forecast-tool-divider {
  width: 1px;
  height: 24px;
  flex: 0 0 1px;
  margin: 0 2px;
  background: #ccd6e3;
}

.overview-sales-forecast-tools .overview-scope-row,
.overview-sales-forecast-tools .overview-filter-field {
  display: grid;
  gap: 2px;
  margin: 0;
}

.overview-sales-forecast-tools .overview-scope-row select,
.overview-sales-forecast-tools .overview-filter-field select {
  width: 118px;
  min-width: 118px;
  height: 30px;
  padding: 0 28px 0 9px;
  border-color: #c8d3e1;
  color: #22334a;
  font-size: 12px;
}

.overview-sales-forecast-tools .overview-scope-row select:disabled {
  cursor: not-allowed;
  border-color: #d9e1eb;
  background: #f1f4f8;
  color: #98a5b6;
}

.overview-sales-forecast-tools .overview-multi-filter summary {
  width: 126px;
}

.overview-sales-forecast-tools .overview-filter-popover {
  z-index: 60;
}

.overview-sales-forecast-tools .overview-filter-popover-year {
  left: 0;
  right: auto;
}

.overview-sales-forecast-tools .overview-filter-popover-month {
  left: auto;
  right: 0;
}

@media (max-width: 1580px) {
  .overview-sales-forecast-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .overview-sales-forecast-head > .overview-sales-forecast-tools {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 1180px) {
  .overview-sales-forecast-tools {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 4px;
    padding: 4px;
  }

  .overview-forecast-tool-divider {
    display: block;
  }

  .overview-forecast-tool-group {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .overview-forecast-compare-range {
    padding-top: 0;
    border-top: 0;
  }

  .overview-sales-forecast-tools .overview-scope-row select,
  .overview-sales-forecast-tools .overview-filter-field select {
    width: 96px;
    min-width: 96px;
    padding-left: 7px;
    padding-right: 22px;
  }

  .overview-sales-forecast-tools .overview-multi-filter summary {
    width: 104px;
  }

  .overview-sales-forecast-tools .overview-filter-caption {
    margin-right: 0;
    font-size: 11px;
    white-space: nowrap;
  }
}

@media (max-width: 980px) {
  .overview-sales-forecast-tools .overview-scope-row select,
  .overview-sales-forecast-tools .overview-filter-field select {
    width: 84px;
    min-width: 84px;
    font-size: 11px;
  }

  .overview-sales-forecast-tools .overview-multi-filter summary {
    width: 92px;
    font-size: 11px;
  }
}

.overview-line-forecast {
  stroke: #e67800;
  stroke-dasharray: 7 5;
}

.daily-sales-filter-grid {
  grid-template-columns: repeat(7, 150px);
}

.daily-sales-table-wrap {
  height: calc(100vh - 212px);
  max-height: calc(100vh - 212px);
}

.daily-sales-table th,
.daily-sales-table td {
  text-align: center;
}

.daily-sales-table {
  min-width: 1260px;
  table-layout: fixed;
}

.daily-sales-table th:nth-child(1) { width: 108px; }
.daily-sales-table th:nth-child(2) { width: 100px; }
.daily-sales-table th:nth-child(3) { width: 220px; }
.daily-sales-table th:nth-child(4) { width: 170px; }
.daily-sales-table th:nth-child(n+5) { width: 130px; }

.daily-sales-quick-row {
  border-top: 0;
  margin-top: 0;
}

.daily-sales-layer-tabs button span {
  margin-left: 3px;
  color: #6f8197;
  font-size: 11px;
  font-weight: 600;
}

.daily-sales-layer-tabs button.active span {
  color: inherit;
}

.overview-rate-average {
  stroke: #f59f00;
  stroke-width: 1.2;
  stroke-dasharray: 6 4;
  opacity: 0.7;
  pointer-events: none;
}

.overview-hit-zone {
  fill: transparent;
}

.overview-trend-range-zone {
  cursor: crosshair;
}

.overview-trend-range-zone:hover {
  fill: rgba(37, 99, 235, 0.055);
}

.overview-plan-point {
  fill: var(--series-color);
  stroke: #fff;
  stroke-width: 1.4;
  pointer-events: none;
}

.overview-plan-range-zone {
  fill: transparent;
  cursor: crosshair;
}

.overview-plan-range-zone:hover {
  fill: rgba(37, 99, 235, 0.055);
}

.overview-plan-point-reorder {
  fill: #fff;
  stroke: var(--series-color);
  stroke-width: 2;
}

.overview-plan-value {
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}

.overview-plan-series-line {
  pointer-events: none;
}

.overview-plan-forecast-line {
  fill: none;
  stroke: #d97706;
  stroke-width: 3;
  stroke-dasharray: 8 5;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
}

.overview-plan-forecast-point {
  fill: #fff7ed;
  stroke: #d97706;
  stroke-width: 2;
  pointer-events: none;
}

.overview-plan-forecast-value {
  fill: #b45309 !important;
}

.overview-plan-tooltip {
  position: absolute;
  z-index: 40;
  display: grid;
  min-width: 320px;
  max-width: 460px;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid #aebdce;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 6px 18px rgba(38, 55, 78, 0.18);
  color: #26384f;
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
}

.overview-plan-tooltip span:first-child {
  padding-bottom: 4px;
  border-bottom: 1px solid #e1e7ef;
  color: #102a46;
  font-size: 12px;
  font-weight: 700;
}

.overview-scope-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.overview-scope-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.overview-scope-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.overview-scope-row select {
  width: 180px;
  height: 28px;
  border: 1px solid #cfd7e3;
  background: #fff;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 8px;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.section-actions {
  display: flex;
  gap: 8px;
}

.section-head h2,
.empty h2 {
  margin: 0;
  font-size: 15px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: end;
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
  margin-bottom: 10px;
}

.toolbar.sticky {
  position: sticky;
  top: 0;
  z-index: 4;
}

label {
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

label.wide {
  min-width: 360px;
  flex: 1;
}

select,
input,
textarea {
  height: 30px;
  min-width: 160px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 8px;
}

textarea {
  min-height: 86px;
  resize: vertical;
  padding: 8px;
  line-height: 1.5;
}

.hint {
  padding: 10px 12px;
  border: 1px solid #f0d58c;
  background: #fff7df;
  color: #6d4b00;
  margin-bottom: 10px;
}

.small-text {
  font-size: 12px;
}

.compact-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.compact-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #56657a;
  font-size: 12px;
}

.compact-form input {
  height: 28px;
  border: 1px solid var(--line);
  padding: 0 8px;
  font-size: 13px;
}

.compact-table th,
.compact-table td {
  height: 28px;
  padding: 4px 8px;
}

.mapping-help {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.mapping-help > div {
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
  line-height: 1.7;
}

.condition-panel {
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 10px;
  padding: 10px;
}

.condition-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.condition-head h2 {
  font-size: 15px;
  margin: 0;
}

.condition-head span {
  color: var(--muted);
}

.condition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  align-items: end;
}

.condition-grid label {
  min-width: 0;
}

.condition-grid input {
  min-width: 0;
  width: 100%;
}

.checkline {
  height: 30px;
  flex-direction: row;
  align-items: center;
  color: var(--ink);
}

.checkline input {
  width: auto;
  height: auto;
  min-width: 0;
}

.condition-actions {
  display: flex;
  gap: 8px;
  min-width: 250px;
}

.wide-condition {
  grid-column: span 2;
}

.summary-view {
  padding-top: 0;
  padding-bottom: 10px;
  overflow: hidden;
}

.summary-erp-view {
  --summary-border: #d7e2ef;
  --summary-soft-border: #e5edf6;
  --summary-panel: #ffffff;
  --summary-head: #f3f7fc;
  --summary-row: #fffdf2;
  --summary-row-alt: #f4f9ff;
  --summary-row-hover: #e9f4ff;
  --summary-row-selected: #fff5d5;
  background: #f3f6fb;
}

.summary-erp-view:not(.active),
.summary-erp-view.hidden {
  display: none;
}

.summary-filter-panel {
  margin: 0 -16px 8px;
  border-top: 0;
  border-bottom-color: var(--summary-border);
  box-shadow: 0 1px 0 rgba(16, 35, 63, 0.04);
}

.jst-filter-panel {
  background: #fff;
  border-bottom: 1px solid var(--line);
  margin: -14px -16px 8px;
  padding: 8px 10px 10px;
  flex: 0 0 auto;
}

.summary-view .jst-filter-panel,
.production-view .jst-filter-panel {
  min-height: 78px;
  max-height: 78px;
  overflow: hidden;
}

.jst-filter-grid {
  display: grid;
  grid-template-columns: repeat(14, minmax(72px, 1fr));
  gap: 5px;
  align-items: center;
}

.jst-filter-grid input,
.jst-filter-grid select,
.jst-filter-grid button,
.filter-panel input,
.filter-panel select,
.filter-panel button {
  text-align: center;
  text-align-last: center;
}

.permission-view-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.permission-view-bar select {
  height: 28px;
  min-width: 116px;
  border-color: #cfd7e3;
}

.permission-view-bar .summary-data-meta {
  margin-left: 4px;
}

.jst-filter-grid input,
.jst-filter-grid select,
.jst-filter-grid button {
  width: 100%;
  min-width: 0;
  height: 28px;
}

.jst-filter-grid input,
.jst-filter-grid select {
  padding: 0 6px;
  border-color: #cfd7e3;
  background: #fbfdff;
  color: #223047;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.jst-filter-grid input:focus,
.jst-filter-grid select:focus {
  border-color: #1677d2;
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(24, 119, 210, 0.12);
}

#summaryStyleCodeFilter:focus {
  border-color: #111827;
  outline: 1px solid #111827;
}

.filter-action-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  min-width: 0;
}

.jst-filter-grid .filter-action-pair button {
  min-width: 0;
  padding: 0 8px;
}

.jst-filter-grid .filter-action-plan:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.filter-action-strip {
  grid-column: span 4;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  height: 28px;
  overflow: hidden;
}

.summary-action-strip {
  justify-content: flex-end;
  padding-left: 4px;
  border-left: 1px solid #e1e8f2;
}

.filter-action-strip button,
.filter-action-strip .quick-filter-chip {
  width: auto;
  min-width: 42px;
  height: 20px;
  padding: 0 7px;
  font-size: 12px;
  line-height: 18px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.filter-action-strip .quick-filter-save {
  min-width: 96px;
}

.filter-action-strip .filter-action-plan {
  min-width: 64px;
}

.summary-action-strip .filter-action-plan {
  border-color: #9fc7f4;
  color: #0b63ce;
  background: #f0f7ff;
  font-weight: 700;
}

.summary-action-strip .filter-action-plan:not(:disabled) {
  color: #fff;
  border-color: #0b73d9;
  background: #147bd1;
  box-shadow: 0 1px 4px rgba(20, 123, 209, 0.18);
}

.filter-action-strip .filter-action-export {
  min-width: 42px;
}

.jst-filter-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  flex-wrap: wrap;
  overflow: hidden;
}

.jst-filter-actions button,
.jst-filter-actions select {
  height: 28px;
}

.jst-filter-actions select {
  min-width: 78px;
}

.quick-filter-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  overflow-x: auto;
  flex: 1 1 auto;
  height: 24px;
}

.quick-filter-chip {
  border-color: #c9d7e8;
  background: #fff;
  color: #1f2329;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.quick-filter-chip em {
  font-style: normal;
  color: #8794a8;
  padding-left: 2px;
}

.quick-filter-chip.active,
.quick-filter-chip[aria-pressed="true"] {
  border-color: #1677ff;
  background: #91caff;
  color: #1f2329;
  box-shadow: inset 0 -2px 0 #1677ff;
}

.quick-filter-chip.active em,
.quick-filter-chip[aria-pressed="true"] em {
  color: #66758a;
}

.quick-filter-empty {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  line-height: 20px;
}

.quick-filter-save {
  flex: 0 0 auto;
}

.mini-label {
  color: var(--muted);
}

.jst-check {
  height: 28px;
  flex-direction: row;
  align-items: center;
  color: var(--muted);
  gap: 4px;
}

.jst-check input {
  width: 14px;
  min-width: 0;
  height: 14px;
}

.link-action {
  border-color: transparent;
  color: var(--blue);
  background: transparent;
}

.summary-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 36px;
  height: 36px;
  min-height: 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 0;
  padding: 0 8px;
  overflow: hidden;
}

.summary-erp-toolbar {
  border-color: var(--summary-border);
  display: flex;
  gap: 0 !important;
  width: 100%;
  padding: 0;
  justify-content: flex-start !important;
  column-gap: 0 !important;
  flex: 0 0 38px;
  height: 38px;
  min-height: 38px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 35, 63, 0.04);
}

.column-order-open {
  margin-left: auto;
  flex: 0 0 auto;
}

.column-order-panel {
  width: min(440px, calc(100vw - 32px));
}

.column-order-legend {
  display: flex;
  justify-content: space-between;
  padding: 0 10px 8px;
  color: #768399;
  font-size: 12px;
}

.column-order-list {
  max-height: min(620px, calc(100vh - 240px));
  overflow: auto;
  border: 1px solid #dfe6ef;
  border-radius: 4px;
  background: #fff;
}

.column-order-item {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) 30px;
  align-items: center;
  column-gap: 7px;
  min-height: 32px;
  padding: 0 8px;
  border-bottom: 1px solid #edf1f6;
  cursor: grab;
  user-select: none;
}

.column-order-item:last-child {
  border-bottom: 0;
}

.column-order-item.dragging {
  opacity: .45;
}

.column-order-item.drag-over {
  box-shadow: inset 0 2px #1677ff;
}

.column-order-item.locked {
  cursor: default;
  background: #f1f3f6;
  color: #8b95a4;
}

.column-order-item.locked .column-order-pin {
  opacity: 1;
  cursor: default;
  color: #aab2bf;
  background: #e7eaf0;
}

#columnOrderModal input.column-order-check {
  width: 13px !important;
  min-width: 13px !important;
  height: 13px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0;
  accent-color: #1677ff;
  cursor: pointer;
}

.column-order-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-order-item.locked .column-order-check {
  cursor: default;
}

.column-order-pin {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #77859a;
  opacity: 0;
  cursor: pointer;
}

.column-order-item:hover .column-order-pin,
.column-order-pin.active,
.column-order-pin:focus-visible {
  opacity: 1;
}

.column-order-pin:hover,
.column-order-pin.active {
  color: #1677ff;
  background: #edf5ff;
}

.data-table .user-pinned-col {
  position: sticky;
  z-index: 3;
  background: inherit;
}

.data-table thead .user-pinned-col {
  z-index: 8;
  background: #eef4fb;
}

.data-table tfoot .user-pinned-col {
  z-index: 6;
  background: #f5f8fc;
}

#columnOrderModal {
  align-items: stretch;
  justify-content: flex-end;
  padding: 8px 0 8px 8px;
}

#columnOrderModal .column-order-panel {
  width: min(360px, calc(100vw - 24px));
  max-height: none;
  height: 100%;
  margin: 0;
  border-right: 0;
  border-radius: 6px 0 0 6px;
  animation: column-order-slide-in 180ms ease-out;
}

#columnOrderModal .modal-head {
  min-height: 58px;
  padding: 10px 12px;
}

#columnOrderModal .modal-head p {
  margin-top: 3px;
  font-size: 11px;
}

#columnOrderModal .modal-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 10px 12px;
}

#columnOrderModal .column-order-list {
  min-height: 0;
  max-height: none;
  flex: 1;
}

#columnOrderModal .column-order-item {
  min-height: 34px;
}

@keyframes column-order-slide-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #columnOrderModal .column-order-panel {
    animation: none;
  }
}

.summary-bottom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 34px;
  min-height: 34px;
  margin-top: 0;
  padding: 3px 8px;
  border: 1px solid var(--summary-border);
  border-top: 0;
  border-radius: 0 0 var(--erp-radius) var(--erp-radius);
  background: #fbfdff;
}

.summary-bottom-toolbar .summary-data-meta {
  flex: 1 1 auto;
  min-width: 0;
  color: #9aa7b8;
  font-size: clamp(9px, 0.58vw, 11px);
  line-height: 1.25;
  white-space: nowrap;
  overflow-x: hidden;
  overflow-y: hidden;
  text-overflow: ellipsis;
}

.summary-bottom-toolbar .summary-data-meta strong {
  color: #748398;
  font-weight: 600;
}

.summary-bottom-toolbar .summary-data-meta span {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: inherit;
}

.summary-bottom-toolbar .summary-data-meta .meta-warn {
  border: 1px solid #f3c56b;
  background: #fff7e6;
  color: #a35d00;
  padding: 2px 5px;
}

.summary-bottom-toolbar .summary-table-tools {
  flex: 0 0 auto;
  width: auto;
  min-width: 360px;
  height: 28px;
  padding: 0;
  border-left: 0;
  justify-content: flex-end;
  gap: 6px;
  font-size: 12px;
}

.summary-erp-toolbar .table-tabs {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  padding-left: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  border-right: 1px solid var(--summary-border);
  scrollbar-width: thin;
}

.summary-erp-toolbar .table-tabs button {
  flex: 0 0 auto;
  height: 38px;
  border-color: transparent;
  background: transparent;
}

.summary-erp-toolbar .table-tabs button.active {
  border-color: #d7e0eb;
  background: #fff;
  color: #23364d;
  font-weight: 700;
}

.summary-erp-toolbar .quick-filter-bar {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  padding-right: 8px;
  overflow-x: hidden;
  overflow-y: hidden;
}

.summary-erp-toolbar .quick-filter-chip,
.summary-erp-toolbar .quick-filter-empty {
  height: 22px;
  line-height: 20px;
}

#grainControl > button[data-grain],
#grainControl .quick-filter-chip {
  position: relative;
  box-sizing: border-box;
  height: 22px !important;
  min-height: 22px;
  max-height: 22px;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  outline: none;
}

#grainControl .quick-filter-chip {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 180px;
  padding-right: 20px;
  overflow: hidden;
}

#grainControl .quick-filter-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#grainControl .quick-filter-chip > em {
  position: absolute;
  top: 2px;
  right: 3px;
  display: inline-flex;
  width: 16px;
  height: 16px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  color: #6f8195;
  font-size: 12px;
  line-height: 16px;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}

#grainControl .quick-filter-chip:hover > em,
#grainControl .quick-filter-chip:focus-visible > em {
  opacity: 0.72;
}

#grainControl .quick-filter-chip > em:hover {
  background: #dbe6f1;
  color: #294f78;
  opacity: 1;
}

#grainControl > button.active {
  position: relative;
  height: 22px;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  border-color: transparent #d5deea !important;
  background: #d8e8f8 !important;
  color: #153b66 !important;
  box-shadow: none;
}

#grainControl > button:not(.active) {
  position: relative;
  height: 22px;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  border-color: transparent #d5deea !important;
  background: #f8fafc !important;
  color: #41546b !important;
}

#grainControl .quick-filter-chip.active,
#grainControl .quick-filter-chip[aria-pressed="true"] {
  font-weight: 500;
  border-color: transparent #d5deea !important;
  background: #d8e8f8 !important;
  color: #153b66 !important;
  box-shadow: none !important;
}

#grainControl .quick-filter-chip:not(.active):not([aria-pressed="true"]) {
  font-weight: 500;
  border-color: transparent #d5deea !important;
  background: #f8fafc !important;
  color: #41546b !important;
  box-shadow: none !important;
}

.summary-erp-toolbar .summary-data-meta {
  box-sizing: border-box;
  margin: 0;
  height: 38px;
  padding: 2px 8px;
  border-left: 0;
  border-right: 0;
  flex-wrap: nowrap;
  overflow: hidden;
  font-size: clamp(10px, 0.62vw, 12px);
  line-height: 1.32;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.summary-erp-toolbar .summary-data-meta::before,
.summary-erp-toolbar .summary-data-meta::after {
  content: "";
  align-self: stretch;
  width: 1px;
  background: transparent;
}

.summary-erp-toolbar .summary-data-meta span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-erp-toolbar .meta-flow-text,
.production-erp-toolbar .meta-flow-text {
  display: -webkit-box;
  max-width: 100%;
  max-height: calc(2em * 1.32);
  overflow: hidden;
  border: 0;
  background: transparent;
  padding: 0;
  color: #526174;
  white-space: normal;
  word-break: keep-all;
  line-height: 1.32;
  text-align: center;
  text-overflow: clip;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.summary-erp-toolbar .summary-table-tools {
  box-sizing: border-box;
  width: 360px;
  min-width: 0;
  height: 38px;
  padding: 3px 6px;
  border-left: 1px solid var(--summary-border);
  justify-content: flex-end;
  overflow: hidden;
  gap: 6px;
  font-size: 12px;
  margin-left: 0 !important;
}

.summary-erp-toolbar .summary-page-size,
.production-erp-toolbar .production-page-size {
  flex: 0 0 58px;
  min-width: 58px;
}

.summary-erp-toolbar .summary-page-size select,
.production-erp-toolbar .production-page-size select {
  width: 58px;
}

.summary-erp-toolbar .summary-counter,
.production-erp-toolbar .production-counter {
  flex: 0 0 128px;
  min-width: 128px;
  text-align: right;
}

.summary-data-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  color: #526174;
  font-size: 12px;
}

.summary-data-meta strong {
  color: #24364b;
  margin-right: 2px;
}

.summary-data-meta span {
  border: 1px solid #dbe7f4;
  background: #f7fbff;
  padding: 3px 7px;
  white-space: nowrap;
}

.summary-data-meta .meta-warn {
  border-color: #f3c56b;
  background: #fff7e6;
  color: #a35d00;
}

.summary-data-meta .meta-danger {
  border-color: #f0a8a8;
  background: #fff1f1;
  color: #b42318;
}

.production-data-meta {
  gap: 3px;
  align-content: flex-start;
  font-size: 11px;
  line-height: 14px;
  max-height: 34px;
  overflow: hidden;
}

.production-data-meta strong {
  line-height: 14px;
}

.production-data-meta span {
  padding: 1px 5px;
  line-height: 14px;
}

.factory-production-filter {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  align-items: center;
}

.factory-production-filter input,
.factory-production-filter select {
  width: 100%;
  min-width: 0;
}

.filter-note {
  border: 1px solid #f2d58f;
  background: #fff8df;
  color: #6f4b00;
  padding: 6px 10px;
  margin: 4px 0 8px;
  min-height: 30px;
  display: flex;
  align-items: center;
  line-height: 1.35;
}

.factory-production-summary {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 10px 0;
  max-height: 310px;
  overflow: auto;
  padding-right: 4px;
}

.factory-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 3px;
  padding: 8px;
}

.factory-card-head,
.factory-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.factory-card-head strong {
  color: #15243a;
}

.factory-card-head span,
.factory-card-foot {
  color: var(--muted);
  font-size: 12px;
}

.factory-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 7px 0;
}

.factory-metric {
  border: 1px solid #dfe7f1;
  background: #f8fbff;
  padding: 5px;
  min-width: 0;
}

.factory-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.factory-metric strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: #12233a;
}

.factory-production-wrap {
  flex: 1 1 auto;
  height: auto;
  max-height: none;
  min-height: 0;
}

.factory-production-table {
  min-width: 1680px;
}

.table-tabs button {
  height: 34px;
  min-width: 100px;
  border-bottom: 0;
}

.table-tabs button.active {
  background: #eef6ff;
  color: var(--blue);
  border-color: #91c5ff;
}

.table-tab-divider {
  width: 1px;
  height: 20px;
  margin: 0 6px;
  background: #d9e4f2;
  flex: 0 0 auto;
}

.summary-table-wrap {
  flex: 1 1 auto;
  height: calc(100vh - 180px);
  max-height: none;
  border-color: var(--summary-border);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(16, 35, 63, 0.03);
  scrollbar-color: #aab8c9 #eef3f8;
  scrollbar-width: thin;
}

.summary-table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.summary-table-wrap::-webkit-scrollbar-track {
  background: #eef3f8;
}

.summary-table-wrap::-webkit-scrollbar-thumb {
  background: #aab8c9;
  border: 3px solid #eef3f8;
  border-radius: 999px;
}

.summary-grid-table {
  width: max-content;
  min-width: 1880px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.summary-grid-table th,
.summary-grid-table td {
  box-sizing: border-box;
  padding: 7px 8px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  background: inherit;
}

.summary-grid-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 34px;
  background: var(--summary-head);
  color: #263a55;
  font-weight: 700;
  border-bottom-color: #cfdae8;
}

th[data-table-col] {
  position: relative;
  user-select: none;
}

.summary-grid-table thead th[data-table-col] {
  position: sticky;
}

th[data-table-col] .th-label {
  display: inline-block;
  max-width: calc(100% - 2px);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.summary-sales-sort-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  user-select: none;
}

.summary-sales-sort-trigger .summary-sales-sort-direction {
  color: #0969c3;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.summary-sales-sort-trigger:hover,
.summary-sales-sort-trigger.is-active {
  color: #0969c3;
}

.expected-rate-header-label {
  display: grid;
  gap: 1px;
  line-height: 1.05;
}

.expected-rate-header-label small {
  color: #708197;
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}

.summary-grid-table thead th.summary-expected-rate-col {
  height: 42px;
}

.col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
}

.col-resizer:hover {
  background: rgba(24, 144, 255, 0.18);
}

.stock-audit-cell {
  position: relative;
}

.pending-audit-badge {
  position: absolute;
  top: 3px;
  right: 4px;
  border: 1px solid #f2c96d;
  background: #fff8df;
  color: #8a5a00;
  font-size: 11px;
  line-height: 16px;
  padding: 0 4px;
  font-weight: 600;
}

.summary-grid-table tbody td {
  height: auto;
  min-height: 92px;
}

.summary-grid-table tbody tr {
  background: var(--summary-row);
}

.summary-grid-table tbody tr:nth-child(even) {
  background: var(--summary-row-alt);
}

.summary-grid-table tbody tr.selected {
  background: var(--summary-row-selected);
}

.summary-grid-table tbody tr:hover {
  background: var(--summary-row-hover);
}

.summary-grid-table td.danger-text {
  color: var(--red);
  font-weight: 700;
}

.row-no-col {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  color: #617089;
  text-align: center;
  font-style: italic;
}

.expand-col {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  text-align: center;
  padding-left: 4px !important;
  padding-right: 4px !important;
}

.summary-select-box {
  appearance: none;
  -webkit-appearance: none;
  width: 14px !important;
  min-width: 14px !important;
  max-width: 14px !important;
  height: 14px !important;
  margin: 0;
  padding: 0 !important;
  vertical-align: middle;
  background: #fff;
  border: 1px solid #7aa7d9;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px #fff;
  cursor: pointer;
  position: relative;
}

.summary-select-box:checked {
  background: var(--blue);
  border-color: var(--blue);
}

.summary-select-box:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.image-col {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
  text-align: center;
}

.summary-grid-table .image-col {
  width: 76px;
  min-width: 76px;
  max-width: 76px;
}

.summary-style-col {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}

.summary-color-col {
  width: 112px;
  min-width: 112px;
  max-width: 112px;
  white-space: normal !important;
  line-height: 1.28;
}

th.row-no-col,
th.expand-col,
th.image-col,
th.summary-style-col,
th.summary-color-col {
  z-index: 8;
}

.summary-grid-table .sticky-left {
  background: inherit;
  box-shadow: 1px 0 0 var(--summary-soft-border);
}

.summary-grid-table thead .sticky-left {
  background: var(--summary-head);
  z-index: 9;
}

.summary-grid-table tbody tr .sticky-left {
  background: inherit;
}

.summary-grid-table tfoot .sticky-left {
  background: #fff;
}

.summary-grid-table .sticky-right {
  position: sticky;
  z-index: 4;
  background: inherit;
  box-shadow: -1px 0 0 #d8e1ee;
}

.summary-grid-table thead .sticky-right {
  z-index: 10;
  background: var(--summary-head, #f3f6fb);
}

.summary-grid-table tfoot .sticky-right {
  z-index: 6;
  background: #fff;
}

.summary-log-col {
  width: 86px;
  min-width: 86px;
  max-width: 86px;
  text-align: center;
}

.summary-follow-col {
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  text-align: center;
}

.summary-grid-table .summary-follow-col {
  right: 0;
}

.summary-grid-table .summary-log-col {
  right: 58px;
}

.summary-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid #d8e0eb;
  background: #f3f6fa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7b8798;
  font-size: 12px;
}

.summary-image-btn {
  width: 84px;
  height: 84px;
  padding: 1px;
  border: 0;
  background: transparent;
}

.summary-grid-table .summary-thumb {
  width: 58px;
  height: 72px;
}

.summary-grid-table .summary-image-btn {
  width: 62px;
  height: 76px;
}

.summary-image-btn:hover .summary-thumb {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px #d7ebff;
}

.row-expand-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: #5e718c;
}

.row-expand-btn:hover {
  background: #eef6ff;
  border-color: #91c5ff;
}

.hidden-check {
  display: none;
}

.help-mark {
  color: #ff4d4f;
  font-weight: 700;
  margin-right: 3px;
}

.code-cell {
  min-width: 140px;
}

.tag-cell {
  white-space: normal;
  width: 130px;
  min-width: 130px;
  max-width: 130px;
  line-height: 1.35;
}

.follow-cell {
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  text-align: center;
}

.follow-heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid #d8e2ef;
  background: #fff;
  color: #8a98aa;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.follow-heart:hover {
  border-color: #ff9cb2;
  background: #fff6f8;
  color: #ff5f7c;
}

.follow-heart.active {
  border-color: #ffc4d0;
  background: #fff1f5;
  color: #ff4f73;
}

.summary-grid-table .scoped-metric-cell,
.summary-grid-table .tag-cell,
.summary-grid-table .stock-audit-cell {
  white-space: normal;
}

.summary-grid-table .share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 18px;
  line-height: 1.25;
  text-align: center;
  vertical-align: middle;
}

.summary-grid-table .scoped-metric-cell {
  line-height: 1.25;
}

.summary-grid-table .scoped-main,
.summary-grid-table .scoped-sub {
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-grid-table .return-rate-stack,
.summary-grid-table .plan-share-stack,
.summary-grid-table .plan-return-rate-stack {
  display: inline-grid;
  justify-items: center;
  align-items: center;
  vertical-align: middle;
  white-space: normal;
}

.summary-grid-table .return-rate-line,
.summary-grid-table .plan-share-stack span,
.summary-grid-table .plan-return-rate-stack span {
  justify-content: center;
}

.summary-grid-table .scoped-sub {
  white-space: nowrap;
  margin-top: 2px;
  color: #7a8798;
  font-size: 12px;
}

.summary-grid-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #fff;
  border-top: 1px solid #cfd7e3;
  font-weight: 700;
}

.summary-grid-table tfoot .sticky-left {
  z-index: 4;
}

.plan-size-ratio-link {
  max-width: 100%;
  padding: 0;
  color: #1677ff;
  font-weight: 600;
  white-space: normal;
  word-break: break-word;
  text-align: center;
}

.production-duration-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.production-duration-table {
  min-width: 1320px;
  font-size: 12px;
}

.production-view {
  padding-top: 0;
  padding-bottom: 10px;
  overflow: hidden;
}

.production-filter-panel {
  margin: 0 -16px 8px;
  border-top: 0;
}

.production-filter-grid {
  grid-template-columns: repeat(14, minmax(72px, 1fr));
}

.production-view .production-erp-filter-panel {
  min-height: 74px;
  max-height: 74px;
  margin: 0 -16px 8px;
  padding: 9px 10px 8px;
  background: #fbfdff;
  border-bottom: 1px solid #d8e2ee;
  box-shadow: inset 0 -1px 0 #edf2f7;
}

.production-erp-filter-grid {
  grid-template-columns:
    150px
    132px
    132px
    132px
    132px
    132px
    132px
    132px
    132px
    132px
    108px
    108px
    180px;
  grid-auto-rows: 30px;
  gap: 6px;
  align-items: center;
  justify-content: start;
  overflow: hidden;
}

.production-erp-filter-grid input,
.production-erp-filter-grid select {
  height: 30px;
  border: 1px solid #cdd8e6;
  background: #fff;
  color: #24354c;
  font-size: 12px;
  text-align: center;
  text-align-last: center;
}

.production-erp-filter-grid input::placeholder {
  color: #8794a6;
}

.production-erp-filter-grid input:hover,
.production-erp-filter-grid select:hover {
  border-color: #aebed0;
}

.production-erp-filter-grid input:focus,
.production-erp-filter-grid select:focus {
  border-color: #1677ff;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.12);
}

.production-erp-filter-grid .jst-check {
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #cfd9e6;
  border-radius: 2px;
  background: #fff;
  color: #24354c;
  font-size: 12px;
  font-weight: 600;
}

.production-action-strip .production-action-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 82px;
  height: 30px;
  margin-left: -1px;
  padding: 0 12px;
  border: 1px solid #cfd9e6;
  border-radius: 0;
  background: #fff;
  color: #24354c;
  font-size: 12px;
  font-weight: 600;
  line-height: 28px;
  cursor: pointer;
  user-select: none;
}

.production-action-strip .production-action-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.production-action-strip .production-action-toggle:hover {
  position: relative;
  z-index: 1;
  border-color: #91caff;
  color: #0958d9;
  background: #f0f7ff;
}

.production-action-strip .production-action-toggle:has(input:checked) {
  position: relative;
  z-index: 1;
  border-color: #1677ff;
  color: #0958d9;
  background: #e6f4ff;
}

.production-action-strip {
  grid-column: 1 / -1;
  justify-content: flex-start;
  gap: 0;
  height: 30px;
  padding: 0;
  border-left: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.production-action-strip button {
  flex: 0 0 auto;
  min-width: 56px;
  height: 30px;
  margin-left: -1px;
  padding: 0 12px;
  border: 1px solid #cfd9e6;
  border-radius: 0;
  background: #fff;
  color: #24354c;
  font-size: 12px;
  font-weight: 600;
  line-height: 28px;
  box-shadow: none;
}

.production-action-strip button:first-child {
  margin-left: 0;
  border-radius: 2px 0 0 2px;
}

.production-action-strip .primary {
  min-width: 72px;
  border-color: #1677ff;
  background: #1677ff;
  color: #fff;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.production-action-strip .quick-filter-save {
  min-width: 118px;
}

.production-action-strip .filter-action-export {
  min-width: 56px;
}

.production-toolbar-quick-filter {
  grid-column: 2;
  align-self: stretch;
  justify-self: start;
  flex: 0 0 auto;
  min-width: 0;
  width: fit-content;
  max-width: 360px;
  height: 38px;
  margin-left: 0;
  padding: 0 6px;
  border-left: 0;
  border-right: 0;
  background: #fff;
  align-items: center;
}

.production-toolbar-quick-filter:has(.quick-filter-empty) {
  display: none;
}

.production-toolbar-quick-filter .quick-filter-chip,
.production-toolbar-quick-filter .quick-filter-empty {
  height: 38px;
  line-height: 38px;
}

.production-toolbar-quick-filter .quick-filter-chip {
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #29405f;
  font-size: 13px;
  font-weight: 400;
  box-shadow: none;
}

.production-toolbar-quick-filter .quick-filter-chip em {
  margin-left: 4px;
  color: #8c8c8c;
  font-size: 12px;
  font-weight: 400;
}

.production-toolbar-quick-filter .quick-filter-chip:hover {
  background: #f6fbff;
  color: #0b70d1;
}

.production-tabs {
  justify-content: flex-start;
  align-items: center;
}

.production-consult-view .summary-tabs {
  align-items: center;
  gap: 10px;
}

.production-consult-view .table-tabs,
.production-consult-view .table-page-tools,
.production-consult-view .table-page-pager,
.production-consult-view .table-page-size {
  align-items: center;
  height: 100%;
}

.production-consult-view .production-counter,
.production-consult-view .table-page-counter {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  line-height: 28px;
}

.production-consult-view #consultTaskCounter:empty {
  display: none;
}

.production-consult-view .table-page-size select,
.production-consult-view .table-page-pager button {
  height: 28px;
  line-height: 28px;
}

.production-consult-view .table-page-size {
  line-height: 28px;
}

.production-data-meta {
  flex: 1 1 auto;
  min-width: 280px;
  margin-left: 8px;
}

.factory-production-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.factory-production-slicer-panel {
  border-right: 1px solid #d5deea;
  background: #f7f9fc;
  padding: 8px;
  overflow: auto;
  min-height: 0;
  height: 100%;
}

.factory-production-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.side-slicer-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.side-slicer-controls label {
  display: grid;
  gap: 4px;
  color: #526174;
  font-size: 12px;
}

.side-slicer-controls select {
  height: 30px;
  border: 1px solid #c8d4e1;
  background: #fff;
  color: #1f334a;
  padding: 0 8px;
}

.side-slicer-list {
  border: 1px solid #9cc7f0;
  background: #fff;
  padding: 6px;
  margin-bottom: 8px;
}

.side-slicer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  color: #1f334a;
}

.side-slicer-head strong {
  font-size: 12px;
}

.slicer-clear {
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: #8b98a8;
  cursor: pointer;
}

.side-slicer-options {
  display: grid;
  gap: 4px;
  max-height: 190px;
  overflow: auto;
}

[data-factory-slicer-group="factory"] .side-slicer-options {
  max-height: 310px;
}

.side-slicer-options button {
  width: 100%;
  border: 1px solid #cfd9e6;
  background: #fff;
  color: #1d2f45;
  text-align: left;
  padding: 4px 6px;
  min-height: 24px;
  cursor: pointer;
}

.side-slicer-options button.active {
  background: #b8d8f1;
  border-color: #6aa8da;
  font-weight: 600;
}

.table-page-counter,
.production-counter,
.summary-counter {
  color: var(--muted);
  padding: 0;
  white-space: nowrap;
}

.table-page-tools,
.production-table-tools,
.summary-table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

.table-page-size,
.production-page-size,
.summary-page-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.table-page-size select,
.production-page-size select,
.summary-page-size select {
  height: 28px;
  min-width: 64px;
  padding: 0 8px;
}

.table-page-pager,
.production-pager,
.summary-pager {
  display: flex;
  gap: 6px;
}

.table-page-pager button,
.production-pager button,
.summary-pager button {
  height: 28px;
  padding: 0 10px;
}

.icon-button,
.table-refresh-button {
  width: 28px;
  min-width: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.table-refresh-button {
  color: #24a35a;
}

.table-refresh-button:hover {
  color: #168246;
  border-color: #84d1a4;
  background: #f3fbf6;
}

.production-table-wrap {
  flex: 1 1 auto;
  max-height: none;
  min-width: 0;
}

.production-grid-table {
  min-width: 2400px;
}

.production-grid-table th,
.production-grid-table td {
  padding: 7px 8px;
}

.production-grid-table tbody td {
  height: 66px;
}

.production-grid-table tbody tr {
  background: #fff;
}

.production-grid-table tbody tr:nth-child(even) {
  background: #fcfdff;
}

.plan-table {
  width: 100%;
  min-width: 1880px;
  table-layout: fixed;
}

.plan-table th,
.plan-table td {
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.plan-table th:nth-child(1),
.plan-table td:nth-child(1) {
  width: 78px;
  min-width: 78px;
}

.plan-table th:nth-child(2),
.plan-table td:nth-child(2) {
  width: 64px;
}

.plan-table th:nth-child(3),
.plan-table td:nth-child(3) {
  width: 92px;
}

.plan-table th:nth-child(4),
.plan-table td:nth-child(4) {
  width: 108px;
}

.plan-table th:nth-child(5),
.plan-table td:nth-child(5) {
  width: 84px;
}

.plan-table th:nth-child(6),
.plan-table td:nth-child(6),
.plan-table th:nth-child(7),
.plan-table td:nth-child(7),
.plan-table th:nth-child(8),
.plan-table td:nth-child(8),
.plan-table th:nth-child(9),
.plan-table td:nth-child(9) {
  width: 70px;
}

.plan-table th:nth-child(10),
.plan-table td:nth-child(10) {
  width: 58px;
}

.plan-table th:nth-child(11),
.plan-table td:nth-child(11) {
  width: 96px;
}

.plan-table th:nth-child(12),
.plan-table td:nth-child(12),
.plan-table th:nth-child(13),
.plan-table td:nth-child(13),
.plan-table th:nth-child(15),
.plan-table td:nth-child(15),
.plan-table th:nth-child(16),
.plan-table td:nth-child(16),
.plan-table th:nth-child(17),
.plan-table td:nth-child(17) {
  width: 86px;
}

.plan-table th:nth-child(14),
.plan-table td:nth-child(14) {
  width: 104px;
}

.plan-table th:nth-child(18),
.plan-table td:nth-child(18) {
  text-align: center;
  white-space: normal;
  word-break: break-word;
}

.plan-table th:nth-child(19),
.plan-table td:nth-child(19) {
  width: 116px;
  white-space: normal;
  word-break: break-word;
}

.plan-table th:nth-child(20),
.plan-table td:nth-child(20) {
  width: 82px;
}

.plan-table th:nth-child(21),
.plan-table td:nth-child(21) {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 174px;
  background: #fff;
  box-shadow: -1px 0 0 #dfe6f0;
}

.plan-table th:nth-child(21) {
  z-index: 3;
  background: #eef3fa;
}

.plan-table th:nth-child(4),
.plan-table td:nth-child(4) {
  width: 70px;
}

.plan-table th:nth-child(21),
.plan-table td:nth-child(21) {
  position: static;
  right: auto;
  z-index: auto;
  width: 82px;
  box-shadow: none;
}

.plan-table th:nth-child(22),
.plan-table td:nth-child(22) {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 174px;
  background: #fff;
  box-shadow: -1px 0 0 #dfe6f0;
}

.plan-table th:nth-child(22) {
  z-index: 3;
  background: #eef3fa;
}

.plan-table {
  min-width: 1980px;
}

.plan-table th:nth-child(22),
.plan-table td:nth-child(22) {
  position: static;
  right: auto;
  z-index: auto;
  width: 82px;
  box-shadow: none;
}

.plan-table th:nth-child(23),
.plan-table td:nth-child(23) {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 174px;
  background: #fff;
  box-shadow: -1px 0 0 #dfe6f0;
}

.plan-table th:nth-child(23) {
  z-index: 3;
  background: #eef3fa;
}

.plan-table th:nth-child(19),
.plan-table td:nth-child(19) {
  text-align: center;
  white-space: normal;
  word-break: break-word;
}

.plan-type-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 20px;
  border: 1px solid #d8e2ef;
  background: #f7fbff;
  color: #315574;
  font-size: 12px;
  font-weight: 700;
}

.plan-type-tag.new {
  border-color: #f3bf72;
  background: #fff7e8;
  color: #b26a00;
}

.plan-type-tag.repeat {
  border-color: #9cc7ee;
  background: #eef7ff;
  color: #0b63ce;
}

.plan-type-cell {
  text-align: center;
  vertical-align: middle;
}

.plan-table thead th.plan-type-cell {
  position: sticky !important;
  top: 0;
  z-index: 7 !important;
  background: #eef3f9;
  box-shadow: inset 0 -1px 0 #d4deea !important;
}

.plan-type-empty {
  display: inline-block;
  width: 34px;
  height: 20px;
}

.order-type-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid #d8e2ef;
  background: #f7fbff;
  color: #315574;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.order-type-tag.new {
  border-color: #f3bf72;
  background: #fff7e8;
  color: #b26a00;
}

.order-type-tag.repeat {
  border-color: #9cc7ee;
  background: #eef7ff;
  color: #0b63ce;
}

.order-type-tag.broken-warning {
  border-color: #ff9f9a;
  background: #fff0ef;
  color: #c42d2d;
}

.plan-table .summary-thumb {
  width: 46px;
  height: 46px;
}

.plan-style-cell {
  position: relative;
  display: inline-block;
  min-width: 54px;
  padding: 2px 12px 2px 0;
}

.first-order-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  color: #d97706;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
}

.plan-action-cell {
  padding: 4px 6px !important;
}

.plan-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.plan-actions button {
  min-width: 42px;
  height: 26px;
  padding: 0 6px;
  font-size: 12px;
}

.plan-transfer-actions button {
  min-width: 36px;
}

.plan-share-link {
  border: 0;
  background: transparent;
  color: #0b73d9;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.plan-share-link:hover {
  text-decoration: underline;
}

.plan-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.plan-detail-item {
  border: 1px solid #dbe6f5;
  background: #f8fbff;
  padding: 10px 12px;
}

.plan-detail-item span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 5px;
}

.plan-detail-item strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

.workflow-action-form {
  display: grid;
  gap: 14px;
}

.workflow-action-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
}

.workflow-action-form input,
.workflow-action-form select,
.workflow-action-form textarea {
  width: 100%;
  border: 1px solid #ccd8e8;
  padding: 8px 10px;
  font: inherit;
}

.workflow-code-settings {
  margin-top: 14px;
}

.workflow-code-template-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  width: 100%;
}

.workflow-code-template-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 6px 10px;
  align-items: center;
  border: 1px solid #dbe6f5;
  background: #f8fbff;
  padding: 10px;
}

.workflow-code-template-row span {
  color: #334155;
  font-weight: 600;
}

.workflow-code-template-row input {
  width: 100%;
  border: 1px solid #ccd8e8;
  padding: 7px 8px;
  font: inherit;
}

.workflow-code-template-row em {
  grid-column: 2;
  color: #64748b;
  font-style: normal;
  font-size: 12px;
}

.flow-code-rule-wrap {
  max-width: 980px;
  border: 1px solid #d9e5f3;
  background: #fff;
}

.flow-code-rule-table th,
.flow-code-rule-table td {
  height: 36px;
  padding: 6px 10px;
  white-space: nowrap;
}

.flow-code-rule-table th:nth-child(1),
.flow-code-rule-table td:nth-child(1) {
  width: 150px;
}

.flow-code-rule-table th:nth-child(2),
.flow-code-rule-table td:nth-child(2) {
  width: 260px;
}

.flow-code-rule-table th:nth-child(3),
.flow-code-rule-table td:nth-child(3) {
  width: 96px;
}

.flow-code-rule-table input {
  width: 100%;
  height: 28px;
  border: 1px solid #cfdbea;
  background: #fff;
  padding: 0 8px;
  font: inherit;
}

.flow-code-rule-table em {
  color: #6b778c;
  font-style: normal;
}

.plan-share-stack {
  display: inline-grid;
  gap: 2px;
  min-width: 92px;
  justify-items: start;
  line-height: 1.25;
  text-align: center;
}

.plan-share-stack:hover {
  text-decoration: none;
}

.plan-share-stack span {
  display: grid;
  grid-template-columns: 22px minmax(48px, auto);
  gap: 4px;
  align-items: baseline;
}

.plan-share-stack em {
  color: #66758a;
  font-style: normal;
  font-size: 12px;
}

.plan-share-stack strong {
  color: #0b63ce;
  font-weight: 700;
}

.plan-table .plan-sales-share-cell {
  text-align: center;
  vertical-align: middle;
  line-height: 1;
}

.plan-table .plan-sales-share-cell .plan-share-link {
  appearance: none;
  display: grid !important;
  place-items: center;
  margin: 0 auto;
  min-height: 0;
  line-height: 1.25;
  vertical-align: top;
  font: inherit;
  border: 0;
  background: transparent;
}

.plan-table .plan-sales-share-cell .plan-share-link.plan-share-stack {
  place-items: center stretch;
  align-content: center !important;
  gap: 2px;
  padding: 0;
}

.plan-table .plan-sales-share-cell .plan-share-stack {
  width: 92px;
  justify-items: center !important;
  text-align: center;
  line-height: 1.2;
}

.plan-table .plan-sales-share-cell .plan-share-stack span {
  grid-template-columns: 22px minmax(48px, auto);
  justify-content: center;
  width: 74px;
  align-items: center !important;
  min-height: 15px;
}

.plan-table .plan-sales-share-cell .plan-share-stack em,
.plan-return-rate-stack em {
  color: #1f2f46;
  text-align: center;
}

.plan-table .plan-sales-share-cell .plan-share-stack strong,
.plan-return-rate-stack strong {
  color: #1f2f46;
  text-align: center;
}

.plan-table .plan-sales-share-cell .plan-share-stack .primary-platform em,
.plan-table .plan-sales-share-cell .plan-share-stack .primary-platform strong {
  color: #0b63ce;
}

.plan-return-rate-stack {
  display: inline-grid;
  gap: 2px;
  min-width: 92px;
  justify-items: start;
  line-height: 1.25;
}

.plan-return-rate-stack span {
  display: grid;
  grid-template-columns: 22px minmax(48px, auto);
  gap: 4px;
  align-items: baseline;
}

.plan-return-rate-stack em {
  color: #66758a;
  font-style: normal;
  font-size: 12px;
}

.plan-return-rate-stack strong {
  font-weight: 700;
}

.plan-return-rate-stack .primary-platform em,
.plan-return-rate-stack .primary-platform strong {
  color: #0b63ce;
}

.plan-share-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.plan-share-summary.replenishment-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.plan-share-summary.replenishment-summary-legacy {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.plan-share-summary.replenishment-overview-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.plan-share-summary.replenishment-decision-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: -4px;
}

.plan-share-summary.replenishment-decision-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 10px 12px;
}

.plan-share-summary.replenishment-decision-summary span {
  margin-bottom: 0;
}

.plan-share-summary.replenishment-decision-summary strong {
  font-size: 18px;
  letter-spacing: 0.01em;
}

.plan-share-summary .replenishment-gap-card.is-covered {
  background: #f1faf5;
  border-color: #b9dfc9;
}

.plan-share-summary .replenishment-gap-card.is-covered strong {
  color: #177245;
}

.plan-share-summary .replenishment-gap-card.is-shortage {
  background: #fff5f1;
  border-color: #efc8b8;
}

.plan-share-summary .replenishment-gap-card.is-shortage strong {
  color: #bb3e24;
}

.plan-share-summary .replenishment-threshold-card {
  background: #f7f9fc;
  border-color: #d8e0eb;
}

.plan-share-summary div {
  border: 1px solid #dbe6f3;
  background: #f8fbff;
  padding: 8px 10px;
}

.plan-share-summary span {
  display: block;
  color: #66758a;
  font-size: 12px;
  margin-bottom: 4px;
}

.plan-share-summary strong {
  color: #1c2f46;
}

#planAuditModal .plan-audit-modal-panel {
  width: min(420px, calc(100vw - 32px)) !important;
  max-width: 420px;
}

#planAuditModal.plan-audit-modal-batch .plan-audit-modal-panel {
  width: min(1180px, calc(100vw - 40px)) !important;
  max-width: 1180px;
}

.plan-audit-form {
  display: grid;
  gap: 14px;
}

#planAuditModal.plan-audit-modal-batch .modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "batch batch"
    "person actions";
  gap: 16px;
  align-items: start;
}

#planAuditModal.plan-audit-modal-batch .plan-audit-form {
  grid-area: person;
  width: 260px;
}

#planAuditModal.plan-audit-modal-batch .plan-audit-form label:not(:nth-child(3)) {
  display: none;
}

#planAuditModal.plan-audit-modal-batch .modal-actions {
  grid-area: actions;
  align-self: end;
  justify-content: flex-end;
}

.plan-audit-batch-preview {
  grid-area: batch;
  min-width: 0;
}

.plan-audit-batch-preview .modal-table-wrap {
  max-height: 430px;
  overflow: auto;
}

.plan-audit-batch-table {
  min-width: 1320px;
}

.plan-audit-batch-table th,
.plan-audit-batch-table td {
  text-align: center;
  vertical-align: middle;
}

.plan-audit-batch-table th:nth-child(6),
.plan-audit-batch-table td:nth-child(6),
.plan-audit-batch-table th:nth-child(9),
.plan-audit-batch-table td:nth-child(9) {
  min-width: 82px;
}

.plan-audit-batch-table th:nth-child(11),
.plan-audit-batch-table td:nth-child(11) {
  min-width: 220px;
}

.plan-audit-batch-table select,
.plan-audit-batch-table input {
  width: 100%;
  height: 28px;
  border: 1px solid #ccd6e4;
  background: #fff;
  color: #17233c;
  box-sizing: border-box;
  font: inherit;
  text-align: center;
}

.plan-audit-batch-table select {
  padding: 0 24px 0 8px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #53657d 50%),
    linear-gradient(135deg, #53657d 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 11px,
    calc(100% - 9px) 11px;
  background-repeat: no-repeat;
  background-size: 5px 5px;
}

.plan-audit-batch-table .plan-batch-note {
  padding: 0 8px;
  text-align: left;
}

.plan-audit-form label {
  display: grid;
  gap: 7px;
  color: #4c596a;
  font-size: 13px;
}

.plan-audit-form input,
.plan-audit-form select,
.plan-audit-form textarea {
  width: 100%;
  border: 1px solid #ccd6e4;
  padding: 8px 10px;
  font: inherit;
  min-width: 0;
  box-sizing: border-box;
  background: #fff;
  color: #17233c;
}

.plan-audit-form input,
.plan-audit-form select {
  height: 32px;
  line-height: 30px;
  padding-top: 0;
  padding-bottom: 0;
}

.plan-audit-form select {
  padding-right: 30px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #53657d 50%),
    linear-gradient(135deg, #53657d 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 13px,
    calc(100% - 11px) 13px;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  line-height: 32px;
  vertical-align: middle;
}

.plan-audit-form textarea {
  min-height: 86px;
  line-height: 1.5;
  resize: vertical;
}

.stepper-input {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
}

.stepper-input input {
  text-align: center;
  border-left: 0;
  border-right: 0;
}

.stepper-input button {
  min-width: 0;
  border-radius: 0;
}

.production-row-no {
  left: 0;
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  color: #617089;
  text-align: center;
  font-style: italic;
}

.production-image-col {
  left: 42px;
  width: 78px;
  min-width: 78px;
  max-width: 78px;
  text-align: center;
}

.production-image-col .summary-thumb {
  width: 54px;
  height: 54px;
}

.production-image-col .summary-image-btn,
.production-image-btn {
  width: 58px;
  height: 58px;
}

.production-fixed-1 {
  left: 120px;
  width: 112px;
  min-width: 112px;
  max-width: 112px;
}

.production-fixed-2 {
  left: 232px;
  width: 150px;
  min-width: 150px;
  max-width: 150px;
}

th.production-row-no,
th.production-image-col,
th.production-fixed-1,
th.production-fixed-2 {
  z-index: 5;
}

.production-grid-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #fff;
  border-top: 1px solid #cfd7e3;
  font-weight: 700;
}

.production-grid-table tfoot .sticky-left {
  z-index: 4;
}

.production-erp-view {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #f4f7fb;
}

.production-erp-view:not(.active),
.production-erp-view.hidden {
  display: none;
}

.production-erp-filter-panel {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #d8e1ee;
  background: #fff;
}

.production-erp-filter-grid {
  grid-template-columns: 126px 126px 126px 126px 132px 132px 132px 120px 120px 126px 104px 104px auto;
  gap: 8px;
  align-items: center;
}

.production-erp-filter-grid input,
.production-erp-filter-grid select {
  height: 30px;
  min-width: 0;
}

.production-action-strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.production-date-picker {
  position: fixed;
  z-index: 120;
  width: 326px;
  border: 1px solid #cfd9e8;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 42, 61, 0.16);
  color: #26364a;
  font-size: 13px;
}

.production-date-picker-head {
  height: 42px;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  border-bottom: 1px solid #edf1f6;
}

.production-date-picker-head strong {
  text-align: center;
  font-size: 14px;
}

.production-date-picker-head button,
.production-date-day,
.production-date-presets button {
  border: 0;
  background: transparent;
  color: inherit;
  min-width: 0;
  height: 30px;
  padding: 0;
}

.production-date-picker-head button {
  color: #7b8798;
  font-size: 20px;
}

.production-date-week,
.production-date-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 12px;
}

.production-date-week {
  height: 32px;
  align-items: center;
  color: #7d8a9b;
  text-align: center;
}

.production-date-days {
  row-gap: 3px;
  padding-bottom: 8px;
}

.production-date-day {
  border: 1px solid transparent;
}

.production-date-day:hover,
.production-date-day.active {
  border-color: #2f7df6;
  color: #1267d8;
  background: #f4f8ff;
}

.production-date-day.muted {
  color: #9aa6b5;
}

.production-date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 12px 12px;
  border-top: 1px solid #edf1f6;
}

.production-date-presets button {
  height: 24px;
  color: #1677ff;
}

.production-erp-toolbar {
  flex: 0 0 38px;
  height: 38px;
  min-height: 38px;
  margin: 8px 0 0;
  padding: 0;
  border: 1px solid #d8e1ee;
  border-bottom: 0;
  background: #fff;
  display: grid;
  grid-template-columns: max-content max-content 1fr;
  gap: 0 !important;
  width: 100%;
  justify-content: flex-start !important;
  column-gap: 0 !important;
  align-items: stretch;
  box-shadow: 0 1px 0 rgba(16, 35, 63, 0.04);
}

.production-erp-toolbar .table-tabs {
  box-sizing: border-box;
  grid-column: 1;
  min-width: 0;
  width: max-content;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  border-right: 1px solid #d8e1ee;
  scrollbar-width: thin;
}

.production-erp-toolbar .table-tabs button {
  flex: 0 0 auto;
  min-width: 86px;
  height: 38px;
  padding: 0 12px;
  border-color: transparent;
  background: transparent;
  color: #29405f;
  white-space: nowrap;
}

.production-erp-toolbar .table-tabs button[data-production-tab="all"] {
  min-width: 112px;
  margin-right: 8px;
  background: #f6fbff;
  border-right: 1px solid #d8e1ee;
}

.production-erp-toolbar .table-tabs button[data-production-tab="needCut"] {
  min-width: 76px;
}

.production-erp-toolbar .table-tabs button[data-production-tab="needOutsource"] {
  min-width: 124px;
}

.production-erp-toolbar .table-tabs button[data-production-tab="finished"] {
  min-width: 112px;
  margin-left: 8px;
  background: #f8fafc;
  border-left: 1px solid #d8e1ee;
}

.production-erp-toolbar .table-tabs button.active {
  background: #eaf4ff;
  color: #0b70d1;
  border-color: transparent;
  font-weight: 700;
}

.production-erp-toolbar .table-tabs button em {
  margin-left: 4px;
  font-style: normal;
  color: inherit;
}

.production-erp-toolbar .column-order-open {
  grid-column: 3;
  justify-self: end;
  align-self: stretch;
  min-width: 86px;
  height: 38px;
  margin: 0;
  padding: 0 14px;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid #d8e1ee;
  border-radius: 0;
  background: #fff;
}

.production-data-meta {
  box-sizing: border-box;
  margin: 0;
  height: auto;
  max-height: none;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  padding: 0;
  border-left: 0;
  border-right: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  line-height: 1.25;
  color: #9aa7b8;
}

.production-data-meta span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.production-table-tools {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: auto;
  min-width: 360px;
  height: 28px;
  margin-left: 0;
  margin-left: 0 !important;
  padding: 0;
  border-left: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow: hidden;
  font-size: 12px;
}

.production-bottom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 34px;
  min-height: 34px;
  margin-top: 0;
  padding: 3px 8px;
  border: 1px solid #d8e1ee;
  border-top: 0;
  border-radius: 0 0 var(--erp-radius) var(--erp-radius);
  background: #fbfdff;
}

.production-bottom-toolbar .production-data-meta {
  flex: 1 1 auto;
}

.production-bottom-toolbar .production-data-meta strong {
  color: #748398;
  font-weight: 600;
}

.production-bottom-toolbar .production-data-meta span {
  border: 0;
  background: transparent;
  padding: 0;
}

.production-bottom-toolbar .production-page-size {
  flex: 0 0 58px;
  min-width: 58px;
}

.production-bottom-toolbar .production-page-size select {
  width: 58px;
  height: 26px;
}

.production-bottom-toolbar .production-counter {
  flex: 0 0 128px;
  min-width: 128px;
  text-align: right;
  color: #64748b;
}

.production-bottom-toolbar .production-pager {
  display: flex;
  align-items: center;
  gap: 4px;
}

.production-bottom-toolbar .production-pager button {
  height: 26px;
  padding: 0 10px;
}

.production-bottom-toolbar .table-refresh-button {
  width: 26px;
  padding: 0;
}

.production-erp-table-wrap {
  flex: 1 1 auto;
  height: calc(100vh - 178px);
  margin: 0 0 10px;
  border: 1px solid #d8e1ee;
  background: #fff;
  overflow: auto;
  min-width: 0;
}

.production-grid-table {
  width: max-content;
  min-width: 3000px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.production-grid-table th,
.production-grid-table td {
  box-sizing: border-box;
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  border-right: 1px solid #e1e7f0;
  border-bottom: 1px solid #e1e7f0;
}

.production-grid-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 34px;
  background: #f3f6fb;
  color: #263a55;
  font-weight: 700;
}

.production-grid-table tbody td {
  height: 52px;
  background: inherit;
}

.production-grid-table tbody tr {
  background: #fffdf2;
}

.production-grid-table tbody tr:nth-child(even) {
  background: #f7fbff;
}

.production-grid-table tbody tr:hover {
  background: #eaf4ff;
}

.production-grid-table tbody tr.selected {
  background: #e5f2ff;
}

.production-row-no {
  left: 0;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  color: #69768b;
  text-align: center;
  font-style: normal;
}

.production-select-col {
  left: 44px;
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  padding: 0 !important;
  text-align: center;
}

.production-image-col {
  left: 80px;
  width: 58px !important;
  min-width: 58px !important;
  max-width: 58px !important;
  text-align: center;
}

.production-image-col .summary-thumb {
  width: 40px;
  height: 40px;
}

.production-image-col .summary-image-btn,
.production-image-btn {
  width: 42px;
  height: 42px;
}

.production-fixed-1 {
  left: 138px;
  width: 126px !important;
  min-width: 126px !important;
  max-width: 126px !important;
}

.production-fixed-2 {
  left: 264px;
  width: 118px !important;
  min-width: 118px !important;
  max-width: 118px !important;
}

.production-date-cell {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
}

.production-num-cell {
  width: 84px;
  min-width: 84px;
  max-width: 84px;
}

.production-status-cell,
.production-owner-cell {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
}

.production-color-cell,
.production-type-cell {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
}

.production-id-cell {
  width: 112px;
  min-width: 112px;
  max-width: 112px;
}

.production-factory-cell {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
}

.production-note-cell {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  white-space: normal;
  line-height: 1.35;
}

.production-grid-table .sticky-left {
  position: sticky;
  z-index: 3;
  background: inherit;
  box-shadow: 1px 0 0 #d8e1ee;
}

.production-grid-table thead .sticky-left {
  z-index: 6;
  background: #f3f6fb;
}

.production-grid-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  height: 34px;
  background: #fff;
  border-top: 1px solid #cfd7e3;
  font-weight: 700;
}

.production-grid-table tfoot .sticky-left {
  z-index: 5;
  background: #fff;
}

.report-view {
  padding-bottom: 16px;
}

.filter-panel {
  display: grid;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.expected-return-filter {
  grid-template-columns: 220px 180px 160px minmax(520px, 1fr);
}

.expected-return-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.rule-chip {
  height: 30px;
  min-width: 86px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 8px;
  white-space: nowrap;
}

.rule-chip span {
  color: var(--muted);
  font-size: 12px;
}

.rule-chip strong {
  color: #13233a;
  font-size: 13px;
}

.rule-chip.model-chip {
  min-width: 260px;
  max-width: 360px;
}

.rule-chip.model-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.expected-return-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
  align-items: stretch;
}

.expected-result-panel {
  margin-bottom: 10px;
}

.expected-return-panel {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
  min-width: 0;
}

.expected-rule-grid .expected-return-panel {
  display: flex;
  flex-direction: column;
}

.expected-return-panel h3,
.sub-panel-title {
  margin: 0 0 8px;
  font-size: 14px;
  color: #1f2a3d;
}

.report-table-wrap {
  max-height: 360px;
}

.expected-rule-table-wrap,
.expected-day-model-wrap {
  flex: 1 1 auto;
  max-height: 260px;
  overflow-x: hidden;
}

.expected-rule-table {
  table-layout: fixed;
  min-width: 0;
}

.expected-rule-table th,
.expected-rule-table td {
  padding: 6px 6px;
}

.expected-daily-wrap {
  max-height: 460px;
}

.expected-platform-summary-wrap {
  flex: 0 0 auto !important;
  max-height: none !important;
  overflow: visible;
  margin-bottom: 8px;
}

.expected-platform-summary-table {
  min-width: 0;
}

.expected-platform-summary-table th {
  width: 160px;
  text-align: right;
  background: #f4f8fd;
}

.expected-platform-summary-table td {
  min-width: 140px;
}

.expected-platform-summary-table strong {
  margin-left: 6px;
  font-size: 15px;
  color: #13233a;
}

.expected-platform-summary-table .expected-platform-rate {
  color: #0b64c0;
  font-size: 18px;
}

.expected-platform-summary-table .expected-platform-status {
  font-size: 13px;
  font-weight: 600;
}

.expected-return-overview {
  flex: 0 0 auto;
  margin-bottom: 10px;
  border: 1px solid #cbd9e8;
  background: #fff;
}

.expected-return-primary {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.2fr) minmax(130px, 0.48fr) minmax(130px, 0.48fr);
  align-items: center;
  gap: 20px;
  min-height: 78px;
  padding: 12px 16px;
  background: #f7faff;
}

.expected-return-primary > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.expected-return-eyebrow {
  color: #526174;
  font-size: 12px;
}

.expected-return-primary > div:first-child strong {
  color: #0b64c0;
  font-size: 30px;
  line-height: 1;
}

.expected-return-confidence {
  display: grid;
  gap: 4px;
  padding-left: 18px;
  border-left: 3px solid #9eb3c8;
}

.expected-return-confidence b {
  color: #355675;
  font-size: 13px;
}

.expected-return-confidence span {
  color: #748195;
  font-size: 12px;
}

.expected-return-range-summary {
  display: grid;
  gap: 5px;
  min-height: 48px;
  padding-left: 18px;
  border-left: 1px solid #cbd9e8;
  align-content: center;
}

.expected-return-range-summary span {
  color: #748195;
  font-size: 11px;
}

.expected-return-range-summary strong {
  color: #263a55;
  font-size: 18px;
  line-height: 1;
}

.expected-return-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  border-bottom: 1px solid #e1e8f0;
}

.expected-return-metrics span {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 8px 12px;
  border-right: 1px solid #e1e8f0;
}

.expected-return-metrics span:last-child {
  border-right: 0;
}

.expected-return-metrics em {
  color: #7a8797;
  font-size: 11px;
  font-style: normal;
}

.expected-return-metrics strong {
  color: #1f3046;
  font-size: 16px;
}

.expected-return-source-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 7px 12px;
  color: #667488;
  font-size: 11px;
}

.expected-return-source-line b {
  color: #263a55;
}

.expected-day-legend {
  display: flex;
  flex: 0 0 auto;
  gap: 20px;
  padding: 6px 10px;
  border: 1px solid #d8e2ec;
  border-bottom: 0;
  background: #fbfcfe;
  color: #607086;
  font-size: 11px;
}

.expected-day-legend span::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  content: "";
}

.expected-day-legend .observe::before {
  background: #9aa8b8;
}

.expected-day-legend .included::before {
  background: #2f75b5;
}

.expected-near15-table tbody tr.expected-day-observe td {
  background: #f8fafc;
}

.expected-near15-table tbody tr.expected-day-included td:first-child {
  box-shadow: inset 3px 0 0 #2f75b5;
}

@media (max-width: 900px) {
  .expected-return-primary {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .expected-return-confidence {
    padding-left: 10px;
  }

  .expected-return-metrics {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

.expected-near15-wrap {
  max-height: 520px;
}

.expected-near15-table {
  min-width: 920px;
  table-layout: fixed;
}

.expected-near15-table th:first-child,
.expected-near15-table td:first-child {
  width: 190px;
}

.expected-near15-table th:not(:first-child),
.expected-near15-table td:not(:first-child) {
  width: calc((100% - 190px) / 7);
}

.expected-near15-table th,
.expected-near15-table td {
  height: 32px;
  padding-top: 5px;
  padding-bottom: 5px;
  line-height: 1.2;
}

.expected-near15-table th span {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

.expected-return-cell {
  display: grid;
  gap: 2px;
  line-height: 1.25;
}

.expected-return-cell b {
  color: #13233a;
}

.expected-return-cell span,
.expected-return-cell em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.expected-day-cell b,
.expected-day-cell span,
.expected-day-cell em {
  display: inline;
}

.expected-day-cell {
  white-space: nowrap;
}

.expected-day-cell b + span,
.expected-day-cell span + em,
.expected-day-cell b + em {
  margin-left: 8px;
}

.expected-rate-interval {
  display: inline-block;
  min-width: 64px;
  padding: 2px 7px;
  border-radius: 3px;
  color: #355675;
  font-weight: 600;
}

.expected-empty-value {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8a97a8;
  font-weight: 400;
}

.expected-rate-interval.is-low {
  color: #59697b;
}

.expected-rate-interval.is-medium {
  color: #43566c;
}

.expected-rate-interval.is-high {
  background: #fff3df;
  color: #8a5a18;
}

.expected-rate-interval.is-critical {
  background: #fbe9e7;
  color: #a33b32;
}

.expected-rate-interval.is-high::after,
.expected-rate-interval.is-critical::after {
  margin-left: 5px;
  font-size: 10px;
  font-weight: 600;
}

.expected-rate-interval.is-high::after {
  content: "偏高";
}

.expected-rate-interval.is-critical::after {
  content: "高风险";
}

.expected-day-cell span {
  color: var(--muted);
  font-size: 12px;
}

.expected-day-cell em {
  color: #8a96a6;
  font-size: 10px;
  font-style: normal;
}

.expected-day-model-wrap {
  max-height: 260px;
}

.strong-rate {
  color: var(--blue);
  font-weight: 700;
}

button.linklike,
.expected-rate-link {
  border: 0;
  background: transparent;
  padding: 0;
  height: auto;
  min-width: 0;
  font: inherit;
  color: var(--blue);
}

.return-rate-trend-section {
  margin-top: 12px;
  border: 1px solid #d7e1ec;
  background: #fff;
}

.return-rate-trend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafd;
}

.return-rate-trend-head > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.return-rate-trend-head strong {
  color: #20364f;
  font-size: 13px;
}

.return-rate-trend-head span,
.return-rate-trend-empty {
  color: #718096;
  font-size: 11px;
}

.return-rate-trend-legend {
  display: flex;
  gap: 18px;
}

.return-rate-trend-means {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  white-space: nowrap;
}

.return-rate-trend-means b {
  margin-left: 3px;
  font-size: 12px;
}

.return-rate-trend-means .expected b {
  color: #0b64c0;
}

.return-rate-trend-means .expected::before {
  display: inline-block;
  width: 16px;
  margin-right: 6px;
  border-top: 1px dashed #0b64c0;
  vertical-align: middle;
  content: "";
}

.return-rate-trend-legend span::before {
  display: inline-block;
  width: 16px;
  height: 2px;
  margin-right: 6px;
  vertical-align: middle;
  content: "";
}

.return-rate-trend-legend .actual::before {
  background: #31475e;
}

.return-rate-trend-legend .expected::before {
  background: #0b64c0;
}

.return-rate-trend-chart {
  overflow-x: auto;
  padding: 8px 10px 2px;
}

.return-rate-trend-chart svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: 220px;
}

.return-rate-grid line {
  stroke: #e1e7ee;
  stroke-width: 1;
}

.return-rate-grid text {
  fill: #7a8797;
  font-size: 10px;
}

.return-rate-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.return-rate-mean-line {
  stroke-width: 1.25;
  stroke-dasharray: 6 4;
  opacity: 0.72;
  pointer-events: none;
}

.return-rate-mean-line.expected {
  stroke: #0b64c0;
}

.return-rate-line.actual,
.return-rate-point.actual {
  stroke: #31475e;
}

.return-rate-line.expected,
.return-rate-point.expected {
  stroke: #0b64c0;
}

.return-rate-point {
  fill: #fff;
  stroke-width: 2;
  pointer-events: none;
}

.return-rate-hover-group {
  outline: none;
}

.return-rate-hover-zone {
  fill: transparent;
  cursor: crosshair;
  transition: fill 120ms ease;
}

.return-rate-hover-guide,
.return-rate-hover-tooltip {
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.return-rate-hover-guide {
  stroke: #8ca8c3;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.return-rate-hover-tooltip rect {
  fill: #ffffff;
  stroke: #b9c9d9;
  stroke-width: 1;
  filter: drop-shadow(0 2px 4px rgba(35, 58, 82, 0.12));
}

.return-rate-hover-tooltip text {
  font-size: 10px;
  font-weight: 600;
}

.return-rate-hover-tooltip .date {
  fill: #5d6f82;
}

.return-rate-hover-tooltip .actual {
  fill: #31475e;
}

.return-rate-hover-tooltip .expected {
  fill: #0b64c0;
}

.return-rate-hover-group:hover .return-rate-hover-zone,
.return-rate-hover-group:focus .return-rate-hover-zone {
  fill: rgba(11, 100, 192, 0.055);
}

.return-rate-hover-group:hover .return-rate-hover-guide,
.return-rate-hover-group:hover .return-rate-hover-tooltip,
.return-rate-hover-group:focus .return-rate-hover-guide,
.return-rate-hover-group:focus .return-rate-hover-tooltip {
  opacity: 1;
}

.return-rate-trend-empty {
  padding: 26px 12px;
  text-align: center;
}

.expected-rate-link:hover {
  text-decoration: underline;
}

.profit-drilldown-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.15fr) minmax(360px, 0.85fr);
  gap: 10px;
}

.profit-detail-wrap {
  max-height: 520px;
}

.profit-wide-wrap {
  min-width: 1080px;
}

.profit-chart {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px;
  min-height: 210px;
}

.profit-chart svg {
  width: 100%;
  height: 210px;
  display: block;
}

@media (max-width: 1200px) {
  .profit-drilldown-grid {
    grid-template-columns: 1fr;
  }
}

.production-dashboard-view {
  padding-top: 0;
  padding-bottom: 10px;
  overflow: hidden;
}

.production-source-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  padding: 0 0 6px;
}

.empty-cell {
  height: 78px;
  color: var(--muted);
  background: #fff;
}

.catalog-main {
  min-width: 0;
}

.node-tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100vh - 160px);
  overflow: auto;
}

.node-row {
  width: 100%;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  background: #fff;
  padding: 0 8px;
  text-align: left;
}

.node-row:hover,
.node-row.active {
  border-color: #91c5ff;
  background: #eef6ff;
  color: var(--blue);
}

.node-row small {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.node-empty {
  color: var(--muted);
  line-height: 1.7;
  padding: 10px;
}

.source-panel {
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
  margin-bottom: 10px;
}

.source-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.source-head h2 {
  margin: 0;
  font-size: 15px;
}

.source-head span,
.source-card span {
  color: var(--muted);
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.source-card {
  min-height: 78px;
  padding: 8px 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
}

.source-card-title {
  color: var(--text);
  font-weight: 700;
}

.source-card.active,
.source-card:hover {
  border-color: #91c5ff;
  background: #eef6ff;
}

.source-card span {
  font-size: 12px;
}

.source-card .source-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
  padding: 4px 9px;
  background: var(--primary);
  color: #fff;
  border-radius: 2px;
  font-weight: 700;
}

.settings-home {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 12px;
}

.settings-quick,
.settings-groups {
  background: #fff;
  border: 1px solid var(--line);
  padding: 14px;
}

.settings-quick h2,
.settings-group h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.settings-quick {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-entry {
  width: 100%;
  height: 36px;
  border: 1px solid transparent;
  background: #fff;
  text-align: left;
  padding: 0 10px;
}

.settings-entry.active,
.settings-entry:hover {
  border-color: #91c5ff;
  background: #eef6ff;
  color: var(--blue);
}

.settings-entry.muted span::after {
  content: " 待配置";
  color: var(--muted);
  font-size: 12px;
}

.settings-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 22px 42px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.settings-link {
  width: 100%;
  height: 32px;
  border: 1px solid transparent;
  background: #fff;
  text-align: left;
  padding: 0 8px;
}

.settings-link:hover {
  border-color: #91c5ff;
  background: #f7fbff;
}

.settings-panel {
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
  margin-bottom: 12px;
}

.production-settings-view {
  gap: 10px;
}

.business-flow-settings {
  max-width: 980px;
}

.business-flow-card {
  border: 1px solid #d8e1ec;
  background: #fff;
}

.business-flow-card-head {
  display: grid;
  gap: 5px;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f1;
}

.business-flow-card-head strong {
  color: #1d2f47;
  font-size: 14px;
}

.business-flow-card-head span,
.business-flow-row em {
  color: #7a8799;
  font-style: normal;
  font-size: 12px;
  line-height: 1.5;
}

.business-flow-row {
  min-height: 72px;
  padding: 12px 16px;
  border-bottom: 1px solid #edf2f7;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  color: #223047;
}

.business-flow-row:last-child {
  border-bottom: 0;
}

.business-flow-row span {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.business-flow-row strong {
  font-size: 13px;
}

.business-flow-edit {
  height: 28px;
  min-width: 90px;
  padding: 0 10px;
}

.business-flow-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 32px;
  height: 18px;
  min-width: 32px;
  border: 0;
  border-radius: 999px;
  background: #a8b2bf;
  padding: 0;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
}

.business-flow-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(19, 35, 54, 0.22);
  transition: transform 0.15s ease;
}

.business-flow-row input[type="checkbox"]:checked {
  background: #1677ff;
}

.business-flow-row input[type="checkbox"]:checked::after {
  transform: translateX(14px);
}

#planFlowFieldsInput {
  width: 100%;
  min-height: 180px;
  resize: vertical;
}

.settings-toolbar {
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 -10px 10px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(280px, 0.8fr);
  gap: 12px;
}

.settings-subhead {
  color: var(--muted);
  margin-bottom: 8px;
}

.settings-node-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-node-group,
.config-placeholder {
  border: 1px solid var(--line);
  background: #fdfefe;
}

.settings-node-root {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  background: #f4f7fb;
  border-bottom: 1px solid var(--line);
}

.settings-node-root span,
.settings-node-child small,
.config-placeholder span {
  color: var(--muted);
}

.settings-node-children {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px;
}

.settings-node-child {
  min-height: 66px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.settings-node-child:hover {
  border-color: #91c5ff;
  background: #eef6ff;
}

.settings-node-open {
  flex: 1 1 auto;
  height: auto;
  min-height: 42px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: 6px 8px 4px;
  text-align: left;
}

.settings-node-open:hover {
  border: 0;
  color: var(--blue);
  background: transparent;
}

.node-mode-select {
  height: 24px;
  margin: 0 8px 8px;
  border: 1px solid #cfd7e3;
  background: #f8fafc;
}

.node-empty.compact {
  padding: 4px 2px;
}

.config-placeholder {
  min-height: 110px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.7;
}

.setting-editor {
  margin-top: 10px;
  align-items: stretch;
}

.setting-editor-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 72px;
  gap: 8px;
  align-items: center;
}

.setting-editor-row input {
  width: 100%;
  height: 32px;
}

.operation-mapping-view .toolbar {
  align-items: end;
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.operation-mapping-toolbar label {
  min-width: 180px;
}

.operation-mapping-toolbar label.wide {
  min-width: 260px;
}

.operation-mapping-wrap {
  max-height: calc(100vh - 220px);
}

.operation-mapping-table th,
.operation-mapping-table td {
  white-space: nowrap;
}

.operation-mapping-table {
  min-width: 1180px;
}

.operation-mapping-table th:nth-child(1),
.operation-mapping-table td:nth-child(1),
.operation-mapping-table th:last-child,
.operation-mapping-table td:last-child {
  width: 128px;
}

.operation-mapping-table th:nth-child(6),
.operation-mapping-table td:nth-child(6) {
  width: 210px;
}

.store-mapping-input,
.store-mapping-status {
  width: 100%;
  min-width: 120px;
  height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 7px;
}

.store-mapping-input:focus,
.store-mapping-status:focus {
  border-color: var(--primary);
  outline: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
}

.mapping-disabled td {
  color: var(--muted);
  background: #f7f8fa;
}

.mapping-source-cell span,
.mapping-source-cell small {
  display: block;
}

.mapping-source-cell small {
  margin-top: 2px;
  color: var(--muted);
}

.mapping-action-cell {
  display: flex;
  gap: 5px;
}

.mapping-action-cell .danger {
  color: #b42318;
}

.settings-rollup-source {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings-rollup-source span {
  background: #f4f7fb;
  border: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.4;
  padding: 4px 7px;
}

.settings-rollup-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.settings-rollup-summary span {
  background: #f7fbff;
  border: 1px solid #d7e8fb;
  color: var(--muted);
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 7px 9px;
}

.settings-rollup-summary strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
}

.settings-rollup-tree {
  display: grid;
  gap: 8px;
}

.settings-rollup-node {
  background: #fff;
  border: 1px solid var(--line);
}

.settings-rollup-node summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 34px;
  padding: 6px 9px;
}

.settings-rollup-node summary span {
  color: var(--muted);
  white-space: nowrap;
}

.settings-rollup-node.child {
  background: #fbfdff;
}

.settings-rollup-children,
.settings-rollup-leaves {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  padding: 8px;
}

.settings-rollup-leaves {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.settings-rollup-leaves.compact {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.settings-rollup-leaf {
  background: #fdfefe;
  border: 1px solid #e1e8f0;
  display: grid;
  gap: 2px;
  min-height: 44px;
  padding: 6px 8px;
}

.settings-rollup-leaf span {
  color: var(--muted);
  font-size: 12px;
}

.account-settings-view {
  overflow: hidden;
}

.account-filter-panel {
  margin-bottom: 8px;
}

.account-presence-panel {
  margin-bottom: 8px;
  border: 1px solid #d7e1ec;
  background: #f8fbff;
}

.account-presence-summary {
  display: grid;
  grid-template-columns: 150px 150px minmax(260px, 1fr);
  align-items: stretch;
}

.account-presence-metric,
.account-presence-note {
  min-height: 62px;
  padding: 9px 12px;
}

.account-presence-metric {
  border-right: 1px solid #d7e1ec;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  column-gap: 8px;
}

.account-presence-metric span,
.account-presence-note span,
.account-presence-metric small {
  color: var(--muted);
  font-size: 12px;
}

.account-presence-metric strong {
  color: #147d45;
  font-size: 18px;
}

.account-presence-metric small {
  grid-column: 1 / -1;
}

.account-presence-note {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.account-presence-note strong {
  color: #31465f;
  font-size: 13px;
}

.account-presence-empty {
  min-height: 46px;
  padding: 13px 14px;
  color: var(--muted);
}

.account-presence-events {
  border-top: 1px solid #d7e1ec;
}

.account-presence-events summary {
  cursor: pointer;
  padding: 7px 12px;
  color: #35506e;
  font-size: 12px;
  user-select: none;
}

.account-presence-events summary span {
  color: var(--muted);
}

.account-presence-event-table-wrap {
  max-height: 280px;
  overflow: auto;
  border-top: 1px solid #e2e9f1;
  background: #fff;
}

.account-presence-event-table {
  min-width: 980px;
}

.account-presence-event-table th,
.account-presence-event-table td {
  height: 32px;
  white-space: nowrap;
}

.presence-event {
  color: #516176;
}

.presence-event.login_success {
  color: #14814b;
}

.presence-event.login_failed {
  color: #c24040;
}

.account-presence-cell {
  min-width: 128px;
}

.presence-status {
  display: inline-block;
}

.presence-status.online {
  color: #14814b;
  font-weight: 600;
}

.presence-status.offline,
.presence-status.never {
  color: #69798c;
}

.presence-last-seen {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.account-filter-grid {
  grid-template-columns: minmax(280px, 480px) minmax(160px, 240px) minmax(150px, 220px) 64px 64px;
  width: min(100%, 1100px);
  justify-content: start;
}

@media (max-width: 1100px) {
  .account-filter-grid {
    grid-template-columns: minmax(240px, 1fr) minmax(150px, 0.65fr) minmax(140px, 0.6fr) 64px 64px;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .account-filter-grid {
    grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.7fr);
  }
}

.account-table-wrap {
  flex: 1 1 auto;
  max-height: none;
}

.account-permission-table {
  min-width: 1550px;
}

.account-permission-table th,
.account-permission-table td,
.role-permission-table th,
.role-permission-table td {
  height: 34px;
  white-space: nowrap;
}

.account-permission-table th:first-child,
.account-permission-table td:first-child {
  width: 36px;
  text-align: center;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  vertical-align: middle;
  background: #aab4c2;
}

.status-dot.ok {
  background: #19a65a;
}

.status-dot.off {
  background: #aab4c2;
}

.account-modal-panel {
  width: min(960px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  background: #fff;
  border: 1px solid #cfd7e3;
  box-shadow: 0 18px 42px rgba(31, 47, 70, 0.25);
  display: flex;
  flex-direction: column;
}

.account-modal-body {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  min-height: 460px;
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.account-edit-tabs {
  background: #f7f9fc;
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-edit-tabs button {
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  height: 36px;
  color: #26384f;
}

.account-edit-tabs button.active {
  background: #e9f3ff;
  border-color: #c9e2ff;
  color: var(--blue);
}

.account-edit-content {
  padding: 16px;
  overflow: auto;
}

.account-edit-panel {
  display: none;
}

.account-edit-panel.active {
  display: block;
}

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-form-grid label,
.account-wide-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #526174;
}

.account-form-grid input,
.account-form-grid select,
.account-wide-label textarea,
.role-scope-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #cfd7e3;
  background: #fff;
  padding: 6px 8px;
}

.permission-note {
  border: 1px solid #d8e8fb;
  background: #f4f9ff;
  color: #516176;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.account-inherit-role {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-inherit-role label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1769b1;
  white-space: nowrap;
}

.account-inherit-role input {
  width: 14px;
  height: 14px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.permission-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}

.permission-grid label,
.binding-option {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid #dfe7f1;
  background: #fbfdff;
  padding: 5px 8px;
}

.permission-grid input,
.binding-option input {
  width: 14px;
  height: 14px;
  min-width: 14px;
}

.binding-platform-groups {
  display: grid;
  gap: 2px;
  padding: 2px 4px 10px;
}

.binding-view-modes {
  display: flex;
  gap: 6px;
  padding: 4px 8px 8px;
  border-bottom: 1px solid #e4ebf3;
}

.binding-view-modes button {
  min-height: 28px;
  padding: 3px 12px;
  border: 1px solid #cdd9e6;
  background: #fff;
  color: #4a6278;
  font-size: 12px;
}

.binding-view-modes button.active {
  border-color: #2588d8;
  background: #eaf5ff;
  color: #1269ad;
  font-weight: 600;
}

.binding-platform-group {
  border: 0;
  border-bottom: 1px solid #edf1f5;
  background: #fff;
}

.binding-platform-group > header {
  display: grid;
  grid-template-columns: 18px 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 8px 3px;
  background: #fff;
  color: #168347;
}

.binding-platform-group > header input,
.binding-platform-stores input {
  width: var(--settings-check-size);
  height: var(--settings-check-size);
  min-width: var(--settings-check-size);
  min-height: var(--settings-check-size);
  margin: 0;
  accent-color: var(--blue);
}

.binding-platform-group > header span,
.binding-platform-group > header strong,
.binding-platform-group > header small {
  display: block;
}

.binding-platform-group > header strong {
  font-size: 13px;
  font-weight: 600;
}

.binding-platform-group > header small {
  display: inline;
  margin-left: 7px;
  color: #7a8999;
  font-size: 11px;
  font-weight: 400;
}

.binding-platform-group > header em {
  min-width: 42px;
  padding: 0;
  color: #78889a;
  font-size: 11px;
  font-style: normal;
  text-align: center;
  box-shadow: none;
}

.binding-platform-toggle {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #617c95;
}

.binding-platform-stores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0 20px;
  padding: 3px 12px 10px 34px;
  border-top: 0;
}

.binding-platform-stores .binding-option {
  min-height: 30px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 2px 8px;
  padding: 3px 0;
  border: 0;
  background: transparent;
}

.binding-platform-stores .binding-option input {
  position: static;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.binding-platform-stores .binding-option span {
  grid-column: 2;
  min-width: 0;
  word-break: break-word;
}

.binding-platform-stores .binding-option small {
  grid-column: 2;
  color: #7b8999;
  font-size: 10px;
}

.binding-platform-stores .binding-option:has(input:checked) {
  color: #1769b1;
}

.binding-platform-group.collapsed > .binding-platform-stores {
  display: none;
}

.account-permission-tree {
  max-width: 780px;
}

.account-permission-tree .role-tree-root-head {
  min-height: 60px;
}

.account-permission-tree .role-tree-root-head div strong {
  font-size: 14px;
}

.account-permission-tree .role-tree-root-head div small,
.account-permission-tree .role-tree-root-head > em,
.account-permission-tree .role-tree-row small {
  font-size: 11px;
}

.account-permission-tree .role-tree-root-children > .role-tree-node > .role-tree-row {
  min-height: 40px;
  font-size: 13px;
  font-weight: 600;
}

.account-permission-tree .role-tree-node.depth-1 > .role-tree-row {
  min-height: 34px;
  font-size: 12px;
}

.account-permission-tree input[type="checkbox"] {
  width: var(--settings-check-size);
  height: var(--settings-check-size);
  min-width: var(--settings-check-size);
  min-height: var(--settings-check-size);
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}

.role-permission-workbench {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  width: 100%;
  height: calc(100vh - 190px);
  min-height: 560px;
  flex: 0 0 auto;
  align-self: flex-start;
  overflow: hidden;
  border: 1px solid #cfdbe8;
  background: #fff;
}

.role-selector {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #d8e2ec;
  background: #f5f8fc;
}

.role-selector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid #d8e2ec;
  color: #253c55;
}

.role-selector-head span {
  color: #7b8999;
  font-size: 11px;
}

.role-selector > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid #e1e8f0;
  border-left: 3px solid transparent;
  background: transparent;
  color: #32465d;
  text-align: left;
  cursor: pointer;
}

.role-selector > button:hover {
  background: #eef5fc;
}

.role-selector > button.active {
  border-left-color: #2878c8;
  background: #e7f1fb;
  color: #145f9f;
}

.role-selector > button span,
.role-selector > button strong,
.role-selector > button small {
  display: block;
}

.role-selector > button small {
  margin-top: 4px;
  color: #7b8999;
  font-size: 10px;
}

.role-selector > button em {
  min-width: 28px;
  padding: 3px 6px;
  background: #fff;
  color: #587089;
  font-size: 11px;
  font-style: normal;
  text-align: center;
  box-shadow: inset 0 0 0 1px #d4dfeb;
}

.role-selector-foot {
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid #d8e2ec;
  color: #7a8999;
  font-size: 10px;
  line-height: 1.5;
}

.role-editor-stack {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: #f8fbfe;
}

.role-editor-panel {
  display: none;
  min-height: 0;
}

.role-editor-panel.active {
  display: block;
}

.role-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 92px;
  padding: 16px 20px;
  border-bottom: 1px solid #d8e2ec;
  background: #fff;
}

.role-editor-eyebrow {
  color: #2878c8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.role-editor-head h3 {
  margin: 4px 0 2px;
  color: #173a5d;
  font-size: 20px;
}

.role-editor-head p {
  margin: 0;
  color: #7a8999;
  font-size: 11px;
}

.role-editor-summary {
  min-width: 132px;
  padding-left: 18px;
  border-left: 1px solid #d8e2ec;
  text-align: right;
}

.role-editor-summary span,
.role-editor-summary strong {
  display: block;
}

.role-editor-summary span {
  color: #7a8999;
  font-size: 10px;
}

.role-editor-summary strong {
  margin-top: 3px;
  color: #1769b1;
  font-size: 22px;
}

.role-editor-summary small {
  color: #8492a2;
  font-size: 11px;
}

.role-scope-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.2fr);
  align-items: center;
  gap: 18px;
  margin: 16px 20px 0;
  padding: 14px 16px;
  border-left: 3px solid #2878c8;
  background: #edf5fc;
}

.role-scope-card strong,
.role-scope-card span {
  display: block;
}

.role-scope-card strong {
  color: #203c59;
}

.role-scope-card span {
  margin-top: 4px;
  color: #718196;
  font-size: 11px;
  line-height: 1.45;
}

.role-scope-card .role-scope-input {
  min-height: 36px;
  border-color: #bfcfe0;
}

.role-permission-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 20px 10px;
}

.role-permission-toolbar > div strong,
.role-permission-toolbar > div span {
  display: block;
}

.role-permission-toolbar > div strong {
  color: #203c59;
}

.role-permission-toolbar > div span {
  margin-top: 3px;
  color: #7a8999;
  font-size: 11px;
}

.role-all-permission {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 210px;
  padding: 8px 10px;
  border: 1px solid #c7dbef;
  background: #f3f8fd;
}

.role-all-permission input {
  width: 16px;
  height: 16px;
}

.role-all-permission span,
.role-all-permission strong,
.role-all-permission small {
  display: block;
}

.role-all-permission strong {
  color: #1e4f7d;
  font-size: 12px;
}

.role-all-permission small {
  margin-top: 2px;
  color: #7a8999;
  font-size: 9px;
}

.role-permission-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 1280px;
  padding: 0 20px;
}

.role-permission-tree {
  max-width: 1280px;
  padding: 0 20px;
}

.role-tree-root {
  border: 1px solid #d5e1ec;
  background: #fff;
}

.role-tree-root-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 14px;
  border-bottom: 1px solid #cfdeeb;
  background: #edf5fc;
}

.role-tree-root-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 30px;
  background: #2878c8;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.role-tree-root-head div strong,
.role-tree-root-head div small {
  display: block;
}

.role-tree-root-head div strong {
  color: #1e4264;
  font-size: 13px;
}

.role-tree-root-head div small {
  margin-top: 3px;
  color: #78899a;
  font-size: 10px;
}

.role-tree-root-head > em {
  min-width: 52px;
  padding: 4px 8px;
  background: #fff;
  color: #2878c8;
  font-size: 11px;
  font-style: normal;
  text-align: center;
  box-shadow: inset 0 0 0 1px #c9dbea;
}

.role-tree-root-children {
  position: relative;
  padding: 6px 12px 10px;
}

.role-tree-node {
  position: relative;
}

.role-tree-root-children > .role-tree-node {
  border-bottom: 1px solid #edf1f5;
}

.role-tree-root-children > .role-tree-node:last-child {
  border-bottom: 0;
}

.role-tree-row {
  display: grid;
  grid-template-columns: 18px 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 7px;
  color: #40536a;
  cursor: pointer;
}

.role-tree-root-children > .role-tree-node > .role-tree-row {
  min-height: 38px;
  color: #284864;
  font-size: 12px;
  font-weight: 600;
}

.role-tree-row input {
  width: 15px;
  height: 15px;
  min-width: 15px;
}

.role-tree-row:hover {
  background: #f1f7fd;
}

.role-tree-row:has(input:checked) {
  color: #1765a8;
}

.role-tree-row small {
  color: #8a97a6;
  font-size: 9px;
}

.role-tree-toggle {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #668099;
  line-height: 18px;
  cursor: pointer;
}

.role-tree-spacer {
  width: 18px;
}

.role-tree-children {
  position: relative;
  margin-left: 16px;
  padding-left: 15px;
}

.role-tree-children::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 7px;
  left: 7px;
  border-left: 1px dashed #c9d7e4;
}

.role-tree-node.collapsed > .role-tree-children {
  display: none;
}

.role-tree-node.depth-1 > .role-tree-row {
  min-height: 31px;
  font-size: 11px;
}

.role-tree-node.depth-1 > .role-tree-row::before {
  content: "";
  position: absolute;
  left: -8px;
  width: 10px;
  border-top: 1px dashed #c9d7e4;
}

/* Settings center: 1920x1080 baseline with a stable readable scale. */
.settings-workbench-view {
  width: 100%;
  max-width: none;
  align-self: stretch;
  padding: 10px 8px 12px;
  color: #203247;
  font-family: "Segoe UI Variable", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

.settings-workbench-view > * {
  width: 100%;
  min-width: var(--settings-1920-content-width);
}

.settings-workbench-head {
  min-height: 66px;
  margin-bottom: 10px;
  padding: 12px 16px;
  border-color: #d5dfeb;
}

.settings-workbench-head h2 {
  color: #172f4a;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.settings-workbench-head p {
  max-width: 760px;
  margin-top: 5px;
  color: #708196;
  font-size: 12px;
  line-height: 1.55;
}

.settings-head-mark {
  color: #8b9bad;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.settings-workbench-view .toolbar,
.settings-workbench-view .jst-filter-panel {
  border-color: #d5dfeb;
  background: #f8fafc;
}

.settings-workbench-view .toolbar {
  min-height: 64px;
  padding: 10px 12px;
}

.settings-workbench-view .toolbar label {
  gap: 6px;
  color: #54677d;
  font-size: 12px;
  font-weight: 600;
}

.settings-workbench-view input,
.settings-workbench-view select,
.settings-workbench-view button {
  min-height: 34px;
}

.settings-workbench-view input[type="checkbox"] {
  width: var(--settings-check-size);
  height: var(--settings-check-size);
  min-width: var(--settings-check-size);
  min-height: var(--settings-check-size);
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.settings-workbench-view input[type="radio"] {
  width: var(--settings-radio-size);
  height: var(--settings-radio-size);
  min-width: var(--settings-radio-size);
  min-height: var(--settings-radio-size);
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.settings-workbench-view .business-flow-row input[type="checkbox"] {
  width: var(--settings-switch-width);
  height: var(--settings-switch-height);
  min-width: var(--settings-switch-width);
  min-height: var(--settings-switch-height);
}

.settings-workbench-view .replenishment-toggle-field > input[type="checkbox"],
.settings-workbench-view .setting-control-row > input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
}

.settings-workbench-view input,
.settings-workbench-view select {
  border-color: #cdd8e5;
  color: #21364e;
  background: #fff;
}

.settings-workbench-view input:focus,
.settings-workbench-view select:focus {
  border-color: #3b84c5;
  outline: 2px solid rgba(40, 120, 200, 0.12);
  outline-offset: 0;
}

.settings-workbench-view .summary-data-meta {
  min-height: 32px;
  padding: 6px 10px;
  color: #63758a;
  font-size: 12px;
  line-height: 1.5;
}

.settings-workbench-view .data-table {
  color: #203247;
  font-size: 13px;
}

.settings-workbench-view .data-table thead th {
  height: 40px;
  padding: 8px 10px;
  background: #eef3f8;
  color: #30475f;
  font-size: 12px;
  font-weight: 700;
}

.settings-workbench-view .data-table tbody td {
  height: 46px;
  padding: 7px 10px;
  border-color: #dfe6ee;
}

.settings-workbench-view .data-table tbody tr:nth-child(odd) td {
  background: #fff;
}

.settings-workbench-view .data-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.settings-workbench-view .data-table tbody tr:hover td {
  background: #eef6fd;
}

.settings-workbench-view .compact-button {
  min-height: 32px;
  padding: 0 12px;
}

.settings-workbench-view .link-action {
  min-height: 30px;
  font-size: 13px;
  font-weight: 600;
}

.settings-workbench-view .tag {
  font-size: 12px;
}

.settings-workbench-view .mapping-source-cell small {
  margin-top: 3px;
  color: #7b8b9d;
  font-size: 11px;
}

.settings-workbench-view .store-mapping-input,
.settings-workbench-view .store-mapping-status {
  height: 34px;
  font-size: 13px;
}

.settings-workbench-view .operation-mapping-wrap,
.settings-workbench-view .account-table-wrap {
  border: 1px solid #d5dfeb;
}

.settings-workbench-view .account-filter-panel {
  padding: 10px 12px 0;
}

.settings-workbench-view .account-filter-grid {
  gap: 8px;
}

.settings-workbench-view .account-permission-table input[type="checkbox"] {
  width: var(--settings-check-size);
  height: var(--settings-check-size);
  min-width: var(--settings-check-size);
  min-height: var(--settings-check-size);
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

.settings-workbench-view .account-permission-table th:first-child,
.settings-workbench-view .account-permission-table td:first-child {
  width: 42px;
  min-width: 42px;
  padding-right: 8px;
  padding-left: 8px;
}

.store-group-workbench {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  width: 100%;
  height: calc(100vh - 165px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid #cfdbe8;
  background: #fff;
}

.store-group-sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid #d8e2ec;
  background: #f5f8fc;
}

.store-group-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 15px;
  border-bottom: 1px solid #d8e2ec;
  color: #253c55;
}

.store-group-sidebar-head span {
  color: #7b8999;
  font-size: 12px;
}

.store-group-list {
  min-height: 0;
  overflow: auto;
}

.store-group-list > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid #e1e8f0;
  border-left: 3px solid transparent;
  background: transparent;
  color: #32465d;
  text-align: left;
}

.store-group-list > button:hover {
  background: #eef5fc;
}

.store-group-list > button.active {
  border-left-color: #2878c8;
  background: #e7f1fb;
  color: #145f9f;
}

.store-group-list span,
.store-group-list strong,
.store-group-list small {
  display: block;
}

.store-group-list small {
  margin-top: 4px;
  color: #7b8999;
  font-size: 12px;
}

.store-group-list .store-group-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  line-height: 18px;
}

.store-group-platforms i {
  color: #617990;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.store-group-list > button.active .store-group-platforms i {
  color: #2872b7;
}

.store-group-list em {
  min-width: 30px;
  padding: 3px 6px;
  background: #fff;
  color: #587089;
  font-size: 12px;
  font-style: normal;
  text-align: center;
  box-shadow: inset 0 0 0 1px #d4dfeb;
}

.store-group-sidebar-foot {
  margin-top: auto;
  padding: 11px 14px;
  border-top: 1px solid #d8e2ec;
  color: #7a8999;
  font-size: 12px;
}

.store-group-main {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.store-group-main .operation-mapping-toolbar {
  flex: 0 0 auto;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #d8e2ec;
}

.store-group-main .summary-data-meta {
  flex: 0 0 auto;
  border-bottom: 1px solid #e2e8f0;
}

.store-group-main .operation-mapping-wrap {
  flex: 1 1 auto;
  max-height: none;
  border: 0;
  overflow: auto;
}

.store-display-name {
  color: #1d344c;
  font-weight: 600;
}

.store-platform-name {
  color: #245f96;
}

.store-leader-name {
  color: #244b70;
  font-weight: 600;
}

.mapping-status-tag {
  display: inline-flex;
  align-items: center;
  color: #168347;
  font-size: 13px;
}

.mapping-status-tag::before {
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #19a65a;
  content: "";
}

.mapping-status-tag.off {
  color: #7d8995;
}

.mapping-status-tag.off::before {
  background: #aab4c2;
}

.merch-tree-workbench {
  display: grid;
  grid-template-columns: 210px 220px minmax(0, 1fr);
  width: 100%;
  height: calc(100vh - 165px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid #cfdbe8;
  background: #fff;
}

.supplier-tree-workbench,
.people-tree-workbench {
  display: grid;
  grid-template-columns: 190px 210px minmax(0, 1fr);
  width: 100%;
  height: calc(100vh - 165px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid #cfdbe8;
  background: #fff;
}

.settings-workbench-view > .settings-workbench-head,
.settings-workbench-view > .supplier-tree-workbench,
.settings-workbench-view > .people-tree-workbench,
.settings-workbench-view > .store-group-workbench,
.settings-workbench-view > .merch-tree-workbench,
.settings-workbench-view > .role-permission-workbench {
  width: 100%;
  max-width: none;
}

.people-tree-workbench {
  grid-template-columns: 230px minmax(0, 1fr);
}

.supplier-tree-main {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.supplier-tree-main .mapping-filter-row,
.supplier-tree-main .operation-mapping-toolbar {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #d8e2ec;
}

.supplier-tree-main .summary-data-meta {
  flex: 0 0 auto;
}

.supplier-tree-main .operation-mapping-wrap {
  min-height: 0;
  flex: 1 1 auto;
}

@media (max-width: 1100px) {
  .supplier-tree-workbench,
  .people-tree-workbench {
    grid-template-columns: 165px 175px minmax(680px, 1fr);
    overflow-x: auto;
  }

  .people-tree-workbench {
    grid-template-columns: 190px minmax(680px, 1fr);
  }
}

.merch-tree-column {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid #d8e2ec;
  background: #f5f8fc;
}

.merch-person-column {
  background: #f9fbfd;
}

.merch-tree-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid #d8e2ec;
  color: #253c55;
}

.merch-tree-head span {
  min-width: 28px;
  padding: 3px 6px;
  background: #fff;
  color: #647a91;
  font-size: 12px;
  text-align: center;
  box-shadow: inset 0 0 0 1px #d4dfeb;
}

.merch-tree-list {
  min-height: 0;
  overflow: auto;
}

.merch-tree-list > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  min-height: 58px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid #e1e8f0;
  border-left: 3px solid transparent;
  background: transparent;
  color: #32465d;
  text-align: left;
}

.merch-tree-list > button:hover {
  background: #eef5fc;
}

.merch-tree-list > button.active {
  border-left-color: #2878c8;
  background: #e7f1fb;
  color: #145f9f;
}

.merch-tree-list span,
.merch-tree-list strong,
.merch-tree-list small {
  display: block;
}

.merch-tree-list small {
  margin-top: 3px;
  color: #7b8999;
  font-size: 11px;
}

.merch-tree-list em {
  min-width: 28px;
  color: #587089;
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.merch-tree-main {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.merch-tree-main .operation-mapping-toolbar {
  flex: 0 0 auto;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #d8e2ec;
}

.merch-hidden-filter {
  display: none;
}

.merch-tree-main .summary-data-meta {
  flex: 0 0 auto;
}

.merch-draft-notice {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-top: 1px solid #e7d9b9;
  border-bottom: 1px solid #e7d9b9;
  background: #fff9e9;
  color: #80642c;
  font-size: 12px;
}

.merch-tree-main .operation-mapping-wrap {
  flex: 1 1 auto;
  max-height: none;
  border: 0;
  overflow: auto;
}

.merch-edit-table {
  min-width: 900px;
}

.merch-edit-table th:first-child,
.merch-edit-table td:first-child {
  width: 62px;
}

.merch-edit-table th:nth-child(5),
.merch-edit-table td:nth-child(5) {
  width: 92px;
}

.merch-edit-table th:last-child,
.merch-edit-table td:last-child {
  width: 112px;
}

@media (max-width: 1360px) {
  .merch-tree-workbench {
    grid-template-columns: 190px 200px minmax(0, 1fr);
  }
}

.settings-workbench-view .role-selector-head {
  min-height: 52px;
  padding: 0 16px;
  font-size: 14px;
}

.settings-workbench-view .role-selector-head span,
.settings-workbench-view .role-selector > button small,
.settings-workbench-view .role-selector-foot {
  font-size: 12px;
}

.settings-workbench-view .role-selector > button {
  min-height: 68px;
  padding: 11px 16px;
  font-size: 14px;
}

.settings-workbench-view .role-selector > button em {
  font-size: 12px;
}

.settings-workbench-view .role-editor-eyebrow,
.settings-workbench-view .role-editor-summary span {
  font-size: 11px;
}

.settings-workbench-view .role-editor-head p,
.settings-workbench-view .role-scope-card span,
.settings-workbench-view .role-permission-toolbar > div span,
.settings-workbench-view .role-all-permission small,
.settings-workbench-view .role-tree-root-head div small {
  font-size: 12px;
}

.settings-workbench-view .role-scope-card strong,
.settings-workbench-view .role-permission-toolbar > div strong,
.settings-workbench-view .role-all-permission strong,
.settings-workbench-view .role-tree-root-head div strong {
  font-size: 14px;
}

.settings-workbench-view .role-tree-root-head {
  min-height: 64px;
  padding: 10px 14px;
}

.settings-workbench-view .role-tree-root-children > .role-tree-node > .role-tree-row {
  min-height: 42px;
  font-size: 14px;
}

.settings-workbench-view .role-tree-node.depth-1 > .role-tree-row {
  min-height: 36px;
  font-size: 13px;
}

.settings-workbench-view .role-tree-row small,
.settings-workbench-view .role-tree-root-head > em {
  font-size: 12px;
}

.settings-workbench-view.basic-settings-view {
  gap: 12px;
}

.settings-page-intro {
  flex: 0 0 auto;
}

#sizeOrderSettings .setting-editor {
  width: min(1120px, 100%);
  min-height: 0;
  margin: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-color: #d5dfeb;
  background: #fff;
}

#sizeOrderSettings .setting-editor > strong {
  padding: 13px 16px 4px;
  color: #203a56;
  font-size: 15px;
}

#sizeOrderSettings .setting-editor > span {
  padding: 0 16px 12px;
  color: #718196;
  font-size: 12px;
  line-height: 1.55;
}

#sizeOrderSettings .setting-editor-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e3eaf1;
  background: #f8fafc;
}

#sizeOrderSettings #sizeOrderSettingsCard .setting-editor-row input {
  flex: 1 1 auto;
  height: 36px;
}

#sizeOrderSettings .setting-editor-row button {
  min-width: 140px;
}

#sizeOrderSettings .workflow-code-template-rows,
#sizeOrderSettings .flow-code-rule-wrap {
  width: auto;
  max-width: none;
  margin: 0 16px 14px;
}

#sizeOrderSettings .workflow-code-template-row {
  min-height: 66px;
  padding: 8px 10px;
  border-color: #d9e3ee;
  background: #fbfcfe;
}

#sizeOrderSettings .workflow-code-template-rows {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

#sizeOrderSettings .flow-code-rule-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#sizeOrderSettings .flow-code-rule-table th,
#sizeOrderSettings .flow-code-rule-table td {
  height: 38px;
  padding: 6px 8px;
}

#sizeOrderSettings .flow-code-rule-table th:nth-child(1),
#sizeOrderSettings .flow-code-rule-table td:nth-child(1) {
  width: 18%;
}

#sizeOrderSettings .flow-code-rule-table th:nth-child(2),
#sizeOrderSettings .flow-code-rule-table td:nth-child(2) {
  width: 24%;
}

#sizeOrderSettings .flow-code-rule-table th:nth-child(3),
#sizeOrderSettings .flow-code-rule-table td:nth-child(3) {
  width: 13%;
}

#sizeOrderSettings .flow-code-rule-table th:nth-child(4),
#sizeOrderSettings .flow-code-rule-table td:nth-child(4) {
  width: 27%;
}

#sizeOrderSettings .flow-code-rule-table th:nth-child(5),
#sizeOrderSettings .flow-code-rule-table td:nth-child(5) {
  width: 18%;
}

.settings-workbench-view .business-flow-settings {
  width: min(1240px, 100%);
  max-width: none;
}

.settings-workbench-view .business-flow-card-head {
  padding: 14px 18px;
  background: #f8fafc;
}

.settings-workbench-view .business-flow-card-head strong {
  font-size: 15px;
}

.settings-workbench-view .business-flow-card-head span,
.settings-workbench-view .business-flow-row em {
  font-size: 12px;
}

.settings-workbench-view .business-flow-row {
  min-height: 68px;
  padding: 11px 18px;
}

.settings-workbench-view .business-flow-row strong {
  font-size: 14px;
}

.settings-workbench-view .business-flow-edit {
  min-width: 96px;
}

#replenishmentSettings,
.settings-workbench-view .replenishment-setting-grid {
  width: min(1280px, 100%);
  max-width: none;
}

.settings-workbench-view .table-wrap {
  scrollbar-gutter: stable;
}

.settings-workbench-view .table-wrap .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.settings-workbench-view .operation-mapping-wrap,
.settings-workbench-view .account-table-wrap {
  max-height: calc(100vh - 250px);
  overflow: auto;
}

#summaryAggregationTemplate .table-wrap {
  width: min(1500px, 100%);
  max-height: calc(100vh - 190px);
  overflow: auto;
  border: 1px solid #d5dfeb;
}

#summaryAggregationTemplate .template-table {
  min-width: 1180px;
}

#apiIntegration .api-config-panel {
  width: min(1500px, 100%);
  padding: 0;
}

#apiIntegration .api-workbench {
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100vh - 190px);
}

#apiIntegration .api-source-nav {
  max-height: calc(100vh - 190px);
  overflow: auto;
}

@media (max-width: 1360px) {
  .settings-workbench-view {
    width: 100%;
  }

  #apiIntegration .api-workbench {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

.role-permission-group {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #d7e2ed;
  background: #fff;
}

.role-permission-group legend {
  padding: 0 6px;
  color: #244765;
  font-size: 12px;
  font-weight: 700;
}

.role-permission-group > p {
  margin: 0 0 10px;
  color: #8491a1;
  font-size: 10px;
}

.role-permission-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.role-permission-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #e0e8f0;
  background: #fbfdff;
  color: #40536a;
}

.role-permission-options label:has(input:checked) {
  border-color: #bcd7ef;
  background: #edf6fe;
  color: #1765a8;
}

.role-permission-options input {
  width: 14px;
  height: 14px;
}

.role-permission-options input:disabled + span {
  opacity: 0.7;
}

.role-risk-note {
  display: flex;
  gap: 10px;
  margin: 14px 20px 20px;
  padding: 10px 12px;
  border: 1px solid #eadcbd;
  background: #fffaf0;
  color: #78633d;
  font-size: 11px;
}

.role-risk-note strong {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .role-permission-workbench {
    grid-template-columns: 190px minmax(720px, 1fr);
    width: 100%;
    overflow: auto;
  }
}

.binding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.binding-grid.binding-grid-stores {
  display: block;
}

.binding-option {
  justify-content: flex-start;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  position: relative;
  padding-left: 30px;
}

.binding-option input {
  position: absolute;
  left: 9px;
  top: 8px;
}

.binding-option span {
  color: #1f324a;
  line-height: 1.35;
}

.binding-option small {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .settings-home,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-groups {
    grid-template-columns: 1fr;
  }

  .import-form {
    grid-template-columns: 1fr;
  }
}

#customPreviewTable {
  min-width: 900px;
}

.segmented {
  display: inline-flex;
}

.segmented button {
  border-right: 0;
}

.segmented button:last-child {
  border-right: 1px solid var(--line);
}

.segmented button.active {
  background: #e8f3ff;
  color: var(--blue);
  border-color: #91c5ff;
}

.table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  width: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  flex: 1 1 auto;
  overflow: auto;
  max-height: none;
}

.table-wrap.compact {
  flex: 0 1 360px;
  max-height: 360px;
}

.style-archive-wrap table {
  min-width: 1500px;
}

.style-archive-colors {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.style-archive-detail-wrap {
  max-height: 520px;
}

.compact-btn {
  min-width: 52px;
  padding: 4px 8px;
}

.strong-num {
  font-weight: 700;
  color: var(--text);
}

.muted-cell {
  color: var(--muted);
  text-align: center;
}

.table-wrap.factory-production-wrap {
  flex: 1 1 auto;
  height: auto;
  max-height: none;
  min-height: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 2200px;
}

th,
td {
  border-right: 1px solid #e7ebf1;
  border-bottom: 1px solid #e7ebf1;
  padding: 7px 8px;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3f6fa;
  color: #445063;
  font-weight: 600;
}

.tiny-col {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  padding-left: 4px;
  padding-right: 4px;
}

.mini-expand-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #c8d6e6;
  background: #fff;
  color: var(--blue);
  line-height: 20px;
  font-weight: 700;
}

.mini-expand-btn:hover {
  background: #eef6ff;
}

.group-summary-row td {
  background: #fff9e8;
  font-weight: 600;
}

.drill-child-row td {
  background: #f8fbff;
}

.sticky-left {
  position: sticky;
  left: 0;
  z-index: 3;
  background: inherit;
}

.select-col {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

.select-col input {
  min-width: 0;
  width: 14px;
  height: 14px;
}

th.sticky-left {
  z-index: 4;
  background: #f3f6fa;
}

tbody tr:nth-child(odd) {
  background: var(--row);
}

tbody tr:nth-child(even) {
  background: var(--row-alt);
}

tbody tr:hover {
  background: #eaf4ff;
}

.num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.linklike {
  color: var(--blue);
  cursor: pointer;
  font-weight: 600;
}

.summary-arrival-toggle {
  min-width: 18px;
  height: 18px;
  margin-right: 4px;
  padding: 0 4px;
  border: 1px solid #b9c9df;
  background: #f5f9ff;
  line-height: 16px;
}

.summary-arrival-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px;
}

.summary-arrival-flow-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #d8e2ef;
  background: #fff;
  color: #25364d;
  font-variant-numeric: tabular-nums;
}

.summary-arrival-flow-item b {
  font-weight: 700;
}

.scoped-metric-cell {
  line-height: 1.25;
}

.scoped-main {
  display: block;
}

.scoped-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  margin-right: 4px;
  background: #edf2f7;
  color: #42526a;
  border: 1px solid #d6dee9;
}

.tag.warn {
  background: #fff4dc;
  border-color: #f5c66b;
  color: #875c00;
}

.tag.danger {
  background: #ffe8e8;
  border-color: #ffb8b8;
  color: #a83232;
}

.tag.good {
  background: #e6f6ee;
  border-color: #a8dfc0;
  color: #176b42;
}

.production-mini-badge {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  border: 1px solid #d6dee9;
  background: #f3f6fa;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  vertical-align: middle;
}

.replenish-badge {
  border-color: #f5c66b;
  background: #fff7e6;
  color: #9a6700;
}

.consult-badge {
  border-color: #bcdcff;
  background: #edf6ff;
  color: #0969b7;
}

.ready-date-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
}

.ready-date-cell em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
}

.ready-source-tag {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid #d8e2ee;
  background: #f4f7fb;
  color: #6b7a8d;
  font-size: 11px;
  line-height: 1.2;
}

.detail-section + .detail-section {
  margin-top: 14px;
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 6px;
  color: var(--ink);
}

.detail-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.qty-input {
  width: 90px;
  min-width: 90px;
  text-align: right;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.drawer {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(1180px, calc(100vw - 80px));
  height: min(840px, calc(100vh - 60px));
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 46px rgba(21, 34, 50, 0.22);
  transform: translate(-50%, -50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.store-operator-edit-panel {
  width: min(680px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
}

.store-operator-edit-form {
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 0;
}

.store-operator-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.store-operator-form-grid label,
.store-operator-form-grid label > span {
  display: block;
}

.store-operator-form-grid label > span {
  margin-bottom: 7px;
  color: #31465c;
  font-size: 13px;
  font-weight: 600;
}

.store-operator-form-grid label > span b {
  color: #d14343;
  font-weight: 500;
}

.store-operator-form-grid input,
.store-operator-form-grid select {
  width: 100%;
  height: 36px;
  border: 1px solid #c9d6e4;
  background: #fff;
  color: #172d45;
  font-size: 13px;
}

.store-operator-form-grid input:focus,
.store-operator-form-grid select:focus {
  border-color: #2878c8;
  outline: 2px solid rgba(40, 120, 200, 0.12);
}

.store-operator-form-wide {
  grid-column: 1 / -1;
}

.supplier-edit-panel {
  width: min(760px, calc(100vw - 40px));
}

.supplier-form-wide {
  grid-column: 1 / -1;
}

.edit-status-switch {
  display: inline-flex !important;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  cursor: pointer;
}

.edit-status-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.edit-status-switch i {
  position: relative;
  display: block;
  width: 34px;
  height: 20px;
  border: 1px solid #aab8c7;
  border-radius: 10px;
  background: #c4ced9;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.edit-status-switch i::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 51, 72, 0.28);
  content: "";
  transition: transform 0.15s ease;
}

.edit-status-switch input:checked + i {
  border-color: #1677d2;
  background: #1677d2;
}

.edit-status-switch input:checked + i::after {
  transform: translateX(14px);
}

.edit-status-switch input:focus-visible + i {
  outline: 2px solid rgba(40, 120, 200, 0.28);
  outline-offset: 2px;
}

.edit-status-switch strong {
  color: #31465c;
  font-size: 13px;
  font-weight: 600;
}

.store-operator-modal-actions {
  justify-content: space-between;
  margin: 20px -20px 0;
}

.store-operator-modal-actions > div {
  display: flex;
  gap: 8px;
}

@media (max-width: 720px) {
  .store-operator-form-grid {
    grid-template-columns: 1fr;
  }

  .store-operator-form-wide {
    grid-column: auto;
  }

  .supplier-form-wide {
    grid-column: auto;
  }
}

.drawer-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  margin: 0;
  font-size: 16px;
}

.drawer-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.icon-btn {
  width: 30px;
  padding: 0;
  font-size: 20px;
}

.drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.drawer-tabs button {
  border: 0;
  border-right: 1px solid var(--line);
  min-width: 88px;
}

.drawer-tabs button.active {
  color: var(--blue);
  background: #eef6ff;
}

.drawer.inventory-only .drawer-tabs {
  display: none;
}

.drawer.inventory-only {
  width: min(1420px, calc(100vw - 64px));
  height: auto;
  max-height: calc(100vh - 80px);
}

.drawer.inventory-only .drawer-head {
  min-height: 56px;
  padding: 8px 12px;
}

.drawer.inventory-only .drawer-content {
  max-height: calc(100vh - 138px);
  padding: 8px;
}

.drawer.inventory-only .drawer-metric-grid {
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 5px;
}

.drawer.inventory-only .drawer-metric-card {
  min-height: 52px;
  padding: 6px 8px;
}

.drawer.inventory-only .modal-table-wrap {
  overflow-x: auto;
}

.drawer.inventory-only .modal-table-wrap table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
  font-size: 10.5px;
}

.drawer.inventory-only .modal-table-wrap th,
.drawer.inventory-only .modal-table-wrap td {
  min-width: 0;
  height: 30px;
  padding: 3px 4px;
  line-height: 1.15;
  white-space: nowrap;
}

.drawer.inventory-only .modal-table-wrap th {
  white-space: normal;
}

.drawer.inventory-only .modal-table-wrap th:nth-child(11),
.drawer.inventory-only .modal-table-wrap td:nth-child(11) {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  text-align: center;
}

.drawer.inventory-only .modal-table-wrap td:nth-child(11) .return-rate-stack {
  min-width: 0;
  margin: 0 auto;
  justify-items: center;
}

.drawer.inventory-only .modal-table-wrap td:nth-child(11) .return-rate-line {
  grid-template-columns: 18px 48px;
  justify-content: center;
  text-align: center;
}

.drawer.inventory-only .summary-thumb,
.drawer.inventory-only .summary-image-btn {
  width: 34px;
  height: 42px;
}

.inventory-size-balance-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 6px 0;
  padding: 6px 10px;
  border: 1px solid #c9dfcf;
  background: #f3faf5;
  color: #315b3c;
  font-size: 11px;
}

.inventory-size-balance-summary strong {
  flex: 0 0 auto;
  font-size: 12px;
}

.inventory-size-balance-summary.shortage {
  border-color: #ffaaa5;
  background: #fff1f0;
  color: #b42323;
}

.inventory-size-balance-summary.excess {
  border-color: #efc078;
  background: #fff7e8;
  color: #9a5a00;
}

.inventory-size-balance-summary.neutral {
  border-color: #d4dde8;
  background: #f6f8fb;
  color: #65768b;
}

.drawer.inventory-only .modal-table-wrap th.inventory-size-balance-cell,
.drawer.inventory-only .modal-table-wrap td.inventory-size-balance-cell {
  width: 130px;
  min-width: 130px;
  max-width: 130px;
  white-space: normal;
  text-align: center;
}

.inventory-size-balance-cell strong,
.inventory-size-balance-cell small {
  display: flex;
  align-items: center;
  justify-content: center;
}

.inventory-size-balance-cell strong {
  gap: 6px;
  font-size: 11px;
}

.inventory-size-balance-cell strong b {
  color: #8090a3;
  font-weight: 500;
}

.inventory-size-balance-cell small {
  margin-top: 2px;
  color: inherit;
  font-size: 9.5px;
  font-weight: 600;
}

.drawer.inventory-only .modal-table-wrap td.inventory-size-balance-cell.shortage {
  box-shadow: inset 3px 0 #e43b36;
  background: #fff0ef !important;
  color: #bd2925;
}

.drawer.inventory-only .modal-table-wrap td.inventory-size-balance-cell.excess {
  box-shadow: inset 3px 0 #e79a24;
  background: #fff6e6 !important;
  color: #9a5a00;
}

.drawer.inventory-only .modal-table-wrap td.inventory-size-balance-cell.insufficient,
.drawer.inventory-only .modal-table-wrap td.inventory-size-balance-cell.disabled,
.drawer.inventory-only .modal-table-wrap td.inventory-size-balance-cell.neutral {
  background: #f5f7fa !important;
  color: #7b8796;
}

.drawer-content {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px;
}

.drawer-content table {
  min-width: 920px;
}

.drawer-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text);
}

.drawer-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.drawer-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.drawer-metric-card {
  min-height: 58px;
  border: 1px solid #cfe3ff;
  background: #f4f9ff;
  padding: 8px 10px;
}

.drawer-metric-card span,
.drawer-metric-card em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.drawer-metric-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
}

.drawer-plan-panel {
  border: 1px solid #cfe3ff;
  background: #f4f9ff;
  padding: 10px;
  margin-bottom: 10px;
}

.drawer-plan-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.drawer-plan-head span {
  color: var(--muted);
  font-size: 12px;
}

.drawer-plan-button {
  height: 28px;
  width: 120px;
}

.share-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: right;
}

.share-link:hover {
  text-decoration: underline;
}

.share-link.warn {
  color: #b26a00;
  font-weight: 700;
}

.style-log-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
  min-height: 0;
  max-height: calc(100vh - 150px);
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.style-log-item {
  min-width: 0;
  border: 1px solid #dbe3ee;
  border-left: 4px solid #9fb4cc;
  background: #fff;
  padding: 10px 12px;
}

.style-log-item.good {
  border-left-color: #2f9e62;
}

.style-log-item.warn {
  border-left-color: #e6a23c;
}

.style-log-item.danger {
  border-left-color: #e35252;
}

.style-log-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.style-log-category,
.style-log-status {
  color: #6b778c;
  font-size: 12px;
}

.style-log-status {
  margin-left: auto;
}

@media (max-width: 900px) {
  .style-log-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.style-log-message {
  margin-top: 6px;
  line-height: 1.5;
}

.style-dynamics-shell {
  min-height: 0;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: #f5f8fc;
}

.style-dynamic-section {
  padding: 16px;
}

.style-dynamic-section + .style-dynamic-section {
  border-top: 1px solid #d9e3ef;
}

.style-dynamic-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.style-dynamic-section-head > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.style-dynamic-section-head span {
  color: #2878c8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.style-dynamic-section-head h3 {
  margin: 0;
  color: #17324f;
  font-size: 16px;
}

.style-dynamic-section-head p {
  margin: 0;
  color: #738196;
  font-size: 12px;
}

.style-dynamic-table-wrap {
  overflow-x: auto;
  border: 1px solid #cfdbe8;
  background: #fff;
}

.style-dynamic-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
}

.style-dynamic-table th {
  height: 34px;
  padding: 0 12px;
  border-right: 1px solid #dce5ef;
  border-bottom: 1px solid #cbd8e6;
  background: #edf4fb;
  color: #556579;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.style-dynamic-table th:first-child {
  width: 132px;
}

.style-dynamic-table th:last-child {
  width: 150px;
  border-right: 0;
}

.style-dynamic-main-row > td {
  min-height: 112px;
  padding: 12px;
  border-right: 1px solid #e2e9f1;
  border-bottom: 1px solid #d6e0eb;
  vertical-align: top;
}

.style-dynamic-main-row > td:last-child {
  border-right: 0;
}

.style-dynamic-order {
  background: #f8fbfe;
}

.style-dynamic-order strong,
.style-dynamic-order span,
.style-dynamic-order small {
  display: block;
}

.style-dynamic-order strong {
  color: #16395e;
  font-size: 14px;
}

.style-dynamic-order span {
  margin-top: 9px;
  color: #26384b;
  font-weight: 700;
}

.style-dynamic-order small {
  margin-top: 4px;
  color: #7b899a;
  line-height: 1.4;
}

.style-dynamic-stage {
  position: relative;
  background: #fff;
}

.style-dynamic-stage::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #c8d4e1;
}

.style-dynamic-stage.done::before {
  background: #398866;
}

.style-dynamic-stage.active::before {
  background: #2878c8;
}

.style-dynamic-stage-label {
  color: #7a899b;
  font-size: 11px;
}

.style-dynamic-stage-date {
  margin-top: 7px;
  color: #1f3853;
  font-size: 13px;
  font-weight: 700;
}

.style-dynamic-stage-value {
  min-height: 32px;
  margin-top: 5px;
  color: #42546a;
  font-size: 12px;
  line-height: 1.35;
}

.style-dynamic-stage-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: #2878c8;
  font-size: 11px;
}

.style-dynamic-stage-action.muted {
  color: #a0aaba;
}

.style-dynamic-status {
  background: #f8fbfe;
}

.style-dynamic-status > span {
  display: inline-block;
  padding: 3px 7px;
  background: #e5f0fb;
  color: #1765ad;
  font-size: 11px;
  font-weight: 700;
}

.style-dynamic-status strong {
  display: block;
  margin-top: 10px;
  color: #26384b;
  font-size: 12px;
}

.style-dynamic-progress {
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
  background: #dfe7ef;
}

.style-dynamic-progress i {
  display: block;
  height: 100%;
  background: #2878c8;
}

.style-dynamic-flow-row td {
  padding: 0;
  border-bottom: 1px solid #d6e0eb;
  background: #f8fbfe;
}

.style-dynamic-flow-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  padding: 10px 12px;
  background: #dce5ef;
}

.style-dynamic-flow-item {
  display: grid;
  grid-template-columns: 92px minmax(160px, 0.7fr) minmax(220px, 1.3fr);
  align-items: center;
  gap: 6px 14px;
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  background: #fff;
}

.style-dynamic-flow-item strong {
  color: #26384b;
  font-size: 12px;
}

.style-dynamic-flow-item > span:last-child {
  grid-column: 3;
  color: #7b899a;
  font-size: 11px;
}

.style-dynamic-flow-date {
  grid-row: auto;
  color: #2878c8;
  font-size: 11px;
  font-weight: 700;
}

.style-dynamic-flow-empty {
  padding: 10px 12px;
  background: #fff;
  color: #8a97a7;
  font-size: 12px;
}

/* Style dynamics: light production command track */
.style-dynamic-command-list {
  display: grid;
  gap: 12px;
}

.style-dynamic-command-card {
  overflow: hidden;
  border: 1px solid #cbd9e8;
  background: #fff;
  box-shadow: 0 8px 22px rgba(34, 73, 112, 0.07);
}

.style-dynamic-command-head {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px minmax(280px, 1.35fr);
  align-items: stretch;
  min-height: 74px;
  border-bottom: 1px solid #dbe5ef;
  background: linear-gradient(90deg, #f8fbfe 0%, #fff 62%);
}

.style-dynamic-batch,
.style-dynamic-command-metric,
.style-dynamic-command-progress {
  padding: 12px 16px;
}

.style-dynamic-batch,
.style-dynamic-command-metric {
  border-right: 1px solid #e1e9f1;
}

.style-dynamic-batch > span,
.style-dynamic-command-metric > span {
  display: block;
  color: #7a899a;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.style-dynamic-batch strong {
  display: block;
  margin-top: 4px;
  color: #153b62;
  font-size: 16px;
  letter-spacing: 0.03em;
}

.style-dynamic-batch small {
  display: block;
  margin-top: 2px;
  color: #8996a5;
  font-size: 10px;
}

.style-dynamic-command-metric strong {
  display: block;
  margin-top: 4px;
  color: #17324f;
  font-size: 21px;
  line-height: 1;
}

.style-dynamic-command-metric strong small {
  margin-left: 3px;
  color: #728196;
  font-size: 11px;
}

.style-dynamic-command-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.style-dynamic-command-progress > div:first-child > strong {
  color: #1767b0;
  font-size: 17px;
}

.style-dynamic-status-tag {
  padding: 3px 8px;
  border-left: 3px solid #2878c8;
  background: #eaf3fb;
  color: #1765ad;
  font-size: 11px;
  font-weight: 700;
}

.style-dynamic-command-progress .style-dynamic-progress {
  margin-top: 8px;
}

.style-dynamic-command-progress > small {
  display: block;
  margin-top: 5px;
  color: #6f7f92;
  font-size: 10px;
  text-align: right;
}

.style-dynamic-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  min-width: 820px;
  padding: 18px 20px 14px;
}

.style-dynamic-track::before {
  content: "";
  position: absolute;
  top: 29px;
  left: calc(10% + 20px);
  right: calc(10% + 20px);
  height: 2px;
  background: #cfdae6;
}

.style-dynamic-track .style-dynamic-stage {
  position: relative;
  min-width: 0;
  padding: 27px 14px 0;
  text-align: center;
}

.style-dynamic-track .style-dynamic-stage::before {
  display: none;
}

.style-dynamic-node {
  position: absolute;
  z-index: 1;
  top: 3px;
  left: 50%;
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  background: #bcc9d6;
  box-shadow: 0 0 0 2px #bcc9d6;
  transform: translateX(-50%);
}

.style-dynamic-stage.done .style-dynamic-node {
  background: #398866;
  box-shadow: 0 0 0 2px #398866;
}

.style-dynamic-stage.active .style-dynamic-node {
  background: #2878c8;
  box-shadow: 0 0 0 2px #2878c8, 0 0 0 7px rgba(40, 120, 200, 0.11);
  animation: styleDynamicPulse 2.4s ease-in-out infinite;
}

@keyframes styleDynamicPulse {
  0%, 100% { box-shadow: 0 0 0 2px #2878c8, 0 0 0 5px rgba(40, 120, 200, 0.08); }
  50% { box-shadow: 0 0 0 2px #2878c8, 0 0 0 9px rgba(40, 120, 200, 0.16); }
}

.style-dynamic-track .style-dynamic-stage-label {
  color: #708196;
  font-size: 11px;
}

.style-dynamic-track .style-dynamic-stage-date {
  margin-top: 5px;
  color: #17324f;
  font-size: 13px;
}

.style-dynamic-track .style-dynamic-stage-value {
  min-height: 18px;
  margin-top: 3px;
  color: #4f6175;
  font-size: 11px;
}

.style-dynamic-stage-note {
  min-height: 16px;
  margin-top: 2px;
  color: #7a899b;
  font-size: 10px;
  white-space: nowrap;
}

.style-dynamic-track .style-dynamic-stage-action {
  justify-content: center;
  min-height: 23px;
  margin-top: 7px;
}

.style-dynamic-stage-action button {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: #2878c8;
  font: inherit;
  cursor: pointer;
}

.style-dynamic-stage-action button:hover {
  border-bottom-color: currentColor;
}

.style-dynamic-flow-row {
  border-top: 1px solid #dbe5ef;
  background: #f5f9fd;
}

@media (prefers-reduced-motion: reduce) {
  .style-dynamic-stage.active .style-dynamic-node {
    animation: none;
  }
}

@media (max-width: 900px) {
  .style-dynamic-command-head {
    grid-template-columns: 1fr 120px;
  }

  .style-dynamic-command-progress {
    grid-column: 1 / -1;
    border-top: 1px solid #e1e9f1;
  }

  .style-dynamic-command-card {
    overflow-x: auto;
  }
}

.style-anomaly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.style-anomaly-item {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #d6e0eb;
  border-left: 3px solid #8ba5c0;
  background: #fff;
}

.style-anomaly-item.warn {
  border-left-color: #d28b22;
}

.style-anomaly-item.danger {
  border-left-color: #cc4b4b;
}

.style-anomaly-item.good {
  border-left-color: #398866;
}

.style-anomaly-item > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #78879a;
  font-size: 11px;
}

.style-anomaly-item strong {
  display: block;
  margin-top: 6px;
  color: #26384b;
  font-size: 13px;
}

.style-anomaly-item p {
  margin: 5px 0 0;
  color: #5d6d80;
  font-size: 12px;
  line-height: 1.45;
}

.style-dynamic-loading,
.style-dynamic-empty {
  padding: 28px 16px;
  border: 1px solid #d6e0eb;
  background: #fff;
  color: #718196;
  text-align: center;
}

.style-dynamic-empty strong,
.style-dynamic-empty span {
  display: block;
}

.style-dynamic-empty strong {
  color: #34475d;
}

.style-dynamic-empty span {
  margin-top: 5px;
  font-size: 12px;
}

.style-dynamic-empty.compact {
  padding: 18px 16px;
}

@media (max-width: 900px) {
  .style-dynamic-section {
    padding: 12px;
  }

  .style-dynamic-section-head {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .style-anomaly-grid,
  .style-dynamic-flow-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.style-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  color: #7a869a;
  font-size: 12px;
}

.log-guide {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid #d7e5f7;
  background: #f7fbff;
  color: #526174;
  line-height: 1.5;
}

.log-guide strong {
  flex: 0 0 auto;
  color: #1f334a;
}

.log-guide span {
  min-width: 0;
}

.log-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.log-guide-grid div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 30, 45, 0.22);
}

.modal-panel {
  width: min(1280px, calc(100vw - 40px));
  max-height: min(820px, calc(100vh - 40px));
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(21, 34, 50, 0.2);
  display: flex;
  flex-direction: column;
}

.modal-head {
  min-height: 64px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h2 {
  margin: 0;
  font-size: 16px;
}

.import-target-name {
  display: inline-flex;
  align-items: center;
  max-width: min(620px, calc(100vw - 180px));
  margin-top: 5px;
  padding: 3px 8px;
  border: 1px solid #cfe3ff;
  background: #f4f9ff;
  color: #0b64c0;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.modal-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.modal-body table {
  min-width: 1100px;
}

.table-wrap.modal-table-wrap {
  flex: 1 1 auto;
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.image-preview-wrap {
  width: min(820px, calc(100vw - 90px));
  min-height: min(820px, calc(100vh - 180px));
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f8fb;
}

.image-preview-large {
  width: 800px;
  height: 800px;
  max-width: calc(100vw - 110px);
  max-height: calc(100vh - 200px);
  object-fit: contain;
  background: #fff;
}

.import-modal-panel {
  width: min(900px, calc(100vw - 64px));
  max-width: none;
  max-height: calc(100vh - 64px);
}

.import-modal-panel .modal-body {
  overflow-y: auto;
}

.import-modal-panel .modal-body table {
  min-width: 0;
  width: 100%;
}

.import-modal-panel .import-template-box {
  max-height: min(360px, calc(100vh - 390px));
  overflow: auto;
}

.plan-audit-import-panel {
  width: min(900px, calc(100vw - 72px));
  max-width: none;
}

.plan-workflow-import-panel {
  width: min(820px, calc(100vw - 72px));
  max-width: none;
}

.plan-workflow-import-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.plan-workflow-import-grid .import-rule-group {
  margin: 0;
}

.plan-workflow-import-grid .import-rule-group:last-child {
  grid-column: 1 / -1;
}

.plan-workflow-rule-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 0 0 16px;
  color: #31445c;
  font-size: 13px;
  line-height: 1.5;
}

.plan-workflow-rule-list li {
  padding-left: 2px;
}

.plan-modal-panel {
  max-width: 880px;
}

.plan-inline-edit-panel {
  width: min(860px, calc(100vw - 72px));
  max-width: none;
  border: 1px solid #d7e1ee;
  box-shadow: 0 18px 44px rgba(21, 38, 64, 0.18);
}

.plan-inline-edit-panel .modal-body {
  gap: 14px;
  overflow: visible;
  padding: 16px;
  background: #fbfcfe;
}

.plan-inline-edit-context {
  min-height: 34px;
  padding: 9px 11px;
  border: 1px solid #dce7f3;
  border-left: 3px solid #7db3ff;
  background: #f7fbff;
  color: #2f4058;
  font-size: 12px;
  line-height: 1.5;
}

.plan-inline-edit-detail:empty {
  display: none;
}

.plan-cut-ratio-card {
  border: 1px solid #dbe6f2;
  background: #fff;
}

.plan-cut-ratio-order {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid #e2eaf4;
  background: #fbfdff;
}

.plan-cut-ratio-order span {
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid #edf2f7;
  color: #26374d;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-cut-ratio-order span:last-child {
  border-right: 0;
}

.plan-cut-ratio-order strong {
  display: block;
  margin-bottom: 3px;
  color: #7a8797;
  font-size: 11px;
  font-weight: 500;
}

.plan-cut-ratio-table-wrap {
  overflow-x: hidden;
}

.plan-cut-ratio-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.plan-inline-edit-panel .modal-body .plan-cut-ratio-table {
  min-width: 0;
}

.plan-cut-ratio-table th,
.plan-cut-ratio-table td {
  height: 28px;
  border: 1px solid #e4ebf4;
  padding: 4px 6px;
  text-align: center;
  white-space: nowrap;
}

.plan-cut-ratio-table thead th {
  background: #f1f5fa;
  color: #1f3350;
  font-weight: 600;
}

.plan-cut-ratio-table tbody th {
  width: 126px;
  background: #fbfcfe;
  color: #31445c;
  text-align: right;
  font-weight: 500;
}

.plan-cut-ratio-table tbody td {
  color: #1f2f46;
}

.plan-inline-edit-field {
  display: grid;
  gap: 7px;
  color: #24364b;
  font-size: 13px;
  font-weight: 600;
}

.plan-inline-edit-field input {
  width: 100%;
  height: 36px;
  border: 1px solid #cbd8e8;
  background: #fff;
  padding: 0 11px;
  color: #1f2f46;
  font: inherit;
  font-weight: 400;
}

.plan-inline-edit-field input:focus {
  outline: none;
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.12);
}

.plan-inline-edit-note {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #e4ebf4;
  background: #fff;
  color: #68778d;
  font-size: 12px;
  line-height: 1.6;
}

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

.plan-edit-grid label {
  display: grid;
  gap: 6px;
  color: #24364b;
  font-size: 12px;
  font-weight: 600;
}

.plan-edit-grid input,
.plan-edit-grid textarea {
  width: 100%;
  border: 1px solid #cbd8e8;
  background: #fff;
  padding: 8px 10px;
  color: #1f2f46;
  font: inherit;
  font-weight: 400;
}

.plan-edit-grid textarea {
  min-height: 72px;
  resize: vertical;
}

.plan-edit-grid .plan-edit-wide {
  grid-column: 1 / -1;
}

.plan-inline-edit-panel .modal-actions {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid #e2e9f2;
}

.plan-inline-edit-panel .modal-actions button {
  min-width: 74px;
  height: 30px;
}

.production-task-entry-drawer {
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(18, 30, 45, 0.2);
}

.production-task-entry-panel {
  width: min(760px, calc(100vw - 96px));
  max-width: none;
  height: 100vh;
  max-height: none;
  border: 1px solid #d7e1ee;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  box-shadow: -18px 0 40px rgba(21, 38, 64, 0.18);
}

.production-task-entry-panel .modal-body {
  gap: 10px;
  overflow: auto;
  padding: 12px;
  background: #fbfcfe;
}

.production-task-entry-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #dbe6f2;
  background: #fff;
}

.production-task-entry-summary span {
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
  color: #23354c;
  font-size: 12px;
  line-height: 1.35;
}

.production-task-entry-summary span:nth-child(3n),
.production-task-entry-summary span:last-child {
  border-right: 0;
}

.production-task-entry-summary em {
  display: block;
  margin-bottom: 3px;
  color: #7a8797;
  font-style: normal;
  font-weight: 500;
}

.production-task-entry-summary strong {
  display: block;
  min-height: 16px;
  overflow: hidden;
  color: #172b45;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-task-entry-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.production-task-entry-form label,
.production-task-entry-note,
.production-task-upload {
  display: grid;
  gap: 6px;
  color: #24364b;
  font-size: 12px;
  font-weight: 600;
}

.production-task-entry-form select,
.production-task-entry-form input,
.production-task-entry-note textarea,
.production-task-upload input {
  width: 100%;
  border: 1px solid #cbd8e8;
  background: #fff;
  color: #1f2f46;
  font: inherit;
  font-weight: 400;
}

.production-task-entry-form select,
.production-task-entry-form input,
.production-task-upload input {
  height: 32px;
  padding: 0 9px;
}

.production-task-entry-form select:focus,
.production-task-entry-form input:focus,
.production-task-entry-note textarea:focus,
.production-task-upload input:focus {
  outline: none;
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

.production-task-entry-section {
  border: 1px solid #dbe6f2;
  background: #fff;
}

.production-task-entry-title {
  min-height: 34px;
  padding: 8px 10px;
  border-bottom: 1px solid #e4ebf4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #68778d;
  font-size: 12px;
}

.production-task-entry-title strong {
  color: #172b45;
  font-size: 13px;
}

.production-task-entry-table-wrap {
  max-height: 190px;
  overflow: auto;
}

.production-task-entry-table,
.production-task-summary-table {
  width: 100%;
  min-width: 0 !important;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.production-task-entry-table th,
.production-task-entry-table td,
.production-task-summary-table th,
.production-task-summary-table td {
  height: 31px;
  border: 1px solid #e4ebf4;
  padding: 4px 7px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.production-task-entry-table thead th,
.production-task-summary-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5fa;
  color: #1f3350;
  font-weight: 600;
}

.production-task-entry-table input {
  width: 104px;
  height: 26px;
  border: 1px solid #cbd8e8;
  background: #fff;
  padding: 0 8px;
  text-align: center;
}

.production-task-summary-table tfoot td {
  background: #f7f9fc;
  color: #172b45;
  font-weight: 700;
}

.production-task-entry-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.9fr);
  gap: 10px;
}

.production-task-entry-note textarea {
  min-height: 64px;
  resize: vertical;
  padding: 8px 10px;
}

.production-task-upload {
  align-content: start;
  min-height: 64px;
  padding: 10px;
  border: 1px dashed #b9cbe1;
  background: #f7fbff;
}

.production-task-upload em {
  color: #7d8ba0;
  font-style: normal;
  font-weight: 400;
}

.production-task-entry-panel .modal-actions {
  position: sticky;
  bottom: 0;
  margin-top: 0;
  margin-right: -12px;
  margin-bottom: -12px;
  margin-left: -12px;
  padding: 10px 12px;
  border-top: 1px solid #e2e9f2;
  background: #fbfcfe;
  z-index: 3;
}

.production-task-entry-panel .modal-actions button {
  min-width: 74px;
  height: 30px;
}

.batch-plan-modal-panel {
  width: min(1180px, calc(100vw - 80px));
  max-width: none;
}

.batch-plan-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
}

.batch-plan-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.batch-plan-toolbar input {
  width: 160px;
  height: 28px;
  border: 1px solid #cfd7e3;
  padding: 0 8px;
}

.batch-plan-rows {
  max-height: 58vh;
  overflow: auto;
  border: 1px solid var(--line);
}

.batch-plan-table th,
.batch-plan-table td {
  white-space: nowrap;
}

.batch-plan-table .batch-plan-qty {
  width: 86px;
  height: 28px;
  border: 1px solid #cfd7e3;
  padding: 0 6px;
}

.batch-plan-table .batch-plan-reason {
  width: 360px;
  min-height: 46px;
  border: 1px solid #cfd7e3;
  padding: 5px 6px;
  resize: vertical;
  font: inherit;
  white-space: normal;
}

.batch-price-modal-panel {
  width: min(1180px, calc(100vw - 80px));
  max-width: none;
}

.batch-price-toolbar {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.batch-price-rows {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--line);
}

.batch-price-table {
  min-width: 1040px !important;
}

.batch-price-table th,
.batch-price-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.batch-price-table select,
.batch-price-table input[type="number"] {
  width: 100%;
  min-width: 118px;
  height: 30px;
  border: 1px solid #cfd7e3;
  padding: 0 8px;
  background: #fff;
}

.batch-price-table select {
  min-width: 190px;
}

.batch-price-save-cell {
  text-align: center;
}

.batch-price-save-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.product-price-table {
  min-width: 1940px;
}

.product-price-table.price-review-mode {
  min-width: 1480px;
}

.product-price-filter-grid {
  grid-template-columns: 240px 150px 110px 130px minmax(460px, 1fr) !important;
}

.product-price-table th,
.product-price-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.product-price-table th:nth-child(1),
.product-price-table td:nth-child(1) {
  min-width: 126px;
}

.product-price-table th:nth-child(2),
.product-price-table td:nth-child(2) {
  min-width: 150px;
  white-space: normal;
}

.product-price-table th:last-child,
.product-price-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 4;
  width: 72px;
  min-width: 72px;
  background: inherit;
  box-shadow: -1px 0 0 var(--line);
}

.product-price-table thead th:last-child {
  z-index: 7;
  background: var(--erp-head, #edf3fa);
}

.price-history-row {
  color: #6b7788;
  background: #f7f9fc;
}

.product-price-pager {
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-product-price-tab] em {
  display: inline-block;
  min-width: 18px;
  margin-left: 4px;
  color: #b54708;
  font-style: normal;
}

.price-compact-values {
  display: grid;
  gap: 2px;
  min-width: 150px;
}

.price-compact-values span {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 6px;
}

.price-compact-values b {
  color: #667085;
  font-weight: 400;
}

.price-compact-values.disputed {
  color: #b42318;
}

.price-review-actions {
  display: flex;
  gap: 5px;
}

.product-price-import-panel {
  width: min(1120px, calc(100vw - 64px));
}

.price-import-preview {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.price-import-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.price-import-summary > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 6px 10px;
  border-right: 1px solid var(--line);
}

.price-import-summary > span:last-child {
  border-right: 0;
}

.price-import-summary b {
  color: var(--muted);
  font-weight: 400;
}

.price-import-summary .good strong { color: #067647; }
.price-import-summary .warn strong { color: #b54708; }
.price-import-summary .danger strong { color: #b42318; }
.price-import-summary .muted strong { color: #667085; }

.price-import-preview-table-wrap {
  max-height: 340px;
  overflow: auto;
}

.price-import-preview-table {
  min-width: 1050px !important;
}

.price-import-preview-table th,
.price-import-preview-table td {
  white-space: nowrap;
}

.price-import-new { color: #067647; }
.price-import-update { color: #b54708; }
.price-import-review,
.price-import-invalid { color: #b42318; }
.price-import-duplicate { color: #667085; }

.product-price-edit-panel {
  width: min(900px, calc(100vw - 64px));
  max-width: none;
}

.product-price-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.product-price-edit-grid label {
  display: grid;
  gap: 5px;
  color: #344054;
  font-size: 13px;
}

.product-price-edit-grid input {
  width: 100%;
  height: 32px;
  border: 1px solid #cfd7e3;
  padding: 0 8px;
}

.product-price-edit-note {
  grid-column: span 3;
}

.product-price-generate-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid #cfd7e3;
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
}

.product-price-generate-row button {
  flex: 0 0 auto;
}

.price-review-diff {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid #f1c27d;
  background: #fff8e8;
}

.price-review-diff span {
  display: inline-flex;
  gap: 7px;
}

@media (max-width: 980px) {
  .product-price-filter-grid,
  .product-price-edit-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .product-price-edit-note {
    grid-column: 1 / -1;
  }

  .product-price-generate-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .price-import-summary {
    grid-template-columns: repeat(3, 1fr);
  }
}

.style-batch-modal-panel {
  width: min(560px, calc(100vw - 80px));
  max-width: none;
}

.style-batch-textarea {
  width: 100%;
  min-height: 170px;
  border: 1px solid #cfd7e3;
  padding: 8px;
  font: inherit;
  resize: vertical;
}

.style-batch-preview {
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid #dbe7f4;
  background: #f7fbff;
  color: #526174;
  word-break: break-all;
}

.plan-context {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.plan-context span {
  border: 1px solid #d8e7fb;
  background: #f5f9ff;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  color: var(--muted);
}

.plan-context em {
  font-style: normal;
  font-size: 12px;
}

.plan-context strong {
  color: var(--ink);
  font-size: 16px;
}

.plan-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.plan-form label,
.plan-form input,
.plan-form textarea {
  min-width: 0;
  width: 100%;
}

.plan-reason-field {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.consult-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.consult-type-btn {
  min-height: 54px;
  text-align: left;
  border: 1px solid #cfe0f4;
  background: #f8fbff;
  padding: 8px 10px;
  color: var(--ink);
}

.consult-type-btn strong,
.consult-type-btn span {
  display: block;
}

.consult-type-btn span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.consult-task-wrap {
  height: calc(100vh - 212px);
  margin-bottom: 0;
}

.consult-task-table {
  width: 100%;
  min-width: 2490px;
  table-layout: fixed;
}

.production-consult-view {
  padding-right: 16px;
  padding-left: 16px;
  background: #f4f7fb;
}

.consult-erp-filter-grid {
  grid-template-columns: 240px 138px 138px 120px 160px 132px 132px;
}

.consult-action-strip {
  width: auto;
  height: 30px;
  padding: 0;
}

.consult-action-strip button {
  min-width: 58px;
}

.consult-quick-filter-strip {
  border-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  height: 38px;
  min-height: 38px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden;
}

.consult-quick-filter-bar {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  height: 38px;
  padding: 0 0 5px;
  gap: 0;
  border: 0;
  background: transparent;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #aeb9c8 transparent;
}

.consult-quick-filter-bar::-webkit-scrollbar {
  height: 5px;
}

.consult-quick-filter-bar::-webkit-scrollbar-track {
  background: transparent;
}

.consult-quick-filter-bar::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: #aeb9c8;
}

.consult-quick-filter-strip > .table-tabs {
  box-sizing: border-box;
  height: 38px;
  padding-bottom: 5px;
}

.consult-quick-filter-strip > .table-tabs button,
.consult-quick-filter-bar .quick-filter-chip {
  height: 33px;
  line-height: 33px;
  border: 0;
  border-right: 1px solid #d7e0eb;
  border-radius: 0;
}

.consult-quick-filter-bar .quick-filter-chip {
  background: transparent;
  box-shadow: none;
}

.consult-quick-filter-bar .quick-filter-chip:hover {
  background: #f6fbff;
}

.consult-quick-filter-bar .quick-filter-chip.active,
.consult-quick-filter-bar .quick-filter-chip[aria-pressed="true"] {
  border: 0;
  border-right: 1px solid #d7e0eb;
  background: #eaf4ff;
  color: #0b70d1;
  box-shadow: inset 0 -2px 0 #1677ff;
}

.consult-type-settings-btn {
  flex: 0 0 auto;
  height: 33px;
  margin-bottom: 5px;
  margin-left: auto;
}

.consult-type-settings-panel {
  width: min(620px, calc(100vw - 48px));
}

.consult-type-settings-rows {
  border: 1px solid #d9e2ee;
  background: #fff;
}

.consult-type-settings-row {
  display: grid;
  grid-template-columns: 42px minmax(220px, 1fr) auto;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid #e5ebf2;
}

.consult-type-settings-row:last-child { border-bottom: 0; }
.consult-type-settings-index { color: #7b8796; text-align: center; }
.consult-type-settings-row input { height: 30px; }
.consult-type-settings-actions { display: flex; gap: 4px; padding: 0 8px; }
.consult-type-settings-actions button { min-width: 30px; padding: 0 8px; }
.consult-type-settings-add { margin-top: 10px; }

.consult-quick-filter-bar .quick-filter-chip b {
  display: inline-flex;
  min-width: 20px;
  height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #e8f2ff;
  color: #1269b8;
  font-size: 11px;
  font-weight: 600;
}

.consult-bottom-toolbar {
  margin-top: 0;
}

.production-consult-view .summary-tabs {
  min-height: 38px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.consult-bulk-panel {
  width: min(1320px, calc(100vw - 48px));
  max-width: none;
  height: min(860px, calc(100vh - 48px));
}

.consult-reply-import-panel {
  width: min(1180px, calc(100vw - 48px));
  max-width: none;
  height: min(820px, calc(100vh - 48px));
}

.consult-reply-import-body {
  gap: 10px;
  overflow: hidden;
}

.consult-reply-compose {
  display: grid;
  grid-template-columns: 130px minmax(460px, 1fr) 150px;
  gap: 10px;
  align-items: stretch;
}

.consult-reply-compose textarea {
  min-height: 138px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}

.consult-reply-compose > button {
  align-self: end;
  height: 38px;
}

.consult-reply-preview {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  border: 1px solid #dce3ec;
  background: #fff;
}

.consult-reply-preview table {
  min-width: 980px;
  margin: 0;
}

.consult-reply-preview th,
.consult-reply-preview td {
  padding: 7px 8px;
  text-align: left;
  vertical-align: middle;
}

.consult-reply-preview select,
.consult-reply-preview input {
  width: 100%;
  min-width: 0;
}

.consult-reply-unmatched td {
  background: #fff4f1;
  color: #a43d2f;
}

.consult-text-panel {
  width: min(760px, calc(100vw - 48px));
  max-width: none;
}

.consult-text-body {
  gap: 12px;
}

.consult-text-body textarea {
  width: 100%;
  min-height: min(560px, calc(100vh - 220px));
  padding: 14px 16px;
  border: 1px solid #cfd9e6;
  background: #fbfcfe;
  color: #21364f;
  font: 14px/1.75 "Microsoft YaHei", sans-serif;
  resize: vertical;
}

.consult-bulk-body {
  gap: 10px;
  overflow: hidden;
}

.consult-bulk-compose {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) 150px;
  gap: 10px;
  align-items: stretch;
}

.consult-bulk-head-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.consult-bulk-head-actions .consult-bulk-date-field {
  width: 160px;
}

.consult-bulk-head-actions .consult-bulk-date-field input {
  height: 30px;
}

.consult-bulk-head-actions .icon-btn {
  align-self: flex-start;
}

.consult-bulk-date-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.consult-bulk-date-field input,
.consult-bulk-compose textarea {
  border: 1px solid var(--line);
  background: #fff;
}

.consult-bulk-compose textarea {
  height: 88px;
  min-height: 72px;
  max-height: 140px;
  padding: 9px 10px;
  resize: vertical;
  font: inherit;
  line-height: 1.55;
}

.consult-bulk-compose > button {
  align-self: end;
  height: 38px;
}

.consult-bulk-summary {
  min-height: 36px;
  padding: 8px 10px;
  border-left: 3px solid #1677d2;
  background: #f3f8fe;
  color: #40556f;
}

.consult-bulk-preview {
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.consult-bulk-table-wrap {
  height: 100%;
  overflow: auto;
  overflow-anchor: none;
}

.consult-bulk-table {
  min-width: 1180px !important;
  table-layout: fixed;
}

.consult-bulk-table th,
.consult-bulk-table td {
  padding: 6px 7px;
  text-align: center;
  vertical-align: middle;
}

.consult-bulk-table th:nth-child(1) { width: 54px; }
.consult-bulk-table th:nth-child(2) { width: 96px; }
.consult-bulk-table th:nth-child(3) { width: 310px; }
.consult-bulk-table th:nth-child(4) { width: 125px; }
.consult-bulk-table th:nth-child(5) { width: 150px; }
.consult-bulk-table th:nth-child(6) { width: auto; }

.consult-bulk-table .consult-bulk-source {
  text-align: left;
  white-space: normal;
  line-height: 1.45;
}

.consult-bulk-expand {
  width: 25px;
  min-width: 25px;
  height: 25px;
  padding: 0;
  color: #1677d2;
  font-size: 18px;
  line-height: 1;
}

.consult-bulk-expand[aria-expanded="true"] {
  border-color: #1677d2;
  background: #1677d2;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.consult-bulk-order-count {
  min-width: 104px;
  color: #1677d2;
}

.consult-bulk-selection-result {
  color: var(--muted);
  text-align: left !important;
}

.consult-bulk-selection-result.has-selection {
  color: #17613b;
  font-weight: 600;
}

.consult-bulk-detail-row > td {
  padding: 0 !important;
  background: #f6f9fd !important;
}

.consult-bulk-candidate-wrap {
  padding: 8px 0 10px;
}

.consult-bulk-candidate-table {
  width: 100%;
  min-width: 1080px;
  margin: 0;
  border: 1px solid #cfdbea;
  background: #fff;
  table-layout: fixed;
}

.consult-bulk-candidate-table th,
.consult-bulk-candidate-table td {
  padding: 6px 8px;
  border-right: 1px solid #dce4ee;
  border-bottom: 1px solid #dce4ee;
  text-align: center;
  vertical-align: middle;
}

.consult-bulk-candidate-table th:first-child { width: 52px; }
.consult-bulk-candidate-table th:nth-child(2) { width: 85px; }
.consult-bulk-candidate-table th:nth-child(3) { width: 118px; }
.consult-bulk-candidate-table th:nth-child(4) { width: 82px; }
.consult-bulk-candidate-table th:nth-child(5) { width: 140px; }
.consult-bulk-candidate-table th:nth-child(6) { width: 82px; }
.consult-bulk-candidate-table th:nth-child(7),
.consult-bulk-candidate-table th:nth-child(8),
.consult-bulk-candidate-table th:nth-child(9) { width: 68px; }
.consult-bulk-candidate-table th:nth-child(10) { width: 82px; }
.consult-bulk-candidate-table th:nth-child(11),
.consult-bulk-candidate-table th:nth-child(12) { width: 105px; }

.consult-bulk-candidate-table td strong,
.consult-bulk-candidate-table td span {
  display: block;
}

.consult-bulk-candidate-table td span:not(.consult-bulk-stage) {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.consult-bulk-candidate-table tr.is-selected td {
  background: #eef7ff;
}

.consult-bulk-select-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.consult-bulk-candidate-table input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: #1677d2;
  cursor: pointer;
}

.consult-bulk-summary.is-error {
  border-left-color: #cf3f32;
  background: #fff2f0;
  color: #a52f25;
}

.consult-bulk-ready-cell {
  text-align: left !important;
}

.consult-bulk-ready-cell span {
  display: flex !important;
  align-items: center;
  margin: 2px 0 !important;
  color: #40556f !important;
  white-space: nowrap;
}

.consult-bulk-estimated-date {
  margin-left: 5px;
  color: #ef3f36;
  font-weight: 500;
}

.consult-bulk-date-cell,
.consult-bulk-qty-cell {
  white-space: nowrap;
}

.consult-bulk-qty-cell,
.consult-bulk-remaining-cell > strong {
  color: #163b63;
  font-weight: 700;
}

.consult-bulk-ready-cell em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 3px;
  margin-right: 4px;
  border: 1px solid #c8d8e8;
  background: #f3f8fd;
  color: #315a81;
  font-size: 11px;
  font-style: normal;
}

.consult-bulk-table select {
  width: 100%;
  min-width: 110px;
}

.consult-bulk-selected td {
  background: #f2f8ff;
}

.consult-bulk-unmatched td {
  background: #fff5f2;
  color: #ad3c2a;
}

.consult-bulk-stage {
  display: inline-flex;
  padding: 2px 7px;
  border: 1px solid #c9d9eb;
  background: #f5f9fd;
  color: #315a81;
}

.consult-bulk-actions {
  flex: 0 0 auto;
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.danger-text {
  color: #c33c2f;
}

@media (max-width: 900px) {
  .consult-bulk-compose {
    grid-template-columns: 1fr;
  }

  .consult-reply-compose {
    grid-template-columns: 1fr;
  }
}

.consult-task-table th,
.consult-task-table td {
  padding: 6px 7px;
  vertical-align: middle;
  text-align: center;
  word-break: break-word;
}

.consult-task-table th {
  height: 34px;
  background: #f2f5f9;
  color: #40536a;
  font-weight: 600;
  white-space: nowrap;
  word-break: keep-all;
}

.consult-task-table td {
  white-space: normal;
}

.consult-task-table tbody tr:not(.consult-expanded-row):hover > td {
  background: #eef6ff;
}

.consult-task-table textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfd7e3;
  padding: 5px 6px;
  font: inherit;
  line-height: 1.35;
  resize: vertical;
  white-space: pre-wrap;
  text-align: center;
}

.consult-task-table .mini-input {
  width: 100%;
  min-width: 0;
}

.consult-task-table th:nth-child(1),
.consult-task-table td:nth-child(1) {
  width: 82px;
}

.consult-task-table th:nth-child(2),
.consult-task-table td:nth-child(2) {
  width: 82px;
}

.consult-task-table th:nth-child(3),
.consult-task-table td:nth-child(3) {
  width: 210px;
}

.consult-task-table th:nth-child(4),
.consult-task-table td:nth-child(4) {
  width: 160px;
}

.consult-task-table th:nth-child(5),
.consult-task-table td:nth-child(5),
.consult-task-table th:nth-child(6),
.consult-task-table td:nth-child(6),
.consult-task-table th:nth-child(10),
.consult-task-table td:nth-child(10),
.consult-task-table th:nth-child(11),
.consult-task-table td:nth-child(11),
.consult-task-table th:nth-child(12),
.consult-task-table td:nth-child(12),
.consult-task-table th:nth-child(13),
.consult-task-table td:nth-child(13),
.consult-task-table th:nth-child(14),
.consult-task-table td:nth-child(14) {
  width: 86px;
}

.consult-task-table th:nth-child(7),
.consult-task-table td:nth-child(7) {
  width: 86px;
}

.consult-task-table th:nth-child(8),
.consult-task-table td:nth-child(8),
.consult-task-table th:nth-child(9),
.consult-task-table td:nth-child(9) {
  width: 96px;
}

.consult-task-table th:nth-child(15),
.consult-task-table td:nth-child(15) {
  width: auto;
}

.consult-task-table th:nth-child(16),
.consult-task-table td:nth-child(16) {
  width: 120px;
}

.consult-task-table th:nth-child(17),
.consult-task-table td:nth-child(17) {
  width: 72px;
}

.consult-status-cell,
.consult-batch-cell,
.consult-progress-cell,
.consult-action-cell {
  display: flex;
  gap: 6px;
}

.consult-status-cell,
.consult-task-table td:nth-child(14),
.consult-action-cell {
  align-items: center;
  justify-content: center;
}

.consult-batch-cell {
  align-items: center;
  justify-content: center;
}

.consult-status-cell span,
.consult-batch-cell span,
.consult-progress-cell span,
.consult-progress-cell em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.consult-target-link {
  width: fit-content;
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}

.consult-expand-btn {
  width: fit-content;
  height: 24px;
  padding: 0 6px;
}

.consult-reply-input {
  min-width: 0;
}

.consult-reply-input:disabled {
  background: #f8fafc;
  color: #1f2937;
  opacity: 1;
}

.consult-type-input,
.consult-action-cell .mini-input {
  min-width: 0;
}

.consult-content-cell {
  line-height: 1.4;
  text-align: center;
  vertical-align: middle;
}

.consult-action-cell .primary {
  width: 54px;
  height: 28px;
  min-width: 0;
  padding: 0 6px;
}

.consult-task-table td:nth-child(1),
.consult-task-table td:nth-child(14),
.consult-task-table td:nth-child(16),
.consult-task-table td:nth-child(17) {
  vertical-align: middle;
  text-align: center;
}

.consult-task-table td:nth-child(1) > *,
.consult-task-table td:nth-child(14) > *,
.consult-task-table td:nth-child(16) > *,
.consult-task-table td:nth-child(17) > * {
  margin-left: auto;
  margin-right: auto;
}

/* Production consultation workbench: condensed columns and deliberate editing. */
.consult-task-table th:nth-child(1),
.consult-task-table td:nth-child(1) { width: 72px; }
.consult-task-table th:nth-child(2),
.consult-task-table td:nth-child(2) { width: 76px; }
.consult-task-table th:nth-child(3),
.consult-task-table td:nth-child(3) { width: 210px; }
.consult-task-table th:nth-child(4),
.consult-task-table td:nth-child(4) { width: 135px; }
.consult-task-table th:nth-child(5),
.consult-task-table td:nth-child(5) { width: 120px; }
.consult-task-table th:nth-child(6),
.consult-task-table td:nth-child(6) { width: 110px; }
.consult-task-table th:nth-child(7),
.consult-task-table td:nth-child(7) { width: 115px; }
.consult-task-table th:nth-child(8),
.consult-task-table td:nth-child(8) { width: 135px; }
.consult-task-table th:nth-child(9),
.consult-task-table td:nth-child(9) { width: 105px; }
.consult-task-table th:nth-child(10),
.consult-task-table td:nth-child(10) { width: 210px; }
.consult-task-table th:nth-child(11),
.consult-task-table td:nth-child(11) { width: 110px; }
.consult-task-table th:nth-child(12),
.consult-task-table td:nth-child(12) { width: 100px; }

.consult-task-table td:nth-child(3),
.consult-task-table td:nth-child(5),
.consult-task-table td:nth-child(6),
.consult-task-table td:nth-child(7),
.consult-task-table td:nth-child(8),
.consult-task-table td:nth-child(9),
.consult-task-table td:nth-child(10),
.consult-task-table td:nth-child(11) {
  text-align: left;
}

.consult-task-table textarea,
.consult-task-table input,
.consult-task-table select {
  width: 100%;
  min-width: 0;
  text-align: left;
}

.consult-task-table tr.is-editing > td {
  background: #f2f7fd;
  box-shadow: inset 0 1px 0 #c8dcf3, inset 0 -1px 0 #c8dcf3;
}

.consult-task-table tr.is-editing > td:first-child {
  box-shadow: inset 3px 0 0 #1677d2, inset 0 1px 0 #c8dcf3, inset 0 -1px 0 #c8dcf3;
}

/* Main consultation list follows the compact ERP grid, including row number and selection. */
.consult-task-table {
  min-width: 1510px;
}

.consult-task-table th:nth-child(1),
.consult-task-table td:nth-child(1) { width: 40px; }
.consult-task-table th:nth-child(2),
.consult-task-table td:nth-child(2) { width: 38px; }
.consult-task-table th:nth-child(3),
.consult-task-table td:nth-child(3) { width: 64px; }
.consult-task-table th:nth-child(4),
.consult-task-table td:nth-child(4) { width: 72px; }
.consult-task-table th:nth-child(5),
.consult-task-table td:nth-child(5) { width: 185px; }
.consult-task-table th:nth-child(6),
.consult-task-table td:nth-child(6) { width: 105px; }
.consult-task-table th:nth-child(7),
.consult-task-table td:nth-child(7) { width: 105px; }
.consult-task-table th:nth-child(8),
.consult-task-table td:nth-child(8) { width: 95px; }
.consult-task-table th:nth-child(9),
.consult-task-table td:nth-child(9) { width: 88px; }
.consult-task-table th:nth-child(10),
.consult-task-table td:nth-child(10) { width: 105px; }
.consult-task-table th:nth-child(11),
.consult-task-table td:nth-child(11) { width: 270px; }
.consult-task-table th:nth-child(12),
.consult-task-table td:nth-child(12) { width: 180px; }
.consult-task-table th:nth-child(13),
.consult-task-table td:nth-child(13) { width: 105px; }
.consult-task-table th:nth-child(14),
.consult-task-table td:nth-child(14) { width: 90px; }
.consult-task-table th:nth-child(15),
.consult-task-table td:nth-child(15) { width: 90px; }
.consult-task-table th:nth-child(16),
.consult-task-table td:nth-child(16) { width: 90px; }
.consult-task-table th:nth-child(17),
.consult-task-table td:nth-child(17) { width: 90px; }
.consult-task-table th:nth-child(18),
.consult-task-table td:nth-child(18) { width: 120px; }
.consult-task-table th:nth-child(19),
.consult-task-table td:nth-child(19) { width: 240px; }
.consult-task-table th:nth-child(20),
.consult-task-table td:nth-child(20) { width: 135px; }
.consult-task-table th:nth-child(21),
.consult-task-table td:nth-child(21) { width: 105px; }
.consult-task-table th:nth-child(22),
.consult-task-table td:nth-child(22) { width: 70px; }

.consult-task-table td:nth-child(5),
.consult-task-table td:nth-child(7),
.consult-task-table td:nth-child(8),
.consult-task-table td:nth-child(9),
.consult-task-table td:nth-child(10),
.consult-task-table td:nth-child(11),
.consult-task-table td:nth-child(12),
.consult-task-table td:nth-child(13) {
  text-align: left;
}

.consult-task-table input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: #1677d2;
  cursor: pointer;
}

.consult-sequence-cell,
.consult-select-cell {
  text-align: center !important;
  color: var(--muted);
}

.consult-content-display,
.consult-reply-display {
  overflow: hidden;
  color: #26384e;
  line-height: 1.45;
  text-align: left;
  white-space: pre-wrap;
}

.consult-content-display {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.consult-reply-display {
  max-height: 4.35em;
}

.consult-primary-value {
  overflow: hidden;
  color: #21364f;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.consult-secondary-value {
  margin-top: 3px;
  overflow: hidden;
  color: #7a899a;
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
}

.consult-metric-line {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: #334a64;
}

.consult-metric-line strong {
  color: #193a5e;
  font-size: 14px;
}

.consult-metric-line span {
  color: #7a899a;
  font-size: 12px;
}

.consult-owner-editor {
  display: grid;
  gap: 5px;
}

.consult-type-badge {
  display: inline-flex;
  max-width: 100%;
  padding: 2px 7px;
  overflow: hidden;
  border: 1px solid #c9d9eb;
  background: #f5f9fd;
  color: #315a81;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.consult-empty-value {
  color: #9a6d1f;
  font-size: 12px;
}

.consult-action-cell {
  display: table-cell;
  text-align: center !important;
  white-space: nowrap;
}

.consult-action-cell button {
  min-width: 46px;
  height: 28px;
  padding: 0 7px;
}

.consult-action-cell button + button {
  margin-left: 5px;
}

@media (max-width: 900px) {
  .consult-erp-filter-grid {
    grid-template-columns: 180px repeat(6, 120px);
  }
}

.consult-expanded-row td {
  background: #f8fafc;
  padding: 6px;
}

.consult-node-table {
  width: max-content;
  min-width: 0;
  table-layout: auto;
  border-collapse: collapse;
}

.consult-node-table th,
.consult-node-table td {
  border: 1px solid #dce3ec;
  padding: 4px 6px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  width: auto !important;
}

.consult-node-table th {
  background: #f4f8fd;
  font-weight: 600;
  white-space: nowrap;
}

.consult-expanded-wide-table {
  display: table;
}

.consult-expanded-row > td {
  overflow-x: auto;
  text-align: left !important;
  width: auto !important;
}

.consult-task-table .consult-expanded-row > td > .consult-node-table {
  margin-left: 0 !important;
  margin-right: auto !important;
}

.consult-production-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.consult-purchase-detail-btn {
  height: 24px;
  padding: 0 7px;
}

.consult-expanded-detail-grid {
  display: grid;
  grid-template-columns: minmax(760px, 1.3fr) minmax(420px, 0.7fr);
  min-height: 128px;
}

.consult-expanded-detail {
  border-top: 1px solid #dce3ec;
}

.consult-expanded-detail + .consult-expanded-detail {
  border-left: 1px solid #dce3ec;
}

.consult-expanded-detail h3 {
  margin: 0;
  padding: 5px 8px;
  border-bottom: 1px solid #dce3ec;
  background: #fbfcff;
  font-size: 12px;
  text-align: center;
}

.consult-detail-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}

.consult-detail-rows div {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  min-height: 24px;
  border-right: 1px solid #edf1f6;
  border-bottom: 1px solid #edf1f6;
}

.consult-detail-rows span,
.consult-detail-rows strong {
  padding: 3px 6px;
  line-height: 1.35;
}

.consult-detail-rows span {
  color: var(--muted);
  text-align: right;
  background: #fafcff;
  white-space: nowrap;
}

.consult-detail-rows strong {
  color: var(--ink);
  font-weight: 500;
  word-break: break-all;
}

.consult-purchase-table-wrap {
  max-height: 210px;
  overflow: auto;
}

.consult-purchase-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  table-layout: fixed;
}

.consult-purchase-table th,
.consult-purchase-table td {
  border: 1px solid #edf1f6;
  padding: 3px 5px;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  vertical-align: middle;
}

.consult-purchase-table th {
  background: #f4b4bd;
  color: #1f2933;
  font-weight: 600;
  white-space: nowrap;
}

.consult-purchase-table th:nth-child(2),
.consult-purchase-table td:nth-child(2) {
  width: 280px;
  text-align: left;
}

.consult-purchase-table th:nth-child(9),
.consult-purchase-table td:nth-child(9) {
  background: #d9e5ff;
}

.consult-empty-detail {
  margin: 8px;
}
}

.consult-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
}

.consult-detail-cell {
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 8px 10px;
}

.consult-detail-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.consult-detail-cell strong {
  display: block;
  min-height: 18px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.consult-detail-content {
  white-space: pre-wrap;
  border: 1px solid var(--line);
  background: #fbfcff;
  padding: 10px;
  max-height: 260px;
  overflow: auto;
}

.import-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.import-modal-panel .import-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: end !important;
}

.import-mode-field {
  display: grid;
  gap: 5px;
  grid-column: 1 / -1;
}

.import-form label {
  min-width: 0;
}

.import-modal-panel .import-mode-field,
.import-modal-panel .import-actions {
  grid-column: 1 / -1 !important;
}

.import-mode-field > span,
.import-form label {
  color: #526174;
  font-size: 12px;
}

.import-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.import-mode-option {
  border: 1px solid #cbd9ea;
  background: #fff;
  color: #34465c;
  min-height: 74px;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  display: grid;
  gap: 6px;
  align-content: center;
  border-radius: 4px;
}

.import-mode-option strong {
  font-size: 14px;
  color: #1c2f46;
}

.import-mode-option span {
  font-size: 12px;
  line-height: 1.45;
  color: #617089;
}

.import-mode-option.active {
  background: #eef6ff;
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
  font-weight: 600;
}

.import-mode-option.active strong,
.import-mode-option.active span {
  color: #0f65c8;
}

.import-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.import-actions button {
  min-width: 112px;
}

.import-template-box {
  border: 1px solid #dbe5f0;
  background: #fff;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.import-template-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.import-template-head strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.import-template-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.import-field-guide {
  border: 1px solid #edf2f7;
  background: #fbfcfe;
  padding: 8px;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.import-field-guide > span {
  min-height: 24px;
  border: 1px solid #d7e1ee;
  background: #fff;
  color: #24364b;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  line-height: 1.2;
}

.import-field-section {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 12px;
  color: #526174;
}

.import-field-section strong {
  color: #24364b;
  white-space: nowrap;
}

.import-field-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.import-field-tags span {
  border: 1px solid #d7e1ee;
  background: #fff;
  color: #34465c;
  padding: 2px 7px;
  line-height: 18px;
}

.import-field-tags span.required {
  border-color: #bcdcff;
  background: #edf6ff;
  color: #0969b7;
}

.import-field-notes p {
  margin: 0 0 4px;
  line-height: 1.5;
}

.import-field-notes p:last-child {
  margin-bottom: 0;
}

.import-template-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.import-template-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.import-template-table th,
.import-template-table td {
  min-width: 96px;
  border: 1px solid #cfd7e3;
  padding: 7px 9px;
  text-align: center;
  white-space: nowrap;
}

.import-template-table th {
  background: #f2f5f8;
  color: #24364b;
}

.import-form label,
.import-form input,
.import-form select,
.import-target-box {
  min-width: 0;
  width: 100%;
}

.import-form input,
.import-form select {
  height: 30px;
}

.import-fixed-dir-hint {
  border: 1px solid #d7e5f4;
  background: #f8fbff;
  color: #526174;
  padding: 7px 9px;
  margin: -2px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

.import-fixed-dir-hint strong {
  color: #24364b;
}

.import-fixed-dir-hint.warn {
  border-color: #f4d49b;
  background: #fff8eb;
}

.import-target-box {
  height: 30px;
  border: 1px solid var(--line);
  background: #f6f8fb;
  color: var(--ink);
  padding: 0 8px;
  display: flex;
  align-items: center;
}

.import-drop-zone {
  border: 1px dashed #a9bdd4;
  background: #f8fbff;
  min-height: 86px;
  margin: 4px 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #526174;
  cursor: pointer;
}

.import-drop-zone strong {
  color: var(--ink);
}

.import-drop-zone span {
  font-size: 12px;
}

.import-drop-zone.drag-over,
.import-drop-zone.has-file {
  border-color: var(--blue);
  background: #eef6ff;
}

.plan-import-file-picker.is-disabled {
  pointer-events: none;
  opacity: 0.65;
}

.import-progress {
  border: 1px solid #cfe0f3;
  background: #f8fbff;
  padding: 9px 10px;
  margin: 4px 0 10px;
}

.import-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: #526174;
}

.import-progress-row strong {
  color: var(--blue);
}

.import-progress-track {
  height: 8px;
  background: #e4edf7;
  overflow: hidden;
}

.import-progress-bar {
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width 0.2s ease;
}

.import-progress-detail {
  margin-top: 7px;
  color: #738196;
  font-size: 12px;
  line-height: 1.45;
}

.import-progress.is-error {
  border-color: #f0b7b7;
  background: #fff7f7;
}

.import-progress.is-error .import-progress-row strong,
.import-progress.is-error .import-progress-detail {
  color: #c53b3b;
}

.import-progress.is-error .import-progress-bar {
  background: #d9534f;
}

.import-progress.is-success {
  border-color: #b9dfca;
  background: #f5fcf8;
}

.import-progress.is-success .import-progress-row strong,
.import-progress.is-success .import-progress-detail {
  color: #24804d;
}

.import-progress.is-success .import-progress-bar {
  background: #2f9d62;
}

.log-progress {
  min-width: 150px;
}

.log-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.log-progress-head strong {
  color: var(--blue);
}

.log-progress-track {
  height: 6px;
  background: #e5edf7;
  overflow: hidden;
}

.log-progress-track span {
  display: block;
  height: 100%;
  background: var(--blue);
  transition: width 0.2s ease;
}

.log-progress.warn .log-progress-head strong,
.log-progress.warn .log-progress-track span {
  color: #a35d00;
  background: #f3a100;
}

.log-progress.danger .log-progress-head strong,
.log-progress.danger .log-progress-track span {
  color: #b42318;
  background: #d92d20;
}

.mapping-mindmap {
  display: grid;
  gap: 14px;
}

.mindmap-group {
  border: 1px solid var(--border);
  background: #fff;
}

.mindmap-group h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  background: #f5f9ff;
}

.mindmap-flow-list {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.mindmap-flow {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 28px minmax(170px, 1fr) 28px minmax(220px, 1.45fr) minmax(200px, 1.2fr);
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  border: 1px solid #e4ebf5;
  background: #fbfdff;
}

.mindmap-node {
  padding: 8px;
  border: 1px solid #d9e2ef;
  background: #fff;
  min-height: 66px;
}

.mindmap-node span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.mindmap-node strong {
  font-size: 13px;
}

.mindmap-node.source {
  border-left: 3px solid #1890ff;
}

.mindmap-node.aggregate {
  border-left: 3px solid #52c41a;
}

.mindmap-node.fields {
  border-left: 3px solid #faad14;
}

.mindmap-node.drilldown {
  border-left: 3px solid #722ed1;
}

.mindmap-arrow {
  display: grid;
  place-items: center;
  color: #7a8aa0;
  font-size: 18px;
}

.mindmap-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.mindmap-tags b {
  padding: 2px 5px;
  border: 1px solid #dbe6f3;
  background: #f6faff;
  font-size: 12px;
  font-weight: 500;
}

.mindmap-rule {
  grid-column: 1 / -1;
  margin: 0;
  padding: 7px 8px;
  color: #56657a;
  background: #fff9e8;
  border: 1px solid #f2dfaa;
}

.import-rule-banner {
  border: 1px solid #ffe2b8;
  background: #fff8ed;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.import-rule-banner div {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.import-rule-banner strong {
  color: #7c4a03;
  white-space: nowrap;
}

.import-rule-banner span {
  color: #5b6472;
  line-height: 1.6;
}

.plan-import-rules-panel .import-rule-banner span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.plan-import-control-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #dbe5f0;
}

.plan-import-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
  align-items: center;
}

.plan-import-file-picker {
  min-width: 0;
  height: 34px;
  border: 1px solid #198cff;
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  align-items: stretch;
  color: #526174;
  cursor: pointer;
}

.plan-import-file-picker span {
  min-width: 0;
  padding: 0 8px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}

.plan-import-file-picker strong {
  border-left: 1px solid #dbe7f5;
  background: #f7fbff;
  color: #0b63ce;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
}

.plan-import-file-picker.drag-over,
.plan-import-file-picker.has-file {
  background: #f5fbff;
  box-shadow: inset 0 0 0 1px rgba(25, 140, 255, 0.12);
}

.plan-import-file-row #planAuditImportSubmit,
.plan-import-file-row #planOrderImportSubmit,
.plan-import-file-row #dailySalesHistoryImportSubmit {
  width: 112px;
  height: 34px;
  padding: 0 12px;
  border-radius: 2px;
  white-space: nowrap;
}

.plan-import-mode-box {
  display: flex;
  align-items: center;
  min-height: 24px;
  margin: 0;
  padding: 0;
  overflow: visible;
}

.plan-import-mode-choice {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 24px;
  line-height: 24px;
  white-space: nowrap;
}

.plan-import-mode-title {
  flex: 0 0 auto;
  color: #24364b;
  font-weight: 600;
  line-height: 24px;
  white-space: nowrap;
}

.plan-import-mode-box label {
  flex: 0 0 auto;
  height: 24px;
  border: 0;
  background: transparent;
  display: inline-grid;
  grid-template-columns: 13px max-content;
  align-items: center;
  gap: 4px;
  padding: 0;
  color: #24364b;
  font-size: 12px;
  font-weight: 400;
  line-height: 24px;
  white-space: nowrap;
  cursor: pointer;
}

.plan-import-mode-box label + label {
  margin-left: 0;
}

.plan-import-mode-box input[type="radio"] {
  flex: 0 0 auto;
  appearance: auto;
  -webkit-appearance: radio;
  width: 13px !important;
  min-width: 13px !important;
  max-width: 13px !important;
  height: 13px !important;
  min-height: 13px !important;
  max-height: 13px !important;
  margin: 0;
  padding: 0 !important;
  align-self: center;
  accent-color: #1677ff;
}

.plan-import-mode-box label:has(input:checked) {
  color: #0f65c8;
  font-weight: 600;
}

.plan-import-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.plan-import-main {
  min-width: 0;
}

.plan-import-drop-zone {
  min-height: 148px;
  margin: 0 0 10px;
}

.plan-import-rules-panel {
  min-height: 360px;
  max-height: min(500px, calc(100vh - 300px));
  overflow: auto;
  padding: 0 10px 10px 0;
  margin-bottom: 0;
}

.plan-import-rules-panel .import-rule-banner {
  margin-bottom: 12px;
}

.plan-import-note {
  border: 1px solid #dbe5f0;
  background: #fbfcfe;
  padding: 8px 10px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  color: #5b6472;
  font-size: 12px;
  line-height: 1.5;
}

.plan-import-note strong {
  color: #24364b;
  flex: 0 0 auto;
  white-space: nowrap;
}

.plan-import-note span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.plan-import-rules-panel .import-rule-group {
  border: 1px solid #edf2f7;
  border-bottom: 0;
  padding: 8px 10px;
  background: #fff;
}

.plan-import-rules-panel .import-rule-group:last-child {
  border-bottom: 1px solid #edf2f7;
}

.plan-import-rules-panel .import-template-head {
  margin-bottom: 5px;
}

.plan-import-rules-panel .import-template-head > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.plan-import-rules-panel .import-template-head strong {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.plan-import-rules-panel .import-template-head span {
  min-width: 0;
  color: #7a8797;
  font-size: 12px;
  line-height: 1.35;
}

.plan-import-rules-panel .import-field-guide {
  margin-bottom: 4px;
  border: 0;
  background: #fbfcfe;
}

.manual-edit-panel {
  flex: 0 0 auto;
  border: 1px solid #cfe3ff;
  background: #f5f9ff;
  margin-bottom: 8px;
  padding: 8px 10px;
}

.manual-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.manual-edit-actions strong {
  color: var(--blue);
}

.manual-edit-actions span {
  color: var(--muted);
  margin-right: auto;
}

.manual-paste-box {
  width: 100%;
  min-height: 96px;
  margin-top: 8px;
  border: 1px solid #cfd7e3;
  padding: 8px;
  resize: vertical;
  font-family: Consolas, "Microsoft YaHei", monospace;
}

#customPreviewTable td[contenteditable="true"] {
  background: #fff;
  outline: none;
}

#customPreviewTable td[contenteditable="true"]:focus {
  box-shadow: inset 0 0 0 2px #91c5ff;
  background: #f8fcff;
}

.template-table {
  min-width: 1500px;
}

.template-table td,
.log-table td,
.requirement-table td {
  white-space: normal;
  line-height: 1.5;
  vertical-align: top;
}

.log-table {
  min-width: 1180px;
}

.requirement-table {
  min-width: 1800px;
}

.history-block {
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.history-head {
  min-height: 34px;
  padding: 8px 10px;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-head span {
  color: var(--muted);
}

.trend-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.trend-summary span {
  border: 1px solid var(--line);
  background: #f7f9fc;
  padding: 8px 10px;
  color: var(--muted);
}

.trend-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
}

.trend-breakdown {
  border: 1px solid var(--line);
  background: #f7f9fc;
  margin-bottom: 10px;
  padding: 8px;
}

.trend-breakdown-title {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.trend-breakdown-table {
  background: #fff;
}

.trend-breakdown-table th,
.trend-breakdown-table td {
  height: 30px;
  text-align: center;
}

.trend-breakdown-table .summary-row {
  background: #fff8e5;
  font-weight: 700;
}

.trend-chart {
  border: 1px solid var(--line);
  background: #fff;
  margin-bottom: 10px;
  padding: 8px;
}

.trend-chart svg {
  width: 100%;
  height: 260px;
  display: block;
}

.trend-axis {
  stroke: #cfd8e3;
  stroke-width: 1;
}

.trend-area {
  fill: rgba(24, 144, 255, 0.12);
}

.trend-average-line {
  stroke: #8aa0b6;
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
}

.trend-average-label {
  fill: #7b8ba0;
  font-size: 12px;
  text-anchor: end;
}

.trend-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.5;
}

.trend-line-ma5,
.trend-line-ma10 {
  fill: none;
  stroke-width: 1.7;
  stroke-dasharray: 5 4;
  pointer-events: none;
}

.trend-line-ma5 {
  stroke: #fa8c16;
}

.trend-line-ma10 {
  stroke: #52c41a;
}

.trend-legend {
  fill: #6b7a90;
  font-size: 12px;
}

.trend-hit-zone {
  fill: transparent;
  pointer-events: all;
}

.trend-hit-zone:hover {
  fill: rgba(24, 144, 255, 0.06);
}

.trend-dot {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 2;
  cursor: pointer;
}

.trend-dot:hover {
  fill: var(--blue);
  stroke-width: 3;
}

.trend-label,
.trend-max {
  fill: var(--muted);
  font-size: 12px;
}

.trend-label {
  text-anchor: middle;
}

.trend-table-wrap {
  max-height: 260px;
}

.timeliness-segments {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.timeliness-segment {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  padding: 2px 6px;
  border: 1px solid #d9e2ef;
  background: #f8fbff;
  white-space: nowrap;
}

.timeliness-segment em {
  color: #8a98aa;
  font-style: normal;
}

.trend-chart-row {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  border: 1px solid var(--line);
  background: #fff;
  margin-bottom: 8px;
}

.trend-chart-holder {
  min-width: 0;
}

.trend-chart-row .trend-chart {
  border: 0;
  margin: 0;
}

.trend-hover-panel {
  border-right: 1px solid var(--line);
  background: #fbfdff;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 260px;
}

.trend-hover-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.trend-hover-grid th,
.trend-hover-grid td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  height: 28px;
  padding: 4px 6px;
  text-align: center;
  white-space: nowrap;
}

.trend-hover-grid th {
  width: 44px;
  color: var(--ink);
  font-weight: 600;
}

.trend-hover-grid td:nth-child(2) {
  width: 62px;
}

.trend-hover-grid td:last-child {
  border-right: 0;
  color: var(--muted);
}

.trend-hover-grid b {
  color: var(--ink);
  font-weight: 600;
}

.trend-hover-grid-compact th,
.trend-hover-grid-compact td {
  border-right: 0;
  width: 50%;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trend-hover-grid-compact td:first-child {
  color: var(--ink);
  font-weight: 600;
}

.trend-hover-grid-compact td:last-child {
  color: #526174;
}

.trend-hover-grid-head th,
.trend-hover-grid-head td {
  background: #eef6ff;
  font-weight: 600;
}

.trend-hover-list {
  width: 100%;
  font-size: 12px;
  color: var(--ink);
}

.trend-hover-list-head {
  height: 28px;
  line-height: 28px;
  padding: 0 8px;
  background: #eef6ff;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trend-hover-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 74px;
  gap: 6px;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
}

.trend-hover-list-colhead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 74px;
  gap: 6px;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.trend-hover-list-row span,
.trend-hover-list-colhead span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-hover-list-row b,
.trend-hover-list-colhead b {
  color: #526174;
  font-weight: 500;
  white-space: nowrap;
  text-align: right;
}

.trend-hover-list-row em,
.trend-hover-list-colhead em {
  color: #526174;
  font-style: normal;
  white-space: nowrap;
  text-align: right;
}

.trend-hover-list-empty {
  padding: 10px 8px;
  color: var(--muted);
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.modal-body .trend-table {
  min-width: 640px;
}

#trendHoverHint {
  display: none;
}

.trend-hover-hint {
  border: 1px solid #dbe5f0;
  background: #f8fbff;
  color: #526174;
  padding: 7px 9px;
  margin: -2px 0 8px;
  font-size: 12px;
}

.trend-hover-hint strong {
  color: var(--ink);
  margin-right: 8px;
}

.trend-platform-table th,
.trend-platform-table td {
  min-width: 76px;
}

.trend-platform-table th:first-child,
.trend-platform-table td:first-child {
  min-width: 92px;
}

.platform-value,
.fulfillment-value {
  text-align: center;
  white-space: nowrap;
}

.platform-value b,
.fulfillment-value b {
  color: var(--ink);
  font-weight: 600;
  margin-right: 5px;
}

.platform-value span,
.fulfillment-value span {
  color: #9aa7b7;
  font-size: 12px;
}

.platform-value .platform-fulfillment {
  display: block;
  margin-top: 3px;
  color: #6b7788;
  font-size: 12px;
  font-weight: 400;
}

.platform-value .platform-fulfillment-inline {
  display: inline-block;
  margin-left: 4px;
  color: #6b7788;
  font-size: 12px;
  font-weight: 500;
}

.process-log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.process-card {
  background: #fff;
  border: 1px solid var(--line);
}

.process-card-head {
  min-height: 60px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.process-card-head h2 {
  margin: 0;
  font-size: 16px;
}

.process-card-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.flow-line {
  display: flex;
  align-items: stretch;
  gap: 16px;
  overflow-x: auto;
  padding: 14px;
}

.flow-node {
  position: relative;
  min-width: 150px;
  border: 1px solid #b9d7f4;
  background: #eef6ff;
  padding: 10px 10px 10px 38px;
  min-height: 54px;
}

.flow-node::after {
  content: "";
  position: absolute;
  right: -17px;
  top: 50%;
  width: 16px;
  height: 1px;
  background: #91bfe8;
}

.flow-node:last-child::after {
  display: none;
}

.flow-node span {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.flow-node strong {
  display: block;
  line-height: 1.4;
}

.process-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 14px 14px;
}

.process-columns > div {
  border: 1px solid var(--line);
  background: #fbfcfe;
  padding: 10px 12px;
}

.process-columns h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.process-columns ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.empty {
  background: #fff;
  border: 1px solid var(--line);
  margin: 14px 16px;
  padding: 20px;
}

.issue-toolbar input {
  min-width: 280px;
}

.issue-table th,
.issue-table td {
  white-space: nowrap;
}

.issue-table .issue-message {
  min-width: 280px;
  max-width: 460px;
  white-space: normal;
  line-height: 1.45;
}

.issue-status-select {
  min-width: 96px;
}

.table-wrap.expected-rule-table-wrap,
.table-wrap.expected-day-model-wrap {
  flex: 1 1 260px;
  height: 260px;
  min-height: 260px;
  max-height: 260px;
  overflow-x: hidden;
}

.api-config-panel {
  padding: 0 14px 16px;
}

.api-workbench {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 12px;
  min-height: 520px;
}

.api-source-nav {
  align-self: start;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding: 8px;
}

.api-source-nav-title {
  color: var(--muted);
  font-weight: 700;
  padding: 6px 8px;
}

.api-source-nav button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 8px;
  text-align: left;
}

.api-source-nav button.active {
  background: #eef6ff;
  border-color: #b8d8ff;
  color: var(--blue);
}

.api-source-nav button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.api-source-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.api-config-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
}

.api-config-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.api-config-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.api-config-head p,
.api-last-test {
  color: var(--muted);
  margin: 0;
}

.api-status-row,
.api-actions,
.api-result-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.status-pill {
  border: 1px solid var(--line);
  background: #f8fbff;
  color: var(--text);
  display: inline-flex;
  padding: 4px 8px;
}

.status-pill.ok {
  background: #f2fbf5;
  border-color: #bfe5c9;
  color: #177245;
}

.status-pill.warn {
  background: #fff8e8;
  border-color: #f3cf87;
  color: #9a6400;
}

.api-form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.api-sync-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.api-form-grid label,
.api-sync-grid label,
.api-remark,
.api-test-sku {
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.api-remark {
  margin-top: 10px;
}

.api-test-sku {
  min-width: 240px;
}

.api-test-result {
  margin: 0;
  padding: 0;
}

.api-result-table th,
.api-result-table td {
  white-space: nowrap;
}

.api-cache-note {
  background: #f8fbff;
  border: 1px solid #d7e8fb;
  color: var(--text);
  line-height: 1.5;
  margin-top: 10px;
  padding: 8px 10px;
}

.api-mapping-wrap {
  max-height: 360px;
}

.api-cache-list {
  display: grid;
  gap: 8px;
}

.api-cache-item {
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding: 9px 10px;
}

.api-cache-item span {
  color: var(--muted);
}

@media (max-width: 900px) {
  .overview-metric-grid,
  .overview-bottom-grid,
  .mapping-help,
  .process-columns,
  .api-form-grid,
  .api-sync-grid,
  .api-workbench {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  label.wide,
  select,
  input {
    min-width: 0;
    width: 100%;
  }
}

/* Procurement plan table final column layout. This intentionally sits at EOF to override older nth-child rules. */
.plan-table {
  min-width: 2260px;
  table-layout: fixed;
  min-height: 0;
}

.plans-table-wrap {
  overflow-x: auto;
}

.plan-table th,
.plan-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-table th:nth-child(1),
.plan-table td:nth-child(1) { width: 112px; }
.plan-table th:nth-child(2),
.plan-table td:nth-child(2) {
  width: 64px;
  min-width: 64px;
  padding-left: 4px;
  padding-right: 4px;
}
.plan-table th:nth-child(3),
.plan-table td:nth-child(3) { width: 132px; }
.plan-table th:nth-child(4),
.plan-table td:nth-child(4) { width: 72px; }
.plan-table th:nth-child(5),
.plan-table td:nth-child(5) { width: 96px; }
.plan-table th:nth-child(6),
.plan-table td:nth-child(6) { width: 82px; }
.plan-table th:nth-child(7),
.plan-table td:nth-child(7) { width: 70px; }
.plan-table th:nth-child(8),
.plan-table td:nth-child(8),
.plan-table th:nth-child(9),
.plan-table td:nth-child(9),
.plan-table th:nth-child(10),
.plan-table td:nth-child(10) { width: 70px; }
.plan-table th:nth-child(11),
.plan-table td:nth-child(11),
.plan-table th:nth-child(12),
.plan-table td:nth-child(12) { width: 96px; }
.plan-table th:nth-child(13),
.plan-table td:nth-child(13),
.plan-table th:nth-child(14),
.plan-table td:nth-child(14),
.plan-table th:nth-child(15),
.plan-table td:nth-child(15),
.plan-table th:nth-child(16),
.plan-table td:nth-child(16),
.plan-table th:nth-child(17),
.plan-table td:nth-child(17),
.plan-table th:nth-child(18),
.plan-table td:nth-child(18) { width: 92px; }
.plan-table th:nth-child(19),
.plan-table td:nth-child(19) {
  width: 170px;
  white-space: normal;
  word-break: break-word;
}
.plan-table th:nth-child(20),
.plan-table td:nth-child(20) {
  width: 116px;
  white-space: normal;
  word-break: break-word;
}
.plan-table th:nth-child(21),
.plan-table td:nth-child(21) {
  width: 88px;
}
.plan-table th:nth-child(22),
.plan-table td:nth-child(22) {
  position: static;
  right: auto;
  z-index: auto;
  width: 78px;
  box-shadow: none;
}
.plan-table th:nth-child(20),
.plan-table td:nth-child(20),
.plan-table th:nth-child(21),
.plan-table td:nth-child(21) {
  white-space: normal;
  word-break: break-word;
}
.plan-table th:nth-child(23),
.plan-table td:nth-child(23) {
  position: sticky;
  right: 0;
  z-index: 8;
  width: 174px;
  background: #fff;
  box-shadow: -1px 0 0 #dfe6f0;
}
.plan-table th:nth-child(23) {
  z-index: 9;
  background: #eef3fa;
}

.plan-style-cell {
  display: block;
  min-width: 0;
  padding: 0;
}

.plan-style-cell .linklike {
  display: inline-block;
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* 1920px review workspace layout. Pending hides audit note; completed states include it. */
.plan-table.plan-pending {
  min-width: 2060px;
}

.plan-table.plan-with-audit {
  min-width: 2180px;
}

.plan-table.plan-pending th:nth-child(1),
.plan-table.plan-pending td:nth-child(1),
.plan-table.plan-with-audit th:nth-child(1),
.plan-table.plan-with-audit td:nth-child(1) { width: 136px; }

.plan-table.plan-pending th:nth-child(2),
.plan-table.plan-pending td:nth-child(2),
.plan-table.plan-with-audit th:nth-child(2),
.plan-table.plan-with-audit td:nth-child(2) {
  width: 52px;
  min-width: 52px;
  padding-left: 3px;
  padding-right: 3px;
}

.plan-table.plan-pending th:nth-child(3),
.plan-table.plan-pending td:nth-child(3),
.plan-table.plan-with-audit th:nth-child(3),
.plan-table.plan-with-audit td:nth-child(3) { width: 132px; }

.plan-table.plan-pending th:nth-child(4),
.plan-table.plan-pending td:nth-child(4),
.plan-table.plan-with-audit th:nth-child(4),
.plan-table.plan-with-audit td:nth-child(4) { width: 96px; }

.plan-table.plan-pending th:nth-child(5),
.plan-table.plan-pending td:nth-child(5),
.plan-table.plan-with-audit th:nth-child(5),
.plan-table.plan-with-audit td:nth-child(5) { width: 82px; }

.plan-table.plan-pending th:nth-child(6),
.plan-table.plan-pending td:nth-child(6),
.plan-table.plan-pending th:nth-child(7),
.plan-table.plan-pending td:nth-child(7),
.plan-table.plan-pending th:nth-child(8),
.plan-table.plan-pending td:nth-child(8),
.plan-table.plan-with-audit th:nth-child(6),
.plan-table.plan-with-audit td:nth-child(6),
.plan-table.plan-with-audit th:nth-child(7),
.plan-table.plan-with-audit td:nth-child(7),
.plan-table.plan-with-audit th:nth-child(8),
.plan-table.plan-with-audit td:nth-child(8) { width: 64px; }

.plan-table.plan-pending th:nth-child(9),
.plan-table.plan-pending td:nth-child(9),
.plan-table.plan-with-audit th:nth-child(9),
.plan-table.plan-with-audit td:nth-child(9) { width: 78px; }

.plan-table.plan-pending th:nth-child(10),
.plan-table.plan-pending td:nth-child(10),
.plan-table.plan-pending th:nth-child(11),
.plan-table.plan-pending td:nth-child(11),
.plan-table.plan-with-audit th:nth-child(10),
.plan-table.plan-with-audit td:nth-child(10),
.plan-table.plan-with-audit th:nth-child(11),
.plan-table.plan-with-audit td:nth-child(11) { width: 96px; }

.plan-table.plan-pending th:nth-child(12),
.plan-table.plan-pending td:nth-child(12),
.plan-table.plan-pending th:nth-child(13),
.plan-table.plan-pending td:nth-child(13),
.plan-table.plan-pending th:nth-child(14),
.plan-table.plan-pending td:nth-child(14),
.plan-table.plan-pending th:nth-child(15),
.plan-table.plan-pending td:nth-child(15),
.plan-table.plan-pending th:nth-child(16),
.plan-table.plan-pending td:nth-child(16),
.plan-table.plan-with-audit th:nth-child(12),
.plan-table.plan-with-audit td:nth-child(12),
.plan-table.plan-with-audit th:nth-child(13),
.plan-table.plan-with-audit td:nth-child(13),
.plan-table.plan-with-audit th:nth-child(14),
.plan-table.plan-with-audit td:nth-child(14),
.plan-table.plan-with-audit th:nth-child(15),
.plan-table.plan-with-audit td:nth-child(15),
.plan-table.plan-with-audit th:nth-child(16),
.plan-table.plan-with-audit td:nth-child(16) { width: 88px; }

.plan-table.plan-pending th:nth-child(17),
.plan-table.plan-pending td:nth-child(17),
.plan-table.plan-with-audit th:nth-child(17),
.plan-table.plan-with-audit td:nth-child(17) { width: 88px; }

.plan-table.plan-pending th:nth-child(18),
.plan-table.plan-pending td:nth-child(18),
.plan-table.plan-with-audit th:nth-child(18),
.plan-table.plan-with-audit td:nth-child(18) { width: 92px; }

.plan-table.plan-pending th:nth-child(19),
.plan-table.plan-pending td:nth-child(19),
.plan-table.plan-with-audit th:nth-child(19),
.plan-table.plan-with-audit td:nth-child(19) {
  width: 180px;
  white-space: normal;
  word-break: break-word;
}

.plan-table.plan-pending th:nth-child(20),
.plan-table.plan-pending td:nth-child(20),
.plan-table.plan-with-audit th:nth-child(20),
.plan-table.plan-with-audit td:nth-child(20) { width: 76px; }

.plan-table.plan-pending th:nth-child(21),
.plan-table.plan-pending td:nth-child(21),
.plan-table.plan-with-audit th:nth-child(22),
.plan-table.plan-with-audit td:nth-child(22) {
  position: static;
  right: auto;
  z-index: auto;
  width: 78px;
  box-shadow: none;
}

.plan-table.plan-with-audit th:nth-child(21),
.plan-table.plan-with-audit td:nth-child(21) {
  width: 128px;
  white-space: normal;
  word-break: break-word;
}

.plan-table.plan-pending th:nth-child(22),
.plan-table.plan-pending td:nth-child(22),
.plan-table.plan-with-audit th:nth-child(23),
.plan-table.plan-with-audit td:nth-child(23) {
  position: sticky;
  right: 0;
  z-index: 12;
  width: 174px;
  background: #fff;
  box-shadow: -1px 0 0 #dfe6f0;
}

.plan-table.plan-pending th:nth-child(22),
.plan-table.plan-with-audit th:nth-child(23) {
  z-index: 13;
  background: #eef3fa;
}

.plan-table.plan-pending .summary-thumb,
.plan-table.plan-with-audit .summary-thumb {
  width: 40px;
  height: 40px;
}

.plan-table.plan-pending .summary-image-btn,
.plan-table.plan-with-audit .summary-image-btn {
  width: 44px;
  height: 44px;
}

/* ERP workbench polish for purchase plan review. Kept at EOF to override legacy nth-child widths. */
.plan-erp-view {
  background: #f4f7fb;
}

.plan-workflow-view {
  background: #f4f7fb;
}

.plan-erp-view .plan-filter-panel,
.plan-workflow-view .production-filter-panel {
  margin: 0 -16px 8px;
  padding: 9px 12px;
  background: #fff;
  border-top: 0;
  border-bottom: 1px solid #d8e1ec;
}

.production-view.plan-workflow-view .jst-filter-panel {
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.plan-erp-view .plan-filter-grid {
  grid-template-columns: repeat(8, 150px);
  gap: 7px;
}

.plan-workflow-view .production-filter-grid {
  grid-template-columns: 360px 150px 150px 1fr;
  gap: 7px;
}

.plan-workflow-view .daily-sales-filter-grid {
  grid-template-columns: 150px 150px minmax(180px, 240px) minmax(110px, 140px) 90px 120px 120px;
  justify-content: start;
}

.plan-workflow-view .plan-order-record-filter-grid {
  grid-template-columns: repeat(9, 150px);
}

.plan-order-record-action-strip {
  border-top: 1px solid #d8e1ec;
  border-bottom: 1px solid #d8e1ec;
  margin-top: 7px;
  padding: 0;
  height: 30px;
  overflow-x: auto;
  overflow-y: hidden;
}

.plan-order-record-quick-row {
  border-top: 0;
  margin-top: 0;
}

.plan-workflow-view .production-filter-grid > input:first-child {
  min-width: 0;
}

.plan-erp-view .plan-filter-grid input,
.plan-erp-view .plan-filter-grid select,
.plan-erp-view .plan-filter-grid button,
.plan-workflow-view .production-filter-grid input,
.plan-workflow-view .production-filter-grid select,
.plan-workflow-view .production-filter-grid button {
  height: 30px;
  border-radius: 2px;
}

.plan-action-strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 30px;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.plan-action-strip > button {
  flex: 0 0 auto;
  min-width: 72px;
  height: 30px;
  margin-left: -1px;
  padding: 0 12px;
  border-radius: 0;
}

.plan-action-strip > button:first-child {
  margin-left: 0;
  border-radius: 2px 0 0 2px;
}

.plan-action-strip > button.primary {
  border-color: #1677ff;
  background: #1677ff;
  color: #fff;
}

.plan-action-strip > button:disabled {
  opacity: 0.48;
}

.plan-toolbar-quick-filter {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  padding: 3px 8px;
  border-left: 1px solid #d8e1ec;
  overflow-x: auto;
  overflow-y: hidden;
}

.plan-status-toolbar {
  min-height: 42px;
  margin: 0 -16px 8px;
  padding: 6px 12px;
  gap: 10px;
  background: #fff;
  border-top: 1px solid #e3eaf3;
  border-bottom: 1px solid #d8e1ec;
  box-shadow: 0 1px 2px rgba(15, 42, 68, 0.04);
}

.plan-status-toolbar .table-tabs {
  flex: 0 0 auto;
}

.plan-status-toolbar .quick-filter-chip,
.plan-status-toolbar .quick-filter-empty {
  height: 22px;
  line-height: 20px;
}

.plan-status-toolbar .table-tabs {
  flex: 0 0 auto;
}

.plan-status-toolbar .table-tabs button {
  min-width: 92px;
  height: 30px;
  border-radius: 2px;
  font-weight: 700;
}

.plan-bulk-toolbar {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0;
  min-height: 30px;
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  white-space: nowrap;
}

.plan-bulk-toolbar strong {
  min-width: 76px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #c9d7e8;
  background: #f8fbff;
  color: #1f3654;
  font-size: 12px;
  font-weight: 800;
  line-height: 28px;
  text-align: center;
}

.plan-bulk-toolbar button {
  height: 30px;
  min-width: 64px;
  margin-left: -1px;
  padding: 0 10px;
  border-radius: 0;
  font-size: 12px;
}

.plan-bulk-toolbar button:disabled {
  opacity: 0.48;
}

.plan-data-meta {
  min-width: 110px;
  flex: 0 1 auto;
}

.plan-bottom-toolbar {
  flex: 0 0 28px;
  height: 28px;
  min-height: 28px;
  margin: 0 -16px;
  padding: 0 12px;
  border-top: 1px solid #d8e1ec;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.plan-bottom-toolbar .summary-data-meta {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8090a6;
  font-size: 11px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.plan-bottom-toolbar .table-page-tools,
.plan-erp-view .table-page-tools {
  gap: 7px;
}

.plan-bottom-toolbar .table-page-size select,
.plan-bottom-toolbar .table-page-pager button,
.plan-erp-view .table-page-size select,
.plan-erp-view .table-page-pager button {
  height: 24px;
  border-radius: 2px;
}

.plans-table-wrap {
  height: calc(100vh - 212px);
  max-height: calc(100vh - 212px);
  overflow: auto;
  border: 1px solid #d8e1ec;
  border-bottom: 0;
  background: #fff;
  box-shadow: inset 0 1px 0 #f8fafc;
}

.plan-workflow-view .production-table-wrap {
  height: calc(100vh - 212px);
  max-height: calc(100vh - 212px);
  border-bottom: 0;
  background: #f7fbff;
}

.plan-reorder-table {
  width: max(100%, 1814px);
  min-width: 1814px;
  table-layout: fixed;
}

.plan-reorder-table th,
.plan-reorder-table td {
  box-sizing: border-box;
  padding: 6px 8px;
  vertical-align: middle;
}

.plan-reorder-table .reprint-col-date { width: 100px; }
.plan-reorder-table .reprint-col-image { width: 72px; }
.plan-reorder-table .reprint-col-style { width: 92px; }
.plan-reorder-table .reprint-col-store { width: 140px; }
.plan-reorder-table .reprint-col-operator { width: 82px; }
.plan-reorder-table .reprint-col-reason { width: 430px; }
.plan-reorder-table .reprint-col-compare { width: 390px; }
.plan-reorder-table .reprint-col-finish { width: 118px; }
.plan-reorder-table .reprint-col-person { width: 90px; }
.plan-reorder-table .reprint-col-summary { width: 300px; }
.plan-reorder-table .reprint-col-default { width: 110px; }

.plan-reorder-table td.reprint-col-reason,
.plan-reorder-table td.reprint-col-compare,
.plan-reorder-table td.reprint-col-summary {
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.plan-reorder-table td.reprint-col-date,
.plan-reorder-table td.reprint-col-finish {
  white-space: nowrap;
}

.plan-reorder-table td.image-col {
  min-width: 72px;
  max-width: 72px;
}

.plan-order-record-table {
  width: max-content;
  min-width: 1480px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.plan-order-record-table th,
.plan-order-record-table td {
  height: 34px;
  padding: 5px 8px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-order-record-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #eef3f9;
  color: #21334d;
}

.plan-order-record-table tbody td {
  background: #fffdf2;
}

.plan-order-record-table tbody tr:nth-child(even) td {
  background: #f7fbff;
}

.plan-order-record-table tbody tr:hover td {
  background: #eaf4ff;
}

.plan-order-record-table tbody tr.selected td {
  background: #e7f1ff;
}

.plan-order-record-table .plan-order-col-select { width: 38px; }
.plan-order-record-table .plan-order-col-select input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  margin: 0;
  vertical-align: middle;
}
.plan-order-record-table .plan-order-col-index { width: 48px; }
.plan-order-record-table .plan-order-col-date { width: 96px; }
.plan-order-record-table .plan-order-col-image { width: 44px; }
.plan-order-record-table .plan-order-col-style { width: 118px; }
.plan-order-record-table .plan-order-col-color { width: 126px; }
.plan-order-record-table .plan-order-col-qty { width: 70px; }
.plan-order-record-table .plan-order-col-material { width: 92px; }
.plan-order-record-table .plan-order-col-merchandiser { width: 82px; }
.plan-order-record-table .plan-order-col-factory { width: 132px; }
.plan-order-record-table .plan-order-col-tag { width: 72px; }
.plan-order-record-table .plan-order-col-order { width: 132px; }
.plan-order-record-table .plan-order-col-batch { width: 142px; }
.plan-order-record-table .plan-order-col-production { width: 132px; }
.plan-order-record-table .plan-order-col-work { width: 132px; }
.plan-order-record-table .plan-order-col-note { width: 180px; }
.plan-order-record-table .plan-order-col-action { width: 104px; }

.plan-material-table tbody td {
  background: #fffdf2;
}

.plan-material-table tbody tr:nth-child(even) td {
  background: #f7fbff;
}

.plan-material-table tbody tr.selected td {
  background: #e7f1ff;
}

.plan-material-table .plan-order-col-select {
  width: 38px;
}

.plan-material-table .plan-order-col-select input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  margin: 0;
  vertical-align: middle;
}

.plan-material-table .summary-thumb,
.business-flow-table .summary-thumb {
  width: 34px;
  height: 34px;
}

.subtle-help {
  transform: scale(.86);
  opacity: .72;
}
.plan-order-record-table .plan-order-col-default { width: 110px; }
.plan-order-record-table .plan-order-col-filler {
  width: auto;
  min-width: 180px;
  color: transparent;
  pointer-events: none;
  background: #fff !important;
}

.plan-order-record-table thead .plan-order-col-filler {
  background: #eef3f9 !important;
}

.plan-order-record-table td.image-col {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  padding: 3px 4px;
}

.plan-order-record-table .summary-image-btn,
.plan-order-record-table .summary-thumb {
  width: 28px;
  height: 28px;
}

.plan-order-record-table .summary-image-btn {
  padding: 0;
}

.plan-order-record-table .summary-thumb {
  font-size: 10px;
  border-radius: 2px;
}

.plan-order-record-table .mini-btn {
  height: 24px;
  padding: 0 7px;
  border: 1px solid #cfe0f3;
  background: #fff;
  color: #1767bd;
  font-size: 12px;
  line-height: 22px;
  white-space: nowrap;
}

.plan-order-record-table .mini-btn:hover {
  border-color: #8ebdff;
  background: #edf6ff;
}

.plan-action-strip .ghost.danger {
  color: #b42318;
  border-color: #f4b8b1;
  background: #fff8f7;
}

.plan-action-strip .ghost.danger:hover {
  border-color: #e27b73;
  background: #fff1ef;
}

.business-flow-mapping-bar {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  overflow-x: auto;
  border-bottom: 1px solid #dce6f2;
  background: #fff;
}

.business-flow-map-item {
  flex: 0 0 auto;
  display: grid;
  gap: 1px;
  min-width: 168px;
  max-width: 240px;
  padding: 5px 8px;
  border: 1px solid #dbe6f2;
  background: #f8fbff;
  color: #32445c;
  font-size: 11px;
}

.business-flow-map-item.active {
  border-color: #8ebdff;
  background: #edf6ff;
}

.business-flow-map-item strong {
  color: #1f3350;
  font-size: 12px;
}

.business-flow-map-item span,
.business-flow-map-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  color: #65758b;
}

.business-flow-placeholder {
  display: grid;
  gap: 8px;
  margin: 12px;
  min-height: 220px;
  align-content: center;
  justify-items: center;
  border: 1px dashed #c8d8ec;
  background: #fff;
  color: #69788c;
  text-align: center;
}

.business-flow-placeholder strong {
  color: #1f3350;
  font-size: 14px;
}

.business-flow-placeholder span {
  max-width: 720px;
  line-height: 1.7;
}

.page-connection-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 10px 12px 0;
  padding: 10px 12px;
  border: 1px solid #d8e3ef;
  border-left: 3px solid #7c93ad;
  background: #f6f9fc;
  color: #52657c;
}

.page-connection-notice > div {
  display: grid;
  gap: 3px;
}

.page-connection-notice strong {
  color: #263e59;
  font-size: 13px;
}

.page-connection-notice span:not(.page-connection-badge) {
  line-height: 1.55;
}

.page-connection-badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  border: 1px solid #b9c8d8;
  border-radius: 2px;
  background: #e8eef5;
  color: #526b85;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
}

.replenishment-setting-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  max-width: 1180px;
}

.replenishment-editor-section {
  padding: 14px 16px 16px;
  border-bottom: 1px solid #e6edf5;
}

.replenishment-editor-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.replenishment-editor-title strong {
  color: #1d2f47;
  font-size: 13px;
}

.replenishment-editor-title span {
  color: #7a8799;
  font-size: 12px;
}

.replenishment-editor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #dce5ef;
  border-left: 1px solid #dce5ef;
}

.replenishment-editor-field {
  min-height: 78px;
  padding: 10px 12px;
  border-right: 1px solid #dce5ef;
  border-bottom: 1px solid #dce5ef;
  background: #fbfcfe;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.replenishment-editor-field > span:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.replenishment-editor-field strong {
  color: #243a55;
  font-size: 13px;
}

.replenishment-editor-field em {
  color: #8290a2;
  font-size: 11px;
  font-style: normal;
  line-height: 1.4;
}

.replenishment-editor-field select {
  width: 132px;
  min-width: 132px;
}

.replenishment-toggle-field > input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0 6px;
}

.setting-input-with-unit {
  display: inline-grid;
  grid-template-columns: 72px 30px;
  align-items: center;
  min-width: 102px;
  height: 32px;
  border: 1px solid #cbd8e6;
  background: #fff;
}

.setting-input-with-unit input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 7px;
  border: 0;
  background: transparent;
  text-align: right;
}

.setting-input-with-unit i {
  color: #708197;
  font-size: 12px;
  font-style: normal;
  text-align: center;
}

.replenishment-rule-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #dce5ef;
  background: #f7fafd;
}

.replenishment-rule-controls > label,
.replenishment-stop-rule {
  min-height: 58px;
  padding: 8px 12px;
  border-right: 1px solid #dce5ef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #51657a;
  font-size: 12px;
}

.replenishment-rule-controls > :last-child {
  border-right: 0;
}

.replenishment-stop-rule strong {
  color: #a33a2b;
  font-size: 13px;
}

.replenishment-platform-rules {
  margin-top: 10px;
  border-top: 1px solid #dce5ef;
  border-left: 1px solid #dce5ef;
}

.replenishment-platform-rule {
  display: grid;
  grid-template-columns: 1.1fr repeat(3, minmax(0, 1fr));
}

.replenishment-platform-name,
.replenishment-rate-band {
  min-height: 68px;
  padding: 9px 12px;
  border-right: 1px solid #dce5ef;
  border-bottom: 1px solid #dce5ef;
}

.replenishment-platform-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: #f4f7fb;
}

.replenishment-platform-name strong {
  color: #21364f;
  font-size: 13px;
}

.replenishment-platform-name span {
  color: #6f8197;
  font-size: 12px;
}

.replenishment-rate-band {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  gap: 3px 8px;
  background: #fff;
}

.replenishment-rate-band span {
  grid-column: 1 / -1;
  color: #8290a2;
  font-size: 11px;
}

.replenishment-rate-band strong {
  color: #2b4058;
  font-size: 13px;
}

.replenishment-rate-band em {
  color: #376a9c;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.replenishment-rate-multiplier {
  display: grid;
  grid-template-columns: 54px 22px;
  align-items: center;
  height: 30px;
  border: 1px solid #b9cde1;
  background: #fff;
}

.replenishment-rate-multiplier input {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: #245f96;
  font-weight: 700;
  text-align: right;
}

.replenishment-rate-multiplier i {
  color: #708197;
  font-size: 11px;
  font-style: normal;
}

.replenishment-rate-band.is-stop {
  background: #fff8f6;
}

.replenishment-rate-band.is-stop em {
  color: #a33a2b;
}

.setting-model-summary {
  margin: 12px 16px 4px;
  padding: 10px 12px;
  border-left: 3px solid #2f7fd3;
  background: #f4f8fc;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
  color: #526980;
  font-size: 12px;
  line-height: 1.6;
}

.setting-model-summary strong {
  color: #24496f;
}

#replenishmentModelSettingsCard .setting-editor-row {
  display: flex;
  justify-content: flex-end;
  padding: 10px 16px 14px;
}

#replenishmentModelSettingsCard .setting-editor-row .primary {
  min-width: 150px;
}

.setting-control-row {
  cursor: default;
}

.setting-control-row > input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0 8px;
}

.setting-control-row .setting-number-input {
  width: 104px;
  min-width: 104px;
  text-align: right;
}

.setting-model-formula {
  margin: 10px 12px 4px;
  padding: 10px 12px;
  border: 1px solid #cfe0ef;
  background: #f4f9fd;
  color: #35516d;
  line-height: 1.6;
}

.setting-inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e9f0;
  background: #fbfcfe;
}

.setting-inline-fields label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #51657a;
}

.setting-inline-fields input {
  width: 92px;
  text-align: right;
}

.setting-inline-fields em {
  color: #728399;
  font-style: normal;
}

@media (max-width: 1180px) {
  .replenishment-setting-grid {
    grid-template-columns: 1fr;
  }

  .replenishment-editor-grid,
  .replenishment-rule-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .replenishment-platform-rule {
    grid-template-columns: 1fr repeat(3, minmax(140px, 1fr));
    min-width: 720px;
  }

  .replenishment-platform-rules {
    overflow-x: auto;
  }
}

.product-event-filter-grid {
  grid-template-columns: minmax(260px, 1.4fr) 180px 150px 150px minmax(330px, auto);
}

.product-event-notice {
  margin-bottom: 10px;
}

.product-event-table-wrap {
  max-height: calc(100vh - 295px);
}

.product-event-table {
  min-width: 1780px;
}

.product-event-table th:nth-child(1) { width: 150px; }
.product-event-table th:nth-child(2) { width: 125px; }
.product-event-table th:nth-child(3) { width: 130px; }
.product-event-table th:nth-child(4) { width: 110px; }
.product-event-table th:nth-child(5) { width: 160px; }
.product-event-table th:nth-child(6),
.product-event-table th:nth-child(7) { width: 100px; }

.product-event-type {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid #bcd2e5;
  background: #eef6fc;
  color: #315f85;
  white-space: nowrap;
}

.plan-table.plan-pending,
.plan-table.plan-with-audit {
  width: max-content;
  min-width: 2288px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.plan-table.plan-with-audit {
  min-width: 2420px;
}

.plan-table.plan-pending th,
.plan-table.plan-pending td,
.plan-table.plan-with-audit th,
.plan-table.plan-with-audit td {
  height: 44px;
  padding: 5px 7px;
  border-color: #e3eaf3;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  background-clip: padding-box;
}

.plan-table.plan-pending thead th,
.plan-table.plan-with-audit thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  height: 34px;
  background: #eef3f9;
  color: #21334d;
  font-weight: 800;
  box-shadow: inset 0 -1px 0 #d4deea;
}

.plan-table.plan-pending tbody tr:nth-child(odd),
.plan-table.plan-with-audit tbody tr:nth-child(odd) {
  background: #fffdf2;
}

.plan-table.plan-pending tbody tr:nth-child(even),
.plan-table.plan-with-audit tbody tr:nth-child(even) {
  background: #f7fbff;
}

.plan-table.plan-pending tbody tr:hover,
.plan-table.plan-with-audit tbody tr:hover,
.plan-table.plan-pending tbody tr.selected,
.plan-table.plan-with-audit tbody tr.selected {
  background: #eaf4ff;
}

.plan-table.plan-pending tbody tr:hover td,
.plan-table.plan-with-audit tbody tr:hover td,
.plan-table.plan-pending tbody tr.selected td,
.plan-table.plan-with-audit tbody tr.selected td {
  background-color: #eaf4ff;
}

.plan-table tbody td.plan-action-cell {
  background: inherit;
}

.plan-table.plan-pending th:nth-child(1),
.plan-table.plan-pending td:nth-child(1),
.plan-table.plan-with-audit th:nth-child(1),
.plan-table.plan-with-audit td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 8;
  width: 44px;
  min-width: 44px;
  padding-left: 4px;
  padding-right: 4px;
  background: inherit;
  box-shadow: 1px 0 0 #d8e1ec;
}

.plan-table.plan-pending th:nth-child(1),
.plan-table.plan-with-audit th:nth-child(1) {
  z-index: 11;
  background: #eef3f9;
}

.plan-table.plan-pending th:nth-child(2),
.plan-table.plan-pending td:nth-child(2),
.plan-table.plan-with-audit th:nth-child(2),
.plan-table.plan-with-audit td:nth-child(2) {
  position: sticky;
  left: 44px;
  z-index: 8;
  width: 142px;
  min-width: 142px;
  background: inherit;
  box-shadow: 1px 0 0 #d8e1ec;
}

.plan-table.plan-pending th:nth-child(2),
.plan-table.plan-with-audit th:nth-child(2) {
  z-index: 11;
  background: #eef3f9;
}

.plan-table.plan-pending th:nth-child(3),
.plan-table.plan-pending td:nth-child(3),
.plan-table.plan-with-audit th:nth-child(3),
.plan-table.plan-with-audit td:nth-child(3) {
  width: 58px;
  min-width: 58px;
  padding-left: 4px;
  padding-right: 4px;
}

.plan-table.plan-pending th:nth-child(4),
.plan-table.plan-pending td:nth-child(4),
.plan-table.plan-with-audit th:nth-child(4),
.plan-table.plan-with-audit td:nth-child(4) { width: 136px; }

.plan-table.plan-pending th:nth-child(5),
.plan-table.plan-pending td:nth-child(5),
.plan-table.plan-with-audit th:nth-child(5),
.plan-table.plan-with-audit td:nth-child(5) { width: 96px; }

.plan-table.plan-pending th:nth-child(6),
.plan-table.plan-pending td:nth-child(6),
.plan-table.plan-with-audit th:nth-child(6),
.plan-table.plan-with-audit td:nth-child(6) { width: 86px; }

.plan-table.plan-pending th:nth-child(7),
.plan-table.plan-pending td:nth-child(7),
.plan-table.plan-pending th:nth-child(8),
.plan-table.plan-pending td:nth-child(8),
.plan-table.plan-pending th:nth-child(9),
.plan-table.plan-pending td:nth-child(9),
.plan-table.plan-with-audit th:nth-child(7),
.plan-table.plan-with-audit td:nth-child(7),
.plan-table.plan-with-audit th:nth-child(8),
.plan-table.plan-with-audit td:nth-child(8),
.plan-table.plan-with-audit th:nth-child(9),
.plan-table.plan-with-audit td:nth-child(9) { width: 64px; }

.plan-table.plan-pending th:nth-child(10),
.plan-table.plan-pending td:nth-child(10),
.plan-table.plan-with-audit th:nth-child(10),
.plan-table.plan-with-audit td:nth-child(10) { width: 82px; }

.plan-table.plan-pending th:nth-child(11),
.plan-table.plan-pending td:nth-child(11),
.plan-table.plan-pending th:nth-child(12),
.plan-table.plan-pending td:nth-child(12),
.plan-table.plan-with-audit th:nth-child(11),
.plan-table.plan-with-audit td:nth-child(11),
.plan-table.plan-with-audit th:nth-child(12),
.plan-table.plan-with-audit td:nth-child(12) { width: 104px; }

.plan-table.plan-pending th:nth-child(13),
.plan-table.plan-pending td:nth-child(13),
.plan-table.plan-pending th:nth-child(14),
.plan-table.plan-pending td:nth-child(14),
.plan-table.plan-pending th:nth-child(15),
.plan-table.plan-pending td:nth-child(15),
.plan-table.plan-pending th:nth-child(16),
.plan-table.plan-pending td:nth-child(16),
.plan-table.plan-pending th:nth-child(17),
.plan-table.plan-pending td:nth-child(17),
.plan-table.plan-with-audit th:nth-child(13),
.plan-table.plan-with-audit td:nth-child(13),
.plan-table.plan-with-audit th:nth-child(14),
.plan-table.plan-with-audit td:nth-child(14),
.plan-table.plan-with-audit th:nth-child(15),
.plan-table.plan-with-audit td:nth-child(15),
.plan-table.plan-with-audit th:nth-child(16),
.plan-table.plan-with-audit td:nth-child(16),
.plan-table.plan-with-audit th:nth-child(17),
.plan-table.plan-with-audit td:nth-child(17) { width: 92px; }

.plan-table.plan-pending th:nth-child(18),
.plan-table.plan-pending td:nth-child(18),
.plan-table.plan-with-audit th:nth-child(18),
.plan-table.plan-with-audit td:nth-child(18) { width: 92px; }

.plan-table.plan-pending th:nth-child(19),
.plan-table.plan-pending td:nth-child(19),
.plan-table.plan-with-audit th:nth-child(19),
.plan-table.plan-with-audit td:nth-child(19) { width: 96px; }

.plan-table.plan-pending th:nth-child(20),
.plan-table.plan-pending td:nth-child(20),
.plan-table.plan-with-audit th:nth-child(20),
.plan-table.plan-with-audit td:nth-child(20) {
  width: 220px;
  white-space: normal;
  word-break: break-word;
}

.plan-table.plan-pending th:nth-child(21),
.plan-table.plan-pending td:nth-child(21),
.plan-table.plan-with-audit th:nth-child(21),
.plan-table.plan-with-audit td:nth-child(21) {
  width: 82px;
  white-space: normal;
}

.plan-table th.plan-audit-note-cell,
.plan-table td.plan-audit-note-cell {
  right: auto !important;
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
  white-space: normal;
  word-break: break-word;
  box-shadow: none !important;
}

.plan-table th.plan-status-cell,
.plan-table td.plan-status-cell {
  right: auto !important;
  width: 82px !important;
  min-width: 82px !important;
  max-width: 82px !important;
  box-shadow: none !important;
}

.plan-table tbody td.plan-audit-note-cell,
.plan-table tbody td.plan-status-cell {
  position: static !important;
  z-index: auto !important;
}

.plan-table thead th.plan-audit-note-cell,
.plan-table thead th.plan-status-cell {
  position: sticky !important;
  top: 0;
  z-index: 6 !important;
  background: #eef3f9;
  box-shadow: inset 0 -1px 0 #d4deea !important;
}

.plan-table th.plan-action-cell,
.plan-table td.plan-action-cell {
  position: sticky !important;
  right: 0 !important;
  z-index: 9 !important;
  width: 184px !important;
  min-width: 184px !important;
  max-width: 184px !important;
  background: inherit;
  box-shadow: -1px 0 0 #d8e1ec;
}

.plan-table th.plan-action-cell {
  z-index: 12 !important;
  background: #eef3f9;
}

.plan-table.plan-pending tbody tr:nth-child(odd) td,
.plan-table.plan-with-audit tbody tr:nth-child(odd) td {
  background-color: #fffdf2;
}

.plan-table.plan-pending tbody tr:nth-child(even) td,
.plan-table.plan-with-audit tbody tr:nth-child(even) td {
  background-color: #f7fbff;
}

.plan-table.plan-pending tbody tr:hover td,
.plan-table.plan-with-audit tbody tr:hover td,
.plan-table.plan-pending tbody tr.selected td,
.plan-table.plan-with-audit tbody tr.selected td {
  background-color: #eaf4ff;
}

.plan-table td.plan-action-cell {
  background-color: inherit;
  background-clip: border-box;
}

.plan-table.plan-pending tbody tr:nth-child(odd) td.plan-action-cell,
.plan-table.plan-with-audit tbody tr:nth-child(odd) td.plan-action-cell {
  background-color: #fffdf2;
}

.plan-table.plan-pending tbody tr:nth-child(even) td.plan-action-cell,
.plan-table.plan-with-audit tbody tr:nth-child(even) td.plan-action-cell {
  background-color: #f7fbff;
}

.plan-table.plan-pending tbody tr:hover td.plan-action-cell,
.plan-table.plan-with-audit tbody tr:hover td.plan-action-cell,
.plan-table.plan-pending tbody tr.selected td.plan-action-cell,
.plan-table.plan-with-audit tbody tr.selected td.plan-action-cell {
  background-color: #eaf4ff;
}

.plan-table.plan-pending tbody tr:nth-child(odd) td.plan-type-cell,
.plan-table.plan-with-audit tbody tr:nth-child(odd) td.plan-type-cell {
  background-color: #fffdf2;
}

.plan-table.plan-pending tbody tr:nth-child(even) td.plan-type-cell,
.plan-table.plan-with-audit tbody tr:nth-child(even) td.plan-type-cell {
  background-color: #f7fbff;
}

.plan-table.plan-pending tbody tr:hover td.plan-type-cell,
.plan-table.plan-with-audit tbody tr:hover td.plan-type-cell,
.plan-table.plan-pending tbody tr.selected td.plan-type-cell,
.plan-table.plan-with-audit tbody tr.selected td.plan-type-cell {
  background-color: #eaf4ff;
}

.plan-select-cell input,
#planSelectCurrentPage {
  width: 15px;
  height: 15px;
  min-width: 15px;
  margin: 0;
}

.plan-code-cell {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
}

.plan-source-badge {
  flex: 0 0 auto;
  height: 18px;
  padding: 0 5px;
  border: 1px solid #c8d8ec;
  background: #f4f8fd;
  color: #4a607c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}

.plan-source-badge.imported {
  border-color: #f1c36d;
  background: #fff8e8;
  color: #a26300;
}

.plan-source-badge.online {
  border-color: #b8d7ff;
  background: #edf6ff;
  color: #1767bd;
}

.plan-code-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted-cell {
  color: #9aa8b8;
}

.plan-value-source-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
}

.plan-value-source {
  flex: 0 0 auto;
  height: 17px;
  padding: 0 4px;
  border: 1px solid #d2deec;
  background: #f7f9fc;
  color: #5c6b7d;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
}

.plan-value-source.online {
  border-color: #b8d7ff;
  background: #eef6ff;
  color: #1767bd;
}

.plan-value-source.offline {
  border-color: #f1c36d;
  background: #fff8e8;
  color: #a26300;
}

.plan-value-link {
  min-width: 0;
}

.plan-value-text {
  color: #21334d;
  font-weight: 700;
}

.table-source-help {
  margin-left: 2px;
  color: #d93025;
  display: inline;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
}

.plan-table.plan-pending .summary-image-btn,
.plan-table.plan-with-audit .summary-image-btn,
.plan-table.plan-pending .summary-thumb,
.plan-table.plan-with-audit .summary-thumb {
  width: 38px;
  height: 38px;
}

.plan-actions {
  width: 100%;
  gap: 5px;
}

.plan-actions button {
  height: 26px;
  min-width: 42px;
  padding: 0 8px;
  border-radius: 2px;
  font-size: 12px;
}

.plan-actions .primary {
  font-weight: 800;
}

.plan-share-stack,
.plan-return-rate-stack {
  gap: 2px;
}

.historical-return-filter {
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 8px;
  align-items: center;
}

.historical-return-actions {
  flex: 0 0 auto;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.historical-return-view .section-head {
  align-items: flex-start;
  gap: 16px;
}

.historical-return-view .section-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.historical-return-import-control {
  display: flex;
  max-width: 380px;
  align-items: flex-end;
  flex-direction: column;
  gap: 3px;
}

#historicalReturnImportBtn.is-busy {
  border-color: #e3bd67;
  background: #fff8e8;
  color: #805b13;
}

.historical-return-import-status {
  max-width: 380px;
  color: #687b91;
  font-size: 10px;
  line-height: 1.35;
  text-align: right;
}

.historical-return-import-status.warn {
  color: #8a650f;
}

.historical-return-import-status.success {
  color: #15805f;
}

.historical-return-import-status.error {
  color: #c83b42;
}

.historical-return-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 8px;
  margin: 8px 0 10px;
}

.historical-return-summary div {
  border: 1px solid #dbe6f4;
  background: #f8fbff;
  padding: 9px 10px;
}

.historical-return-summary span {
  display: block;
  color: #60718a;
  font-size: 12px;
}

.historical-return-summary strong {
  display: block;
  margin-top: 3px;
  color: #1f3654;
  font-size: 18px;
}

.historical-return-summary .historical-return-empty-card {
  grid-column: 1 / -1;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.historical-return-summary .historical-return-empty-card strong {
  flex: 0 0 auto;
  margin: 0;
  font-size: 14px;
}

.historical-return-summary .historical-return-empty-card span {
  margin: 0;
}

.historical-return-chart {
  display: grid;
  gap: 8px;
  min-height: 88px;
}

.historical-return-bar-row {
  display: grid;
  grid-template-columns: 110px minmax(160px, 1fr) 72px 130px;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  font-size: 12px;
}

.historical-return-bar-label {
  color: #23384f;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.historical-return-bar-track {
  height: 12px;
  background: #eef3fa;
  border: 1px solid #d7e1ef;
  overflow: hidden;
}

.historical-return-bar-track span {
  display: block;
  height: 100%;
  background: #1677d2;
}

.historical-return-bar-row strong {
  color: #0b70d1;
  text-align: right;
}

.historical-return-bar-row em {
  color: #60718a;
  font-style: normal;
  text-align: right;
}

.historical-return-wrap {
  max-height: calc(100vh - 360px);
}

.historical-return-table {
  min-width: 1420px;
}

.historical-return-table th,
.historical-return-table td {
  text-align: center;
  vertical-align: middle;
}

.historical-return-source-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 7px 9px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #7a899a;
  font-size: 10px;
}

.historical-return-source-bar span {
  flex: 0 0 auto;
  color: #8a98a8;
  font-weight: 700;
}

.historical-return-source-bar strong {
  min-width: 0;
  color: #6e7e90;
  font-weight: 400;
}

.arrival-flow-filter {
  display: grid;
  grid-template-columns: 160px 128px 128px 128px 140px 180px 150px 150px 150px 92px;
  gap: 8px;
  align-items: center;
  justify-content: start;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.arrival-flow-filter > input,
.arrival-flow-filter > select,
.arrival-flow-date-field,
.arrival-flow-date-trigger {
  width: 100%;
  min-width: 0;
}

.arrival-flow-date-trigger {
  height: 32px;
  padding: 0 30px 0 10px;
  border: 1px solid #cbd7e6;
  border-radius: 2px;
  background:
    linear-gradient(45deg, transparent 50%, #6b7c92 50%) calc(100% - 13px) 13px / 5px 5px no-repeat,
    linear-gradient(135deg, #6b7c92 50%, transparent 50%) calc(100% - 8px) 13px / 5px 5px no-repeat,
    #fff;
  color: #34445a;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.arrival-flow-date-trigger:hover {
  border-color: #8fb5e6;
}

.arrival-flow-date-trigger:focus-visible,
.arrival-flow-date-trigger.is-open {
  border-color: #2f7edb;
  box-shadow: 0 0 0 1px rgba(47, 126, 219, 0.18);
  outline: none;
}

.arrival-flow-date-trigger.has-value {
  color: #17283f;
}

.arrival-flow-date-popover {
  position: fixed;
  z-index: 1200;
  width: 292px;
  padding: 10px 12px 8px;
  border: 1px solid #cbd7e6;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(33, 57, 87, 0.18);
}

.arrival-flow-date-popover[hidden] {
  display: none;
}

.arrival-flow-calendar-head {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  margin-bottom: 6px;
}

.arrival-flow-calendar-head strong {
  color: #24354c;
  font-size: 14px;
  text-align: center;
}

.arrival-flow-calendar-nav {
  height: 28px;
  border: 0;
  background: transparent;
  color: #72839a;
  font-size: 18px;
  cursor: pointer;
}

.arrival-flow-calendar-nav:hover {
  color: #1677e8;
  background: #f2f7fd;
}

.arrival-flow-calendar-weekdays,
.arrival-flow-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.arrival-flow-calendar-weekdays span {
  padding: 6px 0;
  color: #6e7f96;
  font-size: 12px;
}

.arrival-flow-calendar-day {
  height: 32px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #33445b;
  font-size: 12px;
  cursor: pointer;
}

.arrival-flow-calendar-day:hover {
  background: #eaf3ff;
  color: #126ed0;
}

.arrival-flow-calendar-day.is-outside {
  color: #a9b5c4;
}

.arrival-flow-calendar-day.is-today {
  color: #1677e8;
  font-weight: 700;
}

.arrival-flow-calendar-day.is-selected {
  background: #1677e8;
  color: #fff;
  font-weight: 700;
}

.arrival-flow-calendar-shortcuts {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin: 8px -4px -2px;
  padding-top: 8px;
  border-top: 1px solid #e1e8f1;
}

.arrival-flow-calendar-shortcuts button {
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: #1677e8;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.arrival-flow-calendar-shortcuts button:hover {
  text-decoration: underline;
}

.arrival-flow-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 8px;
}

.arrival-flow-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #d6e2f0;
  background: #f8fbff;
  color: #21334d;
  font-size: 12px;
}

.arrival-flow-source-pill span {
  color: #60718a;
}

.arrival-flow-view {
  height: 100%;
  overflow: hidden;
}

.arrival-flow-view .section-head {
  flex: 0 0 auto;
  margin-bottom: 6px;
}

.arrival-flow-view .section-head p {
  margin-top: 2px;
}

.arrival-flow-view .filter-panel,
.arrival-flow-view #arrivalFlowMeta,
.arrival-flow-view .arrival-flow-summary,
.arrival-flow-view .arrival-flow-sources {
  flex: 0 0 auto;
}

.table-wrap.compact.arrival-flow-wrap {
  flex: 1 1 0;
  height: auto;
  min-height: 420px;
  max-height: none;
  overscroll-behavior: contain;
}

.arrival-flow-table {
  min-width: 1560px;
}

.arrival-flow-table th,
.arrival-flow-table td {
  height: 38px;
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
}

.arrival-flow-table thead th {
  top: 0;
  z-index: 3;
  height: 36px;
  background: #f3f6fa;
  box-shadow: inset 0 -1px 0 #d8e1ec;
}

.arrival-flow-table th:nth-child(14),
.arrival-flow-table td:nth-child(14),
.arrival-flow-table th:nth-child(15),
.arrival-flow-table td:nth-child(15) {
  max-width: 240px;
  white-space: normal;
  word-break: break-word;
}

.plan-table tbody tr {
  height: 68px;
}

.plan-table tbody td {
  height: 68px;
  max-height: 68px;
  vertical-align: middle;
  line-height: 1.25;
}

.plan-table tbody td:nth-child(19),
.plan-table tbody td:nth-child(20) {
  display: table-cell;
  max-height: 68px;
}

.plan-table .plan-compare-cell {
  display: inline-grid;
  gap: 2px;
  min-width: 62px;
  justify-items: center;
  align-content: center;
  line-height: 1.15;
}

.plan-table .plan-compare-cell span {
  display: grid;
  grid-template-columns: 24px minmax(28px, auto);
  gap: 3px;
  align-items: center;
  min-height: 17px;
}

.plan-table .plan-compare-cell em {
  color: #7a8799;
  font-style: normal;
  font-size: 11px;
}

.plan-table .plan-compare-cell strong {
  color: #12304f;
  font-weight: 700;
}

.plan-table .plan-reason-preview {
  display: block;
  width: 100%;
  overflow: hidden;
  color: #21334d;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-reason-fulltext {
  min-height: 120px;
  padding: 12px;
  border: 1px solid #dbe6f3;
  background: #fbfdff;
  color: #1f2f46;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* purchase-erp-ui: global shell polish */
.topbar {
  height: 46px;
  flex-basis: 46px;
  background: #fbfdff;
  border-bottom-color: #d6e0ec;
  box-shadow: 0 1px 0 rgba(15, 35, 60, 0.04);
}

.top-actions button,
.toolbar button,
.jst-filter-grid button,
.table-page-tools button,
.modal-actions button {
  border-radius: 2px;
  font-weight: 600;
}

.top-actions .primary,
.jst-filter-grid .primary,
.modal-actions .primary {
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.sidebar {
  background: #138bd8;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.08);
}

.brand {
  height: 52px;
  letter-spacing: 0;
}

.nav {
  height: 46px;
  font-weight: 600;
}

.nav.active {
  background: #0b75bd;
  box-shadow: inset 3px 0 0 #ffffff;
}

.nav:hover {
  background: #0d7eca;
}

.workspace-tab {
  min-width: 104px;
  background: #eef3f8;
}

.workspace-tab.active {
  color: #0b63ce;
  background: #fff;
}

.modal {
  background: rgba(17, 29, 43, 0.34);
}

.modal-panel {
  border-color: #cad6e4;
  box-shadow: 0 22px 58px rgba(20, 36, 56, 0.24);
}

.modal-head {
  background: #fbfdff;
}

.modal-head h2 {
  color: #182b42;
  font-weight: 700;
}

.modal-actions {
  padding-top: 10px;
  border-top: 1px solid #e5ebf3;
}

/* purchase-erp-ui: commodity summary filter area */
.summary-view .summary-filter-panel {
  min-height: 74px;
  max-height: 74px;
  margin: 0 -16px 8px;
  padding: 9px 10px 8px;
  overflow: hidden;
  background: #f4f7fb;
  border-bottom: 1px solid #ccd8e6;
  box-shadow: inset 0 -1px 0 #e8eef5;
}

.summary-filter-grid {
  grid-template-columns:
    minmax(0, 132fr)
    minmax(0, 132fr)
    minmax(0, 126fr)
    minmax(0, 74fr)
    minmax(0, 74fr)
    minmax(0, 126fr)
    minmax(0, 74fr)
    minmax(0, 74fr)
    minmax(0, 104fr)
    minmax(0, 96fr)
    minmax(0, 118fr)
    minmax(0, 108fr)
    minmax(0, 74fr)
    minmax(0, 74fr)
    minmax(0, 112fr)
    minmax(0, 112fr);
  grid-auto-rows: 30px;
  gap: 6px;
  align-items: center;
  justify-content: start;
  overflow: hidden;
}

.summary-filter-grid input,
.summary-filter-grid select {
  height: 30px;
  min-width: 0;
  padding-inline: 4px;
  border: 1px solid #c5d1df;
  background: #fff;
  color: #26384f;
  font-size: clamp(10px, 0.65vw, 12px);
}

.summary-filter-grid input::placeholder {
  color: #7d8ca0;
}

.summary-filter-grid input:hover,
.summary-filter-grid select:hover {
  border-color: #8ea7c1;
}

.summary-filter-grid .jst-check {
  justify-content: flex-start;
  min-width: 0;
  height: 28px;
  color: #526174;
  font-size: 12px;
}

.summary-filter-grid .jst-check input {
  width: 14px;
  height: 14px;
}

.summary-filter-grid .filter-action-strip,
.summary-action-strip {
  grid-column: 1 / -1;
  justify-content: flex-start;
  gap: 0;
  height: 30px;
  padding: 0;
  border-left: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.summary-action-strip button {
  flex: 0 0 auto;
  min-width: 56px;
  height: 30px;
  margin-left: -1px;
  padding: 0 12px;
  border-color: #c8d3df;
  border-radius: 0;
  background: #f9fbfd;
  color: #30445c;
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}

.summary-action-strip::-webkit-scrollbar {
  height: 4px;
}

.summary-action-strip::-webkit-scrollbar-track {
  background: transparent;
}

.summary-action-strip::-webkit-scrollbar-thumb {
  background: #c8d3e1;
  border-radius: 999px;
}

.summary-action-strip button:first-child {
  margin-left: 0;
  border-radius: 2px 0 0 2px;
}

.summary-action-strip button:last-child {
  border-radius: 0 2px 2px 0;
}

.summary-action-strip button:hover:not(:disabled) {
  position: relative;
  z-index: 1;
  border-color: #8eb2d8;
  color: #1c5f9f;
  background: #edf4fb;
}

.summary-action-strip .primary {
  min-width: 72px;
  border-color: #176fb8;
  background: #176fb8;
  color: #fff;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.summary-action-strip .primary:hover:not(:disabled) {
  border-color: #0f5e9f;
  background: #0f5e9f;
  color: #fff;
}

.summary-action-strip .quick-filter-save {
  min-width: 118px;
}

.summary-action-strip .filter-action-plan {
  min-width: 86px;
  max-width: 190px;
  color: #8c8c8c;
  border-color: #d7e0eb;
  background: #f5f7fa;
}

.summary-action-strip .filter-action-plan {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-action-strip .filter-action-plan:not(:disabled) {
  color: #0b63ce;
  border-color: #91caff;
  background: #f0f7ff;
}

.summary-action-strip .filter-action-export {
  min-width: 56px;
}

.summary-filter-grid .summary-action-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 82px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #c8d3df;
  border-radius: 2px;
  background: #f9fbfd;
  color: #30445c;
  font-size: 12px;
  font-weight: 600;
  line-height: 28px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.summary-action-strip .summary-action-toggle {
  flex: 0 0 auto;
  margin-left: 6px;
}

.summary-action-strip .summary-action-toggle + .summary-action-toggle {
  margin-left: 4px;
}

.summary-filter-grid .summary-action-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.summary-filter-grid .summary-action-toggle:hover {
  border-color: #8eb2d8;
  color: #1c5f9f;
  background: #edf4fb;
}

.summary-filter-grid .summary-action-toggle:has(input:checked) {
  border-color: #7ea6cf;
  color: #174f86;
  background: #e8f1fa;
}

.summary-action-strip > button,
.summary-action-strip > .summary-action-toggle {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  margin-left: -1px;
  padding-inline: clamp(4px, 0.55vw, 12px);
  overflow: hidden;
  font-size: clamp(10px, 0.65vw, 12px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-action-strip > .summary-action-toggle:first-of-type {
  margin-left: 6px;
}

.summary-action-strip > .summary-action-toggle + .summary-action-toggle {
  margin-left: -1px;
}

.summary-erp-toolbar {
  border-top: 1px solid #d8e2ee;
  background: #f7f9fc;
}

.summary-grid-table thead th {
  background: #eef3f9;
  color: #1d2f47;
  font-weight: 700;
}

.summary-grid-table tbody td {
  vertical-align: middle;
}

.summary-grid-table tbody tr:hover td {
  background-color: #eaf4ff;
}

/* purchase-erp-ui: commodity summary table discipline */
.summary-table-wrap {
  border: 1px solid #d9e2ee;
  border-radius: var(--erp-radius);
  background: #fff;
}

.summary-grid-table th,
.summary-grid-table td {
  border-right: 1px solid #e4eaf2;
  border-bottom: 1px solid #e4eaf2;
}

.summary-grid-table thead th {
  height: 36px;
  padding: 0 8px;
  background: var(--erp-head) !important;
  color: #1f3045;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.summary-grid-table tbody td {
  height: 72px;
  min-height: 72px;
  padding: 6px 8px;
  color: #25354a;
  font-size: 12px;
  line-height: 1.25;
}

.summary-grid-table tbody tr {
  background: #fffdf3;
}

.summary-grid-table tbody tr:nth-child(even) {
  background: #f4f8fd;
}

.summary-grid-table tbody tr:hover td {
  background: var(--erp-hover) !important;
}

.summary-grid-table .summary-number-col,
.summary-grid-table td.num.summary-number-col {
  text-align: center;
}

.summary-grid-table .summary-compact-num-col {
  white-space: nowrap;
}

.summary-grid-table thead th.summary-number-col,
.summary-grid-table thead th.summary-text-col,
.summary-grid-table thead th.summary-date-col,
.summary-grid-table thead th.summary-metric-col,
.summary-grid-table thead th.summary-style-col,
.summary-grid-table thead th.summary-color-col {
  text-align: center;
}

.summary-grid-table tbody td.summary-date-col {
  text-align: center;
}

.summary-grid-table .summary-date-col,
.summary-grid-table .summary-metric-col,
.summary-grid-table .tag-cell,
.summary-grid-table .follow-cell,
.summary-grid-table .image-col,
.summary-grid-table .row-no-col,
.summary-grid-table .expand-col {
  text-align: center;
}

.summary-grid-table .summary-text-col,
.summary-grid-table .code-cell {
  text-align: center;
}

.summary-grid-table .summary-style-col,
.summary-grid-table .summary-color-col {
  text-align: left;
}

.summary-grid-table .code-cell.summary-style-col {
  text-align: left;
}

.summary-grid-table .summary-style-col .linklike {
  color: #1677ff;
  font-weight: 700;
}

.summary-grid-table .summary-thumb,
.summary-grid-table .summary-image-btn {
  width: 48px;
  height: 56px;
  border-radius: var(--erp-radius);
}

.summary-grid-table .summary-image-btn {
  border: 1px solid #d8e2ef;
  background: #fff;
  padding: 2px;
}

.summary-grid-table .summary-thumb {
  object-fit: cover;
}

.summary-grid-table .summary-thumb.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8c8c8c;
  background: #f5f7fa;
}

.summary-grid-table .danger-text,
.summary-grid-table td.danger-text {
  color: var(--red) !important;
  background: inherit !important;
  font-weight: 700;
}

.summary-grid-table .pending-audit-badge {
  border-radius: 2px;
  border-color: #ffd591;
  background: #fff7e6;
  color: #ad6800;
}

.summary-grid-table .follow-heart {
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  border-radius: var(--erp-radius);
}

.summary-grid-table .follow-heart:hover {
  border-color: #ff85a2;
  background: #fff0f4;
}

.summary-grid-table .share-link,
.summary-grid-table .linklike {
  color: #1677ff;
}

.summary-grid-table .share-link:hover,
.summary-grid-table .linklike:hover {
  color: #0958d9;
  text-decoration: underline;
}

.summary-grid-table .return-rate-stack,
.summary-grid-table .plan-share-stack,
.summary-grid-table .plan-return-rate-stack {
  align-items: center;
  justify-items: center;
  text-align: center;
}

.summary-erp-toolbar .table-page-tools {
  border-left: 1px solid #d9e2ee;
}

.summary-erp-toolbar .table-page-tools button,
.summary-erp-toolbar .table-page-tools select {
  height: 28px;
  border-radius: var(--erp-radius);
}

.plan-material-table .table-inline-input {
  width: 100%;
  height: 26px;
  min-width: 88px;
  padding: 0 7px;
  border: 1px solid #d6e0ec;
  border-radius: var(--erp-radius);
  background: #fff;
  color: #10233f;
  font-size: 12px;
  line-height: 24px;
  text-align: center;
}

.plan-material-table .table-inline-input:focus {
  border-color: #1677ff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.08);
}

.plan-material-table .wide-note {
  min-width: 180px;
}

.plan-material-table .compact-button {
  height: 26px;
  min-width: 48px;
  padding: 0 10px;
}

.plans-table-wrap .plan-table thead th {
  position: sticky !important;
  top: 0;
  z-index: 30 !important;
  background: #eef3f9 !important;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 #d4deea !important;
}

.plans-table-wrap .plan-table thead th:nth-child(1),
.plans-table-wrap .plan-table thead th:nth-child(2),
.plans-table-wrap .plan-table thead th.plan-action-cell {
  z-index: 40 !important;
}

.plans-table-wrap .plan-table tbody td.plan-type-cell,
.plans-table-wrap .plan-table tbody td.plan-action-cell {
  z-index: 2 !important;
}

@media (max-width: 1500px) {
  .summary-view .summary-filter-panel {
    min-height: 74px;
    max-height: 74px;
  }

  .summary-filter-grid .filter-action-strip,
  .summary-action-strip {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1280px) {
  .plan-erp-view .plan-filter-grid {
    grid-template-columns: repeat(5, minmax(100px, 1fr));
  }

  .plan-status-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .plan-bulk-toolbar {
    order: 2;
  }
}

/* ERP workspace tabs: centered label with fixed close affordance. */
.open-tabs .workspace-tab-main {
  padding: 0 30px 0 12px;
  text-align: center;
}

.open-tabs .workspace-tab-close {
  position: absolute;
  top: 7px;
  right: 4px;
  margin-right: 0;
}

/* Production consultation: readable fixed-width snapshot with frozen controls. */
.consult-task-table {
  width: 2406px;
  min-width: 2406px;
  table-layout: fixed;
  font-size: 13px;
}

.consult-task-table th,
.consult-task-table td,
.consult-task-table td:nth-child(n) {
  padding: 9px 8px;
  text-align: center !important;
  vertical-align: middle;
  line-height: 1.4;
}

.consult-task-table th {
  height: 38px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #eef3f9;
}

.consult-task-table td {
  min-height: 52px;
}

.consult-task-table th:nth-child(1), .consult-task-table td:nth-child(1) { width: 40px; }
.consult-task-table th:nth-child(2), .consult-task-table td:nth-child(2) { width: 44px; }
.consult-task-table th:nth-child(3), .consult-task-table td:nth-child(3) { width: 76px; }
.consult-task-table th:nth-child(4), .consult-task-table td:nth-child(4) { width: 84px; }
.consult-task-table th:nth-child(5), .consult-task-table td:nth-child(5) { width: 220px; }
.consult-task-table th:nth-child(6), .consult-task-table td:nth-child(6) { width: 92px; }
.consult-task-table th:nth-child(7), .consult-task-table td:nth-child(7) { width: 88px; }
.consult-task-table th:nth-child(8), .consult-task-table td:nth-child(8) { width: 120px; }
.consult-task-table th:nth-child(9), .consult-task-table td:nth-child(9) { width: 120px; }
.consult-task-table th:nth-child(10), .consult-task-table td:nth-child(10) { width: 84px; }
.consult-task-table th:nth-child(11), .consult-task-table td:nth-child(11) { width: 140px; }
.consult-task-table th:nth-child(12), .consult-task-table td:nth-child(12) { width: 130px; }
.consult-task-table th:nth-child(13), .consult-task-table td:nth-child(13) { width: 140px; }
.consult-task-table th:nth-child(14), .consult-task-table td:nth-child(14) { width: 88px; }
.consult-task-table th:nth-child(15), .consult-task-table td:nth-child(15) { width: 82px; }
.consult-task-table th:nth-child(16), .consult-task-table td:nth-child(16) { width: 88px; }
.consult-task-table th:nth-child(17), .consult-task-table td:nth-child(17) { width: 82px; }
.consult-task-table th:nth-child(18), .consult-task-table td:nth-child(18) { width: 92px; }
.consult-task-table th:nth-child(19), .consult-task-table td:nth-child(19) { width: 240px; }
.consult-task-table th:nth-child(20), .consult-task-table td:nth-child(20) { width: 140px; }
.consult-task-table th:nth-child(21), .consult-task-table td:nth-child(21) { width: 140px; }
.consult-task-table th:nth-child(22), .consult-task-table td:nth-child(22) { width: 76px; }

.consult-task-table th,
.consult-task-table td:not(:nth-child(5)):not(:nth-child(19)) {
  white-space: nowrap;
  word-break: keep-all;
}

.consult-task-table td:nth-child(5),
.consult-task-table td:nth-child(19) {
  white-space: normal;
  word-break: break-word;
}

.consult-task-table th:nth-child(1),
.consult-task-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 5;
}

.consult-task-table th:nth-child(2),
.consult-task-table td:nth-child(2) {
  position: sticky;
  left: 40px;
  z-index: 5;
  box-shadow: 1px 0 0 #d8e0ea;
}

.consult-task-table th:nth-child(22),
.consult-task-table td:nth-child(22) {
  position: sticky;
  right: 0;
  z-index: 6;
  box-shadow: -1px 0 0 #d8e0ea;
}

.consult-task-table thead th:nth-child(1),
.consult-task-table thead th:nth-child(2),
.consult-task-table thead th:nth-child(22) {
  z-index: 12;
  background: #eef3f9;
}

.consult-task-wrap::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.consult-task-table tbody tr:nth-child(odd) td:nth-child(1),
.consult-task-table tbody tr:nth-child(odd) td:nth-child(2),
.consult-task-table tbody tr:nth-child(odd) td:nth-child(22) {
  background: #fffdf3;
}

.consult-task-table tbody tr:nth-child(even) td:nth-child(1),
.consult-task-table tbody tr:nth-child(even) td:nth-child(2),
.consult-task-table tbody tr:nth-child(even) td:nth-child(22) {
  background: #f3f8fe;
}

.consult-snapshot-cell strong,
.consult-snapshot-cell span {
  display: block;
}

.consult-snapshot-cell span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.consult-material-lines,
.consult-material-editor,
.consult-owner-editor {
  display: grid;
  gap: 4px;
}

.consult-material-lines span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  text-overflow: clip;
  white-space: nowrap;
}

.consult-material-lines .consult-bulk-estimated-date {
  display: inline;
  margin: 0 0 0 1px;
  color: #ef3f36;
  font-size: inherit;
  font-weight: 500;
}

.consult-material-lines em {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border: 1px solid #c9d9eb;
  color: #315a81;
  font-size: 11px;
  font-style: normal;
}

.consult-snapshot-editor,
.consult-material-editor input,
.consult-owner-editor input {
  width: 100% !important;
  min-width: 0;
  height: 28px;
  padding: 3px 5px;
  text-align: center;
}

.consult-reply-cell-input {
  width: calc(100% - 10px) !important;
  height: 34px;
  min-width: 0;
  margin: 0 auto;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  text-align: center !important;
}

.consult-header-help {
  display: inline-flex;
  width: 14px;
  height: 14px;
  margin-left: 3px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #d92d20;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}

.consult-expected-date-cell strong,
.consult-expected-date-cell span {
  display: block;
}

.consult-expected-date-editor {
  display: grid;
  gap: 4px;
}

.consult-expected-date-editor input {
  width: 100% !important;
  min-width: 0;
  height: 28px;
  padding: 3px 4px;
  text-align: center;
}

.consult-expected-date-cell span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.consult-empty-date {
  color: #9aa8b7;
}

.consult-reply-cell-input:hover {
  border-color: #c8d8ea;
  background: #fff;
}

.consult-reply-cell-input:focus {
  border-color: #1677d2;
  background: #fff;
  box-shadow: inset 0 0 0 1px #1677d2;
  outline: none;
}

.consult-task-table .consult-content-display,
.consult-task-table .consult-primary-value,
.consult-task-table .consult-secondary-value {
  text-align: center;
}

.consult-action-cell .ghost.danger {
  color: #b42318;
}

.consult-edit-btn {
  min-width: 52px !important;
}

.consult-edit-actions {
  display: grid;
  gap: 4px;
}

.consult-edit-actions button {
  width: 100%;
  min-width: 0;
  margin: 0 !important;
}

.consult-workflow-mark {
  display: block;
  margin-top: 3px;
  color: #52708d;
  font-size: 10px;
  line-height: 1.1;
}

.consult-expected-date-input {
  width: 112px;
  min-width: 0;
  height: 28px;
  padding: 3px 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #18324c;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.consult-expected-date-input:hover,
.consult-expected-date-input:focus {
  border-color: #9fc5ec;
  background: #fff;
  outline: none;
}

.consult-date-offset-presets {
  grid-template-columns: repeat(4, 1fr);
}

.consult-task-edit-panel {
  width: min(1120px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
}

.consult-task-edit-body {
  display: grid;
  gap: 12px;
  overflow: auto;
}

.consult-task-edit-form {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) 240px;
  gap: 10px 14px;
}

.consult-task-edit-form label {
  display: grid;
  gap: 5px;
  color: #5f7185;
  font-size: 12px;
}

.consult-task-edit-form label > input,
.consult-task-edit-form label > select,
.consult-task-rematch-line input {
  width: 100%;
  height: 34px;
  min-width: 0;
}

.consult-task-edit-wide {
  grid-column: 1 / -1;
}

.consult-task-rematch-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
}

.consult-task-edit-candidates {
  max-height: 220px;
  overflow: auto;
}

.consult-task-edit-candidate-table {
  width: 100%;
}

.consult-task-edit-candidate-table td,
.consult-task-edit-candidate-table th {
  padding: 7px 8px;
  text-align: center;
  white-space: nowrap;
}

.consult-task-edit-candidate-table td span {
  display: block;
  margin-top: 2px;
  color: #77889a;
  font-size: 11px;
}

.consult-task-edit-candidate-table tr.is-selected td {
  background: #edf7ff;
}

.consult-task-edit-snapshot {
  border: 1px solid #d6e2ef;
  background: #f8fbff;
}

.consult-task-edit-snapshot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid #d6e2ef;
}

.consult-task-edit-snapshot-head span {
  color: #6d7f92;
  font-size: 12px;
}

.consult-task-edit-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(90px, 1fr));
}

.consult-task-edit-snapshot-grid > div {
  min-height: 54px;
  padding: 8px 10px;
  border-right: 1px solid #e1eaf3;
  border-bottom: 1px solid #e1eaf3;
  text-align: center;
}

.consult-task-edit-snapshot-grid span,
.consult-task-edit-snapshot-grid strong {
  display: block;
}

.consult-task-edit-snapshot-grid span {
  margin-bottom: 4px;
  color: #718398;
  font-size: 11px;
}

.consult-task-edit-panel .modal-actions .danger {
  margin-right: auto;
  color: #b42318;
}

@media (max-width: 900px) {
  .consult-task-edit-form { grid-template-columns: 1fr; }
  .consult-task-edit-wide { grid-column: auto; }
  .consult-task-edit-snapshot-grid { grid-template-columns: repeat(3, minmax(90px, 1fr)); }
}
.danger-outline {
  border: 1px solid #efb5b5;
  background: #fff;
  color: #d9363e;
}

.danger-outline:hover:not(:disabled) {
  border-color: #d9363e;
  background: #fff4f4;
}

.danger-outline:disabled {
  border-color: #d9e1eb;
  color: #a9b3c2;
  background: #f7f9fc;
  cursor: not-allowed;
}

.selection-column {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.selection-column input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
}

/* One-click recode workflow */
.summary-action-strip .recode-open-button {
  border-color: #91b9ae;
  background: #f2f8f6;
  color: #256c5e;
}

.summary-action-strip .recode-open-button:hover {
  border-color: #5e9d8d;
  background: #e8f3f0;
}

.recode-modal-panel {
  width: min(1540px, calc(100vw - 28px));
  max-height: calc(100vh - 24px);
}

.recode-modal-head {
  min-height: 68px;
  padding: 12px 18px;
}

.recode-modal-head p {
  max-width: 900px;
}

.recode-modal-body {
  gap: 10px;
  overflow-y: auto;
  padding: 12px 14px;
  background: #f5f8fb;
}

.recode-stage-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #d6e1ed;
  background: #fff;
}

.recode-stage-strip > div {
  position: relative;
  min-height: 58px;
  padding: 9px 12px 8px 48px;
  border-right: 1px solid #e0e8f1;
}

.recode-stage-strip > div:last-child {
  border-right: 0;
}

.recode-stage-strip span {
  position: absolute;
  top: 12px;
  left: 14px;
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border: 1px solid #bdc9d7;
  border-radius: 50%;
  color: #697b90;
  font-size: 12px;
  font-weight: 700;
}

.recode-stage-strip strong,
.recode-stage-strip em {
  display: block;
}

.recode-stage-strip strong {
  color: #293b52;
  font-size: 13px;
}

.recode-stage-strip em {
  margin-top: 3px;
  color: #8491a3;
  font-size: 11px;
  font-style: normal;
}

.recode-stage-strip > div.active {
  background: #f0f8ff;
  box-shadow: inset 0 -2px 0 #1686d9;
}

.recode-stage-strip > div.active span {
  border-color: #1686d9;
  background: #1686d9;
  color: #fff;
}

.recode-stage-strip > div.done span {
  border-color: #4ca38e;
  background: #e9f7f2;
  color: #087565;
}

.recode-safety-note {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #efcf8c;
  background: #fff9e9;
  color: #755416;
  font-size: 12px;
}

.recode-safety-note strong {
  flex: 0 0 auto;
  padding-right: 12px;
  border-right: 1px solid #ead39e;
}

.recode-recent-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 0.9fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 7px 10px;
  border: 1px solid #d6e1ed;
  background: #fff;
}

.recode-recent-bar > div span,
.recode-recent-bar > div strong {
  display: block;
}

.recode-recent-bar > div span {
  color: #6b7f95;
  font-size: 11px;
}

.recode-recent-bar > div strong {
  margin-top: 2px;
  color: #293b52;
  font-size: 12px;
}

.recode-recent-bar select {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid #cbd7e5;
  background: #fff;
}

.recode-settings-card,
.recode-candidate-card,
.recode-batch-panel {
  border: 1px solid #d6e1ed;
  background: #fff;
}

.recode-settings-card,
.recode-candidate-card {
  padding: 10px;
}

.recode-settings-view {
  overflow-y: auto;
}

.recode-settings-page-shell {
  display: grid;
  gap: 10px;
}

.recode-settings-page-card {
  padding: 14px;
}

.recode-settings-page-card .recode-settings-form {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.recode-settings-page-card .recode-model-fieldset {
  width: 100%;
  padding: 14px;
}

.recode-settings-page-card .recode-parameter-grid.compact {
  grid-template-columns: repeat(3, minmax(180px, 260px));
  justify-content: start;
}

.recode-settings-page-card .recode-parameter-grid.recode-page-parameter-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 240px));
  justify-content: start;
}

.recode-settings-page-card .recode-model-fieldset.reprint {
  padding-bottom: 12px;
}

.recode-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.recode-section-head > div > span {
  display: block;
  margin-bottom: 2px;
  color: #1686d9;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.recode-section-head h3 {
  margin: 0;
  color: #23364c;
  font-size: 15px;
}

.recode-section-head p {
  margin: 3px 0 0;
  color: #75859a;
  font-size: 12px;
}

.recode-loading {
  min-height: 72px;
  padding: 25px 12px;
  border: 1px dashed #cbd8e6;
  background: #f8fbfe;
  color: #687c92;
  text-align: center;
}

.recode-loading.error,
.recode-modal-actions span.error {
  color: #c43636;
}

.recode-settings-form {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(310px, 0.9fr);
  gap: 10px;
}

.recode-model-fieldset {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid #cfdbe8;
  background: #fbfdff;
}

.recode-model-fieldset.reprint {
  border-color: #ddcfeb;
  background: #fdfbff;
}

.recode-model-fieldset legend {
  width: 100%;
  padding: 0 2px 7px;
  color: #23364c;
  font-size: 13px;
  font-weight: 700;
}

.recode-model-fieldset legend > span {
  float: left;
}

.recode-switch {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #5c7087;
  font-size: 11px;
  font-weight: 500;
}

.recode-switch input,
.recode-candidate-toolbar input,
.recode-check-col input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.recode-parameter-grid {
  clear: both;
  display: grid;
  grid-template-columns: repeat(5, minmax(118px, 1fr));
  gap: 7px;
}

.recode-parameter-grid.compact {
  grid-template-columns: minmax(180px, 260px);
}

.recode-parameter-grid.recode-page-parameter-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.recode-rule-layer-head {
  clear: both;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 3px 0 8px;
  padding: 7px 9px;
  border: 1px solid #cfe0ee;
  background: #f1f8fc;
}

.recode-rule-layer-head.task-layer {
  margin-top: 13px;
  border-color: #d8d8eb;
  background: #f7f6fc;
}

.recode-rule-layer-head strong {
  color: #285873;
  font-size: 12px;
}

.recode-rule-layer-head.task-layer strong {
  color: #4f4f79;
}

.recode-rule-layer-head span {
  color: #718398;
  font-size: 10px;
  text-align: right;
}

.recode-shadow-status {
  margin-top: 8px;
  border: 1px solid #d6e1ec;
  background: #fbfcfe;
}

.recode-shadow-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 35px;
  padding: 5px 8px 5px 10px;
  border-bottom: 1px solid #e5ebf1;
}

.recode-shadow-status-head > span {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.recode-shadow-status-head strong {
  color: #344d66;
  font-size: 11px;
}

.recode-shadow-status-head em {
  overflow: hidden;
  color: #7b8b9d;
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recode-shadow-status-head button {
  min-width: 66px;
  height: 25px;
  padding: 0 8px;
}

.recode-shadow-state-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #aab6c3;
}

.recode-shadow-status.ready .recode-shadow-state-dot {
  background: #1daf72;
}

.recode-shadow-status.pending .recode-shadow-state-dot {
  background: #e6a23c;
}

.recode-shadow-status.error .recode-shadow-state-dot {
  background: #d9534f;
}

.recode-shadow-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(95px, 1fr));
}

.recode-shadow-metrics > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
  padding: 7px 10px;
  border-right: 1px solid #e5ebf1;
}

.recode-shadow-metrics > span:last-child {
  border-right: 0;
}

.recode-shadow-metrics em {
  color: #74869a;
  font-size: 10px;
  font-style: normal;
}

.recode-shadow-metrics strong {
  color: #203d59;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.recode-parameter-grid label {
  position: relative;
  display: block;
  min-width: 0;
}

.recode-parameter-grid label > span,
.recode-cap-item em {
  display: block;
  margin-bottom: 4px;
  color: #65788e;
  font-size: 11px;
  font-style: normal;
}

.recode-parameter-grid input,
.recode-parameter-grid select {
  width: 100%;
  height: 30px;
  padding-right: 52px;
  border: 1px solid #cbd7e5;
  background: #fff;
}

.recode-parameter-grid select {
  padding: 0 28px 0 8px;
}

.recode-parameter-grid .recode-locked-parameter input {
  border-color: #b7d5e8;
  background: #eef7fc;
  color: #215d84;
  font-weight: 700;
}

.recode-parameter-grid label > em {
  position: absolute;
  right: 7px;
  bottom: 8px;
  color: #8492a4;
  font-size: 10px;
  font-style: normal;
  pointer-events: none;
}

.recode-fixed-rules {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

.recode-fixed-rules span {
  color: #718398;
  font-size: 10px;
}

.recode-fixed-rules b {
  padding: 2px 6px;
  border: 1px solid #cee1ee;
  background: #f0f7fb;
  color: #3b637d;
  font-size: 10px;
  font-weight: 600;
}

.recode-model-scope-note {
  margin: 7px 0 0;
  padding: 6px 8px;
  border-left: 2px solid #78a9c7;
  background: #f3f8fc;
  color: #546b82;
  font-size: 10px;
  line-height: 1.45;
}

.recode-cap-block {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #e2e9f1;
}

.recode-cap-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.recode-cap-head strong {
  color: #31465d;
  font-size: 12px;
}

.recode-cap-head span {
  color: #7b8a9c;
  font-size: 10px;
}

.recode-cap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.recode-cap-item {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 6px;
  padding: 6px;
  border: 1px solid #dce5ef;
  background: #fff;
}

.recode-cap-item > span {
  align-self: center;
  padding: 3px 5px;
  background: #eaf4fb;
  color: #226a98;
  font-size: 10px;
  font-weight: 700;
}

.recode-cap-item label {
  position: relative;
  min-width: 0;
}

.recode-cap-item input:not([type="hidden"]) {
  box-sizing: border-box;
  width: 100%;
  height: 27px;
  padding-right: 22px;
  border: 1px solid #cbd7e5;
}

.recode-cap-item b {
  position: absolute;
  right: 7px;
  bottom: 7px;
  color: #8291a3;
  font-size: 10px;
  font-weight: 400;
}

.recode-cap-limit.last strong {
  display: flex;
  height: 27px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid #d8e1eb;
  background: #f3f6f9;
  color: #5f7186;
  font-size: 10px;
}

.recode-history-source {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  padding: 8px 10px;
  border: 1px solid #d8e3ee;
  background: #f7fafc;
}

.recode-history-source span,
.recode-history-source strong,
.recode-history-source small {
  display: block;
}

.recode-history-source span {
  color: #708197;
  font-size: 10px;
}

.recode-history-source strong {
  margin-top: 2px;
  color: #2d4762;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.recode-history-source small {
  margin-top: 3px;
  color: #76879a;
  font-size: 10px;
}

.recode-settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #e3eaf2;
}

.recode-settings-actions button,
.recode-task-actions button {
  min-width: 108px;
}

.recode-settings-page-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.recode-settings-page-footer .recode-history-source {
  margin-top: 0;
}

.recode-settings-page-status {
  max-width: 420px;
  color: #61748a;
  font-size: 12px;
  text-align: right;
}

.recode-settings-page-status.error {
  color: #c43636;
}

.recode-rule-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.recode-rule-summary-item {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #d6e1ed;
  background: #fbfdff;
}

.recode-rule-summary-item.reprint {
  border-color: #ddcfeb;
  background: #fdfbff;
}

.recode-rule-summary-item.disabled {
  opacity: 0.62;
}

.recode-rule-summary-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.recode-rule-summary-item > div strong {
  color: #263d55;
  font-size: 13px;
}

.recode-rule-summary-item > div span {
  padding: 2px 6px;
  border: 1px solid #bcd8e8;
  background: #eef7fc;
  color: #226a98;
  font-size: 10px;
  font-weight: 700;
}

.recode-run-model-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
}

.recode-run-model-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.recode-run-model-toggle input:disabled {
  cursor: not-allowed;
}

.recode-run-model-toggle span {
  padding: 2px 6px;
  border: 1px solid #bcd8e8;
  background: #eef7fc;
  color: #226a98;
  font-size: 10px;
  font-weight: 700;
}

.recode-run-model-toggle input:not(:checked) + span {
  border-color: #d7dde4;
  background: #f4f6f8;
  color: #7b8794;
}

.recode-rule-summary-item > p {
  margin: 6px 0;
  color: #526b83;
  font-size: 11px;
  line-height: 1.45;
}

.recode-rule-summary-item ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recode-rule-summary-item li {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 6px;
  color: #6d7f92;
  font-size: 10px;
}

.recode-rule-summary-item li b {
  color: #435c74;
  font-weight: 700;
}

.recode-rule-summary-item li em {
  font-style: normal;
}

.recode-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.recode-metrics span {
  min-width: 70px;
  padding: 5px 8px;
  border: 1px solid #d8e3ee;
  background: #f8fbfe;
  text-align: right;
}

.recode-metrics em,
.recode-metrics strong {
  display: block;
}

.recode-metrics em {
  color: #7a8a9d;
  font-size: 9px;
  font-style: normal;
}

.recode-metrics strong {
  margin-top: 1px;
  color: #24425f;
  font-size: 14px;
}

.recode-candidate-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid #dbe4ee;
  border-bottom: 0;
  background: #f7fafc;
}

.recode-candidate-toolbar .jst-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #43566c;
  font-size: 11px;
}

.recode-candidate-toolbar > span {
  margin-left: auto;
  color: #62758b;
  font-size: 11px;
}

.recode-table-wrap {
  max-height: 340px !important;
  border: 1px solid #dbe4ee;
}

.modal-body .recode-candidate-table {
  min-width: 1180px;
}

.recode-candidate-table th,
.recode-candidate-table td {
  padding: 6px 7px;
  font-size: 11px;
}

.recode-candidate-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #edf3f8;
}

.recode-check-col {
  width: 38px;
  min-width: 38px;
  text-align: center;
}

.recode-candidate-row.selected td {
  background: #f0f8ff;
}

.recode-model-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid #8dcfc1;
  background: #edf9f6;
  color: #087565;
  font-weight: 700;
  white-space: nowrap;
}

.recode-model-tag.reprint {
  border-color: #c5aee3;
  background: #f8f2ff;
  color: #7046a0;
}

.recode-style-route {
  min-width: 220px;
  white-space: nowrap;
}

.recode-style-route strong {
  color: #176cbc;
}

.recode-style-route span {
  margin: 0 5px;
  color: #8b98a7;
}

.recode-stock-cell strong,
.recode-stock-cell small {
  display: block;
}

.recode-stock-cell small {
  margin-top: 2px;
  color: #7b8b9d;
  font-size: 9px;
}

.recode-reason-cell {
  min-width: 250px;
  max-width: 380px;
  color: #4d6076;
  white-space: normal;
}

.recode-reason-cell small {
  display: block;
  margin-top: 3px;
  color: #74869a;
  font-size: 9px;
}

.recode-reason-cell .recode-ratio-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0 0 4px;
  color: #52677d;
  font-size: 10px;
  line-height: 1.35;
}

.recode-ratio-summary b {
  color: #2f465d;
  font-weight: 700;
}

.recode-ratio-summary b.anomaly {
  color: #e53935;
}

.recode-ratio-summary i {
  color: #9aacbc;
  font-style: normal;
}

.recode-reason-text {
  display: block;
}

.recode-detail-toggle {
  white-space: nowrap;
}

.recode-line-row > td {
  padding: 0 !important;
  background: #f8fbfe;
}

.recode-line-table-wrap {
  padding: 7px 44px 9px;
  overflow-x: auto;
}

.modal-body .recode-line-table {
  min-width: 900px !important;
  border: 1px solid #dce5ee;
  background: #fff;
}

.recode-line-table th {
  position: static !important;
  background: #f3f7fa !important;
  color: #607389;
  font-size: 10px;
}

.recode-line-table td {
  font-size: 10px;
}

.recode-line-arrow {
  width: 26px;
  color: #1780ca;
  text-align: center;
}

.recode-line-empty {
  padding: 12px;
  color: #79899b;
  text-align: center;
}

.recode-task-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 2px 0;
}

.recode-task-actions strong,
.recode-task-actions span {
  display: block;
}

.recode-task-actions strong {
  color: #2c4057;
  font-size: 12px;
}

.recode-task-actions span {
  margin-top: 2px;
  color: #7a899a;
  font-size: 10px;
}

.recode-batch-panel {
  padding: 10px;
  border-color: #e0bd71;
  background: #fffdf7;
}

.recode-batch-panel.confirmed {
  border-color: #80c2af;
  background: #f5fcf9;
}

.recode-status-badge {
  padding: 4px 8px;
  border: 1px solid #e0b85e;
  background: #fff4d9;
  color: #8a5a00;
  font-size: 11px;
  font-weight: 700;
}

.recode-status-badge.confirmed {
  border-color: #73b7a4;
  background: #e6f7f1;
  color: #087565;
}

.recode-batch-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(110px, 0.6fr));
  border: 1px solid #e4d6b6;
  background: #fff;
}

.recode-batch-summary span {
  padding: 8px 10px;
  border-right: 1px solid #e7dfce;
}

.recode-batch-summary span:last-child {
  border-right: 0;
}

.recode-batch-summary em,
.recode-batch-summary strong {
  display: block;
}

.recode-batch-summary em {
  color: #7e7462;
  font-size: 10px;
  font-style: normal;
}

.recode-batch-summary strong {
  margin-top: 3px;
  color: #3d3a32;
  font-size: 13px;
}

.recode-execution-actions {
  display: grid;
  grid-template-columns: auto minmax(520px, 1fr);
  align-items: stretch;
  gap: 9px;
  margin-top: 9px;
}

#recodeDownloadTasksBtn {
  display: inline-flex;
  min-width: 130px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #b9c8d8;
  background: #fff;
  color: #315574;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.recode-confirm-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 9px;
  border: 1px solid #e6c67f;
  background: #fff8e8;
}

.recode-confirm-zone strong,
.recode-confirm-zone span {
  display: block;
}

.recode-confirm-zone strong {
  color: #6f4c08;
  font-size: 12px;
}

.recode-confirm-zone span {
  margin-top: 2px;
  color: #856a35;
  font-size: 10px;
}

.recode-confirm-zone button {
  flex: 0 0 auto;
  min-width: 250px;
}

.recode-modal-actions {
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin: 0;
  padding: 8px 14px;
  background: #fbfdff;
}

.recode-modal-actions > span {
  overflow: hidden;
  color: #61748a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-tag-settings-view {
  overflow-y: auto;
}

.product-tag-settings-view > .settings-workbench-head,
.product-tag-settings-view > .product-tag-settings-shell {
  width: var(--settings-1920-content-width);
  min-width: var(--settings-1920-content-width);
  max-width: var(--settings-1920-content-width);
}

.product-tag-settings-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-tag-settings-shell {
  display: grid;
  gap: 10px;
}

.product-tag-principle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #d7e1ec;
  background: #fff;
}

.product-tag-principle-grid article {
  position: relative;
  min-height: 78px;
  padding: 12px 14px 10px 48px;
  border-right: 1px solid #e2e8f0;
}

.product-tag-principle-grid article:last-child {
  border-right: 0;
}

.product-tag-principle-grid article > span {
  position: absolute;
  top: 12px;
  left: 14px;
  color: #1b87d4;
  font-family: Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
}

.product-tag-principle-grid strong {
  color: #263b52;
  font-size: 13px;
}

.product-tag-principle-grid p {
  margin: 5px 0 0;
  color: #6f8195;
  font-size: 11px;
  line-height: 1.5;
}

.product-tag-settings-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #d7e1ec;
  background: #fff;
}

.product-tag-settings-card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.product-tag-settings-card-head > div:first-child > span {
  display: block;
  color: #1686d9;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.product-tag-settings-card-head h3 {
  margin: 2px 0 0;
  color: #23364c;
  font-size: 15px;
}

.product-tag-settings-summary {
  color: #65788e;
  font-size: 11px;
}

.product-tag-settings-table-wrap {
  max-height: none;
  overflow: hidden;
}

.product-tag-settings-table {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  table-layout: fixed;
}

.product-tag-settings-table col.product-tag-col-enabled {
  width: 80px;
}

.product-tag-settings-table col.product-tag-col-name {
  width: 210px;
}

.product-tag-settings-table col.product-tag-col-category {
  width: 160px;
}

.product-tag-settings-table col.product-tag-col-source {
  width: 160px;
}

.product-tag-settings-table col.product-tag-col-scopes {
  width: 300px;
}

.product-tag-settings-table col.product-tag-col-description {
  width: 800px;
}

.product-tag-settings-table col.product-tag-col-operation {
  width: 96px;
}

.product-tag-settings-table th,
.product-tag-settings-table td {
  min-width: 0;
  overflow: hidden;
}

.product-tag-settings-table td {
  padding: 7px;
  vertical-align: top;
}

.product-tag-settings-table input:not([type="checkbox"]),
.product-tag-settings-table textarea {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  border: 1px solid #cbd7e5;
  border-radius: 0;
  background: #fff;
  color: #2d4057;
  font: inherit;
}

.product-tag-settings-table input:not([type="checkbox"]) {
  height: 30px;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-tag-settings-table textarea {
  display: block;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  padding: 6px 8px;
  line-height: 1.45;
  overflow: auto;
  overflow-wrap: anywhere;
  resize: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.product-tag-settings-table input[readonly] {
  border-color: #d8e1ea;
  background: #f4f7fa;
  color: #334b63;
  font-weight: 700;
}

.product-tag-settings-table td small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #8492a3;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-tag-enabled-cell,
.product-tag-operation-cell {
  text-align: center;
}

.product-tag-enable-toggle {
  display: inline-grid;
  justify-items: center;
  gap: 4px;
  color: #536a82;
  font-size: 10px;
}

.product-tag-enable-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.product-tag-source-badge,
.product-tag-locked {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  padding: 3px 6px;
  border: 1px solid #cbdce9;
  background: #eef6fb;
  color: #315f7d;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-tag-source-badge.source-business,
.product-tag-source-badge.source-business_action,
.product-tag-source-badge.source-execution {
  border-color: #d7cae8;
  background: #f6f1fb;
  color: #6e4a91;
}

.product-tag-source-badge.source-manual,
.product-tag-source-badge.source-custom {
  border-color: #e4d2aa;
  background: #fff8e8;
  color: #805f1f;
}

.product-tag-operation-cell button {
  max-width: 100%;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #c43c3c;
  cursor: pointer;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-tag-locked {
  border-color: #d9e0e8;
  background: #f5f7f9;
  color: #778598;
  font-weight: 500;
}

.product-tag-settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  padding: 7px 11px;
  border: 1px solid #d7e1ec;
  background: #f8fafc;
  color: #687b90;
  font-size: 11px;
}

.product-tag-settings-footer strong {
  flex: 0 0 auto;
  color: #36536e;
  font-weight: 600;
}

.product-tag-settings-footer strong.error {
  color: #c43636;
}

@media (max-width: 1180px) {
  .recode-settings-form {
    grid-template-columns: 1fr;
  }

  .recode-settings-page-card .recode-settings-form {
    grid-template-columns: 1fr;
  }

  .recode-settings-page-card .recode-parameter-grid.recode-page-parameter-grid,
  .recode-settings-page-card .recode-parameter-grid.compact {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
  }

  .recode-parameter-grid {
    grid-template-columns: repeat(3, minmax(118px, 1fr));
  }

  .recode-parameter-grid.recode-page-parameter-grid {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
  }

  .recode-cap-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .recode-recent-bar {
    grid-template-columns: 1fr minmax(300px, 1fr) auto auto;
  }

  .product-tag-principle-grid {
    grid-template-columns: 1fr;
  }

  .product-tag-principle-grid article {
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .product-tag-principle-grid article:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 760px) {
  .recode-stage-strip,
  .recode-parameter-grid,
  .recode-cap-grid,
  .recode-batch-summary,
  .recode-recent-bar,
  .recode-execution-actions,
  .recode-rule-summary,
  .recode-settings-page-footer {
    grid-template-columns: 1fr;
  }

  .recode-settings-page-status {
    max-width: none;
    text-align: left;
  }

  .recode-parameter-grid.recode-page-parameter-grid {
    grid-template-columns: 1fr;
  }

  .recode-settings-page-card .recode-parameter-grid.recode-page-parameter-grid,
  .recode-settings-page-card .recode-parameter-grid.compact {
    grid-template-columns: 1fr;
  }

  .recode-rule-layer-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .recode-rule-layer-head span {
    text-align: left;
  }

  .recode-shadow-status-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .recode-shadow-status-head > span {
    flex-wrap: wrap;
  }

  .recode-shadow-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recode-shadow-metrics > span:nth-child(2) {
    border-right: 0;
  }

  .recode-shadow-metrics > span:nth-child(-n + 2) {
    border-bottom: 1px solid #e5ebf1;
  }

  .recode-stage-strip > div {
    border-right: 0;
    border-bottom: 1px solid #e0e8f1;
  }

  .recode-confirm-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .recode-confirm-zone button {
    min-width: 0;
  }

  .product-tag-settings-card-head,
  .product-tag-settings-footer,
  .product-tag-settings-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* production summary final overrides: keep parity with product summary */
.production-view .production-erp-filter-panel {
  min-height: 74px;
  max-height: 74px;
  padding: 9px 10px 8px;
  overflow: hidden;
  background: #f4f7fb;
  border-bottom-color: #ccd8e6;
  box-shadow: inset 0 -1px 0 #e8eef5;
}

.production-erp-filter-grid {
  grid-template-columns:
    minmax(0, 150fr) minmax(0, 132fr) minmax(0, 132fr) minmax(0, 132fr)
    minmax(0, 132fr) minmax(0, 132fr) minmax(0, 132fr) minmax(0, 132fr)
    minmax(0, 132fr) minmax(0, 132fr) minmax(0, 108fr) minmax(0, 108fr);
  grid-auto-rows: 30px;
  gap: 6px;
  overflow: hidden;
}

.production-erp-filter-grid input,
.production-erp-filter-grid select {
  min-width: 0;
  padding-inline: 4px;
  border-color: #c5d1df;
  color: #26384f;
  font-size: clamp(10px, 0.65vw, 12px);
}

.production-action-strip {
  height: 30px;
  overflow: hidden;
}

.production-action-strip > button,
.production-action-strip > .production-action-toggle {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  padding-inline: clamp(4px, 0.55vw, 12px);
  overflow: hidden;
  border-color: #c8d3df;
  background: #f9fbfd;
  color: #30445c;
  font-size: clamp(10px, 0.65vw, 12px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-action-strip .primary {
  border-color: #176fb8;
  background: #176fb8;
  color: #fff;
}

.production-erp-toolbar {
  display: flex;
  align-items: center;
  gap: 0 !important;
  background: #f7f9fc;
}

.production-erp-toolbar .table-tabs {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  padding-left: 6px;
  gap: 3px;
  overflow: hidden;
}

.production-erp-toolbar .table-tabs button,
.production-toolbar-quick-filter .quick-filter-chip {
  box-sizing: border-box;
  flex: 0 1 auto;
  min-width: 0;
  height: 22px !important;
  min-height: 22px;
  max-height: 22px;
  margin: 0;
  padding: 0 clamp(5px, 0.55vw, 12px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-color: transparent #d5deea !important;
  border-radius: 0;
  background: #f8fafc !important;
  color: #41546b;
  font-size: clamp(10px, 0.65vw, 12px);
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none !important;
  outline: none;
}

.production-erp-toolbar .table-tabs button[data-production-tab] {
  min-width: 0;
  margin: 0;
}

.production-erp-toolbar .table-tabs button.active,
.production-toolbar-quick-filter .quick-filter-chip.active,
.production-toolbar-quick-filter .quick-filter-chip[aria-pressed="true"] {
  background: #d8e8f8 !important;
  color: #153b66;
  font-weight: 500;
}

.production-toolbar-quick-filter {
  flex: 0 1 360px;
  width: auto;
  max-width: 360px;
  height: 28px;
  padding: 0 6px;
  overflow: hidden;
  background: transparent;
}

.production-toolbar-quick-filter .quick-filter-chip {
  position: relative;
  max-width: 180px;
  padding-right: 20px;
}

.production-toolbar-quick-filter .quick-filter-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-toolbar-quick-filter .quick-filter-chip > em {
  position: absolute;
  top: 2px;
  right: 3px;
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  color: #6f8195;
  font-size: 12px;
  line-height: 16px;
  opacity: 0;
}

.production-toolbar-quick-filter .quick-filter-chip:hover > em,
.production-toolbar-quick-filter .quick-filter-chip:focus-visible > em {
  opacity: 0.72;
}

.production-erp-toolbar .column-order-open {
  flex: 0 0 86px;
  min-width: 86px;
}

.production-bottom-toolbar {
  overflow: hidden;
}

.production-bottom-toolbar .production-data-meta,
.production-bottom-toolbar .production-data-meta span {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(9px, 0.58vw, 11px);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Production table frozen columns: row number, selector, image, then the first two business fields. */
.production-grid-table .production-row-no,
.production-grid-table .production-select-col,
.production-grid-table .production-image-col,
.production-grid-table .production-fixed-1,
.production-grid-table .production-fixed-2 {
  position: sticky !important;
  background: inherit;
}

.production-grid-table .production-row-no {
  left: 0 !important;
  z-index: 9;
}

.production-grid-table .production-select-col {
  left: 44px !important;
  z-index: 8;
}

.production-grid-table .production-image-col {
  left: 80px !important;
  z-index: 7;
}

.production-grid-table .production-fixed-1 {
  left: 138px !important;
  z-index: 6;
}

.production-grid-table .production-fixed-2 {
  left: 264px !important;
  z-index: 5;
  box-shadow: 1px 0 0 #c8d5e4;
}

.production-grid-table thead .production-row-no,
.production-grid-table thead .production-select-col,
.production-grid-table thead .production-image-col,
.production-grid-table thead .production-fixed-1,
.production-grid-table thead .production-fixed-2 {
  background: #eef3f9;
  z-index: 12;
}

.production-grid-table tfoot .production-row-no,
.production-grid-table tfoot .production-select-col,
.production-grid-table tfoot .production-image-col,
.production-grid-table tfoot .production-fixed-1,
.production-grid-table tfoot .production-fixed-2 {
  background: #fff;
  z-index: 11;
}

.production-erp-toolbar .table-tabs {
  flex: 0 1 auto;
}

.production-toolbar-quick-filter {
  flex: 0 1 auto;
  width: auto;
  height: 38px;
  align-items: center;
}

.production-erp-toolbar .column-order-open {
  margin-left: auto;
}

.production-toolbar-quick-filter .quick-filter-chip b {
  margin-left: 3px;
  color: inherit;
  font-size: inherit;
  font-weight: 500;
}

/* production consultation workbench: reuse the confirmed dense ERP toolbar system */
.production-consult-view .consult-erp-filter-panel {
  min-height: 74px;
  max-height: 74px;
  padding: 9px 10px 8px;
  overflow: hidden;
  background: #f4f7fb;
  border-bottom-color: #ccd8e6;
}

.production-consult-view .consult-erp-filter-grid {
  grid-template-columns:
    minmax(0, 240fr)
    minmax(0, 138fr)
    minmax(0, 138fr)
    minmax(0, 120fr)
    minmax(0, 160fr)
    minmax(0, 132fr)
    minmax(0, 132fr);
  grid-auto-rows: 30px;
  gap: 6px;
  overflow: hidden;
}

.production-consult-view .consult-erp-filter-grid input {
  min-width: 0;
  padding-inline: 4px;
  border-color: #c5d1df;
  background: #fff;
  color: #26384f;
  font-size: clamp(10px, 0.65vw, 12px);
}

.production-consult-view .consult-action-strip {
  height: 30px;
  overflow: hidden;
}

.production-consult-view .consult-action-strip > button {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  padding-inline: clamp(4px, 0.55vw, 12px);
  overflow: hidden;
  border-color: #c8d3df;
  background: #f9fbfd;
  color: #30445c;
  font-size: clamp(10px, 0.65vw, 12px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-consult-view .consult-action-strip .primary {
  border-color: #176fb8;
  background: #176fb8;
  color: #fff;
}

.production-consult-view .consult-quick-filter-strip {
  height: 38px;
  min-height: 38px;
  padding: 0 6px !important;
  gap: 3px;
  border-top: 1px solid #d6e0eb;
  background: #f7f9fc;
}

.consult-quick-filter-strip > .table-tabs {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  height: 38px;
  padding: 0;
  gap: 3px;
  overflow: hidden;
}

.consult-quick-filter-strip > .table-tabs button,
.consult-quick-filter-bar .quick-filter-chip {
  box-sizing: border-box;
  flex: 0 0 auto;
  min-width: 0;
  height: 22px !important;
  min-height: 22px;
  max-height: 22px;
  margin: 0;
  padding: 0 clamp(5px, 0.55vw, 12px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid;
  border-color: transparent #d5deea !important;
  border-radius: 0;
  background: #f8fafc !important;
  color: #41546b;
  font-size: clamp(10px, 0.65vw, 12px);
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none !important;
  outline: none;
}

.consult-quick-filter-strip > .table-tabs button.active,
.consult-quick-filter-bar .quick-filter-chip.active,
.consult-quick-filter-bar .quick-filter-chip[aria-pressed="true"] {
  background: #d8e8f8 !important;
  color: #153b66;
  font-weight: 500;
}

.consult-quick-filter-strip > .table-tabs button:last-child {
  border-right-color: transparent !important;
}

.consult-quick-filter-bar {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  height: 38px;
  margin-left: 7px;
  padding: 0 6px 0 10px;
  gap: 3px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  border-left: 2px solid #9fb4ca;
  background: transparent;
  scrollbar-width: none;
}

.consult-quick-filter-bar::-webkit-scrollbar {
  display: none;
}

.consult-quick-filter-bar .quick-filter-chip {
  position: relative;
  max-width: none;
  padding-right: 20px;
}

.consult-quick-filter-bar .quick-filter-chip > span {
  min-width: max-content;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.consult-quick-filter-bar .quick-filter-chip > em {
  position: absolute;
  top: 2px;
  right: 3px;
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  color: #6f8195;
  font-size: 12px;
  line-height: 16px;
  opacity: 0;
}

.consult-quick-filter-bar .quick-filter-chip:hover > em,
.consult-quick-filter-bar .quick-filter-chip:focus-visible > em {
  opacity: 0.72;
}

.consult-quick-filter-bar .quick-filter-chip b {
  display: inline;
  min-width: 0;
  height: auto;
  margin-left: 3px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: 500;
}

.consult-quick-filter-strip .consult-type-settings-btn {
  flex: 0 0 auto;
  height: 30px;
  margin: 0 0 0 auto;
  border-color: #c8d3df;
  background: #f9fbfd;
  color: #30445c;
}

.production-consult-view .consult-bottom-toolbar {
  overflow: hidden;
}

.production-consult-view .consult-bottom-toolbar #consultTaskCounter {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(9px, 0.58vw, 11px);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.consult-task-table th:nth-child(22),
.consult-task-table td:nth-child(22) {
  position: static;
  right: auto;
  box-shadow: none;
}

.consult-task-table th.consult-edit-col,
.consult-task-table td.consult-action-cell {
  position: sticky;
  right: 0;
  z-index: 6;
  box-shadow: -1px 0 0 #c9d5e2;
}

.consult-task-table thead th.consult-edit-col {
  z-index: 12;
  background: #eef3f9;
}

.consult-task-table tbody tr:nth-child(odd) td.consult-action-cell {
  background: #fffdf3;
}

.consult-task-table tbody tr:nth-child(even) td.consult-action-cell {
  background: #f3f8fe;
}

/* These columns are reorderable, so their layout must follow semantic classes. */
.consult-task-table th.consult-status-col,
.consult-task-table td.consult-status-cell {
  width: 92px !important;
  min-width: 92px !important;
  max-width: 92px !important;
}

.consult-task-table td.consult-status-cell {
  display: table-cell;
  overflow: hidden;
  padding-inline: 6px;
  white-space: nowrap;
}

.consult-task-table td.consult-status-cell > * {
  max-width: 100%;
  margin-inline: auto;
  white-space: nowrap;
}

.consult-task-table th.consult-updated-col,
.consult-task-table td.consult-updated-cell {
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
  overflow: hidden;
}

.consult-task-table td.consult-updated-cell > * {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Full desktop keeps the designed control sizes; narrower audit views may compress. */
@media (min-width: 1860px) {
  .summary-filter-grid {
    grid-template-columns:
      132px 132px 126px 74px 74px 126px 74px 74px
      104px 96px 118px 108px 74px 74px 112px 112px;
  }

  .production-erp-filter-grid {
    grid-template-columns:
      150px 132px 132px 132px 132px 132px
      132px 132px 132px 132px 108px 108px;
  }

  .production-consult-view .consult-erp-filter-grid {
    grid-template-columns: 240px 138px 138px 120px 160px 132px 132px;
  }

  .summary-filter-grid input,
  .summary-filter-grid select,
  .production-erp-filter-grid input,
  .production-erp-filter-grid select,
  .production-consult-view .consult-erp-filter-grid input {
    font-size: 12px;
  }

  .summary-action-strip > button,
  .summary-action-strip > .summary-action-toggle {
    flex: 0 0 auto;
    min-width: 56px;
    padding-inline: 12px;
    font-size: 12px;
  }

  .summary-action-strip > .primary {
    min-width: 72px;
  }

  .summary-action-strip > .quick-filter-save {
    min-width: 118px;
  }

  .summary-action-strip > .summary-action-toggle {
    min-width: 82px;
  }

  .production-action-strip > button,
  .production-action-strip > .production-action-toggle,
  .production-consult-view .consult-action-strip > button {
    flex: 0 0 auto;
    min-width: max-content;
    padding-inline: 12px;
    font-size: 12px;
  }

  .production-erp-toolbar .table-tabs button,
  .production-toolbar-quick-filter .quick-filter-chip,
  .consult-quick-filter-strip > .table-tabs button,
  .consult-quick-filter-bar .quick-filter-chip {
    flex: 0 0 auto;
    padding-inline: 12px;
    font-size: 12px;
  }
}
.recode-work-order-view .consult-erp-filter-grid {
  grid-template-columns: 340px 168px 168px;
  justify-content: start;
  gap: 6px;
}

.recode-work-order-view .recode-work-order-query {
  width: 340px;
}

/* Search-area width convergence: keep desktop controls readable without
   stretching a single field across all remaining workspace width. */
@media (min-width: 901px) {
  .operation-mapping-toolbar {
    flex-wrap: wrap;
  }

  .operation-mapping-toolbar label.wide {
    flex: 0 1 460px;
    width: clamp(280px, 32vw, 460px);
    min-width: 280px;
    max-width: 460px;
  }
}

#orderTimeliness .expected-return-filter {
  grid-template-columns:
    minmax(220px, 360px)
    minmax(180px, 260px)
    minmax(160px, 220px)
    minmax(180px, 320px);
  width: min(100%, 1200px);
  justify-content: start;
}

.plan-workflow-view .product-event-filter-grid {
  grid-template-columns:
    minmax(280px, 420px)
    180px
    150px
    150px;
  width: min(100%, 960px);
  justify-content: start;
}

.historical-return-filter {
  grid-template-columns: repeat(auto-fit, minmax(140px, 180px));
  width: min(100%, 1308px);
  justify-content: start;
}

.factory-production-filter {
  grid-template-columns: repeat(auto-fit, minmax(140px, 200px));
  width: min(100%, 1240px);
  justify-content: start;
}

@media (max-width: 760px) {
  #orderTimeliness .expected-return-filter,
  .plan-workflow-view .product-event-filter-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    width: 100%;
  }

  .historical-return-filter,
  .factory-production-filter {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    width: 100%;
  }
}

@media (max-width: 520px) {
  #orderTimeliness .expected-return-filter,
  .plan-workflow-view .product-event-filter-grid,
  .historical-return-filter,
  .factory-production-filter {
    grid-template-columns: minmax(0, 1fr);
  }
}

.recode-work-order-view .recode-work-order-date {
  width: 168px;
}

.recode-scan-exclusion {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #52677d;
  font-size: 11px;
}

.recode-scan-exclusion input {
  width: 58px;
  min-height: 28px;
  padding: 3px 6px;
  text-align: center;
}

.recode-scan-exclusion em {
  color: #7a8b9c;
  font-style: normal;
}

.recode-work-order-action-row {
  grid-column: 1 / -1;
  width: max-content;
  height: 30px;
  margin-top: 0;
  justify-content: flex-start;
  gap: 3px;
}

.recode-work-order-action-row > button {
  flex: 0 0 auto !important;
  min-width: 58px !important;
  height: 28px;
  padding: 0 10px;
  border-color: #c8d3df;
  border-radius: 0;
  background: #f9fbfd;
  color: #30445c;
  font-size: 11px;
  line-height: 26px;
  white-space: nowrap;
}

.recode-work-order-action-row > button.primary {
  border-color: #176fb8;
  background: #176fb8;
  color: #fff;
}

.recode-work-order-toolbar .recode-work-order-job-status {
  min-width: 0;
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  color: var(--text-secondary, #52657a);
}

.recode-work-order-job-status strong {
  flex: 0 0 auto;
  color: var(--text-primary, #17365d);
}

.recode-work-order-job-status span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recode-work-order-job-status.error,
.recode-work-order-job-status.error strong {
  color: #b42318;
}

.recode-analysis-expand {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #9fb7cf;
  background: #fff;
  color: #176fb8;
  font-size: 17px;
  line-height: 20px;
}

.recode-analysis-expand:disabled {
  border-color: #d8e0e8;
  color: #aab6c2;
}

.recode-analysis-stage {
  max-width: 330px;
}

.recode-analysis-stage strong,
.recode-analysis-stage small {
  display: block;
}

.recode-analysis-stage small {
  margin-top: 3px;
  overflow: hidden;
  color: #66788d;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recode-analysis-stage.error strong,
.recode-analysis-stage.error small,
.recode-work-order-table tr.error-row > td {
  color: #b42318;
}

.recode-analysis-detail-row > td {
  padding: 0 !important;
  border-top: 0;
  background: #f5f9fd;
}

.recode-analysis-detail-shell {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 10px 14px 14px 48px;
  border-top: 1px solid #c9d9e8;
  border-bottom: 1px solid #b8cadc;
}

.recode-analysis-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.recode-analysis-detail-head > div,
.recode-analysis-detail-head span {
  min-width: 0;
}

.recode-analysis-detail-head strong,
.recode-analysis-detail-head span {
  display: block;
}

.recode-analysis-detail-head strong {
  color: #17365d;
  font-size: 12px;
}

.recode-analysis-detail-head span {
  margin-top: 2px;
  color: #63768a;
  font-size: 10px;
}

.recode-analysis-detail-head > div:last-child {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.recode-analysis-detail-table-wrap {
  max-height: 620px;
  overflow: auto;
  border: 1px solid #cbd9e6;
  background: #fff;
}

.recode-analysis-detail-table {
  width: 100%;
  min-width: 1870px;
  table-layout: fixed;
}

.recode-analysis-detail-table th,
.recode-analysis-detail-table td {
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recode-analysis-detail-table th:nth-child(1) { width: 48px !important; }
.recode-analysis-detail-table th:nth-child(2) { width: 120px !important; }
.recode-analysis-detail-table th:nth-child(3) { width: 230px !important; }
.recode-analysis-detail-table th:nth-child(4) { width: 140px !important; }
.recode-analysis-detail-table th:nth-child(5),
.recode-analysis-detail-table th:nth-child(6),
.recode-analysis-detail-table th:nth-child(10) { width: 94px !important; }
.recode-analysis-detail-table th:nth-child(7) { width: 72px !important; }
.recode-analysis-detail-table th:nth-child(8) { width: 374px !important; }
.recode-analysis-detail-table th:nth-child(9) { width: 180px !important; }
.recode-analysis-detail-table th:nth-child(11) { width: 400px !important; }

.recode-analysis-detail-table td.recode-reason-cell {
  white-space: normal;
  line-height: 1.35;
}

.recode-style-target {
  display: inline;
  color: #567089;
  font-size: 11px;
}

.recode-size-inventory,
.recode-change-items {
  display: flex;
  align-items: center;
  gap: 4px 8px;
  overflow: hidden;
  white-space: nowrap;
}

.recode-size-stock {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  color: #24384c;
  font-variant-numeric: tabular-nums;
}

.recode-size-stock strong {
  font-weight: 600;
}

.recode-size-stock.changed {
  color: #d92d20;
  font-weight: 700;
}

.recode-change-items span {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: #24384c;
  font-variant-numeric: tabular-nums;
}

.recode-change-items b {
  color: #d92d20;
  font-weight: 700;
}

.recode-candidate-lines-toggle {
  min-width: 40px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid #9fb7cf;
  background: #fff;
  color: #176fb8;
  font-weight: 700;
  line-height: 22px;
}

.recode-erp-detail-cell,
.recode-candidate-line-erp {
  text-align: center;
}

.recode-single-line-count {
  min-width: 40px;
  color: #526b84;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.recode-quantity-total {
  color: #17365d;
  font-variant-numeric: tabular-nums;
}

.recode-line-quantity-input {
  width: 72px;
  height: 26px;
  padding: 2px 6px;
  border: 1px solid #9fb7cf;
  background: #fff;
  color: #17365d;
  font: inherit;
  font-weight: 700;
  text-align: right;
}

.recode-line-quantity-input:focus {
  border-color: #176fb8;
  outline: 2px solid rgba(23, 111, 184, 0.16);
  outline-offset: 0;
}

.recode-line-quantity-input:disabled {
  border-color: #d8e0e8;
  background: #f3f6f9;
  color: #7c8c9d;
}

.recode-main-quantity-input {
  width: 64px;
}

.recode-candidate-line-row > td {
  border-top: 0;
  background: #edf4fb !important;
}

.recode-candidate-line-row:hover > td {
  background: #e7f0f9 !important;
}

.recode-candidate-line-spacer {
  padding: 0 !important;
}

.recode-candidate-line-inventory {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.recode-line-number {
  color: #176fb8;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.recode-erp-code-flow {
  overflow: hidden;
  color: #567089;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recode-line-change {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.recode-line-change span,
.recode-candidate-line-note {
  color: #6d7f91;
  font-size: 10px;
}

.recode-analysis-detail-state {
  padding: 20px;
  border: 1px dashed #b9cadb;
  background: #fff;
  color: #60758b;
  text-align: center;
}

.recode-analysis-detail-state.error {
  color: #b42318;
}

.recode-ledger-remark > span,
.recode-ledger-remark > a {
  display: block;
}

.recode-ledger-remark > a {
  margin-top: 3px;
}

.recode-work-order-table {
  width: 100%;
  min-width: 1640px;
  table-layout: fixed;
}

.recode-work-order-table:not(.recode-line-ledger-table) th,
.recode-work-order-table:not(.recode-line-ledger-table) td {
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(1) { width: 52px; }
.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(2) { width: 70px; }
.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(3) { width: 120px; }
.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(4) { width: 160px; }
.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(5) { width: 280px; }
.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(6) { width: 220px; }
.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(7),
.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(8),
.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(9) { width: 130px; }
.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(10) { width: 90px; }
.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(11) { width: 74px; }
.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(12) { width: 120px; }
.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(13) { width: 84px; }
.recode-work-order-table:not(.recode-line-ledger-table) th:nth-child(14) { width: 100px; }
}

.recode-work-order-table.recode-line-ledger-table {
  width: 100%;
  min-width: 2220px;
  table-layout: fixed;
}

.recode-work-filter-tabs {
  flex: 0 0 auto;
}

.recode-line-ledger-table th,
.recode-line-ledger-table td {
  box-sizing: border-box;
  padding: 5px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.recode-line-ledger-table .recode-ledger-group-head th {
  position: static;
  left: auto;
  width: auto !important;
  height: 25px;
  padding-block: 3px;
  border-bottom-color: #c8d5e4;
  background: #e7eef7;
  color: #31516f;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-align: center;
  box-shadow: none;
}

.recode-line-ledger-table .recode-ledger-column-head th {
  height: 32px;
  background: #f1f5fa;
  color: #31475f;
}

.recode-line-ledger-table .recode-ledger-column-head th:nth-child(1),
.recode-line-ledger-table tbody td:nth-child(1) {
  left: 0;
}

.recode-line-ledger-table .recode-ledger-column-head th:nth-child(2),
.recode-line-ledger-table tbody td:nth-child(2) {
  left: 54px;
}

.recode-line-ledger-table tbody td:nth-child(1),
.recode-line-ledger-table tbody td:nth-child(2) {
  z-index: 5;
}

.recode-line-ledger-table .recode-ledger-batch-select {
  text-align: center;
}

.recode-line-ledger-table tr.selected td {
  background: #edf6ff;
}

.recode-analysis-select-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.recode-analysis-select-all span {
  color: #31516f;
  font-size: 11px;
  font-weight: 600;
}

.recode-line-ledger-table .recode-ledger-code,
.recode-line-ledger-table .recode-ledger-style {
  font-family: Consolas, "SFMono-Regular", monospace;
  text-align: left;
}

.recode-line-ledger-table .recode-ledger-code,
.recode-line-ledger-table .recode-ledger-ellipsis,
.recode-line-ledger-table .recode-ledger-remark,
.recode-line-ledger-table .recode-work-order-id button {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recode-line-ledger-table .recode-ledger-arrow {
  width: 28px;
  min-width: 28px;
  color: #6f8298;
  text-align: center;
}

.recode-line-ledger-table .recode-ledger-datetime {
  display: inline-flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  white-space: nowrap;
}

.recode-line-ledger-table .recode-ledger-datetime small {
  display: block;
  margin-top: 2px;
  color: #718195;
  font-size: 10px;
  line-height: 1;
}

.recode-line-ledger-table .recode-ledger-remark {
  text-align: left;
}

.recode-work-order-table tr.selected {
  background: #eef6ff;
}

.recode-work-order-table .recode-work-order-id button {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recode-work-order-table td small {
  display: block;
  margin-top: 2px;
  color: #7a8797;
}

.recode-work-order-table .consult-action-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.recode-work-order-table .consult-action-cell button {
  min-width: 60px;
  padding-inline: 8px;
  white-space: nowrap;
}

@media (max-width: 1500px) {
  .recode-work-order-view .consult-erp-filter-grid {
    grid-template-columns: 300px 150px 150px;
  }

  .recode-work-order-view .recode-work-order-query {
    width: 300px;
  }

  .recode-work-order-view .recode-work-order-date {
    width: 150px;
  }

  .recode-work-order-action-row > button {
    padding-inline: 7px;
    font-size: 10px;
  }
}
