:root {
  --bg: #f4f7fb;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --text: #132238;
  --muted: #67788f;
  --line: #d8e2ef;
  --brand: #2e75b6;
  --brand-dark: #245e92;
  --brand-soft: #eaf2fb;
  --accent: #f59f0b;
  --accent-soft: #fff3d7;
  --danger: #d9485f;
  --danger-soft: #fde8ec;
  --success: #2b8a6e;
  --success-soft: #def7ec;
  --shadow: 0 18px 40px rgba(19, 34, 56, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-ui: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* 销售端 V2 / 技术端 A+：待办驱动 + 订单管道。其他角色继续使用原工作台样式。 */
body.sales-v2-active,
body.tech-v2-active {
  /* 主题色改为蓝色系（取参考图 #2E75B6）。变量名沿用历史的 -red，值为蓝，避免大范围改名。 */
  --sales-v2-red: #2e75b6;
  --sales-v2-red-dark: #245e92;
  --sales-v2-red-soft: #eaf2fb;
  /* 仅逾期使用的红色强调 */
  --sales-v2-overdue: #d64541;
  --sales-v2-overdue-soft: #fdeceb;
  --sales-v2-ink: #24211f;
  --sales-v2-muted: #77716c;
  --sales-v2-line: #e8e2dc;
  background: #f3f2f0;
}

body.tech-v2-active {
  --sales-v2-red: #2e75b6;
  --sales-v2-red-dark: #245e92;
  --sales-v2-red-soft: #eaf2fb;
}

.shell.sales-v2-shell {
  width: min(880px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 104px;
  color: var(--sales-v2-ink);
}

.sales-v2-header {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px 14px;
  border-bottom: 1px solid rgba(214, 207, 200, 0.86);
  background: rgba(243, 242, 240, 0.96);
  backdrop-filter: blur(16px);
}

.sales-v2-header h1 {
  color: var(--sales-v2-ink);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.12;
}

.sales-v2-header p {
  margin: 7px 0 0;
  color: var(--sales-v2-muted);
  font-size: 13px;
}

.sales-v2-header.slim {
  align-items: center;
  justify-content: flex-end;
  padding-top: 10px;
  padding-bottom: 10px;
}

.sales-v2-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sales-account-menu-compact > summary {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sales-v2-ink);
  font-size: 12px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.sales-account-menu-compact > summary::-webkit-details-marker {
  display: none;
}

.sales-account-menu-compact > summary::after {
  content: "▾";
  font-size: 10px;
  color: var(--sales-v2-muted);
  margin-left: 2px;
}

.sales-account-menu-compact[open] > summary {
  background: rgba(46, 117, 182, 0.08);
  color: var(--sales-v2-red);
}

.sales-account-popover-fit {
  width: max-content;
  padding: 4px;
}

.sales-account-popover-fit .sales-logout-btn {
  display: block;
  width: max-content;
  min-height: 0;
  margin: 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: #f3f2f0;
  color: var(--sales-v2-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.coordinator-task-meta {
  display: block;
  margin-top: 6px;
  color: var(--sales-v2-muted, #77716c);
  font-size: 11px;
}

.coordinator-sync-note {
  color: var(--sales-v2-red);
  background: var(--sales-v2-red-soft);
}

.sales-icon-btn,
.sales-account-menu > summary {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--sales-v2-line);
  border-radius: 999px;
  background: #fff;
  color: var(--sales-v2-ink);
  font-size: 13px;
  font-weight: 650;
}

.sales-account-menu {
  position: relative;
}

.sales-account-menu.sales-account-menu-compact > summary {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
}

.sales-account-menu > summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.sales-account-menu > summary::-webkit-details-marker {
  display: none;
}

.sales-account-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(360px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--sales-v2-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(45, 37, 30, 0.16);
}

.sales-account-popover .role-switcher {
  grid-template-columns: auto minmax(120px, 1fr);
}

.sales-v2-page {
  padding: 18px 0 0;
}

.sales-todo-feed,
.sales-task-list,
.sales-pipeline-list {
  display: grid;
  gap: 12px;
}

.sales-task-section + .sales-task-section {
  margin-top: 24px;
}

.sales-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.sales-section-title h2 {
  font-size: 15px;
  letter-spacing: 0.01em;
}

.sales-section-title span {
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e7e3df;
  color: #69625c;
  font-size: 12px;
  font-weight: 700;
}

.sales-task-section.is-hot .sales-section-title h2 {
  color: var(--sales-v2-red);
}

.sales-task-section.is-hot .sales-section-title span {
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
}

.sales-task-section.is-warn .sales-section-title h2 {
  color: #b45309;
}

.sales-task-section.is-warn .sales-section-title span {
  background: #fff7ed;
  color: #b45309;
}

.sales-task-card.is-warn::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #b45309;
}

.sales-task-card.is-warn {
  border-color: rgba(180, 83, 9, 0.22);
  background: linear-gradient(90deg, #fffaf5, #fff 34%);
}

.manager-task-badge.is-warn {
  background: #fff7ed;
  color: #b45309;
}

.manager-task-badge.is-danger {
  background: var(--sales-v2-overdue-soft);
  color: var(--sales-v2-overdue);
}

.manager-leader-record {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(44, 138, 110, 0.28);
  border-radius: 14px;
  background: #e8f5f0;
  color: #2c8a6e;
  font-size: 13px;
  line-height: 1.55;
}

.manager-leader-record.pending {
  border-color: rgba(46, 117, 182, 0.22);
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
}

.sales-pipeline-card p.manager-abnormal-note {
  color: #b45309;
  font-weight: 650;
}

.sales-pipeline-card p.manager-pipeline-meta {
  color: #57514c;
  line-height: 1.55;
}

.manager-resp-tag {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--sales-v2-muted);
}

.manager-resp-tag.resp-sales,
.manager-resp-tag.resp-leader {
  color: var(--sales-v2-red);
  font-weight: 700;
}

.manager-resp-tag.resp-warn,
.manager-resp-tag.is-overdue {
  color: var(--sales-v2-overdue);
  font-weight: 700;
}

.manager-resp-tag.resp-state {
  color: var(--sales-v2-muted);
}

.sales-pipeline-card-foot b {
  color: var(--sales-v2-red);
  font-size: 11px;
  font-weight: 650;
}

.sales-task-card,
.sales-pipeline-card {
  width: 100%;
  border: 1px solid var(--sales-v2-line);
  border-radius: 16px;
  background: #fff;
  color: var(--sales-v2-ink);
  text-align: left;
  box-shadow: 0 8px 22px rgba(55, 45, 36, 0.045);
}

.sales-task-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  overflow: hidden;
}

.sales-task-card.is-hot::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--sales-v2-red);
}

.sales-task-card.is-hot {
  border-color: rgba(46, 117, 182, 0.22);
  background: linear-gradient(90deg, #fff8f7, #fff 34%);
}

.sales-task-card-main {
  min-width: 0;
  flex: 1;
}

.sales-task-card-title,
.sales-pipeline-card-top,
.sales-pipeline-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sales-task-card-title strong {
  font-size: 16px;
}

.sales-task-card p,
.sales-pipeline-card p {
  margin: 7px 0 0;
  color: #57514c;
  font-size: 13px;
  line-height: 1.55;
}

/* 技术退回原因：订单列表卡片上与待办一致地显示文字 */
.sales-pipeline-card p.pipeline-return-note {
  color: var(--sales-v2-red);
  font-weight: 650;
}

.sales-task-card small {
  display: block;
  margin-top: 7px;
  color: #97908a;
  font-size: 11px;
}

.sales-countdown {
  flex-shrink: 0;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
  font-size: 11px;
  font-weight: 750;
}

.sales-task-action {
  flex-shrink: 0;
  color: var(--sales-v2-red);
  font-size: 12px;
  font-weight: 750;
}

.sales-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 35;
  width: min(420px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(221, 214, 207, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 36px rgba(45, 37, 30, 0.16);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.sales-bottom-nav button {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #8a837c;
  font-weight: 700;
}

.sales-bottom-nav button.active {
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
}

.sales-nav-icon {
  font-size: 18px;
  line-height: 1;
}

.sales-nav-count {
  margin-left: 5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--sales-v2-red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.sales-bottom-nav button.active .sales-nav-count {
  background: var(--sales-v2-red);
  color: #fff;
}

.sales-pipeline-shell {
  display: grid;
  gap: 14px;
}

.sales-pipeline-tabs {
  position: sticky;
  top: 0;
  z-index: 26;
  display: flex;
  gap: 6px;
  padding: 12px 2px 10px;
  background: rgba(243, 242, 240, 0.96);
  overflow-x: auto;
  scrollbar-width: none;
}

.sales-pipeline-tabs::-webkit-scrollbar {
  display: none;
}

.sales-pipeline-tabs button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid var(--sales-v2-line);
  border-radius: 999px;
  background: #fff;
  color: #6f6862;
  font-size: 13px;
}

.sales-pipeline-tabs button b {
  color: #a49d97;
  font-size: 11px;
}

.sales-pipeline-tabs button.active {
  border-color: var(--sales-v2-red);
  background: var(--sales-v2-red);
  color: #fff;
}

.sales-pipeline-tabs button.active b {
  color: rgba(255, 255, 255, 0.78);
}

.draft-stage-hint {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red-dark);
  font-size: 13px;
  line-height: 1.5;
}

/* 订单页底部 ±：左 − 已关闭订单，右 ＋ 新建，与底栏左右对称 */
.sales-fab-dock {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 34;
  width: min(420px, calc(100vw - 28px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.sales-fab-dock .sales-fab {
  position: static;
  right: auto;
  pointer-events: auto;
}

/* 订单页右下角浮动新建按钮：任意分段可见，点击即新建潜在订单 */
.sales-fab {
  position: fixed;
  right: max(18px, calc((100vw - 880px) / 2));
  bottom: 96px;
  z-index: 34;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sales-v2-red), var(--sales-v2-red-dark));
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(46, 117, 182, 0.38);
  cursor: pointer;
}

.sales-fab:active {
  transform: scale(0.94);
}

.sales-pipeline-card {
  display: block;
  padding: 16px 18px;
}

.sales-pipeline-card-top strong {
  font-size: 16px;
}

.sales-pipeline-card-top span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0eeeb;
  color: #746d67;
  font-size: 11px;
  font-weight: 700;
}

.sales-pipeline-card-top span.is-mine {
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
}

.sales-pipeline-card-top span.pipeline-type-badge.is-nonstandard {
  background: #fbeecb;
  color: #a2660a;
}

.sales-pipeline-card-top span.tech-badge-mine {
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
}

.sales-pipeline-card-top span.tech-badge-wait {
  background: #f0eeeb;
  color: #746d67;
}

.sales-pipeline-card-top span.tech-badge-wait-green {
  background: #e5f5ef;
  color: #168363;
}

.sales-pipeline-card-top span.tech-badge-done {
  background: #e5f5ef;
  color: #168363;
}

.sales-pipeline-card-top span.tech-badge-due-soon {
  background: #fff7e6;
  color: #8a4b00;
}

.sales-pipeline-card-top span.tech-badge-overdue {
  background: var(--sales-v2-overdue-soft);
  color: var(--sales-v2-overdue);
}

.tech-v2-header h1,
.tech-v2-shell .sales-section-title h2 {
  letter-spacing: 0;
}

.tech-task-card.is-hot {
  background: linear-gradient(90deg, #f4fbfd, #fff 34%);
}

.tech-v2-empty > span {
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
}

.tech-action-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--sales-v2-line);
  border-left: 4px solid #c8d5e4;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(55, 45, 36, 0.045);
}

.tech-action-banner.mine,
.tech-action-banner.due-soon {
  border-left-color: var(--sales-v2-red);
  background: linear-gradient(90deg, #f4fbfd, #fff 38%);
}

.tech-action-banner.overdue {
  border-left-color: var(--sales-v2-overdue);
  background: linear-gradient(90deg, var(--sales-v2-overdue-soft), #fff 42%);
}

.tech-action-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.tech-action-who {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
  font-size: 11px;
  font-weight: 800;
}

.tech-action-banner.overdue .tech-action-who {
  background: var(--sales-v2-overdue-soft);
  color: var(--sales-v2-overdue);
}

.tech-action-main h3 {
  margin: 0;
  color: var(--sales-v2-ink);
  font-size: 16px;
}

.tech-action-main p {
  margin: 5px 0 0;
  color: var(--sales-v2-muted);
  font-size: 13px;
  line-height: 1.5;
}

.tech-product-review-card {
  margin-bottom: 12px;
}

.tech-branch-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.tech-branch-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--sales-v2-line);
  border-radius: 14px;
  background: #fff;
}

.tech-branch-row.pending {
  border-color: rgba(46, 117, 182, 0.28);
}

.tech-branch-row.returned,
.tech-branch-row.rejected {
  border-color: rgba(214, 69, 65, 0.26);
  background: #fffafa;
}

.tech-branch-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tech-branch-main strong {
  color: var(--sales-v2-ink);
  font-size: 15px;
}

.tech-branch-main p {
  margin: 3px 0 0;
  color: var(--sales-v2-muted);
  font-size: 12px;
}

.tech-branch-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tech-branch-facts span {
  min-width: 0;
  padding: 8px 9px;
  border-radius: 9px;
  background: #f8fafc;
  color: var(--sales-v2-ink);
  font-size: 12px;
  line-height: 1.4;
}

.tech-branch-facts b {
  display: block;
  margin-bottom: 2px;
  color: var(--sales-v2-muted);
  font-size: 11px;
}

.tech-branch-deadline,
.tech-branch-warning,
.tech-branch-note,
.tech-dialog-warning {
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
}

.tech-branch-deadline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
}

.tech-branch-deadline.overdue,
.tech-branch-warning,
.tech-dialog-warning {
  background: var(--sales-v2-overdue-soft);
  color: var(--sales-v2-overdue);
}

.tech-branch-deadline.due-soon {
  background: #fff7e6;
  color: #8a4b00;
}

.tech-branch-note {
  background: #f6f3ef;
  color: var(--sales-v2-muted);
}

.tech-branch-actions {
  justify-content: flex-end;
}

.tech-action-banner-compact {
  padding: 8px 12px;
  margin-bottom: 10px;
  box-shadow: none;
}

.tech-action-compact-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.tech-action-compact-text {
  min-width: 0;
  color: var(--sales-v2-muted);
  font-size: 12.5px;
  line-height: 1.45;
  /* 允许换行：该文案只在「该我/待复核」等可操作态出现，nowrap 会把详情页撑出手机屏、
     顶栏「×」被挤出可视区（只读态不出此横幅故不溢出）。改为正常换行即可根治。 */
  white-space: normal;
  overflow-wrap: anywhere;
}

.tech-branch-list-compact {
  gap: 6px;
  margin-top: 10px;
}

.tech-branch-row-compact {
  gap: 6px;
  padding: 8px 10px;
}

.tech-branch-compact-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tech-branch-compact-btn,
.tech-branch-compact-static {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
}

.tech-branch-compact-btn {
  cursor: pointer;
}

.tech-branch-row-compact.selected {
  border-color: rgba(46, 117, 182, 0.45);
  background: #f8fbff;
}

.tech-branch-approved-mark {
  flex: 0 0 14px;
  color: #2e9b5b;
  font-size: 12px;
  font-weight: 800;
}

.tech-branch-approved-mark.placeholder {
  visibility: hidden;
}

.tech-branch-todo-badge {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.tech-branch-compact-name {
  flex: 0 1 auto;
  max-width: 38%;
  min-width: 0;
  font-weight: 700;
  color: var(--sales-v2-ink);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tech-branch-compact-meta {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--sales-v2-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tech-branch-compact-meta.muted {
  flex: 1 1 auto;
}

.tech-owner-type-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid #d7e2f0;
  border-radius: 999px;
  background: #fff;
}

.tech-owner-type-btn {
  border: 0;
  background: transparent;
  color: var(--sales-v2-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.tech-owner-type-btn.active {
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
}

.tech-branch-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tech-branch-warning.compact {
  padding: 6px 8px;
  font-size: 12px;
}

.tech-config-review-header {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--sales-v2-line);
  border-radius: 12px;
  background: #fbfdff;
}

.tech-config-review-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 0;
  /* 内容一行放不下时（如产品负责人＝终审重合、名字都较长）允许整行内元素换行，
     避免右侧「调整/改派」按钮把行撑破。默认仍单行完整显示。 */
  flex-wrap: wrap;
}

.tech-config-review-label {
  flex: 0 0 42px;
  color: var(--sales-v2-muted);
  font-size: 11px;
  font-weight: 800;
}

.tech-config-review-value {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--sales-v2-ink);
  font-size: 12.5px;
  line-height: 1.4;
  /* 完整显示、不省略：一行放得下就单行，放不下随行换行（不再截断成 …） */
  white-space: normal;
  overflow-wrap: anywhere;
}

.tech-config-inline-action {
  flex: 0 0 auto;
}

.tech-config-review-controls {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-config-grade-select {
  flex: 0 0 auto;
  border: 1px solid #d7e2f0;
  border-radius: 8px;
  background: #fff;
  color: var(--sales-v2-ink);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  padding: 4px 8px;
  cursor: pointer;
}

.tech-config-review-note {
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.tech-config-review-note.muted {
  background: #f6f3ef;
  color: var(--sales-v2-muted);
}

.tech-config-review-note.overdue {
  background: var(--sales-v2-overdue-soft);
  color: var(--sales-v2-overdue);
}

.tech-config-review-note.due-soon {
  background: #fff7e6;
  color: #8a4b00;
}

#techActionDialog .dialog-section {
  gap: 12px;
}

#techActionDialog select,
#techActionDialog input[type="date"] {
  width: 100%;
  margin-top: 7px;
  border: 1px solid #d8d2cc;
  border-radius: 10px;
  padding: 10px 11px;
  font: inherit;
  color: var(--sales-v2-ink);
  background: #fff;
}

@media (max-width: 640px) {
  .tech-action-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .tech-branch-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tech-branch-actions {
    justify-content: stretch;
  }

  .tech-branch-actions .primary-btn,
  .tech-branch-actions .secondary-btn {
    flex: 1 1 calc(50% - 6px);
  }
}

/* 逾期红色强调（仅逾期时） */
.sales-pipeline-card-top span.is-overdue {
  background: var(--sales-v2-overdue-soft);
  color: var(--sales-v2-overdue);
}

.sales-pipeline-card-code {
  margin-top: 5px;
  color: #9b948d;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.sales-pipeline-card-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f0ece8;
  color: #8d857e;
  font-size: 11px;
}

.sales-pipeline-card-foot b {
  color: var(--sales-v2-red);
}

.sales-v2-empty {
  padding: 52px 24px;
  border: 1px dashed #d7cfc8;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--sales-v2-muted);
  text-align: center;
}

.sales-v2-empty > span {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e9f3ec;
  color: #43805a;
  font-size: 24px;
}

.sales-v2-empty h2 {
  margin-top: 12px;
  color: var(--sales-v2-ink);
  font-size: 18px;
}

.sales-v2-empty p {
  margin: 7px 0 0;
  font-size: 13px;
}

.sales-v2-empty.compact {
  padding: 34px 20px;
}

.sales-v2-detail-shell {
  padding-bottom: 110px;
}

.sales-v2-detail-shell .panel,
.sales-v2-detail-shell .content-card,
.sales-v2-detail-shell .timeline-item,
.sales-v2-detail-shell .comment-item {
  border-color: var(--sales-v2-line);
  box-shadow: 0 8px 24px rgba(55, 45, 36, 0.055);
}

.sales-v2-detail-shell .detail-sticky-head {
  background: rgba(243, 242, 240, 0.97);
  border-bottom-color: var(--sales-v2-line);
}

.sales-v2-detail-shell .tab-btn.active {
  border-color: rgba(46, 117, 182, 0.24);
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
}

.sales-v2-detail-shell .draft-order-group-head::before {
  background: var(--sales-v2-red);
}

.sales-v2-detail-shell .draft-order-group-head h4,
.sales-v2-detail-shell .device-template-input,
.sales-v2-detail-shell .device-template-choice strong {
  color: var(--sales-v2-ink);
}

body.sales-v2-active .primary-btn,
body.tech-v2-active .primary-btn {
  background: linear-gradient(135deg, var(--sales-v2-red), var(--sales-v2-red-dark));
}

body.sales-v2-active .secondary-btn,
body.tech-v2-active .secondary-btn {
  border-color: rgba(46, 117, 182, 0.26);
  color: var(--sales-v2-red);
}

.sales-progress-card {
  position: relative;
  padding: 16px 14px 12px;
  border: 1px solid rgba(46, 117, 182, 0.32);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(55, 45, 36, 0.055);
}

.sales-progress-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* 跟单员专用：进度条下一行「当前在哪、该不该我动手」 */
.sales-progress-note {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px dashed rgba(55, 45, 36, 0.12);
  font-size: 12px;
  line-height: 1.55;
  color: #77716c;
}

.sales-progress-note.is-mine {
  color: #b45309;
  font-weight: 700;
}

.sales-progress-steps > div {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #a19a94;
  font-size: 11px;
}

.sales-progress-steps > div::before {
  content: "";
  position: absolute;
  top: 5px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #e4dfda;
  transform: translateX(-50%);
}

.sales-progress-steps > div:first-child::before {
  display: none;
}

.sales-progress-steps > div > span,
.sales-progress-dot {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 2px solid #d6d0ca;
  border-radius: 50%;
  background: #fff;
}

.sales-progress-dot {
  padding: 0;
  appearance: none;
  cursor: pointer;
}

.sales-progress-steps > div.done::before,
.sales-progress-steps > div.current::before {
  background: var(--sales-v2-red);
}

.sales-progress-steps > div.done > span,
.sales-progress-steps > div.current > span,
.sales-progress-steps > div.done > .sales-progress-dot,
.sales-progress-steps > div.current > .sales-progress-dot {
  border-color: var(--sales-v2-red);
  background: var(--sales-v2-red);
}

.sales-progress-steps > div.paid > span,
.sales-progress-steps > div.paid > .sales-progress-dot {
  border-color: var(--sales-v2-red);
  background: var(--sales-v2-red);
}

.deposit-progress-popover {
  position: absolute;
  top: 48px;
  left: 50%;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(360px, calc(100vw - 42px));
  padding: 12px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(24, 49, 83, 0.18);
  transform: translateX(-50%);
}

.deposit-progress-popover div {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: #f8fafc;
}

.deposit-progress-popover span,
.deposit-progress-popover strong {
  display: block;
}

.deposit-progress-popover span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.deposit-progress-popover strong {
  overflow-wrap: anywhere;
  color: #183153;
  font-size: 12px;
}

.deposit-progress-popover .deposit-popover-gate {
  grid-column: 1 / -1;
}

.deposit-progress-popover .deposit-popover-gate small {
  display: block;
  color: #183153;
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.deposit-progress-popover .deposit-popover-actions {
  grid-column: 1 / -1;
  display: grid;
  justify-items: start;
  gap: 6px;
  background: #fff;
  padding: 6px 8px 0;
}

.deposit-progress-popover .deposit-popover-actions small {
  color: var(--muted);
  font-size: 11px;
}

.sales-progress-steps > div.current {
  color: var(--sales-v2-red);
  font-weight: 800;
}

.initial-review-progress-panel {
  margin-top: 10px;
  border: 1px solid #dce4ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(24, 49, 83, 0.12);
  overflow: hidden;
}

.initial-review-progress-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f6;
  background: #f8fafc;
}

.initial-review-progress-panel-head strong {
  display: block;
  font-size: 13px;
  color: #183153;
}

.initial-review-progress-panel-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.initial-review-progress-panel-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
}

.initial-review-progress-panel-scroll {
  max-height: min(52vh, 420px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px 14px;
}

.initial-review-progress-panel-scroll .irf-row {
  padding: 8px 0;
}

.initial-review-progress-panel-scroll .irf-archive-note {
  margin-bottom: 10px;
}

.sales-progress-note {
  margin: 9px 0 0;
  padding-top: 9px;
  border-top: 1px dashed var(--sales-v2-line);
  text-align: center;
  font-size: 11px;
  color: var(--sales-v2-muted);
}

.sales-v2-detail-tabs {
  margin-top: -3px;
}

.sales-v2-detail-tabs .tab-nav {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sales-v2-detail-tabs .tab-btn {
  justify-content: center;
}

.tech-v2-detail-tabs {
  margin-top: -3px;
}

.tech-v2-detail-tabs .tab-nav {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tech-v2-detail-tabs .tab-btn {
  justify-content: center;
}

/* 生产详情：标签栏从灰头卡内移出，改为头卡下方独立整行，与销售/技术保持一致 */
.production-detail-tabs {
  margin-top: -3px;
}

.production-detail-tabs .tab-nav {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.production-detail-tabs .tab-btn {
  justify-content: center;
}

/* 行动横幅：进详情第一眼回答「在谁手里 · 剩多久 · 下一步」 */
.sales-action-banner {
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--sales-v2-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(55, 45, 36, 0.055);
}

.sales-action-banner::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #c9c3bd;
}

.sales-action-banner.tone-me {
  border-color: rgba(46, 117, 182, 0.35);
  background: linear-gradient(0deg, rgba(234, 242, 251, 0.5), rgba(234, 242, 251, 0.5)), #fff;
}

.sales-action-banner.tone-me::before {
  background: var(--sales-v2-red);
}

.sales-action-banner.tone-done::before {
  background: #2b8a6e;
}

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

.sab-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--sales-v2-ink);
}

.sab-who {
  display: inline-block;
  margin-right: 7px;
  padding: 1.5px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  vertical-align: 1.5px;
  color: var(--sales-v2-muted);
  background: #efedea;
  border: 1px solid var(--sales-v2-line);
}

.sales-action-banner.tone-me .sab-who {
  color: #fff;
  background: var(--sales-v2-red);
  border-color: var(--sales-v2-red);
}

.sales-action-banner.tone-done .sab-who {
  color: #fff;
  background: #2b8a6e;
  border-color: #2b8a6e;
}

.sab-cd {
  font-size: 12px;
  font-weight: 800;
  color: var(--sales-v2-red);
  white-space: nowrap;
}

.sales-action-banner.tone-wait .sab-cd,
.sales-action-banner.tone-done .sab-cd {
  color: var(--sales-v2-muted);
  font-weight: 650;
}

.sab-sub {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--sales-v2-muted);
}

/* 要素行：一行一件事，可展开 */
.sales-facts-card {
  margin-bottom: 12px;
  border: 1px solid var(--sales-v2-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(55, 45, 36, 0.055);
  overflow: hidden;
}

.sales-fact {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid #f1eeea;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--sales-v2-ink);
  text-align: left;
  cursor: pointer;
}

.sales-fact:last-child,
.sales-fact-detail + .sales-fact:last-child {
  border-bottom: none;
}

.sales-fact.static {
  cursor: default;
}

.sales-fact .sf-i {
  flex: 0 0 auto;
  width: 18px;
  text-align: center;
  font-size: 12px;
  color: #b8b1aa;
}

.sales-fact.ok .sf-i {
  color: #2b8a6e;
}

.sales-fact .sf-i.tone-approved {
  color: #2b8a6e;
}

.sales-fact .sf-i.tone-pending {
  color: var(--sales-v2-red);
}

.sales-fact .sf-i.tone-returned,
.sales-fact .sf-i.tone-rejected {
  color: var(--sales-v2-overdue);
}

.sales-fact .sf-t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-fact.muted .sf-t {
  color: var(--sales-v2-muted);
}

.sales-fact .sf-x {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--sales-v2-muted);
}

.sales-fact .sf-x.link {
  color: var(--sales-v2-red);
  font-weight: 700;
}

.sales-fact-detail {
  padding: 2px 14px 12px 42px;
  background: #faf9f8;
  border-bottom: 1px solid #f1eeea;
}

.sfd-kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed #eee9e4;
  font-size: 12px;
}

