:root {
  /* Modern color system */
  --bg-page: #f0f2f5;
  --bg-surface: #ffffff;
  --bg-hover: #f5f7fa;
  --bg-tag: #f1f5f9;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-header: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 50%, #2563eb 100%);

  --text-primary: #1a202c;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --text-light: #ffffff;

  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-strong: #cbd5e1;

  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --blue-bg: #eff6ff;
  --blue-border: #bfdbfe;

  --green: #22c55e;
  --green-dark: #16a34a;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;

  --yellow: #eab308;
  --yellow-bg: #fefce8;
  --yellow-border: #fef08a;

  --orange: #f97316;
  --orange-bg: #fff7ed;
  --orange-border: #fed7aa;

  --red: #ef4444;
  --red-dark: #dc2626;
  --red-bg: #fef2f2;
  --red-border: #fecaca;

  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;
  --purple-border: #ddd6fe;

  --cyan: #06b6d4;
  --cyan-bg: #ecfeff;
  --cyan-border: #a5f3fc;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 2px 8px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.04);
  --shadow-blue: 0 4px 14px rgba(59,130,246,.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ============ 首屏启动保护（2026-09-15）============
   问题：HTML 里的 v-if 与 {{ }} 只由 Vue 处理；在「脚本下载完成 → 应用 mount()」这段时间
   （弱网/2Mbps 出口下可达数秒）浏览器已把整段 HTML 画出来，于是：
     · 所有 v-if 控制的弹窗/遮罩「全部预先弹出」并堆叠
     · 所有 {{ }} 插值原样显示为文本
   修复：给 #app 加 v-cloak，Vue 挂载完成时才会移除该属性 → 挂载前整体隐藏，绝不出现上述现象。
   另外提供 #boot-splash 启动占位（挂在 #app 外面，因此不受 v-cloak 影响），
   挂载完成后由页面脚本给 body 加 .app-ready 隐藏它。 */
[v-cloak] { display: none !important; }

#boot-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg-page);
}
#boot-splash .boot-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #d7e0ec; border-top-color: var(--blue);
  animation: boot-spin .8s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }
#boot-splash .boot-text { font-size: 13px; color: var(--text-secondary); }
#boot-splash .boot-slow { display: none; font-size: 12px; color: #94a3b8; text-align: center; line-height: 1.7; }
#boot-splash.is-slow .boot-slow { display: block; }
/* 挂载成功后隐藏启动占位（页面脚本在 mount() 之后给 body 加 .app-ready） */
body.app-ready #boot-splash { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; transition: color .15s; }
a:hover { color: var(--blue-dark); }

/* ============ App layout (sidebar + main) ============ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ============ Sidebar ============ */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #1e3a5f 0%, #1a2d47 100%);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0,0,0,.15);
}
.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon { font-size: 22px; }
.logo-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-section { margin-bottom: 10px; }
.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 8px 12px 4px;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 4px;
}
.nav-section:first-child .nav-section-title {
  border-top: none;
  margin-top: 0;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s;
  cursor: pointer;
  white-space: nowrap;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.sidebar-nav a.active {
  background: rgba(59,130,246,.25);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--blue);
}
.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  opacity: .8;
}
.nav-icon-red { color: var(--red); opacity: 1; }
.nav-icon-green { color: var(--green); opacity: 1; }
.nav-text { flex: 1; }
.nav-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}
.nav-badge-red {
  background: var(--red);
  color: #fff;
  box-shadow: 0 1px 4px rgba(239,68,68,.4);
}
.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-link {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  transition: color .15s;
}
.sidebar-link:hover { color: #fff; }

/* ============ Main area ============ */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ============ Sub-header ============ */
.sub-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  box-shadow: var(--shadow-xs);
}
.sub-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sub-header-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.tracker-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tracker-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px 5px 7px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .2s;
}
.tracker-chip:hover {
  border-color: var(--blue-border);
  background: var(--blue-bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.tracker-chip.active {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: var(--blue-dark);
  box-shadow: var(--shadow-xs);
}
.chip-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.chip-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}
.chip-red { background: var(--red); color: #fff; box-shadow: 0 1px 4px rgba(239,68,68,.3); }

/* ============ Header nav tabs (in dark header) ============ */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-tabs a {
  padding: 6px 13px;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 7px;
  transition: all .2s;
  white-space: nowrap;
  cursor: pointer;
}
.nav-tabs a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-tabs a.active {
  background: rgba(255,255,255,.18);
  color: #fff;
  font-weight: 600;
}
.header-divider { width: 1px; height: 24px; background: rgba(255,255,255,.2); margin: 0 4px; flex-shrink: 0; }

/* ============ Main content ============ */
.main { padding: 24px; flex: 1; }

/* ============ Cards ============ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow); }
.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
}

/* ============ Stat cards ============ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: all .2s;
  box-shadow: var(--shadow-xs);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--blue);
  opacity: .8;
}
.stat-card.danger::before { background: var(--red); }
.stat-card.warning::before { background: var(--orange); }
.stat-card.success::before { background: var(--green); }
.stat-card .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.stat-card .value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.stat-card .sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.stat-card.danger .value { color: var(--red); }
.stat-card.warning .value { color: var(--orange); }
.stat-card.success .value { color: var(--green); }

/* ============ Project Grid (重点关注项目卡片) ============ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 4px 0;
}
.project-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.project-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}
.project-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-size: 12px;
  background: var(--bg-tag);
  text-transform: uppercase;
  letter-spacing: .03em;
}
table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
table tr { transition: background .15s; }
table tr:hover td { background: var(--bg-hover); }
table tr:last-child td { border-bottom: none; }

/* ============ Badges ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-red { background: var(--red-bg); color: var(--red-dark); border: 1px solid var(--red-border); }
.badge-orange { background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange-border); }
.badge-yellow { background: var(--yellow-bg); color: #a16207; border: 1px solid var(--yellow-border); }
.badge-green { background: var(--green-bg); color: var(--green-dark); border: 1px solid var(--green-border); }
.badge-blue { background: var(--blue-bg); color: var(--blue-dark); border: 1px solid var(--blue-border); }
.badge-gray { background: var(--bg-tag); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-purple { background: var(--purple-bg); color: var(--purple); border: 1px solid var(--purple-border); }
/* 2026-09-03：混合采购类型（如「大货样+大货」合并 PO）徽标，绿色系与 po-chip.pt-mixed 呼应 */
.badge-mixed { background: #CDE8D5; color: #0E6E58; border: 1px solid #9FD4BF; }

/* ============ Risk dot ============ */
.risk-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.8);
}
.risk-dot-red { background: var(--red); box-shadow: 0 0 0 2px rgba(255,255,255,.8), 0 0 6px rgba(239,68,68,.4); }
.risk-dot-orange { background: var(--orange); }
.risk-dot-yellow { background: var(--yellow); }
.risk-dot-green { background: var(--green); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-tertiary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.btn:active { transform: translateY(0); }
.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
  box-shadow: none;
}
.btn:disabled:hover,
.btn[disabled]:hover {
  background: inherit;
  border-color: inherit;
  transform: none;
  box-shadow: none;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 7px; }
.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 2px 8px rgba(239,68,68,.2);
}
.btn-danger:hover { background: var(--red-dark); }
.btn-success {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  box-shadow: 0 2px 8px rgba(34,197,94,.2);
}
.btn-success:hover { background: var(--green-dark); }

