/* ============================================================
   宠物供应链 ERP · 设计系统 v2
   品牌色：深松石绿（供应链/宠物养护的自然语感，区别于通用蓝紫 AI 模板）
   结构：深色侧边栏 + 细线卡片 + 下划线式标签页
   原则：克制阴影、清晰层级、业务密度
   ============================================================ */
:root {
  --primary: #0d7a6e;          /* 主色：深松石绿 */
  --primary-strong: #0a5f56;   /* 主色加深（hover 深压/按下） */
  --primary-light: #179084;    /* 主色提亮 */
  --primary-bg: #e3f1ee;       /* 主色淡底 */
  --danger: #cf4a55;
  --danger-bg: #fceeef;
  --warn: #b96f10;
  --warn-bg: #fcf3e3;
  --success: #1e8a4c;
  --success-bg: #e5f4ea;
  --blue: #2f6bff;
  --blue-bg: #ebf0fe;
  --purple: #7656e8;
  --purple-bg: #f0ecfd;
  --teal: #0e8f86;
  --teal-bg: #e1f4f2;
  --text-1: #182420;
  --text-2: #4e5d58;
  --text-3: #8b9993;
  --line: #e5eae8;
  --bg: #f2f5f4;
  --card: #ffffff;
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgba(20, 35, 30, .05), 0 2px 8px rgba(20, 35, 30, .05);
  --shadow-lg: 0 20px 48px rgba(16, 30, 26, .16);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  /* 深色侧边栏 */
  --sb-bg: #142521;
  --sb-text: #a7b9b2;
  --sb-text-strong: #e8efec;
  --sb-line: rgba(255, 255, 255, .07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px; color: var(--text-1); background: var(--bg);
  -webkit-font-smoothing: antialiased; line-height: 1.5;
}
input, select, textarea, button { font-family: inherit; font-size: 13px; color: var(--text-1); }
button { cursor: pointer; border: none; background: none; }
a { color: var(--primary); text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cdd6d2; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b4c0bb; }

/* ===== 统一图标 ===== */
svg.i { width: 14px; height: 14px; display: block; flex-shrink: 0; }
.nav-ico svg.i { width: 17px; height: 17px; }
.search-ico svg.i { width: 14px; height: 14px; }
.modal-close svg.i { width: 15px; height: 15px; }
.rt-dot svg.i { width: 12px; height: 12px; }
.btn svg.i { width: 14px; height: 14px; }
.btn-primary svg.i, .btn-success svg.i { color: #fff; }

/* ===== 登录页：深色渐变 + 品牌光晕 ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(720px 420px at 78% -10%, rgba(23, 144, 132, .35), transparent 62%),
    radial-gradient(640px 420px at -10% 110%, rgba(118, 86, 232, .22), transparent 60%),
    linear-gradient(155deg, #0f241f 0%, #143229 52%, #0b3d34 100%);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  padding: 20px;
}
.login-card {
  width: 404px; background: #fff; border-radius: 16px; padding: 38px 34px 30px;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .12);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.logo-mark {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; box-shadow: 0 6px 16px rgba(13, 122, 110, .35);
}
.logo-name { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.logo-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.input {
  height: 38px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px;
  width: 100%; background: #fff; transition: border-color .15s, box-shadow .15s;
  color: var(--text-1);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 122, 110, .13); }
.input::placeholder { color: var(--text-3); }
textarea.input { padding: 10px 12px; line-height: 1.6; }
.login-err { color: var(--danger); font-size: 12px; min-height: 18px; }
.login-hint { font-size: 12px; color: var(--text-3); text-align: center; }

/* ===== 自定义原生控件 ===== */
select.input {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b9993' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px 16px;
  padding-right: 30px;
}
select.input:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230d7a6e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px 16px;
}
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px;
  border: 1.5px solid #c3cdc8; border-radius: 4px; background: #fff; cursor: pointer;
  position: relative; transition: border-color .15s, background .15s; vertical-align: middle; flex-shrink: 0;
}
input[type="checkbox"]:hover { border-color: var(--primary); }
input[type="checkbox"]:checked { background: var(--primary); border-color: var(--primary); }
input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 4.5px; top: 1px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }
input[type="date"].input { padding-right: 8px; cursor: pointer; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500;
  transition: all .15s; white-space: nowrap; user-select: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-primary:active { background: var(--primary-strong); }
.btn-secondary { background: #fff; color: var(--text-1); border: 1px solid var(--line); }
.btn-secondary:hover { background: #f4f7f6; border-color: #d3dcd8; }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success-bg); color: var(--success); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: #eef2f0; }
.btn-sm { height: 29px; padding: 0 11px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; height: 42px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== 布局 ===== */
.app { display: flex; height: 100vh; }
.sidebar {
  width: 216px; flex-shrink: 0; background: var(--sb-bg); color: var(--sb-text);
  display: flex; flex-direction: column; padding: 16px 12px 12px;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; border-bottom: 1px solid var(--sb-line); margin-bottom: 12px; min-width: 0; }
.sidebar-logo .logo-mark { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
.sidebar-logo .logo-name { font-size: 15px; color: var(--sb-text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-logo .logo-sub { font-size: 11px; color: rgba(255, 255, 255, .45); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--sb-text); transition: all .15s; text-align: left; width: 100%;
  position: relative; min-width: 0; overflow: hidden;
}
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: var(--sb-text-strong); }
.nav-item.active { background: rgba(13, 122, 110, .32); color: #fff; font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--primary-light); }
.nav-ico { width: 17px; height: 17px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; margin-left: auto;
  border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; text-align: center; flex-shrink: 0;
}
.mn-item .nav-badge { position: absolute; top: -3px; right: -9px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; border-radius: 8px; margin-left: 0; }
.sidebar-footer { border-top: 1px solid var(--sb-line); padding-top: 10px; }
.sidebar-footer .btn-ghost { color: var(--sb-text); width: 100%; justify-content: flex-start; }
.sidebar-footer .btn-ghost:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 24px; flex-shrink: 0;
}
.topbar-title { font-size: 16px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.mu-wrap { position: relative; display: none; flex-shrink: 0; }
.mu-btn {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.mu-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 95;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 30, 26, .16); min-width: 190px; padding: 6px; display: none;
}
.mu-menu.open { display: block; animation: popIn .15s ease; }
.mu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.mu-name { font-weight: 700; font-size: 14px; }
.mu-role { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.mu-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  height: 40px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--danger);
}
.mu-logout:active, .mu-logout:hover { background: #fff1f0; }
.content { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* ===== 卡片 / 表格 ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 16px 18px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.card-title > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

.banner { padding: 11px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; line-height: 1.6; }
.banner-warn { background: var(--warn-bg, #fff7e6); color: var(--warn, #a06a00); border: 1px solid var(--warn-bd, #ffe1a8); }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; }
.kv > div { display: flex; flex-direction: column; gap: 4px; }
.kv label { font-size: 12px; color: var(--text-3); }
.kv b { font-size: 15px; font-weight: 600; color: var(--text-1); }
@media (max-width: 640px) { .kv { grid-template-columns: repeat(2, 1fr); } }
.search-box { position: relative; width: 240px; }
.search-box .input { padding-left: 32px; }
.search-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); display: flex; align-items: center; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; color: var(--text-3); font-weight: 500;
  padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid #eef2f0; font-size: 13px; vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: #f7faf9; }
.table tbody tr:last-child td { border-bottom: none; }
.table tr.clickable { cursor: pointer; }
.table td .btn { margin: 2px 6px 2px 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); font-size: 13px; }

/* 徽标 */
.badge { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 5px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-orange { background: var(--warn-bg); color: var(--warn); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-gray { background: #eef2f0; color: var(--text-2); }
.badge-teal { background: var(--teal-bg); color: var(--teal); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(13, 24, 21, .45); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(2px); }
.modal {
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 640px; max-width: calc(100vw - 40px); max-height: calc(100vh - 60px);
  display: flex; flex-direction: column; animation: popIn .18s ease;
}
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-header { padding: 18px 22px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; }
.modal-title .badge { flex-shrink: 0; }
.modal-close { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-3); flex-shrink: 0; }
.modal-close:hover { background: #f0f2f7; color: var(--text-1); }
.modal-body { padding: 16px 22px; overflow-y: auto; max-height: 65vh; }
.modal-footer { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid #f2f5f4; }
.modal.modal-wide { width: 1350px; max-width: 95vw; }

/* 表单 */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; margin-bottom: 12px; }
.form-row .full { grid-column: 1 / -1; }
.form-label { font-size: 12px; color: var(--text-2); font-weight: 500; margin-bottom: 6px; display: block; }
.form-label .req { color: var(--danger); }

/* Toast */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #182420; color: #fff; padding: 10px 18px; border-radius: 9px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: popIn .2s ease; display: flex; align-items: center; gap: 8px;
}
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }

/* 商品卡片（销售下单） */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.prod-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px;
  cursor: pointer; transition: all .15s; position: relative; min-width: 0;
}
.prod-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(13, 122, 110, .1); transform: translateY(-1px); }
.prod-card .pc-name { font-weight: 600; font-size: 13px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prod-card .pc-spec { font-size: 11px; color: var(--text-3); margin: 4px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-card .pc-price { font-size: 16px; font-weight: 700; color: var(--primary); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.prod-card .pc-stock { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.prod-card .pc-qty { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.prod-card .pc-qty input { width: 100%; height: 30px; border: 1px solid var(--line); border-radius: 7px; text-align: center; font-size: 13px; }
.prod-card.out { opacity: .45; }
.qty-btn { width: 26px; height: 26px; border-radius: 7px; background: #eef2f0; font-size: 15px; flex-shrink: 0; color: var(--text-1); }
.qty-btn:hover { background: #e0e7e4; }

/* 订单明细 */
.items-table { width: 100%; border-collapse: collapse; }
.items-table th { text-align: left; font-size: 12px; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.items-table td { padding: 9px 10px; border-bottom: 1px solid #eef2f0; font-size: 13px; }
.items-table tr:last-child td { border-bottom: none; }
.items-table input { height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; width: 90px; text-align: center; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-box { flex: 1; min-width: 160px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 16px; box-shadow: var(--shadow); }
.stat-box .sb-label { font-size: 12px; color: var(--text-2); }
.stat-box .sb-value { font-size: 24px; font-weight: 700; margin-top: 4px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); }
.fs-11 { font-size: 11px; } .fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; }
.hint { font-size: 12px; color: var(--text-3); line-height: 1.8; }

/* 勾选标签 */
.chk { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; font-size: 13px; color: var(--text-2); cursor: pointer; }

/* 自定义搜索下拉 */
.dd { position: relative; min-width: 0; }
.dd-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 38px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px;
  background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.dd-head:hover { border-color: var(--primary); }
.dd.open .dd-head { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 122, 110, .13); }
.dd-val { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-1); }
.dd-val.ph { color: var(--text-3); }
.dd-arrow { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; transition: transform .15s; }
.dd.open .dd-arrow { transform: rotate(180deg); }
.dd-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16, 30, 26, .16); display: none; overflow: hidden;
}
.dd.open .dd-panel { display: block; animation: popIn .15s ease; }
.dd-search { width: 100%; height: 34px; border: none; border-bottom: 1px solid var(--line); padding: 0 12px; font-size: 13px; outline: none; }
.dd-list { max-height: 224px; overflow-y: auto; padding: 4px; }
.dd-opt { padding: 9px 12px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-opt:hover { background: var(--primary-bg); color: var(--primary); }
.dd-opt.on { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.dd-empty { padding: 16px; text-align: center; color: var(--text-3); font-size: 12px; }

/* 品牌分组折叠（销售下单） */
.brand-group { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: #fff; }
.brand-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; background: #f6f8f7; user-select: none; }
.brand-head:hover { background: #edf2f0; }
.brand-arrow { font-size: 11px; color: var(--primary); width: 14px; font-family: var(--mono); }
.brand-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-count { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.brand-sum { font-size: 12px; color: var(--text-3); margin-left: auto; flex-shrink: 0; }
.brand-group .prod-grid { padding: 10px; }

/* ===== 退货进度 ===== */
.rt-mini { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; margin-top: 6px; }
.rt-mini b { font-size: 10px; font-weight: 400; color: var(--text-3); padding: 1px 5px; border-radius: 5px; background: #eef2f0; }
.rt-mini b.on { background: var(--primary); color: #fff; font-weight: 600; }
.rt-mini b.cur { background: var(--primary-bg); color: var(--primary); font-weight: 700; }
.rt-mini i { width: 8px; height: 2px; background: #dfe5e2; border-radius: 1px; }
.rt-mini i.on { background: var(--primary); }
.rt-steps { display: flex; align-items: flex-start; margin: 4px 0 18px; background: #f5f8f7; border-radius: var(--r-md); padding: 16px 10px 14px; }
.rt-step { flex: 1; text-align: center; position: relative; min-width: 0; }
.rt-step::before { content: ''; position: absolute; top: 12px; left: calc(-50% + 14px); width: calc(100% - 28px); height: 2px; background: #dfe5e2; }
.rt-step:first-child::before { display: none; }
.rt-step.done::before, .rt-step.cur::before { background: var(--primary); }
.rt-dot {
  width: 24px; height: 24px; border-radius: 50%; margin: 0 auto; background: #eef2f0; color: var(--text-3);
  font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; border: 2px solid transparent;
}
.rt-step.done .rt-dot { background: var(--primary); color: #fff; }
.rt-step.done .rt-dot svg.i { color: #fff; }
.rt-step.cur .rt-dot { border-color: var(--primary); color: var(--primary); }
.rt-label { font-size: 11px; color: var(--text-3); margin-top: 6px; }
.rt-step.done .rt-label, .rt-step.cur .rt-label { color: var(--primary); font-weight: 600; }
.rt-step.fail .rt-dot { border-color: var(--danger); color: var(--danger); }
.rt-step.fail .rt-label { color: var(--danger); font-weight: 600; }
.rt-step.fail::before { background: var(--danger); }

/* ===== 移动端布局（≤768px：底部导航 + 卡片列表 + 全屏弹窗） ===== */
.mobile-nav { display: none; }
@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar { display: none; }
  .main { flex: 1; height: 100%; }
  .topbar { height: 50px; padding: 0 14px; }
  .topbar-title { font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .content { padding: 12px 12px calc(72px + env(safe-area-inset-bottom)); }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    height: 58px; background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: var(--text-2); font-size: 10px; min-width: 0; position: relative;
  }
  .mn-item.on { color: var(--primary); }
  .mn-item.on .mn-label { font-weight: 700; }
  .mn-ico { position: relative; display: flex; align-items: center; justify-content: center; height: 22px; }
  .mn-ico svg.i { width: 22px; height: 22px; }
  .mn-label { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card { border-radius: 12px; padding: 14px; }
  .toolbar { gap: 8px; margin-bottom: 12px; }
  .search-box { flex: 1; min-width: 150px; }
  .form-row { grid-template-columns: 1fr; gap: 12px; }
  .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { overflow-x: auto; }
  .table { min-width: 560px; }
  .modal.modal-wide { width: 1350px; }
  .modal { position: fixed; inset: 0; width: 100%; max-width: 100%; max-height: 100%; border-radius: 0; animation: slideUp .22s ease; }
  @keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .modal-header { padding: 16px 16px 0; }
  .modal-body { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
  .btn { height: 42px; }
  .btn-sm { height: 34px; padding: 0 12px; }
  .items-table { min-width: 480px; }
  .stat-box { min-width: 128px; }
  .dd-panel { max-height: 60vh; }
  .mu-wrap { display: block; }
}

/* ===== 移动端订单 / 退货卡片 ===== */
.ocard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(20, 35, 30, .05); }
.oc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.oc-no { font-size: 12px; color: var(--text-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-badges { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.oc-cust { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.oc-sales { font-size: 11px; color: var(--text-3); font-weight: 400; }
.oc-sum { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.oc-progress { margin-top: 8px; }
.oc-bottom { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; gap: 8px; }
.oc-amt { font-family: var(--mono); font-weight: 700; font-size: 17px; color: var(--primary); font-variant-numeric: tabular-nums; }
.oc-time { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.oc-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); flex-wrap: wrap; }

/* 移动端登录页 */
@media (max-width: 480px) {
  .login-card { width: 100%; max-width: 400px; padding: 30px 22px 24px; }
  .login-logo { margin-bottom: 22px; }
}

/* ===== 销售看板 ===== */
.dash-status { display: flex; gap: 10px; flex-wrap: wrap; }
.ds-item { display: flex; align-items: center; gap: 8px; background: #f5f8f7; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 108px; }
.ds-item b { font-size: 18px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dash-chart { display: flex; gap: 12px; height: 132px; padding: 8px 4px 0; }
.dash-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.dash-num { font-size: 12px; font-weight: 600; }
.dash-amt { font-size: 10px; color: var(--text-3); }
.dash-bar { width: 100%; max-width: 44px; background: var(--primary); border-radius: 5px 5px 0 0; min-height: 3px; transition: height .3s; }
.dash-day { font-size: 11px; color: var(--text-3); }
@media (max-width: 768px) {
  .dash-chart { height: 110px; }
}

/* 徽标/状态列居中 */
.table .tc, .table th.tc { text-align: center; }
.table td.tc .badge, .table td.tc .rt-mini { vertical-align: middle; }

/* 新增商品下拉菜单 */
.add-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16, 30, 26, .16); padding: 4px; display: none; min-width: 148px;
}
.add-menu.open { display: block; animation: popIn .15s ease; }
.add-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border-radius: 8px; font-size: 13px; color: var(--text-1); text-align: left; }
.add-menu button:hover { background: var(--primary-bg); color: var(--primary); }

/* ===== 品牌快速筛选 chips ===== */
.brand-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.chip {
  height: 30px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: 12px; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px;
  flex-shrink: 0; transition: all .12s; white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.chip .n { font-size: 10px; opacity: .75; }

/* ===== 紧凑商品列表 ===== */
.prod-list { display: flex; flex-direction: column; gap: 8px; }
.prod-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; transition: all .12s; }
.prod-row:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(13, 122, 110, .1); }
.prod-row.out { opacity: .45; }
.prod-row .pr-main { flex: 1; min-width: 0; }
.prod-row .pr-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-row .pr-spec { font-size: 11px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-row .pr-price { font-family: var(--mono); font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.prod-row .pr-stock { font-size: 11px; color: var(--text-3); min-width: 56px; text-align: right; flex-shrink: 0; }
.prod-row .pr-qty { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.prod-row .pr-qty input { width: 56px; height: 30px; border: 1px solid var(--line); border-radius: 7px; text-align: center; }
@media (max-width: 768px) {
  .brand-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .prod-row { flex-wrap: wrap; gap: 8px; }
  .prod-row .pr-main { flex: 1 1 100%; }
  .prod-row .pr-qty { margin-left: auto; }
}

/* 只读输入框 */
input.input[readonly] {
  background: #f2f5f4; color: var(--text-2); cursor: not-allowed;
  border-color: transparent;
}

/* 业务员业绩金额占比条 */
.bar-line { display: inline-block; width: 90px; height: 8px; background: #eef2f0; border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 4px; }

/* 赠品按钮 */
.gift-btn { padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text-2); font-size: 12px; cursor: pointer; transition: all .15s; white-space: nowrap; }
.gift-btn:hover { border-color: var(--primary); color: var(--primary); }
.gift-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== 标签页容器：下划线式 ===== */
.view-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; flex-wrap: nowrap; }
.view-tab { padding: 9px 2px; border-radius: 0; font-size: 13.5px; color: var(--text-2); background: transparent; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; white-space: nowrap; }
.view-tab:hover { color: var(--primary); background: none; }
.view-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; background: none; }
.tab-body { min-height: 200px; }
@media (max-width: 768px) {
  .view-tabs { gap: 16px; margin-bottom: 10px; }
  .view-tab { flex: 0 0 auto; padding: 8px 0; font-size: 12.5px; }
}

/* ===== 管理端：管理中心入口卡片 ===== */
.mc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; padding: 16px; }
.mc-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; cursor: pointer; background: var(--card); transition: border-color .15s, box-shadow .15s; }
.mc-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(13, 122, 110, .1); }
.mc-ico { width: 42px; height: 42px; border-radius: 10px; background: var(--primary-bg); display: flex; align-items: center; justify-content: center; margin-bottom: 10px; color: var(--primary); }
.mc-ico .i { width: 22px; height: 22px; }
.mc-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-desc { font-size: 12px; color: var(--text-3); }

/* ===== 管理端：看板双柱 ===== */
.dash-bar2 { width: 100%; max-width: 44px; background: var(--primary-light); border-radius: 4px 4px 0 0; min-height: 3px; transition: height .3s; }

/* ===== 看板统计卡片（取代旧彩虹渐变 stat-card） ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; min-width: 0;
}
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.stat-card.accent-blue::before { background: var(--blue); }
.stat-card.accent-orange::before { background: var(--warn); }
.stat-card.accent-red::before { background: var(--danger); }
.stat-card.accent-green::before { background: var(--success); }
.stat-card.accent-purple::before { background: var(--purple); }
.stat-card.accent-gray::before { background: var(--text-3); }
.stat-label { font-size: 12px; color: var(--text-2); }
.stat-value { font-size: 22px; font-weight: 700; margin-top: 4px; font-family: var(--mono); font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat-sub { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* 表格横向滚动容器 */
.table-wrap { overflow-x: auto; }

/* 报销中心等旧视图的通用样式（历史 modal 助手用） */
.modal h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.btn-cancel { background: #eef2f0; color: var(--text-1); }
.btn-cancel:hover { background: #e0e7e4; }
.select-wrap select { width: 100%; }

/* ===== 系统设置：流程节点自定义 ===== */
.wf-steps { display: flex; flex-direction: column; gap: 10px; }
.wf-step { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); flex-wrap: wrap; }
.wf-name { font-size: 13px; font-weight: 600; min-width: 160px; }
.wf-roles { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