.sfd-kv:last-child {
  border-bottom: none;
}

.sfd-kv span:first-child {
  color: var(--sales-v2-muted);
}

.sfd-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.sfd-hint {
  font-size: 10.5px;
  color: var(--sales-v2-muted);
}

/* 底栏锁定态主按钮：闸门规则可视化 */
body.sales-v2-active .primary-btn.locked-btn,
body.sales-v2-active .primary-btn.locked-btn:disabled {
  background: #e9e6e2;
  color: #a19a94;
  box-shadow: none;
  cursor: not-allowed;
}

/* 销售端 V2 详情底栏：小按钮体系（方案一）——次按钮 soft 蓝底、主按钮实底放大、锁定原因上移细字。
   悬浮卡样式与 sales-bottom-nav 同一风格语言，避免按钮直接浮在表单上 */
body.sales-v2-active .sales-v2-dock {
  gap: 8px;
  align-items: stretch;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(221, 214, 207, 0.9);
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(45, 37, 30, 0.16);
  backdrop-filter: blur(18px);
}

body.sales-v2-active .sales-v2-dock .primary-btn,
body.sales-v2-active .sales-v2-dock .secondary-btn,
body.sales-v2-active .sales-v2-dock .ghost-btn {
  min-height: 40px;
  padding: 8px 10px;
  border: none;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.sales-v2-active .sales-v2-dock .secondary-btn,
body.sales-v2-active .sales-v2-dock .ghost-btn {
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
}

body.sales-v2-active .sales-v2-dock .secondary-btn {
  flex: 0 1 auto;
  min-width: 5.2em;
}

body.sales-v2-active .sales-v2-dock .primary-btn {
  flex: 1.6 1 0;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(46, 117, 182, 0.25);
}

body.sales-v2-active .sales-v2-dock .primary-btn.locked-btn {
  flex: 1 1 0;
  box-shadow: none;
}

body.sales-v2-active .sales-v2-dock .sales-dock-hint {
  flex-basis: 100%;
  margin: 0 0 -1px;
  text-align: center;
  font-size: 10.5px;
  color: var(--sales-v2-muted);
  white-space: nowrap;
}

/* 销售端订单动态：竖线 + 圆点时间线，最新一条高亮 */
.sales-timeline {
  margin: 14px 0 2px 6px;
  padding-left: 16px;
  border-left: 2px solid #e4dfda;
}

.sales-timeline-item {
  position: relative;
  padding-bottom: 15px;
}

.sales-timeline-item:last-child {
  padding-bottom: 2px;
}

.sales-timeline-item::before {
  content: "";
  position: absolute;
  left: -22.5px;
  top: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d6d0ca;
  border: 2px solid #fff;
}

.sales-timeline-item.latest {
  margin-left: -18px;
  padding: 9px 11px 11px 16px;
  background: var(--sales-v2-red-soft);
  border-left: 3px solid var(--sales-v2-red);
  border-radius: 0 12px 12px 0;
}

.sales-timeline-item.latest::before {
  left: -26px;
  background: var(--sales-v2-red);
}

.stl-meta {
  font-size: 11px;
  color: var(--sales-v2-muted);
}

.stl-meta b {
  color: var(--sales-v2-red);
  font-weight: 700;
}

.stl-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0.5px 7px;
  border: 1px solid var(--sales-v2-line);
  border-radius: 999px;
  font-size: 10px;
  color: var(--sales-v2-muted);
}

.stl-text {
  margin-top: 2.5px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--sales-v2-ink);
}

.sales-timeline-empty {
  padding: 14px 2px 4px;
  font-size: 12.5px;
  color: var(--sales-v2-muted);
}

.history-hidden-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e4dfda;
  color: var(--sales-v2-muted);
  font-size: 12px;
}

.history-hidden-actions summary {
  width: fit-content;
  cursor: pointer;
  color: var(--sales-v2-muted);
  font-weight: 700;
  list-style-position: inside;
}

.history-hidden-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  line-height: 1.5;
}

.history-close-order-btn {
  min-height: 34px;
  padding: 7px 11px;
  border-color: #ead5d2;
  background: #fff7f6;
  color: var(--sales-v2-red);
  font-size: 12px;
}

/* ============ 固定初评资料表（草稿阶段） ============ */
.sab-gapchips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.sab-gapchip {
  border: 1px solid rgba(46, 117, 182, 0.35);
  border-radius: 999px;
  background: #fff;
  color: var(--sales-v2-red);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  cursor: pointer;
}

.fcard-irf {
  background: #fff;
  border: 1px solid var(--sales-v2-line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(55, 45, 36, 0.055);
  overflow: hidden;
}

.irf-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px 4px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--sales-v2-ink);
}

.irf-head small {
  font-size: 11px;
  font-weight: 600;
  color: var(--sales-v2-red);
}

.irf-body {
  padding: 2px 14px 12px;
}

.irf-done-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 2px;
  border: none;
  border-bottom: 1px dashed #eee9e4;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: default;
  color: var(--sales-v2-ink);
}

.irf-done-row .irf-di {
  color: #2b8a6e;
  font-size: 12px;
}

.irf-done-row .irf-dk {
  flex: 0 0 76px;
  color: var(--sales-v2-muted);
}

.irf-done-row .irf-dv {
  flex: 1;
  min-width: 0;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.55;
  font-weight: 650;
}

.irf-done-row .irf-dx {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--sales-v2-red);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.irf-field {
  padding: 12px 2px 10px;
  border-bottom: 1px dashed #eee9e4;
}

.irf-field:last-child {
  border-bottom: none;
}

.irf-field.inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.irf-field.inline .irf-flabel {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.irf-flabel {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--sales-v2-ink);
  margin-bottom: 8px;
}

.irf-flabel b {
  color: var(--sales-v2-overdue);
}

.irf-flabel small {
  color: var(--sales-v2-muted);
  font-weight: 400;
  margin-left: 4px;
}

.irf-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.irf-chips.sub {
  margin-top: 7px;
}

.irf-chip {
  border: 1px solid #d8d2cc;
  border-radius: 9px;
  background: #fff;
  color: var(--sales-v2-ink);
  font-family: inherit;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  line-height: 1.35;
}

/* 紧凑一行式：标签左置 64px，控件占满右侧 */
.irf-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px dashed #eee9e4;
}

.irf-row:last-child {
  border-bottom: none;
}

.irf-row.is-hidden {
  display: none;
}

/* 通用隐藏：如人员编辑里「新建部门」输入框，未选新建时不显示 */
.is-hidden {
  display: none;
}

.irf-rlabel {
  flex: 0 0 64px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sales-v2-ink);
  padding-top: 5px;
  line-height: 1.35;
}

.irf-rlabel b {
  color: var(--sales-v2-overdue);
}

.irf-rlabel small {
  display: block;
  font-size: 9.5px;
  font-weight: 400;
  color: var(--sales-v2-muted);
}

.irf-rctl {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.irf-rctl .irf-chips {
  gap: 5px;
}

/* 下拉控件 */
.irf-select {
  min-width: 170px;
  max-width: 100%;
  border: 1px solid #d8d2cc;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--sales-v2-ink);
}

.irf-multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 320px);
  text-align: left;
  cursor: pointer;
}

.irf-multi-select-trigger > span:last-child {
  color: var(--sales-v2-muted);
  font-size: 15px;
}

/* 电压：频率 / 相数各占一行 */
.irf-chips.subline {
  flex-basis: 100%;
  margin-top: 2px;
}

.irf-linetag {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--sales-v2-muted);
  width: 28px;
}

/* 长宽高固定一行 */
.irf-dims.oneline {
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 3px;
}

.irf-dims.oneline .irf-text.num {
  width: 52px;
}

.irf-text.money {
  width: 120px;
  text-align: left;
}

.irf-ratio-value {
  min-width: 120px;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
  font-size: 13px;
  font-weight: 800;
}

.irf-profile-hint,
.irf-profile-match {
  margin: 8px 0 10px 126px;
  padding: 10px;
  border: 1px solid #cce5d9;
  border-radius: 11px;
  color: #27765c;
  background: #f1faf6;
  font-size: 12px;
}

.irf-profile-match > strong,
.irf-profile-match > small {
  display: block;
}
.irf-profile-match > small {
  margin-top: 7px;
  color: #63746c;
  line-height: 1.45;
}
.irf-profile-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #dceee5;
}
.irf-profile-item b,
.irf-profile-item small {
  display: block;
}
.irf-profile-item small {
  color: #63746c;
}

.config-choice-summary {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  color: #267658;
  background: #eef8f3;
  text-align: left;
  font-weight: 700;
}

.config-choice-summary b {
  color: var(--brand);
  font-size: 12px;
}

/* 依赖字段未满足（输送机没选名称）：整行置灰不可填 */
.sheet-inline-field.field-dependency-locked {
  opacity: 0.5;
}

.sheet-inline-field.field-dependency-locked .sheet-line-value.derived-value {
  color: var(--muted);
}

.sheet-line-value.derived-value {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f4f7fb;
  color: #183153;
  font-weight: 700;
}

/* 长文本摘要：全文显示、按内容换行，「改」按钮贴在右上 */
.config-choice-summary.multiline {
  align-items: flex-start;
}

