:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #dbe3ee;
  --text: #10243c;
  --muted: #66758a;
  --blue: #0076ba;
  --blue-strong: #005b91;
  --brand-navy: #071f34;
  --brand-red: #e53e35;
  --green: #0f8f68;
  --orange: #c76a14;
  --red: #c83232;
  --shadow: 0 12px 28px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  border-radius: 6px;
  padding: 9px 13px;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--blue-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.ghost {
  background: #fff;
  color: var(--blue);
}

button.ghost:hover {
  background: #eef5ff;
}

button.mini {
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.mini-input {
  width: 86px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

button.danger {
  border-color: #f1b7b7;
  color: #b42318;
}

button.danger:hover {
  background: #fff1f1;
}

.select-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.select-add select {
  min-width: 0;
}

.select-add button {
  width: 32px;
  height: 32px;
  padding: 0;
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: var(--brand-navy);
  color: #e8eef7;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.brand {
  display: grid;
  gap: 8px;
  align-items: start;
  padding: 6px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-logo-box {
  width: 192px;
  min-width: 0;
  height: 24px;
  display: grid;
  place-items: start;
  padding: 0;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.brand span {
  display: block;
}

.brand span {
  color: #9fb1c8;
  font-size: 12px;
  line-height: 1.35;
}

nav {
  margin-top: 16px;
  display: grid;
  gap: 5px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

nav::-webkit-scrollbar {
  width: 4px;
}

nav::-webkit-scrollbar-thumb {
  background: rgba(188, 208, 230, 0.35);
  border-radius: 999px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d6e0ed;
  text-align: left;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand-red);
}

.nav-item span:first-child {
  white-space: nowrap;
}

.nav-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #bcd0e6;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 4px;
}

.sidebar-footer span {
  color: #9fb1c8;
  font-size: 12px;
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 86px;
  padding: 22px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.userbox {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.content {
  padding: 24px 28px 42px;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-kpi {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 7px 18px rgba(23, 32, 51, 0.045);
}

.dashboard-kpi.primary {
  border-color: #9dd5f7;
  background: #f3faff;
}

.dashboard-kpi.alert {
  border-color: #f4c2c2;
  background: #fff7f7;
}

.slow-range-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-slow-filter {
  justify-content: flex-end;
}

.dashboard-slow-filter > span {
  margin-right: auto;
}

.dashboard-slow-filter .mini {
  min-height: 29px;
  margin-left: 4px;
}

.slow-range-controls button {
  padding: 5px 11px;
  border-radius: 999px;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
  box-shadow: none;
}

.slow-range-controls button:hover,
.slow-range-controls button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.trial-flow {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.trial-step {
  display: grid;
  grid-template-columns: 44px minmax(240px, 1fr) 120px minmax(220px, 0.9fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 70px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.trial-step:last-child {
  border-bottom: 0;
}

.trial-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue);
  font-weight: 900;
}

.trial-step strong,
.trial-step small,
.trial-step em {
  display: block;
}

.trial-step small,
.trial-step em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.trial-step em {
  font-style: normal;
}

.trial-step .status {
  justify-self: start;
  white-space: nowrap;
}

.trial-step button {
  justify-self: end;
}

.dashboard-kpi span,
.dashboard-kpi small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-kpi small + small {
  margin-top: 4px;
  font-weight: 600;
}

.dashboard-kpi small.good-text {
  color: var(--green);
}

.dashboard-kpi small.warning-text {
  color: var(--orange);
}

.dashboard-kpi small.danger-text {
  color: var(--red);
}

.dashboard-kpi strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 27px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-kpi-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 10px 0 8px;
}

.dashboard-kpi-pair > div + div {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.dashboard-kpi-pair strong {
  margin: 0 0 4px;
  font-size: 25px;
}

.dashboard-kpi-pair small {
  font-weight: 700;
}

.dashboard-customer-sales {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.dashboard-customer-sales-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-customer-sales h3 {
  margin: 0;
  font-size: 16px;
}

.dashboard-customer-sales-head span,
.dashboard-customer-sales-row small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-customer-sales-list {
  display: grid;
  gap: 8px;
}

.dashboard-customer-sales-row {
  display: grid;
  grid-template-columns: 28px minmax(150px, 260px) minmax(120px, 1fr) 120px 40px;
  align-items: center;
  gap: 10px;
  min-height: 30px;
}

.dashboard-rank {
  color: var(--muted);
  text-align: center;
}

.dashboard-customer-sales-customer {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.dashboard-customer-sales-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.dashboard-customer-sales-customer small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-customer-sales-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf2f8;
}

.dashboard-customer-sales-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2f74e8;
}

.dashboard-customer-sales-amount {
  text-align: right;
  white-space: nowrap;
}

.dashboard-agency-card {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.dashboard-agency-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 250px);
  gap: 12px;
  align-items: stretch;
}

.dashboard-agency-map {
  position: relative;
  min-height: 620px;
}

.agency-world-svg {
  display: block;
  width: 100%;
  min-height: 620px;
  height: 100%;
}

.agency-world-ocean {
  fill: #cfeaf5;
  stroke: #94c7dc;
  stroke-width: 1.25;
}

.agency-world-grid path {
  fill: none;
  stroke: #9fc8d9;
  stroke-width: 0.55;
  opacity: 0.9;
}

.agency-world-country {
  fill: #d7e4ed;
  stroke: #ffffff;
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.agency-world-country.covered {
  fill: #2f74e8;
  stroke: #145eb7;
  cursor: pointer;
  transition: fill 140ms ease, stroke 140ms ease;
}

.agency-world-country.covered:hover,
.agency-world-country.covered:focus,
.agency-world-country.covered.active {
  fill: #e77717;
  stroke: #a94f0c;
  outline: none;
}

.agency-world-coverage-label circle {
  fill: #e77717;
  stroke: #ffffff;
  stroke-width: 2;
}

.agency-world-coverage-label text {
  fill: #24344d;
  font-size: 15px;
  font-weight: 800;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.agency-world-loading {
  fill: #607086;
  font-size: 18px;
  font-weight: 700;
}

.dashboard-agency-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 390px;
  overflow: auto;
  padding-right: 3px;
}

.dashboard-agency-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 62px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.dashboard-agency-row strong,
.dashboard-agency-row small,
.dashboard-agency-row span {
  display: block;
}

.dashboard-agency-country strong {
  font-size: 13px;
  line-height: 1.3;
}

.dashboard-agency-code {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dashboard-agency-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.dashboard-agency-company strong {
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.sales-historical-order-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #f3cf91;
  border-radius: 6px;
  background: #fffaf0;
}

.sales-historical-order-notice > div {
  display: grid;
  gap: 3px;
}

.sales-historical-order-notice span {
  color: var(--muted);
  font-size: 13px;
}

.inventory-analysis-overview {
  margin-bottom: 16px;
}

.inventory-analysis-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.inventory-analysis-heading h2 {
  margin: 2px 0 5px;
  font-size: 24px;
}

.inventory-analysis-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.inventory-analysis-sync {
  display: grid;
  justify-items: end;
  gap: 6px;
  max-width: 390px;
  text-align: right;
}

.inventory-analysis-sync > div {
  display: grid;
  justify-items: inherit;
  gap: 3px;
}

.inventory-analysis-sync small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.inventory-analysis-gate {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid #f0cf9a;
  border-radius: 8px;
  background: #fffaf0;
  color: #6d501b;
}

.inventory-analysis-gate strong {
  color: #9a6510;
}

.inventory-analysis-gate small {
  color: #806128;
  line-height: 1.55;
}

.metric-grid.inventory-analysis-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inventory-analysis-metrics .metric {
  min-height: 116px;
}

.inventory-analysis-metrics .metric strong {
  font-size: 24px;
}

.inventory-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.inventory-analysis-grid.inventory-age-only {
  grid-template-columns: minmax(0, 1fr);
}

.inventory-age-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.inventory-age-summary strong {
  font-size: 22px;
}

.inventory-age-summary span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.inventory-age-stack {
  display: flex;
  min-height: 16px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf2f8;
}

.inventory-age-stack-segment {
  min-width: 0;
  flex-basis: 0;
  padding: 0;
  border: 0;
  border-right: 2px solid #fff;
  cursor: pointer;
  transition: filter 0.16s ease, transform 0.16s ease;
}

.inventory-age-stack-segment:last-child {
  border-right: 0;
}

.inventory-age-stack-segment:hover,
.inventory-age-stack-segment:focus-visible {
  filter: brightness(0.88);
  outline: 2px solid #123d75;
  outline-offset: -2px;
}

.inventory-age-stack .inventory-age-stack-empty {
  flex: 1;
  background: #edf2f8;
}

.inventory-age-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 14px;
}

.inventory-age-breakdown-item {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  align-items: baseline;
  width: 100%;
  min-height: 82px;
  padding: 13px 15px 12px 19px;
  border: 1px solid #dbe4ef;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(31, 60, 94, 0.05);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.inventory-age-breakdown-item::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--age-color, #2f74e8);
  content: "";
}

.inventory-age-breakdown-item:hover {
  border-color: var(--age-color, #2f74e8);
  box-shadow: 0 8px 18px rgba(31, 60, 94, 0.1);
  transform: translateY(-1px);
}

.inventory-age-breakdown-item:hover span,
.inventory-age-breakdown-item:focus-visible span {
  color: #1266c3;
}

.inventory-age-breakdown-item:focus-visible {
  outline: 2px solid #1266c3;
  outline-offset: 2px;
}

.inventory-age-breakdown span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}

.inventory-age-breakdown i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
}

.inventory-age-breakdown strong {
  white-space: nowrap;
  text-align: right;
  font-size: 13px;
}

.inventory-age-breakdown small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.inventory-status-list,
.inventory-priority-list {
  display: grid;
  gap: 8px;
}

.inventory-priority-toolbar,
.inventory-priority-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
}

.inventory-priority-toolbar input {
  width: min(420px, 100%);
}

.inventory-priority-toolbar span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.inventory-priority-pagination {
  justify-content: flex-end;
  margin: 14px 0 0;
}

.inventory-status-row {
  display: grid;
  grid-template-columns: 118px 58px minmax(90px, 1fr) 112px;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}

.inventory-status-row > strong,
.inventory-status-row > small {
  text-align: right;
  white-space: nowrap;
}

.inventory-status-row small,
.inventory-priority-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.inventory-status-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf2f8;
}

.inventory-status-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2f74e8;
}

.inventory-shelf-note {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.inventory-shelf-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.inventory-analysis-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.inventory-analysis-toolbar > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.inventory-slow-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.inventory-slow-type {
  min-width: 0;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.inventory-slow-type:last-child {
  padding-right: 0;
  border-right: 0;
}

.inventory-slow-type > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inventory-slow-type b,
.inventory-slow-type small {
  display: block;
}

.inventory-slow-type b {
  margin: 12px 0 6px;
  font-size: 17px;
}

.inventory-slow-type small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inventory-tracking-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.inventory-period-tracking {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.inventory-period-tracking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.inventory-period-tracking-head strong,
.inventory-period-tracking-head small {
  display: block;
}

.inventory-period-tracking-head small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.inventory-period-tracking-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
}

.inventory-period-tracking-grid.two-column {
  grid-template-columns: repeat(2, minmax(260px, 340px));
  justify-content: start;
}

.inventory-period-tracking-grid > div,
.inventory-period-tracking-grid > button {
  min-width: 0;
  padding: 0 16px;
  border-left: 1px solid var(--line);
}

.inventory-period-tracking-grid > div:first-child,
.inventory-period-tracking-grid > button:first-child {
  padding-left: 0;
  border-left: 0;
}

.inventory-period-tracking-grid span,
.inventory-period-tracking-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.inventory-period-tracking-grid strong {
  display: block;
  margin: 5px 0 2px;
  font-size: 24px;
  letter-spacing: 0;
}

.inventory-period-tracking-grid > button {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.inventory-period-tracking-grid > button:hover strong,
.inventory-period-tracking-grid > button:focus-visible strong {
  color: #1266c3;
}

.inventory-period-tracking-grid > button:focus-visible {
  outline: 2px solid #1266c3;
  outline-offset: 3px;
}

.inventory-period-tracking-grid.baseline > div:nth-child(n + 3) strong {
  color: #a36316;
  font-size: 17px;
}

.inventory-tracking-head span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-tracking-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 14px;
  margin-top: 12px;
}

.inventory-tracking-grid > div {
  min-width: 0;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.inventory-tracking-grid > div:nth-child(3n) {
  padding-right: 0;
  border-right: 0;
}

.inventory-tracking-grid span,
.inventory-tracking-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.inventory-tracking-grid strong {
  display: block;
  margin: 5px 0 3px;
  font-size: 22px;
}

.inventory-tracking-baseline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 12px;
}

.inventory-tracking-baseline > div {
  min-width: 0;
  padding-right: 16px;
  border-right: 1px solid var(--line);
}

.inventory-tracking-baseline > div:nth-child(2) {
  padding-right: 0;
  border-right: 0;
}

.inventory-tracking-baseline span,
.inventory-tracking-baseline small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inventory-tracking-baseline strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
}

.inventory-tracking-baseline > small {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.inventory-trend-chart {
  min-height: 248px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.inventory-trend-chart svg {
  width: 100%;
  height: 224px;
  display: block;
}

.chart-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.inventory-trend-grid {
  stroke: #e3e9f1;
  stroke-width: 1;
}

.inventory-trend-axis {
  stroke: #cad5e3;
  stroke-width: 1.2;
}

.inventory-trend-line {
  fill: none;
  stroke: #e47c1f;
  stroke-width: 3;
}

.inventory-trend-chart circle {
  fill: #fff;
  stroke: #e47c1f;
  stroke-width: 3;
}

.inventory-trend-chart text {
  font-size: 12px;
}

.inventory-trend-y-label,
.inventory-trend-x-label {
  fill: var(--muted);
  text-anchor: middle;
}

.inventory-trend-y-label {
  text-anchor: end;
}

.inventory-trend-point-label {
  fill: var(--text);
  font-weight: 800;
  text-anchor: middle;
}

.inventory-trend-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.inventory-trend-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e47c1f;
}

.inventory-trend-empty {
  display: grid;
  min-height: 138px;
  place-items: center;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.inventory-priority-row {
  display: grid;
  grid-template-columns: 28px minmax(220px, 360px) 110px minmax(220px, 240px) 86px minmax(150px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.inventory-priority-row:last-child {
  border-bottom: 0;
}

.inventory-priority-row > div {
  min-width: 0;
}

.inventory-priority-row > div small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-priority-rank {
  color: var(--muted);
  text-align: center;
}

.inventory-priority-amount {
  text-align: right;
  white-space: nowrap;
}

.inventory-priority-amount small {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.inventory-action-summary {
  min-width: 0;
}

.inventory-action-summary strong,
.inventory-action-summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-action-summary small {
  color: var(--muted);
  font-size: 12px;
}

.kpi-action {
  margin-top: 10px;
}

.kpi-delta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.kpi-delta-row em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.kpi-delta-row .delta-up {
  color: #a63d18;
  background: #fff0e8;
}

.kpi-delta-row .delta-down {
  color: #087054;
  background: #eaf8f2;
}

.performance-panel {
  margin-bottom: 16px;
  padding-top: 0;
}

.dashboard-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-analytics-card {
  min-width: 0;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.dashboard-analytics-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.dashboard-chart-legend {
  display: flex;
  min-height: 26px;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-chart-legend span,
.dashboard-chart-labels i {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dashboard-chart-legend i,
.dashboard-chart-labels i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.dashboard-pie-layout {
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 214px;
}

.dashboard-pie {
  position: relative;
  display: grid;
  width: 158px;
  height: 158px;
  place-content: center;
  border-radius: 50%;
  margin: 0 auto;
}

.dashboard-pie::after {
  position: absolute;
  inset: 42px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.dashboard-pie strong,
.dashboard-pie small {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
}

.dashboard-pie strong {
  color: var(--text);
  font-size: 25px;
  line-height: 1;
}

.dashboard-pie small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-chart-labels {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.dashboard-chart-labels div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-chart-labels span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-chart-labels strong {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.dashboard-bar-chart {
  display: flex;
  min-height: 220px;
  align-items: flex-end;
  gap: 16px;
  padding: 18px 8px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-bar-column {
  display: grid;
  min-width: 34px;
  flex: 1 1 0;
  grid-template-rows: 20px 170px auto;
  align-items: end;
  gap: 6px;
  text-align: center;
}

.dashboard-bar-column strong {
  color: var(--text);
  font-size: 12px;
}

.dashboard-bar-column span {
  width: min(42px, 100%);
  align-self: end;
  justify-self: center;
  border-radius: 5px 5px 0 0;
}

.dashboard-bar-column small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-customer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
}

.dashboard-customer-grid section + section {
  border-left: 1px solid var(--line);
  padding-left: 36px;
}

.dashboard-customer-grid h3,
.dashboard-followups h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.dashboard-followups {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.dashboard-followups > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.dashboard-followups > div:first-child p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-followup-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-followup-list article {
  min-width: 0;
  border-left: 2px solid #b7d8ee;
  padding-left: 10px;
}

.dashboard-followup-list strong,
.dashboard-followup-list span,
.dashboard-followup-list p {
  display: block;
}

.dashboard-followup-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.dashboard-followup-list span,
.dashboard-followup-list p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-followup-list p {
  line-height: 1.45;
}

.dashboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 -18px 16px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
}

.dashboard-tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 16px;
  box-shadow: none;
}

.dashboard-tabs button:hover,
.dashboard-tabs button.active {
  color: var(--blue);
  background: #f4f9ff;
}

.dashboard-tabs button.active {
  box-shadow: inset 0 -2px 0 var(--blue);
}

.cash-ledger-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.cash-ledger-tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  box-shadow: none;
}

.cash-ledger-tabs button:hover,
.cash-ledger-tabs button.active {
  color: var(--blue);
  background: #f4f9ff;
}

.cash-ledger-tabs button.active {
  box-shadow: inset 0 -2px 0 var(--blue);
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.chart-controls button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 10px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 12px;
}

.chart-controls button:hover,
.chart-controls button.active {
  color: #fff;
  background: var(--blue);
}

.supplier-monthly-controls {
  flex-wrap: wrap;
  max-width: 430px;
  overflow: visible;
  justify-content: flex-start;
  white-space: normal;
  align-content: flex-start;
}

.supplier-monthly-controls button {
  flex: 0 0 auto;
}

/* 供应商趋势的筛选紧邻说明，不使用横向拖动条。 */
.panel-header:has(.supplier-monthly-controls) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(355px, 430px);
  align-items: start;
  gap: 20px;
}

.panel-header:has(.supplier-monthly-controls) > div:first-child {
  min-width: 0;
  max-width: 820px;
}

.panel-header:has(.supplier-monthly-controls) > div:first-child p {
  max-width: 820px;
  line-height: 1.5;
}

.supplier-monthly-chart .supplier-monthly-point-label {
  fill: #2267d8;
  font-size: 11px;
  font-weight: 800;
  paint-order: stroke;
  stroke: #fff;
  stroke-linejoin: round;
  stroke-width: 4px;
}

.quote-payment-account-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.performance-chart {
  min-height: 336px;
}

.performance-chart.empty {
  display: grid;
  place-items: center;
}

.performance-chart svg {
  width: 100%;
  height: 310px;
  display: block;
}

.performance-chart .chart-grid {
  stroke: #e3e9f1;
  stroke-width: 1;
}

.performance-chart .chart-axis {
  stroke: #cad5e3;
  stroke-width: 1.2;
}

.performance-chart .performance-line {
  fill: none;
  stroke: var(--series-color);
  stroke-width: 3;
}

.performance-chart circle {
  fill: #fff;
  stroke: var(--series-color);
  stroke-width: 3;
}

.performance-chart text {
  font-size: 12px;
}

.performance-chart .y-label,
.performance-chart .x-label {
  fill: var(--muted);
  text-anchor: middle;
}

.performance-chart .y-label {
  text-anchor: end;
}

.performance-chart .point-label {
  fill: var(--text);
  font-weight: 800;
  text-anchor: middle;
}

@media (max-width: 760px) {
  .performance-chart .day-label-optional {
    display: none;
  }

  .performance-chart .chart-scroll svg {
    min-width: 940px;
  }

  .inventory-trend-chart .chart-scroll svg {
    min-width: 720px;
  }
}

.chart-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.dashboard-focus-grid {
  align-items: start;
}

.ops-list {
  display: grid;
  gap: 10px;
}

.ops-list > div {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.ops-list > div:last-child {
  border-bottom: 0;
}

.ops-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.ops-list strong {
  font-size: 24px;
  text-align: right;
}

.ops-list small {
  color: var(--muted);
  font-size: 12px;
}

.role-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.role-overview div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.role-overview span,
.role-overview small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.role-overview strong {
  display: block;
  margin: 8px 0;
  font-size: 26px;
  line-height: 1.1;
}

.role-overview small {
  line-height: 1.45;
}

.system-maintenance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
}

.system-maintenance strong,
.system-maintenance span {
  display: block;
}

.system-maintenance span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.system-maintenance button {
  flex: 0 0 auto;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 105px;
  box-shadow: var(--shadow);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric.green {
  border-color: #bfe7d8;
  background: #f3fbf7;
}

.metric.orange {
  border-color: #f6d7b7;
  background: #fff8ef;
}

.metric.red {
  border-color: #f0b8b8;
  background: #fff5f5;
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.watch-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.watch-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
  min-height: 154px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.watch-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.watch-item strong {
  font-size: 24px;
}

.watch-item p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 4px;
}

.bar-chart {
  height: 300px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(70px, 1fr);
  gap: 18px;
  align-items: end;
  overflow-x: auto;
  padding: 10px 4px 0;
}

.bar-column {
  min-width: 70px;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(160px, 1fr) auto auto;
  gap: 7px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.bar-value {
  color: var(--blue);
  font-weight: 800;
  white-space: nowrap;
}

.bar-track {
  height: 100%;
  display: flex;
  align-items: end;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.bar-track span {
  display: block;
  width: 52px;
  border-radius: 6px 6px 0 0;
  background: #2f6fec;
}

.bar-column strong {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.line-chart {
  min-height: 300px;
}

.line-chart svg {
  width: 100%;
  height: 280px;
}

.line-chart .axis {
  stroke: #dfe6ef;
  stroke-width: 1;
}

.line-chart .trend-line {
  fill: none;
  stroke: #2f6fec;
  stroke-width: 3;
}

.line-chart circle {
  fill: #2f6fec;
}

.line-chart text {
  fill: #2f6fec;
  font-size: 12px;
  text-anchor: middle;
}

.line-chart .x-label {
  fill: var(--muted);
}

.line-chart > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.distribution-list {
  display: grid;
  gap: 12px;
}

.distribution-row {
  display: grid;
  gap: 6px;
}

.distribution-row div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.distribution-row span {
  color: var(--muted);
  white-space: nowrap;
}

.distribution-track {
  height: 9px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.distribution-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2f6fec;
}

.empty-chart {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

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

.grid-2,
.grid-3 {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.grid-2 {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.profit-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.36fr) minmax(310px, 0.74fr);
  gap: 16px;
  margin-top: 16px;
}

.profit-workspace .panel {
  min-width: 0;
}

.profit-workspace .table-wrap {
  max-width: 100%;
}

.sales-receivables-summary {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
}

.sales-receivables-summary > div {
  min-width: 190px;
  padding: 12px 16px;
}

.sales-receivables-summary > div + div {
  border-left: 1px solid var(--line);
}

.sales-receivables-summary span,
.sales-receivables-summary strong {
  display: block;
}

.sales-receivables-summary span {
  color: var(--muted);
  font-size: 13px;
}

.sales-receivables-summary strong {
  margin-top: 5px;
  font-size: 20px;
}

.dashboard-owner-status-chart .dashboard-owner-stack {
  display: flex;
  width: 42px;
  padding: 0;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
  background: var(--panel-soft);
}

.dashboard-owner-stack i,
.dashboard-owner-stack b {
  display: block;
  width: 100%;
  flex: 0 0 auto;
}

.dashboard-owner-stack i,
.dashboard-owner-closed { background: #2f74e9; }
.dashboard-owner-stack b,
.dashboard-owner-open { background: #78d3ca; }

.dashboard-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-card-head h3 { margin: 0; }

.dashboard-card-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.dashboard-card-controls button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 7px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.dashboard-card-controls button.active {
  background: var(--blue);
  color: #fff;
  border-radius: 4px;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* 客户档案字段较多，横向查看时始终保留客户身份。 */
.table-wrap[data-table-id="crm-customers"] table {
  min-width: 3260px;
  table-layout: fixed;
}

/* 客户表较宽，顶部也提供一条同步横向滚动条，避免必须翻到列表末尾。 */
.table-scroll-top[data-table-scroll-top="crm-customers"] {
  height: 17px;
  overflow-x: scroll;
  overflow-y: hidden;
  margin: -2px 0 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  scrollbar-gutter: stable;
}

.table-scroll-top[data-table-scroll-top="crm-customers"] > div {
  height: 1px;
}

.table-wrap[data-table-id="crm-customers"] th:nth-child(1),
.table-wrap[data-table-id="crm-customers"] td:nth-child(1) {
  position: sticky;
  left: 0;
  width: 98px;
  min-width: 98px;
  max-width: 98px;
  background: #fff;
  z-index: 2;
}

.table-wrap[data-table-id="crm-customers"] th:nth-child(2),
.table-wrap[data-table-id="crm-customers"] td:nth-child(2) {
  position: sticky;
  left: 98px;
  width: 230px;
  min-width: 230px;
  max-width: 230px;
  background: #fff;
  box-shadow: 8px 0 10px -10px rgba(24, 49, 81, 0.6);
  z-index: 2;
}

.table-wrap[data-table-id="crm-customers"] th:nth-child(1),
.table-wrap[data-table-id="crm-customers"] th:nth-child(2) {
  background: #f1f5fa;
  z-index: 3;
}

.table-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.search-field {
  width: min(420px, 100%);
}

.crm-filter-tools {
  align-items: end;
}

.crm-select-filters {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 10px;
}

.crm-select-filters label {
  display: grid;
  gap: 4px;
  min-width: 148px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.crm-select-filters .crm-name-search {
  min-width: 250px;
}

.crm-select-filters .crm-name-search input {
  min-width: 250px;
  height: 38px;
  background: #fff;
}

.crm-select-filters select {
  min-width: 148px;
  height: 38px;
  background: #fff;
}

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

.table-search {
  height: 38px;
}

.table-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.table-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 38px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.table-pager > div {
  display: flex;
  gap: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
  vertical-align: top;
}

.table-wrap[data-table-id="crm-customers"] td:nth-child(2) {
  min-width: 230px;
}

/* 固定客户身份列后，国家名称仍保留足够宽度，避免被客户名称覆盖或压缩。 */
.table-wrap[data-table-id="crm-customers"] th:nth-child(3),
.table-wrap[data-table-id="crm-customers"] td:nth-child(3) {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  white-space: nowrap;
}

/* CRM 是高频扫表场景：压缩无效留白，但保持国家、编码、最近跟进清晰可读。 */
.table-wrap[data-table-id="crm-customers"] th,
.table-wrap[data-table-id="crm-customers"] td {
  padding: 8px 10px;
  line-height: 1.35;
}

.table-wrap[data-table-id="crm-customers"] td:nth-child(2) strong {
  display: inline;
}

/* 联系方式和备注允许自动换行，避免邮箱、电话等长内容越过单元格互相重叠。 */
.table-wrap[data-table-id="crm-customers"] th:nth-child(n+11),
.table-wrap[data-table-id="crm-customers"] td:nth-child(n+11) {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table-wrap[data-table-id="crm-customers"] th:nth-child(11),
.table-wrap[data-table-id="crm-customers"] td:nth-child(11),
.table-wrap[data-table-id="crm-customers"] th:nth-child(12),
.table-wrap[data-table-id="crm-customers"] td:nth-child(12),
.table-wrap[data-table-id="crm-customers"] th:nth-child(14),
.table-wrap[data-table-id="crm-customers"] td:nth-child(14),
.table-wrap[data-table-id="crm-customers"] th:nth-child(15),
.table-wrap[data-table-id="crm-customers"] td:nth-child(15) {
  width: 180px;
}

.table-wrap[data-table-id="crm-customers"] th:nth-child(13),
.table-wrap[data-table-id="crm-customers"] td:nth-child(13) {
  width: 240px;
}

.table-wrap[data-table-id="crm-customers"] th:nth-child(16),
.table-wrap[data-table-id="crm-customers"] td:nth-child(16) {
  width: 240px;
}

.table-wrap[data-table-id="crm-customers"] th:nth-child(17),
.table-wrap[data-table-id="crm-customers"] td:nth-child(17),
.table-wrap[data-table-id="crm-customers"] th:nth-child(18),
.table-wrap[data-table-id="crm-customers"] td:nth-child(18) {
  width: 300px;
}

.exclusive-agent {
  min-height: 18px;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid #bfd7ff;
  background: #edf4ff;
  color: #1556bd;
  font-size: 11px;
  line-height: 1.2;
  vertical-align: middle;
}

th {
  background: #f1f5fa;
  color: #405168;
  font-weight: 800;
  white-space: nowrap;
}

.sort-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.sort-button:hover,
.sort-button.active {
  background: transparent;
  color: var(--blue);
}

.sort-button small {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.tag,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf4ff;
  color: #1556bd;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.thumb {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.barcode-box {
  min-width: 108px;
  display: inline-grid;
  gap: 4px;
}

.barcode-bars {
  height: 42px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.barcode-bars span {
  display: block;
  background: #172033;
}

.barcode-box small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0;
}

.status.green {
  background: #e7f6f0;
  color: var(--green);
}

.status.orange {
  background: #fff2e2;
  color: var(--orange);
}

.status.red {
  background: #ffecec;
  color: var(--red);
}

.status.blue {
  background: #eaf3ff;
  color: #1769aa;
}

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

.flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(95px, 1fr));
  gap: 8px;
}

.flow-step {
  min-height: 76px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 8px;
  padding: 10px;
}

.flow-step strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.flow-step span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.form-field[hidden] {
  display: none !important;
}

.form-field.is-disabled {
  opacity: 0.68;
}

label {
  display: grid;
  gap: 6px;
  color: #405168;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cdd8e5;
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
}

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.check-field input {
  width: auto;
  margin: 0;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.quote-builder {
  display: grid;
  gap: 14px;
}

.quote-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(460px, 0.88fr);
  gap: 16px;
  align-items: start;
}

.quote-editor-panel {
  min-width: 0;
}

.quote-preview-panel {
  min-width: 0;
  align-self: start;
}

.quote-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.preview-item-name {
  display: inline;
}

.preview-item-name.is-editing {
  display: inline-block;
  min-width: 96px;
  padding: 1px 3px;
  border-radius: 2px;
  outline: 1px dashed var(--blue);
  background: #f5f9ff;
  cursor: text;
}

.quote-preview-content {
  min-width: 0;
  overflow-x: auto;
}

.quote-section-title {
  margin-top: 2px;
  padding: 8px 10px;
  border-left: 3px solid var(--blue);
  background: #f3f7fc;
  color: #24435f;
  font-size: 13px;
  font-weight: 800;
}

.quote-form-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.quote-parties {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quote-parties > div {
  position: relative;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.quote-buyer-address-button {
  position: absolute;
  top: 9px;
  right: 10px;
  z-index: 1;
}

.quote-parties span,
.quote-line-amount span,
.quote-profit-grid span,
.a4-meta span,
.a4-total span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.quote-parties strong {
  display: block;
  margin: 5px 0;
}

.quote-parties small {
  color: var(--muted);
  line-height: 1.45;
}

.quote-address-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quote-address-title button {
  margin-left: auto;
}

.quote-address-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.quote-address-summary {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  line-height: 1.5;
}

.quote-address-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.quote-address-wide {
  grid-column: span 2;
}

.quote-address-help {
  margin: -4px 0 4px;
}

.quote-items {
  display: grid;
  gap: 10px;
}

.quote-picker {
  position: relative;
  display: block;
}

.quote-picker > input {
  width: 100%;
}

.quote-picker-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 248px;
  overflow-y: auto;
  border: 1px solid #b8c9de;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(26, 51, 82, .16);
}

.quote-product-picker {
  min-width: min(620px, calc(100vw - 72px));
  max-height: 360px;
}

.quote-picker-menu[hidden] {
  display: none;
}

.quote-picker-option {
  display: grid;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #e6edf5;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.quote-picker-option:last-child {
  border-bottom: 0;
}

.quote-picker-option:hover,
.quote-picker-option:focus-visible {
  background: #edf5ff;
  outline: none;
}

.quote-picker-option strong,
.quote-picker-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-picker-option small,
.quote-picker-empty {
  color: var(--muted);
  font-size: 12px;
}

.quote-picker-summary {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid #e6edf5;
  background: #f5f8fc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.quote-product-picker .quote-picker-option strong,
.quote-product-picker .quote-picker-option small {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.quote-product-picker .quote-picker-option strong {
  line-height: 1.4;
}

.quote-product-picker .quote-picker-option small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.35;
}

.quote-picker-empty {
  display: block;
  margin: 0;
  padding: 9px 10px;
  line-height: 1.45;
}

.quote-product-search {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.quote-product-search label {
  flex: 1 1 360px;
}

.quote-product-search > span {
  flex: 0 0 auto;
  padding-bottom: 2px;
  font-size: 12px;
  white-space: nowrap;
}

.quote-payment-term {
  grid-column: span 3;
}

.quote-item {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 86px 108px minmax(92px, max-content) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 12px 46px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-item > label {
  position: relative;
  display: grid;
  grid-template-rows: 18px 38px;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.quote-field-label {
  display: block;
  line-height: 18px;
  white-space: nowrap;
}

.quote-line-amount {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 3px;
  grid-column: auto;
  padding-top: 24px;
  white-space: nowrap;
}

.quote-item .removeQuoteItem {
  align-self: start;
  margin-top: 24px;
}

.quote-price-note {
  position: absolute;
  top: 67px;
  left: 0;
  display: block;
  min-height: 0;
  margin: 0;
  max-width: 108px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.quote-price-note.history {
  color: #087f5b;
}

.quote-price-note.manual {
  color: #9a5b00;
}

.quote-price-note.saved {
  color: #46617f;
}

.quote-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 12px;
  background: #f1f6ff;
  border-radius: 8px;
}

.quote-summary strong {
  font-size: 22px;
}

.quote-profit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

.quote-profit-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quote-cost-warning {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #d58a1c;
  border-radius: 0 6px 6px 0;
  background: #fff8ef;
  color: #8a4b08;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.quote-profit-grid strong {
  display: block;
  margin-top: 7px;
  font-size: 18px;
}

.good-text {
  color: var(--green);
}

.warning-text {
  color: var(--orange);
}

.danger-text {
  color: var(--red);
}

.a4-preview {
  width: 100%;
  min-height: 680px;
  padding: 24px;
  border: 1px solid #d8e0ea;
  background: #fff;
  box-shadow: inset 0 0 0 1px #f4f7fb;
  color: #172033;
  font-size: 12px;
  line-height: 1.46;
}

.a4-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid #d8e0ea;
  padding-bottom: 14px;
}

.a4-head > div {
  min-width: 0;
}

.a4-head img {
  width: 170px;
  height: 32px;
  object-fit: contain;
  object-position: left center;
}

.a4-head h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #111;
  text-align: left;
  overflow-wrap: anywhere;
}

.a4-head p {
  margin: 2px 0;
  font-size: 13px;
}

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

.a4-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.a4-parties > div,
.a4-note {
  border: 1px solid #d8e0ea;
  padding: 12px;
}

.a4-parties p,
.a4-note {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.a4-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 12px;
  border: 1px solid #d8e0ea;
}

.a4-meta.a4-meta-single {
  grid-template-columns: 1fr;
}

.a4-meta div {
  min-width: 0;
  padding: 9px;
  border-right: 1px solid #d8e0ea;
  font-size: 13px;
  line-height: 1.35;
}

.a4-meta div:last-child {
  border-right: 0;
}

.a4-items {
  margin-top: 14px;
}

.a4-items th,
.a4-items td {
  padding: 7px;
  font-size: 12px;
}

.a4-items img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 1px solid #d8e0ea;
  background: #fff;
}

.a4-total {
  width: min(340px, 100%);
  margin: 12px 0 0 auto;
  border: 1px solid #d8e0ea;
}

.a4-total div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid #d8e0ea;
  font-size: 13px;
}

.document-total-qty {
  display: inline-block;
  margin-left: 12px;
  color: #526679;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
}

.a4-total div:last-child {
  border-bottom: 0;
  background: #f4f7fb;
}

.a4-note {
  margin-top: 12px;
}

.contract-preview {
  min-height: 0;
  padding: 22px;
  font-size: 12px;
  line-height: 1.46;
}

.contract-preview-head {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 190px;
  gap: 12px;
  align-items: center;
  padding-bottom: 11px;
  border-bottom: 2px solid #0d4b7a;
}

.contract-preview-head img {
  width: 122px;
  height: 30px;
  object-fit: contain;
  object-position: left center;
}

.contract-preview-head h2 {
  margin: 0;
  color: #102b47;
  font-size: 22px;
  letter-spacing: 2px;
  text-align: center;
}

.contract-preview-meta {
  color: #42566c;
  font-size: 12px;
  line-height: 1.55;
}

.contract-preview-meta p {
  margin: 0;
}

.contract-preview-meta strong {
  color: #1d3147;
}

.contract-preview-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.contract-preview-parties section {
  min-width: 0;
  min-height: 146px;
  border: 1px solid #9fb5c7;
  padding: 9px 10px;
}

.contract-preview-parties h3 {
  margin: 0;
  padding-bottom: 5px;
  border-bottom: 1px solid #d8e2eb;
  color: #102b47;
  font-size: 13px;
}

.contract-preview-parties p {
  margin: 7px 0 0;
  color: #24364a;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.contract-preview-parties strong {
  color: #102b47;
  font-size: 13px;
}

.contract-preview-items {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
}

.contract-preview-items th,
.contract-preview-items td {
  padding: 5px;
  border: 1px solid #9fb5c7;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  vertical-align: middle;
}

.contract-preview-items th {
  color: #1f3b55;
  background: #eef4f8;
  font-size: 12px;
}

.contract-preview-items .contract-preview-description {
  min-width: 104px;
  text-align: left;
}

.contract-preview-items img {
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 auto;
  object-fit: contain;
  border: 1px solid #d8e0ea;
}

.contract-preview-total {
  width: min(292px, 100%);
  margin: 11px 0 0 auto;
  border: 1px solid #9fb5c7;
}

.contract-preview-total div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-bottom: 1px solid #9fb5c7;
  font-size: 12px;
}

.contract-preview-total div:last-child {
  border-bottom: 0;
  background: #eef4f8;
  font-size: 13px;
}

.contract-preview-clauses {
  margin-top: 11px;
  padding: 8px 10px;
  border: 1px solid #9fb5c7;
  color: #24364a;
  font-size: 12px;
  line-height: 1.55;
}

.contract-preview-clauses div + div {
  margin-top: 2px;
}

.contract-preview-remarks {
  min-height: 34px;
  margin-top: 11px;
  padding: 7px 9px;
  border: 1px solid #9fb5c7;
  color: #24364a;
  font-size: 12px;
  line-height: 1.45;
}

.contract-preview-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 38px;
  margin-top: 34px;
}

.contract-preview-signatures div {
  min-height: 46px;
  padding-top: 6px;
  border-top: 1px solid #172033;
  color: #526679;
  font-size: 12px;
}

.payment-qr-upload {
  gap: 8px;
}

.payment-qr-upload-preview {
  min-height: 56px;
  display: flex;
  align-items: center;
}

.payment-qr-upload-preview img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.payment-qr-upload small {
  color: var(--muted);
  line-height: 1.45;
}

.payment-qr-thumb {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.a4-payment-qr-note {
  text-align: left;
}

.a4-payment-qr {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin: 10px 0;
  font-weight: 800;
}

.a4-payment-qr img {
  width: 144px;
  height: 144px;
  object-fit: contain;
  border: 1px solid #d8e0ea;
  background: #fff;
}

.a4-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}

.a4-signatures span {
  min-height: 52px;
  padding-top: 8px;
  border-top: 1px solid #172033;
  color: var(--muted);
  font-size: 11px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

.card h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-head-row h3 {
  min-width: 0;
}

.knowledge-card-content,
.knowledge-article-content {
  overflow-wrap: anywhere;
}

.knowledge-article-view {
  min-width: 0;
}

.kb-source-list {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
}

.kb-source-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.kb-source-list li > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.split-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.issue-scope-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 14px 0 10px;
}

.issue-scope-controls > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-right: 2px;
}

.issue-scope-controls button {
  box-shadow: none;
}

.issue-scope-controls button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.dxm-workbench {
  display: grid;
  gap: 16px;
}

.dxm-summary,
.dxm-readiness {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dxm-summary div,
.dxm-readiness div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.dxm-summary span,
.dxm-readiness span,
.dxm-field-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dxm-summary strong,
.dxm-readiness strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1.1;
}

.dxm-readiness small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dxm-summary small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dxm-initial-data {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #f1cc85;
  border-radius: 8px;
  background: #fff9eb;
}

.dxm-initial-data strong {
  color: #8a5a00;
}

.dxm-initial-data p {
  margin: 5px 0 0;
  color: #725c32;
  font-size: 13px;
  line-height: 1.5;
}

.dxm-initial-source {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  color: #725c32;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.dxm-initial-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.dxm-initial-progress > div {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid #ecd19e;
  border-radius: 6px;
  background: #fffdf7;
}

.dxm-initial-progress span {
  color: #725c32;
  font-size: 12px;
  font-weight: 700;
}

.dxm-initial-progress strong {
  font-size: 12px;
}

.dxm-initial-data .split-actions {
  flex: 0 0 auto;
  margin: 0;
}

.dxm-task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dxm-routine-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 2px 0 10px;
}

.dxm-routine-heading strong {
  color: var(--ink);
  font-size: 16px;
}

.dxm-routine-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dxm-routine-heading > span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eaf7f1;
  color: #19835d;
  font-size: 12px;
  font-weight: 800;
}

.dxm-routine-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dxm-task {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.dxm-task strong {
  font-size: 15px;
}

.dxm-step {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.dxm-task p,
.dxm-field-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.dxm-task button {
  justify-self: start;
}

.dxm-guidance {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.dxm-guidance > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  list-style: none;
}

.dxm-guidance > summary::-webkit-details-marker {
  display: none;
}

.dxm-guidance > summary::after {
  content: "+";
  order: 3;
  color: var(--blue);
  font-size: 20px;
  line-height: 1;
}

.dxm-guidance[open] > summary::after {
  content: "−";
}

.dxm-guidance > summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dxm-guidance-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.dxm-first-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid #f1cc85;
  border-radius: 7px;
  background: #fff9eb;
}

.dxm-first-time span,
.dxm-guidance-grid span {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.dxm-first-time p,
.dxm-guidance-grid p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.dxm-first-time button {
  flex: 0 0 auto;
}

.dxm-guidance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dxm-guidance-grid > div {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.dxm-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.dxm-field-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.dxm-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.dxm-flow section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.dxm-flow strong {
  color: var(--ink);
  font-size: 15px;
}

.dxm-flow p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.sync-checklist td {
  vertical-align: top;
  line-height: 1.45;
}

.sync-checklist td:first-child {
  width: 48px;
  text-align: center;
  font-weight: 800;
  color: #0f70b7;
}

.sync-checklist td:nth-child(4) {
  min-width: 320px;
}

.settlement-scope {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.settlement-scope span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settlement-scope strong {
  font-size: 13px;
  line-height: 1.5;
}

.settlement-calc {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.settlement-calc div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.settlement-calc span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settlement-calc strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.history-order-note {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid #cfe0f5;
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  background: #f7fbff;
  color: var(--muted);
  line-height: 1.6;
}

.history-order-note strong {
  color: var(--ink);
}

.order-export-file {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px !important;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 12px 14px;
  background: #172033;
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.login-mode .sidebar {
  display: none;
}

.login-mode .app-shell {
  grid-template-columns: 1fr;
}

.login-mode .topbar {
  display: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: #eaf0f6;
}

.login-card {
  width: min(1040px, 100%);
  min-height: 576px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  background: #fff;
  border: 1px solid #d7e1ec;
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(19, 48, 76, 0.16);
  overflow: hidden;
}

.login-copy {
  display: flex;
  flex-direction: column;
  padding: 42px;
  background: #0b2941;
  color: #fff;
}

.login-logo-wrap {
  width: 234px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  margin-bottom: 50px;
}

.login-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.login-copy h1 {
  margin: 10px 0 0;
  font-size: 34px;
  line-height: 1.25;
}

.login-system-label,
.login-form-heading > span {
  color: #8db4d2;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.login-system-copy {
  margin: 12px 0 0;
  color: #c7d8e8;
  font-size: 16px;
  line-height: 1.6;
}

.login-module-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 360px;
  margin-top: 38px;
}

.login-module-list span {
  padding: 10px 12px;
  border: 1px solid rgba(183, 212, 235, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #d7e7f6;
  font-size: 13px;
  font-weight: 700;
}

.login-copy-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid rgba(183, 212, 235, 0.18);
  color: #9bbbd3;
  font-size: 12px;
  font-weight: 700;
}

.login-copy-footer span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.login-copy-footer i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #46cc91;
}

.login-boundary {
  margin: 18px 0 0;
  color: rgba(225, 237, 248, 0.72);
  font-size: 12px;
  line-height: 1.6;
}

.login-form {
  padding: 48px 42px;
  display: grid;
  gap: 16px;
  align-content: center;
}

.login-form-heading {
  margin-bottom: 10px;
}

.login-form-heading > span {
  color: var(--blue);
}

.login-form h2 {
  margin: 7px 0 4px;
  color: var(--ink);
  font-size: 26px;
}

.login-form-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.login-form label {
  color: #40526a;
  font-size: 13px;
  font-weight: 800;
}

.login-form input {
  min-height: 44px;
  margin-top: 7px;
  background: #fbfdff;
}

.login-error {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.login-recovery {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.login-recovery summary {
  width: fit-content;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
}

.login-recovery p {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #8fc2eb;
  background: #f4f9fd;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 32, 51, 0.46);
}

.modal-dialog {
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(23, 32, 51, 0.2);
}

.modal-dialog.wide-dialog {
  width: min(1120px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.modal-head h2 {
  margin-bottom: 4px;
}

.modal-section {
  padding: 18px 18px 0;
}

.modal-section h3,
.modal-form h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head h3 {
  margin: 0;
}

.section-head > div {
  min-width: 0;
}

.section-head p {
  margin: 4px 0 0;
}

.order-lines {
  display: grid;
  gap: 10px;
}

.order-line {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) 90px 110px minmax(140px, 0.8fr) 90px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.order-line.purchase-line {
  grid-template-columns: minmax(220px, 1.5fr) 86px 100px 86px 86px minmax(130px, 0.9fr) 90px auto;
}

.order-line > div {
  display: grid;
  gap: 6px;
}

.order-line > div span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-line > div strong {
  min-height: 38px;
  display: flex;
  align-items: center;
}

.followup-list {
  display: grid;
  gap: 8px;
}

.followup-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.followup-item div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.followup-item p {
  margin: 6px 0 0;
  line-height: 1.55;
}

.modal-form {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field-wide textarea {
  min-height: 170px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
  }

  .sidebar {
    position: static;
    height: auto;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .metric-grid,
  .inventory-analysis-metrics,
  .dashboard-kpis,
  .dashboard-analytics-grid,
  .dashboard-customer-grid,
  .grid-2,
  .profit-workspace,
  .grid-3,
  .cards,
  .watch-grid,
  .watch-grid.compact {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-followup-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-agency-layout {
    grid-template-columns: 1fr;
  }

  .inventory-analysis-grid {
    grid-template-columns: 1fr;
  }

  .inventory-period-tracking-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 14px;
  }

  .inventory-period-tracking-grid > div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .inventory-period-tracking-grid > button:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .metric-grid.inventory-analysis-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-workbench {
    grid-template-columns: 1fr;
  }

  .dxm-task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dxm-routine-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quote-profit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trial-step {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .trial-step em {
    grid-column: 2 / -1;
  }
}

@media (max-width: 720px) {
  .sidebar {
    display: block;
    height: auto;
    overflow: visible;
    padding: 10px 12px 0;
  }

  .dashboard-agency-map {
    min-height: 280px;
  }

  .agency-world-svg {
    min-height: 280px;
  }

  .inventory-period-tracking-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .inventory-period-tracking-grid {
    grid-template-columns: 1fr;
  }

  .inventory-period-tracking-grid > div,
  .inventory-period-tracking-grid > button,
  .inventory-period-tracking-grid > div:nth-child(3),
  .inventory-period-tracking-grid > button:nth-child(3) {
    padding: 10px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .inventory-period-tracking-grid > div:first-child,
  .inventory-period-tracking-grid > button:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .dashboard-agency-row {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px;
  }

  .dashboard-agency-meta {
    grid-column: 2;
    text-align: left;
  }

  .brand {
    display: flex;
    align-items: center;
    padding: 2px 0 10px;
    border-bottom: 0;
  }

  .brand-logo-box {
    width: 132px;
    height: 20px;
  }

  .brand > span,
  .sidebar-footer {
    display: none;
  }

  nav {
    display: flex;
    grid-template-columns: none;
    gap: 6px;
    margin-top: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 10px;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 116px;
    min-height: 40px;
    padding: 8px 10px;
  }

  .nav-badge {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .top-actions .userbox {
    flex-basis: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .content,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* iPhone 上小于 16px 的输入文字会触发页面自动放大。 */
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .panel-header,
  .table-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-header:has(.supplier-monthly-controls) {
    display: flex;
    grid-template-columns: none;
  }

  .panel-header:has(.supplier-monthly-controls) > div:first-child,
  .panel-header:has(.supplier-monthly-controls) > div:first-child p {
    max-width: none;
  }

  .panel-header > button,
  .panel-header > .split-actions,
  .table-tools .search-field {
    width: 100%;
  }

  .supplier-monthly-controls {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
  }

  .table-pager {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .metric-grid,
  .inventory-analysis-metrics,
  .dashboard-kpis,
  .dashboard-analytics-grid,
  .dashboard-customer-grid,
  .grid-2,
  .profit-workspace,
  .grid-3,
  .cards,
  .watch-grid,
  .watch-grid.compact,
  .quote-form-grid,
  .quote-address-grid,
  .quote-parties,
  .quote-profit-grid,
  .a4-head,
  .a4-parties,
  .form-grid,
  .settlement-calc,
  .flow {
    grid-template-columns: 1fr;
  }

  .inventory-analysis-heading,
  .inventory-analysis-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid.inventory-analysis-metrics {
    grid-template-columns: 1fr;
  }

  .inventory-analysis-sync {
    justify-items: start;
    max-width: none;
    text-align: left;
  }

  .inventory-status-row {
    grid-template-columns: 110px 48px minmax(80px, 1fr);
  }

  .inventory-status-row > small {
    grid-column: 2 / -1;
    text-align: left;
  }

  .inventory-shelf-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .inventory-slow-type-grid {
    grid-template-columns: 1fr;
  }

  .inventory-age-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .inventory-age-summary span {
    text-align: left;
  }

  .inventory-age-breakdown {
    grid-template-columns: 1fr;
  }

  .inventory-trend-chart {
    min-height: 218px;
  }

  .inventory-trend-chart svg {
    height: 194px;
  }

  .inventory-trend-chart text {
    font-size: 11px;
  }

  .inventory-trend-label-optional {
    display: none;
  }

  .inventory-tracking-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .inventory-tracking-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-tracking-baseline {
    grid-template-columns: 1fr;
  }

  .inventory-tracking-baseline > div {
    padding: 0 0 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .inventory-tracking-grid > div:nth-child(2n) {
    border-right: 0;
    padding-right: 0;
  }

  .inventory-tracking-grid > div:nth-child(3n):not(:nth-child(2n)) {
    padding-right: 10px;
    border-right: 1px solid var(--line);
  }

  .inventory-slow-type {
    padding: 0 0 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .inventory-slow-type:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .inventory-priority-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: start;
  }

  .inventory-priority-row > span.status {
    grid-column: 2;
  }

  .inventory-priority-amount {
    grid-column: 3;
    grid-row: 1;
  }

  .inventory-priority-row > small {
    grid-column: 2 / -1;
  }

  .inventory-priority-row > button {
    grid-column: 3;
    grid-row: 3;
  }

  .dashboard-customer-grid section + section {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
  }

  .dashboard-followups > div:first-child {
    display: block;
  }

  .dashboard-followups > div:first-child p {
    margin-top: 4px;
  }

  .dashboard-followup-list {
    grid-template-columns: 1fr;
  }

  .dashboard-pie-layout {
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 10px;
  }

  .dashboard-pie {
    width: 120px;
    height: 120px;
  }

  .dashboard-pie::after {
    inset: 32px;
  }

  .dashboard-pie strong {
    font-size: 20px;
  }

  .dashboard-bar-chart {
    gap: 8px;
    padding-left: 0;
    padding-right: 0;
  }

  .dashboard-customer-sales-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .dashboard-customer-sales-row {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 8px;
    row-gap: 5px;
    min-height: 48px;
  }

  .dashboard-customer-sales-bar {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .dashboard-customer-sales-amount {
    grid-column: 3;
    grid-row: 1;
  }

  .dashboard-customer-sales-row > small {
    grid-column: 2;
    grid-row: 3;
  }

  .sales-historical-order-notice {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .quote-item {
    grid-template-columns: 1fr;
    padding-bottom: 12px;
  }

  .quote-price-note {
    position: static;
    margin-top: 4px;
  }

  .order-line,
  .order-line.purchase-line {
    grid-template-columns: 1fr;
  }

  .modal-head {
    padding: 14px;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-actions button {
    flex: 1 1 132px;
    min-height: 42px;
  }

  .quote-product-search {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-product-search > span {
    white-space: normal;
  }

  .quote-payment-term {
    grid-column: auto;
  }

  .dxm-task-grid {
    grid-template-columns: 1fr;
  }

  .dxm-routine-grid {
    grid-template-columns: 1fr;
  }

  .dxm-routine-heading,
  .dxm-first-time {
    align-items: flex-start;
    flex-direction: column;
  }

  .dxm-guidance > summary {
    align-items: flex-start;
    min-height: 58px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .dxm-guidance > summary small {
    margin-left: 0;
  }

  .dxm-guidance-grid {
    grid-template-columns: 1fr;
  }

  .dxm-initial-data {
    align-items: flex-start;
    flex-direction: column;
  }

  .dxm-initial-data .split-actions {
    width: 100%;
  }

  .dxm-initial-progress {
    align-items: stretch;
  }

  .trial-step {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .trial-step .status,
  .trial-step em,
  .trial-step button {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .a4-meta {
    grid-template-columns: 1fr;
  }

  .a4-meta div {
    border-right: 0;
    border-bottom: 1px solid #d8e0ea;
  }

  .a4-meta div:last-child {
    border-bottom: 0;
  }

  .a4-head h2 {
    text-align: left;
  }

  .login-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .login-screen {
    padding: 16px;
  }

  .login-copy,
  .login-form {
    padding: 28px 24px;
  }

  .login-logo-wrap {
    width: 204px;
    margin-bottom: 34px;
  }

  .login-copy h1 {
    font-size: 29px;
  }

  .login-module-list {
    margin-top: 26px;
  }

  .modal-backdrop {
    padding: 12px;
  }
}
.customer-order-detail-button {
  min-width: 76px;
  white-space: nowrap;
}

.overseas-inventory-page {
  display: grid;
  gap: 16px;
}

.overseas-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #d8e3ef;
  border-radius: 12px;
}

.overseas-filter-bar label {
  display: grid;
  gap: 6px;
  color: #62738a;
  font-size: 12px;
  font-weight: 700;
}

.overseas-filter-bar select {
  min-width: 0;
  background: #f9fbfe;
}

.overseas-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overseas-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.overseas-platform-chart {
  display: grid;
  gap: 12px;
}

.overseas-platform-row {
  display: grid;
  grid-template-columns: 76px minmax(180px, 1fr) 130px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #142a43;
  text-align: left;
  background: #f8fbff;
  border: 1px solid #dce7f3;
  border-radius: 10px;
}

.overseas-platform-row:hover {
  border-color: #2d7ec7;
  background: #f1f7fd;
}

.overseas-platform-row span {
  justify-self: end;
  font-weight: 800;
}

.overseas-platform-row small {
  grid-column: 2 / -1;
  color: #6b7c92;
}

.overseas-platform-bar {
  display: flex;
  align-items: stretch;
  height: 14px;
  overflow: hidden;
  background: #e8eef5;
  border-radius: 999px;
}

.overseas-platform-bar i {
  display: block;
  min-width: 2px;
}

.overseas-platform-bar .on {
  background: #2477bd;
}

.overseas-platform-bar .transit {
  background: #f3a64a;
}

.overseas-freshness {
  align-content: start;
}

.overseas-freshness > div:not(.section-head) {
  display: grid;
  grid-template-columns: 72px 92px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #e5edf5;
}

.overseas-freshness small {
  overflow: hidden;
  color: #6b7c92;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overseas-inventory-page td small {
  display: block;
  margin-top: 3px;
  color: #708197;
}

@media (max-width: 1050px) {
  .overseas-filter-bar,
  .overseas-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overseas-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .overseas-filter-bar,
  .overseas-metrics {
    grid-template-columns: 1fr;
  }

  .overseas-platform-row {
    grid-template-columns: 70px minmax(120px, 1fr);
  }

  .overseas-platform-row span {
    grid-column: 2;
    justify-self: start;
  }
}

.inline-field-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inline-field-action button {
  white-space: nowrap;
}

.supplier-payable-supplier {
  grid-column: span 3;
}

.supplier-payable-supplier .inline-field-action {
  grid-template-columns: minmax(240px, 1fr) auto;
}

.inline-supplier-create {
  padding: 14px;
  background: #f7faff;
  border: 1px solid #d5e2f0;
  border-radius: 10px;
}

.inline-supplier-create > strong {
  display: block;
  margin-bottom: 10px;
}

.searchable-select-combobox {
  width: 100%;
  background: #fff;
  border-color: #a8c8e8;
}

.searchable-select-host {
  position: relative;
}

.searchable-select-menu {
  top: 100%;
  max-height: 300px;
}

.select-add.searchable-select-host .searchable-select-menu {
  right: 0;
  min-width: 100%;
}

.select-add .searchable-select-option {
  width: 100%;
  height: auto;
  padding: 8px 10px;
}

.select-add .searchable-select-option strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.searchable-select-option {
  min-height: 38px;
}

.searchable-select-source {
  display: none !important;
}
