: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; }

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  max-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;
  overflow: hidden;
}

body.is-locked {
  display: block;
  overflow: auto;
  height: auto;
  max-height: none;
}
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-brand {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  margin-bottom: 4px;
}

.login-brand .brand-logo {
  width: min(200px, 100%);
  margin: 0;
}

.login-card h1 { margin: 0; font-size: 18px; line-height: 1.4; font-weight: 700; }
.login-card p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 13px; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  color: #fff;
  background: #10231f;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 6px 14px;
  flex-shrink: 0;
  text-align: left;
}
.brand-text { display: grid; gap: 8px; min-width: 0; width: 100%; }
.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: #f0c66c;
  color: #10231f;
  font-weight: 800;
}

.brand-logo {
  display: block;
  width: min(220px, 100%);
  height: auto;
  object-fit: contain;
}

.brand-logo--sidebar {
  width: min(160px, 100%);
  height: auto;
  flex-shrink: 0;
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
}

.brand small { display: block; margin-top: 2px; color: #b9ccc8; }

.nav-list {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  justify-items: stretch;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d9e6e2;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.nav-item:hover, .nav-item.active { background: rgba(255, 255, 255, 0.08); color: #fff; }

.session-box {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #b9ccc8;
  font-size: 13px;
  flex-shrink: 0;
}

.session-box button {
  color: #d9e6e2;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
}

.role-switch {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.role-switch.is-collapsed {
  display: none;
}

.role-switch span {
  font-size: 11px;
  color: #8fa9a3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-switch select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #f4f7f6;
  color: #10231f;
  font-size: 13px;
  cursor: pointer;
}

.role-switch select option {
  background: #fff;
  color: #10231f;
}

.role-switch.hidden {
  display: none;
}

main {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  max-height: 100vh;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.view-error-banner {
  flex: 0 0 auto;
  padding: 12px 16px;
  border: 1px solid #f5c2c0;
  border-radius: 10px;
  background: #fff5f5;
  color: #b42318;
}

.panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.panel-title-block { display: grid; gap: 6px; min-width: 0; }

.panel-head h2 { margin: 0; font-size: 18px; }

.panel-subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  font-weight: normal;
}

.panel-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.panel-body > .toolbar,
.panel-body > .button-row,
.panel-body > .partner-filter-bar,
.panel-body > .guide-box,
.panel-body > .hint,
.panel-body > .error,
.panel-body > .partner-filter-meta,
.panel-body > .dash-widget-inquiry,
.panel-body > .master-tabs,
.panel-body > .master-subtabs,
.panel-body > form,
.panel-body > .admin-section:not(.results-scroll) {
  flex-shrink: 0;
}

.panel-body > .dash-board {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.panel-body > .admin-section.results-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-body > .content-scroll,
.panel-body .table-scroll {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.results-scroll > .admin-section-title {
  flex-shrink: 0;
}

.button-row, .toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

button, .btn {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}

button.primary, .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.danger { color: var(--danger); border-color: #fecdca; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data-table th, table.data-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

table.data-table th { color: var(--muted); font-weight: 600; background: var(--surface-soft); }
table.data-table tr:hover td { background: #fafcfd; }

.empty { color: var(--muted); text-align: center; padding: 24px; }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

.tab {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}

.tab.active { background: var(--accent-soft); border-color: #b7ddd4; color: var(--accent); }

/* 基础资料：主分类（物料/客户/…）— 大号下划线 Tab */
.master-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--line);
  margin: 0 0 4px;
}

.master-tab {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 10px 16px 12px;
  margin-bottom: -2px;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.master-tab:hover { color: var(--ink); }

.master-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

.master-tab-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.master-tab.active .master-tab-count { color: #5a8f86; }

/* 基础资料：物料子页 — 小号胶囊 Tab */
.master-subtabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.sub-tab {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
}

.sub-tab:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.sub-tab.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #b7ddd4;
  font-weight: 500;
}

.form-card, .stat-grid { display: grid; gap: 12px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }

input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

/* 可搜索选择器（替代长下拉） */
.picker { position: relative; }
.picker-input { width: 100%; }
.picker-dropdown {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.picker-dropdown.hidden { display: none; }
.picker-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.picker-option:hover,
.picker-option.active { background: var(--accent-soft); }
.picker-option-label { font-size: 13px; }
.picker-option-hint { font-size: 11px; color: var(--muted); }
.picker-empty { padding: 10px; font-size: 12px; color: var(--muted); text-align: center; }

.bom-lines { display: grid; gap: 12px; margin-top: 8px; }
.bom-line-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.bom-line-main {
  display: grid;
  grid-template-columns: 1fr 88px 88px auto auto;
  gap: 8px;
  align-items: end;
}
.bom-line-row .picker { min-width: 0; }
.bom-line-desc textarea {
  width: 100%;
  min-height: 52px;
  resize: vertical;
  font: inherit;
}
.bom-line-files label { display: block; font-size: 12px; margin-bottom: 4px; }
.bom-line-att-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.bom-att-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11px;
}
.bom-att-chip.pending { opacity: 0.85; }
.bom-att-rm {
  border: none;
  background: transparent;
  color: var(--danger, #c0392b);
  cursor: pointer;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
}
.bom-line-row .bom-line-price {
  white-space: nowrap;
  align-self: center;
  min-width: 100px;
}

.npi-bom-group {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.npi-bom-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
}

.npi-bom-stat-card {
  flex: 1 1 140px;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.npi-bom-stat-card.readonly {
  cursor: default;
  opacity: 0.92;
}

.npi-bom-stat-card.has-pending {
  border-color: #fecaca;
  background: #fff5f5;
}

.npi-bom-stat-card.active,
.npi-bom-stat-card:not(.readonly):hover {
  border-color: #1a6b5c;
  box-shadow: 0 0 0 2px rgba(26, 107, 92, 0.12);
}

.npi-bom-stat-num {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.npi-bom-stat-lbl {
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

.kb-dept-stats {
  display: flex;
  gap: 8px;
}

.kb-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.kb-toolbar .order-search {
  flex: 1 1 200px;
  min-width: 180px;
}

.kb-doc-table td:nth-child(2) {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
}

.npi-bom-stat-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
}

.npi-bom-pending-panel {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fffbfb;
}

.npi-bom-pending-panel .admin-section-title {
  margin-bottom: 8px;
}

.npi-bom-pending-panel h4 {
  margin: 0;
  font-size: 14px;
  color: #b42318;
}

.badge-red {
  background: #fee2e2;
  color: #b42318;
}

.npi-bom-group summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  list-style: none;
  background: var(--surface-soft);
}

.npi-bom-group summary::-webkit-details-marker { display: none; }

.npi-bom-group[open] summary {
  border-bottom: 1px solid var(--line);
}

.npi-bom-group .npi-bom-table {
  margin: 8px 12px 12px;
}
.npi-bom-table tbody tr.npi-bom-row-common {
  background: #e8f5e9;
}
.npi-bom-table tbody tr.npi-bom-row-new {
  background: #fff3e0;
}
.npi-bom-legend-common {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: #e8f5e9;
  font-size: 12px;
}
.npi-bom-legend-new {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: #fff3e0;
  font-size: 12px;
}
.npi-btn-common {
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
}
.npi-btn-new.primary {
  background: #e65100;
  border-color: #e65100;
}
.npi-price-ref { color: #2e7d32; font-size: 12px; font-weight: 600; }
.npi-price-done { color: var(--ok, #1a6b5c); font-size: 12px; }
.npi-price-missing { color: #e65100; font-size: 12px; }

.npi-btn-trial-po {
  background: #1565c0;
  color: #fff;
  border-color: #1565c0;
}
.npi-fee-group {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.npi-fee-group summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.npi-fee-table tbody tr.npi-fee-row {
  background: #e3f2fd;
}
.po-line-fee {
  background: #fff8e1 !important;
}

.bom-cost-total {
  margin-left: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #1a6b5c;
}

.bom-modal-total {
  font-weight: 500;
  color: #1a6b5c;
}

.form-section-title {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.form-section-title:first-of-type { margin-top: 0; }

.form-span-2 { grid-column: 1 / -1; }

.contact-lines { display: grid; gap: 10px; margin-top: 8px; }

.contact-line {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr 88px auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafcfb;
}

.contact-line-remove {
  align-self: center;
  margin-bottom: 2px;
}

.address-lines { display: grid; gap: 10px; margin-top: 8px; }

.address-line {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafcfb;
}

.address-detail-label { min-width: 0; }

.address-line-remove {
  align-self: start;
  margin-top: 22px;
}

@media (max-width: 720px) {
  .address-line {
    grid-template-columns: 1fr;
  }
  .address-line-remove { margin-top: 0; justify-self: start; }
}

@media (max-width: 720px) {
  .contact-line {
    grid-template-columns: 1fr 1fr;
  }
  .contact-line-remove { grid-column: 1 / -1; justify-self: start; }
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.stat-card strong { display: block; font-size: 24px; margin-top: 6px; }

/* 工作台 · 多模块拼盘（询价不占满行） */
.dash-board {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px;
}
.dash-widget {
  flex: 0 1 auto;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.dash-widget-inquiry {
  width: fit-content;
  max-width: min(420px, 100%);
}
.dash-widget-customer {
  width: fit-content;
  max-width: min(560px, 100%);
}
.dash-widget-master {
  width: fit-content;
  max-width: min(320px, 100%);
}
.dash-widget-supplier {
  width: fit-content;
  max-width: min(280px, 100%);
}
.dash-region-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.dash-region-chip {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}
.dash-region-chip:hover { border-color: var(--accent); color: var(--accent); }
.dash-region-chip b { font-weight: 700; margin-left: 2px; }
.partner-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.partner-badges .badge { font-size: 11px; padding: 1px 6px; }
.partner-filter-bar--crm {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 6px 8px;
}
.partner-filter-bar--crm .partner-filter-keyword {
  flex: 0 1 200px;
  min-width: 140px;
  max-width: 240px;
  order: 0;
}
.partner-filter-bar--crm .partner-filter-classify {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  order: 1;
  overflow-x: auto;
}
.partner-filter-bar--crm .partner-filter-clear {
  flex-shrink: 0;
  order: 2;
  margin-left: auto;
}
.crm-classify-field {
  display: grid;
  gap: 1px;
  font-size: 10px;
  color: var(--muted);
  flex: 1 1 0;
  min-width: 72px;
  margin: 0;
}
.crm-classify-field select {
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  background: #fff;
  height: 28px;
}
.dash-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}
.dash-status-head b { color: var(--text); font-size: 14px; }
.dash-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dash-status-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 76px;
  min-width: 76px;
  height: 60px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.dash-status-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.dash-status-card strong {
  font-size: 18px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--text);
}
.dash-status-card span {
  margin-top: 3px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.dash-status-card.tone-orange { border-color: #f0c9a0; background: #fff8f1; }
.dash-status-card.tone-orange strong { color: #c05621; }
.dash-status-card.tone-blue { border-color: #b7d3f0; background: #f3f8fd; }
.dash-status-card.tone-blue strong { color: #2b6cb0; }
.dash-status-card.tone-green { border-color: #b7e0c7; background: #f2faf5; }
.dash-status-card.tone-green strong { color: #2f855a; }
.dash-status-card.tone-gray { border-color: var(--line); background: var(--surface-soft); }
.dash-status-card.tone-red { border-color: #f0b4b0; background: #fff5f5; }
.dash-status-card.tone-red strong { color: #c53030; }
.dash-status-card.tone-accent {
  border-color: #9fd0c4;
  background: linear-gradient(160deg, #f2faf7 0%, #e8f5f0 100%);
  width: 86px;
  min-width: 86px;
  padding: 6px 8px;
  cursor: default;
}
.dash-status-card.tone-accent strong { color: #1a6b5c; font-size: 16px; }
.dash-status-card.tone-accent em {
  margin-top: 1px;
  font-style: normal;
  font-size: 9px;
  color: var(--muted);
}
.dash-conv-card { pointer-events: none; }
.dash-status-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow: auto; }
.dash-status-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-soft); cursor: pointer; text-align: left; font: inherit; width: 100%;
}
.dash-status-row:hover { border-color: var(--accent); }

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.grid-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.grid-form textarea { min-height: 72px; resize: vertical; }
.grid-form button[type="submit"] { grid-column: 1 / -1; justify-self: start; }

.pf-phase-bar { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.pf-phase { flex: 1; min-width: 100px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); font-size: 11px; }
.pf-phase-active { border-color: var(--accent); background: #eef6ff; }
.pf-phase-done { border-color: #86efac; background: #f0fdf4; }
.pf-phase-label { display: block; font-weight: 600; margin-bottom: 4px; }
.pf-phase-progress { color: var(--muted); }
.pf-phase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.pf-track-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; min-height: 400px; }
@media (max-width: 900px) { .pf-track-layout { grid-template-columns: 1fr; } }
.pf-case-list { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.pf-case-btn { text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.pf-case-btn.active { border-color: var(--accent); background: #eef6ff; }
.pf-case-detail h4 { margin: 0 0 8px; }
.pf-step-list { list-style: none; padding: 0; margin: 8px 0; }
.pf-step { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.pf-step.done { opacity: 0.75; }
.pf-step-main { display: flex; gap: 8px; flex: 1; }
.pf-phase-detail { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }

.hint { font-size: 12px; color: var(--muted); margin: 0; }

.guide-box {
  margin: 0 0 16px;
  padding: 14px 16px 12px;
  border: 1px solid #c8e6df;
  border-radius: 10px;
  background: linear-gradient(180deg, #f4fbf9 0%, #f8fcfb 100%);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}

.guide-box-title {
  font-weight: 600;
  font-size: 14px;
  color: #1a6b5c;
  margin-bottom: 8px;
}

.guide-steps {
  margin: 0;
  padding-left: 1.25rem;
  color: #374151;
}

.guide-steps li { margin: 4px 0; }

.guide-steps li::marker { color: #5a8f86; font-weight: 600; }

.guide-note {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px dashed #c8e6df;
  font-size: 12px;
  color: var(--muted);
}

.guide-box-collapsible {
  padding: 0;
}

.guide-box-collapsible > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}

.guide-box-collapsible > summary::-webkit-details-marker { display: none; }

.guide-box-collapsible > summary:hover {
  background: rgba(26, 107, 92, 0.06);
}

.guide-box-chevron {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 2px solid #1a6b5c;
  border-bottom: 2px solid #1a6b5c;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.guide-box-collapsible[open] .guide-box-chevron {
  transform: rotate(45deg);
  margin-top: -4px;
}

.guide-box-collapsible .guide-box-body {
  padding: 0 16px 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 35, 31, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
  overflow: auto;
}

.modal,
.modal-card {
  width: min(720px, 100%);
  max-width: 100%;
  max-height: min(90vh, 900px);
  margin: auto;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.modal-card h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.modal-card .dash-status-list {
  max-height: min(55vh, 480px);
  overflow: auto;
  overscroll-behavior: contain;
}

.hidden { display: none !important; }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.status-on { background: #e6f4ef; color: #1a6b5c; }
.status-off { background: #f2f4f7; color: #667085; }

.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.field-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}


.role-check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafcfb;
}

.role-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
}

.role-check input { width: auto; }

.rules-summary-cell {
  max-width: 320px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.panel-workflows {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-workflows .panel-head {
  flex-shrink: 0;
}

.panel-workflows .panel-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.panel-workflows .guide-box-collapsible {
  flex-shrink: 0;
}

.panel-workflows .workflow-master-detail {
  flex: 1;
  min-height: 0;
}

.workflow-master-detail {
  display: grid;
  grid-template-columns: minmax(260px, 32%) 1fr;
  gap: 20px;
  align-items: stretch;
  margin-top: 12px;
  min-height: 360px;
}

.workflow-master-col {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.workflow-search-wrap {
  margin-bottom: 10px;
}

.workflow-search-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.workflow-search-input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.workflow-search-meta {
  margin: 8px 0 0;
}

.partner-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.partner-filter-keyword {
  flex: 1 1 180px;
  min-width: 160px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.partner-filter-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  flex: 2 1 320px;
}

.partner-filter-pickers label {
  flex: 1 1 200px;
  min-width: 180px;
  margin: 0;
  font-size: 12px;
}

.partner-filter-select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.bom-block {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.bom-block > summary {
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  background: var(--surface-soft);
}

.bom-block > summary::-webkit-details-marker { display: none; }

.bom-block[open] > summary {
  border-bottom: 1px solid var(--line);
}

.bom-block > table,
.bom-block > button {
  margin-left: 14px;
  margin-right: 14px;
}

.bom-block > button:last-of-type {
  margin-bottom: 12px;
}

.partner-filter-clear {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font: inherit;
}

.partner-filter-date {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

/* 客户询价 · 紧凑单行筛选 */
.npi-inquiry-filter-bar {
  flex-wrap: nowrap;
  align-items: center;
  padding: 8px 10px;
  gap: 8px;
}

.npi-inquiry-filter-bar .partner-filter-keyword {
  flex: 1 1 120px;
  min-width: 100px;
  max-width: 200px;
  padding: 6px 8px;
  font-size: 13px;
}

.npi-inquiry-filter-bar .partner-filter-pickers {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  gap: 6px 8px;
  min-width: 0;
}

.npi-inquiry-filter-bar .partner-filter-pickers label {
  flex: 0 0 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 12px;
}

.npi-inquiry-filter-bar .npi-filter-lbl {
  color: var(--muted);
  flex-shrink: 0;
}

.npi-inquiry-filter-bar .npi-filter-select-sm,
.npi-inquiry-filter-bar .npi-filter-date-sm {
  display: inline-block;
  width: auto;
  min-width: 0;
  margin-top: 0;
  padding: 5px 6px;
  font-size: 12px;
  line-height: 1.2;
}

.npi-inquiry-filter-bar .npi-filter-select-sm {
  max-width: 96px;
}

.npi-inquiry-filter-bar label:nth-child(1) .npi-filter-select-sm {
  max-width: 88px;
}

.npi-inquiry-filter-bar label:nth-child(4) .npi-filter-select-sm {
  max-width: 108px;
}

.npi-inquiry-filter-bar .npi-filter-date-sm {
  width: 118px;
  padding: 4px 4px;
}

.npi-inquiry-filter-bar .npi-filter-clear-sm {
  padding: 5px 10px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .npi-inquiry-filter-bar {
    flex-wrap: wrap;
  }
  .npi-inquiry-filter-bar .partner-filter-pickers {
    flex-wrap: wrap;
  }
}

/* 客户询价 · 转化漏斗 */
.npi-funnel-panel {
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: linear-gradient(180deg, #f0f7ff 0%, #f8fbff 100%);
}

/* 三部门评估 · 待评估 / 已评估 */
.npi-assess-tabs {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-bottom: 4px;
}
.npi-assess-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.npi-assess-tab b { color: var(--ink); margin-left: 4px; }
.npi-assess-tab.active {
  border-color: var(--accent);
  background: #eef6ff;
  color: var(--ink);
  font-weight: 600;
}
.npi-assess-list {
  display: grid;
  gap: 8px;
  align-content: start;
}
.npi-assess-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.npi-assess-row:hover {
  border-color: var(--accent);
  background: #f7fbfa;
}
.npi-assess-row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.npi-assess-row-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.npi-assess-row-preview {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.npi-assess-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.npi-assess-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.npi-assess-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.npi-assess-mine {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
}
.npi-assess-mine.pending {
  color: #c05621;
  background: #fff8f1;
  border: 1px solid #f0c9a0;
}
.npi-assess-mine.done {
  background: #f2faf5;
  border: 1px solid #b7e0c7;
}
.npi-assess-mine-body {
  margin-top: 4px;
  white-space: pre-wrap;
  font-size: 13px;
}

.panel-body > .npi-assess-tabs {
  flex-shrink: 0;
}

.npi-funnel-title {
  font-weight: 600;
  font-size: 14px;
  color: #1e40af;
  margin-bottom: 10px;
}

.npi-funnel-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
}

.npi-funnel-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #dbeafe;
}

.npi-funnel-stat.highlight {
  border-color: #86efac;
  background: #f0fdf4;
}

.npi-funnel-stat-btn {
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.npi-funnel-stat-btn:hover {
  border-color: #1e40af;
  box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.12);
}

.npi-funnel-stat-btn.active {
  border-color: #1e40af;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.18);
}

.npi-funnel-filter-hint {
  margin: 8px 0 0;
  color: #1e40af;
}

.npi-funnel-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.npi-funnel-lbl {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.npi-funnel-arrow {
  font-size: 11px;
  color: #64748b;
  padding: 0 2px;
}

.npi-funnel-foot {
  margin: 10px 0 0;
}

.npi-inquiry-main {
  flex: 1;
  min-width: 0;
}

.npi-inquiry-head {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  font-size: 13px;
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
}

.npi-inquiry-no {
  flex-shrink: 0;
}

.npi-inquiry-sep {
  flex-shrink: 0;
  color: var(--muted);
  margin: 0 5px;
}

.npi-inquiry-customer {
  flex-shrink: 0;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.npi-inquiry-product {
  flex-shrink: 0;
  color: #1a6b5c;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.npi-inquiry-subject {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.npi-inquiry-date {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.npi-inquiry-head .badge {
  flex-shrink: 0;
  margin-left: 6px;
  font-size: 10px;
}

.npi-inquiry-row .npi-pipeline-wrap {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 12px;
}

.inquiry-replies {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.inquiry-replies-empty {
  padding: 8px 10px;
}

.inquiry-reply {
  padding: 8px 10px;
  border-radius: 8px;
  border-left: 3px solid var(--line);
  background: var(--surface);
}

.inquiry-reply-sales {
  border-left-color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
}

.inquiry-reply-design {
  border-left-color: #0891b2;
  background: rgba(8, 145, 178, 0.06);
}

.inquiry-reply-tech {
  border-left-color: #ca8a04;
  background: rgba(202, 138, 4, 0.08);
}

.inquiry-reply-quality {
  border-left-color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
}

.inquiry-reply-system {
  border-left-color: var(--muted);
  background: rgba(100, 116, 139, 0.08);
}

.inquiry-reply-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
}

.inquiry-reply-head time {
  color: var(--muted);
  font-size: 11px;
}

.inquiry-reply-body {
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.row-actions .btn-sm.active {
  outline: 2px solid var(--primary);
}

.npi-pipeline-wrap > summary {
  padding: 6px 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.npi-pipeline-wrap > summary::-webkit-details-marker { display: none; }

.npi-pipeline-steps {
  margin: 0;
  padding: 4px 10px 10px 28px;
  list-style: none;
}

.npi-pipeline-step {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 4px 0;
  color: var(--muted);
}

.npi-pipeline-step.npi-step-done { color: var(--ink); }

.npi-pipeline-step.npi-step-fail { color: #b42318; }

.npi-pipeline-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #cbd5e1;
}

.npi-step-done .npi-pipeline-dot { background: #22c55e; }

.npi-step-fail .npi-pipeline-dot { background: #ef4444; }

.npi-pipeline-label { line-height: 1.4; }

.npi-pipeline-step small { white-space: nowrap; color: var(--muted); font-size: 11px; }

.partner-filter-meta {
  margin: 0 0 8px;
}

.workflow-detail-col {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.workflow-detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 8px;
  scrollbar-gutter: stable;
}

.workflow-master-table tbody tr.workflow-master-row {
  cursor: pointer;
}

.workflow-master-table tbody tr.workflow-master-row:hover,
.workflow-master-table tbody tr.workflow-master-row.selected {
  background: #eff6ff;
}

.workflow-detail-panel {
  display: grid;
  gap: 16px;
}

.workflow-detail-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.workflow-detail-section h4 {
  margin: 0 0 6px;
}

.workflow-scenario-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.workflow-scenario-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}

.workflow-scenario-card.configured {
  border-left: 4px solid #16a34a;
  background: #f0fdf4;
}

.workflow-scenario-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.workflow-scenario-desc {
  margin: 0 0 6px;
}

.workflow-scenario-preview {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: #374151;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: #f3f4f6;
  color: #4b5563;
}

.badge.badge-ok,
.badge-green {
  background: #dcfce7;
  color: #166534;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-gray { background: #f3f4f6; color: #4b5563; }
.badge-red { background: #fee2e2; color: #b91c1c; }

@media (max-width: 900px) {
  .workflow-master-detail {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .workflow-master-col {
    max-height: 240px;
  }
  .workflow-detail-scroll {
    max-height: calc(100vh - 280px);
  }
}

.lifecycle-panel {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fcfb 0%, #fff 100%);
}

.lifecycle-panel-head h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.lifecycle-diagram-wrap {
  margin: 12px 0;
  padding: 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: auto;
}

/* 审批状态流转图（内置，无需外网） */
.state-chart {
  min-width: min(100%, 680px);
  min-height: 120px;
  padding: 8px 4px;
}

.state-chart-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  justify-content: center;
}

.state-node {
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid #1a6b5c;
  background: #e6f4ef;
  color: #134e44;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.state-node-start {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #475569;
  border-radius: 8px;
}

.state-node-pending { border-color: #d97706; background: #fff7ed; color: #9a3412; }
.state-node-approved { border-color: #2563eb; background: #eff6ff; color: #1e40af; }
.state-node-scheduled { border-color: #7c3aed; background: #f5f3ff; color: #5b21b6; }
.state-node-rejected { border-color: #dc2626; background: #fef2f2; color: #991b1b; }
.state-node-effective { border-color: #1a6b5c; background: #1a6b5c; color: #fff; }

.state-chart-binding .state-chart-track,
.state-chart-batch .state-chart-track {
  flex-wrap: wrap;
}

.state-branch-batch {
  min-width: 140px;
}

.state-edge {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
  padding: 0 4px;
}

.state-edge-line {
  display: block;
  width: 36px;
  height: 2px;
  background: #94a3b8;
  position: relative;
}

.state-edge-line::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border: 5px solid transparent;
  border-left-color: #94a3b8;
}

.state-edge-down {
  min-height: 28px;
  justify-content: flex-end;
}

.state-edge-down .state-edge-line {
  width: 2px;
  height: 24px;
}

.state-edge-down .state-edge-line::after {
  right: -4px;
  top: auto;
  bottom: -1px;
  border: 5px solid transparent;
  border-top-color: #94a3b8;
  border-left-color: transparent;
}

.state-edge-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  text-align: center;
  max-width: 88px;
  line-height: 1.3;
}

.state-chart-branches {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  justify-content: center;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  position: relative;
}

.state-chart-branches::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 16px;
  background: #94a3b8;
  transform: translateX(-50%);
}

.state-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.state-branch-approve .state-node-approved { margin-top: 0; }

@media (max-width: 640px) {
  .state-chart-track { flex-direction: column; align-items: stretch; }
  .state-edge { flex-direction: row; min-width: 0; padding: 4px 0; }
  .state-edge-line { width: 100%; max-width: 120px; }
  .state-chart-branches { flex-direction: column; align-items: center; }
}

.lifecycle-states-table {
  margin-top: 8px;
  font-size: 13px;
}

.lifecycle-modal-hint {
  margin: 0 0 12px;
  line-height: 1.55;
}

.workflow-rules-toolbar {
  margin-bottom: 10px;
}

.workflow-rules-table td.button-row button {
  font-size: 12px;
  padding: 4px 10px;
}

.workflow-scenario-card .button-row button {
  font-size: 12px;
  padding: 4px 10px;
}

.workflow-rules { display: grid; gap: 10px; margin-top: 8px; }

.workflow-rule-line {
  display: grid;
  grid-template-columns: 1fr 1.2fr 88px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafcfb;
}

.workflow-rule-line .rule-approver-wrap {
  grid-column: 1 / -1;
}

.workflow-rule-remove {
  align-self: start;
  margin-top: 22px;
}

@media (max-width: 820px) {
  .workflow-rule-line {
    grid-template-columns: 1fr 1fr;
  }
  .workflow-rule-remove { grid-column: 1 / -1; margin-top: 0; }
}

.visually-hidden-file {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .sidebar {
    position: static;
    height: auto;
    max-height: 36vh;
  }
  main {
    height: auto;
    max-height: none;
    min-height: 0;
  }
}

/* ── 系统通知 ── */
.system-notice {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid #f0d9a8;
  border-radius: 8px;
  color: #714500;
  background: #fff8e6;
  box-shadow: var(--shadow);
}
.system-notice.error {
  border-color: #f5c2c0;
  color: #b42318;
  background: #fff5f5;
}

/* ── 报表中心（对齐 V1）── */
.admin-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.admin-section-title h3 { margin: 0; font-size: 15px; }
.results-scroll {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.results-inner {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.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-actions { white-space: nowrap; }

.partner-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.partner-list-row {
  margin: 0;
  padding: 0;
  gap: 0;
  border-bottom: 1px solid var(--line);
}
.partner-list-row:last-child { border-bottom: 0; }
.partner-list-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.partner-list-main:hover { background: var(--surface-soft, #f5f8f7); }
.partner-list-title {
  font-size: 14px;
  line-height: 1.4;
}
.partner-list-preview {
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.partner-list-del {
  flex-shrink: 0;
  margin: 10px 12px 10px 0;
  align-self: center;
}
.partner-detail-list {
  margin: 0 0 12px;
  padding-left: 18px;
  line-height: 1.7;
  font-size: 13px;
}
.partner-detail-modal .form-section-title {
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 600;
}
.report-row { cursor: pointer; }
.report-row:hover { background: var(--accent-soft); }
.report-meta, .memo-meta { font-size: 11px; color: var(--muted); }
.report-content { margin-top: 8px; line-height: 1.6; white-space: pre-wrap; max-height: 400px; overflow: auto; }
.badge-ai { background: var(--accent-soft); color: var(--accent); }
.reports-tabs .reports-tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.reports-tab-btn, .report-gen-btn, .search-go-btn, .memo-kind-btn, .memo-add-btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
}
.search-go-btn { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.reports-hint { font-size: 12px; color: var(--muted); margin: 8px 0; line-height: 1.6; }
.reports-toolbar { margin-top: 6px; flex-wrap: wrap; gap: 8px; }
.toolbar-spacer { flex: 1; }
.reports-person-group { margin-bottom: 14px; }
.reports-group-title {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 6px;
}
.memo-done { opacity: 0.55; }
.memo-done b { text-decoration: line-through; }
.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; line-height: 1.5; }
.memo-src-ai, .memo-src-manual { font-size: 11px; color: var(--muted); margin-right: 4px; }
.memo-kind-btn.active { font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.memo-add-btn.todo.on { background: #16a34a; color: #fff; border-color: #16a34a; font-weight: 600; }
.memo-add-btn.memo.on { background: #d97706; color: #fff; border-color: #d97706; font-weight: 600; }
.memo-form-box {
  margin-top: 10px;
  padding: 16px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--surface);
  display: grid;
  gap: 8px;
}
.memo-form-todo { border-color: #16a34a !important; background: rgba(22, 163, 74, 0.06) !important; }
.memo-form-memo { border-color: #d97706 !important; background: rgba(217, 119, 6, 0.07) !important; }
.memo-form-hint { margin: 0; font-size: 12px; color: var(--muted); }
.memo-form-box input, .memo-form-box textarea {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.memo-form-box .primary.todo { background: #16a34a; border-color: #16a34a; }
.memo-form-box .primary.memo { background: #d97706; border-color: #d97706; }
.btn-sm {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  background: var(--surface);
}
.memo-del-btn, .report-del-btn { background: var(--danger) !important; color: #fff !important; border-color: var(--danger) !important; }
.save-status { font-size: 12px; color: var(--muted); margin-left: 8px; }
#reportsPersonFilter, #reportsTypeFilter {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  min-width: 140px;
}

/* ── 邮件工作台（对齐 V1）── */
.panel-email { border: 0; box-shadow: none; background: transparent; }
.panel-email .panel-body-email { padding: 0; }
.email-workspace {
  display: flex;
  gap: 0;
  height: calc(100vh - 48px);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
}
.email-sidebar {
  width: 340px;
  min-width: 340px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: #f8f9fb;
}
.email-toolbar {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
}
.email-toolbar button {
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 11px;
  background: #e8e8e8;
}
.email-toolbar button:first-child { background: var(--accent); color: #fff; }
.email-compose-btn { background: #07c160 !important; color: #fff !important; }
.email-search-wrap { padding: 4px 8px; border-bottom: 1px solid var(--line); }
.email-search-wrap input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 12px;
  box-sizing: border-box;
}
.email-filter-bar {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 11px;
}
.email-filter-btn {
  flex: 1;
  padding: 6px;
  text-align: center;
  cursor: pointer;
  color: #666;
  border-bottom: 2px solid transparent;
}
.email-filter-btn.active { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.email-folder-tabs {
  flex: 0 0 auto;
  max-height: 40%;
  overflow-y: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 4px 0;
}
.email-folder-item {
  padding: 6px 12px;
  cursor: pointer;
  font-size: 11px;
  color: #666;
  border-left: 2px solid transparent;
}
.email-folder-item.active { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); }
.email-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.email-list-empty { padding: 30px; text-align: center; color: #999; font-size: 13px; }
.email-list-empty span { font-size: 11px; display: block; margin-top: 6px; }
.email-list-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}
.email-list-item.active { background: var(--accent-soft); border-left: 3px solid var(--accent); }
.email-list-item-top { display: flex; justify-content: space-between; font-size: 12px; }
.email-unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
}
.email-star, .email-todo { cursor: pointer; margin-right: 4px; }
.email-todo { color: #ddd; }
.email-todo.marked { color: #f0ad4e; }
.email-date { color: #999; font-size: 10px; }
.email-list-subject { font-size: 13px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-list-subject.unread { font-weight: 600; }
.email-list-preview { font-size: 11px; color: #888; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.email-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 14px;
}
.email-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.email-header { padding: 12px 16px; border-bottom: 1px solid #eee; }
.email-detail-subject { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.email-star-inline { cursor: pointer; margin-right: 6px; }
.email-detail-meta { font-size: 12px; color: #666; }
.email-actions {
  padding: 6px 12px;
  border-bottom: 1px solid #eee;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.email-actions button {
  border: none;
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 11px;
  background: #e8e8e8;
}
.email-actions button:first-child { background: var(--accent); color: #fff; }
.email-ai-btn { background: #fef9e7 !important; border: 1px solid #f0c674 !important; }
.email-actions .marked { background: #fff3cd !important; }
.email-del-btn { background: #fa5151 !important; color: #fff !important; margin-left: auto; }
.email-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.email-ai-draft {
  flex-shrink: 0;
  border-top: 2px solid #f0c674;
  background: #fef9e7;
  padding: 10px 16px;
  max-height: 40vh;
  overflow-y: auto;
}
.email-ai-draft-title { font-size: 11px; color: #b7950b; font-weight: 600; margin-bottom: 4px; }
.email-draft-text { font-size: 13px; line-height: 1.6; white-space: pre-wrap; max-height: 200px; overflow-y: auto; }
.email-ai-draft-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.email-ai-draft-actions button {
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 12px;
  background: #e8e8e8;
}
.email-ai-draft-actions button:first-child { background: var(--accent); color: #fff; }
.email-compose {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  gap: 6px;
  overflow-y: auto;
}
.email-compose label { font-size: 12px; color: #666; }
.email-compose input, .email-compose select, .email-compose textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
}
.email-compose textarea { flex: 1; min-height: 120px; resize: none; }
.email-compose-title { font-weight: 600; font-size: 15px; }
.email-compose-ai { display: flex; gap: 4px; }
.email-compose-ai button { background: var(--accent); color: #fff; border: none; border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.email-compose-actions { display: flex; gap: 8px; margin-top: 10px; }
.email-send-btn { background: #07c160 !important; color: #fff !important; border: none; border-radius: 6px; padding: 8px 20px; cursor: pointer; }
.email-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.email-settings-modal {
  background: #fff;
  border-radius: 12px;
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}
.email-settings-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.email-settings-head h3 { margin: 0; font-size: 16px; }
.email-settings-close { border: none; background: none; font-size: 20px; cursor: pointer; color: #999; }
.email-settings-label { font-size: 12px; color: #666; margin-bottom: 8px; font-weight: 600; }
.email-settings-empty { text-align: center; padding: 24px; color: #bbb; font-size: 13px; }
.email-acc-card { padding: 12px 14px; border: 1px solid #eee; border-radius: 8px; margin-bottom: 10px; }
.email-acc-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.email-acc-meta { font-size: 12px; color: #666; line-height: 1.5; }
.email-acc-on { color: #07c160; }
.email-acc-off { color: #999; }
.email-acc-error { font-size: 11px; color: #fa5151; margin-top: 4px; }
.email-acc-hint { font-size: 11px; color: #e67e22; margin-top: 4px; background: #fff8f0; padding: 6px 8px; border-radius: 4px; }
.email-acc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #eee; }
.email-acc-actions button { padding: 5px 12px; border-radius: 4px; cursor: pointer; font-size: 11px; background: #fff; border: 1px solid #ddd; }
.email-scope-save-btn { margin-left: auto !important; }
.email-prov-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.email-prov-btn { padding: 7px 10px; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; font-size: 11px; background: #fff; text-align: center; }
.email-prov-btn span { font-size: 9px; color: #999; }
.email-new-form { margin-top: 14px; padding: 16px; background: #f8f9fb; border-radius: 8px; border: 1px solid #e8e8e8; display: grid; gap: 8px; }
.email-form-title { font-weight: 600; font-size: 14px; }
.email-form-note { font-size: 11px; color: #b7950b; background: #fef9e7; padding: 8px 10px; border-radius: 4px; }
.email-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.email-form-actions .email-save-btn { flex: 1; background: var(--accent); color: #fff; border: none; border-radius: 6px; padding: 9px; cursor: pointer; }
.email-scope-block { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e8e8e8; }
.email-scope-hint { font-size: 11px; color: #999; margin-bottom: 6px; }
.email-scope-radios { display: flex; flex-wrap: wrap; gap: 6px; }
.email-scope-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fafafa;
  cursor: pointer;
}
.email-scope-radio.active { border-color: var(--accent); background: var(--accent-soft); }
.email-scope-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #666; cursor: pointer; }

@media (max-width: 900px) {
  .email-workspace { flex-direction: column; height: auto; min-height: calc(100vh - 80px); }
  .email-sidebar { width: 100%; min-width: 0; max-height: 45vh; }
}

/* 销售报价 / 订单 / 报销 */
.quote-summary {
  margin: 12px 0;
  padding: 12px 14px;
  background: var(--accent-soft, #f0f4ff);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.sf-bom-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.sf-bom-table th, .sf-bom-table td { padding: 6px 8px; border-bottom: 1px solid var(--line, #eee); text-align: left; }
.sf-other-fee-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.sf-other-fee-row button { border: none; background: transparent; color: var(--danger, #e74c3c); cursor: pointer; font-size: 16px; }
.order-detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; margin: 12px 0; font-size: 13px; }
.order-detail-grid .detail-field b { display: block; font-size: 11px; color: var(--muted, #888); margin-bottom: 2px; }
.item-table-header, .item-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; padding: 6px 0; font-size: 12px; border-bottom: 1px solid var(--line, #eee); }
.item-table-header { font-weight: 600; color: var(--muted, #888); }
.btn-sm { padding: 4px 10px; border-radius: 4px; border: 1px solid var(--line, #ddd); font-size: 11px; cursor: pointer; background: #fff; }
.system-notice {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  padding: 10px 16px; border-radius: 8px; background: #1a7f37; color: #fff; font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.system-notice.error { background: #b42318; }

/* V1 销售订单列表 */
.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, #eee);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.so-list-row:hover { background: var(--accent-soft, #f0f4ff); }
.so-list-head {
  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;
  padding: 8px 10px;
  background: var(--surface-soft, #f8fafc);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #888);
  position: sticky;
  top: 0;
  z-index: 1;
}
.so-col { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.so-col small { font-size: 10px; color: var(--muted); word-break: break-all; }
.so-col-meta { align-items: flex-end; text-align: right; }
.so-col-attach { align-items: center; justify-content: center; }
.order-list-wrap { border-bottom: 1px solid var(--line, #eee); }
.order-list-wrap.expanded { background: #f8fafc; }
.order-expand-panel { padding: 0 10px 12px; background: #f8fafc; }
.order-items-brief { font-size: 11px; color: var(--muted); }
.order-chevron { font-size: 10px; color: var(--muted); }
.so-inline-items { display: grid; gap: 3px; }
.so-inline-item {
  display: grid;
  grid-template-columns: 1fr 0.8fr 72px auto auto auto;
  gap: 6px;
  font-size: 11px;
  align-items: center;
}
.so-inline-part { font-weight: 600; }
.so-inline-model { color: var(--muted); font-size: 10px; }
.order-line-card {
  border: 1px solid var(--line, #eee);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
}
.order-line-head { margin-bottom: 6px; }
.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: 10px;
  margin: 8px 0;
}
.line-stage-track .stage-dot { font-size: 11px; }
.line-stage-track .stage-line { width: 12px; height: 1px; background: var(--line); }
.line-row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.order-act-btn {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
}
.order-act-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.io-expand-panel { margin-top: 10px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.io-qty-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.io-qty-table th, .io-qty-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.io-qty-table .io-num { text-align: right; }
.io-modal-actions { margin-top: 10px; display: flex; gap: 8px; }
.wh-io-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.wh-io-tab { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); cursor: pointer; font: inherit; }
.wh-io-tab.active { border-color: var(--accent); background: #eef7f5; font-weight: 600; }
.wh-stat-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.wh-fifo-banner { padding: 10px 12px; border-radius: 8px; margin-top: 6px; font-size: 12px; line-height: 1.5; }
.wh-fifo-warn { background: #fff8e6; border: 1px solid #f0c040; color: #7a5b00; }
.wh-fifo-ok { background: #ecfdf3; border: 1px solid #86efac; color: #166534; }
.wh-fifo-info { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }
.wh-fifo-error { background: #fff5f5; border: 1px solid #fca5a5; color: #b42318; }
.wh-fifo-list { margin: 6px 0 0 18px; padding: 0; }
.wh-shelf-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.wh-shelf-row input { flex: 1; min-width: 0; }
.wh-stat-card { flex: 1 1 140px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); cursor: pointer; text-align: left; font: inherit; }
.wh-stat-card.active, .wh-stat-card:hover { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(26, 107, 92, 0.1); }
.wh-stat-num { font-size: 22px; font-weight: 700; }
.wh-stat-lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }
.io-slip-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; font-size: 13px; }
.trace-code-box { font-family: monospace; background: #f5f5f5; padding: 8px 12px; border-radius: 6px; word-break: break-all; }
.so-form-table-wrap { overflow-x: auto; }
.so-form-table { width: 100%; min-width: 900px; font-size: 12px; border-collapse: collapse; }
.so-form-table th, .so-form-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.so-form-table thead tr { background: #f0f4f8; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.order-sort, .search-go-btn { font-size: 12px; padding: 6px 10px; border-radius: 4px; border: 1px solid var(--line); }

/* 报销 V1 */
.reimburse-form-panel {
  margin: 0 0 12px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.reimburse-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.reimburse-form-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.reimburse-form-panel input, .reimburse-form-panel select, .reimburse-form-panel textarea {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
}
.reimburse-attach-btn {
  padding: 6px 12px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
#reimburseAttachPreview { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.reimburse-att-preview-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  max-width: 100%;
}
.reimburse-att-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.reimburse-att-rm {
  border: none;
  background: transparent;
  color: var(--danger, #c00);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
}
.reimburse-att-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-right: 8px;
  font-size: 10px;
  text-decoration: none;
  color: inherit;
}
.reimburse-list-row { align-items: flex-start; }
.reimb-act-btn { margin-left: 4px; }

/* 采购订单 V1 展开明细 */
.order-detail-table.item-table-header,
.order-detail-table.item-row { display: grid; grid-template-columns: 1.2fr 0.9fr 72px 64px 72px 80px; gap: 6px; padding: 6px 8px; font-size: 12px; }
.order-detail-table.item-table-header { background: #f0f4f8; font-weight: 700; color: var(--muted); }
.order-detail-table.item-row { border-bottom: 1px solid var(--line); }
.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.danger { border-color: #e74c3c; color: #e74c3c; }
.po-list-head { margin-top: 0; }

/* 财务模块 */
.fin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.fin-kpi-grid--compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.fin-kpi {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.fin-kpi-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.fin-kpi-value { font-size: 22px; font-weight: 800; line-height: 1.2; }
.fin-kpi-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.fin-kpi.tone-ar .fin-kpi-value { color: #12645a; }
.fin-kpi.tone-ap .fin-kpi-value { color: #a15c11; }
.fin-kpi.tone-fund .fin-kpi-value { color: #1d4ed8; }
.fin-kpi.tone-in .fin-kpi-value { color: var(--ok); }
.fin-kpi.tone-out .fin-kpi-value { color: var(--danger); }
.fin-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.fin-quick-btn {
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 14px;
  text-align: center;
}
.fin-quick-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.fin-inline-form {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.fin-inline-form h4 { margin: 0 0 12px; font-size: 14px; }
.fin-form-wrap.hidden { display: none; }
.seg-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-tab {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
}
.seg-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }
