:root {
  --brand: #1f6feb;
  --brand-dark: #0b3d91;
  --ink: #1d2733;
  --muted: #6b7785;
  --line: #e6e9ee;
  --bg: #f4f6f9;
  --side: #121a26;
  --side-2: #1b2636;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); font-size: 14px;
}
[v-cloak] { display: none; }
a { color: var(--brand); text-decoration: none; }

/* ---------- 登录 ---------- */
.login-body { background: linear-gradient(135deg, #0b1626 0%, #13294b 55%, #1f6feb 140%); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 64px; padding: 24px; flex-wrap: wrap; }
.login-brand { color: #e8eef7; max-width: 420px; }
.login-brand h1 { font-size: 32px; margin: 16px 0 12px; letter-spacing: 1px; }
.login-brand p { color: #b5c3d6; line-height: 1.8; }
.login-brand ul { padding-left: 18px; color: #c9d6e8; line-height: 2; }
.brand-mark { width: 52px; height: 52px; border-radius: 14px; background: var(--brand); color: #fff; font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(31,111,235,.45); }
.login-card { width: 400px; max-width: 100%; background: #fff; border-radius: 14px; padding: 20px 28px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }

/* ---------- 布局 ---------- */
.layout { display: flex; height: 100vh; }
.side { width: 212px; background: var(--side); color: #c8d1dd; display: flex; flex-direction: column; flex-shrink: 0; transition: width .2s; }
.side.collapsed { width: 64px; }
.side .logo { height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 16px; color: #fff; font-weight: 600; font-size: 16px; border-bottom: 1px solid #1f2a3a; white-space: nowrap; overflow: hidden; }
.side .logo .brand-mark { width: 32px; height: 32px; font-size: 16px; border-radius: 9px; flex-shrink: 0; box-shadow: none; }
.side .el-menu { background: transparent; border-right: none; flex: 1; }
.side .el-menu-item { color: #aab6c5; height: 46px; }
.side .el-menu-item:hover { background: var(--side-2); color: #fff; }
.side .el-menu-item.is-active { background: var(--brand); color: #fff; }
.side .side-foot { padding: 12px 16px; font-size: 12px; color: #6f7d90; border-top: 1px solid #1f2a3a; white-space: nowrap; overflow: hidden; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 58px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0; }
.topbar .title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.topbar .who { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.content { flex: 1; overflow: auto; padding: 18px 20px 40px; }

/* ---------- 卡片 & 指标 ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-head .sub { color: var(--muted); font-size: 12px; font-weight: normal; margin-left: 6px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; cursor: default; position: relative; overflow: hidden; }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: var(--brand); }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.warn .value { color: var(--warn); }
.kpi.danger .value { color: var(--danger); }
.kpi.ok .value { color: var(--ok); }
.kpi.brand .value { color: var(--brand); }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.chart { width: 100%; height: 300px; }

/* ---------- 表格 & 工具条 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.filters .el-select, .filters .el-input { width: 170px; }
.filters .el-date-editor { width: 260px !important; }
.status-tabs { margin-bottom: 8px; }
.pager { display: flex; justify-content: flex-end; margin-top: 12px; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.money.neg { color: var(--danger); }
.money.pos { color: var(--ok); }
.prod-cell { display: flex; gap: 10px; align-items: center; }
.prod-cell .thumb { width: 44px; height: 44px; border-radius: 6px; background: #f0f2f5; flex-shrink: 0; object-fit: cover; border: 1px solid var(--line); }
.prod-cell .thumb.empty { display: flex; align-items: center; justify-content: center; color: #b0b8c3; font-size: 11px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.changed { color: var(--danger); font-size: 12px; cursor: pointer; }
.remark-cell { font-size: 12px; color: #5b6573; max-width: 180px; }

/* ---------- 详情 ---------- */
.kv { display: grid; grid-template-columns: 92px 1fr; row-gap: 8px; column-gap: 8px; font-size: 13px; }
.kv .k { color: var(--muted); }
.remark-item { padding: 10px 12px; border-radius: 8px; background: #f6f8fb; margin-bottom: 8px; }
.remark-item.internal { background: #fff7e6; border: 1px dashed #f0c36d; }
.remark-item .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.section-title { font-weight: 600; margin: 18px 0 10px; font-size: 14px; }

/* ---------- 产品 ---------- */
.img-list { display: flex; flex-wrap: wrap; gap: 8px; }
.img-item { width: 86px; height: 86px; border-radius: 8px; border: 1px solid var(--line); position: relative; overflow: hidden; background: #fafbfc; }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item .ops { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-around; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 3px 0; opacity: 0; transition: opacity .15s; }
.img-item:hover .ops { opacity: 1; }
.img-item .ops span { cursor: pointer; }
.img-item .main-flag { position: absolute; top: 4px; left: 4px; background: var(--brand); color: #fff; font-size: 11px; padding: 1px 5px; border-radius: 4px; }
.img-add { width: 86px; height: 86px; border-radius: 8px; border: 1px dashed #c0c7d1; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); cursor: pointer; font-size: 12px; }
.img-add:hover { border-color: var(--brand); color: var(--brand); }

.result-box { max-height: 260px; overflow: auto; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 12px; line-height: 1.8; }
.result-box .err { color: var(--danger); }
.result-box .warn { color: var(--warn); }
.balance-big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tip { background: #f0f6ff; border: 1px solid #cfe0fb; color: #3a5a8c; padding: 8px 12px; border-radius: 8px; font-size: 12px; line-height: 1.7; margin-bottom: 12px; }
.el-table .overdue-row { background: #fff8f0; }
.parse-box { background: #f6f9ff; border: 1px dashed #b9cff5; border-radius: 8px; padding: 10px; margin-bottom: 14px; }
.parse-box .parse-actions { display: flex; justify-content: flex-end; margin-top: 8px; gap: 6px; }
.pf-tag { display: inline-block; color: #fff; font-size: 11px; line-height: 18px; padding: 0 6px; border-radius: 4px; white-space: nowrap; }
.pf-radio { display: flex; flex-wrap: wrap; gap: 6px 0; }
/* 发货窗口：产品图 + 大字名称/数量，防止发错货 */
.ship-goods { display: flex; gap: 16px; align-items: center; padding: 12px; border: 2px solid #1f6feb; border-radius: 10px; margin-bottom: 12px; background: #fff; }
.ship-goods-img { width: 120px; height: 120px; border-radius: 8px; flex-shrink: 0; border: 1px solid var(--line); background: #f0f2f5; }
.ship-goods-img.empty { display: flex; align-items: center; justify-content: center; color: #9aa5b1; font-size: 13px; }
.ship-goods-info { min-width: 0; }
.ship-goods-name { font-size: 22px; font-weight: 700; line-height: 1.35; color: var(--ink); word-break: break-all; }
.ship-goods-spec { font-size: 16px; color: #374151; margin-top: 4px; }
.ship-goods-qty { font-size: 18px; margin-top: 8px; color: #374151; }
.ship-goods-qty b { font-size: 34px; color: #dc2626; vertical-align: -4px; margin: 0 2px; }
.ship-goods-qty span { font-size: 15px; color: #dc2626; }
.batch-qty { font-size: 22px; font-weight: 700; }
.batch-qty.multi { color: #dc2626; }
.ship-receiver { margin-top: 6px; display: grid; row-gap: 4px; }
.ship-receiver > div { display: flex; gap: 10px; align-items: baseline; }
.ship-receiver .k { flex-shrink: 0; width: 48px; color: #6b7785; font-size: 13px; }
.ship-receiver .v { font-size: 15px; color: #1d2733; font-weight: 600; word-break: break-all; }
