:root {
  /* 表面与背景 */
  --bg: #eef2f9;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(37, 99, 235, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(15, 118, 110, 0.05), transparent 55%);
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-sunken: #f1f5fa;

  /* 描边 */
  --line: #e3e9f2;
  --line-strong: #cbd5e4;

  /* 文本 */
  --text: #131b2e;
  --text-soft: #3a455c;
  --muted: #707d92;
  --muted-soft: #97a2b5;

  /* 主色阶 */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1ff;
  --primary-softer: #f4f8ff;
  --primary-ring: rgba(37, 99, 235, 0.32);

  /* 语义色（前景 / 背景 / 描边 三件套） */
  --teal: #0f766e;
  --teal-bg: #d6f3ee;
  --green: #15803d;
  --green-bg: #dcfce7;
  --green-line: #a7e9bf;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --amber-line: #f6d27a;
  --red: #c0241c;
  --red-bg: #fdecea;
  --red-line: #f6b6b1;

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* 阴影层级 */
  --shadow-xs: 0 1px 2px rgba(19, 27, 46, 0.05);
  --shadow-sm: 0 2px 8px rgba(19, 27, 46, 0.06);
  --shadow: 0 10px 30px rgba(19, 27, 46, 0.08);
  --shadow-lg: 0 20px 48px rgba(19, 27, 46, 0.14);
  --shadow-primary: 0 8px 20px rgba(37, 99, 235, 0.26);

  /* 过渡 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 130ms var(--ease);
  --t-mid: 220ms var(--ease);
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--primary-ring);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 统一滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: var(--r-pill);
  background-clip: padding-box;
  background-color: var(--line-strong);
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted-soft);
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 76px;
  padding: 12px 26px;
  background: linear-gradient(120deg, #0f1729 0%, #16213b 55%, #122031 100%);
  color: #f8fafc;
  box-shadow: 0 6px 22px rgba(9, 14, 27, 0.28);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--r-md);
  background: linear-gradient(145deg, #2f6df3, #0f766e);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 6px 16px rgba(15, 70, 160, 0.4);
  transition: transform var(--t-mid);
}

.brand-block:hover .brand-mark {
  transform: translateY(-1px) rotate(-3deg);
}

.brand-icon {
  width: 38px;
  height: 38px;
  display: block;
}

.icon-sheet {
  fill: rgba(255, 255, 255, 0.96);
}

.icon-fold {
  fill: none;
  stroke: #93c5fd;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-nut {
  fill: #facc15;
  stroke: #172033;
  stroke-width: 1.25;
  stroke-linejoin: round;
}

.icon-hole {
  fill: #172033;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-subtitle {
  margin-top: 3px;
  color: #9fb0cb;
  font-size: 13px;
  line-height: 1.35;
}

.nav-list {
  display: none;
}

/* 采购员工作台同时承载核价、标准号查询和调价申请，必须显示模块导航。 */
.purchaser-workspace .sidebar {
  flex-wrap: wrap;
}

.purchaser-workspace .nav-list {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.purchaser-workspace .nav-item {
  width: auto;
  min-height: 40px;
  padding: 0 14px;
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .purchaser-workspace .sidebar {
    gap: 12px;
  }

  .purchaser-workspace .nav-list {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-top: 2px;
  }
}

@media (max-width: 720px) {
  .purchaser-workspace .sidebar {
    padding: 10px 14px;
  }

  .purchaser-workspace .brand-subtitle,
  .purchaser-workspace .note-label {
    display: none;
  }

  .purchaser-workspace .side-note {
    gap: 6px;
    padding: 6px;
  }

  .purchaser-workspace .side-note strong {
    max-width: 34vw;
  }
}

.nav-item {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.side-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-md);
  color: #c3cfe2;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
  font-size: 12px;
  line-height: 1.5;
}

.side-note strong {
  display: block;
  max-width: min(360px, 32vw);
  overflow: hidden;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, #2f6df3, #0f766e);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-note > .ghost-button,
.admin-header-actions > .ghost-button {
  flex: 0 0 auto;
  align-self: center;
  height: 38px;
  margin: 0;
}

.note-label,
.section-label {
  color: var(--muted);
  font-size: 12px;
}

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

.view {
  display: none;
  min-width: 0;
}

.view.active {
  display: grid;
  gap: 16px;
  animation: viewIn 360ms var(--ease);
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.page-header > * {
  min-width: 0;
}

.page-header.compact {
  max-width: 1080px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.22;
  letter-spacing: -0.3px;
  font-weight: 800;
}

h2 {
  font-size: 16px;
  letter-spacing: -0.1px;
}

h3 {
  font-size: 15px;
}

.page-header p,
.panel-toolbar p,
.admin-panel p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.sales-pricing-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 12px;
}

.sales-pricing-input .tiny-input { width: 86px; }
.sales-pricing-hint { margin: 0; padding: 0 18px 12px; color: #64748b; font-size: 12px; line-height: 1.6; }

.header-actions,
.toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.file-button,
.primary-button,
.secondary-button,
.ghost-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    box-shadow var(--t-fast),
    transform var(--t-fast);
}

.file-button:active,
.primary-button:active,
.secondary-button:active,
.ghost-button:active {
  transform: translateY(1px);
}

.file-button input {
  display: none;
}

.file-button,
.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, #2f74f5, var(--primary));
  box-shadow: var(--shadow-primary);
}

.file-button:hover,
.primary-button:hover {
  background: linear-gradient(135deg, #2f74f5, var(--primary-dark));
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.34);
  transform: translateY(-1px);
}

.file-button.secondary,
.secondary-button {
  color: var(--primary-dark);
  border-color: #c5dafe;
  background: var(--primary-soft);
  box-shadow: var(--shadow-xs);
}

.file-button.secondary:hover,
.secondary-button:hover {
  border-color: var(--primary);
  background: #e0ebff;
}

.import-action-tooltip::before,
.import-action-tooltip::after {
  position: absolute;
  left: 12px;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.import-action-tooltip::before {
  content: "";
  top: calc(100% + 4px);
  border: 6px solid transparent;
  border-bottom-color: #172033;
  transform: translateY(-4px);
}

.import-action-tooltip::after {
  content: attr(data-tooltip);
  top: calc(100% + 16px);
  width: 330px;
  max-width: calc(100vw - 48px);
  padding: 10px 12px;
  border-radius: 8px;
  color: #fff;
  background: #172033;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  transform: translateY(-4px);
}

.import-action-tooltip:hover::before,
.import-action-tooltip:hover::after,
.import-action-tooltip:focus-visible::before,
.import-action-tooltip:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ghost-button {
  color: var(--text-soft);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.ghost-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
  transform: none;
}

button:disabled:hover {
  transform: none;
}

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

.metric-block {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition:
    transform var(--t-mid),
    box-shadow var(--t-mid);
}

.metric-block::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--line-strong);
  transition: background var(--t-mid);
}

.metric-block:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.metric-block.success::before {
  background: linear-gradient(var(--teal), var(--green));
}

.metric-block.warning::before {
  background: linear-gradient(#f59e0b, var(--amber));
}

.metric-block.primary::before {
  background: linear-gradient(#2f74f5, var(--primary));
}

.metric-block span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.metric-block strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.metric-block.success strong {
  color: var(--teal);
}

.metric-block.warning strong {
  color: var(--amber);
}

/* 匹配率环形进度 */
.metric-rate {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rate-ring {
  --rate: 0;
  position: relative;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background:
    conic-gradient(var(--primary) calc(var(--rate) * 1%), var(--surface-sunken) 0);
  transition: background 600ms var(--ease);
}

.rate-ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--surface);
}

.rate-ring strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-size: 14px;
  z-index: 1;
  color: var(--primary-dark);
}

.metric-rate .rate-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.metric-rate .rate-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted-soft);
  font-size: 11px;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.sheet-panel,
.review-panel,
.admin-panel,
.import-history {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.sheet-panel {
  min-width: 0;
  overflow: hidden;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--surface), var(--surface-soft));
}

.table-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 560px;
  max-height: calc(100vh - 280px);
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.excel-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}

.excel-table th,
.excel-table td {
  height: 36px;
  padding: 6px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #ffffff;
  font-variant-numeric: tabular-nums;
}

.excel-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--text-soft);
  background: linear-gradient(#eef3fa, #e6edf6);
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: inset 0 -1px 0 var(--line-strong);
}

.excel-table .output-group-row th {
  top: 0;
  height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  text-align: center;
}

.excel-table .output-subheader-row th {
  top: 30px;
  height: 34px;
  text-align: center;
}

.excel-table .input-header-cell[rowspan="2"] {
  top: 0;
  height: 64px;
  vertical-align: middle;
}

.excel-table .price-group-header {
  z-index: 4;
  color: #0f172a;
  border-top: 3px solid currentColor;
  font-size: 12px;
  letter-spacing: 1px;
}

.excel-table .price-group-subheader {
  z-index: 3;
  color: #0f172a;
  font-size: 12px;
}

.excel-table .price-group-tone-0 { background: #f6d385; border-color: #d97706; }
.excel-table .price-group-tone-1 { background: #b8dfbb; border-color: #16a34a; }
.excel-table .price-group-tone-2 { background: #98d4e8; border-color: #0891b2; }
.excel-table .price-group-tone-3 { background: #c5b5ed; border-color: #7c3aed; }
.excel-table .price-group-tone-4 { background: #ecb5d2; border-color: #db2777; }

.excel-table th.field-totalWeight { background: #fff72d; color: #111827; }
.excel-table th.field-assignedPurchaser { background: #ef4444; color: #111827; }

.excel-table tbody tr {
  transition: background var(--t-fast);
}

.excel-table tbody tr:hover td {
  background: var(--primary-softer);
}

.excel-table .row-number {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 46px;
  max-width: 46px;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: right;
  font-weight: 600;
}

.excel-table th.row-number {
  z-index: 3;
}

.excel-table td.editable-cell {
  position: relative;
  outline: 2px solid transparent;
  background: #fffdf3;
  cursor: text;
  transition:
    background var(--t-fast),
    box-shadow var(--t-fast);
}

.excel-table td.editable-cell::after {
  content: "✎";
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  color: #d4a017;
  opacity: 0;
  transition: opacity var(--t-fast);
}

.excel-table td.editable-cell:hover {
  background: #fff8df;
}

.excel-table td.editable-cell:hover::after {
  opacity: 0.7;
}

.excel-table td.editable-cell:focus {
  outline-color: #f59e0b;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #f59e0b;
}

.excel-table td.editable-cell:focus::after {
  opacity: 0;
}

.excel-table tr.needs-review td {
  color: #842020;
  background: #fdeeec;
}

.excel-table tr.needs-review:hover td {
  background: #fce3df;
}

.excel-table tr.needs-review td.problem-cell {
  border-color: var(--red-line);
  box-shadow: inset 0 0 0 1px #ef4444;
  background: #fbdbd6;
  font-weight: 700;
}

.excel-table tr.audit-warning-row td,
.excel-table td.warning-cell {
  background: #fffaeb;
}

.excel-table td.warning-cell {
  border-color: var(--amber-line);
  box-shadow: inset 0 0 0 1px #f59e0b;
}

.excel-table td.mismatch-cell {
  color: #991b1b;
  background: #fee2e2;
  border-color: var(--red-line);
  box-shadow: inset 0 0 0 1px #ef4444;
  font-weight: 700;
}

.excel-table tbody tr:hover td.mismatch-cell {
  background: #fecaca;
}

.excel-table tr.resolved-review td {
  background: #f0fbf3;
}

.excel-table tr.resolved-review td.resolved-cell {
  color: var(--green);
  background: #d8f4e1;
  font-weight: 700;
}

.excel-table tr.focus-row td {
  animation: rowFlash 1.3s ease;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: 420px;
  padding: 32px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  color: var(--text);
  font-size: 17px;
}

.empty-state p {
  max-width: 420px;
}
.upload-drop-hint { color:var(--primary, #2563eb); font-size:13px; }
#tableWrap.is-file-dragging .empty-state { background:#eff6ff; outline:2px dashed #3b82f6; outline-offset:-8px; }

.empty-illustration {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, var(--primary-soft), var(--surface-sunken));
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--line);
}

.empty-illustration svg {
  width: 38px;
  height: 38px;
}

.empty-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

/* 加载遮罩 */
.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(247, 249, 252, 0.78);
  backdrop-filter: blur(3px);
  color: var(--text-soft);
}

.loading-overlay.show {
  display: flex;
  animation: viewIn 200ms var(--ease);
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-overlay .loading-text {
  font-size: 14px;
  font-weight: 600;
}

.loading-overlay .loading-sub {
  font-size: 12px;
  color: var(--muted);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 骨架屏 */
.skeleton-table {
  display: grid;
  gap: 9px;
  padding: 18px;
}

.skeleton-row {
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-sunken) 25%, #e9eef6 37%, var(--surface-sunken) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

.skeleton-row.head {
  height: 34px;
  background: linear-gradient(90deg, #e4ebf5 25%, #dde6f2 37%, #e4ebf5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.review-panel {
  order: -1;
  display: grid;
  grid-template-columns: 92px minmax(170px, 1fr) 120px minmax(260px, 1.4fr) minmax(280px, auto);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
}

.review-panel .quote-field-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.review-panel .issue-section {
  grid-column: 1 / -1;
  min-width: 0;
}

.review-section {
  display: grid;
  gap: 6px;
  padding-top: 0;
  border-top: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  color: var(--green);
  background: var(--green-bg);
  font-size: 12px;
  font-weight: 700;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}

.status-pill.muted {
  color: var(--muted);
  background: var(--surface-sunken);
}

.issue-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 10px;
  max-height: min(38vh, 420px);
  overflow: auto;
  padding-right: 2px;
}

.issue-list-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--muted);
  background: var(--surface-sunken);
  font-size: 12px;
}

.issue-notice {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border: 1px solid #fde68a;
  border-left: 3px solid #f59e0b;
  border-radius: var(--r-sm);
  color: #8a4b0f;
  background: #fffbeb;
  font-size: 12px;
  line-height: 1.6;
}

.issue-toggle {
  flex: 0 0 auto;
  border: 0;
  padding: 0;
  color: var(--primary);
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.issue-item {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--red-line);
  border-left: 3px solid #ef4444;
  border-radius: var(--r-sm);
  background: var(--red-bg);
  color: #842020;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  transition:
    transform var(--t-fast),
    box-shadow var(--t-fast);
}

.issue-item:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}

.issue-item strong {
  color: var(--red);
}

.issue-item-body {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.issue-item-body span {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.material-option-box {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #fecaca;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.72);
  overflow-x: auto;
}

.material-option-title {
  margin-bottom: 6px;
  color: #7f1d1d;
  font-weight: 700;
}

.material-option-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 12px;
}

.material-option-table th,
.material-option-table td {
  padding: 5px 7px;
  border-bottom: 1px solid #fee2e2;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.material-option-table th {
  color: #7f1d1d;
  background: #fff7ed;
  font-weight: 700;
}

.audit-summary {
  padding: 9px 11px;
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.55;
}

.audit-ok {
  color: var(--teal);
  background: var(--teal-bg);
}

.audit-warning {
  color: var(--amber);
  background: var(--amber-bg);
}

.audit-error {
  color: var(--red);
  background: var(--red-bg);
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.field-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  min-width: 0;
}

.field-tags span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid #d3e2fe;
  font-size: 12px;
  font-weight: 600;
}

col.row-number {
  width: 42px;
}

col.field-standard,
col.field-productType {
  width: 190px;
}

col.field-size,
col.field-finish,
col.field-material,
col.field-grade,
col.field-unit {
  width: 96px;
}

col.field-quantity,
col.field-taxTonPrice,
col.field-thousandWeight,
col.field-thousandPrice,
col.field-matchStatus {
  width: 106px;
}

col.field-matchIssue {
  width: 130px;
}

@keyframes rowFlash {
  0% {
    box-shadow: inset 0 0 0 9999px rgba(37, 99, 235, 0.2);
  }
  100% {
    box-shadow: inset 0 0 0 9999px transparent;
  }
}

.admin-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
  max-width: 1080px;
}

.admin-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

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

.admin-title span {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  color: var(--text-soft);
  background: var(--surface-sunken);
  font-size: 12px;
  font-weight: 600;
}

.import-history {
  max-width: 1080px;
}

.history-list {
  display: grid;
  gap: 0;
}

.history-row,
.empty-inline {
  display: grid;
  grid-template-columns: 120px 1fr 90px 170px;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  align-items: center;
  font-size: 13px;
}

.history-row:first-child {
  border-top: 0;
}

.empty-inline {
  display: block;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 220px;
  max-width: 380px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  color: #ffffff;
  background: linear-gradient(135deg, #1b2536, #0f1729);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  transform: translateY(18px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--t-mid),
    opacity var(--t-mid);
}

.toast::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.28);
}

.toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.notice-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(3px);
}

.notice-dialog-backdrop[hidden] {
  display: none;
}

.notice-dialog {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  padding: 30px 28px 24px;
  border: 1px solid #cbdaf2;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
  text-align: center;
}

.notice-dialog h2 {
  margin: 12px 0 8px;
  font-size: 20px;
  color: var(--ink);
}

.notice-dialog p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.65;
}

.notice-dialog-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #9a6700;
  background: #fff3c4;
  font-size: 24px;
  font-weight: 800;
}

