:root {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: #14213d;
  /* ERP pages use a quiet, token-backed work surface. Decorative gradients here
     used to bleed through nested layouts and made the shell read like a marketing
     surface instead of a dense operational workspace. */
  background: var(--erp-color-workspace, #f6f8fb);
}

.mall-shell .mall-after-sale-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.mall-shell .mall-after-sale-row > div {
  min-width: 0;
}

.mall-shell .mall-after-sale-list-item {
  overflow: hidden;
}

@media (max-width: 560px) {
  /* Keep alert content readable when a narrow action row would otherwise
     consume the entire flex line and collapse the message to zero width. */
  .mall-shell .ant-alert {
    flex-wrap: wrap;
  }

  .mall-shell .ant-alert-content {
    flex: 1 1 calc(100% - 30px);
    min-width: 0;
  }

  .mall-shell .ant-alert-action {
    flex: 1 1 100%;
    margin-left: 22px;
  }

  .mall-shell .mall-after-sale-row {
    flex-direction: column;
    gap: 8px;
  }

  .mall-shell .mall-after-sale-row > .ant-btn {
    align-self: flex-start;
    padding-inline: 0;
  }
}

.mall-operations-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.mall-operations-heading .ant-typography-secondary {
  color: #5f6b7a;
  font-size: 12px;
}

.mall-operations-heading .ant-btn {
  margin-left: auto;
  color: #5f6b7a;
}

.mall-operations-card .ant-tabs-nav {
  margin-bottom: 8px;
}

.mall-operations-tab-actions {
  display: flex;
  justify-content: flex-end;
  min-height: 32px;
}

.mall-operations-tab-actions .ant-btn + .ant-btn {
  margin-left: 8px;
}

.mall-orders-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.mall-orders-heading .ant-typography-secondary {
  color: #5f6b7a;
  font-size: 12px;
}

.mall-orders-heading .ant-btn {
  margin-left: auto;
  color: #5f6b7a;
}

.mall-orders-status-strip {
  margin-bottom: 2px;
}

.mall-orders-status-strip .ant-card {
  border: 1px solid #e4e7ec;
  box-shadow: none;
}

.mall-orders-status-strip .ant-card-body {
  padding: 9px 12px;
}

.mall-orders-status-strip .ant-statistic-title {
  margin-bottom: 0;
  color: #5f6b7a;
  font-size: 11px;
}

.mall-orders-status-strip .ant-statistic-content {
  font-size: 18px;
}

.mall-orders-filter-toolbar {
  padding-bottom: 10px;
  border-bottom: 1px solid #edf0f3;
}

@media (max-width: 640px) {
  .mall-operations-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .mall-operations-heading .ant-btn {
    margin-left: auto;
  }
}

/* Mobile ERP */
.mobile-erp-shell {
  --mobile-bottom-nav-height: calc(62px + env(safe-area-inset-bottom, 0px));
  --mobile-submit-bar-height: 68px;
  min-height: 100vh;
  max-width: 680px;
  margin: 0 auto;
  background: #f3f5f7;
  color: #17202a;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.mobile-erp-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: env(safe-area-inset-top, 0) 16px 0;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e4e7eb;
  backdrop-filter: blur(12px);
}

.mobile-erp-brand,
.mobile-user-button,
.mobile-bottom-nav button,
.mobile-quick-grid button,
.mobile-todo-list button,
.mobile-compact-list button,
.mobile-document-row,
.mobile-todo-cards button {
  appearance: none;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.mobile-erp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  background: transparent;
  text-align: left;
}

.mobile-erp-brand > span:last-child {
  display: grid;
  gap: 1px;
}

.mobile-erp-brand strong {
  font-size: 15px;
  line-height: 1.2;
}

.mobile-erp-brand small {
  color: #707985;
  font-size: 11px;
}

.mobile-erp-logo,
.mobile-login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 6px;
  background: #176b87;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.mobile-user-button {
  display: inline-flex;
  padding: 0;
  background: transparent;
}

.mobile-user-button .ant-avatar {
  background: #dfe9e6;
  color: #245c52;
  font-weight: 700;
}

.mobile-erp-content {
  min-height: calc(var(--mobile-visible-height, 100vh) - 58px);
  padding-bottom: calc(var(--mobile-content-bottom, var(--mobile-bottom-nav-height)) + 14px);
}

.mobile-erp-shell[data-mobile-keyboard-open] .mobile-bottom-nav { display: none; }
.mobile-erp-shell :is(input, textarea, [contenteditable="true"]) {
  scroll-margin-bottom: calc(var(--mobile-action-bottom, var(--mobile-bottom-nav-height)) + var(--mobile-submit-bar-height));
}

.mobile-bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 680px;
  min-height: var(--mobile-bottom-nav-height);
  margin: 0 auto;
  padding: 5px 4px calc(5px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid #dfe3e8;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.mobile-bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 50px;
  padding: 3px 2px;
  background: transparent;
  color: #707985;
  font-size: 11px;
}

.mobile-bottom-nav button.is-active {
  color: #176b87;
  font-weight: 700;
}

.mobile-nav-icon {
  display: inline-flex;
  font-size: 20px;
}

.mobile-page {
  width: 100%;
  padding: 14px 14px 24px;
}

.mobile-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  margin-bottom: 14px;
}

.mobile-page-header-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.mobile-page-heading {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.mobile-page-heading .ant-typography {
  margin: 0;
}

.mobile-page-heading h4.ant-typography {
  font-size: 20px;
  line-height: 1.25;
}

.mobile-page-heading > span.ant-typography {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-page-header-extra {
  display: flex;
  flex: 0 0 auto;
}

.mobile-icon-button.ant-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}

.mobile-section,
.mobile-form-section,
.mobile-detail-summary,
.mobile-profile-identity,
.mobile-skeleton-block,
.mobile-filter-stack {
  margin-bottom: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
}

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

.mobile-section-heading .ant-typography {
  margin: 0;
  font-size: 15px;
}

.mobile-list-pagination {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.mobile-list-pagination .ant-btn {
  flex: 1;
  min-height: 44px;
}

.mobile-receipt-entry-list {
  display: grid;
  gap: 10px;
}

.mobile-receipt-entry {
  padding: 12px;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  background: #f8fafb;
}

.mobile-receipt-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mobile-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.mobile-metric {
  display: grid;
  min-width: 0;
  min-height: 82px;
  padding: 12px;
  border: 1px solid #e1e5e9;
  border-left-width: 4px;
  border-radius: 7px;
  background: #fff;
}

.mobile-metric span {
  color: #66717d;
  font-size: 12px;
}

.mobile-metric strong {
  align-self: end;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.2;
}

.mobile-tone-blue { border-color: #267a9a !important; color: #176b87; }
.mobile-tone-green { border-color: #3b7d69 !important; color: #276454; }
.mobile-tone-orange { border-color: #c97a2b !important; color: #9b5315; }
.mobile-tone-cyan { border-color: #39828a !important; color: #25636a; }
.mobile-tone-red { border-color: #bb4e57 !important; color: #98353e; }
.mobile-tone-purple { border-color: #8064a9 !important; color: #674c8b; }
.mobile-tone-gold { border-color: #b68a24 !important; color: #886513; }

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

.mobile-quick-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 68px;
  padding: 8px 3px;
  border-radius: 6px;
  background: #f4f7f8;
}

.mobile-quick-grid button > span {
  display: inline-flex;
  color: #176b87;
  font-size: 21px;
}

.mobile-quick-grid button strong {
  width: 100%;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-todo-list,
.mobile-compact-list,
.mobile-item-list,
.mobile-money-lines {
  display: grid;
}

.mobile-todo-list button,
.mobile-compact-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 9px 0;
  background: transparent;
  border-bottom: 1px solid #edf0f2;
  text-align: left;
}

.mobile-todo-list button:last-child,
.mobile-compact-list button:last-child {
  border-bottom: 0;
}

.mobile-todo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 6px;
  background: #edf4f5;
  color: #176b87;
  font-size: 16px;
}

.mobile-todo-label {
  min-width: 0;
  flex: 1;
  font-size: 13px;
}

.mobile-todo-list button > strong {
  font-size: 17px;
}

.mobile-compact-list button {
  justify-content: space-between;
}

.mobile-compact-list button > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.mobile-compact-list small {
  overflow: hidden;
  color: #707985;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-compact-end {
  justify-items: end;
  flex: 0 0 auto;
}

.mobile-compact-end .ant-tag {
  margin: 0;
}

.mobile-empty-inline {
  padding: 24px 0;
  color: #7a838e;
  text-align: center;
}

.mobile-document-tabs {
  margin-bottom: 10px;
}

.mobile-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-bottom: 9px;
}

.mobile-scan-input {
  display: none;
}

.mobile-scan-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.mobile-document-list,
.mobile-inventory-list,
.mobile-todo-cards {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.mobile-document-row {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 13px;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.mobile-document-row-head,
.mobile-document-row-foot,
.mobile-document-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mobile-document-row-head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-document-row-head .ant-tag,
.mobile-status-group .ant-tag {
  margin: 0;
}

.mobile-document-party {
  overflow: hidden;
  color: #424b56;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-document-meta {
  justify-content: flex-start;
  color: #7a838e;
  font-size: 11px;
}

.mobile-document-meta span + span::before {
  content: "·";
  margin-right: 7px;
}

.mobile-document-row-foot {
  padding-top: 7px;
  border-top: 1px solid #edf0f2;
}

.mobile-document-row-foot > strong {
  flex: 0 0 auto;
  font-size: 17px;
}

.mobile-status-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.mobile-list-skeleton {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.mobile-list-skeleton .ant-skeleton,
.mobile-skeleton-block .ant-skeleton {
  padding: 10px;
  background: #fff;
  border-radius: 8px;
}

.mobile-list-end {
  display: block;
  padding: 10px;
  text-align: center;
}

.mobile-empty {
  padding: 54px 0;
}

.mobile-load-error {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #e5b9b9;
  border-radius: 8px;
  background: #fff7f7;
  color: #9d3232;
  font-size: 12px;
}

.mobile-load-error > span:nth-child(2) {
  overflow-wrap: anywhere;
}

.mobile-load-error.is-compact {
  margin-block: 8px;
  padding-block: 9px;
}

.mobile-empty-state {
  padding: 34px 12px;
  border: 1px dashed #dfe3e8;
  border-radius: 8px;
  background: #fff;
}

.mobile-pending-operation-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.mobile-pending-operation-title .ant-tag {
  margin-inline-end: 0;
}

.mobile-detail-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.mobile-detail-summary > span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.mobile-detail-summary > span strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.mobile-detail-amount {
  justify-items: end;
}

.mobile-detail-amount strong {
  color: #9b5315;
  font-size: 21px !important;
}

.mobile-detail-summary > .mobile-status-group {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid #edf0f2;
}

.mobile-detail-section .ant-descriptions-item-label {
  width: 82px;
  color: #707985;
}

.mobile-item-row {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 9px 0;
  border-bottom: 1px solid #edf0f2;
}

.mobile-item-row:last-child {
  border-bottom: 0;
}

.mobile-item-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  border-radius: 4px;
  background: #edf4f5;
  color: #176b87;
  font-size: 11px;
}

.mobile-item-main,
.mobile-item-values {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.mobile-item-main strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-item-main small,
.mobile-item-values small {
  color: #78818c;
  font-size: 10px;
}

.mobile-item-values {
  justify-items: end;
  text-align: right;
}

.mobile-item-values strong {
  font-size: 12px;
}

.mobile-money-lines span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
}

.mobile-money-lines small {
  color: #707985;
}

.mobile-money-lines .is-total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #dfe3e8;
}

.mobile-money-lines .is-total strong {
  color: #9b5315;
  font-size: 18px;
}

.mobile-fixed-actions {
  position: sticky;
  z-index: 35;
  bottom: var(--mobile-action-bottom, var(--mobile-bottom-nav-height));
  display: flex;
  gap: 8px;
  margin: 14px -4px -8px;
  padding: 9px;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

.mobile-todo-cards button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.mobile-todo-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid currentColor;
  border-radius: 7px;
  background: #fff;
  font-size: 19px;
}

.mobile-todo-card-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.mobile-todo-card-copy strong {
  font-size: 14px;
}

.mobile-todo-card-copy small {
  overflow: hidden;
  color: #77808b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-todo-count {
  font-size: 22px;
  font-weight: 800;
}

.mobile-inventory-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.mobile-filter-stack {
  display: grid;
  gap: 8px;
}

.mobile-inventory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 78px;
  padding: 13px;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: #fff;
}

.mobile-inventory-product,
.mobile-inventory-stock {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.mobile-inventory-product strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-inventory-product small {
  color: #747e89;
  font-size: 11px;
}

.mobile-inventory-stock {
  justify-items: end;
  align-content: center;
}

.mobile-inventory-stock > strong {
  color: #176b87;
  font-size: 25px;
  line-height: 1;
}

.mobile-inventory-stock > small {
  color: #747e89;
}

.mobile-inventory-stock .ant-tag {
  margin: 2px 0 0;
}

.mobile-form-page .ant-form-item {
  margin-bottom: 15px;
}

.mobile-form-page .ant-select-selector,
.mobile-form-page .ant-input,
.mobile-form-page .ant-input-number,
.mobile-filter-stack .ant-select-selector,
.mobile-search-row .ant-input-affix-wrapper {
  min-height: 42px;
}

.mobile-form-page .ant-select-selection-item,
.mobile-form-page .ant-select-selection-placeholder,
.mobile-filter-stack .ant-select-selection-item,
.mobile-filter-stack .ant-select-selection-placeholder {
  line-height: 40px !important;
}

.mobile-form-page .ant-input-number-input {
  height: 40px;
}

.mobile-stock-preview {
  display: grid;
  gap: 9px;
  margin: -3px 0 15px;
  padding: 11px;
  border: 1px solid #dfe7e9;
  border-radius: 7px;
  background: #f5f9f9;
}

.mobile-stock-preview-heading {
  font-size: 12px;
}

.mobile-stock-preview-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.mobile-stock-preview-values span {
  display: grid;
  gap: 3px;
}

.mobile-stock-preview-values small {
  color: #6f7984;
  font-size: 11px;
}

.mobile-stock-preview-values strong {
  font-size: 19px;
}

.mobile-stock-preview-values strong.is-increase {
  color: #276454;
}

.mobile-stock-preview-values strong.is-decrease {
  color: #98353e;
}

.mobile-stock-preview .ant-alert {
  padding: 7px 9px;
}

.mobile-form-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.mobile-transfer-item {
  padding: 11px;
  border: 1px solid #e1e5e9;
  border-radius: 7px;
  background: #f9fafb;
}

.mobile-transfer-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  margin-bottom: 6px;
}

.mobile-transfer-item .ant-form-item:last-child {
  margin-bottom: 0;
}

.mobile-profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-profile-identity .ant-avatar {
  background: #dfe9e6;
  color: #245c52;
}

.mobile-profile-identity > span {
  display: grid;
  gap: 3px;
}

.mobile-profile-identity .ant-typography {
  margin: 0;
}

.mobile-profile-section {
  padding-block: 4px;
}

.mobile-profile-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px solid #edf0f2;
}

.mobile-profile-line:last-child {
  border-bottom: 0;
}

.mobile-profile-line > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.mobile-role-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.mobile-role-tags .ant-tag {
  margin: 0;
}

.mobile-profile-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.mobile-login-screen {
  display: grid;
  align-content: center;
  min-height: 100vh;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  background: #eef2f3;
}

.mobile-login-brand,
.mobile-login-panel {
  width: min(100%, 440px);
  margin-inline: auto;
}

.mobile-login-brand {
  display: grid;
  justify-items: center;
  margin-bottom: 28px;
  text-align: center;
}

.mobile-login-logo {
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  font-size: 17px;
}

.mobile-login-brand .ant-typography {
  margin: 0;
}

.mobile-login-brand h1.ant-typography {
  font-size: 28px;
}

.mobile-login-panel {
  padding: 20px;
  border: 1px solid #dde2e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.mobile-login-heading {
  display: grid;
  gap: 3px;
  margin-bottom: 18px;
}

.mobile-login-heading .ant-typography {
  margin: 0;
}

.mobile-login-panel .ant-alert {
  margin-bottom: 14px;
}

.mobile-login-panel .ant-form-item {
  margin-bottom: 16px;
}

@media (min-width: 681px) {
  .mobile-bottom-nav {
    left: 50%;
    right: auto;
    width: 680px;
    transform: translateX(-50%);
  }
}

@media (max-width: 380px) {
  .mobile-page {
    padding-inline: 10px;
  }

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

  .mobile-form-two-column {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .mobile-document-row-foot {
    align-items: flex-end;
  }

  .mobile-document-row-foot > strong {
    font-size: 15px;
  }
}

.route-loading {
  display: grid;
  min-height: 240px;
  place-items: center;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
}

.page-card {
  background: rgba(250, 253, 255, 0.9);
  border: 1px solid rgba(20, 33, 61, 0.08);
  box-shadow: 0 18px 45px rgba(20, 33, 61, 0.08);
  backdrop-filter: blur(12px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat-panel {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(239, 246, 255, 0.82));
  border: 1px solid rgba(20, 33, 61, 0.08);
}

.stat-panel h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #57534e;
  font-weight: 600;
}

.stat-panel strong {
  display: block;
  font-size: 30px;
  color: #0f172a;
}

.json-block {
  margin: 0;
  padding: 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  overflow: auto;
  max-height: 65vh;
}

.mall-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, rgba(22, 119, 255, 0.2), transparent 24%),
    radial-gradient(circle at 90% 0%, rgba(59, 130, 246, 0.16), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, #eaf2ff 100%);
}

.mall-shell .mall-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: auto;
  line-height: normal;
  padding: 0;
  background: rgba(247, 251, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(20, 33, 61, 0.08);
}

.mall-shell .mall-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding: 16px 32px;
}

.mall-shell .mall-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  flex: 0 0 auto;
}

.mall-shell .mall-brand:focus-visible,
.mall-shell .mall-header button:focus-visible {
  outline: 2px solid #1677ff;
  outline-offset: 3px;
}

.mall-shell .mall-brand strong {
  font-size: 22px;
}

.mall-shell .mall-brand span {
  font-size: 12px;
  color: #475569;
}

.mall-page-title-row,
.mall-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.mall-shell .mall-nav {
  flex: 1;
  min-width: 220px;
  background: transparent;
  border-bottom: none;
}

.mall-shell .mall-cart-nav-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.mall-shell .mall-desktop-account {
  flex: 0 1 auto;
  min-width: 0;
}

.mall-shell .mall-account-trigger {
  display: inline-flex;
  align-items: center;
  max-width: 210px;
}

.mall-shell .mall-account-trigger-active,
.mall-shell .mall-mobile-action-active {
  color: #1677ff;
  border-color: #1677ff;
  background: #e6f4ff;
}

.mall-shell .mall-account-name {
  display: block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mall-account-dropdown .mall-account-menu-label {
  display: flex;
  flex-direction: column;
  max-width: 260px;
  overflow: hidden;
}

.mall-account-dropdown .mall-account-menu-label strong,
.mall-account-dropdown .mall-account-menu-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mall-account-dropdown .mall-account-menu-label span {
  color: #64748b;
  font-size: 12px;
}

.mall-shell .mall-mobile-actions {
  display: none;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.mall-mobile-drawer .mall-mobile-account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0 8px 14px;
  padding: 12px;
  border-radius: 8px;
  background: #f6f8fb;
}

.mall-mobile-drawer .mall-mobile-account > .anticon {
  flex: 0 0 auto;
  margin-top: 2px;
}

.mall-mobile-drawer .mall-mobile-account > span {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.mall-mobile-drawer .mall-mobile-account strong,
.mall-mobile-drawer .mall-mobile-account small {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mall-mobile-drawer .mall-mobile-account strong {
  color: #0f172a;
  line-height: 1.45;
}

.mall-mobile-drawer .mall-mobile-account small {
  margin-top: 3px;
  color: #64748b;
  line-height: 1.4;
}

.mall-shell .mall-page {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding: 28px 32px 36px;
}

.mall-hero {
  margin-bottom: 24px;
  padding: 36px 32px;
  border-radius: 28px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  background:
    radial-gradient(circle at right top, rgba(30, 64, 175, 0.2), transparent 24%),
    linear-gradient(135deg, rgba(22, 119, 255, 0.16), rgba(255, 255, 255, 0.84));
  border: 1px solid rgba(20, 33, 61, 0.08);
}

.mall-hero-copy {
  max-width: 720px;
}

.mall-hero-copy h1 {
  margin-bottom: 12px;
}

.mall-eyebrow {
  letter-spacing: 0.18em;
  color: #1677ff;
  font-weight: 700;
}

.mall-hero-actions {
  display: flex;
  justify-content: flex-end;
  width: min(420px, 42%);
  min-width: 260px;
}

.mall-home-carousel {
  width: 100%;
}

.mall-home-banner {
  position: relative;
  display: block;
  width: 100%;
  height: 220px;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: #0f172a;
  cursor: pointer;
  text-align: left;
}

.mall-shell .mall-home-banner:focus-visible {
  outline: 3px solid #1677ff;
  outline-offset: 3px;
}

.mall-shell .mall-home-banner-static {
  cursor: default;
}

.mall-home-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
}

.mall-shell .mall-home-banner-image-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #cbd5e1;
  font-size: 14px;
  letter-spacing: 0.16em;
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
}

.mall-home-banner span {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(15, 23, 42, 0.5);
  overflow-wrap: anywhere;
}

.mall-shell .mall-home-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.mall-shell .mall-home-page .mall-section,
.mall-shell .mall-home-page .mall-hero {
  margin: 0;
}

.mall-shell .mall-home-hero {
  padding-block: 28px;
}

.mall-shell .mall-home-hero .mall-hero-copy {
  width: min(100%, 760px);
}

.mall-shell .mall-home-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 560px);
}

.mall-shell .mall-home-search .ant-input-affix-wrapper {
  flex: 1 1 320px;
  min-width: 0;
}

.mall-shell .mall-home-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.mall-shell .mall-home-section-head h3 {
  margin: 0 0 4px;
}

.mall-shell .mall-home-category-card {
  height: 100%;
}

.mall-shell .mall-home-category-card .ant-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 126px;
}

.mall-shell .mall-home-category-card h5 {
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.mall-shell .mall-home-category-card .ant-btn {
  margin-top: auto;
  padding-inline: 0;
}

.mall-shell .mall-home-product-card .ant-card-body {
  min-height: 248px;
}

.mall-shell .mall-home-product-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  height: 100%;
  min-width: 0;
}

.mall-shell .mall-home-product-name {
  height: auto;
  max-width: 100%;
  padding: 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.mall-shell .mall-home-product-code {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.mall-shell .mall-home-product-price > .ant-typography:first-child {
  color: #cf1322;
  font-size: 22px;
}

.mall-shell .mall-home-product-actions {
  margin-top: auto;
}

.mall-shell .mall-home-operations h3 {
  margin: 0;
}

.mall-shell .mall-home-notices {
  height: 100%;
}

.mall-shell .mall-home-notice-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.mall-shell .mall-home-notice + .mall-home-notice {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(20, 33, 61, 0.08);
}

.mall-shell .mall-home-notice .ant-typography {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.mall-shell .mall-home-notice p {
  margin: 4px 0 0;
}

.mall-login-page {
  min-height: 100vh;
  padding: 28px clamp(20px, 5vw, 72px);
  background:
    radial-gradient(circle at 8% 12%, rgba(22, 119, 255, 0.2), transparent 26%),
    linear-gradient(135deg, #f8fbff 0%, #eaf2ff 100%);
}

.mall-login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
}

.mall-login-brand .anticon {
  color: #1677ff;
  font-size: 24px;
}

.mall-login-hero {
  min-height: calc(100vh - 92px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: clamp(28px, 6vw, 88px);
  align-items: center;
}

.mall-login-copy {
  max-width: 680px;
}

.mall-login-copy h1 {
  margin: 14px 0 16px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.mall-login-copy .ant-typography {
  font-size: 17px;
  color: #475569;
}

.mall-welcome-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
  max-width: 780px;
}

.mall-welcome-grid > div {
  min-height: 150px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mall-welcome-grid .anticon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 119, 255, 0.12);
  color: #1677ff;
  font-size: 20px;
}

.mall-welcome-grid strong {
  font-size: 16px;
  color: #0f172a;
}

.mall-welcome-grid span {
  color: #64748b;
  line-height: 1.7;
}

.mall-login-card {
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.14);
}

.mall-admin-shell {
  min-height: 100vh;
  background: #f6f8fb;
}

.mall-admin-sider {
  background:
    linear-gradient(180deg, #111827 0%, #0f172a 58%, #111827 100%) !important;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 10px 0 30px rgba(15, 23, 42, 0.12);
}

.mall-admin-brand {
  padding: 28px 18px 22px;
  color: #f8fafc;
}

.mall-admin-brand strong {
  display: block;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0;
}

.mall-admin-brand span {
  display: block;
  margin-top: 8px;
  color: #94a3b8;
  font-size: 13px;
}

.mall-admin-menu {
  background: transparent;
  color: #cbd5e1;
  border-inline-end: 0 !important;
  padding: 0 10px;
}

.mall-admin-menu .ant-menu-item {
  height: 42px;
  line-height: 42px;
  margin: 4px 0;
  width: 100%;
  border-radius: 8px;
  color: #cbd5e1;
}

.mall-admin-menu .ant-menu-item .anticon {
  color: #94a3b8;
  font-size: 16px;
}

.mall-admin-menu .ant-menu-item:hover {
  background: rgba(148, 163, 184, 0.12) !important;
  color: #ffffff !important;
}

.mall-admin-menu .ant-menu-item:hover .anticon {
  color: #bbf7d0;
}

.mall-admin-menu .ant-menu-item-selected {
  background: linear-gradient(135deg, #16a34a, #22c55e) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px rgba(22, 163, 74, 0.24);
}

.mall-admin-menu .ant-menu-item-selected .anticon {
  color: #ffffff;
}

.mall-admin-erp-link {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  width: calc(100% - 36px);
  height: 40px;
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.42);
  color: #e2e8f0;
}

.mall-admin-erp-link:hover {
  border-color: rgba(34, 197, 94, 0.72) !important;
  background: rgba(22, 163, 74, 0.14) !important;
  color: #ffffff !important;
}

.mall-admin-header {
  height: auto;
  min-height: 82px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.mall-admin-content {
  padding: 24px;
}

.mall-admin-entry-card {
  height: 100%;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.mall-admin-entry-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #dcfce7;
  color: #15803d;
  font-size: 22px;
}

.mall-admin-dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.mall-admin-metric-card {
  height: 100%;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.mall-admin-metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
  line-height: 1;
  color: #111827;
}

.mall-admin-todo-row {
  width: 100%;
  min-height: 34px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 6px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 0 10px;
  cursor: pointer;
  text-align: left;
}

.mall-admin-todo-row:hover {
  border-color: #1677ff;
  background: #f8fbff;
}

.mall-admin-todo-row span,
.mall-ranking-row strong,
.mall-ranking-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mall-trend-grid {
  min-height: 280px;
  display: grid;
  gap: 12px;
  align-items: stretch;
}

.mall-trend-item {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto auto auto;
  gap: 6px;
  text-align: center;
}

.mall-trend-bars {
  min-height: 160px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  align-items: end;
  padding: 8px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 6px;
}

.mall-trend-bars i {
  display: block;
  border-radius: 4px 4px 0 0;
}

.mall-trend-bars .sales,
.mall-chart-legend .sales {
  background: #1677ff;
}

.mall-trend-bars .refund,
.mall-chart-legend .refund {
  background: #f97316;
}

.mall-trend-bars .count,
.mall-chart-legend .count {
  background: #16a34a;
}

.mall-trend-item span {
  color: #6b7280;
}

.mall-trend-item strong {
  font-size: 13px;
}

.mall-trend-item em {
  font-size: 12px;
  color: #6b7280;
  font-style: normal;
}

.mall-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: #6b7280;
}

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

.mall-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.mall-ranking-row {
  display: grid;
  grid-template-columns: 26px minmax(140px, 1fr) minmax(120px, 1.2fr) auto;
  align-items: center;
  gap: 10px;
}

.mall-ranking-row > span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eef2ff;
  color: #1d4ed8;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.mall-ranking-row div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mall-ranking-row em {
  color: #6b7280;
  font-size: 12px;
  font-style: normal;
}

.mall-ranking-row > i {
  height: 8px;
  background: #edf2f7;
  border-radius: 999px;
  overflow: hidden;
}

.mall-ranking-row > i b {
  display: block;
  height: 100%;
  background: #16a34a;
}

.mall-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mall-product-card {
  height: 100%;
  border: 1px solid rgba(20, 33, 61, 0.08);
  box-shadow: 0 14px 40px rgba(20, 33, 61, 0.08);
  background: rgba(255, 255, 255, 0.88);
}

.mall-product-card .ant-card-body {
  min-height: 260px;
}

.mall-product-buy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: end;
  gap: 12px;
}

.mall-product-cover,
.mall-product-fallback {
  height: 220px;
  width: 100%;
  object-fit: cover;
}

.mall-category-card {
  height: 100%;
}

.mall-detail-cover img,
.mall-detail-cover {
  border-radius: 18px;
}

.mall-detail-gallery .ant-card-body {
  padding: 14px;
}

.mall-detail-thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.mall-detail-thumb img,
.mall-detail-thumb {
  border-radius: 10px;
  object-fit: cover;
}

.mall-detail-price-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(2, minmax(150px, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(20, 33, 61, 0.08);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.92), rgba(255, 255, 255, 0.9));
}

.mall-related-card {
  height: 100%;
  border: 1px solid rgba(20, 33, 61, 0.08);
}

.mall-related-cover {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.mall-product-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #1677ff, #1d4ed8);
}

.mall-shell .mall-product-list-page,
.mall-shell .mall-product-detail-page {
  overflow-wrap: anywhere;
}

.mall-shell .mall-product-list-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(140px, 170px) auto auto;
  gap: 10px;
  width: min(100%, 900px);
}