.config-choice-summary.multiline > span {
  min-width: 0;
  flex: 1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.config-choice-summary.multiline > b {
  flex: 0 0 auto;
  padding-top: 2px;
}
.config-choice-editor {
  display: grid;
  gap: 8px;
}
.config-choice-done {
  justify-self: end;
  padding: 5px 11px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

/* 销售配置正文：初评式完成行 + 字段列表（仅产品切换条下方 .sales-config-body） */
.sales-config-field-list {
  display: flex;
  flex-direction: column;
}

.sales-config-section .sheet-compact-head {
  margin-bottom: 2px;
}

.sales-config-body .sales-config-field-row .irf-rlabel {
  flex: 0 0 72px;
  font-size: 12px;
  color: var(--sales-v2-muted);
}

.sales-config-body .sales-config-field-row .irf-rctl {
  flex: 1;
  min-width: 0;
}

.sales-config-body .config-done-row .irf-dv {
  font-weight: 400;
  color: var(--sales-v2-ink);
}

.sales-config-body .config-choice-summary,
.sales-config-body .config-choice-done {
  display: none !important;
}

body.sales-v2-active .sales-config-body .choice-chip.selected {
  border-color: rgba(46, 117, 182, 0.42);
  background: rgba(46, 117, 182, 0.12);
  color: var(--brand);
}

.sales-config-body .config-done-row-bag.has-bag-detail {
  display: grid;
  grid-template-columns: 16px 72px 1fr auto;
  gap: 6px 8px;
  align-items: start;
}

.sales-config-body .config-done-row-bag.has-bag-detail .irf-dx {
  grid-column: 4;
  grid-row: 1;
}

.sales-config-body .sales-config-field-image-static .inline-image-preview img {
  max-width: 100%;
  height: auto;
}

.sales-config-body .config-done-row-bag .bag-block {
  grid-column: 2 / -1;
  margin-top: 2px;
}

.sales-config-body .config-done-row-bag-grid.has-bag-detail .irf-dv {
  display: none;
}

.sales-config-body .bag-size-grid-compact-table {
  min-width: 0;
}

.sales-config-body .bag-grid-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.sales-config-body .bag-grid-section-title {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}

.sales-config-body .bag-grid-section-title .bag-grid-unit {
  margin-left: 6px;
  font-weight: 600;
  color: #64748b;
  font-size: 10.5px;
}

.sales-config-body .bag-edit table {
  table-layout: fixed;
}

.sales-config-body .bag-edit tbody td {
  text-align: center;
}

.sales-config-body .bag-edit .bag-grid-ro {
  display: block;
  font-weight: 650;
  font-size: 12px;
  color: #1a2332;
  padding: 4px 2px;
}

.sales-config-body .bag-size-compact {
  display: grid;
  gap: 8px;
}

.sales-config-body .bag-compact-mode-row {
  margin-bottom: 2px;
}

.sales-config-body .bag-read {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  line-height: 1.55;
  color: #334155;
}

.sales-config-body .bag-read p {
  margin: 0 0 5px;
}

.sales-config-body .bag-read p:last-child {
  margin-bottom: 0;
}

.sales-config-body .bag-read .bag-w {
  font-weight: 700;
  color: #0f172a;
}

.sales-config-body .bag-read .bag-hint {
  color: #64748b;
  font-size: 11px;
}

.sales-config-body .bag-edit {
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  background: #fff;
}

.sales-config-body .bag-edit table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.sales-config-body .bag-edit thead th {
  padding: 6px 4px;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  font-size: 10.5px;
}

.sales-config-body .bag-edit thead th:first-child {
  text-align: left;
  padding-left: 8px;
  width: 42px;
}

.sales-config-body .bag-edit tbody td {
  padding: 5px 3px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.sales-config-body .bag-edit tbody td:first-child {
  padding-left: 8px;
  font-weight: 700;
  color: #0f172a;
}

.sales-config-body .bag-edit input.bag-compact-cell {
  width: 100%;
  min-width: 0;
  padding: 5px 2px;
  border: 0;
  border-bottom: 1px solid #94a3b8;
  border-radius: 0;
  background: #fafbfc;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
  color: #1a2332;
}

.sales-config-body .bag-edit-foot {
  padding: 6px 8px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 10.5px;
  color: #64748b;
  line-height: 1.4;
}

.sales-config-body .bag-other-note {
  margin-top: 4px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}

.sales-config-body .bag-other-note span {
  color: #64748b;
  flex: 0 0 auto;
}

.sales-config-body .bag-other-note input {
  flex: 1;
  min-width: 120px;
  border: 0;
  border-bottom: 1px solid #94a3b8;
  padding: 4px 2px;
  font: inherit;
  background: transparent;
}

.sales-config-switcher {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(46, 117, 182, 0.14);
  border-radius: 12px;
  background: #f8fbff;
}

.sales-config-switcher-head,
.sales-config-product-tab,
.product-tab-main,
.product-tab-side {
  display: flex;
  align-items: center;
}

.sales-config-switcher-head {
  justify-content: space-between;
  gap: 10px;
}

.sales-config-switcher-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.sales-config-switcher-head strong,
.sales-config-switcher-head span {
  display: block;
}

.sales-config-switcher-head strong {
  color: #183153;
}
.sales-config-switcher-head span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.sales-config-delete-toggle {
  color: #8a4a3a;
}

.sales-config-product-tabs {
  display: grid;
  gap: 8px;
}

.sales-config-product-row {
  position: relative;
  display: grid;
  gap: 6px;
}

.sales-config-product-line {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.sales-config-product-line > .sales-config-product-tab,
.sales-config-product-line > .sales-config-product-tab.is-locked {
  flex: 1 1 auto;
  min-width: 0;
}

/* ④ 产品 tab 内只读数量「× N 台」 */
.tab-qty {
  margin-left: 8px;
  color: #5b6b7f;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.tab-qty b {
  color: #183153;
  font-weight: 800;
}
.product-tab-main {
  min-width: 0;
  gap: 0;
}
.product-tab-main > b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ④ 笔按钮（编辑型号/数量），在 tab 按钮外，不触发切换 */
.sales-config-mq-pen {
  flex: 0 0 auto;
  width: 36px;
  border: 1px solid #dfe6f0;
  border-radius: 10px;
  background: #fff;
  color: #8aa0bb;
  font-size: 14px;
  cursor: pointer;
}
.sales-config-mq-pen:hover {
  color: var(--brand);
  border-color: #bcd0e8;
}
.sales-config-product-row.mq-editing .sales-config-mq-pen {
  display: none;
}

/* ④ 型号/数量编辑区：默认收起，笔展开 */
.sales-config-mq-editor {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 8px 10px;
  border: 1px solid #d7e2f0;
  border-radius: 10px;
  background: #fff;
}
.sales-config-product-row.mq-editing .sales-config-mq-editor {
  display: flex;
}
.sales-config-model-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #cfdbeb;
  border-radius: 999px;
  padding: 3px 26px 3px 12px;
  height: 30px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  font-family: inherit;
  cursor: pointer;
  background: #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' fill='none' stroke='%232e75b6' stroke-width='1.6'/></svg>")
    no-repeat right 10px center;
}
.sales-config-qty-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #5b6b7f;
  font-size: 13px;
  font-weight: 600;
}
.sales-config-step {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #cfdbeb;
  background: #fff;
  color: var(--brand);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.sales-config-qty-input {
  width: 44px;
  height: 30px;
  text-align: center;
  border: 1px solid #cfdbeb;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #1b2d42;
  background: #fff;
}
.sales-config-qty-input::-webkit-outer-spin-button,
.sales-config-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.sales-config-mq-done {
  margin-left: auto;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* #2 头部图标按钮（＋ / 🗑） */
.sales-config-icon-btn {
  min-width: 36px;
  padding: 6px 10px;
  font-size: 15px;
  line-height: 1;
}

.sales-config-delete-tip {
  color: #8a4a3a;
  font-size: 12px;
  font-weight: 700;
}

.sales-config-product-tab {
  width: 100%;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #d7e2f0;
  border-radius: 10px;
  background: #fff;
  color: #183153;
  text-align: left;
  cursor: pointer;
}

.sales-config-product-row.active .sales-config-product-tab {
  border-color: rgba(46, 117, 182, 0.45);
  background: #eef6ff;
  box-shadow: inset 3px 0 0 var(--brand);
}

.sales-config-product-row.delete-mode .sales-config-product-tab {
  border-style: dashed;
}

/* 跟单员：轮到我审的产品行整行提暖色，右侧就地出「退回 / 通过」 */
.sales-config-product-row.coordinator-review .sales-config-product-tab {
  border-color: rgba(217, 119, 6, 0.5);
  background: #fff8ef;
  box-shadow: inset 3px 0 0 #d97706;
}

.sales-config-product-row.coordinator-review.active .sales-config-product-tab {
  background: #fff3e2;
}

.coordinator-row-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.coordinator-row-actions > button {
  white-space: nowrap;
}

/* 底栏「通过 · 产品名」：产品名过长时省略，不把固定条撑成多行 */
body.sales-v2-active .sales-v2-dock .primary-btn.coordinator-approve-btn {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 24px;
}

/* 领导定金卡内联审批按钮（决策①：与底部固定条各一份） */
.gate-leader-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0 2px;
}

.gate-leader-actions > button {
  flex: 1;
  white-space: nowrap;
}

.gate-leader-hint {
  margin: 4px 0 2px;
  font-size: 11px;
  line-height: 1.5;
  color: #77716c;
}

.sales-config-product-row.delete-selected .sales-config-product-tab {
  border-color: rgba(183, 57, 42, 0.48);
  background: #fff5f2;
  box-shadow: inset 3px 0 0 #b7392a;
}

/* 删除模式：行主体不可点，右侧红色「−」选中后就地弹确认条 */
.sales-config-product-tab.is-locked {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px dashed #d7e2f0;
  border-radius: 10px;
  background: #fbfcfe;
  color: #6f7b8b;
  cursor: default;
}

.sales-config-delete-pick {
  width: 34px;
  min-width: 34px;
  height: auto;
  align-self: stretch;
  border: 1px solid #e2a89c;
  border-radius: 10px;
  background: #fff;
  color: #b7392a;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
}

.sales-config-delete-pick.active {
  border-color: #b7392a;
  background: #b7392a;
  color: #fff;
}

.sales-config-delete-confirm {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #efd0ca;
  border-radius: 10px;
  background: #fff7f5;
}

.sales-config-delete-confirm span {
  min-width: 0;
  flex: 1;
  color: #8a4a3a;
  font-size: 12px;
  font-weight: 700;
}

.product-tab-main {
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.product-tab-main b,
.product-tab-main small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-tab-main small {
  color: var(--muted);
}

.product-tab-side {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.product-tab-side small {
  color: var(--muted);
  font-size: 12px;
}

.product-tab-side em,
.device-summary-status {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.product-tab-side em.ok,
.device-summary-status.ok {
  color: #20835d;
}

.product-tab-side em.warn,
.device-summary-status.warn {
  color: #b66b00;
}

.device-summary-status.muted {
  color: var(--muted);
}

.summary-only-device {
  border-style: dashed;
  background: #fbfdff;
}

.tech-branch-row.summary-only {
  border-style: dashed;
  background: #fbfdff;
}

.sales-config-missing-line {
  padding: 8px 10px;
  border-radius: 8px;
  color: #805200;
  background: #fff7e6;
  font-size: 12px;
  line-height: 1.45;
}

.sales-config-more-status {
  position: relative;
  align-self: stretch;
}

.sales-config-more-status > summary {
  height: 100%;
  min-width: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #d7e2f0;
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.sales-config-more-status > summary::-webkit-details-marker {
  display: none;
}

.sales-config-status-popover {
  position: absolute;
  right: 0;
  z-index: 30;
  width: min(360px, calc(100vw - 34px));
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #dce4ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(24, 49, 83, 0.16);
}

.sales-config-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sales-config-status-grid span {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: #f8fafc;
  color: #183153;
  font-size: 12px;
  line-height: 1.35;
}

.sales-config-status-grid b {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
}

.sales-config-status-note {
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  background: #fff7e6;
  color: #805200;
  font-size: 12px;
  line-height: 1.45;
}

.sales-config-status-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .deposit-progress-popover {
    grid-template-columns: 1fr;
  }

  .sales-config-delete-pick {
    min-height: 40px;
  }

  .sales-config-more-status > summary {
    min-height: 34px;
  }

  .sales-config-status-popover {
    position: static;
    width: 100%;
  }

  .sales-config-status-grid {
    grid-template-columns: 1fr;
  }
}

.config-nonstandard-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: #a34700;
  background: #fff0df;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.config-reference-floating {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  justify-items: end;
  gap: 10px;
  pointer-events: none;
}

/* 销售 V2 详情底栏固定在右下，参考球需抬高以免挡住「提交当前产品配置表」 */
body.sales-v2-active .config-reference-floating {
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 76px);
}

/* 技术详情：参考球同样抬高，避让底部「退回销售 / 审核通过」动作坞 */
body.tech-v2-active .config-reference-floating {
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 76px);
}

/* 技术详情外壳的 detail-shell 带 backdrop-filter，会成为 position:fixed 的包含块，
   把右下角「参考」浮球困在面板底部、滚出屏外。技术视角去掉该模糊滤镜即可让浮球
   正常固定在视口右下（面板背景近乎不透明，去掉模糊无可感知差异）。仅作用技术视角。 */
.tech-v2-shell .detail-shell {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.config-reference-ball,
.config-reference-panel {
  pointer-events: auto;
}

.config-reference-ball {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(46, 117, 182, 0.28);
  cursor: pointer;
}

/* 参考页占满整屏：滑动只在面板内部生效，必须点「收起」才关闭 */
.config-reference-panel {
  position: fixed;
  inset: 0;
  z-index: 90;
  width: 100%;
  max-height: none;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
  overscroll-behavior: contain;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.config-reference-floating.open .config-reference-ball {
  display: none;
}

html.config-reference-locked,
body.config-reference-locked {
  overflow: hidden;
}

/* detail-shell 的毛玻璃会成为 fixed 定位的包含块，导致参考面板铺不满屏；
   面板打开时它整屏被遮住，临时去掉模糊不影响观感。 */
body.config-reference-locked .detail-shell {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.config-reference-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf1f6;
}

.config-reference-head strong,
.config-reference-head span {
  display: block;
}

.config-reference-head strong {
  color: #183153;
}
.config-reference-head span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.config-reference-device-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f6;
  overflow-x: auto;
}

.config-reference-device-tabs button {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #d8e2ee;
  border-radius: 999px;
  background: #fff;
  color: #36506f;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.config-reference-device-tabs button.active {
  border-color: rgba(46, 117, 182, 0.42);
  background: #eef6ff;
  color: var(--brand);
}

.config-reference-scroll {
  min-height: 0;
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.config-reference-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.config-reference-image {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #fff;
  color: #183153;
  text-align: left;
  cursor: pointer;
}

.config-reference-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fafc;
}

.config-reference-image span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.config-reference-block {
  padding: 10px 0;
  border-top: 1px solid #edf1f6;
}

.config-reference-block h4 {
  margin: 0 0 8px;
  color: #183153;
  font-size: 14px;
}

.config-reference-block p {
  margin: 0 0 7px;
  color: #384b63;
  font-size: 12px;
  line-height: 1.55;
}

.config-reference-block p.config-reference-note-subheading {
  margin: 10px 0 6px;
  color: #183153;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.config-reference-block p.config-reference-note-subheading:first-child {
  margin-top: 0;
}

.irf-money-lock-note,
.irf-archive-note {
  margin: 8px 0 4px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #e6f4ee;
  color: #24745e;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.55;
}

.irf-archive-note {
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
}

.irf-archive-value {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
}

.irf-product-finish {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--sales-v2-red);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.new-order-product-row .irf-rctl {
  align-items: flex-start;
}

.irf-product-summary-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #d8d2cc;
  border-radius: 9px;
  background: #fff;
  color: var(--sales-v2-ink);
  font-size: 13px;
  font-weight: 650;
}

.irf-product-summary-box > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.irf-product-multiselect .irf-rctl {
  display: grid;
  width: 100%;
}

.irf-product-options {
  display: grid;
  width: min(100%, 520px);
  max-height: 230px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #d8d2cc;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(31, 42, 55, 0.12);
}

.irf-product-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--sales-v2-ink);
  font-size: 13px;
  cursor: pointer;
}

.irf-product-option:hover,
.irf-product-option:has(input:checked) {
  background: var(--sales-v2-red-soft);
}

.irf-product-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--sales-v2-red);
}

.irf-product-popup-tip {
  padding: 2px 4px 0;
  color: var(--sales-v2-muted);
  font-size: 11px;
}

.irf-product-select {
  width: min(100%, 320px);
}

.irf-selected-products,
.irf-sample-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.irf-selected-products {
  width: 100%;
  margin-top: 6px;
}

.irf-selected-product {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 10px;
  border: 1px solid #decfc4;
  border-radius: 999px;
  background: #fffaf6;
  color: var(--sales-v2-ink);
  font-size: 12px;
  font-weight: 700;
}

.irf-selected-product button {
  border: 0;
  background: transparent;
  color: var(--sales-v2-red);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
}

.irf-sample-fields {
  margin-top: 8px;
  width: 100%;
  flex-wrap: nowrap;
}

.irf-sample-fields label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--sales-v2-muted);
  font-size: 11px;
  white-space: nowrap;
}

.irf-sample-fields input.irf-text {
  margin-top: 0;
}

.irf-sample-fields .irf-sample-recipient {
  flex: 0 0 62px;
  width: 62px !important;
}

.irf-sample-fields .irf-sample-tracking {
  flex: 1 1 180px;
  width: min(230px, 100%) !important;
}

.irf-sample-editline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow: visible;
  padding-bottom: 2px;
}

.irf-sample-editline .irf-chips {
  flex-wrap: nowrap;
}

.irf-sample-editline input.irf-text {
  margin-top: 0 !important;
}

.irf-sample-editline .irf-sample-recipient {
  flex: 0 0 74px;
  width: 74px !important;
}

.irf-sample-editline .irf-sample-tracking {
  flex: 1 1 150px;
  width: min(210px, 34vw) !important;
}

.irf-sample-receive-mark {
  flex: 0 0 auto;
  color: var(--sales-v2-muted);
  font-size: 12px;
}

.irf-sample-editline .irf-inline-edit {
  margin-left: auto;
}

.irf-bag-photo.compact {
  flex: 1 1 240px;
  min-width: 0;
  gap: 5px;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.irf-bag-photo.compact .irf-upbtn.compact {
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 10.5px;
  line-height: 1.2;
}

.irf-collapse-head .cl small.warn-part {
  color: var(--sales-v2-overdue);
  font-weight: 600;
}

.payment-gate-signal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  vertical-align: text-bottom;
}

.payment-gate-signal.danger {
  color: #fff;
  background: var(--sales-v2-red);
}

.payment-gate-signal.ok {
  color: #fff;
  background: #2b8a6e;
}

.irf-chip.sel {
  border: 1.5px solid var(--sales-v2-red);
  color: var(--sales-v2-red);
  font-weight: 700;
  background: var(--sales-v2-red-soft);
}

.irf-compact-choice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  width: 100%;
  max-width: 100%;
}

.irf-inline-edit {
  flex: 0 0 auto;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--sales-v2-red);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 2px;
}

.irf-compact-choice input.irf-text {
  margin-top: 0 !important;
}

.irf-choice-value {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--sales-v2-ink);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.5;
}

.irf-explosion-choice {
  flex-wrap: nowrap;
}

.irf-explosion-choice input.irf-text {
  flex: 1 1 180px;
}

.irf-text {
  border: 1px solid #d8d2cc;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--sales-v2-ink);
  min-width: 0;
}

.irf-text.num {
  width: 66px;
  text-align: center;
  padding: 7px 4px;
}

.irf-text.wide {
  width: 100%;
}

input.irf-text:not(.num):not(.wide) {
  margin-top: 7px;
  width: min(240px, 100%);
}

.irf-inline-input {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--sales-v2-muted);
}

.irf-dims {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--sales-v2-muted);
  flex-wrap: wrap;
}

.irf-unit {
  font-size: 11px;
  color: var(--sales-v2-muted);
}

.irf-sublabel {
  font-size: 12px;
  font-weight: 700;
  color: var(--sales-v2-ink);
  margin: 10px 0 7px;
}

.irf-sublabel small {
  color: var(--sales-v2-muted);
  font-weight: 400;
}

.irf-bag-spec {
  margin-top: 9px;
  padding: 9px 10px;
  background: #faf9f8;
  border-radius: 11px;
}

.irf-text.irf-invalid {
  border-color: #c84a43;
  background: #fff4f2;
  box-shadow: 0 0 0 2px rgba(200, 74, 67, 0.12);
}

.irf-input-error {
  flex: 1 0 100%;
  min-height: 14px;
  color: #b93832;
  font-size: 11px;
  line-height: 1.35;
}

.irf-input-error:empty {
  display: none;
}

.irf-bag-spec-layout {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.irf-bag-spec-title {
  font-size: 12px;
  font-weight: 700;
  margin: 7px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #555f6c;
  line-height: 1.35;
}

.irf-bag-dimension-row .irf-bag-spec-title {
  flex: 0 0 64px;
  margin: 0;
  padding-top: 7px;
  align-self: flex-start;
}

.irf-bag-dimension-row .irf-bag-spec-values {
  display: block;
  width: 100%;
  padding: 2px 8px 8px;
  border-radius: 10px;
  background: #faf9f8;
}

.irf-bag-other-name {
  width: 64px !important;
  margin-top: 4px !important;
  padding: 5px 4px;
}

.irf-bag-spec-values {
  min-width: 0;
}

.irf-specrow {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--sales-v2-muted);
  margin-top: 7px;
}

.irf-spec-main-line,
.irf-spec-m-line,
.irf-spec-dimension,
.irf-spec-weight {
  display: flex;
  align-items: center;
  gap: 4px;
}

.irf-spec-main-line {
  flex-wrap: nowrap;
  min-width: max-content;
}

.irf-spec-m-line {
  padding-left: 93px;
}

.irf-specrow .irf-text.num {
  width: 54px;
  margin-top: 0;
}

.irf-specrow .irf-text.num.irf-spec-kg {
  width: 28px;
}

.irf-bag-dimension-row .irf-bag-spec-values {
  overflow-x: auto;
}

.irf-bag-type-picker {
  display: grid;
  width: min(100%, 520px);
  gap: 6px;
}

.irf-bag-type-picker .irf-bag-other-name {
  width: min(240px, 100%) !important;
  margin-top: 0 !important;
}