.notice-dialog-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.notice-dialog-close:hover {
  color: var(--ink);
  background: #eef3fb;
}

[data-fill-down-field] {
  cursor: context-menu;
}

[data-fill-down-field]:hover {
  box-shadow: inset 0 0 0 1px #9dbcf5;
  background: #f4f8ff;
}

.fill-down-context-menu,
.fill-down-range-panel {
  position: fixed;
  z-index: 110;
  border: 1px solid #cbd8ea;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
}

.fill-down-context-menu[hidden],
.fill-down-range-panel[hidden] {
  display: none;
}

.fill-down-context-menu {
  width: min(248px, calc(100vw - 24px));
  padding: 6px;
}

.fill-down-context-menu button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.fill-down-context-menu button:hover,
.fill-down-context-menu button:focus-visible {
  background: var(--primary-soft);
}

.fill-down-context-menu strong {
  font-size: 14px;
}

.fill-down-context-menu small {
  color: var(--muted);
  font-size: 12px;
}

.fill-down-range-panel {
  width: min(340px, calc(100vw - 24px));
  padding: 16px;
}

.fill-down-range-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.fill-down-range-heading span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
}

.fill-down-range-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.fill-down-close {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
  line-height: 1;
}

.fill-down-close:hover {
  color: var(--ink);
  background: var(--surface-sunken);
}

.fill-down-summary {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 8px;
  margin: 14px 0;
}

.fill-down-summary > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-sunken);
}

.fill-down-summary dt {
  color: var(--muted);
  font-size: 11px;
}

.fill-down-summary dd {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fill-down-end-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  font-size: 13px;
}

.fill-down-end-label input {
  width: 92px;
  min-height: 36px;
  text-align: center;
}

.fill-down-range-panel .field-hint {
  min-height: 20px;
  margin: 8px 0 13px;
}

.fill-down-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.fill-down-actions button {
  min-height: 36px;
}

.admin-page {
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
}

.admin-shell {
  display: grid;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 24px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(15, 118, 110, 0.05)),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.admin-header .ghost-button {
  flex: 0 0 auto;
}

.admin-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.admin-mark {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: var(--r-md);
  background: linear-gradient(145deg, #2f6df3, #0f766e);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 18px rgba(15, 70, 160, 0.34);
}

.admin-mark .brand-icon {
  width: 30px;
  height: 30px;
}

.admin-header p,
.config-panel p,
.config-panel li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  background: #ffffff;
  text-decoration: none;
}

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

body.admin-page[data-role="boss"] .tab-panel[data-tab="rules"] .config-grid {
  grid-template-columns: minmax(560px, 1fr) minmax(320px, 380px);
  grid-template-areas:
    "source dictionary"
    "source customer"
    "finish finish"
    "package package";
}

.config-grid .config-panel {
  overflow: hidden;
}

.config-grid .database-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  contain: paint;
}

.config-grid .database-table {
  width: 100% !important;
  min-width: 100% !important;
}

body.admin-page[data-role="boss"] .tab-panel[data-tab="rules"] .config-grid #sourceOriginMappingForm {
  grid-area: source;
}

body.admin-page[data-role="boss"] .tab-panel[data-tab="rules"] .config-grid #customerDictionaryForm {
  grid-area: customer;
}

body.admin-page[data-role="boss"] .tab-panel[data-tab="rules"] .config-grid #dictionaryForm {
  grid-area: dictionary;
  align-self: start;
}

.washer-type-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  align-items: stretch;
  margin-bottom: 12px;
}

.washer-type-toolbar input,
.washer-type-toolbar select {
  width: 100%;
  min-width: 0;
  height: 42px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #c8d6e8;
  border-radius: 8px;
  background: #fff;
  color: #243b57;
  font: inherit;
}

.washer-type-toolbar input:focus,
.washer-type-toolbar select:focus {
  border-color: #6c9bea;
  outline: 2px solid rgba(37, 99, 235, 0.1);
  outline-offset: 0;
}

.washer-type-toolbar > button,
.washer-type-toolbar > .file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 0;
  white-space: nowrap;
}

.washer-factory-detail-host {
  min-width: 0;
}

.washer-selected-factory {
  min-width: 0;
  border: 1px solid #d6e2f0;
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}

.washer-selected-factory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px 10px 16px;
  border-bottom: 1px solid #dbe6f2;
  background: #edf5ff;
}

.washer-selected-factory-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.washer-selected-factory-header strong {
  overflow: hidden;
  color: #173354;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.washer-selected-factory-header span:not(.washer-configured-badge) {
  color: #6b7d93;
  font-size: 12px;
  line-height: 1.3;
}

.washer-configured-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #66758a;
  font-size: 12px;
  font-weight: 650;
  background: #2563eb;
  color: #fff;
}

.washer-type-table-wrap {
  max-height: 520px;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.washer-type-table {
  table-layout: auto;
}

.washer-type-table input,
.washer-type-table select {
  width: 100%;
  min-width: 0;
}

/* Keep controls inside resizable columns, including previously saved narrow widths. */
.washer-value-fit-table input {
  box-sizing: border-box;
  width: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  field-sizing: fixed;
}

.washer-type-table th,
.washer-type-table td {
  padding-right: 7px;
  padding-left: 7px;
}

.washer-type-table th:first-child,
.washer-type-table td:first-child {
  min-width: 260px;
}

.washer-type-table th:nth-child(5),
.washer-type-table td:nth-child(5) {
  min-width: 120px;
}

.washer-type-table tr.washer-price-unconfigured > td {
  background: #fbfcfe;
}

.washer-type-table tr.washer-price-unconfigured > td:first-child {
  box-shadow: inset 3px 0 #cbd5e1;
}

.washer-factory-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 150px;
  padding: 28px 16px;
  border: 1px dashed #cbd8e8;
  border-radius: 9px;
  color: #738297;
  text-align: center;
}

.washer-factory-empty strong {
  color: #314a68;
  font-size: 15px;
}

.washer-factory-empty span {
  font-size: 13px;
}

.unassigned-standard-row td {
  background: #fff8e7;
}

.unassigned-standard-row textarea {
  display: block;
  width: 100%;
  min-width: 280px;
  resize: vertical;
  border: 1px solid #e7c878;
  border-radius: 7px;
  padding: 8px 10px;
  color: #795300;
  background: #fffdf5;
}

#sourceOriginMappingForm .database-table {
  min-width: 0;
  table-layout: fixed;
}

#sourceOriginMappingForm .database-table th:first-child,
#sourceOriginMappingForm .database-table td:first-child {
  width: auto;
  min-width: 0;
  text-align: left;
}

#sourceOriginMappingForm .database-table th:nth-child(2),
#sourceOriginMappingForm .database-table td:nth-child(2) {
  width: 190px;
}

#sourceOriginMappingForm .database-table th:nth-child(3),
#sourceOriginMappingForm .database-table td:nth-child(3) {
  width: 150px;
}

#sourceOriginMappingForm .database-table th:nth-child(4),
#sourceOriginMappingForm .database-table td:nth-child(4) {
  width: 72px;
  text-align: center;
}

#sourceOriginMappingForm .database-table th:last-child,
#sourceOriginMappingForm .database-table td:last-child:not([colspan]) {
  position: static;
  right: auto;
  min-width: 0;
  text-align: left;
  box-shadow: none;
}

#sourceOriginMappingForm .source-map-input {
  min-width: 0;
  width: 100%;
}

#sourceOriginMappingForm .source-map-input[data-f="code"] {
  max-width: 170px;
}

#sourceOriginMappingForm .source-map-input[data-f="category"] {
  max-width: 130px;
}

.sub-config-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
}

.compact-title h3 {
  margin: 0;
  font-size: 16px;
}

#sourceOriginMappingForm .standard-purchaser-block .database-table th:first-child,
#sourceOriginMappingForm .standard-purchaser-block .database-table td:first-child {
  width: 55%;
}

#sourceOriginMappingForm .standard-purchaser-block .database-table th:nth-child(2),
#sourceOriginMappingForm .standard-purchaser-block .database-table td:nth-child(2) {
  width: 220px;
}

#sourceOriginMappingForm .standard-purchaser-block .database-table th:nth-child(3),
#sourceOriginMappingForm .standard-purchaser-block .database-table td:nth-child(3) {
  width: 72px;
  text-align: center;
}

#sourceOriginMappingForm .standard-map-input,
#sourceOriginMappingForm .standard-purchaser-select,
#newStandardPurchaserUser {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0 11px;
  background: #fff;
}

#sourceOriginMappingForm .standard-map-input {
  max-width: none;
}

#sourceOriginMappingForm .standard-list-input {
  min-width: 280px;
}

#newStandardPurchaserUser {
  flex: 0 1 220px;
}

.source-origin-add-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.source-origin-add-row input {
  flex: 1 1 220px;
  min-height: 38px;
  max-width: 320px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0 11px;
}

.material-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.material-toolbar input,
.material-toolbar select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0 11px;
  background: #fff;
  color: var(--text);
}

/* 低于起订量是非阻断业务警示：从业务端到审批端始终整行标红。 */
.excel-table tr.moq-below-minimum td,
.workflow-table tr.moq-below-minimum td,
.purchase-review-table tr.moq-below-minimum td {
  color: #842020 !important;
  background: #fdeeec !important;
  border-color: #ef9a9a !important;
}

.excel-table tr.moq-below-minimum:hover td,
.workflow-table tr.moq-below-minimum:hover td,
.purchase-review-table tr.moq-below-minimum:hover td {
  background: #fce3df !important;
}

