:root {
  --ink: #111111;
  --muted: #666666;
  --line: #d4d4d4;
  --grid-line: #d4d4d4;
  --panel: #ffffff;
  --bg: #f2f2f2;
  --accent: #ffffff;
  --accent-2: #c45c26;
  --ok: #111111;
  --warn: #b45309;
  --danger: #b42318;
  --header-bg: #eeeeee;
  --row-even: #f7f7f7;
  --row-hover: #e8e8e8;
  --filter-bg: #f5f5f5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "SimSun", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}

#app {
  height: 100%;
}

.login-wrap {
  height: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: var(--bg);
}

.login-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  padding: 24px 22px;
  box-shadow: none;
}

.login-logo {
  display: block;
  width: 112px;
  height: auto;
  margin: 0 auto 18px;
  background: transparent;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.login-card .sub {
  color: var(--muted);
  margin-bottom: 22px;
  font-size: 0.92rem;
}

.shell {
  position: relative;
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns 0.32s ease;
}

.shell.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}

.sidebar {
  background: #000000;
  color: #f2f2f2;
  padding: 0 6px 8px;
  overflow-y: auto;
  border-right: 1px solid #000000;
  flex-shrink: 0;
  width: 168px;
  min-width: 168px;
  max-width: 168px;
  transition: opacity 0.28s ease, padding 0.28s ease;
}

.shell.sidebar-collapsed .sidebar {
  opacity: 0;
  padding: 0;
  border-right: 0;
  overflow: hidden;
  pointer-events: none;
  width: 0;
  min-width: 0;
  max-width: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-left h2 {
  margin: 0;
}

.edge-burger {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 6px;
  margin: 0;
  line-height: 0;
  cursor: pointer;
  appearance: none;
}

.edge-burger:hover,
.edge-burger:focus-visible {
  background: transparent;
  border: none;
}

.edge-burger:focus-visible {
  outline: none;
}

.burger {
  display: block;
  width: 24px;
  height: 24px;
  overflow: visible;
}

.burger line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  shape-rendering: geometricPrecision;
}

.sidebar-edge {
  position: absolute;
  left: 5px;
  top: 5px;
  z-index: 30;
  padding: 0;
  color: #f2f2f2;
  transform: none;
  transition: left 0.32s ease, top 0.32s ease, color 0.32s ease;
}

.sidebar-edge .burger {
  transform: none;
}

.shell.sidebar-collapsed .sidebar-edge {
  left: 10px;
  top: 6px;
  color: #000000;
}

.shell.sidebar-collapsed .sidebar-edge .burger {
  animation: burger-dock 0.32s ease;
}

.shell.sidebar-collapsed .topbar {
  padding-left: 42px;
  transition: padding-left 0.32s ease;
}

@keyframes burger-dock {
  0% { transform: translate(0, 0); }
  40% { transform: translate(16px, 4px); }
  100% { transform: translate(0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-edge,
  .shell.sidebar-collapsed .topbar {
    transition: none;
  }
  .shell.sidebar-collapsed .sidebar-edge .burger {
    animation: none;
  }
}

.brand {
  font-weight: 700;
  font-size: 15px;
  padding: 0 8px 10px;
  line-height: 1.3;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 6px;
}

.brand-logo {
  display: block;
  width: 110px;
  height: auto;
  margin: 0 auto -10px 3px;
}

.brand small {
  display: block;
  font-weight: 400;
  opacity: .65;
  font-size: 13px;
  margin-top: 2px;
}

.nav-btn {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #d4d4d4;
  padding: 5px 8px;
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 1px;
  font-size: 14px;
}

.nav-btn:hover, .nav-btn.active {
  background: #ffffff;
  color: #111;
}

.nav-group {
  margin: 6px 0 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.nav-group-label {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(201,213,227,.5);
  padding: 2px 8px 4px;
}

.nav-btn-sub {
  padding-left: 14px;
  font-size: 14px;
}

/* 年月日分段筛选：可输入 + 点选日历 + 清除 */
.date-range {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.date-ymd {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 148px;
  max-width: 100%;
  flex: 0 0 auto;
  height: 32px;
  min-height: 32px;
  padding: 0 4px 0 6px;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
  outline: none;
}

.date-ymd:focus-within,
.date-ymd.is-open,
.date-ymd.is-hot {
  outline: 1px solid #111;
  border-color: #111;
}

.form-grid .date-ymd,
.inquiry-submit-grid .date-ymd {
  width: 100%;
  flex: 1 1 auto;
}

.date-ymd-segs {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.date-ymd-seg {
  width: auto;
  min-width: 0;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent;
  padding: 2px 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink);
  cursor: text;
}

.date-ymd-y { width: 2.8em; }
.date-ymd-m,
.date-ymd-d { width: 1.45em; }
.date-ymd-h { width: 1.45em; }

.date-ymd.is-datetime {
  width: 248px;
  min-width: 220px;
  cursor: pointer;
}

.date-ymd-display {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.2;
  user-select: none;
}

.date-ymd-display.is-placeholder {
  color: #999999;
}

.form-grid .date-ymd.is-datetime,
.inquiry-submit-grid .date-ymd.is-datetime {
  width: 100%;
  max-width: 100%;
}

.date-ymd-sep {
  color: var(--muted);
  font-size: 12px;
  user-select: none;
  padding: 0;
}

.date-ymd-gap {
  width: 0.35em;
}

.date-ymd-seg::placeholder {
  color: #999999;
  font-size: 12px;
  letter-spacing: 0;
}

/* 右侧图标/清除：与双日 .drp-icon / .drp-clear 同槽位互换 */
.date-ymd .drp-icon,
.date-ymd .drp-clear {
  margin-left: auto;
}

.date-ymd.is-hot .drp-icon,
.date-ymd.is-hot .drp-clear {
  color: #111;
}

.btn-clear-dates {
  padding: 0 8px;
  font-size: 13px;
  width: 48px;
  min-width: 48px;
  height: 32px;
}

/* 可搜索下拉：输入即筛、点选 */
.combo-field {
  position: relative;
}

.combo {
  position: relative;
  width: 100%;
}

.combo-input-wrap {
  position: relative;
  width: 100%;
}
.combo-input-wrap > input {
  width: 100%;
  box-sizing: border-box;
}
.combo-input-wrap.has-add > input {
  padding-right: 34px;
}
.combo-add-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: var(--accent);
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.combo-add-btn:hover {
  filter: brightness(0.92);
}
.combo-add-btn:active {
  transform: translateY(calc(-50% + 1px));
}
.combo-add-btn svg {
  display: block;
}

.combo-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  bottom: auto;
  z-index: 60;
  margin: 0;
  padding: 2px 0;
  list-style: none;
  max-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  box-shadow: none;
}

.combo-list.combo-list-up {
  top: auto;
  bottom: calc(100% + 2px);
}

.combo-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  cursor: pointer;
}

.combo-item-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 4px;
  cursor: default;
}

.combo-item:hover,
.combo-item.active {
  background: #000;
  color: #fff;
}

.combo-item:hover .combo-item-title,
.combo-item.active .combo-item-title,
.combo-item:hover .combo-item-sub,
.combo-item.active .combo-item-sub {
  color: #fff;
}

.combo-pick {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border: 0;
  background: transparent;
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  border-radius: 8px;
}

.combo-pick:hover {
  background: #000;
  color: #fff;
}

.combo-item-title {
  color: var(--ink);
  font-size: 14px;
}

.combo-item-sub {
  color: var(--muted);
  font-size: 13px;
}

.combo-del {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.combo-del:hover {
  color: var(--danger);
  background: #f8e8e6;
}

.combo-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.combo-picked {
  font-size: 0.75rem;
  margin-top: 2px;
}

.phone-suggest {
  border: 1px solid #f0d9a8;
  background: #fffbf2;
  border-radius: 2px;
  padding: 8px 10px;
}

.phone-suggest-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #8a5a00;
  margin-bottom: 8px;
}

.phone-suggest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.phone-suggest-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 2px;
  background: #fff;
  border: 1px solid var(--grid-line);
  cursor: pointer;
}

.phone-suggest-item:hover {
  border-color: #000;
  background: #000;
  color: #fff;
}

.phone-suggest-item:hover .combo-item-title,
.phone-suggest-item:hover .combo-item-sub,
.phone-suggest-item:hover .phone-suggest-use {
  color: #fff;
}

.phone-suggest-item .combo-item-title {
  grid-column: 1;
  grid-row: 1;
}

.phone-suggest-item .combo-item-sub {
  grid-column: 1;
  grid-row: 2;
}

.phone-suggest-use {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 0.8rem;
  color: #111;
  font-weight: 600;
}

.phone-suggest-warn {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--danger);
  line-height: 1.45;
}

.main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  background: var(--bg);
}

/* SaaS 服务临期红条：导航栏正上方 */
.expire-banner {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 8px 12px;
  background: #b91c1c;
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  border-bottom: 1px solid #7f1d1d;
  z-index: 5;
}