.irf-bag-type-summary > span {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.irf-bag-spec-table-head,
.irf-bag-spec-table-row {
  display: grid;
  grid-template-columns: minmax(40px, 0.67fr) repeat(3, minmax(58px, 1fr));
  gap: 6px;
  align-items: center;
  min-width: 300px;
  padding: 7px 8px;
}

.irf-bag-spec-table-head {
  width: 100%;
  color: #626b76;
  background: #f2f0ed;
  border: 1px solid #e4dfda;
  border-radius: 9px 9px 0 0;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.irf-bag-spec-head-row {
  padding-bottom: 0;
  border-bottom: 0;
}

.irf-bag-spec-head-row > .irf-rlabel,
.irf-bag-spec-group > .irf-bag-spec-group-label {
  flex-basis: 82px;
}

.irf-bag-spec-head-row .irf-rctl,
.irf-bag-spec-group .irf-rctl {
  display: block;
  overflow-x: auto;
}

.irf-bag-spec-group {
  padding-top: 0;
}

.irf-bag-spec-group-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-width: 0;
  padding-top: 8px;
  color: #555f6c;
}

.irf-bag-spec-group-label > .irf-bag-spec-name {
  width: 100%;
  min-width: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.irf-bag-spec-group-label .irf-addrow.compact {
  flex: 0 0 auto;
  margin-left: 0;
  margin-top: 1px;
}

.irf-bag-spec-group-label .irf-bag-other-name {
  width: 78px !important;
  min-width: 0;
  margin-top: 0 !important;
}

.irf-bag-spec-group-values {
  min-width: 300px;
  overflow: hidden;
  border: 1px solid #e4dfda;
  border-radius: 0 0 9px 9px;
  background: #faf9f8;
}

.irf-bag-spec-table-row + .irf-bag-spec-table-row {
  border-top: 1px dashed #e7e2dd;
}

.irf-bag-spec-table-row .irf-text.num {
  width: 100% !important;
  min-width: 0;
  margin-top: 0 !important;
}

.irf-bag-spec-empty {
  min-height: 30px;
}

.irf-bag-done-block {
  padding-bottom: 8px;
  border-bottom: 1px dashed #eee9e4;
}

.irf-bag-summary-table {
  margin: 3px 8px 7px 26px;
  overflow-x: auto;
  border: 1px solid #e8e3de;
  border-radius: 9px;
}

.irf-bag-summary-head,
.irf-bag-summary-group,
.irf-bag-summary-row {
  display: grid;
  gap: 6px;
  padding: 6px 8px;
  align-items: center;
}

.irf-bag-summary-head,
.irf-bag-summary-group {
  grid-template-columns: minmax(110px, 1.45fr) minmax(280px, 4fr);
  min-width: 420px;
}

.irf-bag-summary-head {
  grid-template-columns: minmax(110px, 1.45fr) repeat(4, minmax(58px, 1fr));
}

.irf-bag-summary-row {
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  min-width: 280px;
  padding: 0;
}

.irf-bag-summary-head {
  background: #f6f3f0;
  color: var(--sales-v2-muted);
  font-size: 10.5px;
  font-weight: 800;
}

.irf-bag-summary-row {
  color: var(--sales-v2-ink);
  font-size: 11.5px;
}

.irf-bag-summary-group + .irf-bag-summary-group,
.irf-bag-summary-row + .irf-bag-summary-row {
  border-top: 1px dashed #eee9e4;
}

.irf-bag-summary-name {
  color: #555f6c;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.irf-bag-summary-meta {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
  margin: 5px 8px 0 26px;
  color: var(--sales-v2-ink);
  font-size: 11.5px;
  line-height: 1.5;
}

.irf-bag-summary-meta > span {
  display: inline-flex;
  gap: 7px;
}

.irf-bag-summary-meta b {
  color: var(--sales-v2-muted);
  white-space: nowrap;
}

.irf-row-del {
  border: none;
  background: #efedea;
  color: var(--sales-v2-muted);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.irf-addrow {
  display: inline-block;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--sales-v2-red);
  margin-top: 8px;
  cursor: pointer;
  padding: 2px 0;
}

.irf-addrow.compact {
  margin: 0 0 0 3px;
  padding: 2px 5px;
  border-radius: 7px;
  background: var(--sales-v2-red-soft);
  font-size: 17px;
  line-height: 1;
}

.irf-bag-photo {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1.5px dashed rgba(46, 117, 182, 0.4);
  border-radius: 11px;
  background: var(--sales-v2-red-soft);
}

.irf-bag-photo-thumbs {
  display: flex;
  flex: 1 1 120px;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.irf-compact-choice > .irf-bag-photo-thumbs {
  flex-basis: 100%;
}

.irf-bag-photo-item {
  position: relative;
  display: inline-flex;
}

.irf-bag-photo-thumb {
  display: block;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid #ccd8e5;
  border-radius: 8px;
  background: #fff;
  padding: 0;
  cursor: pointer;
}

.irf-bag-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.irf-bag-photo-del {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 1;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sales-v2-ink);
  color: #fff;
  font: 700 12px/18px inherit;
  cursor: pointer;
}

.irf-photo-tip {
  flex: 1;
  min-width: 150px;
  font-size: 11px;
  color: var(--sales-v2-muted);
  line-height: 1.5;
}

.irf-photo-tip b {
  color: var(--sales-v2-red);
}

.irf-collapse {
  background: #fff;
  border: 1px solid var(--sales-v2-line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(55, 45, 36, 0.055);
  overflow: hidden;
}

.irf-collapse-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 14px;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.irf-collapse-head .cl {
  font-size: 13px;
  font-weight: 700;
  color: var(--sales-v2-ink);
}

.irf-collapse-head .cl small {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--sales-v2-muted);
  margin-top: 2px;
}

.irf-collapse-head .arr {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--sales-v2-muted);
  font-weight: 700;
  white-space: nowrap;
}

.irf-collapse.open .irf-collapse-head {
  border-bottom: 1px solid #f1eeea;
}

.irf-collapse-body {
  padding: 2px 14px 13px;
}

.irf-attachment-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.irf-attachment-head .irf-flabel {
  flex: 1 1 auto;
  min-width: 0;
}

.irf-attachment-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.irf-attachment-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--sales-v2-line);
}

.irf-upbtn {
  flex: 1;
  text-align: center;
  border: 1.5px dashed rgba(46, 117, 182, 0.4);
  border-radius: 12px;
  padding: 12px 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--sales-v2-red);
  background: var(--sales-v2-red-soft);
  cursor: pointer;
  line-height: 1.45;
}

.irf-upbtn small {
  display: block;
  font-weight: 400;
  color: var(--sales-v2-muted);
  font-size: 10px;
}

.irf-upbtn.compact {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 10px;
}

