:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --ink: #18212b;
  --muted: #667085;
  --line: #dfe5ea;
  --line-strong: #c8d1d8;
  --accent: #12645a;
  --accent-soft: #e7f3f0;
  --warning: #a15c11;
  --danger: #b42318;
  --ok: #087443;
  --shadow: 0 12px 32px rgba(22, 34, 45, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

body.is-locked {
  display: block;
}

body.is-locked .sidebar,
body.is-locked main {
  display: none;
}

.login-screen {
  display: none;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, #e7f3f0, transparent 28%), var(--bg);
}

body.is-locked .login-screen {
  display: grid;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 2px 0 0;
  font-size: 24px;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.session-box {
  display: grid;
  gap: 6px;
  margin-top: auto; /* 始终贴侧栏底边（仓库菜单项少时也不上移） */
  padding: 8px 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  flex: 0 0 auto;
}

.session-box span {
  color: #b9ccc8;
  font-size: 13px;
}

.session-box label {
  display: grid;
  gap: 5px;
  color: #b9ccc8;
  font-size: 12px;
}

.session-box select {
  width: 100%;
  min-height: 34px;
}

.session-box button {
  color: #d9e6e2;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.16);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100dvh;
  padding: 22px 16px;
  color: #fff;
  background: #10231f;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden; /* 整栏不滚；只滚功能区 #mainNav */
}

.sidebar .brand {
  flex: 0 0 auto;
}

/* 功能框：占满中间剩余高度并可滚动；底部 session（系统管理员→退出）始终贴底 */
.sidebar #mainNav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 4px 0 0;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(185, 204, 200, 0.55) transparent;
}
.sidebar #mainNav::-webkit-scrollbar {
  width: 8px;
}
.sidebar #mainNav::-webkit-scrollbar-thumb {
  background: rgba(185, 204, 200, 0.45);
  border-radius: 6px;
}
.sidebar #mainNav::-webkit-scrollbar-track {
  background: transparent;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px 10px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: #f0c66c;
  color: #10231f;
  font-weight: 800;
  overflow: hidden;
  flex: 0 0 auto;
}

.brand-mark.logo-uploaded {
  background: transparent;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: #b9ccc8;
}

nav {
  display: grid;
  gap: 6px;
}

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

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

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

.nav {
  min-height: 42px;
  border: 0;
  color: #d9e6e2;
  background: transparent;
  text-align: left;
}

.nav.active {
  color: #fff;
  background: #1d4038;
}

main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

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

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 10px;
}

