/* ============================================================
   经销存送货平台 · 工作台美化样式（数据青 · 专业）
   仅样式层，不改动任何 DOM 结构与交互逻辑
   ============================================================ */
:root {
  --bg: #eef2f4;
  --surface: #ffffff;
  --surface-2: #f4f8f8;
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-soft: #f0fdfa;
  --text: #134e4a;
  --text-2: #3f6f6a;
  --text-muted: #7b9892;
  --border: #dce9e7;
  --border-strong: #bcd4cf;
  --sidebar-bg: #0c2e2b;
  --sidebar-bg-2: #134e4a;
  --sidebar-item: #9fd3cb;
  --shadow-sm: 0 1px 2px rgba(12, 46, 43, .05), 0 1px 3px rgba(12, 46, 43, .07);
  --shadow-md: 0 4px 14px rgba(12, 46, 43, .10);
  --shadow-lg: 0 12px 32px rgba(12, 46, 43, .16);
  --radius: 14px;
  --radius-sm: 9px;
  --c-teal: #0d9488;
  --c-cyan: #0ea5e9;
  --c-blue: #2563eb;
  --c-sky: #0e7490;
  --c-amber: #d97706;
  --c-green: #16a34a;
  --c-red: #dc2626;
  accent-color: var(--primary);   /* 原生控件（勾选/单选/滑块/滚动条）统一用品牌绿，不跟随系统强调色 */
}

/* 焦点样式统一：不同操作系统/浏览器会把焦点框画成系统强调色（如粉色圆角框），
   这里统一改为品牌绿；鼠标点击不显示焦点框，仅键盘导航显示，兼顾美观与可访问性 */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