.expire-banner strong {
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.expire-banner span {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: 36px;
  padding: 0 10px;
  margin: 0;
  background: #f5f5f5;
  border-bottom: 1px solid var(--grid-line);
  transition: padding-left 0.32s ease;
}

.topbar .btn {
  background: transparent;
  border: 1px solid var(--grid-line);
  color: var(--ink);
  box-shadow: none;
}

.topbar .btn:hover,
.topbar .btn:focus-visible,
.topbar .btn:active {
  background: var(--accent);
  border-color: #111111;
  color: #111;
}

.topbar h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

/* —— 列表页：工具栏 / 筛选 / 表格 三层 —— */
.list-page,
.panel.list-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--panel);
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.panel {
  background: var(--panel);
  border: 0;
  border-radius: 0;
  padding: 10px 12px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.list-toolbar {
  display: none; /* 操作按钮改到筛选行日期后面 */
}

.list-filters .btn,
.pager .btn {
  height: 32px;
  padding: 0 10px;
  font-size: 14px;
  border-radius: 2px;
}

.list-filters .date-range .btn-clear-dates {
  width: auto;
  min-width: 40px;
  height: 24px;
  padding: 0 6px;
  font-size: 12px;
}

/* 列表顶栏：上排筛选网格，下排按钮矩阵。控件统一 32px 高。 */
.list-filters {
  --filter-h: 32px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  flex-shrink: 0;
  padding: 12px 16px;
  background: var(--filter-bg);
  border-bottom: 1px solid var(--grid-line);
}

.list-filters .filter-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
  container-type: inline-size;
  container-name: filterbar;
}

.list-filters .filter-note {
  display: inline-flex;
  align-items: center;
  height: var(--filter-h);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.list-filters .filter-item {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  min-width: 0;
  height: var(--filter-h);
  font-size: 13px;
  color: var(--ink);
  font-weight: 400;
}

.list-filters .filter-select,
.list-filters .filter-check {
  order: 1;
}
.list-filters .filter-keyword {
  --fq-n: max(1, round(down, (100cqw + 10px) / 170px, 1));
  --fq-col: calc((100cqw - (var(--fq-n) - 1) * 10px) / var(--fq-n));
  order: 0;
  grid-column: 1 / -1;
  justify-self: start;
  width: min(100%, calc(3.5 * var(--fq-col) + 30px));
  max-width: 100%;
}

/* 远程客户搜索：与关键词栏同宽规则，下拉不被裁切 */
.list-filters .filter-combo {
  --fq-n: max(1, round(down, (100cqw + 10px) / 170px, 1));
  --fq-col: calc((100cqw - (var(--fq-n) - 1) * 10px) / var(--fq-n));
  order: 0;
  grid-column: 1 / -1;
  justify-self: start;
  width: min(100%, calc(3.5 * var(--fq-col) + 30px));
  max-width: 100%;
  overflow: visible;
  z-index: 6;
  gap: 6px;
}
.list-filters .filter-combo .combo {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--filter-h);
}
.list-filters .filter-combo .combo > input {
  width: 100%;
  height: var(--filter-h);
  box-sizing: border-box;
}
.list-filters .filter-date {
  order: 2;
  grid-column: span 3;
  height: var(--filter-h);
  min-height: var(--filter-h);
  min-width: 0;
}

@container filterbar (max-width: 500px) {
  .list-filters .filter-date {
    grid-column: 1 / -1;
  }
}

.drp {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 32px;
  min-width: 0;
  box-sizing: border-box;
  padding: 0 4px 0 8px;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: transparent;
  color: var(--grid-line);
  cursor: pointer;
  outline: none;
}

.drp.is-hot {
  border-color: #111;
}

.drp-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 400;
  line-height: 30px;
  text-align: left;
}

.drp-text.is-placeholder,
.drp-label {
  color: var(--grid-line);
  font-weight: 400;
}

.drp-val {
  color: var(--ink);
  font-weight: 400;
}

