:root {
  --bg: #f3f5f2;
  --bg-deep: #e9ede7;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --ink: #17221f;
  --ink-soft: #34423e;
  --muted: #6e7a75;
  --muted-2: #98a29d;
  --line: #e2e7e1;
  --line-strong: #d3dad3;
  --brand: #14614f;
  --brand-dark: #0c493b;
  --brand-soft: #e7f2ed;
  --brand-softer: #f2f8f5;
  --amber: #b87322;
  --amber-soft: #fbf1e3;
  --danger: #b83a35;
  --danger-soft: #fbeceb;
  --blue: #2f5f8f;
  --blue-soft: #ebf2f9;
  --sidebar: #132823;
  --sidebar-soft: #1b352f;
  --shadow-sm: 0 1px 2px rgba(20, 34, 29, 0.04), 0 1px 3px rgba(20, 34, 29, 0.03);
  --shadow-md: 0 10px 30px rgba(22, 42, 35, 0.08);
  --shadow-lg: 0 24px 70px rgba(17, 34, 28, 0.18);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --num: "Bahnschrift", "DIN Alternate", "Segoe UI", "Microsoft YaHei UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { flex: none; }
[hidden] { display: none !important; }

.boot-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background:
    radial-gradient(600px 400px at 50% 0%, rgba(102, 167, 141, 0.1), transparent 70%),
    var(--bg);
  color: var(--muted);
  font-size: 13px;
}
.boot-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, #247663, #10503f);
  box-shadow: 0 14px 34px rgba(18, 79, 62, 0.2);
  font-size: 24px;
  font-weight: 800;
}
.boot-screen p { margin: 14px 0 0; }