/* ============ Tracker cards ============ */
.tracker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.tracker-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all .2s;
  box-shadow: var(--shadow-xs);
}
.tracker-card:hover {
  border-color: var(--blue-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tracker-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.tracker-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.tracker-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ts-item {
  text-align: center;
  padding: 8px 4px;
  background: var(--bg-tag);
  border-radius: var(--radius-sm);
}
.ts-label { font-size: 11px; color: var(--text-tertiary); margin-bottom: 2px; }
.ts-value { font-size: 20px; font-weight: 800; }
.tracker-alert-bar {
  margin-top: 10px;
  text-align: center;
  padding: 6px;
  background: var(--red-bg);
  border-radius: var(--radius-sm);
}

/* ============ Text colors ============ */
.text-danger { color: var(--red) !important; }
.text-warning { color: var(--orange) !important; }
.text-success { color: var(--green) !important; }
.text-tertiary { color: var(--text-tertiary); }

/* ============ Progress timeline ============ */
.timeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 12px 0;
}
.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-surface);
  border: 2.5px solid var(--border-strong);
  color: var(--text-tertiary);
  transition: all .2s;
  box-shadow: 0 2px 4px rgba(0,0,0,.06);
}
.timeline-dot.done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(34,197,94,.3);
}
.timeline-dot.pending { border-color: var(--text-tertiary); }
.timeline-dot.current {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59,130,246,.3);
}
.timeline-dot.overdue {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239,68,68,.3);
  animation: pulse-red 2s infinite;
}
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
.timeline-line {
  flex: 1;
  height: 2.5px;
  background: var(--border-strong);
  min-width: 20px;
  border-radius: 2px;
}
.timeline-line.done { background: var(--green); }
.timeline-label {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 5px;
  text-align: center;
  white-space: nowrap;
  font-weight: 500;
}

/* ============ Progress mini bar ============ */
.progress-mini {
  display: flex;
  align-items: center;
  gap: 8px;
}
.progress-mini-bar {
  width: 50px;
  height: 7px;
  border-radius: 4px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.progress-mini-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width .3s;
}
.progress-mini > span {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 500;
}

/* Supplier portal progress bar */
.supplier-progress {
  width: 90px;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.supplier-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
  background: linear-gradient(90deg, var(--blue) 0%, var(--cyan) 100%);
}