button:focus:not(:focus-visible) { outline: none; }

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; }
input, select {
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .15);
}
button {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, transform .05s, box-shadow .15s;
}
button:hover { background: var(--primary-dark); }
button:active { transform: translateY(1px); }
button.ghost { background: #eef2f7; color: var(--text); border: 1px solid var(--border); }
button.ghost:hover { background: #e2e8f0; }
button.danger { background: var(--c-red); }
button.danger:hover { background: #b91c1c; }
.err { color: var(--c-red); font-size: 13px; min-height: 18px; }

/* ---------------- 登录 ---------------- */
.login-wrap { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, #0f766e 0%, #0c2e2b 100%); }
.login-box {
  background: var(--surface);
  padding: 38px 32px 32px;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  width: 340px;
  text-align: center;
}
.login-box h1 { margin: 0 0 4px; font-size: 22px; color: var(--text); letter-spacing: .5px; }
.login-box .sub { color: var(--text-muted); margin: 0 0 22px; font-size: 13px; }
.login-box input { display: block; width: 100%; margin-bottom: 14px; padding: 11px 13px; border-radius: 10px; }
.login-box button { width: 100%; padding: 11px; border-radius: 10px; font-size: 15px; letter-spacing: 4px; }
/* 登录密码可见切换（内联 SVG，放大图标并遮住原生 reveal，防止 native 控件阻挡输入） */
.pwd-wrap { position: relative; margin-bottom: 14px; }
.pwd-wrap input { margin-bottom: 0 !important; padding-right: 56px !important; }
/* 隐藏浏览器原生密码显示/清除/强密码/自动填充等所有控件，避免和自定义眼睛按钮重叠抢焦点 */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear { display: none !important; width: 0 !important; height: 0 !important; opacity: 0 !important; }
input::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-textfield-decoration-container,
input[type="password"]::-webkit-strong-password-auto-fill-button,
input[type="password"]::-webkit-caps-lock-indicator,
input[type="password"]::-webkit-inner-spin-button,
input[type="password"]::-webkit-calendar-picker-indicator,
input[type="password"]::-webkit-search-cancel-button,
input[type="password"]::-webkit-search-decoration {
  visibility: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  right: 9999px !important;
  top: auto !important;
  opacity: 0 !important;
  width: 0 !important; height: 0 !important;
}
/* 屏蔽 Edge / Chrome「显示密码」原生小眼睛和密码生成建议弹层 */
input[type="password"] { -webkit-appearance: none; appearance: none; }
/* 用 .pwd-wrap 提高特异性，覆盖 .login-box button { width:100% } */
.pwd-wrap input { box-sizing: border-box; margin-bottom: 0 !important; padding-right: 56px !important; }
.pwd-wrap .pwd-toggle {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 48px !important; height: auto !important;
  margin: 0; padding: 0; border: none; border-radius: 0;
  background: transparent; color: #7c8b98;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  cursor: pointer; z-index: 1000;  /* 提到最高，压制所有原生控件 */
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pwd-wrap .pwd-toggle svg { width: 22px; height: 22px; display: block; pointer-events: none; }
.pwd-wrap .pwd-toggle:hover { color: #1d4ed8; background: rgba(0,0,0,0.03); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; }
.login-brand img { width: 38px; height: 38px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.login-brand span { font-size: 21px; font-weight: 800; color: var(--text); letter-spacing: .5px; }

/* ---------------- 主框架 ---------------- */
.main { display: flex; height: 100vh; }
.sidebar {
  width: 232px;
  background: var(--sidebar-bg);
  color: var(--sidebar-item);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.brand {
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.brand-logo {
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo img {
  width: 100%;
  height: auto;
  max-height: 56px;
  object-fit: contain;
  display: block;
}
.brand-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ver-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  padding: 1px 8px;
  cursor: pointer;
  line-height: 1.6;
  transition: background .15s;
}
.ver-badge:hover { background: rgba(255, 255, 255, .28); }
.brand .brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}
.sidebar nav { flex: 1; overflow-y: auto; padding: 12px 12px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  color: var(--sidebar-item);
  text-decoration: none;
  border-radius: 10px;
  margin-bottom: 4px;
  font-size: 14px;
  position: relative;
  transition: background .15s, color .15s;
}
.sidebar nav a:hover { background: var(--sidebar-bg-2); color: #fff; }
.sidebar nav a.active {
  background: var(--primary);
  color: #fff;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}
.sidebar nav a.active::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: 0 3px 3px 0;
  background: #fff;
}
.userbar {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #cbd5e1;
}
.userbar button { background: var(--sidebar-bg-2); padding: 6px 12px; font-size: 12px; }
.userbar button:hover { background: #334155; }

.content { flex: 1; overflow-y: auto; padding: 26px 30px 40px; }
.content h2 { margin: 0 0 18px; font-size: 21px; font-weight: 700; color: var(--text); }
.toolbar { margin-bottom: 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------------- 表格 ---------------- */
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 13px; }
thead th:first-child { border-top-left-radius: var(--radius); }
thead th:last-child { border-top-right-radius: var(--radius); }
tr:hover td { background: #f8fafc; }
tr:last-child td { border-bottom: none; }
td.num { text-align: right; font-weight: 600; }
tr.low-row td { background: #fef2f2; color: #b91c1c; }
button { white-space: nowrap; } /* 表格内的「编辑/删除」等按钮文字不换行 */

/* 订单状态胶囊：不同状态不同底色（与移动端一致） */
.tag.st-created { background: #fef3c7; color: #b45309; }
.tag.st-out { background: #e0f2fe; color: #0369a1; }
.tag.st-done { background: #dcfce7; color: #15803d; }
.tag.st-settled { background: #e5e7eb; color: #475569; }
.tag.st-cancel { background: #f1f5f9; color: #94a3b8; text-decoration: line-through; }
/* 经销商管理「区域/地址/联系人」等长文本列：单行截断，避免列宽不够时换行成多行 */
.col-region { max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-address { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-contact { max-width: 160px; }
.col-items { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* 工作台最近订单：商品明细列过长截断，悬停看全称 */
.col-actions { min-width: 120px; white-space: nowrap; } /* 容纳 2 个 op-btn 横排 */
table th { white-space: nowrap; } /* 表头不换行（应对多列表格） */
.grp-row td { background: #f1f5f9; color: var(--text); font-weight: 700; font-size: 12px; letter-spacing: 1px; padding: 5px 14px; } /* 客户列表首字母分组分隔行 */
/* 对账检查页面 */
.recon-card { border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; overflow: hidden; }
.recon-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #f8fafc; flex-wrap: wrap; }
.recon-sample { margin: 0; padding: 8px 14px 12px 30px; font-size: 12px; color: var(--mut); max-height: 170px; overflow: auto; }
.recon-sample li { white-space: pre-wrap; word-break: break-all; }
.warn { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; padding: 8px 12px; border-radius: 8px; }
.ok { color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; padding: 8px 12px; border-radius: 8px; }
.err { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; padding: 8px 12px; border-radius: 8px; }
/* 库存模块合并商品管理后的区块标题 */
.sec-label { font-size: 13px; font-weight: 700; color: var(--mut); letter-spacing: 1px; margin: 4px 0 10px; padding-left: 2px; }
.pm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pm-head h3 { font-size: 16px; margin: 0; }
/* 已停用商品整行置灰（排列表底部），与在售商品形成视觉区分 */
tr.prod-off td { color: var(--muted); opacity: .55; }
tr.prod-off td .tag { opacity: .8; }
tr.prod-off:hover td { opacity: .8; }

/* 收款二级界面：商品明细列允许换行、限制宽度 */
.om-detail { max-width: 320px; line-height: 1.5; }

/* ---------------- 指标卡 ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card[data-kpi] { cursor: pointer; }
.card .num { font-size: 27px; font-weight: 700; line-height: 1.1; color: var(--text); }
.card .lbl { color: var(--text-muted); font-size: 13px; margin-top: 8px; }
/* 待办可点击卡片：强调可交互 */
.todo-go { border-left: 4px solid var(--c-orange, #f59e0b); }
.todo-go:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }

/* 工作台顶部 6 张指标卡：语义色强调（青色主调 + 关键语义色，仅作用于工作台主卡片区） */
#view > .cards > .card { border-left: 4px solid var(--primary); }
#view > .cards > .card:nth-child(1) { border-left-color: var(--c-teal); }
#view > .cards > .card:nth-child(1) .num { color: var(--c-teal); }
#view > .cards > .card:nth-child(2) { border-left-color: var(--c-cyan); }
#view > .cards > .card:nth-child(2) .num { color: var(--c-cyan); }
#view > .cards > .card:nth-child(3) { border-left-color: var(--c-sky); }
#view > .cards > .card:nth-child(3) .num { color: var(--c-sky); }
#view > .cards > .card:nth-child(4) { border-left-color: var(--c-amber); }
#view > .cards > .card:nth-child(4) .num { color: var(--c-amber); }
#view > .cards > .card:nth-child(5) { border-left-color: var(--c-green); }
#view > .cards > .card:nth-child(5) .num { color: var(--c-green); }
#view > .cards > .card:nth-child(6) { border-left-color: var(--c-red); }
#view > .cards > .card:nth-child(6) .num { color: var(--c-red); }

/* 待办卡：保持中性、与主指标区区分 */
.panel .cards .card { border-left: none; }
.panel .cards .card .num { color: var(--primary); }

/* ---------------- 标签 ---------------- */
.tag { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #ccfbf1; color: #0f766e; }
.tag.gray { background: #e4eceb; color: #3f6f6a; }
.tag.green { background: #dcfce7; color: #15803d; }
.tag.orange { background: #ffedd5; color: #c2410c; }
.tag.red { background: #fee2e2; color: #b91c1c; }

/* ---------------- 表单 ---------------- */
.form-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; flex-wrap: wrap; }
.form-row input, .form-row select { min-width: 120px; }
.fld { display: flex; flex-direction: column; flex: 1; min-width: 130px; }
.fld label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.fld select { width: 100%; }

/* ---------------- 弹窗 ---------------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: var(--radius); width: 540px; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); }
.modal h3 { margin: 0 0 18px; font-size: 17px; color: var(--text); }
.close-x { background: #eef2f7; color: var(--text); padding: 4px 11px; border-radius: 8px; cursor: pointer; }
.close-x:hover { background: #e2e8f0; }
/* 弹窗头部：标题在左、关闭叉叉在右；作为固定头部（不滚动），下方 .modal-body 独立滚动——
   彻底避免标题栏吸顶覆盖/挤压内容，不同屏幕尺寸下均正常显示 */
.modal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 26px; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.modal-bar h3 { margin: 0; }
.modal-bar .close-x { flex-shrink: 0; }
/* 弹窗内容区：独立滚动，标题栏永远固定在顶部，互不遮挡；max-height 限制 + 本区滚动保证完整显示 */
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 26px 26px; scrollbar-gutter: stable; }
/* 小屏适配：缩小弹窗内边距，让内容在窄窗口/手机上更宽裕、不被挤压 */
@media (max-width: 600px) {
  .modal { max-width: 96vw; }
  .modal-bar { padding: 14px 16px; }
  .modal-body { padding: 14px 16px 20px; }
}
.item-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; }
.item-row select, .item-row input { flex: 1; min-width: 90px; }
.item-row .pi { flex: 2; min-width: 150px; }
.item-row .pb { flex: 1.6; min-width: 170px; }
.item-row .pq-unit { font-size: 12px; color: var(--text-2); white-space: nowrap; min-width: 26px; }

/* 库存页批次列 */
.b-item { font-size: 12px; line-height: 1.8; }
.b-item.expired { color: #dc2626; font-weight: 600; }
.b-item.near { color: #c2410c; font-weight: 600; }
.b-item.ok { color: #334155; }
.b-item.none { color: #334155; }
.b-item .muted { color: #94a3b8; font-weight: 400; }
.b-item.b-hit { background: #fef3c7; border-radius: 4px; padding: 0 4px; }

/* ---------------- 面板 ---------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.panel h3 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding-left: 12px;
  border-left: 4px solid var(--primary);
  line-height: 1.3;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 .panel { margin-bottom: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-3 .panel { margin-bottom: 0; min-width: 0; }
.biz-range { display: inline-flex; gap: 0; margin: 12px 0 4px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.biz-range-btn { padding: 7px 18px; border: none; background: #fff; color: var(--muted); font-size: 14px; cursor: pointer; }
.biz-range-btn + .biz-range-btn { border-left: 1px solid var(--border); }
.biz-range-btn.active { background: var(--primary); color: #fff; font-weight: 600; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 6px; }
.grid-4 .biz-card { cursor: pointer; border-left: 4px solid var(--border); transition: box-shadow .15s, border-color .15s; }
.grid-4 .biz-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.grid-4 .biz-card.active { border-left-color: var(--primary); background: #f5f8ff; }
.grid-4 .biz-card .num.blue { color: var(--c-sky); }
.grid-4 .biz-card .num.gray { color: var(--text); }
.grid-4 .biz-card .num.orange { color: var(--c-amber); }
.grid-4 .biz-card .num.green { color: var(--c-green); }
.grid-4.biz-cards { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.cat-sep td { background: #f3f7ff; padding: 7px 12px; border-top: 2px solid #e3edff; }
.cat-sep .cat-title { font-weight: 700; color: #2f6fed; font-size: 14px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* ---------------- 图表 ---------------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 8px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.bar .fill { width: 64%; background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 100%); border-radius: 6px 6px 0 0; min-height: 3px; transition: opacity .15s; }
.bar:hover .fill { opacity: .82; }
.bar .lbl { font-size: 11px; color: var(--text-muted); }
.bar .val { font-size: 11px; color: var(--text-2); font-weight: 600; }

/* ---------------- 排行 ---------------- */
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; justify-content: space-between; padding: 9px 4px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.rank li:last-child { border-bottom: none; }
.rank li span:first-child { flex: 1; min-width: 0; color: var(--text); overflow-wrap: break-word; }
.rank li span:last-child { flex-shrink: 0; margin-left: 8px; color: var(--text-2); font-weight: 600; }

/* ---------------- 范围切换按钮 ---------------- */
.rg { padding: 7px 18px; border: 1px solid var(--border-strong); background: #fff; color: var(--text-2); border-radius: 999px; cursor: pointer; font-size: 13px; transition: all .15s; }
.rg:hover { border-color: var(--primary); color: var(--primary); }
.rg.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: var(--shadow-sm); }

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

/* ---------------- 订单/退货 页签 ---------------- */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.tab { background: none; border: none; padding: 10px 16px; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; cursor: pointer; border-radius: 0; }
.tab:hover { color: var(--primary); background: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
/* 库存页仓库切换 tab：内嵌重命名小按钮 / 新建仓库 */
.tabs .wh-edit { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--text-2); background: none; border: none; cursor: pointer; padding: 1px 4px; border-radius: 6px; line-height: 1.2; }
.tabs .wh-edit:hover { color: var(--primary); background: var(--primary-soft); }
.tabs .new-tab { color: var(--primary); font-weight: 500; }
.tabs .new-tab:hover { color: var(--primary); background: var(--primary-soft); }
/* 门店盘点-历史盘点：单表头大表，商品行小字、行高加高、时间/盘点人合并 */
.hist-stock td { padding: 10px 12px; vertical-align: middle; }
.hist-stock .st-item { font-size: 12px; }
.hist-stock .st-item b { font-size: 12px; }
.hist-stock .v-time { font-size: 12px; white-space: nowrap; }
.hist-stock .v-note { color: var(--text-2); font-size: 11px; margin-top: 3px; white-space: normal; }
.hist-stock .v-ph { margin-top: 5px; }
.hist-stock .v-ph img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; margin: 1px; vertical-align: top; }
.hist-stock .v-op { font-size: 12px; }
.hist-stock td.v-type { text-align: center; width: 58px; padding: 10px 6px; }
.hist-stock .v-type .tag { margin: 0; }

/* ---------------- 客户表单（网格 + 分区） ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 4px; }
.form-grid .col-2 { grid-column: 1 / -1; }
.form-grid .fld { min-width: 0; }
.form-grid input, .form-grid select { width: 100%; }
.form-grid input[readonly] { background: #f8fafc; color: var(--text-2); }
.form-section { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--text); border-top: 1px solid var(--border); padding-top: 14px; margin-top: 2px; }
.addr-field .addr-wrap { display: block; width: 100%; }
.addr-field input { width: 100%; }
.modal-wide { width: 600px; max-width: 94vw; }
.modal-stocktake { width: 760px; max-width: 96vw; }
.ws-cell { white-space: nowrap; }
button.block { width: 100%; margin-top: 18px; padding: 11px 16px; font-size: 15px; border-radius: 10px; }

/* ---------------- 门店盘点 ---------------- */
a.store-link, span.store-link { color: var(--primary); text-decoration: none; font-weight: 600; }
a.store-link:hover { text-decoration: underline; }
.row-click { cursor: pointer; }
.visit-block img { border: 1px solid var(--border); border-radius: 8px; }

/* 图片全屏放大 */
.img-zoom { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.img-zoom.hidden { display: none; }
.img-zoom img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 12px; background: #fff; }
.img-zoom .hint { color: rgba(255,255,255,.7); margin-top: 16px; font-size: 14px; }

/* 收款登记页 */
.pay-qr-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.pay-qr-box .t { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.pay-qr-imgs { display: flex; gap: 16px; }
.pay-qr-imgs img { height: 140px; border-radius: 8px; cursor: zoom-in; border: 1px solid var(--border); background: #fff; }
.pay-upload { display: inline-flex; align-items: center; gap: 8px; border: 1px dashed var(--border); border-radius: 8px; padding: 10px 14px; cursor: pointer; color: var(--muted); background: var(--bg); }
.pay-upload input { display: none; }
.pay-upload img { max-height: 120px; border-radius: 6px; margin-left: 10px; }
.discount-fld { display: inline-block; width: 120px; }

/* ---------------- 地址自动补全 ---------------- */
.addr-wrap { position: relative; display: inline-block; }
.suggest-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 99; background: #fff; border: 1px solid var(--border-strong); border-radius: 10px; max-height: 220px; overflow-y: auto; box-shadow: var(--shadow-md); margin-top: 4px; }
.sug-item { padding: 9px 12px; cursor: pointer; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-item:hover { background: var(--primary-soft); color: var(--primary); }

/* ---------------- 客户筛选输入联想 ---------------- */
.suggest-input { min-width: 180px; }
.suggest-box { z-index: 999; background: #fff; border: 1px solid var(--border-strong); border-radius: 10px; max-height: 240px; overflow-y: auto; box-shadow: var(--shadow-md); margin-top: 2px; }
.suggest-item { padding: 9px 12px; cursor: pointer; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-item:hover { background: var(--primary-soft); color: var(--primary); }
/* 商品列表最左「分类」列：作为分组依据，略加强调 */
.cat-col { font-weight: 600; color: var(--primary); white-space: nowrap; }

/* ===== v0.4 账号管理表单美化 ===== */
.form-sec { display: flex; flex-direction: column; gap: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.field label i { font-style: normal; color: var(--text-muted); opacity: .7; font-weight: 400; }
.field input, .field select { width: 100%; box-sizing: border-box; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; transition: all .15s; position: relative; background: #fff; }
.role-card:hover { border-color: #93c5fd; background: #f8fafc; }
.role-card.on { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 1px #2563eb inset; }
.role-card .rc-ic { font-size: 20px; }
.role-card .rc-n { font-weight: 600; font-size: 13px; color: var(--text); }
.role-card .rc-d { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.role-card .rc-check { position: absolute; top: 8px; right: 10px; color: #2563eb; font-weight: 700; opacity: 0; transition: opacity .15s; }
.role-card.on .rc-check { opacity: 1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.tag-role { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; margin-right: 4px; }
.tag-inactive { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: #e2e8f0; color: #64748b; font-weight: 600; }
.op-btn { padding: 4px 10px; font-size: 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: #fff; color: var(--text); cursor: pointer; margin-right: 4px; min-width: 60px; text-align: center; white-space: nowrap; box-sizing: border-box; }
.op-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.op-btn.danger { color: #dc2626; }
.op-btn.danger:hover { border-color: #dc2626; background: #fef2f2; }

/* 版本更新日志 */
.changelog-block { margin-bottom: 14px; }
.changelog-block:last-child { margin-bottom: 0; }
.changelog-head { font-size: 14px; margin-bottom: 6px; }
.changelog-head b { color: var(--primary); }
.changelog-items { margin: 0; padding-left: 20px; line-height: 1.8; font-size: 13px; color: var(--text-2); }
.changelog-items li { margin-bottom: 2px; }

/* 新建订单弹窗：行布局与自定义商品选择器 */
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.item-row { display: flex; align-items: center; gap: 8px; padding: 10px 2px; border-bottom: 1px solid #eef0f3; flex-wrap: wrap; }
.item-row:last-child { border-bottom: none; }
.item-row .prod-pick { flex: 2 1 220px; min-width: 200px; border: 1px solid var(--border-strong, #d8dee6); border-radius: 8px; padding: 8px 10px; cursor: pointer; background: #fff; display: flex; justify-content: space-between; align-items: center; }
.item-row .prod-pick .pp-label { color: #9aa3af; font-size: 13px; }
.item-row .prod-pick.filled .pp-label { color: var(--text, #222); font-weight: 500; }
.item-row .pq { width: 78px; }
.item-row .pp { width: 92px; }
.item-row .pb { flex: 1 1 150px; min-width: 130px; }
.item-row .rm { flex: 0 0 auto; }
.prod-box { z-index: 60; background: #fff; border: 1px solid #d8dee6; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14); max-height: 330px; overflow: auto; padding: 6px; }
.prod-search { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #d8dee6; border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.prod-cat { font-weight: 700; color: #2f6fed; padding: 8px 6px 4px; font-size: 13px; border-top: 1px solid #f1f3f6; }
.prod-cat:first-child { border-top: none; }
.prod-opt { display: grid; grid-template-columns: 1.7fr .6fr .9fr .8fr; gap: 6px; padding: 7px 6px; border-radius: 6px; cursor: pointer; align-items: center; font-size: 13px; }
.prod-opt:hover { background: #f3f7ff; }
.prod-opt .c-unit, .prod-opt .c-spec { color: #8a93a0; font-size: 12px; }
.prod-opt .c-stock { text-align: right; color: #1a9e5e; font-size: 12px; }
.prod-opt.mp-opt { grid-template-columns: 24px 1.7fr .6fr .9fr .8fr; align-items: center; }
.prod-opt.mp-opt .mp-check { text-align: center; font-size: 15px; color: #8a93a0; user-select: none; }
.prod-opt.mp-opt.picked { background: #eaf2ff; }
.prod-opt.mp-opt.picked .mp-check { color: #2f6fed; }
.prod-empty { padding: 14px; color: #9aa3af; text-align: center; font-size: 13px; }
.unload-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid #f1f3f6; }
.unload-row:last-child { border-bottom: none; }
.unload-row .ur-name { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.unload-row .ur-nm { font-weight: 500; }
.unload-row .ur-meta { font-size: 12px; color: #8a93a0; }
.unload-row .ur-bal { color: #1a9e5e; font-size: 13px; white-space: nowrap; }
.unload-row .ur-q { width: 96px; flex: 0 0 96px; }