.irf-upbtn.irf-attachment-upload {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.irf-attachment-section .irf-thumbrow,
.irf-attachment-section .irf-empty {
  margin-top: 8px;
}

.irf-thumbrow {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.irf-thumb {
  position: relative;
  width: 66px;
  display: grid;
  gap: 3px;
  justify-items: center;
}

.irf-thumb img {
  width: 66px;
  height: 66px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--sales-v2-line);
}

.irf-thumb.file .irf-file-name {
  width: 66px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  color: var(--sales-v2-muted);
  background: #f6f4f2;
  border: 1px solid var(--sales-v2-line);
  border-radius: 10px;
  padding: 4px;
  overflow: hidden;
  word-break: break-all;
  text-decoration: none;
}

.irf-attachment-view {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.irf-thumb small {
  font-size: 9.5px;
  color: var(--sales-v2-muted);
}

.irf-thumb-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: none;
  background: var(--sales-v2-ink);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.irf-note {
  width: 100%;
  border: 1px solid #d8d2cc;
  border-radius: 11px;
  padding: 9px 11px;
  font-size: 12.5px;
  font-family: inherit;
  min-height: 58px;
  resize: none;
  background: #fff;
  color: var(--sales-v2-ink);
}

.irf-empty {
  font-size: 12px;
  color: var(--sales-v2-muted);
  padding: 6px 0;
  line-height: 1.6;
}

.irf-readonly {
  font-size: 12.5px;
  color: var(--sales-v2-ink);
}

.irf-preview-group {
  padding: 8px 0;
  border-bottom: 1px dashed #eee9e4;
  font-size: 12px;
  line-height: 1.6;
}

.irf-preview-group:last-child {
  border-bottom: none;
}

.irf-preview-group strong {
  display: block;
  font-size: 12px;
}

.irf-preview-group span {
  color: var(--sales-v2-muted);
  font-size: 11px;
}

.potential-gap-line {
  color: var(--sales-v2-red) !important;
  font-weight: 650;
}

.potential-ready-line {
  color: #2b8a6e !important;
  font-weight: 650;
}

/* 配置表分组锚点条 */
.config-anchor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.config-anchor-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.config-anchor-row::-webkit-scrollbar {
  display: none;
}

.config-anchor-chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid var(--sales-v2-line);
  border-radius: 999px;
  background: #fff;
  color: var(--sales-v2-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.config-anchor-chip.warn {
  color: var(--sales-v2-red);
  border-color: rgba(46, 117, 182, 0.35);
  background: var(--sales-v2-red-soft);
}

.config-anchor-count {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--sales-v2-muted);
  white-space: nowrap;
}

[data-config-anchor="common"],
.order-device-group {
  scroll-margin-top: 118px;
}

body.sales-v2-active #orderForm .dialog-actions .primary-btn {
  background: linear-gradient(135deg, var(--sales-v2-red), var(--sales-v2-red-dark));
}

body.sales-v2-active .draft-order-group-head::before {
  background: var(--sales-v2-red);
}

body.sales-v2-active .draft-order-group-head h4 {
  color: var(--sales-v2-ink);
}

body.sales-v2-active .choice-chip.selected {
  border-color: rgba(46, 117, 182, 0.36);
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
}

body.sales-v2-active .draft-order-control .sheet-inline-input:focus,
body.sales-v2-active .draft-order-control .sheet-textarea:focus,
body.sales-v2-active .draft-inline-select:focus {
  border-color: rgba(46, 117, 182, 0.46);
}

@media (max-width: 760px) {
  .shell.sales-v2-shell {
    width: 100%;
    padding: 0 12px calc(92px + env(safe-area-inset-bottom));
  }

  .sales-v2-header {
    margin: 0 -12px;
    padding: 14px 14px 12px;
  }

  .sales-v2-header h1 {
    font-size: 23px;
  }

  .sales-v2-header p {
    font-size: 11px;
  }

  .sales-icon-btn {
    min-height: 34px;
    padding: 0 9px;
    font-size: 11px;
  }

  .sales-account-menu > summary {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .sales-v2-page {
    padding-top: 14px;
  }

  .sales-pipeline-tabs {
    margin: 0 -12px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .sales-task-card {
    padding: 14px;
    gap: 9px;
  }

  .sales-task-card-title {
    align-items: flex-start;
  }

  .sales-task-card-title strong,
  .sales-pipeline-card-top strong {
    font-size: 15px;
  }

  .sales-task-action {
    max-width: 52px;
    text-align: right;
  }

  .sales-bottom-nav {
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .sales-fab {
    right: 16px;
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 82px);
  }

  .sales-fab-dock {
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 82px);
    width: min(420px, calc(100vw - 28px));
  }

  .sales-fab-dock .sales-fab {
    right: auto;
  }

  .sales-pipeline-card {
    padding: 14px;
  }

  .sales-v2-detail-shell {
    padding-bottom: 104px;
  }

  .sales-progress-card {
    padding: 13px 4px;
  }

  .sales-progress-steps > div small {
    font-size: 10px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(46, 117, 182, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(245, 159, 11, 0.15), transparent 18%),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 20px auto 40px;
}

.detail-shell-page {
  margin-top: 0;
}

.toast-banner {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 40;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(216, 226, 239, 0.94);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(19, 34, 56, 0.14);
  font-size: 14px;
  font-weight: 600;
}

.toast-success {
  color: var(--success);
}

.toast-danger {
  color: var(--danger);
}

.sticky-chrome {
  position: sticky;
  top: 0;
  z-index: 28;
  padding-top: 10px;
  background: linear-gradient(
    180deg,
    rgba(244, 247, 251, 0.99),
    rgba(244, 247, 251, 0.95),
    rgba(244, 247, 251, 0.78),
    transparent
  );
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 4px;
}

.anonymous-topbar {
  min-height: 48px;
}

.auth-mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.compact-appbar {
  align-items: center;
  min-height: 54px;
  padding: 6px 0;
}

.compact-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.header-account-row {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  max-width: min(100%, 420px);
}

.sales-account-popover-single {
  width: max-content;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sales-logout-btn-single {
  display: block;
  width: max-content;
  min-height: 24px;
  margin: 0;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.sales-v2-shell .sales-logout-btn-single {
  border-color: var(--sales-v2-line, rgba(221, 214, 207, 0.95));
  color: var(--sales-v2-muted, #77716c);
}

.simulation-idle-menu {
  position: relative;
  flex: 0 0 auto;
}

.simulation-idle-menu > summary {
  list-style: none;
  position: relative;
  min-height: 24px;
  padding: 3px 18px 3px 8px;
  border: 1px solid #b42318;
  border-radius: 6px;
  background: #fff;
  color: #b42318;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.simulation-idle-menu > summary::-webkit-details-marker {
  display: none;
}

.simulation-idle-menu > summary::after {
  content: "▾";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #b42318;
  pointer-events: none;
}

.simulation-idle-menu[open] > summary::after {
  transform: translateY(-50%) rotate(180deg);
}

.simulation-idle-popover {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 46;
  min-width: 9em;
  max-height: 160px;
  overflow-y: auto;
  padding: 2px;
  border: 1px solid #b42318;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(127, 29, 29, 0.12);
  box-sizing: border-box;
}

.header-account-row .sales-account-menu-compact > summary {
  min-height: 28px;
  padding: 0 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
}

.header-account-row .sales-account-menu-compact > summary::after {
  content: "▾";
  margin-left: 2px;
  font-size: 10px;
  color: var(--muted);
}

.header-account-row .sales-account-menu-compact[open] > summary {
  color: var(--brand);
  background: rgba(46, 117, 182, 0.08);
}

.compact-page-heading h1 {
  font-size: clamp(20px, 2.5vw, 28px);
  white-space: nowrap;
}

.identity-menu,
.sales-account-menu {
  position: relative;
}

.identity-menu > summary {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 650;
}

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

.identity-menu > summary::after,
.sales-account-menu > summary::after {
  content: "⌄";
  margin-left: 7px;
  color: var(--muted);
}

.identity-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 45;
  width: min(380px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.session-identity-summary {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.session-identity-summary span {
  color: var(--muted);
  font-size: 12px;
}

.simulation-entry-note {
  color: #8f1d18 !important;
}

.session-mode-section {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  align-items: center;
  gap: 7px 10px;
  margin-top: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.session-mode-section .inline-note,
.session-mode-heading {
  grid-column: 1 / -1;
}

.session-mode-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.session-mode-heading span {
  font-size: 11px;
}

.session-mode-section.readonly-mode {
  border-color: #e6c685;
  background: #fffaf0;
}

.session-mode-section.readonly-mode .session-mode-heading,
.session-mode-section.readonly-mode .session-mode-heading span {
  color: #805500;
}

.session-mode-section.simulation-mode {
  border-color: #e7aaa5;
  background: #fff3f2;
}

.session-mode-section.simulation-mode .session-mode-heading,
.session-mode-section.simulation-mode .session-mode-heading span {
  color: #8f1d18;
}

.session-simulation-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid #edb7b3;
  border-radius: 12px;
  background: #fff0f0;
  color: #9d3b34;
}

.simulation-strip-wrap {
  position: relative;
  z-index: 50;
  padding: 4px 2px 0;
  margin: 0 0 4px;
}

.simulation-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

.simulation-strip-text {
  min-width: 0;
  font-size: 11px;
  font-weight: 400;
  color: #b42318;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.simulation-strip-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.simulation-stop-btn-compact {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 2px 0;
  border: 1px solid #b42318;
  border-radius: 6px;
  background: #fff;
  color: #b42318;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  width: 5.25em;
  text-align: center;
}

.simulation-switch-menu {
  position: static;
  flex: 0 0 auto;
}

.simulation-switch-menu > summary {
  list-style: none;
  position: relative;
  min-height: 22px;
  padding: 2px 18px 2px 8px;
  border: 1px solid #b42318;
  border-radius: 6px;
  background: #fff;
  color: #b42318;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.simulation-switch-menu > summary::-webkit-details-marker {
  display: none;
}

.simulation-switch-menu > summary::after {
  content: "▾";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #b42318;
  pointer-events: none;
}

.simulation-switch-menu[open] > summary::after {
  transform: translateY(-50%) rotate(180deg);
}

.simulation-switch-popover {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 6;
  width: auto;
  min-width: 0;
  max-height: 160px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px;
  border: 1px solid #b42318;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(127, 29, 29, 0.12);
  box-sizing: border-box;
}

.simulation-switch-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 4px 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #b42318;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.simulation-switch-option:hover {
  background: rgba(180, 35, 24, 0.08);
}

.simulation-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 10px;
  padding: 10px 14px;
  border: 1px solid #edb7b3;
  border-left: 4px solid #b42318;
  border-radius: 12px;
  background: #fff0f0;
  color: #7f1d1d;
  box-shadow: 0 8px 24px rgba(127, 29, 29, 0.1);
}

.simulation-banner div {
  display: grid;
  gap: 2px;
}

.simulation-banner span {
  font-size: 12px;
}

.simulation-stop-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #b42318;
  border-radius: 10px;
  background: #b42318;
  color: #fff;
  font-weight: 700;
}

.title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.title-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  font-size: 12px;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  min-width: 0;
  word-break: break-word;
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 700;
}

.role-switcher {
  display: grid;
  grid-template-columns: auto minmax(120px, 168px);
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

.compact-session-controls {
  width: 100%;
  grid-template-columns: auto minmax(160px, 1fr);
}

.role-switcher label {
  color: var(--muted);
  white-space: nowrap;
}

.role-switcher .inline-note,
.role-switcher .readonly-field {
  grid-column: 1 / -1;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ccd8e7;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

.role-switcher select {
  width: 100%;
  border-radius: 999px;
}

.compact-readonly {
  min-height: auto;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.view-stack {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.auth-gate-panel {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}

.auth-progress-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 150px;
  padding: 24px;
}

.auth-shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 900;
}

.auth-progress-copy {
  min-width: 0;
}

.auth-progress-copy h2 {
  margin-top: 2px;
  font-size: clamp(22px, 4vw, 30px);
}

.auth-progress-copy p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

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

.auth-diagnostics,
.auth-dev-login {
  border-top: 1px solid var(--line);
}

.auth-diagnostics > summary,
.auth-dev-login > summary {
  padding: 14px 24px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.auth-diagnostics[open] > .inline-note,
.auth-dev-login > .form-grid,
.auth-dev-login > .detail-actions-static {
  margin: 0 24px 14px;
}

.auth-retry-row {
  padding: 0 24px 18px;
}

.panel,
.content-card,
.status-tile,
.timeline-item,
.comment-item,
.history-item,
.order-item,
.dialog-card {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(216, 226, 239, 0.94);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.panel,
.content-card {
  padding: 22px;
}

.user-management-page {
  max-width: 980px;
  margin: 0 auto;
}

.system-admin-shell {
  width: min(1480px, calc(100vw - 32px));
}

.system-admin-shell .user-management-page {
  width: 100%;
  max-width: none;
  margin: 0;
}

.system-admin-shell .user-management-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-management-form-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
}

.user-management-form-grid {
  margin-top: 14px;
}

.user-enabled-field {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: end;
  min-height: 46px;
}

.user-enabled-field input {
  width: auto;
}

.user-management-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.um-subtabs,
.user-search-tools,
.user-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.um-subtabs {
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.um-subtabs button {
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.um-subtabs button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.user-department-filter {
  display: grid;
  grid-template-columns: auto minmax(220px, 360px);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.user-department-filter select {
  min-height: 44px;
}

.user-search-tools {
  align-items: stretch;
}

.user-management-toolbar,
.user-management-primary-actions,
.user-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.user-management-primary-actions {
  flex: 0 0 auto;
}

.user-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  color: var(--muted);
  flex: 1 1 320px;
}

.user-search-field input {
  min-height: 44px;
  padding: 9px 0;
  border: 0;
  background: transparent;
  outline: 0;
}

.user-department-group {
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
}

.user-department-group + .user-department-group {
  margin-top: 14px;
}

.user-department-heading {
  position: sticky;
  top: 64px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 13px;
}

.user-department-heading span {
  font-weight: 650;
}

.user-management-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(90px, 0.55fr) minmax(150px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  text-align: left;
}

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

.user-management-row:hover,
.user-management-row:focus-visible {
  background: #f7fafc;
  outline: 0;
}

.user-management-row.is-disabled {
  color: var(--muted);
  background: #f7f8fa;
}

.user-management-row.is-locked {
  color: var(--muted);
  background: #f4f5f7;
}

.user-management-row.is-locked:hover,
.user-management-row.is-locked:focus-visible {
  background: #eef0f3;
}

.user-management-row-name {
  font-weight: 750;
}

.user-management-row-meta {
  color: var(--muted);
  font-size: 13px;
}

.user-management-row-arrow {
  color: var(--brand);
  font-size: 24px;
  line-height: 1;
}

.user-search-empty {
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

.user-pagination {
  justify-content: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.user-detail-page {
  max-width: 920px;
}

.user-detail-heading {
  justify-content: flex-start;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.user-detail-form {
  margin-top: 20px;
}

.user-detail-actions {
  margin-top: 18px;
}

.user-management-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
}

.user-management-item.is-disabled {
  opacity: 0.68;
}

.user-management-item-main {
  min-width: 0;
}

.user-management-item-title,
.user-management-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-management-item-meta,
.user-management-item code {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.user-management-item code {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

@media (max-width: 640px) {
  .user-management-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-management-item-actions {
    width: 100%;
  }

  .user-management-item-actions button {
    flex: 1;
  }

  .user-management-page {
    padding: 14px;
  }

  .user-management-toolbar {
    align-items: flex-start;
  }

  .user-management-toolbar .inline-note {
    display: none;
  }

  .user-management-primary-actions {
    gap: 7px;
  }

  .user-management-primary-actions .status-pill {
    display: none;
  }

  .user-management-row {
    grid-template-columns: minmax(62px, auto) minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 54px;
    padding: 10px 12px;
  }

  .user-management-row .status-pill {
    grid-column: 1 / 3;
    justify-self: start;
  }

  .user-management-row-arrow {
    grid-column: 3;
    grid-row: 1;
  }

  .user-management-row-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .user-search-tools {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .user-search-field {
    grid-column: 1 / -1;
    width: 100%;
    margin-bottom: 0;
  }

  .user-department-filter {
    grid-template-columns: 1fr;
  }

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

  .user-detail-heading {
    display: grid;
    gap: 12px;
  }
}

@media (max-width: 760px) {
  .sticky-chrome {
    padding-top: 2px;
  }

  .compact-appbar {
    min-height: 48px;
    gap: 8px;
  }

  .compact-page-heading {
    gap: 7px;
  }

  .compact-page-heading h1 {
    font-size: 17px;
  }

  .identity-menu > summary {
    max-width: 54vw;
    min-height: 34px;
    padding: 6px 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }

  .identity-popover {
    position: fixed;
    top: max(66px, env(safe-area-inset-top));
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - 86px);
    overflow: auto;
  }

  .compact-session-controls {
    grid-template-columns: 1fr;
  }

  .compact-session-controls > * {
    grid-column: 1 !important;
  }

  .compact-session-controls .role-switcher-label {
    display: block;
    margin-top: 4px;
    font-size: 11px;
  }

  .compact-session-controls .session-mode-section {
    grid-template-columns: 1fr;
  }

  .compact-session-controls .session-mode-section > * {
    grid-column: 1;
  }

  .simulation-banner {
    align-items: flex-start;
    margin-bottom: 6px;
    padding: 9px 10px;
  }

  .simulation-banner span {
    display: block;
    margin-top: 2px;
  }

  .simulation-stop-btn {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 12px;
  }

  .auth-gate-panel {
    margin-top: 2px;
  }

  .auth-progress-card {
    min-height: 132px;
    padding: 18px 16px;
  }

  .auth-progress-copy h2 {
    font-size: 22px;
  }

  .auth-progress-copy p:last-child {
    font-size: 13px;
  }

  .auth-diagnostics > summary,
  .auth-dev-login > summary {
    padding: 12px 16px;
  }

  .auth-diagnostics[open] > .inline-note,
  .auth-dev-login > .form-grid,
  .auth-dev-login > .detail-actions-static {
    margin-right: 16px;
    margin-left: 16px;
  }
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.hero-panel p {
  margin: 0;
}

.hero-note {
  color: var(--muted);
  line-height: 1.65;
  margin-top: 10px !important;
}

.panel-kicker {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

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

.status-bar-shell {
  padding: 8px 0 10px;
}

.finance-status-bar-shell {
  width: min(1240px, calc(100vw - 40px));
  margin-left: auto;
  margin-right: auto;
}

.production-status-bar-shell .status-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.production-status-bar-shell .status-tile {
  min-height: 58px;
  padding: 8px 10px;
}

.production-status-bar-shell .status-label {
  font-size: 12px;
}

.production-status-bar-shell .status-value {
  font-size: 18px;
  line-height: 1;
}

.status-tile {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.status-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(46, 117, 182, 0.28);
}

.status-tile.active {
  border-color: rgba(46, 117, 182, 0.3);
  background: linear-gradient(180deg, #ffffff, #eef5ff);
  box-shadow: 0 12px 24px rgba(46, 117, 182, 0.08);
}

.status-tile.active .status-label,
.status-tile.active .status-value {
  color: var(--brand);
}

.status-label {
  color: var(--muted);
  font-size: 14px;
  white-space: normal;
  line-height: 1.2;
}

.feature-panel-success {
  border-color: rgba(43, 138, 110, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 252, 247, 0.96)), var(--panel);
}

.status-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.dual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 18px;
}

.panel-head,
.card-head,
.section-head,
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.detail-head > div:first-child {
  min-width: 0;
  flex: 1;
}

.detail-close-btn {
  align-self: flex-start;
  margin-left: auto;
  font-size: 28px;
  padding: 0 4px;
  flex-shrink: 0;
  min-width: 40px;
  min-height: 40px;
}

.sales-v2-detail-shell .detail-close-btn,
.tech-v2-shell .detail-close-btn {
  border-radius: 10px;
  background: rgba(238, 233, 228, 0.95);
  color: #5c564f;
  line-height: 40px;
  text-align: center;
}

.panel-head p,
.card-head p,
.detail-head p {
  margin: 0;
}

.card-tip,
.status-pill,
.tag,
.placeholder-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.card-tip,
.tag {
  background: #eef4fb;
  color: var(--muted);
}

.status-pill {
  background: var(--brand-soft);
  color: var(--brand);
}

.status-pill.closed {
  background: #f0f3f8;
  color: #58677d;
}

.status-pill.completed {
  background: var(--success-soft);
  color: var(--success);
}

.quick-list,
.history-list,
.list-body,
.record-grid,
.timeline-list,
.comment-list,
.placeholder-list,
.overview-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.compact-list {
  gap: 10px;
}

.order-item,
.history-item {
  padding: 16px 18px;
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.order-item:hover,
.history-item:hover {
  transform: translateY(-1px);
  border-color: rgba(46, 117, 182, 0.28);
}

.order-item h3,
.history-item h3 {
  font-size: 18px;
  line-height: 1.38;
  word-break: break-word;
  margin-top: 6px;
}

.compact-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  text-align: left;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid rgba(216, 226, 239, 0.94);
  border-radius: 22px;
  box-shadow: var(--shadow);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.compact-order-item-inline {
  width: 100%;
  padding-right: 118px;
}

.compact-order-item:hover {
  transform: translateY(-1px);
  border-color: rgba(46, 117, 182, 0.28);
}

.compact-order-main {
  min-width: 0;
  flex: 1;
}

.compact-order-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.compact-order-code {
  color: var(--brand);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.compact-order-title {
  margin: 10px 0 8px;
  font-size: 18px;
  line-height: 1.35;
  word-break: break-word;
}

.compact-order-line {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.compact-order-muted {
  margin-top: 6px;
  color: var(--muted);
}

.tech-deadline-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #eef4fb;
  color: #334155;
  font-size: 13px;
  line-height: 1.35;
}

.tech-deadline-line strong {
  flex-shrink: 0;
}

.tech-deadline-line.due-soon {
  background: #fff7e6;
  color: #8a4b00;
}

.tech-deadline-line.overdue {
  background: #fff0f0;
  color: #b42318;
}

.field-deadline-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin-top: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef4fb;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  vertical-align: middle;
  white-space: normal;
}

.field-deadline-tag.due-soon {
  background: #fff7e6;
  color: #8a4b00;
}

.field-deadline-tag.overdue {
  background: #fff0f0;
  color: #b42318;
}

.sheet-inline-field small .field-deadline-tag {
  margin-top: 0;
  margin-left: 6px;
}

.compact-order-arrow {
  color: #9ba9bc;
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}

.close-management-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.close-management-panel .panel-head {
  display: none;
}

.closable-order-row {
  position: relative;
}

.order-topline,
.history-topline,
.order-meta,
.order-tags,
.summary-grid,
.insight-list,
.detail-meta,
.tab-nav,
.detail-actions,
.comment-headline,
.summary-row,
.back-row,
.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-topline,
.history-topline,
.toggle-row,
.back-row {
  align-items: center;
  justify-content: space-between;
}

.order-meta,
.order-tags {
  margin-top: 12px;
}

.summary-grid {
  margin-top: 16px;
  gap: 14px;
}

.summary-item,
.insight-item,
.placeholder-item,
.review-row,
.comment-item,
.timeline-item,
.readonly-field,
.finance-only-note {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
}

.summary-item,
.insight-item,
.placeholder-item,
.review-row,
.timeline-item {
  padding: 14px 16px;
}

.summary-item {
  flex: 1 1 220px;
}

.summary-item strong,
.insight-item strong,
.review-row strong,
.timeline-item strong,
.placeholder-item strong {
  display: block;
  margin-bottom: 6px;
}

.insight-list {
  margin-top: 16px;
}

.finance-only-note {
  padding: 18px;
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.65;
}

.history-panel {
  padding: 14px 18px;
}

.history-toggle-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.history-toggle-label {
  font-size: 20px;
  font-weight: 700;
}

.history-toggle-arrow {
  color: var(--muted);
  font-size: 20px;
}

.collapse-btn,
.ghost-inline-btn,
.back-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.detail-shell {
  display: grid;
  gap: 16px;
  padding-bottom: 112px;
}

.detail-page {
  display: grid;
}

.detail-view-stack {
  margin-top: 0;
}

.detail-sticky-head {
  position: sticky;
  top: 0;
  z-index: 26;
  display: grid;
  gap: 10px;
  padding: 12px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 255, 255, 0.96));
  border-bottom: 1px solid rgba(216, 226, 239, 0.86);
}

.detail-title {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.25;
  word-break: break-word;
}

.sales-v2-detail-shell .detail-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-order-code {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 23px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sales-v2-red-soft);
  color: var(--sales-v2-red);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.detail-save-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-meta {
  align-items: center;
  justify-content: flex-end;
  margin-top: 0;
  margin-left: auto;
}

.detail-meta .status-pill,
.detail-meta .tag {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
}

.detail-meta .tech-deadline-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef4fb;
  color: #334155;
}

.detail-meta .tech-deadline-tag.due-soon {
  background: #fff7e6;
  color: #8a4b00;
}

.detail-meta .tech-deadline-tag.overdue {
  background: #fff0f0;
  color: #b42318;
}

.detail-actions {
  position: fixed;
  right: 24px;
  bottom: 16px;
  z-index: 32;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  justify-content: flex-end;
}

.detail-actions.tech-detail-dock {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid rgba(221, 214, 207, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 36px rgba(45, 37, 30, 0.16);
  backdrop-filter: blur(18px);
  justify-content: stretch;
}

.detail-actions.tech-detail-dock .primary-btn,
.detail-actions.tech-detail-dock .secondary-btn {
  flex: 1 1 0;
}

.device-select-dialog {
  width: min(720px, calc(100vw - 24px));
}

.device-select-card {
  width: 100%;
  display: grid;
  gap: 14px;
}

.device-select-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #d9e2ef;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
}

.device-select-list {
  display: grid;
  gap: 10px;
  max-height: min(62vh, 560px);
  overflow: auto;
  padding-right: 2px;
}

.device-select-option {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid rgba(46, 117, 182, 0.18);
  border-radius: 12px;
  background: #f8fbff;
  color: #183153;
  text-align: left;
}

.device-select-option strong {
  color: var(--brand);
  font-size: 16px;
}

.device-select-option span {
  color: var(--muted);
  font-size: 13px;
}

.finance-detail-stack {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.finance-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.finance-config-preview-card {
  padding: 10px 12px;
}

.finance-config-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.finance-config-preview-head b {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.finance-config-preview-head small {
  color: var(--muted);
  font-size: 12px;
}

.finance-config-preview-list {
  display: grid;
  gap: 6px;
}

.finance-config-preview-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid rgba(216, 226, 239, 0.9);
  border-radius: 9px;
  background: #fff;
}

.finance-config-preview-item > strong {
  color: var(--brand);
}

.finance-config-preview-fields {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.finance-config-preview-fields span {
  min-width: 0;
  padding: 5px 7px;
  border-radius: 7px;
  background: #f8fafc;
  color: var(--text);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-link-related-btn {
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.finance-config-preview-fields b {
  display: inline;
  margin-right: 4px;
  color: var(--muted);
  font-size: 11px;
}

.finance-receipt-btn {
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid rgba(46, 117, 182, 0.38);
  background: #fff;
  color: var(--brand);
  font-weight: 700;
}

.finance-receipt-btn.active {
  border-color: transparent;
  background: var(--brand);
  color: #fff;
}

.finance-receipt-btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
}

.finance-detail-shell {
  gap: 10px;
  padding-bottom: 16px;
}

.finance-detail-shell .detail-sticky-head {
  padding: 8px 0;
}

.finance-detail-shell .detail-title {
  font-size: 24px;
}

.finance-detail-onepage {
  display: grid;
  gap: 8px;
}

.finance-detail-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
}

.finance-detail-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 160px;
  padding: 8px;
  border: 1px solid rgba(216, 226, 239, 0.86);
  border-radius: 12px;
  background: #fff;
}

.finance-detail-inline-actions.is-readonly {
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.finance-detail-onepage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.9fr) minmax(240px, 0.8fr);
  gap: 8px;
  align-items: stretch;
}

.finance-detail-side-stack {
  display: grid;
  gap: 8px;
  align-content: start;
}

.finance-detail-onepage .content-card {
  padding: 12px;
  border-radius: 12px;
}

.finance-detail-onepage .card-head h3 {
  font-size: 15px;
}

.finance-detail-onepage .summary-item {
  padding: 8px 9px;
  border-radius: 9px;
}

.finance-detail-onepage .summary-item strong {
  margin-bottom: 3px;
  font-size: 11px;
}

.finance-workbench {
  width: min(1240px, calc(100vw - 40px));
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.finance-workbench-head {
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(216, 226, 239, 0.92);
}

.finance-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.finance-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.finance-filter-chip b {
  color: var(--brand);
}

.finance-filter-chip.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.finance-filter-chip.active b {
  color: rgba(255, 255, 255, 0.86);
}

.finance-section {
  margin-top: 8px;
}

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

.finance-section-head h3 {
  font-size: 16px;
}

.finance-section-head span {
  color: var(--muted);
  font-size: 13px;
}

.finance-section.is-priority .finance-section-head h3 {
  color: var(--danger);
}

.finance-order-list {
  display: grid;
  gap: 7px;
}

.finance-order-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(520px, 1.55fr) minmax(168px, 0.45fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(46, 117, 182, 0.2);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: 0 3px 10px rgba(19, 34, 56, 0.04);
  cursor: pointer;
}

.finance-order-card.is-priority {
  border-color: rgba(217, 72, 95, 0.28);
  border-left-color: var(--danger);
  background: linear-gradient(90deg, #fff8f9, #fff 42%);
}

.finance-order-identity,
.finance-order-meta,
.finance-order-flags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.finance-order-identity {
  align-items: flex-start;
  min-width: 0;
}

.finance-order-title-group {
  min-width: 0;
}

.finance-order-card h3 {
  margin: 2px 0 0;
  font-size: 16px;
  line-height: 1.25;
}

.finance-order-meta {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 12px;
}

.finance-money-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-self: center;
}

.finance-money-grid span {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 7px;
  background: #f3f7fc;
  color: #1b2d42;
  font-size: 12px;
  line-height: 1.35;
}

.finance-money-grid span > strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.2;
}

.finance-reminder-prefix {
  display: inline-block;
  margin-right: 5px;
  color: #8a4b00;
  font-style: normal;
  font-weight: 850;
}

.finance-money-grid .finance-countdown-tile {
  border: 1px solid rgba(46, 117, 182, 0.18);
  background: #eaf2fb;
  overflow: hidden;
}

.finance-countdown-tile strong,
.finance-countdown-tile small {
  display: block;
}

.finance-countdown-tile strong {
  color: var(--brand);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finance-countdown-tile small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finance-countdown-tile.tone-warn {
  border-color: rgba(218, 137, 15, 0.26);
  background: var(--accent-soft);
}

.finance-countdown-tile.tone-warn strong {
  color: #8a4b00;
}

.finance-countdown-tile.tone-danger {
  border-color: rgba(214, 69, 65, 0.24);
  background: var(--danger-soft);
}

.finance-countdown-tile.tone-danger strong {
  color: var(--danger);
}

.finance-countdown-tile.tone-done {
  border-color: rgba(43, 138, 110, 0.22);
  background: var(--success-soft);
}

.finance-countdown-tile.tone-done strong {
  color: var(--success);
}

.finance-money-grid b {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
}

.finance-countdown-tile b i {
  margin-left: 4px;
  color: inherit;
  font: inherit;
}

.finance-decision-panel {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(216, 226, 239, 0.86);
  border-radius: 10px;
  background: #f8fbff;
}

.finance-decision-row,
.finance-next-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.finance-decision-row span,
.finance-next-step b {
  color: var(--muted);
  font-size: 11px;
}

.finance-decision-row strong {
  color: var(--brand);
  font-size: 14px;
  white-space: nowrap;
}

.finance-decision-row strong.tone-danger {
  color: var(--danger);
}

.finance-decision-row strong.tone-warn {
  color: #9a5b00;
}

.finance-decision-row strong.tone-done {
  color: var(--success);
}

.finance-decision-panel p {
  margin: 6px 0 8px;
  color: #52657d;
  font-size: 12px;
  line-height: 1.4;
}

.finance-next-step {
  padding-top: 7px;
  border-top: 1px solid rgba(216, 226, 239, 0.86);
  color: var(--text);
  font-size: 12px;
}

.finance-order-flags {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.finance-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  align-self: center;
}

.finance-list-action {
  width: 76px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(46, 117, 182, 0.32);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.finance-list-action:hover {
  box-shadow: 0 8px 18px rgba(46, 117, 182, 0.14);
}

.finance-list-actions.is-readonly {
  align-content: center;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid rgba(216, 226, 239, 0.86);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
}

.finance-list-actions.is-readonly span {
  color: var(--text);
  font-weight: 800;
}

.finance-list-actions.is-readonly small {
  color: var(--muted);
}

.finance-next-inline {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.finance-flag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.finance-flag.warn {
  background: var(--accent-soft);
  color: #8a4b00;
}

.finance-flag.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.finance-flag.ok {
  background: var(--success-soft);
  color: var(--success);
}

.finance-history-panel {
  margin-top: 18px;
}

.finance-action-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid #c9d3df;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(19, 34, 56, 0.055);
}

.finance-action-banner.tone-me {
  border-left-color: var(--brand);
  background: linear-gradient(0deg, rgba(234, 242, 251, 0.55), rgba(234, 242, 251, 0.55)), #fff;
}

.finance-action-banner.tone-warn {
  border-left-color: var(--accent);
  background: #fffdf8;
}

.finance-action-banner.tone-danger {
  border-left-color: var(--danger);
  background: #fff8f9;
}

.finance-action-banner.tone-done {
  border-left-color: var(--success);
}

.finance-action-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.finance-action-who {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.finance-action-main p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.finance-action-right {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.finance-verification-card,
.finance-exception-card {
  margin-top: 0;
}

.finance-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.finance-exception-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.finance-exception-item {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border-radius: 9px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.finance-approval-lines {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.finance-approval-lines span {
  padding: 7px 8px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.finance-exception-item strong {
  color: var(--text);
}

.finance-exception-item.warn {
  background: var(--accent-soft);
}

.finance-exception-item.danger {
  background: var(--danger-soft);
}

/* 销售领导端：金额变更高亮审批卡 */
.amount-approve-card {
  background: linear-gradient(180deg, #fffaf0 0%, var(--panel-strong) 60%);
  border: 1.5px solid var(--accent);
  box-shadow: 0 10px 24px rgba(245, 159, 11, 0.12);
}

.amount-approve-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.amount-approve-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: #9a6a00;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.amount-approve-meta {
  font-size: 13px;
  color: var(--muted);
}

.amount-approve-meta b {
  color: var(--text);
  font-weight: 600;
}

.amount-approve-reason {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin: 0 2px 12px;
}

.amount-approve-reason .k {
  color: var(--muted);
  margin-right: 6px;
}

.amount-approve-fields {
  border: 1px solid #f0e4c8;
  border-radius: 12px;
  background: var(--panel-strong);
  padding: 2px 14px;
}

.amount-approve-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 11px 0;
  border-bottom: 1px dashed #f0e4c8;
}

.amount-approve-row:last-child {
  border-bottom: none;
}

.amount-approve-label {
  min-width: 60px;
  font-size: 13px;
  color: var(--muted);
}

.amount-old {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 15px;
}

.amount-arrow {
  color: var(--accent);
  font-weight: 700;
}

.amount-new {
  color: var(--danger);
  font-weight: 800;
  font-size: 18px;
}

.amount-keep {
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
}

.amount-nochg {
  font-size: 12px;
  color: var(--muted);
  background: #eef1f5;
  border-radius: 999px;
  padding: 2px 9px;
}

.amount-approve-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.finance-receipt-dialog-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.finance-receipt-dialog-summary div {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
}

.finance-receipt-dialog-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.finance-receipt-dialog-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
}

.finance-audit-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.finance-follow-list {
  margin-top: 12px;
}

.tab-nav {
  margin-top: 0;
}

.tab-btn {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.tab-btn.active {
  border-color: rgba(46, 117, 182, 0.26);
  background: var(--brand-soft);
  color: var(--brand);
}

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

.content-card {
  min-width: 0;
}

.full-width-card {
  grid-column: 1 / -1;
}

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

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.full-span {
  grid-column: 1 / -1;
}

.readonly-field {
  min-height: 48px;
  padding: 12px 14px;
  color: var(--text);
  line-height: 1.55;
}

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

.comment-item {
  padding: 14px 16px;
}

.comment-headline {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.comment-meta,
.timeline-meta,
.inline-muted {
  color: var(--muted);
  font-size: 13px;
}

.comment-composer {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfdff;
  display: grid;
  gap: 10px;
}

/* 订单沟通：所有角色共用同一套聊天气泡，当前用户靠右，其他参与人靠左 */
.sales-conversation-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.question-loop-card,
.conversation-card {
  overflow: hidden;
}

.unified-conversation-card {
  padding-top: 16px;
  padding-bottom: 18px;
}

.question-loop-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 13px;
  font-size: 14px;
  line-height: 1.45;
}

.question-loop-summary > span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-weight: 800;
}

.question-loop-summary.is-closed {
  color: #168363;
  background: #e5f5ef;
}

.question-loop-summary.is-closed > span {
  background: rgba(22, 131, 99, 0.12);
}

.question-loop-summary.has-open {
  color: #a15d05;
  background: #fff3dd;
}

.question-loop-summary.has-open > span {
  background: rgba(161, 93, 5, 0.12);
}

.question-thread-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.question-thread-list:empty {
  display: none;
}

.question-thread-card {
  padding: 14px;
  border: 1px solid #e4e0dc;
  border-radius: 15px;
  background: #fcfbfa;
}

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

.question-status {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.question-status.is-closed {
  color: #168363;
  background: #e5f5ef;
}

.question-status.is-open {
  color: #a15d05;
  background: #fff3dd;
}

.question-composer {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e4e0dc;
  border-radius: 15px;
  background: #fcfbfa;
}

.conversation-message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.unified-message-list {
  gap: 12px;
  margin-top: 0;
}

.question-message-list {
  margin-top: 12px;
}

.conversation-message-row {
  display: flex;
  width: 100%;
}

.conversation-message-row.is-other {
  justify-content: flex-start;
}

.conversation-message-row.is-self {
  justify-content: flex-end;
}

.conversation-bubble {
  width: fit-content;
  max-width: min(82%, 680px);
  padding: 12px 14px 10px;
  border-radius: 16px 16px 16px 4px;
  color: #393633;
  background: #f0eeeb;
}

.conversation-message-row.is-self .conversation-bubble {
  border-radius: 16px 16px 4px 16px;
  color: #155493;
  background: #e5f1fd;
}

.conversation-message-author {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 750;
  color: #494541;
}

.conversation-message-row.is-self .conversation-message-author {
  color: #155493;
}

.conversation-message-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: -1px 0 6px;
}

.conversation-message-tags span {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: inherit;
  font-size: 10.5px;
  font-weight: 650;
}

.conversation-message-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.62;
}

.conversation-speaker {
  font-weight: 750;
  color: #494541;
}

.conversation-return-tag {
  color: var(--sales-v2-red);
  font-weight: 750;
}

.conversation-message-row.is-self .conversation-speaker {
  color: #155493;
}

.conversation-reply-quote {
  margin: 0 0 8px;
  padding: 7px 9px;
  border-left: 3px solid rgba(46, 117, 182, 0.28);
  border-radius: 8px;
  color: #6b6660;
  background: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.45;
}

.conversation-message-time {
  color: #8d8883;
  font-size: 11px;
}

.conversation-message-row.is-self .conversation-message-time {
  color: #6f92b5;
}

.conversation-message-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.conversation-message-row.is-self .conversation-message-foot {
  justify-content: flex-end;
}

.conversation-reply-btn {
  padding: 0;
  border: 0;
  color: #2e75b6;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.conversation-reply-btn:hover {
  text-decoration: underline;
}

.conversation-system-row {
  display: flex;
  justify-content: center;
  padding: 2px 0;
}

.conversation-system-row span {
  max-width: min(92%, 720px);
  padding: 5px 10px;
  border-radius: 999px;
  color: #7f7a74;
  background: #f2f0ed;
  font-size: 11.5px;
  line-height: 1.45;
  text-align: center;
}

.inline-reply-composer {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(142, 132, 121, 0.2);
}

.inline-reply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #6b6660;
  font-size: 12px;
  font-weight: 700;
}

.compact-text-btn {
  min-height: 0;
  padding: 0;
  border: 0;
  color: #8a8279;
  background: transparent;
  font-size: 12px;
}

.inline-reply-composer textarea {
  width: min(420px, 100%);
  min-height: 64px;
  resize: vertical;
  border: 1px solid #dcd6d0;
  border-radius: 12px;
  background: #fff;
}

.conversation-empty {
  padding: 22px 12px;
  border: 1px dashed #ddd7d1;
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.conversation-composer {
  margin-top: 16px;
  padding: 13px 0 0;
  border: 0;
  border-top: 1px solid #e4e0dc;
  border-radius: 0;
  background: transparent;
}

.conversation-composer textarea,
.question-composer textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid #dcd6d0;
  border-radius: 13px;
  background: #fff;
}

.conversation-composer textarea:focus,
.question-composer textarea:focus {
  outline: none;
  border-color: rgba(46, 117, 182, 0.52);
  box-shadow: 0 0 0 3px rgba(46, 117, 182, 0.09);
}

.conversation-visibility {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.conversation-visibility select {
  width: auto;
  min-height: 34px;
  padding: 5px 28px 5px 10px;
  border-radius: 9px;
  font-size: 12px;
}

.conversation-send-row {
  display: flex;
  justify-content: flex-end;
}

.conversation-send-btn {
  min-width: 90px;
  min-height: 38px;
  padding: 8px 16px;
}

.conversation-readonly-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted);
  background: #f6f4f2;
  font-size: 13px;
  text-align: center;
}

.review-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.placeholder-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.placeholder-pill.reserved {
  background: #f0f3f8;
  color: #607086;
}

.placeholder-pill.completed {
  background: var(--success-soft);
  color: var(--success);
}

.empty-state {
  padding: 28px;
  border: 1px dashed rgba(46, 117, 182, 0.3);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(46, 117, 182, 0.06), rgba(255, 255, 255, 0.9));
  color: var(--muted);
}

.empty-state h3 {
  margin-bottom: 10px;
  color: var(--text);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.primary-btn {
  background: var(--brand);
  color: #fff;
}

.primary-btn-compact {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
}

.secondary-btn {
  background: #fff;
  color: var(--brand);
  border-color: rgba(46, 117, 182, 0.24);
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.ghost-btn-compact {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
}

.title-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.title-actions .primary-btn-compact {
  min-width: 72px;
  text-align: center;
  justify-content: center;
}

.swipe-card {
  position: relative;
  margin-bottom: 8px;
  border-radius: 22px;
  overflow: hidden;
}

.swipe-card-body {
  width: 100%;
}

@media (max-width: 720px) {
  .swipe-card {
    border-radius: 18px;
  }
}

.recycle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  width: 100%;
}

.recycle-card {
  background: var(--panel-strong, #fff);
  border: 1px solid var(--line, #e7e6e0);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.recycle-card-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.recycle-card-topline .compact-order-code {
  margin: 0;
}

.recycle-card-topline .status-pill {
  flex-shrink: 0;
}

.recycle-actions-inline {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}

.pill-btn {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line, #e7e6e0);
  color: var(--muted, #6b7480);
  cursor: pointer;
  line-height: 1.6;
  font-weight: 500;
  white-space: nowrap;
}

.pill-btn-restart {
  border-color: rgba(46, 117, 182, 0.32);
  color: var(--brand, #2e75b6);
}

.pill-btn-restart:hover {
  background: rgba(46, 117, 182, 0.08);
}

.pill-btn-delete {
  border-color: rgba(217, 72, 95, 0.4);
  color: var(--danger, #d9485f);
}

.pill-btn-delete:hover {
  background: rgba(217, 72, 95, 0.08);
}

.recycle-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

.recycle-card-body .compact-order-title {
  margin: 4px 0 4px;
}

.recycle-card-body .compact-order-line {
  margin: 0;
}

.recycle-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding-bottom: 8px;
}

.recycle-dialog-head .panel-kicker {
  margin: 0;
}

.recycle-dialog-body {
  display: block !important;
  margin-top: 0 !important;
}

.recycle-dialog-body .recycle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(217, 72, 95, 0.16);
}

.danger-btn-compact {
  padding: 12px 14px;
  min-width: 64px;
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  z-index: 2;
}

.secondary-btn-compact {
  padding: 12px 14px;
  min-width: 64px;
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  z-index: 2;
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: calc(100vw - 16px);
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(19, 34, 56, 0.45);
  backdrop-filter: blur(4px);
}

.order-fullscreen-dialog {
  width: min(1240px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
}

.dialog-card {
  width: min(900px, calc(100vw - 24px));
  padding: 22px;
  background: var(--panel-strong);
  max-height: min(88vh, 920px);
  overflow: auto;
  overflow-x: hidden;
}

.order-dialog-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  overflow: hidden;
}

.dialog-head,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 12px;
  background: var(--panel-strong);
}

#orderForm .dialog-head {
  position: static;
  top: auto;
  padding-bottom: 0;
}

.dialog-body {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

#orderForm .dialog-body {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  padding-bottom: 96px;
}

.dialog-section {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fbfdff;
}

.dialog-grid {
  margin-top: 14px;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

#orderForm .dialog-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 0;
  padding: 14px 0 4px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.96) 24%,
    var(--panel-strong) 100%
  );
}

.dialog-close-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.dialog-close-btn:hover {
  color: var(--text);
}

#closeOrderForm {
  width: min(680px, calc(100vw - 24px));
  max-width: 100%;
}

#closeOrderForm .dialog-head,
#closeOrderForm .dialog-actions {
  align-items: center;
}

#closeOrderDialog {
  width: min(680px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
}

#approveForm {
  width: min(680px, calc(100vw - 24px));
  max-width: 100%;
}

#approveDialog {
  width: min(680px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
}

#closeOrderForm .dialog-section {
  padding: 0;
  border: 0;
  background: transparent;
}

#closeOrderForm .dialog-body {
  margin-top: 8px;
}

.close-order-title-block {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.close-order-title-label {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.close-order-title {
  min-width: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  word-break: break-word;
}

.close-order-reason-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

#closeOrderForm #closeOrderReason {
  border: 1px solid #ccd8e7;
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  min-height: 120px;
  box-shadow: none;
  resize: none;
}

#closeOrderForm #closeOrderReason:focus {
  outline: none;
  border-color: rgba(46, 117, 182, 0.42);
}

@media (max-width: 1080px) {
  .system-admin-shell .user-management-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dual-grid,
  .close-management-grid,
  .overview-grid,
  .record-grid,
  .placeholder-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    width: calc(100vw - 16px);
    margin: 12px auto 24px;
  }

  .system-admin-shell .user-management-form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 10px;
    padding: 4px 0 2px;
  }

  .title-wrap {
    gap: 8px;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .title-badge {
    display: none;
  }

  h1 {
    font-size: 15px;
    line-height: 1.2;
  }

  .primary-btn-compact {
    padding: 6px 10px;
    font-size: 11px;
  }

  .role-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 6px;
    margin-left: 0;
  }

  .role-switcher.compact-session-controls {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .role-switcher.compact-session-controls .session-mode-section .role-switcher-label {
    display: block;
  }

  .role-switcher .role-switcher-label {
    display: none;
  }

  .role-switcher select {
    padding: 6px 8px;
    font-size: 11px;
  }

  .compact-readonly,
  .role-switcher .inline-note {
    grid-column: 1 / -1;
    font-size: 11px;
  }

  .brand-title {
    font-size: 14px;
    line-height: 1.15;
  }

  .title-actions .primary-btn-compact {
    min-width: 56px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .hero-panel,
  .panel,
  .content-card {
    padding: 16px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .status-tile {
    padding: 8px 6px;
    min-height: 48px;
    gap: 4px;
    border-radius: 14px;
  }

  .status-label {
    font-size: 9px;
    line-height: 1.15;
  }

  .status-value {
    font-size: 12px;
  }

  .toast-banner {
    top: 10px;
    right: 10px;
    left: 10px;
    padding: 10px 12px;
    text-align: center;
  }

  .order-item,
  .history-item {
    padding: 14px;
  }

  .order-item h3,
  .history-item h3 {
    font-size: 16px;
  }

  .compact-order-item {
    padding: 14px;
    border-radius: 18px;
  }

  .compact-order-code {
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  .compact-order-title {
    margin: 8px 0 6px;
    font-size: 16px;
  }

  .compact-order-line {
    font-size: 13px;
  }

  .compact-order-arrow {
    font-size: 22px;
  }

  .closable-order-row {
    display: block;
  }

  .compact-order-item-inline {
    padding-right: 98px;
  }

  .danger-btn-compact {
    right: 14px;
    min-width: 60px;
    padding: 10px 12px;
  }

  .secondary-btn-compact {
    right: 14px;
    min-width: 60px;
    padding: 10px 12px;
  }

  .history-panel {
    padding: 12px 14px;
  }

  .history-toggle-label {
    font-size: 16px;
  }

  .detail-title {
    font-size: 17px;
    line-height: 1.25;
  }

  .detail-shell {
    gap: 10px;
    padding-bottom: 108px;
  }

  .detail-shell .back-row {
    justify-content: flex-end;
  }

  .detail-head {
    gap: 8px;
  }

  .detail-toolbar {
    gap: 8px;
    align-items: flex-start;
  }

  .detail-meta {
    gap: 6px;
    margin-top: 0;
  }

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

  .tab-nav {
    gap: 6px;
    margin-top: 0;
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .detail-actions {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 32;
    margin-top: 0;
    padding: 0;
    justify-content: stretch;
  }

  .detail-actions .primary-btn,
  .detail-actions .secondary-btn,
  .detail-actions .ghost-btn,
  .detail-actions .finance-receipt-btn {
    flex: 1 1 0;
  }

  body.sales-v2-active .detail-actions.sales-v2-dock .secondary-btn {
    flex: 0 1 auto;
    min-width: 5.2em;
  }

  .detail-actions.tech-detail-dock {
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
    padding: 8px;
  }

  .device-card-head-actions {
    align-items: flex-end;
    gap: 6px;
  }

  .device-change-hint {
    display: none;
  }

  .device-template-choice-grid {
    grid-template-columns: 1fr;
  }

  .sheet-line-mobile-fields {
    display: grid;
  }

  .sheet-line-table {
    display: none;
  }

  .comment-composer {
    padding: 14px;
  }

  .question-loop-card,
  .conversation-card {
    padding: 16px;
  }

  .conversation-bubble {
    max-width: 86%;
    padding: 11px 12px 9px;
  }

  .conversation-message-content {
    font-size: 13.5px;
  }

  .conversation-composer {
    padding: 13px 0 0;
  }

  .conversation-visibility {
    justify-content: space-between;
  }

  .conversation-send-btn {
    min-width: 90px;
  }

  .dialog-card {
    width: calc(100vw - 16px);
    padding: 16px;
  }

  #closeOrderDialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }

  #closeOrderForm {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }

  .dialog-section {
    padding: 14px;
  }

  .dialog-close-btn {
    font-size: 34px;
  }

  .close-order-title,
  .close-order-title-label,
  .close-order-reason-field {
    font-size: 13px;
  }

  #closeOrderForm #closeOrderReason {
    min-height: 104px;
  }

  #orderDialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    inset: 0;
  }

  .order-dialog-card {
    width: 100vw;
    max-width: 100vw;
    min-height: 100vh;
    max-height: 100vh;
    padding: 0;
    border-radius: 0;
    overflow: hidden;
  }

  .order-dialog-head {
    position: sticky;
    top: 0;
    z-index: 5;
    margin: 0;
    padding: 10px 12px 8px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(207, 219, 235, 0.85);
  }

  #orderForm .dialog-body {
    margin-top: 0;
    gap: 8px;
    padding: 0 0 calc(90px + env(safe-area-inset-bottom));
    overflow: auto;
  }

  #orderForm .dialog-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0),
      rgba(255, 255, 255, 0.94) 22%,
      #fff 100%
    );
  }

  #orderForm .dialog-actions .primary-btn {
    width: 100%;
    min-height: 48px;
    border-radius: 16px;
  }

  .order-dialog-body {
    padding-top: 0;
  }

  .draft-order-shell {
    gap: 0;
  }

  .draft-order-group {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .draft-order-intro h3 {
    display: none;
  }

  .draft-order-group {
    margin: 0;
    width: 100%;
  }

  .draft-order-intro {
    display: none;
  }

  .draft-order-groups {
    gap: 8px;
  }

  .draft-order-group-head {
    min-height: 42px;
    padding: 0 16px;
  }

  .draft-order-row {
    grid-template-columns: 78px minmax(0, 1fr);
    min-height: 54px;
    padding: 0 16px;
    gap: 10px;
  }

  .draft-order-row.is-textarea {
    padding-top: 10px;
    padding-bottom: 12px;
  }

  .draft-order-label {
    font-size: 12px;
  }

  .draft-order-control .sheet-inline-input,
  .draft-order-control .sheet-line-value {
    min-height: 38px;
    font-size: 14px;
  }

  .draft-order-control .sheet-textarea {
    min-height: 92px;
  }

  .choice-chip-row {
    gap: 6px;
  }

  .choice-chip {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .model-inline-row {
    gap: 6px;
  }

  .model-inline-row .choice-chip {
    padding: 0 6px;
  }

  .bag-size-grid {
    gap: 4px;
  }

  .bag-size-line,
  .bag-size-input-line {
    flex-wrap: nowrap;
    gap: 4px;
    font-size: 12px;
  }

  .bag-size-line strong,
  .bag-size-input-line strong {
    min-width: 34px;
  }

  .bag-size-line .inline-underline-input,
  .bag-size-input-line .inline-underline-input {
    flex: 1 1 0;
    min-width: 58px;
  }

  .bag-size-line .inline-underline-input.qty,
  .bag-size-input-line .inline-underline-input.qty,
  .bag-size-input-line .inline-underline.qty {
    flex: 0 0 24px;
    min-width: 24px;
  }

  .bag-size-line .inline-sep,
  .bag-size-input-line .inline-sep {
    white-space: nowrap;
    font-size: 11px;
  }

  .bag-size-input-line .inline-underline {
    min-width: 58px;
  }

  .dimension-pair-line {
    gap: 4px;
    font-size: 12px;
  }

  .dimension-pair-line .inline-underline-input,
  .dimension-pair-line .inline-underline {
    flex: 0 0 48px;
    min-width: 48px;
    max-width: 48px;
  }

  .inline-image-preview img {
    max-width: 110px;
    max-height: 46px;
  }

  .template-media-grid,
  .sheet-inline-grid {
    grid-template-columns: 1fr;
  }

  .config-figure-thumb {
    width: 70px;
  }

  .config-figure-thumb img {
    height: 38px;
  }
}

.order-dialog-body {
  padding-top: 4px;
}

.order-dialog-card {
  width: 100%;
}

.draft-order-shell {
  display: grid;
  gap: 8px;
}

.draft-order-intro {
  display: grid;
  gap: 0;
}

.draft-order-intro h3 {
  margin: 0;
  font-size: 17px;
  color: #183153;
}

.draft-order-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.draft-order-groups {
  display: grid;
  gap: 10px;
}

.draft-order-group {
  border-radius: 12px;
  border: 1px solid rgba(220, 229, 240, 0.95);
  background: #fff;
  padding: 0;
  box-shadow: none;
  overflow: hidden;
}

.draft-order-group.preview {
  box-shadow: none;
}

.draft-order-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(229, 236, 245, 0.95);
}

.draft-order-group-head::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 999px;
  background: var(--brand);
}

.draft-order-group-head h4 {
  margin: 0;
  font-size: 15px;
  color: #183153;
}

.draft-order-list {
  display: grid;
}

.device-add-group {
  border-style: dashed;
}

.device-add-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: 56px;
  padding: 10px 14px;
}

.draft-order-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(229, 236, 245, 0.95);
}

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

.draft-order-row.is-textarea {
  align-items: start;
  padding-top: 10px;
  padding-bottom: 10px;
}

.draft-order-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  color: #26394d;
  font-size: 13px;
  font-weight: 600;
}

.draft-order-control {
  min-width: 0;
}

.money-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.money-with-unit .money-input,
.money-with-unit .money-value {
  flex: 1 1 auto;
  min-width: 0;
}

.money-with-unit.readonly .money-value {
  padding: 0;
  border: 0;
}

.money-unit {
  flex: 0 0 auto;
  color: #5e6b7b;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.prepayment-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  color: #1b2d42;
}

.prepayment-ratio-value {
  min-width: 46px;
  font-weight: 700;
}

.prepayment-status-value {
  color: #5e6b7b;
  font-size: 13px;
  font-weight: 600;
}

.ship-crate-control {
  display: grid;
  grid-template-columns: minmax(96px, 0.7fr) minmax(132px, 1fr);
  gap: 10px;
  align-items: center;
}

.ship-crate-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.ship-crate-field small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.quantity-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.quantity-with-unit .sheet-inline-input {
  flex: 1 1 auto;
  min-width: 0;
}

.quantity-unit {
  flex: 0 0 auto;
  color: #5e6b7b;
  font-size: 13px;
  font-weight: 600;
}

.sheet-inline-input::placeholder,
.sheet-textarea::placeholder,
.finance-amount-input::placeholder {
  color: #8a94a6;
  opacity: 1;
}

.date-placeholder-shell {
  position: relative;
  display: block;
  min-width: 0;
  width: 100%;
}

.date-placeholder-text {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #8a94a6;
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
}

.date-placeholder-shell.has-value .date-placeholder-text,
.date-placeholder-shell:focus-within .date-placeholder-text {
  display: none;
}

.date-placeholder-shell:not(.has-value) .date-placeholder-input {
  color: transparent;
}

.required-star {
  margin-left: 4px;
  color: #24211f;
  font-style: normal;
}

.draft-order-control .sheet-inline-input,
.draft-order-control .sheet-textarea,
.draft-inline-select {
  width: 100%;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1b2d42;
  box-sizing: border-box;
  box-shadow: none;
  text-align: left;
}

.draft-order-control .sheet-textarea {
  min-height: 86px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  background: #fff;
}

.empty-device-group .draft-order-group-head {
  justify-content: space-between;
}

.device-empty-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.device-empty-body h3 {
  margin: 0;
  color: #183153;
  font-size: 17px;
}

.device-empty-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.device-template-selector {
  display: grid;
  gap: 10px;
}

.device-template-row {
  min-height: 50px;
}

.device-template-input {
  color: var(--brand);
  font-weight: 700;
}

.device-template-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 14px 12px;
}

.device-empty-body .device-template-choice-grid {
  padding: 0;
}

.device-template-choice {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(46, 117, 182, 0.18);
  border-radius: 12px;
  background: #f8fbff;
  color: #183153;
  text-align: left;
}

.device-template-choice strong {
  color: var(--brand);
  font-size: 14px;
}

.device-template-choice span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.device-card-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.device-card-head-actions .secondary-btn,
.device-card-head-actions .ghost-btn {
  white-space: nowrap;
}

.device-more-menu,
.product-more-menu {
  position: relative;
}

.device-more-menu > summary,
.product-more-menu > summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.device-more-menu > summary::-webkit-details-marker,
.product-more-menu > summary::-webkit-details-marker {
  display: none;
}

.device-more-popover,
.product-more-popover {
  position: absolute;
  right: 0;
  z-index: 20;
  min-width: 96px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(24, 49, 83, 0.14);
}

.danger-text {
  color: #a64b35 !important;
}

.device-change-hint {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.device-collapse-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid rgba(229, 236, 245, 0.95);
  flex-wrap: wrap;
}

.device-collapse-summary strong {
  color: #183153;
}

.order-device-group.collapsed .device-collapse-summary {
  border-bottom: 0;
}

.device-list-empty {
  margin-top: 0;
}

.sheet-line-mobile-fields {
  display: none;
}

@media (max-width: 760px) {
  .detail-shell-page {
    width: 100%;
    margin: 0;
  }

  .detail-view-stack {
    gap: 0;
  }

  .detail-shell-page .detail-shell {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .detail-sticky-head {
    padding: 10px 12px;
  }

  .device-card-head-actions {
    align-items: flex-end;
    gap: 6px;
  }

  .device-change-hint {
    display: none;
  }

  .device-template-choice-grid {
    grid-template-columns: 1fr;
  }

  .sheet-line-mobile-fields {
    display: grid;
  }

  .sheet-line-table {
    display: none;
  }

  .device-select-dialog {
    width: 100vw;
    max-width: 100vw;
  }

  .device-select-card {
    width: 100vw;
    max-height: 86vh;
    border-radius: 18px 18px 0 0;
  }
}

.finance-amount-group {
  display: grid;
  gap: 8px;
}

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

.finance-amount-grid-2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-inline-pair {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.finance-inline-pair.readonly {
  align-items: stretch;
}

.finance-inline-label {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1.2;
  color: #6a7486;
  white-space: nowrap;
}

.finance-inline-pair .sheet-inline-input,
.finance-inline-pair .sheet-line-value {
  flex: 1 1 auto;
  min-width: 0;
}

.finance-inline-pair.readonly .sheet-line-value {
  display: flex;
  align-items: center;
}

.finance-amount-cell {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.finance-inline-pair .finance-amount-input {
  min-width: 0;
  border-width: 0 0 1px;
  border-style: solid;
  border-color: rgba(46, 117, 182, 0.34);
  border-radius: 0;
  background: transparent;
  padding: 0 2px 4px;
  min-height: 30px;
}

.finance-inline-pair .finance-amount-input:focus {
  border-color: rgba(46, 117, 182, 0.72);
  box-shadow: none;
}

.finance-amount-readonly {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  background: #f8fafc;
  color: #1b2d42;
}

.draft-order-control .sheet-inline-input:focus,
.draft-order-control .sheet-textarea:focus,
.draft-inline-select:focus {
  outline: none;
  border-color: rgba(46, 117, 182, 0.45);
  box-shadow: none;
}

.choice-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.choice-chip-row.choice-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.choice-chip-row.choice-grid-2x2 .choice-chip {
  width: 100%;
  min-width: 0;
}

.choice-chip-row.choice-grid-2x2 .choice-chip span {
  display: block;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.choice-chip-row.choice-inline-row {
  flex-wrap: nowrap;
}

.choice-chip-row.choice-inline-row .choice-chip {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 6px;
}

.choice-chip-row.choice-inline-row .choice-chip span {
  display: block;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.choice-chip-row.choice-inline-row.choice-inline-fit {
  flex-wrap: wrap;
  gap: 6px;
}

.choice-chip-row.choice-inline-row.choice-inline-fit .choice-chip {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  padding: 0 10px;
}

.choice-chip-row.choice-inline-row.choice-inline-fit .choice-chip span {
  white-space: nowrap;
  text-align: center;
}

.dimension-pair-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}

.dimension-pair-line .inline-underline-input,
.dimension-pair-line .inline-underline {
  flex: 0 0 57px;
  min-width: 57px;
  max-width: 57px;
}

.dimension-pair-line .inline-sep {
  white-space: nowrap;
}

.inline-image-preview {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.inline-image-preview img {
  display: block;
  max-width: 132px;
  max-height: 52px;
  border-radius: 8px;
  border: 1px solid #d9e2ef;
  background: #fff;
  object-fit: contain;
}

.model-inline-row {
  flex-wrap: nowrap;
}

.model-inline-row .choice-chip {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 8px;
}

.choice-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #cfdbeb;
  background: #fff;
  color: #36506f;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    color 0.16s ease;
}

.choice-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.choice-chip.selected {
  border-color: rgba(46, 117, 182, 0.35);
  background: rgba(46, 117, 182, 0.08);
  color: var(--brand);
  font-weight: 700;
}

.choice-chip.is-display {
  cursor: default;
}

.choice-chip .chip-inline-input {
  margin-left: 6px;
}

.choice-chip .chip-inline-input.hidden {
  display: none;
}

.option-note-stack {
  display: grid;
  gap: 8px;
}

.option-note-list {
  display: grid;
  gap: 6px;
}

.option-note-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #667a90;
  font-size: 12px;
}

.option-note-row:not(.active) {
  display: none;
}

.inline-underline-input {
  min-width: 56px;
  height: 28px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid #9cb0c8;
  border-radius: 0;
  background: transparent;
  text-align: center;
  color: #1b2d42;
}

.inline-underline-input.qty {
  min-width: 44px;
}

.inline-underline-input.wide {
  flex: 1 1 auto;
  min-width: 90px;
  text-align: left;
}

.inline-underline {
  display: inline-flex;
  min-width: 48px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(156, 176, 200, 0.95);
  color: #1b2d42;
}

.inline-underline.inline-display {
  flex: 1 1 auto;
  min-width: 90px;
  justify-content: flex-start;
  padding: 0 4px;
}

.inline-sep {
  color: #667a90;
  font-size: 12px;
}

.bag-size-grid {
  display: grid;
  gap: 6px;
}

.bag-size-section {
  display: grid;
  gap: 8px;
}

.bag-size-title {
  color: #3a5776;
  font-size: 12px;
  font-weight: 600;
}

.bag-size-line,
.bag-size-input-line {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  color: #1b2d42;
  font-size: 13px;
}

.bag-size-line strong,
.bag-size-input-line strong {
  min-width: 42px;
  font-weight: 600;
}

.bag-size-input-line .inline-underline-input {
  flex: 1 1 0;
  min-width: 92px;
}

.bag-size-input-line .inline-underline-input.qty,
.bag-size-input-line .inline-underline.qty {
  flex: 0 0 32px;
  min-width: 32px;
}

.bag-size-input-line .inline-underline {
  flex: 1 1 0;
  min-width: 92px;
}

.bag-size-input-line .inline-sep:last-child {
  flex: 0 0 auto;
  min-width: 18px;
  text-align: right;
}

.draft-order-row.bag-size-split-row {
  align-items: start;
}

.draft-order-group-head.with-figure,
.sheet-compact-head {
  align-items: flex-start;
}

.sheet-compact-head-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.config-figure-thumb {
  flex-shrink: 0;
  display: grid;
  gap: 6px;
  width: 88px;
  padding: 6px;
  border: 1px solid rgba(74, 55, 31, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: #4d3922;
  text-align: center;
}

.config-figure-thumb img {
  width: 100%;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  background: #fff;
}

.config-figure-thumb span {
  color: #51687f;
  font-size: 11px;
  line-height: 1.2;
}

.config-figure-thumb.draft {
  width: 76px;
  padding: 4px;
}

.config-figure-thumb.draft img {
  height: 42px;
}

.draft-order-control .sheet-line-value {
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #51687f;
}

.template-rule-table {
  overflow-x: auto;
}

.template-rule-table table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.template-rule-table th,
.template-rule-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.template-rule-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.template-rule-table td input[type="text"],
.template-rule-table td select,
.template-rule-table td textarea,
.template-rule-table td input:not([type="checkbox"]) {
  width: 100%;
}

.rule-check-cell {
  text-align: center !important;
}

.rule-check-cell input {
  width: 18px;
  height: 18px;
}

.rule-category-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(46, 117, 182, 0.08);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
}

.draft-preview-shell {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff, #f6faff);
  border: 1px solid rgba(207, 219, 235, 0.9);
}

.sheet-order-shell {
  display: grid;
  gap: 14px;
}

.sheet-order-shell.detail {
  gap: 0;
}

.sheet-order-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.sheet-order-toolbar-note {
  color: var(--muted);
  font-size: 13px;
}

.sheet-order-product-picker {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.sheet-order-product-picker select {
  min-width: 260px;
}

.sheet-paper-card {
  border-radius: 22px;
  border: 1px solid rgba(74, 55, 31, 0.14);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(252, 248, 242, 0.98));
  padding: 16px;
  color: #221c14;
  box-shadow: 0 16px 34px rgba(74, 55, 31, 0.08);
}

.sheet-paper-card.detail {
  padding: 18px;
}

.sheet-paper-card.preview {
  padding: 14px;
}

.sheet-paper-head {
  display: grid;
  gap: 10px;
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(74, 55, 31, 0.22);
}

.sheet-paper-head h2 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 30px);
  color: #21170d;
}

.sheet-paper-code {
  justify-self: end;
  color: #4d3922;
  font-size: 13px;
}

.sheet-line-list {
  margin-top: 10px;
  border-top: 1px solid rgba(74, 55, 31, 0.14);
}

.sheet-line-item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid rgba(74, 55, 31, 0.14);
}

.sheet-line-label {
  color: #221c14;
  font-weight: 700;
}

.sheet-line-value {
  min-height: 22px;
  display: flex;
  align-items: center;
  color: #2e75b6;
}

.sheet-inline-input,
.sheet-textarea {
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #221c14;
}

.sheet-inline-input:focus,
.sheet-textarea:focus {
  outline: none;
}

.sheet-textarea {
  min-height: 68px;
  resize: vertical;
  padding-top: 4px;
}

.sheet-table-head,
.sheet-compact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-table-head {
  margin-top: 14px;
  margin-bottom: 8px;
}

.sheet-table-head h3,
.sheet-compact-head h4 {
  margin: 0;
  color: #221c14;
}

.sheet-table-head span,
.sheet-compact-head span {
  color: var(--muted);
  font-size: 12px;
}

.sheet-line-table table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.sheet-line-table th,
.sheet-line-table td {
  border: 1px solid rgba(74, 55, 31, 0.26);
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
  background: rgba(255, 253, 249, 0.94);
}

.sheet-line-table th {
  background: rgba(246, 239, 229, 0.92);
  color: #221c14;
}

.sheet-line-table td .sheet-inline-input,
.sheet-line-table td select {
  text-align: center;
}

.accent-cell {
  color: #2e75b6;
  font-weight: 700;
}

.sheet-compact-block {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(74, 55, 31, 0.16);
}

.sheet-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.sheet-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(74, 55, 31, 0.14);
  background: rgba(255, 255, 255, 0.78);
  color: #4d3922;
  font-size: 12px;
}