/* ============ Alert items ============ */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  border: 1px solid;
  transition: all .2s;
}
.alert-item:hover { transform: translateX(2px); box-shadow: var(--shadow-sm); }
.alert-item.red { background: var(--red-bg); border-color: var(--red-border); }
.alert-item.orange { background: var(--orange-bg); border-color: var(--orange-border); }
.alert-item.yellow { background: var(--yellow-bg); border-color: var(--yellow-border); }
.alert-item .alert-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  font-weight: 700;
  color: #fff;
}
.alert-item.red .alert-icon { background: var(--red); box-shadow: 0 2px 6px rgba(239,68,68,.3); }
.alert-item.orange .alert-icon { background: var(--orange); box-shadow: 0 2px 6px rgba(249,115,22,.3); }
.alert-item.yellow .alert-icon { background: var(--yellow); box-shadow: 0 2px 6px rgba(234,179,8,.3); }
.alert-item .alert-body { flex: 1; min-width: 0; }
.alert-item .alert-title { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.alert-item .alert-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.alert-item .alert-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ============ Alert table (list view) ============ */
.alert-table {
  width: 100%;
  border-collapse: collapse;
}
.alert-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  background: var(--bg-tag);
  white-space: nowrap;
}
.alert-table tbody tr {
  transition: background .15s;
  border-bottom: 1px solid var(--border-light);
}
.alert-table tbody tr:hover { background: var(--bg-hover); }
.alert-table tbody tr.alert-row-red { border-left: 3px solid var(--red); }
.alert-table tbody tr.alert-row-orange { border-left: 3px solid var(--orange); }
.alert-table tbody tr.alert-row-yellow { border-left: 3px solid var(--yellow); }
.alert-table td {
  padding: 10px 12px;
  font-size: 13px;
  vertical-align: top;
}
.alert-table .alert-msg { font-weight: 500; line-height: 1.5; }
.alert-table .alert-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.alert-level-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
}
.alert-level-dot.red { background: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.alert-level-dot.orange { background: var(--orange); box-shadow: 0 0 0 3px rgba(249,115,22,.15); }
.alert-level-dot.yellow { background: var(--yellow); box-shadow: 0 0 0 3px rgba(234,179,8,.15); }

/* ============ Supplier portal ============ */
.supplier-header {
  background: var(--bg-header);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(30,58,95,.15);
}
.supplier-header h1 { font-size: 17px; font-weight: 700; color: #fff; }
.supplier-header .sub { font-size: 12px; color: rgba(255,255,255,.7); }

/* 2026-09-15 修复「右侧内容区空白」（根因 + 配套规则）：
   根因：supplier.html 的 #app 漏了 class="app-layout"（平台端 index.html 有），
   于是 #app 停留在 display:block —— 而 .sidebar 定义了 height:100vh，
   作为块级元素它独占整个首屏，右侧内容区被挤到视口下方，
   表现为「左侧菜单栏在、右侧一片空白」；窄屏（≤768px）因
   .sidebar{height:auto; position:fixed} 反而不受影响，
   这也是「放大到移动端断点后内容才出现」的原因。
   已在 HTML 补上 .app-layout；以下为内容区在 flex 布局下的配套规则。 */
.supplier-content { flex: 1; min-width: 0; }

/* 2026-09-21 变更订单列表：变更前一行仅给「实际发生变化的字段」加删除线 */
.chg-del { text-decoration: line-through; color: var(--text-secondary); }
/* 变更后一行的对应字段轻微高亮，方便对照 */
.chg-after { color: var(--blue); font-weight: 600; }
.supplier-main { padding: 20px; max-width: 1700px; margin: 0 auto; }

.order-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
}
.order-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.order-card .order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.order-card .order-code { font-size: 12px; color: var(--text-secondary); }
.order-card .order-product { font-size: 15px; font-weight: 600; margin: 4px 0; }
.order-card .order-meta { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.order-card .order-meta span { margin-right: 14px; }

.node-list { margin-top: 14px; }
.node-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border-light);
}
.node-item:first-child { border-top: none; }
.node-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all .2s;
}
.node-icon.done { background: var(--green); color: #fff; box-shadow: 0 2px 6px rgba(34,197,94,.25); }
.node-icon.current { background: var(--blue); color: #fff; box-shadow: 0 2px 8px rgba(59,130,246,.3); }
.node-icon.pending { background: var(--bg-tag); color: var(--text-tertiary); border: 1.5px solid var(--border); }
.node-icon.overdue { background: var(--red); color: #fff; box-shadow: 0 2px 6px rgba(239,68,68,.25); }
.node-info { flex: 1; min-width: 0; }
.node-info .node-name { font-weight: 500; font-size: 13px; }
.node-info .node-date { font-size: 11px; color: var(--text-secondary); }
.node-action { flex-shrink: 0; }

/* ============ Forms ============ */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: all .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* ============ Tabs ============ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 18px;
}
.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  transition: all .2s;
  margin-bottom: -2px;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--blue-dark); border-bottom-color: var(--blue); font-weight: 600; }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 90%;
  max-width: 600px;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal h2 { font-size: 18px; font-weight: 700; margin-bottom: 18px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ============ Empty state ============ */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
}
.empty .icon { font-size: 36px; margin-bottom: 10px; opacity: .5; }

/* ============ Loading ============ */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-tertiary);
}

/* ============ Utility ============ */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-secondary { color: var(--text-secondary); }
.font-medium { font-weight: 500; }
.cursor-pointer { cursor: pointer; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ============ Sidebar user info ============ */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

/* ============ Sync banner ============ */
.sync-banner {
  background: linear-gradient(135deg, var(--green-bg) 0%, var(--blue-bg) 100%);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideDown .3s ease;
}
@keyframes slideDown {
  /* 2026-09-03：translateY 与 fixed 居中的 translateX(-50%) 合并，避免动画结束态覆盖居中 */
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============ Real-time banner (supplier) ============ */
.realtime-banner {
  /* 2026-09-03：改为 fixed 浮层，避免插入/消失时推动下方内容造成页面跳动。
     触发频繁（SSE 每次订单更新都闪），固定在顶部居中浮层即可。 */
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-md);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 6px;
  animation: slideDown .3s ease;
}

/* ============ Upload area ============ */
.upload-area {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-area:hover {
  border-color: var(--blue);
  background: var(--blue-bg);
}
.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 13px;
}
.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.upload-preview-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tag);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
}
.upload-preview-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-add-more {
  font-size: 12px;
  color: var(--blue);
  font-weight: 600;
  padding: 4px 12px;
  border: 1px dashed var(--blue-border);
  border-radius: var(--radius-sm);
}

/* ============ Code style ============ */
code {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 13px;
}

/* ============ Export button icon ============ */
.btn-sm[title] {
  position: relative;
}

/* ============ 筛选区统一布局（订单列表等） ============ */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}
.filter-bar .form-input,
.filter-bar .form-select {
  width: auto;
  min-width: 120px;
}
.filter-searchable {
  position: relative;
  display: inline-block;
}
.filter-searchable .filter-search-input {
  position: absolute;
  top: -1px;
  left: 1px;
  height: 30px;
  width: 120px;
  font-size: 12px;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px 0 0 6px;
  z-index: 1;
}
.filter-searchable .form-select {
  padding-left: 130px;
  min-width: 200px;
  border-radius: 6px;
  background: #fff;
}
/* ============ Responsive ============ */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
    overflow: hidden;
  }
  .sidebar .nav-text,
  .sidebar .nav-section-title,
  .sidebar .nav-badge,
  .sidebar .sidebar-user > div,
  .sidebar .sidebar-footer > div:last-child {
    display: none;
  }
  .sidebar-logo {
    justify-content: center;
  }
  .main { padding: 12px; }
  .stat-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ============ Dashboard Mobile Optimization ============ */
