/* 云仓 WMS 原型样式：企业管理系统风格，PC 优先，移动端可用。 */

:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --surface-3: #eef2f5;
  --ink: #17222b;
  --ink-2: #3d4a55;
  --muted: #6b7885;
  --muted-2: #8b96a1;
  --line: #e3e8ed;
  --line-strong: #cfd7de;
  --brand: #0f766e;
  --brand-600: #0d6a63;
  --brand-700: #0b5751;
  --brand-soft: #e6f2f0;
  --teal-line: #bcdcd8;
  --amber: #b45309;
  --amber-soft: #fdf3e3;
  --amber-line: #f0d5a8;
  --red: #b91c1c;
  --red-soft: #fdeceb;
  --red-line: #f3c6c3;
  --green: #15803d;
  --green-soft: #e9f5ec;
  --green-line: #bfe0c6;
  --blue: #1d4ed8;
  --blue-soft: #eaf0fe;
  --blue-line: #c5d4fb;
  --violet: #6d28d9;
  --violet-soft: #f1ecfe;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 32, .06);
  --shadow: 0 10px 28px rgba(16, 24, 32, .14);
  --sidebar-w: 244px;
  --topbar-h: 60px;
  --font: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
table { border-collapse: collapse; width: 100%; }
.icon { display: inline-block; vertical-align: -0.16em; flex: none; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.strong { font-weight: 600; }
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ---------- 布局 ---------- */
.layout { min-height: 100%; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.app-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.content { padding: 18px 22px 40px; flex: 1; }
.content-inner { max-width: 1520px; margin: 0 auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  min-height: var(--topbar-h);
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  flex: none;
}
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: 0; }
.brand-sub { font-size: 11px; color: var(--muted); line-height: 1.2; }
.brand-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { padding: 10px 10px 20px; overflow-y: auto; flex: 1; }
.nav-section { margin-top: 10px; }
.nav-section:first-child { margin-top: 0; }
.nav-title {
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: .04em;
}
.nav-item, .nav-group-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
}
.nav-item:hover, .nav-group-btn:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--brand-soft); color: var(--brand-700); font-weight: 600; }
.nav-item.active .icon, .nav-item:hover .icon { color: inherit; }
.nav-item .icon, .nav-group-btn .icon { color: var(--muted); }
.nav-item.active .icon { color: var(--brand); }
.nav-group-btn .chev { margin-left: auto; transition: transform .15s ease; color: var(--muted-2); }
.nav-group.open .chev { transform: rotate(180deg); }
.nav-sub { display: none; padding: 2px 0 4px 30px; }
.nav-group.open .nav-sub { display: block; }
.nav-sub .nav-item { padding: 5px 8px; font-size: 13px; border-left: 1px solid var(--line); border-radius: 0 6px 6px 0; }
.nav-sub .nav-item.active { border-left-color: var(--brand); }
.sidebar-foot {
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar .crumb { font-size: 13px; color: var(--muted); }
.topbar .crumb b { color: var(--ink); font-weight: 600; }
.global-search {
  position: relative;
  max-width: 320px;
  flex: 1 1 200px;
}
.global-search .icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.global-search input {
  width: 100%;
  height: 34px;
  padding: 0 34px 0 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--ink);
}
.global-search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 11px; color: var(--muted-2);
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; background: #fff;
}
.icon-btn {
  position: relative;
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); border: 1.5px solid #fff;
}
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  cursor: pointer;
}
.user-chip:hover { background: var(--surface-2); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-700);
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
  flex: none;
}
.user-meta { line-height: 1.15; }
.user-meta b { display: block; font-size: 12.5px; }
.user-meta span { font-size: 11px; color: var(--muted); }