.metric-strip span {
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-strip small {
  display: block;
  color: var(--muted);
}

.metric-strip b {
  display: block;
  margin-top: 6px;
  font-size: 21px;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #f0d9a8;
  border-radius: 8px;
  color: #714500;
  background: #fff8e6;
}
.notice.error {
  border-color: #f0b8b8;
  color: #8a1f1f;
  background: #fff5f5;
}

/* 中间弹出提示（错误 / 发料弹窗内消息） */
#centerNoticeOverlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 24, 32, 0.42);
}
#centerNoticeOverlay[hidden] { display: none !important; }
.center-notice-card {
  width: min(420px, 92vw);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  text-align: center;
}
.center-notice-card.error {
  border-color: #f0b8b8;
}
.center-notice-card.ok {
  border-color: #b7e0c8;
}
.center-notice-msg {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 16px;
  white-space: pre-wrap;
  word-break: break-word;
}
.center-notice-card.error .center-notice-msg { color: #8a1f1f; }
.center-notice-card.ok .center-notice-msg { color: #0f5132; }
.center-notice-ok {
  min-width: 112px;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}
.center-notice-ok.primary,
.center-notice-card .center-notice-ok {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.view { display: none; }
.view.active { display: block; }

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

.bot-layout,
.two-col {
  grid-template-columns: minmax(340px, 0.82fr) minmax(460px, 1.18fr);
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.panel-title p {
  margin-top: 5px;
  font-size: 13px;
}

.badge,
.pill,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.badge,
.pill {
  color: var(--accent);
  background: var(--accent-soft);
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.form-grid label { font-size: 12px; gap: 3px; }
.form-grid input { min-height: 30px; font-size: 12px; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: 18px;
}

.primary {
  width: 100%;
  min-height: 42px;
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 14px;
}

.quick-actions button {
  padding: 0 8px;
  font-size: 13px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.inline-actions button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.chat-log,
.stack,
.timeline,
.log-list {
  display: grid;
  gap: 10px;
}

.chat-log {
  min-height: 360px;
  align-content: start;
}

.empty {
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
}

.bubble,
.row-card,
.role-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.bubble {
  padding: 13px;
}

.bubble strong {
  display: block;
  margin-bottom: 5px;
}

.bubble hr {
  margin: 12px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

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

.role-card {
  padding: 15px;
}

.role-card h3 {
  margin-bottom: 12px;
}

.role-metrics {
  display: grid;
  gap: 9px;
}

.role-metrics p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

.role-metrics strong {
  font-size: 18px;
}

.row-card {
  display: grid;
  gap: 7px;
  padding: 13px;
}

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

.row-card p {
  font-size: 13px;
}

.link-button {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-weight: 800;
}

.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.36);
}

.detail-panel {
  width: min(720px, 100%);
  max-height: 86vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.detail-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-panel h2 {
  margin: 4px 0 0;
  font-size: 22px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 18px;
  background: var(--line);
}

.detail-grid p {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 12px;
  background: var(--surface);
}

.detail-grid span,
.detail-note {
  color: var(--muted);
  font-size: 13px;
}

.detail-note {
  padding: 0 18px 18px;
}

.detail-subsection {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.detail-subsection h3 {
  margin: 0;
  font-size: 15px;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 18px 18px;
}

.save-status {
  min-height: 20px;
  color: var(--accent);
  font-weight: 700;
}

.logo-uploader {
  display: grid;
  gap: 12px;
}

.logo-preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-preview {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f0c66c;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.logo-placeholder {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #f0c66c;
  color: #10231f;
  font-weight: 800;
 font-size: 14px;
}

.section-label {
  margin: 4px 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f7fbff, #f7faf8);
  margin-bottom: 6px;
}

.admin-hero h2 {
  font-size: 17px;
}

.admin-hero p {
  margin: 0;
  color: var(--muted);
}

.admin-health {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}

.ok-dot,
.warn-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.ok-dot {
  background: var(--ok);
}

.warn-dot {
  background: var(--warning);
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.admin-stat-grid .mini-card {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-stat-grid .mini-card.clickable {
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}
.admin-stat-grid .mini-card.clickable:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transform: translateY(-1px);
  border-color: var(--accent);
}
.admin-stat-grid .mini-card.clickable:active {
  transform: translateY(0);
}

.admin-stat-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-stat-grid b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
}

/* 销售看板 — 9 卡两行（5+4），略加大 */
.sales-stat-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.sales-stat-grid .mini-card {
  padding: 10px 8px;
  border-radius: 8px;
  min-width: 0;
  text-align: center;
}
.sales-stat-grid span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
}
.sales-stat-grid b {
  font-size: 18px;
  margin-top: 4px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 720px) {
  .sales-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sales-stat-grid span { font-size: 11px; }
  .sales-stat-grid b { font-size: 16px; }
}

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

.admin-console {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.admin-menu {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.admin-menu button {
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 700;
}

.admin-menu button.active,
.admin-menu button:hover {
  background: #eef4ff;
  color: #2454a6;
}

.admin-content {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.admin-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-section-title h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.admin-section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  background: #f6f8fb;
  font-size: 13px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

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

.admin-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.role-bind-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.model-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.role-bind-card,
.model-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.role-bind-card header,
.model-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.role-bind-card label { font-size: 12px; gap: 3px; }
.role-bind-card input, .role-bind-card textarea { min-height: 28px; font-size: 12px; }
.role-bind-card textarea { min-height: 40px; }
.role-bind-card .role-chip { font-size: 11px; padding: 2px 6px; }

.button-row,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-row input {
  min-width: 180px;
  flex: 1;
}

.role-chip {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2454a6;
  font-size: 12px;
  font-weight: 700;
}

.callback-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px dashed #b7c5d8;
  border-radius: 10px;
  background: #f8fbff;
}

.callback-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.callback-box code {
  overflow-wrap: anywhere;
  color: #16427b;
}

.compact-stack {
  gap: 8px;
}

@media (max-width: 900px) {
  .admin-hero,
  .admin-section-title:not(.sales-compare-head) {
    display: grid;
  }

  .admin-stat-grid:not(.sales-stat-grid):not(/* legacy */ .reconcile-stat-grid-legacy):not(.ops-fin-stat-grid):not(.fin-dash-row):not(.fin-dash-row6):not(.fin-dash-row3),
  .module-grid,
  .role-bind-grid,
  .model-grid,
  .admin-console,
  .admin-row {
    grid-template-columns: 1fr;
  }
}

.status-draft,
.status-pending {
  color: var(--warning);
  background: #fff3df;
}

.status-confirmed,
.status-completed,
.status-qualified {
  color: var(--ok);
  background: #e8f6ef;
}

.status-defective {
  color: var(--danger);
  background: #fff0ee;
}

.log-list {
  max-height: 520px;
  overflow: auto;
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .topbar,
  .bot-layout,
  .two-col {
    display: grid;
    grid-template-columns: 1fr;
  }

  .metric-strip,
  .quick-actions,
  .detail-grid,
  .detail-actions,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Rule Engine Panel ===== */
.rule-engine-layout {
  display: grid;
  gap: 16px;
}

.rules-ai-chat {
  max-height: 320px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.rules-ai-placeholder {
  color: var(--muted);
  font-size: 13px;
}

.rules-ai-placeholder ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.rules-ai-placeholder li {
  margin-bottom: 4px;
}

.rules-ai-msg {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.rules-ai-msg.user {
  background: #e7f3f0;
  border-color: #cde3de;
}

.rules-ai-msg.ai {
  background: #f0f4ff;
  border-color: #d8e2f5;
}

.rules-ai-msg.error {
  background: #fff0ee;
  border-color: #fcd5d0;
}

.rules-ai-msg b {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
}

.rules-ai-msg p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.6;
}

.rules-ai-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.rules-ai-input-row textarea {
  flex: 1;
  min-height: 44px;
}

.rules-ai-input-row button {
  width: auto;
  min-width: 80px;
  min-height: 44px;
}

/* ===== Log Items ===== */
.log-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.log-item .role-chip {
  flex: 0 0 auto;
  margin-top: 1px;
  min-width: 44px;
  text-align: center;
}
.log-item p {
  flex: 1;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}
.log-item .log-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

/* ===== Section Labels ===== */
.section-label {
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* ===== Inline Actions ===== */
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.inline-actions button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

/* ===== Master Data Table ===== */
.master-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.master-tab {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.master-tab.active {
  background: var(--surface);
  border-bottom-color: var(--surface);
  font-weight: 700;
  color: var(--accent);
}
.master-tab .badge {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
}
.master-tab:hover { background: var(--surface); }
.master-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.master-toolbar input,
.master-toolbar input.master-search {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.master-table-wrap {
  max-height: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.master-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.master-table th {
  background: var(--surface-soft);
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  z-index: 3;
}
.master-table th.th-actions { width: 80px; text-align: center; }
.master-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.master-table tr:hover td { background: var(--accent-soft); }
.master-table td.empty { text-align: center; color: var(--muted); padding: 40px 16px; font-style: italic; }
.td-actions { text-align: center; white-space: nowrap; }
.master-add-form, .master-import-area {
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}
.master-add-form h4, .master-import-area h4 { margin: 0 0 10px; }
.master-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: var(--surface);
  border-radius: 10px;
  padding: 0;
  max-width: 640px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}
.modal-box-head {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 12px;
  border-bottom: 1px solid var(--line, #e8e8e8);
  background: var(--surface);
  z-index: 2;
}
.modal-box-head h3,
.modal-box-head h4 {
  margin: 0;
  font-size: 15px;
  flex: 1;
  min-width: 0;
}
.modal-box-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 24px;
  -webkit-overflow-scrolling: touch;
}
.modal-box-foot {
  flex-shrink: 0;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--line, #e8e8e8);
  background: var(--surface);
}
.modal-box h4 { margin: 0 0 14px; }
.modal-box .master-add-grid { max-height: none; overflow: visible; }

/* ===== System Admin ===== */
.sysadmin-grid { display: grid; gap: 16px; }
.form-narrow { max-width: 400px; }

/* ===== List Row (Sales / Purchase view) ===== */
.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-row-main {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}
.list-row-main b { font-size: 13px; }
.list-row-meta {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.list-row .badge {
  flex: 0 0 auto;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--accent-soft);
  color: var(--accent);
}
.contact-row-actions {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}
.badge.warn { background: #fff3e0; color: #b76a00; }
.badge.error { background: #fee8e6; color: var(--danger); }
.badge-orange { background: #fff3e0; color: #b76a00; }
.badge-blue { background: #e3f0ff; color: #1a6bb0; }
.badge-green { background: #e3f5ec; color: #087443; }
.badge-red { background: #fee8e6; color: var(--danger); }

/* ===== Backup / Restore ===== */
.backup-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.backup-buttons button {
  font-size: 13px;
  min-height: 34px;
  min-width: 120px;
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.compare-col {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}
.compare-col b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.compare-val { display: block; font-size: 13px; font-weight: 700; }
.compare-diff { display: block; font-size: 11px; margin-top: 2px; }
.compare-diff.up { color: var(--ok); }
.compare-diff.down { color: var(--danger); }

.dash-scroll { overflow: hidden; }
.dash-scroll-inner {
  max-height: 280px;
  overflow-y: auto;
  margin: 0 -14px;
  padding: 0 14px;
}

/* ===== Accordion (采购看板) ===== */
.purchase-accordion {
  display: grid;
  gap: 4px;
}
.accordion-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.accordion-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-soft);
  transition: background 0.1s;
}
.accordion-header:hover { background: #eef2f5; }
.accordion-header.open { background: var(--accent-soft); color: var(--accent); }
.accordion-arrow {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
}
.accordion-body { display: none; }
.accordion-inner {
  max-height: 300px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.accordion-inner .list-row:last-child { border-bottom: 0; }

.toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}
.toolbar input { flex: 1; min-width: 200px; font-size: 14px; padding: 6px 10px; }
.toolbar select.order-sort { width: auto; min-width: 90px; min-height: 30px; font-size: 12px; }
.toolbar button { min-width: 90px; min-height: 32px; font-size: 12px; }
.search-go-btn { min-width: 50px !important; min-height: 30px !important; font-size: 13px; font-weight: 700; }

/* ===== Item Table (in order detail) ===== */
.item-table {
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}
.item-table-header {
  display: grid;
  grid-template-columns: 1.2fr 72px 40px 50px 50px 70px 70px;
  gap: 4px;
  padding: 4px 8px;
  background: var(--surface-soft);
  font-weight: 700;
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid var(--line-strong);
}
.item-table-header span:not(:first-child) { text-align: right; }
.item-row {
  display: grid;
  grid-template-columns: 1.2fr 72px 40px 50px 50px 70px 70px;
  gap: 4px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: 0; }
.item-model { font-weight: 600; font-size: 12px; }
.item-dd { color: #2563eb; font-size: 11px; white-space: nowrap; }
.item-unit, .item-qty, .item-shipped, .item-price, .item-total { text-align: right; color: var(--muted); font-size: 12px; }
.item-shipped.done { color: var(--ok); font-weight: 700; }
.item-total { font-weight: 700; color: var(--ink); }

.results-scroll { overflow: hidden; }
.results-inner {
  max-height: 400px;
  overflow-y: auto;
  margin: 0 -14px;
  padding: 0 14px;
}
.clickable-row { cursor: pointer; transition: background 0.1s; }
.clickable-row:hover { background: var(--accent-soft); }

.order-detail { max-width: 520px; }
.order-detail h4 { font-size: 15px; }
.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
  font-size: 13px;
}
.detail-field { padding: 3px 0; }
.detail-field b { color: var(--muted); font-weight: 600; display: inline-block; min-width: 50px; margin-right: 6px; }
.stage-track {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 10px;
  background: var(--surface-soft);
  border-radius: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}
.stage-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--line);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.stage-dot.done { background: var(--ok); }
.stage-line {
  width: 16px;
  height: 2px;
  background: var(--line);
}

.form-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.form-card textarea { resize: vertical; min-height: 40px; }

.form-prod-info {
  display: flex;
  gap: 16px;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-radius: 6px;
  font-size: 13px;
  flex-wrap: wrap;
}
.form-prod-info span { color: var(--muted); }
.form-prod-info b { color: var(--ink); font-weight: 700; }
.form-total { font-size: 18px; font-weight: 700; color: var(--accent); display: block; padding-top: 4px; }

/* ===== Reconcile (legacy rows) ===== */
.reconcile-items {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
}
.reconcile-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.reconcile-row:hover { background: var(--accent-soft); }
.reconcile-row input[type=checkbox] { width: 16px; height: 16px; }
.reconcile-row .list-row-main { flex: 1; }
.reconcile-row .list-row-meta { font-weight: 700; }
.reconcile-row .list-row-meta.negative { color: var(--danger); }
.reconcile-row .list-row-meta.positive { color: var(--ok); }

.back-btn {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}
.back-btn:hover { background: var(--accent-soft); }

.backup-list {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  font-size: 12px;
  max-height: 150px;
  overflow-y: auto;
}
.backup-list b { display: block; margin-bottom: 4px; }
.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
}
.restore-btn {
  font-size: 11px;
  min-height: 24px;
  padding: 0 8px;
}

/* ===== WeChat Config Tabs ===== */
.wecom-tabs { display: grid; gap: 0; }
.wecom-tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.wecom-tab {
  padding: 8px 16px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: -1px;
}
.wecom-tab.active {
  border-color: var(--line);
  background: #fff;
  color: var(--accent);
}
.wecom-tab:hover { color: var(--ink); }
.wecom-tab-content { min-height: 0; }

/* ===== Master Detail Grid ===== */
.master-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px 12px;
  font-size: 12px;
}
.master-detail-grid span { display: flex; gap: 4px; }
.master-detail-grid b { color: var(--muted); font-weight: 600; min-width: 60px; }
.master-expand-btn { font-size: 12px; padding: 2px 6px; min-height: 0; }

/* ===== Log list compact ===== */
.log-list { display: grid; gap: 4px; width: 100%; }
.log-list .log-item {
  padding: 5px 8px;
}
.log-list .log-item .log-time { font-size: 10px; }

/* ===== Compact view tweaks ===== */
main { padding: 14px; }
.admin-section-title { margin-bottom: 0; }
.admin-section-title h3 { font-size: 14px; }
.admin-section-title p { font-size: 12px; }

/* Missing CSS classes from app.js modules */
.order-search { width:100%; padding:8px 12px; border:1px solid var(--line); border-radius:6px; font-size:14px; }
.order-create-btn { padding:6px 16px; background:var(--accent); color:#fff; border:none; border-radius:6px; cursor:pointer; font-size:13px; }
.btn-sm { padding:4px 12px; font-size:12px; border:1px solid var(--line); border-radius:4px; cursor:pointer; background:#fff; }
.btn-open-replenish {
  width: auto !important;
  min-height: 0 !important;
  max-width: none;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.admin-section-title .btn-open-replenish {
  margin-left: auto;
  justify-self: end;
  flex: 0 0 auto;
}
.admin-section-title:has(.btn-open-replenish) {
  align-items: center;
  flex-wrap: nowrap;
}
.admin-section-title:has(.btn-open-replenish) h3 {
  flex: 1 1 auto;
  min-width: 0;
}
@media (max-width: 900px) {
  .admin-section-title:has(.btn-open-replenish) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
}
.btn-cancel { padding:6px 16px; background:var(--surface); color:var(--ink); border:1px solid var(--line); border-radius:6px; cursor:pointer; font-size:13px; }
.btn-inbound-confirm, .btn-confirm-outbound { padding:4px 10px; font-size:12px; background:var(--ok); color:#fff; border:none; border-radius:4px; cursor:pointer; }
.btn-inbound-defective { padding:4px 10px; font-size:12px; background:var(--danger); color:#fff; border:none; border-radius:4px; cursor:pointer; }
.toolbar { display:flex; gap:8px; align-items:center; margin-bottom:12px; }
.dash-scroll { margin-bottom:12px; }
.dash-scroll-inner { max-height:300px; overflow-y:auto; }
.timeline-item { padding:8px 0; border-bottom:1px solid var(--line); }
.reconcile-check { width:18px; height:18px; }
.reconcile-confirm-btn, .reconcile-open-btn { padding:3px 8px; font-size:11px; background:var(--accent); color:#fff; border:none; border-radius:4px; cursor:pointer; }
.reconcile-del-btn { padding:3px 8px; font-size:11px; background:var(--danger); color:#fff; border:none; border-radius:4px; cursor:pointer; }
.master-add-btn, .master-edit-btn { padding:4px 10px; font-size:12px; background:var(--accent); color:#fff; border:none; border-radius:4px; cursor:pointer; }
.master-del-btn { padding:4px 10px; font-size:12px; background:var(--danger); color:#fff; border:none; border-radius:4px; cursor:pointer; }
.master-import-btn { padding:6px 14px; background:var(--surface); border:1px solid var(--line); border-radius:6px; cursor:pointer; }
.master-export-btn { padding:6px 14px; background:var(--surface); border:1px solid var(--line); border-radius:6px; cursor:pointer; }
.bind-ids { width:100%; padding:6px; border:1px solid var(--line); border-radius:4px; font-size:13px; min-height:60px; }
.bind-name { width:100%; padding:6px; border:1px solid var(--line); border-radius:4px; font-size:13px; }
.model-provider, .model-name, .model-key, .model-url { width:100%; padding:6px; border:1px solid var(--line); border-radius:4px; font-size:13px; box-sizing:border-box; }
.model-enabled { width:18px; height:18px; }
.edit-field { width:100%; padding:6px; border:1px solid var(--line); border-radius:4px; font-size:13px; box-sizing:border-box; }
.close-order-btn { padding:4px 10px; font-size:12px; background:var(--warning); color:#fff; border:none; border-radius:4px; cursor:pointer; }
.master-search { width:100%; padding:6px 10px; border:1px solid var(--line); border-radius:4px; font-size:13px; }
.master-toolbar .master-search,
.master-toolbar .ops-search {
  width: 160px;
  max-width: 160px;
  flex: 0 0 160px;
  padding: 3px 8px;
  font-size: 12px;
  min-height: 28px;
  height: 28px;
  box-sizing: border-box;
}
.form-prod-select, .form-qty-input { padding:6px; border:1px solid var(--line); border-radius:4px; font-size:13px; }
.inbound-qty, .outbound-qty { width:60px; padding:4px; border:1px solid var(--line); border-radius:4px; text-align:center; }
.rule-value-input { width:100%; padding:6px; border:1px solid var(--line); border-radius:4px; }
.rule-value-text { font-size:13px; color:var(--muted); }
.rule-save-btn { padding:3px 8px; background:var(--ok); color:#fff; border:none; border-radius:4px; cursor:pointer; }
.rule-cancel-btn { padding:3px 8px; background:var(--surface); border:1px solid var(--line); border-radius:4px; cursor:pointer; }
.rule-edit-btn { padding:2px 6px; font-size:11px; background:transparent; border:1px solid var(--line); border-radius:3px; cursor:pointer; }
.ret-complete-btn { padding:3px 8px; background:var(--ok); color:#fff; border:none; border-radius:4px; cursor:pointer; }
.ret-del-btn { padding:3px 8px; background:var(--danger); color:#fff; border:none; border-radius:4px; cursor:pointer; }
.reconcile-contact:not(select) { font-size:12px; color:var(--muted); }
.reconcile-date { font-size:12px; }
.master-detail-row { display:flex; gap:6px; align-items:center; margin:4px 0; }
.master-add-input { flex:1; padding:6px; border:1px solid var(--line); border-radius:4px; }

/* Master data table - hidden rows */
[hidden] { display: none !important; }
.master-expand-btn { cursor: pointer; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 11px; }

.wecom-login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}
.wecom-login-divider::before,
.wecom-login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.wecom-login-btn {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 13px;
  color: #333;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
}
.wecom-login-btn:hover {
  border-color: #07c160;
  color: #07c160;
  background: #f0faf4;
}

/* ===== 移动端优化（企微内置浏览器）===== */
@media (max-width: 768px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 8px; }
  .sidebar .brand { font-size: 14px; padding: 6px; }
  nav { grid-template-columns: repeat(2, 1fr); gap: 3px; }
  nav button { font-size: 11px; padding: 6px 4px; min-height: 36px; }
  .topbar { padding: 6px 10px; }
  main { padding: 8px; }
  
  .admin-hero { padding: 8px 10px; }
  .admin-hero h2 { font-size: 15px; }
  .admin-section { padding: 8px; gap: 6px; }
  .admin-section-title h3 { font-size: 13px; }
  
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .mini-card { padding: 6px; font-size: 11px; }
  .mini-card b { font-size: 16px; }
  
  /* 表单优化 */
  .form-card { padding: 10px; }
  .form-grid { grid-template-columns: 1fr; gap: 6px; }
  .form-grid label { font-size: 12px; }
  .form-grid input, .form-grid select, .form-grid textarea { font-size: 14px; padding: 8px; }
  .form-prod-info { font-size: 11px; gap: 4px; flex-wrap: wrap; }
  .form-prod-info span { padding: 2px 6px; }
  
  .button-row { flex-direction: column; gap: 4px; }
  .button-row button { width: 100%; min-height: 40px; font-size: 14px; }
  
  /* 表格 */
  .admin-row { grid-template-columns: 1fr; gap: 2px; padding: 6px; }
  .admin-row b { font-size: 13px; }
  .admin-row span { font-size: 11px; }
  .admin-row button { min-height: 34px; }
  
  /* 日志 */
  .log-list { max-height: 240px; overflow-y: auto; }
  .log-item { font-size: 11px; padding: 4px 6px; }
  
  /* 企业微信配置 */
  .wecom-tab-bar { overflow-x: auto; white-space: nowrap; }
  .wecom-tab { font-size: 11px; padding: 6px 10px; }
  .role-bind-grid { grid-template-columns: 1fr; }
  
  /* 邮件 */
  #adminContent > div[style*="height:calc(100vh - 140px)"] { flex-direction: column; height: auto !important; }
  #adminContent > div[style*="height:calc(100vh - 140px)"] > div:first-child { width: 100% !important; min-width: unset !important; max-height: 50vh; overflow-y: auto; }
  #emailFolderTree { max-height: 20vh !important; overflow-y: auto !important; }
  .email-actions { flex-wrap: wrap; }
  #emailActions button { font-size: 10px; padding: 3px 8px; }
  
  /* 销售订单详情 */
  .order-detail { max-width: 100%; }
  .order-detail .order-summary { flex-direction: column; gap: 4px; }
  .order-detail .order-summary span { font-size: 12px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar input { min-width: 120px; font-size: 13px; }
  .toolbar button { min-width: 60px; min-height: 30px; font-size: 11px; }
  .search-go-btn { min-width: 40px !important; }
  
  /* 新建订单页面 */
  [data-view="sales-new"] .form-prod-info { display: grid; grid-template-columns: repeat(2, 1fr); }
  
  /* 规则引擎 */
  .rules-grid { grid-template-columns: 1fr; }
  .rules-ai-chat { max-height: 200px; overflow-y: auto; }
  
  /* 系统设置 */
  .sysadmin-grid { grid-template-columns: 1fr; }
  .master-tabs { overflow-x: auto; }
  .master-tab { font-size: 11px; padding: 6px 10px; }
  .master-toolbar { flex-direction: column; }
  position: sticky;
  top: 0;
  z-index: 10;
  .master-table { font-size: 11px; }
  .master-table th, .master-table td { padding: 4px 6px; }
  
  /* 看板数字 */
  .ceo-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .ceo-card { padding: 8px; }
  .ceo-card .num { font-size: 18px; }
  
  /* AI对话窗口 */
  .brain-chat { max-height: 200px; overflow-y: auto; }
  .brain-msg { font-size: 12px; padding: 6px 8px; }
  
  /* 模态框 */
  div[style*="position:fixed"][style*="z-index:9999"] > div { width: 92% !important; max-width: 92% !important; padding: 16px !important; }
  
  /* 底部用户区域 */
  .bot-layout { grid-template-columns: 1fr; }
  #sessionRole { font-size: 11px; }
}


/* ===== Sales order list (multi-line PO) ===== */
.so-list-head,
.so-list-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.1fr) minmax(90px, 1fr) minmax(180px, 2fr) minmax(72px, 0.7fr) minmax(88px, 0.8fr) minmax(64px, 0.55fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.so-list-head {
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 1;
}
.so-list-row { font-size: 12px; cursor: pointer; transition: background 0.1s; }
.so-list-row:hover { background: var(--accent-soft); }
.so-col { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.so-col b { font-size: 12px; line-height: 1.35; }
.so-col small { font-size: 10px; color: var(--muted); line-height: 1.3; word-break: break-all; }
.so-col-amt b { color: var(--ink); font-size: 13px; }
.so-col-meta { align-items: flex-end; text-align: right; }
.so-col-attach { display: flex; align-items: center; justify-content: center; gap: 4px; padding-top: 2px; flex-wrap: wrap; }
.so-order-thumb { position: relative; border: 1px solid #c5ddf8; border-radius: 8px; padding: 0; width: 52px; height: 52px; overflow: hidden; cursor: pointer; background: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 1px 4px rgba(21,101,192,.12); transition: transform .12s, box-shadow .12s; }
.so-order-thumb:hover { transform: scale(1.04); box-shadow: 0 4px 12px rgba(21,101,192,.22); }
.so-order-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.so-order-thumb-lg { width: 88px; height: 88px; border-radius: 10px; }
.so-order-thumb-pdf { flex-direction: column; gap: 2px; background: linear-gradient(145deg, #eef6ff, #f8fafc); color: #1565C0; font-size: 11px; font-weight: 700; }
.so-thumb-pdf-label { font-size: 13px; line-height: 1; }
.so-thumb-hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 0; font-size: 9px; line-height: 1.1; text-align: center; color: #fff; background: rgba(15,23,42,.55); opacity: 0; transition: opacity .12s; pointer-events: none; }
.so-order-thumb:hover .so-thumb-hint { opacity: 1; }
.so-file-preview-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.72); z-index: 9999; display: none; align-items: center; justify-content: center; padding: 20px; }
.so-file-preview-box { position: relative; background: #fff; border-radius: 10px; max-width: min(96vw, 980px); max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.so-file-preview-box img { display: block; max-width: min(96vw, 960px); max-height: 88vh; }
.so-file-preview-box iframe { display: block; width: min(92vw, 900px); height: min(88vh, 820px); border: 0; }
.so-file-preview-close { position: absolute; top: 8px; right: 8px; z-index: 2; border: none; background: rgba(0,0,0,.55); color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 16px; }
.so-row-actions { display: inline-flex; gap: 2px; margin-top: 2px; }
.so-row-actions button { background: none; border: none; cursor: pointer; font-size: 12px; padding: 0 2px; }
.so-inline-items { display: grid; gap: 3px; }
.so-inline-items.compact { gap: 2px; }
.so-inline-item {
  display: grid;
  grid-template-columns: 1fr 0.8fr 72px auto auto auto;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  line-height: 1.3;
}
.so-inline-part { font-weight: 600; color: var(--ink); word-break: break-all; }
.so-inline-model { color: var(--muted); word-break: break-all; font-size: 10px; }
.so-inline-dd { color: #2563eb; white-space: nowrap; font-size: 10px; }
.so-inline-qty, .so-inline-price { color: var(--muted); white-space: nowrap; }
.so-inline-amt { font-weight: 700; white-space: nowrap; text-align: right; }
.so-inline-single { font-size: 11px; color: var(--muted); line-height: 1.4; word-break: break-all; }
@media (max-width: 900px) {
  .so-list-head { display: none; }
  .so-list-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 8px;
  }
  .so-col-meta { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; gap: 8px; }
}
/* ===== Expandable order list ===== */
.order-list-wrap { border-bottom: 1px solid var(--line); }
.order-list-wrap.expanded { background: #f8fafc; }
.order-summary-row { border-bottom: none !important; }
.order-items-brief { font-size: 11px; color: var(--muted); line-height: 1.4; word-break: break-all; }
.order-chevron { font-size: 10px; color: var(--muted); margin-left: 4px; }
.order-expand-panel { padding: 0 10px 12px 10px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.order-expand-inner { padding: 10px 4px 4px; }
.order-detail-table.item-table-header,
.order-detail-table.item-row { grid-template-columns: 1.2fr 0.9fr 72px 64px 72px 80px; }
.order-row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.order-act-btn { padding: 5px 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px; text-decoration: none; color: inherit; display: inline-block; }
.order-act-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.order-act-btn.danger { border-color: #e74c3c; color: #e74c3c; }
.po-list-head { margin-top: 0; }

.order-original-file-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; background: #eef6ff; border: 1px solid #c5ddf8; border-radius: 8px; margin-bottom: 4px; }
.order-original-label { font-size: 12px; }
.order-line-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.order-line-head { font-size: 13px; margin-bottom: 4px; }
.order-line-meta { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.line-stage-track { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11px; margin: 8px 0; padding: 6px 8px; background: #f8fafc; border-radius: 6px; }
.line-stage-track-full { flex-wrap: nowrap; overflow-x: auto; padding: 8px 10px; gap: 2px; -webkit-overflow-scrolling: touch; }
.line-stage-track-full .stage-dot { flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; background: #e2e8f0; color: #64748b; }
.line-stage-track-full .stage-dot.done { background: #dcfce7; color: #15803d; }
.line-stage-track-full .stage-dot.active { background: #dbeafe; color: #1565C0; box-shadow: 0 0 0 2px #93c5fd; }
.line-stage-track-full .stage-label { flex-shrink: 0; white-space: nowrap; font-size: 10px; color: var(--muted); margin-right: 2px; }
.line-stage-track-full .stage-label.current { color: #1565C0; font-weight: 700; }
.line-stage-track-full .stage-line { flex-shrink: 0; width: 10px; height: 1px; background: #cbd5e1; margin: 0 1px; }
.line-row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }

.io-modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 0;
  width: 560px;
  max-width: 92vw;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
}
.io-modal-box > h3,
.io-modal-box > p:first-of-type { margin: 0; padding: 20px 24px 0; flex-shrink: 0; }
.io-modal-box > p:first-of-type { padding-top: 8px; padding-bottom: 0; }
.io-modal-box > div[id$="ModalBody"],
.io-modal-box > #purchaseDraftModalBody,
.io-modal-box > #inboundModalBody,
.io-modal-box > #outboundModalBody,
.io-modal-box > #outboundCombineModalBody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 24px;
}
.io-modal-actions {
  margin-top: 0;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--line, #e8e8e8);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  flex-shrink: 0;
  background: #fff;
}
.io-modal-actions button { padding: 8px 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; }
.io-modal-actions button.primary { background: #12645a; color: #fff; border-color: #12645a; }
.io-modal-actions .btn-inbound-defective { border-color: #b42318; color: #b42318; }
.io-qty-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.io-qty-table th, .io-qty-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.io-qty-table th { text-align: left; font-size: 11px; color: var(--muted); }
.io-qty-table .io-num { text-align: center; }
.io-qty-table input { width: 72px; text-align: center; padding: 4px; border: 1px solid var(--line); border-radius: 4px; }

.wh-io-tabs { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.wh-io-tab { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 13px; }
.wh-io-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.io-record-row { align-items: center; gap: 10px; }

.io-list-wrap { border-bottom: 1px solid var(--line); }
.io-list-wrap.expanded { background: #f8fafc; }
.io-slip-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; padding: 10px; background: #eef6ff; border-radius: 8px; font-size: 12px; }
.io-slip-thumb { width: 44px; height: 44px; flex-shrink: 0; }
.io-no-slip { font-size: 10px; color: var(--muted); }
.io-record-row { cursor: pointer; }

.io-inbound-done-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fff;
  cursor: pointer;
}
.io-inbound-done-card:hover { background: rgba(18, 100, 90, 0.04); border-color: var(--accent); }
.io-inbound-done-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.io-inbound-done-title { flex: 1; min-width: 0; font-size: 13px; }
.io-inbound-done-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.io-inbound-items-wrap { margin: 0 0 8px; overflow-x: auto; }

/* 库存明细弹窗：强制限高 + 可见滑条（覆盖 view-master-locked 隐藏滚动条） */
#invDetailModal.modal-overlay {
  z-index: 1200;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow: auto;
}
#invDetailModal .inv-detail-modal-box.modal-box {
  width: min(720px, 94vw) !important;
  max-width: 94vw !important;
  max-height: min(88vh, 920px) !important;
  height: min(88vh, 920px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  margin: auto;
}
#invDetailModal .modal-box-head {
  flex: 0 0 auto;
}
#invDetailModal .modal-box-body,
#invDetailModal #invDetailBody,
html body #invDetailModal .modal-box-body,
html body.view-master-locked #invDetailModal .modal-box-body,
html body.view-frame-locked #invDetailModal .modal-box-body,
html body.app-shell-locked #invDetailModal .modal-box-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: auto !important;
  scrollbar-color: #6b7280 #e8edf2 !important;
}
html body #invDetailModal .modal-box-body::-webkit-scrollbar,
html body #invDetailModal #invDetailBody::-webkit-scrollbar,
html body.view-master-locked #invDetailModal .modal-box-body::-webkit-scrollbar,
html body.view-frame-locked #invDetailModal .modal-box-body::-webkit-scrollbar,
html body.app-shell-locked #invDetailModal .modal-box-body::-webkit-scrollbar,
html body #invDetailModal .inv-detail-list-scroll::-webkit-scrollbar,
html body.view-master-locked #invDetailModal .inv-detail-list-scroll::-webkit-scrollbar {
  width: 10px !important;
  height: 10px !important;
  display: block !important;
}
html body #invDetailModal .modal-box-body::-webkit-scrollbar-thumb,
html body #invDetailModal #invDetailBody::-webkit-scrollbar-thumb,
html body #invDetailModal .inv-detail-list-scroll::-webkit-scrollbar-thumb {
  background: #6b7280 !important;
  border-radius: 6px !important;
}
html body #invDetailModal .modal-box-body::-webkit-scrollbar-track,
html body #invDetailModal #invDetailBody::-webkit-scrollbar-track,
html body #invDetailModal .inv-detail-list-scroll::-webkit-scrollbar-track {
  background: #e8edf2 !important;
}
.inv-detail-list-scroll,
html body #invDetailModal .inv-detail-list-scroll,
html body.view-master-locked #invDetailModal .inv-detail-list-scroll {
  max-height: min(36vh, 300px) !important;
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line, #e8e8e8);
  border-radius: 6px;
  padding: 2px 8px;
  background: #fafbfc;
  scrollbar-gutter: stable;
  scrollbar-width: auto !important;
  scrollbar-color: #6b7280 #e8edf2 !important;
}
@media (max-width: 640px) {
  .inv-detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .inv-detail-list-scroll,
  html body #invDetailModal .inv-detail-list-scroll { max-height: min(42vh, 340px) !important; }
  #invDetailModal .inv-detail-modal-box.modal-box {
    height: min(92vh, 920px) !important;
    max-height: min(92vh, 920px) !important;
  }
}
.io-inbound-items-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.io-inbound-items-mini th,
.io-inbound-items-mini td {
  padding: 6px 8px;
  border: 1px solid var(--line);
  text-align: left;
}
.io-inbound-items-mini th { background: var(--surface-soft); font-weight: 600; }
.io-inbound-items-mini .io-num { text-align: right; white-space: nowrap; }
.io-inbound-slip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
}
.io-inbound-slip-label { color: var(--muted); white-space: nowrap; }
.io-delivery-thumb-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.io-delivery-thumb-wrap {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  position: relative;
}
.io-delivery-del-btn {
  border: none;
  background: var(--danger, #d32f2f);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.io-delivery-upload-label {
  cursor: pointer;
  margin: 0;
  font-size: 11px;
  padding: 4px 10px;
}

.io-defect-panel { border: 1px solid #f5c2c7; background: #fff5f5; border-radius: 8px; padding: 12px; margin-top: 12px; }
.defect-reason-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }
.io-defect-radio { display: block; font-size: 12px; margin: 4px 0; cursor: pointer; }
.io-defect-summary { font-size: 12px; padding: 10px; background: #fff8e6; border: 1px solid #f0d78c; border-radius: 6px; margin-bottom: 8px; line-height: 1.6; }

.io-defect-options-top { background: #fff; border: 1px solid #f5c2c7; border-radius: 6px; padding: 10px; margin-bottom: 4px; }

/* ===== Reconcile long-bar lists ===== */
.reconcile-flow-hint {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
}
.reconcile-flow-hint b { color: var(--ink); display: inline; margin-bottom: 0; }
.reconcile-hint-collapsed > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.reconcile-hint-collapsed > summary::-webkit-details-marker { display: none; }
.reconcile-stat-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 4px !important;
  margin: 0 0 6px !important;
}
.reconcile-stat-grid .mini-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3px 5px !important;
  border-radius: 4px;
  min-width: 0;
  min-height: 0;
  height: 40px;
  max-height: 40px;
  text-align: center;
}
.reconcile-stat-grid .mini-card span {
  display: block;
  font-size: 10px !important;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.reconcile-stat-grid .mini-card b {
  display: block;
  font-size: 13px !important;
  line-height: 1.15;
  margin: 1px 0 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reconcile-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.reconcile-toolbar .reconcile-contact {
  flex: 1 1 auto;
  min-width: 140px;
  max-width: 420px;
  font-size: 13px;
  color: inherit;
  padding: 5px 8px;
}
.reconcile-toolbar .reconcile-cutoff-label {
  flex: 0 0 auto;
  margin: 0;
}
.reconcile-toolbar .btn-sm { flex: 0 0 auto; }
.reconcile-pending-title h3 { margin: 0 0 2px; font-size: 14px; }
.reconcile-pending-title p { margin: 0 0 4px; font-size: 11px; color: var(--muted); line-height: 1.35; }
.reconcile-draft-title h3 { margin: 0 0 4px; font-size: 14px; }
.reconcile-list-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.reconcile-list-scroll {
  max-height: min(36vh, 280px);
  overflow: auto;
}
.reconcile-list-scroll-draft { max-height: none; }
.reconcile-list-scroll-modal { max-height: min(48vh, 400px); }
.reconcile-list-head,
.reconcile-list-row,
.reconcile-draft-head,
.reconcile-draft-row {
  display: grid;
  align-items: center;
  gap: 6px 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  width: max-content;
  min-width: 100%;
  box-sizing: border-box;
}
.reconcile-list-head,
.reconcile-draft-head {
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 1;
}
.reconcile-list-head,
.reconcile-list-row {
  grid-template-columns: 28px 72px minmax(88px, 1fr) minmax(88px, 1fr) minmax(72px, 0.9fr) 72px minmax(100px, 1.2fr) 48px 80px;
}
.reconcile-list-sales .reconcile-list-head,
.reconcile-list-sales .reconcile-list-row {
  grid-template-columns: 28px 72px 100px 80px 76px minmax(140px, 240px) 56px 72px 84px 72px 92px;
  font-size: 11px;
}
.reconcile-list-purchase.reconcile-list-finance .reconcile-list-head,
.reconcile-list-purchase.reconcile-list-finance .reconcile-list-row {
  grid-template-columns: 28px 72px 100px 80px 76px minmax(140px, 240px) 56px 72px 84px 72px 92px;
  font-size: 11px;
}
.reconcile-list-sales.reconcile-list-finance,
.reconcile-list-purchase.reconcile-list-finance { overflow: visible; }
.reconcile-list-sales { overflow: hidden; }
.reconcile-draft-head,
.reconcile-draft-row {
  grid-template-columns: 72px minmax(160px, 280px) 80px 52px minmax(120px, 200px) 72px 76px minmax(96px, 140px);
}
.reconcile-list-row {
  cursor: pointer;
  transition: background 0.1s;
}
.reconcile-list-row:hover { background: var(--accent-soft); }
.reconcile-list-row:last-child,
.reconcile-draft-row:last-child { border-bottom: 0; }
.reconcile-draft-row { font-size: 12px; }
.reconcile-col-check { display: flex; align-items: center; justify-content: center; }
.reconcile-col-check input { width: 16px; height: 16px; margin: 0; }
.reconcile-col-no b,
.reconcile-col-title b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reconcile-list-head > span,
.reconcile-list-row > span,
.reconcile-draft-head > span,
.reconcile-draft-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reconcile-col-check,
.reconcile-col-actions,
.reconcile-draft-actions { overflow: visible; }
.reconcile-col-detail,
.reconcile-col-party,
.reconcile-col-refno,
.reconcile-col-title { min-width: 0; }
.reconcile-col-party { color: var(--muted); font-size: 11px; max-width: 7.5em; }
.reconcile-col-refno { font-size: 11px; color: var(--primary); }
.reconcile-col-qty,
.reconcile-col-count,
.reconcile-col-date { text-align: center; color: var(--muted); white-space: nowrap; }
.reconcile-col-amt { text-align: right; font-weight: 700; white-space: nowrap; }
.reconcile-amt-sub { font-size: 10px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.reconcile-col-amt.positive { color: var(--ok); }
.reconcile-col-amt.negative { color: var(--danger); }
.reconcile-col-status { text-align: center; }
.reconcile-col-actions,
.reconcile-draft-actions { display: flex; gap: 4px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.reconcile-type-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  background: #eef2ff;
  color: #4338ca;
}
.reconcile-type-badge.ship, .reconcile-type-badge.recv { background: #e3f5ec; color: #087443; }
.reconcile-type-badge.return, .reconcile-type-badge.claim { background: #fee8e6; color: var(--danger); }
.reconcile-type-badge.repl { background: #fff3e0; color: #b76a00; }
.reconcile-type-badge.fee { background: #f3e8ff; color: #7c3aed; }
.reconcile-type-badge.sales { background: #e3f0ff; color: #1a6bb0; }
.reconcile-type-badge.purchase { background: #fef3c7; color: #92400e; }
.reconcile-list-body { overflow: visible; max-height: none; }
.reconcile-list-scroll .reconcile-list-body { padding: 0; }
.reconcile-draft-wrap .reconcile-list-body { max-height: none; }
.reconcile-empty { padding: 24px 12px; text-align: center; }
.reconcile-modal-items .reconcile-list-head,
.reconcile-modal-items .reconcile-list-row {
  grid-template-columns: 72px minmax(96px, 1fr) minmax(88px, 1fr) minmax(100px, 1.4fr) 56px 88px;
}
.reconcile-modal-items-sales .reconcile-list-head,
.reconcile-modal-items-sales .reconcile-list-row {
  grid-template-columns: 72px 100px 80px minmax(120px, 200px) 76px 56px 72px 84px 72px 92px;
  font-size: 11px;
}
.reconcile-modal-items-purchase .reconcile-list-head,
.reconcile-modal-items-purchase .reconcile-list-row {
  grid-template-columns: 72px 100px minmax(120px, 200px) 76px 56px 72px 84px 72px 92px;
  font-size: 11px;
}
.reconcile-modal-items-sales,
.reconcile-modal-items-purchase { overflow: hidden; }
.reconcile-col-partno { font-size: 11px; color: var(--primary); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reconcile-col-unitprice,
.reconcile-col-tax,
.reconcile-col-invoice { text-align: right; white-space: nowrap; font-size: 11px; }
.reconcile-col-invoice { font-weight: 700; color: var(--primary); }
.reconcile-modal-row { cursor: default; }
.reconcile-modal-row:hover { background: transparent; }
.reconcile-actions { margin-top: 10px; }
@media (max-width: 900px) {
  .reconcile-list-head { display: none; }
  .reconcile-list-row,
  .reconcile-draft-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 6px 8px;
  }
  .reconcile-list-body { max-height: none; background: var(--surface-soft); padding-bottom: 4px; }
}

.reconcile-cutoff-label { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.reconcile-col-bizdate { text-align: center; color: var(--muted); font-size: 11px; white-space: nowrap; }
.session-pw-btn {
  width: 100%;
  padding: 7px 10px;
  font-size: 12px;
  color: #d9e6e2;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.session-pw-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* fin-arap draft table: checkbox column */
.fin-arap-draft-wrap {
  overflow-x: auto;
}
.fin-arap-draft-head,
.fin-arap-draft-row {
  /* 11列：整行不换行（对齐 V1） */
  grid-template-columns: 22px 56px minmax(96px, 1.2fr) minmax(64px, 0.8fr) 36px 72px 64px 78px 72px 68px minmax(88px, auto);
  gap: 4px 6px;
  padding: 6px 8px;
  font-size: 11px;
  width: max-content;
  min-width: 100%;
  align-items: center;
}
.fin-arap-draft-wrap .reconcile-draft-head,
.fin-arap-draft-wrap .reconcile-draft-row {
  white-space: nowrap;
}
.fin-arap-draft-wrap .reconcile-draft-head > span,
.fin-arap-draft-wrap .reconcile-draft-row > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fin-arap-draft-wrap .reconcile-list-body { max-height: none; }
@media (max-width: 900px) {
  .fin-arap-draft-wrap .fin-arap-draft-head { display: grid; }
  .fin-arap-draft-wrap .fin-arap-draft-row {
    grid-template-columns: 22px 56px minmax(96px, 1.2fr) minmax(64px, 0.8fr) 36px 72px 64px 78px 72px 68px minmax(88px, auto);
    gap: 4px 6px;
    padding: 6px 8px;
    margin: 0;
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
  }
}
/* expense monthly groups */
.expense-group-list { display: flex; flex-direction: column; gap: 6px; }
.expense-group-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.expense-group-section.open { border-color: var(--accent-soft); }
.expense-flow-hint { line-height: 1.65; }
.expense-group-header {
  display: grid;
  grid-template-columns: 28px 1fr auto auto auto;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
}
.expense-group-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.expense-group-toggle:hover .expense-group-arrow { color: var(--accent); }
.expense-group-arrow { font-size: 10px; color: var(--muted); width: 14px; flex-shrink: 0; }
.expense-group-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.expense-group-title { font-weight: 700; font-size: 13px; line-height: 1.35; }
.expense-group-party { font-size: 12px; color: var(--muted); }
.expense-group-amt { font-weight: 700; font-size: 13px; white-space: nowrap; text-align: right; }
.expense-period-tag { font-weight: 400; font-size: 11px; color: var(--muted); margin-left: 6px; }
.expense-group-actions { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 720px) {
  .expense-group-header {
    grid-template-columns: 28px 1fr auto;
    grid-template-areas: "arrow main amt" "arrow status actions";
  }
  .expense-group-toggle { grid-area: arrow; }
  .expense-group-main { grid-area: main; }
  .expense-group-amt { grid-area: amt; }
  .expense-group-header > .badge { grid-area: status; justify-self: start; }
  .expense-group-actions { grid-area: actions; }
}
.expense-group-actions .btn-sm,
.expense-btn-disabled {
  padding: 4px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  min-width: 52px;
}
.expense-group-confirm-btn { background: var(--ok); color: #fff; }
.expense-group-pay-btn { background: var(--accent); color: #fff; }
.expense-btn-disabled { background: #c8cdd2 !important; color: #fff !important; cursor: not-allowed !important; opacity: 0.75; }
.expense-group-body { border-top: 1px solid var(--line); }
.expense-detail-row { padding: 6px 12px !important; }
.badge-gray { background: #eef2f5; color: var(--muted); }
/* sales compare — 完全对齐 V1 销售看板 */
.admin-section-title.sales-compare-head,
.sales-compare-head {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 6px;
}
.sales-compare-head-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.sales-compare-head-left h3 { margin: 0; font-size: 14px; }
.sales-compare-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  margin: 0;
}
.sales-compare-tab {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.sales-compare-tab:hover { border-color: var(--accent); color: var(--accent); }
.sales-compare-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.sales-compare-sub { font-size: 11px; color: var(--muted); margin: 0; line-height: 1.3; }
.sales-compare-body { padding: 0 0 4px; min-width: 0; }
.sales-compare-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.sales-compare-table th, .sales-compare-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right;
}
.sales-compare-table th:first-child, .sales-compare-table td:first-child { text-align: left; }
.sales-compare-table thead th { background: var(--surface-soft); font-weight: 700; }
.sales-compare-table tbody tr:last-child td { border-bottom: 0; }
.sales-compare-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.sales-compare-note summary {
  cursor: pointer;
  user-select: none;
  color: var(--muted);
}
.sales-compare-note-body {
  margin-top: 4px;
  line-height: 1.35;
}
.sales-compare-section { margin-bottom: 12px; min-width: 0; }
@media (max-width: 520px) {
  .sales-compare-head { align-items: flex-start; }
  .sales-compare-tabs { width: 100%; justify-content: flex-end; }
}
/* 看板：销售对比 + 损益表并排（V1） */
.dash-metrics-row,
.ops-dash-body .dash-metrics-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) !important;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 10px;
  min-width: 0;
  width: 100%;
}
.dash-metrics-row > .admin-section {
  margin-bottom: 0;
  height: auto;
  min-width: 0;
  overflow: visible;
}
.dash-pnl-section { margin-bottom: 0; }
.dash-pnl-body { padding: 0 2px 4px; }
.dash-order-flow { margin-top: 0; }
.dash-order-flow-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 4px 2px;
  list-style: none;
}
.dash-order-flow-summary::-webkit-details-marker { display: none; }
/* dash-metrics stack handled at end (640px only) */
/* CEO dashboard compact layout */
.ceo-dash-top { margin-bottom: 10px; }
.ceo-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}
.ceo-mini-card {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.ceo-mini-card:hover { border-color: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.ceo-mini-card span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ceo-mini-card b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ceo-mini-card em {
  display: block;
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ceo-funds-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-soft) 0%, #fff 100%);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.3;
  transition: border-color 0.15s;
}
.ceo-funds-bar:hover { border-color: var(--accent); }
.ceo-funds-label { font-weight: 700; color: var(--ink); white-space: nowrap; }
.ceo-funds-total b { font-size: 15px; color: var(--ink); }
.ceo-funds-sep { color: var(--line); user-select: none; }
.ceo-funds-item { color: var(--muted); white-space: nowrap; }
.ceo-funds-tax { color: var(--danger); white-space: nowrap; }
.ceo-funds-avail { color: var(--ok); font-weight: 600; white-space: nowrap; }
.ceo-funds-rate { font-size: 10px; color: var(--muted); text-decoration: none; margin-left: auto; white-space: nowrap; }
.ceo-funds-rate:hover { color: var(--accent); }
@media (max-width: 768px) {
  .ceo-stat-grid { grid-template-columns: repeat(3, 1fr); }
  .ceo-funds-bar { font-size: 11px; padding: 6px 8px; gap: 4px 8px; }
  .ceo-funds-rate { margin-left: 0; }
}
@media (max-width: 480px) {
  .ceo-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.memo-done { opacity: 0.55; }
.memo-done b { text-decoration: line-through; }
.report-content { line-height: 1.6; }

.memo-row-todo { border-left: 4px solid #16a34a !important; background: rgba(22,163,74,0.07) !important; }
.memo-row-memo { border-left: 4px solid #d97706 !important; background: rgba(217,119,6,0.08) !important; }
.memo-type-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; margin-right: 4px; }
.memo-badge-todo { background: #dcfce7; color: #15803d; }
.memo-badge-memo { background: #fef3c7; color: #b45309; }
.memo-content-preview { font-size: 12px; color: var(--text); line-height: 1.5; }
.memo-meta { font-size: 11px; color: var(--muted); }
.memo-src-ai, .memo-src-manual { font-size: 11px; color: var(--muted); margin-right: 4px; }
.memo-kind-btn { transition: background .15s, box-shadow .15s; }
.memo-kind-btn:hover { filter: brightness(1.05); }

.memo-form-box { margin-top: 10px; padding: 16px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); transition: border-color .2s, background .2s, box-shadow .2s; }
.memo-form-todo { border-color: #16a34a !important; background: rgba(22,163,74,0.06) !important; box-shadow: 0 4px 14px rgba(22,163,74,0.12); }
.memo-form-memo { border-color: #d97706 !important; background: rgba(217,119,6,0.07) !important; box-shadow: 0 4px 14px rgba(217,119,6,0.12); }

.io-pending-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 72px 80px 28px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}
.io-pending-row .list-row-main { min-width: 0; overflow-wrap: anywhere; word-break: normal; }
.io-pending-row.io-done-row {
  grid-template-columns: 28px minmax(160px, 1fr) 56px 72px auto;
}
.io-pending-row.io-done-row .list-row-main {
  overflow-wrap: normal;
  word-break: keep-all;
  white-space: normal;
}
.io-pending-row.io-done-row .list-row-main b,
.io-pending-row.io-done-row .list-row-main span,
.io-pending-row.io-done-row .list-row-main small {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.io-pending-row .list-row-main b,
.io-pending-row .list-row-main span {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.io-detail-link { white-space: nowrap; }
.io-pick-slot { display: flex; align-items: center; justify-content: center; }
.io-qty-col { text-align: center; white-space: nowrap; line-height: 1.2; }
.io-qty-num { display: block; font-size: 16px; font-weight: 700; color: var(--primary); }
.io-qty-label { display: block; font-size: 11px; color: var(--muted); }
.io-badge-slot { display: flex; align-items: center; justify-content: center; min-height: 24px; }
.io-table-scroll { overflow-x: auto; margin: 0 -2px; }
.io-qty-table.io-io-table { table-layout: fixed; width: 100%; min-width: 560px; }
.io-outbound-table { min-width: 820px; }
.io-qty-table.io-io-table .col-po { width: 108px; max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.io-qty-table.io-io-table .col-model { width: 120px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.io-qty-table.io-io-table .col-num { width: 56px; }
.io-qty-table.io-io-table .col-input { width: 80px; }
.io-qty-table.io-io-table .col-action { width: 72px; }
.io-qty-table.io-io-table .col-flag { width: 64px; }
.io-qty-table.io-io-table th.io-num,
.io-qty-table.io-io-table td.io-num { text-align: center; }
.io-qty-table.io-io-table input { width: 100%; max-width: 72px; box-sizing: border-box; }

.io-combine-bar { display:flex; align-items:center; gap:10px; margin:0 0 12px; padding:10px 12px; background:#eef6ff; border:1px solid #c9e2ff; border-radius:8px; flex-wrap:wrap; }
.io-combine-bar .order-act-btn.primary:disabled { opacity:0.45; cursor:not-allowed; }
.io-pick-slot input[type=checkbox] { width:16px; height:16px; cursor:pointer; }
/* Material line-entry pick dropdowns */
.mat-lines-form-table { overflow: visible; margin-bottom: 4px; }
.mat-lines-form-table .master-table td.pick-cell {
  overflow: visible !important;
  vertical-align: top;
  min-width: 220px;
}
.mat-lines-form-table .master-search-pick-cell { min-width: 220px; }
.mat-lines-actions { margin-top: 12px; clear: both; position: relative; z-index: 1; }
.master-pick-list.master-pick-list-floating {
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

/* 低库存补货弹窗 — 加宽约2倍，供应商横排 */
.rp-replenish-modal-box {
  width: min(98vw, 2560px) !important;
  max-width: min(98vw, 2560px) !important;
}
.io-modal-box-xl {
  width: min(98vw, 1400px) !important;
  max-width: min(98vw, 1400px) !important;
}
/* 销售单→采购草稿：列多，尽量拉满屏宽 */
.pd-draft-modal-box,
#purchaseDraftModal .io-modal-box {
  width: min(98vw, 1920px) !important;
  max-width: min(98vw, 1920px) !important;
}
#purchaseDraftModalBody .pd-draft-scroll {
  overflow: auto;
  max-height: min(68vh, 720px);
}
.pd-draft-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 13px;
}
.pd-draft-table th,
.pd-draft-table td {
  padding: 8px 10px;
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 1px solid var(--line, #e8e8e8);
}
.pd-draft-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  font-size: 12px;
  color: var(--muted, #667085);
  font-weight: 600;
}
.pd-draft-table .pd-col-type { min-width: 72px; }
.pd-draft-table .pd-col-model { min-width: 160px; white-space: normal; }
.pd-draft-table .pd-col-unit { min-width: 48px; text-align: center; }
.pd-draft-table .pd-col-supplier { min-width: 120px; white-space: normal; }
.pd-draft-table .pd-col-num { min-width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.pd-draft-table .pd-col-qty,
.pd-draft-table .pd-col-price { min-width: 100px; text-align: right; }
.pd-draft-table .pd-col-reason { min-width: 220px; white-space: normal; font-size: 12px; }
.pd-draft-table .pd-line-qty,
.pd-draft-table .pd-line-price { width: 88px; max-width: 100%; }
/* 已发料 / 待发料 / 发料明细：加宽，避免右侧列被裁切 */
.io-modal-box.io-modal-box-issue {
  width: min(98vw, 1680px) !important;
  max-width: min(98vw, 1680px) !important;
}
#issueSlipListModal .io-modal-box,
#issueSlipDetailModal .io-modal-box,
#issueStockModal .io-modal-box {
  width: min(98vw, 1680px) !important;
  max-width: min(98vw, 1680px) !important;
}
.io-modal-box > #issueStockModalBody,
.io-modal-box > #issueSlipListModalBody,
.io-modal-box > #issueSlipDetailModalBody {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  padding: 12px 24px;
}
#issueSlipListModalBody .issue-slip-list-table-wrap {
  overflow: hidden;
  max-width: 100%;
}
#issueSlipListModalBody .issue-slip-list-table-wrap .master-table-scroll {
  max-height: min(62vh, 560px);
  overflow-x: scroll !important;
  overflow-y: auto !important;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: auto !important;
  scrollbar-color: #6b7280 #e8edf2 !important;
}
#issueSlipListModalBody .issue-slip-list-table-wrap .master-table-scroll::-webkit-scrollbar {
  height: 12px !important;
  width: 12px !important;
  display: block !important;
}
#issueSlipListModalBody .issue-slip-list-table-wrap .master-table-scroll::-webkit-scrollbar-track {
  background: #e8edf2 !important;
  border-radius: 6px;
}
#issueSlipListModalBody .issue-slip-list-table-wrap .master-table-scroll::-webkit-scrollbar-thumb {
  background: #6b7280 !important;
  border-radius: 6px;
  border: 2px solid #e8edf2;
}
#issueSlipListModalBody .issue-slip-list-table-wrap .master-table-scroll::-webkit-scrollbar-corner {
  background: #e8edf2 !important;
}
#issueSlipListModalBody .issue-slip-list-table {
  min-width: 1100px;
}
.issue-stock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface, #f8fafc);
  cursor: pointer;
}
.issue-stock-bar:hover { border-color: var(--accent); background: #fff; }
.issue-slip-list-section .results-inner { padding: 0; }
.issue-slip-list-section .master-table-wrap { margin: 0; }
/* 发料单页内「待发料/已发料」列表：强制显示左右滚动条 */
.issue-slip-list-section .master-table-scroll,
.issue-slip-list-table-wrap .master-table-scroll {
  overflow-x: scroll !important;
  overflow-y: auto !important;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: auto !important;
  scrollbar-color: #6b7280 #e8edf2 !important;
}
.issue-slip-list-section .master-table-scroll::-webkit-scrollbar,
.issue-slip-list-table-wrap .master-table-scroll::-webkit-scrollbar {
  height: 12px !important;
  width: 12px !important;
  display: block !important;
}
.issue-slip-list-section .master-table-scroll::-webkit-scrollbar-track,
.issue-slip-list-table-wrap .master-table-scroll::-webkit-scrollbar-track {
  background: #e8edf2 !important;
  border-radius: 6px;
}
.issue-slip-list-section .master-table-scroll::-webkit-scrollbar-thumb,
.issue-slip-list-table-wrap .master-table-scroll::-webkit-scrollbar-thumb {
  background: #6b7280 !important;
  border-radius: 6px;
  border: 2px solid #e8edf2;
}
.issue-slip-list-table tbody tr { cursor: pointer; }
.issue-slip-list-table tbody tr:hover { background: rgba(18, 100, 90, 0.06); }
.issue-slip-open-row { cursor: pointer; }
.issue-slip-open-row:hover { background: rgba(18, 100, 90, 0.06); }
.issue-slip-tabs {
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 8px;
}
.issue-slip-tabs .wh-io-tab {
  flex: 1 1 0;
  min-width: 0;
  width: auto !important;
  min-height: 0 !important;
  max-width: none;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}
.issue-slip-tabs .issue-slip-tab-draft.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.issue-slip-tabs .issue-slip-tab-draft.active:hover {
  filter: brightness(1.05);
}
#issueSlipDetailModalBody .issue-slip-detail-table-wrap {
  overflow: hidden;
  max-height: none;
  max-width: 100%;
  border: none;
}
#issueSlipDetailModalBody .issue-slip-detail-table-wrap .master-table-scroll {
  max-height: min(58vh, 520px);
  overflow-x: scroll !important;
  overflow-y: auto !important;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: auto !important;
  scrollbar-color: #6b7280 #e8edf2 !important;
  border: 1px solid var(--line);
  border-radius: 6px;
}
#issueSlipDetailModalBody .issue-slip-detail-table-wrap .master-table-scroll::-webkit-scrollbar {
  height: 12px !important;
  width: 12px !important;
  display: block !important;
}
#issueSlipDetailModalBody .issue-slip-detail-table-wrap .master-table-scroll::-webkit-scrollbar-track {
  background: #e8edf2 !important;
  border-radius: 6px;
}
#issueSlipDetailModalBody .issue-slip-detail-table-wrap .master-table-scroll::-webkit-scrollbar-thumb {
  background: #6b7280 !important;
  border-radius: 6px;
  border: 2px solid #e8edf2;
}
#issueSlipDetailModalBody .issue-slip-detail-table-wrap .master-table-scroll::-webkit-scrollbar-corner {
  background: #e8edf2 !important;
}
#issueSlipDetailModalBody .issue-slip-detail-table {
  min-width: 1480px;
  width: max-content;
}
#issueSlipDetailModalBody .issue-slip-detail-table th,
#issueSlipDetailModalBody .issue-slip-detail-table td {
  white-space: nowrap !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
#issueSlipDetailModalBody .issue-slip-pick-col {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  overflow: visible;
  white-space: nowrap;
  padding: 6px 4px;
}
#issueSlipDetailModalBody thead .issue-slip-pick-col {
  z-index: 3;
  background: var(--surface-soft);
}
#issueSlipDetailModalBody tr:hover .issue-slip-pick-col { background: var(--accent-soft); }
#issueSlipDetailModalBody .issue-slip-pick-lbl {
  display: block;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.2;
  margin-bottom: 2px;
}
#issueSlipDetailModalBody .issue-slip-detail-table td:not(.issue-slip-pick-col),
#issueSlipDetailModalBody .issue-slip-detail-table th:not(.issue-slip-pick-col) {
  white-space: normal;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
.issue-slip-danger-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.issue-slip-danger-row .issue-del-btn {
  color: var(--danger, #c62828);
  border-color: #f0b8b8;
  background: #fff5f5;
}
.issue-slip-danger-hint {
  font-size: 11px;
  color: var(--muted);
}
.io-modal-box > #purchaseReplenishModalBody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 24px;
}
.rp-replenish-scroll {
  overflow: auto;
  max-height: 72vh;
}
.rp-replenish-table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}
.rp-replenish-table th,
.rp-replenish-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line, #e8e8e8);
  vertical-align: middle;
  text-align: left;
}
.rp-replenish-table th {
  font-size: 12px;
  color: var(--muted, #667085);
  background: #f8fafc;
  white-space: nowrap;
}
.rp-replenish-table .rp-col-supplier {
  min-width: 160px;
  max-width: 280px;
  white-space: nowrap;
  word-break: keep-all;
  writing-mode: horizontal-tb;
  line-height: 1.4;
}
.rp-replenish-table .rp-col-model {
  min-width: 140px;
  white-space: nowrap;
}
.rp-replenish-table .rp-col-num {
  text-align: right;
  white-space: nowrap;
  min-width: 72px;
}
.rp-replenish-table .rp-col-reason {
  min-width: 220px;
  max-width: 420px;
  font-size: 12px;
  color: #c60;
  line-height: 1.45;
  word-break: break-word;
  white-space: normal;
}
.rp-replenish-table .rp-col-action {
  text-align: center;
  white-space: nowrap;
  width: 72px;
  position: sticky;
  right: 0;
  background: #fff;
  box-shadow: -4px 0 8px rgba(0,0,0,.04);
}
.rp-replenish-table thead .rp-col-action {
  background: #f8fafc;
}
.rp-replenish-table tr.rp-bom-parent-row td {
  background: #fff8ef;
}
.rp-replenish-table tr.rp-bom-parent-row .rp-col-action {
  background: #fff8ef;
}
.rp-replenish-table .btn-rp-line-remove {
  padding: 4px 12px;
  border: 1px solid #e57373;
  background: #fff5f5;
  color: #c62828;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}
.rp-replenish-table .btn-rp-line-remove:hover {
  background: #ffebee;
}

/* 物料主表：工具栏固定宽度，仅表格区横向滚动 */
.admin-section { min-width: 0; }
.master-data-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.master-toolbar,
.master-field-config,
#masterFieldConfigPanel {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.master-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden; /* 宽表不外溢，由内部 .master-table-scroll 左右滚动 */
  border: 1px solid var(--line);
  border-radius: 6px;
  max-height: none;
}
.master-table-scroll {
  max-height: 480px;
  overflow-x: auto;
  overflow-y: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.ops-materials-page .master-table-scroll,
.master-data-shell .master-table-scroll,
#adminContent .master-table-scroll {
  overflow-x: auto !important;
  overflow-y: auto !important;
}
.master-table-wrap .master-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.master-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-soft);
}
.master-table-scroll th.th-actions.sticky-actions {
  z-index: 5;
}
.master-table th.th-actions {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}
.master-table th.th-actions.sticky-actions,
.master-table td.td-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -3px 0 6px rgba(15, 23, 42, 0.06);
}
.master-table th.th-actions.sticky-actions {
  z-index: 4;
  background: var(--surface-soft);
}
.master-table td.td-actions {
  max-width: 56px;
  min-width: 56px;
  width: 56px;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  padding: 4px 2px;
  vertical-align: middle;
}
.master-table tr:hover td.td-actions { background: var(--accent-soft); }
.master-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-wrap: nowrap;
}
.master-act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  padding: 0;
  margin: 0;
  font-size: 10px;
  line-height: 1;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
}
.master-act-btn.master-edit-btn { border-color: #b8c9f0; color: var(--accent); }
.master-act-btn.master-del-btn { border-color: #f0b8b8; color: var(--danger); }
.master-act-btn.master-expand-btn { border-color: #ddd; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: -1px; }

/* 基础资料 ops-materials / 各角色：工具栏不随表宽拉长 */
#adminContent,
#admin,
main {
  min-width: 0;
  max-width: 100%;
}
#adminContent .admin-section,
.ops-materials-page,
.ops-materials-body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
#adminContent .admin-section {
  overflow-x: hidden;
  overflow-y: visible;
}
.ops-materials-page,
.ops-materials-body,
.master-data-shell {
  overflow-x: hidden;
  overflow-y: visible;
}
.master-tabs.ops-materials-tabs,
.ops-materials-page > .master-tabs {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  box-sizing: border-box;
}
.ops-materials-page > p[style*="font-size:12px"] {
  max-width: 100%;
}
/* 兼容旧缓存：无 master-table-scroll 时 wrap 自身滚动 */
.master-table-wrap:not(:has(.master-table-scroll)) {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 480px;
}

/* erp-viewport-unify — 各电脑底部对齐、列表高度随屏幕自适应 */
html {
  height: 100%;
}

body:not(.is-locked) {
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body:not(.is-locked) .sidebar {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden; /* 侧栏整体不滚 */
  overscroll-behavior: none;
  display: flex;
  flex-direction: column;
}

body:not(.is-locked) main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
}

body:not(.is-locked) #admin.view.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body:not(.is-locked) #adminContent {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* 全站壳层：高度与左侧导航一致，禁止整页上下滚（综合看板 → 报表中心） */
html.app-shell-locked,
body.app-shell-locked {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
body.app-shell-locked main {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  /* 底边与左侧侧栏 padding / 退出按钮对齐 */
  padding-bottom: 22px !important;
}
body.app-shell-locked #admin.view.active {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
body.app-shell-locked #adminContent {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important; /* 只在右侧内容区滚，不是整页 */
  overscroll-behavior: contain !important;
  padding-bottom: 10px;
  box-sizing: border-box;
}
body.app-shell-locked.view-master-locked #adminContent {
  overflow: hidden !important; /* 基础资料仍只滚列表 */
  padding-bottom: 0;
}

/* 综合看板：标题/页签固定，下方内容可滚，底边与退出对齐 */
body.app-shell-locked #adminContent:has(.ops-dash-body) {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding-bottom: 0 !important;
}
body.app-shell-locked #adminContent:has(.ops-dash-body) > .admin-section {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  margin-bottom: 0 !important;
}
body.app-shell-locked #adminContent:has(.ops-dash-body) > .admin-section > .admin-section-title,
body.app-shell-locked .ops-dash-tabs {
  flex: 0 0 auto !important;
}
body.app-shell-locked .ops-dash-body {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  padding-bottom: 10px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
body.app-shell-locked .ops-dash-tabs.master-tabs {
  margin-bottom: 8px;
}
body.app-shell-locked .ops-dash-tabs .master-tab {
  font-size: 12px;
  padding: 4px 10px;
}

/* 综合看板：仅 .ops-dash-body 是滚动容器；标题和页签固定 */
body.app-shell-locked #adminContent:has(.ops-dash-body) {
  height: 100% !important;
  min-height: 0 !important;
}
body.app-shell-locked #adminContent:has(.ops-dash-body) > .admin-section {
  height: 100% !important;
  box-sizing: border-box !important;
}
body.app-shell-locked .ops-dash-body {
  height: 0 !important;
  min-height: 0 !important;
  flex: 1 1 0 !important;
  scrollbar-gutter: stable;
}

/* sales/compare metrics: kept in primary block above; no duplicate overrides */
/* 运营综合看板 → 销售看板：9 卡两行 + 对比/损益并排 */
.ops-dash-body .sales-stat-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-bottom: 12px !important;
}
.ops-dash-body .sales-stat-grid .mini-card {
  padding: 10px 8px !important;
  border-radius: 8px !important;
  min-width: 0;
  text-align: center;
}
.ops-dash-body .sales-stat-grid span {
  display: block;
  font-size: 12px !important;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ops-dash-body .sales-stat-grid b {
  display: block;
  font-size: 18px !important;
  margin-top: 4px !important;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ops-dash-body .dash-metrics-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) !important;
  gap: 10px !important;
  align-items: start;
  width: 100%;
  min-width: 0;
}
.ops-dash-body .dash-metrics-row > .admin-section {
  min-width: 0;
  margin-bottom: 0 !important;
  height: auto !important;
  overflow: visible !important;
}
.ops-dash-body .admin-section-title.sales-compare-head,
.ops-dash-body .sales-compare-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .ops-dash-body .sales-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .ops-dash-body .sales-stat-grid span { font-size: 11px !important; }
  .ops-dash-body .sales-stat-grid b { font-size: 16px !important; }
}


body:not(.is-locked) .admin-hero,
body:not(.is-locked) .toolbar,
body:not(.is-locked) .sales-draft-alert {
  flex-shrink: 0;
}

:root {
  --erp-list-offset: 248px;
}

body:not(.is-locked) .results-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body:not(.is-locked) .results-scroll > .admin-section-title {
  flex-shrink: 0;
}

body:not(.is-locked) .results-inner {
  flex: 1 1 auto;
  min-height: 160px;
  max-height: calc(100dvh - var(--erp-list-offset));
  overflow-y: auto;
}

body:not(.is-locked) .dash-scroll {
  flex: 1 1 auto;
  min-height: 0;
}

body:not(.is-locked) .dash-scroll-inner {
  max-height: calc(100dvh - var(--erp-list-offset));
  min-height: 140px;
  overflow-y: auto;
}

body:not(.is-locked) .log-list {
  max-height: calc(100dvh - var(--erp-list-offset));
  overflow-y: auto;
}

body:not(.is-locked) .reconcile-list-body {
  max-height: calc(100dvh - 280px);
}

body:not(.is-locked) .reconcile-draft-wrap .reconcile-list-body {
  max-height: none;
}

@media (max-width: 768px) {
  body:not(.is-locked).app-shell-locked {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }
  body:not(.is-locked).app-shell-locked main {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }
  body:not(.is-locked).app-shell-locked #adminContent {
    overflow-y: auto !important;
  }
}

/* pwfix issue slip stock */
.issue-stock-overview { margin: 8px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.issue-stock-overview.empty-hint { font-size: 12px; color: var(--muted); padding: 8px 12px; }
.issue-stock-overview-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.issue-stock-overview-scroll { max-height: 180px; overflow: auto; }
.issue-stock-overview-table { font-size: 12px; margin: 0; }
.issue-stock-overview-table th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.issue-stock-overview-table td, .issue-stock-overview-table th { padding: 6px 8px; }
.issue-mat-type-badge { font-size: 10px; margin-left: 4px; vertical-align: middle; }
.issue-mat-name { font-size: 11px; color: var(--muted); }
.issue-stock-col { min-width: 140px; }
.issue-stock-cell { font-size: 12px; line-height: 1.5; color: var(--text); }
.issue-stock-lbl { display: inline-block; min-width: 88px; font-size: 11px; color: var(--muted); }
.issue-stock-qty { font-size: 13px; color: var(--text); }
.issue-stock-unit { font-size: 11px; color: var(--muted); }

/* 邮件工作台：填满 main 区域，右侧正文独立滚动 */
body.app-email-view main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
}
body.app-email-view #admin.view.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.app-email-view #adminContent {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.email-workspace {
  flex: 1;
  min-height: 360px;
  display: flex;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line, #e8e8e8);
  margin-top: -12px;
}
.email-workspace > div:last-child {
  min-width: 0;
}
#emailDetail {
  min-height: 0;
}
#emailBody {
  overscroll-behavior: contain;
}

/* 邮件 AI 回复：可拖动弹窗 */
.email-ai-draft-popup {
  position: fixed;
  z-index: 10050;
  width: min(560px, calc(100vw - 32px));
  height: min(580px, calc(100vh - 80px));
  max-height: min(580px, calc(100vh - 80px));
  display: none;
  flex-direction: column;
  background: #fef9e7;
  border: 1px solid #f0c674;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.email-ai-draft-popup.expanded {
  width: min(1120px, calc(100vw - 24px));
  height: min(calc(100vh - 48px), 1160px);
  max-height: min(calc(100vh - 48px), 1160px);
}
.email-ai-draft-drag {
  cursor: move;
  user-select: none;
  padding: 10px 14px;
  background: linear-gradient(180deg, #f9e79f 0%, #f5d76e 100%);
  font-weight: 600;
  font-size: 12px;
  color: #8a6d0a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.email-ai-draft-head-btns {
  display: flex;
  gap: 10px;
  align-items: center;
}
.email-ai-draft-drag button {
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}
.email-ai-draft-drag button:hover { color: #333; }
.email-ai-draft-body {
  flex: 1;
  min-height: 200px;
  max-height: none;
  overflow-y: auto;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.email-ai-draft-popup.expanded .email-ai-draft-body {
  font-size: 14px;
  line-height: 1.65;
  padding: 16px 20px;
}
.email-ai-draft-actions {
  padding: 10px 12px;
  border-top: 1px solid #f0c674;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
  background: #fef9e7;
}

/* ===== 基础资料 / 基础数据：紧凑页签、搜索栏、减少空白 ===== */
#adminContent .admin-section:has(.ops-materials-page),
#adminContent .admin-section:has(> .master-tabs),
#adminContent .admin-section:has(.master-data-shell) {
  padding: 8px 10px;
  gap: 6px;
  border-radius: 8px;
}
#adminContent .admin-section:has(.ops-materials-page) > .admin-section-title,
#adminContent .admin-section:has(> .master-tabs) > .admin-section-title,
#adminContent .admin-section:has(.master-data-shell) > .admin-section-title {
  margin: 0;
  padding: 0;
  gap: 6px;
}
#adminContent .admin-section:has(.ops-materials-page) > .admin-section-title h2,
#adminContent .admin-section:has(> .master-tabs) > .admin-section-title h2,
#adminContent .admin-section:has(.master-data-shell) > .admin-section-title h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
}

/* 页签：小字号、紧凑分格，避免一行过高、两侧留白过大 */
.ops-materials-page > .master-tabs,
.master-tabs.ops-materials-tabs,
#adminContent .admin-section > .master-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0 0 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}
.ops-materials-page .master-tab,
.master-tabs.ops-materials-tabs .master-tab,
#adminContent .admin-section > .master-tabs .master-tab {
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 500;
  gap: 4px;
  white-space: nowrap;
}
.ops-materials-page .master-tab.active,
.master-tabs.ops-materials-tabs .master-tab.active,
#adminContent .admin-section > .master-tabs .master-tab.active {
  background: #fff;
  border-color: var(--line);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ops-materials-page .master-tab .badge,
.master-tabs.ops-materials-tabs .master-tab .badge,
#adminContent .admin-section > .master-tabs .master-tab .badge {
  padding: 0 5px;
  font-size: 10px;
  border-radius: 8px;
  line-height: 1.4;
}

/* 第二行应用栏：搜索 + 操作按钮，字号缩小、高度压低 */
.ops-materials-page .master-toolbar,
.master-data-shell > .master-toolbar,
.ops-materials-body > .toolbar,
.ops-materials-body .admin-section > .toolbar {
  gap: 5px;
  margin-bottom: 4px;
  align-items: center;
}
.ops-materials-page .master-toolbar input,
.ops-materials-page .master-toolbar input.master-search,
.ops-materials-page .master-toolbar input.ops-search,
.master-data-shell > .master-toolbar input,
.master-data-shell > .master-toolbar input.master-search,
.master-data-shell > .master-toolbar input.ops-search,
.ops-materials-body > .toolbar .order-search {
  flex: 0 0 160px !important;
  width: 160px !important;
  max-width: 160px !important;
  min-width: 160px !important;
  min-height: 24px !important;
  height: 24px !important;
  padding: 2px 6px !important;
  font-size: 11px !important;
  border-radius: 4px;
  border: 1px solid var(--line);
  box-sizing: border-box;
}
.ops-materials-page .master-toolbar button,
.master-data-shell > .master-toolbar button,
.ops-materials-page .master-add-btn,
.ops-materials-page .master-import-btn,
.ops-materials-page .master-export-btn,
.ops-materials-page .ops-import-btn,
.ops-materials-page .ops-export-btn,
.master-data-shell .master-add-btn,
.master-data-shell .master-import-btn,
.master-data-shell .master-export-btn,
.ops-materials-body > .toolbar button,
.ops-materials-body .order-create-btn,
.ops-materials-body .search-go-btn {
  min-height: 24px !important;
  height: 24px !important;
  padding: 1px 8px !important;
  font-size: 11px !important;
  border-radius: 4px !important;
  line-height: 1.2 !important;
  font-weight: 500;
}

/* 显示字段行压低 */
.ops-materials-page .master-field-config,
.master-data-shell > .master-field-config {
  margin: 2px 0 4px !important;
  font-size: 11px;
  line-height: 1.35;
}
.ops-materials-page .master-field-config span,
.master-data-shell > .master-field-config span {
  font-size: 11px !important;
}
.ops-materials-page .master-field-config-btn,
.master-data-shell .master-field-config-btn {
  padding: 1px 6px !important;
  font-size: 11px !important;
}

/* 表内容略紧凑，把高度让给数据行 */
.ops-materials-page .master-table,
.master-data-shell .master-table {
  font-size: 12px;
}
.ops-materials-page .master-table th,
.ops-materials-page .master-table td,
.master-data-shell .master-table th,
.master-data-shell .master-table td {
  padding: 5px 8px;
}
.ops-materials-page .master-table-scroll,
.master-data-shell .master-table-scroll {
  overflow-x: auto !important;
  overflow-y: auto !important;
}

/* ===== 基础数据/基础资料：标题·页签·工具栏固定，仅列表上下滚动 ===== */
html.view-master-locked,
body.view-master-locked {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
body.view-master-locked main {
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  display: flex !important;
  flex-direction: column !important;
}
body.view-master-locked #admin.view.active {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
body.view-master-locked #adminContent {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important; /* 禁止整页滚，只滚列表 */
  overscroll-behavior: none !important;
  display: flex !important;
  flex-direction: column !important;
}
body.view-master-locked #adminContent > .admin-hero,
body.view-master-locked #adminContent > .admin-section > .admin-section-title,
body.view-master-locked .master-tabs,
body.view-master-locked .ops-materials-tabs,
body.view-master-locked .master-toolbar,
body.view-master-locked .master-field-config,
body.view-master-locked #masterFieldConfigPanel,
body.view-master-locked .toolbar {
  flex: 0 0 auto !important;
}
body.view-master-locked #adminContent > .admin-section {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  gap: 6px !important;
}
body.view-master-locked .ops-materials-page,
body.view-master-locked .ops-materials-body,
body.view-master-locked .master-data-shell,
body.view-master-locked .results-scroll {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  min-width: 0 !important;
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* 基础资料：禁止整页左右滑条，仅物料列表容器出滑条 */
html.view-master-locked,
body.view-master-locked {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}
body.view-master-locked,
body.view-master-locked main,
body.view-master-locked #admin.view.active,
body.view-master-locked #adminContent,
body.view-master-locked #adminContent > .admin-section,
body.view-master-locked .master-data-shell,
body.view-master-locked .ops-materials-page,
body.view-master-locked .ops-materials-body,
body.view-master-locked .master-table-wrap {
  overflow-x: hidden !important;
  max-width: 100% !important;
  min-width: 0 !important;
}
body.view-master-locked .master-table-scroll {
  overflow-x: scroll !important;
  overflow-y: scroll !important;
  width: 100% !important;
  max-width: 100% !important;
  inset: 0 !important;
  bottom: 0 !important;
}
/* wrap：占满剩余高度；物料列表铺满并强制显示上下左右滑条 */
body.view-master-locked .master-table-wrap {
  flex: 0 0 auto;
  min-height: 160px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  display: block !important;
  overflow: hidden !important;
  position: relative !important;
  border: 1px solid var(--line) !important;
  border-radius: 6px !important;
  background: #fff !important;
  /* 高度由 JS 按左侧退出底边计算 */
}
/* 其它区域隐藏滚动条（列表用后面更高优先级规则强制显示） */
body.view-master-locked *:not(.master-table-scroll):not(#mainNav):not(.modal-box-body):not(.inv-detail-list-scroll):not(#invDetailBody):not(.master-add-form):not(.master-import-area):not(#opsImportArea) {
  scrollbar-width: none;
}
body.view-master-locked *:not(.master-table-scroll):not(#mainNav):not(.modal-box-body):not(.inv-detail-list-scroll):not(#invDetailBody):not(.master-add-form):not(.master-import-area):not(#opsImportArea)::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}
body.view-master-locked .sidebar {
  overflow: hidden !important;
  background: #10231f !important;
}
body.view-master-locked .sidebar #mainNav {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(185, 204, 200, 0.55) rgba(0,0,0,0.12) !important;
}
body.view-master-locked .sidebar #mainNav::-webkit-scrollbar {
  width: 8px !important;
  height: 0 !important;
}
body.view-master-locked .sidebar #mainNav::-webkit-scrollbar-thumb {
  background: rgba(185, 204, 200, 0.45) !important;
  border-radius: 6px !important;
}
/* 物料列表：始终显示横向+纵向滑条 */
body.view-master-locked .master-table-scroll,
body.view-master-locked .ops-materials-body .results-inner,
body.view-master-locked .results-scroll > .results-inner {
  scrollbar-width: auto !important;
  scrollbar-color: #7b8794 #e8edf2 !important;
}
body.view-master-locked .master-table-scroll::-webkit-scrollbar,
body.view-master-locked .ops-materials-body .results-inner::-webkit-scrollbar,
body.view-master-locked .results-scroll > .results-inner::-webkit-scrollbar {
  width: 12px !important;
  height: 12px !important;
  display: block !important;
  background: #e8edf2 !important;
}
body.view-master-locked .master-table-scroll::-webkit-scrollbar-track,
body.view-master-locked .ops-materials-body .results-inner::-webkit-scrollbar-track,
body.view-master-locked .results-scroll > .results-inner::-webkit-scrollbar-track {
  background: #e8edf2 !important;
}
body.view-master-locked .master-table-scroll::-webkit-scrollbar-thumb,
body.view-master-locked .ops-materials-body .results-inner::-webkit-scrollbar-thumb,
body.view-master-locked .results-scroll > .results-inner::-webkit-scrollbar-thumb {
  background: #7b8794 !important;
  border-radius: 6px !important;
  border: 2px solid #e8edf2 !important;
}
body.view-master-locked .master-table-scroll::-webkit-scrollbar-corner,
body.view-master-locked .ops-materials-body .results-inner::-webkit-scrollbar-corner,
body.view-master-locked .results-scroll > .results-inner::-webkit-scrollbar-corner {
  background: #e8edf2 !important;
}

html.view-master-locked body.view-master-locked .master-table-scroll,
html.view-master-locked body.view-master-locked .master-data-shell .master-table-scroll,
html.view-master-locked body.view-master-locked .ops-materials-page .master-table-scroll {
  overflow-x: scroll !important;
  overflow-y: scroll !important;
  scrollbar-width: auto !important;
  scrollbar-color: #7b8794 #e8edf2 !important;
}
html.view-master-locked body.view-master-locked .master-table-scroll::-webkit-scrollbar {
  width: 12px !important;
  height: 12px !important;
  display: block !important;
  background: #e8edf2 !important;
}
body.view-master-locked .master-table-scroll {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow-x: scroll !important;
  overflow-y: scroll !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: auto !important;
  scrollbar-color: #6b7280 #dce3ea !important;
}
body.view-master-locked .ops-materials-body .results-inner,
body.view-master-locked .results-scroll > .results-inner {
  flex: 1 1 0 !important;
  min-height: 160px !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: scroll !important;
  overflow-y: scroll !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
    margin-bottom: 0 !important;
}
body.view-master-locked .results-scroll {
  position: relative !important;
}
body.view-master-locked .results-scroll > .results-inner {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  flex: none !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  margin-bottom: 0 !important;
}
body.view-master-locked .master-table-wrap .master-table,
body.view-master-locked .master-table-scroll > .master-table {
  width: max-content !important;
  min-width: 100% !important;
  max-width: none !important;
  table-layout: auto !important;
}
body.view-master-locked .master-table-scroll th:not(.sticky-col-1):not(.sticky-col-2):not(.sticky-actions):not(.th-actions),
body.view-master-locked .master-table-scroll td:not(.sticky-col-1):not(.sticky-col-2):not(.td-actions) {
  max-width: none !important;
  white-space: nowrap !important;
}
body.view-master-locked .master-table-scroll th.sticky-col-1,
body.view-master-locked .master-table-scroll th.sticky-col-2,
body.view-master-locked .master-table-scroll th.sticky-actions,
body.view-master-locked .master-table-scroll td.sticky-col-1,
body.view-master-locked .master-table-scroll td.sticky-col-2,
body.view-master-locked .master-table-scroll td.td-actions {
  white-space: nowrap !important;
  overflow: visible !important;
}
body.view-master-locked .master-tabs,
body.view-master-locked .ops-materials-tabs,
body.view-master-locked .master-toolbar,
body.view-master-locked .master-field-config,
body.view-master-locked #adminContent > .admin-section > .admin-section-title {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}
body.view-master-locked .master-add-form,
body.view-master-locked .master-import-area,
body.view-master-locked #opsImportArea {
  flex: 0 0 auto !important;
  max-height: 46vh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  scrollbar-width: thin !important;
  position: relative !important;
  z-index: 5 !important;
  background: var(--surface-soft, #f7f9fb) !important;
}
body.view-master-locked .master-add-form::-webkit-scrollbar,
body.view-master-locked .master-import-area::-webkit-scrollbar,
body.view-master-locked #opsImportArea::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}
body.view-master-locked .master-add-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft, #f7f9fb);
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line, #e5eaf0);
}
body.view-master-locked .master-add-form-head h4 { margin: 0; }
body.view-master-locked.master-add-open .master-table-wrap {
  /* 打开新增时由 JS 缩短表格高度，表单露在可视区 */
}
@media (max-width: 980px) {
  body.view-master-locked {
    /* 窄屏不强制双栏，避免再超边 */
    display: block !important;
  }
}

/* 销售对比 + 损益表：缩小并排（对齐 V1） */
.dash-metrics-row,
.ops-dash-body .dash-metrics-row,
body.app-shell-locked .ops-dash-body .dash-metrics-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) !important;
  gap: 8px !important;
  align-items: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  margin-bottom: 10px !important;
}
.dash-metrics-row > .admin-section,
.ops-dash-body .dash-metrics-row > .admin-section,
body.app-shell-locked .ops-dash-body .dash-metrics-row > .admin-section {
  min-width: 0 !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  margin-bottom: 0 !important;
  padding: 8px 10px !important;
  gap: 6px !important;
  overflow: hidden !important;
  display: grid !important;
  align-content: start !important;
  box-sizing: border-box !important;
}
.ops-dash-body .sales-compare-head,
.ops-dash-body .admin-section-title.sales-compare-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  margin-bottom: 4px !important;
}
.ops-dash-body .sales-compare-head-left h3,
.ops-dash-body .dash-pnl-section .admin-section-title h3 {
  font-size: 13px !important;
  margin: 0 !important;
}
.ops-dash-body .sales-compare-sub { font-size: 10px !important; }
.ops-dash-body .sales-compare-tab {
  padding: 2px 8px !important;
  font-size: 11px !important;
}
.ops-dash-body .sales-compare-table,
.sales-compare-table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  font-size: 12px !important;
  border: 1px solid #c8d1d8 !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  background: #fff !important;
}
.ops-dash-body .sales-compare-table th,
.ops-dash-body .sales-compare-table td,
.sales-compare-table th,
.sales-compare-table td {
  padding: 6px 6px !important;
  border-bottom: 1px solid #dfe5ea !important;
  border-right: 1px solid #eef2f5 !important;
  text-align: right !important;
  vertical-align: middle !important;
  background: #fff !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.ops-dash-body .sales-compare-table th:first-child,
.ops-dash-body .sales-compare-table td:first-child,
.sales-compare-table th:first-child,
.sales-compare-table td:first-child {
  text-align: left !important;
  width: 22% !important;
}
.ops-dash-body .sales-compare-table th:last-child,
.ops-dash-body .sales-compare-table td:last-child,
.sales-compare-table th:last-child,
.sales-compare-table td:last-child {
  border-right: 0 !important;
  width: 18% !important;
}
.ops-dash-body .sales-compare-table thead th,
.sales-compare-table thead th {
  background: #f0f4f8 !important;
  font-weight: 700 !important;
}
.ops-dash-body .dash-pnl-body table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  font-size: 12px !important;
}
.ops-dash-body .dash-pnl-body table td {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
/* 仅很窄时才上下堆叠；桌面/笔记本保持左右并排 */
@media (max-width: 640px) {
  .dash-metrics-row,
  .ops-dash-body .dash-metrics-row,
  body.app-shell-locked .ops-dash-body .dash-metrics-row {
    grid-template-columns: 1fr !important;
  }
}

/* 物料列表滑条：最高优先级强制可见 */
html.view-master-locked body.view-master-locked #adminContent .master-table-scroll {
  overflow-x: scroll !important;
  overflow-y: scroll !important;
  scrollbar-width: auto !important;
  scrollbar-color: #6b7280 #dce3ea !important;
}
html.view-master-locked body.view-master-locked #adminContent .master-table-scroll::-webkit-scrollbar {
  width: 14px !important;
  height: 14px !important;
  display: block !important;
  background: #dce3ea !important;
}
html.view-master-locked body.view-master-locked #adminContent .master-table-scroll::-webkit-scrollbar-track {
  background: #dce3ea !important;
}
html.view-master-locked body.view-master-locked #adminContent .master-table-scroll::-webkit-scrollbar-thumb {
  background: #6b7280 !important;
  border-radius: 7px !important;
  border: 2px solid #dce3ea !important;
  min-height: 32px !important;
}
html.view-master-locked body.view-master-locked #adminContent .master-table-scroll::-webkit-scrollbar-corner {
  background: #dce3ea !important;
}

/* 基础资料物料表：表头固定；第1列编号、第2列固定；右侧编辑删除固定 */
body.view-master-locked .master-table-scroll {
  border-collapse: separate;
}
body.view-master-locked .master-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
body.view-master-locked .master-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 4 !important;
  background: var(--surface-soft) !important;
}
body.view-master-locked .master-table .sticky-col-1,
body.view-master-locked .master-table .sticky-col-2 {
  position: sticky !important;
  background: #fff !important;
  z-index: 3 !important;
}
body.view-master-locked .master-table thead th.sticky-col-1,
body.view-master-locked .master-table thead th.sticky-col-2 {
  z-index: 6 !important;
  background: var(--surface-soft) !important;
}
body.view-master-locked .master-table .sticky-col-1 {
  left: 0 !important;
  min-width: 96px !important;
  max-width: 140px !important;
  box-shadow: 2px 0 4px rgba(15, 23, 42, 0.08) !important;
}
body.view-master-locked .master-table .sticky-col-2 {
  left: 96px !important;
  min-width: 120px !important;
  max-width: 180px !important;
  box-shadow: 2px 0 4px rgba(15, 23, 42, 0.06) !important;
}
body.view-master-locked .master-table th.th-actions.sticky-actions,
body.view-master-locked .master-table td.td-actions {
  position: sticky !important;
  right: 0 !important;
  z-index: 3 !important;
  width: 72px !important;
  min-width: 72px !important;
  max-width: 88px !important;
  text-align: center !important;
  background: #fff !important;
  box-shadow: -3px 0 6px rgba(15, 23, 42, 0.08) !important;
}
body.view-master-locked .master-table th.th-actions.sticky-actions {
  z-index: 6 !important;
  background: var(--surface-soft) !important;
  top: 0 !important;
}
body.view-master-locked .master-table tr:hover td.sticky-col-1,
body.view-master-locked .master-table tr:hover td.sticky-col-2,
body.view-master-locked .master-table tr:hover td.td-actions {
  background: var(--accent-soft) !important;
}
.master-table th.th-actions.sticky-actions,
.master-table td.td-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -3px 0 6px rgba(15, 23, 42, 0.06);
}
.master-table th.th-actions.sticky-actions {
  z-index: 4;
  background: var(--surface-soft);
}


/* ===== 库存 / 财务 / 期初盘点：内容框底边对齐退出，框内滚动 ===== */
body.app-shell-locked #adminContent:has(.page-frame-body),
body.app-shell-locked #adminContent:has(.wh-inventory-body) {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding-bottom: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
}
body.app-shell-locked #adminContent:has(.page-frame-body) > .admin-section,
body.app-shell-locked #adminContent:has(.wh-inventory-body) > .admin-section {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
}
body.app-shell-locked #adminContent:has(.page-frame-body) > .admin-section > .admin-section-title,
body.app-shell-locked #adminContent:has(.wh-inventory-body) > .admin-section > .admin-section-title,
body.app-shell-locked .wh-inventory-tabs,
body.app-shell-locked .wh-stock-tabs {
  flex: 0 0 auto !important;
}
body.app-shell-locked .page-frame-body,
body.app-shell-locked .wh-inventory-body {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: 0 !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  box-sizing: border-box !important;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  margin-bottom: 0 !important;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
body.app-shell-locked .page-frame-body::-webkit-scrollbar,
body.app-shell-locked .wh-inventory-body::-webkit-scrollbar {
  width: 10px !important;
  height: 10px !important;
}
body.app-shell-locked .page-frame-body::-webkit-scrollbar-thumb,
body.app-shell-locked .wh-inventory-body::-webkit-scrollbar-thumb {
  background: #9aa7b5 !important;
  border-radius: 6px !important;
}
body.app-shell-locked .page-frame-body::-webkit-scrollbar-track,
body.app-shell-locked .wh-inventory-body::-webkit-scrollbar-track {
  background: #e8eef4 !important;
}
body.app-shell-locked .frame-list-wrap {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  max-height: min(52vh, 560px);
  position: relative;
}
body.app-shell-locked .frame-list-wrap > .master-table-scroll {
  max-height: min(52vh, 560px);
  overflow: auto !important;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
body.app-shell-locked .frame-list-wrap > .master-table-scroll::-webkit-scrollbar {
  width: 10px !important;
  height: 10px !important;
}
body.app-shell-locked .frame-list-wrap > .master-table-scroll::-webkit-scrollbar-thumb {
  background: #9aa7b5 !important;
  border-radius: 6px !important;
}
body.app-shell-locked .wh-inventory-body .frame-list-wrap {
  max-height: none;
}
body.app-shell-locked .wh-inventory-body .frame-list-wrap > .master-table-scroll {
  max-height: none;
}

/* ===== 物料表：左两列 + 右操作固定，仅中间横向滑 ===== */
html.view-master-locked body.view-master-locked .master-table,
body.view-master-locked .master-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
html.view-master-locked body.view-master-locked .master-table td.sticky-col-1,
html.view-master-locked body.view-master-locked .master-table td.sticky-col-2,
html.view-master-locked body.view-master-locked .master-table td.td-actions,
html.view-master-locked body.view-master-locked .master-table th.sticky-col-1,
html.view-master-locked body.view-master-locked .master-table th.sticky-col-2,
html.view-master-locked body.view-master-locked .master-table th.th-actions.sticky-actions,
body.view-master-locked .master-table td.sticky-col-1,
body.view-master-locked .master-table td.sticky-col-2,
body.view-master-locked .master-table td.td-actions,
body.view-master-locked .master-table th.sticky-col-1,
body.view-master-locked .master-table th.sticky-col-2,
body.view-master-locked .master-table th.th-actions.sticky-actions {
  position: sticky !important;
  overflow: visible !important;
  text-overflow: clip !important;
  background-clip: padding-box !important;
}
html.view-master-locked body.view-master-locked .master-table .sticky-col-1,
body.view-master-locked .master-table .sticky-col-1 {
  left: 0 !important;
  width: 108px !important;
  min-width: 108px !important;
  max-width: 108px !important;
  z-index: 4 !important;
  background: #fff !important;
  box-shadow: 2px 0 4px rgba(15, 23, 42, 0.1) !important;
}
html.view-master-locked body.view-master-locked .master-table .sticky-col-2,
body.view-master-locked .master-table .sticky-col-2 {
  left: 108px !important;
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
  z-index: 4 !important;
  background: #fff !important;
  box-shadow: 2px 0 4px rgba(15, 23, 42, 0.08) !important;
}
html.view-master-locked body.view-master-locked .master-table th.th-actions.sticky-actions,
html.view-master-locked body.view-master-locked .master-table td.td-actions,
body.view-master-locked .master-table th.th-actions.sticky-actions,
body.view-master-locked .master-table td.td-actions {
  right: 0 !important;
  left: auto !important;
  width: 76px !important;
  min-width: 76px !important;
  max-width: 76px !important;
  z-index: 4 !important;
  background: #fff !important;
  box-shadow: -3px 0 6px rgba(15, 23, 42, 0.1) !important;
  text-align: center !important;
}
html.view-master-locked body.view-master-locked .master-table thead th.sticky-col-1,
html.view-master-locked body.view-master-locked .master-table thead th.sticky-col-2,
html.view-master-locked body.view-master-locked .master-table thead th.th-actions.sticky-actions,
body.view-master-locked .master-table thead th.sticky-col-1,
body.view-master-locked .master-table thead th.sticky-col-2,
body.view-master-locked .master-table thead th.th-actions.sticky-actions {
  top: 0 !important;
  z-index: 8 !important;
  background: var(--surface-soft) !important;
}
html.view-master-locked body.view-master-locked .master-table tr:hover td.sticky-col-1,
html.view-master-locked body.view-master-locked .master-table tr:hover td.sticky-col-2,
html.view-master-locked body.view-master-locked .master-table tr:hover td.td-actions,
body.view-master-locked .master-table tr:hover td.sticky-col-1,
body.view-master-locked .master-table tr:hover td.sticky-col-2,
body.view-master-locked .master-table tr:hover td.td-actions {
  background: var(--accent-soft, #eef6ff) !important;
}


/* ===== 库存/财务/期初盘点：JS 量高后的壳层（防整页滚） ===== */
html.view-frame-locked,
body.view-frame-locked {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}
body.view-frame-locked main,
body.view-frame-locked #admin.view.active {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}
body.view-frame-locked #adminContent {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding-bottom: 0 !important;
}
body.view-frame-locked #adminContent > .admin-section {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  margin-bottom: 0 !important;
}
body.view-frame-locked #adminContent > .admin-section > .admin-section-title,
body.view-frame-locked .wh-inventory-tabs,
body.view-frame-locked .wh-stock-tabs {
  flex: 0 0 auto !important;
}
body.view-frame-locked .page-frame-body,
body.view-frame-locked .wh-inventory-body {
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
  overflow: auto !important;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
/* 待入库/待出库：外框滚动 + 强制可见滑条（已入库/已出库同一套） */
html body.view-frame-locked.view-wh-io .page-frame-body,
body.view-frame-locked.view-wh-io .page-frame-body,
body.app-shell-locked.view-wh-io .page-frame-body {
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  scrollbar-gutter: stable !important;
  scrollbar-width: auto !important;
  scrollbar-color: #4b5563 #dbe3ea !important;
}
html body.view-frame-locked.view-wh-io .page-frame-body::-webkit-scrollbar,
body.view-frame-locked.view-wh-io .page-frame-body::-webkit-scrollbar,
body.app-shell-locked.view-wh-io .page-frame-body::-webkit-scrollbar {
  width: 12px !important;
  height: 12px !important;
  display: block !important;
  background: #dbe3ea !important;
}
html body.view-frame-locked.view-wh-io .page-frame-body::-webkit-scrollbar-thumb,
body.view-frame-locked.view-wh-io .page-frame-body::-webkit-scrollbar-thumb {
  background: #4b5563 !important;
  border-radius: 6px !important;
  border: 2px solid #dbe3ea !important;
  min-height: 40px;
}
html body.view-frame-locked.view-wh-io .page-frame-body::-webkit-scrollbar-track,
body.view-frame-locked.view-wh-io .page-frame-body::-webkit-scrollbar-track {
  background: #dbe3ea !important;
}
/* 列表本身不截断、不套第二层滚动，避免滑条被外层裁掉 */
body.view-wh-io .page-frame-body .results-scroll,
body.view-wh-io .page-frame-body .results-inner,
body.view-wh-io .page-frame-body .wh-io-done-list {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  flex: none !important;
  min-height: 0 !important;
}
body.view-frame-locked .page-frame-body::-webkit-scrollbar,
body.view-frame-locked .wh-inventory-body::-webkit-scrollbar,
body.view-frame-locked .master-table-scroll::-webkit-scrollbar {
  width: 10px !important;
  height: 10px !important;
}
body.view-frame-locked .page-frame-body::-webkit-scrollbar-thumb,
body.view-frame-locked .wh-inventory-body::-webkit-scrollbar-thumb,
body.view-frame-locked .master-table-scroll::-webkit-scrollbar-thumb {
  background: #9aa7b5 !important;
  border-radius: 6px !important;
}


/* 物料列表：取消左侧第1/2列固定，仅保留右侧编辑删除固定 */
html.view-master-locked body.view-master-locked .master-table .sticky-col-1,
html.view-master-locked body.view-master-locked .master-table .sticky-col-2,
body.view-master-locked .master-table .sticky-col-1,
body.view-master-locked .master-table .sticky-col-2,
body.view-master-locked .master-table th.sticky-col-1,
body.view-master-locked .master-table th.sticky-col-2,
body.view-master-locked .master-table td.sticky-col-1,
body.view-master-locked .master-table td.sticky-col-2,
.master-table .sticky-col-1,
.master-table .sticky-col-2 {
  position: static !important;
  left: auto !important;
  right: auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  z-index: auto !important;
  box-shadow: none !important;
  overflow: hidden !important;
}


/* 库存：外框不滚，仅列表滑条 */
body.view-frame-locked .wh-inventory-body {
  overflow: hidden !important;
}
body.view-frame-locked .wh-inventory-body .frame-list-wrap {
  max-height: none !important;
}
body.view-frame-locked .wh-inventory-body .frame-list-wrap > .master-table-scroll {
  max-height: none !important;
  overflow: scroll !important;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
body.view-frame-locked .wh-inventory-body .frame-list-wrap > .master-table-scroll::-webkit-scrollbar {
  width: 10px !important;
  height: 10px !important;
}
body.view-frame-locked .wh-inventory-body .frame-list-wrap > .master-table-scroll::-webkit-scrollbar-thumb {
  background: #9aa7b5 !important;
  border-radius: 6px !important;
}


/* 财务应收应付明细弹窗 + 对账明细滑条 */
.fin-arap-detail-scroll {
  max-height: min(60vh, 520px);
  overflow: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
.fin-arap-detail-scroll::-webkit-scrollbar,
.fin-arap-list-scroll::-webkit-scrollbar,
body.view-frame-locked .reconcile-list-finance > .reconcile-list-scroll::-webkit-scrollbar {
  width: 10px !important;
  height: 10px !important;
}
.fin-arap-detail-scroll::-webkit-scrollbar-thumb,
.fin-arap-list-scroll::-webkit-scrollbar-thumb,
body.view-frame-locked .reconcile-list-finance > .reconcile-list-scroll::-webkit-scrollbar-thumb {
  background: #9aa7b5 !important;
  border-radius: 6px !important;
}
.fin-arap-list-scroll {
  max-height: min(36vh, 360px);
  overflow: auto;
}
body.view-frame-locked .reconcile-list-finance > .reconcile-list-scroll {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

/* 物料列表：编号 / 客户编号排列 */
.master-sort-group .master-sort-btn.primary {
  background: var(--accent-soft, #e8f1ff);
  border-color: var(--accent, #3b82f6);
  color: var(--ink, #111);
  font-weight: 600;
}
.master-sort-th:hover {
  color: var(--accent, #2563eb);
}


/* 销售看板：对比单列（已去掉销售侧损益） */
.dash-metrics-row-single {
  grid-template-columns: 1fr !important;
}



/* 综合看板·财务看板：强制上6下3两排；损益表用表格格式 */
.ops-dash-body .fin-dash-root,
.page-frame-body .fin-dash-root,
.fin-dash-root {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px;
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
}
.ops-dash-body .fin-dash-cards,
.page-frame-body .fin-dash-cards,
.fin-dash-cards {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  flex: 0 0 auto !important;
  min-width: 0 !important;
}
.ops-dash-body .fin-dash-row,
.page-frame-body .fin-dash-row,
.fin-dash-row {
  display: grid !important;
  gap: 4px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}
.ops-dash-body .fin-dash-row6,
.page-frame-body .fin-dash-row6,
.fin-dash-row6 {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}
.ops-dash-body .fin-dash-row3,
.page-frame-body .fin-dash-row3,
.fin-dash-row3 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.ops-dash-body .fin-dash-cards .mini-card,
.ops-dash-body .fin-dash-row .mini-card,
.page-frame-body .fin-dash-cards .mini-card,
.page-frame-body .fin-dash-row .mini-card,
.fin-dash-cards .mini-card,
.fin-dash-row .mini-card,
.admin-stat-grid.fin-dash-row .mini-card {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 8px 6px !important;
  border: 1px solid #c8d2dc !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
  min-width: 0 !important;
  min-height: 52px !important;
  height: 56px !important;
  max-height: 56px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-align: center !important;
}
.ops-dash-body .fin-dash-cards .mini-card span,
.ops-dash-body .fin-dash-row .mini-card span,
.page-frame-body .fin-dash-cards .mini-card span,
.fin-dash-cards .mini-card span,
.fin-dash-row .mini-card span {
  display: block !important;
  width: 100% !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: #64748b !important;
}
.ops-dash-body .fin-dash-cards .mini-card b,
.ops-dash-body .fin-dash-row .mini-card b,
.page-frame-body .fin-dash-cards .mini-card b,
.fin-dash-cards .mini-card b,
.fin-dash-row .mini-card b {
  display: block !important;
  width: 100% !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  margin: 3px 0 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: #0f172a !important;
}
.ops-dash-body .fin-dash-hint,
.page-frame-body .fin-dash-hint {
  flex: 0 0 auto;
  margin: 0 0 4px !important;
  padding: 4px 8px !important;
  font-size: 12px;
}
.ops-dash-body .fin-dash-hint > summary,
.page-frame-body .fin-dash-hint > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.ops-dash-body .fin-dash-hint > summary::-webkit-details-marker,
.page-frame-body .fin-dash-hint > summary::-webkit-details-marker { display: none; }
.ops-dash-body .fin-dash-main,
.page-frame-body .fin-dash-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) !important;
  gap: 8px !important;
  min-height: 0;
  flex: 1 1 auto;
  align-items: stretch;
}
.ops-dash-body .fin-dash-main > .admin-section,
.page-frame-body .fin-dash-main > .admin-section {
  margin: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border: 1px solid var(--line) !important;
  border-radius: 6px !important;
  background: #fff !important;
}
.ops-dash-body .fin-dash-main .admin-section-title,
.page-frame-body .fin-dash-main .admin-section-title {
  flex: 0 0 auto;
  padding: 6px 8px 2px;
}
.ops-dash-body .fin-dash-main .admin-section-title h3,
.page-frame-body .fin-dash-main .admin-section-title h3 {
  margin: 0;
  font-size: 13px;
}
.ops-dash-body .fin-dash-pnl-body,
.ops-dash-body .fin-dash-log-scroll,
.page-frame-body .fin-dash-pnl-body,
.page-frame-body .fin-dash-log-scroll {
  flex: 1 1 auto;
  min-height: 160px;
  overflow: auto;
  padding: 4px 8px 8px;
}
.ops-dash-body .fin-dash-pnl,
.page-frame-body .fin-dash-pnl {
  min-height: 220px;
}
.ops-dash-body .fin-pnl-table,
.page-frame-body .fin-pnl-table,
.fin-pnl-table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 13px !important;
  display: table !important;
  table-layout: fixed !important;
}
.ops-dash-body .fin-pnl-table tr,
.page-frame-body .fin-pnl-table tr,
.fin-pnl-table tr { display: table-row !important; }
.ops-dash-body .fin-pnl-table td,
.page-frame-body .fin-pnl-table td,
.fin-pnl-table td {
  display: table-cell !important;
  padding: 6px 10px !important;
  border-bottom: 1px solid #ddd !important;
  vertical-align: middle !important;
}
.ops-dash-body .fin-dash-log-scroll .list-row,
.page-frame-body .fin-dash-log-scroll .list-row { padding: 6px 4px; }
body.view-ops-dash-locked .ops-dash-body {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}
@media (max-width: 720px) {
  .ops-dash-body .fin-dash-main,
  .page-frame-body .fin-dash-main {
    grid-template-columns: 1fr !important;
  }
}

.dash-pnl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-pnl-row td, .dash-pnl-cell { padding: 8px 10px; border-bottom: 1px solid #ddd; vertical-align: middle; }
.dash-pnl-val { text-align: right; white-space: nowrap; }
.dash-pnl-note { font-size: 10px; color: #999; margin-top: 4px; line-height: 1.35; }
.fin-arap-draft-wrap .reconcile-col-amt,
.fin-arap-draft-wrap .reconcile-col-tax,
.fin-arap-draft-wrap .reconcile-col-invoice { white-space: nowrap; }


.reconcile-stat-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}
.reconcile-stat-grid .mini-card {
  padding: 6px 8px;
  gap: 2px;
  min-width: 0;
}
.reconcile-stat-grid .mini-card span {
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reconcile-stat-grid .mini-card b {
  font-size: 15px;
  line-height: 1.2;
}
.reconcile-upload-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.reconcile-upload-bar .reconcile-upload-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.reconcile-upload-bar .reconcile-upload-hint {
  font-size: 11px;
  color: var(--muted);
}



/* 待对账列表本身不要用 reconcile-split 的两列布局 */
.reconcile-purchase-left .reconcile-list-wrap {
  display: block;
  width: 100%;
}
.reconcile-purchase-left .reconcile-list-wrap.reconcile-split {
  display: block;
  grid-template-columns: none;
}

.reconcile-purchase-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
  min-width: 0;
}
.reconcile-purchase-left,
.reconcile-purchase-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reconcile-purchase-left .admin-section-title,
.reconcile-purchase-left .reconcile-pending-title {
  margin: 0;
}
.reconcile-purchase-left .admin-section-title h3,
.reconcile-purchase-left .reconcile-pending-title h3 {
  font-size: 14px;
  margin: 0 0 2px;
}
.reconcile-purchase-left .admin-section-title p,
.reconcile-purchase-left .reconcile-pending-title p {
  font-size: 11px;
  line-height: 1.35;
  margin: 0;
  color: var(--muted);
}
.reconcile-purchase-left .reconcile-toolbar {
  margin: 0;
  gap: 6px;
}
.reconcile-purchase-left .reconcile-contact {
  max-width: 100%;
  flex: 1 1 140px;
  min-width: 0;
  font-size: 12px;
}
.reconcile-purchase-left .reconcile-cutoff-label {
  font-size: 12px;
  white-space: nowrap;
}

.reconcile-stmt-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  opacity: 0 !important;
}
.reconcile-purchase-right .reconcile-upload-bar {
  position: relative;
}
.reconcile-stmt-pick {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.reconcile-stmt-fname {
  font-size: 11px;
  color: var(--muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reconcile-purchase-right .reconcile-upload-bar input[type="file"] {
  /* 被 .reconcile-stmt-file-input 隐藏，不再占位 */
  display: none !important;
}

.reconcile-purchase-right .reconcile-upload-bar {
  margin: 0;
  padding: 6px 8px;
  gap: 6px 8px;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}
.reconcile-purchase-right .reconcile-upload-title {
  font-size: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.reconcile-purchase-right .reconcile-upload-bar input[type="file"] {
  width: auto !important;
  max-width: 200px !important;
  flex: 0 1 auto !important;
  min-width: 0;
  font-size: 11px;
  /* 避免系统文件框被拉成大白块 */
  height: 28px;
  padding: 0;
}
.reconcile-purchase-right .reconcile-upload-hint {
  font-size: 11px;
  line-height: 1.3;
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
}
.reconcile-purchase-right .reconcile-stmt-empty {
  padding: 10px 8px;
  margin: 0;
}
.reconcile-purchase-right .reconcile-stmt-panel {
  gap: 6px;
  padding: 8px;
}
.reconcile-purchase-right .reconcile-stmt-panel {
  max-height: min(58vh, 620px);
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.reconcile-purchase-left .reconcile-list-scroll {
  max-height: min(58vh, 620px) !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.reconcile-purchase-left .reconcile-list-wrap.reconcile-list-finance {
  overflow: visible !important; /* 滚动交给内部 scroll，勿锁死 */
}
@media (max-width: 720px) {
  .reconcile-purchase-layout { grid-template-columns: 1fr; }
}

.reconcile-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}
.reconcile-split-pending,
.reconcile-split-stmt {
  min-width: 0;
}
.reconcile-split .reconcile-list-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.reconcile-split .reconcile-list-scroll {
  max-height: min(56vh, 560px);
  overflow: auto;
}
/* 半宽时隐藏次要列，避免挤爆 */
.reconcile-split.reconcile-list-purchase.reconcile-list-finance .reconcile-list-head,
.reconcile-split.reconcile-list-purchase.reconcile-list-finance .reconcile-list-row,
.reconcile-purchase-left .reconcile-list-purchase.reconcile-list-finance .reconcile-list-head,
.reconcile-purchase-left .reconcile-list-purchase.reconcile-list-finance .reconcile-list-row {
  grid-template-columns: 22px 40px minmax(0, 1.2fr) minmax(0, 1fr) 36px 108px;
  gap: 4px 5px;
  font-size: 12px;
  padding: 5px 6px;
}
.reconcile-purchase-left .reconcile-col-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.reconcile-purchase-left .reconcile-col-amt {
  white-space: nowrap;
  overflow: visible;
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 70px;
  color: var(--muted);
  font-weight: 500;
}
.reconcile-split .reconcile-col-party,
.reconcile-split .reconcile-col-unitprice,
.reconcile-split .reconcile-col-tax,
.reconcile-purchase-left .reconcile-col-party,
.reconcile-purchase-left .reconcile-col-unitprice,
.reconcile-purchase-left .reconcile-col-tax {
  display: none !important;
}
.reconcile-purchase-left .reconcile-col-invoice {
  display: block !important;
  white-space: nowrap;
  overflow: visible;
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 80px;
  font-weight: 600;
}
.reconcile-stmt-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(56vh, 560px);
  overflow: auto;
}
.reconcile-stmt-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.reconcile-stmt-panel-title small {
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}
.reconcile-stmt-summary {
  font-size: 12px;
  color: var(--muted);
}
.reconcile-stmt-summary b { color: var(--ink); }
.reconcile-stmt-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 18px 8px;
  text-align: center;
  background: #f8fafc;
  border-radius: 6px;
}
.reconcile-stmt-preview {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
  background: #f1f5f9;
  max-height: 160px;
}
.reconcile-stmt-preview img {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  background: #fff;
}
.reconcile-stmt-pdf {
  font-size: 12px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  color: var(--muted);
}
.reconcile-stmt-lines-head,
.reconcile-stmt-line {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 44px minmax(88px, max-content);
  gap: 4px 6px;
  align-items: center;
  font-size: 12px;
}

.reconcile-stmt-lines-head,
.reconcile-stmt-line {
  grid-template-columns: 24px minmax(0, 1.1fr) 40px minmax(72px, max-content) minmax(72px, max-content) !important;
}
.reconcile-stmt-amt-inc {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 11px;
}
.reconcile-stmt-tax-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 3px;
  background: #ffedd5;
  color: #c2410c;
  font-size: 10px;
  font-weight: 600;
}

.reconcile-stmt-amt {
  white-space: nowrap;
  overflow: visible;
  text-align: right;
  font-variant-numeric: tabular-nums;
  justify-self: end;
}
.reconcile-stmt-lines-head {
  color: var(--muted);
  font-weight: 600;
  padding: 0 2px 4px;
  border-bottom: 1px solid var(--line);
}
.reconcile-stmt-line {
  padding: 5px 2px;
  border-bottom: 1px solid #f1f5f9;
}
.reconcile-stmt-i { color: var(--muted); }
.reconcile-stmt-model {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reconcile-stmt-qty,
.reconcile-stmt-amt { text-align: right; font-variant-numeric: tabular-nums; }
.reconcile-stmt-ono {
  grid-column: 2 / -1;
  font-size: 11px;
  color: var(--muted);
}
.reconcile-stmt-raw {
  font-size: 11px;
  color: var(--muted);
}
.reconcile-stmt-raw pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow: auto;
  background: #f8fafc;
  padding: 8px;
  border-radius: 6px;
  margin: 6px 0 0;
}
@media (max-width: 960px) {
  .reconcile-split { grid-template-columns: 1fr; }
  .reconcile-split.reconcile-list-purchase.reconcile-list-finance .reconcile-list-head,
  .reconcile-split.reconcile-list-purchase.reconcile-list-finance .reconcile-list-row,
  .reconcile-purchase-left .reconcile-list-purchase.reconcile-list-finance .reconcile-list-head,
  .reconcile-purchase-left .reconcile-list-purchase.reconcile-list-finance .reconcile-list-row {
    grid-template-columns: 22px 40px minmax(0, 1.2fr) minmax(0, 1fr) 36px 108px;
  }
}

@media (max-width: 900px) {
  .reconcile-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .reconcile-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* ===== V2 sync: 采购对账左右分栏（对齐 V1，提高优先级） ===== */
.page-frame-body .reconcile-purchase-layout,
.admin-section .reconcile-purchase-layout,
.reconcile-pending-sec .reconcile-purchase-layout,
.reconcile-purchase-layout {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  align-items: start !important;
  min-width: 0 !important;
  width: 100% !important;
}
.reconcile-purchase-left,
.reconcile-purchase-right {
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
.reconcile-purchase-left .reconcile-list-wrap {
  display: block !important;
  width: 100% !important;
}
.reconcile-purchase-left .reconcile-list-purchase.reconcile-list-finance .reconcile-list-head,
.reconcile-purchase-left .reconcile-list-purchase.reconcile-list-finance .reconcile-list-row {
  grid-template-columns: 22px 40px minmax(0, 1.2fr) minmax(0, 1fr) 36px 108px !important;
  gap: 4px 5px !important;
  font-size: 12px !important;
  padding: 5px 6px !important;
}
.reconcile-purchase-left .reconcile-col-party,
.reconcile-purchase-left .reconcile-col-unitprice,
.reconcile-purchase-left .reconcile-col-tax {
  display: none !important;
}
.reconcile-purchase-left .reconcile-col-invoice {
  display: block !important;
  white-space: nowrap !important;
  text-align: right !important;
  font-weight: 600 !important;
  min-width: 80px !important;
}
.reconcile-purchase-left .reconcile-col-amt {
  white-space: nowrap !important;
  text-align: right !important;
  color: var(--muted) !important;
}
.reconcile-purchase-left .reconcile-col-detail {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  min-width: 0 !important;
}
.reconcile-stmt-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
}
.reconcile-purchase-right .reconcile-upload-bar input[type="file"] {
  display: none !important;
}
.reconcile-stmt-lines-head,
.reconcile-stmt-line {
  grid-template-columns: 24px minmax(0, 1.1fr) 40px minmax(72px, max-content) minmax(72px, max-content) !important;
}
@media (max-width: 720px) {
  .page-frame-body .reconcile-purchase-layout,
  .reconcile-purchase-layout {
    grid-template-columns: 1fr !important;
  }
}

/* ===== V2 fix: 对账页外框可滚（防锁死） ===== */
body.view-frame-locked .page-frame-body {
  overflow-x: hidden !important;
  overflow-y: scroll !important;
}
body.view-frame-locked .reconcile-pending-sec,
body.view-frame-locked .reconcile-draft-sec {
  overflow: visible !important;
  max-height: none !important;
}
body.view-frame-locked .reconcile-list-finance > .reconcile-list-scroll,
body.view-frame-locked .reconcile-purchase-left .reconcile-list-scroll,
.reconcile-purchase-left .reconcile-list-scroll {
  max-height: min(56vh, 560px) !important;
  overflow: auto !important;
}
body.view-frame-locked .reconcile-list-sales > .reconcile-list-scroll {
  max-height: min(56vh, 560px) !important;
  overflow: auto !important;
}
body.view-frame-locked .reconcile-draft-wrap > .reconcile-list-scroll {
  max-height: min(28vh, 220px) !important;
  overflow: auto !important;
}
body:not(.is-locked) .reconcile-list-body {
  max-height: none !important;
}
body.view-frame-locked .ops-finance-tabs,
body.view-frame-locked .ops-reconcile-tabs {
  flex: 0 0 auto !important;
}
body.view-frame-locked .ops-finance-body,
body.view-frame-locked .ops-reconcile-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* ===== V2 fix: 对账草稿侧栏排版 ===== */
.reconcile-work-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.85fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  width: 100%;
}
.reconcile-work-main,
.reconcile-work-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reconcile-work-side {
  position: sticky;
  top: 8px;
  align-self: start;
}
.reconcile-work-side .reconcile-draft-title h3,
.reconcile-draft-side-wrap .reconcile-draft-title h3 {
  margin: 0 0 2px;
  font-size: 14px;
}
.reconcile-work-side .reconcile-draft-title p,
.reconcile-draft-side-wrap .reconcile-draft-title p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.reconcile-draft-side .reconcile-list-scroll-draft,
.reconcile-work-side .reconcile-list-scroll-draft,
.reconcile-draft-side-wrap .reconcile-list-scroll-draft {
  max-height: min(52vh, 480px) !important;
  overflow: auto !important;
}
/* 侧栏草稿：隐藏次要列，保留标题/笔数/合计/状态/操作 */
.reconcile-draft-side .reconcile-draft-head,
.reconcile-draft-side .reconcile-draft-row {
  grid-template-columns: minmax(0, 1.4fr) 44px minmax(72px, 0.9fr) 52px minmax(110px, 1.1fr) !important;
  gap: 4px 6px !important;
  padding: 6px 8px !important;
  font-size: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
}
.reconcile-draft-side .reconcile-col-type,
.reconcile-draft-side .reconcile-col-party,
.reconcile-draft-side .reconcile-col-date {
  display: none !important;
}
.reconcile-draft-side .reconcile-col-title b {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.reconcile-draft-side .reconcile-amt-sub {
  display: block;
  margin-left: 0;
  margin-top: 1px;
}
.reconcile-draft-side .reconcile-draft-actions {
  flex-wrap: wrap;
  gap: 3px;
  justify-content: flex-end;
}
.reconcile-draft-side-wrap {
  margin-top: 2px;
}
.reconcile-purchase-right .reconcile-draft-side-wrap {
  order: 0;
}
.reconcile-purchase-left .reconcile-actions,
.reconcile-work-main .reconcile-actions {
  margin: 4px 0 0;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 1100px) {
  .reconcile-work-layout {
    grid-template-columns: 1fr;
  }
  .reconcile-work-side {
    position: static;
  }
}

/* ===== V2 fix: 采购对账三窗口 ===== */
.reconcile-purchase-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.reconcile-purchase-subtabs {
  margin: 0 0 2px !important;
  flex: 0 0 auto !important;
}
.reconcile-purchase-subtabs .master-tab {
  font-size: 13px;
  padding: 5px 12px;
}
.reconcile-purchase-tab-body {
  min-width: 0;
}
.reconcile-purchase-panel {
  margin: 0;
}
.reconcile-purchase-panel-scroll {
  max-height: min(62vh, 620px) !important;
  overflow: auto !important;
}

/* ===== V2 fix: 对账统计7卡一行 ===== */
.reconcile-stat-grid,
.reconcile-stat-grid.reconcile-stat-grid-7,
.admin-stat-grid.reconcile-stat-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 4px !important;
  margin: 0 0 6px !important;
  width: 100% !important;
}
.reconcile-stat-grid .mini-card {
  min-width: 0 !important;
  height: 40px !important;
  max-height: 40px !important;
  padding: 3px 4px !important;
}
.reconcile-stat-grid .mini-card span {
  font-size: 10px !important;
}
.reconcile-stat-grid .mini-card b {
  font-size: 13px !important;
}
@media (max-width: 900px) {
  .reconcile-stat-grid,
  .reconcile-stat-grid.reconcile-stat-grid-7 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 560px) {
  .reconcile-stat-grid,
  .reconcile-stat-grid.reconcile-stat-grid-7 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
.reconcile-sales-pending {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.reconcile-sales-pending .reconcile-list-scroll {
  max-height: min(56vh, 560px);
  overflow: auto;
}

/* ===== reconcile: 闭环一行 + 去掉顶卡 ===== */
.reconcile-flow-hint-oneline {
  display: block;
  margin: 0 0 8px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface-soft, #f8fafc);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.reconcile-flow-hint-oneline b {
  color: var(--ink);
  font-weight: 700;
}

/* ===== 销售对账：客户+截止日同一行 ===== */
.reconcile-sales-pending .toolbar.reconcile-toolbar,
.reconcile-sales-pending .reconcile-toolbar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 6px !important;
  min-width: 0 !important;
  width: 100% !important;
}
.reconcile-sales-pending .reconcile-contact {
  flex: 1 1 auto !important;
  min-width: 140px !important;
  max-width: none !important;
  width: auto !important;
}
.reconcile-sales-pending .reconcile-cutoff-label {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin: 0 !important;
  white-space: nowrap !important;
  font-size: 12px !important;
}
.reconcile-sales-pending .reconcile-toolbar input.reconcile-date,
.reconcile-sales-pending .reconcile-toolbar input[type="date"] {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: 160px !important;
  padding: 4px 6px !important;
  font-size: 12px !important;
}
.reconcile-sales-pending .reconcile-toolbar .btn-sm {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  white-space: nowrap !important;
}

/* ===== 待对账明细标题与说明同一行 ===== */
.reconcile-pending-title.admin-section-title,
.admin-section-title.reconcile-pending-title {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: baseline !important;
  gap: 10px !important;
  margin: 0 0 6px !important;
  min-width: 0 !important;
}
.reconcile-pending-title h3 {
  flex: 0 0 auto !important;
  margin: 0 !important;
  font-size: 14px !important;
  white-space: nowrap !important;
}
.reconcile-pending-title p {
  flex: 1 1 auto !important;
  margin: 0 !important;
  font-size: 11px !important;
  color: var(--muted) !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
}

/* ===== 采购对账：强制左明细右识别（V1/V2） ===== */
.reconcile-purchase-shell .reconcile-purchase-layout,
.reconcile-purchase-tab-body .reconcile-purchase-layout,
.page-frame-body .reconcile-purchase-layout,
.ops-finance-body .reconcile-purchase-layout,
.reconcile-pending-sec .reconcile-purchase-layout,
.reconcile-purchase-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr) !important;
  gap: 10px !important;
  align-items: start !important;
  width: 100% !important;
  min-width: 0 !important;
}
.reconcile-purchase-left,
.reconcile-purchase-right {
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
.reconcile-purchase-right {
  position: sticky;
  top: 8px;
  align-self: start;
}
.reconcile-upload-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}
.reconcile-upload-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.reconcile-purchase-right .reconcile-upload-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px 8px !important;
  margin: 0 !important;
  padding: 0 !important;
}
.reconcile-stmt-pick {
  display: inline-flex !important;
  align-items: center !important;
  cursor: pointer !important;
}
.reconcile-purchase-right .reconcile-stmt-empty {
  display: block !important;
  padding: 16px 10px !important;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px dashed var(--line);
}
@media (max-width: 720px) {
  .reconcile-purchase-shell .reconcile-purchase-layout,
  .reconcile-purchase-layout {
    grid-template-columns: 1fr !important;
  }
  .reconcile-purchase-right { position: static; }
}

/* ===== 对账草稿：5个操作键同一行 ===== */
.reconcile-draft-head,
.reconcile-draft-row {
  grid-template-columns: 72px minmax(120px, 1.2fr) minmax(64px, 0.7fr) 48px minmax(88px, 0.9fr) 56px 72px minmax(210px, max-content) !important;
}
.reconcile-draft-side .reconcile-draft-head,
.reconcile-draft-side .reconcile-draft-row {
  grid-template-columns: minmax(0, 1.2fr) 40px minmax(64px, 0.8fr) 48px minmax(200px, max-content) !important;
}
.reconcile-col-actions,
.reconcile-draft-actions {
  overflow: visible !important;
}
.reconcile-draft-actions {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 4px !important;
  white-space: nowrap !important;
}
.reconcile-draft-actions .order-act-btn,
.reconcile-draft-actions .reconcile-open-btn,
.reconcile-draft-actions .reconcile-confirm-btn,
.reconcile-draft-actions .reconcile-del-btn {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  padding: 2px 6px !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  min-width: 0 !important;
}
.reconcile-draft-side .reconcile-draft-actions {
  flex-wrap: nowrap !important;
}

/* ===== V2 nuke: 采购左右分栏 + 草稿五键一行（最高优先级） ===== */
html body #adminContent .reconcile-purchase-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr) !important;
  gap: 10px !important;
  width: 100% !important;
}
html body #adminContent .reconcile-purchase-right {
  display: flex !important;
  flex-direction: column !important;
  min-width: 280px !important;
}
html body #adminContent .reconcile-draft-actions {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  gap: 4px !important;
}
html body #adminContent .reconcile-col-actions {
  overflow: visible !important;
  min-width: 220px !important;
  max-width: none !important;
  white-space: nowrap !important;
}
html body #adminContent .reconcile-draft-head,
html body #adminContent .reconcile-draft-row {
  grid-template-columns: 72px minmax(100px, 1.1fr) minmax(56px, 0.6fr) 44px minmax(80px, 0.8fr) 52px 68px minmax(220px, max-content) !important;
  width: 100% !important;
  min-width: 100% !important;
}
html body #adminContent .reconcile-draft-head > span.reconcile-col-actions,
html body #adminContent .reconcile-draft-row > span.reconcile-col-actions {
  overflow: visible !important;
  white-space: nowrap !important;
  text-overflow: clip !important;
  min-width: 220px !important;
}

/* ===== V2 fix: 采购待对账金额可见（压缩物料说明） ===== */
.reconcile-purchase-left .reconcile-col-party,
.reconcile-purchase-left .reconcile-col-unitprice,
.reconcile-purchase-left .reconcile-col-tax,
.reconcile-purchase-left .reconcile-col-bizdate,
.reconcile-purchase-left .reconcile-col-invoice {
  display: none !important;
}
.reconcile-purchase-left .reconcile-list-purchase.reconcile-list-finance .reconcile-list-head,
.reconcile-purchase-left .reconcile-list-purchase.reconcile-list-finance .reconcile-list-row,
.reconcile-purchase-left .reconcile-head-purchase-compact,
.reconcile-purchase-left .reconcile-row-purchase-compact {
  display: grid !important;
  grid-template-columns: 22px 40px minmax(0, 1.2fr) minmax(0, 1fr) 36px 108px !important;
  gap: 4px 6px !important;
  align-items: center !important;
  padding: 6px !important;
  font-size: 12px !important;
}
.reconcile-purchase-left .reconcile-col-detail {
  max-width: 96px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  min-width: 0 !important;
}
.reconcile-purchase-left .reconcile-col-amt,
.reconcile-purchase-left .reconcile-col-money {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-width: 0 !important;
  max-width: 108px !important;
  overflow: hidden !important;
  justify-content: flex-end !important;
  color: var(--ink) !important;
  font-weight: 700 !important;
}
.reconcile-purchase-left .reconcile-list-finance,
.reconcile-purchase-left .reconcile-list-scroll {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
.reconcile-purchase-left .reconcile-head-purchase-compact,
.reconcile-purchase-left .reconcile-row-purchase-compact,
.reconcile-purchase-left .reconcile-list-purchase.reconcile-list-finance .reconcile-list-head,
.reconcile-purchase-left .reconcile-list-purchase.reconcile-list-finance .reconcile-list-row {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ===== 采购对账单对照结果 ===== */
.reconcile-stmt-compare {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  margin: 0 0 8px;
}
.reconcile-stmt-compare-title {
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 6px;
}
.reconcile-stmt-compare-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
  align-items: stretch;
}
.reconcile-stmt-compare-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  min-width: 0;
}
.reconcile-stmt-compare-item span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.reconcile-stmt-compare-item b {
  display: block;
  font-size: 12px;
  margin-top: 2px;
  word-break: break-all;
}
.reconcile-stmt-compare-item small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.reconcile-stmt-compare-item.ok {
  border-color: #86efac;
  background: #f0fdf4;
}
.reconcile-stmt-compare-item.bad {
  border-color: #fca5a5;
  background: #fef2f2;
}
.reconcile-stmt-lines-head,
.reconcile-stmt-line {
  grid-template-columns: 24px minmax(72px, 1.2fr) 44px minmax(56px, 0.8fr) minmax(56px, 0.8fr) minmax(64px, 0.9fr) minmax(110px, 1.4fr) !important;
}
.reconcile-stmt-flags {
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reconcile-stmt-line.is-matched {
  background: #f0fdf4;
}
.reconcile-stmt-line.is-bad {
  background: #fff7ed;
}

/* ===== 应收应付：待收/待付对账单强制单行 ===== */
html body #adminContent .fin-arap-draft-wrap .fin-arap-draft-head,
html body #adminContent .fin-arap-draft-wrap .fin-arap-draft-row,
.fin-arap-draft-wrap .fin-arap-draft-head,
.fin-arap-draft-wrap .fin-arap-draft-row {
  display: grid !important;
  grid-template-columns: 28px 52px minmax(110px, 1.4fr) minmax(72px, 1fr) 44px minmax(72px, 0.85fr) minmax(64px, 0.75fr) minmax(80px, 0.95fr) 64px 76px minmax(88px, max-content) !important;
  gap: 4px 6px !important;
  align-items: center !important;
  width: 100% !important;
  min-width: 920px !important;
  white-space: nowrap !important;
  overflow: visible !important;
}
html body #adminContent .fin-arap-draft-wrap .fin-arap-draft-head > span,
html body #adminContent .fin-arap-draft-wrap .fin-arap-draft-row > span,
.fin-arap-draft-wrap .fin-arap-draft-head > span,
.fin-arap-draft-wrap .fin-arap-draft-row > span {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
}
.fin-arap-draft-wrap {
  overflow-x: auto !important;
}
.fin-arap-draft-wrap .reconcile-col-actions {
  overflow: visible !important;
  white-space: nowrap !important;
  text-overflow: clip !important;
}

@media (max-width: 900px) {
  html body #adminContent .fin-arap-draft-wrap .fin-arap-draft-head,
  html body #adminContent .fin-arap-draft-wrap .fin-arap-draft-row,
  .fin-arap-draft-wrap .fin-arap-draft-head,
  .fin-arap-draft-wrap .fin-arap-draft-row {
    display: grid !important;
    grid-template-columns: 28px 52px minmax(110px, 1.4fr) minmax(72px, 1fr) 44px minmax(72px, 0.85fr) minmax(64px, 0.75fr) minmax(80px, 0.95fr) 64px 76px minmax(88px, max-content) !important;
    gap: 4px 6px !important;
    padding: 6px 8px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    width: max-content !important;
    min-width: 100% !important;
  }
}

/* ===== V2 fix: 采购待对账明细列宽收紧（去横滑、去大空隙） ===== */
html body #adminContent .reconcile-purchase-left .reconcile-head-purchase-compact,
html body #adminContent .reconcile-purchase-left .reconcile-row-purchase-compact,
html body #adminContent .reconcile-purchase-left .reconcile-list-purchase.reconcile-list-finance .reconcile-list-head,
html body #adminContent .reconcile-purchase-left .reconcile-list-purchase.reconcile-list-finance .reconcile-list-row {
  display: grid !important;
  grid-template-columns: 22px 40px minmax(0, 1.2fr) minmax(0, 1fr) 36px 108px !important;
  gap: 4px 6px !important;
  align-items: center !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
html body #adminContent .reconcile-purchase-left .reconcile-list-finance {
  overflow: visible !important;
}
html body #adminContent .reconcile-purchase-left .reconcile-list-scroll {
  overflow-x: auto !important;
  overflow-y: auto !important;
  max-height: min(58vh, 620px) !important;
}
html body #adminContent .reconcile-purchase-right .reconcile-stmt-panel {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  max-height: min(58vh, 620px) !important;
}
html body #adminContent .reconcile-purchase-right .reconcile-upload-panel {
  min-height: 0 !important;
  overflow: visible !important;
}
html body #adminContent #reconcileStmtPanelWrap {
  min-height: 0 !important;
  overflow: visible !important;
}
html body #adminContent .reconcile-purchase-left .reconcile-col-refno,
html body #adminContent .reconcile-purchase-left .reconcile-col-detail {
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
html body #adminContent .reconcile-purchase-left .reconcile-col-money,
html body #adminContent .reconcile-purchase-left .reconcile-col-amt {
  min-width: 0 !important;
  max-width: 108px !important;
}