.drp-icon,
.drp-clear {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--grid-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.drp.is-hot .drp-icon,
.drp.is-hot .drp-clear {
  color: #111;
}

.drp-pop {
  position: fixed;
  z-index: 65;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 10px 8px;
  background: #fff;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(16, 32, 51, 0.16);
}

.drp-cals {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.drp-cal {
  flex: 1 1 0;
  min-width: 0;
}

.drp-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}

.drp-nav,
.drp-nav-spacer {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.drp-nav {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 2px;
}

.drp-nav:hover {
  background: #000;
  color: #fff;
}

.drp-week,
.drp-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.drp-week span {
  height: 22px;
  line-height: 22px;
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.drp-day {
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
}

.drp-day.is-empty {
  cursor: default;
}

.drp-day.is-in {
  background: #000;
  color: #fff;
  border-radius: 0;
}

.drp-day.is-edge {
  background: #000;
  color: #fff;
}

.drp-day:hover:not(:disabled):not(.is-edge) {
  background: #000;
  color: #fff;
}

.drp-day.is-today:not(.is-edge) {
  box-shadow: inset 0 0 0 1px #111;
  color: #111;
}

.drp-pop.is-single {
  width: 280px;
  max-width: calc(100vw - 16px);
}

.drp-pop.is-single.is-datetime {
  width: 412px;
  max-width: calc(100vw - 16px);
  padding: 10px 10px 8px;
}

.drp-datetime-body {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.drp-pop.is-single.is-datetime .drp-cal {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.drp-time-panel {
  display: flex;
  flex: 0 0 auto;
  gap: 0;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: #f7f7f7;
  overflow: hidden;
}

.drp-time-col {
  display: flex;
  flex-direction: column;
  width: 46px;
  border-right: 1px solid #ececec;
}

.drp-time-col:last-child {
  border-right: 0;
}

.drp-time-col-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 2px 0;
  border-bottom: 1px solid #ececec;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.drp-time-step {
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}

.drp-time-step:hover {
  color: #fff;
  background: #000;
}

.drp-time-scroll {
  height: 168px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.drp-time-opt {
  display: block;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
}

.drp-time-opt:hover {
  background: #000;
  color: #fff;
}

.drp-time-opt.is-active {
  background: #000;
  color: #fff;
  font-weight: 600;
}

/* 兼容旧类名，避免残留引用空白 */
.drp-time-row,
.drp-time-label,
.drp-time-input {
  display: none;
}

.drp-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.drp-foot.is-single-foot {
  justify-content: space-between;
  padding-top: 2px;
  border-top: 1px solid #ececec;
}

.drp-ghost {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}

.drp-ghost:hover {
  border-color: #d4d4d4;
  background: #f7f7f7;
}

.drp-ok {
  height: 28px;
  padding: 0 14px;
  border: 0;
  border-radius: 2px;
  background: var(--accent);
  color: #111;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}

.drp-ok:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.list-filters .filter-prefix {
  flex: 0 0 auto;
  font-weight: 400;
  font-size: 13px;
  color: var(--grid-line);
  white-space: nowrap;
}

.list-filters .filter-select {
  gap: 2px;
  padding-left: 8px;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: transparent;
  box-sizing: border-box;
}

.list-filters .filter-check {
  gap: 6px;
  padding: 0 8px;
  border: 1px solid var(--grid-line);
  background: transparent;
  box-sizing: border-box;
}
.list-filters .filter-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 16px;
}
.list-filters .filter-check span {
  line-height: var(--filter-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-filters .keyword-group {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: var(--filter-h);
  min-width: 0;
  gap: 0;
}

.list-filters .keyword-group input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: var(--filter-h);
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--grid-line);
  border-right: 0;
  border-radius: 2px 0 0 2px;
  background: transparent;
  font-weight: 400;
  box-shadow: none;
}

.list-filters .keyword-search {
  flex: 0 0 var(--filter-h);
  width: var(--filter-h);
  height: var(--filter-h);
  margin: 0;
  padding: 0;
  border: 1px solid #000000;
  border-radius: 0 2px 2px 0;
  background: #000000;
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
}

.list-filters .keyword-search svg {
  display: block;
  fill: none;
  stroke: var(--bg);
  stroke-width: 2;
}

.list-filters .keyword-search:hover,
.list-filters .keyword-search:focus-visible {
  background: #222222;
  border-color: #222222;
}

.list-filters .filter-select .theme-select {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
.list-filters .filter-select .theme-select-btn {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 0;
  background: transparent;
  font-weight: 400;
  box-shadow: none;
  padding: 0 4px 0 0;
  font-size: 13px;
}
.list-filters .filter-select .theme-select-btn:focus-visible,
.list-filters .filter-select .theme-select.is-open .theme-select-btn {
  outline: none;
}
.list-filters .filter-select:focus-within {
  border-color: #111;
}

.list-filters .date-range {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: var(--filter-h);
  min-width: 0;
  padding: 0 4px 0 8px;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: transparent;
  box-sizing: border-box;
}

.list-filters .date-range-name {
  flex: 0 0 auto;
  color: var(--grid-line);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.list-filters .date-ymd {
  width: auto;
  flex: 1 1 96px;
  min-width: 0;
  height: 28px;
  min-height: 28px;
  border: 0;
  background: transparent;
  padding: 0 2px;
}

.list-filters .btn-clear-dates {
  width: auto;
  min-width: 40px;
  height: 24px;
  flex: 0 0 auto;
  padding: 0 6px;
}

.list-filters .filter-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
}

.list-filters > .list-hint {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

/* 顶部多功能操作键：透底+外框；悬停/按下为分页同款深绿 */
.list-filters .filter-actions .btn {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: var(--filter-h);
  padding: 0 8px;
  font-size: 13px;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent;
  border: 1px solid var(--grid-line);
  color: var(--ink);
  box-shadow: none;
}

.list-filters .filter-actions .btn:hover,
.list-filters .filter-actions .btn:focus-visible,
.list-filters .filter-actions .btn:active {
  background: var(--accent);
  border-color: #111111;
  color: #111;
}

.list-filters .filter-actions .btn:disabled,
.list-filters .filter-actions .btn:disabled:hover,
.list-filters .filter-actions .btn:disabled:active {
  background: transparent;
  border: 1px solid var(--grid-line);
  color: var(--ink);
  opacity: 0.45;
}

.list-filters .filter-actions .btn-primary,
.list-filters .filter-actions .btn-warn,
.list-filters .filter-actions .btn-danger,
.list-filters .filter-actions .btn-ghost {
  background: transparent;
  border: 1px solid var(--grid-line);
  color: var(--ink);
}

.list-filters .filter-actions .btn-primary:hover,
.list-filters .filter-actions .btn-primary:focus-visible,
.list-filters .filter-actions .btn-primary:active,
.list-filters .filter-actions .btn-warn:hover,
.list-filters .filter-actions .btn-warn:focus-visible,
.list-filters .filter-actions .btn-warn:active,
.list-filters .filter-actions .btn-danger:hover,
.list-filters .filter-actions .btn-danger:focus-visible,
.list-filters .filter-actions .btn-danger:active,
.list-filters .filter-actions .btn-ghost:hover,
.list-filters .filter-actions .btn-ghost:focus-visible,
.list-filters .filter-actions .btn-ghost:active {
  background: var(--accent);
  border-color: #111111;
  color: #111;
}

.list-filters .filter-actions .btn-wide,
.settle-ops {
  white-space: nowrap;
}
.settle-ops .btn + .btn {
  margin-left: 6px;
}
.list-filters .filter-actions .btn-batch {
  width: 100%;
  min-width: 0;
  font-size: 13px;
}

/* 订单工具栏：主按钮 + 下拉，压缩平铺占用 */
.list-filters .filter-actions.is-order-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.list-filters .filter-actions.is-order-toolbar > .btn {
  width: auto;
  min-width: 88px;
  flex: 0 0 auto;
  padding: 0 12px;
}

/* 订单工具栏：与顶部筛选 theme-select 一致的一体下拉 */
.list-filters .filter-actions.is-order-toolbar .tb-dd {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  max-width: 100%;
}

.list-filters .filter-actions.is-order-toolbar .tb-dd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: auto;
  min-width: 88px;
  height: 32px;
  margin: 0;
  padding: 0 10px 0 12px;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
  box-shadow: none;
}

.list-filters .filter-actions.is-order-toolbar .tb-dd-btn:hover {
  background: var(--accent);
  border-color: #111111;
  color: #111;
}

.list-filters .filter-actions.is-order-toolbar .tb-dd.is-open .tb-dd-btn,
.list-filters .filter-actions.is-order-toolbar .tb-dd-btn:focus-visible {
  outline: none;
  background: var(--accent);
  border-color: #111111;
  color: #111;
}

.list-filters .filter-actions.is-order-toolbar .tb-dd-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-filters .filter-actions.is-order-toolbar .tb-caret {
  flex: 0 0 auto;
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
}

.list-filters .filter-actions.is-order-toolbar .tb-dd.is-open .tb-caret {
  opacity: 1;
}

/* 无下拉的单按钮（如仅「提交询价」） */
.list-filters .filter-actions.is-order-toolbar .tb-solo-btn {
  width: auto;
  min-width: 88px;
  flex: 0 0 auto;
  padding: 0 12px;
}

.list-filters .filter-actions.is-order-toolbar .tb-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  min-width: max(100%, 156px);
  margin: 0;
  padding: 4px 0;
  background: #fff;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.list-filters .filter-actions.is-order-toolbar .tb-menu-item {
  display: block;
  width: 100%;
  margin: 0;
  height: auto;
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}

.list-filters .filter-actions.is-order-toolbar .tb-menu-item:hover,
.list-filters .filter-actions.is-order-toolbar .tb-menu-item:focus-visible {
  background: #000;
  color: #fff;
}

.list-filters .filter-actions.is-order-toolbar .tb-menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
  color: var(--muted);
}

.list-filters .filter-actions.is-order-toolbar .tb-menu-item:disabled:hover {
  background: transparent;
  color: var(--muted);
}

.list-filters .filter-actions.is-order-toolbar .tb-menu-item.is-danger {
  color: var(--danger);
}

.list-filters .filter-actions.is-order-toolbar .tb-menu-item.is-danger:hover:not(:disabled),
.list-filters .filter-actions.is-order-toolbar .tb-menu-item.is-danger:focus-visible:not(:disabled) {
  background: #000;
  color: #fff;
}

.list-filters .filter-actions.is-order-toolbar .tb-globals {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.list-filters .filter-actions.is-order-toolbar .tb-globals .btn {
  width: auto;
  min-width: 88px;
}

.list-filters input,
.list-filters select {
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 400;
  border-radius: 2px;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  color: var(--ink);
}

.list-filters input::placeholder {
  color: var(--grid-line);
  font-weight: 400;
  opacity: 1;
}

.list-filters .date-ymd,
.list-filters .date-ymd input {
  background: transparent;
}

.list-filters .date-ymd input {
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.list-filters .date-ymd-seg {
  height: auto;
  padding: 0;
}
.list-filters .date-ymd-y { width: 2.8em; flex: 0 0 2.8em; }
.list-filters .date-ymd-m,
.list-filters .date-ymd-d { width: 1.45em; flex: 0 0 1.45em; }

.customer-invoice-cell .profile-drill {
  display: inline;
  max-width: 12rem;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.customer-invoice-cell .profile-drill.muted {
  color: var(--muted, #666666);
  text-decoration: none;
}
.customer-invoice-cell .profile-drill.muted:hover {
  color: #111;
  text-decoration: underline;
}

.invoice-snapshot-panel {
  margin: 0.75rem 0 0.25rem;
}
.invoice-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem 0.75rem;
}
.invoice-snapshot-cell {
  min-width: 0;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--grid-line, #e5e5e5);
  background: #f7f7f7;
}
.invoice-snapshot-label {
  display: block;
  color: var(--muted, #666666);
  font-size: 12px;
  margin-bottom: 0.2rem;
}
.invoice-snapshot-value {
  font-size: 13px;
  word-break: break-all;
  line-height: 1.35;
  user-select: text;
}
@media (max-width: 720px) {
  .invoice-snapshot-grid {
    grid-template-columns: 1fr;
  }
}

.customer-sales-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--grid-line);
  background: var(--header-bg, #f7f7f7);
  flex-shrink: 0;
  font-size: 13px;
}

.customer-sales-stats-label {
  color: var(--muted, #666666);
  font-weight: 600;
  margin-right: 4px;
}

.customer-sales-stat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 1px 8px;
  border: 1px solid var(--grid-line);
  background: #fff;
  white-space: nowrap;
}

.customer-sales-stat-chip strong {
  font-variant-numeric: tabular-nums;
  color: var(--primary, #000000);
}

.list-hint {
  margin: 0;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--muted);
  background: #f7f7f7;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.grid-scroll,
.status-logs-scroll {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #b0b0b0 transparent;
}

.grid-scroll::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
  display: block !important;
}

.grid-scroll::-webkit-scrollbar-thumb {
  background: #b0b0b0;
  border-radius: 2px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0;
  align-items: center;
}

input, select, textarea {
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  padding: 4px 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
}

input::placeholder,
textarea::placeholder {
  color: #999999;
  opacity: 1;
}

input:focus, select:focus, textarea:focus {
  outline: 1px solid #111;
  border-color: #111;
}

.theme-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}
.theme-select-native {
  display: none !important;
}
.theme-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  height: 32px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}
.theme-select-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: #f5f5f5;
}
.theme-select.is-open .theme-select-btn,
.theme-select-btn:focus-visible {
  outline: 1px solid #111;
  border-color: #111;
}
.theme-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.theme-select-caret {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
}
.theme-select-menu {
  position: fixed;
  z-index: 10000;
  margin: 0;
  padding: 4px 0;
  background: #fff;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}
.theme-select-opt {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-size: 14px;
  line-height: 1.3;
  padding: 6px 10px;
  cursor: pointer;
  box-sizing: border-box;
}
.theme-select-opt:hover,
.theme-select-opt.is-active,
.theme-select-opt.is-selected {
  background: #000;
  color: #fff;
}
.theme-select-opt:disabled,
.theme-select-opt:disabled:hover {
  background: transparent;
  color: var(--muted);
  cursor: not-allowed;
}

/* 禁止数字框滚轮改值 / 隐藏 spinner */
input[type='number'] {
  -moz-appearance: textfield;
}
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #c8c8c8;
  border-radius: 2px;
  padding: 3px 10px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  background: #ececec;
  color: var(--ink);
  white-space: nowrap;
  box-shadow: none;
  height: 30px;
}

.btn:hover { background: #e6e6e6; }
.btn:disabled,
button.badge:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: #111111;
  color: #111;
}
.btn-primary:hover { background: #f2f2f2; }

.btn-warn {
  background: var(--accent-2);
  border-color: #a34c20;
  color: #fff;
}

.btn-danger {
  background: #f5e0dd;
  border-color: #d4a8a2;
  color: var(--danger);
}

.btn-ghost {
  background: #fff;
  border-color: var(--grid-line);
}

.btn-link.logistics-edit {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: #111;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
}
.btn-link.logistics-edit:hover {
  color: #000;
}

/* Excel 风格 DataGrid（separate 以兼容 sticky 表头） */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 14px;
}

.data-grid,
.status-logs-table {
  table-layout: fixed;
  width: max-content;
  max-width: none;
}

th, td,
.data-grid th,
.data-grid td {
  border-right: 1px solid var(--grid-line);
  border-bottom: 1px solid var(--grid-line);
  padding: 4px 6px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.35;
  height: 34px;
  box-sizing: border-box;
}

.data-grid th:not(.col-check),
.data-grid td:not(.col-check),
.status-logs-table th,
.status-logs-table td {
  min-width: 28px;
  width: auto;
  padding: 6px 10px;
}

th:first-child,
td:first-child,
.data-grid th:first-child,
.data-grid td:first-child {
  border-left: 1px solid var(--grid-line);
}

thead tr:first-child th,
.data-grid thead tr:first-child th {
  border-top: 1px solid var(--grid-line);
}

th,
.data-grid th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  color: #1a1a1a;
  font-weight: 700;
  font-size: 14px;
  text-transform: none;
}

/* 列宽拖拽：表头右侧手柄 */
.data-grid.is-col-resizable,
.status-logs-table.is-col-resizable {
  table-layout: fixed;
}

.data-grid.is-col-resizable > thead > tr > th:not(.col-actions),
.status-logs-table.is-col-resizable > thead > tr > th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-grid.is-col-resizable > tbody > tr > td:not(.col-actions) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-grid th.col-actions,
.data-grid td.col-actions {
  min-width: 120px;
  white-space: nowrap;
  text-align: center;
  overflow: visible;
  text-overflow: clip;
}
.data-grid td.col-actions .btn {
  max-width: none;
  white-space: nowrap;
}

.status-logs-table.is-col-resizable > tbody > tr > td {
  overflow: hidden;
}

.status-logs-table.is-col-resizable .col-remark {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

th .col-resizer,
.data-grid th .col-resizer,
.status-logs-table th .col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 12;
  user-select: none;
  touch-action: none;
}

th .col-resizer::after,
.data-grid th .col-resizer::after,
.status-logs-table th .col-resizer::after {
  content: '';
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 3px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
}

th .col-resizer:hover,
th .col-resizer.is-dragging,
.data-grid th .col-resizer:hover,
.data-grid th .col-resizer.is-dragging,
.status-logs-table th .col-resizer:hover,
.status-logs-table th .col-resizer.is-dragging {
  background: rgba(0, 0, 0, 0.06);
}

th .col-resizer:hover::after,
th .col-resizer.is-dragging::after,
.data-grid th .col-resizer:hover::after,
.data-grid th .col-resizer.is-dragging::after,
.status-logs-table th .col-resizer:hover::after,
.status-logs-table th .col-resizer.is-dragging::after {
  background: rgba(0, 0, 0, 0.45);
}

body.is-col-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

body.is-col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.data-grid .col-check {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

/* 状态列：多枚徽章横向优先排列，禁止被表格 overflow/ellipsis 裁掉 */
.data-grid th.col-status-lead,
.data-grid td.col-status-lead {
  min-width: 168px;
  max-width: none;
  height: auto;
  min-height: 34px;
  white-space: normal;
  overflow: visible !important;
  text-overflow: clip;
  line-height: 1.45;
}
.data-grid.is-col-resizable > thead > tr > th.col-status-lead,
.data-grid.is-col-resizable > tbody > tr > td.col-status-lead {
  overflow: visible !important;
  text-overflow: clip;
}
.data-grid td.col-status-lead .status-badge-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.data-grid td.col-status-lead .badge {
  display: inline-block;
  margin: 0;
  vertical-align: middle;
}

/* 横向冻结列（可右键表头「冻结到此列」自由选择） */
.data-grid th.is-col-frozen,
.data-grid td.is-col-frozen {
  position: sticky;
  background: #fff;
}
.data-grid thead th.is-col-frozen {
  top: 0;
  background: var(--header-bg);
}
.data-grid tbody tr:nth-child(even) > td.is-col-frozen {
  background: var(--row-even);
}
.data-grid tbody tr:hover > td.is-col-frozen,
.data-grid tbody tr.row-selectable:hover > td.is-col-frozen {
  background: #e8e8e8;
}
.data-grid tbody tr.row-selected > td.is-col-frozen {
  background: #d4d4d4;
}
.data-grid tbody tr.row-receive-abnormal > td.is-col-frozen,
.data-grid tbody tr.row-selectable.row-ship-abnormal > td.is-col-frozen {
  background: #fef2f2;
}
.data-grid tbody tr.row-selectable.row-ship-abnormal.row-selected > td.is-col-frozen {
  background: #fecaca;
}

.col-freeze-menu {
  position: fixed;
  z-index: 9999;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--grid-line, #d4d4d4);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  display: none;
}
.col-freeze-menu.is-open {
  display: block;
}
.col-freeze-menu-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #1f2937;
}
.col-freeze-menu-item:hover:not(:disabled) {
  background: #000;
  color: #fff;
}
.col-freeze-menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.company-user-tree {
  min-width: 1180px;
}
.company-user-tree > thead > tr > th.col-expand,
.company-user-tree > tbody > tr > td.col-expand {
  position: sticky;
  left: 0;
  z-index: 5;
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
  padding: 0;
  background: #fff;
}
.company-user-tree > thead > tr > th.col-expand {
  z-index: 15;
  background: var(--header-bg);
}
.company-user-tree > thead > tr > th.col-check,
.company-user-tree > tbody > tr > td.col-check {
  left: 36px;
}
.company-user-tree > tbody > tr.is-open > td {
  background: #f7f7f7;
}
/* 展开行：取消树形左缩进空白条，子表贴满父表宽度 */
.company-user-tree > tbody > tr.row-expand-detail > td {
  padding: 0;
  height: auto;
  background: #f7f7f7;
  border-bottom: 1px solid var(--grid-line);
  vertical-align: top;
}
.company-user-tree > tbody > tr.row-expand-detail:hover > td {
  background: #f7f7f7;
}
.company-user-tree .nested-accounts-panel {
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-top: 1px solid var(--grid-line);
  background: #f7f7f7;
}
.row-expand-btn {
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: #fff;
  color: #111;
  font-size: 16px;
  line-height: 20px;
  cursor: pointer;
}
.row-expand-btn:hover {
  border-color: #111;
  background: var(--accent-hover);
}
.company-user-tree .data-grid-nested {
  width: 100%;
  min-width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  table-layout: auto;
  box-sizing: border-box;
}
.company-user-tree .data-grid-nested th,
.company-user-tree .data-grid-nested td,
.company-user-tree .data-grid-nested th.col-check,
.company-user-tree .data-grid-nested td.col-check {
  position: static;
  left: auto;
  z-index: auto;
}
.company-user-tree .data-grid-nested thead th {
  background: #f2f2f2;
}
.company-user-tree .data-grid-nested thead tr:first-child th {
  border-top: 0;
}
.company-user-tree .data-grid-nested th:first-child,
.company-user-tree .data-grid-nested td:first-child {
  border-left: 0;
}
.company-user-tree .data-grid-nested th:last-child,
.company-user-tree .data-grid-nested td:last-child {
  border-right: 0;
}
.company-user-tree .data-grid-nested tbody tr:last-child > td {
  border-bottom: 0;
}

.data-grid .col-check input[type='checkbox'] {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
}
.data-grid tbody tr.row-selectable {
  cursor: pointer;
}
.data-grid tbody tr.row-selectable:hover > td {
  background: #e8e8e8;
}
.data-grid tbody tr.row-selected > td {
  background: #d4d4d4;
}
.data-grid tbody tr.row-receive-abnormal > td {
  background: #fef2f2;
}
.data-grid tbody tr.row-selectable.row-ship-abnormal > td {
  background: #fef2f2;
}
.data-grid tbody tr.row-selectable.row-ship-abnormal.row-selected > td {
  background: #fecaca;
}

.grid-scroll tbody tr:nth-child(even),
.data-grid tbody tr:nth-child(even) {
  background: var(--row-even);
}

.grid-scroll tbody tr:hover,
.data-grid tbody tr:hover {
  background: var(--row-hover);
}

.badge {
  display: inline-block;
  padding: 0 5px;
  border-radius: 2px;
  font-size: 13px;
  line-height: 20px;
  border: 1px solid transparent;
  background: #f0f0f0;
}

.badge-wait { background: #fff3cd; color: #856404; border-color: #e6d59a; }
.badge-ok { background: #fff; color: #111; border-color: #111; }
.badge-orange { background: #ffedd5; color: #c2410c; border-color: #fdba74; }
.badge-info { background: #111; color: #fff; border-color: #111; }
.badge-gray { background: #f0f0f0; color: #666666; border-color: #d4d4d4; }
.badge-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
  font-weight: 600;
}
.reject-reason {
  max-width: 14rem;
  margin-left: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.status-logs-table tr.log-reject .col-remark {
  color: var(--danger);
  font-weight: 600;
}
.badge-click {
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  padding: 1px 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.badge-danger.badge-click {
  border: 1px solid #fca5a5;
}
.badge-ok.badge-click {
  border: 1px solid #111;
}
.badge-orange.badge-click {
  border: 1px solid #fdba74;
}
.badge-click:hover {
  filter: brightness(0.96);
}
.ship-alert-link {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.text-danger { color: #dc2626 !important; }
.money-due { color: #111; font-weight: 600; }
.money-open { color: #b45309; font-weight: 600; }
.money-refund { color: #b42318; font-weight: 600; }
.text-xs { font-size: 12px; line-height: 1.35; }
.mt-1 { margin-top: 4px; }
.font-semibold { font-weight: 600; }
.row-ship-abnormal > td {
  background: #fef2f2;
}
.row-ship-abnormal > td:first-child {
  box-shadow: inset 3px 0 0 #dc2626;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.stat {
  background: #fff;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  padding: 8px 10px;
}

.stat .label { color: var(--muted); font-size: 11px; }
.stat .value { font-size: 18px; font-weight: 700; margin-top: 2px; }

.finance-fold {
  position: relative;
  z-index: 4;
  border-top: 0;
  flex-shrink: 0;
}

.finance-fold::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    var(--grid-line) 0,
    var(--grid-line) calc(50% - 26px),
    transparent calc(50% - 12px),
    transparent calc(50% + 12px),
    var(--grid-line) calc(50% + 26px),
    var(--grid-line) 100%
  );
}

.finance-burger {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 2;
  padding: 0;
  color: #000000;
  background: transparent;
  border: none;
  transform: translate(-50%, -50%);
}

.finance-burger:hover,
.finance-burger:focus-visible {
  background: transparent;
  border: none;
  transform: translate(-50%, -50%);
}

.boss-finance .grid-block > [role="tabpanel"] {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* 利润大盘：紧凑指标卡 */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
}

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

.kpi-card-waive {
  background: #fff7ed;
  border-color: #f97316;
}

.kpi-card-waive .kpi-label,
.kpi-card-waive .kpi-value {
  color: #c2410c;
}

.kpi-card .kpi-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  flex: 0 0 auto;
}

.kpi-tip-bubble {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 5;
  width: 280px;
  padding: 8px 10px;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: #fff;
  color: var(--text, #1d2430);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  box-shadow: 0 6px 18px rgba(15, 28, 46, 0.12);
}

.kpi-tip:hover .kpi-tip-bubble,
.kpi-tip:focus .kpi-tip-bubble {
  display: block;
}

.kpi-card .kpi-value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.kpi-card .kpi-sub {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
}

.kpi-card .kpi-line {
  margin-top: 6px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.kpi-line.is-link {
  cursor: pointer;
}
.kpi-line.is-link:hover b {
  color: #111;
}
.kpi-line.is-note {
  display: block;
  line-height: 1.45;
  white-space: normal;
}
.kpi-foot-link {
  display: inline-block;
  margin-top: 8px;
  color: #111;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.audit-col,
.audit-cell {
  background: #fff7ed;
}
.audit-cell {
  font-weight: 600;
  white-space: normal;
  line-height: 1.4;
}
.kpi-card .kpi-line b {
  color: var(--text, #1d2430);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.kpi-card.kpi-wide {
  grid-column: span 2;
}

/* 工作台卡片：与利润大盘来源板块同款，可点击 */
button.kpi-card-click {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

button.kpi-card-click:hover {
  border-color: #111;
  background: #ffffff;
}

button.kpi-card-click.kpi-card-danger {
  border-color: #e8a0a0;
  background: #fff5f5;
}

button.kpi-card-click.kpi-card-danger .kpi-label {
  color: var(--danger);
}

button.kpi-card-click.kpi-card-danger:hover {
  border-color: var(--danger);
  background: #ffe8e8;
}

tr.row-voided td {
  opacity: 0.72;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

tr.row-voided td .badge,
tr.row-voided td .btn {
  text-decoration: none;
  opacity: 1;
}

.dash-block {
  margin-bottom: 4px;
}

.dash-block .grid-block-title {
  margin: 0;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 700;
}

.dash-block .kpi-grid {
  padding-top: 0;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15,28,46,.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 50;
  padding: 24px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal {
  width: min(42rem, 100%); /* max-w-2xl */
  background: #fff;
  border-radius: 2px;
  border: 1px solid var(--grid-line);
  padding: 14px 16px;
  margin: auto 0;
  max-height: none;
  overflow: visible;
  box-shadow: none;
  flex-shrink: 0;
}

.modal.modal-sm {
  width: min(28rem, 100%); /* max-w-md / lg */
}

.modal.modal-lg {
  width: min(48rem, 100%); /* max-w-3xl */
}

.modal.status-logs-modal {
  width: min(52rem, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* 中间「流转记录」吃满剩余高度，才能把滚轮交给内部列表 */
.modal.status-logs-modal > .inquiry-form-group {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  margin-bottom: 0;
}

.modal.status-logs-modal > .form-actions {
  flex-shrink: 0;
  margin-top: 12px;
}

.modal.status-logs-modal .status-logs-scroll {
  align-self: stretch;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.status-logs-scroll {
  align-self: stretch;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 0 12px;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
}

.status-logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.status-logs-table th,
.status-logs-table td {
  border: none;
  border-bottom: 1px solid var(--grid-line);
  padding: 8px 10px;
  height: auto;
  vertical-align: top;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.status-logs-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--header-bg);
  font-weight: 700;
  white-space: nowrap;
}

.status-logs-table .col-time {
  white-space: nowrap;
}

.status-logs-table .col-remark {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.modal h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

/* 两列栅格：短字段并排，长字段 span-2 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem; /* gap-5 */
  align-items: start;
}

.form-grid > .span-2,
.form-grid > label.span-2,
.form-grid > .form-field.span-2 {
  grid-column: 1 / -1;
}

.form-grid > label,
.form-grid > .form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.875rem; /* text-sm */
  font-weight: 500;
  color: #4b5563; /* text-gray-600 */
  min-width: 0;
}

.form-grid > label > span.field-label,
.form-grid .field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
  margin-bottom: 0;
}

.source-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 6px 0 2px;
}
.source-radios label,
.source-radios .source-radio-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.source-radios input[type='radio'] {
  width: auto;
  margin: 0;
  cursor: pointer;
}
/* 仅点圆点本身才切换；点文字不触发（送货方式等） */
.source-radios-box-only {
  cursor: default;
}
.source-radios-box-only .source-radio-item {
  cursor: default;
}
.source-radios-box-only .source-radio-item > span {
  pointer-events: none;
}
.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--muted);
}
.form-static-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  background: #f5f5f5;
  border: 1px dashed var(--grid-line);
  color: var(--ink);
  font-size: 13px;
}
@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
input.shake {
  animation: field-shake 0.45s ease;
  border-color: #b42318 !important;
  background: #fef2f2;
}
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-width: 0;
}
.currency-price-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden; /* 避免币种框右侧溢出灰线/假滚动条 */
}
.form-grid .currency-price-row > select {
  width: 138px;
  flex: 0 0 138px;
}
/* theme-select 默认 width:100% / flex:1，在并排价币行会挤出残影竖线 */
.form-grid .currency-price-row > .theme-select,
.inquiry-submit-grid .currency-price-row > .theme-select {
  display: block;
  width: 138px;
  flex: 0 0 138px;
  min-width: 0;
  max-width: 45%;
  overflow: hidden;
}
.form-grid .currency-price-row > .theme-select .theme-select-btn,
.inquiry-submit-grid .currency-price-row > .theme-select .theme-select-btn {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.form-grid .currency-price-row > input,
.inquiry-submit-grid .currency-price-row > input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

/* 表单中间的辅助按钮：绝不拉满整行 */
.form-grid > .btn,
.form-grid > button.btn,
.form-inline-actions > .btn {
  width: fit-content;
  justify-self: start;
}

.form-inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  grid-column: 1 / -1;
}

.form-inline-actions .muted {
  font-size: 0.875rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem; /* gap-3 */
  margin-top: 1.25rem;
  padding-top: 0.25rem;
}

.form-actions .btn {
  width: fit-content;
}

.login-card .form-grid {
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* 登录：公司代码(1) + 公司名称(4) 同列并排 */
.login-company-field .login-company-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.login-company-field .login-company-code {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.login-company-field .login-company-name {
  flex: 4 1 0;
  width: auto;
  min-width: 0;
}

.login-remember {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.login-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted, #666666);
  cursor: pointer;
  user-select: none;
}

.login-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid > .span-2,
  .form-grid > label.span-2,
  .form-grid > .form-field.span-2 {
    grid-column: auto;
  }
}

/* 确认 / 提示弹窗：始终屏幕正中 */
.dialog-mask {
  z-index: 70;
  align-items: center;
  padding: 16px;
}

.dialog-panel {
  width: min(26rem, 100%);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 14px;
  padding: 14px 16px 12px;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  animation: dialog-in 0.12s ease-out;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dialog-icon {
  grid-row: 1;
  grid-column: 1;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f4f4f4;
  color: #111;
  flex-shrink: 0;
}

.dialog-panel.dialog-danger .dialog-icon {
  background: #f8e8e5;
  color: var(--danger);
}

.dialog-body {
  grid-row: 1;
  grid-column: 2;
  min-width: 0;
}

.dialog-body h3 {
  margin: 2px 0 8px;
  font-size: 1.05rem;
}
.dialog-panel:has(.dialog-facts) {
  width: min(36rem, 100%);
}
.dialog-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 0 0 10px;
}
.dialog-fact {
  min-width: 0;
}
.dialog-fact dt {
  margin: 0;
  font-size: 12px;
  color: #666666;
}
.dialog-fact dd {
  margin: 2px 0 0;
  font-weight: 650;
  word-break: break-all;
}
.dialog-fact.is-danger dd,
.dialog-body h3.text-danger,
h3.text-danger {
  color: var(--danger);
}

.dialog-msg {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.dialog-actions {
  grid-row: 2;
  grid-column: 1 / -1;
  margin-top: 0;
  justify-content: flex-end;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #000000;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 80;
  max-width: 360px;
  font-size: .9rem;
}

.toast.err { background: var(--danger); }

.muted { color: var(--muted); }
.settle-freeze-reason {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 400;
  color: #999999;
  white-space: normal;
}
/* 勿对 td 使用 display:flex，否则行高不会与其它列一起撑开 */
.row-actions {
  white-space: nowrap;
  vertical-align: middle;
}

.row-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 6px;
  margin-right: 3px;
  font-size: 13px;
  vertical-align: middle;
}
.row-actions .btn:last-child {
  margin-right: 0;
}

.receive-pics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.receive-pics img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--grid-line);
  background: #fff;
}
.ship-shot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 96px;
}
.ship-shot .btn {
  padding: 2px 6px;
  font-size: 12px;
}
.receive-pics img {
  cursor: pointer;
}
.thumb-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.thumb-pic {
  width: 40px;
  height: 40px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}
.image-preview-mask {
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-preview-frame {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}
.image-preview-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  line-height: 1;
}
.image-preview-frame img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  background: #fff;
  padding: 4px;
  border-radius: 4px;
}
.ship-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  vertical-align: middle;
  max-width: 280px;
}
.ship-check-inline .ship-alert-link {
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: center;
  gap: 8px 10px;
  flex-shrink: 0;
  margin: 0;
  padding: 6px 10px;
  border-top: 1px solid var(--grid-line);
  background: #f5f5f5;
  font-size: 14px;
  line-height: 1.2;
  color: var(--muted);
}

/* 共 X 条 / 每页 / 跳至 / 页码文字：禁止竖排换字，禁止被下拉框挤扁 */
.pager > span,
.pager > label,
.pager > .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.pager label {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-width: max-content;
  white-space: nowrap;
}

/* 覆盖全局 theme-select 的 width:100% / flex:1，避免把「每页」挤成竖排 */
.pager .theme-select {
  display: inline-block;
  width: auto;
  min-width: 64px;
  flex: 0 0 auto;
}

.pager .theme-select-btn {
  width: auto;
  min-width: 64px;
  height: 28px;
  padding: 0 8px;
}

.pager select {
  height: 28px;
  padding: 0 4px;
  font-size: 14px;
  flex: 0 0 auto;
}

.pager-jump input {
  width: 56px;
  height: 28px;
  padding: 0 4px;
  font-size: 14px;
  flex: 0 0 auto;
}

.fund-kpi-note {
  margin: 0 8px 6px;
  font-size: 12px;
}

.pager-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.pager-pages .btn {
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  font-size: 13px;
}

.pager-pages .btn.active {
  background: var(--accent);
  border-color: #111111;
  color: #111;
}

.settle-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.settle-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.list-stack {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  gap: 0;
}

.expense-summary-row {
  display: flex;
  flex: 0 0 auto;
  min-height: 140px;
  max-height: 42%;
  gap: 0;
  border-bottom: 1px solid var(--grid-line);
}

.expense-payer-block {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.invoice-pending-hint {
  display: inline-block;
  font-size: 12px;
  padding: 2px 6px;
  opacity: 0.75;
}

.list-stack .grid-block {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
}

.list-stack .grid-block-title {
  flex-shrink: 0;
  margin: 0;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 700;
  background: var(--header-bg);
  border-bottom: 1px solid var(--grid-line);
}

/* 账号权限配置面板 */
.modal.modal-perm-wide {
  max-width: min(920px, 96vw);
  max-height: 90vh;
  overflow: auto;
}
.perm-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--grid-line, #e5e7eb);
  border-radius: 8px;
  background: #f7f7f7;
}
.perm-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.perm-panel-head .muted { font-size: 12px; }
.perm-template-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--grid-line, #e5e7eb);
}
.perm-template-select {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  width: 220px;
  max-width: 100%;
  flex: 0 0 auto;
}
.perm-template-select select {
  width: 100%;
  max-width: 220px;
}
.perm-template-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  align-self: flex-end;
  gap: 6px;
}
.perm-template-actions .btn {
  width: auto;
  padding: 2px 8px;
  font-size: 12px;
  white-space: nowrap;
}
.inquiry-brief {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
}
.inquiry-brief-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.modal:has(.inquiry-brief),
.modal.modal-inquiry {
  width: min(1000px, calc(100vw - 32px));
  max-width: 1000px;
  container-type: inline-size;
  container-name: inquiry-modal;
}
.inquiry-layout {
  display: grid;
  grid-template-columns: minmax(0, 20fr) minmax(0, 25fr) minmax(0, 25fr);
  gap: 8px;
  align-items: stretch;
}
.inquiry-block {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 8px;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: #fff;
  box-sizing: border-box;
}
.inquiry-block .inquiry-fields {
  flex: 1 1 auto;
}
.inquiry-block-finance {
  grid-column: 1 / -1;
}
.inquiry-block h4 {
  margin: 0 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e5e5e5;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
.inquiry-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: row;
  column-gap: 16px;
  row-gap: 6px;
  align-items: start;
  justify-items: stretch;
}
.finance-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.finance-ccy {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--ink);
}
.finance-ccy-k {
  margin-right: 4px;
  font-weight: 400;
  color: var(--muted);
}
.finance-bands {
  display: flex;
  flex-direction: column;
}
.finance-band {
  padding: 8px 0 10px;
  border-bottom: 1px solid #e5e5e5;
}
.finance-band:first-child {
  padding-top: 2px;
}
.finance-band:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}
.finance-band-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--ink);
}
.finance-lanes,
.finance-clusters {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.finance-lane,
.finance-cluster {
  min-width: 0;
  flex: 1 1 0;
}
.finance-lane + .finance-lane,
.finance-cluster + .finance-cluster {
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid #e5e5e5;
}
.finance-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 8px;
  align-items: start;
}
.finance-fields .inquiry-k,
.finance-fields .inquiry-v,
.finance-fields .inquiry-sub {
  overflow-wrap: anywhere;
}
.finance-fields > .inquiry-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.finance-fields .inquiry-k {
  line-height: 1.2;
}
.finance-fields .inquiry-v {
  margin-top: 1px;
  line-height: 1.25;
}
.finance-fields .inquiry-v.is-dash {
  font-weight: 500;
  color: var(--muted);
}
.finance-band.is-profit {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, #e5e5e5);
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 7%, #fff);
}
.finance-band.is-profit:last-child {
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 22%, #e5e5e5);
}
.finance-band.is-profit .inquiry-field.is-profit .inquiry-v:not(.is-dash) {
  font-size: 15px;
  font-weight: 700;
}
.inquiry-field {
  min-width: 0;
  border: 0;
  background: transparent;
}
.inquiry-k {
  display: block;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--muted);
}
.inquiry-v {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.inquiry-field.is-order .inquiry-v {
  font-size: 16px;
  font-weight: 700;
}
.inquiry-ccy {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.inquiry-sub {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--muted);
}
.modal-inquiry .inquiry-form-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}
.modal-inquiry .inquiry-form-groups.is-flat {
  display: block;
}
.inquiry-form-group {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 8px;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: #fff;
  box-sizing: border-box;
}
.inquiry-form-group.is-plain {
  padding: 0;
  border: 0;
  background: transparent;
}
.ship-panels .inquiry-form-group:not(.is-plain) {
  padding: 0.9rem 1rem 1rem;
}
.ship-panels .inquiry-form-group:not(.is-plain) .form-grid {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 0.85rem;
}
.ship-panels .inquiry-form-group .form-grid > label {
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ship-panels .inquiry-form-group .form-grid > label:has(.upload-card) {
  flex: 1 1 auto;
}
.ship-panels .upload-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  height: auto;
  min-height: 0;
  overflow: visible;
}
.pic-wall {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
}
.pic-card,
.pic-card-add {
  position: relative;
  width: 100px;
  height: 100px;
  flex: 0 0 100px;
  box-sizing: border-box;
}
.pic-card {
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  overflow: hidden;
  background: #f7f7f7;
}
.pic-file-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #666666;
  background: #f7f7f7;
}
.pic-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pic-card-ops {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.pic-card:hover .pic-card-ops,
.pic-card:focus-within .pic-card-ops {
  opacity: 1;
}
.pic-card-ops button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.pic-card-ops button:hover {
  background: rgba(255, 255, 255, 0.16);
}
.pic-card-ops svg {
  width: 18px;
  height: 18px;
}
.upload-hit {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 6em;
  padding: 1rem 0.75rem;
  border: 1px dashed var(--grid-line);
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 4%, #fff);
  color: #111;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
}
.upload-hit:hover {
  border-color: #111;
  background: color-mix(in srgb, var(--accent) 8%, #fff);
}
.upload-hit.pic-card-add {
  width: 100px;
  height: 100px;
  min-height: 100px;
  flex: 0 0 100px;
  padding: 8px 4px;
  font-size: 12px;
  line-height: 1.2;
}
.upload-plus {
  width: 1.35em;
  height: 1.35em;
}
/* 整框可点：input 铺满虚线区，避免只点中 1px 裁切点才弹出选文件 */
.upload-hit .upload-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.upload-hit > *:not(.upload-input) {
  pointer-events: none;
  position: relative;
  z-index: 1;
}
.upload-hint {
  color: color-mix(in srgb, var(--muted) 58%, #fff);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
}
.ship-panels .receive-pics {
  margin: 0;
}
.inquiry-form-group .form-grid {
  flex: 1 1 auto;
}
.inquiry-form-group h4 {
  margin: 0 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e5e5e5;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
.modal-inquiry .form-grid,
.modal-inquiry .inquiry-form-group:not(.is-plain) .form-grid,
.modal-inquiry .inquiry-form-groups.is-flat .form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row;
  gap: 16px;
  align-items: stretch;
}
.inquiry-submit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: center;
}
.modal .form-grid.inquiry-submit-grid,
.modal-inquiry .form-grid.inquiry-submit-grid,
.modal-inquiry .inquiry-form-groups.is-flat .form-grid.inquiry-submit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
}
.modal-inquiry .form-grid.inquiry-submit-grid > .span-2,
.modal-inquiry .form-grid.inquiry-submit-grid > label.span-2,
.modal-inquiry .form-grid.inquiry-submit-grid > div.span-2 {
  grid-column: 1 / -1;
}
.customer-credit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}
.customer-credit-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 32px;
}
.customer-credit-days {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
}
.customer-credit-days > span {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--muted, #666666);
}
.customer-credit-days > input,
.customer-credit-line > input {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: 32px;
  box-sizing: border-box;
}
/* —— 客户对账：复用全站 list-filters（字段上行 / 操作下行靠左） —— */
.customer-ar-page .list-filters {
  overflow: visible;
}
.customer-ar-page .ar-customer-filter {
  overflow: visible;
  z-index: 6;
}
.customer-ar-page .ar-customer-filter .keyword-group .combo {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--filter-h);
  position: relative;
}
.customer-ar-page .ar-customer-filter .keyword-group .combo > input {
  width: 100%;
  height: var(--filter-h);
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--grid-line);
  border-right: 0;
  border-radius: 2px 0 0 2px;
  background: transparent;
  font-weight: 400;
  box-sizing: border-box;
  box-shadow: none;
}
.customer-ar-page .ar-customer-filter .keyword-group .combo > input:focus {
  outline: none;
}
.customer-ar-page .ar-customer-filter .keyword-group:focus-within .combo > input {
  border-color: #111;
}
.customer-ar-page .ar-customer-filter .combo-list {
  left: 0;
  right: 0;
  min-width: 100%;
}

