* {
  box-sizing: border-box;
}

/* 仅读屏可见，用于保留无障标题又不在版心重复显示 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(120deg, #121b36 0%, #15274f 40%, #1a2f63 100%);
  color: #e8eefb;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background:
    radial-gradient(circle at 12% 22%, rgba(255, 160, 220, 0.28) 0%, rgba(255, 160, 220, 0) 36%),
    radial-gradient(circle at 84% 18%, rgba(117, 214, 255, 0.24) 0%, rgba(117, 214, 255, 0) 34%),
    radial-gradient(circle at 45% 82%, rgba(166, 255, 176, 0.2) 0%, rgba(166, 255, 176, 0) 34%);
  animation: bgFloat 18s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  right: -120px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(114, 198, 255, 0.3) 0%, rgba(114, 198, 255, 0) 70%);
  filter: blur(10px);
  pointer-events: none;
  animation: blobDrift 14s ease-in-out infinite;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

.app-shell::before {
  content: "";
  position: fixed;
  left: -140px;
  bottom: -140px;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 208, 116, 0.24) 0%, rgba(255, 208, 116, 0) 72%);
  filter: blur(14px);
  pointer-events: none;
  animation: blobDriftReverse 16s ease-in-out infinite;
}

.sidebar {
  width: fit-content;
  max-width: min(320px, 46vw);
  min-width: 0;
  background: rgba(9, 16, 29, 0.88);
  backdrop-filter: blur(8px);
  border-right: 1px solid rgba(97, 136, 255, 0.25);
  color: #fff;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  z-index: 1;
  align-items: flex-start;
}

.sidebar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-head .profile-menu {
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.sidebar a {
  text-decoration: none;
  color: #cfe0ff;
  padding: 10px;
  padding-inline-end: calc(10px + 1em);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
}

/* Emoji 与中文分栏，避免彩色 emoji 字重/基线与标题文字不一致造成「错位」观感 */
.sidebar a .sidebar-nav-icon {
  flex: 0 0 auto;
  width: 1.35em;
  text-align: center;
  line-height: 1;
  font-size: 1.08em;
}

.sidebar a .sidebar-nav-text {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.sidebar a:hover {
  background: rgba(60, 96, 170, 0.28);
  border-color: rgba(120, 170, 255, 0.35);
}

.sidebar a.active {
  background: linear-gradient(135deg, #1d8bff, #625bff);
  color: #fff;
  box-shadow: 0 6px 18px rgba(30, 106, 255, 0.4);
}

.sidebar-group {
  margin: 0;
}

.sidebar-group summary {
  list-style: none;
  color: #cfe0ff;
  padding: 10px;
  padding-inline-end: calc(10px + 1em);
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
}

.sidebar-group summary::-webkit-details-marker {
  display: none;
}

.sidebar-group summary::after {
  content: "▸";
  float: right;
  color: #88acff;
  transition: transform 0.2s ease;
}

.sidebar-group[open] summary::after {
  transform: rotate(90deg);
}

.sidebar-group summary:hover {
  background: rgba(60, 96, 170, 0.28);
  border-color: rgba(120, 170, 255, 0.35);
}

.sidebar-submenu {
  margin-top: 4px;
  padding-left: 14px;
  display: grid;
  gap: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: #ff4d4f;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.main-panel {
  flex: 1;
  padding: 24px;
  width: 100%;
  min-width: 0;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.shell-main-panel {
  padding: 0;
}

.shell-content {
  width: 100%;
  min-height: 100vh;
  padding: 24px;
  display: block;
  background: transparent;
  animation: shellFadeIn 0.16s ease-out;
}

body.embedded-mode .sidebar {
  display: none !important;
}

body.embedded-mode .main-panel {
  padding: 16px;
}

/* 信息管理内嵌页：外层已有顶栏与个人中心，子页不再重复展示 */
body.embedded-mode .profile-menu {
  display: none !important;
}

/* 信息管理 iframe：外层 Tab 已标明模块，隐藏子页顶栏（大标题等） */
body.embedded-mode .list-page-root > .topbar {
  display: none !important;
}

.info-management-tabs {
  margin-bottom: 12px;
}

.info-management-embed-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: min(70vh, 720px);
}

.info-embed-frame {
  width: 100%;
  min-height: min(70vh, 720px);
  height: calc(100vh - 220px);
  border: none;
  border-radius: 8px;
  background: transparent;
  display: block;
}

.info-embed-frame.hidden {
  display: none !important;
}

@keyframes shellFadeIn {
  from {
    opacity: 0.25;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  width: min(96vw, 560px);
  margin: 40px auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.wide {
  max-width: 900px;
}

h1 {
  margin-bottom: 4px;
}

.subtitle {
  margin-top: 0;
  color: #99afda;
}

.card {
  background: linear-gradient(145deg, rgba(24, 36, 64, 0.82), rgba(20, 31, 58, 0.78));
  border: 1px solid rgba(148, 184, 255, 0.3);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(4, 8, 18, 0.45), inset 0 1px 0 rgba(197, 214, 255, 0.08);
  animation: cardBreath 7s ease-in-out infinite;
}

/* App 主区扁平分区：与侧栏相接，区域间以分割线区分（无 .app-shell 的登录页不受影响；#dashPanelBi 保持圆角卡片） */
body:has(.app-shell) .main-panel {
  padding: 0;
}

body:has(.app-shell) .shell-content {
  padding: 0;
}

body.embedded-mode:has(.app-shell) .main-panel {
  padding: 0;
}

body:has(.app-shell) .main-panel > .topbar,
body:has(.app-shell) .main-panel > .list-page-root > .topbar {
  flex-shrink: 0;
  /* 左侧略大于右侧：与大标题相对侧栏右缘留出空隙，避免贴边 */
  padding: 14px 20px 12px 28px;
  border-bottom: 1px solid rgba(120, 160, 255, 0.42);
  background: rgba(10, 18, 36, 0.5);
}

body:has(.app-shell) .main-panel > .subtitle:not(.hidden),
body:has(.app-shell) .main-panel > .list-page-root > .subtitle:not(.hidden) {
  padding: 6px 20px 0 28px;
  margin-top: 0;
  margin-bottom: 0;
}

body:has(.app-shell) .main-panel > .dashboard-main-tabs,
body:has(.app-shell) .main-panel > .list-page-root > .dashboard-main-tabs {
  margin-top: 0;
  margin-bottom: 0;
  padding: 4px 16px 0 28px;
  border-bottom: 1px solid rgba(120, 160, 255, 0.4);
  gap: 4px;
}

body:has(.app-shell) .main-panel .info-management-tabs {
  margin-bottom: 0;
}

body:has(.app-shell) .main-panel #dashPanelTodos > .dashboard-todo-subtabs,
body:has(.app-shell) .main-panel #dashPanelReports > .dashboard-report-subtabs,
body:has(.app-shell) .main-panel .list-page-root > .dashboard-report-subtabs {
  margin-bottom: 0 !important;
  padding: 4px 16px 0 28px;
  border-bottom: 1px solid rgba(120, 160, 255, 0.4);
}

body:has(.app-shell) .main-panel .card {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(120, 165, 255, 0.48);
  box-shadow: none;
  animation: none;
  margin-bottom: 0;
}

body:has(.app-shell) .main-panel .count-create-panel {
  margin-bottom: 0;
}

body:has(.app-shell) .info-embed-frame {
  border-radius: 0;
}

#dashPanelBi .card,
#dashPanelBi article.card {
  border-radius: 12px;
  border: 1px solid rgba(148, 184, 255, 0.3);
  box-shadow: 0 10px 30px rgba(4, 8, 18, 0.45), inset 0 1px 0 rgba(197, 214, 255, 0.08);
  animation: cardBreath 7s ease-in-out infinite;
}

#dashPanelBi > .card {
  margin-bottom: 16px;
}

#dashPanelBi .dashboard-bi-side > .card,
#dashPanelBi .dashboard-map-card,
#dashPanelBi article.metric-card {
  margin-bottom: 0;
}

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px 16px;
  align-items: start;
}

/* 订单卡片：表头字段靠左排列，不占满整行栅格 */
.main-panel .card .form-grid.order-card-header-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px 24px;
  max-width: 100%;
}

.main-panel .card .form-grid.order-card-header-grid .form-item {
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  min-width: 200px;
}

.main-panel .card .form-grid.order-card-header-grid .form-item input,
.main-panel .card .form-grid.order-card-header-grid .form-item select {
  width: 220px;
  max-width: 100%;
  box-sizing: border-box;
}

.main-panel .card .form-grid.order-card-header-grid .customer-combobox-wrap .customer-combobox input[type="text"] {
  width: 220px;
  max-width: 100%;
  box-sizing: border-box;
}

.customer-combobox-wrap {
  position: relative;
}

.customer-combobox {
  position: relative;
}

.customer-suggest-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 4px 0;
  position: absolute;
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(420px, 92vw);
  top: 100%;
  z-index: 80;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(18, 28, 48, 0.98);
  border: 1px solid rgba(124, 157, 218, 0.38);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.customer-suggest-list .customer-suggest-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
}

.customer-suggest-list .customer-suggest-item:hover {
  background: rgba(85, 130, 220, 0.28);
}

body.theme-light .customer-suggest-list {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.12);
}

body.theme-light .customer-suggest-list .customer-suggest-item:hover {
  background: rgba(22, 119, 255, 0.12);
}

/* 仓库进销：出货单操作列横向排列（确认出货 / 作废） */
.so-slip-op-stack {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.so-slip-op-stack .btn-confirm-ship,
.so-slip-op-stack .secondary {
  flex-shrink: 0;
  white-space: nowrap;
}

/* 已出货：流程已完结（横向） */
.so-slip-op-ended-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.so-slip-op-ended-row .btn-flow-ended {
  flex-shrink: 0;
}

/* 售后退货列表：操作列「确认退货 / 作废」横向排列，避免竖排误触 */
.return-actions-cell {
  vertical-align: middle;
}
.return-actions-cell .return-actions-inline {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.return-actions-cell .return-actions-inline > button {
  flex-shrink: 0;
  white-space: nowrap;
}

/* 出货单查询：单行横向排列，过宽时整行左右滚动 */
.so-outbound-slip-search-bar.search-bar {
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.so-outbound-slip-search-bar.search-bar input[type="text"] {
  min-width: 6.25rem;
  flex: 0 1 7.5rem;
}
.so-outbound-slip-search-bar.search-bar .search-date-range-unified {
  flex-shrink: 0;
}

/* 出货单 Tab：按内容撑开列宽，整表至少占满容器；过宽时由外层横向滚动；保留纵向滚动 */
.so-ship-cart-panel .list-table-scroll {
  margin-top: 4px;
  overflow-x: auto;
  overflow-y: auto;
  min-height: 0;
}

/* 仓库进销：收货/拣货/出货单共一张 data-card，列表面板须为纵向 flex，.list-table-scroll 的 flex:1 才生效 */
.list-page-data-card:has(#soListPanel) > p,
.list-page-data-card:has(#soListPanel) > .dashboard-main-tabs {
  flex-shrink: 0;
}

.list-page-data-card > #soListPanel,
.list-page-data-card > #soCartPanel.so-ship-cart-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.list-page-data-card > #soListPanel > .section-head,
.list-page-data-card > #soCartPanel.so-ship-cart-panel > p,
.list-page-data-card > #soCartPanel.so-ship-cart-panel > .section-head {
  flex-shrink: 0;
}

/* 出货单 Tab：与列表页同一顶栏逻辑（左打印、右查询） */
.list-page-data-card > #soCartPanel.so-ship-cart-panel > .section-head {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.list-page-data-card > #soCartPanel.so-ship-cart-panel > .section-head .section-head-main {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
}

.list-page-data-card > #soCartPanel.so-ship-cart-panel > .section-head .search-bar {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-end;
}

.list-page-data-card > #soListPanel > .list-page-footer--with-pager,
.list-page-data-card > #soCartPanel.so-ship-cart-panel > .list-pagination-host {
  flex-shrink: 0;
}

.list-page-footer--with-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 10px;
  width: 100%;
  box-sizing: border-box;
}

.list-page-footer--with-pager .list-pagination-host {
  width: auto;
  margin-left: auto;
}