/* ===== V2 stmt UI align from V1 (v2-stmt-ui-align-20260805) ===== */
.reconcile-upload-hint-inline {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  font-size: 11px !important;
  color: var(--muted) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 0 !important;
  line-height: 1.35 !important;
}
.reconcile-stmt-summary-row {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.reconcile-stmt-unmatched-row {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  padding: 2px 0 !important;
  color: #9a3412 !important;
}
.reconcile-stmt-unmatched-list {
  margin-top: 4px;
}



/* 识别并勾选：避免 .primary{width:100%} + .btn-sm{background:#fff} 把字冲没变成大白框 */
html body #adminContent .reconcile-upload-toolbar #reconcileStmtRecognize,
html body #adminContent .reconcile-upload-toolbar .btn-sm.primary,
html body #adminContent #reconcileStmtRecognize {
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  flex: 0 0 auto !important;
  padding: 4px 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  border: 1px solid var(--accent) !important;
  border-radius: 4px !important;
  background: var(--accent) !important;
  color: #fff !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}
html body #adminContent .reconcile-upload-toolbar #reconcileStmtPickBtn {
  width: auto !important;
  min-height: 0 !important;
  flex: 0 0 auto !important;
  background: #fff !important;
  color: var(--ink) !important;
}

/* ===== 采购对账上传条：杜绝原生文件大白框 ===== */
html body #adminContent .reconcile-stmt-file-input,
html body #adminContent #reconcileStmtFile,
html body #adminContent .reconcile-upload-toolbar input[type="file"],
html body #adminContent .reconcile-upload-bar input[type="file"],
html body #adminContent .reconcile-upload-panel input[type="file"] {
  position: fixed !important;
  left: -10000px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  max-width: 1px !important;
  max-height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}