.sheet-chip.active {
  color: #2e75b6;
  border-color: rgba(46, 117, 182, 0.24);
  background: rgba(46, 117, 182, 0.08);
  font-weight: 700;
}

.sheet-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 10px;
}

.sheet-inline-field {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(74, 55, 31, 0.14);
}

.sheet-inline-field.full {
  grid-column: 1 / -1;
  align-items: start;
}

.sheet-inline-field small {
  color: var(--muted);
  line-height: 1.35;
}

.sheet-inline-notice {
  margin-top: 10px;
  padding: 9px 10px;
  border-left: 3px solid rgba(46, 117, 182, 0.28);
  background: rgba(46, 117, 182, 0.08);
  color: #365b89;
  font-size: 12px;
  line-height: 1.5;
}

.sheet-reference-block {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(74, 55, 31, 0.16);
  display: grid;
  gap: 8px;
}

.sheet-reference-title {
  font-size: 13px;
  font-weight: 700;
  color: #4d3922;
}

.sheet-reference-row {
  font-size: 12px;
  color: var(--muted);
}

.detail-mobile-shell {
  display: grid;
  gap: 8px;
}

.desktop-word-shell {
  max-width: 1160px;
  margin: 0 auto;
}

.desktop-word-card {
  border-radius: 8px;
  border-color: rgba(34, 28, 20, 0.3);
  background: #fff;
  padding: 24px 28px 30px;
  box-shadow: 0 10px 28px rgba(34, 28, 20, 0.08);
  font-family: "SimSun", "Songti SC", serif;
}

