:root {
  /* 主题橙（参考 evergreenadm.xiaohouyunyin.com 的橙色系，2026-09-02 定）：
     主操作 #E8590C / 亮橙点缀 #FF8A07 / 奶油浅底 #FFF3E0 系。
     变量名沿用 green-* 是为了少改引用处，值已是橙色阶。 */
  --green-900: #7A3408;
  --green-700: #FF8A07;   /* 主按钮底色（参考站亮橙，白字） */
  --green-600: #E8590C;   /* 链接 / hover / 描边（亮橙上可读的深一号） */
  --green-300: #FFB784;
  --green-100: #FFE9D2;
  --green-50:  #FFF6EC;
  --brand-bright: #FF8A07;
  --brand-cream: #FFF0DD;
  --ok-bg:    #EAF3DE;   /* 成功状态的绿底（语义色，不随主题） */
  --ok-fg:    #3B6D11;
  --ink:       #2A2724;
  --ink-2:     #6B645C;
  --ink-3:     #9A9186;
  --line:      #E8E0D6;
  --line-2:    #D5CBBB;
  --bg:        #FAF6F0;
  --card:      #ffffff;
  --radius:    10px;
  --shadow:    0 1px 2px rgba(122, 52, 8, .08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--green-900); }
h1 { font-size: 19px; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
p  { margin: 0 0 8px; }
a  { color: var(--green-600); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶部条 ---------- */
.topbar {
  background: linear-gradient(180deg, var(--brand-cream), #fff 30px), var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--green-700);
  color: #fff; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
/* 小猴云印 logo：替换掉原来的文字圆标（登录页用 inline 高度放大） */
.brand-logo {
  flex: none; height: 34px; width: auto;
  border-radius: 8px; object-fit: contain; align-self: center;
}
.brand-sub { font-size: 12px; color: var(--ink-3); }
.spacer { flex: 1 1 auto; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}

/* ---------- 概览数字 ---------- */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.metric {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.metric-label { font-size: 12px; color: var(--ink-2); }
.metric-value { font-size: 24px; font-weight: 600; color: var(--green-900); line-height: 1.3; }
.metric-value.warn { color: #854F0B; }
.metric-hint { font-size: 12px; color: var(--ink-3); }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab {
  appearance: none; background: none; border: none; border-bottom: 2px solid transparent;
  padding: 9px 14px; font-size: 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
  font-family: inherit;
}
.tab:hover { color: var(--green-600); }
.tab.active { color: var(--green-600); border-bottom-color: var(--green-700); font-weight: 600; }
.panel { display: none; }
.panel.active { display: block; }

/* ---------- 按钮 ---------- */
.btn {
  appearance: none; font-family: inherit; font-size: 13px; line-height: 1.5;
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { border-color: var(--green-600); color: var(--green-600); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-600); border-color: var(--green-600); color: #fff; }
/* 流程推进按钮按状态色配（跟对应徽章同色板，2026-09-02 定）：
   确认 = 绿（已确认徽章 #3B6D11）、发货 = 蓝（发货中 #185FA5）、签收 = 紫（已签收 #5B2D8C） */
.btn-ok { background: var(--ok-fg, #3B6D11); border-color: var(--ok-fg, #3B6D11); color: #fff; }
.btn-ok:hover { background: #27500A; border-color: #27500A; color: #fff; }
.btn-blue { background: #185FA5; border-color: #185FA5; color: #fff; }
.btn-blue:hover { background: #0C447C; border-color: #0C447C; color: #fff; }
.btn-purple { background: #5B2D8C; border-color: #5B2D8C; color: #fff; }
.btn-purple:hover { background: #3C1E63; border-color: #3C1E63; color: #fff; }
.btn-danger { color: #A32D2D; border-color: #F09595; }
.btn-danger:hover { background: #FCEBEB; border-color: #E24B4A; color: #A32D2D; }
.btn-warn { color: #854F0B; border-color: #EF9F27; }
.btn-warn:hover { background: #FAEEDA; border-color: #C97600; }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=date], input[type=number],
select, textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px;
  background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--green-600); box-shadow: 0 0 0 3px var(--green-100); }
textarea { resize: vertical; min-height: 62px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin-bottom: 0; min-width: 130px; }
.filters .field.grow { flex: 1 1 200px; }

/* ---------- 表格 ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
thead th {
  background: var(--green-100); color: var(--green-900); font-weight: 600;
  text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-2);
  white-space: nowrap; position: sticky; top: 0;
}
tbody td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:nth-child(even) { background: var(--green-50); }
tbody tr:hover { background: var(--green-100); }
td.num, th.num { text-align: right; white-space: nowrap; }
td.mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { padding: 34px 12px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------- 状态徽章 ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.7;
}
.badge-pending   { background: #FAEEDA; color: #854F0B; }
.badge-confirmed { background: var(--ok-bg); color: var(--ok-fg); }
/* 结算自动徽标（「已收合同/账单」「已收发票」）2026-09-23 第 4 轮：用户要「粉色的主题色」，
   项目没有现成粉色（logo 橙 #F09030 / 主题 --brand-bright #FF8A07 / 底色米 #FAF6F0）⇒
   新增专用类。圆角/字号/内边距全部继承 .badge，只换颜色，尺寸一字不动。 */
.badge-settle    { background: #FDE7F0; color: #B23A66; }
.badge-shipping  { background: #E6F1FB; color: #185FA5; }
.badge-signed     { background: #F4ECFB; color: #5B2D8C; }
.badge-done      { background: #F1EFE8; color: #5F5E5A; }
.badge-pay-none    { background: #F1EFE8; color: #5F5E5A; }
.badge-pay-pending { background: #E9EEF4; color: #54606E; }
.badge-pay-done    { background: var(--ok-bg); color: var(--ok-fg); }
.badge-err         { background: #FFE0E0; color: #C0392B; }
/* 少收货：钱可能没错，但货没交齐，同样要处理（跟月结账单里的标黄一致） */
.badge-warn        { background: #FFF3CD; color: #854F0B; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(23,52,4,.28);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 50;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--card); border-radius: 14px; width: 100%; max-width: 620px;
  box-shadow: 0 8px 28px rgba(23,52,4,.18); overflow: hidden;
  margin: auto;
}
.modal-wide { max-width: 900px; }
.modal-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  background: var(--green-50);
}
.modal-body { padding: 18px; max-height: 70vh; overflow-y: auto; }
.modal-foot {
  padding: 12px 18px; border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
  background: #fcfdfb;
}
.x-btn {
  appearance: none; background: none; border: none; font-size: 20px; line-height: 1;
  color: var(--ink-2); cursor: pointer; padding: 0 4px; font-family: inherit;
}
.x-btn:hover { color: var(--ink); }

/* ---------- 详情列表 ---------- */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; word-break: break-all; }

/* ---------- 提示条 ---------- */
.alert { padding: 10px 13px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; border: 1px solid; }
.alert-info    { background: var(--green-50); border-color: var(--green-300); color: var(--green-900); }
.alert-warn    { background: #FAEEDA; border-color: #EF9F27; color: #633806; }
.alert-err     { background: #FCEBEB; border-color: #F09595; color: #791F1F; }

/* ---------- toast ---------- */
#toast-host { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 999; }
.toast {
  background: var(--green-900); color: #fff; padding: 9px 16px; border-radius: 8px;
  font-size: 13px; margin-bottom: 8px; box-shadow: 0 4px 14px rgba(23,52,4,.25);
  animation: toast-in .18s ease-out;
}
.toast.err { background: #A32D2D; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px);} to { opacity: 1; } }

/* ---------- 专属链接 ---------- */
.link-box {
  display: flex; gap: 8px; align-items: center; margin-top: 6px;
}
.link-box input {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px; background: var(--green-50);
}
.link-box input[readonly] { cursor: text; }

/* ---------- 上传区 ---------- */
.dropzone {
  border: 2px dashed var(--line-2); border-radius: var(--radius);
  padding: 30px 16px; text-align: center; background: var(--green-50);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--green-600); background: var(--green-100); }
.dropzone-title { font-size: 15px; font-weight: 600; color: var(--green-900); }
.dropzone-hint { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

/* ---------- 登录 ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card { width: 100%; max-width: 360px; }
/* 顶部奶油橙渐变，跟参考站顶栏一个味道 */
.login-card .card {
  background: linear-gradient(180deg, var(--brand-cream), #fff 46px), var(--card);
}
.login-card .brand { justify-content: center; margin-bottom: 18px; }

/* ---------- 其它 ---------- */
.muted { color: var(--ink-2); font-size: 12.5px; }
.tiny { color: var(--ink-3); font-size: 12px; }
.section-title { margin: 22px 0 10px; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- 可搜索下拉（供应商 45 家，输入即过滤） ---------- */
select.ssel-src { display: none; }  /* 原控件视觉隐藏，value 仍与组件双向同步 */
.ssel { position: relative; }
.ssel-input { width: 100%; }
.ssel-pop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 80;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(23,52,4,.14); max-height: 264px; overflow-y: auto; padding: 4px; }
.ssel-opt { padding: 7px 11px; font-size: 13px; cursor: pointer; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ssel-opt:hover, .ssel-opt.hot { background: var(--green-100); color: var(--green-900); }
.ssel-empty { padding: 7px 11px; font-size: 12.5px; color: var(--ink-3); }
.ssel-cap { padding: 4px 11px 6px; font-size: 11.5px; color: var(--ink-3);
  border-bottom: 1px solid var(--line); margin-bottom: 2px; }

/* 可点击的单号（点开弹订单详情） */
.lnk { cursor: pointer; }
.lnk:hover { text-decoration: underline; }

/* 月结账单摘要：选完供应商+月份立刻显示，下载前先看一眼对不对 */.settle-summary {
  margin-top: 14px;
  padding: 10px 14px;
  max-width: 620px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--green-50);
  font-size: 13.5px;
  color: var(--ink-2);
}
.settle-summary b { color: var(--green-900); font-weight: 600; }
.settle-summary .warn { color: #8a6d3b; }

/* ---------- 手机适配 ---------- */
@media (max-width: 720px) {
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .wrap { padding: 0 12px; }
  .card { padding: 14px; }
  .kv { grid-template-columns: 84px 1fr; }
  .modal-body { max-height: none; }
  .modal-backdrop { padding: 16px 10px; }
}

/* 快递轨迹时间线（批次2后半，2026-09-03） */
.trace-btn { margin-top: 3px; }
.trace { margin: 4px 2px; max-height: 440px; overflow: auto; padding-right: 4px; }
.tr-node { position: relative; padding: 0 0 16px 20px; margin-left: 5px;
           border-left: 2px solid #E8DCC8; }
.tr-node:last-child { border-left-color: transparent; padding-bottom: 2px; }
.tr-dot { position: absolute; left: -5px; top: 3px; width: 8px; height: 8px;
          border-radius: 50%; background: #D9C7A8; }
.tr-last .tr-dot { background: #F08C2E; box-shadow: 0 0 0 3px rgba(240,140,46,.18); }
.tr-last .tr-ctx { color: #222; font-weight: 600; }
.tr-ctx { color: #444; line-height: 1.5; word-break: break-word; }
.grey { color: #999; }

/* 收货确认（批次4，2026-09-03）——橙黄警示但不刺眼 */
.badge-await { background: #FFF3CD; color: #854F0B; border: 1px solid #EFC78A; }

/* 数量异议提示条（需求B，2026-09-10）：工厂对批次实收提异议时供应商卡/详情顶部红条 */
.dispute-bar {
  background: #FFF1EE; border: 1px solid #F2B8B5; color: #A93226;
  border-radius: 9px; padding: 8px 11px; font-size: 12.5px; line-height: 1.6;
  margin: 0 0 8px; word-break: break-word;
}
.dispute-bar .cat-tag { background: #F6D6D2; color: #8E2B22; }
.dispute-bar b { color: #A93226; }


/* 签收不认可红条（批次4，2026-09-03） */
.sign-reject-bar {
  background: #FFF1EE; border: 1px solid #F2B8B5; color: #A93226;
  border-radius: 7px; padding: 6px 10px; font-size: 12.5px; line-height: 1.6;
  margin: 0 0 8px; word-break: break-word;
}
.sign-reject-bar .lnk { color: #A93226; font-weight: 600; text-decoration: underline; }
.alert-err { background: #FFF1EE; border: 1px solid #F2B8B5; color: #A93226; border-radius: 8px; padding: 8px 12px; font-size: 13px; }

/* 工厂平台链接管理（批次4） */
.fl-list { display: flex; flex-direction: column; gap: 8px; }
.fl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
          border: 1px solid #E8E0D6; border-radius: 9px; padding: 7px 10px; }
.fl-input { width: 100%; min-width: 260px; box-sizing: border-box; font-size: 11.5px;
            padding: 5px 8px; border: 1px solid #D5CBBB; border-radius: 7px;
            background: #FDFBF7; color: #444; }

/* 验证闸门（公共：供应商端设备验证 / 工厂平台名称验证，批次3/4 调优 2026-09-03） */
.dev-gate {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(252, 249, 244, .96);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.dev-gate-card {
  background: #fff; border: 1px solid #EFE6DA; border-radius: 16px;
  padding: 26px 22px 20px; width: 100%; max-width: 320px; text-align: center;
  box-shadow: 0 16px 44px rgba(90, 60, 20, .13);
}
.dev-gate-logo { margin-bottom: 4px; }
.dev-gate-logo img { height: 22px; width: auto; opacity: .92; }
.dev-gate-card h2 { margin: 6px 0 8px; color: #8A4400; font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.dev-gate-tip { color: #7A7368; font-size: 12px; line-height: 1.8; margin: 0 0 14px; }
.dev-gate-tip strong { color: #B34700; font-weight: 700; }
.dev-gate-card input {
  width: 100%; box-sizing: border-box; padding: 9px 12px;
  border: 1px solid #DDD3C6; border-radius: 9px; font-size: 14px;
  text-align: center; outline: none; background: #FDFBF7;
  transition: border-color .15s, box-shadow .15s;
}
.dev-gate-card input:focus { border-color: #F08C2E; background: #fff;
  box-shadow: 0 0 0 3px rgba(240, 140, 46, .14); }
.dev-gate-err { color: #C0392B; font-size: 11.5px; min-height: 20px; padding-top: 7px; }

/* 顶栏品牌：名字 + 「· 小猴云印」同字号同色（2026-09-03 定稿，2026-09-20 复核复原） */
.brand-corp { color: var(--green-900); font-weight: 700; font-size: 16px;
  margin-left: 1px; line-height: 1; }

/* 收尾档位（批次5，2026-09-03）：已作废灰置 / 减单完结黄棕 */
.badge-void { background: #F1F0ED; color: #8F8D88; text-decoration: line-through; }
.badge-reduced { background: #FFF1E0; color: #9A4E0B; border: 1px solid #EAC08B; }

/* 数据审计（批次6） */
.ok-empty { background: #F3FAF0; border: 1px solid #CBE4C0; color: #2E7D32;
  border-radius: 9px; padding: 14px 16px; font-size: 13.5px; }
.au-block { margin: 0 0 14px; }
.au-block h3 { font-size: 14px; margin: 0 0 6px; color: #7A3408; }
.au-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid #F0D9D5; background: #FFF8F7; border-radius: 8px;
  padding: 6px 10px; margin-bottom: 6px; font-size: 13px; }
.au-block:nth-of-type(2) .au-row { border-color: #EFC78A; background: #FFFBF2; }
.au-block:nth-of-type(3) .au-row { border-color: #CDE0EF; background: #F7FBFF; }
.au-main { min-width: 0; }

/* 后台订单块状平铺（2026-09-03） */
.oblock { background: #fff; border: 1px solid #E7E1D5; border-radius: 13px;
  padding: 13px 15px; margin-bottom: 11px; box-shadow: 0 1px 4px rgba(90,60,20,.05);
  border-left: 4px solid #D5CDBD; }
.oblock.st-pending { border-left-color: #EF9F27; }
.oblock.st-confirmed { border-left-color: #3B6D11; }
.oblock.st-shipping { border-left-color: #378ADD; }
.oblock.st-done { border-left-color: #B4B2A9; }
.oblock.st-void { border-left-color: #C9C5BD; background: #FBFBFA; }
.oblock.st-reduced { border-left-color: #E9A45B; }
.oblock.st-signed { border-left-color: #8E6FBF; }
.oblock.st-await { border-left-color: #E8590C; }
.ob-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
/* 批次级「逾期 / 临期」提示（2026-09-21 分批计划，邓姐 00:41：提示跟着批次走）。
   文案由后端 db.get_order 算好（batch.date_hint / date_hint_cls），三端只负责显示：
   逾期红字加粗、临期（今天/明天到期）橙字。没 hint 的批次这一行整块不渲染。 */
.b-hint { margin: 0 0 4px; font-size: 12px; line-height: 1.5; }
.b-hint .bhint { display: inline-block; padding: 1px 8px; border-radius: 6px;
  border: 1px solid transparent; }
.b-hint .bhint-od { background: #FFE0E0; border-color: #F5B7B1; color: #C0392B; font-weight: 600; }
.b-hint .bhint-due { background: #FFF3CD; border-color: #EFD9A8; color: #854F0B; }
/* 供应商改某一批时写的「说明」（2026-09-21 傍晚邓姐第 4 条「说明必填，做成提示给工厂看」）：
   贴在该批下面给工厂 / 采购看 —— 尤其是「改品类数量」这种不需要审批的改动，
   不显出来的话工厂完全不知道供应商为什么改。放 style.css 是因为工厂端和后台都要用。 */
.pl-note { margin: 3px 0 0; padding: 3px 8px; border-left: 2px solid #CBBFAE;
  background: #FBF8F3; border-radius: 0 6px 6px 0; color: #6B645C;
  font-size: 12.5px; line-height: 1.6; }
.ob-meta { font-size: 12.5px; color: #6B645C; display: flex; gap: 12px;
  flex-wrap: wrap; margin-bottom: 4px; }
.oblock .lnk { color: #B34700; }
#orders-body .oblock .mono b { color: var(--green-900); font-size: 14.5px; }
.ob-batches { background: #F7F4EE; border: 1px dashed #D8CDBD; border-radius: 8px;
  padding: 5px 10px; margin-top: 6px; font-size: 12.5px; display: flex;
  flex-direction: column; gap: 3px; }
.ob-acts { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
/* 后台块内物料表（11 列，固定布局） */
#orders-body .mtab { width: 100%; border-collapse: collapse; font-size: 12.5px;
  table-layout: fixed; }
#orders-body .mtab th { font-weight: 600; white-space: nowrap; font-size: 12px; }
#orders-body .mtab th, #orders-body .mtab td { padding: 4px 5px; }
#orders-body .mtab .num { text-align: center; }
#orders-body .mtab tfoot td { border-top: 1px solid #E4DACB; color: #5F5242; }

/* 三端统一顶部品牌条（2026-09-03 邓姐：照工厂样式） */
.ft-brand { display: flex; align-items: center; gap: 9px; font-weight: 700;
  color: var(--green-900); font-size: 16px; }
.ft-brand img { height: 30px; }
/* 后台/供应商复用的收货红条与右下进度条 */
.addr-line { margin: 6px 0 0; font-size: 12px; color: #C0392B; font-weight: 600;
  background: #FFF5F3; border: 1px solid #F3D6D2; border-radius: 7px;
  padding: 5px 10px; word-break: break-all; }
/* 进度条（2026-09-03 间距统一：每格等宽内边距、箭头等距、整体基线对齐） */
.step-mini { display: inline-flex; align-items: center; gap: 0; font-size: 10px;
  color: #B9B0A2; white-space: nowrap; line-height: 1; }
.step-mini .sm { display: inline-flex; align-items: center; justify-content: center;
  color: #C9C0B2; padding: 3px 7px; border-radius: 9px; line-height: 1;
  margin: 0 2px; height: 19px; box-sizing: border-box; }
.step-mini .sm.done { color: #A79D8C; background: #F0EBE1; }
.step-mini .sm.cur { color: #B34700; background: #FFE9D2; font-weight: 700; }
.step-mini .sm-ar { color: #DDD5C8; padding: 0 1px; display: inline-flex;
  align-items: center; }
/* 后台金额单列 */
.amt1 { width: 168px; text-align: right; white-space: nowrap; }
/* 首行冻结：后台页签行与筛选行随滚动吸顶（2026-09-03） */
.tabs { position: sticky; top: 0; z-index: 40; background: #FAF6F0;
  border-radius: 10px; }
.panel .filters { position: sticky; top: 46px; z-index: 30; background: #fff;
  border-radius: 12px; padding: 4px 8px; box-shadow: 0 6px 16px rgba(90,60,20,.06); }

/* 后台物料表列宽：与供应商平台同款（2026-09-03 照搬） */
#orders-body .mtab { width: 100%; border-collapse: collapse; font-size: 12.5px;
  table-layout: fixed; }
#orders-body .mtab th { font-weight: 600; white-space: nowrap; }
#orders-body .mtab th, #orders-body .mtab td { padding: 5px 6px; }
#orders-body .mtab .num { text-align: center; }
#orders-body .mtab .idxc { width: 32px; text-align: center; color: #9A9186; }
#orders-body .mtab .catc { width: 62px; color: #6B645C; font-size: 11.5px;
  white-space: nowrap; }   /* 2026-09-20 与供应商端同口径：类别不换行（原来 break-word 会断行） */
#orders-body .mtab .q9 { width: 64px; text-align: center; }
#orders-body .mtab .bstate { width: 90px; text-align: center; }
#orders-body .mtab .p4 { width: 76px; text-align: center; }
#orders-body .mtab .amtc { width: 126px; text-align: center; }
#orders-body .mtab .specc { word-break: break-word; }
#orders-body .mtab tfoot td { border-top: 1px solid #E4DACB; color: #5F5242; }
/* 后台/供应商顶部品牌行：窄版居中左对齐（2026-09-03） */
.top-brand, .sup-topbar-row { max-width: 1160px; margin-left: auto; margin-right: auto; }

/* 冻结（2026-09-03）：仅页签行吸顶；订单搜索工具条不冻结 */
.tabs { background: #FFFDF9; }

/* 后台顶栏=标题行（2026-09-03）：小 logo + 标题，右侧刷新/退出原位 */
.topbar-inner { max-width: 1180px; padding: 8px 16px; }
.topbar .brand-logo { height: 22px; width: auto; vertical-align: middle; }
.topbar .brand { align-items: center; }
.topbar .brand > div { display: inline-flex; align-items: baseline; gap: 6px; }
.topbar h1 { font-size: 16px; font-weight: 700; color: var(--green-900); margin: 0;
  display: inline; }
.topbar .brand-sub { font-size: 16px; color: var(--green-900); font-weight: 700;
  line-height: 1.25;
  display: inline; }

/* 统计卡可点（2026-09-03 邓姐：点击数字跳对应状态筛选） */
.metric[data-st] { cursor: pointer; transition: box-shadow .15s, transform .05s; }
.metric[data-st]:hover { box-shadow: 0 3px 12px rgba(90,60,20,.12); }
.metric .seg { cursor: pointer; padding: 0 3px; border-radius: 6px; }
.metric .seg:hover { color: #E8590C !important; background: #FFF1E6; }
.metric .seg-sep { color: #D8CDBD; padding: 0 2px; }
.metric.hit { outline: 2px solid #E8590C; outline-offset: 2px; }

/* 统计区三块并排（2026-09-03 邓姐定稿）：总数卡｜订单进度大卡(8行竖排)｜供应商窄卡 */
#metrics { display: flex; gap: 14px; align-items: stretch; flex-wrap: wrap;
  margin-bottom: 6px; }
#metrics .metric { padding: 12px 16px; }
.metric-col { flex: 0 1 200px; display: flex; flex-direction: column;
  justify-content: center; }
.metric-col .metric-value { font-size: 22px; }
.metric-prog { flex: 1 1 480px; min-width: 420px; display: flex;
  flex-direction: column; justify-content: center; }
.metric-prog .pcols { display: grid; grid-template-columns: repeat(9, 1fr);
  gap: 1px; }
/* 状态名统一占 2 行位，单行名(如 工厂确认)与断行名数字对齐不串位 */
.metric-prog .pn { min-height: 2.44em; display: flex; align-items: center;
  justify-content: center; }
.metric-prog .pcol { display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 4px 2px 6px; border-radius: 7px; cursor: pointer; }
.metric-prog .pcol:hover { background: #FFF4EA; }
.metric-prog .pn { font-size: 11px; color: #6B645C; line-height: 1.22;
  text-align: center; width: 100%; word-break: break-word;
  min-height: 2.44em; display: flex; align-items: center; justify-content: center; }
.metric-prog .pv { font-weight: 700; font-size: 16px; color: var(--green-900);
  line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-prog .pv.warn { color: #B34700; }
.metric-prog .prog-hint { font-size: 11px; color: var(--ink-3); margin-top: 5px;
  text-align: right; }
@media (max-width: 1000px) {
  .metric-col { flex: 1 1 100%; }
  .metric-prog { flex: 1 1 100%; min-width: 0; }
}

/* 日期筛选控件（2026-09-03） */
.filters .qk { display: inline-flex; gap: 6px; }
.filters input[type="date"].d-in { padding: 7px 8px; border: 1px solid var(--line-2);
  border-radius: 8px; font-size: 12.5px; font-family: inherit; background: #fff; }
/* 后台订单筛选行文字统一 14px（2026-09-04，三端一致） */
#panel-orders .filters .field label,
#panel-orders .filters .qk .btn,
#panel-orders .filters input[type="text"],
#panel-orders .filters select,
#panel-orders .filters input[type="date"] { font-size: 14px; }


/* ============ V2.9.0（2026-09-08）三端通用组件 ============ */
/* 逾期徽章：状态徽章后的红标，逾期才显示 */
.badge-od { background:#FFE0E0; color:#C0392B; border:1px solid #F5B7B1; }
/* 实际交期 pill（2026-09-11 邓姐：改回绿色；日期文字不再加粗）：
   绿=已确认/正常，橙=待复核（保留提醒色），字号沿用原样。 */
.pill { display:inline-block; padding:1px 8px; border-radius:6px; font-weight:800; font-size:12px;
  line-height:1.8; white-space:nowrap; vertical-align:middle; }
.pill-ok   { background:#DFF0E0; color:#216E2D; border:1px solid #A8CFA9; font-weight:400; }
.pill-wait { background:#FAEEDA; color:#854F0B; border:1px solid #EF9F27; font-weight:400; }
/* 供应商端临期红框：固定一行文案 */
.od-box { margin:7px 0 2px; border:2px solid #E02424; background:#FFF1F1; border-radius:8px;
  padding:6px 10px; font-size:12px; color:#B3261E; font-weight:700; line-height:1.6; }
/* 分页条（三端共用） */
.opager { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:space-between;
  margin-top:10px; padding:8px 12px; background:#fff; border:1px solid var(--line);
  border-radius:10px; font-size:12.5px; color:var(--ink-2); }
.opager .pg { display:inline-flex; min-width:28px; height:28px; align-items:center; justify-content:center;
  border:1px solid var(--line-2); border-radius:7px; background:#fff; color:var(--ink-2);
  cursor:pointer; font-size:12.5px; }
.opager .pg.cur { background:#FF8A07; border-color:#FF8A07; color:#fff; font-weight:700; }
.opager .pg:disabled { opacity:.4; cursor:not-allowed; }
/* 三端手机小屏基础（各页面再按需细化）：整宽卡、大按钮、紧凑条 */
@media (max-width: 560px) {
  body { font-size: 13px; }
  .wrap { padding: 0 10px; }
  .card { padding: 12px 11px; border-radius: 10px; }
  .btn { min-height: 40px; padding: 8px 12px; font-size: 14px; border-radius: 9px; }
  .btn-sm { min-height: 34px; padding: 5px 10px; font-size: 13px; }
  .filters { gap: 6px; }
  .opager .pg { min-width: 34px; height: 34px; }
  table { font-size: 12px; }
  th, td { padding: 6px 7px; }
}
@media (max-width: 720px) and (min-width: 561px) {
  .card { padding: 13px 12px; }
}

/* ============ V2.9.0 三端手机版细化（560px 档覆盖通用组件） ============ */
@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .ob-acts { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar-inner { padding: 8px 10px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 10px; padding-bottom: 0; }
  .filters { margin-bottom: 6px; }
  .filters .field { min-width: 0 !important; flex: 1 1 46%; margin-bottom: 4px; }
  .filters .field.grow { flex: 1 1 100%; }
  .filters .qk { flex-wrap: nowrap; overflow-x: auto; }
  /* 后台订单块竖排收窄 */
  .oblock { padding: 10px 9px; }
  .ob-head .step-mini { width: 100%; margin: 4px 0 0; overflow-x: auto; order: 8; }
  .ob-meta { gap: 2px 10px; }
  .ob-acts { row-gap: 6px; }
  .ob-acts .btn { flex: 0 0 auto; }
  .addr-line { font-size: 11.5px; }
  .mtab { min-width: 620px; }   /* 物料明细整表横滑，不硬拆列 */
  .table-scroll { margin: 0 -2px; }
}

/* ============ 批次物料折叠块（2026-09-20 补样式：此前只有类名、零 CSS，用户看不出「可以点开」）===
   三端共用 —— supplier / factory / admin 都 <link> 了本文件。
   结构：.b-fold > .b-fold-sum（可点，inline 带 cursor:pointer）+ .b-fold-full（初始 inline display:none）
   行为（≤2 平铺 / ≥3 折叠、点摘要行切换）由三端 batchFoldHtml / batchFoldToggle 负责，本文件只管视觉。
   注意：展开时 JS 把 .b-fold-full 的 inline display 置空 → 这里用 flex + column，
   让 legacy 的 inline / inline-block 物料行（supplier 的 .bq、factory/admin 的 inline-block span）
   一律成为 flex item 而「每条一行」，因此不需要 !important。 */
.b-fold {
  /* 2026-09-21 20:26（邓姐）：「折叠行的底色，跟着这一整个卡的大底色走，不要背景色一个颜色，
     折叠行一个颜色」⇒ 折叠块**不再自带底色**（transparent），跟所在容器完全一致：白卡就是白、
     `.ob-batches` 是米色、供应商/后台的「部分货物取消」条是黄、工厂端 `.pl-box` 也是黄。
     （上一步刚把它从灰米白改成淡黄 —— 那是"整块换一个颜色"，她这次要的是"跟容器"，所以底色整个撤掉。）
     虚线左边框保留（它是"这里是一个可展开的块"的标记），色值回到中性 #D8CDBD，放任何底色上都不打架。 */
  background: transparent;
  border-left: 3px dashed #D8CDBD;
  border-radius: 6px;
  padding: 6px 9px;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.7;
  color: #6B645C;
}
.b-fold-sum { cursor: pointer; }
/* 悬停提示「能点」：用半透明黑，跟着容器底色走（原来写死一个颜色，换个底色就跳出来） */
.b-fold-sum:hover { background: rgba(0, 0, 0, .05); border-radius: 4px; }
.b-fold-ar {
  display: inline-block; width: 13px; text-align: center;
  font-size: 13px; color: #8A8278;
}
.b-fold-sum:hover .b-fold-ar { color: #B34700; }
.b-fold-hint {                        /* 「展开 / 收起」小字提示：让它看起来「能点」 */
  margin-left: 6px; font-size: 11px; color: #185FA5;
  border-bottom: 1px dashed #9DBEDC;
}
.b-fold-sum:hover .b-fold-hint { color: #B34700; border-bottom-color: #E0A98A; }
.b-fold-full {                        /* 展开后：flex 列 → 每条一行；左缩进与摘要文字对齐 */
  display: flex; flex-direction: column; gap: 1px;
  margin-top: 4px; padding-left: 13px;
}
.b-fold-full > * { min-width: 0; overflow-wrap: anywhere; }

/* 手机端（≤560px）：不溢出、不横滚 */
@media (max-width: 560px) {
  .b-fold { padding: 5px 7px; font-size: 11.5px; }
  .b-fold-sum { overflow-wrap: anywhere; }
}