.excel-table tr.moq-below-minimum input,
.workflow-table tr.moq-below-minimum input,
.purchase-review-table tr.moq-below-minimum input {
  color: #842020 !important;
  background: #ffe7e4 !important;
  border-color: #ef4444 !important;
}

.material-toolbar input[type="search"] {
  flex: 1 1 220px;
  min-width: 180px;
}

.material-toolbar #newMaterialName,
.material-toolbar #newMaterialSourceOrigin {
  width: 180px;
}

.material-toolbar #newMaterialPrice {
  width: 140px;
}

.mat-name,
.mat-origin,
.mat-price {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 10px;
}

.mat-name,
.mat-origin {
  width: 160px;
}

.mat-price {
  width: 120px;
}

.config-panel {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.config-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.config-title span {
  padding: 5px 11px;
  border-radius: var(--r-pill);
  color: var(--green);
  background: var(--green-bg);
  font-size: 12px;
  font-weight: 700;
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

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

.config-panel label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.config-panel .switch-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.config-panel .switch-row input {
  width: auto;
}

.config-panel input,
.record-editor select,
.config-panel textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 10px 11px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-weight: 400;
  transition:
    border-color var(--t-fast),
    box-shadow var(--t-fast);
}

.config-panel input:focus,
.record-editor select:focus,
.config-panel textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.field-hint.empty {
  color: var(--amber);
}

.test-result {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  line-height: 1.5;
}

.test-result.error {
  border-color: #fecaca;
  color: var(--red);
  background: #fef2f2;
}

.config-panel textarea {
  resize: vertical;
}

.config-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.recommendation ul {
  margin: 0;
  padding-left: 18px;
}

.database-admin {
  max-width: none;
  min-width: 0;
}

.database-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-toolbar {
  padding-bottom: 2px;
}

.file-button.secondary.danger-outline {
  color: #b45309;
  border-color: #f5c77a;
  background: #fff8e8;
}

.file-button.secondary.danger-outline:hover {
  color: #92400e;
  border-color: #d97706;
  background: #ffefd0;
}

.database-import-help {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.database-import-help > div {
  display: grid;
  gap: 5px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  line-height: 1.65;
}

.database-import-help strong {
  color: var(--text);
  font-size: 13px;
}

.database-catalog {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #f8fafc;
}

.database-catalog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.database-catalog-heading h3,
.database-catalog-heading p {
  margin: 0;
}

.database-catalog-heading h3 {
  color: var(--text);
  font-size: 15px;
}

.database-catalog-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.catalog-all-button,
.catalog-standard,
.catalog-category-all,
.catalog-variant {
  appearance: none;
  border: 1px solid #cbd8ea;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.catalog-all-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 11px 0 13px;
  border-radius: var(--r-sm);
  font-weight: 700;
  white-space: nowrap;
}

.count-badge,
.catalog-all-button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.database-catalog-tree {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

.catalog-category {
  min-width: 0;
  border: 1px solid #d9e3f0;
  border-radius: 8px;
  background: var(--surface);
}

.catalog-category[open] {
  align-self: start;
  background: #fbfdff;
}

.catalog-category.active {
  border-color: #91b5ee;
  box-shadow: inset 0 0 0 1px #d4e5ff;
}

.catalog-category > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 8px 11px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.catalog-category > summary::-webkit-details-marker,
.catalog-standard-group > summary::-webkit-details-marker {
  display: none;
}

.catalog-category > summary::before,
.catalog-standard-group > summary::before {
  content: "▸";
  flex: 0 0 auto;
  color: #64748b;
  transition: transform var(--t-fast);
}

.catalog-category[open] > summary::before,
.catalog-standard-group[open] > summary::before {
  transform: rotate(90deg);
}

.catalog-category > summary span,
.catalog-standard-group > summary span {
  flex: 1 1 auto;
  min-width: 0;
}

.catalog-category > summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.catalog-standard-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  align-items: start;
  gap: 12px;
  padding: 0 11px 11px 30px;
}

.catalog-standard,
.catalog-category-all {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  align-self: start;
  box-sizing: border-box;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 116px;
  max-width: 100%;
  padding: 14px;
  border-radius: 10px;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.03),
    0 2px 6px rgba(16, 24, 40, 0.02);
  font-size: 13px;
  text-align: left;
}

.catalog-standard span,
.catalog-category-all span,
.catalog-standard-group > summary span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-overflow: ellipsis;
  white-space: normal;
}

.catalog-washer-subtype {
  align-items: flex-start;
  min-height: 68px;
}

.catalog-washer-subtype .catalog-variant-copy {
  gap: 3px;
}

.catalog-washer-subtype .catalog-variant-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-category-all {
  border-style: dashed;
  font-weight: 700;
}

.catalog-standard-group {
  position: relative;
  z-index: 1;
  align-self: start;
  box-sizing: border-box;
  min-width: 0;
  height: 116px;
  border: 1px solid #cbd8ea;
  border-radius: 10px;
  background: var(--surface);
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.03),
    0 2px 6px rgba(16, 24, 40, 0.02);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.catalog-standard-group[open] {
  z-index: 30;
}

.catalog-standard-group.active {
  border-color: var(--primary);
  background: var(--primary-softer);
  box-shadow: 0 0 0 2px rgba(91, 143, 249, 0.08);
}

.catalog-standard-group > summary {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  gap: 9px;
  width: 100%;
  height: 100%;
  min-height: 116px;
  padding: 14px;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
  text-align: left;
}

.catalog-standard-group > summary::before {
  content: "▸";
  flex: 0 0 auto;
  color: #64748b;
  transition: transform var(--t-fast);
}

.catalog-standard-group > summary strong {
  margin-left: auto;
}

.catalog-variant-list {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  box-sizing: border-box;
  width: max(100%, min(360px, calc(100vw - 32px)));
  min-width: 210px;
  max-width: calc(100vw - 32px);
  padding: 6px;
  border: 1px solid #dce5f0;
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
}

.catalog-standard-group:not([open]) > .catalog-variant-list {
  display: none;
}

.catalog-standard-group.popover-up > .catalog-variant-list {
  top: auto;
  bottom: calc(100% + 7px);
}

.catalog-standard-group.popover-align-right > .catalog-variant-list {
  right: 0;
  left: auto;
}

.catalog-variant {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 6px 9px;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  text-align: left;
}

.catalog-variant-all {
  border-style: solid;
}

.catalog-variant-copy {
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
}

.catalog-variant-copy b {
  overflow-wrap: anywhere;
  color: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.catalog-variant-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
}

.catalog-variant.active .catalog-variant-copy small {
  color: #4f74ae;
}

.catalog-all-button:hover,
.catalog-standard:hover,
.catalog-category-all:hover,
.catalog-standard-group > summary:hover {
  border-color: #7aa6eb;
  color: #174b9c;
  background: #f1f6ff;
}

.catalog-standard:hover,
.catalog-category-all:hover,
.catalog-standard-group:hover {
  box-shadow: 0 4px 12px rgba(40, 90, 180, 0.08);
  transform: translateY(-1px);
}

.catalog-variant:hover {
  border-color: transparent;
  color: #174b9c;
  background: #f5f8ff;
}

.catalog-all-button:focus-visible,
.catalog-standard:focus-visible,
.catalog-category-all:focus-visible,
.catalog-variant:focus-visible,
.catalog-category > summary:focus-visible,
.catalog-standard-group > summary:focus-visible {
  outline: 3px solid var(--primary-ring);
  outline-offset: 2px;
}

.catalog-all-button.active,
.catalog-standard.active,
.catalog-category-all.active,
.catalog-variant.active {
  border-color: var(--primary);
  background: var(--primary-softer);
  color: #174b9c;
}

.catalog-all-button.active strong,
.catalog-standard.active strong,
.catalog-category-all.active strong,
.catalog-variant.active strong,
.catalog-standard-group.active > summary strong {
  background: var(--primary);
  color: #fff;
}

.catalog-variant.active {
  border-color: transparent;
  background: #edf4ff;
  color: #2563eb;
  font-weight: 600;
}

.washer-type-table tr.washer-type-edit-target > td {
  background: #edf5ff;
  box-shadow: inset 0 0 0 1px #91b5ee;
}

.database-catalog-empty {
  margin: 0;
  padding: 8px 2px;
  color: var(--muted);
  font-size: 12px;
}

.danger-text {
  color: var(--red);
}

.database-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.database-metrics div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-soft);
  transition:
    transform var(--t-fast),
    box-shadow var(--t-fast);
}

.database-metrics div:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.database-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.database-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.database-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.price-table-wrap {
  max-width: 100%;
  position: relative;
}

.database-filters,
.database-actions,
.pagination-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.database-filters input,
.database-filters select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0 11px;
  color: var(--text);
  background: var(--surface);
  transition:
    border-color var(--t-fast),
    box-shadow var(--t-fast);
}

.database-filters input:focus,
.database-filters select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.database-filters input[type="search"] {
  flex: 1 1 260px;
  min-width: 220px;
}

.inline-check {
  display: inline-flex !important;
  align-items: center;
  gap: 7px !important;
  color: #334155 !important;
  font-size: 13px !important;
  font-weight: 700;
}

.inline-check input {
  width: auto;
}

.permission-cell {
  min-width: 360px;
  white-space: normal !important;
}

.permission-chip {
  margin: 2px 10px 2px 0;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-soft);
}

.database-actions {
  justify-content: space-between;
}

.database-actions span {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.database-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 12px;
}

.database-table th,
.database-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.database-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(#eef3fa, #e6edf6);
  color: var(--text-soft);
  font-weight: 700;
  box-shadow: inset 0 -1px 0 var(--line-strong);
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 6;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 18%;
  right: 3px;
  width: 1px;
  height: 64%;
  background: transparent;
  transition: background var(--t-fast);
}

.column-resize-handle:hover::after,
.database-table th.resizing .column-resize-handle::after,
.excel-table th.resizing .column-resize-handle::after,
.suggestion-table th.resizing .column-resize-handle::after,
table.resizing-columns th.resizing .column-resize-handle::after {
  background: var(--primary);
}

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

.panel-width-resize-handle {
  position: absolute;
  top: 12px;
  right: -6px;
  bottom: 12px;
  z-index: 10;
  width: 12px;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
}

.panel-width-resize-handle::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 5px;
  bottom: 12px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background var(--t-fast);
}

.panel-width-resize-handle:hover::after,
.workflow-task-panel.is-panel-resizing .panel-width-resize-handle::after {
  background: var(--primary);
}

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

table.resizing-columns th,
table.resizing-columns td {
  user-select: none;
}

table.resizable-columns-fixed th,
table.resizable-columns-fixed td {
  overflow: hidden;
  text-overflow: ellipsis;
}

table.resizable-columns-fixed {
  table-layout: fixed;
}

.database-table tbody tr {
  transition: background var(--t-fast);
}

.database-table tbody tr:hover {
  background: var(--primary-softer);
}

.record-separated-table tbody tr:not(:last-child) > td {
  border-bottom: 2px solid #dfe8f3;
}

.record-separated-table tr > th:not(:last-child),
.record-separated-table tr > td:not(:last-child) {
  border-right: 2px solid #dfe8f3;
}

.record-separated-table tbody tr.category-group-start:not(:first-child) > td {
  border-top: 4px solid #c9d8ea;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid #c7d8f6;
  border-radius: 999px;
  background: #eef5ff;
  color: #2353a4;
  font-weight: 700;
}

.database-table th:first-child,
.database-table td:first-child {
  width: 42px;
  text-align: center;
}

.database-table th:last-child,
.database-table td:last-child:not([colspan]) {
  width: 112px;
  min-width: 112px;
  text-align: center;
  position: sticky;
  right: 0;
  background: var(--surface);
  box-shadow: -8px 0 14px rgba(15, 23, 42, 0.08);
}

.database-table th:last-child {
  z-index: 4;
  background: linear-gradient(#eef3fa, #e6edf6);
}

.database-table td:last-child:not([colspan]) {
  z-index: 2;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
}

.database-table td:last-child:not([colspan]) .text-action,
.database-table td:last-child:not([colspan]) > .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 2px;
  white-space: nowrap;
}

.material-table {
  min-width: 1660px;
  table-layout: fixed;
}

.material-table th:first-child,
.material-table td:first-child {
  width: 210px;
  min-width: 210px;
  text-align: left;
}

.material-table th:nth-child(2),
.material-table td:nth-child(2) {
  width: 210px;
}

.material-table th:nth-child(3),
.material-table td:nth-child(3) {
  width: 150px;
}

.material-table th:nth-child(5),
.material-table td:nth-child(5) {
  width: 110px;
}

.material-table th:nth-child(6),
.material-table td:nth-child(6) {
  width: 260px;
}

.material-table th:nth-child(7),
.material-table td:nth-child(7) {
  width: 140px;
}

.material-table th:nth-child(8),
.material-table td:nth-child(8) {
  width: 140px;
}

.material-table th:nth-child(9),
.material-table td:nth-child(9) {
  width: 100px;
}

.material-table th:nth-child(10),
.material-table td:nth-child(10) {
  width: 160px;
}

.material-table th:last-child,
.material-table td:last-child:not([colspan]) {
  width: 150px;
  min-width: 150px;
}

.material-table .mat-name,
.material-table .mat-origin,
.material-table .mat-base-price,
.material-table .mat-price {
  width: 100%;
  box-sizing: border-box;
}

