/* ===================================================================
   南图ERP · 现代 SaaS 设计系统  v3
   浅色主题 / 柔和阴影 / 圆角 / 精致配色
   =================================================================== */
:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --primary: #0b5db8;
  --primary-600: #094b96;
  --primary-50: #edf4fd;
  --primary-100: #d7e7f9;
  --text: #1f2937;
  --text-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e6e8ef;
  --line-2: #f0f2f7;
  --green: #16a34a;
  --green-50: #ecfdf3;
  --red: #dc2626;
  --red-50: #fef2f2;
  --orange: #ea580c;
  --orange-50: #fff3eb;
  --blue: #0369a1;
  --blue-50: #eff8ff;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.04);
  --shadow-md: 0 6px 20px rgba(16,24,40,.08);
  --shadow-lg: 0 18px 50px rgba(16,24,40,.18);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
svg { display: block; }
/* 图标默认尺寸：所有内联 SVG 图标统一 18px，各上下文可用更高优先级的规则覆盖 */
.ic { width: 18px; height: 18px; flex-shrink: 0; }
.panel-head h3 { display: flex; align-items: center; gap: 8px; }
.panel-head h3 .ic { width: 18px; height: 18px; color: var(--primary); }
.todo .t-label .ic { width: 16px; height: 16px; color: var(--primary); }
.todo.warn .t-label .ic { color: var(--orange); }
.todo.danger .t-label .ic { color: var(--red); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d4d8e3; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #b9bfd0; }
#app { display: flex; height: 100vh; overflow: hidden; }

/* ============ 侧边栏 ============ */
.sidebar {
  width: var(--sidebar-w); background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; flex-shrink: 0; transition: width .18s ease;
  z-index: 20;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; }
.brand-mark {
  width: auto; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.brand-mark img { height: 100%; width: auto; display: block; object-fit: contain; border-radius: 6px; }
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.brand-name small { display: block; font-size: 11px; font-weight: 500; color: var(--faint); letter-spacing: 1px; }
.sidebar.collapsed .brand-name, .sidebar.collapsed .nav-group, .sidebar.collapsed .nav-item span, .sidebar.collapsed .ver, .sidebar.collapsed .logout span { display: none; }
.sidebar.collapsed .brand { justify-content: center; padding: 18px 0 16px; }
#nav { flex: 1; overflow-y: auto; padding: 4px 12px; }
.nav-group { font-size: 11px; color: var(--faint); font-weight: 600; letter-spacing: 1px; padding: 16px 10px 6px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; margin-bottom: 2px;
  border-radius: 9px; cursor: pointer; color: var(--text-2); user-select: none;
  font-size: 13.5px; font-weight: 500; transition: background .12s, color .12s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.nav-item span { white-space: nowrap; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-50); color: var(--primary-600); font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line-2); }
.ver { font-size: 11px; color: var(--faint); padding: 10px 11px 4px; }
.logout {
  display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted);
  padding: 9px 11px; border-radius: 9px; cursor: pointer;
}
.logout svg { width: 17px; height: 17px; }
.logout:hover { background: var(--red-50); color: var(--red); }

/* ============ 主区域 ============ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 22px; flex-shrink: 0;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); transition: .12s;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
#crumb { font-weight: 700; font-size: 17px; color: var(--text); }
.crumb-sub { font-size: 12px; color: var(--faint); margin-left: 8px; font-weight: 400; }
.search-box {
  display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid transparent;
  border-radius: 10px; padding: 7px 12px; width: 280px; transition: .15s;
}
.search-box:focus-within { background: #fff; border-color: var(--primary-100); box-shadow: 0 0 0 3px var(--primary-50); }
.search-box svg { width: 16px; height: 16px; color: var(--faint); flex-shrink: 0; }
.search-box input { border: none; background: transparent; outline: none; font-size: 13px; width: 100%; color: var(--text); font-family: inherit; }
.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 30px; transition: .12s; }
.user-chip:hover { background: var(--bg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,#1f7ae0,#0b5db8); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.user-chip .un { font-size: 13px; font-weight: 600; }
.user-chip .ur { font-size: 11px; color: var(--faint); }
.content { flex: 1; overflow-y: auto; padding: 24px; }

/* ============ 卡片/KPI ============ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 16px; margin-bottom: 22px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.card .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.card .num { font-size: 27px; font-weight: 800; margin-top: 8px; letter-spacing: -.5px; }
.card.warn { border-color: #fde0c2; background: linear-gradient(180deg,#fffaf3,#fff); }
.card.warn .num { color: var(--orange); }
.card .spark { position: absolute; right: 0; bottom: 0; opacity: .5; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 22px; height: 22px; }
.stat-meta .label { color: var(--muted); font-size: 12.5px; }
.stat-meta .num { font-size: 22px; font-weight: 800; margin-top: 2px; letter-spacing: -.5px; }

/* ============ 区块标题 ============ */
.section-title { font-size: 15px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 9px; }
.section-title svg { width: 18px; height: 18px; color: var(--primary); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 20px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 700; }