html body #adminContent .reconcile-upload-toolbar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
html body #adminContent .reconcile-upload-toolbar .btn-sm,
html body #adminContent .reconcile-upload-toolbar .reconcile-stmt-pick {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}
html body #adminContent .reconcile-upload-toolbar .reconcile-stmt-fname[hidden],
html body #adminContent .reconcile-upload-toolbar .reconcile-upload-status:empty {
  display: none !important;
}
html body #adminContent .reconcile-upload-toolbar .reconcile-stmt-fname {
  flex: 0 1 auto !important;
  max-width: 110px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 12px !important;
}
html body #adminContent .reconcile-upload-toolbar .reconcile-upload-hint-inline,
html body #adminContent .reconcile-upload-hint-inline {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 11px !important;
  color: var(--muted) !important;
  line-height: 1.35 !important;
  margin: 0 !important;
}
html body #adminContent .reconcile-stmt-empty {
  padding: 10px 8px !important;
  min-height: 0 !important;
  background: transparent !important;
  border: none !important;
  text-align: left !important;
  color: var(--muted) !important;
  font-size: 12px !important;
}


/* 对账上传：彻底无白框、无换行空白 */
html body #adminContent .reconcile-upload-panel { min-height: 0 !important; gap: 6px !important; }
html body #adminContent .reconcile-upload-toolbar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  min-height: 28px !important;
  height: auto !important;
  overflow: hidden !important;
}
html body #adminContent .reconcile-upload-toolbar > * { flex-shrink: 0; }
html body #adminContent .reconcile-upload-toolbar .reconcile-upload-hint-inline {
  flex: 1 1 auto !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 11px !important;
  color: var(--muted) !important;
  line-height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body #adminContent .reconcile-stmt-empty,