.material-table th:nth-child(4),
.material-table td:nth-child(4) { width: 150px; }
.material-table .mat-price[readonly] { background: #f1f5f9; color: #334155; }

.material-table .material-standard-list,
.material-table .material-attribute-list {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
  color: #334155;
}

.material-table .material-group-row td[colspan] {
  width: auto;
  min-width: 0;
  padding: 0;
  border-top: 1px solid #bfd3ee;
  background: #edf4fd;
}

.material-group-toggle {
  display: grid;
  grid-template-columns: 22px minmax(120px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 8px 13px;
  border: 0;
  background: transparent;
  color: #17315c;
  text-align: left;
  cursor: pointer;
}

.material-group-toggle:hover {
  background: #e2edfb;
}

.material-group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: #fff;
  color: #2563eb;
  font-size: 18px;
  line-height: 1;
}

.material-group-toggle strong {
  font-size: 14px;
}

.material-group-summary {
  justify-self: end;
  color: #5b6f8d;
  font-size: 12px;
  font-weight: 500;
}

.material-detail-row[hidden] {
  display: none;
}

.material-detail-name {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
}

.material-detail-name > span {
  width: 10px;
  height: 14px;
  margin-top: -6px;
  border-left: 1px solid #b5c7dc;
  border-bottom: 1px solid #b5c7dc;
}

.baking-paint-pricing-panel,
.washer-pricing-panel {
  margin-top: 12px;
}

.baking-paint-pricing-panel .config-title > div,
.washer-pricing-panel .config-title > div {
  min-width: 0;
}

.baking-paint-pricing-panel .config-title .field-hint,
.washer-pricing-panel .config-title .field-hint {
  margin: 5px 0 0;
}

.pricing-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 10px 0 12px;
}

.pricing-filter-row label {
  color: #17315c;
  font-weight: 600;
}

.pricing-filter-row select {
  width: min(320px, 100%);
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 34px 0 10px;
  background: #fff;
  color: var(--text);
}