/* 对账操作栏：当月美元基准汇率填入（尺寸对齐操作按钮） */
.customer-ar-page .list-filters .filter-actions .ar-benchmark-inline-input {
  width: 100%;
  min-width: 0;
  height: var(--filter-h);
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  box-sizing: border-box;
  text-align: center;
}
.customer-ar-page .list-filters .filter-actions .ar-benchmark-inline-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}
.customer-ar-page .list-filters .filter-actions .ar-benchmark-inline-input:focus {
  outline: none;
  border-color: #111;
}

/* 对账 KPI：与采购支出页同款 kpi-grid 尺寸 */
.ar-kpi-grid {
  flex-shrink: 0;
}
.ar-kpi-grid .kpi-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.ar-kpi-grid .kpi-card-danger {
  border-color: #e8a0a0;
  background: #fff5f5;
}
.ar-kpi-grid .kpi-card-danger .kpi-label,
.ar-kpi-grid .kpi-card-danger .kpi-value {
  color: var(--danger);
}

.customer-ar-page tr.row-currency-locked td {
  opacity: 0.55;
}

.ar-alloc {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ar-collect-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 10px;
  font-size: 13px;
}
.ar-collect-summary-modal {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #f5f5f5;
  border: 1px solid var(--grid-line);
  border-radius: 8px;
}
.text-ok {
  color: #111;
}
.customer-credit .modal-check {
  flex: 0 0 auto;
  min-height: 32px;
}
.customer-credit .modal-check input[type='checkbox'] {
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  flex: 0 0 14px;
}
.inquiry-submit-grid .text-danger {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}
.modal-inquiry .form-grid > label,
.modal-inquiry .form-grid > .form-field,
.inquiry-submit-grid > label,
.inquiry-submit-grid > div {
  height: auto;
  min-width: 0;
  align-self: center;
}
/* 右侧单选区块与左侧 label 同结构，保证「客户目标价 / 客户要求」齐平 */
.inquiry-submit-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}
.inquiry-submit-grid .source-radios {
  min-height: 32px;
  padding: 0;
  align-items: center;
}
.modal-inquiry .form-grid input:not([type='checkbox']):not([type='radio']):not([type='file']),
.modal-inquiry .form-grid .theme-select-btn,
.inquiry-submit-grid input:not([type='checkbox']):not([type='radio']):not([type='file']),
.inquiry-submit-grid .theme-select-btn {
  height: 32px;
  box-sizing: border-box;
}
.modal.ship-panels .inquiry-form-group:not(.is-plain) .form-grid {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 0.85rem;
}
.modal.ship-panels .inquiry-form-group .form-grid > label {
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}
.modal.ship-panels .inquiry-form-group .form-grid > label:has(.upload-card) {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}
.modal.ship-panels .inquiry-form-group:has(.upload-card) .form-grid {
  grid-template-rows: auto;
  height: auto;
  min-height: 140px;
  overflow: visible;
}
.modal.receive-problem .inquiry-form-groups {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.modal.receive-problem .inquiry-form-group {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
}
.modal.ship-panels.receive-problem .inquiry-form-group .form-grid.receive-pair {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-content: stretch;
  height: 100%;
  gap: 6px;
  margin: 0;
  min-height: 0;
}
.modal.receive-problem .receive-pair-k,
.modal.receive-problem .upload-hint {
  display: flex;
  align-items: center;
  flex: 0 0 22px;
  height: 22px;
  margin: 0;
  line-height: 1.45;
}
.modal.receive-problem .receive-pair-k {
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
}
.modal.receive-problem .receive-pair > textarea {
  flex: 1 1 140px;
  min-height: 140px;
  height: auto;
  margin: 0;
  resize: none;
  box-sizing: border-box;
}
.modal.receive-problem .receive-pair > .upload-card {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  margin: 0;
  gap: 6px;
}
.modal.receive-problem .upload-hint {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
}
.modal-inquiry .form-grid > .span-2,
.modal-inquiry .form-grid > label.span-2,
.modal-inquiry .form-grid > .form-field.span-2 {
  grid-column: auto;
}
.modal-inquiry .form-grid > .span-all,
.modal-inquiry .form-grid > .form-group-title {
  grid-column: 1 / -1;
}
.form-group-title {
  margin: 4px 0 0;
  padding: 0 0 4px;
  border-bottom: 1px solid #e5e5e5;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
@container inquiry-modal (max-width: 760px) {
  .inquiry-layout,
  .modal-inquiry .inquiry-form-groups,
  .modal-inquiry .inquiry-form-groups.is-flat .form-grid {
    grid-template-columns: 1fr;
  }
  .finance-lanes,
  .finance-clusters {
    flex-direction: column;
  }
  .finance-lane + .finance-lane,
  .finance-cluster + .finance-cluster {
    margin-left: 0;
    margin-top: 8px;
    padding-left: 0;
    padding-top: 8px;
    border-left: 0;
    border-top: 1px solid #e5e5e5;
  }
  .modal.receive-problem .inquiry-form-groups {
    flex-direction: column;
  }
}
.perm-module {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--grid-line, #e5e7eb);
  border-radius: 8px;
  background: #fff;
}
.perm-module-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--grid-line, #e5e7eb);
}
.perm-module-head strong {
  font-size: 14px;
  color: #000000;
}
.perm-module-group {
  font-size: 12px;
}
.perm-sub {
  margin-top: 8px;
}
.perm-sub-title {
  font-size: 12px;
  font-weight: 600;
  color: #666666;
  margin-bottom: 4px;
}
.perm-select-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  margin: 0;
}
.perm-select-all input {
  width: auto;
  margin: 0;
}
.perm-scope-hint {
  font-size: 12px;
  font-weight: 400;
}
.dialog-prompt {
  display: block;
  margin-top: 10px;
}
.dialog-prompt input {
  width: 100%;
  box-sizing: border-box;
}
.dialog-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}
.dialog-check input {
  margin-top: 2px;
  flex-shrink: 0;
}
.perm-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.perm-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
}
.perm-check input { width: auto; margin: 0; }
.modal-check-row {
  flex-direction: row;
  align-items: center;
}
.modal-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.modal-check input {
  width: auto;
  margin: 0;
}
/* 录入报价：无货勾选在底价下方；仅点勾选框本身才切换，点文字不触发 */
.inquiry-submit-grid > .quote-nostock-check,
.modal-inquiry .form-grid.inquiry-submit-grid > .quote-nostock-check {
  grid-column: 1 / -1;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  height: auto;
  min-height: 28px;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 500;
  color: var(--ink);
  cursor: default;
  user-select: none;
}
.inquiry-submit-grid > .quote-nostock-check input {
  width: auto;
  height: auto;
  margin: 0;
  cursor: pointer;
}
.inquiry-submit-grid > .quote-nostock-check > span {
  pointer-events: none;
}
.perm-scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}
.perm-scope {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  min-width: 200px;
}
.perm-scope select { max-width: 220px; }
.btn-sm { padding: 2px 8px; font-size: 12px; }

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

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: 100vh;
    overflow: hidden;
  }
  .shell.sidebar-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: 0 1fr;
  }
  .sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: 120px;
    overflow: auto;
  }
  .shell.sidebar-collapsed .sidebar {
    max-height: 0;
    padding: 0;
  }
  .brand { width: 100%; border: 0; margin: 0; padding-bottom: 4px; }
  .nav-btn { width: auto; }
  .main { height: auto; min-height: 0; }
}