html body #adminContent .reconcile-stmt-preview,
html body #adminContent .reconcile-stmt-pdf,
html body #adminContent .reconcile-upload-bar {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}
html body #adminContent #reconcileStmtFile,
html body #adminContent .reconcile-stmt-file-input {
  position: fixed !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}


/* ===== 识别明细：原生 table，彻底对齐 ===== */
html body #adminContent .reconcile-stmt-table {
  display: table !important;
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  margin: 0 !important;
  min-width: 0 !important;
  border: 0 !important;
}
html body #adminContent .reconcile-stmt-table thead {
  display: table-header-group !important;
}
html body #adminContent .reconcile-stmt-table tbody {
  display: table-row-group !important;
}
html body #adminContent .reconcile-stmt-table tr.reconcile-stmt-lines-head,
html body #adminContent .reconcile-stmt-table tr.reconcile-stmt-line,
html body #adminContent .reconcile-stmt-table tr {
  display: table-row !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  background: transparent !important;
}
html body #adminContent .reconcile-stmt-table th,
html body #adminContent .reconcile-stmt-table td {
  display: table-cell !important;
  padding: 5px 4px !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  vertical-align: middle !important;
  border-bottom: 1px solid #eef2f7 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  grid-column: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
}
html body #adminContent .reconcile-stmt-table thead th {
  color: var(--muted) !important;
  font-weight: 600 !important;
  background: #fff !important;
  border-bottom: 1px solid var(--line) !important;
  text-align: left !important;
}
html body #adminContent .reconcile-stmt-table .reconcile-stmt-i {
  width: 42px !important;
  white-space: nowrap !important;
  overflow: visible !important;
  color: var(--muted) !important;
}
html body #adminContent .reconcile-stmt-table .reconcile-stmt-i span {
  margin-left: 3px !important;
  font-size: 11px !important;
}
html body #adminContent .reconcile-stmt-table th.reconcile-stmt-i,
html body #adminContent .reconcile-stmt-table td.reconcile-stmt-qty,
html body #adminContent .reconcile-stmt-table th:nth-child(3),
html body #adminContent .reconcile-stmt-table td.reconcile-stmt-amt,
html body #adminContent .reconcile-stmt-table th:nth-child(4),
html body #adminContent .reconcile-stmt-table td.reconcile-stmt-amt-inc,
html body #adminContent .reconcile-stmt-table th:nth-child(5) {
  text-align: right !important;
}
html body #adminContent .reconcile-stmt-table th.reconcile-stmt-i {
  text-align: left !important;
}
html body #adminContent .reconcile-stmt-table .reconcile-stmt-qty,
html body #adminContent .reconcile-stmt-table .reconcile-stmt-amt,
html body #adminContent .reconcile-stmt-table .reconcile-stmt-amt-inc {
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
}
html body #adminContent .reconcile-stmt-table td.reconcile-stmt-flags,
html body #adminContent .reconcile-stmt-table th:last-child {
  color: var(--muted) !important;
  font-size: 11px !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word !important;
  line-height: 1.35 !important;
  min-width: 110px !important;
}
html body #adminContent .reconcile-stmt-table .reconcile-stmt-model {
  max-width: none !important;
}
html body #adminContent .reconcile-stmt-table tr.is-matched td {
  background: #f0fdf4 !important;
}
html body #adminContent .reconcile-stmt-table tr.is-bad td {
  background: #fff7ed !important;
}
html body #adminContent .reconcile-stmt-table input[type="checkbox"].reconcile-stmt-check,
html body #adminContent .reconcile-stmt-table input[type="checkbox"].reconcile-stmt-check-all {
  -webkit-appearance: checkbox !important;
  appearance: auto !important;
  width: 13px !important;
  height: 13px !important;
  min-width: 13px !important;
  max-width: 13px !important;
  min-height: 13px !important;
  max-height: 13px !important;
  margin: 0 2px 0 0 !important;
  padding: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
  flex: none !important;
  position: static !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  clip: auto !important;
  left: auto !important;
}