.mall-shell .mall-product-list-toolbar > .ant-input-affix-wrapper,
.mall-shell .mall-product-list-toolbar > .ant-select {
  min-width: 0;
  width: 100%;
}

.mall-shell .mall-product-filter-card .mall-list-head h4 {
  margin: 0 0 4px;
}

.mall-shell .mall-product-category-scroll {
  max-width: 100%;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.mall-shell .mall-product-category-scroll .ant-segmented {
  min-width: max-content;
}

.mall-shell .mall-product-list-card {
  overflow: hidden;
}

.mall-shell .mall-product-list-card .ant-card-body {
  min-height: 390px;
}

.mall-shell .mall-product-list-card-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  height: 100%;
}

.mall-shell .mall-product-list-code,
.mall-shell .mall-product-detail-code {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.mall-shell .mall-product-list-name,
.mall-shell .mall-related-name {
  height: auto;
  max-width: 100%;
  padding: 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.mall-shell .mall-product-list-name {
  min-height: 48px;
}

.mall-shell .mall-product-list-selling-point {
  min-height: 44px;
  margin: 0;
}

.mall-shell .mall-product-list-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
}

.mall-shell .mall-product-list-tags .ant-tag {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mall-shell .mall-product-list-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mall-shell .mall-product-list-meta span,
.mall-shell .mall-detail-price-panel > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mall-shell .mall-product-list-meta strong {
  margin-top: 2px;
}

.mall-shell .mall-product-list-price {
  display: flex;
  flex-direction: column;
  margin-top: auto;
}

.mall-shell .mall-product-list-price strong,
.mall-shell .mall-detail-price-panel strong {
  color: #cf1322;
  font-size: 24px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mall-shell .mall-product-list-price small,
.mall-shell .mall-detail-price-panel small {
  color: #64748b;
  font-size: 13px;
  font-weight: 400;
}

.mall-shell .mall-product-list-card .mall-product-buy-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.mall-shell .mall-product-list-card .ant-input-number {
  width: 100%;
}

.mall-shell .mall-product-pagination {
  display: flex;
  justify-content: flex-end;
  padding: 16px 0 4px;
  overflow-x: auto;
}

.mall-shell .mall-product-return {
  align-self: flex-start;
}

.mall-shell .mall-product-detail-summary h2 {
  margin: 8px 0 10px;
  overflow-wrap: anywhere;
}

.mall-shell .mall-product-detail-summary .mall-detail-price-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0;
}

.mall-shell .mall-product-detail-purchase,
.mall-shell .mall-product-detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.mall-shell .mall-product-detail-purchase label {
  font-weight: 600;
}

.mall-shell .mall-product-fact-card {
  height: 100%;
}

.mall-shell .mall-product-detail-specs .ant-descriptions-item-label,
.mall-shell .mall-product-detail-specs .ant-descriptions-item-content {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mall-shell .mall-detail-gallery .mall-product-fallback {
  min-height: 360px;
}

.mall-shell .mall-detail-cover,
.mall-shell .mall-detail-cover img {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: contain;
}

.mall-shell .mall-detail-thumb-fallback {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 8px;
  padding: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

.mall-shell .mall-related-card .ant-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.mall-shell .mall-related-card .mall-product-fallback {
  height: 150px;
  font-size: 28px;
}

.mall-cart-summary {
  position: sticky;
  top: 104px;
}

.mall-shell .mall-cart-page h3,
.mall-shell .mall-cart-page h4,
.mall-shell .mall-checkout-page h3,
.mall-shell .mall-addresses-page h3,
.mall-shell .mall-orders-page h3 {
  margin: 0;
}

.mall-shell .mall-cart-list,
.mall-shell .mall-order-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mall-shell .mall-cart-item,
.mall-shell .mall-order-list-item {
  align-items: stretch;
  border: 1px solid rgba(20, 33, 61, 0.08);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.mall-shell .mall-cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
  gap: 20px;
}

.mall-shell .mall-cart-product {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.mall-shell .mall-cart-product .ant-image,
.mall-shell .mall-cart-product img,
.mall-shell .mall-cart-image-fallback {
  width: 108px;
  height: 108px;
  border-radius: 8px;
  object-fit: cover;
}

.mall-shell .mall-cart-image-fallback {
  display: grid;
  place-items: center;
  background: #e8eef7;
  color: #475569;
}

.mall-shell .mall-cart-product-copy,
.mall-shell .mall-cart-editor {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mall-shell .mall-cart-editor .ant-input-number {
  width: min(100%, 180px);
}

.mall-shell .mall-checkout-result {
  width: min(100%, 720px);
  margin-inline: auto;
  text-align: center;
}

.mall-shell .mall-checkout-result .ant-alert,
.mall-shell .mall-checkout-result .ant-descriptions,
.mall-shell .mall-checkout-result .ant-space {
  margin-top: 18px;
  text-align: left;
}

.mall-shell .mall-checkout-result-icon {
  color: #16a34a;
  font-size: 54px;
}

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

.mall-shell .mall-address-card .ant-card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}

.mall-shell .mall-address-card-head,
.mall-shell .mall-address-card-head > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.mall-shell .mall-address-full {
  flex: 1;
  margin: 0;
  overflow-wrap: anywhere;
}

.mall-shell .mall-order-filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(180px, 220px) auto;
  gap: 10px;
}

.mall-shell .mall-order-filter-bar .ant-select {
  width: 100%;
}

.mall-shell .mall-order-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.mall-shell .mall-order-card-head,
.mall-shell .mall-order-card-head > div,
.mall-shell .mall-order-overview-head,
.mall-shell .mall-order-overview-head > div {
  display: flex;
  justify-content: space-between;
  gap: 8px 18px;
}

.mall-shell .mall-order-card-head > div,
.mall-shell .mall-order-overview-head > div {
  flex-direction: column;
}

.mall-shell .mall-order-amount,
.mall-shell .mall-order-overview-head h2 {
  color: #cf1322;
}

.mall-shell .mall-order-pagination,
.mall-shell .mall-order-detail-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  overflow-x: auto;
}

.mall-shell .mall-order-overview h2 {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.mall-shell .mall-order-table-card .ant-table-cell,
.mall-shell .mall-order-detail-page .ant-descriptions-item-content {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 960px) {

  .mall-shell .mall-cart-item {
    grid-template-columns: 1fr;
  }

  .mall-shell .mall-address-grid {
    grid-template-columns: 1fr;
  }

  .mall-shell .mall-product-list-toolbar {
    grid-template-columns: minmax(0, 1fr) auto minmax(140px, 180px);
  }

  .mall-shell .mall-product-list-toolbar > :nth-child(4),
  .mall-shell .mall-product-list-toolbar > :nth-child(5) {
    justify-self: start;
  }

  .mall-hero,
  .mall-shell .mall-page {
    padding-left: 18px;
    padding-right: 18px;
  }

  .mall-shell .mall-header-bar {
    gap: 12px;
    padding: 12px 18px;
  }

  .mall-shell .mall-desktop-nav,
  .mall-shell .mall-desktop-account {
    display: none;
  }

  .mall-shell .mall-mobile-actions {
    display: flex;
  }

  .mall-hero {
    flex-direction: column;
  }

  .mall-hero-actions {
    width: 100%;
    min-width: 0;
  }

  .mall-login-hero {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 36px;
  }

  .mall-login-card {
    max-width: 520px;
    width: 100%;
  }

  .mall-welcome-grid {
    grid-template-columns: 1fr;
  }

  .mall-detail-price-panel {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 576px) {

  .mall-shell .mall-cart-product {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .mall-shell .mall-cart-product .ant-image,
  .mall-shell .mall-cart-product img,
  .mall-shell .mall-cart-image-fallback {
    width: 72px;
    height: 72px;
  }

  .mall-shell .mall-order-filter-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mall-shell .mall-order-filter-bar .ant-select,
  .mall-shell .mall-order-filter-bar > :last-child {
    grid-column: 1 / -1;
  }

  .mall-shell .mall-order-card-head,
  .mall-shell .mall-order-overview-head,
  .mall-shell .mall-order-detail-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .mall-shell .mall-product-list-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mall-shell .mall-product-list-toolbar > .ant-select,
  .mall-shell .mall-product-list-toolbar > :nth-child(4),
  .mall-shell .mall-product-list-toolbar > :nth-child(5) {
    grid-column: 1 / -1;
    width: 100%;
  }

  .mall-shell .mall-product-list-toolbar > :nth-child(4),
  .mall-shell .mall-product-list-toolbar > :nth-child(5) {
    justify-self: stretch;
  }

  .mall-shell .mall-product-detail-summary .mall-detail-price-panel,
  .mall-shell .mall-product-list-meta {
    grid-template-columns: 1fr;
  }

  .mall-shell .mall-product-detail-actions > .ant-btn {
    flex: 1 1 100%;
  }
  .mall-shell .mall-page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .mall-shell .mall-header-bar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .mall-shell .mall-brand strong {
    font-size: 18px;
  }

  .mall-shell .mall-brand span {
    display: none;
  }

  .mall-shell .mall-account-name {
    max-width: 112px;
  }

  .mall-shell .mall-home-page {
    gap: 22px;
  }

  .mall-shell .mall-home-hero {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .mall-shell .mall-home-search {
    align-items: stretch;
    flex-direction: column;
  }

  .mall-shell .mall-home-search .ant-input-affix-wrapper {
    flex-basis: auto;
    width: 100%;
  }

  .mall-shell .mall-home-search .ant-btn {
    width: 100%;
  }

  .mall-shell .mall-home-section-head {
    align-items: flex-start;
  }
}
/* Native permission checks also hide body portals outside the retained router. */
html[data-native-access-blocked] body > :not(#root) { visibility: hidden !important; pointer-events: none !important; }
:root {
  /* 主品牌色同时承担“主操作填充（白字）”和“可交互文字/图标”两个角色，因此必须同时满足
     白字在填充上、以及它在各级浅色背景上的 4.5:1。antd 默认 blue-6 (#1677ff) 只有 4.10:1，
     两个角色都达不到 WCAG AA；这里取同一色相的 blue-7，最低 5.71:1。 */
  --erp-color-primary: #0958d9;
  --erp-color-primary-soft: #f0f7ff;
  --erp-color-text: #344054;
  --erp-color-text-secondary: #5f6b7a;
  --erp-color-border: #e4e7ec;
  --erp-color-surface-muted: #f8fafc;
  --erp-color-success: #027a48;
  --erp-color-warning: #b54708;
  --erp-color-danger: #b42318;
  --erp-font-size-caption: 12px;
  --erp-font-size-body: 13px;
  --erp-font-size-section: 16px;
  --erp-font-size-page: 22px;
  --erp-space-1: 4px;
  --erp-space-2: 8px;
  --erp-space-3: 12px;
  --erp-space-4: 16px;
  --erp-space-6: 24px;
  --erp-page-max-width: 1680px;
  --erp-radius-control: 6px;
  --erp-application-bar-height: 52px;
  --erp-navigation-wide: 184px;
  --erp-navigation-compact: 56px;
  --erp-color-workspace: #f6f8fb;
  --erp-color-surface: #ffffff;
  --erp-color-divider: #e5e9ef;
  /* 焦点环属于 WCAG 1.4.11 的非文本对比，需要 3:1；与主品牌色保持一致以便统一 focus-visible 表现。 */
  --erp-color-focus: #0958d9;
  --erp-shadow-floating: 0 12px 28px rgba(16, 24, 40, 0.12);
}

/* 所有可聚焦控件的焦点表现只有这一条规则。
   antd 会给不少组件注入自己的浅蓝 3px 焦点环（`outline: 3px solid #85c0ff`，白底 1.91:1，
   低于 WCAG 1.4.11 / 2.4.11 要求的 3:1）。这些选择器形如 `.ant-btn:not(:disabled):focus-visible`
   或 `.ant-modal .ant-modal-close:focus-visible`，具体度最高到 (0,3,0)，而 `:where(...)` 的具体度是 0，
   所以 ERP 里大量按钮实际显示的是那一版。这里用 `:is(...)` 让规则自带具体度（`:root` + `:is(...)`
   最高到 (0,4,0) + `:focus-visible`），一次压过 antd 的各类组件局部写法，并且不依赖样式表先后顺序；
   也避免逐个枚举 antd 组件，将来新增组件同样被覆盖。
   轮廓值走变量，需要另一种焦点表现的控件只要在自身上设 `--erp-focus-outline: none` 即可豁免，
   不必反过来跟这条规则比拼具体度（目前只有 `.module-preview-resizer` 这么做）。 */
:root :is(a, button, input, select, textarea, [tabindex]:not([tabindex='-1'])):focus-visible {
  outline: var(--erp-focus-outline, 2px solid var(--erp-color-focus));
  outline-offset: 2px;
}

/* Transient feedback sits below the persistent application bar and above drawers/modals. */
.ant-message {
  z-index: 1100;
  pointer-events: none;
}

.ant-message-notice {
  padding-bottom: var(--erp-space-2);
}

.ant-message-notice-content {
  border: 1px solid var(--erp-color-divider);
  border-radius: var(--erp-radius-control);
  box-shadow: var(--erp-shadow-floating);
  color: var(--erp-color-text);
}
/* Keep the dashboard focused on work that needs attention first. */
.dashboard-page > .ant-spin-nested-loading > .ant-spin-container {
  display: flex;
  flex-direction: column;
}

.dashboard-page .dash-todo-card { order: 1; }
.dashboard-page .dash-task-commands { order: 2; }
.dashboard-page .dash-metric-grid { order: 3; }
.dashboard-page .dash-chart-card { order: 4; }

.dashboard-page .dash-todo-card,
.dashboard-page .dash-task-commands,
.dashboard-page .dash-metric-grid,
.dashboard-page .dash-chart-card {
  margin-bottom: 14px;
}

.dashboard-page .dash-chart-card {
  margin-bottom: 0;
}

/* Dashboard-specific workflow affordances. */
.dash-continue-card {
  margin-bottom: 14px;
}

.dash-continue-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-continue-head-icon {
  color: var(--erp-color-primary);
  font-size: 20px;
}

.dash-continue-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.dash-continue-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  text-align: left;
  color: var(--erp-color-text);
  background: var(--erp-color-surface-muted);
  border: 1px solid var(--erp-color-border);
  border-radius: var(--erp-radius-control);
  cursor: pointer;
}

.dash-continue-list button:hover {
  border-color: #91caff;
  background: var(--erp-color-primary-soft);
}

.dash-continue-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

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

.dash-continue-copy small {
  color: var(--erp-color-text-secondary);
  font-size: 12px;
}

.dash-continue-action {
  flex: 0 0 auto;
  color: var(--erp-color-primary);
  font-size: 12px;
}

@media (max-width: 720px) {
  .dash-continue-list {
    grid-template-columns: 1fr;
  }
}

/* Todo board, moved out of the global stylesheet. */
.dash-todo-card {
  margin-top: 14px;
}

.dash-todo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

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

.dash-todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid #eaecf0;
  border-radius: 6px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dash-todo-item:hover {
  border-color: #b2ddff;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
}

.dash-todo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
}

.dash-todo-icon.orange { color: #b54708; background: #ffead5; }
.dash-todo-icon.blue { color: #175cd3; background: #d1e9ff; }
.dash-todo-icon.red { color: #b42318; background: #fee4e2; }
.dash-todo-icon.green { color: #027a48; background: #d1fadf; }

.dash-todo-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dash-todo-copy strong {
  color: #101828;
  font-size: 20px;
  line-height: 1.1;
}

.dash-todo-copy span {
  overflow: hidden;
  color: #5f6b7a;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-todo-copy small {
  overflow: hidden;
  color: #5f6b7a;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-work-queue-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--erp-color-divider);
}

.dash-work-queue-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--erp-color-divider);
}

.dash-work-queue-record {
  display: grid;
  grid-template-columns: 84px minmax(120px, 1fr) minmax(120px, 1fr) minmax(100px, 0.8fr) minmax(90px, 0.6fr) auto;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 3px 4px;
  color: var(--erp-color-text);
  background: transparent;
  border: 0;
  border-radius: var(--erp-radius-control);
  cursor: pointer;
  text-align: left;
}

.dash-work-queue-record:hover { background: var(--erp-color-surface-muted); }
.dash-work-queue-record:focus-visible { outline: 2px solid var(--erp-color-primary); outline-offset: 2px; }

.dash-work-queue-record strong,
.dash-work-queue-record small,
.dash-work-queue-record em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-work-queue-record small {
  color: var(--erp-color-text-secondary);
  font-size: 12px;
}

.dash-work-queue-record em {
  color: var(--erp-color-text);
  font-size: 13px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.dash-work-queue-type-group {
  display: inline-flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.dash-work-queue-type { color: var(--erp-color-text-secondary); font-size: 12px; font-weight: 600; }
.dash-work-queue-type.critical { color: var(--erp-color-error); }
.dash-work-queue-type.warning { color: var(--erp-color-warning); }
.dash-work-queue-severity { font-size: 11px; font-weight: 500; }
.dash-work-queue-severity.critical { color: var(--erp-color-error); }
.dash-work-queue-severity.warning { color: var(--erp-color-warning); }
.dash-work-queue-severity.normal { color: var(--erp-color-text-secondary); }
.dash-work-queue-more { margin-top: 6px; padding-inline: 0; }

@media (max-width: 960px) {
  .dash-work-queue-record { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .dash-work-queue-record small:nth-of-type(2) { display: none; }
}

@media (max-width: 960px) {
  .dash-todo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Compact desktop dashboard: work queues lead, while navigation and metrics stay quiet. */
.dashboard-page .dash-head-card,
.dashboard-page .dash-metric-card,
.dashboard-page .dash-chart-card,
.dashboard-page .dash-todo-card,
.dashboard-page .dash-continue-card,
.dashboard-page .dash-recent-card {
  border: 1px solid var(--erp-color-border);
  border-radius: var(--erp-radius-control);
  box-shadow: none;
}

.dashboard-page .dash-head-card .ant-card-body {
  padding: 12px 14px;
}

.dashboard-page .dash-head-row .ant-typography h3,
.dashboard-page .dash-head-row h3.ant-typography {
  font-size: var(--erp-font-size-page);
  line-height: 1.25;
}

.dashboard-page .dash-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--erp-space-2);
}

.dashboard-page .dash-metric-card .ant-card-body {
  padding: 12px 14px;
}

.dashboard-page .dash-metric-title {
  overflow: hidden;
  color: var(--erp-color-text-secondary);
  font-size: var(--erp-font-size-body);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-page .dash-metric-value {
  overflow: hidden;
  margin-top: 6px;
  color: #1d2939;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-page .dash-metric-sub {
  margin-top: 4px;
  color: var(--erp-color-text-secondary);
  font-size: var(--erp-font-size-caption);
}

.dashboard-page .dash-quick-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--erp-space-2);
  margin-top: 0;
}

.dashboard-page .dash-quick-card {
  min-height: 76px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 12px;
  color: var(--erp-color-text);
  background: #fff;
}

.dashboard-page .dash-quick-card:hover {
  color: var(--erp-color-primary);
  background: var(--erp-color-primary-soft);
  transform: none;
}

.dashboard-page .dash-quick-icon {
  color: var(--erp-color-primary);
  font-size: 20px;
}

.dashboard-page .dash-quick-label {
  overflow: hidden;
  font-size: var(--erp-font-size-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-task-commands {
  margin-bottom: 14px;
  padding: 0 2px;
}

.dash-task-command-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.dash-task-command-head .ant-typography { display: block; }

.dash-quick-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dashboard-page .dash-quick-card small {
  overflow: hidden;
  color: var(--erp-color-text-secondary);
  font-size: var(--erp-font-size-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-task-command-settings { display: grid; gap: 4px; }

.dash-task-command-setting {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--erp-color-divider);
}

.dash-task-command-setting .ant-checkbox-wrapper { min-width: 0; }
.dash-task-command-setting .ant-checkbox-wrapper span:last-child { display: grid; min-width: 0; gap: 2px; }
.dash-task-command-setting small { color: var(--erp-color-text-secondary); font-size: var(--erp-font-size-caption); }

.dashboard-page .dash-todo-card .ant-card-body,
.dashboard-page .dash-continue-card .ant-card-body,
.dashboard-page .dash-chart-card .ant-card-body {
  padding: 14px;
}

.dashboard-page .dash-todo-head {
  margin-bottom: 10px;
}

.dashboard-page .dash-todo-copy strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1200px) {
  .dashboard-page .dash-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-page .dash-quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .dash-todo-grid { grid-template-columns: 1fr; }
}

/* Metric cards, charts and rankings, moved out of the global stylesheet. */
.dash-head-card,
.dash-metric-card,
.dash-chart-card {
  background: #f7f8fa;
  border: 1px solid #e4e7ee;
  box-shadow: none;
}

.dash-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.dash-updated-at {
  white-space: nowrap;
  font-size: 12px;
}

.dash-recent-card {
  margin-bottom: 14px;
}

.dash-recent-card .ant-card-body {
  padding: 10px 14px;
}

.dash-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 720px) {
  .dash-recent-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

.dash-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 10px;
}

.dash-metric-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-metric-title {
  font-size: 32px;
  font-weight: 600;
  color: #43566d;
}

.dash-metric-value {
  font-size: 46px;
  font-weight: 500;
  line-height: 1.1;
  color: #43566d;
  margin-top: 12px;
}

.dash-metric-sub {
  margin-top: 8px;
  font-size: 18px;
  color: var(--erp-color-text-secondary);
}

.dash-quick-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
}

.dash-quick-card {
  border: 1px solid #e4e7ee;
  background: #f7f8fa;
  min-height: 126px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.dash-quick-card:hover {
  border-color: #91caff;
  transform: translateY(-1px);
}

.dash-quick-icon {
  font-size: 40px;
}

.dash-quick-label {
  font-size: 28px;
}

.dash-quick-card.c1,
.dash-quick-card.c2 {
  color: #1677ff;
}

.dash-quick-card.c3,
.dash-quick-card.c4 {
  color: #15803d;
}

.dash-quick-card.c5,
.dash-quick-card.c6 {
  color: #c2410c;
}

.dash-chart-card {
  margin-top: 10px;
}

.dash-chart-card-v2 {
  overflow: hidden;
}

.dash-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-chart-summary {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.dash-chart-summary > div {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-chart-summary span {
  color: #64748b;
  font-size: 13px;
}

.dash-chart-summary strong {
  color: #0f172a;
  font-size: 19px;
}

.dash-analytics-chart {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  min-height: 340px;
}

.dash-y-axis {
  height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 8px 0 44px;
  color: #64748b;
  font-size: 12px;
}

.dash-bar-chart-v2 {
  min-width: 0;
  min-height: 320px;
  display: grid;
  gap: 8px;
  align-items: end;
  overflow-x: auto;
  padding: 8px 2px 0;
  border-left: 1px solid #e5e7eb;
  background:
    linear-gradient(#eef2f7 1px, transparent 1px) 0 8px / 100% 70px,
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.dash-bar-item-v2 {
  min-width: 44px;
  display: grid;
  grid-template-rows: 280px 20px 18px;
  gap: 4px;
  text-align: center;
}

.dash-bar-track-v2 {
  height: 280px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.dash-bar-fill-v2,
.dash-stacked-bar-v2 {
  width: min(32px, 72%);
  border-radius: 5px 5px 0 0;
  overflow: hidden;
}

.dash-bar-fill-v2 {
  background: linear-gradient(180deg, #60a5fa 0%, #1677ff 100%);
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.2);
}

.dash-stacked-bar-v2 {
  display: flex;
  flex-direction: column-reverse;
}

.dash-bar-item-v2 span {
  color: #334155;
  font-size: 12px;
}

.dash-bar-item-v2 em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.dash-ranking-list-v2 {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-ranking-row-v2 {
  display: grid;
  grid-template-columns: 38px minmax(110px, 190px) minmax(180px, 1fr) 70px 130px;
  align-items: center;
  gap: 12px;
  min-height: 34px;
}

.dash-bar-chart {
  margin-top: 14px;
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;
  height: 420px;
  display: grid;
  grid-template-columns: repeat(15, minmax(50px, 1fr));
  gap: 10px;
}

.dash-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.dash-bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid #e5e7eb;
}

.dash-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #5bb7e3 0%, #3b9bcc 100%);
}

.dash-bar-date {
  margin-top: 8px;
  font-size: 13px;
  color: #4b5563;
}

.dash-bar-amount {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

.dash-chart-legend {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #4b5563;
  font-size: 13px;
}

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

.dash-legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.dash-stacked-bar {
  width: 100%;
  display: flex;
  flex-direction: column-reverse;
}

.dash-ranking-list {
  margin-top: 16px;
  border-top: 1px solid #e5e7eb;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-ranking-row {
  display: grid;
  grid-template-columns: 38px minmax(110px, 180px) minmax(160px, 1fr) 70px 120px;
  align-items: center;
  gap: 12px;
  min-height: 34px;
}

.dash-ranking-index {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: #e8f3ff;
  color: #1677ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.dash-ranking-name {
  font-weight: 600;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-ranking-track {
  height: 18px;
  background: #eef2f7;
  border: 1px solid #dde5ef;
  overflow: hidden;
}

.dash-ranking-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b9bcc 0%, #5bb7e3 100%);
}

.dash-ranking-orders,
.dash-ranking-amount {
  color: #4b5563;
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 960px) {
  .dash-metric-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .dash-quick-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .dash-bar-chart {
    overflow-x: auto;
  }

  .dash-chart-summary {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .dash-analytics-chart {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .dash-ranking-row-v2 {
    grid-template-columns: 34px minmax(90px, 140px) minmax(140px, 1fr);
  }

  .dash-ranking-row-v2 .dash-ranking-orders,
  .dash-ranking-row-v2 .dash-ranking-amount {
    display: none;
  }
}

/* These remain last: dashboard.css retains earlier legacy theme layers. */
.dashboard-page .dash-head-card,
.dashboard-page .dash-metric-card,
.dashboard-page .dash-chart-card,
.dashboard-page .dash-todo-card,
.dashboard-page .dash-continue-card,
.dashboard-page .dash-recent-card {
  border: 1px solid var(--erp-color-border);
  border-radius: var(--erp-radius-control);
  box-shadow: none;
}

.dashboard-page .dash-head-card .ant-card-body,
.dashboard-page .dash-todo-card .ant-card-body,
.dashboard-page .dash-continue-card .ant-card-body,
.dashboard-page .dash-chart-card .ant-card-body {
  padding: 14px;
}

.dashboard-page .dash-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--erp-space-2);
}

.dashboard-page .dash-metric-card .ant-card-body { padding: 12px 14px; }

.dashboard-page .dash-metric-title {
  overflow: hidden;
  color: var(--erp-color-text-secondary);
  font-size: var(--erp-font-size-body);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-page .dash-metric-value {
  overflow: hidden;
  margin-top: 6px;
  color: #1d2939;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-page .dash-metric-sub {
  margin-top: 4px;
  color: var(--erp-color-text-secondary);
  font-size: var(--erp-font-size-caption);
}

.dashboard-page .dash-quick-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--erp-space-2);
  margin-top: 0;
}

.dashboard-page .dash-quick-card,
.dashboard-page .dash-quick-card.c1,
.dashboard-page .dash-quick-card.c2,
.dashboard-page .dash-quick-card.c3,
.dashboard-page .dash-quick-card.c4,
.dashboard-page .dash-quick-card.c5,
.dashboard-page .dash-quick-card.c6 {
  min-height: 76px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 12px;
  color: var(--erp-color-text);
  background: #fff;
}

.dashboard-page .dash-quick-card:hover {
  color: var(--erp-color-primary);
  background: var(--erp-color-primary-soft);
  transform: none;
}

.dashboard-page .dash-quick-icon { color: var(--erp-color-primary); font-size: 20px; }

.dashboard-page .dash-quick-label {
  overflow: hidden;
  font-size: var(--erp-font-size-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-page .dash-todo-head { margin-bottom: 10px; }
.dashboard-page .dash-todo-copy strong { font-size: 22px; font-variant-numeric: tabular-nums; }

@media (max-width: 1200px) {
  .dashboard-page .dash-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-page .dash-quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Personal task console: the first screen answers "what should I handle now?". */
.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.task-console-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.task-console-greeting {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.task-console-date {
  color: var(--erp-color-text-secondary);
  font-size: var(--erp-font-size-caption);
}

.task-console-title {
  margin: 0;
  color: #1d2939;
  font-size: var(--erp-font-size-page);
  line-height: 1.3;
}

.task-console-head-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
}

/* Keep the first viewport task-led without changing the existing request or
 * task ordering contracts. The queue/work views stay together, followed by
 * the per-user summary and lower-priority business context. */
.task-console {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.task-console-columns {
  order: 1;
  grid-template-areas:
    "priority priority"
    "summary views";
}

.task-console-priority { grid-area: priority; }
.task-console-summary { grid-area: summary; }
.task-console-views { grid-area: views; }
.task-console-overview { order: 2; }

.task-console-loading {
  display: grid;
  min-height: 120px;
  place-items: center;
}

.task-console-section {
  min-width: 0;
  padding: 14px;
  background: var(--erp-color-surface);
  border: 1px solid var(--erp-color-divider);
  border-radius: var(--erp-radius-control);
}

.task-console-summary,
.task-console-views,
.task-console-commands,
.task-console-overview {
  background: transparent;
  border: 0;
}

.task-console-summary,
.task-console-views,
.task-console-commands {
  padding: 0;
}

.task-console-summary {
  padding-bottom: 4px;
}

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

.task-console-section-head .ant-typography { margin: 0; }
.task-console-section-head .ant-typography.ant-typography-h4 {
  color: #1d2939;
  font-size: var(--erp-font-size-section);
}

.task-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--erp-color-divider);
}

.task-summary-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--erp-color-text);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--erp-color-divider);
  cursor: pointer;
  text-align: left;
}

.task-summary-card:last-child { border-right: 0; }

.task-summary-card:hover,
.task-summary-card:focus-visible { background: var(--erp-color-primary-soft); }

.task-summary-icon {
  display: inline-flex;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  color: var(--erp-color-primary);
  background: var(--erp-color-primary-soft);
  border-radius: 50%;
  font-size: 13px;
}

.task-summary-card.orange .task-summary-icon,
.task-summary-card.blue .task-summary-icon,
.task-summary-card.red .task-summary-icon,
.task-summary-card.green .task-summary-icon {
  color: var(--erp-color-text-secondary);
  background: transparent;
  border: 1px solid var(--erp-color-divider);
}

.task-summary-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.task-summary-copy strong {
  color: #101828;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.task-summary-copy span {
  overflow: hidden;
  color: var(--erp-color-text);
  font-size: var(--erp-font-size-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-summary-copy small {
  overflow: hidden;
  color: var(--erp-color-text-secondary);
  font-size: var(--erp-font-size-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-console-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 14px;
  align-items: start;
}

.task-console-priority .dash-work-queue-list { border-top: 0; }

.task-console-views { display: flex; flex-direction: column; gap: 14px; }

.task-console-commands {
  padding-block: 2px 0;
}

.task-command-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-command-list button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  color: var(--erp-color-text);
  background: var(--erp-color-surface-muted);
  border: 1px solid var(--erp-color-border);
  border-radius: 4px;
  cursor: pointer;
  font-size: var(--erp-font-size-body);
}

.task-command-list button:hover,
.task-command-list button:focus-visible {
  color: var(--erp-color-primary);
  background: var(--erp-color-primary-soft);
  border-color: #91caff;
}

.task-command-icon {
  display: inline-flex;
  color: var(--erp-color-primary);
  font-size: 14px;
}

.task-view-block { display: flex; flex-direction: column; gap: 8px; }

.task-view-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--erp-color-text-secondary);
  font-size: var(--erp-font-size-caption);
}

.task-view-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.task-view-chips button {
  padding: 4px 10px;
  color: var(--erp-color-text);
  background: var(--erp-color-surface-muted);
  border: 1px solid var(--erp-color-border);
  border-radius: 4px;
  cursor: pointer;
  font-size: var(--erp-font-size-body);
}

.task-view-chips button:hover {
  color: var(--erp-color-primary);
  background: var(--erp-color-primary-soft);
  border-color: #91caff;
}

.task-console-overview .dash-metric-grid { margin-bottom: 14px; }
.task-console-overview .dash-metric-card {
  padding: 12px 14px;
  background: var(--erp-color-surface-muted);
  border: 1px solid var(--erp-color-border);
  border-radius: var(--erp-radius-control);
}

.task-overview-chart {
  padding-top: 14px;
  border-top: 1px solid var(--erp-color-divider);
}

@media (max-width: 1280px) {
  .task-console-columns {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "priority" "summary" "views";
  }
}

@media (max-width: 960px) {
  .task-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-summary-card:nth-child(2) { border-right: 0; }
  .task-summary-card:nth-child(-n + 2) { border-bottom: 1px solid var(--erp-color-divider); }
}

@media (max-width: 720px) {
  .task-console-head { flex-direction: column; }
  .task-console-head-actions { justify-content: flex-start; }
}

/* Classic ERP workspace skin: keep the task-console data and interactions,
 * while presenting the overview in the familiar metrics/actions/chart order. */
.dashboard-page {
  gap: 10px;
  padding: 12px 14px 24px;
  background: #f5f6f8;
}

.dashboard-page .task-console-head {
  align-items: center;
  padding: 2px 0;
}

.dashboard-page .task-console-date,
.dashboard-page .task-console-greeting > .ant-typography-secondary { display: none; }
.dashboard-page .task-console-title { color: #344054; font-size: 20px; font-weight: 600; }
.dashboard-page .task-console-head-actions { gap: 8px !important; }

/* JSX keeps sections grouped for screen readers; visual order matches the
 * classic dashboard without changing any request or permission logic. */
.dashboard-page .task-console { display: flex; flex-direction: column; gap: 10px; }
.dashboard-page .task-console-overview { order: 1; }
.dashboard-page .task-console-commands { order: 2; }
.dashboard-page .task-console-columns { order: 3; }

.dashboard-page .task-console-section,
.dashboard-page .task-overview-chart {
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  background: #fff;
  box-shadow: none;
}

.dashboard-page .task-console-section-head {
  min-height: 46px;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f2;
}

.dashboard-page .task-console-section-head h4 {
  margin: 0;
  color: #475467;
  font-size: 15px;
  font-weight: 600;
}

.dashboard-page .task-console-overview {
  padding: 0;
  border: 0;
  background: transparent;
}

.dashboard-page .task-console-overview > .task-console-section-head {
  border: 1px solid #e5e7eb;
  border-bottom: 0;
  background: #fff;
}

.dashboard-page .dash-metric-grid { gap: 10px; margin: 0; }
.dashboard-page .dash-metric-card {
  min-height: 104px;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  background: #fff;
}
.dashboard-page .dash-metric-card::before { display: none; }
.dashboard-page .dash-metric-title { color: #667085; font-size: 14px; }
.dashboard-page .dash-metric-value { margin-top: 10px; color: #52657a; font-size: 30px; font-weight: 400; }
.dashboard-page .dash-metric-sub { color: #98a2b3; }

.dashboard-page .task-console-commands { padding: 0; overflow: hidden; }
.dashboard-page .task-command-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
}
.dashboard-page .task-command-list button {
  min-height: 86px;
  padding: 14px 10px;
  border-right: 1px solid #edf0f2;
  border-radius: 0;
  color: #475467;
  background: #fff;
}
.dashboard-page .task-command-list button:last-child { border-right: 0; }
.dashboard-page .task-command-list button:hover { color: #1677ff; background: #f5faff; }
.dashboard-page .task-command-icon { color: #1677ff; font-size: 26px; }

.dashboard-page .task-overview-chart { margin-top: 10px; overflow: hidden; }
.dashboard-page .dash-chart-head { padding: 12px 14px; border-bottom: 1px solid #edf0f2; }
.dashboard-page .dash-chart-summary { padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid #edf0f2; }
.dashboard-page .dash-bar-fill-v2,
.dashboard-page .dash-stacked-bar-v2,
.dashboard-page .dash-ranking-fill { background: #3fa7d6; }

.dashboard-page .task-console-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 10px;
}
.dashboard-page .task-console-priority { grid-row: span 2; }
.dashboard-page .task-console-summary,
.dashboard-page .task-console-views { min-width: 0; }

@media (max-width: 960px) {
  .dashboard-page .task-console-columns { grid-template-columns: 1fr; }
  .dashboard-page .task-console-priority { grid-row: auto; }
}

@media (max-width: 720px) {
  .dashboard-page { padding: 8px; }
  .dashboard-page .task-console-head { align-items: flex-start; }
  .dashboard-page .dash-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-page .task-command-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-page .task-command-list button:nth-child(even) { border-right: 0; }
}
/* Desktop ERP sign-in screen, moved out of the global stylesheet. */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(560px, 1.08fr) minmax(420px, 0.92fr);
  background:
    radial-gradient(circle at 82% 14%, rgba(14, 165, 233, 0.12), transparent 30%),
    linear-gradient(120deg, #f8fafc 0%, #eef5ff 100%);
}

.login-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(150deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 64, 175, 0.95) 58%, rgba(29, 78, 216, 0.92) 100%);
  color: #f8fafc;
}

.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(130deg, rgba(0, 0, 0, 0.8), transparent 70%);
  pointer-events: none;
}

.login-brand,
.login-metrics {
  position: relative;
  z-index: 1;
}

.login-brand {
  max-width: 680px;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 28px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.login-version {
  display: block;
  margin-bottom: 14px;
  color: rgba(226, 232, 240, 0.76);
  font-size: 13px;
}

.login-hero h1 {
  max-width: 640px;
  margin: 0 0 18px;
  font-size: 52px;
  line-height: 1.08;
  font-weight: 800;
}

.login-hero p {
  max-width: 520px;
  color: rgba(226, 232, 240, 0.84);
  font-size: 16px;
  line-height: 1.75;
}

.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 760px;
}

.login-metrics > div {
  min-height: 112px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-metrics .anticon {
  color: #bfdbfe;
  font-size: 22px;
}

.login-metrics span {
  color: rgba(226, 232, 240, 0.72);
  font-size: 13px;
}

.login-metrics strong {
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
}

.login-panel {
  padding: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(440px, 100%);
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.login-card-head h2 {
  margin: 4px 0 8px !important;
  color: #0f172a;
  font-size: 30px !important;
  line-height: 1.2 !important;
}

.login-card-eyebrow {
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.login-form .ant-form-item {
  margin-bottom: 18px;
}

.login-form .ant-input-affix-wrapper,
.login-form .ant-input {
  border-radius: 8px;
}

.login-submit {
  height: 44px;
  margin-top: 4px;
  border-radius: 8px;
  font-weight: 700;
}

@media (max-width: 960px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-hero {
    padding: 32px 24px;
    min-height: auto;
    gap: 28px;
  }

  .login-hero h1 {
    font-size: 34px;
  }

  .login-hero p {
    font-size: 15px;
  }

  .login-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
  }

  .login-metrics {
    grid-template-columns: 1fr;
  }

  .login-metrics > div {
    min-height: 84px;
  }

  .login-panel {
    padding: 24px;
    align-items: flex-start;
  }

  .login-card {
    padding: 2px;
  }

  .login-card-head h2 {
    font-size: 26px !important;
  }
}
/* Mobile workflow additions kept separate from the legacy desktop stylesheet. */
.mobile-detail-page .document-operation-card {
  margin: 0 0 16px;
  border-radius: var(--erp-radius-control);
}

.mobile-detail-page .document-operation-card .ant-card-head {
  min-height: 40px;
  padding: 0 12px;
}

.mobile-detail-page .document-operation-card .ant-card-body {
  padding: 12px;
}

.mobile-detail-page .document-operation-card .ant-timeline {
  margin: 0;
}

.doc-draft-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
}

.doc-draft-status-error {
  margin: 0;
  padding: 3px 8px;
  font-size: 12px;
}

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

.mobile-shipment-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--erp-color-border);
  border-radius: var(--erp-radius-control);
}

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

.mobile-shipment-evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.mobile-shipment-evidence {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mobile-shipment-evidence .ant-image {
  width: 100%;
  aspect-ratio: 1;
}

.mobile-shipment-evidence .ant-image-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

/* R1 mobile document creation: page-level surfaces remain unframed while
   repeated product rows are compact cards with a stable touch layout. */
.mobile-header-actions { display: inline-flex; align-items: center; gap: 4px; }

.mobile-document-create-page { padding-bottom: calc(var(--mobile-submit-bar-height) + var(--mobile-bottom-nav-height) + 16px); }

.mobile-document-create-page .mobile-form-section { display: grid; gap: 10px; }
.mobile-document-create-page .mobile-form-section > .ant-typography { margin: 0; }
.mobile-document-create-page .ant-form-item { margin-bottom: 4px; }
.mobile-line-editor { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--erp-color-border); border-radius: 6px; background: #fff; }
.mobile-line-editor-head { display: flex; min-height: 30px; align-items: center; justify-content: space-between; }
.mobile-line-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mobile-returnable-list { display: grid; gap: 7px; max-height: 260px; overflow: auto; }
.mobile-returnable-list button { display: flex; min-height: 52px; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 9px; text-align: left; border: 1px solid var(--erp-color-border); border-radius: 6px; background: #fff; color: inherit; }
.mobile-returnable-list button > span:first-child { display: grid; min-width: 0; gap: 2px; }
.mobile-returnable-list small { overflow: hidden; color: #6b7280; text-overflow: ellipsis; white-space: nowrap; }
.mobile-returnable-list button > span:last-child { flex: 0 0 auto; color: var(--erp-color-primary); }
.mobile-submit-bar { position: fixed; z-index: 60; right: 0; bottom: var(--mobile-bottom-nav-height); left: 0; display: flex; min-height: var(--mobile-submit-bar-height); align-items: center; justify-content: space-between; gap: 8px; padding: 8px max(12px, env(safe-area-inset-left)) 8px max(12px, env(safe-area-inset-right)); border-top: 1px solid var(--erp-color-border); background: rgba(255, 255, 255, .97); box-shadow: 0 -4px 12px rgba(15, 23, 42, .06); }
.mobile-submit-bar > span { display: grid; min-width: 0; gap: 2px; }
.mobile-submit-bar small { color: #6b7280; font-size: 12px; }
.mobile-submit-bar strong { color: #b42318; font-size: 16px; white-space: nowrap; }
.mobile-submit-bar .ant-space { flex: 0 0 auto; }
.mobile-submit-review { display: grid; gap: 10px; color: #374151; }
.mobile-submit-review p { margin: 0; }
.mobile-submit-review .anticon { color: var(--erp-color-primary); font-size: 24px; }
.mobile-assistant-page .agent-page { min-height: auto; }
.mobile-sales-suggestion { display: grid; gap: 7px; margin-top: 16px; padding: 12px; border: 1px solid var(--erp-color-border); border-radius: 8px; background: #fff; }
.mobile-sales-suggestion .ant-typography { margin: 0; }
.mobile-agent-candidates { display: grid; gap: 4px; margin-top: 8px; }
.mobile-suggestion-summary { display: grid; gap: 8px; margin-top: 10px; }

.mobile-master-data-page { padding-bottom: calc(var(--mobile-bottom-nav-height) + 20px); }
.mobile-master-data-page .mobile-form-section { display: grid; gap: 10px; }
.mobile-master-data-page .ant-form-item { margin-bottom: 4px; }
.mobile-master-data-grid { display: grid; gap: 4px; }
.mobile-master-data-select { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.mobile-master-data-select > .ant-btn { min-height: 32px; }
.mobile-master-data-select .ant-form-item { min-width: 0; flex: 1; }
.mobile-master-data-select .ant-select { width: 100%; }
.mobile-master-data-shortcuts { margin-top: 16px; }
.mobile-dashboard-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mobile-dashboard-actions .ant-btn { min-height: 44px; }

@media (max-width: 374px) {
  .mobile-submit-bar { padding-right: 8px; padding-left: 8px; }
  .mobile-submit-bar .ant-btn { padding-inline: 8px; }
  .mobile-submit-bar strong { font-size: 14px; }
}

/* Keep assistant controls fully reachable on phone widths, including long
   context labels. These rules only apply to the compact mobile assistant. */
.mobile-assistant-page .agent-page-mobile > .ant-space-item { min-width: 0; }
.mobile-assistant-page .agent-page-mobile .ant-btn { min-height: 44px; min-width: 44px; }
.mobile-assistant-page .agent-history-controls > .ant-select { flex-basis: 100% !important; min-height: 44px; }
.mobile-assistant-page .agent-history-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.mobile-assistant-page .agent-page-mobile .ant-alert { flex-wrap: wrap; gap: 8px; }
.mobile-assistant-page .agent-page-mobile .ant-alert-content { min-width: 0; overflow-wrap: anywhere; }
.mobile-assistant-page .agent-page-mobile .ant-alert-action { margin-inline-start: 0; }
/* Final module-list overrides. Loaded after the legacy global stylesheet. */
.list-toolbar-sticky {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.list-toolbar-sticky .module-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  min-width: 0;
}

.list-toolbar-sticky .module-filter-row > * {
  width: 100%;
  min-width: 0;
}

.list-toolbar-sticky .module-toolbar-actions {
  justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
}

.module-view-presets {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.module-view-presets .ant-typography {
  margin-right: 4px;
  font-size: 12px;
}

/* 常用视图的「当前选中项」。
   这排按钮此前靠 antd 的 `type="primary"` 表示选中——那是**主操作**的视觉语义，于是「全部」
   这类被选中的筛选项会被染成整页最重的那个填充色。清单页本来就该只有一个主操作（计划
   「状态和操作」第一条），选中态改用主色系的浅底 + 主色文字/描边表达：既是「已选中」，又不
   抢主操作的位。可读性由 `tokens.test.ts` 的 4.5:1 门禁兜底（primary 压在 primary-soft 上）。
   不用 `.ant-btn-primary` 覆盖，是因为那会重新落回「用主操作样式表达选中」的老问题。 */
.module-view-presets .ant-btn[aria-pressed='true'] {
  color: var(--erp-color-primary);
  background: var(--erp-color-primary-soft);
  border-color: var(--erp-color-primary);
}

/* 远端选项（客户/供应商/商品/仓库）加载失败时的下拉内容。
   它替代的是 antd 默认的「暂无数据」——那句话把“请求失败”说成“没有数据”，而两者要用户做的事
   正好相反（一个重试，一个改条件）。选择器不加祖先作用域：下拉是挂在 document.body 上的浮层，
   加作用域等于永远选不中；色值走 :root 上的 token，所以照样受视觉系统管辖。 */
.module-options-error {
  display: grid;
  justify-items: start;
  gap: var(--erp-space-1);
  max-width: 320px;
  padding: var(--erp-space-2);
}

.module-options-error > .ant-typography:first-child {
  color: var(--erp-color-warning);
}

.module-options-error .ant-btn {
  height: auto;
  padding: 0;
}

.module-batch-failure-list {
  max-height: 220px;
  overflow: auto;
  padding: 8px 10px;
  color: #475467;
  background: #f7f8fa;
  border: 1px solid #e4e7ec;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.7;
}

.async-state-loading {
  min-height: 180px;
  display: grid;
  grid-auto-flow: row;
  gap: 10px;
  place-items: center;
}

.finance-options-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  border-radius: 4px;
}

@media (max-width: 960px) {
  .list-toolbar-sticky {
    grid-template-columns: 1fr;
  }

  .list-toolbar-sticky .module-toolbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
/* Sales overview composes the shared module list with its dashboard-specific controls. */
.sales-orders-overview-page > * + * { margin-top: 14px; }
.sales-orders-overview-page .sales-orders-module > .page-card:first-child { display: none; }
.sales-orders-table .ant-table-thead > tr > th { position: sticky; top: 0; z-index: 2; }
.sales-orders-module .module-row-actions { max-width: 232px; }
.sales-orders-module .module-row-actions .ant-btn { padding-inline: 7px; }
.sales-orders-module .list-toolbar-sticky { gap: 8px; padding-bottom: 4px; }
.sales-orders-module .module-filter-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 8px;
}
.sales-orders-module .module-filter-row > * { width: 100%; min-width: 0; }
.sales-orders-module .module-filter-keyword,
.sales-orders-module .module-filter-customerId { grid-column: span 4; }
.sales-orders-module .module-toolbar-actions { row-gap: 6px; }
.sales-orders-module .module-toolbar-actions .ant-btn { height: 32px; padding-inline: 12px; }
.sales-orders-module .list-toolbar-sticky > .ant-typography { font-size: 12px; line-height: 18px; }

.sales-todo-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 14px; }
.sales-todo-card { position: relative; overflow: hidden; border: 1px solid #e4e7ec; box-shadow: 0 4px 14px rgba(16, 24, 40, 0.06); cursor: pointer; }
.sales-todo-card .ant-card-body { padding: 18px; }
.sales-todo-card::before { position: absolute; inset: 0 auto 0 0; width: 4px; content: ''; }
.sales-todo-orange::before { background: #f79009; }
.sales-todo-blue::before { background: #1677ff; }
.sales-todo-green::before { background: #12b76a; }
.sales-todo-content { display: flex; align-items: center; gap: 14px; min-height: 72px; }
.sales-todo-icon { display: grid; flex: 0 0 46px; width: 46px; height: 46px; place-items: center; border-radius: 12px; background: #f2f4f7; color: #344054; font-size: 22px; }
.sales-todo-orange .sales-todo-icon { background: #fff4e5; color: #dc6803; }
.sales-todo-blue .sales-todo-icon { background: #eaf3ff; color: #1677ff; }
.sales-todo-green .sales-todo-icon { background: #eafbf3; color: #039855; }
.sales-todo-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.sales-todo-copy strong { color: #101828; font-size: 28px; line-height: 1.2; }
.sales-todo-copy span { overflow: hidden; color: #5f6b7a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sales-todo-link { align-self: flex-end; color: #1677ff; font-size: 12px; white-space: nowrap; }

@media (max-width: 1280px) {
  .sales-orders-module .module-filter-row { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
  .sales-orders-module .module-filter-keyword,
  .sales-orders-module .module-filter-customerId { grid-column: span 2; }
}

@media (max-width: 960px) {
  .sales-todo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sales-orders-module .module-filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-orders-module .module-filter-keyword,
  .sales-orders-module .module-filter-customerId { grid-column: span 2; }
}

/* Desktop list hierarchy and scanability. */
.list-toolbar-sticky {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0 0 var(--erp-space-3);
  background: transparent;
  backdrop-filter: none;
}

.list-toolbar-sticky .module-filter-row {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.list-toolbar-sticky .module-toolbar-actions {
  gap: var(--erp-space-2);
}

.module-selection-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--erp-space-3);
  min-height: 44px;
  padding: 6px var(--erp-space-3);
  color: #175cd3;
  background: var(--erp-color-primary-soft);
  border: 1px solid #b2ddff;
  border-radius: var(--erp-radius-control);
}

.module-selection-count {
  flex: 0 0 auto;
  font-size: var(--erp-font-size-body);
  font-weight: 600;
  white-space: nowrap;
}

.module-selection-bar .ant-space {
  min-width: 0;
}

.erp-module-table .ant-table-cell {
  font-size: var(--erp-font-size-body);
  vertical-align: middle;
}

.erp-module-table .ant-table {
  min-width: 100%;
}

.ant-table-wrapper .module-table-cell {
  color: var(--erp-color-text);
}

.ant-table-wrapper .module-table-cell.is-primary {
  color: #1d2939;
  font-weight: 600;
}

.ant-table-wrapper .module-table-cell.is-numeric,
.ant-table-wrapper .module-table-cell.is-numeric .module-cell-content {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.ant-table-wrapper .module-table-cell.is-single-line,
.ant-table-wrapper .module-table-cell.is-single-line .module-cell-content {
  white-space: nowrap;
}

.ant-table-wrapper .module-cell-content {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.erp-module-table .ant-table-tbody > tr {
  cursor: pointer;
}

.erp-module-table .ant-table-tbody > tr:hover > td {
  background: #f8fbff !important;
}

.erp-module-table .ant-tag {
  min-width: 52px;
  margin-inline-end: 0;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .list-toolbar-sticky {
    grid-template-columns: 1fr;
  }

  .list-toolbar-sticky .module-toolbar-actions {
    justify-content: flex-start;
  }
}
.module-master-detail-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0 var(--module-preview-width, 440px);
  min-height: min(680px, calc(100vh - 168px));
  border: 1px solid var(--erp-color-divider);
  background: var(--erp-color-surface);
}

.module-preview-resizer {
  /* 分隔条是全高的 10px 命中区，套通用轮廓会在列表和预览之间画出一个贯穿整屏的方框，
     所以它用下面那条伪元素色条表达焦点，并通过变量豁免 tokens.css 的统一焦点轮廓。 */
  --erp-focus-outline: none;
  position: relative;
  z-index: 1;
  width: 10px;
  margin-inline: -5px;
  cursor: col-resize;
  touch-action: none;
}

.module-preview-resizer::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  content: '';
  background: transparent;
}

.module-preview-resizer:hover::after,
.module-preview-resizer:focus-visible::after { background: var(--erp-color-primary); }

.module-master-detail-workspace .module-list-surface {
  min-width: 0;
  border: 0;
  border-radius: 0;
}

.module-master-detail-workspace .module-list-surface .ant-card-body {
  height: 100%;
}

.module-record-preview {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--erp-color-surface);
  border-left: 1px solid var(--erp-color-divider);
}

.module-record-preview-header {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--erp-color-divider);
}

.module-record-preview-title { min-width: 0; font-weight: 600; }
/* Record-summary header: the selected record's identity and status, not the module label. */
.module-detail-summary { min-width: 0; }
.module-detail-title-row { display: flex; align-items: center; min-width: 0; gap: 8px; }
.module-detail-title-row .ant-typography { font-size: var(--erp-font-size-section); }
.module-detail-title-row .ant-tag { flex: 0 0 auto; }
.module-detail-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-detail-facts {
  display: flex;
  min-width: 0;
  margin-top: 3px;
  gap: 14px;
  overflow: hidden;
  color: var(--erp-color-text-secondary);
  font-size: var(--erp-font-size-caption);
  font-variant-numeric: tabular-nums;
}
/* Facts share one ellipsised line, so each one shrinks rather than pushing the row out of the header. */
.module-detail-facts > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-record-preview-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.module-record-preview-body { min-height: 0; padding: 14px; overflow: auto; }
.module-record-preview .document-detail-content { gap: 18px; }
.master-detail-business-summary { gap: 14px; }
.master-detail-summary-section { min-width: 0; padding-bottom: 14px; border-bottom: 1px solid var(--erp-color-divider); }
.master-detail-summary-section:last-child { padding-bottom: 0; border-bottom: 0; }
.master-detail-summary-section > .ant-typography { display: block; margin-bottom: 8px; }
.master-detail-summary-section .ant-descriptions-item-content { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.master-detail-related-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.document-preview-section { padding-bottom: 16px; border-bottom: 1px solid var(--erp-color-divider); }
.document-preview-section:last-of-type { padding-bottom: 0; border-bottom: 0; }
.document-preview-section-title { display: block; margin-bottom: 10px; }
.document-preview-section-body { min-width: 0; }
.module-finance-detail-content { display: flex; flex-direction: column; gap: 18px; }
.module-finance-detail-section { min-width: 0; padding-bottom: 16px; border-bottom: 1px solid var(--erp-color-divider); }
.module-finance-detail-section:last-child { padding-bottom: 0; border-bottom: 0; }
.module-finance-detail-section .ant-table-wrapper { overflow-x: auto; }
.document-preview-items .ant-table-wrapper { overflow-x: auto; }
.document-preview-items .ant-table { min-width: 680px; }
.document-preview-money-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.document-preview-money-grid .ant-form-item { margin-bottom: 0; }

.module-filter-summary {
  display: flex;
  min-height: 24px;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--erp-color-text-secondary);
  font-size: 12px;
}

.module-filter-summary button {
  padding: 2px 6px;
  color: #175cd3;
  background: #eff8ff;
  border: 1px solid #b2ddff;
  border-radius: 4px;
  cursor: pointer;
}

.module-table-density-compact .ant-table-thead > tr > th,
.module-table-density-compact .ant-table-tbody > tr > td { padding-top: 5px; padding-bottom: 5px; }
.module-table-density-standard .ant-table-thead > tr > th,
.module-table-density-standard .ant-table-tbody > tr > td { padding-top: 10px; padding-bottom: 10px; }

.module-table-row-selected > td { background: #eff8ff !important; }
.erp-module-table .ant-table-tbody > tr:focus-visible > td { outline: 2px solid var(--erp-color-focus); outline-offset: -2px; }

@media (max-width: 1279px) {
  .module-master-detail-workspace { display: block; min-height: 0; border: 0; }
}

.products-workspace { min-width: 0; }

@media (min-width: 1280px) {
  .products-workspace.is-preview-open {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
    min-height: 520px;
    border-top: 1px solid var(--erp-color-divider);
  }

  .products-workspace-list { min-width: 0; }
  .products-workspace.is-preview-open .products-workspace-list { padding-right: 12px; }
}

.products-workspace-list .ant-table-tbody > tr { cursor: pointer; }
.products-workspace-list .ant-table-tbody > tr:focus-visible > td { outline: 2px solid var(--erp-color-focus); outline-offset: -2px; }

.product-record-preview {
  min-width: 0;
  padding: 14px;
  background: var(--erp-color-surface);
  border-left: 1px solid var(--erp-color-divider);
}

.product-record-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.product-record-preview-head .ant-typography { margin: 2px 0 0; }
.product-record-preview-status { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.product-record-preview-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin: 0; }
.product-record-preview-fields div { min-width: 0; }
.product-record-preview-fields dt { color: var(--erp-color-text-secondary); font-size: 12px; }
.product-record-preview-fields dd { overflow: hidden; margin: 3px 0 0; color: var(--erp-color-text); font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.product-record-preview-copy { margin: 16px 0 0 !important; color: var(--erp-color-text-secondary); }
.products-view-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.products-selection-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--erp-color-divider); background: var(--erp-color-surface-subtle); }
.product-preview-section { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--erp-color-divider); }
.product-inventory-summary { display: flex; flex-direction: column; gap: 6px; }
.product-inventory-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.product-inventory-total { padding-top: 6px; border-top: 1px dashed var(--erp-color-divider); }
.product-alternative-list { display: flex; flex-direction: column; gap: 6px; }
.product-alternative-list > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.product-price-line { display: block; }
.product-related-actions { gap: 10px; }

@media (max-width: 1279px) {
  .products-view-actions { align-items: flex-start; }
  .product-record-preview { border-left: 0; border-top: 1px solid var(--erp-color-divider); }
}

.fund-flows-workspace { min-width: 0; }

@media (min-width: 1280px) {
  .fund-flows-workspace.is-preview-open {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
    min-height: 520px;
    border-top: 1px solid var(--erp-color-divider);
  }

  .fund-flows-workspace-list { min-width: 0; }
  .fund-flows-workspace.is-preview-open .fund-flows-workspace-list { padding-right: 12px; }
}

.fund-flows-workspace-list .ant-table-tbody > tr { cursor: pointer; }
.fund-flows-workspace-list .ant-table-tbody > tr:focus-visible > td { outline: 2px solid var(--erp-color-focus); outline-offset: -2px; }
.fund-flow-record-preview { display: flex; min-width: 0; flex-direction: column; background: var(--erp-color-surface); border-left: 1px solid var(--erp-color-divider); }
.fund-flow-record-preview-header { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--erp-color-divider); }
.fund-flow-record-preview-header .ant-typography { display: block; margin: 0; }
.fund-flow-record-preview-body { min-height: 0; padding: 14px; overflow: auto; }
.fund-flow-record-preview-fields .ant-descriptions-item-label { color: var(--erp-color-text-secondary); }
.fund-flow-record-preview-fields .ant-descriptions-item-content { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.purchase-applications-workspace { min-width: 0; }

@media (min-width: 1280px) {
  .purchase-applications-workspace.is-preview-open {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 38%);
    min-height: min(680px, calc(100vh - 168px));
    border: 1px solid var(--erp-color-divider);
    background: var(--erp-color-surface);
  }

  .purchase-applications-workspace.is-preview-open .purchase-applications-workspace-list {
    min-width: 0;
    border: 0;
    border-radius: 0;
  }
}

.purchase-application-record-preview {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--erp-color-surface);
  border-left: 1px solid var(--erp-color-divider);
}

.purchase-application-record-preview-header {
  display: flex;
  min-height: 58px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--erp-color-divider);
}

.purchase-application-record-preview-title { min-width: 0; }
.purchase-application-record-preview-title .ant-typography { display: block; margin: 0; }
.purchase-application-record-preview-title .ant-typography.ant-typography-h4 { overflow: hidden; margin-top: 2px; text-overflow: ellipsis; white-space: nowrap; }
.purchase-application-record-preview-status { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; }
.purchase-application-record-preview-body { min-height: 0; padding: 14px; overflow: auto; }
.purchase-application-record-preview-body .ant-table-wrapper { overflow-x: auto; }
.purchase-application-record-preview-body .ant-table { min-width: 680px; }

.shipments-workspace { min-width: 0; }
.inventory-workspace-command-bar { display: flex; min-height: 32px; justify-content: flex-end; align-items: center; }
.shipments-workspace.is-preview-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  min-height: min(680px, calc(100vh - 230px));
  border: 1px solid var(--erp-color-divider);
  background: var(--erp-color-surface);
}
.shipments-workspace.is-preview-open .shipments-workspace-list { min-width: 0; border: 0; border-radius: 0; }
.shipments-workspace.is-preview-open .shipments-workspace-list .ant-card-body { height: 100%; }
.shipments-workspace-list .ant-table-tbody > tr { cursor: pointer; }
.shipment-record-preview { display: flex; min-width: 0; flex-direction: column; background: var(--erp-color-surface); border-left: 1px solid var(--erp-color-divider); }
.shipment-record-preview-header { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--erp-color-divider); }
.shipment-record-preview-body { min-height: 0; padding: 14px; overflow: auto; }
.shipment-preview-evidence { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--erp-color-divider); }

@media (max-width: 1279px) {
  .shipments-workspace.is-preview-open { display: block; min-height: 0; border: 0; }
}
/* Print preview keeps the primary action visible while secondary tools stay compact. */
.dot-command-bar .dot-quick-settings,
.dot-command-bar .dot-preview-controls,
.dot-command-bar .dot-primary-actions {
  min-height: 38px;
}

.dot-command-bar .dot-quick-settings {
  background: #f8fbff;
  border-color: #cfe1f5;
}

.dot-command-bar .dot-primary-print {
  min-width: 92px;
  font-weight: 600;
}

.dot-command-bar .dot-more-action {
  color: #475569;
}

.dot-advanced-settings {
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
}

.dot-advanced-settings > summary {
  padding: 9px 12px;
  color: #475569;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  list-style-position: inside;
}

.dot-advanced-settings[open] > summary {
  border-bottom: 1px solid #e2e8f0;
  color: #1677ff;
}

.dot-advanced-settings-body {
  padding: 0 12px 10px;
}

@media (max-width: 900px) {
  .dot-command-bar .dot-action-groups {
    justify-content: flex-start;
  }

  .dot-command-bar .dot-quick-settings,
  .dot-command-bar .dot-preview-controls,
  .dot-command-bar .dot-primary-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .dot-command-bar .dot-primary-actions {
    order: -1;
  }
}

@media (max-width: 560px) {
  .dot-command-bar .dot-template-picker {
    width: min(100%, 220px);
  }

  .dot-command-bar .dot-secondary-action {
    padding-inline: 8px;
  }
}

/**
 * 打印页的路由拒绝态。打印页平时不挂壳层（它自己的内联样式负责 `body` 边距与底色），
 * 所以这一块必须自己站住：居中、给足边距，别让「没有权限」四个字贴在左上角。
 */
.print-route-guard {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: #eef1f5;
}

.finance-entry-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(260px, 1.3fr) minmax(220px, 1fr);
  column-gap: 14px;
  align-items: start;
}

.doc-page {
  width: 100%;
}

.doc-toolbar-card {
  background: #eef1f5;
  border: 1px solid #d5dbe5;
  box-shadow: none;
}

.doc-toolbar {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.doc-toolbar-title {
  margin: 0 !important;
  font-size: 24px !important;
  font-weight: 700 !important;
}

.doc-section-card {
  background: #f2f4f7;
  border: 1px solid #d7dce5;
  box-shadow: none;
}

.doc-section-card .ant-card-head {
  min-height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid #d9dee6;
}

.doc-section-card .ant-card-head-title {
  padding: 10px 0;
  font-size: 20px;
  font-weight: 700;
}

.doc-section-card .ant-card-body {
  padding: 10px;
}

.doc-head-grid,
.doc-amount-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 0;
  border-left: 1px solid #d7dce5;
  border-top: 1px solid #d7dce5;
  background: #fff;
}

.doc-head-grid .ant-form-item,
.doc-amount-grid .ant-form-item {
  margin-bottom: 0 !important;
  border-right: 1px solid #d7dce5;
  border-bottom: 1px solid #d7dce5;
}

.doc-head-grid .ant-form-item-row,
.doc-amount-grid .ant-form-item-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  min-height: 46px;
}

.doc-head-grid .ant-form-item-label,
.doc-amount-grid .ant-form-item-label {
  padding: 0 !important;
  margin: 0 !important;
  background: #f5f7fa;
  border-right: 1px solid #d7dce5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-head-grid .ant-form-item-label > label,
.doc-amount-grid .ant-form-item-label > label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  width: 100%;
  height: 100% !important;
  margin: 0;
}

.doc-head-grid .ant-form-item-control,
.doc-amount-grid .ant-form-item-control {
  padding: 4px 8px;
}

.doc-head-grid .ant-form-item-control-input,
.doc-amount-grid .ant-form-item-control-input {
  min-height: 36px;
}

.doc-head-grid .ant-input,
.doc-head-grid .ant-select-selector,
.doc-head-grid .ant-input-number,
.doc-head-grid .ant-input-affix-wrapper,
.doc-amount-grid .ant-input,
.doc-amount-grid .ant-select-selector,
.doc-amount-grid .ant-input-number,
.doc-amount-grid .ant-input-affix-wrapper {
  border: 0 !important;
}

/* Calculated amounts should read as results, while editable amounts remain actionable. */
.doc-amount-grid .ant-input[readonly] {
  color: #344054;
  font-size: 15px;
  font-weight: 600;
  text-align: right;
  cursor: default;
}

.doc-amount-grid .ant-form-item:has(.ant-input[readonly]) .ant-form-item-label {
  color: #5f6b7a;
}

.doc-amount-grid .ant-input-number,
.doc-amount-grid .ant-select-selector {
  border: 1px solid #cfd6df !important;
  border-radius: 4px;
  background: #fff !important;
}

.doc-amount-grid .ant-input-number-input {
  text-align: right;
}

.doc-table .ant-table-thead > tr > th {
  background: #f1f3f6;
  font-weight: 600;
  padding: 8px;
  border-color: #d7dce5 !important;
}

.doc-table .ant-table-tbody > tr > td {
  border-color: #d7dce5 !important;
  padding: 6px 8px;
}

.doc-table .ant-table-summary > tr > td {
  background: #fafafa;
  border-color: #d7dce5 !important;
}

.doc-items-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  gap: 12px;
}

.doc-items-toolbar .ant-btn {
  min-width: 104px;
}

.doc-table .ant-table-thead > tr > th:first-child,
.doc-table .ant-table-tbody > tr > td:first-child {
  text-align: center;
}

.doc-table .ant-btn.ant-btn-dangerous.ant-btn-text {
  color: #b42318;
}

.doc-table .ant-btn.ant-btn-dangerous.ant-btn-text:hover {
  background: #fef3f2;
}

.doc-form .ant-btn {
  border-radius: 3px;
}

.doc-form .ant-btn-sm {
  min-width: 28px;
}

.sales-create-toolbar .doc-toolbar {
  min-height: 28px;
}

.sales-create-toolbar .doc-toolbar-title {
  font-size: 20px !important;
}

.sales-create-page > * + * {
  margin-top: 14px;
}

.sales-optional-customer {
  grid-column: 1 / -1;
  margin-top: -2px;
}

.sales-optional-customer .ant-collapse-header {
  padding: 4px 0 !important;
  color: #5f6b7a !important;
  font-size: 12px;
}

.sales-optional-customer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sales-bottom-summary {
  position: sticky;
  z-index: 11;
  bottom: 10px;
  padding: 9px 14px;
  border-color: #cfd6df;
  margin-top: 0;
}

.sales-bottom-summary strong {
  color: #101828;
  font-size: 16px;
}

.sales-document-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 14px;
}

.sales-items-card { min-width: 0; }

.sales-settlement-rail {
  position: sticky;
  top: 66px;
}

.sales-settlement-rail .doc-amount-grid { grid-template-columns: 1fr; }

.sales-item-risks .ant-tag { margin-inline-end: 0; font-size: 11px; line-height: 18px; }

.sales-rail-summary {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--erp-color-divider);
}

.sales-rail-summary .ant-typography { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.sales-rail-summary strong { color: var(--erp-color-text); }

.purchase-document-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 14px;
}

.purchase-items-card { min-width: 0; }
.purchase-settlement-rail { position: sticky; top: 66px; }
.purchase-settlement-rail .doc-amount-grid { grid-template-columns: 1fr; }

.purchase-rail-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--erp-color-divider);
}

.purchase-rail-summary .ant-typography { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.purchase-rail-summary strong { color: var(--erp-color-text); }

.return-document-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 14px;
}

.return-items-card { min-width: 0; }
.return-settlement-rail { position: sticky; top: 66px; }
.return-settlement-rail .doc-amount-grid { grid-template-columns: 1fr; }

.return-rail-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--erp-color-divider);
}

.return-rail-summary .ant-typography { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.return-rail-summary strong { color: var(--erp-color-text); }

@media (min-width: 1280px) {
  .sales-bottom-summary { display: none; }
  .purchase-bottom-summary { display: none; }
}

@media (max-width: 720px) {
  .sales-optional-customer-grid {
    grid-template-columns: 1fr;
  }
}

.doc-form .ant-input:not([readonly]),
.doc-form .ant-input-number,
.doc-form .ant-select-selector,
.doc-form .ant-input-affix-wrapper,
.doc-form textarea {
  background: #fff !important;
  border-color: #cfd6df !important;
  box-shadow: none !important;
}

.doc-form .ant-input[readonly] {
  color: #5f6b7a;
  background: #f5f7fa !important;
  border-color: #e4e7ec !important;
}

.doc-form .ant-input[readonly]:focus {
  border-color: #e4e7ec !important;
  box-shadow: none !important;
}

@media (max-width: 960px) {
  .doc-head-grid,
  .doc-amount-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

.finance-entry-form > .ant-form-item {
  min-width: 0;
}

.finance-entry-form > .ant-form-item:nth-of-type(4),
.finance-entry-form > .ant-form-item:nth-of-type(5),
.finance-entry-form > .ant-form-item:nth-of-type(6),
.finance-entry-form > .ant-btn {
  grid-column: 1 / -1;
}

.finance-entry-form .ant-form-item-control-input-content > .ant-space {
  width: 100%;
}

@media (max-width: 640px) {
  .finance-entry-form {
    grid-template-columns: 1fr;
  }
}

.document-operation-card .ant-card-body {
  padding-bottom: 4px;
}

.document-operation-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Shared desktop document layout for sales, purchases and both return forms. */
.doc-page {
  max-width: var(--erp-page-max-width);
  margin-inline: auto;
  padding-bottom: 76px;
}

.doc-toolbar-card,
.doc-page .sales-create-toolbar {
  position: sticky;
  top: 0;
  z-index: 14;
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--erp-color-border);
  border-radius: var(--erp-radius-control);
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.06);
}

.doc-toolbar-card .ant-card-body {
  padding: 10px 12px;
}

.doc-toolbar-title,
.doc-toolbar .ant-typography.ant-typography-h4 {
  font-size: var(--erp-font-size-section) !important;
  line-height: 1.4;
}

.doc-toolbar-number {
  font-size: var(--erp-font-size-caption);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.doc-section-card {
  background: #fff;
  border-color: var(--erp-color-border);
  border-radius: var(--erp-radius-control);
}

.doc-section-card .ant-card-head-title {
  font-size: var(--erp-font-size-section);
}

.doc-head-grid,
.doc-amount-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.doc-head-grid .ant-form-item-label,
.doc-amount-grid .ant-form-item-label {
  min-width: 94px;
}

.doc-head-grid .ant-form-item-label > label,
.doc-amount-grid .ant-form-item-label > label {
  color: var(--erp-color-text-secondary);
  font-size: var(--erp-font-size-body);
}

.doc-amount-section + .doc-amount-section {
  margin-top: var(--erp-space-4);
}

.doc-amount-section-title {
  display: block;
  margin-bottom: var(--erp-space-2);
  color: #344054;
  font-size: var(--erp-font-size-body);
  font-weight: 600;
}

.doc-amount-grid-calculation .ant-form-item:has(.ant-input[readonly]) {
  background: #f8fafc;
}

.doc-settlement-section .doc-amount-grid {
  border-color: #b2ddff;
}

.doc-table .ant-table-thead > tr > th {
  color: #475467;
  font-size: var(--erp-font-size-body);
  white-space: nowrap;
}

.doc-table .ant-table-tbody > tr > td {
  font-size: var(--erp-font-size-body);
}

.doc-table .ant-input-number-input,
.doc-table .ant-table-cell:nth-last-child(2),
.doc-table .ant-table-summary .ant-table-cell {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.doc-items-toolbar {
  position: sticky;
  left: 0;
}

.sales-bottom-summary {
  top: auto;
  bottom: 10px;
  z-index: 15;
  min-height: 54px;
  background: rgba(255, 255, 255, 0.98);
}

.sales-bottom-summary .ant-typography {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.doc-bottom-summary {
  top: auto;
  bottom: 10px;
  z-index: 15;
  min-height: 54px;
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.98);
}

.doc-bottom-summary .ant-typography {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.module-detail-drawer .ant-drawer-header {
  min-height: 68px;
  padding: 10px 18px;
  background: #fff;
  border-bottom-color: var(--erp-color-border);
}

.module-detail-drawer .ant-drawer-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.98);
  border-top-color: var(--erp-color-border);
}

.document-detail-summary { min-width: 0; }
.document-detail-title-row,
.document-detail-facts { display: flex; align-items: center; min-width: 0; gap: 8px; }
.document-detail-title-row .ant-typography { font-size: var(--erp-font-size-section); }
.document-detail-number,
.document-detail-facts { overflow: hidden; color: var(--erp-color-text-secondary); font-size: var(--erp-font-size-caption); text-overflow: ellipsis; white-space: nowrap; }
.document-detail-number { font-variant-numeric: tabular-nums; }
.document-detail-facts { margin-top: 3px; gap: 14px; }
.document-detail-content .ant-card { border-radius: var(--erp-radius-control); box-shadow: none; }
.document-detail-flow { background: var(--erp-color-surface-muted); }

@media (max-width: 1200px) {
  .doc-head-grid,
  .doc-amount-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.sales-rail-amount,
.purchase-rail-amount,
.return-rail-amount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sales-rail-amount span,
.purchase-rail-amount span,
.return-rail-amount span {
  color: var(--erp-color-text-secondary);
  font-size: var(--erp-font-size-body);
}

.sales-rail-amount strong,
.purchase-rail-amount strong,
.return-rail-amount strong {
  color: #101828;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

@media (max-width: 1279px) {
  .sales-document-workspace { grid-template-columns: 1fr; }
  .sales-settlement-rail { position: static; }
  .sales-rail-summary { display: none; }
  .sales-rail-amount { display: none; }
  .sales-rail-actions { display: none; }
  .purchase-document-workspace { grid-template-columns: 1fr; }
  .purchase-settlement-rail { position: static; }
  .purchase-rail-summary { display: none; }
  .purchase-rail-amount { display: none; }
  .purchase-rail-actions { display: none; }
  .return-document-workspace { grid-template-columns: 1fr; }
  .return-settlement-rail { position: static; }
  .return-rail-summary { display: none; }
  .return-rail-amount { display: none; }
  .return-rail-actions { display: none; }
}
.icp-footer {
  padding: 18px 12px 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.app-shell {
  min-height: 100vh;
}

.jsh-shell {
  position: relative;
  background: #f3f6fb;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-height: 100vh;
}

.top-tabs {
  height: 42px;
  background: #eef1f5;
  border-bottom: 1px solid #d9dde4;
  display: flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
}

.top-tab-home {
  width: 44px;
  height: 42px;
  border: 0;
  border-right: 1px solid #d9dde4;
  background: #edf1f5;
  color: #5b6778;
  cursor: pointer;
}

.top-tab-home.active {
  background: #ffffff;
}

.top-tab-list {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  flex: 1;
}

.top-tab-item {
  height: 42px;
  border: 0;
  border-right: 1px solid #d9dde4;
  background: #eef1f5;
  color: #3d4958;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
}

.top-tab-item.active {
  background: #ffffff;
  font-weight: 600;
}

.top-tab-title {
  font-size: 14px;
}

.top-tab-close {
  font-size: 11px;
  color: var(--erp-color-text-secondary);
}

.top-tab-close:hover {
  color: #1677ff;
}

.jsh-header {
  background: rgba(240, 247, 255, 0.88);
  border-bottom: 1px solid rgba(20, 33, 61, 0.08);
  padding: 0 24px;
}

.jsh-content {
  padding: 24px;
}

/* Keep the ERP shell readable after the legacy page styles. */
.top-tabs { height: 38px; padding: 4px 12px 0; background: #fff; border-bottom: 1px solid #e4e7ec; }
.top-tab-item, .top-tab-home { height: 30px; border-radius: 4px 4px 0 0; }
.top-tab-item { min-width: 112px; max-width: 210px; padding: 0 9px; }
.top-tab-pin { margin-right: 5px; color: #1677ff; font-size: 8px; }
.jsh-header { height: 48px; min-height: 48px; padding: 0 18px; background: #fff; border-bottom: 1px solid #e4e7ec; }
.jsh-header-inner { min-width: 0; }
.jsh-header-title { min-width: 0; }
.jsh-header-title .ant-typography-secondary { display: none; }
.jsh-header-inner > .ant-space { flex-shrink: 0; }
.jsh-header-inner > .ant-space > .ant-btn { height: 30px; padding-inline: 9px; }
.jsh-header-title .ant-typography { font-size: 16px; }
.jsh-content { padding: 18px; background: #f4f6f8; }
.jsh-content .page-card,
.jsh-content .dash-head-card,
.jsh-content .dash-metric-card,
.jsh-content .dash-chart-card,
.jsh-content .list-toolbar-sticky,
.jsh-content .sticky-action-bar {
  background: #fff;
  backdrop-filter: none;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
}

/* Final compact ERP overrides. Keep these last because this stylesheet contains legacy theme layers. */
.jsh-header .jsh-context-title {
  color: #344054;
  font-size: 15px;
  font-weight: 600;
}

.jsh-header .jsh-user-button {
  height: 32px;
  padding-inline: 4px;
}

.page-shell {
  width: 100%;
  min-width: 0;
}

.module-page-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.module-page-heading .ant-typography-secondary {
  font-size: 12px;
}

.list-toolbar-sticky {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding-bottom: 8px;
  background: linear-gradient(180deg, rgba(250, 253, 255, 0.96), rgba(250, 253, 255, 0.84));
  backdrop-filter: blur(6px);
}

.list-toolbar-sticky .module-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  min-width: 0;
}

.list-toolbar-sticky .module-filter-row > * {
  width: 100%;
  min-width: 0;
}

.list-toolbar-sticky .module-toolbar-actions {
  justify-content: flex-end;
  align-items: center;
  white-space: nowrap;
}

/* Document summaries are bottom-affordances, not the shell's top toolbars. */
.sticky-action-bar.sales-bottom-summary,
.sticky-action-bar.doc-bottom-summary {
  position: fixed;
  right: 16px;
  left: 80px;
  top: auto;
  bottom: 10px;
}

@media (max-width: 960px) {
  .sticky-action-bar.sales-bottom-summary,
  .sticky-action-bar.doc-bottom-summary {
    left: 100px;
  }
}

@media (min-width: 1280px) {
  .sticky-action-bar.sales-bottom-summary,
  .sticky-action-bar.purchase-bottom-summary,
  .sticky-action-bar.sales-return-bottom-summary,
  .sticky-action-bar.purchase-return-bottom-summary { display: none; }
}

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

.page-header-copy h1 {
  margin: 0;
  color: #1d2939;
  font-size: 22px;
  line-height: 1.35;
}

.page-header-subtitle {
  margin-top: 4px;
  color: #5f6b7a;
  font-size: 13px;
}

.page-header-extra {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sticky-action-bar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 7px 12px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dfe4ea;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
  backdrop-filter: blur(8px);
}

@media (max-width: 960px) {
  .page-header,
  .sticky-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header-extra {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .list-toolbar-sticky {
    grid-template-columns: 1fr;
  }

  .list-toolbar-sticky .module-toolbar-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.xiao-k-float .ant-float-btn-body {
  overflow: hidden;
}

.xiao-k-float {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.xiao-k-float-dragging {
  cursor: grabbing;
  transition: none !important;
}

.xiao-k-float .ant-float-btn-content {
  align-items: center;
  justify-content: center;
}

.xiao-k-float .ant-float-btn-icon {
  display: flex;
  width: 32px;
  height: 32px;
  margin: 0;
  align-items: center;
  justify-content: center;
}

.xiao-k-float-icon {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

/* Keep the desktop shell quiet and reserve vertical space for work. */
.jsh-header {
  height: 38px;
  min-height: 38px;
  padding: 0 14px;
}

.jsh-header .jsh-header-inner > .ant-space {
  margin-left: auto;
}

/* The page heading is intentionally available to assistive technology only; content owns the visible title. */
.jsh-header .jsh-context-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.jsh-content {
  padding: 16px;
}

.jsh-content .page-card,
.jsh-content .dash-head-card,
.jsh-content .dash-metric-card,
.jsh-content .dash-chart-card,
.jsh-content .list-toolbar-sticky {
  box-shadow: none;
}

.module-page-heading {
  margin-bottom: 10px;
}

.module-page-heading .ant-typography.ant-typography-h3 {
  color: #1d2939;
  font-size: var(--erp-font-size-page);
  line-height: 1.3;
}

@media (max-width: 1200px) {
  .jsh-content { padding: 12px; }
}

/* Final ERP navigation contract: the rail never changes width on hover/focus. */
.jsh-shell {
  background: var(--erp-color-workspace);
}

.jsh-sider {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: var(--erp-navigation-wide);
  flex: 0 0 var(--erp-navigation-wide);
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  color: var(--erp-color-text);
  background: var(--erp-color-surface);
  border-right: 1px solid var(--erp-color-divider);
}

.jsh-sider.jsh-sider-compact {
  width: var(--erp-navigation-compact);
  flex-basis: var(--erp-navigation-compact);
}

.jsh-sider .brand-mark {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  min-height: var(--erp-application-bar-height);
  flex: 0 0 var(--erp-application-bar-height);
  flex-direction: column;
  gap: 2px;
  padding: 7px 16px;
  overflow: hidden;
  color: #1d2939;
  border-bottom: 1px solid var(--erp-color-divider);
}

.jsh-sider .brand-mark strong {
  color: inherit;
  font-size: 15px;
  line-height: 18px;
  letter-spacing: 0;
  white-space: nowrap;
}

.jsh-sider .brand-mark span {
  overflow: hidden;
  color: var(--erp-color-text-secondary);
  font-size: 11px;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-nav {
  flex: 0 0 auto;
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--erp-color-divider);
}

.workspace-nav-item {
  box-sizing: border-box;
  width: 100%;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  color: #475467;
  background: transparent;
  cursor: pointer;
  text-align: center;
}

.workspace-nav-item:hover,
.workspace-nav-item.active,
.workspace-nav-item:focus-visible {
  color: var(--erp-color-primary);
  background: var(--erp-color-primary-soft);
}

.workspace-nav-icon,
.group-nav-icon {
  line-height: 1;
}

.workspace-nav-icon { font-size: 21px; }
.workspace-nav-label { font-size: 13px; white-space: nowrap; }

.sider-navigation-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.group-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}

.group-nav-item {
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  color: #475467;
  background: transparent;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}

.group-nav-item:hover {
  color: #344054;
  background: var(--erp-color-surface-muted);
}

.group-nav-item.expanded {
  color: var(--erp-color-primary);
  background: #e6f4ff;
  box-shadow: inset 3px 0 0 var(--erp-color-primary);
}

.group-nav-item.active {
  color: var(--erp-color-primary);
  background: var(--erp-color-primary-soft);
  font-weight: 600;
}

.group-nav-item:focus-visible,
.workspace-nav-item:focus-visible,
.mega-item:focus-visible,
.mega-section-item:focus-visible {
  outline: 2px solid var(--erp-color-focus);
  outline-offset: -2px;
}

.group-nav-icon {
  display: inline-flex;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.group-nav-label {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jsh-sider.jsh-sider-compact .brand-mark {
  align-items: center;
  justify-content: center;
  padding: 11px 8px;
}

.jsh-sider.jsh-sider-compact .brand-mark strong,
.jsh-sider.jsh-sider-compact .brand-mark span,
.jsh-sider.jsh-sider-compact .workspace-nav-label,
.jsh-sider.jsh-sider-compact .group-nav-label {
  display: none;
}

.jsh-sider.jsh-sider-compact .brand-mark::before {
  content: '凯';
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--erp-color-primary);
  background: var(--erp-color-primary-soft);
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
}

.jsh-sider.jsh-sider-compact .workspace-nav-item,
.jsh-sider.jsh-sider-compact .group-nav-item {
  justify-content: center;
  padding: 0;
}

.sider-navigation-footer {
  display: flex;
  min-height: 48px;
  flex: 0 0 48px;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 8px;
  border-top: 1px solid var(--erp-color-divider);
}

.sider-navigation-toggle {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  color: var(--erp-color-text-secondary);
}

.jsh-sider.jsh-sider-compact .sider-navigation-footer {
  justify-content: center;
  padding-inline: 4px;
}

.jsh-main {
  width: calc(100% - var(--erp-navigation-wide));
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--erp-navigation-wide);
  flex: 0 0 calc(100% - var(--erp-navigation-wide));
}

.jsh-sider.jsh-sider-compact ~ .jsh-main {
  width: calc(100% - var(--erp-navigation-compact));
  margin-left: var(--erp-navigation-compact);
  flex-basis: calc(100% - var(--erp-navigation-compact));
}

.mega-panel {
  position: fixed;
  top: calc(var(--erp-application-bar-height) + 8px);
  left: calc(var(--erp-navigation-wide));
  z-index: 60;
  display: block;
  width: min(760px, calc(100vw - var(--erp-navigation-wide) - 16px));
  max-width: calc(100vw - var(--erp-navigation-wide));
  max-height: calc(100vh - var(--erp-application-bar-height) - 16px);
  padding: 14px 0 8px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--erp-color-surface);
  border: 1px solid var(--erp-color-divider);
  border-top: 2px solid var(--erp-color-primary);
  border-radius: 0 var(--erp-radius-control) var(--erp-radius-control) 0;
  box-shadow: var(--erp-shadow-floating);
  scrollbar-gutter: stable;
}

/* The first four groups are short direct lists. Keep their flyout compact;
   reports and settings retain the wider grouped layout below. */
.mega-panel.mega-panel-direct {
  width: min(300px, calc(100vw - var(--erp-navigation-wide) - 16px));
  max-width: calc(100vw - var(--erp-navigation-wide));
}

.jsh-sider.jsh-sider-compact ~ .mega-panel {
  left: var(--erp-navigation-compact);
  width: min(760px, calc(100vw - var(--erp-navigation-compact) - 16px));
  max-width: calc(100vw - var(--erp-navigation-compact));
}

.jsh-sider.jsh-sider-compact ~ .mega-panel.mega-panel-direct {
  width: min(300px, calc(100vw - var(--erp-navigation-compact) - 16px));
  max-width: calc(100vw - var(--erp-navigation-compact));
}

.mega-panel-title {
  padding: 0 16px 10px;
  margin: 0;
  color: #344054;
  border-bottom: 1px solid #edf0f3;
}

.mega-direct-list {
  display: flex;
  flex-direction: column;
  padding: 6px 8px 0;
}

.mega-direct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  border-bottom: 1px solid #f0f2f5;
}

.mega-direct-row:last-child { border-bottom: 0; }

.mega-item {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 0;
  border-radius: 4px;
  color: #344054;
  background: transparent;
  font-size: 14px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.mega-direct-row .mega-item {
  min-width: 0;
  flex: 1;
  padding: 9px 8px;
}

.mega-item:hover,
.mega-item.active,
.mega-section-item:hover,
.mega-section-item.active {
  color: var(--erp-color-primary);
  background: var(--erp-color-primary-soft);
}

.mega-item.active,
.mega-section-item.active { font-weight: 600; }

.mega-create-button {
  min-width: 54px;
  flex: 0 0 auto;
  margin-right: 4px;
}

.mega-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 0;
  padding: 6px 8px 8px;
}

.mega-section-column {
  min-width: 0;
  padding: 8px 14px 12px;
  border-right: 1px solid #edf0f3;
}

.mega-section-column:last-child { border-right: 0; }

.mega-section-title {
  margin-bottom: 8px;
  color: #5f6b7a;
  font-size: 13px;
  font-weight: 600;
}

.mega-section-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mega-section-item {
  min-height: 34px;
  padding: 7px 8px;
  border: 0;
  border-radius: 4px;
  color: #344054;
  background: transparent;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.application-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  height: var(--erp-application-bar-height);
  min-width: 0;
  gap: 4px;
  padding: 0 10px;
  background: var(--erp-color-surface);
  border-bottom: 1px solid var(--erp-color-divider);
}

.application-nav-toggle {
  flex: 0 0 auto;
}

.application-workspace-context {
  display: inline-flex;
  align-items: center;
  min-width: 52px;
  max-width: 96px;
  height: 32px;
  padding: 0 8px;
  overflow: hidden;
  color: var(--erp-color-text);
  border-right: 1px solid var(--erp-color-divider);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.application-bar .top-tab-home,
.application-bar .top-tab-item {
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
}

.application-bar .top-tab-home {
  width: 32px;
}

.application-bar .top-tab-item {
  min-width: 84px;
  max-width: 176px;
  padding: 0 8px;
}

.application-bar .top-tab-home:hover,
.application-bar .top-tab-item:hover,
.application-bar .top-tab-home.active,
.application-bar .top-tab-item.active {
  color: var(--erp-color-primary);
  background: var(--erp-color-primary-soft);
}

.application-bar .top-tab-list {
  min-width: 72px;
  max-width: 44%;
  flex: 1 1 auto;
  gap: 2px;
}

.application-command-trigger {
  display: flex;
  align-items: center;
  min-width: min(260px, 26vw);
  height: 32px;
  gap: 8px;
  padding: 0 9px;
  color: var(--erp-color-text-secondary);
  background: var(--erp-color-surface-muted);
  border: 1px solid var(--erp-color-divider);
  border-radius: 4px;
  cursor: pointer;
}

.application-command-trigger span {
  flex: 1;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.application-command-trigger kbd {
  color: var(--erp-color-text-secondary);
  font-family: inherit;
  font-size: 11px;
}

.application-command-trigger:hover {
  color: var(--erp-color-primary);
  border-color: #91caff;
}

.application-user-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 150px;
  padding-inline: 7px;
}

.employee-workspace-button,
.employee-workspace-label {
  flex: 0 1 auto;
  max-width: 152px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-workspace-label {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding-inline: 8px;
  color: var(--erp-color-text);
  font-size: 14px;
  font-weight: 600;
}

.application-user-button span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.application-user-button .ant-avatar {
  flex: 0 0 auto;
  background: #e6f4ff;
  color: #0958d9;
}

.jsh-content {
  padding: 16px;
  background: var(--erp-color-workspace);
}

.global-command-palette .ant-modal-content {
  padding: 12px;
  border-radius: var(--erp-radius-control);
}

.global-command-palette .ant-input-affix-wrapper {
  height: 42px;
  border-radius: 4px;
}

.global-command-esc {
  padding: 1px 6px;
  color: var(--erp-color-text-secondary);
  background: var(--erp-color-surface-muted);
  border: 1px solid var(--erp-color-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
}

.global-command-results {
  max-height: min(65vh, 600px);
  padding-top: 8px;
  overflow-y: auto;
}

.global-command-group + .global-command-group {
  margin-top: 12px;
}

.global-command-search-warning {
  display: block;
  padding: 6px 8px;
  color: var(--erp-color-warning);
  font-size: 12px;
}

.global-command-searching {
  display: block;
  padding: 6px 8px;
  color: var(--erp-color-text-secondary);
  font-size: 12px;
}

.global-command-group-title {
  display: block;
  padding: 3px 8px 6px;
  color: var(--erp-color-text-secondary);
  font-size: 12px;
}

.global-command-group button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 8px;
  color: var(--erp-color-text);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
}

.global-command-group button:hover,
.global-command-group button.active {
  background: var(--erp-color-primary-soft);
}

.global-command-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: var(--erp-color-primary);
  background: #e6f4ff;
  border-radius: 4px;
}

.global-command-copy { display: grid; min-width: 0; gap: 1px; }
.global-command-copy strong, .global-command-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-command-copy small { color: var(--erp-color-text-secondary); font-size: 12px; }

@media (max-width: 1100px) {
  .application-command-trigger { min-width: 32px; }
  .application-command-trigger span,
  .application-command-trigger kbd,
  .application-user-button span:last-child { display: none; }
  .application-bar .top-tab-list { max-width: none; }
}

@media (max-width: 720px) {
  .application-bar { padding-inline: 6px; }
  .application-bar .top-tab-list { display: none; }
  .application-command-trigger { flex: 1; }
}
.product-form-tabs {
  min-height: 430px;
}

.product-form-tabs .ant-tabs-content {
  padding-top: 8px;
}

.product-form-tabs .toolbar-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-form-tabs .toolbar-row > * {
  min-width: 0;
}

.product-form-tabs .ant-form-item {
  margin-bottom: 14px;
}

.toolbar-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-row > * {
  min-width: 180px;
}

.reports-page-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.reports-page-heading .ant-typography-secondary {
  color: #5f6b7a;
  font-size: 12px;
}

.reports-summary-strip {
  margin-bottom: 2px;
}

.report-summary-card {
  padding: 10px 14px;
}

.report-summary-card .ant-card-body {
  padding: 12px 14px;
}

.report-summary-card .ant-statistic-title {
  margin-bottom: 2px;
  color: #5f6b7a;
  font-size: 11px;
}

.report-summary-card .ant-statistic-content {
  font-size: 18px;
}

.reports-tabs {
  margin-bottom: 4px;
}

.reports-tabs .ant-tabs-nav-list {
  flex-wrap: nowrap;
}

.reports-tabs .ant-tabs-nav-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
}

.reports-filter-toolbar {
  width: 100%;
  padding: 8px 0 2px;
  border-top: 1px solid #edf0f3;
}

.reports-filter-toolbar .ant-input {
  width: min(320px, 100%);
}

@media (max-width: 640px) {
  .product-form-tabs {
    min-height: 0;
  }

  .product-form-tabs .toolbar-row {
    grid-template-columns: 1fr;
  }
}

/* Total-debt analysis workbench, moved out of the global stylesheet. */
.debt-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.debt-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.debt-stat-grid .ant-statistic {
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.debt-treemap {
  position: relative;
  width: 100%;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
}

.debt-treemap-cell {
  position: absolute;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  padding: 10px;
  border: 2px solid #ffffff;
  color: #ffffff;
  overflow: hidden;
}

.debt-treemap-cell strong,
.debt-treemap-cell span,
.debt-treemap-cell em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
}

.debt-treemap-cell strong {
  font-size: 15px;
}

.debt-treemap-cell span {
  font-size: 13px;
}

.debt-treemap-cell em {
  font-size: 12px;
  font-style: normal;
  opacity: 0.86;
}

.debt-row-high > td {
  background: #fff1f0 !important;
}

.debt-row-medium > td {
  background: #fffbe6 !important;
}
/* A / L2 / E2 desktop ERP presentation. Business controls remain in their forms. */
.jsh-shell {
  --erp-navigation-wide: 208px;
  --erp-color-workspace: #f3f6fa;
  --erp-color-primary: #2563eb;
  --erp-color-primary-soft: #edf3ff;
  background: #f3f6fa;
}
.jsh-shell .jsh-sider { background: #101b36; border-right: 0; color: #c4d1e7; }
.jsh-shell .jsh-sider .brand-mark { padding: 20px 22px; min-height: 92px; border-color: #26334e; color: #fff; }
.jsh-shell .jsh-sider .brand-mark strong { font-size: 23px; line-height: 30px; }
.jsh-shell .jsh-sider .brand-mark span { color: #a7b7d2; }
.jsh-shell .jsh-sider :is(.group-nav-item,.workspace-nav-item) { color: #c4d1e7; background: transparent; border-radius: 8px; min-height: 44px; margin-block: 5px; }
.jsh-shell .jsh-sider :is(.group-nav-item,.workspace-nav-item):hover { background: #203254; color: #fff; }
.jsh-shell .jsh-sider :is(.group-nav-item,.workspace-nav-item).active { background: #2563eb; color: #fff; }
.jsh-shell .jsh-sider :is(.group-nav-icon,.workspace-nav-icon) { color: inherit; }
.jsh-shell .sider-navigation-footer { border-color: #26334e; }
.jsh-shell .sider-navigation-toggle { color: #c4d1e7; }
.jsh-shell .application-bar { background: #fff; border-color: #e5eaf1; }
.jsh-shell .top-tab-item.active { color: #2563eb; background: #edf3ff; border-radius: 6px 6px 0 0; }
.jsh-shell .jsh-content { padding: 24px; background: #f3f6fa; }
.jsh-shell :is(.page-card,.doc-section-card,.module-record-preview) { background: #fff; border: 1px solid #e8edf4; border-radius: 12px; box-shadow: none; }
.jsh-shell .module-page-heading { margin-bottom: 16px; }
.jsh-shell .list-toolbar-sticky { grid-template-columns: 1fr; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid #edf1f6; }
.jsh-shell .module-toolbar-actions { flex-wrap: wrap; white-space: normal; }
.jsh-shell .module-master-detail-workspace { gap: 8px; }
.jsh-shell .module-record-preview-header { background: #fff; border-bottom: 1px solid #edf1f6; padding: 18px; }
.jsh-shell .module-record-preview-body { padding: 18px; }
.jsh-shell .ant-table-thead > tr > th { background: #f5f7fb; color: #64748b; font-weight: 500; }
.jsh-shell .ant-table-tbody > tr > td { border-color: #edf1f6; }
.jsh-shell .module-table-row-selected > td { background: #edf3ff !important; }
.jsh-shell .doc-toolbar-card { background: transparent; border: 0; }
.jsh-shell .doc-toolbar-card > .ant-card-body { padding: 0 0 8px; }
.jsh-shell .doc-section-card .ant-card-head { min-height: 52px; border-bottom: 1px solid #edf1f6; padding: 0 20px; }
.jsh-shell .doc-section-card .ant-card-head-title { font-size: 16px; }
.jsh-shell .doc-section-card .ant-card-body { padding: 20px; }
.jsh-shell .doc-form { gap: 18px; }
.jsh-shell :is(.doc-head-grid,.doc-amount-grid) { gap: 14px 18px; border: 0; background: transparent; grid-template-columns: repeat(3,minmax(0,1fr)); }
.jsh-shell :is(.doc-head-grid,.doc-amount-grid) .ant-form-item { border: 0; min-width: 0; }
.jsh-shell :is(.doc-head-grid,.doc-amount-grid) .ant-form-item-row { display: flex; flex-direction: column; min-height: 0; }
.jsh-shell :is(.doc-head-grid,.doc-amount-grid) .ant-form-item-label { justify-content: flex-start; background: transparent; border: 0; padding-bottom: 7px !important; }
.jsh-shell :is(.doc-head-grid,.doc-amount-grid) .ant-form-item-label > label { width: auto; justify-content: flex-start; color: #64748b; font-size: 12px; }
.jsh-shell :is(.doc-head-grid,.doc-amount-grid) .ant-form-item-control { padding: 0; }
.jsh-shell :is(.sales-settlement-rail,.purchase-settlement-rail,.return-settlement-rail) .doc-amount-grid { grid-template-columns: 1fr; }
.jsh-shell :is(.sales-rail-amount,.purchase-rail-amount,.return-rail-amount) { border-radius: 8px; background: #edf3ff; padding: 18px; }
.jsh-shell :is(.sales-rail-amount,.purchase-rail-amount,.return-rail-amount) strong { color: #2563eb; font-size: 30px; }
.jsh-shell :is(.sales-bottom-summary,.purchase-bottom-summary,.sales-return-bottom-summary,.purchase-return-bottom-summary,.doc-bottom-summary) { display: flex; position: sticky; bottom: 0; z-index: 20; background: #fff; padding: 16px 20px; border: 1px solid #e5eaf1; border-radius: 10px; box-shadow: 0 -4px 16px #17203308; flex-wrap: wrap; gap: 12px; }
/* The existing workspace wrapper is transparent to the form grid: the rail
   spans both header and item rows without moving or remounting any fields. */
@media (min-width: 1280px) {
  .jsh-shell .doc-form:has(> :is(.sales-document-workspace,.purchase-document-workspace,.return-document-workspace)) { display: grid; grid-template-columns: minmax(0,1fr) 320px; align-items: start; }
  .jsh-shell .doc-form > :is(.sales-document-workspace,.purchase-document-workspace,.return-document-workspace) { display: contents; }
  .jsh-shell .doc-form > .doc-section-card { grid-column: 1; min-width: 0; }
  .jsh-shell :is(.sales-items-card,.purchase-items-card,.return-items-card) { grid-column: 1; min-width: 0; }
  .jsh-shell :is(.sales-settlement-rail,.purchase-settlement-rail,.return-settlement-rail) { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: 66px; min-width: 0; }
  .jsh-shell :is(.sales-rail-actions,.purchase-rail-actions,.return-rail-actions) { display: none; }
}
.erp-entry-workspace { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 20px; align-items: start; }
.erp-entry-main { min-width: 0; }
.erp-entry-summary { position: sticky; top: 68px; padding: 22px; border: 1px solid #e5eaf1; border-radius: 12px; background: #fff; }
.erp-entry-summary h3 { margin: 0 0 22px; font-size: 17px; }
.erp-entry-summary dl { margin: 0; }
.erp-entry-summary dl > div { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0; }
.erp-entry-summary dt { color: #64748b; }
.erp-entry-summary dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.erp-entry-summary .erp-entry-total { padding: 16px; background: #edf3ff; border-radius: 8px; display: grid; gap: 10px; }
.erp-entry-total strong { color: #2563eb; font-size: 28px; }
.erp-entry-main > .ant-space { flex-wrap: wrap; }
.erp-entry-modal .ant-modal-body { max-height: 72vh; overflow-y: auto; }
.erp-entry-workspace > .erp-entry-main > .finance-entry-form { display: block; }
.jsh-shell .finance-entry-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
/* A dashboard: overview first; tasks and shortcuts remain permission-aware. */
.jsh-shell .dashboard-page { padding: 0; background: transparent; gap: 22px; }
.jsh-shell .dashboard-page .task-console { gap: 20px; }
.jsh-shell .dashboard-page :is(.task-console-section,.task-overview-chart,.dash-metric-card) { border-radius: 12px; border-color: #e8edf4; }
.jsh-shell .dashboard-page .task-console-title { font-size: 26px; color: #1e293b; font-weight: 700; }
.jsh-shell .dashboard-page .task-console-date { display: block; color: #64748b; }
.jsh-shell .dashboard-page .dash-metric-grid { gap: 18px; }
.jsh-shell .dashboard-page .dash-metric-card { padding: 22px; min-height: 140px; }
.jsh-shell .dashboard-page .dash-metric-value { color: #1e293b; font-weight: 650; font-size: clamp(22px,2vw,32px); font-variant-numeric: tabular-nums; }
.jsh-shell .dashboard-page .task-console-overview { background: transparent; }
.jsh-shell .dashboard-page .task-console-overview > .task-console-section-head { border: 0; background: transparent; padding: 0 0 16px; }
.jsh-shell .dashboard-page .task-overview-chart { margin-top: 20px; }
.jsh-shell .dashboard-page .task-command-list { gap: 12px; padding: 16px; }
.jsh-shell .dashboard-page .task-command-list button { border: 1px solid #edf1f6; border-radius: 8px; }
.jsh-shell .dashboard-page .task-console-columns { gap: 20px; }
@media (max-width: 1279px) {
  .erp-entry-workspace { grid-template-columns: 1fr; }
  .erp-entry-summary { position: static; }
  .jsh-shell :is(.sales-rail-amount,.purchase-rail-amount,.return-rail-amount) { display: block; }
}
@media (max-width: 960px) {
  .jsh-shell .jsh-content { padding: 12px; }
  .jsh-shell :is(.doc-head-grid,.doc-amount-grid) { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .jsh-shell :is(.doc-head-grid,.doc-amount-grid,.finance-entry-form) { grid-template-columns: 1fr; }
}
.jsh-shell .erp-finance-form { display: block; }
.erp-entry-main > .doc-section-card + .doc-section-card { margin-top: 18px; }
.erp-entry-main > .ant-space-horizontal { display: flex; flex-wrap: wrap; }
.erp-entry-main > .ant-space-horizontal > .ant-space-item { flex: 1 1 200px; min-width: 0; }
.erp-entry-main > .ant-space-horizontal .ant-form-item { min-width: 0 !important; }
.jsh-shell .dashboard-page .task-console:has(.task-console-overview) { display: grid; grid-template-columns: minmax(0,1fr); align-items: start; }
.jsh-shell .dashboard-page .task-console-overview { display: contents; }
.jsh-shell .dashboard-page .task-console-overview > .task-console-section-head { grid-row: 1; padding: 0; }
.jsh-shell .dashboard-page .dash-metric-grid { grid-row: 2; }
.jsh-shell .dashboard-page .task-console:has(.task-console-overview) .task-console-commands { grid-row: 3; }
.jsh-shell .dashboard-page .task-overview-chart { grid-row: 4; margin-top: 0; min-width: 0; }
.jsh-shell .dashboard-page .task-console:has(.task-console-overview) .task-console-columns { grid-row: 5; }
@media (min-width: 1440px) {
  .jsh-shell .dashboard-page .task-console:has(.task-console-overview) { display: grid; grid-template-columns: minmax(0,1fr) 360px; align-items: start; }
  .jsh-shell .dashboard-page .task-console:has(.task-console-overview) :is(.task-console-overview,.task-console-columns) { display: contents; }
  .jsh-shell .dashboard-page .task-console-overview > .task-console-section-head { grid-column: 1 / -1; grid-row: 1; padding: 0; }
  .jsh-shell .dashboard-page .dash-metric-grid { grid-column: 1 / -1; grid-row: 2; }
  .jsh-shell .dashboard-page .task-overview-chart { grid-column: 1; grid-row: 4; margin-top: 0; min-width: 0; }
  .jsh-shell .dashboard-page .task-console:has(.task-console-overview) .task-console-priority { grid-column: 2; grid-row: 4; max-height: 640px; overflow-y: auto; }
  .jsh-shell .dashboard-page .task-console:has(.task-console-overview) .task-console-commands { grid-column: 1 / -1; grid-row: 3; }
  .jsh-shell .dashboard-page .task-console:has(.task-console-overview) .task-console-summary { grid-column: 1; grid-row: 5; }
  .jsh-shell .dashboard-page .task-console:has(.task-console-overview) .task-console-views { grid-column: 2; grid-row: 5; }
}
.jsh-shell .doc-head-grid :is(.ant-input,.ant-input-number,.ant-select-selector,.ant-input-affix-wrapper) { border: 1px solid #d7dfea !important; border-radius: 6px !important; background: #fff; }
.jsh-shell .doc-head-grid .ant-input-affix-wrapper > .ant-input { border: 0 !important; }
.jsh-shell .doc-head-grid .ant-select { width: 100%; }
.jsh-shell .doc-head-grid .ant-input:focus { border-color: #2563eb !important; }
.jsh-shell .workspace-nav-item { flex-direction: row; justify-content: flex-start; gap: 12px; padding-inline: 16px; }
@media (min-width:1280px) {
  .jsh-shell :is(.sales-settlement-rail,.purchase-settlement-rail,.return-settlement-rail) { max-height: calc(100vh - 168px); overflow-y: auto; scrollbar-gutter: stable; }
  .jsh-shell :is(.sales-rail-summary,.purchase-rail-summary,.return-rail-summary) { gap: 4px; margin-block: 10px; padding-block: 8px; }
}
.jsh-shell .module-master-detail-workspace { align-items: start; background: transparent; border: 0; min-height: 0; }
.jsh-shell .module-master-detail-workspace .module-list-surface { border: 1px solid #e8edf4; border-radius: 12px; }
.jsh-shell .module-preview-resizer { align-self: stretch; }
.jsh-shell .module-record-preview { position: sticky; top: 66px; max-height: calc(100vh - 90px); overflow: hidden; }
.jsh-shell .module-record-preview-header { flex-direction: column; align-items: stretch; }
.jsh-shell .module-record-preview-title { width: 100%; }
.jsh-shell .module-record-preview-actions { justify-content: flex-end; }
.jsh-shell .module-record-preview-body { flex: 1; min-height: 0; overflow: auto; }
.jsh-shell .module-record-preview .document-detail-title-row { flex-wrap: wrap; }
.jsh-shell .module-record-preview .document-detail-title-row > .ant-typography { white-space: nowrap; }
.jsh-shell .module-filter-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
.jsh-shell .module-filter-row > * { grid-column: auto; }
.erp-finance-form .erp-entry-main { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 18px; }
.erp-finance-form .erp-entry-main > :is(.ant-space,.ant-btn) { grid-column: 1 / -1; }
.erp-finance-form .erp-entry-main > .ant-form-item:has(textarea) { grid-column: 1 / -1; }
.erp-finance-form .erp-entry-main > .ant-btn { justify-self: end; }
@media (max-width:960px) {
  .erp-finance-form .erp-entry-main { grid-template-columns: 1fr; }
}
.erp-master-data-select { display: flex; align-items: center; gap: 4px; min-width: 0; width: 100%; position: relative; }
.erp-master-data-select > .ant-btn { flex: 0 0 auto; }
.erp-picker-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.erp-picker-toolbar .ant-input { flex: 1; }
.erp-picker-footer { display: flex; justify-content: flex-end; padding-top: 12px; }
.erp-quick-picker-footer { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px 4px; border-top: 1px solid #edf1f6; }
.erp-master-data-search-trigger { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; color: #718096; cursor: pointer; border-radius: 4px; }
.erp-master-data-search-trigger:hover, .erp-master-data-search-trigger:focus-visible { color: #1677ff; background: #edf5ff; outline: none; }
.erp-master-data-select .ant-select-arrow { pointer-events: auto; }
.erp-master-data-select .ant-select { width: 100%; }