@media (max-width: 768px) {
  /* 侧边栏改为底部固定导航栏 */
  .app-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(0,0,0,.15);
    padding: 0;
    max-height: 56px;
  }
  .sidebar-header { display: none; }
  .sidebar-nav {
    flex-direction: row;
    padding: 0;
    gap: 0;
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-section { margin: 0; display: flex; flex-shrink: 0; }
  .nav-section-title { display: none; }
  .sidebar-nav a {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 11px;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    min-width: 56px;
  }
  .nav-section .nav-text { display: block !important; font-size: 10px; }
  .nav-section .nav-icon { font-size: 16px; }
  .nav-section .nav-badge { font-size: 8px; min-width: 14px; height: 14px; line-height: 14px; padding: 0 3px; }
  .sidebar-footer { display: none; }

  /* 主区域底部留出导航栏空间 */
  .main-area { padding-bottom: 60px; }

  /* 子头部跟单员选择 — 横向滚动 */
  .sub-header-inner { flex-wrap: wrap; }
  .tracker-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .tracker-chip { flex-shrink: 0; }

  /* 卡片标题 — 垂直堆叠 */
  .card-title {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .card-title > .flex { flex-wrap: wrap; }

  /* 统计卡片 — 2列紧凑 */
  .stat-grid { gap: 8px !important; }
  .stat-card { padding: 12px; }
  .stat-card .value { font-size: 20px; }
  .stat-card .label { font-size: 12px; }
  .stat-card .sub { font-size: 11px; }

  /* 两列布局改为单列 */
  .stat-grid[style*="2fr 1fr"] { grid-template-columns: 1fr !important; }

  /* 表格 — 横向滚动 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 700px; }
  .table-wrap th, .table-wrap td { padding: 8px 10px; font-size: 12px; white-space: nowrap; }

  /* 弹窗 — 全屏底部弹出 */
  .modal-overlay { padding: 0; align-items: flex-end; z-index: 2000; }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 14px 14px 0 0;
    padding: 16px;
    overflow-y: auto;
  }
  .modal h2 { font-size: 16px; margin-bottom: 12px; }

  /* 筛选栏 — 紧凑排列 */
  .form-input, .form-select { font-size: 13px; }
  .btn-sm { padding: 6px 12px; font-size: 12px; }

  /* 预警项 — 紧凑 */
  .alert-item { padding: 10px 8px; }
  .alert-title { font-size: 13px; }
  .alert-desc { font-size: 11px; }

  /* 项目卡片 — 单列 */
  .project-grid { grid-template-columns: 1fr !important; }

  /* 维度切换器 — 紧凑 */
  .pill-group { flex-wrap: wrap; }
  .pill { padding: 4px 10px; font-size: 12px; }

  /* 跟单员卡片 — 单列 */
  .tracker-grid { grid-template-columns: 1fr !important; }

  /* 导入区域 */
  .import-drop-zone { padding: 20px 12px; }
  .import-drop-icon { font-size: 32px; }
}