/* 对账识别工具条：允许换行，避免「手动组合」被裁掉 */
html body #adminContent .reconcile-upload-toolbar {
  flex-wrap: wrap !important;
  overflow: visible !important;
  height: auto !important;
  min-height: 28px !important;
}
html body #adminContent .reconcile-upload-toolbar #reconcileStmtComboMatch {
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  padding: 4px 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  border: 1px solid #d97706 !important;
  border-radius: 4px !important;
  background: #f59e0b !important;
  color: #fff !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

/* 对账型号筛选 */
html body #adminContent .reconcile-model-filter-label {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 12px !important;
  color: var(--muted) !important;
  white-space: nowrap !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
}
html body #adminContent .reconcile-model-filter {
  width: 140px !important;
  min-width: 96px !important;
  max-width: 200px !important;
  height: 28px !important;
  padding: 2px 8px !important;
  margin: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  background: #fff !important;
  color: var(--ink) !important;
}
html body #adminContent .reconcile-toolbar {
  flex-wrap: wrap !important;
  gap: 6px 8px !important;
}

/* 对账组合匹配配色 */
html body #adminContent .reconcile-stmt-table tr.is-combo td,
html body #adminContent .reconcile-list-row.is-combo {
  box-shadow: inset 3px 0 0 rgba(0,0,0,.12);
}
html body #adminContent .reconcile-stmt-table tr.is-combo-0 td,
html body #adminContent .reconcile-list-row.is-combo-0 {
  background: #fef3c7 !important; /* amber */
}
html body #adminContent .reconcile-stmt-table tr.is-combo-1 td,
html body #adminContent .reconcile-list-row.is-combo-1 {
  background: #e0f2fe !important; /* sky */
}
html body #adminContent .reconcile-stmt-table tr.is-combo-2 td,
html body #adminContent .reconcile-list-row.is-combo-2 {
  background: #ede9fe !important; /* violet */
}
html body #adminContent .reconcile-stmt-table tr.is-combo-3 td,
html body #adminContent .reconcile-list-row.is-combo-3 {
  background: #fce7f3 !important; /* pink */
}
html body #adminContent .reconcile-stmt-table tr.is-combo-4 td,
html body #adminContent .reconcile-list-row.is-combo-4 {
  background: #ccfbf1 !important; /* teal */
}
html body #adminContent .reconcile-stmt-table tr.is-combo-5 td,
html body #adminContent .reconcile-list-row.is-combo-5 {
  background: #ffedd5 !important; /* orange */
}
html body #adminContent .reconcile-combo-badge {
  display: inline-block !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  padding: 1px 4px !important;
  margin-right: 2px !important;
  border-radius: 3px !important;
  background: rgba(0,0,0,.08) !important;
  color: #9a3412 !important;
  vertical-align: middle !important;
}
html body #adminContent .reconcile-list-row.is-combo {
  border-radius: 2px;
}