/* ---------- 页面头 / 卡片 ---------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.page-head h1 { font-size: 20px; font-weight: 700; letter-spacing: 0; }
.page-head .desc { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.card-head h2 { font-size: 14px; font-weight: 650; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-body { padding: 14px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.kpi { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid.dash { grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); align-items: start; }
.grid.form-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.form-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 入库/出库录入页：单据区全宽，辅助信息置于下方两栏，避免明细表被挤压 */
body[data-page="inbound"] .content-inner > .grid,
body[data-page="outbound"] .content-inner > .grid {
  grid-template-columns: minmax(0, 1fr) !important;
}
body[data-page="inbound"] .content-inner > .grid > .grid:last-child,
body[data-page="outbound"] .content-inner > .grid > .grid:last-child {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body[data-page="inbound"] .line-table { min-width: 1120px !important; }
body[data-page="outbound"] .line-table { min-width: 1180px !important; }

/* KPI */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-ico { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.kpi-value { font-size: 22px; font-weight: 700; margin-top: 6px; letter-spacing: 0; }
.kpi-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi-foot { margin-top: 4px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.ico-teal { background: var(--brand-soft); color: var(--brand-700); }
.ico-amber { background: var(--amber-soft); color: var(--amber); }
.ico-red { background: var(--red-soft); color: var(--red); }
.ico-green { background: var(--green-soft); color: var(--green); }
.ico-blue { background: var(--blue-soft); color: var(--blue); }
.ico-violet { background: var(--violet-soft); color: var(--violet); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-danger { background: #fff; border-color: var(--red-line); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-soft { background: var(--brand-soft); border-color: var(--teal-line); color: var(--brand-700); }
.btn-soft:hover { background: #d9ebe8; color: var(--brand-700); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn-lg { height: 38px; padding: 0 16px; }
.btn-block { width: 100%; }
.btn-link { border: 0; background: transparent; color: var(--brand); padding: 0 4px; height: auto; }
.btn-link:hover { background: transparent; text-decoration: underline; }
.btn-link.danger { color: var(--red); }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field .req::after { content: " *"; color: var(--red); }
.input, select.input, textarea.input {
  width: 100%; height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-family: inherit;
  min-width: 0;
}
textarea.input { height: auto; padding: 7px 10px; resize: vertical; }
.input:focus, select.input:focus, textarea.input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.input:disabled, .input[readonly] { background: var(--surface-2); color: var(--muted); }
.input.is-invalid { border-color: var(--red); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-left: -1px; height: 34px; }
.hint { font-size: 11.5px; color: var(--muted); }
.error-text { font-size: 11.5px; color: var(--red); }
.checkline { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.checkline input { accent-color: var(--brand); }

.filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: end; }
.filters .filter-actions { display: flex; gap: 8px; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.radio-card {
  display: flex; gap: 9px; align-items: flex-start;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 10px 11px; background: var(--surface); cursor: pointer;
}
.radio-card:hover { border-color: var(--teal-line); background: var(--surface-2); }
.radio-card input { accent-color: var(--brand); margin-top: 2px; }
.radio-card.selected { border-color: var(--brand); background: var(--brand-soft); }
.radio-card b { display: block; font-size: 13px; }
.radio-card span { font-size: 11.5px; color: var(--muted); }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
table.data-table { font-size: 13px; min-width: 760px; }
table.data-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600; font-size: 12px; text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data-table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data-table tbody tr:hover { background: #fafcfc; }
table.data-table tbody tr:last-child td { border-bottom: 0; }
table.data-table td.num, table.data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data-table td.actions { white-space: nowrap; text-align: right; }
table.data-table tr.row-danger { background: var(--red-soft); }
table.data-table tr.row-warn { background: #fffaf1; }
table.data-table tr.row-flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: #ffe9a8; } 100% { background: transparent; } }
.cell-main { font-weight: 550; color: var(--ink); }
.cell-sub { font-size: 11.5px; color: var(--muted); }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.empty .icon { color: var(--muted-2); margin-bottom: 6px; }
.tfoot-total td { background: var(--surface-2); font-weight: 600; }

/* ---------- 徽标 / 状态 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.badge-teal { background: var(--brand-soft); color: var(--brand-700); border-color: var(--teal-line); }
.badge-green { background: var(--green-soft); color: var(--green); border-color: var(--green-line); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
.badge-red { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.badge-blue { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-line); }
.badge-violet { background: var(--violet-soft); color: var(--violet); border-color: #ddd2fb; }
.badge-gray { background: var(--surface-3); color: var(--muted); border-color: var(--line-strong); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; color: var(--ink-2);
}
.chip b { color: var(--ink); }
.dot-status { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ---------- 扫码 ---------- */
.scanner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--teal-line);
  background: linear-gradient(0deg, rgba(230, 242, 240, .55), rgba(230, 242, 240, .55));
  border-radius: var(--radius);
}
.scanner .scan-ico { width: 34px; height: 34px; border-radius: 7px; background: #fff; color: var(--brand); display: grid; place-items: center; border: 1px solid var(--teal-line); flex: none; }
.scanner .scan-input { flex: 1 1 auto; min-width: 0; }
.scanner .scan-input input { font-family: var(--mono); letter-spacing: .02em; }
.scanner .scan-state { font-size: 11.5px; color: var(--brand-700); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.scanner-hint { font-size: 11.5px; color: var(--muted); }
.barcode {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 2px 4px; background: #fff; border: 1px solid var(--line);
  border-radius: 3px; line-height: 1;
}
.barcode .bars {
  width: 74px; height: 20px;
  background-image: repeating-linear-gradient(90deg, #1b252e 0 1px, transparent 1px 3px, #1b252e 3px 5px, transparent 5px 6px, #1b252e 6px 8px, transparent 8px 11px, #1b252e 11px 12px, transparent 12px 14px);
}
.barcode .code { font-family: var(--mono); font-size: 9.5px; color: var(--muted); }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 14px; overflow-x: auto; }
.tab {
  border: 0; background: transparent; cursor: pointer;
  padding: 10px 12px; font-size: 13.5px; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand-700); font-weight: 600; border-bottom-color: var(--brand); }
a.tab { text-decoration: none; display: inline-block; }
a.tab:hover { text-decoration: none; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
.pager .pages { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 12.5px; cursor: pointer;
}
.page-btn:hover { background: var(--surface-3); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 弹窗 / 抽屉 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15, 23, 30, .42);
  display: none; align-items: flex-start; justify-content: center;
  padding: 44px 16px; overflow-y: auto;
}
.overlay.open { display: flex; }
.modal {
  width: 100%; max-width: 560px;
  background: var(--surface); border-radius: 10px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  animation: pop .12s ease-out;
}
.modal.lg { max-width: 820px; }
.modal.xl { max-width: 1040px; }
@keyframes pop { from { transform: translateY(-6px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; font-weight: 650; }
.modal-body { padding: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 10px 10px; flex-wrap: wrap; }

.overlay.drawer-overlay { justify-content: flex-end; padding: 0; align-items: stretch; }
.drawer {
  width: 100%; max-width: 460px; background: var(--surface);
  height: 100%; display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.drawer .modal-head { flex: none; }
.drawer .modal-body { flex: 1; overflow-y: auto; }
.drawer .modal-foot { flex: none; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; top: 16px; right: 16px; z-index: 120; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px 12px; font-size: 13px; animation: slide .16s ease-out;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
.toast .icon { margin-top: 1px; }
@keyframes slide { from { transform: translateX(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 进度 / 漏斗 ---------- */
.progress { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; min-width: 70px; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.progress.amber > span { background: var(--amber); }
.progress.red > span { background: var(--red); }
.progress.blue > span { background: var(--blue); }

.funnel { display: grid; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 64px 1fr 42px; align-items: center; gap: 9px; font-size: 12.5px; }
.funnel-bar { height: 22px; border-radius: 5px; background: var(--brand-soft); position: relative; overflow: hidden; }
.funnel-bar > i { position: absolute; inset: 0 auto 0 0; background: var(--brand); opacity: .22; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--line-strong); }
.tl-item { position: relative; padding: 0 0 14px 4px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -16px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand);
}
.tl-item.warn::before { border-color: var(--amber); }
.tl-item.red::before { border-color: var(--red); }
.tl-title { font-size: 13px; font-weight: 550; }
.tl-meta { font-size: 11.5px; color: var(--muted); }

/* ---------- 架构图 ---------- */
.arch { display: grid; gap: 10px; justify-items: center; padding: 6px 0; }
.arch-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; }
.arch-box {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); padding: 9px 14px; text-align: center; min-width: 130px;
}
.arch-box b { display: block; font-size: 13px; }
.arch-box span { font-size: 11.5px; color: var(--muted); }
.arch-box.core { border-color: var(--teal-line); background: var(--brand-soft); }
.arch-box.exchange { border-style: dashed; border-color: var(--amber-line); background: var(--amber-soft); }
.arch-arrow { color: var(--muted-2); font-size: 15px; line-height: 1; }
.arch-split { width: 70%; height: 16px; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); border-radius: 4px 4px 0 0; }

.provider-card { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 12px 13px; background: var(--surface); cursor: pointer; }
.provider-card:hover { border-color: var(--teal-line); background: var(--surface-2); }
.provider-card.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.provider-card .pc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.provider-card .pc-ico { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; }
.provider-card b { font-size: 13.5px; }
.provider-card p { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---------- 导入步骤 / 拖放区 ---------- */
.steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; }
.step .num { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 11px; background: #fff; }
.step.active { color: var(--brand-700); font-weight: 600; }
.step.active .num { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.done .num { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }
.step-sep { width: 18px; height: 1px; background: var(--line-strong); }
.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2); padding: 22px 16px; text-align: center; cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .icon { color: var(--brand); margin-bottom: 6px; }
.file-picked {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--green-line); background: var(--green-soft); border-radius: var(--radius);
}
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat-tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.stat-tile b { display: block; font-size: 20px; }
.stat-tile span { font-size: 11.5px; color: var(--muted); }
.stat-tile.ok b { color: var(--green); }
.stat-tile.warn b { color: var(--amber); }
.stat-tile.err b { color: var(--red); }

/* ---------- 单据录入 ---------- */
.line-table input.input { height: 30px; padding: 0 7px; font-size: 12.5px; }
.line-table select.input { height: 30px; padding: 0 6px; font-size: 12.5px; }
.doc-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.doc-meta b { color: var(--ink); font-family: var(--mono); }
.side-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.side-list li:last-child { border-bottom: 0; }
.callout { display: flex; gap: 9px; padding: 10px 12px; border-radius: var(--radius); font-size: 12.5px; border: 1px solid var(--line); background: var(--surface-2); }
.callout .icon { flex: none; margin-top: 1px; }
.callout.info { background: var(--blue-soft); border-color: var(--blue-line); color: #1e3a8a; }
.callout.warn { background: var(--amber-soft); border-color: var(--amber-line); color: #7c2d12; }
.callout.danger { background: var(--red-soft); border-color: var(--red-line); color: #7f1d1d; }
.callout.ok { background: var(--green-soft); border-color: var(--green-line); color: #14532d; }

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .grid.kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.dash { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15, 23, 30, .35); z-index: 35; }
  .app-main { margin-left: 0; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.form-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body[data-page="inbound"] .content-inner > .grid > .grid:last-child,
  body[data-page="outbound"] .content-inner > .grid > .grid:last-child { grid-template-columns: 1fr; }
  .content { padding: 14px 12px 32px; }
  .grid.kpi, .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.form-2, .grid.form-4, .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr 1fr; }
  .global-search { display: none; }
  .user-meta { display: none; }
  .topbar { gap: 8px; padding: 0 12px; }
  .page-head h1 { font-size: 18px; }
  .scanner { flex-wrap: wrap; }
  .scanner .scan-input { flex-basis: 100%; }
}
@media (max-width: 520px) {
  .grid.kpi, .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.form-2, .grid.form-4, .stat-tiles, .filters { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
}

@media print {
  .sidebar, .topbar, .page-actions, .toast-host, .overlay { display: none !important; }
  .app-main { margin-left: 0; }
  .card { box-shadow: none; }
  body { background: #fff; }
}

/* ---------- Razor 站点补充 ---------- */
.nav-item.disabled { color: var(--muted); cursor: pointer; opacity: .72; }
.nav-item.disabled:hover { background: var(--surface-3); color: var(--ink-2); }
.page-btn[aria-disabled="True"] { opacity: .45; pointer-events: none; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-errors { color: var(--red); font-size: 12.5px; }
.field-validation-error { color: var(--red); font-size: 11.5px; }
.input.input-validation-error { border-color: var(--red); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.detail-grid .detail-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); }
.detail-item .label { font-size: 11.5px; color: var(--muted); }
.detail-item .value { font-size: 14px; font-weight: 600; margin-top: 3px; word-break: break-all; }
.qty-change-positive { color: var(--green); font-weight: 600; }
.qty-change-negative { color: var(--red); font-weight: 600; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0f3f3b 0%, #0f766e 55%, #115e59 100%); padding: 24px; }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .28); padding: 28px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-brand .brand-mark { width: 40px; height: 40px; border-radius: 10px; }
.login-title { font-size: 20px; font-weight: 700; }
.login-sub { font-size: 12.5px; color: var(--muted); }
.login-hint { margin-top: 16px; padding: 10px 12px; border-radius: var(--radius); background: var(--brand-soft); border: 1px solid var(--teal-line); color: var(--brand-700); font-size: 12.5px; }
.login-footer { text-align: center; color: rgba(255, 255, 255, .75); font-size: 12px; margin-top: 16px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .detail-grid { grid-template-columns: 1fr; } }