.list-page-footer-stat {
  font-size: 13px;
  flex: 1 1 auto;
  min-width: 12rem;
}
table.so-ship-slip-table {
  width: max-content;
  min-width: 100%;
  max-width: none;
}
.so-ship-slip-table th,
.so-ship-slip-table td {
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  max-width: none;
}
.so-ship-slip-table .so-slip-cart-time-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

/* 仓库进销「仓库收货 / 拣货出库」列表：隐藏类型、进出库时间、进出库操作人（详情模态中展示） */
#soListScrollArea table th.so-warehouse-list-hidden,
#soListScrollArea table td.so-warehouse-list-hidden {
  display: none !important;
}

/* 仓库进销列表：备注列自动换行，避免单行过长 */
#soListScrollArea table th.so-list-remark-col,
#soListScrollArea table td.so-list-remark-col {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 5rem;
  max-width: 14rem;
  vertical-align: middle;
  line-height: 1.45;
}

/* 采购订单列表：部分列仅在「订单号」详情中展示 */
.po-list-scroll-area table th.po-list-col-hidden,
.po-list-scroll-area table td.po-list-col-hidden {
  display: none !important;
}

/* 销售订单列表：货号/产品/金额等列仅在详情中展示 */
.sr-list-scroll-area table th.sr-list-col-hidden,
.sr-list-scroll-area table td.sr-list-col-hidden {
  display: none !important;
}

/* 拣货出库列表：已添加出货单数量 > 0 时橙色提醒 */
.so-slip-pending-qty-alert {
  color: #ff9800;
  font-weight: 600;
}

/* 合并单元格：与整表一致垂直居中；显式 <br> 仍可换行 */
.so-ship-slip-table td.so-slip-merged-vtop {
  vertical-align: middle;
  line-height: 1.45;
  white-space: nowrap;
}
.so-ship-slip-table td.so-slip-cart-time-cell.so-slip-merged-vtop {
  white-space: nowrap;
}

/* 采购订单：新建表单弹层（明细表可横向滚动，表头字段纵向堆叠便于手机） */
.po-create-modal-card.modal-card {
  width: min(920px, calc(100vw - 24px));
  max-height: min(92vh, 90vh);
  overflow-y: auto;
  box-sizing: border-box;
}

.po-create-modal-message,
.po-form-inline-message {
  min-height: 22px;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}

.po-create-modal-card .form-grid.order-card-header-grid,
.inv-flow-modal .inv-editor-modal-card .form-grid.order-card-header-grid,
.list-page-toolbar-card #purchaseOrderForm .form-grid.order-card-header-grid,
.list-page-toolbar-card #returnForm .form-grid.order-card-header-grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.po-create-modal-card .form-grid.order-card-header-grid .form-item,
.inv-flow-modal .inv-editor-modal-card .form-grid.order-card-header-grid .form-item,
.list-page-toolbar-card #purchaseOrderForm .form-grid.order-card-header-grid .form-item,
.list-page-toolbar-card #returnForm .form-grid.order-card-header-grid .form-item {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.po-create-modal-card .form-grid.order-card-header-grid .form-item input,
.po-create-modal-card .form-grid.order-card-header-grid .form-item select,
.inv-flow-modal .inv-editor-modal-card .form-grid.order-card-header-grid .form-item input,
.inv-flow-modal .inv-editor-modal-card .form-grid.order-card-header-grid .form-item select,
.list-page-toolbar-card #purchaseOrderForm .form-grid.order-card-header-grid .form-item input,
.list-page-toolbar-card #purchaseOrderForm .form-grid.order-card-header-grid .form-item select,
.list-page-toolbar-card #returnForm .form-grid.order-card-header-grid .form-item input,
.list-page-toolbar-card #returnForm .form-grid.order-card-header-grid .form-item select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.po-create-modal-card .form-grid.order-card-header-grid .customer-combobox-wrap .customer-combobox input[type="text"],
.inv-flow-modal
  .inv-editor-modal-card
  .form-grid.order-card-header-grid
  .customer-combobox-wrap
  .customer-combobox
  input[type="text"],
.list-page-toolbar-card
  #purchaseOrderForm
  .form-grid.order-card-header-grid
  .customer-combobox-wrap
  .customer-combobox
  input[type="text"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .po-create-modal-card .form-grid.order-card-header-grid,
  .inv-flow-modal .inv-editor-modal-card .form-grid.order-card-header-grid,
  .list-page-toolbar-card #purchaseOrderForm .form-grid.order-card-header-grid,
  .list-page-toolbar-card #returnForm .form-grid.order-card-header-grid {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
  }
  .po-create-modal-card .form-grid.order-card-header-grid .form-item,
  .inv-flow-modal .inv-editor-modal-card .form-grid.order-card-header-grid .form-item,
  .list-page-toolbar-card #purchaseOrderForm .form-grid.order-card-header-grid .form-item,
  .list-page-toolbar-card #returnForm .form-grid.order-card-header-grid .form-item {
    flex: 0 0 auto;
    width: max-content;
    max-width: 100%;
    min-width: 200px;
  }
  .po-create-modal-card .form-grid.order-card-header-grid .form-item input,
  .po-create-modal-card .form-grid.order-card-header-grid .form-item select,
  .inv-flow-modal .inv-editor-modal-card .form-grid.order-card-header-grid .form-item input,
  .inv-flow-modal .inv-editor-modal-card .form-grid.order-card-header-grid .form-item select,
  .list-page-toolbar-card #purchaseOrderForm .form-grid.order-card-header-grid .form-item input,
  .list-page-toolbar-card #purchaseOrderForm .form-grid.order-card-header-grid .form-item select,
  .list-page-toolbar-card #returnForm .form-grid.order-card-header-grid .form-item input,
  .list-page-toolbar-card #returnForm .form-grid.order-card-header-grid .form-item select {
    width: 220px;
    max-width: 100%;
  }
  .list-page-toolbar-card #returnForm .form-grid.order-card-header-grid .return-order-no-combo input,
  .inv-flow-modal .inv-editor-modal-card .form-grid.order-card-header-grid .return-order-no-combo input {
    width: min(360px, 100%);
    max-width: 100%;
  }
  .po-create-modal-card .form-grid.order-card-header-grid .customer-combobox-wrap .customer-combobox input[type="text"],
  .inv-flow-modal
    .inv-editor-modal-card
    .form-grid.order-card-header-grid
    .customer-combobox-wrap
    .customer-combobox
    input[type="text"],
  .list-page-toolbar-card
    #purchaseOrderForm
    .form-grid.order-card-header-grid
    .customer-combobox-wrap
    .customer-combobox
    input[type="text"] {
    width: 220px;
    max-width: 100%;
  }
}

/* 销售流水：「添加产品」子弹窗（垂直表单，便于手机；非新增/编辑主弹窗卡片） */
.sales-add-line-modal-card.modal-card:not(.inv-editor-modal-card) {
  width: min(560px, calc(100vw - 24px));
  max-height: min(92vh, 90vh);
  overflow-y: auto;
}

.sr-add-line-modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 4px;
}

.sr-add-line-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.sr-add-line-modal-field > label,
.sr-add-line-modal-field > .sr-add-line-modal-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

body.theme-light .sr-add-line-modal-field > label,
body.theme-light .sr-add-line-modal-field > .sr-add-line-modal-label {
  color: rgba(0, 0, 0, 0.65);
}

.sr-add-line-modal-field input,
.sr-add-line-modal-field select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  font-size: 16px;
}

.sr-add-line-subtotal-field .sr-add-line-subtotal-readout {
  min-height: 40px;
  display: flex;
  align-items: center;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.table-order-lines {
  border-collapse: collapse;
  width: 100%;
}

/* 新增订单卡片内：明细表略向左缩进，宽度随列内容不必横向铺满整卡 */
.order-lines-table-wrap {
  margin-left: 12px;
  margin-bottom: 10px;
  overflow-x: auto;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
}

.order-lines-table-wrap .table-order-lines {
  width: auto;
  min-width: max-content;
  table-layout: auto;
}

.order-lines-actions-row {
  margin-left: 12px;
}

.table-order-lines thead th {
  text-align: left;
  padding: 8px 10px 8px 0;
  font-weight: 600;
  color: #b8c8e8;
  white-space: nowrap;
}

body.theme-light .table-order-lines thead th {
  color: #334155;
}

.table-order-lines tbody td {
  padding: 6px 10px 6px 0;
  vertical-align: middle;
  white-space: nowrap;
}

/* 订单明细：列宽由单元格控件的当前值撑开，外层横向滚动承接长内容 */
.table-order-lines col.col-line-code {
  width: auto;
}
.table-order-lines col.col-line-name {
  width: auto;
}
.table-order-lines col.col-line-stock {
  width: auto;
}
.table-order-lines col.col-line-brand {
  width: auto;
}
.table-order-lines col.col-line-unit-tier {
  width: auto;
}
.table-order-lines col.col-line-spec {
  width: auto;
}
.table-order-lines col.col-line-qty {
  width: auto;
}
.table-order-lines col.col-line-price {
  width: auto;
}
.table-order-lines col.col-line-expire {
  width: auto;
}
.table-order-lines col.col-line-action {
  width: auto;
}
.table-order-lines select.line-spec,
.table-order-lines select.po-line-spec {
  min-width: calc(8ch + 40px);
  width: auto;
  box-sizing: border-box;
  field-sizing: content;
}
.table-order-lines select.line-unit-tier,
.table-order-lines select.po-line-unit {
  min-width: calc(5ch + 40px);
  width: auto;
  box-sizing: border-box;
  field-sizing: content;
}
.table-order-lines .line-current-stock {
  width: 100%;
  max-width: 8.5rem;
  box-sizing: border-box;
  cursor: default;
  opacity: 0.95;
}
.table-order-lines td.col-line-code input,
.table-order-lines td.col-line-name input,
.table-order-lines td.col-line-brand input {
  width: auto;
  max-width: none;
  box-sizing: border-box;
  field-sizing: content;
}
.table-order-lines td.col-line-code input {
  min-width: calc(8ch + 40px);
}
.table-order-lines td.col-line-name input {
  min-width: calc(14ch + 40px);
}
.table-order-lines td.col-line-brand input {
  min-width: calc(8ch + 40px);
}

.table-order-lines td.col-line-qty input,
.table-order-lines input.po-line-qty {
  min-width: calc(5ch + 40px);
  width: auto;
  box-sizing: border-box;
  field-sizing: content;
}

.table-order-lines td.col-line-price input,
.table-order-lines input.po-line-price {
  min-width: calc(6ch + 40px);
  width: auto;
  box-sizing: border-box;
  field-sizing: content;
}

.table-order-lines td.col-line-expire input,
.table-order-lines input.po-line-expire {
  min-width: calc(10ch + 40px);
  width: auto;
  box-sizing: border-box;
  field-sizing: content;
}

/* 订单创建卡片内明细表「数量」列：宽度为原先内联宽度的 1.5 倍（采购 100px→150px，销售 88px→132px） */
.main-panel .card.list-page-toolbar-card .table-order-lines input.po-line-qty {
  width: auto;
  min-width: calc(5ch + 40px);
  max-width: none;
  box-sizing: border-box;
}
.main-panel .card.list-page-toolbar-card .table-order-lines input.line-qty {
  width: 132px;
  max-width: 100%;
  box-sizing: border-box;
}

.form-grid > h3,
.form-grid > .subtitle {
  grid-column: 1 / -1;
  margin: 0;
}

.form-title-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.form-title-row .subtitle {
  margin: 0;
}

#createUserForm {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px 20px;
}

#createUserForm .form-item {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

#createUserForm .form-item label {
  width: auto;
  text-align: left;
}

.main-panel .card .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px 20px;
}

/* 新增退货单：与采购单同结构的明细区；表格外无圆角卡片框，沿用 order-lines-table-wrap + table-order-lines */
.list-page-toolbar-card #returnForm .return-form-actions,
.inv-flow-modal #returnForm .return-form-actions {
  margin-top: 8px;
}

.list-page-toolbar-card #returnForm .order-lines-table-wrap .return-draft-items-table,
.inv-flow-modal #returnForm .order-lines-table-wrap .return-draft-items-table {
  table-layout: auto;
}