/* 对账单与供应商差异标注 */
html body #adminContent .stmt-variance-box {
  margin: 10px 0 12px !important;
  padding: 10px 12px !important;
  border: 1px solid #f59e0b !important;
  border-left: 4px solid #d97706 !important;
  background: #fffbeb !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  color: #78350f !important;
}
html body #adminContent .stmt-variance-title {
  font-weight: 700 !important;
  margin-bottom: 6px !important;
  color: #9a3412 !important;
}
html body #adminContent .stmt-variance-summary {
  margin-bottom: 6px !important;
  color: #92400e !important;
}
html body #adminContent .stmt-variance-list {
  margin: 0 !important;
  padding-left: 18px !important;
}
html body #adminContent .stmt-variance-list li {
  margin: 4px 0 !important;
  line-height: 1.45 !important;
}
html body #adminContent .stmt-variance-warn { color: #9a3412 !important; }
html body #adminContent .stmt-variance-info { color: #78716c !important; }
html body #adminContent .stmt-variance-ok { margin: 0 !important; color: #166534 !important; }
html body #adminContent .stmt-variance-pre {
  white-space: pre-wrap !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}
html body #adminContent .reconcile-modal-row-variance {
  background: #fff7ed !important;
}
html body #adminContent .stmt-var-tag {
  display: inline-block !important;
  margin-left: 4px !important;
  padding: 0 4px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #9a3412 !important;
  background: #fed7aa !important;
  border-radius: 3px !important;
  vertical-align: middle !important;
}