.desktop-word-card .sheet-paper-head {
  position: relative;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(34, 28, 20, 0.6);
}

.desktop-word-card .sheet-paper-head h2 {
  font-size: clamp(28px, 2.6vw, 40px);
  font-weight: 700;
  letter-spacing: 1px;
}

.desktop-word-card .sheet-paper-code {
  position: absolute;
  right: 0;
  bottom: 0;
  color: #2e75b6;
  font-size: 16px;
}

.desktop-word-card .sheet-line-list {
  margin-top: 16px;
  border-top: 0;
}

.desktop-word-card .sheet-line-item {
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  min-height: 50px;
  border-bottom: 1px solid rgba(34, 28, 20, 0.22);
}

.desktop-word-card .sheet-line-label {
  font-size: 16px;
}

.desktop-word-card .sheet-line-value {
  min-height: 28px;
  color: #2e75b6;
}

.desktop-word-card .sheet-inline-input,
.desktop-word-card .sheet-textarea {
  border-bottom: 1px solid rgba(34, 28, 20, 0.2);
}

.desktop-word-card .sheet-textarea {
  min-height: 92px;
}

.desktop-word-card .sheet-table-head {
  margin-top: 22px;
  margin-bottom: 10px;
}

.desktop-word-card .sheet-table-head h3,
.desktop-word-card .sheet-compact-head h4 {
  font-size: 18px;
}

.desktop-word-card .sheet-table-head span,
.desktop-word-card .sheet-compact-head span {
  font-size: 13px;
}

.desktop-word-card .sheet-line-table th,
.desktop-word-card .sheet-line-table td {
  padding: 10px 8px;
  border-color: rgba(34, 28, 20, 0.34);
  background: #fff;
  font-size: 15px;
}

.desktop-word-card .sheet-line-table th {
  background: #f6f1ea;
}

.desktop-word-card .sheet-compact-block {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(34, 28, 20, 0.24);
}

.desktop-word-card .sheet-chip {
  border-radius: 999px;
  border-color: rgba(34, 28, 20, 0.18);
  background: #fff;
}

.desktop-word-card .sheet-chip.active {
  color: #2e75b6;
  border-color: rgba(46, 117, 182, 0.3);
  background: rgba(46, 117, 182, 0.05);
}

.desktop-word-card .word-inline-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.desktop-word-card .word-field {
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding-bottom: 10px;
}

.desktop-word-card .word-field small {
  color: #221c14;
  font-size: 15px;
  font-weight: 700;
}

.desktop-word-card .word-field .sheet-line-value {
  border-bottom: 1px solid rgba(34, 28, 20, 0.18);
  padding-bottom: 5px;
}

.desktop-word-card .finance-amount-readonly {
  border-color: rgba(34, 28, 20, 0.18);
  background: transparent;
  color: #2e75b6;
}

.desktop-word-card .word-field .sheet-inline-input,
.desktop-word-card .word-field .sheet-textarea {
  padding-bottom: 5px;
}

.desktop-word-card .option-note-row {
  font-size: 13px;
}

.template-center-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.template-product-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.template-product-item {
  display: grid;
  gap: 4px;
  padding: 14px;
  text-align: left;
  border-radius: 18px;
  border: 1px solid rgba(216, 226, 239, 0.94);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: var(--text);
}

.template-product-item.active {
  border-color: rgba(46, 117, 182, 0.26);
  background: linear-gradient(180deg, #ffffff, #eef5ff);
}

.template-product-item span {
  color: var(--muted);
  font-size: 13px;
}

.template-editor-shell {
  display: grid;
  gap: 16px;
}

.template-editor-meta,
.template-default-grid,
.template-header-grid {
  display: grid;
  gap: 12px;
}

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

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

.template-header-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.template-edit-section {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(216, 226, 239, 0.94);
  background: rgba(255, 255, 255, 0.72);
}

.template-edit-section label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

.sales-region-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(244, 247, 251, 0.82);
}

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

.sales-region-meta span {
  color: var(--muted);
  font-size: 12px;
}

.template-media-grid {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.template-media-stack {
  display: grid;
  gap: 16px;
}

.template-media-preview-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(46, 117, 182, 0.26);
  background: linear-gradient(180deg, #fbfdff, #f7fbff);
  color: var(--muted);
  text-align: center;
}

.template-media-preview-card.has-image {
  border-style: solid;
  color: var(--text);
}

.template-media-preview-card:disabled {
  cursor: default;
  opacity: 1;
}

.template-media-preview-image {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
}

.template-media-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 200px;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background: rgba(46, 117, 182, 0.06);
  color: var(--muted);
  font-size: 13px;
}

.template-upload-cta {
  display: inline-grid !important;
  justify-items: start;
  gap: 8px;
  color: var(--text) !important;
  font-weight: 600;
}

.template-media-side {
  display: grid;
  gap: 8px;
  align-content: center;
}

.template-upload-cta input[type="file"] {
  width: 100%;
}

.template-header-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(244, 247, 251, 0.78);
}

.template-preview-shell {
  margin-top: 14px;
}

.image-preview-card {
  width: min(980px, calc(100vw - 24px));
}

.image-preview-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding-top: 12px;
}