.list-page-toolbar-card #returnForm .order-lines-table-wrap .return-draft-items-table thead th,
.inv-flow-modal #returnForm .order-lines-table-wrap .return-draft-items-table thead th {
  white-space: nowrap;
}

.list-page-toolbar-card #returnForm .order-lines-table-wrap .return-draft-items-table tbody td:nth-child(1),
.list-page-toolbar-card #returnForm .order-lines-table-wrap .return-draft-items-table tbody td:nth-child(3),
.list-page-toolbar-card #returnForm .order-lines-table-wrap .return-draft-items-table tbody td:nth-child(4),
.list-page-toolbar-card #returnForm .order-lines-table-wrap .return-draft-items-table tbody td:nth-child(6),
.inv-flow-modal #returnForm .order-lines-table-wrap .return-draft-items-table tbody td:nth-child(1),
.inv-flow-modal #returnForm .order-lines-table-wrap .return-draft-items-table tbody td:nth-child(3),
.inv-flow-modal #returnForm .order-lines-table-wrap .return-draft-items-table tbody td:nth-child(4),
.inv-flow-modal #returnForm .order-lines-table-wrap .return-draft-items-table tbody td:nth-child(6) {
  white-space: nowrap;
}

.list-page-toolbar-card #returnForm .order-lines-table-wrap .return-draft-items-table tbody td:nth-child(2),
.inv-flow-modal #returnForm .order-lines-table-wrap .return-draft-items-table tbody td:nth-child(2) {
  white-space: normal;
  min-width: 7rem;
  max-width: 36rem;
  word-break: break-word;
}

.list-page-toolbar-card #returnForm .order-lines-table-wrap .return-draft-items-table tbody td:nth-child(5),
.inv-flow-modal #returnForm .order-lines-table-wrap .return-draft-items-table tbody td:nth-child(5) {
  white-space: normal;
  min-width: 5rem;
  max-width: 20rem;
  word-break: break-word;
}

.main-panel .card .form-grid.product-form-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: 100%;
}

.main-panel .card .form-grid.product-form-grid .form-section-title {
  width: 100%;
  box-sizing: border-box;
  margin: 4px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e6edff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.main-panel .card .form-grid.product-form-grid .form-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 10px 16px;
  width: 100%;
  max-width: 100%;
}

.main-panel .card .form-grid.product-form-grid .form-row .form-item {
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  align-items: flex-start;
}

.main-panel .card .form-grid.product-form-grid .form-item input,
.main-panel .card .form-grid.product-form-grid .form-item select {
  width: 200px;
  max-width: 100%;
  flex: none;
  box-sizing: border-box;
}

.main-panel .card .form-grid.product-form-grid .form-item .customer-combobox-wrap {
  width: 200px;
  max-width: 100%;
}

.main-panel .card .form-grid.product-form-grid > .row.form-actions {
  align-self: stretch;
  justify-content: flex-start;
}

body.theme-light .main-panel .card .form-grid.product-form-grid .form-section-title {
  color: #1a1a2e;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.main-panel .card .form-item {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.main-panel .card .form-item label {
  width: auto;
  text-align: left;
}

.main-panel .card .form-item input,
.main-panel .card .form-item select {
  width: min(100%, 420px);
}

.form-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-item label {
  width: 110px;
  text-align: right;
  color: #b8ccf4;
  flex-shrink: 0;
}

.form-item input,
.form-item select {
  flex: 1;
}

.form-actions {
  grid-column: 1 / -1;
  justify-content: center;
  margin-top: 4px;
}

input,
select,
button {
  font-size: 14px;
  padding: 10px;
}

input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(128, 165, 255, 0.36);
  border-radius: 8px;
  background: rgba(8, 16, 33, 0.7);
  color: #e8f0ff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input::placeholder {
  color: #8da5d4;
}

input:focus,
select:focus {
  border-color: #58a4ff;
  box-shadow: 0 0 0 3px rgba(88, 164, 255, 0.22);
  background: rgba(10, 20, 40, 0.85);
}

button {
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #1f8fff, #5c61ff);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  animation: buttonBreath 5.5s ease-in-out infinite;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 120, 255, 0.35);
}

#message {
  min-height: 24px;
  font-weight: 600;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 20;
  overflow: visible;
}

/* 各模块顶栏主标题：左侧约半字宽留白，避免贴齐主区内缘 */
.topbar > h1 {
  margin: 0;
  padding-inline-start: 0.5em;
  box-sizing: border-box;
}

.row {
  display: flex;
  gap: 10px;
}

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

.section-head h2 {
  margin: 0;
}

/* 列表页：禁止整页滚动，仅 .list-table-scroll 内滚动 */
html:has(.list-page-root) {
  height: 100%;
}