/* ============ Order Import ============ */
.import-drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-hover);
}
.import-drop-zone:hover {
  border-color: var(--blue);
  background: var(--blue-bg);
}
.import-drop-zone.dragover {
  border-color: var(--blue);
  background: var(--blue-bg);
  transform: scale(1.01);
}
.import-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.import-drop-icon {
  font-size: 48px;
  opacity: 0.5;
}
.import-drop-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.import-drop-hint {
  font-size: 13px;
  color: var(--text-tertiary);
}
.import-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.import-file-icon {
  font-size: 32px;
}
.import-progress-bar {
  width: 200px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.import-progress-fill {
  position: absolute;
  width: 40%;
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
  animation: importProgress 1.2s infinite ease-in-out;
}
@keyframes importProgress {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* ============ 基表管理 ============ */
.base-table-container .data-table th {
  background: var(--bg-card-header, #f0f5ff);
  font-weight: 600;
  font-size: 13px;
}
.base-table-container .data-table td {
  font-size: 13px;
}
.base-table-container .btn-primary {
  background: var(--blue);
  color: #fff;
  border: none;
}
.base-table-container .btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.base-table-container .btn-primary:disabled,
.base-table-container .btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============ 供应商门户模块导航 ============ */
.module-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.module-nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .2s;
  white-space: nowrap;
}
.module-nav-item:hover {
  background: var(--bg-page);
  color: var(--text-primary);
}
.module-nav-item.active {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(59,130,246,.25);
}
.module-nav-icon {
  font-size: 16px;
}
.module-nav-label {
  font-size: 13px;
}
.module-nav-count {
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  background: rgba(0,0,0,.08);
  font-size: 11px;
  font-weight: 600;
  padding: 0 4px;
}
.module-nav-item.active .module-nav-count {
  background: rgba(255,255,255,.25);
  color: #fff;
}
.module-nav-count.red {
  background: var(--red);
  color: #fff;
}
.module-nav-item.active .module-nav-count.red {
  background: rgba(255,255,255,.3);
  color: #fff;
}

/* 预警统计栏 */
.alert-stats-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.alert-stat-item {
  flex: 1;
  padding: 12px 8px;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  border: 2px solid transparent;
  background: var(--bg-surface);
}
.alert-stat-item:hover {
  border-color: var(--border-strong);
}
.alert-stat-item.active {
  border-color: var(--blue);
  background: var(--blue-bg);
}
.alert-stat-item.red.active {
  border-color: var(--red);
  background: var(--red-bg);
}
.alert-stat-item.orange.active {
  border-color: var(--orange);
  background: var(--orange-bg);
}
.alert-stat-item.yellow.active {
  border-color: #eab308;
  background: rgba(234,179,8,.08);
}
.alert-stat-num {
  display: block;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}
.alert-stat-item.red .alert-stat-num { color: var(--red); }
.alert-stat-item.orange .alert-stat-num { color: var(--orange); }
.alert-stat-item.yellow .alert-stat-num { color: #a16207; }
.alert-stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.alert-stat-item.active .alert-stat-label {
  font-weight: 600;
}

/* 预警列表项 */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}
.alert-item.red {
  border-color: var(--red-border);
  background: var(--red-bg);
}
.alert-item.orange {
  border-color: var(--orange-border);
  background: var(--orange-bg);
}
.alert-item.yellow {
  border-color: rgba(234,179,8,.3);
  background: rgba(234,179,8,.06);
}
.alert-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.alert-item.red .alert-icon { background: var(--red); color: #fff; }
.alert-item.orange .alert-icon { background: var(--orange); color: #fff; }
.alert-item.yellow .alert-icon { background: #eab308; color: #fff; }
.alert-body {
  flex: 1;
  min-width: 0;
}
.alert-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

/* 响应式 - 模块导航 */
@media (max-width: 768px) {
  .module-nav {
    flex-direction: column;
    gap: 2px;
  }
  .module-nav-item {
    justify-content: flex-start;
    padding: 12px 16px;
  }
  .alert-stats-bar {
    flex-wrap: wrap;
  }
  .alert-stat-item {
    min-width: calc(50% - 4px);
  }
}

/* ============ 供应商门户三端自适应 ============ */

/* 设备标识徽章 */
.device-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  margin-left: 8px;
}
.device-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
}

/* === 1. 桌面端 (>1024px) — 完整布局 === */
.supplier-main { max-width: 1700px; }

/* === 2. 平板端 (768px-1024px) — 触控优化 === */
@media (max-width: 1024px) and (min-width: 769px) {
  .supplier-main { max-width: 100%; padding: 16px 24px; }
  .supplier-header { padding: 16px 24px; }
  .supplier-header h1 { font-size: 18px; }
  .order-card { padding: 14px 16px; }
  .node-item { padding: 10px 12px; }
  .node-icon { width: 36px; height: 36px; font-size: 14px; }
  .btn-sm { padding: 8px 16px; font-size: 13px; }
  .modal { width: 90%; max-width: 520px; }
}

/* === 3. 手机端 (<768px) — 简化布局，大触控区域 === */
@media (max-width: 768px) {
  /* 全宽布局 */
  .supplier-main { max-width: 100%; padding: 12px; }
  .supplier-header { padding: 12px 16px; }
  .supplier-header h1 { font-size: 16px; }
  .supplier-header .sub { font-size: 11px; line-height: 1.5; }

  /* Tab 栏 — 大触控目标 */
  .tabs { gap: 0; }
  .tab { padding: 10px 8px; font-size: 13px; }

  /* 订单卡片 — 紧凑 */
  .order-card { padding: 12px; border-radius: 10px; margin-bottom: 10px; }
  .order-code { font-size: 14px; }
  .order-product { font-size: 13px; }
  .order-meta { font-size: 12px; flex-wrap: wrap; gap: 4px 12px; }
  .order-meta span { display: inline-block; }

  /* 工艺节点 — 大触控 */
  .node-item { padding: 10px 8px; gap: 10px; }
  .node-icon { width: 32px; height: 32px; font-size: 13px; }
  .node-name { font-size: 14px; }
  .node-date { font-size: 11px; }

  /* 上报按钮 — 大触控区域 */
  .node-action .btn-sm {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 8px;
    min-width: 64px;
  }

  /* 进度条 */
  .supplier-progress { height: 6px; }
  .text-sm { font-size: 12px !important; }

  /* 弹窗 — 全屏底部弹出 */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    padding: 16px;
    overflow-y: auto;
  }
  .modal h2 { font-size: 17px; }

  /* 表单元素 — 大输入区域 */
  .form-input, .form-textarea {
    font-size: 16px; /* iOS 防缩放 */
    padding: 12px 14px;
  }

  /* 上传区域 */
  .upload-area { padding: 16px; }
  .upload-placeholder { font-size: 13px; }
  .upload-preview-item { gap: 8px; }
  .upload-preview-name { font-size: 12px; max-width: 120px; }

  /* 弹窗按钮 — 大触控 */
  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-footer .btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    border-radius: 10px;
  }

  /* 供应商选择列表 — 大触控 */
  .order-card[style*="cursor:pointer"] { padding: 14px 12px; }
  .font-medium { font-size: 15px; }

  /* 预警提示 — 紧凑 */
  .alert-item { padding: 6px 10px !important; }
  .alert-title { font-size: 12px !important; }

  /* 风险指示灯 — 更大 */
  .risk-dot { width: 10px; height: 10px; }

  /* badge 字号 */
  .badge { font-size: 10px; padding: 2px 6px; }

  /* 表格 — 允许横向滚动 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 800px; }
  .table-wrap th, .table-wrap td { padding: 8px 10px; font-size: 12px; }
}

/* === 4. 超小屏 (<375px) — 极简模式 === */
@media (max-width: 375px) {
  .supplier-header h1 { font-size: 14px; }
  .supplier-header .sub { font-size: 10px; }
  .order-code { font-size: 13px; }
  .node-name { font-size: 13px; }
  .tab { font-size: 12px; padding: 8px 4px; }
}

/* === 触控设备优化 === */
@media (hover: none) and (pointer: coarse) {
  .order-card[style*="cursor:pointer"]:active {
    background: var(--bg-hover);
    transform: scale(0.98);
    transition: all 0.1s;
  }
  .btn:active {
    transform: scale(0.96);
    transition: all 0.1s;
  }
}

/* === 安全区域适配（刘海屏/底部横条） === */
@supports (padding: env(safe-area-inset-bottom)) {
  .modal-footer { padding-bottom: env(safe-area-inset-bottom); }
  .supplier-header { padding-top: env(safe-area-inset-top); }
}

/* ============ 2026-09-03 需求4：关联跟单员/供应商 模糊搜索下拉 ============ */
.search-dropdown {
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 6px;
  background: var(--bg-surface, #fff);
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.search-dropdown-item {
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-primary, #333);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-dropdown-item:hover {
  background: var(--bg-hover, #f5f5f5);
}
.search-dropdown-item-active {
  background: var(--blue-bg, #e6f1fb);
  color: var(--blue-dark, #185fa5);
}
.search-dropdown-empty {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-tertiary, #999);
}

/* ==================================================================
   2026-09-03 供应商门户 · 仪表盘 / 订单看板 美化
   ================================================================== */

/* ---- 指标卡：在 .stat-card 基础上加左侧色条与右上角图标 ---- */
.stat-card.dash {
  padding: 14px 16px;
  cursor: default;
}
.stat-card.dash::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border-strong);
}
.stat-card.dash.is-accent::before   { background: var(--blue); }
.stat-card.dash.is-warn::before     { background: var(--orange); }
.stat-card.dash.is-good::before     { background: var(--green); }
.stat-card.dash.is-danger::before   { background: #E24B4A; }

.stat-card.dash.is-clickable { cursor: pointer; }
.stat-card.dash.is-clickable:hover { border-color: #E24B4A; }

.dash-icon {
  position: absolute;
  right: 12px;
  top: 10px;
  font-size: 22px;
  opacity: .16;
  line-height: 1;
}
.dash-label {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: .3px;
}
.dash-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.dash-value.is-accent { color: var(--blue-dark); }
.dash-value.is-warn   { color: #854F0B; }
.dash-value.is-good   { color: var(--green-dark); }
.dash-value.is-danger { color: #A32D2D; }
.dash-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ---- 分区标题 ---- */
.dash-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 14px 16px;
}
.dash-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---- 预警分布：堆叠条 + 图例 ---- */
.alert-bar {
  display: flex;
  height: 22px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--border-light);
}
.alert-bar-seg {
  transition: opacity .15s;
  cursor: help;
}
.alert-bar-seg:hover { opacity: .82; }

.alert-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: 12px;
}
.alert-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.alert-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}
.alert-legend-num {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.alert-legend-pct {
  color: var(--text-tertiary);
  font-size: 11px;
}

/* ---- 交期趋势：柱状图 ---- */
.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 92px;
  padding: 0 2px;
}
.trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  cursor: help;
  min-width: 0;
}
.trend-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 3px 3px 0 0;
  background: #85B7EB;
  transition: background .15s, transform .15s;
  min-height: 3px;
}
.trend-col:hover .trend-bar { background: #378ADD; transform: scaleY(1.04); transform-origin: bottom; }
.trend-bar.is-current { background: #185FA5; }
.trend-bar.is-overdue { background: #E24B4A; }
.trend-val {
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  font-variant-numeric: tabular-nums;
}
.trend-axis {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  padding: 0 2px;
}
.trend-axis-item {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trend-axis-item.is-current { color: var(--blue-dark); font-weight: 600; }

/* ---- 订单看板：日期格子 ---- */
.board-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}
.board-weekday {
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  padding-bottom: 2px;
}
.board-cell {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 7px 4px 6px;
  min-height: 68px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-surface);
  transition: all .16s;
  position: relative;
}
.board-cell:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}
.board-cell.is-outside { opacity: .42; }
.board-cell.is-today   { border-color: var(--blue); background: var(--blue-bg); }
.board-cell.is-picked  { border-color: var(--blue); background: var(--blue-bg); box-shadow: 0 0 0 2px rgba(55,138,221,.16); }
.board-cell.is-empty   { background: transparent; border-style: dashed; }

.board-day {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.board-cell.is-today .board-day { color: var(--blue-dark); font-weight: 600; }
.board-cell.is-weekend .board-day { color: #B44; }

.board-count {
  font-size: 19px;
  font-weight: 700;
  margin-top: 3px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.board-count.is-zero { color: var(--text-tertiary); font-weight: 500; }

.board-od {
  display: inline-block;
  margin-top: 3px;
  font-size: 10px;
  color: #A32D2D;
  background: #FCEBEB;
  border-radius: 8px;
  padding: 1px 5px;
  font-weight: 600;
}

/* ---- 逾期原因标签 ---- */
.od-reason {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  padding: 2px 7px;
  white-space: nowrap;
}
.od-reason-late    { background: #FCEBEB; color: #A32D2D; }  /* 完成超期 */
.od-reason-stalled { background: #FEF3E2; color: #854F0B; }  /* 停滞未操作 */

/* ---- 逾期行数：表格里逾期行淡红底 ---- */
tr.is-overdue-row > td { background: #FEF7F7; }
tr.is-overdue-row:hover > td { background: #FDEDed; }

/* ==================================================================
   2026-09-03 仪表盘 v2 / 看板列视图 · 高端样式
   ================================================================== */

/* ---- 仪表盘标题栏 ---- */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.dash-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---- 6 大数字卡 ---- */
.dash-six-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.dash-big-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.dash-big-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--border-strong);
}
.dash-big-card.is-blue::before      { background: #378ADD; }
.dash-big-card.is-blue .dash-big-value { color: #185FA5; }
.dash-big-card.is-amber::before     { background: #EF9F27; }
.dash-big-card.is-amber .dash-big-value { color: #854F0B; }
.dash-big-card.is-red::before       { background: #E24B4A; }
.dash-big-card.is-red .dash-big-value { color: #A32D2D; }
.dash-big-card.is-red-soft::before  { background: #F58F8F; }
.dash-big-card.is-red-soft .dash-big-value { color: #791F1F; }
.dash-big-card.is-green::before     { background: #639922; }
.dash-big-card.is-green .dash-big-value { color: #3B6D11; }
.dash-big-card.is-purple::before    { background: #7F77DD; }
.dash-big-card.is-purple .dash-big-value { color: #534AB7; }

.dash-big-label {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: .4px;
  font-weight: 500;
}
.dash-big-value {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.dash-big-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
  line-height: 1.5;
}
.dash-bold { font-weight: 600; color: var(--text-secondary); }

/* ---- 金额双卡 ---- */
.dash-money-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.dash-money-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.dash-money-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.dash-money-card.is-transit::before { background: linear-gradient(90deg, #378ADD 0%, #85B7EB 100%); }
.dash-money-card.is-done::before    { background: linear-gradient(90deg, #639922 0%, #97C459 100%); }
.dash-money-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.dash-money-value {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1.15;
}
.dash-money-card.is-transit .dash-money-value { color: #185FA5; }
.dash-money-card.is-done .dash-money-value { color: #3B6D11; }
.dash-money-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
  line-height: 1.5;
}

/* ---- 主区：30天日历 + 预警摘要 ---- */
.dash-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
}
@media (max-width: 980px) {
  .dash-main-grid { grid-template-columns: 1fr; }
}

/* ---- 交期分布 · 月历网格（2026-09-03：日历形式，格内小柱条不改变整体布局）---- */
.dash-cal2 { padding: 2px 0; }
.dash-cal2-head,
.dash-cal2-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.dash-cal2-wd {
  text-align: center;
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 600;
  padding-bottom: 4px;
}
.dash-cal2-cell {
  position: relative;
  height: 52px;               /* 固定格高：柱条在格内伸缩，绝不影响整体布局 */
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  padding: 4px 5px;
  min-width: 0;
  overflow: hidden;
}
.dash-cal2-cell.is-blank { background: transparent; border-color: transparent; }
.dash-cal2-cell.has-data { background: #EAF2FC; border-color: #B9D3F2; }
.dash-cal2-cell.has-data:not(.is-today) { background: #EAF2FC; }
.dash-cal2-cell.is-today {
  background: #EAF2FC;
  border-color: #185FA5;
  box-shadow: inset 0 0 0 1px #185FA5;
}
.dash-cal2-date {
  font-size: 10px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
/* 2026-09-04：格内顶部一行 = 左（日期 + PO数）+ 右（该日订单金额合计） */
.dash-cal2-top {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.dash-cal2-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dash-cal2-amt {
  margin-left: auto;
  max-width: 48px;
  font-size: 9px;
  line-height: 1.25;
  color: #5A7A9E;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.dash-cal2-cell.has-data .dash-cal2-amt { color: #185FA5; }
.dash-cal2-cell.is-today .dash-cal2-amt { color: #185FA5; font-weight: 600; }
.dash-cal2-cell.is-today .dash-cal2-date { color: #185FA5; font-weight: 700; }
.dash-cal2-cell.is-weekend:not(.has-data) .dash-cal2-date { color: #C97A7A; }
.dash-cal2-count {
  font-size: 14px;
  font-weight: 700;
  color: #185FA5;
  line-height: 1.2;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.dash-cal2-bar-wrap {
  margin-top: auto;
  height: 22px;               /* 固定柱条区域：柱高只在此区域内变化 */
  display: flex;
  align-items: flex-end;
}
.dash-cal2-bar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  background: #85B7EB;
  transition: height .2s;
}
.dash-cal2-cell.is-today .dash-cal2-bar { background: #185FA5; }

/* ---- 预警摘要列表 ---- */
.dash-feed {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-feed-item {
  background: var(--bg-page);
  border-left: 3px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 12px;
}
.dash-feed-item.is-red    { border-left-color: #E24B4A; background: #FCEBEB; }
.dash-feed-item.is-orange { border-left-color: #EF9F27; background: #FAEEDA; }
.dash-feed-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
}
.dash-feed-level {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--bg-surface);
  font-weight: 700;
}
.dash-feed-item.is-red .dash-feed-level    { color: #A32D2D; }
.dash-feed-item.is-orange .dash-feed-level { color: #854F0B; }
.dash-feed-title { font-size: 12px; font-weight: 500; }
.dash-feed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-tertiary);
}
.dash-feed-date { margin-left: auto; }
/* 2026-09-04：摘要按 PO 去重后新增的交期/逾期/条数标记 */
.dash-feed-po {
  font-weight: 700;
  color: var(--text-secondary);
}
.dash-feed-overdue {
  color: #A32D2D;
  font-weight: 700;
}
.dash-feed-cnt {
  margin-left: auto;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
}

/* ==================================================================
   看板列视图 · 每列一天，列内堆叠 PO/物料卡片
   ================================================================== */
.board-col-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-snap-type: x proximity;
}
.board-col {
  /* 2026-09-15：168→184px —— 小签改两行后，需容纳「PO 号 + 类型徽标」整行不被压缩 */
  flex: 0 0 184px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 200px;
  cursor: pointer;
  transition: all .15s;
}
.board-col:hover { box-shadow: var(--shadow-xs); }
/* 2026-09-15 需求2①：当日与点选做差异化（原先两者都是蓝色系实线边框，视觉上无法区分）
   - 当日(is-today)：琥珀色**虚线**边框 —— 作为"今天"这个时间锚点的位置标识
   - 点选(is-picked)：深蓝**实线**加粗 + 浅蓝底 + 外发光 —— 表示"当前已选定"
   - 两者同时命中：选中优先（实线），但仍保留浅蓝底以便同时看出"今天被选中" */
.board-col.is-today { border: 2px dashed #C77C1B; box-shadow: none; background: #FFFBF3; }
.board-col.is-picked { border: 2px solid #185FA5; box-shadow: 0 0 0 3px rgba(24,95,165,.22); background: #EFF6FF; }
.board-col.is-today.is-picked { border-style: solid; border-color: #185FA5; background: #EFF6FF; }
.board-col.is-weekend { background: var(--bg-page); }

.board-col-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}
.board-col-date {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
/* 当日日期文字用琥珀色，与「点选」的蓝色区分开 */
.board-col.is-today .board-col-date { color: #C77C1B; font-weight: 700; }
.board-col-count {
  font-size: 20px;
  font-weight: 700;
  margin-top: 2px;
  line-height: 1.1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.board-col-count.is-zero {
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 14px;
}
.board-col-od {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  color: #A32D2D;
  background: #FCEBEB;
  border-radius: 8px;
  padding: 1px 6px;
  font-weight: 600;
}

.board-col-cards {
  flex: 1;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 460px;
}

/* ---- PO 小签（2026-09-03：交期视图列内只显示 PO 号 + 类型）---- */
.po-chip {
  display: flex;
  /* 2026-09-15：改为可换行两行布局 —— 第一行 PO 号 + 类型徽标，第二行供应商名 */
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  row-gap: 2px;
  width: 100%;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
  background: #F2F6FC;
  border: 1px solid var(--border-light);
  transition: all .12s;
}
.po-chip:hover {
  border-color: var(--blue);
  background: #E3EDF9;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  transform: translateY(-1px);
}
.po-chip + .po-chip { margin-top: 4px; }
.po-chip-code {
  flex: 0 0 auto;   /* PO 号永不压缩 —— 保证完整可读（这是小签的主信息） */
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.po-chip-type {
  /* 2026-09-15：原先 flex-shrink:0 会把 PO 号挤成省略号；现改为「可退让」——
     空间不足时优先省略徽标（完整类型信息仍有 title 提示），确保 PO 号完整 */
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.po-chip.pt-sample     .po-chip-type { color: #7F77DD; border-color: #D8D2F2; }
.po-chip.pt-bulkSample .po-chip-type { color: #C77D0E; border-color: #F3DFC0; }
.po-chip.pt-bulk       .po-chip-type { color: #2B6FBE; border-color: #C3D9F4; }
.po-chip.pt-mixed      .po-chip-type { color: #0E8A72; border-color: #BFE3D9; }   /* 大货样+大货 等混合类型 */
.po-chip.is-overdue    { background: #FDECEC; border-color: #E8B4B4; }
.po-chip.is-overdue .po-chip-code { color: #A32D2D; }
.po-chip.is-overdue:hover { background: #FBDEDE; border-color: #D98C8C; }

/* ==========================================================================
   2026-09-23 需求3：采购类型「交期里程碑」
   同一 PO 同时含大货样与大货时，两边最后交期各提示一次，用颜色区分类型。
   配色与订单列表 poTypeBadge 保持一致：产前样=紫 / 大货样=琥珀 / 大货=蓝。
   ========================================================================== */
/* 看板小签：按类型着色（左侧色条 + 类型文字同色） */
.po-chip.ms-sample     { border-left: 3px solid #7F77DD; }
.po-chip.ms-bulkSample { border-left: 3px solid #EF9F27; }
.po-chip.ms-bulk       { border-left: 3px solid #378ADD; }
.po-chip.ms-other      { border-left: 3px solid #B4B2A9; }
.po-chip.ms-sample     .po-chip-type { color: #534AB7; border-color: #D8D2F2; }
.po-chip.ms-bulkSample .po-chip-type { color: #854F0B; border-color: #F3DFC0; }
.po-chip.ms-bulk       .po-chip-type { color: #185FA5; border-color: #C3D9F4; }
.po-chip.ms-other      .po-chip-type { color: #5F5E5A; border-color: #D3D1C7; }
/* 同一 PO 含多个类型时的关联标记（两列里都能看到这个 ⇄，便于认出是同一单） */
.po-chip-link { margin-left: 3px; font-size: 10px; color: #0E8A72; font-weight: 700; }

/* 订单表 / 图例里的里程碑标签 */
.ms-chip {
  display: inline-block;
  padding: 1px 7px;
  margin: 0 4px 2px 0;
  border-radius: 9px;
  border: 1px solid #D3D1C7;
  background: #fff;
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
}
.ms-chip.ms-sample     { color: #534AB7; border-color: #D8D2F2; background: #EEEDFE; }
.ms-chip.ms-bulkSample { color: #854F0B; border-color: #F3DFC0; background: #FAEEDA; }
.ms-chip.ms-bulk       { color: #185FA5; border-color: #C3D9F4; background: #E6F1FB; }
.ms-chip.ms-other      { color: #5F5E5A; border-color: #D3D1C7; background: #F1EFE8; }
.ms-chip.is-overdue    { border-color: #E8B4B4; box-shadow: inset 0 0 0 1px #E8B4B4; }
.ms-chip.is-overdue::after { content: " · 逾期"; font-size: 10px; color: #A32D2D; }

/* ---- PO 卡片 ---- */
.po-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  transition: all .12s;
  position: relative;
}
.po-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  transform: translateY(-1px);
}
.po-card.pt-sample    { border-left: 3px solid #7F77DD; }
.po-card.pt-bulkSample{ border-left: 3px solid #EF9F27; }
.po-card.pt-bulk      { border-left: 3px solid #378ADD; }

.po-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.po-card-code {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.po-card-type {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--bg-tag);
  color: var(--text-secondary);
  font-weight: 500;
}
.pt-sample .po-card-type     { background: #EEEDFE; color: #534AB7; }
.pt-bulkSample .po-card-type { background: #FAEEDA; color: #854F0B; }
.pt-bulk .po-card-type       { background: #E6F1FB; color: #185FA5; }

.po-card-name {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 2px 0 4px;
  min-height: 28px;
}
.po-card-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
}
.po-card-bar-fill {
  height: 100%;
  background: #E24B4A;
  border-radius: 2px;
  transition: width .25s;
}
.po-card-bot {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.po-card-pct { font-weight: 600; color: var(--text-secondary); }

/* ==================================================================
   看板：单日详情视图（点选某天后只显示该天订单清单）
   ================================================================== */
.board-day-detail { padding: 4px 0; }
.board-day-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.board-day-detail-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.board-day-detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.board-day-od {
  font-size: 11px;
  color: #A32D2D;
  background: #FCEBEB;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}
.board-day-detail-tip {
  font-size: 11px;
  color: var(--text-tertiary);
  font-style: italic;
}

/* 单日视图：网格 3~4 列自适应 */
.board-day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.po-card-lg { padding: 10px 12px; }
.po-card-lg .po-card-name { font-size: 12px; min-height: 32px; }
.po-card-lg .po-card-bar { height: 6px; }
.po-card-lg .po-card-bot { font-size: 11px; }

/* ============ 2026-09-15 需求4② + 迭代：看板 PO 小签改为两行 ============
   第一行：PO 号 + 采购类型徽标；第二行：供应商名（小字，独占一行）。
   这样 PO 号不再被供应商名挤到省略号，供应商名也有整行宽度可用。 */
.portal-chip-sup {
  flex: 0 0 100%;      /* 独占第二行 */
  display: block;
  min-width: 0;
  font-size: 8.5px;    /* 比 PO 号（11px）明显小一档，不抢主信息 */
  line-height: 1.2;
  margin-top: 2px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.po-chip:hover .portal-chip-sup { color: var(--text-secondary); }
.po-chip.is-overdue .portal-chip-sup { color: #A32D2D; opacity: .9; }

/* ==================================================================
   2026-09-15 供应商门户右侧内容区（.app-layout 的 flex 子项）
   窄屏（≤768px）时 .sidebar 变为底部固定导航栏（见上方 @media (max-width:768px)），
   给内容区留出底部空间，避免遮挡内容与最后一个操作按钮
   （对齐平台端 .main-area 的 padding-bottom:60px 处理）。
   ================================================================== */
@media (max-width: 768px) {
  .supplier-content { padding-bottom: 60px; }
}