.image-preview-body img {
  width: 100%;
  max-height: min(72vh, 760px);
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
}

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

  .template-editor-meta,
  .template-default-grid,
  .template-header-grid,
  .sales-region-grid,
  .sheet-inline-grid {
    grid-template-columns: 1fr;
  }

  .sheet-line-item {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 0;
  }

  .sheet-order-product-picker select {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .finance-amount-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .finance-inline-label {
    font-size: 11px;
  }

  .finance-inline-pair {
    gap: 6px;
  }

  .finance-amount-input,
  .finance-amount-readonly {
    min-height: 38px;
    padding-left: 8px;
    padding-right: 8px;
    font-size: 13px;
  }

  .draft-order-row.bag-size-split-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .draft-order-row.bag-size-split-row .draft-order-control {
    overflow: hidden;
  }

  .sheet-inline-field.bag-size-field {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 6px;
  }

  .draft-order-row.bag-size-split-row .bag-size-section {
    gap: 6px;
  }

  .draft-order-row.bag-size-split-row .bag-size-input-line {
    display: grid;
    grid-template-columns: 44px 12px minmax(46px, 1fr) 10px 14px minmax(46px, 1fr) 22px;
    align-items: center;
    column-gap: 4px;
    row-gap: 0;
    width: 100%;
  }

  .draft-order-row.bag-size-split-row .bag-size-input-line.outer-line {
    grid-template-columns: 44px 26px 10px 12px minmax(42px, 1fr) 10px 14px minmax(42px, 1fr) 22px;
  }

  .draft-order-row.bag-size-split-row .bag-size-input-line strong,
  .draft-order-row.bag-size-split-row .bag-size-input-line .inline-sep,
  .draft-order-row.bag-size-split-row .bag-size-input-line .inline-underline,
  .draft-order-row.bag-size-split-row .bag-size-input-line .inline-underline-input {
    min-width: 0;
  }

  .draft-order-row.bag-size-split-row .bag-size-input-line strong {
    font-size: 11px;
    white-space: nowrap;
  }

  .draft-order-row.bag-size-split-row .bag-size-input-line .inline-sep {
    font-size: 10px;
    text-align: center;
  }

  .draft-order-row.bag-size-split-row .bag-size-input-line .inline-sep:last-child {
    min-width: 22px;
    text-align: left;
  }

  .draft-order-row.bag-size-split-row .bag-size-input-line .inline-underline,
  .draft-order-row.bag-size-split-row .bag-size-input-line .inline-underline-input {
    width: 100%;
    min-width: 0;
  }

  .draft-order-row.bag-size-split-row .bag-size-input-line .inline-underline-input.qty,
  .draft-order-row.bag-size-split-row .bag-size-input-line .inline-underline.qty {
    width: 100%;
    min-width: 0;
  }

  /* 配置表详情页的「包装尺寸」栅格沿用草稿页的紧凑网格，
     否则 L/W 输入按最小宽度不换行排，一行超过屏宽，mm 和右侧「改」被挤出屏幕（ZDJ-1800） */
  .sheet-inline-field.bag-size-field {
    min-width: 0;
    overflow: hidden;
  }

  .sheet-inline-field.bag-size-field .bag-size-grid,
  .sheet-inline-field.bag-size-field .bag-size-section {
    min-width: 0;
    gap: 6px;
  }

  .sheet-inline-field.bag-size-field .bag-size-input-line {
    display: grid;
    grid-template-columns: 44px 12px minmax(46px, 1fr) 10px 14px minmax(46px, 1fr) 22px;
    align-items: center;
    column-gap: 4px;
    row-gap: 0;
    width: 100%;
    min-width: 0;
  }

  .sheet-inline-field.bag-size-field .bag-size-input-line.outer-line {
    grid-template-columns: 44px 26px 10px 12px minmax(42px, 1fr) 10px 14px minmax(42px, 1fr) 22px;
  }

  .sheet-inline-field.bag-size-field .bag-size-input-line strong,
  .sheet-inline-field.bag-size-field .bag-size-input-line .inline-sep,
  .sheet-inline-field.bag-size-field .bag-size-input-line .inline-underline,
  .sheet-inline-field.bag-size-field .bag-size-input-line .inline-underline-input {
    min-width: 0;
  }

  .sheet-inline-field.bag-size-field .bag-size-input-line strong {
    font-size: 11px;
    white-space: nowrap;
  }

  .sheet-inline-field.bag-size-field .bag-size-input-line .inline-sep {
    font-size: 10px;
    text-align: center;
  }

  .sheet-inline-field.bag-size-field .bag-size-input-line .inline-sep:last-child {
    min-width: 22px;
    text-align: left;
  }

  .sheet-inline-field.bag-size-field .bag-size-input-line .inline-underline,
  .sheet-inline-field.bag-size-field .bag-size-input-line .inline-underline-input {
    width: 100%;
    min-width: 0;
  }

  /* 整行不再被这块撑破，右侧「改」按钮才不会被裁掉 */
  .sheet-inline-grid,
  .sheet-compact-block,
  .sheet-inline-field {
    min-width: 0;
  }
}

.product-review-card {
  border: 1px solid #eadfdd;
}

.product-review-card .card-head > div {
  min-width: 0;
}

.product-review-list {
  display: grid;
  gap: 10px;
}

.product-review-branch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e8e4e3;
  border-left: 4px solid #b8b1af;
  border-radius: 12px;
  background: #fff;
}

.product-review-branch.pending {
  border-left-color: var(--brand);
  background: rgba(46, 117, 182, 0.045);
}

.product-review-branch.approved {
  border-left-color: #37845b;
  background: #f6fbf8;
}

.product-review-branch.returned {
  border-left-color: #c5852d;
  background: #fffaf3;
}

.product-review-branch.rejected {
  border-left-color: var(--danger);
  background: #fff8f7;
}

.product-review-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.product-review-main strong {
  display: block;
  color: #292321;
}

.product-review-main p,
.product-review-side small {
  margin: 3px 0 0;
  color: #7c716e;
  font-size: 12px;
}

.product-review-index {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #f3efee;
  color: #6f625f;
  font-size: 12px;
  font-weight: 700;
}

.product-review-side {
  display: grid;
  justify-items: end;
  max-width: 260px;
}

.product-review-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #efedec;
  color: #6f6764;
  font-size: 12px;
  font-weight: 700;
}

.product-review-status.pending {
  background: var(--brand-soft);
  color: var(--brand);
}

.product-review-status.approved {
  background: #e4f4e9;
  color: #276b46;
}

.product-review-status.returned {
  background: #fff0d9;
  color: #945a0f;
}

.product-review-status.rejected {
  background: var(--danger-soft);
  color: var(--danger);
}

.product-review-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(108, 92, 87, 0.12);
}

@media (max-width: 640px) {
  .product-review-branch {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .product-review-side {
    justify-items: start;
    max-width: none;
    padding-left: 38px;
  }

  .product-review-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .product-review-actions .primary-btn {
    grid-column: 1 / -1;
  }
}

.related-orders-card .card-head {
  align-items: flex-start;
}

.related-order-list {
  display: grid;
  gap: 8px;
}

.related-order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #e7e2e0;
  border-radius: 11px;
  background: #fff;
}

.related-order-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: #302927;
  text-align: left;
  cursor: pointer;
}

.related-order-open > span:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.related-order-open strong,
.related-order-open small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-order-open small {
  color: #817673;
}

.related-order-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f5ecea;
  color: #9d3b34;
  font-size: 12px;
  font-weight: 700;
}

.related-order-unlink {
  border: 0;
  border-left: 1px solid #eee8e6;
  background: #faf8f7;
  color: #9b8e8a;
  font-size: 19px;
  cursor: pointer;
}

.related-order-empty {
  padding: 16px;
  border: 1px dashed #d9cfcc;
  border-radius: 11px;
  color: #8a7d79;
  text-align: center;
}

@media (max-width: 640px) {
  .related-orders-card .card-head {
    display: grid;
    gap: 10px;
  }

  .related-orders-card .card-head .secondary-btn {
    width: 100%;
  }

  .related-order-open {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ============ 一期：技术域管理 / 模板版本 / 操作日志 ============ */
.um-tabs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.um-tabs button {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #6f625e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.um-tabs button:hover,
.um-tabs button:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
  outline: 0;
}

.um-tabs button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.um-tabs button.active:hover,
.um-tabs button.active:focus-visible {
  color: #fff;
}

.tech-org-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
}

.tech-org-field {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.tech-org-field-label {
  font-size: 13px;
  font-weight: 700;
  color: #6f625e;
}

.tech-org-select {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  max-width: 360px;
  font-size: 13px;
  font-weight: 700;
  color: #6f625e;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  font-size: 13px;
  cursor: pointer;
}

.checkbox-chip input {
  width: auto;
  margin: 0;
}

.checkbox-chip.is-disabled {
  opacity: 0.55;
}

.grade-mapping-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.grade-mapping-grid label {
  display: grid;
  gap: 4px;
  width: 88px;
  font-size: 13px;
  font-weight: 700;
  color: #6f625e;
}

.tech-org-warning {
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid #e8d59a;
  border-radius: var(--radius-md);
  background: #fdf6e3;
  color: #8a6d1b;
  font-size: 13px;
  line-height: 1.6;
}

.tech-org-product {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
}

.tech-org-product-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.tech-org-product-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.tech-org-product-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.tech-org-template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.conveyor-chip {
  gap: 10px;
}

.conveyor-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8a7d79;
  font-size: 12px;
}

.tech-org-identity-row {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}

.tech-org-identity-row span {
  color: #8a7d79;
  line-height: 1.6;
}

.audit-log-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.audit-log-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
}

.audit-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.audit-log-head span {
  color: #8a7d79;
  font-size: 12px;
}

.audit-log-reason {
  margin-top: 6px;
  font-size: 13px;
  color: #8a6d1b;
}

.audit-log-change {
  margin-top: 4px;
  font-size: 12px;
  color: #6f625e;
  line-height: 1.6;
  word-break: break-all;
}

.audit-log-change span {
  font-weight: 700;
}

.template-version-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  margin-bottom: 14px;
}

.template-version-note {
  display: block;
  color: #8a7d79;
  font-size: 11px;
}

.template-history-card {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.template-editor-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

@media (max-width: 640px) {
  .tech-org-product-head {
    flex-direction: column;
  }

  .grade-mapping-grid label {
    width: 72px;
  }
}

.user-detail-form .user-enabled-field {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
}

.user-detail-form .user-enabled-field input {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

@media (max-width: 760px) {
  .shell {
    width: calc(100% - 16px);
  }
}

/* ============ 生产端一期：只读交付 + 生产自维护状态 ============ */
.production-order-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 16px 16px 13px;
  text-align: left;
  box-shadow: 0 10px 24px rgba(55, 45, 36, 0.05);
  color: var(--ink);
  cursor: pointer;
}

.production-order-card + .production-order-card {
  margin-top: 12px;
}

.production-card-top,
.production-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.production-card-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.35;
  color: #1f2a3d;
}

.production-card-tags {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  max-width: 48%;
  overflow-x: auto;
  scrollbar-width: none;
}

.production-card-tags::-webkit-scrollbar {
  display: none;
}

.production-card-sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.production-card-alert {
  margin-top: 10px;
  border-left: 4px solid #d64541;
  border-radius: 10px;
  background: #fdeceb;
  padding: 8px 10px;
  color: #a8322f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.production-card-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(108, 92, 87, 0.12);
  color: var(--muted);
  font-size: 12px;
}

.production-card-ship {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-card-ship.warn,
.production-card-ship.danger {
  color: #d64541;
  font-weight: 800;
}

.production-card-ship.done {
  color: #2b8a6e;
  font-weight: 800;
}

.production-status-pill,
.production-exception-pill,
.production-next-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
  background: #eaf2fb;
  color: #2e75b6;
  white-space: nowrap;
}

.production-next-pill {
  background: #f4f1ed;
  color: #655b57;
}

.production-status-pill.in_production,
.production-status-pill.scheduled {
  background: #fff4d8;
  color: #9a6a00;
}

.production-status-pill.completed,
.production-status-pill.pending_shipment,
.production-status-pill.shipped {
  background: #e3f4ed;
  color: #2b8a6e;
}

.production-exception-pill {
  margin-left: 8px;
  background: #fdeceb;
  color: #d64541;
}

.production-status-banner {
  margin: 12px 0;
  border: 1px solid rgba(46, 117, 182, 0.28);
  border-left: 4px solid #2e75b6;
  border-radius: 14px;
  background: linear-gradient(0deg, rgba(234, 242, 251, 0.65), rgba(234, 242, 251, 0.65)), #fff;
  padding: 13px 14px;
}

.production-status-banner.has-exception {
  border-color: rgba(214, 69, 65, 0.35);
  border-left-color: #d64541;
  background: linear-gradient(0deg, rgba(253, 236, 235, 0.7), rgba(253, 236, 235, 0.7)), #fff;
}

.production-status-banner h3 {
  margin: 9px 0 3px;
  font-size: 16px;
}

.production-status-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.production-detail-shell .content-card {
  margin-bottom: 12px;
}

.production-config-card .draft-order-shell {
  padding: 0;
}

.production-config-card .draft-order-groups {
  margin-top: 0;
}

.production-tech-list {
  display: grid;
  gap: 10px;
}

.production-tech-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.9fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.production-tech-row p,
.production-tech-row span {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.production-status-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.production-status-control button {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 38px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.production-status-control button.active {
  border-color: #2e75b6;
  background: #eaf2fb;
  color: #2e75b6;
}

.production-note-form {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.production-note-form textarea,
.production-note-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
}

.production-confirm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.production-exception-box {
  margin-top: 14px;
  border: 1px solid rgba(214, 69, 65, 0.28);
  border-radius: 12px;
  background: #fdeceb;
  padding: 11px;
}

.production-exception-box p {
  margin: 6px 0 10px;
  color: #7d2926;
  font-size: 13px;
  line-height: 1.55;
}

.shared-production-card {
  margin-bottom: 12px;
}

.shared-production-compact {
  padding: 12px 14px 14px;
}

.shared-production-compact-head-row {
  align-items: flex-start;
  margin-bottom: 10px;
}

.shared-production-compact-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.shared-production-compact-head h3 {
  margin: 0;
}

.shared-production-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.shared-production-metric {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #eef2f6;
  border-radius: 10px;
  background: #f8fafc;
}

.shared-production-metric > span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.shared-production-metric > strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.shared-production-compact-alert {
  margin-top: 8px;
  margin-bottom: 0;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .shared-production-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .shared-production-metric {
    padding: 6px 5px;
    border-radius: 8px;
  }

  .shared-production-metric > span {
    font-size: 9px;
  }

  .shared-production-metric > strong {
    font-size: 10px;
    line-height: 1.3;
  }
}

.danger-note {
  border-left: 3px solid #d64541;
  color: #a8322f;
  background: #fdeceb;
}

.production-workbench,
.production-orders-panel {
  overflow: visible;
}

.production-orders-panel {
  margin-top: 4px;
}

.production-orders-head {
  margin-bottom: 10px;
}

.production-action-card,
.production-exception-card,
.production-note-card,
.production-remark-card {
  width: 100%;
}

.production-current-state {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(46, 117, 182, 0.22);
  border-radius: 12px;
  background: #f7fbff;
  padding: 12px;
}

.production-current-state strong {
  font-size: 18px;
}

.production-current-state small {
  color: var(--muted);
  line-height: 1.45;
}

.production-progress-card {
  margin-top: 12px;
  padding: 13px 8px 10px;
  border: 1px solid rgba(46, 117, 182, 0.18);
  border-radius: 14px;
  background: #fff;
}

.production-progress-card + .production-current-state {
  margin-top: 12px;
}

.production-progress-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.production-progress-steps > div {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #9b938f;
  font-size: 11px;
}

.production-progress-steps > div::before {
  content: "";
  position: absolute;
  top: 5px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #e4dfda;
  transform: translateX(-50%);
}

.production-progress-steps > div:first-child::before {
  display: none;
}

.production-progress-steps > div > span {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 2px solid #d6d0ca;
  border-radius: 50%;
  background: #fff;
}

.production-progress-steps > div.done::before,
.production-progress-steps > div.current::before {
  background: #2e75b6;
}

.production-progress-steps > div.done > span,
.production-progress-steps > div.current > span {
  border-color: #2e75b6;
  background: #2e75b6;
}

.production-progress-steps > div.current {
  color: #2e75b6;
  font-weight: 800;
}

.production-next-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.production-next-action-single {
  grid-template-columns: 1fr;
}

.production-next-action-single .primary-btn {
  width: 100%;
}

.production-next-action p,
.production-transition-panel p,
.production-adjust-box p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.production-transition-panel {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  border: 1px solid rgba(46, 117, 182, 0.24);
  border-radius: 12px;
  background: #f7fbff;
  padding: 12px;
}

.production-transition-panel textarea,
.production-adjust-box textarea,
.production-adjust-box select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
}

.production-transition-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.production-adjust-box {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.production-adjust-box summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.production-adjust-box select,
.production-adjust-box textarea {
  margin-top: 8px;
}

.production-adjust-box button {
  margin-top: 8px;
}

.production-exception-card.has-open-exception {
  border-color: rgba(214, 69, 65, 0.32);
}

.production-exception-main {
  display: grid;
  gap: 10px;
}

.production-exception-main strong {
  line-height: 1.55;
}

.production-exception-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.production-assignee-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.production-activity-list {
  display: grid;
  gap: 10px;
}

.production-activity-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.production-activity-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.production-activity-item span {
  color: var(--muted);
  font-size: 12px;
}

.production-activity-item p {
  margin: 7px 0 0;
  color: var(--ink);
  line-height: 1.55;
  font-size: 13px;
}

@media (max-width: 640px) {
  .finance-workbench-head,
  .finance-action-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .finance-workbench {
    width: 100%;
  }

  .finance-order-card,
  .finance-audit-grid {
    grid-template-columns: 1fr;
  }

  .finance-filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-filter-chip {
    justify-content: space-between;
  }

  .finance-money-grid,
  .finance-context-grid,
  .finance-config-preview-fields,
  .finance-kv-grid,
  .finance-receipt-dialog-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 手机窄屏：详情页外层三列大网格塌成单列纵向堆叠，避免标题被挤成竖排单字 */
  .finance-detail-onepage-grid,
  .finance-detail-topline {
    grid-template-columns: 1fr;
  }

  /* 操作按钮从右侧窄条改为通栏大按钮，方便手指点 */
  .finance-detail-inline-actions {
    min-width: 0;
    justify-content: stretch;
  }

  .finance-detail-inline-actions .finance-list-action {
    flex: 1;
    width: auto;
    min-height: 40px;
    font-size: 14px;
  }

  .production-tech-row,
  .production-next-action {
    grid-template-columns: 1fr;
  }

  .production-status-bar-shell .status-grid {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .production-status-bar-shell .status-tile {
    flex: 0 0 88px;
  }

  .production-card-top {
    align-items: flex-start;
  }

  .production-card-tags {
    max-width: 52%;
    justify-content: flex-end;
  }

  .production-progress-card {
    overflow-x: auto;
    padding-left: 10px;
    padding-right: 10px;
  }

  .production-progress-steps {
    min-width: 420px;
  }

  .production-transition-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .production-activity-item > div {
    align-items: flex-start;
    flex-direction: column;
  }
}

.tech-order-card-meta {
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.tech-order-card-meta.compact {
  font-size: 11px;
}

.irf-cosign-progress {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft, #e8ebf0);
  border-radius: 10px;
  background: #f8fafc;
}

.irf-cosign-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.irf-cosign-progress-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.irf-cosign-item {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef2f7;
}

.irf-cosign-item.ok {
  color: #0f766e;
  background: #ecfdf5;
}

.irf-cosign-item.wait {
  color: #b45309;
  background: #fffbeb;
}

.irf-cosign-item.warn {
  color: #b91c1c;
  background: #fef2f2;
}

/* 退回/不通过的产品：chip 下挂一行原因；没有原因时仍走裸 chip，不影响单行紧凑排布 */
.irf-cosign-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  max-width: 100%;
}

.irf-cosign-reason {
  padding: 0 8px;
  font-size: 11px;
  line-height: 1.45;
  color: #b91c1c;
  overflow-wrap: anywhere;
}

.irf-cosign-diff {
  margin: 8px 0 0;
  font-size: 12px;
  color: #b45309;
}

/* 销售端在会签卡上增删产品（技术端不出现这些控件） */
.irf-cosign-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.irf-cosign-progress-head {
  flex-wrap: wrap;
  align-items: center;
}

.irf-cosign-progress.delete-mode .irf-cosign-progress-items {
  display: grid;
  gap: 8px;
}

.irf-cosign-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.irf-cosign-row .sales-config-delete-pick {
  align-self: center;
  height: 28px;
  min-height: 28px;
  font-size: 18px;
}

.irf-cosign-row .sales-config-delete-confirm {
  flex: 1 1 100%;
}

.irf-bag-photo-thumbs.inline {
  display: inline-flex;
  margin-left: 8px;
  vertical-align: middle;
}

.product-tab-side em.submitted {
  color: #047857;
}