body:has(.list-page-root) {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body:has(.list-page-root) .app-shell {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* 列表页：工具/新增区与列表标题固定，仅表格区域滚动（主布局 + 壳内嵌页） */
.main-panel:has(> .list-page-root) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.shell-main-panel:has(.shell-content > .list-page-root) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.shell-content:has(> .list-page-root) {
  flex: 1;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.list-page-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.list-page-root > .topbar,
.list-page-root > .subtitle {
  flex-shrink: 0;
}

.list-page-root > .dashboard-main-tabs {
  flex-shrink: 0;
}

/* 有 Tab 时：tabpanel 占满 root 剩余高度，内层 data-card + .list-table-scroll 才有纵向滚动（库存盘点、结算管理等） */
.list-page-root > [role="tabpanel"] {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.list-page-root > [role="tabpanel"] > .list-page-toolbar-card,
.list-page-root > [role="tabpanel"] > .count-create-panel {
  flex-shrink: 0;
}

.list-page-root > [role="tabpanel"] > .list-page-data-card {
  flex: 1;
  min-height: 0;
  min-width: 0;
}

/* 企业看板：左侧菜单 + 页标题 + 主 Tab 固定，仅当前 Tab 面板内纵向滚动 */
html:has(.dashboard-page-root) {
  height: 100%;
}

body:has(.dashboard-page-root) {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body:has(.dashboard-page-root) .app-shell {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

body:has(.dashboard-page-root) .sidebar {
  flex-shrink: 0;
  align-self: stretch;
  overflow: hidden;
}

.main-panel:has(> .list-page-root.dashboard-page-root) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.list-page-root.dashboard-page-root {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.list-page-root.dashboard-page-root > .topbar,
.list-page-root.dashboard-page-root > .subtitle {
  flex-shrink: 0;
}

.list-page-root.dashboard-page-root > .dashboard-main-tabs {
  flex-shrink: 0;
}

.list-page-root.dashboard-page-root > [role="tabpanel"]:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.list-page-root.dashboard-page-root > [role="tabpanel"] > .list-page-data-card {
  flex: 0 1 auto;
  min-height: auto;
  min-width: 0;
  max-width: 100%;
}

/* 纵向仍由 Tab 面板滚动；表格过宽时在 .list-table-scroll 内横向滑动（窄屏可看全列） */
.list-page-root.dashboard-page-root .list-table-scroll {
  flex: none;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.list-page-toolbar-card {
  flex-shrink: 0;
}

.list-page-data-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.list-page-data-card > .section-head {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

/* 左侧：主操作按钮 + 列表提示（对齐仓库进销「出货单」Tab） */
.list-page-data-card > .section-head .section-head-main {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
}

/* 右侧：查询条件 + 导入/导出等，整体靠右；过宽时在本区域内横向滚动 */
.list-page-data-card > .section-head .search-bar {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-end;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 报表汇总：客户消费分析 / 产品销量区块内筛选 */
.list-page-data-card > .section-head .report-customer-search-bar,
.list-page-data-card > .section-head .report-product-search-bar {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

/* 结算管理·发票清单：左侧「新增发票」，右侧筛选与按钮整体右对齐 */
.list-page-data-card > .section-head .search-bar.inv-invoice-search-bar {
  flex: 1 1 100%;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.inv-invoice-search-bar .inv-invoice-query-row__left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.inv-invoice-search-bar .inv-invoice-query-row__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.inv-invoice-search-bar .inv-invoice-query-message {
  margin: 0;
  max-width: min(280px, 34vw);
}

.inv-missing-customer-name {
  color: #d4380d;
  font-weight: 600;
}

.list-page-data-card > p {
  flex-shrink: 0;
}

.list-page-data-card > .receivable-summary-footer {
  flex-shrink: 0;
}

.section-head-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: 2px;
}

.list-page-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}

/* 列表顶栏：主按钮在左，提示文案紧随其后（与出货单 Tab 左侧区一致） */
.list-page-title-row--with-lead-action {
  align-items: center;
}

.list-page-title-row--with-actions {
  align-items: center;
  width: 100%;
}
.list-page-title-row--with-actions .so-alerts-refresh-btn,
.list-page-title-row--with-actions .so-slip-print-selected-btn {
  margin-left: auto;
}

.list-page-title-row--with-expiry {
  align-items: center;
  width: 100%;
}
.dash-expiry-threshold-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 14px;
  font-weight: normal;
  color: #99afda;
}
.dash-expiry-threshold-label input[type="number"] {
  width: 72px;
  padding: 4px 8px;
  border-radius: 4px;
}

.list-inline-message {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  max-width: min(560px, 52vw);
  word-break: break-word;
}

.list-table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin: 0 -2px;
  padding: 0 2px 4px;
}

.list-table-scroll table {
  display: table;
  width: max-content;
  min-width: 100%;
  max-width: none;
  border-collapse: collapse;
}

.list-table-scroll table th,
.list-table-scroll table td {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.list-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(180deg, rgba(28, 42, 72, 0.98), rgba(22, 34, 58, 0.96));
  box-shadow: 0 1px 0 rgba(120, 160, 255, 0.22);
}

/* 仓库进销列表：订单号、客户名称等列视觉收窄，省略号 + title 悬停看全文 */
.so-list-cell-ellipsis {
  max-width: 9.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.so-list-order-no {
  max-width: 7.25rem;
}

.so-list-customer {
  max-width: 8.25rem;
}

.so-list-product-name {
  max-width: 11rem;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 查询行内靠右（如「导入」与左侧筛选拉开） */
.search-bar .search-bar-trailing {
  margin-left: auto;
  flex-shrink: 0;
}

/* 查询、刷新及同栏按钮：横排文字，避免窄容器下逐字折行呈竖排观感 */
.search-bar button,
.snapshot-inventory-excel-bar button {
  flex-shrink: 0;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.snapshot-inventory-excel-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-bar input,
.search-bar select {
  /* 覆盖全局 input/select { width:100% }，避免查询行里单个框被横向扯满整行 */
  width: auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* 合并关键字、客户名等单行文本：固定合理宽度，不随容器变长 */
.search-bar input[type="text"],
.search-bar input[type="search"],
.search-bar input[list] {
  min-width: 11rem;
  max-width: min(22rem, 92vw);
  flex: 0 0 auto;
}

.search-bar .list-keyword-input {
  min-width: 12rem;
  max-width: min(20rem, 90vw);
  flex: 0 0 auto;
}

.search-bar .search-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(232, 238, 251, 0.92);
  flex-shrink: 0;
  white-space: nowrap;
}

.search-bar .search-filter-select {
  min-width: 6.5rem;
  max-width: 9rem;
  color: #f0f6ff;
  color-scheme: dark;
}

/* 查询行「状态」类原生下拉：与多选状态列宽约 5 个汉字 */
.search-bar .search-filter-select.search-filter-select--status {
  width: 5em;
  min-width: 5em;
  max-width: 5em;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.search-bar .search-filter-select option {
  background: #141c30;
  color: #f0f6ff;
}

.search-bar .search-filter-select:focus {
  color: #f8fbff;
}

body.theme-light .search-bar .search-filter-label {
  color: #16335f;
}

body.theme-light .search-bar .search-filter-select {
  color: #162f56;
  color-scheme: light;
}

body.theme-light .search-bar .search-filter-select option {
  background: #f4f8ff;
  color: #162f56;
}

body.theme-candy .search-bar .search-filter-label {
  color: #fff3ff;
}

body.theme-candy .search-bar .search-filter-select {
  color: #fff8ff;
  color-scheme: dark;
}

body.theme-candy .search-bar .search-filter-select option {
  background: #2d1f4d;
  color: #fff4ff;
}

/* 列表查询：状态下拉 + 复选（替代原生 multiple select） */
.search-bar .multi-select-dd {
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
  font-size: 0.9rem;
  width: var(--multi-select-trigger-width, 5em);
  min-width: var(--multi-select-trigger-width, 5em);
  max-width: var(--multi-select-trigger-width, 5em);
}

.search-bar .multi-select-dd-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  margin: 0;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.9rem;
  color: #f0f6ff;
  background: rgba(12, 18, 32, 0.92);
  border: 1px solid rgba(120, 144, 192, 0.35);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  color-scheme: dark;
}

.search-bar .multi-select-dd-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-bar .multi-select-dd-arrow {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(200, 216, 248, 0.75);
  margin-top: 2px;
}

/* 打开时由 multi-select-dropdown.js 设为 position:fixed，避免查询行 overflow 裁切 */
.search-bar .multi-select-dd-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 350;
  box-sizing: border-box;
  min-width: 100%;
  width: max-content;
  max-width: min(22rem, calc(100vw - 24px));
  padding: 8px 0 6px;
  background: #1a2438;
  border: 1px solid rgba(120, 144, 192, 0.4);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.search-bar .multi-select-dd-options {
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 6px;
}

.search-bar .multi-select-dd-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 4px;
  padding: 6px 8px;
  margin: 2px 0;
  border-radius: 6px;
  font-size: 0.9rem;
  color: rgba(232, 238, 251, 0.95);
  cursor: pointer;
  user-select: none;
}

.search-bar .multi-select-dd-option:hover {
  background: rgba(80, 120, 200, 0.18);
}

.search-bar .multi-select-dd-option input {
  margin: 0;
  /* 覆盖 .search-bar input { min-width: 180px }，否则复选框被拉成整条很宽 */
  min-width: 0;
  width: 0.95rem;
  max-width: 0.95rem;
  height: 0.95rem;
  accent-color: #5b8def;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
  box-sizing: border-box;
}

.search-bar .multi-select-dd-option-text {
  min-width: 0;
  line-height: 1.35;
  word-break: break-word;
}

.search-bar .multi-select-dd-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 4px;
  border-top: 1px solid rgba(120, 144, 192, 0.22);
  margin-top: 4px;
}

.search-bar .multi-select-dd-confirm {
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(100, 150, 230, 0.55);
  background: linear-gradient(180deg, rgba(70, 120, 210, 0.55), rgba(50, 95, 185, 0.75));
  color: #f5f8ff;
  cursor: pointer;
  font-weight: 600;
}

.search-bar .multi-select-dd-confirm:hover {
  filter: brightness(1.08);
}

.search-bar .multi-select-dd-clear {
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(140, 160, 200, 0.4);
  background: rgba(30, 42, 64, 0.9);
  color: rgba(220, 230, 255, 0.9);
  cursor: pointer;
}

.search-bar .multi-select-dd-clear:hover {
  background: rgba(50, 70, 110, 0.55);
}

body.theme-light .search-bar .multi-select-dd-trigger {
  color: #162f56;
  background: #fff;
  border-color: rgba(100, 130, 180, 0.45);
  color-scheme: light;
}

body.theme-light .search-bar .multi-select-dd-arrow {
  border-top-color: rgba(60, 90, 140, 0.65);
}

body.theme-light .search-bar .multi-select-dd-dropdown {
  background: #fff;
  border-color: rgba(100, 130, 180, 0.4);
  box-shadow: 0 12px 28px rgba(15, 35, 70, 0.18);
}

body.theme-light .search-bar .multi-select-dd-option {
  color: #1e3a5f;
}

body.theme-light .search-bar .multi-select-dd-option:hover {
  background: rgba(80, 130, 220, 0.12);
}

body.theme-light .search-bar .multi-select-dd-confirm {
  border-color: rgba(60, 110, 200, 0.55);
  background: linear-gradient(180deg, #5b8def, #3d6ec9);
  color: #fff;
}

body.theme-light .search-bar .multi-select-dd-clear {
  background: #f4f7fc;
  color: #234;
  border-color: rgba(100, 130, 180, 0.4);
}

body.theme-candy .search-bar .multi-select-dd-trigger {
  color: #fff8ff;
  background: rgba(40, 28, 72, 0.95);
  border-color: rgba(200, 160, 240, 0.35);
}

body.theme-candy .search-bar .multi-select-dd-dropdown {
  background: #2d1f4d;
  border-color: rgba(200, 160, 240, 0.35);
}

body.theme-candy .search-bar .multi-select-dd-option {
  color: #fff4ff;
}

body.theme-candy .search-bar .multi-select-dd-option:hover {
  background: rgba(160, 100, 220, 0.22);
}

body.theme-candy .search-bar .multi-select-dd-confirm {
  border-color: rgba(200, 140, 255, 0.6);
  background: linear-gradient(180deg, rgba(140, 80, 200, 0.85), rgba(100, 50, 160, 0.95));
  color: #fff8ff;
}

body.theme-candy .search-bar .multi-select-dd-clear {
  background: rgba(50, 36, 86, 0.9);
  color: #ffe8ff;
  border-color: rgba(200, 160, 240, 0.35);
}

/* 列表查询：单一「时间范围」控件（内含起止 date，同一视觉分组） */
.search-bar .search-date-range-unified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.search-bar .search-date-range-unified .search-date-range-title {
  font-size: 0.9rem;
  color: rgba(232, 238, 251, 0.88);
  white-space: nowrap;
}

.search-bar .search-date-range-inner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 3px 7px;
  border-radius: 8px;
  border: 1px solid rgba(120, 160, 255, 0.38);
  background: rgba(10, 16, 30, 0.55);
}

/* 浅色日历图标（深色表单下原生图标易不可见）；宽度按 yyyy-mm-dd + 图标收紧 */
.search-bar .search-date-range-inner input[type="date"] {
  --date-calendar-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23c5dcff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01'/%3E%3C/svg%3E");
  box-sizing: border-box;
  min-width: 7.625rem;
  width: auto;
  max-width: 100%;
  padding: 4px 5px;
  padding-right: 0.125rem;
  font-size: 0.875rem;
  border: none;
  background: transparent;
  color: #e8eefb;
  color-scheme: dark;
}

.search-bar .search-date-range-inner input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  width: 1.4rem;
  height: 1.1rem;
  padding: 1px 3px;
  margin-left: 0;
  box-sizing: content-box;
  background: var(--date-calendar-icon) center / 1rem 1rem no-repeat;
}

.search-bar .search-date-range-inner input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0.95;
  transform: scale(1.08);
}

.search-bar .search-date-range-inner input[type="number"] {
  min-width: 3.75rem;
  width: 4.5rem;
  max-width: 100%;
  padding: 4px 5px;
  font-size: 0.875rem;
  border: none;
  background: transparent;
  color: #e8eefb;
  color-scheme: dark;
}

.search-date-sep {
  color: rgba(232, 238, 251, 0.55);
  user-select: none;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.secondary {
  background: linear-gradient(135deg, #4f5f82, #3c4b70);
}

.secondary:hover {
  background: linear-gradient(135deg, #56688f, #43547f);
}

.danger {
  background: linear-gradient(135deg, #e43c56, #b92341);
}

.danger:hover {
  background: linear-gradient(135deg, #ef4e67, #c42a49);
}

/* 进销列表 / 弹窗：确认收货（入库）— 青绿，与「确认出货」区分 */
button.btn-confirm-receive {
  background: linear-gradient(135deg, #0d9f6e, #0a7a85);
  animation: none;
}

button.btn-confirm-receive:hover {
  box-shadow: 0 8px 18px rgba(13, 159, 110, 0.38);
}

/* 进销列表 / 弹窗：确认出货（扣库）— 琥珀橙，与「确认收货」区分 */
button.btn-confirm-ship {
  background: linear-gradient(135deg, #e07818, #c44b2a);
  animation: none;
}

button.btn-confirm-ship:hover {
  box-shadow: 0 8px 18px rgba(192, 90, 40, 0.42);
}

/* 列表操作：流程已终态，灰色不可点 */
button.btn-flow-ended,
button.btn-flow-ended:disabled {
  background: linear-gradient(135deg, #4a5568, #3d4556);
  color: rgba(255, 255, 255, 0.65);
  cursor: not-allowed;
  animation: none;
  opacity: 0.92;
  box-shadow: none;
}

button.btn-flow-ended:hover {
  transform: none;
  box-shadow: none;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button.btn-link.list-order-detail-trigger {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: #a8d4ff;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-align: inherit;
  max-width: 100%;
  word-break: break-all;
}

button.btn-link.list-order-detail-trigger:hover {
  color: #d6ebff;
}

.list-order-detail-modal .list-order-detail-modal-card {
  width: min(560px, calc(100vw - 24px));
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.list-order-detail-modal .list-order-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: left;
  /* 明细表与底部「关闭」区之间留白，避免贴底 */
  padding-bottom: 20px;
}

.list-order-detail-subtitle {
  margin: 12px 0 8px;
  font-size: 15px;
  color: #cfe0ff;
}

.list-order-detail-dl {
  margin-bottom: 0;
}

.list-order-detail-table-wrap {
  overflow-x: auto;
  margin: 0 -4px 10px;
  padding: 0 4px;
  -webkit-overflow-scrolling: touch;
}

.list-order-detail-modal .flow-terminal-modal-actions {
  margin-top: 4px;
  padding-top: 4px;
}

.list-order-detail-items-table {
  width: 100%;
  font-size: 13px;
}

body.theme-light button.btn-link.list-order-detail-trigger {
  color: #1677ff;
}

.hidden {
  display: none !important;
}

/* 库存盘点「当前库存」表：非管理员隐藏「操作」列 */
.stock-snapshot-table.hide-snapshot-op-col th:nth-child(9),
.stock-snapshot-table.hide-snapshot-op-col td:nth-child(9) {
  display: none;
}

/* 产品列表：无采购价权限时同时隐藏 th/td，避免只藏表头导致列错位 */
.product-list-table.hide-purchase-price-cols .purchase-price-col {
  display: none !important;
}

.product-list-table.hide-sale-price-cols .sale-price-col {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 采购「添加产品」二层弹窗，叠在新建/编辑主弹窗（inv-flow-modal）之上 */
.po-add-line-modal,
.modal.modal-stack-above-editor,
.count-add-line-modal,
.return-add-product-modal {
  z-index: 1350;
}

/* 「确认新建产品」叠在添加明细弹窗之上；低于全局提示 .app-alert-modal（5000） */
.modal.modal-create-product-confirm {
  z-index: 1400;
}

/* 库存盘点：页内展开的新增盘点单卡片 */
.count-create-panel {
  margin-bottom: 12px;
}
.count-create-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.count-create-panel-head h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 650;
}

/* 库存盘点：添加明细弹窗（z-index 见 .modal-stack-above-editor / .count-add-line-modal 统一规则） */
.count-add-line-modal {
  /* z-index 在 .po-add-line-modal 规则块中统一设置 */
}

.count-confirm-modal .modal-card {
  width: min(920px, calc(100vw - 32px));
}

.po-cancel-order-modal-card,
.sr-cancel-order-modal-card {
  width: min(720px, calc(100vw - 32px));
}

.count-draft-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.count-draft-table th,
.count-draft-table td {
  padding: 6px 8px;
  border: 1px solid rgba(120, 160, 255, 0.22);
  text-align: left;
}
.count-draft-table thead th {
  background: rgba(24, 38, 68, 0.9);
}

.po-add-line-modal-message {
  margin: 0 0 8px 0;
  font-size: 14px;
  min-height: 1.2em;
}

/* 叠在确认类弹窗之上，用于展示「知道了」提示 */
.app-alert-modal {
  z-index: 5000;
}

.app-alert-modal-message {
  margin: 0 0 4px 0;
  font-size: 15px;
  line-height: 1.55;
  color: #e8eeff;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 18, 0.62);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: min(640px, calc(100vw - 32px));
  border-radius: 12px;
  border: 1px solid rgba(126, 161, 246, 0.28);
  background: linear-gradient(180deg, rgba(18, 30, 54, 0.96), rgba(12, 22, 42, 0.95));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  padding: 16px;
  /* iOS 底栏会遮挡底部按钮：卡片下沿与操作按钮之间预留约两行 + 安全区 */
  padding-bottom: calc(16px + 2em + env(safe-area-inset-bottom, 0px));
}

/* 订单号详情：与全局模态底边距一致 */
.list-order-detail-modal .modal-card.list-order-detail-modal-card {
  padding-bottom: calc(16px + 2em + env(safe-area-inset-bottom, 0px));
}

#modalPasswordForm.form-grid {
  grid-template-columns: 1fr;
}

.modal-card h3 {
  margin: 0 0 10px 0;
}

.flow-terminal-modal-question {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 600;
  color: #eef3ff;
}

.flow-terminal-modal-hint {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: rgba(220, 231, 255, 0.72);
  line-height: 1.5;
}

.flow-terminal-modal-summary {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(6, 12, 24, 0.55);
  border: 1px solid rgba(126, 161, 246, 0.2);
  font-size: 14px;
  line-height: 1.55;
  color: #dce7ff;
}

.flow-terminal-modal-summary dt {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: rgba(220, 231, 255, 0.58);
}

.flow-terminal-modal-summary dt:first-of-type {
  margin-top: 0;
}

.flow-terminal-modal-summary dd {
  margin: 2px 0 0 0;
  font-weight: 500;
}

.flow-terminal-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.inv-actions-cell {
  white-space: normal;
  min-width: 220px;
  vertical-align: middle;
}
.inv-actions-cell .inv-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.inv-actions-cell .inv-action-btns button {
  font-size: 13px;
  padding: 4px 10px;
}

/* 发票清单操作：与主题主色/正向操作色一致，避免 secondary 灰感 */
.inv-actions-cell .inv-action-btns button.btn-inv-edit {
  background: linear-gradient(135deg, #1f8fff, #5c61ff);
  animation: none;
}
.inv-actions-cell .inv-action-btns button.btn-inv-edit:hover {
  box-shadow: 0 8px 18px rgba(37, 120, 255, 0.35);
}
.inv-actions-cell .inv-action-btns button.btn-inv-confirm-paid {
  background: linear-gradient(135deg, #0d9f6e, #0a7a85);
  animation: none;
}
.inv-actions-cell .inv-action-btns button.btn-inv-confirm-paid:hover {
  box-shadow: 0 8px 18px rgba(13, 159, 110, 0.38);
}

.inv-flow-terminal-label {
  display: inline-block;
  font-size: 13px;
  color: rgba(151, 164, 193, 0.88);
  cursor: default;
  user-select: none;
}
body.theme-light .inv-flow-terminal-label {
  color: rgba(100, 110, 130, 0.95);
}

.inv-flow-modal {
  z-index: 1200;
  align-items: flex-start;
  justify-content: center;
  padding: max(10px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
    max(10px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.inv-flow-modal .modal-card.inv-editor-modal-card,
.inv-flow-modal .inv-editor-modal-card.sales-add-line-modal-card {
  width: min(920px, 100%);
  max-width: 100%;
  max-height: none;
  margin: 12px auto;
  box-sizing: border-box;
}

.inv-flow-modal .inv-editor-modal-card .form-grid:not(.product-form-grid):not(.order-card-header-grid) {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.inv-flow-modal .inv-editor-modal-card .form-grid:not(.product-form-grid):not(.order-card-header-grid) .form-item {
  width: 100%;
  min-width: 0;
}

.inv-flow-modal .inv-editor-modal-card .form-grid:not(.product-form-grid):not(.order-card-header-grid) .form-item input,
.inv-flow-modal .inv-editor-modal-card .form-grid:not(.product-form-grid):not(.order-card-header-grid) .form-item select,
.inv-flow-modal .inv-editor-modal-card .form-grid:not(.product-form-grid):not(.order-card-header-grid) .form-item textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.inv-flow-modal .inv-editor-modal-card .form-grid.product-form-grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  max-width: 100%;
}

.inv-flow-modal .inv-editor-modal-card .form-grid.product-form-grid .form-section-title {
  width: 100%;
  box-sizing: border-box;
  margin: 4px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e6edff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.inv-flow-modal .inv-editor-modal-card .form-grid.product-form-grid .form-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}

.inv-flow-modal .inv-editor-modal-card .form-grid.product-form-grid .form-row .form-item {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.inv-flow-modal .inv-editor-modal-card .form-grid.product-form-grid .form-item input,
.inv-flow-modal .inv-editor-modal-card .form-grid.product-form-grid .form-item select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.inv-flow-modal .inv-editor-modal-card .form-grid.product-form-grid .form-item .customer-combobox-wrap {
  width: 100%;
  max-width: 100%;
}

.inv-flow-modal .inv-editor-modal-card .order-lines-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.inv-flow-modal .inv-editor-modal-card .form-actions,
.inv-flow-modal .inv-editor-modal-card > .row.form-actions,
.inv-flow-modal .inv-editor-modal-card form > .row.form-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.inv-flow-modal #returnForm .return-form-actions,
.inv-flow-modal .inv-editor-modal-card #returnForm .return-form-actions {
  margin-top: 8px;
}

.inv-flow-modal #returnForm .order-lines-table-wrap .return-draft-items-table,
.inv-flow-modal .inv-editor-modal-card #returnForm .order-lines-table-wrap .return-draft-items-table {
  table-layout: auto;
}

@media (min-width: 640px) {
  .inv-flow-modal .inv-editor-modal-card .form-grid:not(.product-form-grid):not(.order-card-header-grid) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
  }

  .inv-flow-modal .inv-editor-modal-card .form-grid.product-form-grid .form-row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .inv-flow-modal .inv-editor-modal-card .form-grid.product-form-grid .form-row .form-item {
    flex: 0 0 auto;
    width: max-content;
    max-width: 100%;
  }

  .inv-flow-modal .inv-editor-modal-card .form-grid.product-form-grid .form-item input,
  .inv-flow-modal .inv-editor-modal-card .form-grid.product-form-grid .form-item select {
    width: 220px;
    max-width: 100%;
  }
}

@media (max-width: 639px) {
  .inv-flow-modal {
    padding: 8px;
  }

  .inv-flow-modal .modal-card.inv-editor-modal-card,
  .inv-flow-modal .inv-editor-modal-card.sales-add-line-modal-card {
    width: 100%;
    margin: 0 auto 8px;
    border-radius: 10px;
  }

  .modal.modal-stack-above-editor,
  .po-add-line-modal,
  .return-add-product-modal {
    align-items: flex-start;
    padding: 8px;
    overflow-y: auto;
  }

  .modal.modal-stack-above-editor .sales-add-line-modal-card,
  .po-add-line-modal .sales-add-line-modal-card,
  .return-add-product-modal .sales-add-line-modal-card {
    width: 100%;
    max-width: 100%;
    margin: auto 0;
  }
}

.inv-editor-modal-card {
  width: min(920px, calc(100vw - 24px));
  max-height: min(92vh, 900px);
  overflow-y: auto;
}

.inv-module-tabs {
  margin-bottom: 14px;
}

.receivable-summary-footer .list-pagination-host,
.list-page-footer--with-pager .list-pagination-host {
  margin-left: auto;
}

/* 覆盖 .list-table-scroll td 的 nowrap，回款统计多行列表可换行 */
.list-table-scroll table td.inv-receivable-invoice-list,
.list-table-scroll table th.inv-receivable-invoice-list {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.inv-receivable-invoice-list {
  max-width: min(520px, 55vw);
  font-size: 13px;
  line-height: 1.45;
  color: rgba(220, 231, 255, 0.92);
}

.inv-receivable-invoice-list--invoices {
  min-width: 7rem;
  max-width: min(300px, 38vw);
}

body.theme-light .inv-receivable-invoice-list {
  color: rgba(40, 50, 70, 0.95);
}

.so-fulfill-qty-wrap {
  margin-top: 14px;
}

/* 确认收货 / 添加到出货单：摘要两列；下方表单每行两字段 */
#soOutboundConfirmModal .flow-terminal-modal-summary {
  display: grid;
  grid-template-columns: max-content 1fr max-content 1fr;
  column-gap: 12px 20px;
  row-gap: 10px;
  align-items: baseline;
}
#soOutboundConfirmModal .flow-terminal-modal-summary dt,
#soOutboundConfirmModal .flow-terminal-modal-summary dd {
  margin: 0;
}
#soOutboundConfirmModal .flow-terminal-modal-summary dd {
  min-width: 0;
  word-break: break-word;
}
#soOutboundConfirmModal .so-outbound-modal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 14px;
  max-width: 100%;
  align-items: start;
}
#soOutboundConfirmModal .so-outbound-modal-form-grid .form-item {
  margin: 0;
  min-width: 0;
}
#soOutboundConfirmModal .so-outbound-modal-form-grid label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: #99afda;
}
#soOutboundConfirmModal .so-outbound-modal-form-grid input,
#soOutboundConfirmModal .so-outbound-modal-form-grid select {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
#soOutboundConfirmModal .so-fulfill-qty-input,
#soOutboundConfirmModal .so-fulfill-unit-select {
  max-width: none;
}
@media (max-width: 520px) {
  #soOutboundConfirmModal .flow-terminal-modal-summary {
    grid-template-columns: max-content 1fr;
  }
  #soOutboundConfirmModal .so-outbound-modal-form-grid {
    grid-template-columns: 1fr;
  }
}

.so-fulfill-qty-wrap label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: #99afda;
}
.so-fulfill-unit-row {
  margin-bottom: 0;
}
.so-fulfill-unit-select {
  width: 100%;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(142, 167, 211, 0.45);
  background: rgba(15, 28, 52, 0.55);
  color: inherit;
  font-size: 15px;
}
body.theme-light .so-fulfill-unit-select {
  background: #fff;
  color: #162f56;
  border-color: rgba(100, 130, 180, 0.45);
}
body.theme-candy .so-fulfill-unit-select {
  background: rgba(40, 28, 72, 0.95);
  color: #fff8ff;
  border-color: rgba(200, 160, 240, 0.35);
}
.so-fulfill-qty-input {
  width: 100%;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(142, 167, 211, 0.45);
  background: rgba(15, 28, 52, 0.55);
  color: inherit;
  font-size: 15px;
}

/* 弹窗随主题：浅色/糖果下与页面卡片一致，避免深色底 + 浅色字对比错误 */
body.theme-light .modal-backdrop {
  background: rgba(26, 43, 73, 0.45);
}

body.theme-light .modal-card {
  background: linear-gradient(145deg, rgba(245, 249, 255, 0.98), rgba(236, 243, 252, 0.96));
  border-color: rgba(142, 167, 211, 0.55);
  box-shadow: 0 24px 56px rgba(60, 90, 140, 0.22);
}

body.theme-light .modal-card h3 {
  color: #122a50;
}

body.theme-light .app-alert-modal-message {
  color: #1f3a68;
}

body.theme-light .modal-card .subtitle,
body.theme-light .modal-card p:not(.flow-terminal-modal-hint):not(.flow-terminal-modal-question) {
  color: #1f3a68;
}

body.theme-light .modal-card strong {
  color: #0f2344;
}

body.theme-light .flow-terminal-modal-question {
  color: #16335f;
}

body.theme-light .flow-terminal-modal-hint {
  color: #1f3a68;
}

body.theme-light .flow-terminal-modal-summary {
  background: rgba(233, 241, 252, 0.92);
  border-color: rgba(119, 149, 200, 0.45);
  color: #1d3764;
}

body.theme-light .flow-terminal-modal-summary dt {
  color: rgba(22, 47, 86, 0.72);
}

body.theme-light .flow-terminal-modal-summary dd {
  color: #122a50;
}

body.theme-light .list-order-detail-subtitle {
  color: #16335f;
}

body.theme-light .modal-card table {
  background: rgba(222, 232, 248, 0.65);
}

body.theme-light .modal-card th {
  background: rgba(126, 158, 214, 0.38);
  color: #17315b;
}

body.theme-light .modal-card td {
  color: #17315b;
  border-color: rgba(119, 149, 200, 0.4);
}

body.theme-light .modal-card tbody tr:nth-child(even) {
  background: rgba(112, 151, 218, 0.12);
}

body.theme-light .modal-card tbody tr:hover {
  background: rgba(88, 130, 201, 0.2);
}

body.theme-candy .modal-backdrop {
  background: rgba(24, 14, 48, 0.55);
}

body.theme-candy .modal-card {
  background: linear-gradient(145deg, rgba(66, 42, 112, 0.92), rgba(35, 79, 125, 0.88));
  border-color: rgba(255, 197, 237, 0.38);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

body.theme-candy .modal-card h3 {
  color: #fff3ff;
}

body.theme-candy .modal-card .subtitle {
  color: #ffe9ff;
}

body.theme-candy .modal-card strong {
  color: #fff8ff;
}

body.theme-candy .flow-terminal-modal-question {
  color: #fff6ff;
}

body.theme-candy .app-alert-modal-message {
  color: #fff0ff;
}

body.theme-candy .flow-terminal-modal-hint {
  color: rgba(255, 244, 255, 0.88);
}

body.theme-candy .flow-terminal-modal-summary {
  background: rgba(35, 24, 62, 0.55);
  border-color: rgba(255, 197, 237, 0.28);
  color: #ffe9ff;
}

body.theme-candy .flow-terminal-modal-summary dt {
  color: rgba(255, 233, 255, 0.65);
}

body.theme-candy .flow-terminal-modal-summary dd {
  color: #fff8ff;
}

body.theme-candy .list-order-detail-subtitle {
  color: #fff0ff;
}

body.theme-candy .modal-card table {
  background: rgba(255, 149, 226, 0.08);
}

body.theme-candy .modal-card th {
  background: rgba(117, 74, 177, 0.45);
  color: #fff0ff;
}

body.theme-candy .modal-card td {
  color: #fff0ff;
  border-color: rgba(255, 197, 237, 0.22);
}

body.theme-candy .modal-card tbody tr:nth-child(even) {
  background: rgba(255, 149, 226, 0.07);
}

body.theme-candy .modal-card tbody tr:hover {
  background: rgba(255, 176, 235, 0.14);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  background: rgba(6, 12, 24, 0.28);
  border-radius: 10px;
  overflow: hidden;
}

th,
td {
  border: 1px solid rgba(126, 161, 246, 0.22);
  padding: 8px;
  text-align: left;
  color: #dce7ff;
}

th {
  background: rgba(31, 56, 102, 0.45);
  color: #cfe0ff;
}

tbody tr:nth-child(even) {
  background: rgba(125, 160, 255, 0.06);
}

tbody tr:hover {
  background: rgba(87, 140, 255, 0.18);
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

.row-low-stock {
  background: rgba(255, 112, 67, 0.14);
}

.stock-warning-tag {
  display: inline-block;
  margin-left: 8px;
  color: #ffd4bf;
  font-size: 12px;
  border: 1px solid rgba(255, 156, 128, 0.7);
  padding: 1px 6px;
  border-radius: 12px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

/* 与采购订单等列表一致：占满一行，内部控件靠右（右下角） */
.list-pagination-host {
  width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
}

.list-pagination-bar {
  margin-top: 10px;
}

.list-pagination-bar .list-pagination-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.list-pagination-bar .list-pagination-page-size {
  display: inline-flex;
  flex-direction: row;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
  word-break: keep-all;
}

.list-pagination-bar .list-pagination-size-select {
  min-width: 4.5rem;
  padding: 4px 8px;
}

.list-pagination-bar .list-pagination-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.list-pagination-bar .list-pagination-label {
  font-size: 13px;
  white-space: nowrap;
}

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

/* 看板顶部 KPI 固定同一行；窄屏横向滚动 */
.dashboard-kpi-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-card-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.12s ease;
}

.metric-card-clickable:hover {
  box-shadow: 0 0 0 1px rgba(107, 158, 255, 0.45);
  transform: translateY(-1px);
}

.metric-card-clickable:focus {
  outline: 2px solid rgba(107, 158, 255, 0.7);
  outline-offset: 2px;
}

.dashboard-main-tabs,
.dashboard-todo-subtabs,
.dashboard-report-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(124, 157, 218, 0.22);
  padding-bottom: 0;
}

.dashboard-main-tabs .dashboard-tab-btn,
.dashboard-todo-subtabs .dashboard-tab-btn,
.dashboard-report-subtabs .dashboard-tab-btn {
  /* 左右各约半个汉字：随 tab 字号缩放（原 18px 约等于每侧 1em+） */
  padding: 10px 0.5em;
  font-size: 14px;
  border: none;
  background: transparent;
  color: #9bb5e8;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 6px 6px 0 0;
  animation: none;
}

.dashboard-main-tabs .dashboard-tab-btn:hover,
.dashboard-todo-subtabs .dashboard-tab-btn:hover,
.dashboard-report-subtabs .dashboard-tab-btn:hover {
  color: #cfe0ff;
  background: rgba(80, 120, 200, 0.12);
}

.dashboard-main-tabs .dashboard-tab-btn[aria-selected="true"],
.dashboard-todo-subtabs .dashboard-tab-btn[aria-selected="true"],
.dashboard-report-subtabs .dashboard-tab-btn[aria-selected="true"] {
  color: #ffffff;
  background: rgba(55, 95, 170, 0.22);
  border-bottom-color: #6b9eff;
  font-weight: 600;
}

#soCartOrderConfirmTableWrap {
  overflow-x: auto;
  margin: 12px 0;
  max-height: min(60vh, 480px);
  overflow-y: auto;
}

#soCartOrderConfirmTableWrap table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}

#soCartOrderConfirmTableWrap th,
#soCartOrderConfirmTableWrap td {
  border: 1px solid rgba(124, 157, 218, 0.25);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

#soCartOrderConfirmTableWrap th {
  background: rgba(30, 52, 95, 0.6);
  font-weight: 600;
}

.dashboard-kpi-row .metric-card h2 {
  font-size: 14px;
  line-height: 1.25;
}

.dashboard-kpi-row .metric-value {
  font-size: 22px;
}

.dashboard-kpi-row .metric-sub {
  font-size: 12px;
}

.dashboard-bi-layout {
  display: grid;
  grid-template-columns: 1.3fr 2.4fr 1.3fr;
  gap: 12px;
  align-items: stretch;
}

.dashboard-bi-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  min-height: 0;
  align-content: stretch;
}

.dashboard-bi-side > .card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dashboard-bi-side .chart-box {
  flex: 1;
  min-height: 220px;
  height: auto;
}

.dashboard-map-card {
  margin-bottom: 0;
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dashboard-map-card .chart-box {
  flex: 1;
  min-height: 360px;
  height: auto;
}

.chart-box {
  width: 100%;
  height: 320px;
}

.metric-card h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.metric-value {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #cfe0ff;
}

.metric-warning {
  color: #ffc08f;
}

.metric-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: #9bb5e8;
}

.metric-up {
  color: #6ff4a2;
}

.metric-down {
  color: #ff9d9d;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(97, 150, 255, 0.2);
  border: 1px solid rgba(120, 170, 255, 0.35);
  color: #d9e8ff;
  font-size: 13px;
}

.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(128, 165, 255, 0.4);
  background: rgba(8, 16, 33, 0.7);
}

.topbar .row {
  position: relative;
  z-index: 25;
  flex-shrink: 0;
}

.profile-menu {
  position: relative;
  z-index: 30;
  pointer-events: auto;
}

.profile-menu-trigger,
summary.profile-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(128, 165, 255, 0.38);
  border-radius: 999px;
  background: rgba(8, 16, 33, 0.6);
  color: #e8f0ff;
  cursor: pointer;
  list-style: none;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

details.profile-menu > summary.profile-menu-trigger::-webkit-details-marker {
  display: none;
}

.profile-menu-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(99, 152, 255, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  overflow: hidden;
}

.profile-menu-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 由 <details> 控制显隐，不再用 .open + display:none 避免与点击事件冲突 */
details.profile-menu .profile-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 130px;
  background: rgba(10, 18, 35, 0.95);
  border: 1px solid rgba(130, 170, 255, 0.35);
  border-radius: 10px;
  padding: 6px;
  z-index: 2000;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

details.profile-menu.profile-menu--sidebar .profile-menu-panel {
  left: 0;
  right: auto;
}

.profile-menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #dce7ff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.profile-menu-item:hover {
  background: rgba(92, 128, 206, 0.3);
}

body.theme-light {
  background: linear-gradient(120deg, #e9eef8 0%, #e4ebf7 46%, #dfe7f3 100%);
  color: #1a2b49;
}

body.theme-light .card {
  background: linear-gradient(145deg, rgba(245, 249, 255, 0.94), rgba(236, 243, 252, 0.92));
  border-color: rgba(142, 167, 211, 0.5);
}

body.theme-light:has(.app-shell) .main-panel > .topbar,
body.theme-light:has(.app-shell) .main-panel > .list-page-root > .topbar {
  background: rgba(244, 248, 255, 0.92);
  border-bottom-color: rgba(110, 140, 195, 0.52);
}

body.theme-light:has(.app-shell) .main-panel > .dashboard-main-tabs,
body.theme-light:has(.app-shell) .main-panel > .list-page-root > .dashboard-main-tabs,
body.theme-light:has(.app-shell) .main-panel #dashPanelTodos > .dashboard-todo-subtabs,
body.theme-light:has(.app-shell) .main-panel #dashPanelReports > .dashboard-report-subtabs,
body.theme-light:has(.app-shell) .main-panel .list-page-root > .dashboard-report-subtabs {
  border-bottom-color: rgba(110, 140, 195, 0.52);
}

body.theme-light:has(.app-shell) .main-panel .card {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(118, 148, 200, 0.55);
  box-shadow: none;
  animation: none;
  margin-bottom: 0;
}

body.theme-light #dashPanelBi .card,
body.theme-light #dashPanelBi article.card {
  border-radius: 12px;
  border: 1px solid rgba(142, 167, 211, 0.5);
  box-shadow: 0 8px 26px rgba(20, 40, 80, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  animation: cardBreath 7s ease-in-out infinite;
}

body.theme-light #dashPanelBi > .card {
  margin-bottom: 16px;
}

body.theme-light #dashPanelBi .dashboard-bi-side > .card,
body.theme-light #dashPanelBi .dashboard-map-card,
body.theme-light #dashPanelBi article.metric-card {
  margin-bottom: 0;
}

body.theme-light .sidebar {
  background: rgba(220, 231, 248, 0.88);
  border-right-color: rgba(127, 156, 206, 0.5);
}

body.theme-light .sidebar a {
  color: #16335f;
}

body.theme-light .sidebar-group summary {
  color: #16335f;
}

body.theme-light::before {
  opacity: 0.15;
}

body.theme-light input,
body.theme-light select {
  background: rgba(233, 241, 252, 0.95);
  border-color: rgba(119, 149, 200, 0.55);
  color: #162f56;
}

body.theme-light input:focus,
body.theme-light select:focus {
  background: #f4f8ff;
  box-shadow: 0 0 0 3px rgba(86, 132, 208, 0.22);
}

body.theme-light th,
body.theme-light td {
  color: #17315b;
}

body.theme-light th {
  background: rgba(126, 158, 214, 0.36);
}

body.theme-light .list-table-scroll thead th {
  background: linear-gradient(180deg, rgba(210, 224, 248, 0.98), rgba(196, 214, 244, 0.96));
  box-shadow: 0 1px 0 rgba(100, 130, 190, 0.35);
}

body.theme-light .subtitle,
body.theme-light .metric-sub,
body.theme-light .form-item label,
body.theme-light #message,
body.theme-light .list-inline-message,
body.theme-light .profile-menu-name,
body.theme-light .chip {
  color: #1f3a68;
}

body.theme-light .metric-value,
body.theme-light h1,
body.theme-light h2,
body.theme-light h3 {
  color: #122a50;
}

body.theme-light .card p,
body.theme-light .card span,
body.theme-light .card label,
body.theme-light .card li {
  color: #1d3764;
}

body.theme-light .sidebar a.active {
  background: linear-gradient(135deg, #3f82df, #5f6fd8);
}

body.theme-light tbody tr:nth-child(even) {
  background: rgba(112, 151, 218, 0.1);
}

body.theme-light tbody tr:hover {
  background: rgba(88, 130, 201, 0.18);
}

body.theme-light button {
  background: linear-gradient(135deg, #2f79d8, #4f67cd);
}

body.theme-light button.btn-confirm-receive {
  background: linear-gradient(135deg, #059669, #0d9488);
}

body.theme-light button.btn-confirm-receive:hover {
  box-shadow: 0 8px 18px rgba(5, 150, 105, 0.35);
}

body.theme-light button.btn-confirm-ship {
  background: linear-gradient(135deg, #ea580c, #c2410c);
}

body.theme-light button.btn-confirm-ship:hover {
  box-shadow: 0 8px 18px rgba(234, 88, 12, 0.38);
}

body.theme-light .inv-actions-cell .inv-action-btns button.btn-inv-edit {
  background: linear-gradient(135deg, #2f79d8, #4f67cd);
  animation: none;
}
body.theme-light .inv-actions-cell .inv-action-btns button.btn-inv-edit:hover {
  box-shadow: 0 8px 18px rgba(47, 121, 216, 0.38);
}
body.theme-light .inv-actions-cell .inv-action-btns button.btn-inv-confirm-paid {
  background: linear-gradient(135deg, #059669, #0d9488);
  animation: none;
}
body.theme-light .inv-actions-cell .inv-action-btns button.btn-inv-confirm-paid:hover {
  box-shadow: 0 8px 18px rgba(5, 150, 105, 0.35);
}

body.theme-light .secondary {
  background: linear-gradient(135deg, #5b6d92, #4c5e84);
}

body.theme-light button.btn-flow-ended,
body.theme-light button.btn-flow-ended:disabled {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: rgba(255, 255, 255, 0.88);
}

body.theme-candy {
  background: linear-gradient(130deg, #2b1c56 0%, #50308b 40%, #2c6fa4 100%);
  color: #fff4ff;
}

body.theme-candy::before {
  opacity: 0.62;
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 124, 196, 0.45) 0%, rgba(255, 124, 196, 0) 42%),
    radial-gradient(circle at 84% 24%, rgba(133, 233, 255, 0.35) 0%, rgba(133, 233, 255, 0) 40%),
    radial-gradient(circle at 50% 82%, rgba(255, 214, 120, 0.32) 0%, rgba(255, 214, 120, 0) 36%);
  animation-duration: 14s;
}

body.theme-candy::after {
  background: radial-gradient(circle, rgba(255, 113, 185, 0.42) 0%, rgba(255, 113, 185, 0) 70%);
}

body.theme-candy .app-shell::before {
  background: radial-gradient(circle, rgba(132, 222, 255, 0.32) 0%, rgba(132, 222, 255, 0) 72%);
}

body.theme-candy .sidebar {
  background: rgba(43, 25, 80, 0.86);
  border-right-color: rgba(255, 184, 239, 0.28);
}

body.theme-candy .sidebar a,
body.theme-candy .sidebar-group summary {
  color: #ffe9ff;
}

body.theme-candy .sidebar a:hover,
body.theme-candy .sidebar-group summary:hover {
  background: rgba(255, 146, 228, 0.2);
  border-color: rgba(255, 182, 236, 0.4);
}

body.theme-candy .sidebar a.active {
  background: linear-gradient(135deg, #ff6ab1, #8f6bff);
  box-shadow: 0 8px 20px rgba(255, 106, 177, 0.36);
}

body.theme-candy .card {
  background: linear-gradient(145deg, rgba(66, 42, 112, 0.86), rgba(35, 79, 125, 0.8));
  border-color: rgba(255, 197, 237, 0.3);
}

body.theme-candy .subtitle,
body.theme-candy .metric-sub {
  color: #ffe2fa;
}

body.theme-candy h1,
body.theme-candy h2,
body.theme-candy h3,
body.theme-candy .section-head h2,
body.theme-candy .metric-card h2,
body.theme-candy .profile-menu-name {
  color: #fff3ff;
}

body.theme-candy .form-item label,
body.theme-candy .chip,
body.theme-candy #message,
body.theme-candy .list-inline-message,
body.theme-candy .stock-warning-tag {
  color: #ffe9ff;
}

body.theme-candy .metric-value {
  color: #fff8ff;
}

body.theme-candy .metric-up {
  color: #9effcf;
}

body.theme-candy .metric-down {
  color: #ffd1dd;
}

body.theme-candy input,
body.theme-candy select {
  background: rgba(41, 27, 71, 0.68);
  border-color: rgba(255, 189, 233, 0.46);
  color: #fff1ff;
}

body.theme-candy input:focus,
body.theme-candy select:focus {
  border-color: #ff9fdd;
  box-shadow: 0 0 0 3px rgba(255, 159, 221, 0.24);
}

body.theme-candy button {
  background: linear-gradient(135deg, #ff6ab1, #7d73ff);
}

body.theme-candy button.btn-confirm-receive {
  background: linear-gradient(135deg, #14b8a6, #059669);
}

body.theme-candy button.btn-confirm-receive:hover {
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.42);
}

body.theme-candy button.btn-confirm-ship {
  background: linear-gradient(135deg, #fb923c, #ea580c);
}

body.theme-candy button.btn-confirm-ship:hover {
  box-shadow: 0 8px 20px rgba(251, 146, 60, 0.45);
}

body.theme-candy .inv-actions-cell .inv-action-btns button.btn-inv-edit {
  background: linear-gradient(135deg, #ff6ab1, #7d73ff);
  animation: none;
}
body.theme-candy .inv-actions-cell .inv-action-btns button.btn-inv-edit:hover {
  box-shadow: 0 8px 20px rgba(255, 106, 177, 0.4);
}
body.theme-candy .inv-actions-cell .inv-action-btns button.btn-inv-confirm-paid {
  background: linear-gradient(135deg, #14b8a6, #059669);
  animation: none;
}
body.theme-candy .inv-actions-cell .inv-action-btns button.btn-inv-confirm-paid:hover {
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.42);
}

body.theme-candy .secondary {
  background: linear-gradient(135deg, #6f5aa8, #4f72b8);
}

body.theme-candy button.btn-flow-ended,
body.theme-candy button.btn-flow-ended:disabled {
  background: linear-gradient(135deg, #6b5b8a, #4a5d78);
  color: rgba(255, 245, 255, 0.75);
}

body.theme-candy th {
  background: rgba(117, 74, 177, 0.5);
}

body.theme-candy .list-table-scroll thead th {
  background: linear-gradient(180deg, rgba(86, 52, 128, 0.96), rgba(62, 42, 98, 0.94));
  box-shadow: 0 1px 0 rgba(255, 180, 230, 0.25);
}

body.theme-candy th,
body.theme-candy td {
  color: #fff0ff;
}

body.theme-candy tbody tr:nth-child(even) {
  background: rgba(255, 149, 226, 0.08);
}

body.theme-candy tbody tr:hover {
  background: rgba(255, 176, 235, 0.16);
}

/* Tab 条：特异性高于 body.theme-* button，避免浅色下选中态与主按钮渐变叠在一起不可读 */
body.theme-light .dashboard-main-tabs,
body.theme-light .dashboard-todo-subtabs,
body.theme-light .dashboard-report-subtabs {
  border-bottom-color: rgba(90, 120, 175, 0.38);
}

body.theme-light .dashboard-main-tabs .dashboard-tab-btn,
body.theme-light .dashboard-todo-subtabs .dashboard-tab-btn,
body.theme-light .dashboard-report-subtabs .dashboard-tab-btn {
  background: transparent;
  color: #3d5580;
}

body.theme-light .dashboard-main-tabs .dashboard-tab-btn:hover,
body.theme-light .dashboard-todo-subtabs .dashboard-tab-btn:hover,
body.theme-light .dashboard-report-subtabs .dashboard-tab-btn:hover {
  color: #0f2747;
  background: rgba(70, 118, 200, 0.14);
}

body.theme-light .dashboard-main-tabs .dashboard-tab-btn[aria-selected="true"],
body.theme-light .dashboard-todo-subtabs .dashboard-tab-btn[aria-selected="true"],
body.theme-light .dashboard-report-subtabs .dashboard-tab-btn[aria-selected="true"] {
  color: #051426;
  background: rgba(214, 228, 252, 0.98);
  border-bottom-color: #2f79d8;
  font-weight: 600;
}

body.theme-candy .dashboard-main-tabs,
body.theme-candy .dashboard-todo-subtabs,
body.theme-candy .dashboard-report-subtabs {
  border-bottom-color: rgba(255, 160, 220, 0.38);
}

body.theme-candy .dashboard-main-tabs .dashboard-tab-btn,
body.theme-candy .dashboard-todo-subtabs .dashboard-tab-btn,
body.theme-candy .dashboard-report-subtabs .dashboard-tab-btn {
  background: transparent;
  color: rgba(255, 235, 255, 0.8);
}

body.theme-candy .dashboard-main-tabs .dashboard-tab-btn:hover,
body.theme-candy .dashboard-todo-subtabs .dashboard-tab-btn:hover,
body.theme-candy .dashboard-report-subtabs .dashboard-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 106, 177, 0.2);
}

body.theme-candy .dashboard-main-tabs .dashboard-tab-btn[aria-selected="true"],
body.theme-candy .dashboard-todo-subtabs .dashboard-tab-btn[aria-selected="true"],
body.theme-candy .dashboard-report-subtabs .dashboard-tab-btn[aria-selected="true"] {
  color: #ffffff;
  background: rgba(95, 55, 145, 0.58);
  border-bottom-color: #ff8acb;
  font-weight: 600;
}

@media print {
  .sidebar,
  .profile-menu,
  #themeToggleBtn,
  #exportPngBtn,
  #printBtn,
  #biSearchBtn,
  #clearProvinceBtn {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .main-panel {
    padding: 0;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
  }
}

.nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.nav-tabs a {
  text-decoration: none;
  color: #1677ff;
  padding: 6px 0.5em;
  border: 1px solid #d9e8ff;
  border-radius: 6px;
  background: #f5f9ff;
}

.nav-tabs a.active {
  color: #fff;
  background: #1677ff;
  border-color: #1677ff;
}

@keyframes cardBreath {
  0%,
  100% {
    box-shadow: 0 10px 30px rgba(4, 8, 18, 0.45), inset 0 1px 0 rgba(197, 214, 255, 0.08);
  }
  50% {
    box-shadow: 0 12px 34px rgba(10, 20, 40, 0.52), inset 0 1px 0 rgba(197, 214, 255, 0.12);
  }
}

@keyframes buttonBreath {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.06);
  }
}

@keyframes bgFloat {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(0, -16px, 0) scale(1.04);
  }
}

@keyframes blobDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-20px, 20px, 0);
  }
}

@keyframes blobDriftReverse {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(22px, -18px, 0);
  }
}

/* 移动端或系统「减少动效」：关闭 body / 壳层全屏装饰伪元素的无限动画，减轻持续合成与发热 */
@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .app-shell::before {
    animation: none !important;
  }
}

@media (max-width: 768px) {
  body::before,
  body::after,
  .app-shell::before {
    animation: none !important;
  }
}

/* Login/Register stay single-column even on large screens */
.container .form-grid {
  grid-template-columns: 1fr;
}

@media (max-width: 960px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    /* 覆盖大屏的 max-width: min(320px, 46vw)，否则窄屏侧栏仍被压在约半屏宽，3 列格子极窄 */
    max-width: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 8px;
    align-items: stretch;
    justify-items: stretch;
    box-sizing: border-box;
    border-right: none;
    border-bottom: 1px solid rgba(97, 136, 255, 0.25);
  }

  .sidebar > .sidebar-head {
    grid-column: 1 / -1;
    width: 100%;
    flex-basis: unset;
    margin-bottom: 4px;
    justify-content: flex-start;
  }

  .sidebar > .sidebar-group {
    grid-column: 1 / -1;
  }

  /*
   * 小屏 3 列：每格宽度有限，横向「图标+长文案」会互相叠压。
   * 每项视为整体：格内纵向排列（图标上、文字下），文字在格宽内换行，避免盖住图标或侵入邻格。
   */
  .sidebar > a {
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 6px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.8125rem;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
    position: relative;
    z-index: 0;
  }

  .sidebar a .sidebar-nav-text {
    flex: 0 0 auto;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: keep-all;
    line-height: 1.2;
    text-align: center;
  }

  .sidebar > a .sidebar-nav-icon {
    flex-shrink: 0;
    width: auto;
    font-size: 1.2em;
    line-height: 1;
  }

  .main-panel {
    padding: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-item label {
    width: 100px;
  }

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

  /* 列表页：与出货单 Tab 一致——左主操作、右查询区（平板横屏仍保持一行） */
  .list-page-data-card > .section-head {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
  }

  .list-page-data-card > .section-head .search-bar {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-end;
  }

  .list-page-data-card > #soCartPanel.so-ship-cart-panel > .section-head {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
  }

  .list-page-data-card > #soCartPanel.so-ship-cart-panel > .section-head .search-bar {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-end;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .form-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .form-item label {
    width: auto;
    text-align: left;
  }

  .dashboard-grid:not(.dashboard-kpi-row) {
    grid-template-columns: 1fr;
  }

  .dashboard-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(104px, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-kpi-row .metric-card {
    min-width: 0;
  }

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

  .dashboard-bi-side {
    grid-template-rows: auto auto;
  }

  .dashboard-bi-side > .card {
    display: block;
  }

  .dashboard-map-card {
    display: block;
  }

  .dashboard-map-card .chart-box,
  .dashboard-bi-side .chart-box {
    flex: none;
    min-height: 0;
    height: 260px;
  }

  .chart-box {
    height: 260px;
  }

  /*
   * 列表页（.list-page-root，不含企业看板）：小屏改为整页纵向滚动；
   * 企业看板（.dashboard-page-root）仍保持「标题 + Tab 固定、仅面板内滚动」。
   */
  html:has(.list-page-root):not(:has(.dashboard-page-root)) {
    height: auto;
    min-height: 100%;
  }

  body:has(.list-page-root):not(:has(.dashboard-page-root)) {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body:has(.list-page-root):not(:has(.dashboard-page-root)) .app-shell {
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow: visible;
  }

  .main-panel:has(> .list-page-root):not(:has(> .list-page-root.dashboard-page-root)) {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
  }

  .shell-main-panel:has(.shell-content > .list-page-root):not(:has(.shell-content > .list-page-root.dashboard-page-root)) {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    flex: 1 1 auto;
  }

  .shell-content:has(> .list-page-root):not(:has(> .list-page-root.dashboard-page-root)) {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .list-page-root:not(.dashboard-page-root) {
    flex: 0 1 auto;
    min-height: 0;
  }

  .list-page-data-card {
    flex: 0 1 auto;
    min-height: 0;
  }

  .list-table-scroll {
    flex: 0 1 auto;
    min-height: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }
}

/* ≥641px：查询条件同一行横向排列，空间不足时在查询行内横向滚动（避免中等宽度下整列竖排） */
@media (min-width: 641px) {
  .search-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    align-items: center;
    -webkit-overflow-scrolling: touch;
  }

  .search-bar input,
  .search-bar select.search-filter-select {
    flex: 0 0 auto;
  }
}

/* ≤640px：查询行允许换行与日期标签竖排，便于手机点选 */
@media (max-width: 640px) {
  .list-page-data-card > .section-head {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
  }

  .list-page-data-card > .section-head .search-bar {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
  }

  .list-page-data-card > #soCartPanel.so-ship-cart-panel > .section-head {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
  }

  .list-page-data-card > #soCartPanel.so-ship-cart-panel > .section-head .search-bar {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
  }

  .search-bar {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-bar input {
    flex: 1;
    min-width: 160px;
  }

  .search-bar .search-date-range-unified {
    flex: 1 1 100%;
    max-width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .search-bar .search-date-range-unified .search-date-range-title {
    font-size: 0.8125rem;
    line-height: 1.2;
  }

  .search-bar .search-date-range-inner {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 4px 6px;
    padding: 3px 6px;
  }

  .search-bar .search-date-range-inner input[type="date"] {
    flex: none;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 4px 4px;
    padding-right: 0.125rem;
    font-size: 0.8125rem;
  }

  .search-bar .search-date-range-inner input[type="date"]::-webkit-calendar-picker-indicator {
    width: 1.35rem;
    height: 1.05rem;
    padding: 1px 2px;
    margin-left: 0;
  }

  .search-bar .search-date-sep {
    font-size: 0.75rem;
    padding: 0 1px;
  }
}

/* 极窄屏：起止日期上下排列，单列更易点选且不再挤占横向空间 */
@media (max-width: 420px) {
  .search-bar .search-date-range-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .search-bar .search-date-sep {
    text-align: center;
    line-height: 1;
    padding: 2px 0;
    font-size: 0.7rem;
  }
}

/* 图像识别页 */
.imgreco-hint {
  margin: 0 0 12px;
  color: #99afda;
  font-size: 14px;
  line-height: 1.5;
}

.imgreco-pick-label,
.imgreco-status {
  margin: 10px 0 0;
  color: #b8ccf4;
  font-size: 14px;
}

.imgreco-msg {
  min-height: 22px;
  margin-top: 10px;
  font-weight: 600;
  color: #9ed8b4;
}

.imgreco-msg--error {
  color: #ff9a9a;
}

.imgreco-result {
  margin-top: 14px;
  min-height: 48px;
  font-size: 15px;
  line-height: 1.6;
}

.imgreco-match-ok {
  color: #7dffb3;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 6px;
}

.imgreco-match-file {
  color: #cfe7ff;
  word-break: break-all;
}

.imgreco-match-no {
  color: #ffc8a8;
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  body::before,
  body::after,
  .app-shell::before {
    display: none !important;
  }
  .sidebar,
  .topbar,
  .profile-menu,
  .list-page-toolbar-card,
  .no-print,
  .list-pagination-host,
  .dashboard-main-tabs,
  .dashboard-todo-subtabs,
  .dashboard-report-subtabs,
  .search-bar,
  .section-head .list-inline-message {
    display: none !important;
  }
  .app-shell {
    display: block !important;
  }
  .main-panel {
    padding: 12px !important;
    margin: 0 !important;
    max-width: none !important;
  }
  .card {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
  .list-table-scroll {
    overflow: visible !important;
  }
  .list-table-scroll thead th {
    background: #f0f0f0 !important;
    color: #000 !important;
  }
  .list-table-scroll table {
    font-size: 11px;
  }
}

/* 售后退货：未加载可退明细时仍可点击以弹出说明（避免 HTML disabled 吞掉 click） */
button.return-add-product-btn-not-ready {
  opacity: 0.65;
  cursor: not-allowed;
}

/* 诺诺云参考版 ERP 壳层与高密度列表 */
body.nuonuo-erp {
  min-height: 100vh;
  background: #eef2f7 !important;
  color: #1f2937;
}

body.nuonuo-erp::before,
body.nuonuo-erp::after,
.nuonuo-erp .app-shell::before {
  display: none !important;
}

.nuonuo-erp .erp-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #eef2f7;
}

.erp-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 56px;
  padding: 0 18px;
  background: #ffffff;
  border-bottom: 1px solid #d9e0ea;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.erp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  font-weight: 700;
  color: #111827;
}

.erp-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #1769e0;
  color: #fff;
}

.erp-module-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.erp-module-btn {
  height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #344054;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.erp-module-btn:hover,
.erp-module-btn.active {
  color: #1769e0;
  background: #edf5ff;
}

.erp-module-btn.active {
  box-shadow: inset 0 -3px 0 #1769e0;
  font-weight: 700;
}

.profile-menu--erp {
  flex: 0 0 auto;
}

.profile-menu--erp .profile-menu-trigger {
  border: 1px solid #d9e0ea;
  background: #fff;
  color: #1f2937;
}

.erp-workspace {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
}

.erp-subnav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  background: #f8fafc;
  border-bottom: 1px solid #d9e0ea;
  overflow-x: auto;
}

.erp-subnav-btn {
  height: 30px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #475467;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.erp-subnav-btn:hover,
.erp-subnav-btn.active {
  border-color: #b8d5ff;
  background: #ffffff;
  color: #1769e0;
}

.erp-subnav-btn:disabled {
  color: #98a2b3;
  cursor: not-allowed;
}

.erp-tab-strip {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 38px;
  padding: 6px 18px 0;
  background: #eef2f7;
  border-bottom: 1px solid #d9e0ea;
  overflow-x: auto;
}

.erp-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 9px 0 12px;
  border: 1px solid #d9e0ea;
  border-bottom-color: #cbd5e1;
  border-radius: 5px 5px 0 0;
  background: #f8fafc;
  color: #475467;
  cursor: pointer;
  white-space: nowrap;
}

.erp-tab.active {
  background: #ffffff;
  color: #1769e0;
  border-bottom-color: #ffffff;
  font-weight: 700;
}

.erp-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: #667085;
  font-size: 14px;
}

.erp-tab-close:hover {
  background: #e5e7eb;
  color: #111827;
}

.nuonuo-erp .shell-main-panel,
.nuonuo-erp .main-panel {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px 18px 24px;
  background: #eef2f7;
  color: #1f2937;
}

.nuonuo-erp .shell-content {
  width: 100%;
}

body.v2-workspace-embedded,
body.v2-workspace-embedded .erp-shell,
body.v2-workspace-embedded .erp-workspace {
  width: 100%;
  min-height: 100vh;
  background: #eef2f7;
}

body.v2-workspace-embedded .erp-topbar,
body.v2-workspace-embedded .erp-subnav,
body.v2-workspace-embedded .erp-tab-strip {
  display: none !important;
}

body.v2-workspace-embedded .erp-workspace {
  min-height: 100vh;
}

body.v2-workspace-embedded .shell-main-panel {
  min-height: 100vh;
  padding: 12px;
  overflow: auto;
}

.nuonuo-erp .card {
  border: 1px solid #d9e0ea;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.nuonuo-erp .topbar,
.erp-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #1f2937;
}

.nuonuo-erp .topbar h1,
.erp-page-head h1 {
  margin: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1.3;
}

.nuonuo-erp .subtitle,
.nuonuo-erp .muted {
  color: #667085;
}

.nuonuo-erp .search-bar,
.erp-filter-bar {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 0;
}

.nuonuo-erp input,
.nuonuo-erp select,
.nuonuo-erp textarea {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #1f2937;
  box-shadow: none;
}

.nuonuo-erp button,
.nuonuo-erp .primary {
  border-radius: 4px;
  box-shadow: none;
}

.nuonuo-erp button.primary,
.nuonuo-erp .primary {
  border-color: #1769e0;
  background: #1769e0;
  color: #fff;
}

.erp-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.erp-kpi {
  min-height: 70px;
  padding: 12px 14px;
  border: 1px solid #d9e0ea;
  border-radius: 6px;
  background: #fff;
}

.erp-kpi span {
  display: block;
  color: #667085;
  font-size: 13px;
}

.erp-kpi strong {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 22px;
}

.erp-table-card,
.erp-filter-card {
  margin-bottom: 12px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

.dense-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.dense-table th,
.dense-table td {
  height: 38px;
  padding: 6px 10px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  white-space: nowrap;
}

.dense-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: #475467;
  font-weight: 700;
}

.dense-table tfoot td {
  background: #fbfdff;
  font-weight: 700;
}

.dense-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sticky-op {
  position: sticky;
  right: 0;
  background: inherit;
  box-shadow: -1px 0 0 #edf0f5;
}

.empty-cell {
  color: #667085;
  text-align: center !important;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e8f7ef;
  color: #067647;
  font-size: 12px;
}

.muted-pill {
  background: #f2f4f7;
  color: #667085;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
}

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

.erp-settings-card {
  padding: 16px;
}

.erp-settings-card h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.switch-row,
.setting-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  color: #344054;
}

@media (max-width: 900px) {
  .erp-topbar {
    gap: 10px;
    padding: 0 10px;
  }
  .erp-brand-name {
    display: none;
  }
  .erp-kpi-row,
  .erp-settings-grid {
    grid-template-columns: 1fr;
  }
  .nuonuo-erp .topbar,
  .erp-page-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