.pricing-filter-row span {
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 720px) {
  .pricing-filter-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .pricing-filter-row select {
    width: 100%;
  }

  .material-group-toggle {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .material-group-summary {
    grid-column: 2;
    justify-self: start;
  }
}

.baking-paint-pricing-table {
  width: 100%;
  min-width: 880px;
  table-layout: fixed;
}

.baking-paint-pricing-table th:nth-child(1),
.baking-paint-pricing-table td:nth-child(1) { width: 220px; }
.baking-paint-pricing-table th:nth-child(2),
.baking-paint-pricing-table td:nth-child(2) { width: 220px; }
.baking-paint-pricing-table th:nth-child(3),
.baking-paint-pricing-table td:nth-child(3) { width: 120px; }
.baking-paint-pricing-table th:nth-child(4),
.baking-paint-pricing-table td:nth-child(4) { width: 170px; }
.baking-paint-pricing-table th:nth-child(5),
.baking-paint-pricing-table td:nth-child(5) { width: 150px; }

.baking-paint-origin {
  font-weight: 600;
  color: #17315c;
}

.baking-paint-price {
  width: 100%;
  min-height: 34px;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 9px;
  background: #fff;
  color: var(--text);
}

.washer-formula-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

.washer-formula-guide article {
  display: grid;
  gap: 5px;
  padding: 11px 13px;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
}

.washer-formula-guide strong {
  color: #17315c;
}

.washer-formula-guide span {
  line-height: 1.55;
}

.washer-formula-guide small {
  color: #64748b;
}

.washer-pricing-table {
  min-width: 1320px;
  table-layout: auto;
}

.washer-pricing-table th:nth-child(1),
.washer-pricing-table td:nth-child(1) { width: 150px; }
.washer-pricing-table th:nth-child(2),
.washer-pricing-table td:nth-child(2) { width: 105px; }
.washer-pricing-table th:nth-child(3),
.washer-pricing-table td:nth-child(3) { width: 210px; }
.washer-pricing-table th:nth-child(4),
.washer-pricing-table td:nth-child(4) { width: 205px; }
.washer-pricing-table th:nth-child(5),
.washer-pricing-table td:nth-child(5) { width: 190px; }
.washer-pricing-table th:nth-child(6),
.washer-pricing-table td:nth-child(6) { width: 160px; }
.washer-pricing-table th:nth-child(7),
.washer-pricing-table td:nth-child(7) { width: 100px; }
.washer-pricing-table th:nth-child(8),
.washer-pricing-table td:nth-child(8) { width: 150px; }
.washer-pricing-table th:nth-child(9),
.washer-pricing-table td:nth-child(9) { width: 80px; }

.washer-pricing-origin {
  font-weight: 600;
  color: #17315c;
}

.washer-pricing-spec {
  color: #17315c;
}

.washer-pricing-spec strong,
.washer-pricing-spec small {
  display: block;
}

.washer-pricing-spec small {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
}

.washer-pricing-formula,
.washer-rule-number {
  width: 100%;
  min-height: 34px;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 9px;
  background: #fff;
  color: var(--text);
}

.washer-rule-number:disabled {
  color: #94a3b8;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.washer-pricing-value-fit-table .washer-pricing-formula {
  width: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  padding-right: 32px;
}

@supports (field-sizing: content) {
  .washer-pricing-value-fit-table td:nth-child(4) .washer-rule-number {
    width: auto;
    min-inline-size: 150px;
    max-inline-size: 170px;
    field-sizing: content;
  }

  .washer-pricing-value-fit-table td:nth-child(5) .washer-rule-number {
    width: auto;
    min-inline-size: 200px;
    max-inline-size: 220px;
    field-sizing: content;
  }

  .washer-pricing-value-fit-table td:nth-child(6) .washer-rule-number {
    width: auto;
    min-inline-size: 104px;
    max-inline-size: 120px;
    field-sizing: content;
  }
}

@media (max-width: 900px) {
  .washer-formula-guide {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

.server-file-table {
  min-width: 920px;
}

.server-file-table th:first-child,
.server-file-table td:first-child {
  width: auto;
  min-width: 320px;
  text-align: left;
}

.server-file-table th:nth-child(2),
.server-file-table td:nth-child(2) {
  width: 110px;
}

.server-file-table th:nth-child(3),
.server-file-table td:nth-child(3) {
  width: 90px;
}

.server-file-table th:nth-child(4),
.server-file-table td:nth-child(4) {
  width: 150px;
}

.server-file-table th:last-child,
.server-file-table td:last-child:not([colspan]) {
  width: 140px;
  min-width: 140px;
}

.price-database-table {
  min-width: 2108px;
  table-layout: fixed;
}

.price-database-table th,
.price-database-table td {
  padding: 10px 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-database-table th:nth-child(1),
.price-database-table td:nth-child(1) {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
  text-overflow: clip;
  position: sticky;
  left: 0;
  z-index: 3;
}

.price-database-table th:nth-child(1) input[type="checkbox"],
.price-database-table td:nth-child(1) input[type="checkbox"] {
  margin: 0;
  vertical-align: middle;
}

.price-database-table th:nth-child(2),
.price-database-table td:nth-child(2) {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  position: sticky;
  left: 44px;
  z-index: 3;
  box-shadow: 8px 0 14px rgba(15, 23, 42, 0.08);
}

.price-database-table th:nth-child(3),
.price-database-table td:nth-child(3) {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
}

.price-database-table th:nth-child(4),
.price-database-table td:nth-child(4) {
  width: 128px;
  min-width: 128px;
  max-width: 128px;
}

.price-database-table th:nth-child(5),
.price-database-table td:nth-child(5) {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
}

.price-database-table th:nth-child(6),
.price-database-table td:nth-child(6) {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
}

.price-database-table.resizable-columns-fixed th:nth-child(n + 3):not(:last-child),
.price-database-table.resizable-columns-fixed td:nth-child(n + 3):not(:last-child) {
  width: auto;
  min-width: 0;
  max-width: none;
}

.weight-database-table {
  min-width: 1240px;
}

.price-database-table th:nth-child(1),
.price-database-table th:nth-child(2) {
  z-index: 5;
  background: linear-gradient(#eef3fa, #e6edf6);
}

.price-database-table td:nth-child(1),
.price-database-table td:nth-child(2) {
  background: var(--surface);
}

.price-database-table tbody tr:hover td:nth-child(1),
.price-database-table tbody tr:hover td:nth-child(2) {
  background: var(--primary-softer);
}

.price-database-table th:last-child,
.price-database-table td:last-child:not([colspan]) {
  width: 124px;
  min-width: 124px;
  max-width: 220px;
}

.price-database-table th:last-child {
  z-index: 6;
}

.price-database-table td:last-child:not([colspan]) {
  z-index: 4;
}

.compact-input {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

.compact-select {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.tiny-input {
  width: 96px;
}

.workflow-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.workflow-task-panel,
.workflow-detail-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.workflow-task-panel {
  padding: 16px;
  position: sticky;
  top: 16px;
}

.workflow-task-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.workflow-task {
  text-align: left;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  cursor: pointer;
  color: var(--text);
}

.workflow-task:hover,
.workflow-task.active {
  border-color: var(--primary);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.12);
}

.workflow-task span,
.workflow-task small {
  color: var(--muted);
}

.workflow-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 260px);
}

.workflow-table {
  min-width: 1380px;
}

.workflow-table th,
.workflow-table td {
  white-space: nowrap;
}

.workflow-table input {
  min-width: 110px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 10px;
}

.workflow-table input[data-field="remark"] {
  min-width: 180px;
}

.workflow-table input[readonly] {
  color: var(--primary-dark);
  background: #eef4ff;
  cursor: default;
}

.purchase-review-table {
  table-layout: fixed;
}

.purchase-batch-toolbar {
  margin: 0 16px 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 1px solid #bfd2ee;
  border-radius: 10px;
  background: #f4f8ff;
}

.purchase-batch-toolbar[hidden] {
  display: none;
}

.purchase-batch-filters,
.purchase-batch-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.purchase-batch-filters select { flex: 1 1 100px; }
.purchase-batch-filters [data-batch-filter="standard"],
.purchase-batch-filters [data-preview-filter="standard"] { flex: 2 1 200px; }
.purchase-batch-filters #batchSearch,
.purchase-batch-filters #previewSearch { flex: 3 1 260px; }
.purchase-batch-actions #batchAdjustmentInput { width: 250px; }
.purchase-review-table tr[hidden] { display: none; }

.purchase-batch-toolbar select,
.purchase-batch-toolbar input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #ffffff;
}

.purchase-batch-hint {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .purchase-batch-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .purchase-batch-toolbar strong,
  .purchase-batch-hint {
    grid-column: 1 / -1;
  }
}

.purchase-review-table th,
.purchase-review-table td {
  min-width: 0;
  padding: 9px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.purchase-review-table th {
  position: sticky;
  top: 0;
  z-index: 4;
}

.purchase-review-table .purchase-price-group-start {
  border-left: 2px solid #9fb5cf !important;
  box-shadow: none;
}

.purchase-review-table th.purchase-price-tone-0 { background: #f6d385; }
.purchase-review-table th.purchase-price-tone-1 { background: #b8dfbb; }
.purchase-review-table th.purchase-price-tone-2 { background: #98d4e8; }
.purchase-review-table th.purchase-price-tone-3 { background: #c5b5ed; }
.purchase-review-table th.purchase-price-tone-4 { background: #ecb5d2; }

.purchase-review-table td.purchase-price-tone-0 { background: #fff0ce; }
.purchase-review-table td.purchase-price-tone-1 { background: #e1f0df; }
.purchase-review-table td.purchase-price-tone-2 { background: #dceef6; }
.purchase-review-table td.purchase-price-tone-3 { background: #e9e2f7; }
.purchase-review-table td.purchase-price-tone-4 { background: #f6e0ed; }

.purchase-review-table .purchase-review-adjustment,
.purchase-review-table .purchase-review-final {
  background: #f7faff;
}

.purchase-review-table .purchase-review-adjustment {
  border-left: 2px solid #9fb5cf !important;
}

.workflow-total-weight-row td {
  position: sticky;
  bottom: 0;
  z-index: 5;
  font-weight: 700;
  background: #eaf1f8 !important;
  border-top: 2px solid #9eb6d3 !important;
}

.workflow-total-weight-row .workflow-total-label {
  text-align: center;
  color: var(--text);
}

.workflow-total-weight-row .workflow-total-value {
  text-align: right;
  color: var(--primary-dark);
  white-space: nowrap;
}

.purchase-review-table thead .purchase-review-adjustment,
.purchase-review-table thead .purchase-review-final {
  background: #e7eef8;
}

.purchase-review-table .purchase-frozen-column {
  position: sticky;
  z-index: 6;
  background: #f7faff;
}

.purchase-review-table thead .purchase-frozen-column {
  z-index: 10;
  background: #e7eef8;
}

.purchase-review-table tfoot .purchase-frozen-column { z-index: 8; }
.purchase-review-table .purchase-frozen-edge {
  border-right: 2px solid #9fb5cf !important;
  box-shadow: 6px 0 10px rgba(19, 27, 46, 0.08);
}
.purchase-review-table .needs-review .purchase-frozen-column { background: #fff0f0; }
.purchase-review-table .moq-below-minimum .purchase-frozen-column { background: #fff7df; }

.purchase-review-table .purchase-review-adjustment input,
.purchase-review-table .purchase-review-final input {
  width: 100%;
  min-width: 0;
}

.purchase-price-review-list {
  display: grid;
  gap: 6px;
}

.purchase-price-review-item {
  min-height: 38px;
  display: grid;
  grid-template-columns: 92px minmax(82px, 1fr);
  align-items: center;
  gap: 7px;
}

.purchase-price-final-item {
  grid-template-columns: 54px minmax(96px, 1fr);
}

.purchase-factory-choice {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.purchase-factory-choice input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px !important;
  min-width: 16px !important;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
}

.purchase-factory-choice span,
.purchase-price-review-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: var(--ink-soft);
}

.purchase-price-review-item input:disabled {
  color: var(--muted);
  background: #f3f5f8;
  cursor: not-allowed;
}

.manager-review-table .manager-price-review-item {
  min-height: 34px;
}

.manager-review-value {
  min-width: 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid #c8d5e6;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-review-empty {
  color: var(--muted);
  font-size: 13px;
}

.manager-review-note {
  margin-top: 6px;
  padding-top: 6px;
  overflow: hidden;
  border-top: 1px dashed #c8d5e6;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-review-issue {
  color: #b5473b;
}

.workflow-progress {
  padding: 0 16px 14px;
}

.workflow-progress:empty {
  display: none;
}

.workflow-progress-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.workflow-progress-people {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.workflow-person {
  flex: 0 0 auto;
  min-width: 138px;
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 11px;
  background: #f8fafc;
}

.workflow-person span,
.workflow-person small {
  color: var(--muted);
  font-size: 12px;
}

.workflow-person.status-completed {
  border-left-color: var(--teal);
  background: #f0fdf9;
}

.workflow-person.status-in_progress {
  border-left-color: var(--amber);
  background: #fffaf0;
}

/* ------------------------ Boss ERP wide-screen workspace ------------------------ */
@media (min-width: 1101px) {
  body.admin-page[data-role="boss"] {
    background: #e9eef5;
    background-image: none;
  }

  body.admin-page[data-role="boss"] .admin-shell {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 14px 16px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  body.admin-page[data-role="boss"] .admin-header {
    grid-column: 1 / -1;
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 68px;
    align-items: center;
    padding: 10px 16px;
    border-color: #d4dde9;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08);
  }

  body.admin-page[data-role="boss"] .admin-header-brand {
    gap: 11px;
  }

  body.admin-page[data-role="boss"] .admin-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(15, 70, 160, 0.22);
  }

  body.admin-page[data-role="boss"] .admin-mark .brand-icon {
    width: 27px;
    height: 27px;
  }

  body.admin-page[data-role="boss"] .admin-header h1 {
    margin: 0;
    font-size: 21px;
    line-height: 1.2;
  }

  body.admin-page[data-role="boss"] .admin-header p {
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.35;
  }

  body.admin-page[data-role="boss"] .admin-header-actions {
    flex-wrap: nowrap;
  }

  body.admin-page[data-role="boss"] .identity-slot {
    max-width: 420px;
    border: 1px solid #dce4ef;
    background: #f5f7fa;
  }

  body.admin-page[data-role="boss"] .tab-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    position: sticky;
    top: 78px;
    z-index: 12;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 8px;
    overflow: visible;
    border: 1px solid #d4dde9;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  }

  body.admin-page[data-role="boss"] .tab-nav-modules {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-gutter: stable;
  }

  body.admin-page[data-role="boss"] .tab-nav::before {
    content: "ERP 业务模块";
    display: none;
    padding: 5px 10px 9px;
    color: #7a879a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
  }

  body.admin-page[data-role="boss"] .tab-nav button {
    flex: 0 0 auto;
    width: auto;
    min-height: 39px;
    margin: 0;
    padding: 0 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
  }

  body.admin-page[data-role="boss"] .tab-nav button:hover {
    background: #f2f6fb;
  }

  body.admin-page[data-role="boss"] .tab-nav button.active {
    border-bottom-color: var(--primary);
    color: var(--primary-dark);
    background: #eaf1ff;
    box-shadow: inset 0 0 0 1px #d6e4ff;
  }

  body.admin-page[data-role="boss"] .page-card-jump {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 39px;
    padding: 0 2px 0 12px;
    border-left: 1px solid #e2e8f0;
    background: #fff;
  }

  body.admin-page[data-role="boss"] .page-card-jump label {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }

  body.admin-page[data-role="boss"] .page-card-jump select {
    width: 196px;
    min-height: 36px;
    padding: 0 32px 0 10px;
    border: 1px solid #cbd7e6;
    border-radius: 6px;
    background-color: #f8fafc;
    color: #17315c;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }

  body.admin-page[data-role="boss"] .page-card-jump select:hover {
    border-color: #9bb8e8;
    background-color: #fff;
  }

  body.admin-page[data-role="boss"] .page-card-jump select:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.22);
    outline-offset: 1px;
    border-color: var(--primary);
  }

  body.admin-page[data-role="boss"] .page-card-jump select:disabled {
    color: #94a3b8;
    cursor: default;
  }

  body.admin-page[data-role="boss"] [data-page-card-anchor] {
    scroll-margin-top: 148px;
  }

  body.admin-page[data-role="boss"] .page-card-jump-highlight {
    animation: page-card-jump-highlight 1.25s ease-out;
  }

  body.admin-page[data-role="boss"] .admin-shell > .tab-panel {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
  }

  body.admin-page[data-role="boss"] .admin-shell > .tab-panel.active {
    display: block;
  }

  body.admin-page[data-role="boss"] .config-panel,
  body.admin-page[data-role="boss"] .workflow-task-panel,
  body.admin-page[data-role="boss"] .workflow-detail-panel {
    border-color: #d7e0eb;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  }

  body.admin-page[data-role="boss"] .config-panel {
    gap: 12px;
    padding: 15px;
  }

  body.admin-page[data-role="boss"] .config-title {
    min-height: 37px;
    padding-bottom: 10px;
  }

  body.admin-page[data-role="boss"] .config-title h2,
  body.admin-page[data-role="boss"] .config-title h3 {
    margin: 0;
  }

  body.admin-page[data-role="boss"] .database-metrics {
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 8px;
  }

  body.admin-page[data-role="boss"] .database-metrics div {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 6px;
    background: #f6f8fb;
  }

  body.admin-page[data-role="boss"] .database-metrics strong {
    margin: 0;
    font-size: 19px;
  }

  body.admin-page[data-role="boss"] .database-toolbar,
  body.admin-page[data-role="boss"] .database-filters,
  body.admin-page[data-role="boss"] .database-actions,
  body.admin-page[data-role="boss"] .material-toolbar {
    gap: 7px;
  }

  body.admin-page[data-role="boss"] .database-filters input,
  body.admin-page[data-role="boss"] .database-filters select,
  body.admin-page[data-role="boss"] .material-toolbar input,
  body.admin-page[data-role="boss"] .material-toolbar select {
    min-height: 34px;
  }

  body.admin-page[data-role="boss"] .primary-button,
  body.admin-page[data-role="boss"] .secondary-button,
  body.admin-page[data-role="boss"] .ghost-button,
  body.admin-page[data-role="boss"] .file-button {
    min-height: 34px;
  }

  body.admin-page[data-role="boss"] .database-table-wrap {
    border-radius: 5px;
  }

  body.admin-page[data-role="boss"] .database-table th,
  body.admin-page[data-role="boss"] .database-table td {
    padding: 7px 10px;
  }

  body.admin-page[data-role="boss"] .database-table th {
    background: #e9eef5;
  }

  body.admin-page[data-role="boss"] .price-table-wrap {
    min-height: 360px;
    max-height: calc(100vh - 385px);
  }

  body.admin-page[data-role="boss"] .tab-panel[data-tab="rules"] .config-grid {
    grid-template-columns: minmax(680px, 1fr) minmax(340px, 420px);
    gap: 12px;
  }

  body.admin-page[data-role="boss"] .workflow-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  body.admin-page[data-role="boss"] .workflow-task-panel {
    position: static;
    padding: 12px;
  }

  body.admin-page[data-role="boss"] .workflow-table-wrap {
    max-height: calc(100vh - 330px);
  }
}

@media (min-width: 2200px) {
  body.admin-page[data-role="boss"] .admin-shell {
    grid-template-columns: 214px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px 14px;
  }

  body.admin-page[data-role="boss"] .tab-nav {
    grid-column: 1;
    grid-row: 2;
    top: 94px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 3px;
    padding: 10px;
    overflow: visible;
  }

  body.admin-page[data-role="boss"] .tab-nav-modules {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    width: 100%;
    overflow: visible;
  }

  body.admin-page[data-role="boss"] .page-card-jump {
    position: static;
    display: grid;
    gap: 6px;
    width: 100%;
    min-height: auto;
    margin: 8px 0 0;
    padding: 11px 0 0;
    border-left: 0;
    border-top: 1px solid #e2e8f0;
    box-shadow: none;
  }

  body.admin-page[data-role="boss"] .page-card-jump select {
    width: 100%;
  }

  body.admin-page[data-role="boss"] [data-page-card-anchor] {
    scroll-margin-top: 94px;
  }

  body.admin-page[data-role="boss"] .tab-nav::before {
    display: block;
  }

  body.admin-page[data-role="boss"] .tab-nav button {
    width: 100%;
    padding: 0 12px;
    border-bottom: 0;
    border-left: 3px solid transparent;
    text-align: left;
  }

  body.admin-page[data-role="boss"] .tab-nav button.active {
    border-left-color: var(--primary);
    border-bottom-color: transparent;
  }

  body.admin-page[data-role="boss"] .admin-shell > .tab-panel {
    grid-column: 2;
    grid-row: 2;
  }

  body.admin-page[data-role="boss"] .workflow-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  body.admin-page[data-role="boss"] .workflow-task-panel {
    position: sticky;
    top: 94px;
  }

  body.admin-page[data-role="boss"] .tab-panel[data-tab="price"].active {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 12px;
    align-items: start;
  }

  body.admin-page[data-role="boss"] .tab-panel[data-tab="price"] > .database-admin,
  body.admin-page[data-role="boss"] .tab-panel[data-tab="price"] > .record-editor {
    min-width: 0;
    margin-top: 0;
  }

  body.admin-page[data-role="boss"] .tab-panel[data-tab="price"] > .record-editor {
    position: sticky;
    top: 94px;
    max-height: calc(100vh - 114px);
    overflow: auto;
  }

  body.admin-page[data-role="boss"] .tab-panel[data-tab="price"] .record-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  body.admin-page[data-role="boss"] .tab-panel[data-tab="price"] .record-form-grid label {
    gap: 4px;
    font-size: 12px;
  }

  body.admin-page[data-role="boss"] .tab-panel[data-tab="price"] .record-form-grid input,
  body.admin-page[data-role="boss"] .tab-panel[data-tab="price"] .record-form-grid select {
    min-height: 34px;
    padding: 7px 9px;
  }
}

@media (max-width: 1100px) {
  body.admin-page[data-role="boss"] .admin-shell {
    width: 100%;
    max-width: none;
    padding: 14px;
  }
}

@media (max-width: 760px) {
  body.admin-page[data-role="boss"] .page-card-jump label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  body.admin-page[data-role="boss"] .page-card-jump select {
    width: 156px;
  }
}

@keyframes page-card-jump-highlight {
  0% {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.28), 0 8px 22px rgba(37, 99, 235, 0.12);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0), 0 1px 4px rgba(15, 23, 42, 0.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.admin-page[data-role="boss"] .page-card-jump-highlight {
    animation: none;
  }
}

@media (max-width: 1280px) {
  .workflow-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .workflow-task-panel {
    position: static;
  }

  .workflow-task-list {
    display: flex;
    gap: 10px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
  }

  .workflow-task {
    flex: 0 0 min(300px, 82vw);
  }

  .workflow-table-wrap {
    max-height: calc(100vh - 330px);
  }
}

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

  .workflow-task-panel {
    position: static;
  }
}

.manual-search-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin: 0 0 18px;
  box-shadow: var(--shadow-sm);
}

.sales-taskbar {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.94));
  box-shadow: var(--shadow-sm);
}

.sales-taskbar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#workspaceView .sales-collapsible { display: block; }
.sales-collapsible-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 4px 0;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}
.sales-collapsible-summary::-webkit-details-marker { display: none; }
.sales-collapsible-summary::before { content: "▸"; color: var(--muted); }
.sales-collapsible-summary::after { content: "展开"; margin-left: auto; color: var(--primary); }
.sales-collapsible[open] > .sales-collapsible-summary::before { content: "▾"; }
.sales-collapsible[open] > .sales-collapsible-summary::after { content: "收起"; }
.sales-collapsible-summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 4px; }
.sales-collapsible[open] > :not(summary) { margin-top: 8px; }

.sales-taskbar-head > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sales-taskbar-head strong {
  font-size: 16px;
}

.sales-task-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.sales-task-card {
  flex: 0 0 300px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  min-height: 104px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.sales-task-card:hover,
.sales-task-card:focus-within {
  border-color: rgba(37, 99, 235, 0.48);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.sales-task-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14), 0 12px 28px rgba(37, 99, 235, 0.12);
}

.sales-task-preview-button {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.sales-task-card.status-approved {
  border-left-color: var(--teal);
}

.sales-task-card.status-purchase_submitted {
  border-left-color: var(--amber);
}

.sales-task-card.status-returned_to_purchase {
  border-left-color: var(--red);
}

.sales-task-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.sales-task-main strong,
.sales-task-main span,
.sales-task-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-task-main span {
  color: var(--primary-dark);
  font-weight: 700;
}

.sales-task-main small {
  color: var(--muted);
  font-size: 12px;
}

.sales-task-main .sales-task-preview-hint {
  color: var(--primary);
  font-weight: 700;
}

.sales-task-export {
  align-self: flex-start;
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 10px;
  color: var(--teal);
  background: var(--teal-bg);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.manual-search-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.manual-search-row input {
  flex: 1;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0 12px;
}

.suggestion-list {
  margin-top: 12px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.suggestion-list.muted-text {
  max-height: none;
  overflow: visible;
  border: 0;
  border-radius: 0;
}

.suggestion-count {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

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

.suggestion-table th,
.suggestion-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.suggestion-table th {
  position: sticky;
  top: 33px;
  z-index: 2;
  background: #f8fafc;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  background: #e8f3ff;
  color: #1453b8;
  font-size: 12px;
}

.text-action {
  display: inline-flex;
  align-items: center;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-size: 12px;
  white-space: nowrap;
}

.text-action:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.pagination-row {
  justify-content: flex-end;
}

.pagination-row span {
  min-width: 90px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.pagination-row .page-jump-control {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.page-jump-control input {
  width: 70px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0 8px;
  color: var(--text);
  background: var(--surface);
}

.page-jump-control input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.record-editor {
  scroll-margin-top: 16px;
}

.record-form-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.login-page {
  --login-card-reference-height: 506px;
  display: grid;
  align-items: start;
  justify-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(24px, calc((100svh - var(--login-card-reference-height)) / 2)) 24px 24px;
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(37, 99, 235, 0.14), transparent 55%),
    radial-gradient(800px 480px at 85% 90%, rgba(15, 118, 110, 0.13), transparent 55%),
    linear-gradient(135deg, #101a2f, #18243d);
}

.login-page[data-role="dev"] {
  --login-card-reference-height: 424px;
}

.login-shell {
  width: min(560px, 100%);
}

.login-card {
  display: grid;
  gap: 22px;
  min-height: var(--login-card-reference-height);
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
}

.login-brand > div {
  min-width: 0;
}

.login-brand h1 {
  font-size: 22px;
}

.login-brand p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-entry-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #f8fbff;
}

.login-entry {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text);
  background: #fff;
  text-decoration: none;
  transition:
    border-color var(--t-fast),
    background var(--t-fast),
    box-shadow var(--t-fast),
    transform var(--t-fast);
}

.login-entry:hover {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 8px 18px rgba(15, 70, 160, 0.09);
  transform: translateY(-1px);
}

.login-entry.active {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.login-entry strong {
  font-size: 14px;
}

.login-entry span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.login-mark {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: var(--r-md);
  background: linear-gradient(145deg, #2f6df3, #0f766e);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 18px rgba(15, 70, 160, 0.4);
}

.login-form {
  display: grid;
  gap: 15px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
  transition:
    border-color var(--t-fast),
    box-shadow var(--t-fast);
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.login-form .primary-button {
  margin-top: 4px;
  min-height: 44px;
}

.account-password-form {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.profile-home-link {
  min-height: 40px;
  justify-content: center;
}

.login-message {
  display: block;
  height: 36px;
  min-height: 36px;
  margin: 0;
  overflow: auto;
  visibility: hidden;
  opacity: 0;
  color: var(--red);
  font-size: 13px;
  line-height: 18px;
  transition: opacity var(--t-fast);
}

.login-message.show {
  visibility: visible;
  opacity: 1;
}

.login-message.ok {
  color: var(--green);
}

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

  .record-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .config-grid,
  .form-grid,
  .database-metrics,
  .record-form-grid {
    grid-template-columns: 1fr;
  }

  body.admin-page[data-role="boss"] .tab-panel[data-tab="rules"] .config-grid {
    grid-template-areas:
      "source"
      "dictionary"
      "customer"
      "finish"
      "package";
  }

  .database-import-help {
    grid-template-columns: 1fr;
  }

  .database-catalog-tree {
    grid-template-columns: 1fr;
  }

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

  .config-grid #sourceOriginMappingForm,
  .config-grid #customerDictionaryForm,
  .config-grid #dictionaryForm {
    grid-column: 1;
    grid-row: auto;
  }

  .config-grid #sourceOriginMappingForm { order: 1; }
  .config-grid #dictionaryForm { order: 2; }
  .config-grid #customerDictionaryForm { order: 3; }

  .washer-type-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

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

  .side-note {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    margin-left: 0;
    width: 100%;
  }

  .page-header,
  .panel-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions,
  .toolbar-group {
    align-items: stretch;
    flex-direction: column;
  }

  .file-button,
  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .side-note > .ghost-button,
  .admin-header-actions > .ghost-button {
    width: auto;
  }

  .database-catalog-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .database-catalog-tree {
    max-height: 420px;
  }

  .catalog-all-button {
    justify-content: space-between;
    width: 100%;
  }

  .catalog-category > summary {
    align-items: flex-start;
  }

  .catalog-category > summary small {
    white-space: normal;
    text-align: right;
  }

  .catalog-standard-list {
    padding-left: 11px;
  }

  .status-grid,
  .admin-layout,
  .review-panel {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 16px;
  }

  .table-wrap {
    max-height: 520px;
  }

  .washer-type-toolbar {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------- 报价日志面板 ------------------------------- */
.quote-log-admin {
  margin-top: 18px;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 22px 12px;
}

.database-table tr.review-row {
  background: var(--surface-sunken);
}

.quote-log-detail {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
}

.quote-log-detail h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.log-detail-issues {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 16px;
  color: var(--text-soft);
  font-size: 13px;
}

.issue-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 12px;
}

.issue-chip.ok {
  background: var(--teal-bg);
  border-color: var(--teal-bg);
  color: var(--teal);
}

/* ------------------------------- 导入历史 ------------------------------- */
.import-history {
  margin-top: 16px;
  border-top: 1px dashed var(--line-strong);
  padding: 12px 16px;
}

.import-history > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-soft);
  list-style: none;
  user-select: none;
}

.import-history > summary::-webkit-details-marker {
  display: none;
}

.import-history > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.import-history[open] > summary::before {
  transform: rotate(90deg);
}

.import-history .history-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 7px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.import-history .database-table-wrap {
  margin-top: 12px;
}

/* ------------------------------- 字段映射编辑器 ------------------------------- */
.mapping-editor {
  margin: 0 0 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

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

.mapping-editor-head strong {
  font-size: 15px;
  color: var(--text);
  margin-right: 8px;
}

.mapping-hint {
  color: var(--muted);
  font-size: 12px;
}

.mapping-editor-actions {
  display: flex;
  gap: 8px;
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px 14px;
}

.mapping-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-soft);
}

.mapping-field select {
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.mapping-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* —— 多租户后台新增元素 —— */
.admin-header-actions { display: flex; align-items: center; gap: 12px; }
.identity-slot {
  font-size: 13px; color: var(--text-soft, #5b6472); background: rgba(0,0,0,0.04);
  padding: 6px 12px; border-radius: 8px; max-width: 260px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.account-list-wrap { margin-top: 14px; }
.account-list-wrap table { width: 100%; }
.recommendation hr { border: none; border-top: 1px solid rgba(0,0,0,0.08); margin: 16px 0; }
#bossForm[hidden] { display: none; }

/* —— 后台选项卡导航 —— */
.tab-nav {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: 4px 0 22px; padding-bottom: 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.tab-nav button {
  appearance: none; border: none; background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text-soft, #6b7280);
  padding: 10px 16px; border-radius: 10px 10px 0 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, background .15s, border-color .15s;
}
.tab-nav button:hover { color: var(--text, #1f2733); background: rgba(0,0,0,0.03); }
.tab-nav button.active {
  color: var(--accent, #2563eb);
  border-bottom-color: var(--accent, #2563eb);
  background: rgba(37,99,235,0.06);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel > .config-panel + .config-panel,
.tab-panel > section + section,
.tab-panel > section + form,
.tab-panel > form + section { margin-top: 22px; }

/* —— 价格库批量设置面板 —— */
.bulk-edit-panel {
  margin: 4px 0 14px; padding: 14px 16px;
  background: rgba(37,99,235,0.05); border: 1px solid rgba(37,99,235,0.18); border-radius: 10px;
}
.bulk-edit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bulk-edit-row select, .bulk-edit-row input {
  height: 34px; padding: 0 10px; border: 1px solid rgba(0,0,0,0.15); border-radius: 8px; font-size: 14px;
}
.bulk-edit-row input { width: 200px; }
.bulk-edit-panel .field-hint { margin: 10px 0 0; }

/* —— 价格库行内编辑 —— */
.editing-row { background: rgba(37,99,235,0.06); }
.editing-row td { padding: 4px 6px; }
.ie-input {
  width: 100%; min-width: 52px; box-sizing: border-box;
  height: 30px; padding: 0 6px; font-size: 13px;
  border: 1px solid rgba(37,99,235,0.4); border-radius: 6px;
}
.editing-row .ie-input { width: 72px; }
.editing-row .ie-input[data-f="standard"],
.editing-row .ie-input[data-f="size"] { width: 86px; }
.editing-row .ie-input[data-f="grade"],
.editing-row .ie-input[data-f="unit"],
.editing-row .ie-input[data-f="moq"] { width: 58px; }
.editing-row .ie-input[data-f="finish"],
.editing-row .ie-input[data-f="material"],
.editing-row .ie-input[data-f="sourceOrigin"],
.editing-row .ie-input[data-f="package"],
.editing-row .ie-input[data-f="taxTonPrice"],
.editing-row .ie-input[data-f="thousandWeight"],
.editing-row .ie-input[data-f="thousandPrice"] { width: 74px; }
.editing-row .ie-input[data-f="remark"] { width: 150px; }
.editing-row td:nth-last-child(2) {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.editing-row td:last-child:not([colspan]) {
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
}
.ie-input[readonly] { background: #f1f3f5; color: #6b7280; }

/* —— 采购员标准号查询与材料调价审批 —— */
[data-purchase-view][hidden] {
  display: none !important;
}

[data-purchase-view="materials"] > .config-panel + .config-panel {
  margin-top: 18px;
}

.purchase-standard-filters select {
  flex: 1 1 132px;
  min-width: 118px;
}

.purchase-readonly-table-wrap {
  margin-top: 14px;
}

.purchase-standard-table,
.purchase-material-table,
.purchase-request-table,
.material-approval-table {
  width: max-content;
  min-width: 100%;
}

.purchase-standard-table th:first-child,
.purchase-standard-table td:first-child,
.purchase-material-table th:first-child,
.purchase-material-table td:first-child,
.purchase-request-table th:first-child,
.purchase-request-table td:first-child,
.material-approval-table th:first-child,
.material-approval-table td:first-child {
  width: auto;
  min-width: 108px;
  text-align: left;
}

.purchase-standard-table th:last-child,
.purchase-standard-table td:last-child:not([colspan]),
.purchase-request-table th:last-child,
.purchase-request-table td:last-child:not([colspan]) {
  position: static;
  width: auto;
  min-width: 130px;
  text-align: left;
  box-shadow: none;
}

.purchase-material-table input,
.material-approval-actions input {
  min-width: 150px;
  padding: 8px 9px;
}

.purchase-material-table th:nth-child(5),
.purchase-material-table td:nth-child(5) {
  min-width: 280px;
  max-width: 380px;
  white-space: normal;
}

.purchase-standard-summary {
  line-height: 1.5;
}

.purchase-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.approval-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 700;
}

.approval-status.status-pending {
  background: #fff4cf;
  color: #8a5a00;
}

.approval-status.status-approved {
  background: #dcfce7;
  color: #14733b;
}

.approval-status.status-rejected {
  background: #fee2e2;
  color: #b42318;
}

.approval-new-value {
  color: var(--primary);
}

.material-approval-scope {
  min-width: 260px;
  max-width: 420px;
  white-space: normal !important;
  line-height: 1.5;
}

.material-approval-scope span {
  color: var(--muted);
}

.material-approval-table th:last-child,
.material-approval-table td:last-child:not([colspan]) {
  width: 300px;
  min-width: 300px;
}

.material-approval-actions {
  display: grid;
  gap: 7px;
}

.material-approval-actions > div {
  display: flex;
  justify-content: center;
  gap: 7px;
}

#materialPriceApprovalFilter {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
}

@media (max-width: 760px) {
  .purchase-standard-filters > * {
    flex-basis: 100%;
    width: 100%;
  }

  .purchase-pagination {
    justify-content: space-between;
  }

  #materialPriceApprovalPanel .config-title,
  #materialPriceApprovalPanel .toolbar-group {
    align-items: stretch;
  }
}

body.admin-page[data-role="boss"] .tab-panel[data-tab="rules"] #finishSettingsForm {
  grid-area: finish;
}
.finish-settings-table-wrap { max-height: 420px; }
#finishSettingsForm .database-table td:last-child { width: 90px; }
#finishSettingsForm .database-table input { width: 100%; min-width: 0; }
@media (max-width: 900px) {
  body.admin-page[data-role="boss"] .tab-panel[data-tab="rules"] .config-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  #finishSettingsForm .source-origin-add-row input { width: 100%; min-width: 0; }
}
@media (max-width: 900px) {
  body.admin-page[data-role="boss"] .admin-shell { grid-template-columns: minmax(0, 1fr); }
  body.admin-page[data-role="boss"] .tab-panel[data-tab="rules"] { min-width: 0; }
}
#finishSettingsForm .database-table { table-layout: fixed; }
#finishSettingsForm .database-table th:first-child,
#finishSettingsForm .database-table td:first-child { width: auto; text-align: left; }
#finishSettingsForm .database-table th:last-child,
#finishSettingsForm .database-table td:last-child {
  width: 80px;
  min-width: 0;
  position: static;
  box-shadow: none;
}

body.admin-page[data-role="boss"] .tab-panel[data-tab="rules"] #packageSettingsForm {
  grid-area: package;
}
.package-settings-table-wrap { max-height: 420px; }
#packageSettingsForm .database-table td:last-child { width: 90px; }
#packageSettingsForm .database-table input { width: 100%; min-width: 0; }
@media (max-width: 900px) {
  body.admin-page[data-role="boss"] .tab-panel[data-tab="rules"] .config-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  #packageSettingsForm .source-origin-add-row input { width: 100%; min-width: 0; }
}
@media (max-width: 900px) {
  body.admin-page[data-role="boss"] .admin-shell { grid-template-columns: minmax(0, 1fr); }
  body.admin-page[data-role="boss"] .tab-panel[data-tab="rules"] { min-width: 0; }
}
#packageSettingsForm .database-table { table-layout: fixed; }
#packageSettingsForm .database-table th:first-child,
#packageSettingsForm .database-table td:first-child { width: auto; text-align: left; }
#packageSettingsForm .database-table th:last-child,
#packageSettingsForm .database-table td:last-child {
  width: 80px;
  min-width: 0;
  position: static;
  box-shadow: none;
}

.material-option-cell { white-space: normal !important; }
.material-option-picker summary { cursor: pointer; color: var(--blue); }
.material-option-picker select { width: 100%; min-width: 140px; margin: 8px 0; }
.mat-price-breakdown { display: block; white-space: normal; max-width: 180px; margin-top: 6px; color: var(--muted); }
.material-option-price-dialog { position: fixed; inset: 0; margin: auto; width: min(680px, calc(100vw - 32px)); max-height: 85vh; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); }
.material-option-price-dialog::backdrop { background: rgba(15, 23, 42, .48); }
.material-option-price-dialog form { display: grid; gap: 14px; }
.material-option-price-dialog h2 { margin: 0; font-size: 20px; }
.material-option-price-scroll { max-height: 50vh; overflow: auto; }
.material-option-price-scroll table { width: 100%; min-width: 0; border-collapse: collapse; }
.material-option-price-scroll td, .material-option-price-scroll th { padding: 10px; text-align: left; border-bottom: 1px solid var(--line); }
.material-option-price-scroll th { position: sticky; top: 0; background: var(--surface); }
.material-option-price-scroll input { width: 100%; min-width: 80px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }

/* This compact editor scrolls as a whole so actions never cover editable cells. */
.washer-type-table th:last-child {
  right: auto;
  box-shadow: none;
}

.washer-type-table td:last-child:not([colspan]) {
  position: static;
  box-shadow: none;
}

/* 采购经理任务完成状态：颜色与文字同时区分。 */
.purchase-manager-page .workflow-task { position: relative; }
.purchase-manager-page .workflow-task .task-title { padding-right: 82px; overflow-wrap: anywhere; }
.purchase-manager-page .workflow-task .task-completion { position: absolute; top: 11px; right: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 20px; font-size: 11px; font-weight: 700; line-height: 18px; white-space: nowrap; }
.purchase-manager-page .task-completion i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px #ffffff80; }
.purchase-manager-page .workflow-task .task-completion.is-complete { color: #15803d; background: #dcfce7; }
.purchase-manager-page .workflow-task .task-completion.is-pending { color: #b45309; background: #fff1cc; }

.status-light-card { position: relative; }
.workflow-task.status-light-card .task-title { padding-right: 82px; overflow-wrap: anywhere; }
.sales-task-card.status-light-card { padding-top: 43px; }
.status-light-card .task-completion { position: absolute; top: 11px; right: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 20px; font-size: 11px; font-weight: 700; line-height: 18px; white-space: nowrap; }
.status-light-card .task-completion i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px #ffffff80; }
.status-light-card .task-completion.is-complete { color: #15803d; background: #dcfce7; }
.status-light-card .task-completion.is-pending { color: #b45309; background: #fff1cc; }

/* Purchaser and manager tasks sit above the full-width pricing table at every viewport size. */
.purchaser-workspace .workflow-layout[data-purchase-view="tasks"],
.purchase-manager-page .workflow-layout {
  grid-template-columns: minmax(0, 1fr);
}

.purchaser-workspace .workflow-task-panel,
.purchase-manager-page .workflow-task-panel {
  position: static;
}

.purchaser-workspace .workflow-task-list,
.purchase-manager-page .workflow-task-list {
  display: flex;
  gap: 10px;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
}

.purchaser-workspace .workflow-task,
.purchase-manager-page .workflow-task {
  flex: 0 0 min(300px, 82vw);
  min-width: 0;
  align-content: start;
}

/* Boss workflow cards form a compact grid instead of full-width strips. */
body.admin-page[data-role="boss"] .workflow-layout {
  grid-template-columns: minmax(0, 1fr);
}

body.admin-page[data-role="boss"] .workflow-task-panel {
  position: static;
}

#bossApprovalTaskList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 12px;
  max-height: 580px;
  overflow: auto;
  padding: 4px 6px 8px 0;
}

#bossApprovalTaskList .workflow-task {
  width: 100%;
  min-width: 0;
  align-content: start;
  gap: 10px;
  padding: 14px;
  overflow: auto;
  overflow-wrap: anywhere;
}

body.admin-page .database-metrics.server-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: start;
}
body.admin-page .database-metrics.server-metrics > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  min-height: 78px;
  padding: 12px 14px;
}
.server-storage-heading { margin: 20px 0 10px; font-size: 14px; }
.server-disk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.server-disk-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #f8fafc; min-width: 0; }
.server-disk-title, .server-disk-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.server-disk-title code { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.server-disk-capacity { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.server-disk-capacity strong { font-size: 23px; }
.server-disk-capacity span, .server-disk-meta { color: var(--muted); font-size: 12px; }
.server-disk-card progress { display: block; width: 100%; height: 7px; border: none; border-radius: 8px; accent-color: #3b82f6; margin-bottom: 10px; overflow: hidden; }
.server-disk-card progress::-webkit-progress-bar { background: #e2e8f0; }
.server-disk-card progress::-webkit-progress-value { background: #3b82f6; border-radius: 8px; }
.server-path-hint { overflow-wrap: anywhere; line-height: 1.7; }
.workflow-return-dialog{width:min(540px,calc(100% - 32px));max-height:calc(100vh - 40px);overflow:auto;border:1px solid #d7e0e9;border-radius:14px;padding:24px;color:#24364b;background:#fff;box-shadow:0 20px 70px #14253840}
.workflow-return-dialog::backdrop{background:#13223680}
.workflow-return-dialog h2{margin:0 0 12px;font-size:20px}
.workflow-return-dialog p{line-height:1.7;margin:12px 0;font-size:14px}
.workflow-return-task{font-weight:700;overflow-wrap:anywhere}
.workflow-return-dialog label{display:block;margin-top:16px;font-weight:600}
.workflow-return-dialog textarea{display:block;box-sizing:border-box;width:100%;margin:8px 0 16px;padding:10px;font:inherit;resize:vertical;border:1px solid #c9d5e0;border-radius:8px}
.workflow-return-dialog .toolbar-group{display:flex;justify-content:flex-end;gap:10px}
#returnSalesError,.sales-task-return-note{color:#a13e28;overflow-wrap:anywhere}
.sales-return-notice{margin:16px;padding:16px 18px;border:1px solid #e8bd70;border-left:4px solid #d18a20;border-radius:10px;background:#fff8e9;color:#61451f}
.sales-return-notice[hidden]{display:none}
.sales-return-notice>strong{font-size:16px}
.sales-return-notice p{margin:8px 0 12px;line-height:1.7;font-size:13px}
.sales-return-list{display:grid;gap:10px}
.sales-return-entry{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;min-width:0}
.sales-return-entry button{white-space:normal;text-align:left;overflow-wrap:anywhere;max-width:100%}
.sales-return-entry span{font-size:13px;overflow-wrap:anywhere}
.sales-return-entry button:disabled{opacity:1;background:#f7ecd7;color:#61451f;cursor:default}

/* 业务员、采购员和采购经理的表格统一居中，包含原先单独对齐的序号和合计。 */
body.centered-tables table :is(th, td) {
  /* 覆盖各类表格针对首列、末列、合计列的独立对齐规则。 */
  text-align: center !important;
  vertical-align: middle;
}

body.centered-tables table :is(input, select, textarea, button) {
  text-align: center;
}

body.centered-tables table select {
  text-align-last: center;
}

body.centered-tables table .purchase-factory-choice,
body.centered-tables table .manager-review-value {
  justify-content: center;
}

.purchase-review-table tr.review-attention > td {
  background-color: #fff5d6 !important;
  box-shadow: inset 0 2px 0 #e7ac30, inset 0 -2px 0 #e7ac30;
}

.procurement-confirmation {
  padding: 8px;
  margin-top: 8px;
  border: 1px solid #f3b6b6;
  border-radius: 6px;
  background: #fff3f3;
  color: #9d2929;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.5;
}
.procurement-confirmation ul { margin: 6px 0; padding-left: 18px; }
.procurement-confirmation.is-confirmed { border-color: #a7d9b9; background: #f0faf3; color: #24613a; }
.procurement-confirmation.is-optional { border-color: #d9e3f0; background: #f7fafe; color: #52627a; }
.procurement-confirmation label { display: flex; align-items: flex-start; gap: 6px; }
.procurement-confirmation input[type="checkbox"] { flex: 0 0 auto; width: 14px; height: 14px; min-height: 14px; margin-top: 2px; padding: 0; }
.purchase-review-table td.purchase-review-adjustment,
.purchase-review-table td.purchase-review-final { vertical-align: top; }

/* The lowest offer and its manufacturer share the same row background. */
.excel-table tbody td.quote-source-tone-0 { background: #fff0ce; }
.excel-table tbody td.quote-source-tone-1 { background: #e1f0df; }
.excel-table tbody td.quote-source-tone-2 { background: #dceef6; }
.excel-table tbody td.quote-source-tone-3 { background: #e9e2f7; }
.excel-table tbody td.quote-source-tone-4 { background: #f6e0ed; }
.excel-table tbody td.quote-ratio-high { color: #c5221f; font-weight: 600; }
.excel-table tbody td.quote-ratio-low { color: #16803c; font-weight: 600; }
.purchase-peer-readonly { color: var(--text-soft); background: #f5f7fb; }

/* Purchaser-only price adjustment. The saved worksheet remains a read-only preview. */
.purchase-adjustment-dialog { width:calc(100vw - 32px); max-width:1560px; height:calc(100vh - 48px); max-height:960px; padding:0; border:1px solid #cbd9ee; border-radius:12px; color:#172239; overflow:hidden; }
.purchase-adjustment-dialog[open] { display:flex; flex-direction:column; }
.purchase-adjustment-dialog::backdrop { background:rgba(15,23,42,.48); }
.adjustment-dialog-toolbar { flex:0 0 auto; z-index:12; display:flex; justify-content:space-between; align-items:center; gap:16px; padding:12px 16px; background:white; border-bottom:1px solid #dce5f3; }
.adjustment-dialog-toolbar h2 { margin:0 0 3px; font-size:18px; }
.adjustment-dialog-toolbar p { margin:0; color:#60718c; font-size:12px; }
.adjustment-dialog-toolbar button { min-height:32px; padding:6px 14px; }
.purchase-adjustment-dialog .purchase-batch-toolbar { flex:0 0 auto; margin:8px 12px; padding:8px; gap:7px; align-items:stretch; }
.purchase-adjustment-dialog .purchase-batch-toolbar :is(input,select,button) { min-height:32px; height:32px; font-size:12px; padding:4px 8px; }
.purchase-adjustment-dialog .purchase-batch-filters #batchSearch { flex:2 1 200px; }
.purchase-adjustment-dialog .purchase-batch-filters [data-batch-filter=standard] { flex:1 1 120px; }
.purchase-adjustment-dialog .purchase-batch-actions #batchAdjustmentInput { width:180px; }
.purchase-adjustment-dialog .purchase-batch-hint { font-size:12px; }
.adjustment-more-filters { position:relative; flex:0 0 auto; z-index:15; }
.adjustment-more-filters > summary { padding:6px 10px; font-size:12px; cursor:pointer; color:#2454a5; }
.adjustment-more-filters[open] > summary { background:#e6efff; border-radius:6px; }
.adjustment-more-filters > .purchase-batch-filters { position:absolute; top:36px; right:0; width:min(620px,calc(100vw - 72px)); padding:10px; border:1px solid #bfd2ee; border-radius:8px; background:white; box-shadow:0 6px 18px #152b4c26; }
.purchase-adjustment-dialog .workflow-table-wrap { flex:1 1 auto; margin:0 12px 12px; max-height:none; min-height:0; overflow:auto; }
.purchase-adjustment-dialog .adjustment-price-grid { display:grid; grid-template-columns:22px 54px minmax(0,1fr); gap:6px; min-height:0; align-items:center; padding:0; border:0; }
.purchase-adjustment-dialog .purchase-price-final-item { grid-template-columns:54px 74px minmax(0,1fr); }
.purchase-adjustment-dialog .adjustment-price-grid small { display:block; color:#697b97; font-size:11px; margin-bottom:3px; line-height:1.2; }
.purchase-adjustment-dialog .adjustment-price-grid input[type=number], .purchase-adjustment-dialog .adjustment-price-grid select { width:100%; min-width:0; text-align:center; }
.purchase-adjustment-dialog .adjustment-price-grid :is(input[type=number],select) { height:28px; min-height:28px; padding:3px 5px; border:1px solid #cbd8eb; border-radius:5px; font-size:12px; }
.purchase-adjustment-dialog [data-fill-down] { margin-top:3px; padding:3px; }
.purchase-adjustment-dialog [data-no-quote] { color:#b45309; }
.purchase-adjustment-dialog [hidden] { display:none!important; }
.purchase-adjustment-dialog .purchase-factory-choice { white-space:normal; }
.purchase-adjustment-dialog .purchase-review-table { min-width:var(--adjustment-table-width)!important; }
.purchase-adjustment-dialog .purchase-review-table :is(th,td) { padding:6px 8px; font-size:12px; }
.purchase-adjustment-dialog .purchase-review-table td { vertical-align:middle; }
.purchase-adjustment-dialog td.purchase-review-adjustment, .purchase-adjustment-dialog td.purchase-review-final { overflow:visible; }
.purchase-adjustment-dialog .adjustment-price-grid > label { display:block; min-width:0; }
.purchase-adjustment-dialog .purchase-review-adjustment .adjustment-price-grid > label:not(.purchase-factory-choice) { display:grid; grid-template-columns:minmax(0,1fr) 60px; gap:3px; }
.purchase-adjustment-dialog .purchase-review-adjustment .adjustment-price-grid > label > small { grid-column:1 / -1; }
.purchase-adjustment-dialog .purchase-review-adjustment [data-fill-down] { margin:0; padding:2px 0; }
.purchase-adjustment-dialog .adjustment-price-grid .purchase-factory-choice { display:flex; align-items:center; justify-content:center; }
.purchase-adjustment-dialog .purchase-factory-choice span { display:none; }
.purchase-adjustment-dialog .adjustment-price-grid select { display:block; }
.purchase-adjustment-dialog .procurement-confirmation { padding:0; margin-top:5px; border:0; background:transparent; text-align:left; }
.purchase-adjustment-dialog .procurement-confirmation > summary { cursor:pointer; font-size:11px; line-height:20px; }
.purchase-adjustment-dialog .procurement-confirmation[open] { padding:4px 6px; border:1px solid #d9e3f0; }
.purchase-adjustment-dialog .procurement-confirmation ul:empty { display:none; }
.purchase-adjustment-dialog .procurement-confirmation label { font-size:11px; }
.factory-adjustment-button { margin-left:8px; padding:3px 10px; min-height:26px; width:auto; border:1px solid #7fa4e4; border-radius:5px; background:#fff; color:#1b54a8; font-size:12px; font-weight:600; cursor:pointer; vertical-align:middle; }
.factory-adjustment-button:hover:not(:disabled) { background:#edf4ff; border-color:#2563eb; }
.factory-adjustment-button:disabled { opacity:.45; cursor:default; }
.manual-adjustment-actions { display:flex; flex-wrap:wrap; gap:6px; padding:6px 16px; }
.manual-adjustment-actions[hidden] { display:none; }

/* Sales overview: short summaries with secondary information disclosed on demand. */
#workspaceView { gap:12px; }
#workspaceView > .page-header h1 { font-size:23px; }
#workspaceView > .page-header p { margin-top:4px; font-size:12px; }
#workspaceView .sales-taskbar { gap:8px; padding:10px 12px; margin:0; border-radius:12px; }
#workspaceView .sales-taskbar-head strong { font-size:14px; }
#workspaceView .sales-taskbar-head button { min-height:30px; padding:5px 12px; font-size:12px; }
#workspaceView .sales-task-list { gap:8px; align-items:flex-start; }
#workspaceView .sales-task-card { flex:0 0 290px; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:5px 8px; padding:9px 10px; border-radius:9px; box-shadow:none; }
#workspaceView .sales-task-preview-button { grid-column:1 / -1; }
#workspaceView .sales-task-main { gap:3px; }
#workspaceView .sales-task-main strong { padding-right:64px; font-size:13px; }
#workspaceView .sales-task-main > span { font-size:12px; font-weight:600; }
#workspaceView .sales-task-main small { font-size:11px; }
#workspaceView .sales-task-main .sales-task-return-note { white-space:normal; line-height:1.4; }
#workspaceView .sales-task-card .task-completion { top:7px; right:8px; padding:1px 5px; font-size:10px; line-height:16px; gap:4px; }
#workspaceView .sales-task-card .task-completion i { width:6px; height:6px; }
#workspaceView .sales-task-export { grid-column:2; padding:3px 7px; font-size:11px; border-radius:6px; }
.sales-task-details { min-width:0; color:var(--muted); font-size:11px; line-height:1.5; }
.sales-task-details summary { cursor:pointer; padding:3px 0; }
.sales-task-details > div { margin-top:4px; overflow-wrap:anywhere; }
#workspaceView .manual-search-panel { margin:0; padding:10px 12px; border-radius:12px; }
#workspaceView .manual-search-panel > div:first-child { font-size:12px; }
#workspaceView .manual-search-row { margin-top:6px; }
#workspaceView .manual-search-row input { min-height:34px; }
@media (max-width:680px) {
  #workspaceView .sales-taskbar-head > div { flex-wrap:wrap; gap:3px 8px; }
  #workspaceView .sales-task-card { flex-basis:260px; }
}

/* Procurement task summaries match the compact sales overview. */
:is(.purchaser-workspace, .purchase-manager-page) .workflow-task-panel { padding:10px 12px; border-radius:12px; }
:is(.purchaser-workspace, .purchase-manager-page) .workflow-task-panel .config-title { margin-bottom:8px; padding-bottom:8px; }
:is(.purchaser-workspace, .purchase-manager-page) .workflow-task-list { gap:8px; align-items:flex-start; }
:is(.purchaser-workspace, .purchase-manager-page) .compact-workflow-task { position:relative; flex:0 0 min(290px, 82vw); min-height:0; gap:4px; padding:9px 10px; border-radius:9px; cursor:default; box-shadow:none; }
.compact-workflow-task .workflow-task-open { display:grid; gap:3px; width:100%; min-width:0; min-height:0; margin:0; padding:0; border:0; border-radius:3px; background:transparent; color:inherit; text-align:left; box-shadow:none; cursor:pointer; }
.compact-workflow-task .workflow-task-open:focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
:is(.purchaser-workspace, .purchase-manager-page) .compact-workflow-task .task-title { display:block; min-width:0; padding-right:64px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:13px; line-height:20px; }
.compact-workflow-task .workflow-task-open .task-status { font-size:12px; font-weight:600; line-height:18px; }
.compact-workflow-task .workflow-task-open small { font-size:11px; font-weight:400; line-height:17px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
:is(.purchaser-workspace, .purchase-manager-page) .compact-workflow-task .task-completion { top:7px; right:8px; padding:1px 5px; font-size:10px; line-height:16px; gap:4px; pointer-events:none; }
:is(.purchaser-workspace, .purchase-manager-page) .compact-workflow-task .task-completion i { width:6px; height:6px; }
.workflow-task-details { min-width:0; color:var(--muted); font-size:11px; line-height:1.5; }
.workflow-task-details summary { cursor:pointer; padding:3px 0; }
.workflow-task-details > div { margin-top:4px; overflow-wrap:anywhere; }
.quote-adoption-control { display:inline-flex; align-items:center; gap:5px; white-space:nowrap; font-size:12px; }
.price-group-header .quote-adoption-control { display:inline-flex; align-items:center; gap:5px; vertical-align:middle; margin-left:12px; }
.quote-adoption-control input[type="checkbox"] { flex:0 0 15px; width:15px; height:15px; min-width:15px; min-height:15px; padding:0; margin:0; }
.quote-upload-dialog { position:fixed; inset:0; margin:auto; width:min(520px,92vw); max-height:90vh; overflow:auto; border:1px solid #dbe3ef; border-radius:16px; padding:24px; color:#26354b; background:#fff; box-shadow:0 20px 80px #172b4d40; }
.quote-upload-dialog::backdrop { background:#172b4d66; }
.quote-upload-dialog form { display:flex; flex-direction:column; gap:16px; }
.quote-upload-dialog h2, .quote-upload-dialog p { margin:0; }
.quote-upload-dialog label { display:flex; flex-direction:column; gap:8px; font-weight:600; }
.quote-upload-dialog label span { display:inline; color:#d64343; }
.quote-upload-dialog input, .quote-upload-dialog textarea { width:100%; box-sizing:border-box; padding:10px 12px; border:1px solid #cbd5e1; border-radius:8px; font:inherit; font-weight:400; color:inherit; background:#fff; }
.quote-upload-dialog textarea { resize:vertical; }
.quote-upload-filename { overflow-wrap:anywhere; font-size:13px; color:#64748b; }
.quote-upload-dialog footer { display:flex; justify-content:flex-end; gap:12px; }

/* Always visible, individual purchaser status; keep compact task cards. */
.purchaser-progress { display:grid; grid-column:1 / -1; gap:4px; min-width:0; text-align:left; font-size:12px; line-height:1.5; font-weight:400; white-space:normal; }
.purchaser-progress-summary, .purchaser-progress-empty { color:var(--muted); }
.purchaser-progress-list { display:flex; flex-wrap:wrap; gap:4px; min-width:0; }
.purchaser-progress-person { display:inline-flex; flex-wrap:wrap; gap:0 5px; max-width:100%; padding:2px 6px; border-radius:5px; overflow-wrap:anywhere; }
.purchaser-progress-name { font-weight:600; }
.purchaser-progress-person.is-complete { color:#176536; background:#e8f7ec; }
.purchaser-progress-person.is-pending { color:#8a4a06; background:#fff3dd; }
.workflow-task .purchaser-progress-person > span { color:inherit; }

/* Stronger supplier bands and alternating rows; lowest-price cells follow their supplier tone. */
.excel-table tbody tr:nth-child(even) > td.purchase-price-tone-0 { background: #fae5b4; }
.excel-table tbody tr:nth-child(even) > td.purchase-price-tone-1 { background: #d3e8d1; }
.excel-table tbody tr:nth-child(even) > td.purchase-price-tone-2 { background: #cce4f0; }
.excel-table tbody tr:nth-child(even) > td.purchase-price-tone-3 { background: #ddd2ef; }
.excel-table tbody tr:nth-child(even) > td.purchase-price-tone-4 { background: #efcfe1; }
.excel-table tbody tr:nth-child(even) > td.quote-source-tone-0 { background: #fae5b4; }
.excel-table tbody tr:nth-child(even) > td.quote-source-tone-1 { background: #d3e8d1; }
.excel-table tbody tr:nth-child(even) > td.quote-source-tone-2 { background: #cce4f0; }
.excel-table tbody tr:nth-child(even) > td.quote-source-tone-3 { background: #ddd2ef; }
.excel-table tbody tr:nth-child(even) > td.quote-source-tone-4 { background: #efcfe1; }
.purchase-review-table :is(th, td).purchase-adoption-column { width:64px; min-width:64px; max-width:64px; padding-left:4px; padding-right:4px; text-align:center; }
.purchase-adoption-column .quote-adoption-control { justify-content:center; gap:0; }

/* Supplier notes stay inline with the compact confirmation prices. */
.purchase-adjustment-dialog .purchase-review-remark { grid-column:1 / -1; display:flex!important; align-items:center; gap:4px; }
.purchase-adjustment-dialog .purchase-review-remark small { margin:0; flex:0 0 auto; }
.purchase-adjustment-dialog .purchase-review-remark textarea,
.purchase-adjustment-dialog [data-no-quote-remark] textarea {
  display:block; width:100%; min-width:0; height:28px; min-height:28px; border:1px solid #cbd8eb; border-radius:5px; font-size:12px;
  resize:vertical; white-space:pre-wrap; overflow-wrap:anywhere; padding:5px 7px;
}

.excel-table .manufacturer-total-text { color: #d97706; }

/* Full quotation explanations live outside the compact table layout. */
.quote-hover-panel { position:fixed; inset:auto; margin:0; box-sizing:border-box; width:max-content; max-width:min(460px,calc(100vw - 16px)); max-height:min(420px,calc(100dvh - 16px)); overflow:auto; padding:11px 14px; border:1px solid #bdc9da; border-radius:8px; background:#fff; box-shadow:0 8px 28px #172b4d30; color:#26354b; font:12px/1.6 system-ui,"Microsoft YaHei",sans-serif; text-align:left; white-space:pre-wrap; overflow-wrap:anywhere; z-index:2147483647; overscroll-behavior:contain; }
.quote-hover-panel[hidden] { display:none!important; }
.quote-hover-panel:focus-visible { outline:2px solid #91b8e7; outline-offset:2px; }
.excel-table td.purchase-reference-price, .excel-table td.purchase-reference-price .factory-formula-trigger { color:#8b4b08; text-decoration-line:underline; text-decoration-style:dashed; text-decoration-color:#b87816; text-underline-offset:3px; text-decoration-thickness:1px; }
.excel-table td.purchase-reference-price.is-confirmed, .excel-table td.purchase-reference-price.is-confirmed .factory-formula-trigger { color:inherit; text-decoration-color:#8794a8; }
.excel-table td.sales-price-difference { color:#8b4b08; text-decoration-line:underline; text-decoration-style:dashed; text-decoration-color:#b87816; text-underline-offset:3px; text-decoration-thickness:1px; }
/* Rejected offers remain readable and their adoption controls remain usable. */
.excel-table tbody tr > td.quote-excluded-offer { background:#edf0f3!important; color:#7b8490!important; text-decoration-color:#8f99a6!important; }
.excel-table td.quote-excluded-offer .factory-formula-trigger { color:inherit!important; text-decoration-color:inherit!important; }
