:root {
  --bg: #f2f5f5;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --line: #e2e8ea;
  --line-strong: #cfd9dd;
  --ink: #1b2529;
  --ink-2: #5c6c73;
  --ink-3: #86959d;
  --accent: #0f766e;
  --accent-dark: #0b5b55;
  --accent-soft: #e7f3f1;
  --blue: #2563eb;
  --blue-soft: #eaf1fe;
  --warn: #a45c0a;
  --warn-soft: #fdf4e3;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #16794c;
  --ok-soft: #e8f5ee;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(22, 36, 42, .05), 0 10px 28px rgba(22, 36, 42, .05);
  --sidebar-w: 224px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.lucide { width: 16px; height: 16px; flex: none; stroke-width: 1.8; }

[hidden] { display: none !important; }

/* ------------------------------ 布局 ------------------------------ */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 16px 12px 14px;
  background: #fbfcfc;
  border-right: 1px solid var(--line);
  flex: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, .22);
}

.brand-mark svg.lucide { width: 18px; height: 18px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: .2px; }
.brand-text small { color: var(--ink-3); font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  transition: background .15s, color .15s;
}

.nav-item:hover { background: #eff3f3; color: var(--ink); }

.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

.nav-item span { flex: 1; }

.nav-badge {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e5eaec;
  color: var(--ink-2);
  font-size: 11px;
  font-style: normal;
  text-align: center;
}

.nav-item.is-active .nav-badge { background: #fff; color: var(--accent-dark); }

.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }

.storage-info {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 4px 10px;
  color: var(--ink-3);
  font-size: 11px;
}

.storage-info svg.lucide { width: 14px; height: 14px; }

.foot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 62px;
  padding: 0 22px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.topbar-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.crumb { font-size: 15px; font-weight: 650; }
.crumb-sub { color: var(--ink-3); font-size: 11px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.mobile-menu { display: none; }

.content { padding: 18px 22px 40px; }

.view { display: none; }
.view.is-active { display: block; animation: fade-in .18s ease; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------ 通用组件 ------------------------------ */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
}

.panel-head h2 { margin: 0; font-size: 14px; font-weight: 650; }
.panel-sub { margin: 2px 0 0; color: var(--ink-3); font-size: 11px; }
.head-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}

.btn:hover { background: var(--surface-soft); border-color: #b9c5ca; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg.lucide { width: 15px; height: 15px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-danger { background: #fff; border-color: #eeb4ae; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }

.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #eef2f3; border-color: transparent; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
}

.icon-btn:hover { background: #eef2f3; color: var(--ink); }
.icon-btn-danger:hover { background: var(--danger-soft); color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { color: var(--ink-2); font-size: 11.5px; font-weight: 550; }

.field input,
.field select,
.field textarea,
.select,
.search-box input {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.select:focus,
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}

.field input[readonly] { background: var(--surface-soft); color: var(--ink-2); }
.field textarea { resize: vertical; min-height: 34px; line-height: 1.5; }
.field-wide { grid-column: 1 / -1; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}

.badge-teal { background: var(--accent-soft); color: var(--accent-dark); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-partial { background: #fdf3e2; color: #b45309; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: #eef2f3; color: var(--ink-2); }

.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(15, 118, 110, .25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.spinner-lg { width: 20px; height: 20px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 180px;
  padding: 22px;
  color: var(--ink-3);
  text-align: center;
}

.empty-state svg.lucide { width: 24px; height: 24px; color: #a9b7bd; }
.empty-state strong { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.empty-state span { font-size: 12px; }
.empty-state-tall { min-height: 220px; }
.empty-inline { padding: 16px; color: var(--ink-3); font-size: 12px; text-align: center; }

/* ------------------------------ 上传与队列 ------------------------------ */

.intake-top {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.upload-panel { padding-bottom: 14px; }
.upload-panel .field { margin: 0 16px 12px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 16px;
  padding: 22px 16px;
  border: 1.5px dashed #bfcdd2;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink-2);
  text-align: center;
  outline: none;
  transition: border-color .15s, background .15s, transform .15s;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone.is-drag { transform: scale(1.01); }
.dropzone strong { color: var(--ink); font-size: 13px; }
.dropzone small { color: var(--ink-3); font-size: 11.5px; }

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(22, 36, 42, .08);
}

.dropzone-icon svg.lucide { width: 19px; height: 19px; }

.upload-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 16px 0;
  color: var(--ink-3);
  font-size: 11px;
}

.upload-note svg.lucide { width: 14px; height: 14px; color: var(--ok); }

.queue-panel { min-height: 296px; }
.queue-list { display: flex; flex-direction: column; gap: 6px; max-height: 420px; padding: 0 10px 12px; overflow: auto; }

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  text-align: left;
  transition: border-color .15s, background .15s;
}

.queue-item:hover { border-color: #b9c5ca; background: var(--surface-soft); }
.queue-item.is-active { border-color: var(--accent); background: var(--accent-soft); }

.queue-item-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #f0f4f5;
  color: var(--ink-2);
  flex: none;
}

.queue-item.is-active .queue-item-icon { background: #fff; color: var(--accent-dark); }

.queue-item-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.queue-item-title { overflow: hidden; font-weight: 620; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.queue-item-sub { overflow: hidden; color: var(--ink-2); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.queue-item-file { overflow: hidden; color: var(--ink-3); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.queue-item-side { display: flex; align-items: center; gap: 4px; color: var(--ink-3); flex: none; }
.queue-item-side svg.lucide { width: 14px; height: 14px; }

/* ------------------------------ 编辑器 ------------------------------ */

.editor-panel { margin-top: 16px; }
.editor-body { padding: 0 16px 18px; }

.warn-strip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 16px 12px;
  padding: 9px 11px;
  border: 1px solid #f3d9a6;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
}

.warn-strip svg.lucide { width: 15px; height: 15px; margin-top: 1px; }
.warn-strip div { display: flex; flex-direction: column; gap: 2px; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 4px 0 14px;
}

.mapping-panel {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.mapping-panel summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 550;
  list-style: none;
  cursor: pointer;
}

.mapping-panel summary::-webkit-details-marker { display: none; }
.mapping-panel summary svg.lucide { width: 15px; height: 15px; }
.mapping-panel summary em { margin-left: 2px; color: var(--ink-3); font-size: 11px; font-style: normal; font-weight: 400; }
.mapping-panel summary svg.lucide:last-child { margin-left: auto; transition: transform .15s; }
.mapping-panel[open] summary svg.lucide:last-child { transform: rotate(180deg); }

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 2px 11px 12px;
}

.field-compact input,
.field-compact select { padding: 6px 8px; font-size: 12px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 9px;
}

.section-head h3 { display: inline; margin: 0; font-size: 13.5px; font-weight: 650; }
.section-head-tight { padding-top: 4px; }
.section-sub { margin-left: 7px; color: var(--ink-3); font-size: 11.5px; }

.items-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.items-table, .mini-table, .data-table { width: 100%; border-collapse: separate; border-spacing: 0; }

.items-table th,
.mini-table th,
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 9px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.items-table td,
.mini-table td {
  padding: 5px 7px;
  border-bottom: 1px solid #edf1f2;
  vertical-align: top;
}

.items-table tfoot td,
.mini-table tfoot td {
  border-top: 1px solid var(--line-strong);
  background: var(--surface-soft);
  font-weight: 650;
}

.items-table tr:last-child td,
.mini-table tr:last-child td { border-bottom: 0; }

.items-table input,
.items-table textarea,
.items-table select {
  width: 100%;
  padding: 6px 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  outline: none;
  resize: none;
  line-height: 1.45;
}

.items-table input:hover,
.items-table textarea:hover,
.items-table select:hover { background: var(--surface-soft); }
.items-table input:focus,
.items-table textarea:focus,
.items-table select:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 2px rgba(15, 118, 110, .09); }
.items-table textarea { overflow: hidden; }
.kind-combo { position: relative; display: flex; align-items: center; min-width: 0; }
.kind-combo input { padding-right: 24px !important; }
.kind-combo select {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 26px;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
.kind-combo::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-3);
  transform: translateY(-35%);
  pointer-events: none;
}

.col-seq { width: 42px; }
.col-image { width: 56px; }
.col-factory { width: 118px; min-width: 100px; }
.col-customer { width: 106px; min-width: 92px; }
.col-surface { width: 92px; }
.col-kind { width: 92px; }
.col-spec { width: 122px; min-width: 108px; }
.col-qty { width: 78px; }
.col-cut { width: 150px; min-width: 130px; }
.col-req { width: 126px; min-width: 106px; }
.col-remark { width: 230px; min-width: 200px; }
.col-attention { width: 126px; min-width: 106px; }
.col-op { width: 36px; text-align: center; }
.col-file { width: 128px; white-space: nowrap; }
.approval-cell { white-space: nowrap; }
.approval-cell .badge + .btn { margin-left: 6px; }
.approval-change {
  display: block; max-width: 240px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; color: var(--warn);
}
.order-change-banner {
  display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px;
  padding: 10px 12px; background: var(--warn-soft);
  border: 1px solid #efd5a6; border-radius: var(--radius-sm); color: var(--warn);
}
.order-change-banner strong { font-size: 13px; }
.order-change-banner span { font-size: 12px; color: var(--ink-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.items-table { table-layout: fixed; min-width: 1160px; }
.items-table td.col-attention[rowspan],
.mini-table td:last-child[rowspan] { vertical-align: middle; }
.items-table td.col-remark[rowspan],
.mini-table td.col-remark[rowspan] { vertical-align: middle; }

.image-cell {
  position: relative;
  width: 46px;
  height: 46px;
  margin: 0 auto;
}

.image-empty { color: var(--ink-3); text-align: center; }

.thumb-btn {
  display: block;
  width: 46px;
  height: 46px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.thumb-btn:hover { border-color: var(--accent); }
.thumb-btn img { display: block; width: 100%; height: 100%; object-fit: cover; }
.req-thumb { width: 88px; height: 60px; margin: 4px auto; background: #fff; cursor: zoom-in; }
.req-thumb img { object-fit: contain; }
.items-table td.col-req[rowspan],
.mini-table td.col-req[rowspan] { vertical-align: middle; }

.image-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-3);
  font-size: 9px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.image-add:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.image-add svg.lucide { width: 14px; height: 14px; }

.image-actions {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: flex;
  gap: 2px;
}

.thumb-action {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
}

.thumb-action:hover { border-color: var(--accent); color: var(--accent-dark); }
.thumb-action-danger:hover { border-color: #eeb4ae; color: var(--danger); }
.thumb-action svg.lucide { width: 10px; height: 10px; }

.notes-field { margin-top: 14px; }

/* ------------------------------ 订单列表 ------------------------------ */

.stats-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
#ordersStats { grid-template-columns: minmax(220px, 340px); }

.stat-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-dark);
  flex: none;
}

.stat-card strong { display: block; font-size: 19px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-card span:not(.stat-icon) { display: block; color: var(--ink-2); font-size: 12px; }
.stat-card small { display: block; color: var(--ink-3); font-size: 10.5px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.toolbar-spacer { flex: 1; }
.select { width: auto; min-width: 128px; padding: 6px 9px; font-size: 12px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  width: min(320px, 34vw);
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink-3);
}

.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 118, 110, .1); }
.search-box svg.lucide { width: 15px; height: 15px; }
.search-box input { padding: 7px 0; border: 0; box-shadow: none !important; background: transparent; }

.table-wrap { overflow: auto; }
.data-table { min-width: 940px; }
.production-table { min-width: 1160px; }
.production-table td { vertical-align: top; }
.production-table .col-production-model,
.shipping-table .col-production-model {
  min-width: 140px;
  text-align: center;
  white-space: nowrap;
}
.production-table .production-column-row td:first-child,
.shipping-table .production-column-row td:first-child { text-align: center; }
.production-status-select { min-width: 96px; }
.production-qty-input.is-derived,
.production-rolls-input.is-derived { background:#f3f7f8; color:var(--ink-2); cursor:default; }
.production-qty-input,
.production-rolls-input,
.production-batch-input,
.shipping-batch-input,
.production-note-input {
  width: 100%;
  padding: 6px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
}
.production-qty-input { min-width: 90px; text-align: right; }
.production-rolls-input { min-width: 72px; text-align: right; }
.production-batch-input,
.shipping-batch-input { min-width: 110px; }
.production-note-input { min-width: 160px; }
.production-order-row td {
  padding: 0 !important;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  box-shadow: inset 4px 0 0 #d6e3e6;
}
.production-salesperson-row td {
  padding: 0 !important;
  border-top: 2px solid #a8cbc6;
  border-bottom: 2px solid #a8cbc6;
  background: #dcebea;
  box-shadow: inset 5px 0 0 var(--accent);
}
.production-salesperson-row { cursor: pointer; }
.production-salesperson-row:hover td { background: #d2e5e2; }
.production-salesperson-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 13px 16px;
}
.production-salesperson-head strong { color: var(--accent-dark); font-size: 15px; font-weight: 750; }
.production-salesperson-head span { color: var(--ink-2); font-size: 12px; font-weight: 650; }
.production-order-row { cursor: pointer; }
.production-order-row:hover td { background: #f7fafb; }
.production-toggle-icon { display: inline-flex; align-items: center; color: var(--ink-3); }
.production-toggle-icon svg.lucide { width: 16px; height: 16px; }
.production-order-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 11px 14px 11px 28px;
}
.production-order-field { display: flex; align-items: baseline; gap: 7px; }
.production-order-field strong { color: var(--ink-3); font-size: 12px; font-weight: 650; }
.production-order-field span { color: var(--ink); font-size: 14px; font-weight: 700; }
.production-order-field .production-order-status { padding: 2px 9px; border-radius: 999px; font-size: 13px; }
.production-order-status.is-completed { background: var(--ok-soft); color: var(--ok); }
.production-order-status.is-partial { background: #fdf3e2; color: #b45309; }
.production-order-status.is-pending { background: #eef2f3; color: var(--ink-2); }
.shipping-pending-negative { color: #c0392b; font-weight: 700; }
.production-column-row td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.production-column-row td.num { text-align: right; }
.production-total-row td {
  padding: 9px 10px;
  border-top: 1px solid var(--line-strong);
  background: #fbfdfd;
  color: var(--ink-2);
  font-weight: 650;
}
.production-total-value { color: var(--accent-dark) !important; font-size: 15px; }
.shipping-meters-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.shipping-detail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
}
.shipping-detail-toggle:hover { text-decoration: underline; }
.shipping-detail-toggle svg.lucide { width: 12px; height: 12px; }
.shipping-total-weight { white-space: nowrap; }
.shipping-weight-input {
  width: 120px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  text-align: right;
}
.shipping-weight-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .1);
}
.shipping-detail-row td {
  padding: 0 !important;
  border-bottom: 1px solid var(--line);
  background: #fbfdfd;
}
.shipping-detail-panel { padding: 10px 12px; overflow-x: auto; }
.shipping-detail-head,
.shipping-detail-item {
  display: grid;
  grid-template-columns: 112px 140px 96px 76px minmax(150px, 1fr) 36px;
  align-items: center;
  gap: 8px;
}
.shipping-detail-panel.has-width .shipping-detail-head,
.shipping-detail-panel.has-width .shipping-detail-item {
  grid-template-columns: 112px 140px 110px 96px 76px minmax(150px, 1fr) 36px;
}
.production-detail-panel:not(.has-width) .shipping-detail-head,
.production-detail-panel:not(.has-width) .shipping-detail-item {
  grid-template-columns: 96px 76px minmax(150px, 1fr) 36px;
}
.production-detail-panel.has-width .shipping-detail-head,
.production-detail-panel.has-width .shipping-detail-item {
  grid-template-columns: 110px 96px 76px minmax(150px, 1fr) 36px;
}
.shipping-only-detail-panel:not(.has-width) .shipping-detail-head,
.shipping-only-detail-panel:not(.has-width) .shipping-detail-item {
  grid-template-columns: 112px 96px 76px minmax(150px, 1fr) 36px;
}
.shipping-only-detail-panel.has-width .shipping-detail-head,
.shipping-only-detail-panel.has-width .shipping-detail-item {
  grid-template-columns: 112px 110px 96px 76px minmax(150px, 1fr) 36px;
}
.shipping-detail-head { margin-bottom: 6px; color: var(--ink-3); font-size: 11px; }
.shipping-detail-item { margin-bottom: 6px; }
.shipping-detail-item input {
  width: 100%;
  padding: 6px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  text-align: right;
}
.shipping-detail-item input[data-shipping-detail-field="date"],
.shipping-detail-item input[data-shipping-detail-field="batchNo"],
.shipping-detail-item input[data-shipping-detail-field="note"],
.shipping-detail-item input[data-production-detail-field="date"],
.shipping-detail-item input[data-production-detail-field="batchNo"],
.shipping-detail-item input[data-production-detail-field="note"],
.shipping-detail-panel.has-width .shipping-detail-item input[data-shipping-detail-field="width"],
.shipping-detail-panel.has-width .shipping-detail-item input[data-production-detail-field="width"] { text-align: left; }
.shipping-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.production-qty-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.data-table th { padding: 9px 12px; }

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #edf1f2;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tbody tr { cursor: pointer; transition: background .12s; }
.data-table tbody tr:hover { background: var(--surface-soft); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .col-op { width: 48px; }

.cell-strong { display: block; font-weight: 620; }
.cell-sub { display: block; max-width: 210px; overflow: hidden; color: var(--ink-3); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }

.table-foot { padding: 9px 14px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 11.5px; }

/* ------------------------------ 数据概览 ------------------------------ */

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }

.kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-dark);
  flex: none;
}

.kpi strong { display: block; font-size: 20px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi span:not(.kpi-icon) { display: block; color: var(--ink-2); font-size: 12px; }
.kpi small { display: block; color: var(--ink-3); font-size: 10.5px; }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chart-panel { min-height: 260px; }

.bars { display: flex; flex-direction: column; gap: 11px; padding: 4px 16px 18px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(70px, 1.5fr) 62px; align-items: center; gap: 9px; }
.bar-label { display: flex; justify-content: space-between; gap: 6px; min-width: 0; }
.bar-label span { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.bar-label small { color: var(--ink-3); font-size: 10.5px; white-space: nowrap; }
.bar-track { height: 8px; overflow: hidden; border-radius: 999px; background: #edf1f2; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #149087, #0f766e); }
.bar-value { color: var(--ink-2); font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; }

.dashboard-section .section-head { padding: 0 0 12px; }
.dashboard-groups { display: flex; flex-direction: column; gap: 16px; }
.dashboard-salesperson {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.dashboard-salesperson-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
}
.dashboard-salesperson-head strong { color: var(--accent-dark); font-size: 15px; }
.dashboard-salesperson-head > div,
.dashboard-month-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--ink-2); font-size: 12px; }
.dashboard-salesperson-head > div span,
.dashboard-month-head span { padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .75); }
.dashboard-month { border-top: 1px solid var(--line); }
.dashboard-month:first-of-type { border-top: 0; }
.dashboard-month-head { justify-content: flex-start; padding: 10px 16px; background: #fbfcfd; }
.dashboard-month-head strong { margin-right: 4px; font-size: 13px; }
.dashboard-table-wrap { overflow: auto; }
.dashboard-table { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; }
.dashboard-table th,
.dashboard-table td { padding: 10px 12px; border-bottom: 1px solid #edf2f4; text-align: center; white-space: nowrap; }
.dashboard-table th { background: #f6f9fa; color: var(--ink-2); font-size: 11.5px; font-weight: 650; }
.dashboard-table tbody tr:nth-child(even) td { background: #fbfcfd; }
.dashboard-table tbody tr:last-child td { border-bottom: 0; }
.dashboard-table .cell-strong { color: var(--ink); }

.recent-list { display: flex; flex-direction: column; gap: 4px; padding: 2px 10px 12px; }

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
}

.recent-item:hover { background: var(--surface-soft); }
.recent-main { display: flex; flex-direction: column; min-width: 0; }
.recent-main strong { overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.recent-main small, .recent-side small { color: var(--ink-3); font-size: 11px; }
.recent-side { display: flex; flex-direction: column; align-items: flex-end; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------ 抽屉 ------------------------------ */

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 32, 37, .34);
  opacity: 0;
  transition: opacity .18s;
}

.drawer-mask.is-open { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(1120px, 96vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 36px rgba(20, 32, 37, .14);
  transform: translateX(100%);
  transition: transform .2s ease;
}

.drawer.is-open { transform: none; }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 12px; }
.drawer-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.drawer-body { flex: 1; padding: 15px 18px 18px; overflow: auto; }

.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.detail-item { padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.detail-item span { display: block; color: var(--ink-3); font-size: 10.5px; }
.detail-item strong { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 600; }

.mini-table { table-layout: fixed; min-width: 1060px; }
.mini-table td { font-size: 12px; }
.mini-table th { padding: 7px 9px; }

.notes-block { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.notes-block p { margin: 4px 0 0; color: var(--ink); font-size: 12.5px; line-height: 1.65; }

.source-line { display: flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--ink-3); font-size: 11px; }
.source-line svg.lucide { width: 14px; height: 14px; }

.drawer-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.foot-spacer { flex: 1; }
.meta-grid-drawer { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 16px; }

/* ------------------------------ 提示 ------------------------------ */

.toast-wrap {
  position: fixed;
  left: calc(var(--sidebar-w) + 18px);
  bottom: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  max-width: 360px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 32, 37, .14);
  color: var(--ink);
  font-size: 12.5px;
  animation: toast-in .18s ease;
}

.toast svg.lucide { color: var(--ok); }
.toast-error svg.lucide { color: var(--danger); }
.toast.is-out { opacity: 0; transform: translateY(5px); transition: opacity .4s, transform .4s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 20, 24, .74);
  opacity: 0;
  transition: opacity .18s;
}

.lightbox.is-open { opacity: 1; }
.lightbox img {
  max-width: min(760px, 92vw);
  max-height: 84vh;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .32);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.lightbox-close:hover { background: rgba(255, 255, 255, .24); color: #fff; }

/* ------------------------------ 内网共享版 ------------------------------ */

.shared-login {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 28, 33, .46);
  backdrop-filter: blur(5px);
}

.shared-login-card {
  width: min(380px, 94vw);
  padding: 26px 24px 20px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(10, 22, 27, .24);
}

.shared-login-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
}

.shared-login-mark svg.lucide { width: 20px; height: 20px; }
.shared-login-card h1 { margin: 0; font-size: 19px; line-height: 1.3; }
.shared-login-card > p { margin: 5px 0 18px; color: var(--ink-2); font-size: 12px; }

.shared-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.shared-field span,
.shared-user-form label span { color: var(--ink-2); font-size: 11.5px; font-weight: 550; }

.shared-field input,
.shared-user-form input,
.shared-user-form select {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
}

.shared-field input:focus,
.shared-user-form input:focus,
.shared-user-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}

.shared-login-error {
  min-height: 18px;
  margin: 2px 0 8px;
  color: var(--danger);
  font-size: 12px;
}

.shared-login-submit { width: 100%; justify-content: center; }
.shared-login-foot { margin-top: 14px; color: var(--ink-3); font-size: 11px; text-align: center; }

.shared-userbar {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-strong);
}

.shared-user-name {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-user-actions { display: flex; flex-wrap: wrap; gap: 5px; }

.shared-modal {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 28, 33, .42);
}

.shared-modal-card {
  width: min(620px, 95vw);
  max-height: min(720px, 88vh);
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(10, 22, 27, .24);
}

.shared-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.shared-modal-head h2 { margin: 0; font-size: 15px; }
.shared-modal-body { max-height: calc(88vh - 62px); overflow: auto; padding: 16px; }

.shared-user-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.shared-user-form label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.shared-user-list { display: flex; flex-direction: column; gap: 6px; }

.shared-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.shared-user-row span { display: flex; flex-direction: column; min-width: 0; }
.shared-user-row strong { font-size: 12.5px; }
.shared-user-row small { color: var(--ink-3); font-size: 11px; }
.shared-user-row em { color: var(--ink-2); font-size: 11.5px; font-style: normal; }
.shared-user-row-actions { flex-direction: row !important; align-items: center; gap: 8px; }

/* ------------------------------ 视觉刷新 ------------------------------ */

:root {
  --bg: #eef3f4;
  --surface: #ffffff;
  --surface-soft: #f7fafb;
  --line: #dce6e9;
  --line-strong: #c8d6db;
  --ink: #17272c;
  --ink-2: #52666e;
  --ink-3: #7d9098;
  --accent: #0f766e;
  --accent-dark: #0b5b55;
  --accent-soft: #e8f4f2;
  --blue: #2563eb;
  --blue-soft: #edf3ff;
  --warn: #b45309;
  --warn-soft: #fff6e8;
  --danger: #b42318;
  --danger-soft: #fef1f0;
  --ok: #15803d;
  --ok-soft: #ecf8ef;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(18, 38, 44, .04), 0 12px 30px rgba(18, 38, 44, .055);
  --sidebar-w: 236px;
}

*:focus-visible { outline: 2px solid rgba(15, 118, 110, .34); outline-offset: 2px; }

body { background: var(--bg); }

.sidebar {
  background: #f9fbfc;
  border-right-color: var(--line);
}

.brand { padding-bottom: 20px; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; box-shadow: 0 5px 14px rgba(15, 118, 110, .18); }
.brand-text strong { font-size: 15.5px; }

.nav { gap: 4px; }
.nav-item {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
}
.nav-item:hover { background: #edf3f4; }
.nav-item.is-active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-badge { min-width: 22px; padding: 1px 7px; font-weight: 650; }
.sidebar-foot { padding-top: 14px; }

.topbar {
  height: 64px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .94);
}
.crumb { font-size: 15.5px; font-weight: 700; }
.crumb-sub { font-size: 11.5px; }
.content {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

.panel { border-radius: 8px; box-shadow: var(--shadow); }
.panel-head { padding: 15px 18px; }
.panel-head h2 { font-size: 15px; }
.panel-sub { color: var(--ink-3); font-size: 11.5px; }

.btn {
  min-height: 34px;
  padding: 0 13px;
  border-color: var(--line-strong);
  border-radius: 6px;
  background: #fff;
  font-weight: 600;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { border-color: #b8c9cf; background: #f7fafb; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, .16);
}
.btn-primary:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { border-color: transparent; background: #edf3f4; }
.icon-btn { width: 32px; height: 32px; border-radius: 6px; }

.field input,
.field select,
.field textarea,
.select {
  border-color: var(--line-strong);
  border-radius: 6px;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.select:focus,
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}
.search-box {
  height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #f7fafb;
}
.search-box:focus-within { background: #fff; }

.dropzone {
  border-width: 1.5px;
  border-radius: 8px;
  background: #fbfdfd;
}
.dropzone:hover,
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon { width: 38px; height: 38px; box-shadow: 0 2px 8px rgba(22, 36, 42, .08); }

.intake-top { gap: 16px; }
.stats-strip,
.kpi-grid { gap: 12px; }
.stat-card,
.kpi { border-radius: 8px; box-shadow: var(--shadow); }
.stat-card { padding: 14px 16px; }
.stat-card strong,
.kpi strong { font-size: 22px; }

.toolbar { gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.table-wrap { border-radius: 0 0 8px 8px; }

.data-table th,
.items-table th,
.mini-table th {
  border-bottom: 1px solid var(--line-strong);
  background: #f6f9fa;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 650;
}
.data-table td,
.items-table td,
.mini-table td { border-bottom: 1px solid #edf2f4; }
.data-table tbody tr:hover,
.items-table tbody tr:hover,
.mini-table tbody tr:hover { background: #f8fbfb; }
.data-table { min-width: 980px; }
.shipping-table { min-width: 1100px; }
.items-table { min-width: 1120px; }
.mini-table { min-width: 1060px; }

.queue-item { padding: 12px; border-color: var(--line); border-radius: 8px; }
.queue-item:hover { border-color: #b9cbd0; background: #fbfdfd; }
.queue-item.is-active { border-color: var(--accent); background: var(--accent-soft); }
.badge { font-weight: 650; }

.drawer { width: min(1280px, 97vw); }
.drawer-head { padding: 20px 24px; }
.drawer-head h2 { font-size: 21px; }
.drawer-head p { margin-top: 3px; font-size: 13px; }
.drawer-body { padding: 20px 24px 24px; }
.drawer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfc;
  color: var(--ink-3);
  font-size: 12px;
}
.drawer-meta strong { color: var(--ink); font-size: 13px; font-weight: 700; }
.drawer-meta .is-end { margin-left: auto; }
.production-order-row.is-link .production-toggle-icon { color: var(--ink-3); }
.production-order-row.is-link:hover .production-toggle-icon { color: var(--accent); }
.drawer-foot { gap: 10px; padding: 16px 24px; }
.drawer-foot .btn { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.detail-grid { gap: 12px; margin-bottom: 18px; }
.detail-item { padding: 12px 14px; border-radius: 6px; background: #f8fbfb; }
.detail-item span { font-size: 11.5px; }
.detail-item strong { margin-top: 3px; font-size: 14px; line-height: 1.45; }
.section-head h3 { font-size: 15px; }
.section-sub { font-size: 12px; }
.mini-table { min-width: 1180px; }
.mini-table th { padding: 11px 12px; font-size: 12.5px; text-align: center; }
.mini-table td { padding: 11px 12px; font-size: 13px; line-height: 1.6; text-align: center; vertical-align: middle; }
.mini-table th + th,
.mini-table td + td { border-left: 1px solid #eef2f4; }
.mini-table tbody tr:nth-child(even) td { background: #fbfcfd; }
.mini-table .col-factory { width: 110px; min-width: 0; }
.mini-table .col-customer { width: 100px; min-width: 0; }
.mini-table .col-spec { width: 116px; min-width: 0; }
.mini-table .col-cut { width: 110px; min-width: 0; white-space: nowrap; }
.mini-table .col-req {
  width: 160px;
  min-width: 0;
  padding-left: 14px;
  text-align: left;
  word-break: break-word;
  line-height: 1.65;
}
.mini-table th.col-req {
  padding-left: 12px;
  text-align: center;
}
.mini-table .col-remark { width: 250px; min-width: 0; word-break: break-word; }
.mini-table .col-attention { width: 140px; min-width: 0; word-break: break-word; }
.mini-table .col-kind,
.mini-table .col-qty,
.mini-table .col-seq { white-space: nowrap; }
.source-line { margin-top: 16px; font-size: 12px; }

.production-order-row td { background: #fff; }
.production-order-head { align-items: center; gap: 8px 14px; padding: 10px 14px 10px 28px; }
.production-order-field { align-items: center; }
.production-order-field strong { color: var(--ink-3); font-weight: 650; }
.production-order-field span { font-size: 14px; font-weight: 700; }
.production-order-field.is-primary span { font-size: 15px; font-weight: 750; letter-spacing: 0; }
.production-order-field.is-end { margin-left: auto; }
.shipping-status-select {
  min-width: 132px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
}
.shipping-date-input {
  min-width: 132px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
}
.production-column-row td { background: #f6f9fa; color: var(--ink-2); }
.production-detail-row > td { padding: 0 !important; background: #fff; }
.production-detail-table { min-width: 1160px; }
.production-detail-table td[rowspan] { vertical-align: middle; }
.shipping-detail-table { min-width: 1200px; table-layout: fixed; }
.shipping-detail-table .col-seq { width: 50px; }
.shipping-detail-table .col-production-model { width: 140px; }
.shipping-detail-table .col-ship-customer { width: 120px; }
.shipping-detail-table .col-ship-batch { width: 190px; }
.shipping-detail-table .col-ship-spec { width: 140px; }
.shipping-detail-table .col-num { width: 92px; }
.shipping-detail-table .col-ship-meters { width: 104px; }
.shipping-detail-table .col-ship-status { width: 132px; }
.shipping-batch-input { width: 100%; }
.shipping-pending-input {
  width: 82px;
  padding: 4px 6px;
  border: 1px solid #d7e2e6;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-align: right;
}
.shipping-pending-input::placeholder { color: #9aa8ae; font-weight: 500; }
.shipping-pending-input.is-manual { border-color: #e0a35b; background: #fff8ed; }
.shipping-pending-input:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 16%, transparent); }
.shipping-item-status-select {
  width: 100%;
  min-width: 112px;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 650;
}
.shipping-detail-table td + td { border-left: 1px solid #eef2f4; }
.shipping-detail-table .production-item-row.is-alt td { background: #fafcfd; }
.shipping-detail-table .production-item-row td { padding: 8px 10px; }
.shipping-detail-table .production-column-row td { background: #eaf1f3; font-weight: 650; }
.shipping-detail-table tbody td.num { background: #f7fafb; font-weight: 620; font-size: 13px; }
.shipping-detail-table tfoot td.num { background: #eef4f5; }
.num-dim { color: #a6b1b7; }
/* 计划 / 生产 / 发货 三列用底色区分 */
.production-detail-table tbody td.num.col-plan,
.production-detail-table .production-column-row td.col-plan { background: #f3f7f8; color: var(--ink); }
.production-detail-table tbody td.num.col-produced,
.production-detail-table .production-column-row td.col-produced { background: #e8f0fd; color: #1d4ed8; font-weight: 650; }
.production-detail-table tbody td.num.col-shipped,
.production-detail-table .production-column-row td.col-shipped { background: #e4f1ef; color: var(--accent-dark); font-weight: 700; }
.production-table .col-seq,
.shipping-table .col-seq { width: 56px; text-align: center; white-space: nowrap; }
.production-merge-section { margin-bottom: 14px; }
.production-merge-section .section-head { padding: 0 0 10px; }
.production-merge-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.production-merge-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.production-merge-card.is-confirmed { border-left-color: var(--ok); }
.production-merge-head,
.production-merge-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.production-merge-head strong { font-size: 16px; }
.production-merge-meta { display: flex; flex-direction: column; gap: 3px; margin: 9px 0; color: var(--ink-2); font-size: 12.5px; }
.production-merge-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  background: var(--surface-soft);
}
.production-merge-total span { color: var(--ink-3); font-size: 12px; }
.production-merge-total strong { color: var(--accent-dark); font-size: 20px; font-variant-numeric: tabular-nums; }
.production-merge-foot { margin-top: 11px; color: var(--ink-3); font-size: 12px; }

.shared-login-card,
.shared-modal-card { border-radius: 8px; }

.shared-notice-wrap {
  position: fixed;
  top: 78px;
  right: 18px;
  z-index: 260;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(370px, calc(100vw - 36px));
}
.shared-notice {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(18, 38, 44, .16);
  animation: notice-in .18s ease;
}
.shared-notice-head { display: flex; align-items: flex-start; gap: 9px; color: var(--accent-dark); }
.shared-notice-head > div { display: flex; flex-direction: column; gap: 2px; }
.shared-notice-head small { color: var(--ink-3); font-size: 11px; font-weight: 500; }
.shared-notice-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}
.shared-notice-head strong { font-size: 13.5px; }
.shared-notice-body { display: flex; flex-direction: column; gap: 3px; margin: 9px 0 12px; color: var(--ink-2); font-size: 12px; }
.shared-notice-actions { display: flex; justify-content: flex-end; gap: 7px; }
@keyframes notice-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 1180px) {
  .meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mapping-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-strip, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .intake-top { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .search-box { width: 100%; order: 3; }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 12px 0 36px rgba(20, 32, 37, .14);
  }

  .app.nav-open .sidebar { transform: none; }

  .sidebar-mask {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: none;
    background: rgba(20, 32, 37, .3);
  }

  .app.nav-open .sidebar-mask { display: block; }
  .mobile-menu { display: inline-flex; }
  .content { padding: 14px 14px 32px; }
  .topbar { padding: 0 14px; }
  .toast-wrap { left: 14px; right: 14px; align-items: stretch; }
  .toast { max-width: none; }
  .meta-grid, .mapping-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .crumb-sub { display: none; }
  .topbar-actions .btn span { display: none; }
  .stats-strip, .kpi-grid, .meta-grid, .mapping-grid { grid-template-columns: 1fr; }
  .toolbar-spacer { display: none; }
  .search-box { order: 0; width: 100%; flex: 1 1 100%; }
  .toolbar .select { order: 1; width: auto; min-width: 0; flex: 1 1 calc(50% - 4px); }
  #exportCsvBtn { order: 1; flex: 1 1 calc(50% - 4px); }
  .drawer-body { padding: 13px 13px 16px; }
  .drawer-head, .drawer-foot { padding-left: 13px; padding-right: 13px; }
  .detail-grid { grid-template-columns: 1fr; }
  .production-merge-cards { grid-template-columns: 1fr; }
  .shared-user-form { grid-template-columns: 1fr; }
  .shared-user-form .btn { width: 100%; justify-content: center; }
}

/* ------------------------------ 生产看板视觉主题 ------------------------------ */

:root {
  --bg: #f1f5f6;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --line: #e2ebe7;
  --line-strong: #cfded7;
  --ink: #182721;
  --ink-2: #5a6c64;
  --ink-3: #8b9a93;
  --accent: #0b7a5d;
  --accent-dark: #075e48;
  --accent-soft: #e5f4ef;
  --yellow: #f7c948;
  --yellow-dark: #e3ad20;
  --blue: #4b7bec;
  --blue-soft: #edf3ff;
  --warn: #b45309;
  --warn-soft: #fff5e6;
  --danger: #c0392b;
  --danger-soft: #fdeceb;
  --ok: #0f9d58;
  --ok-soft: #e8f7ef;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 48, 38, .04), 0 10px 24px rgba(20, 48, 38, .06);
}

body { background: var(--bg); }

.sidebar {
  background: linear-gradient(180deg, #08664d 0%, #07523f 100%);
  border-right: 0;
  color: #fff;
  box-shadow: 10px 0 30px rgba(7, 82, 63, .10);
}

.brand { padding: 6px 8px 22px; }
.brand-mark {
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .14);
}
.brand-text strong { color: #fff; font-size: 16px; }
.brand-text small { color: rgba(255, 255, 255, .68); font-size: 10.5px; }

.nav { gap: 5px; }
.nav-item {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .82);
  font-size: 12.5px;
}
.nav-item:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.nav-item.is-active {
  background: var(--yellow);
  color: #20302a;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .14);
}
.nav-item.is-active .nav-badge {
  background: rgba(23, 41, 34, .12);
  color: #20302a;
}
.nav-badge {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.storage-info { color: rgba(255, 255, 255, .70); }
.sidebar .btn-ghost {
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.sidebar .btn-ghost:hover {
  border-color: rgba(255, 255, 255, .30);
  background: rgba(255, 255, 255, .16);
}

.shared-userbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .10);
}
.shared-user-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--accent-dark);
  flex: none;
}
.shared-user-name {
  flex: 1;
  min-width: 0;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shared-user-actions {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.shared-user-actions .btn {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.shared-user-actions .btn:hover {
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .16);
}

.topbar {
  height: 82px;
  padding: 0 28px;
  background: var(--bg);
  border-bottom: 0;
  backdrop-filter: none;
}
.crumb { font-size: 24px; font-weight: 800; letter-spacing: -.2px; }
.crumb-sub { margin-top: 3px; color: var(--ink-3); font-size: 12.5px; }
.topbar .btn-primary {
  min-height: 40px;
  padding: 0 17px;
  border-color: var(--yellow);
  background: var(--yellow);
  color: #253029;
  box-shadow: 0 8px 18px rgba(190, 145, 18, .18);
}
.topbar .btn-primary:hover {
  border-color: var(--yellow-dark);
  background: var(--yellow-dark);
}

.content {
  max-width: 1620px;
  padding: 6px 28px 48px;
}

.panel {
  border-radius: 12px;
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.btn { border-radius: 8px; }
.icon-btn { border-radius: 8px; }
.field input, .field select, .field textarea, .select { border-radius: 8px; }
.search-box { border-radius: 8px; background: #f5f8f7; }

.stats-strip { gap: 14px; margin-bottom: 16px; }
#productionStats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-strip .stat-card {
  min-height: 108px;
  padding: 20px 22px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 12px 24px rgba(28, 62, 50, .12);
}
.stats-strip .stat-card:nth-child(4n+1) { background: linear-gradient(135deg, #5a86f2 0%, #3f6fe2 100%); }
.stats-strip .stat-card:nth-child(4n+2) { background: linear-gradient(135deg, #20c997 0%, #0ca678 100%); }
.stats-strip .stat-card:nth-child(4n+3) { background: linear-gradient(135deg, #ffa94d 0%, #f28c28 100%); }
.stats-strip .stat-card:nth-child(4n+4) { background: linear-gradient(135deg, #38b2ac 0%, #0f8b8d 100%); }
.stats-strip .stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
}
.stats-strip .stat-card .stat-icon svg.lucide { width: 24px; height: 24px; }
.stats-strip .stat-card strong { color: #fff; font-size: 30px; line-height: 1.05; }
.stats-strip .stat-card span:not(.stat-icon),
.stats-strip .stat-card small { color: rgba(255, 255, 255, .86); }

#view-production .panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#view-production .toolbar {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
#view-production .table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: auto;
}
#view-production .table-foot {
  padding: 12px 4px 0;
  color: var(--ink-3);
}

#view-production .production-table {
  min-width: 1080px;
  table-layout: fixed;
}
#view-production .production-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 13px 16px;
  border-bottom: 0;
  background: #0a6b51;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
#view-production .production-table th:nth-child(1) { width: 34%; }
#view-production .production-table th:nth-child(2) { width: 18%; }
#view-production .production-table th:nth-child(3) { width: 18%; }
#view-production .production-table th:nth-child(4) { width: 16%; }
#view-production .production-table th:nth-child(5) { width: 14%; }
#view-production .production-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e6efeb;
  vertical-align: middle;
}
#view-production .production-salesperson-row td {
  padding: 0;
  background: #e7f4ef;
  border-bottom: 1px solid #d3e8df;
  box-shadow: inset 4px 0 0 #0a8f68;
}
#view-production .production-salesperson-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 14px;
  color: #0b6b52;
}
#view-production .production-sales-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #d5eee4;
  color: #0b6b52;
  font-size: 14px;
  font-weight: 800;
  flex: none;
}
#view-production .production-salesperson-head strong {
  color: #075e48;
  font-size: 14px;
  font-weight: 800;
}
#view-production .production-sales-stat {
  color: #54746a;
  font-size: 12px;
  font-weight: 600;
}
#view-production .production-sales-stat b { color: #075e48; }
/* 展开箭头放到最右边：其它内容保持靠左，避免整行被挤到右边 */
#view-production .production-salesperson-head .production-toggle-icon { order: 2; margin-left: auto; }

#view-production .production-order-row { cursor: pointer; transition: background .14s; }
#view-production .production-order-row:hover { background: #f5fbf8; }
#view-production .production-order-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
#view-production .production-order-main > .production-toggle-icon { margin-top: 3px; color: #0a8f68; }
#view-production .production-order-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
#view-production .production-order-field {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
#view-production .production-order-field strong {
  flex: none;
  min-width: 44px;
  color: #82938b;
  font-size: 11px;
  font-weight: 600;
}
#view-production .production-order-field span {
  color: #1c2c25;
  font-size: 12.5px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#view-production .production-order-field.is-primary span { color: #0b6b52; }
#view-production .production-col-progress { min-width: 0; }
#view-production .production-progress-value {
  margin-bottom: 6px;
  color: #0a8f68;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
#view-production .production-progress-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f0;
}
#view-production .production-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #13b886 0%, #0a8f68 100%);
}
#view-production .production-col-count {
  color: #1d2b25;
  font-variant-numeric: tabular-nums;
}
#view-production .production-col-count strong {
  display: block;
  color: #1d2b25;
  font-size: 15px;
  font-weight: 800;
}
#view-production .production-col-count span {
  display: block;
  margin-top: 2px;
  color: #8a9992;
  font-size: 10.5px;
}
#view-production .production-col-date {
  color: #d18a12;
  font-size: 12.5px;
  font-weight: 750;
}
#view-production .production-col-date .muted { color: #95a39d; font-weight: 500; }
#view-production .production-col-status { text-align: right; }
#view-production .production-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
}
#view-production .production-status-badge.is-completed { background: #e2f7ec; color: #0a8a4d; }
#view-production .production-status-badge.is-progress { background: #e4f5ee; color: #0a8a4d; }
#view-production .production-status-badge.is-pending { background: #edf1f8; color: #5c6d8d; }

@media (max-width: 1180px) {
  #productionStats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .topbar { height: auto; padding: 14px; }
  .crumb { font-size: 20px; }
  .content { padding: 12px 14px 36px; }
  #productionStats { grid-template-columns: 1fr; }
  #view-production .production-salesperson-head { flex-wrap: wrap; }
  #view-production .production-salesperson-head .production-toggle-icon { margin-left: 0; }
}

/* ------------------------------ 生产表格居中优化 ------------------------------ */

#view-production .production-table th:nth-child(n+2) { text-align: center; }
#view-production .production-order-row td {
  height: 92px;
  vertical-align: middle;
}
#view-production .production-col-main { text-align: left; }
#view-production .production-order-main {
  align-items: center;
  height: 100%;
}
#view-production .production-order-field { align-items: center; }
#view-production .production-order-field strong { text-align: right; }

#view-production .production-col-progress,
#view-production .production-col-count,
#view-production .production-col-date,
#view-production .production-col-status {
  text-align: center;
  vertical-align: middle;
}
#view-production .production-progress-value { text-align: center; }
#view-production .production-progress-track {
  width: min(170px, 100%);
  margin: 0 auto;
}
#view-production .production-col-count strong,
#view-production .production-col-count span {
  text-align: center;
}
#view-production .production-status-badge { margin: 0 auto; }

/* ------------------------------ 数据概览深色看板 ------------------------------ */

#view-dashboard {
  min-height: calc(100vh - 118px);
  padding: 22px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 0%, rgba(18, 104, 82, .55) 0%, rgba(4, 26, 22, .98) 42%, #020c0a 100%);
  color: #e7f6f0;
  box-shadow: 0 18px 44px rgba(3, 18, 14, .18);
}
#view-dashboard .dashboard-groups { display: flex; flex-direction: column; gap: 18px; }
.dashboard-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dashboard-hero h2 { margin: 0; color: #f4fffb; font-size: 28px; font-weight: 800; }
.dashboard-hero p { margin: 5px 0 0; color: rgba(215, 239, 230, .62); font-size: 13px; }
.dashboard-updated { color: rgba(215, 239, 230, .58); font-size: 12px; white-space: nowrap; }

.dashboard-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dashboard-kpi {
  position: relative;
  min-height: 156px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(88, 210, 174, .18);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(8, 52, 44, .95), rgba(4, 28, 24, .94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 18px 36px rgba(0, 0, 0, .18);
}
.dashboard-kpi::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -34px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  opacity: .13;
  background: currentColor;
}
.dashboard-kpi.is-blue { color: #6ea8ff; }
.dashboard-kpi.is-orange { color: #f4b34e; }
.dashboard-kpi.is-green { color: #31d0aa; }
.dashboard-kpi.is-teal { color: #44d6f0; }
.dashboard-kpi-head { display: flex; align-items: center; justify-content: space-between; color: rgba(226, 244, 238, .72); font-size: 12px; font-weight: 650; }
.dashboard-kpi-head svg.lucide { width: 22px; height: 22px; color: currentColor; }
.dashboard-kpi strong { display: block; margin-top: 18px; color: #fff; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.dashboard-kpi strong small { margin-left: 5px; color: rgba(226, 244, 238, .64); font-size: 13px; font-weight: 600; }
.dashboard-kpi em { display: block; margin-top: 18px; color: rgba(226, 244, 238, .62); font-size: 12px; font-style: normal; }
.dashboard-kpi-bar { width: 100%; height: 7px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .10); }
.dashboard-kpi-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #31d0aa, #75f0ca); }

.dashboard-panel {
  border: 1px solid rgba(74, 201, 166, .16);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(5, 42, 36, .95), rgba(3, 25, 21, .96));
  box-shadow: 0 18px 36px rgba(0, 0, 0, .18);
}
.dashboard-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px 12px; }
.dashboard-panel-head h3,
.dashboard-section-head h3 { margin: 0; color: #effbf7; font-size: 17px; font-weight: 750; }
.dashboard-panel-head span,
.dashboard-section-head span { display: block; margin-top: 4px; color: rgba(215, 239, 230, .55); font-size: 11.5px; }
.dashboard-panel-actions { display: flex; align-items: center; gap: 8px; }
.dashboard-panel-actions > span,
.dashboard-panel-actions select { padding: 6px 10px; border: 1px solid rgba(83, 191, 160, .22); border-radius: 8px; background: rgba(255, 255, 255, .06); color: #daeee7; font-size: 12px; }
.dashboard-panel-actions select { appearance: none; padding-right: 26px; }
.dashboard-ghost-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 11px; border: 1px solid rgba(83, 191, 160, .24); border-radius: 8px; background: rgba(255, 255, 255, .05); color: #dff6ee; font-size: 12px; }
.dashboard-chart-wrap { padding: 0 10px 14px; }
.dashboard-chart { display: block; width: 100%; height: 270px; overflow: visible; }
.dashboard-grid-line { stroke: rgba(127, 221, 193, .12); stroke-width: 1; }
.dashboard-axis-label { fill: rgba(207, 235, 225, .62); font-size: 12px; }
.dashboard-trend-dot { fill: #071f1a; stroke: #35e0aa; stroke-width: 3; }
.dashboard-point-label { fill: #9ff0d2; font-size: 12px; font-weight: 700; }
.dashboard-chart.multi { height: 280px; }
.dashboard-chart.bar {
  width: 100%;
  height: auto;
  max-height: 460px;
  aspect-ratio: 1400 / 380;
}
.dashboard-series-dot { fill: #071f1a; stroke-width: 3; }
.dashboard-series-bar { transition: opacity .15s; }
.dashboard-series-bar:hover { opacity: .72; }
.dashboard-chart-legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 20px 16px; }
.dashboard-legend-item { display: inline-flex; align-items: center; gap: 6px; color: rgba(215, 239, 230, .66); font-size: 11.5px; }
.dashboard-legend-item i { width: 9px; height: 9px; border-radius: 50%; }
.dashboard-legend-item em { color: #e8f8f2; font-style: normal; font-weight: 700; }
.dashboard-chart-empty { padding: 70px 20px; color: rgba(215, 239, 230, .48); text-align: center; font-size: 13px; }

.dashboard-sales-section { display: flex; flex-direction: column; gap: 12px; }
.dashboard-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.dashboard-pill { padding: 7px 11px; border: 1px solid rgba(83, 191, 160, .22); border-radius: 8px; background: rgba(255, 255, 255, .05); color: #dff6ee; font-size: 12px; }
.dashboard-sales-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dashboard-sales-card { padding: 14px 16px 12px; border: 1px solid rgba(74, 201, 166, .16); border-radius: 14px; background: linear-gradient(145deg, rgba(6, 49, 41, .95), rgba(3, 27, 23, .96)); box-shadow: 0 16px 30px rgba(0, 0, 0, .16); }
.dashboard-sales-head { display: flex; align-items: center; gap: 10px; }
.dashboard-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #d7f2e7; color: #075e48; font-size: 12px; font-weight: 800; }
.dashboard-sales-head strong { flex: 1; color: #f1fcf8; font-size: 14px; }
.dashboard-dots { color: rgba(211, 238, 229, .52); }
.dashboard-sales-body { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.dashboard-sales-metrics { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dashboard-sales-metric { margin-bottom: 0; }
.dashboard-sales-metric span { display: block; color: rgba(215, 239, 230, .54); font-size: 11px; }
.dashboard-sales-metric strong { display: block; margin-top: 4px; color: #fff; font-size: 22px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.dashboard-sales-metric strong small { margin-left: 4px; color: rgba(215, 239, 230, .55); font-size: 11px; font-weight: 600; }
.dashboard-ring { position: relative; display: grid; place-items: center; width: 64px; height: 64px; }
.dashboard-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.dashboard-ring circle { fill: none; stroke-width: 4; }
.dashboard-ring-bg { stroke: rgba(255, 255, 255, .10); }
.dashboard-ring-value { stroke: var(--ring-color); stroke-linecap: round; }
.dashboard-ring strong { color: #fff; font-size: 14px; }
.dashboard-sales-foot { margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); color: rgba(215, 239, 230, .52); font-size: 11.5px; }
.dashboard-sales-foot strong.is-up { color: #31d0aa; }
.dashboard-sales-foot strong.is-down { color: #ff8a65; }

.dashboard-detail-panel { overflow: hidden; }
.dashboard-tabs { display: flex; gap: 6px; padding: 0 20px 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.dashboard-tab { padding: 7px 11px; border: 0; border-radius: 8px; background: transparent; color: rgba(215, 239, 230, .58); font-size: 12px; }
.dashboard-tab.is-active { background: rgba(49, 208, 170, .13); color: #6ef0c7; }
.dashboard-table-wrap { overflow: auto; }
.dashboard-contract-table { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; }
.dashboard-contract-table th,
.dashboard-contract-table td { padding: 11px 14px; border-bottom: 1px solid rgba(255, 255, 255, .06); color: rgba(226, 244, 238, .72); font-size: 12px; text-align: left; white-space: nowrap; }
.dashboard-contract-table th { background: rgba(255, 255, 255, .03); color: rgba(226, 244, 238, .55); font-size: 11px; font-weight: 650; }
.dashboard-contract-table td.num,
.dashboard-contract-table th.num { text-align: right; }
.dashboard-contract { color: #c9f7e8; font-weight: 700; }
.dashboard-status { display: inline-flex; padding: 4px 8px; border-radius: 7px; font-size: 11px; font-weight: 700; }
.dashboard-status.is-pending { background: rgba(242, 157, 72, .16); color: #ffbd73; }
.dashboard-status.is-partial { background: rgba(76, 156, 255, .16); color: #80b5ff; }
.dashboard-status.is-shipped { background: rgba(49, 208, 170, .16); color: #62e8bc; }
.dashboard-empty { padding: 26px; color: rgba(215, 239, 230, .5); text-align: center; }
.dashboard-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; color: rgba(215, 239, 230, .55); font-size: 12px; }
.dashboard-pages { display: flex; gap: 5px; }
.dashboard-page { min-width: 28px; height: 28px; border: 1px solid rgba(83, 191, 160, .18); border-radius: 7px; background: rgba(255, 255, 255, .04); color: #dff6ee; font-size: 12px; }
.dashboard-page.is-active { border-color: #31d0aa; background: #31d0aa; color: #062019; font-weight: 800; }
.dashboard-empty-state { display: grid; place-items: center; gap: 8px; min-height: 360px; color: rgba(215, 239, 230, .55); text-align: center; }
.dashboard-empty-state svg.lucide { width: 34px; height: 34px; color: #31d0aa; }
.dashboard-empty-state strong { color: #f1fcf8; font-size: 16px; }

@media (max-width: 1180px) {
  .dashboard-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  #view-dashboard { padding: 15px; border-radius: 12px; }
  .dashboard-hero { flex-direction: column; }
  .dashboard-kpi-grid,
  .dashboard-sales-grid { grid-template-columns: 1fr; }
  .dashboard-sales-body { align-items: stretch; flex-direction: column; }
  .dashboard-sales-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-panel-head,
  .dashboard-section-head { align-items: flex-start; flex-direction: column; }
  .dashboard-panel-head .dashboard-panel-actions { width: 100%; }
}

/* 数据概览：当前页面卡片是白底，深色主题继承下来的浅色文字会看不见，这里把表格正文改回深色 */
#view-dashboard .dashboard-table td { color: #1d2b26; }

#view-dashboard .section-head h3 { color: #effbf7; }
#view-dashboard .section-head .section-sub { color: rgba(215, 239, 230, .6); }


/* 总米数：一个型号跨多个规格时的合计米数 */
.items-table .col-model-total { width: 84px; }
.items-table .col-model-total input { text-align: right; }
.mini-table .col-model-total { width: 84px; min-width: 0; }


/* 批号/要求：多行合并的单元格加底色并把内容居中，方便看出合并范围 */
.items-table td.col-req.is-merged,
.mini-table td.col-req.is-merged {
  background: #eaf5f0;
  vertical-align: middle;
  text-align: center;
}
.items-table td.col-req.is-merged textarea,
.mini-table td.col-req.is-merged textarea {
  text-align: center;
}


/* 相邻的合并块交替底色 + 顶部分隔线，方便分辨每一块的范围 */
.items-table td.col-req.is-merged,
.mini-table td.col-req.is-merged {
  box-shadow: inset 0 2px 0 #bcd9cd;
}
.items-table td.col-req.is-merged.is-merged-alt,
.mini-table td.col-req.is-merged.is-merged-alt {
  background: #e7eff9;
  box-shadow: inset 0 2px 0 #bfd0e4;
}


/* 型号合并卡片：列出这条合并来自哪几个订单/型号，确认后也一直显示 */
.production-merge-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.production-merge-orders {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  max-height: 168px;
  overflow-y: auto;
}
.production-merge-order {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  background: #f6f9fa;
  font-size: 12px;
}
.production-merge-order .pm-order { color: var(--accent-dark); font-weight: 700; white-space: nowrap; }
.production-merge-order .pm-model { flex: 1; min-width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.production-merge-order .pm-qty { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
button.pm-order {
  background: transparent; border: 0; padding: 0; font: inherit;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
button.pm-order:hover { color: var(--accent); }
@keyframes productionLocatePulse {
  0% { background: #fff3c4; }
  100% { background: transparent; }
}
tr.is-located td { animation: productionLocatePulse 2.5s ease-out; }
.production-merge-order { align-items: flex-start; }
.production-merge-order .pm-check { flex: none; margin: 3px 0 0; width: 14px; height: 14px; cursor: pointer; }
.production-merge-order .pm-body { flex: 1; min-width: 0; }
.production-merge-order.is-excluded { opacity: .45; }


/* 生产情况：底部「已完成订单」分类 */
#view-production .production-salesperson-row.production-completed-row td {
  background: #e6f7ef;
  box-shadow: inset 4px 0 0 #12a06f;
}
#view-production .production-salesperson-row.production-completed-row:hover td { background: #dcf2e8; }
#view-production .production-salesperson-row.production-completed-row .production-sales-avatar {
  background: #cdeee0;
  color: #0a7a55;
}

/* 发货明细：确认发货按钮 */
.shipping-confirm-btn { margin-left: 8px; padding: 3px 10px; font-size: 12px; }


/* 发货明细：每个业务员下面「已确认发货」折叠分组 */
#view-shipping .shipping-confirmed-row { cursor: pointer; }
#view-shipping .shipping-confirmed-row td {
  padding: 0;
  background: #f2f9f6;
  border-top: 1px solid #dbeae4;
  border-bottom: 1px solid #dbeae4;
  box-shadow: inset 4px 0 0 #9ccfbb;
}
#view-shipping .shipping-confirmed-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 30px;
  color: var(--ink-2);
  font-size: 12.5px;
}
#view-shipping .shipping-confirmed-head strong { color: #0a7a55; font-size: 13px; }


/* 生产情况顶部改成 4 张卡片 */
#productionStats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) {
  #productionStats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  #productionStats { grid-template-columns: 1fr; }
}


/* 分切宽度列加宽，避免 310MM*2+220MM*3 这种被截断 */
.items-table .col-cut { width: 152px; min-width: 140px; }
.mini-table .col-cut { width: 152px; min-width: 0; }


.items-table .col-cut { width: 178px; min-width: 168px; }
.mini-table .col-cut { width: 178px; min-width: 0; }
.items-table .col-cut input { width: 100%; }


/* 明细表格：边框加深，合并单元格的边界更清楚 */
.items-table td,
.mini-table td {
  border-bottom: 1px solid #c6d5db;
  border-right: 1px solid #e0e9ed;
}
.items-table th,
.mini-table th {
  border-bottom: 1px solid #b3c5cc;
  border-right: 1px solid #e0e9ed;
}
.items-table td:last-child,
.mini-table td:last-child,
.items-table th:last-child,
.mini-table th:last-child { border-right: 0; }
.items-wrap { border-color: #c6d5db; }


/* 合并单元格（序号/图片/工厂型号/客户型号/总米数等）里的内容垂直居中 */
.items-table td[rowspan],
.mini-table td[rowspan] { vertical-align: middle; }


/* 型号块这几列（序号/图片/工厂型号/客户型号/总米数）左右也居中 */
.items-table td.col-seq,
.mini-table td.col-seq,
.items-table td.col-image,
.mini-table td.col-image,
.items-table td.col-factory,
.mini-table td.col-factory,
.items-table td.col-customer,
.mini-table td.col-customer,
.items-table td.col-model-total,
.mini-table td.col-model-total { text-align: center; }
.items-table td.col-seq input,
.items-table td.col-factory textarea,
.items-table td.col-customer textarea,
.items-table td.col-model-total input { text-align: center; }


/* 合并卡片：每条来源显示 合同号 + 米数，下面一行显示业务员/规格/表面/种类 */
.production-merge-order .pm-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.production-merge-order .pm-sub {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.45;
  word-break: break-word;
}


/* 合并卡片加宽，让业务员/规格一行放得下 */
.production-merge-cards { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }


/* 合并卡片：确认 / 不能合并 两个按钮 */
.production-merge-actions { display: flex; align-items: center; gap: 6px; }
.production-merge-reject { color: var(--ink-2); border-color: #d7e0e4; }
.production-merge-reject:hover { color: #c0392b; border-color: #e6b3ad; background: #fdf3f2; }


/* 合并卡片：底部「已标记不能合并」入口 */
.production-merge-rejected { grid-column: 1 / -1; margin-top: 6px; }
.production-merge-rejected-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px dashed #cfd9dd;
  border-radius: 8px;
  background: #f8fafb;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
}
.production-merge-rejected-toggle:hover { border-color: #b9c8ce; color: var(--ink); }
.production-merge-rejected-toggle svg.lucide { width: 14px; height: 14px; }
.production-merge-rejected-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; margin-top: 12px; }
.production-merge-card.is-rejected { border-left-color: #c3ced3; opacity: .94; }



/* Dashboard refresh */
#view-dashboard{ min-height:0;padding:0;border-radius:0;background:transparent;color:var(--ink);box-shadow:none;}
#view-dashboard .dashboard-groups{gap:16px;}
.dashboard-hero{align-items:center;padding:2px 2px 4px;}
.dashboard-hero h2{margin:0;color:var(--ink);font-size:24px;font-weight:800;letter-spacing:0;}
.dashboard-hero p{margin:4px 0 0;color:var(--ink-3);font-size:12.5px;}
.dashboard-updated{display:inline-flex;align-items:center;gap:6px;color:var(--ink-3);font-size:11.5px;}
.dashboard-updated svg.lucide{width:13px;height:13px;}
.dashboard-kpi-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.dashboard-kpi{min-height:116px;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius);background:#fff;box-shadow:var(--shadow);}
.dashboard-kpi::after{display:none;}
.dashboard-kpi.is-blue{--kpi-color:#2563eb;}
.dashboard-kpi.is-green{--kpi-color:#16794c;}
.dashboard-kpi.is-orange{--kpi-color:#c97708;}
.dashboard-kpi.is-teal{--kpi-color:#0f766e;}
.dashboard-kpi-head{color:var(--ink-2);font-size:11.5px;}
.dashboard-kpi-head svg.lucide{width:19px;height:19px;padding:4px;border-radius:6px;background:color-mix(in srgb,var(--kpi-color) 12%,white);color:var(--kpi-color);}
.dashboard-kpi strong{margin-top:12px;color:var(--ink);font-size:28px;}
.dashboard-kpi strong small{color:var(--ink-3);font-size:12px;}
.dashboard-kpi em{margin-top:10px;color:var(--ink-3);font-size:11.5px;}
.dashboard-kpi-bar{height:4px;margin-top:10px;background:#edf1f2;}
.dashboard-kpi-bar i{background:var(--kpi-color);}
.dashboard-panel{border:1px solid var(--line);border-radius:var(--radius);background:#fff;box-shadow:var(--shadow);}
.dashboard-panel-head{padding:16px 18px 10px;}
.dashboard-panel-head h3,.dashboard-section-head h3{color:var(--ink);font-size:16px;}
.dashboard-panel-head span,.dashboard-section-head span{color:var(--ink-3);font-size:11.5px;}
.dashboard-panel-actions span,.dashboard-panel-actions select{border-color:var(--line);background:var(--surface-soft);color:var(--ink-2);}
.dashboard-chart-wrap{padding:4px 16px 12px;overflow-x:auto;}
.dashboard-chart.bar{width:100%;height:360px;max-height:none;min-width:860px;aspect-ratio:auto;}
.dashboard-grid-line{stroke:#e7edef;}
.dashboard-axis-label{fill:#7c8c93;font-size:12px;}
.dashboard-point-label{fill:#0f766e;font-size:12px;font-weight:750;}
.dashboard-series-bar{transition:opacity .15s,filter .15s;}
.dashboard-series-bar:hover{opacity:.78;filter:brightness(1.04);}
.dashboard-chart-legend{gap:8px;padding:0 18px 16px;}
.dashboard-legend-item{padding:5px 8px;border:1px solid var(--line);border-radius:6px;background:var(--surface-soft);color:var(--ink-2);font-size:11px;}
.dashboard-legend-item em{color:var(--ink);}
.dashboard-chart-empty{padding:72px 20px;color:var(--ink-3);}


.dashboard-sales-section{gap:10px;}
.dashboard-section-head{align-items:center;padding:2px;}
.dashboard-pill{border-color:var(--line);background:#fff;color:var(--ink-2);}
.dashboard-sales-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.dashboard-sales-card{padding:13px 14px 12px;border:1px solid var(--line);border-radius:var(--radius);background:#fff;box-shadow:var(--shadow);}
.dashboard-sales-head{gap:9px;}
.dashboard-avatar{width:31px;height:31px;background:#e8f4f1;color:#0f766e;font-size:11px;}
.dashboard-sales-head strong{color:var(--ink);font-size:13px;}
.dashboard-dots{color:var(--ink-3);}
.dashboard-sales-body{gap:10px;margin-top:11px;}
.dashboard-sales-metrics{gap:8px;}
.dashboard-sales-metric span{color:var(--ink-3);font-size:10.5px;}
.dashboard-sales-metric strong{color:var(--ink);font-size:18px;}
.dashboard-sales-metric strong small{color:var(--ink-3);}
.dashboard-ring{width:50px;height:50px;}
.dashboard-ring-bg{stroke:#e8eef0;}
.dashboard-ring strong{color:var(--ink);font-size:12px;}
.dashboard-sales-foot{margin-top:8px;padding-top:8px;border-color:var(--line);color:var(--ink-3);font-size:10.5px;}
.dashboard-sales-foot strong.is-up{color:var(--ok);}
.dashboard-sales-foot strong.is-down{color:var(--danger);}
.dashboard-detail-panel{overflow:hidden;}
.dashboard-tabs{gap:5px;padding:0 18px 12px;border-color:var(--line);overflow-x:auto;}
.dashboard-tab{flex:none;padding:6px 10px;color:var(--ink-3);font-size:11.5px;}
.dashboard-tab.is-active{background:var(--accent-soft);color:var(--accent-dark);font-weight:700;}
.dashboard-table-wrap{overflow:auto;}
.dashboard-contract-table{min-width:800px;}
.dashboard-contract-table th,.dashboard-contract-table td{padding:10px 14px;border-color:#edf1f2;color:var(--ink-2);font-size:12px;}
.dashboard-contract-table th{background:var(--surface-soft);color:var(--ink-3);font-size:10.5px;}
.dashboard-contract{color:var(--accent-dark);}
.dashboard-status.is-pending{background:var(--warn-soft);color:var(--warn);}
.dashboard-status.is-partial{background:var(--blue-soft);color:var(--blue);}
.dashboard-status.is-shipped{background:var(--ok-soft);color:var(--ok);}
.dashboard-pagination{padding:12px 16px;border-top:1px solid var(--line);color:var(--ink-3);}
.dashboard-page{border-color:var(--line);background:#fff;color:var(--ink-2);}
.dashboard-page.is-active{border-color:var(--accent);background:var(--accent);color:#fff;}
.dashboard-empty-state{min-height:320px;color:var(--ink-3);}
.dashboard-empty-state strong{color:var(--ink);}
.dashboard-empty-state svg.lucide{color:var(--accent);}
@media(max-width:1180px){.dashboard-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.dashboard-sales-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:820px){#view-dashboard{padding:0;}.dashboard-hero{align-items:flex-start;}.dashboard-kpi-grid,.dashboard-sales-grid{grid-template-columns:1fr;}.dashboard-chart.bar{height:320px;}.dashboard-panel-head,.dashboard-section-head{align-items:flex-start;}}


.dashboard-bar-value {fill:#3f4f56;font-size:10px;font-weight:700;}


/* Dashboard readability */
#view-dashboard .dashboard-hero h2{font-size:28px;}
#view-dashboard .dashboard-hero p{font-size:14px;color:#687a82;}
#view-dashboard .dashboard-updated{font-size:12.5px;color:#6f8087;}
#view-dashboard .dashboard-updated svg.lucide{width:15px;height:15px;}
#view-dashboard .dashboard-kpi{min-height:126px;padding:16px 18px;}
#view-dashboard .dashboard-kpi-head{font-size:12.5px;font-weight:650;}
#view-dashboard .dashboard-kpi-head svg.lucide{width:22px;height:22px;}
#view-dashboard .dashboard-kpi strong{font-size:32px;}
#view-dashboard .dashboard-kpi strong small{font-size:13px;}
#view-dashboard .dashboard-kpi em{font-size:12.5px;}
#view-dashboard .dashboard-panel-head{ padding:18px 20px 12px;}
#view-dashboard .dashboard-panel-head h3,
#view-dashboard .dashboard-section-head h3{font-size:18px;font-weight:800;}
#view-dashboard .dashboard-panel-head span,
#view-dashboard .dashboard-section-head span{font-size:12.5px;line-height:1.5;}
#view-dashboard .dashboard-panel-actions span{font-size:12.5px;}
#view-dashboard .dashboard-chart.bar{height:390px;}
#view-dashboard .dashboard-axis-label{fill:#697a82;font-size:13.5px;font-weight:550;}
#view-dashboard .dashboard-bar-value{fill:#33454d;font-size:12px;font-weight:750;}
#view-dashboard .dashboard-chart-legend{gap:10px;padding:2px 20px 18px;}
#view-dashboard .dashboard-legend-item{padding:6px 10px;border-radius:7px;background:#f7f9fa;color:#53666e;font-size:12px;}
#view-dashboard .dashboard-legend-item em{font-size:12.5px;font-weight:750;}
#view-dashboard .dashboard-sales-card{padding:15px 16px 14px;}
#view-dashboard .dashboard-sales-head strong{font-size:14.5px;}
#view-dashboard .dashboard-avatar{width:34px;height:34px;font-size:12px;}
#view-dashboard .dashboard-sales-metric span{font-size:11.5px;}
#view-dashboard .dashboard-sales-metric strong{font-size:21px;}
#view-dashboard .dashboard-ring{width:56px;height:56px;}
#view-dashboard .dashboard-ring strong{font-size:13px;}
#view-dashboard .dashboard-sales-foot{font-size:11.5px;}
#view-dashboard .dashboard-tab{padding:7px 12px;font-size:12.5px;}
#view-dashboard .dashboard-contract-table th{font-size:12px;}
#view-dashboard .dashboard-contract-table td{font-size:13px;}
#view-dashboard .dashboard-pagination{font-size:12.5px;}
#view-dashboard .dashboard-page{font-size:12.5px;}


.dashboard-month-title {fill:#2f434b;font-size:16px;font-weight:800;}
.dashboard-bar-name {fill:#61747c;font-size:11.5px;font-weight:650;}


/* 数据概览：业务员月度订单分析 */
#view-dashboard .dashboard-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
#view-dashboard .dashboard-insight {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
#view-dashboard .dashboard-insight-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 8px;
  background: #edf4f7;
  color: #25636f;
}
#view-dashboard .dashboard-insight.is-blue .dashboard-insight-icon { background:#eaf2ff; color:#2563eb; }
#view-dashboard .dashboard-insight.is-orange .dashboard-insight-icon { background:#fff3e4; color:#b96806; }
#view-dashboard .dashboard-insight.is-green .dashboard-insight-icon { background:#e8f7f1; color:#13795b; }
#view-dashboard .dashboard-insight-icon svg.lucide { width: 19px; height: 19px; }
#view-dashboard .dashboard-insight small { display:block; color:var(--ink-3); font-size:11.5px; }
#view-dashboard .dashboard-insight strong { display:block; margin-top:6px; color:var(--ink); font-size:19px; line-height:1.2; }
#view-dashboard .dashboard-insight p { margin:5px 0 0; color:var(--ink-2); font-size:12px; }

#view-dashboard .dashboard-matrix-panel { overflow: hidden; }
#view-dashboard .dashboard-matrix-wrap { padding: 0 18px 10px; overflow-x: auto; }
#view-dashboard .dashboard-month-matrix {
  width: 100%;
  min-width: 940px;
  border-collapse: separate;
  border-spacing: 5px;
  table-layout: fixed;
}
#view-dashboard .dashboard-month-matrix th,
#view-dashboard .dashboard-month-matrix td { padding: 0; }
#view-dashboard .dashboard-month-matrix thead th {
  padding: 8px 6px;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
}
#view-dashboard .dashboard-month-matrix thead th:first-child { width: 190px; text-align: left; }
#view-dashboard .dashboard-month-matrix thead th:last-child { width: 112px; }
#view-dashboard .dashboard-month-matrix tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 6px 8px 6px 0;
  background: #fff;
  text-align: left;
}
#view-dashboard .dashboard-matrix-person { display:flex; align-items:center; gap:9px; min-width:0; }
#view-dashboard .dashboard-matrix-person .dashboard-avatar { width:30px; height:30px; flex:none; font-size:11px; }
#view-dashboard .dashboard-matrix-person strong { display:block; color:var(--ink); font-size:12.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#view-dashboard .dashboard-matrix-person span { display:block; margin-top:2px; color:var(--ink-3); font-size:10.5px; white-space:nowrap; }
#view-dashboard .dashboard-month-cell {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:3px;
  width:100%;
  min-height:58px;
  padding:8px 9px;
  border:1px solid #e3eaed;
  border-radius:6px;
  background:#f8fafb;
  color:var(--ink-2);
  text-align:left;
  cursor:pointer;
  transition:transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
#view-dashboard .dashboard-month-cell:hover { transform:translateY(-1px); border-color:#9fc8bf; box-shadow:0 4px 12px rgba(21,82,69,.10); }
#view-dashboard .dashboard-month-cell strong { font-size:13px; font-variant-numeric:tabular-nums; }
#view-dashboard .dashboard-month-cell span { font-size:10.5px; opacity:.8; font-variant-numeric:tabular-nums; }
#view-dashboard .dashboard-month-cell.is-level-1 { border-color:#dcebe7; background:#edf7f3; color:#315e52; }
#view-dashboard .dashboard-month-cell.is-level-2 { border-color:#c4e1d8; background:#dcefe9; color:#205d4d; }
#view-dashboard .dashboard-month-cell.is-level-3 { border-color:#99d0c1; background:#c4e7dc; color:#145844; }
#view-dashboard .dashboard-month-cell.is-level-4 { border-color:#59b79f; background:#9ed8c7; color:#073f31; }
#view-dashboard .dashboard-month-empty { display:grid; place-items:center; min-height:58px; color:#b4c0c5; }
#view-dashboard .dashboard-matrix-row-total,
#view-dashboard .dashboard-matrix-total-row td {
  padding: 7px 9px !important;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f5f8f9;
  text-align: right;
}
#view-dashboard .dashboard-matrix-row-total strong,
#view-dashboard .dashboard-matrix-total-row td strong { display:block; color:var(--ink); font-size:12px; }
#view-dashboard .dashboard-matrix-row-total span,
#view-dashboard .dashboard-matrix-total-row td span { display:block; margin-top:2px; color:var(--ink-3); font-size:10.5px; }
#view-dashboard .dashboard-matrix-total-row th {
  background:#f5f8f9 !important;
  padding:7px 10px !important;
  border-radius:6px;
  color:var(--ink-2);
  font-size:12px;
}
#view-dashboard .dashboard-matrix-legend {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  padding:0 18px 16px;
  color:var(--ink-3);
  font-size:10.5px;
}
#view-dashboard .dashboard-matrix-legend i { width:14px; height:10px; border:1px solid #dce6e9; border-radius:3px; }
#view-dashboard .dashboard-matrix-legend .is-level-1 { background:#edf7f3; }
#view-dashboard .dashboard-matrix-legend .is-level-2 { background:#dcefe9; }
#view-dashboard .dashboard-matrix-legend .is-level-3 { background:#c4e7dc; }
#view-dashboard .dashboard-matrix-legend .is-level-4 { background:#9ed8c7; }

#view-dashboard .dashboard-ranking-panel { overflow:hidden; }
#view-dashboard .dashboard-ranking-list {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0 26px;
  padding:0 18px 14px;
}
#view-dashboard .dashboard-ranking-row {
  display:flex;
  align-items:center;
  gap:12px;
  min-height:62px;
  border-bottom:1px solid var(--line);
}
#view-dashboard .dashboard-ranking-index { width:24px; flex:none; color:#90a0a7; font-size:12px; font-variant-numeric:tabular-nums; }
#view-dashboard .dashboard-ranking-person { flex:1; min-width:0; }
#view-dashboard .dashboard-ranking-person strong { display:block; color:var(--ink); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#view-dashboard .dashboard-ranking-person span { display:block; margin-top:3px; color:var(--ink-3); font-size:10.5px; }
#view-dashboard .dashboard-ranking-value { text-align:right; white-space:nowrap; }
#view-dashboard .dashboard-ranking-value strong { display:block; color:#0f766e; font-size:15px; font-variant-numeric:tabular-nums; }
#view-dashboard .dashboard-ranking-value span { display:block; margin-top:2px; color:var(--ink-3); font-size:10px; }
#view-dashboard .dashboard-filter-chip {
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:30px;
  padding:0 9px;
  border:1px solid #bcd8d1;
  border-radius:7px;
  background:#eef8f5;
  color:#14634f;
  font-size:11.5px;
  cursor:pointer;
}
#view-dashboard .dashboard-filter-chip svg.lucide { width:13px; height:13px; }

@media (max-width: 1180px) {
  #view-dashboard .dashboard-insights { grid-template-columns:1fr; }
  #view-dashboard .dashboard-ranking-list { grid-template-columns:1fr; }
}
@media (max-width: 820px) {
  #view-dashboard .dashboard-insight { min-height:0; }
  #view-dashboard .dashboard-matrix-wrap { padding-left:12px; padding-right:12px; }
  #view-dashboard .dashboard-panel-head { gap:10px; }
  #view-dashboard .dashboard-filter-chip { align-self:flex-start; }
}

/* ---------------- 数据概览：BI 卡片布局 ---------------- */
.bi-dash { display:flex; flex-direction:column; gap:14px; }
.bi-summary {
  display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap;
  padding:14px 18px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.bi-summary-main { display:flex; align-items:center; gap:10px; flex-wrap:wrap; color:var(--ink-2); font-size:14px; }
.bi-summary-main strong { color:var(--accent-dark); font-size:16px; }
.bi-summary-main b { color:var(--accent-dark); font-size:19px; font-variant-numeric:tabular-nums; }
.bi-summary-main .bi-sep { color:var(--line-strong); }
.bi-summary-time { color:var(--ink-3); font-size:12px; }
.bi-grid { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:14px; }
.bi-card {
  display:flex; flex-direction:column; min-height:258px;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:12px 14px 10px; box-shadow:var(--shadow);
}
.bi-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.bi-card-head h3 { margin:0; font-size:15px; font-weight:600; color:var(--ink); }
.bi-card-head span { display:block; margin-top:2px; font-size:12px; color:var(--ink-3); }
.bi-export {
  flex:none; width:28px; height:28px; display:grid; place-items:center; cursor:pointer;
  border:1px solid transparent; border-radius:var(--radius-sm); background:transparent; color:var(--ink-3);
}
.bi-export:hover { background:var(--surface-soft); border-color:var(--line); color:var(--accent); }
.bi-export svg { width:16px; height:16px; }
.bi-card-body { flex:1; display:flex; flex-direction:column; justify-content:center; min-height:0; margin-top:6px; }
.bi-svg { width:100%; height:100%; max-height:212px; }
.bi-axis { stroke:#dde5e8; stroke-width:1; }
.bi-bar-rect { fill:#2f9e6e; }
.bi-bar-value { font-size:11px; font-weight:600; fill:#33454d; }
.bi-bar-label { font-size:11px; fill:#86959d; }
.bi-empty { display:grid; place-items:center; min-height:140px; color:var(--ink-3); font-size:13px; }
.bi-donut { display:flex; align-items:center; gap:10px; min-width:0; }
.bi-donut-svg { width:138px; height:138px; flex:none; }
.bi-donut-seg { transform-origin:21px 21px; }
.bi-donut-total { font-size:5.4px; font-weight:600; fill:#1b2529; }
.bi-donut-unit { font-size:3.4px; fill:#86959d; }
.bi-legend { flex:1; display:flex; flex-direction:column; gap:4px; min-width:0; }
.bi-legend-row { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--ink-2); }
.bi-legend-row i { width:8px; height:8px; border-radius:2px; flex:none; }
.bi-legend-row span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bi-legend-row strong { font-variant-numeric:tabular-nums; color:var(--ink); font-weight:600; }
.bi-rank { display:flex; flex-direction:column; }
.bi-rank-row { display:flex; align-items:center; gap:8px; padding:6px 2px; border-bottom:1px dashed #eef2f4; font-size:13px; }
.bi-rank-row:last-child { border-bottom:0; }
.bi-rank-idx { width:16px; flex:none; color:var(--ink-3); font-size:12px; }
.bi-rank-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bi-rank-value { font-variant-numeric:tabular-nums; color:var(--accent-dark); }
.bi-dash .dashboard-detail-panel { margin:0; }
.bi-quarters { display:flex; flex-wrap:wrap; gap:8px; }
.bi-quarter {
  padding:7px 14px; border-radius:999px; border:1px solid var(--line);
  background:var(--surface); color:var(--ink-2); cursor:pointer; font-size:13px;
}
.bi-quarter:hover { border-color:var(--accent); color:var(--accent-dark); }
.bi-quarter.is-active { background:var(--accent); border-color:var(--accent); color:#fff; }
.bi-people-section { display:flex; flex-direction:column; gap:10px; }
.bi-section-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding:4px 2px; }
.bi-section-head h3 { margin:0; font-size:16px; }
.bi-section-head span { color:var(--ink-3); font-size:13px; }
.bi-people { display:flex; flex-direction:column; gap:14px; }
.bi-person {
  background:var(--surface); border:1px solid var(--line); border-radius:var(--radius);
  padding:14px 16px; box-shadow:var(--shadow);
}
.bi-person-head { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.bi-person-avatar {
  width:34px; height:34px; border-radius:50%; display:grid; place-items:center; flex:none;
  background:var(--accent-soft); color:var(--accent-dark); font-weight:600;
}
.bi-person-title h3 { margin:0; font-size:15px; }
.bi-person-title span { font-size:12px; color:var(--ink-3); }
.bi-person-kpis { margin-left:auto; display:flex; gap:24px; flex-wrap:wrap; }
.bi-person-kpis div { text-align:right; }
.bi-person-kpis span { display:block; font-size:12px; color:var(--ink-3); }
.bi-person-kpis strong { font-size:17px; font-variant-numeric:tabular-nums; color:var(--accent-dark); }
.bi-person-body { display:grid; grid-template-columns:minmax(220px,1fr) minmax(220px,1fr) 1fr; gap:18px; margin-top:12px; }
.bi-mini-title { font-size:12px; color:var(--ink-3); margin-bottom:4px; }
.bi-person-body .bi-svg { max-height:150px; }
.bi-month-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:14px; }
.bi-month-card { min-height:0; }
button.bi-legend-row {
  width:100%; background:transparent; border:0; border-radius:var(--radius-sm);
  padding:4px 6px; cursor:pointer; text-align:left; font:inherit; color:inherit;
}
button.bi-legend-row:hover { background:var(--surface-soft); }
button.bi-legend-row.is-active { background:var(--accent-soft); }
.bi-legend-detail { margin-top:10px; border-top:1px solid var(--line); padding-top:10px; }
.bi-legend-detail-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:6px; }
.bi-legend-detail-head strong { font-size:14px; }
.bi-legend-detail-head span { font-size:12px; color:var(--ink-3); }
.bi-legend-detail-head b { color:var(--accent-dark); font-size:15px; }
.bi-customer-table { width:100%; border-collapse:collapse; font-size:12px; }
.bi-customer-table th {
  text-align:left; color:var(--ink-3); font-weight:500; white-space:nowrap;
  padding:5px 4px; border-bottom:1px solid var(--line);
}
.bi-customer-table td { padding:5px 4px; border-bottom:1px dashed #eef2f4; }
.bi-customer-table tr:last-child td { border-bottom:0; }
.bi-customer-table .num { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
@media (max-width: 1200px) { .bi-month-grid { grid-template-columns:1fr; } }
@media (max-width: 1200px) {
  .bi-person-body { grid-template-columns:1fr; }
  .bi-person-kpis { margin-left:0; }
}
@media (max-width: 1500px) { .bi-grid { grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width: 900px) {
  .bi-grid { grid-template-columns:1fr; }
  .bi-card { min-height:0; }
  .bi-donut { flex-direction:column; align-items:stretch; }
  .bi-donut-svg { align-self:center; }
}


.icp-link {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, .52);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
}
.icp-link:hover { color: rgba(255, 255, 255, .82); }