/* ============ 工具栏 ============ */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar h3 { margin: 0; font-size: 17px; font-weight: 700; }
.spacer { flex: 1; }

/* ============ 按钮 ============ */
button, .btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--primary); color: #fff; border: 1px solid transparent; padding: 9px 16px;
  border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit;
  transition: background .14s, box-shadow .14s, transform .05s; white-space: nowrap;
}
button:hover, .btn:hover { background: var(--primary-600); }
button:active, .btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.ghost { background: #fff; color: var(--primary-600); border-color: var(--primary-100); }
.btn.ghost:hover { background: var(--primary-50); }
.btn.ghost.gray { color: var(--text-2); border-color: var(--line); }
.btn.ghost.gray:hover { background: var(--bg); }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #b91c1c; }
.btn.green { background: var(--green); }
.btn.green:hover { background: #15803d; }
.btn.block { width: 100%; padding: 12px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ============ 表格 ============ */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  background: #f9fafc; color: var(--muted); font-weight: 600; font-size: 12px; text-align: left;
  padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; letter-spacing: .2px;
}
.tbl thead th.sortable { cursor: pointer; user-select: none; }
.tbl thead th.sortable:hover { color: var(--text); }
.tbl thead th .arr { opacity: .4; font-size: 10px; }
.tbl tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: #fafbff; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.money { color: var(--primary-600); font-weight: 600; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.link-btn { color: var(--primary-600); cursor: pointer; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============ 状态标签 ============ */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--primary-50); color: var(--primary-600); white-space: nowrap; }
.tag.green { background: var(--green-50); color: var(--green); }
.tag.red { background: var(--red-50); color: var(--red); }
.tag.orange { background: var(--orange-50); color: var(--orange); }
.tag.blue { background: var(--blue-50); color: var(--blue); }
.tag.gray { background: #f1f3f8; color: var(--muted); }
.tag.warn { background: #fef3c7; color: #b45309; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ============ 表单 ============ */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text); transition: .14s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50);
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field .hint, .hint { font-size: 11.5px; color: var(--faint); margin-top: 4px; line-height: 1.5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.items-table { margin: 16px 0; }
.items-table input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; }
.items-table select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }

/* ============ 弹窗 ============ */
.modal-mask { position: fixed; inset: 0; background: rgba(17,24,39,.45); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 820px; max-width: 96vw; max-height: 92vh; overflow-y: auto; padding: 24px 26px; box-shadow: var(--shadow-lg); animation: modalIn .16s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal h3 { margin: 0 0 18px; font-size: 18px; font-weight: 700; }
.modal .modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal .modal-head h3 { margin: 0; }
.modal .close-x { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); border: 1px solid var(--line); }
.modal .close-x:hover { background: var(--bg); }
.modal .close-x svg { width: 16px; height: 16px; }

/* ============ 杂项 ============ */
.empty { text-align: center; color: var(--faint); padding: 46px 20px; }
.empty svg { width: 46px; height: 46px; opacity: .4; margin: 0 auto 10px; }
.empty .et { font-size: 14px; font-weight: 600; color: var(--muted); }
.empty .es { font-size: 12.5px; margin-top: 4px; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 12px; margin-top: 8px; }
.kpi-row { display: flex; gap: 26px; flex-wrap: wrap; margin: 6px 0 18px; }
.kpi { font-size: 13px; color: var(--muted); }
.kpi b { font-size: 21px; color: var(--text); margin-left: 6px; font-weight: 700; }

/* 待办 */
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 16px; margin: 6px 0 22px; }
.todo { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); cursor: pointer; transition: .14s; }
.todo:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.todo.warn { border-left-color: var(--orange); }
.todo.danger { border-left-color: var(--red); }
.todo .t-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.todo .t-num { font-size: 24px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }
.todo .t-sub { font-size: 12px; color: var(--faint); margin-top: 3px; }

/* 账龄条 */
.age-bar { display: flex; height: 28px; border-radius: 8px; overflow: hidden; margin: 12px 0; }
.age-bar > div { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 600; overflow: hidden; white-space: nowrap; min-width: 0; }
.age-seg-g { background: var(--green); }
.age-seg-y { background: var(--orange); }
.age-seg-r { background: var(--red); }

/* 单据详情 */
.detail-head { background: #f9fafc; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 16px; }
.detail-head .dh-row { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 13px; }
.detail-head .dh-row span { color: var(--text-2); }
.detail-head .dh-row b { color: var(--faint); font-weight: 600; margin-right: 5px; }
.sub-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.sub-tabs .st { padding: 7px 15px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 500; }
.sub-tabs .st.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 商品图片 / 缩略图 */
.row-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.img-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.img-cell { position: relative; width: 92px; height: 92px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f7f9fc; }
.img-cell img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.img-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(220,38,38,.92); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; opacity: 0; transition: opacity .15s; }
.img-cell:hover .img-del { opacity: 1; }
.img-del:hover { background: var(--red); }
.img-cell { cursor: grab; }
.img-cell.dragging { opacity: .4; }
.img-cell.over { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-50); }
.img-main { position: absolute; left: 4px; bottom: 4px; padding: 1px 7px; border-radius: 6px; background: rgba(79,70,229,.92); color: #fff; font-size: 10.5px; font-weight: 600; }
.img-star { position: absolute; left: 4px; bottom: 4px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(17,24,39,.6); color: #ffd76a; cursor: pointer; font-size: 12px; line-height: 1; padding: 0; opacity: 0; transition: opacity .15s; }
.img-cell:hover .img-star { opacity: 1; }
.img-star:hover { background: var(--primary); color: #fff; }
.img-empty { width: 100%; display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-radius: 10px; background: #f7f9fc; color: var(--faint); font-size: 12.5px; }
.img-empty .ic { width: 15px; height: 15px; }

/* ---- 统一上传区：点击 / 拖拽 一次完成 ---- */
.upzone {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border: 1.5px dashed #cfd5e2; border-radius: 10px; background: #fafbfe;
  cursor: pointer; user-select: none; transition: border-color .15s, background .15s;
}
.upzone:hover { border-color: var(--primary); background: var(--primary-50); }
.upzone:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.upzone.drag { border-color: var(--primary); background: var(--primary-50); box-shadow: inset 0 0 0 3px rgba(79,70,229,.08); }
.upzone.drag .upzone-ic { transform: translateY(-2px); }
.upzone.busy { opacity: .55; pointer-events: none; }
.upzone-ic { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--primary-50); color: var(--primary); flex-shrink: 0; transition: transform .15s; }
.upzone:hover .upzone-ic { background: var(--primary-100); }
.upzone-ic .ic { width: 19px; height: 19px; }
.upzone-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.upzone-tx b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.upzone-tx span { font-size: 12px; color: var(--faint); }
.lbl-sub { margin-left: 6px; font-weight: 400; font-size: 11.5px; color: var(--faint); }

/* ---- 商品介绍：图文混排 ---- */
.desc-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 7px; }
.desc-tip { font-size: 11.5px; color: var(--faint); }
.desc-prev { display: none; margin-top: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; padding: 11px 13px; }
.desc-prev-head { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.desc-body { font-size: 13px; color: var(--text-2); line-height: 1.75; word-break: break-word; }
.desc-body .desc-img { max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); margin: 7px 0; cursor: zoom-in; display: block; }

/* ---- 商品详情 ---- */
.pd-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 9px 18px; }
.pd-k { display: flex; align-items: baseline; gap: 8px; font-size: 13px; min-width: 0; }
.pd-k span { color: var(--faint); flex-shrink: 0; }
.pd-k b { color: var(--text); font-weight: 600; word-break: break-all; }
.pd-remark { display: flex; align-items: flex-start; gap: 7px; margin-top: 12px; padding: 9px 12px; border-radius: 9px; background: var(--orange-50); color: #9a3412; font-size: 12.5px; }
.pd-remark .ic { width: 14px; height: 14px; margin-top: 3px; flex-shrink: 0; }
.pd-sec { margin: 16px 0 9px; font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.pd-gallery { display: flex; flex-wrap: wrap; gap: 12px; }
.pd-shot { position: relative; width: 118px; height: 118px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f7f9fc; }
.pd-shot img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.pd-shot:hover img { transform: scale(1.04); }
.pd-shot img { transition: transform .18s; }
.pd-empty { padding: 14px; border: 1px dashed var(--line); border-radius: 10px; color: var(--faint); font-size: 12.5px; text-align: center; background: #fafbfe; }

/* 单据附件 */
.att-row { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 9px; background: #fff; }
.att-prev { flex-shrink: 0; }
.att-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.att-file { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: #f1f4f9; border-radius: 8px; }
.att-meta { flex: 1; min-width: 0; }
.att-meta a { color: var(--primary-600); text-decoration: none; font-size: 13px; word-break: break-all; }
.att-meta a:hover { text-decoration: underline; }
.att-size { color: var(--faint); font-size: 11px; margin-top: 2px; }

/* 图表 */
.chart-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 20px; margin-bottom: 20px; }
.chart-legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.chart-legend .lg { display: flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 11px; height: 11px; border-radius: 3px; }

/* Toast */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); color: #fff; padding: 11px 20px; border-radius: 10px; z-index: 99; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 8px; animation: toastIn .2s ease; }
.toast svg { width: 17px; height: 17px; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 登录 */
.login-mask { position: fixed; inset: 0; background: radial-gradient(1200px 600px at 70% -10%, #1f7ae0 0%, #0b5db8 40%, #062a58 100%); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.login-grid { display: grid; grid-template-columns: 1.1fr .9fr; width: 880px; max-width: 96vw; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); }
.login-aside { background: linear-gradient(160deg, #0b5db8, #062a58); color: #fff; padding: 46px 40px; display: flex; flex-direction: column; justify-content: space-between; }
.login-aside .la-logo { display: flex; align-items: center; }
.login-aside .la-logo img { height: 54px; width: auto; display: block; }
.login-aside h1 { font-size: 26px; font-weight: 800; margin: 28px 0 12px; line-height: 1.35; }
.login-aside p { color: rgba(255,255,255,.78); font-size: 14px; line-height: 1.7; }
.login-aside .la-foot { font-size: 12px; color: rgba(255,255,255,.6); }
.login-box { padding: 46px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-box .lb-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.login-box .lb-sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.login-box .field { margin-bottom: 16px; }
.login-box input { padding: 12px 14px; font-size: 14px; }
.login-hint { color: var(--faint); font-size: 12px; text-align: center; margin-top: 16px; }

/* 打印 */
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .modal-mask { position: static !important; padding: 0 !important; background: none !important; backdrop-filter: none !important; }
  .modal { width: 100% !important; max-width: none !important; max-height: none !important; overflow: visible !important; box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; }
  .no-print { display: none !important; }
}
.print-doc { background: #fff; padding: 28px 32px; color: #111; font-size: 13px; }
.print-doc h2 { text-align: center; margin: 0 0 4px; font-size: 20px; }
.print-doc .pd-sub { text-align: center; color: #666; font-size: 12px; margin-bottom: 18px; }
.print-doc .pd-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 14px; flex-wrap: wrap; gap: 6px; }
.print-doc table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.print-doc th, .print-doc td { border: 1px solid #ccc; padding: 7px 9px; font-size: 12.5px; text-align: left; }
.print-doc th { background: #f3f4f6; }
.print-doc .pd-foot { margin-top: 18px; display: flex; justify-content: space-between; font-size: 12.5px; }

/* ===================================================================
   v4 使用体验：商品搜索选择器 / 单据行 / 筛选分页 / 加载态
   =================================================================== */

/* ---- 商品搜索选择器（combobox）---- */
.prod-cell { position: relative; min-width: 240px; }
.prod-cell input.di-prod-inp { width: 100%; }
.ac-pop {
  position: fixed; z-index: 200; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 262px; overflow-y: auto; padding: 5px;
  animation: acIn .1s ease;
}
@keyframes acIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.ac-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.ac-row.on, .ac-row:hover { background: var(--primary-50); }
.ac-row .ac-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--primary-600); font-weight: 600; min-width: 62px; }
.ac-row .ac-nm { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-row .ac-nm i { font-style: normal; color: var(--faint); font-size: 12px; margin-left: 6px; }
.ac-row .ac-stk { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ac-row .ac-stk.zero { color: var(--orange); font-weight: 600; }
.ac-row .ac-pz { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; min-width: 62px; text-align: right; }
.ac-empty { padding: 16px; text-align: center; color: var(--faint); font-size: 13px; }
.ac-tip { padding: 6px 10px 4px; font-size: 11px; color: var(--faint); border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }

/* ---- 单据明细行 ---- */
.items-table .di-prod-inp { min-width: 200px; }
.items-table .di-qty, .items-table .di-price { width: 92px; text-align: right; font-variant-numeric: tabular-nums; }
.items-table .di-stk { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.items-table .di-stk.warn { color: var(--red); font-weight: 700; }
.items-table .di-stk.warn::after { content: " 不足"; }
.items-table tr.row-bad td { background: var(--red-50); }
.items-table tbody tr:hover { background: #fafbff; }
.btn.icon-only { padding: 6px 8px; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---- 筛选条 / 分页 ---- */
.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px; border-radius: 20px; border: 1px solid var(--line); background: #fff;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; user-select: none; font-weight: 500;
  transition: .12s; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--primary-100); color: var(--primary-600); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(79,70,229,.28); }
.chip .cnt { font-size: 11px; opacity: .75; font-variant-numeric: tabular-nums; }
.search-inp {
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px;
  font-family: inherit; min-width: 220px; background: #fff;
}
.search-inp:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.pager { display: flex; align-items: center; gap: 5px; padding: 12px 4px 4px; flex-wrap: wrap; }
.pager .pg-info { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.pager .pg {
  min-width: 32px; height: 32px; padding: 0 9px; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; font-family: inherit;
}
.pager .pg:hover:not(:disabled) { border-color: var(--primary-100); color: var(--primary-600); }
.pager .pg.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pager .pg:disabled { opacity: .4; cursor: not-allowed; }
.pager .pg-gap { color: var(--faint); padding: 0 2px; }

/* ---- 表格：可点击整行 ---- */
.tbl tbody tr.row-click { cursor: pointer; }

/* ---- 工作台：低库存列表（可下钻）---- */
.low-list { display: flex; flex-direction: column; }
.low-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 9px;
  border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 13px; transition: background .12s;
}
.low-row:last-child { border-bottom: none; }
.low-row:hover { background: var(--primary-50); }
.low-row b { font-weight: 600; }
.low-row .muted { margin-left: auto; font-size: 12.5px; }
.low-row .low-go { color: var(--faint); display: flex; }
.low-row .low-go .ic { width: 15px; height: 15px; }
.low-row:hover .low-go { color: var(--primary); }

/* ---- 加载态 ---- */
.loading-mask { display: flex; align-items: center; justify-content: center; padding: 70px 20px; color: var(--muted); gap: 12px; font-size: 13.5px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 2.5px solid var(--primary-100); border-top-color: var(--primary); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-bar { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--primary), #3b9ae1); z-index: 300; transition: width .2s ease; box-shadow: 0 0 8px rgba(11,93,184,.45); }

/* ---- 工具条附加 ---- */
.toolbar .muted-sm { font-size: 12.5px; color: var(--muted); }
.money-strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.di-sum { display: flex; gap: 18px; align-items: center; margin: 4px 0 14px; flex-wrap: wrap; }
.di-sum .kv { font-size: 12.5px; color: var(--muted); }
.di-sum .kv b { font-size: 15px; color: var(--text); margin-left: 6px; font-variant-numeric: tabular-nums; }
.kbd-hint { font-size: 11.5px; color: var(--faint); display: flex; gap: 10px; flex-wrap: wrap; }
.kbd-hint kbd {
  border: 1px solid var(--line); border-bottom-width: 2px; background: #fff; border-radius: 5px;
  padding: 1px 5px; font-family: inherit; font-size: 11px; color: var(--text-2);
}

/* ===================================================================
   v4.1 工作台精致化 + 文件预览
   =================================================================== */

/* ---- Hero 问候横幅 ---- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  background: linear-gradient(118deg, #094b96 0%, #0b5db8 42%, #1673d1 100%);
  color: #fff; padding: 24px 26px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  box-shadow: 0 14px 34px -14px rgba(11,93,184,.6);
}
.hero-glow {
  position: absolute; right: -60px; top: -110px; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.26) 0%, rgba(255,255,255,0) 70%); pointer-events: none;
}
.hero-glow::after {
  content: ""; position: absolute; left: -420px; top: 200px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 70%);
}
.hero-main { flex: 1; min-width: 230px; position: relative; z-index: 1; }
.hero-hi { font-size: 22px; font-weight: 800; letter-spacing: .3px; }
.hero-date { font-size: 12.5px; color: rgba(255,255,255,.8); margin-top: 6px; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff;
  padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer;
  backdrop-filter: blur(6px); transition: .14s; font-family: inherit;
}
.hero-btn:hover { background: rgba(255,255,255,.3); transform: translateY(-1px); }
.hero-btn svg { width: 16px; height: 16px; }

/* ---- KPI 卡 ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-card {
  position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px 15px; box-shadow: var(--shadow-sm); transition: .16s;
}
.kpi-card::after { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: transparent; transition: .16s; }
.kpi-card.clickable { cursor: pointer; }
.kpi-card.clickable:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary-100); }
.kpi-card.clickable:hover::after { background: linear-gradient(90deg, var(--primary), #3b9ae1); }
.kpi-card.danger::after { background: linear-gradient(90deg, var(--red), #f87171); }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 11px; }
.kpi-ico { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.kpi-ico svg { width: 19px; height: 19px; }
.kpi-go { color: var(--faint); opacity: 0; transition: .14s; display: flex; }
.kpi-card.clickable:hover .kpi-go { opacity: 1; color: var(--primary); }
.kpi-label { font-size: 12.5px; color: var(--muted); }
.kpi-value { font-size: 23px; font-weight: 800; letter-spacing: -.6px; margin: 3px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 11.5px; color: var(--faint); }
.kpi-card.danger .kpi-value { color: var(--red); }

/* ---- 面板头补充 ---- */
.panel-head .ph-sub { font-size: 11.5px; color: var(--faint); margin-top: 3px; font-weight: 400; }
.panel-head > div:first-child { min-width: 0; }
.panel-note {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted);
  background: var(--bg); border-radius: 10px; padding: 9px 12px; margin-top: 14px;
}
.panel-note svg { width: 15px; height: 15px; color: var(--green); flex-shrink: 0; }
.panel-note.is-danger { background: var(--red-50); color: #b91c1c; }
.panel-note.is-danger svg { color: var(--red); }
.panel-note .link-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.panel-note .link-btn svg { width: 14px; height: 14px; color: currentColor; }

/* ---- 两栏 ---- */
.cols-2 { display: grid; grid-template-columns: 1.05fr 1fr; gap: 20px; align-items: start; }
.cols-2.single { grid-template-columns: 1fr; }
.cols-2 > .panel { margin-bottom: 20px; }

/* ---- 构成条 / 数值对 ---- */
.split-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 4px 0 16px; gap: 2px; background: var(--line-2); }
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sp-item { display: flex; align-items: center; gap: 10px; }
.sp-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.sp-label { font-size: 12px; color: var(--muted); }
.sp-item b { font-size: 19px; font-weight: 800; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }

/* ---- 趋势图 ---- */
.chart-box { margin: 2px 0 4px; transition: opacity .15s; }
.chart-box.is-loading { opacity: .4; }
.chart-svg { width: 100%; height: auto; display: block; }
.range-chips { display: flex; gap: 5px; background: var(--bg); padding: 3px; border-radius: 10px; }
.range-chips .rc {
  padding: 5px 12px; border-radius: 8px; font-size: 12.5px; color: var(--muted);
  cursor: pointer; user-select: none; font-weight: 600; transition: .13s;
}
.range-chips .rc:hover { color: var(--primary-600); }
.range-chips .rc.on { background: #fff; color: var(--primary-600); box-shadow: var(--shadow-sm); }
.chart-legend .lg b { margin-left: 2px; font-weight: 700; }
.donut-box { display: flex; justify-content: center; }

/* ---- 待办卡 ---- */
.todo .t-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.todo .t-go { color: var(--faint); display: flex; opacity: 0; transition: .14s; }
.todo:hover .t-go { opacity: 1; color: var(--primary); transform: translateX(2px); }
.todo.danger .t-num { color: var(--red); }
.todo.danger { border-left-color: var(--red); }

/* ---- 低库存进度 ---- */
.low-row { gap: 12px; }
.low-row .low-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.low-row .low-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.low-bar { flex: 1; height: 6px; background: var(--line-2); border-radius: 4px; overflow: hidden; min-width: 50px; }
.low-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #f97316, var(--red)); }
.low-row .low-qty { margin-left: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.low-row .low-go { transform: translateX(-2px); }

/* ---- 面板内嵌表格贴合 ---- */
.table-wrap.flush { border: none; box-shadow: none; border-radius: 0; margin: 0 -20px -18px; }
.table-wrap.flush .tbl tbody tr:last-child td { border-bottom: none; }
.table-wrap.flush .tbl tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }

/* ---- 文件预览灯箱 ---- */
.img-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 8px; }
.img-tools input[type=file] { font-size: 12.5px; color: var(--muted); font-family: inherit; }
.fv-wrap {
  display: flex; align-items: center; justify-content: center;
  background: repeating-conic-gradient(#f3f4f8 0% 25%, #fff 0% 50%) 50% / 18px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; max-height: 62vh; overflow: auto;
}
.fv-img { max-width: 100%; max-height: 58vh; border-radius: 8px; box-shadow: var(--shadow-md); }
.fv-img.zoomable { cursor: zoom-in; }
.fv-img.zoomable.zoom { max-width: none; max-height: none; cursor: zoom-out; }
.fv-tip { margin-right: auto; font-size: 12px; color: var(--faint); }
.att-name { color: var(--primary-600); cursor: pointer; font-size: 13px; word-break: break-all; font-weight: 500; }
.att-name:hover { text-decoration: underline; }
/* 图片加载中的占位 / 失败态 */
img[data-file] { background: linear-gradient(100deg, #f1f3f9 30%, #e8ecf4 50%, #f1f3f9 70%) center/300% 100%; }
img[data-file].file-ready { background: none; }
img[data-file].file-broken { background: var(--red-50); position: relative; }
.att-file {
  font-size: 10.5px; font-weight: 800; letter-spacing: .5px; color: var(--muted);
  background: #eef1f7; border: 1px dashed #cfd5e2;
}
.att-prev { display: flex; }

/* 响应式 */
/* ---------- 分类树 / ID 列 / 分类筛选条 ---------- */
.idcol { width: 58px; color: var(--faint); font-size: 12px; font-weight: 500; }
.tree-cell { font-weight: 500; }
.tree-pre { color: var(--faint); }
.filter-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; margin-bottom: 12px;
  background: var(--primary-50); border: 1px solid var(--primary-100);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2);
}
.filter-bar svg { width: 15px; height: 15px; color: var(--primary); flex: none; }
.filter-bar .btn { margin-left: auto; }
a.lk {
  color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: none;
  border-bottom: 1px dashed rgba(79, 70, 229, .45);
}
a.lk:hover { color: var(--primary-600); border-bottom-style: solid; }
select[data-k] { cursor: pointer; }

@media (max-width: 1100px) {
  .login-grid { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .cols-2, .cols-2.single { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hero { padding: 20px; }
  .hero-hi { font-size: 19px; }
  .sp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .search-box { width: 160px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  #crumb { font-size: 15px; }
  .content { padding: 16px; }
  .search-inp { min-width: 150px; }
  .prod-cell { min-width: 160px; }
  .hero-actions { width: 100%; }
}

/* ===================================================================
   v4.9 新增：条码标签打印 / 批次效期 / 操作日志
   =================================================================== */
.lb-list {
  max-height: 240px; overflow: auto; border: 1px solid var(--line);
  border-radius: var(--radius-sm); margin-top: 12px;
}
.lb-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 13px;
}
.lb-item:last-child { border-bottom: none; }
.lb-item:hover { background: var(--primary-50); }
.lb-item.on { background: var(--primary-50); }
.lb-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  color: var(--primary-600); min-width: 92px; }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bc { min-width: 110px; text-align: right; }

.lb-sheet {
  display: grid; gap: 10px; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.lb-tag {
  border: 1px dashed #c8ccd8; border-radius: 6px; padding: 8px 6px; text-align: center;
  background: #fff; color: #111; overflow: hidden;
}
.lt-name { font-size: 11px; font-weight: 600; margin-bottom: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px;
  letter-spacing: 1px; margin-top: 3px; color: #111; }
.lt-price { font-size: 12px; font-weight: 700; margin-top: 2px; color: #111; }
.lt-spec { font-size: 10px; color: #666; margin-top: 1px; }
.lt-bad { font-size: 10px; color: #c00; border: 1px solid #c00;
  border-radius: 3px; padding: 8px 4px; line-height: 1.4; }
.bc-svg { display: block; margin: 0 auto; max-width: 100%; }

/* 操作日志：时间列等宽数字，便于纵向对比 */
#content table .muted-sm, .muted-sm { font-size: 12px; color: var(--muted); }

/* ===================================================================
   v4.9：明细行进阶列（单位 / 批次 / 效期 / 库位）
   批次三列默认收起，勾选工具栏开关后才展开 —— 不用批次盘点的人
   不必忍受一张 10 列的宽表，用的人也不必每次都手动加列
   =================================================================== */
.items-table .adv-col { display: none; }
.items-table.adv-on .adv-col { display: table-cell; }
.items-table .di-unit-cell { width: 76px; }
.items-table .di-unit { width: 100%; min-width: 58px; padding: 6px 4px; font-size: 12.5px; }
/* 只有一个基本单位时：下拉看着像纯文本，不再暗示「有别的单位可选」 */
.items-table .di-unit-single {
  appearance: none; -webkit-appearance: none; border: none; background: transparent;
  color: var(--muted); text-align: center; opacity: 1;
}
.items-table .di-unit-single::-ms-expand { display: none; }
.items-table .di-batch { width: 118px; }
.items-table .di-exp { width: 132px; }
.items-table .di-loc { width: 118px; padding: 6px 4px; font-size: 12.5px; }
/* 行内两条预警线：数量超库存（红）/ 售价低于最低售价（橙） */
.items-table tr.row-bad > td { background: var(--red-50, #fef2f2); }
.items-table tr.row-min > td { background: var(--orange-50, #fff7ed); }
.items-table tr.row-min .di-price { border-color: var(--orange-500, #f97316); }

.sw.adv-sw { display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.sw.adv-sw input { margin: 0; cursor: pointer; }

/* 草稿行：整行淡黄底 + 左侧色条，扫一眼就能区分「没过账」的单据 */
tr.row-draft > td { background: #fffdf5; }
tr.row-draft > td:first-child { box-shadow: inset 3px 0 0 var(--orange-500, #f97316); }

/* 多单位换算（商品表单内） */
.unit-rows { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.unit-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  border-bottom: 1px solid var(--line-2); font-size: 13px; }
.unit-row:last-child { border-bottom: none; }
.unit-row .spacer { flex: 1; }
.unit-add { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.unit-add input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 13px; }

/* 库存页展开的「批次 / 库位明细」子行 */
tr.slot-row > td { padding: 0 !important; }
tr.slot-row table.tbl { background: transparent; }