/* ---------- 基础布局 ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  color: #eaf2ee;
  background:
    radial-gradient(420px 220px at 0% 0%, rgba(80, 154, 127, 0.16), transparent 60%),
    linear-gradient(180deg, #142a24 0%, #10221e 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  overflow-y: auto;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 9px 24px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #12352b;
  background: linear-gradient(145deg, #d8eee3, #9fd3bd);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 6px 16px rgba(0, 0, 0, 0.18);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -1px;
}
.brand-name {
  color: #f4faf7;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
.brand-sub {
  margin-top: 2px;
  color: #8eaaa0;
  font-size: 11px;
  letter-spacing: 2px;
}
.nav-group { margin-bottom: 16px; }
.nav-label {
  padding: 5px 12px 7px;
  color: #759189;
  font-size: 10.5px;
  letter-spacing: 1.8px;
  font-weight: 600;
}
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 2px 0;
  border: 0;
  border-radius: 9px;
  color: #bdcfc8;
  background: transparent;
  font-size: 13.5px;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.nav-item svg { opacity: 0.86; }
.nav-item:hover { color: #ffffff; background: rgba(255, 255, 255, 0.065); }
.nav-item.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(83, 170, 139, 0.26), rgba(83, 170, 139, 0.1));
  box-shadow: inset 2px 0 0 #75c6a6;
}
.nav-item.active svg { opacity: 1; color: #9fe0c6; }
.nav-item .nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #c7e8d9;
  color: #174638;
  font-size: 10.5px;
  font-weight: 700;
}
.sidebar-foot {
  margin-top: auto;
  padding: 16px 10px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: #77938a;
  font-size: 11px;
  line-height: 1.7;
}
.sidebar-foot strong { color: #a7c0b7; font-weight: 600; }
.sidebar-help {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 0;
  border: 0;
  color: #a9c6bb;
  background: none;
  font-size: 11.5px;
}
.sidebar-help:hover { color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.view, .view > *, .section-stack, .order-main, .order-summary { min-width: 0; }
.dashboard-grid > *, .dashboard-bottom > *, .report-grid > *, .settings-grid > * { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 14px 32px;
  background: rgba(243, 245, 242, 0.88);
  border-bottom: 1px solid rgba(214, 222, 214, 0.75);
  backdrop-filter: blur(14px);
}
.page-heading h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.4px;
  font-weight: 700;
}
.page-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.view {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 32px 64px;
  flex: 1;
}
.section-stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn:hover { background: #f7f9f6; border-color: #c4cec5; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible {
  outline: 2px solid #6fb99d;
  outline-offset: 2px;
}
.btn.primary {
  color: #fff;
  background: linear-gradient(180deg, #1b7160, #115746);
  border-color: #105443;
  box-shadow: 0 4px 12px rgba(17, 84, 67, 0.22);
}
.btn.primary:hover { background: linear-gradient(180deg, #207e6a, #12604e); border-color: #0d4d3e; }
.btn.danger { color: var(--danger); border-color: #ecc9c7; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); border-color: #e2aaa6; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(20, 97, 79, 0.07); border-color: transparent; }
.btn.sm { min-height: 30px; padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.lg { min-height: 44px; padding: 10px 20px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: #f0f4ef; color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn.sm { width: 27px; height: 27px; border-radius: 7px; }
.btn-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-row.right { justify-content: flex-end; }
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- 卡片 ---------- */
.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card.pad { padding: 20px; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head.no-border { border-bottom: 0; padding-bottom: 4px; }
.card-title { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.1px; }
.card-sub { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 12px 20px 18px; }
.card-foot { padding: 13px 20px; border-top: 1px solid var(--line); background: var(--surface-soft); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- 工作台 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  border-radius: 18px;
  color: #eaf7f1;
  background:
    radial-gradient(420px 180px at 88% 0%, rgba(157, 209, 184, 0.25), transparent 65%),
    linear-gradient(120deg, #164f42 0%, #133e35 62%, #183b32 100%);
  box-shadow: 0 14px 34px rgba(19, 71, 58, 0.16);
}
.hero::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -96px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(255, 255, 255, 0.025), 0 0 0 80px rgba(255, 255, 255, 0.018);
  pointer-events: none;
}
.hero-eyebrow { color: #92c9b4; font-size: 12px; letter-spacing: 1.2px; }
.hero h2 { margin: 5px 0 4px; color: #fff; font-size: 26px; letter-spacing: -0.7px; line-height: 1.25; }
.hero p { margin: 0; color: #b6d2c7; font-size: 12.5px; }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 9px; flex-wrap: wrap; }
.hero .btn { border-color: rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.09); color: #f4fbf8; box-shadow: none; }
.hero .btn:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.25); }
.hero .btn.light { background: #f4fbf8; color: #124f40; border-color: #f4fbf8; }
.hero .btn.light:hover { background: #fff; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--brand);
  background: var(--brand-soft);
}
.stat-icon.amber { color: var(--amber); background: var(--amber-soft); }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.red { color: var(--danger); background: var(--danger-soft); }
.stat-value {
  margin: 12px 0 2px;
  font-family: var(--num);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.stat-value .unit { margin-left: 3px; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stat-foot { color: var(--muted); font-size: 11.5px; display: flex; align-items: center; gap: 5px; }
.trend-up { color: var(--brand); }
.trend-down { color: var(--danger); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 16px;
}
.dashboard-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 16px;
}
.mini-chart { display: flex; align-items: flex-end; gap: 10px; height: 132px; padding: 4px 2px 0; }
.mini-chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.mini-chart-bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.mini-chart-bar {
  width: min(28px, 66%);
  min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #63af93, #27745f);
  transition: height 0.35s ease;
}
.mini-chart-bar.empty { background: #edf1ec; }
.mini-chart-label { color: var(--muted-2); font-size: 10px; white-space: nowrap; }
.mini-chart-value { color: var(--ink-soft); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.low-list { display: flex; flex-direction: column; gap: 1px; }
.low-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.low-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.low-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 9px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 13px;
  font-weight: 700;
}
.low-main { min-width: 0; flex: 1; }
.low-name { color: var(--ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.low-meta { color: var(--muted-2); font-size: 10.5px; }
.low-stock { color: var(--danger); font-family: var(--num); font-size: 13px; font-weight: 700; white-space: nowrap; }

.onboard {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border: 1px dashed #b9d3c6;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #f5fbf8, #fbfdf9);
}
.onboard-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 14px;
  color: var(--brand);
  background: #e3f1ea;
}
.onboard h3 { margin: 0 0 3px; font-size: 14.5px; }
.onboard p { margin: 0; color: var(--muted); font-size: 12.5px; }
.onboard .btn { margin-left: auto; }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.8px; }
.data-table th {
  padding: 10px 12px;
  color: var(--muted);
  background: #fafbf9;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.data-table th:first-child { padding-left: 20px; }
.data-table th:last-child { padding-right: 20px; }
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf0ec;
  vertical-align: middle;
}
.data-table td:first-child { padding-left: 20px; }
.data-table td:last-child { padding-right: 20px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 0.12s ease; }
.data-table tbody tr:hover { background: #fbfcfa; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .center { text-align: center; }
.data-table .strong { font-weight: 650; }
.data-table .muted { color: var(--muted); }
.data-table .row-actions { white-space: nowrap; text-align: right; }
.data-table.compact td { padding-top: 8px; padding-bottom: 8px; }
.table-empty { padding: 44px 20px !important; text-align: center; color: var(--muted); }
.data-table tfoot td { padding: 10px 12px; font-weight: 600; border-top: 2px solid var(--line); background: var(--surface-2, #fafafc); }
.data-table tfoot tr.total-row td { color: var(--ink); }
.cell-title { color: var(--ink); font-weight: 600; }
.cell-sub { margin-top: 1px; color: var(--muted-2); font-size: 10.5px; }
.code-text { font-family: "Cascadia Mono", "Consolas", var(--num); font-size: 11.5px; letter-spacing: 0.1px; color: var(--ink-soft); }
.mono { font-family: var(--num); font-variant-numeric: tabular-nums; }
.money { font-family: var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.strong { font-weight: 700; }
.delta-plus { color: var(--brand); }
.delta-minus { color: var(--danger); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 21px;
  padding: 1px 7px;
  border-radius: 6px;
  background: #f0f3ef;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.green { color: #17614e; background: #e5f3ed; }
.badge.amber { color: #96601c; background: #fbf0df; }
.badge.red { color: #a03833; background: #faeae9; }
.badge.blue { color: #2f5c89; background: #ebf2f9; }
.badge.gray { color: #6d7773; background: #eff2ee; }
.badge.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---------- 工具栏/筛选 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; z-index: 2; }
.search-box input { padding-left: 34px; width: 240px; }
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field-label { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.field .hint { color: var(--muted-2); font-size: 10.5px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]), select, textarea {
  width: 100%;
  min-height: 37px;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-size: 13px;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
input:hover, select:hover, textarea:hover { border-color: #bdc8c0; }
input:focus, select:focus, textarea:focus {
  border-color: #5fa68e;
  box-shadow: 0 0 0 3px rgba(40, 124, 99, 0.11);
}
input[readonly] { background: #f6f8f5; color: var(--muted); }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: #d88480; background: #fffafa; }
input::placeholder, textarea::placeholder { color: #a9b1ac; }
input[type="date"] { min-width: 132px; }
input[type="checkbox"] { accent-color: var(--brand); width: 15px; height: 15px; }
select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e7a75' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-grid .span-all { grid-column: 1 / -1; }
.checkbox-line { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 12.5px; cursor: pointer; }
.checkbox-line input { flex: none; }
.form-error {
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid #ecc9c7;
  border-radius: 8px;
  background: var(--danger-soft);
  color: #963b36;
  font-size: 12px;
  line-height: 1.55;
}

.tabs { display: inline-flex; padding: 3px; gap: 2px; background: #eaeee8; border-radius: 9px; }
.tab {
  padding: 6px 14px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
}
.tab.active { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(23, 34, 31, 0.1); }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.segmented button { padding: 6px 10px; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 11.5px; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }

/* ---------- 开单 ---------- */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 312px; align-items: start; gap: 16px; }
.order-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.order-summary { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 12px; }
.doc-meta { display: grid; grid-template-columns: 1.1fr 0.9fr 1.2fr 1.6fr; gap: 12px; }
.doc-no-wrap { display: flex; gap: 6px; }
.doc-no-wrap input { flex: 1; min-width: 0; }
.lines-card .card-head { align-items: center; }
.line-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.line-table th {
  padding: 9px 8px;
  color: var(--muted);
  background: #fafbf9;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.line-table td { padding: 5px 5px; border-bottom: 1px solid #edf0ec; vertical-align: top; }
.line-table th:first-child, .line-table td:first-child { padding-left: 16px; }
.line-table th:last-child, .line-table td:last-child { padding-right: 16px; }
.line-table input { min-height: 34px; padding: 5px 8px; border-color: #e0e5df; font-size: 12.5px; }
.line-table .col-idx { width: 32px; padding-top: 13px; color: var(--muted-2); font-family: var(--num); font-size: 11px; }
.line-table .col-code { width: 132px; }
.line-table .col-name { min-width: 184px; }
.line-table .col-stock { width: 92px; padding-top: 11px; color: var(--muted); font-family: var(--num); font-size: 11px; white-space: nowrap; }
.line-table .col-price { width: 112px; }
.line-table .col-qty { width: 98px; }
.line-table .col-amount { width: 110px; padding-top: 12px; text-align: right; font-family: var(--num); font-weight: 600; white-space: nowrap; }
.line-table .col-action { width: 42px; text-align: center; padding-top: 8px; }
.line-table .input-money { text-align: right; font-family: var(--num); }
.line-table .input-qty { text-align: right; font-family: var(--num); }
.line-table tr.row-unknown td { background: #fffdf8; }
.line-table tr.row-short td { background: #fffafa; }
.line-hint { margin-top: 2px; color: var(--danger); font-size: 9.5px; line-height: 1.2; }
.stock-ok { color: var(--muted-2); }
.stock-short { color: var(--danger); font-weight: 600; }
.line-actions { display: flex; align-items: center; gap: 9px; padding: 10px 16px; }
.summary-card { overflow: hidden; }
.summary-head { padding: 16px 18px 12px; border-bottom: 1px dashed var(--line); }
.summary-head h3 { margin: 0; font-size: 13px; }
.summary-head p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.summary-body { padding: 14px 18px; }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; color: var(--muted); font-size: 12px; }
.summary-row strong { color: var(--ink-soft); font-family: var(--num); font-weight: 600; }
.summary-total { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0 7px; border-top: 1px solid var(--line); margin-top: 7px; }
.summary-total span { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }
.summary-total strong { color: var(--brand); font-family: var(--num); font-size: 28px; line-height: 1.1; letter-spacing: -0.6px; }
.summary-foot { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.summary-note { padding: 9px 11px; border-radius: 8px; background: var(--brand-softer); color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.summary-note.warn { background: var(--amber-soft); color: #8b5a1c; }
.summary-note.danger { background: var(--danger-soft); color: #9c3732; }
.total-qty-line { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; background: #f8faf7; border-radius: 8px; color: var(--muted); font-size: 11.5px; }
.total-qty-line strong { color: var(--ink); font-family: var(--num); font-size: 14px; }

/* ---------- 空状态 ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 54px 20px; color: var(--muted); }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 15px; color: #7da393; background: #edf5f1; }
.empty-state h3 { margin: 0 0 4px; color: var(--ink-soft); font-size: 14px; }
.empty-state p { margin: 0 0 14px; max-width: 360px; font-size: 12px; line-height: 1.65; }
.empty-state.sm { padding: 28px 14px; }
.empty-state.sm .empty-icon { width: 40px; height: 40px; margin-bottom: 8px; }

/* ---------- 商品选择器 ---------- */
.picker-search { position: relative; margin-bottom: 10px; }
.picker-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; z-index: 2; }
.picker-search input { padding-left: 37px; height: 42px; }
.picker-list { max-height: 390px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.picker-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid #eff2ee; background: #fff; text-align: left; }
.picker-item:last-child { border-bottom: 0; }
.picker-item:hover { background: var(--brand-softer); }
.picker-item.selected { background: #edf7f2; }
.picker-check { width: 17px; height: 17px; display: grid; place-items: center; flex: none; border: 1.5px solid #c5d0c7; border-radius: 5px; color: transparent; }
.picker-item.selected .picker-check { color: #fff; background: var(--brand); border-color: var(--brand); }
.picker-main { min-width: 0; flex: 1; }
.picker-name { display: block; color: var(--ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-meta { display: block; margin-top: 1px; color: var(--muted-2); font-size: 10.5px; }
.picker-nums { text-align: right; color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.picker-nums strong { display: block; color: var(--ink-soft); font-family: var(--num); font-size: 12px; }
.picker-empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 12px; }

/* ---------- 报表 ---------- */
.report-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 20px; }
.report-period { color: var(--muted); font-size: 12px; }
.report-period strong { color: var(--ink); }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, 1fr); gap: 16px; }
.kpi-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.kpi-cell { padding: 16px 18px; border-right: 1px solid var(--line); }
.kpi-cell:last-child { border-right: 0; }
.kpi-label { color: var(--muted); font-size: 11.5px; }
.kpi-value { margin-top: 4px; font-family: var(--num); font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.kpi-value.green { color: var(--brand); }
.kpi-value.red { color: var(--danger); }
.kpi-sub { margin-top: 1px; color: var(--muted-2); font-size: 10.5px; }
.bar-track { height: 6px; border-radius: 3px; background: #edf1ec; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #4f9f85, #1b6c57); }
.bar-fill.amber { background: linear-gradient(90deg, #e0b16c, #bd7a2a); }
.report-row-bar { width: 110px; display: inline-flex; align-items: center; gap: 8px; }
.report-row-bar .bar-track { flex: 1; }
.report-note { color: var(--muted-2); font-size: 10.5px; line-height: 1.6; }
.donut-legend { display: flex; flex-direction: column; gap: 9px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.legend-item strong { margin-left: auto; color: var(--ink-soft); font-family: var(--num); }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.settings-section + .settings-section { margin-top: 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row h4 { margin: 0 0 2px; font-size: 12.5px; }
.setting-row p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.about-box { padding: 14px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; line-height: 1.8; }
.about-box strong { color: var(--ink-soft); }

/* ---------- 弹窗 ---------- */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 30px;
  background: rgba(13, 27, 22, 0.48);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  animation: fade-in 0.16s ease;
}
.modal {
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: modal-up 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}
.modal.lg { max-width: 900px; }
.modal.xl { max-width: 1080px; }
.modal.sm { max-width: 440px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; letter-spacing: -0.2px; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-body.flush { padding: 0; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: #fbfcfa; }
.modal-foot .left { margin-right: auto; }
.modal-close { color: var(--muted); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-up { from { opacity: 0; transform: translateY(12px) scale(0.99); } }

/* ---------- 提示 ---------- */
.toast-root { position: fixed; top: 18px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 240px;
  max-width: 380px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #1d2f29;
  color: #f1f8f5;
  box-shadow: 0 10px 30px rgba(10, 25, 20, 0.24);
  font-size: 12.5px;
  line-height: 1.5;
  pointer-events: auto;
  animation: toast-in 0.22s ease;
}
.toast.success { background: #185c49; }
.toast.error { background: #8f332e; }
.toast.warn { background: #81571e; }
.toast .toast-icon { flex: none; margin-top: 1px; }
.toast .toast-close { margin-left: auto; padding: 0 0 0 8px; border: 0; background: none; color: rgba(255, 255, 255, 0.65); }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } }

/* ---------- 保存状态 / 提示条 ---------- */
.save-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  box-shadow: none;
}
.save-status:hover { background: rgba(20, 97, 79, 0.06); }
.save-status .dot { width: 6px; height: 6px; border-radius: 50%; background: #83a495; }
.save-status.saving .dot { background: #d3a14c; animation: pulse 0.9s infinite ease-in-out; }
.save-status.saved .dot { background: #3f9b78; }
.save-status.error { color: var(--danger); background: var(--danger-soft); cursor: pointer; }
.save-status.error .dot { background: var(--danger); }
.save-status.conflict { color: #8f611c; background: var(--amber-soft); cursor: pointer; }
.save-status.conflict .dot { background: #b7791f; }
@keyframes pulse { 50% { opacity: 0.3; } }
.save-status .spin { width: 11px; height: 11px; border: 1.5px solid #d6b479; border-top-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #ecd7b8;
  border-radius: 10px;
  background: #fdf7ed;
  color: #7d551b;
  font-size: 12px;
  line-height: 1.55;
}
.banner.error { border-color: #ecc9c7; background: #fdf3f2; color: #973b36; }
.banner.info { border-color: #c9ded5; background: #f1f8f5; color: #285c4c; }
.banner strong { font-weight: 700; }
.banner .btn { margin-left: auto; flex: none; }

/* ---------- 单据详情/打印 ---------- */
.document-preview { padding: 26px 30px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 16px; border-bottom: 2px solid #26342f; }
.doc-company h3 { margin: 0 0 3px; font-size: 18px; letter-spacing: 0.5px; }
.doc-company p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.doc-title-wrap { text-align: right; }
.doc-title { font-size: 20px; font-weight: 700; letter-spacing: 4px; color: #24332e; }
.doc-no { margin-top: 3px; color: var(--muted); font-family: var(--num); font-size: 11px; }
.doc-meta-line { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 18px; padding: 13px 0; color: var(--muted); font-size: 11.5px; }
.doc-meta-line strong { color: var(--ink-soft); font-weight: 600; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.doc-table th { padding: 8px 8px; border: 1px solid #d9dfda; background: #f6f8f5; color: var(--ink-soft); font-weight: 600; text-align: left; }
.doc-table td { padding: 8px 8px; border: 1px solid #e3e7e2; }
.doc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.doc-totals { display: flex; justify-content: flex-end; padding-top: 12px; }
.doc-totals table { border-collapse: collapse; min-width: 260px; font-size: 11.5px; }
.doc-totals td { padding: 5px 8px; }
.doc-totals td:first-child { color: var(--muted); }
.doc-totals td:last-child { text-align: right; font-family: var(--num); font-weight: 600; }
.doc-totals tr.grand td { padding-top: 9px; border-top: 1px solid #26342f; font-size: 14px; }
.doc-totals tr.grand td:last-child { color: var(--brand); font-size: 18px; }
.doc-note { margin-top: 16px; padding-top: 11px; border-top: 1px dashed var(--line-strong); color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.doc-sign { display: flex; justify-content: space-between; gap: 30px; margin-top: 30px; color: var(--muted); font-size: 11px; }
.doc-sign span { flex: 1; border-top: 1px solid var(--line-strong); padding-top: 6px; }
.doc-stamp {
  display: inline-block;
  margin-top: 7px;
  padding: 4px 12px;
  border: 2px solid #b54a44;
  border-radius: 5px;
  color: #b54a44;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  transform: rotate(-5deg);
}

/* ---------- 打印 ---------- */
.print-area { display: none; }
@media print {
  @page { size: A4; margin: 12mm 11mm; }
  html, body { background: #fff !important; }
  .app-shell, #modal-root, #toast-root { display: none !important; }
  .print-area { display: block !important; }
  .print-doc { color: #111; font-family: var(--font); font-size: 10pt; }
  .print-doc .document-preview { padding: 0; border: 0; border-radius: 0; }
  .print-doc .doc-head { border-bottom: 2px solid #111; }
  .print-doc .doc-table th { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-doc .doc-title { color: #111; }
  .print-doc .doc-totals tr.grand td:last-child { color: #111; }
  .print-doc .doc-stamp { color: #a33; }
  .print-footer { margin-top: 10mm; color: #666; font-size: 8pt; text-align: center; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .dashboard-bottom, .report-grid, .settings-grid { grid-template-columns: 1fr; }
  .order-layout { grid-template-columns: minmax(0, 1fr) 292px; }
  .doc-meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 18px 9px 12px; }
  .brand { justify-content: center; padding: 0 0 18px; }
  .brand-text, .nav-label, .nav-item span:not(.nav-badge), .sidebar-foot { display: none; }
  .nav-item { justify-content: center; padding: 11px 8px; }
  .nav-item .nav-badge { position: absolute; margin-left: 19px; margin-top: -18px; }
  .nav-item { position: relative; }
  .topbar { padding: 12px 22px; }
  .view { padding: 20px 22px 50px; }
  .order-layout { grid-template-columns: 1fr; }
  .order-summary { position: static; }
  .doc-meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    padding: 9px 10px;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    z-index: 40;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .brand { padding: 0 8px 0 0; flex: none; }
  .brand-mark { width: 34px; height: 34px; font-size: 17px; }
  .nav-item {
    width: auto;
    flex: none;
    flex-direction: column;
    gap: 1px;
    min-width: 52px;
    padding: 7px 7px 5px;
    font-size: 10px;
    border-radius: 8px;
  }
  .nav-item span:not(.nav-badge) { display: block; }
  .nav-item .nav-badge { display: none; }
  .nav-group { display: flex; margin: 0; }
  .nav-label, .sidebar-foot { display: none; }
  .topbar { position: static; padding: 11px 14px; min-height: 64px; }
  .page-heading h1 { font-size: 18px; }
  .page-heading p { display: none; }
  .top-actions .btn span { display: none; }
  .top-actions .btn { padding: 8px 10px; }
  .view { padding: 14px 12px 40px; }
  .hero { padding: 20px; align-items: flex-start; flex-direction: column; }
  .hero h2 { font-size: 22px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .form-grid, .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .form-grid .span-2, .form-grid .span-3 { grid-column: auto; }
  .doc-meta { grid-template-columns: 1fr; }
  .toolbar { padding: 12px 14px; }
  .search-box input { width: 100%; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .search-box { width: 100%; }
  .card-head { padding: 14px 15px; }
  .card-body { padding: 14px 15px; }
  .data-table th:first-child, .data-table td:first-child { padding-left: 14px; }
  .data-table th:last-child, .data-table td:last-child { padding-right: 14px; }
  .line-table { min-width: 760px; }
  .lines-card .table-wrap { overflow-x: auto; }
  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 14px; }
  .modal-body { padding: 15px; }
  .modal-head { padding: 15px 16px 12px; }
  .modal-foot { padding: 11px 15px; }
  .document-preview { padding: 16px; }
  .doc-title { font-size: 17px; letter-spacing: 2px; }
  .doc-meta-line { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: 1fr 1fr; }
  .kpi-cell:nth-child(2) { border-right: 0; }
  .kpi-cell:nth-child(1), .kpi-cell:nth-child(2) { border-bottom: 1px solid var(--line); }
  .onboard { flex-wrap: wrap; }
  .onboard .btn { margin-left: 0; }
  .toast-root { left: 12px; right: 12px; top: 12px; }
  .toast { min-width: 0; max-width: none; width: 100%; }
}
@media (max-width: 480px) {
  .sidebar { flex-wrap: wrap; overflow: visible; gap: 2px; }
  .brand { display: none; }
  .nav-group { display: contents; }
  .nav-item { flex: 1 0 calc(25% - 4px); min-width: 0; padding: 6px 4px; font-size: 9.5px; gap: 2px; }
}
@media (max-width: 460px) {
  .stat-grid { grid-template-columns: 1fr; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
  .kpi-strip { grid-template-columns: 1fr; }
  .kpi-cell { border-right: 0; border-bottom: 1px solid var(--line); }
  .summary-total strong { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   礼盒协作版新增样式
   ============================================================ */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  background: var(--bg);
}
.login-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 56px 30px;
  color: #eaf7f1;
  background:
    radial-gradient(620px 420px at 12% 0%, rgba(104, 177, 148, 0.2), transparent 65%),
    radial-gradient(420px 280px at 92% 100%, rgba(217, 177, 132, 0.12), transparent 65%),
    linear-gradient(135deg, #173c32 0%, #102820 100%);
}
.login-brand::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -180px;
  width: 480px;
  height: 480px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 44px rgba(255,255,255,0.02), 0 0 0 96px rgba(255,255,255,0.014);
  pointer-events: none;
}
.login-brand .brand { padding: 0 0 40px; }
.login-brand-inner { position: relative; z-index: 1; max-width: 500px; }
.login-brand h1 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 46px;
  line-height: 1.22;
  letter-spacing: -1.6px;
  font-weight: 700;
}
.login-brand h1 span { color: #e8c39a; }
.login-brand p { max-width: 430px; margin: 0; color: #b8d2c8; font-size: 14px; line-height: 1.85; }
.login-points { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.login-points span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #d8e9e2;
  background: rgba(255,255,255,0.05);
  font-size: 11.5px;
}
.login-foot { position: relative; z-index: 1; color: #6f9285; font-size: 11px; letter-spacing: 0.4px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 36px 30px; }
.login-card { width: 100%; max-width: 390px; }
.login-eyebrow { margin-bottom: 8px; color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: 2.2px; }
.login-card h2 { margin: 0; font-size: 27px; letter-spacing: -0.7px; }
.login-sub { margin: 7px 0 24px; color: var(--muted); font-size: 12.5px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn.lg { margin-top: 8px; }
.login-card .form-error { margin-bottom: 12px; }
.login-tip { margin: 16px 0 0; color: var(--muted-2); font-size: 11px; line-height: 1.7; text-align: center; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.avatar {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(145deg, #2a8069, #12523f);
  font-size: 11px;
  font-weight: 700;
}
.user-chip-name { color: var(--ink-soft); font-size: 12px; font-weight: 600; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.task-list { display: flex; flex-direction: column; }
.task-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 4px;
  border: 0;
  border-bottom: 1px dashed var(--line);
  background: transparent;
  text-align: left;
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #fbfcfa; }
.task-icon {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 9px;
  color: var(--brand);
  background: var(--brand-soft);
}
.task-icon.amber { color: var(--amber); background: var(--amber-soft); }
.task-main { min-width: 0; flex: 1; }
.task-main strong { display: block; color: var(--ink-soft); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-main small { display: block; margin-top: 1px; color: var(--muted-2); font-size: 10.5px; }
.task-arrow { color: var(--muted-2); }
.pipeline-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.pipeline-label { width: 56px; flex: none; color: var(--muted); font-size: 11.5px; }
.pipeline-row .bar-track { flex: 1; }
.pipeline-row strong { width: 24px; text-align: right; font-family: var(--num); font-size: 11.5px; color: var(--ink-soft); }

.team-grid { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.team-card { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.avatar-big {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #2a8069, #12523f);
  font-size: 18px;
  font-weight: 700;
}
.team-strip { display: flex; align-items: center; gap: 4px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.avatar-mini {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin-left: -4px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #4e8b77;
  font-size: 10px;
  font-weight: 700;
}
.avatar-mini:first-child { margin-left: 0; }
.detail-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.detail-pill { display: inline-flex; align-items: center; gap: 7px; padding-right: 14px; border-right: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.detail-pill:last-child { border-right: 0; padding-right: 0; }
.detail-pill strong { color: var(--ink-soft); font-family: var(--num); font-size: 12px; }
.audit-mini { margin-top: 12px; color: var(--muted-2); font-size: 10.5px; text-align: right; }
.audit-table td { font-size: 12px; }
.audit-table td:last-child { color: var(--ink-soft); }

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 260px; padding: 30px 28px 24px; }
  .login-brand h1 { font-size: 32px; margin-bottom: 10px; }
  .login-brand p { font-size: 12.5px; }
  .login-brand .brand { padding-bottom: 24px; }
  .login-panel { padding: 32px 20px 50px; }
  .user-chip-name, .user-chip .badge { display: none; }
}
@media (max-width: 760px) {
  .login-brand { min-height: 0; padding: 20px; }
  .login-brand h1 { font-size: 25px; }
  .login-brand p, .login-points, .login-foot { display: none; }
  .login-brand .brand { padding: 0; }
  .login-panel { padding: 26px 18px 44px; }
  .login-card { max-width: 420px; }
  .top-actions { gap: 5px; }
  .user-chip { padding-right: 5px; }
  .detail-topline { gap: 6px; }
  .detail-pill { padding-right: 9px; }
}
@media (max-width: 480px) {
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; }
  .login-card h2 { font-size: 24px; }
}
@media print {
  .detail-topline, .audit-mini { display: none !important; }
}

.linked-box { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 9px; background: var(--surface-soft); }
.linked-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.linked-head strong { color: var(--ink-soft); font-size: 12px; }
.linked-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px 0; border: 0; border-bottom: 1px dashed var(--line); background: transparent; text-align: left; font-size: 11.5px; color: var(--muted); }
.linked-row:last-child { border-bottom: 0; }
.linked-row:hover { background: rgba(20,97,79,0.03); }
.linked-row strong { margin-left: auto; color: var(--ink-soft); font-family: var(--num); }

.doc-table-wrap { width: 100%; overflow-x: auto; }
.doc-title { white-space: nowrap; }
@media (max-width: 760px) {
  .doc-table { min-width: 620px; }
  .doc-title { font-size: 16px; letter-spacing: 1px; }
  .doc-company h3 { font-size: 16px; }
  .doc-head { gap: 12px; }
  .document-preview { overflow: hidden; }
  .doc-totals table { min-width: 0; width: 100%; }
}
@media print {
  .doc-table-wrap { overflow: visible !important; }
}

/* Excel 导入导出 */
.import-columns { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.import-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 28px 18px; border: 1.5px dashed #b9d3c6; border-radius: 12px; background: linear-gradient(145deg, #f7fbf9, #fbfdfb); text-align: center; transition: border-color .15s ease, background .15s ease; }
.import-drop.dragover { border-color: var(--brand); background: var(--brand-softer); }
.import-drop-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: var(--brand); background: var(--brand-soft); }
.import-drop strong { color: var(--ink-soft); font-size: 13px; }
.import-drop p { margin: 0 0 4px; color: var(--muted-2); font-size: 11px; }
.import-file-name { margin-top: 4px; color: var(--muted); font-size: 11.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.import-result-cell { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.import-result-cell span { display: block; color: var(--muted); font-size: 11.5px; }
.import-result-cell strong { display: block; margin-top: 3px; color: var(--ink); font-family: var(--num); font-size: 26px; line-height: 1.1; }
@media (max-width: 480px) { .import-result-grid { grid-template-columns: 1fr; } .import-result-cell { padding: 10px 12px; } .import-result-cell strong { font-size: 22px; } }

/* ---------- 可点击卡片 ---------- */
.stat-card.interactive {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.stat-card.interactive:hover { border-color: #c3dbcf; box-shadow: 0 6px 18px rgba(22, 42, 35, 0.08); transform: translateY(-1px); }
.stat-card.interactive:active { transform: translateY(0); }
.stat-card.interactive:focus-visible { outline: 2px solid #6fb99d; outline-offset: 2px; }

/* ---------- 筛选栏与条件 chips ---------- */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.filter-bar .search-box input { width: 250px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin-top: 2px; }
.filter-chips:empty { display: none; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid #cfe2d8;
  border-radius: 20px;
  background: #eef7f2;
  color: #1c5c48;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.filter-chip:hover { background: #e2f1ea; border-color: #b4d6c6; }
.filter-chip span { color: #7ba393; font-size: 12px; line-height: 1; }

/* ---------- 收款 / 付款流水 ---------- */
.payment-history { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.payment-history-title { margin-bottom: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.payment-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 11.5px;
}
.payment-row:last-child { border-bottom: 0; }
.payment-row .mono { color: var(--muted); white-space: nowrap; }
.payment-row strong { color: var(--ink); font-family: var(--num); font-size: 12.5px; white-space: nowrap; }
.payment-note { flex: 1; min-width: 0; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payment-row .icon-btn { flex: none; }

@media (max-width: 760px) {
  .filter-bar { padding: 10px 12px; }
  .filter-bar .search-box input { width: 100%; }
  .filter-bar .field { flex: 1 1 45%; }
  .filter-bar .field select,
  .filter-bar .field input { width: 100% !important; }
  .top-actions .save-status span:last-child { display: none; }
}

/* ---------- 分页条 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}
.pager-info { color: var(--muted-2); font-size: 11.5px; }
.pager-controls { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-controls .btn { min-width: 30px; padding: 4px 8px; }
.pager-num { min-width: 30px; }
.pager-size {
  margin-left: 6px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11.5px;
}
.pager-controls .btn:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 760px) {
  .pager { padding: 8px 12px; }
  .pager-controls { width: 100%; }
}

/* ---------- 批量收款 ---------- */
.col-check { width: 34px; text-align: center; padding-right: 0 !important; }
.col-check input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); }
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  background: #eef7f2;
  border-bottom: 1px solid var(--line);
}
.batch-info { color: #1c5c48; font-size: 12px; font-weight: 600; }
.batch-bar .btn { margin-left: 0; }
.batch-bar .btn.primary { margin-left: auto; }
.batch-quick {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
  padding: 8px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.batch-quick-split { color: var(--muted-2); font-size: 11.5px; }
.batch-table td, .batch-table th { padding-top: 6px; padding-bottom: 6px; }
tr.sale-row.selected { background: #f0f8f4; }
@media (max-width: 760px) {
  .batch-bar { padding: 8px 12px; flex-wrap: wrap; }
  .batch-bar .btn.primary { margin-left: 0; }
}

/* ---------- 客户联版式 ---------- */
.doc-customer {
  margin: 4px 0 10px;
  padding: 10px 14px;
  border: 1px solid #d9e8e0;
  border-radius: 8px;
  background: #f6fbf8;
}
.doc-customer-name { font-size: 17px; font-weight: 700; color: #143c30; letter-spacing: .02em; }
.doc-customer-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; font-size: 11.5px; color: #4a5c55; }
.doc-customer-addr { margin-top: 4px; font-size: 11.5px; color: #4a5c55; }
.customer-doc .doc-totals .grand td { font-size: 15px; font-weight: 700; }
.customer-doc .doc-table th, .customer-doc .doc-table td { font-size: 11.5px; }

/* ---------- 列表物流列 ---------- */
.logi-cell { max-width: 130px; }
.logi-co { font-size: 11.5px; font-weight: 600; color: var(--ink); }
.logi-cell .cell-sub { font-size: 10.5px; }

/* ---------- 详情物流条 ---------- */
.detail-logi { gap: 6px; }
.detail-logi .mono { font-size: 11px; }

/* ---------- 顶部分页条 ---------- */
.pager-top:empty { display: none; }
.pager-top .pager {
  border-top: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 18px;
}
.pager-top .pager-info { font-weight: 600; color: var(--ink-soft); }
@media (max-width: 760px) {
  .pager-top .pager { padding: 8px 12px; }
}

/* ---------- 即时校验 ---------- */
.input-error { border-color: var(--danger) !important; background: #fff6f6 !important; box-shadow: 0 0 0 2px rgba(200, 60, 60, .12); }

/* ---------- 销售单右键菜单 ---------- */
.context-menu {
  position: fixed;
  z-index: 3000;
  min-width: 180px;
  padding: 6px;
  border-radius: 10px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e5e5);
  box-shadow: 0 12px 32px rgba(20, 20, 30, .18);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.context-menu button {
  text-align: left;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink, #222);
  cursor: pointer;
}
.context-menu button:hover { background: var(--hover, #f4f4f6); }
.context-menu button.danger { color: var(--danger, #c33); }
.context-menu button.danger:hover { background: #fdf0f0; }

/* ---------- 采购状态下拉 / 右键二级菜单 ---------- */
.status-menu-wrap { position: relative; display: inline-flex; }
.status-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 2600;
  min-width: 150px;
  padding: 6px;
  border-radius: 10px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e5e5);
  box-shadow: 0 12px 32px rgba(20, 20, 30, .18);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.status-menu[hidden] { display: none; }
.status-menu button {
  text-align: left;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink, #222);
  cursor: pointer;
  white-space: nowrap;
}
.status-menu button:hover { background: var(--hover, #f4f4f6); }
.context-submenu { position: relative; }
.context-submenu > .submenu-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink, #222);
  cursor: pointer;
}
.context-submenu > .submenu-parent:hover { background: var(--hover, #f4f4f6); }
.submenu-arrow { color: var(--muted, #999); margin-left: 12px; }
.context-submenu-list {
  display: none;
  position: absolute;
  left: calc(100% + 2px);
  top: -6px;
  min-width: 140px;
  max-height: 60vh;
  overflow: auto;
  padding: 6px;
  border-radius: 10px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e5e5);
  box-shadow: 0 12px 32px rgba(20, 20, 30, .18);
  flex-direction: column;
  gap: 2px;
  z-index: 3100;
}
.context-submenu.open > .context-submenu-list { display: flex; }
.context-submenu-list button {
  text-align: left;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink, #222);
  cursor: pointer;
  white-space: nowrap;
}
.context-submenu-list button:hover { background: var(--hover, #f4f4f6); }
.context-submenu-list button:disabled { opacity: .45; cursor: default; }

/* ---------- 客户/商品搜索下拉 ---------- */
.combo { position: relative; }
.combo input { width: 100%; }
.combo-list {
  position: absolute;
  z-index: 60;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 280px;
  overflow: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e3e3e8);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(20, 20, 30, .16);
  padding: 4px;
}
.combo-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
}
.combo-item:hover { background: var(--hover, #f3f4f7); }
.combo-main { font-size: 13px; color: var(--ink, #222); }
.combo-sub { font-size: 11px; color: var(--muted, #888); }
.combo-empty { padding: 10px; font-size: 12px; color: var(--muted, #888); }
.product-search-combo { margin: 0 18px 8px; max-width: 420px; }

/* ---------- 智能识别结果（页面中间大区域） ---------- */
.parse-result {
  margin: 14px auto 4px;
  max-width: 560px;
  width: 100%;
  border: 1px solid #f0c9c9;
  background: #fff7f7;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(180, 40, 40, .08);
}
.parse-result-inner { display: flex; flex-direction: column; gap: 8px; }
.parse-result-title { font-size: 14px; font-weight: 700; color: #b02a2a; text-align: center; margin-bottom: 2px; }
.parse-error-row, .parse-warn-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.5; }
.parse-error-row { color: #b02a2a; }
.parse-warn-row { color: #9a6b00; }
.parse-error-row svg, .parse-warn-row svg { flex: none; margin-top: 2px; }

/* ---------- 表头排序 ---------- */
.data-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.data-table th.sortable:hover { color: var(--brand, #333); }
.data-table th.sort-asc::after { content: ' ▲'; font-size: 10px; }
.data-table th.sort-desc::after { content: ' ▼'; font-size: 10px; }

/* ---------- 列设置 ---------- */
.col-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 4px; border-bottom: 1px dashed var(--line, #eee); font-size: 13px; }
.col-setting-row:last-child { border-bottom: 0; }

/* ---------- 销售单悬停速览卡片 ---------- */
.sale-hover-card {
  position: fixed;
  z-index: 4000;
  width: 380px;
  max-height: 70vh;
  overflow: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e3e3e8);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(20, 20, 30, .22);
  padding: 12px 14px;
  font-size: 12px;
}
.hcard-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hcard-section { border-top: 1px dashed var(--line, #ececf1); padding-top: 8px; margin-top: 8px; }
.hcard-title { font-weight: 700; color: var(--ink-soft, #666); margin-bottom: 6px; font-size: 11px; letter-spacing: .04em; }
.hcard-table { width: 100%; border-collapse: collapse; }
.hcard-table th { text-align: left; font-size: 10px; color: var(--muted, #999); font-weight: 500; padding: 2px 4px; }
.hcard-table td { padding: 3px 4px; border-top: 1px solid #f4f4f7; }
.hcard-table .num { text-align: right; }
.hcard-total { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; color: var(--ink-soft, #555); }
.hcard-line { display: flex; gap: 10px; padding: 3px 0; line-height: 1.45; }
.hcard-line > span { width: 62px; flex: none; color: var(--muted, #999); }
.hcard-line > strong { font-weight: 500; color: var(--ink, #222); word-break: break-all; }
.hcard-address { white-space: normal; }
.hcard-foot { border-top: 1px dashed var(--line, #ececf1); margin-top: 8px; padding-top: 8px; display: flex; gap: 12px; color: var(--ink-soft, #555); flex-wrap: wrap; }

/* ---------- 销售单详情：客户与物流分列 ---------- */
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 10px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--line, #ececf1);
  border-radius: 12px;
  background: var(--surface-2, #fafafc);
}
.info-row { display: flex; align-items: baseline; gap: 8px; font-size: 12px; line-height: 1.5; min-width: 0; }
.info-row > span { width: 64px; flex: none; color: var(--muted, #999); }
.info-row > strong { font-weight: 500; color: var(--ink, #222); word-break: break-all; }
.info-row.span-2 { grid-column: 1 / -1; }
.info-address { white-space: normal; word-break: break-all; }

.sale-hover-card { user-select: text; cursor: auto; }
.global-hover-card { width: 360px; }
.global-hover-card .hcard-table th { width: 86px; vertical-align: top; }
.hcard-line .link-btn { margin-left: 6px; flex: none; }

/* ---------- 销售单列表：可拖动列宽 / 行高 ---------- */
#sale-table.metric-table { table-layout: fixed; }
#sale-table.metric-table th,
#sale-table.metric-table td {
  height: var(--sale-row-h, 44px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#sale-table.metric-table tbody tr.sale-row:hover { background: var(--hover, #f7f7fa); }
#sale-table th { position: relative; }
.col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
}
.col-resizer::after {
  content: '';
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 3px;
  width: 1px;
  background: transparent;
}
#sale-table th:hover .col-resizer::after { background: var(--brand, #c9c9d4); }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }
body.row-resizing, body.row-resizing * { cursor: row-resize !important; user-select: none !important; }
.row-height-handle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border: 1px dashed var(--line, #ddd);
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink-soft, #666);
  cursor: row-resize;
  user-select: none;
}
.row-height-handle em { font-style: normal; color: var(--brand, #333); }


/* 批量打印：每张单分页 */
@media print {
  #print-area .print-doc + .print-doc { page-break-before: always; break-before: page; }
}

/* ---------- 页内多窗口 ---------- */
.app-window {
  position: fixed;
  display: flex;
  flex-direction: column;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e3e3e8);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 15, 25, .28);
  overflow: hidden;
  resize: both;
  min-width: 320px;
  min-height: 240px;
}
.app-window-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  background: linear-gradient(180deg, #fafafd, #f2f2f8);
  border-bottom: 1px solid var(--line, #e8e8ef);
  cursor: move;
  user-select: none;
}
.app-window-head strong { font-size: 13px; }
.app-window-body { flex: 1; overflow: auto; padding: 0; }
.quick-window { display: flex; flex-direction: column; height: 100%; }
.quick-window .search-box { margin: 10px 12px 6px; }
.quick-window .search-box input { width: 100%; }
.quick-list { flex: 1; overflow: auto; padding: 4px 8px 8px; }
.quick-row { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.quick-row:hover { background: var(--hover, #f4f4f9); }
.quick-main { font-size: 13px; color: var(--ink, #222); }
.quick-sub { font-size: 11px; color: var(--muted, #8a8a96); }
.quick-side { font-size: 11px; color: var(--ink-soft, #667); }
.quick-empty { padding: 16px; text-align: center; color: var(--muted, #999); font-size: 12px; }
.quick-foot { padding: 6px 12px 10px; font-size: 11px; color: var(--muted, #999); border-top: 1px dashed var(--line, #eee); }

/* ---------- 顶部查询菜单 ---------- */
.quick-menu-wrap { position: relative; }
.quick-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 150px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e3e3e8);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(20, 20, 30, .16);
  padding: 5px;
  z-index: 2600;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quick-menu button { text-align: left; padding: 8px 10px; border: 0; background: transparent; border-radius: 7px; font-size: 12px; cursor: pointer; }
.quick-menu button:hover { background: var(--hover, #f4f4f9); }

/* ---------- 页内多标签 ---------- */
.tab-bar-slot { margin-bottom: 10px; }
.tab-bar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  border: 1px solid var(--line, #e3e3ea);
  border-bottom-color: transparent;
  border-radius: 10px 10px 0 0;
  background: var(--surface-2, #f7f7fb);
  font-size: 12px;
  color: var(--ink-soft, #666);
  cursor: pointer;
  white-space: nowrap;
  max-width: 240px;
}
.tab-item.active { background: var(--surface, #fff); color: var(--ink, #222); font-weight: 600; box-shadow: 0 -2px 0 var(--brand, #4a5cff) inset; }
.tab-item.dirty .tab-title::after { content: ' •'; color: var(--amber, #d68a00); }
.tab-title { overflow: hidden; text-overflow: ellipsis; }
.tab-close { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; color: var(--muted, #999); }
.tab-close:hover { background: rgba(0, 0, 0, .08); color: var(--ink, #222); }

/* v2.68：批量填物流里没识别出快递公司的行，标红提示手选 */
.batch-table tr.logi-unknown input.logi-company { border-color: var(--danger); background: #fff7f6; }