/* 利润大盘：来源 / 销售明细 Tab（仅前端显隐） */
.panel-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.panel-tab {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  padding: 8px 14px;
  cursor: pointer;
  margin-bottom: -1px;
}
.panel-tab:hover {
  color: var(--ink);
}
.panel-tab.active {
  color: #111;
  border-bottom-color: #111;
  font-weight: 600;
}

.company-contact-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}
.company-contact-bar input {
  height: 32px;
  flex: 1 1 240px;
  max-width: 360px;
  font-weight: 700;
  word-break: break-all;
}

.label-print-modal { width: min(520px, 100%); }
.label-print-check-note {
  margin: 0 0 8px;
  color: #445;
  font-size: 13px;
  line-height: 1.45;
}
.label-print-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}
.label-preview-stage {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
  background: #f3f5f8;
  border-radius: 8px;
}
.label-print-root { display: none; }
.label-sheet {
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid #222;
  background: #fff;
  color: #111;
}
.label-line {
  display: grid;
  grid-template-columns: 2.8em minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px dashed #ccc;
  font-size: 15px;
  line-height: 1.35;
}
.label-line:last-child { border-bottom: 0; }
.label-line > span {
  color: #555;
  font-weight: 600;
  white-space: nowrap;
}
.label-line > strong {
  font-weight: 700;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 标签打印：不锁纸张；字号/边距跟页宽高走，小纸也能打全 */
@media print {
  body.printing-labels {
    margin: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.printing-labels #app > :not(.label-print-root) {
    display: none !important;
  }
  body.printing-labels .label-print-root {
    display: block !important;
    width: 100%;
  }
  body.printing-labels .label-sheet {
    max-width: none;
    width: 100%;
    min-height: 100vh;
    box-sizing: border-box;
    border: 0;
    margin: 0;
    padding: clamp(1mm, 3vmin, 4mm) clamp(1.5mm, 4vmin, 5mm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(0.2mm, 0.8vmin, 1.5mm);
    font-size: clamp(8px, min(5.2vw, 11vh), 16px);
    page-break-after: always;
    break-after: page;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  body.printing-labels .label-sheet:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  body.printing-labels .label-line {
    grid-template-columns: 2.6em minmax(0, 1fr);
    gap: clamp(1mm, 2vmin, 3mm);
    padding: clamp(0.2mm, 0.7vmin, 1.2mm) 0;
    font-size: inherit;
    line-height: 1.2;
    border-bottom-color: #999;
  }
}

.slip-print-modal { width: min(980px, 100%); }
.slip-format { display: flex; gap: 8px; margin: 8px 0; }
.slip-preview-stage {
  overflow: auto;
  max-height: 68vh;
  background: #f3f4f6;
  padding: 12px;
}
.slip-print-root { display: none; }
.slip-sheet {
  width: 190mm;
  margin: 0 auto;
  background: #fff;
  color: #111;
  padding: 4mm 5mm 6mm;
  box-sizing: border-box;
  font-family: SimSun, "Songti SC", serif;
  font-size: 12px;
}
.slip-sheet.carbon { width: 229mm; }
.slip-title {
  text-align: center;
  font-family: SimHei, "Heiti SC", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  margin: 0 0 3mm;
}
.slip-meta {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.2mm 8mm;
  font-family: SimHei, "Heiti SC", sans-serif;
  margin-bottom: 2mm;
}
.slip-meta .span-2 { grid-column: span 2; }
/* 出库单打印：不锁纸张；窄纸字号/内边距跟着收，超长自然续页 */
@media print {
  body.printing-slips {
    zoom: 1 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.printing-slips .slip-sheet {
    width: 100% !important;
    max-width: none !important;
    padding: clamp(2mm, 1.2vw, 6mm) clamp(2mm, 1.5vw, 8mm) !important;
    font-size: clamp(8px, 1.55vw, 12px);
  }
  body.printing-slips .slip-title {
    font-size: clamp(12px, 2.8vw, 22px);
    margin-bottom: clamp(1mm, 0.8vw, 3mm);
    letter-spacing: 0.04em;
  }
  body.printing-slips .slip-meta,
  body.printing-slips .slip-total,
  body.printing-slips .slip-notes,
  body.printing-slips .slip-sign {
    font-size: inherit;
  }
  body.printing-slips .slip-meta {
    grid-template-columns: 1fr;
    gap: 0.6mm 0;
  }
}
.slip-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.slip-table thead { display: table-header-group; }
.slip-table tr { break-inside: avoid; page-break-inside: avoid; }
.slip-table th, .slip-table td {
  border: 1px solid #111;
  min-height: 7mm;
  height: auto;
  padding: 1mm 1.2mm;
  font-weight: 400;
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  overflow: hidden;
  box-sizing: border-box;
}
.slip-table th:nth-child(1), .slip-table td:nth-child(1) { width: 15%; font-size: 10px; }
.slip-table th:nth-child(2), .slip-table td:nth-child(2) { width: 22%; }
.slip-table th:nth-child(3), .slip-table td:nth-child(3) { width: 11%; }
.slip-table th:nth-child(4), .slip-table td:nth-child(4) { width: 12%; font-size: 10px; }
.slip-table th:nth-child(5), .slip-table td:nth-child(5) { width: 6%; text-align: center; }
.slip-table th:nth-child(6), .slip-table td:nth-child(6) { width: 8%; text-align: right; }
.slip-table th:nth-child(7), .slip-table td:nth-child(7) { width: 13%; text-align: right; }
.slip-table th:nth-child(8), .slip-table td:nth-child(8) { width: 13%; text-align: right; }
.slip-table th { text-align: center; font-family: SimSun, "Songti SC", serif; font-size: 11px; }
@media print {
  body.printing-slips .slip-table th,
  body.printing-slips .slip-table td {
    font-size: clamp(7px, 1.35vw, 10px);
    padding: clamp(0.4mm, 0.35vw, 1mm) clamp(0.5mm, 0.4vw, 1.2mm);
    min-height: 0;
  }
}
.slip-total {
  display: flex;
  justify-content: space-between;
  gap: 8mm;
  margin-top: 2mm;
  font-family: SimHei, "Heiti SC", sans-serif;
}
.slip-notes { margin-top: 1.5mm; line-height: 1.45; font-family: SimHei, "Heiti SC", sans-serif; }
.slip-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6mm;
  margin-top: 4mm;
  font-family: SimHei, "Heiti SC", sans-serif;
}
/* 针式三联与 A4 一样打整张电子单；carbon 仅控制预览/纸幅宽度 */
.slip-inline-input {
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  padding: 2px 6px;
  font: inherit;
  color: #111;
  background: #fff;
  min-width: 8em;
  max-width: 100%;
}
.slip-company-input {
  font-size: inherit;
  font-weight: inherit;
  text-align: center;
  min-width: 10em;
  margin-right: 2px;
}
@media print {
  .slip-inline-input {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }
}

@media print {
  body.printing-slips #app > :not(.slip-print-root) { display: none !important; }
  body.printing-slips .slip-print-root { display: block !important; }
  body.printing-slips .slip-sheet {
    page-break-after: always;
    break-after: page;
  }
  body.printing-slips .slip-sheet:last-child {
    page-break-after: auto;
    break-after: auto;
  }
}

.modal-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}
.modal-tab {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--grid-line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}
.modal-tab.is-on {
  background: var(--accent);
  color: #111;
  border-color: #111;
}
.preview-toolbar {
  margin: 0 0 14px;
  padding: 0 0 12px;
  border-bottom: 2px solid var(--grid-line);
}
.fund-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 280px);
  gap: 16px;
  align-items: start;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--grid-line);
  border-radius: 8px;
  background: #f7f7f7;
}
.fund-card-copy strong {
  display: block;
  font-size: 14px;
}
.fund-card-copy p {
  margin: 4px 0 0;
}
.fund-card-ops {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fund-card-ops label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.fund-card-ops input {
  height: 32px;
}
.settle-order-status {
  margin-right: 6px;
  vertical-align: middle;
}
.settle-pay-modal {
  width: min(680px, 96vw);
  max-width: 96vw;
}
.settle-pay-row {
  display: grid;
  grid-template-columns: 132px 108px minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.settle-pay-row > input {
  width: 100%;
  height: 32px;
  box-sizing: border-box;
}
.settle-pay-name {
  line-height: 1.3;
}
.settle-pay-voucher {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  align-self: end;
}
.settle-pay-shot {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  box-sizing: border-box;
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  background: #fff;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  color: #666666;
}
.settle-pay-shot input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.settle-pay-shot .upload-plus,
.settle-pay-trash svg {
  width: 16px;
  height: 16px;
}
.settle-pay-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.settle-pay-trash {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 0;
  background: transparent;
  color: #666666;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.settle-pay-trash:hover {
  color: #b42318;
}
.settle-pay-confirm .settle-pay-row {
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.settle-pay-confirm .settle-pay-voucher {
  align-self: center;
}