/* 组合匹配说明 */
html body #adminContent .reconcile-stmt-combo-explain {
  margin: 10px 0 8px !important;
  padding: 8px 10px !important;
  border: 1px solid #f59e0b !important;
  border-left: 4px solid #d97706 !important;
  background: #fffbeb !important;
  border-radius: 6px !important;
  font-size: 12px !important;
}
html body #adminContent .reconcile-stmt-combo-explain .reconcile-stmt-compare-title {
  color: #9a3412 !important;
  font-weight: 700 !important;
  margin-bottom: 6px !important;
}
html body #adminContent .reconcile-stmt-combo-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}
html body #adminContent .reconcile-stmt-combo-row {
  padding: 6px 8px !important;
  border-radius: 4px !important;
  line-height: 1.4 !important;
  color: #78350f !important;
  background: rgba(255,255,255,.55) !important;
}
html body #adminContent .reconcile-stmt-combo-row.is-combo-0 { background: #fef3c7 !important; }
html body #adminContent .reconcile-stmt-combo-row.is-combo-1 { background: #e0f2fe !important; }
html body #adminContent .reconcile-stmt-combo-row.is-combo-2 { background: #ede9fe !important; }
html body #adminContent .reconcile-stmt-combo-row.is-combo-3 { background: #fce7f3 !important; }
html body #adminContent .reconcile-stmt-combo-row.is-combo-4 { background: #ccfbf1 !important; }
html body #adminContent .reconcile-stmt-combo-row.is-combo-5 { background: #ffedd5 !important; }
html body #adminContent .reconcile-stmt-combo-how {
  color: #92400e !important;
  font-size: 11px !important;
}


/* stmt compare 3-in-row */
html body #adminContent .reconcile-stmt-compare-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
}
html body #adminContent .reconcile-stmt-compare-item {
  min-width: 0;
}


/* reconcile scroll fix 20260805 */
html body.view-frame-locked #adminContent .reconcile-purchase-left .reconcile-list-scroll,
html body.view-frame-locked #adminContent .reconcile-list-finance > .reconcile-list-scroll {
  max-height: min(58vh, 620px) !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
}
html body.view-frame-locked #adminContent .reconcile-purchase-right .reconcile-stmt-panel {
  max-height: min(58vh, 620px) !important;
  overflow-y: auto !important;
}

/* ===== V2 global scroll unlock 20260805 ===== */
/* 统一：有限高的列表/面板必须可纵向滚动；滚轮由 JS 找最近可滚祖先 */
html body #adminContent .reconcile-list-scroll,
html body #adminContent .reconcile-list-scroll-draft,
html body #adminContent .reconcile-list-scroll-modal,
html body #adminContent .reconcile-stmt-panel,
html body #adminContent .reconcile-purchase-panel-scroll,
html body #adminContent .reconcile-sales-pending .reconcile-list-scroll,
html body #adminContent .dash-scroll-inner,
html body #adminContent .accordion-inner,
html body #adminContent .fin-arap-list-scroll,
html body #adminContent .fin-arap-detail-scroll,
html body #adminContent .fin-dash-log-scroll,
html body #adminContent .fin-dash-pnl-body,
html body #adminContent .log-list,
html body #adminContent .pd-draft-scroll,
html body #adminContent .inv-detail-list-scroll,
html body #adminContent .io-table-scroll,
html body #adminContent .rp-replenish-scroll,
html body #adminContent .issue-stock-overview-scroll,
html body.view-frame-locked .page-frame-body,
html body.view-frame-locked .ops-dash-body,
html body.app-shell-locked .ops-dash-body {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
html body #adminContent .master-table-scroll,
html body.app-shell-locked .frame-list-wrap > .master-table-scroll,
html body.view-frame-locked .frame-list-wrap > .master-table-scroll {
  overflow-x: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* 父级勿锁死裁切（滚动交给内部 scroller） */
html body #adminContent .reconcile-list-wrap,
html body #adminContent .reconcile-list-finance,
html body #adminContent .reconcile-list-sales,
html body #adminContent .reconcile-list-purchase,
html body #adminContent .dash-scroll,
html body #adminContent .results-scroll:not(.wh-io-keep-clip) {
  overflow: visible !important;
}
/* 待入/出库：外框滚，内层不另套滚动（保持可见）——排除在上面可见规则后单独恢复 */
html body.view-wh-io #adminContent .page-frame-body .results-scroll,
html body.view-wh-io #adminContent .page-frame-body .results-inner {
  overflow: visible !important;
  max-height: none !important;
}
.rules-ai-chat,
.brain-chat,
#emailFolderTree {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
/* ===== /V2 global scroll unlock ===== */
