/* ============ 设计令牌（沿用参考站「鱼圈」视觉）============ */
:root {
  --primary: #1a6dff;
  --primary-light: #4a8cff;
  --primary-lighter: #e6f0ff;
  --primary-dark: #0a4bbf;
  --sidebar-bg: #0a2540;
  --sidebar-hover: rgba(255, 255, 255, .07);
  --bg-page: #f5f9ff;
  --surface: #ffffff;
  --border-color: #dce5f0;
  --text-primary: #0a1a2e;
  --text-secondary: #4a5a72;
  --text-light: #8a9ab0;
  --danger: #f56c6c;
  --danger-bg: #fff1f0;
  --success: #16a34a;
  --success-bg: #ecfdf3;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --radius: 16px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 8px 40px rgba(10, 37, 64, .10);
  --shadow-sm: 0 2px 10px rgba(10, 37, 64, .06);
  --transition: .22s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ============ 登录 ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1200px 600px at 10% -10%, #e8f1ff 0%, var(--bg-page) 55%);
}
.login-container {
  display: flex; max-width: 1000px; width: 100%; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; min-height: 580px;
}
.login-brand {
  flex: 1.15; background: var(--sidebar-bg); padding: 48px 40px; display: flex; flex-direction: column;
  justify-content: center; color: #cddcec; position: relative; overflow: hidden;
}
.login-brand::after {
  content: ''; position: absolute; top: -40%; right: -30%; width: 300px; height: 300px;
  background: rgba(26, 109, 255, .10); border-radius: 50%;
}
.login-brand .brand-icon {
  font-size: 34px; color: var(--primary-light); background: rgba(255, 255, 255, .07);
  width: 72px; height: 72px; border-radius: 16px; display: flex; align-items: center;
  justify-content: center; margin-bottom: 28px; position: relative; z-index: 1;
}
.login-brand h1 { font-size: 28px; font-weight: 700; color: #fff; letter-spacing: .5px; position: relative; z-index: 1; }
.login-brand h1 span { color: var(--primary-light); }
.login-brand .sub { font-size: 13.5px; color: rgba(255, 255, 255, .5); margin-top: 8px; position: relative; z-index: 1; }
.login-brand .feature-list { margin-top: 36px; list-style: none; position: relative; z-index: 1; }
.login-brand .feature-list li {
  display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: rgba(255, 255, 255, .72);
  padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.login-brand .feature-list li:last-child { border-bottom: none; }
.login-brand .feature-list li i { color: var(--primary-light); font-size: 15px; width: 22px; text-align: center; }
.login-brand .deco-dots { position: absolute; bottom: 32px; left: 40px; display: flex; gap: 8px; }
.login-brand .deco-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.login-brand .deco-dots span:first-child { background: var(--primary-light); }

.login-form { flex: 1; padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; }
.form-header h2 { font-size: 24px; font-weight: 700; }
.form-header p { color: var(--text-light); font-size: 13.5px; margin-top: 6px; margin-bottom: 28px; }
.login-error {
  display: none; align-items: center; gap: 8px; background: var(--danger-bg); color: var(--danger);
  border: 1px solid #ffd7d5; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 18px;
}
.login-error.show { display: flex; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 7px; font-weight: 500; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > i {
  position: absolute; left: 14px; color: var(--text-light); font-size: 14px; pointer-events: none;
}
.input-wrap input {
  width: 100%; height: 46px; padding: 0 14px 0 40px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); background: #fbfdff; outline: none; transition: var(--transition);
}
.input-wrap input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(26, 109, 255, .10); }
.input-with-btn input { padding-right: 116px; }
.btn-code {
  position: absolute; right: 6px; height: 34px; padding: 0 12px; border-radius: var(--radius-xs);
  background: var(--primary-lighter); color: var(--primary-dark); font-size: 12.5px; font-weight: 600;
}
.btn-code:disabled { opacity: .55; cursor: not-allowed; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 6px; min-height: 16px; }
.btn-login {
  width: 100%; height: 46px; border-radius: var(--radius-sm); background: var(--primary); color: #fff;
  font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: var(--transition); margin-top: 4px;
}
.btn-login:hover { background: var(--primary-dark); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; color: var(--text-light); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
/* 登录 / 注册 Tab */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tab { flex: 1; height: 40px; border: 1px solid var(--border-color); background: #f7fafd; border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text-light); cursor: pointer; transition: all .15s; }
.auth-tab:hover { color: var(--primary-dark); border-color: var(--primary-light); }
.auth-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn-wechat {
  width: 100%; height: 46px; border-radius: var(--radius-sm); border: 1px solid #cfe6d3;
  background: #f4fdf6; color: #07963f; font-weight: 600; display: flex; align-items: center;
  justify-content: center; gap: 8px; transition: var(--transition);
}
.btn-wechat:hover { background: #e9fbec; }
.login-tip { margin-top: 20px; font-size: 12px; color: var(--text-light); line-height: 1.7; text-align: center; }

/* ============ 布局 ============ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: 0 0 248px; background: var(--sidebar-bg); color: #cddcec;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.logo-icon {
  width: 40px; height: 40px; border-radius: 11px; background: rgba(26,109,255,.22); color: var(--primary-light);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.logo-text strong { display: block; color: #fff; font-size: 15px; letter-spacing: .3px; }
.logo-text small { color: rgba(255,255,255,.42); font-size: 11px; }
.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13.5px; color: rgba(255,255,255,.72); transition: var(--transition); margin-bottom: 3px;
}
.sidebar-nav a i { width: 18px; text-align: center; font-size: 14px; }
.sidebar-nav a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav a.active { background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(26,109,255,.35); }
.sidebar-nav a.hide { display: none; }
.sidebar-nav .nav-group.hide { display: none; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.06); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 6px 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 10px; background: rgba(26,109,255,.22); color: var(--primary-light);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 36px;
}
.user-meta strong { display: block; color: #fff; font-size: 13px; }
.user-meta small { color: rgba(255,255,255,.45); font-size: 11.5px; }
.btn-ghost {
  width: 100%; height: 36px; border-radius: var(--radius-xs); background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.8); font-size: 12.5px; display: flex; align-items: center;
  justify-content: center; gap: 7px; transition: var(--transition);
}
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar .btn-ghost { width: auto; padding: 0 14px; background: #eff5ff; color: var(--primary-dark); height: 34px; }
.topbar .btn-ghost:hover { background: var(--primary-lighter); color: var(--primary-dark); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 16px 26px; background: var(--surface);
  border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 30;
}
.page-title h2 { font-size: 18px; font-weight: 700; }
.page-title p { font-size: 12.5px; color: var(--text-light); margin-top: 2px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.btn-menu { display: none; font-size: 17px; color: var(--text-secondary); }
.content { padding: 22px 26px 40px; }
.page { display: none; }
.page.active { display: block; animation: fadeUp .22s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============ 卡片 / 指标 ============ */
.card {
  background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 18px; overflow: hidden;
}
.card-header {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border-color);
}
.card-header h3 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-header h3 i { color: var(--primary); }
.card-header .spacer { margin-left: auto; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 0; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card {
  background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--radius);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm);
}
.metric-icon {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 18px; flex: 0 0 44px;
}
.metric-card span { display: block; font-size: 12.5px; color: var(--text-light); }
.metric-card strong { display: block; font-size: 22px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.metric-card small { display: block; font-size: 11.5px; color: var(--text-light); margin-top: 2px; }
.metric-blue .metric-icon { background: var(--primary-lighter); color: var(--primary); }
.metric-green .metric-icon { background: var(--success-bg); color: var(--success); }
.metric-orange .metric-icon { background: var(--warning-bg); color: var(--warning); }
.metric-red .metric-icon { background: var(--danger-bg); color: var(--danger); }

/* ============ 表单控件 ============ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.field input, .field select, .field textarea {
  height: 38px; padding: 0 11px; border: 1px solid var(--border-color); border-radius: var(--radius-xs);
  background: #fbfdff; outline: none; transition: var(--transition); width: 100%;
}
.field textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(26,109,255,.10);
}
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.filter-actions { display: flex; gap: 8px; }
/* 重点品目标规划顶部按钮较多：改 flex 自动换行、按钮区右对齐，窄屏也不溢出边框 */
.filter-bar.filter-bar-plan { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-bar.filter-bar-plan > .field:first-child { flex: 0 0 auto; }
.filter-bar.filter-bar-plan > .field:nth-child(2) { flex: 1 1 240px; max-width: 300px; }
.filter-bar.filter-bar-plan > .pl-actions { flex: 1 1 320px; }
.btn {
  height: 36px; padding: 0 15px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px; transition: var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
/* 已完成的次要状态按钮：浅绿底 + 绿字描边，区别于普通白底按钮但不刺眼 */
.btn-success { background: var(--success-bg); color: #15803d; border: 1px solid #b7e4c7; }
.btn-success:hover { background: #dcfce7; border-color: var(--success); color: #166534; }
.btn-plain { background: #eef4ff; color: var(--primary-dark); }
.btn-plain:hover { background: var(--primary-lighter); }
.btn-outline { background: #fff; border: 1px solid var(--border-color); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e14b4b; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============ 表格 ============ */
.table-wrap { overflow: auto; max-height: 68vh; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.grid thead th {
  position: sticky; top: 0; z-index: 2; background: #f2f7ff; color: var(--text-secondary);
  font-weight: 600; font-size: 12.5px; text-align: left; padding: 11px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--border-color);
}
table.grid tbody td {
  padding: 10px 12px; border-bottom: 1px solid #eef3fa; vertical-align: top; color: var(--text-primary);
}
table.grid tbody tr:hover td { background: #f8fbff; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.nowrap, table.grid th.nowrap { white-space: nowrap; }
table.grid td.actions { white-space: nowrap; }
/* 月度/历史商品清单：操作列吸附右侧，横向滚动时始终可见（不必滑到最右才能编辑） */
#sMount table.grid thead th:last-child,
#sMount table.grid tbody td.actions {
  position: sticky; right: 0; z-index: 3; background: var(--surface);
  box-shadow: -3px 0 8px rgba(15, 23, 42, .07);
}
#sMount table.grid thead th:last-child { background: #f2f7ff; z-index: 4; }
#sMount table.grid tbody tr:hover td.actions { background: #f8fbff; }
/* 新群批次清单：信息与数据列尽量居中；批次群清单为长文本保持左对齐 */
#ngListMount table.grid thead th, #ngListMount table.grid tbody td { text-align: center; }
#ngListMount table.grid thead th:nth-child(10), #ngListMount table.grid tbody td:nth-child(10) { text-align: left; }
#ngListMount table.grid .ng-groups { text-align: left; }
.cell-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 340px; }
.empty-state { padding: 46px 20px; text-align: center; color: var(--text-light); }
.empty-state i { font-size: 30px; display: block; margin-bottom: 10px; opacity: .5; }

.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tag-primary { background: var(--primary-lighter); color: var(--primary-dark); }
.tag-success { background: var(--success-bg); color: #15803d; }
.tag-warning { background: var(--warning-bg); color: #b45309; }
.tag-danger  { background: var(--danger-bg);  color: #b91c1c; }
.tag-plain   { background: #f1f5f9; color: #475569; }

.pager { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border-color); font-size: 12.5px; color: var(--text-light); }
.pager .pages { display: flex; gap: 5px; margin-left: auto; }
.pager .pages button {
  min-width: 30px; height: 30px; border-radius: var(--radius-xs); border: 1px solid var(--border-color);
  background: #fff; color: var(--text-secondary); font-size: 12.5px;
}
.pager .pages button.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pager .pages button:disabled { opacity: .45; cursor: not-allowed; }

/* ============ 模态 ============ */
.modal-host { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(10,37,64,.42); }
.modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 720px; max-height: 88vh;
  display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(10,37,64,.3); animation: fadeUp .18s ease;
}
.modal.wide { max-width: 1080px; }
.modal.narrow { max-width: 460px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.modal-head h3 { font-size: 15px; font-weight: 700; }
.modal-head .close { margin-left: auto; color: var(--text-light); font-size: 16px; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border-color); display: flex; gap: 10px; justify-content: flex-end; }
/* 防重复提交：确认按钮提交中状态（同步于 core.js openModal 的 submitting 锁） */
.btn.is-submitting { opacity: .7; cursor: progress; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--text-light); line-height: 1.65; }
.callout { background: var(--warning-bg); border: 1px solid #fde68a; color: #92400e; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 12.5px; line-height: 1.7; }
.callout.danger { background: var(--danger-bg); border-color: #ffd7d5; color: #b91c1c; }
.callout.info { background: var(--primary-lighter); border-color: #cfe0ff; color: var(--primary-dark); }

/* ============ 提示 ============ */
.toast-host { position: fixed; top: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 240px; max-width: 380px; background: #fff; border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 12px 16px; font-size: 13px;
  animation: fadeUp .2s ease; line-height: 1.6;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warning); }
.toast strong { display: block; margin-bottom: 2px; }

/* ============ 其它 ============ */
.tabs { display: flex; gap: 6px; padding: 0 20px; border-bottom: 1px solid var(--border-color); }
.tabs button { padding: 12px 14px; font-size: 13px; color: var(--text-light); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.bar { height: 7px; border-radius: 999px; background: #eef3fa; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.bar.good > i { background: var(--success); }
.bar.warn > i { background: var(--warning); }
.bar.bad > i { background: var(--danger); }
.sidebar-overlay { display: none; }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 5px 11px; border-radius: 999px; background: #f1f5f9; font-size: 12px; color: var(--text-secondary); }
.chip.on { background: var(--primary); color: #fff; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--text-light); }
.kv dd { color: var(--text-primary); word-break: break-word; }
.pre { white-space: pre-wrap; line-height: 1.7; font-size: 12.5px; color: var(--text-secondary); }

/* ============ 全量数据（月份筛选 · 全字段宽表）============ */
.month-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.month-bar .myear {
  font-size: 11.5px; color: var(--text-light); font-weight: 700; padding-left: 10px;
  border-left: 2px solid var(--border-color); margin-left: 4px;
}
.month-bar .myear:first-of-type { border-left: none; padding-left: 0; margin-left: 0; }
.mchip {
  height: 32px; padding: 0 12px; border-radius: 999px; background: #f1f5f9; color: var(--text-secondary);
  font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px;
  transition: var(--transition); border: 1px solid transparent;
}
.mchip:hover { background: var(--primary-lighter); color: var(--primary-dark); }
.mchip.on { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(26, 109, 255, .3); }
.mchip small { font-size: 10.5px; font-weight: 500; opacity: .55; }
.mchip.on small { opacity: .82; }

.switch-inline {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  color: var(--text-secondary); cursor: pointer; white-space: nowrap; font-weight: 600;
}
.switch-inline input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.switch-inline select {
  height: 30px; padding: 0 8px; border: 1px solid var(--border-color);
  border-radius: var(--radius-xs); background: #fbfdff; font-weight: 500;
}

.tabs .spacer { margin-left: auto; }
.tabs .tab-tools { display: flex; align-items: center; padding: 5px 0; }
.tabs button i { margin-right: 5px; }

.wide-table { max-height: 72vh; }

/* ============ 团队每日排期：多层表头 + 大组配色 ============ */
.dy-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 0 2px 10px; font-size: 12.5px; }
.dy-legend .lg { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.dy-legend .lg-jump { cursor: pointer; border-radius: 6px; padding: 2px 6px; margin: -2px -6px; transition: background .15s, color .15s; }
.dy-legend .lg-jump:hover { background: var(--bg-hover, #eef2f8); color: var(--text-primary); }
.dy-legend .lg-jump:active { transform: translateY(1px); }
.dy-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
/* 图例点击定位：目标组列表头高亮闪烁 */
table.grid th.dy-div.dy-flash { animation: dyColFlash 1.4s ease; }
@keyframes dyColFlash {
  0%, 55% { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .9), inset 0 0 0 5px rgba(30, 64, 175, .45); }
  100% { box-shadow: none; }
}
table.grid thead tr.dy-hr th {
  height: 35px; padding: 4px 10px; font-size: 12.5px; text-align: center;
  position: sticky; z-index: 3; white-space: nowrap;
}
table.grid thead tr.dy-hr1 th { top: 0; }
table.grid thead tr.dy-hr2 th { top: 35px; }
table.grid thead tr.dy-hr3 th { top: 70px; }
table.grid thead tr.dy-hr4 th { top: 105px; border-bottom: 2px solid var(--border-color); }
table.grid thead tr.dy-hr th.dy-label {
  left: 0; z-index: 6; background: #f8fafc; color: var(--text-light);
  font-weight: 600; text-align: center; letter-spacing: 1px;
}
table.grid thead tr.dy-hr th.dy-div { font-weight: 700; font-size: 13px; letter-spacing: 2px; }
table.grid thead tr.dy-hr th.dy-sep, table.grid tbody td.dy-sep, table.grid tfoot th.dy-sep { border-left: 2px solid transparent; }
table.grid tfoot tr.dy-foot th {
  position: sticky; bottom: 0; z-index: 3; height: 34px; padding: 4px 10px;
  background: #fffbea; color: #92400e; font-size: 12.5px; text-align: center;
  border-top: 2px solid #fde68a; white-space: nowrap;
}
table.grid tfoot tr.dy-foot th.dy-label { left: 0; z-index: 6; text-align: center; letter-spacing: 1px; }
/* 非工作日（周末）整行加深，日期列与星期列同步染色 */
/* 日期列（冻结最左）与星期列（冻结在日期右侧）：横向滚动时团队内容从其下方穿过 */
table.grid tbody td.dy-daycol {
  position: sticky; left: 0; z-index: 1; background: var(--surface);
  width: 100px; min-width: 100px; max-width: 100px;
}
table.grid tbody td.dy-wd {
  position: sticky; left: 100px; z-index: 1; background: var(--surface);
  box-shadow: inset -1px 0 0 var(--border-color);
}
table.grid tbody tr.dy-weekend td { background: #e7ecf4; }
table.grid tbody tr.dy-weekend:hover td { background: #dbe3ef; }
table.grid tbody tr.dy-weekend td.dy-daycol { background: #dbe3ef; }
table.grid tbody tr.dy-weekend:hover td.dy-daycol { background: #d2dcea; }
table.grid tbody tr.dy-weekend:hover td.dy-wd { background: #d2dcea; }
table.grid tbody tr.dy-weekend td.dy-wd,
table.grid tbody tr.dy-weekend td.dy-daycol strong { color: #b45309; font-weight: 700; }
/* 补班日 / 公司上班日：视为工作日，仅加左侧标识色条 */
table.grid tbody tr.dy-workday td.dy-daycol { box-shadow: inset 3px 0 0 #0d9488; }
table.grid tbody tr.dy-workday td.dy-wd { color: #0f766e; font-weight: 600; }
.dy-hname {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  background: #fee2e2; color: #b91c1c; font-size: 11px; font-weight: 600;
}
.dy-works {
  display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 999px;
  background: #ccfbf1; color: #0f766e; font-size: 11px; font-weight: 600;
}
input.dy-cell.dy-rest-cell { background: #f5f7fb; color: #64748b; }
input.dy-cell.dy-rest-cell:focus { background: #fff; color: var(--text-primary); }
.dy-rest-text { font-style: normal; color: #94a3b8 !important; }

/* ============ 新群批次每日排期：日期 × 批次宽表（每批次 3 列） ============ */
/* 顶部批次快捷卡：最新 6 个批次，点击横向定位 */
.ngd-chips { display: flex; flex-wrap: wrap; gap: 8px 10px; padding: 2px 2px 10px; }
.ngd-chip {
  display: inline-flex; flex-direction: column; gap: 2px; min-width: 128px;
  border: 1px solid var(--border-color); border-radius: 8px; padding: 6px 10px 5px;
  cursor: pointer; background: var(--surface);
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.ngd-chip:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(26, 109, 255, .14); }
.ngd-chip:active { transform: translateY(1px); }
.ngd-chip b { font-size: 12.5px; color: var(--text-primary); }
.ngd-chip small { color: var(--text-light); font-size: 11px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* v3.4 全量日期轴：月首行加重分隔 + 月份徽标 + 定位闪烁 */
table.grid tbody tr.ngd-m1 td { border-top: 2px solid #b3c0d4; }
table.grid tbody tr.ngd-m1 td.dy-daycol strong { color: var(--text-main); }
.ngd-mbadge {
  display: inline-block; margin-left: 5px; padding: 0 5px; font-size: 10.5px; font-weight: 600;
  color: #1d4ed8; background: #e8effd; border-radius: 8px; vertical-align: 1px;
}
tr.ngd-mflash > td { animation: ngdRowFlash 1.4s ease; }
@keyframes ngdRowFlash { 0% { background: #fff7d6; } 100% { background: transparent; } }

/* 4 行粘性表头（v3.3：负责人/队名/批次群/运营日D1，行高统一 30px，top 依次 +30） */
table.grid thead tr.ngd-hr th {
  height: 30px; padding: 4px 8px; font-size: 12px; text-align: center;
  position: sticky; z-index: 3; white-space: nowrap;
}
table.grid thead tr.ngd-hr1 th { top: 0; }
table.grid thead tr.ngd-hr2 th { top: 30px; }
table.grid thead tr.ngd-hr3 th { top: 60px; }
table.grid thead tr.ngd-hr4 th { top: 90px; border-bottom: 2px solid var(--border-color); }
table.grid thead tr.ngd-hr5 th { top: 120px; }
table.grid thead tr.ngd-hr6 th { top: 150px; border-bottom: 2px solid var(--border-color); }
table.grid thead tr.ngd-hr th.ngd-label {
  left: 0; z-index: 6; background: #f8fafc; color: var(--text-light);
  font-weight: 600; text-align: center; letter-spacing: 1px;
}
table.grid thead tr.ngd-hr th.ngd-div { font-weight: 700; font-size: 12.5px; letter-spacing: 1px; }
table.grid thead th.ngd-div.ngd-flash { animation: dyColFlash 1.4s ease; }
/* v3.3：表头/表尾单行截断（固定列宽下内容超宽省略，悬浮 title 看全量） */
table.ngd-table th.ngd-div .ngd-cut,
.ngd-cut {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 批次群清单：单行截断，悬停（title）看全量 */
.ngd-groups-t { max-width: 100%; margin: 0 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; font-size: 11.5px; }
/* v3.3：固定列宽单元格（116px），内容超宽截断 */
table.ngd-table tbody td.ngd-td,
table.ngd-table tfoot th.ngd-td {
  max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 不在当月运营窗口的批次：整组淡格 */
table.grid tbody td.ngd-na { background: #f4f6fa; }
/* 同日多条明细格（v3.8：可点击弹出逐条编辑框） */
table.grid tbody td.ngd-multi { background: #fffbeb; text-align: center; font-size: 12px; }
table.grid tbody td.ngd-multi-edit { cursor: pointer; }
table.grid tbody td.ngd-multi-edit:hover { background: #fef3c7; }
table.grid tbody td.ngd-multi-edit:hover .hint { color: #b45309; }
/* 多条明细弹窗：每行独立字段 */
.ngd-mi-row { display:flex; align-items:center; gap:6px; margin-bottom:7px; }
.ngd-mi-idx { flex:0 0 20px; text-align:center; color:var(--text-light); font-size:12px; font-weight:600; }
.ngd-mi-row select.ngd-mi-type { flex:0 0 118px; max-width:118px; padding:6px 4px; }
.ngd-mi-row input { min-width:0; padding:6px 7px; }
.ngd-mi-row input.ngd-mi-product { flex:1 1 40%; }
.ngd-mi-row input.ngd-mi-aog { flex:0 0 88px; text-align:right; }
.ngd-mi-row input.ngd-mi-gmv { flex:0 0 100px; text-align:right; }
.ngd-mi-row .ngd-mi-del { flex:0 0 auto; padding:6px 8px; color:var(--danger); }
/* 宽表单元格：推品列宽一些，数值列窄 */
input.ngd-cell { width: 100%; min-width: 90px; }
input.ngd-num { min-width: 64px; text-align: right; }
/* v3.6：编辑即自动保存 —— 待保存 / 保存中状态可视化 */
input.ngd-cell.ngd-dirty { background: #fff7ed; border-color: #fdba74; }
input.ngd-cell.ngd-dirty:focus { background: #fff; border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.12); }
.ngd-save-state { display:inline-flex; align-items:center; gap:5px; font-size:12px; color:var(--text-light); white-space:nowrap; }
.ngd-save-state.dirty { color:#b45309; }
.ngd-save-state.saving { color:var(--primary); }
.ngd-save-state.error { color:var(--danger); }
/* 表尾合计沿用 dy-foot 配色 */
table.grid table { min-width: 100%; }
table.grid-dense { font-size: 12px; }
table.grid-dense thead th { padding: 7px 10px; font-size: 11.5px; }
table.grid-dense tbody td { padding: 7px 10px; }

/* 三段式分组表头：基础 / 汇总指标 / 运营内容 */
/* 第一段固定 27px 高（16 行高 + 10 内边距 + 1 边框），第二段吸顶偏移量与之严格对齐 */
tr.colgroup-row th {
  top: 0; z-index: 3; text-align: center; font-size: 11px; letter-spacing: .6px;
  height: 27px; line-height: 16px; padding: 5px 10px !important;
  border-bottom: 1px solid var(--border-color);
}
.cg-base { background: #eef4ff; color: var(--primary-dark); }
.cg-metric { background: #eafaf1; color: #15803d; }
.cg-content { background: #fff8ec; color: #b45309; }
table.grid-dense thead tr:nth-child(2) th { top: 27px; z-index: 2; }
.th-base { background: #f7faff; }
.th-metric { background: #f4fcf7; }
.th-content { background: #fffcf5; }
.th-team { background: #f4fcf7; }
.fill-rate {
  display: block; font-size: 10px; font-weight: 500; color: var(--text-light);
  font-variant-numeric: tabular-nums; letter-spacing: 0;
}
.td-empty { color: #cbd5e1; text-align: center; }
.td-text { max-width: 300px; }
.cell-clamp-3 { -webkit-line-clamp: 3; cursor: zoom-in; }
.cell-clamp-3:hover { color: var(--primary); }
.td-product { min-width: 180px; max-width: 260px; }
.td-ratio { font-weight: 600; }
.inline-bar { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 62px; }
.inline-bar .bar { width: 100%; }
table.grid-dense tbody td.td-text .cell-clamp { max-width: 300px; }

/* 重点品 × 组 矩阵 */
table.grid.matrix th, table.grid.matrix td { text-align: center; }
table.grid.matrix th.mx-sticky {
  position: sticky; left: 0; z-index: 4; background: #f7faff; text-align: left; min-width: 220px;
}
table.grid.matrix td.mx-sticky {
  position: sticky; left: 0; z-index: 1; background: #fff; text-align: left;
  min-width: 220px; max-width: 300px; font-weight: 600; color: var(--text-primary);
  box-shadow: 1px 0 0 var(--border-color);
}
table.grid.matrix tbody tr:hover td.mx-sticky { background: #f8fbff; }
.mx-seq {
  display: inline-block; min-width: 22px; height: 18px; line-height: 18px; padding: 0 5px;
  border-radius: 5px; background: var(--primary-lighter); color: var(--primary-dark);
  font-size: 10.5px; font-weight: 700; margin-right: 7px; text-align: center;
}
th .mh-name { font-size: 12px; color: var(--text-primary); font-weight: 700; }
th .mh-sub { font-size: 10px; color: var(--text-light); font-weight: 500; margin-top: 1px; }
.mx-cell { font-variant-numeric: tabular-nums; min-width: 62px; font-size: 11.5px; }
.mx-empty { color: #d7dfea; text-align: center; }
.mx-good { background: var(--success-bg); color: #15803d; font-weight: 700; }
.mx-warn { background: var(--warning-bg); color: #b45309; font-weight: 700; }
.mx-bad  { background: var(--danger-bg); color: #b91c1c; font-weight: 700; }
.mx-total { background: #f2f7ff; font-weight: 700; }

@media (max-width: 992px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: var(--transition); }
  .sidebar.open { transform: none; }
  .sidebar-overlay.show { display: block; position: fixed; inset: 0; background: rgba(10,37,64,.42); z-index: 35; }
  .btn-menu { display: block; }
  .login-container { flex-direction: column; }
  .login-brand { padding: 32px 26px; }
  .login-form { padding: 32px 26px; }
  .form-grid .span-2 { grid-column: auto; }
}

/* ============ 新版补充：导航分组 / 排期单元格 / 行内码 ============ */
.sidebar-nav .nav-group {
  padding: 16px 16px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .6px;
  color: rgba(255, 255, 255, .34); text-transform: none;
}
.sidebar-nav .nav-group:first-child { padding-top: 6px; }
.dy-cell {
  width: 100%; min-width: 120px; padding: 5px 7px; font-size: 12.5px;
  border: 1px solid transparent; border-radius: var(--radius-xs); background: transparent; outline: none;
}
.dy-cell:hover { border-color: var(--border-color); }
.dy-cell:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(26,109,255,.10); }
/* v3.7：老群排期编辑即自动保存 —— 待保存 / 保存中状态可视化 */
.dy-cell.dy-dirty { background: #fff7ed; border-color: #fdba74; }
.dy-cell.dy-dirty:focus { background: #fff; border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.12); }
.dy-save-state { display:inline-flex; align-items:center; gap:5px; font-size:12px; color:var(--text-light); white-space:nowrap; }
.dy-save-state.dirty { color:#b45309; }
.dy-save-state.saving { color:var(--primary); }
.dy-save-state.error { color:var(--danger); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px;
  background: #eef4fc; color: var(--primary-dark); padding: 1px 6px; border-radius: 5px;
}
.card-body .filter-bar { margin-bottom: 12px; }

/* ============ 月度重点品规划：Excel 式复合宽表（左侧属性冻结 + 右侧团队目标矩阵）============ */
.pl-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 0 2px 10px; font-size: 12.5px; }
/* 周工作日条 */
.pl-wd-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-secondary); padding: 0 2px 8px;
}
.pl-wd-bar .fa-calendar-week { color: var(--primary); }
.pl-legend .lg { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.pl-legend .lg[data-gidx] {
  cursor: pointer; padding: 2px 9px; border-radius: 999px; border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.pl-legend .lg[data-gidx]:hover { background: #eef4ff; border-color: #c9d9f2; color: var(--primary-dark); }
.pl-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.pl-wrap { max-height: 74vh; overflow: auto; }
.pl-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.pl-table th, .pl-table td { border-right: 1px solid #eef2f8; border-bottom: 1px solid #eef2f8; }

/* 四层粘性表头 */
table.grid thead tr.pl-hr th {
  height: 34px; padding: 3px 8px; font-size: 12px; text-align: center;
  position: sticky; z-index: 3; white-space: nowrap; font-weight: 600;
}
table.grid thead tr.pl-hr1 th { top: 0; }
table.grid thead tr.pl-hr2 th { top: 34px; }
table.grid thead tr.pl-hr3 th { top: 76px; }
table.grid thead tr.pl-hr4 th { top: 110px; border-bottom: 2px solid var(--border-color); }
/* 左侧冻结列（表头） */
table.grid thead tr.pl-hr th.pl-hl {
  left: 0; z-index: 6; background: #f8fafc; color: var(--text-light);
  text-align: center; letter-spacing: 1px;
}
table.grid thead tr.pl-hr1 th.pl-hl { background: #eef2f8; color: var(--text-secondary); font-size: 12.5px; }
table.grid thead tr.pl-hr th.pl-hl-blank { background: #f8fafc; }
/* 大组标题 */
table.grid thead tr.pl-hr th.pl-div { font-weight: 700; font-size: 13px; letter-spacing: 2px; }
/* 二级负责人 / 群数 / 主推占比 */
table.grid thead tr.pl-hr th.pl-lead { padding: 3px 6px; }
.pl-lead-n { font-weight: 700; font-size: 12.5px; }
.pl-lead-m { font-size: 11px; opacity: .85; margin-top: 1px; display: flex; gap: 5px; justify-content: center; align-items: center; }
.pl-ratio {
  display: inline-block; padding: 0 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .75); font-size: 10.5px; font-weight: 600;
}
/* 队名 */
table.grid thead tr.pl-hr th.pl-tname { font-size: 12.5px; padding: 3px 6px; }
/* 指标列 */
table.grid thead tr.pl-hr th.pl-tcol { font-size: 11.5px; font-weight: 600; }

/* 左侧属性列（冻结，body） */
.pl-table tbody td.pl-c {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
  font-size: 12.5px; padding: 5px 8px; vertical-align: middle;
}
.pl-table tbody tr:hover td.pl-c { background: #f2f7fd; }
.pl-cat { font-weight: 600; }
/* ============ 爆品等级配色（全模块通用）：S 档红色 / A 档浅红 / B 默认 ============ */
.hot-badge {
  display: inline-block; min-width: 36px; text-align: center; padding: 1px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .5px;
}
.hot-badge-s { background: #dc2626; color: #fff; }
.hot-badge-a { background: #fee2e2; color: #e05252; }
.hot-badge-b { background: #eef2f8; color: var(--text-secondary); }
.hot-text-s { color: #dc2626; font-weight: 700; }
.hot-text-a { color: #ef6a6a; font-weight: 600; }
.pl-hotcell { text-align: center; }
.pl-slot-t {
  max-width: 174px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600;
}
.pl-wk .pl-tag {
  display: inline-block; margin-right: 2px; padding: 1px 5px; border-radius: 4px;
  background: #e6f0fe; color: #1d4ed8; font-size: 10.5px; font-weight: 700;
}
.pl-pb { color: var(--text-secondary); }
.pl-strategy-t {
  max-height: 66px; overflow: hidden; font-size: 11.5px; line-height: 1.5;
  color: var(--text-secondary); white-space: pre-wrap; word-break: break-word;
}
/* 长文本列（商品需求及策略 / 待定问题）：截断时提示"展开"，点击切换全文 */
.pl-strategy-t, .pl-pend-t { position: relative; cursor: pointer; }
.pl-strategy-t.clamped::after, .pl-pend-t.clamped::after {
  content: '⋯ 展开'; position: absolute; right: 0; bottom: 0; padding-left: 22px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--surface) 45%);
  font-size: 10.5px; color: var(--primary); font-weight: 600;
}
.pl-strategy-t.open, .pl-pend-t.open { max-height: none; }
.pl-strategy-t.open::after, .pl-pend-t.open::after {
  content: '⌃ 收起'; background: var(--surface); padding-left: 6px;
}
/* 单行截断（推品日历：建议主推位品 / 建议辅推位品）：默认只显示 1 行，点击展开全文、再点收起 */
.cell-t1 {
  position: relative; cursor: pointer; max-height: 1.6em; overflow: hidden;
  line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.cell-t1.clamped::after {
  content: '⋯ 展开'; position: absolute; right: 0; bottom: 0; padding-left: 20px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--surface) 45%);
  font-size: 10.5px; color: var(--primary); font-weight: 600;
}
.cell-t1.open { max-height: none; }
.cell-t1.open::after { content: '⌃ 收起'; background: var(--surface); padding-left: 6px; }
.pl-ref { font-size: 11.5px; color: var(--text-secondary); }
.pl-pend-t {
  max-height: 66px; overflow: hidden; font-size: 11.5px; line-height: 1.5;
  color: var(--text-secondary); white-space: pre-wrap; word-break: break-word;
}
.pl-chk { text-align: center; }
.pl-ok { color: #16a34a; font-weight: 700; }
.pl-sums { font-size: 11px; line-height: 1.45; }
/* 汇总指标表头：全部商品合计区 */
.pl-grand { text-align: left !important; }
.pl-grand-t {
  font-size: 11px; font-weight: 700; color: var(--primary-dark);
  margin-bottom: 3px; white-space: nowrap;
}
.pl-grand .pl-sum { font-size: 10.5px; line-height: 1.4; }
.pl-grand .pl-sum b { font-variant-numeric: tabular-nums; }
.pl-sum { display: flex; justify-content: space-between; gap: 8px; }
.pl-sum span { color: var(--text-light); }
.pl-sum b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-ops { text-align: center; white-space: nowrap; }
.pl-mini {
  width: 24px; height: 24px; padding: 0; margin: 0 1px; border: 1px solid var(--border-color);
  border-radius: 5px; background: #fff; color: var(--text-secondary); cursor: pointer; font-size: 11px;
}
.pl-mini:hover { border-color: var(--primary); color: var(--primary); }
.pl-mini.pl-del:hover { border-color: #dc2626; color: #dc2626; }

/* 行拖拽排序（管理员）：手柄 + 拖动中状态 + 落点指示线 */
.pl-drag {
  display: inline-block; margin-right: 5px; padding: 0 1px; vertical-align: middle;
  color: #b6c2d4; cursor: grab; font-size: 12px; line-height: 1;
}
.pl-drag:hover { color: var(--primary); }
.pl-drag:active { cursor: grabbing; }
body.pl-dragging { user-select: none; cursor: grabbing; }
body.pl-dragging * { cursor: grabbing !important; }
tr.pl-drag-src td { opacity: 0.45; }
tr.pl-drop-before td.pl-c, tr.pl-drop-before td.pl-td {
  border-top: 2px solid var(--primary) !important;
}
tr.pl-drop-after td.pl-c, tr.pl-drop-after td.pl-td {
  border-bottom: 2px solid var(--primary) !important;
}

/* 右侧目标矩阵单元格 */
.pl-table tbody td.pl-td { padding: 2px 4px; font-size: 12px; text-align: center; vertical-align: middle; }
.pl-cell {
  width: 100%; height: 26px; padding: 2px 6px; text-align: center;
  border: 1px solid transparent; border-radius: 4px; background: transparent;
  font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-primary);
}
.pl-cell:hover { border-color: #c7d7ee; background: #f7fbff; }
.pl-cell:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.pl-cell::placeholder { color: #c3ccd9; }
.pl-table tbody tr:hover td.pl-td { background: rgba(37, 99, 235, .03); }
/* 公式计算的只读目标格（总销量 / 总gmv / 群均gmv） */
.pl-table tbody td.pl-calc { color: var(--text-secondary); }

/* 粘性表头在滚动容器内的阴影 */
.pl-wrap thead th.pl-hr1 { box-shadow: 0 1px 0 rgba(15, 23, 42, .04); }
.pl-wrap tbody td.pl-c { box-shadow: 1px 0 0 #eef2f8; }
.pl-wrap thead th.pl-hl { box-shadow: 1px 0 0 #e3e9f2, 0 1px 0 rgba(15, 23, 42, .04); }
/* 矩阵数字格：列宽由 colgroup 固定，长数字不换行溢出 */
.pl-table tbody td.pl-td { white-space: nowrap; }
/* 图例点击定位：对应大组表头闪烁提示 */
@keyframes plFlash {
  0%, 55% { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .95), inset 0 0 0 6px rgba(10, 26, 46, .25); }
}
table.grid thead tr.pl-hr th.pl-div.pl-flash { animation: plFlash 1.4s ease; }
/* 表头列宽拖拽手柄（Excel 式） */
.pl-table thead th .pl-rs {
  position: absolute; top: 0; right: -5px; width: 11px; height: 100%;
  cursor: col-resize; z-index: 9; touch-action: none;
}
.pl-table thead th .pl-rs::after {
  content: ''; position: absolute; top: 16%; right: 5px; width: 1px; height: 68%;
  background: rgba(10, 26, 46, .14);
}
.pl-table thead th .pl-rs:hover::after,
.pl-table thead th .pl-rs.dragging::after { background: var(--primary); width: 2px; }
/* 通用表格列宽拖拽：手柄 + 固定布局 */
table.grid-fixed { table-layout: fixed; }
table.grid-fixed td { overflow: hidden; }
table.grid-fixed td .cell-clamp { max-width: 100%; }
table.grid thead th .grid-rs {
  position: absolute; top: 0; right: -5px; width: 11px; height: 100%;
  cursor: col-resize; z-index: 9; touch-action: none;
}
table.grid thead th .grid-rs::after {
  content: ''; position: absolute; top: 16%; right: 5px; width: 1px; height: 68%;
  background: rgba(10, 26, 46, .14);
}
table.grid thead th .grid-rs:hover::after,
table.grid thead th .grid-rs.dragging::after { background: var(--primary); width: 2px; }
/* 列宽已自定义时的提示条 */
.gridw-bar {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px; margin-bottom: 8px;
  border-radius: var(--radius-xs); background: #f1f6ff; color: var(--text-secondary); font-size: 12px;
}
.gridw-bar i { color: var(--primary); }
.gridw-bar a { color: var(--primary); font-weight: 600; text-decoration: none; margin-left: 2px; }
.gridw-bar a:hover { text-decoration: underline; }
/* 编码继承记录（商品经理 / 商务经理码表） */
.inh-link { color: var(--text-primary); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.inh-link:hover code { color: var(--primary); }
.inh-link .tag { margin-left: 2px; }
.inh-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border-bottom: 1px dashed var(--border); font-size: 13px;
}
.inh-item:last-of-type { border-bottom: none; }
.inh-item .hint { font-size: 12px; }
.inh-item code { font-size: 12.5px; }
.inh-item .inh-move code + code::before { content: ''; }
/* 当月福利品板块（公司推品日历内） */
.welfare-box {
  border: 1px solid #f3d9d2; border-radius: var(--radius-xs); padding: 10px 14px;
  background: linear-gradient(180deg, #fff8f5, #fffdfd);
}
.welfare-head { display: flex; align-items: center; gap: 8px; }
.welfare-head i { color: #e2583f; }
.welfare-head b { font-size: 13.5px; color: var(--text-primary); }
.welfare-body { margin-top: 8px; font-size: 12.5px; line-height: 1.7; color: var(--text-secondary); white-space: normal; }
/* 板块四 · 新群推品计划 */
.ng-metrics { margin-bottom: 4px; }
.ng-groups { font-size: 11.5px; line-height: 1.55; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; max-height: 54px; overflow: hidden; }
.ng-info { display: flex; gap: 16px; align-items: stretch; margin-bottom: 12px; flex-wrap: wrap; }
.ng-info-cell { border: 1px solid var(--border-color); border-radius: var(--radius-xs); padding: 10px 14px; background: #fbfdff; }
.ng-info-cell label { display: block; font-size: 11.5px; color: var(--text-light); margin-bottom: 4px; }
.ng-info-cell:first-child { flex: 1; min-width: 320px; }
.ng-groups-full { font-size: 12.5px; line-height: 1.65; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }
.ng-info-metrics { display: flex; gap: 22px; align-items: center; }
.ng-info-metrics > div { text-align: right; }
.ng-info-metrics b { font-size: 17px; font-variant-numeric: tabular-nums; }
/* 合计行：粘底 + 左侧标签随冻结区固定 */
.pl-wrap tfoot td {
  position: sticky; bottom: 0; z-index: 3; background: #eef2f8;
  font-weight: 700; font-size: 12px; border-top: 2px solid var(--border-color);
  font-variant-numeric: tabular-nums;
}
.pl-wrap tfoot td.pl-foot-left {
  left: 0; z-index: 4; text-align: center; letter-spacing: 1px; color: var(--text-secondary);
}
/* 角色职级配色（GP 体系） */
.tag-info { background: #e0f2fe; color: #0369a1; }
/* 角色 × 模块 权限矩阵 */
.perm-matrix-wrap { overflow-x: auto; }
.perm-matrix { border-collapse: collapse; width: 100%; font-size: 12px; }
.perm-matrix th, .perm-matrix td { border-bottom: 1px solid var(--border-color); padding: 6px 10px; text-align: center; white-space: nowrap; }
.perm-matrix thead th { background: #f5f8fd; color: var(--text-secondary); font-weight: 600; position: sticky; top: 0; }
.perm-matrix thead th:first-child, .perm-matrix td.pm-mod { text-align: left; font-weight: 600; color: var(--text-primary); }
.perm-matrix tbody tr:hover td { background: #fafcff; }
.perm-matrix td.pm-yes { color: #15803d; font-weight: 700; }
.perm-matrix td.pm-no { color: #cbd5e1; }
/* 三档权限矩阵单元格：可写 / 只读 / 不可见 */
.perm-matrix td.pm-cell { min-width: 64px; font-weight: 700; border-radius: 6px; }
.perm-matrix td.pm-write { color: #15803d; }
.perm-matrix td.pm-read { color: #94a3b8; font-weight: 500; }
.perm-matrix td.pm-hide { color: #fca5a5; }
.perm-matrix td.pm-cell:not(.pm-fixed) { cursor: pointer; }
.perm-matrix td.pm-cell:not(.pm-fixed):hover { outline: 2px solid var(--primary-light, #bfdbfe); outline-offset: -2px; }
/* 自定义角色列：名称可点重命名、✕ 删除 */
.perm-matrix thead th .pm-cname { cursor: pointer; border-bottom: 1px dashed #b6c4d8; }
.perm-matrix thead th .pm-cname:hover { color: var(--primary, #3b6cf5); }
.perm-matrix thead th .pm-rm {
  margin-left: 5px; border: none; background: transparent; color: #cbd5e1;
  cursor: pointer; font-size: 11px; padding: 0 3px; border-radius: 4px; line-height: 1;
}
.perm-matrix thead th .pm-rm:hover { color: #dc2626; background: #fee2e2; }
/* 用户列表中的自定义角色标签（虚线边框区分内置） */
.tag.tag-custom { border: 1px dashed currentColor; background: transparent; }
.perm-matrix td.pm-fixed { color: #15803d; opacity: .85; }

/* ============ 商品主数据：新增时间区间筛选 ============ */
.field.date-range .date-range-inputs { display: flex; align-items: center; gap: 6px; }
.field.date-range input[type="date"] {
  flex: 1; min-width: 0; height: 38px; padding: 0 8px;
  border: 1px solid var(--border-color); border-radius: var(--radius-xs);
  background: #fbfdff; outline: none; font-size: 12.5px; color: var(--text-primary);
  color-scheme: light; transition: var(--transition);
}
.field.date-range input[type="date"]:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(26,109,255,.10); }
.field.date-range .date-sep { color: var(--text-light); font-size: 12px; flex: none; }
.field.date-range .date-clear { flex: none; height: 38px; padding: 0 10px; font-size: 12px; }
.field.num-range input[type="number"] {
  flex: 1; min-width: 0; height: 38px; padding: 0 8px;
  border: 1px solid var(--border-color); border-radius: var(--radius-xs);
  background: #fbfdff; outline: none; font-size: 12.5px; color: var(--text-primary);
  transition: var(--transition); -moz-appearance: textfield;
}
.field.num-range input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.field.num-range input[type="number"]:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(26,109,255,.10); }
.field.num-range .date-range-inputs { display: flex; align-items: center; gap: 6px; }

/* ---------- 批量勾选导出：下拉菜单（参考「选择当前页面/全部」交互） ---------- */
.sel-wrap { position: relative; display: inline-block; }
.sel-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-color); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(10, 37, 64, .14);
}
.sel-item { padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--text-primary); cursor: pointer; white-space: nowrap; }
.sel-item:hover { background: var(--primary-lighter); }
.sel-item.disabled { color: var(--text-light); cursor: not-allowed; }
.sel-item.disabled:hover { background: none; }
.sel-item.danger { color: var(--text-secondary); }
.sel-sep { height: 1px; background: var(--border-color); margin: 5px 8px; }
.sel-check { accent-color: var(--primary); cursor: pointer; vertical-align: middle; }

/* ============ 个人中心 ============ */
/* 侧边栏用户卡片：可点击进入个人中心 */
.user-chip { cursor: pointer; border-radius: var(--radius-sm); transition: var(--transition); }
.user-chip:hover { background: rgba(255, 255, 255, .07); }
.user-chip:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.pc-chip-arrow {
  margin-left: auto; font-size: 11px; color: rgba(255, 255, 255, .35);
  transition: var(--transition); flex: 0 0 auto;
}
.user-chip:hover .pc-chip-arrow { color: rgba(255, 255, 255, .75); transform: translateX(2px); }

/* 布局：左身份卡 + 右信息列 */
.pc-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.pc-side { flex: 0 0 280px; max-width: 100%; }
.pc-main { flex: 1 1 420px; min-width: 0; }
.pc-card {
  background: var(--surface); border: 1px solid var(--border-color);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 24px 20px; text-align: center;
}
.pc-avatar {
  width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; letter-spacing: 1px;
}
.pc-name { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.pc-role { margin-bottom: 10px; }
.pc-desc { font-size: 12.5px; color: var(--text-light); line-height: 1.7; margin-bottom: 18px; }
.btn-block { width: 100%; justify-content: center; }

/* 信息行 */
.pc-row {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 11px 0; border-bottom: 1px dashed var(--border-color);
}
.pc-row:last-child { border-bottom: none; }
.pc-label { flex: 0 0 96px; color: var(--text-light); font-size: 13px; }
.pc-value { flex: 1; color: var(--text-primary); font-size: 13.5px; word-break: break-all; }

/* ============ 只读字段（明确不可编辑，避免误以为可改）============ */
.form-grid input.ro,
.form-grid textarea.ro,
.form-grid select.ro {
  background: #f1f5f9; color: var(--text-light); border-color: var(--border-color);
  cursor: not-allowed; -webkit-text-fill-color: var(--text-light);
}
.form-grid input.ro:focus,
.form-grid textarea.ro:focus {
  border-color: var(--border-color); box-shadow: none; outline: none;
}
/* 禁用态（disabled）同样置灰，避免与可编辑框混淆 */
.form-grid input:disabled,
.form-grid select:disabled,
.form-grid textarea:disabled {
  background: #f1f5f9; color: var(--text-light); border-color: var(--border-color);
  cursor: not-allowed; -webkit-text-fill-color: var(--text-light);
}

/* 操作列：删除按钮用危险色区分 */
td.actions button[data-del] { color: var(--danger); border-color: #ffd7d5; }
td.actions button[data-del]:hover { background: var(--danger-bg); color: #b91c1c; }

/* 重点品规划：首行「当月队伍目标汇总」（指标列表头之下、数据行之上） */
.pl-wrap tbody tr.pl-sumrow td {
  background: #e8f1ff; font-weight: 700; font-size: 12px;
  border-bottom: 2px solid #c7dbfa; font-variant-numeric: tabular-nums;
}
.pl-wrap tbody td.pl-sum-left {
  position: sticky; left: 0; z-index: 2;
  background: #fff; font-weight: 400;
}
.pl-wrap tbody td.pl-sum-td { color: #1d4ed8; }

/* ===== 可搜索下拉（type:search，用于商品分类/供应编码分类等长选项） ===== */
.ss-wrap { position: relative; }
.ss-box { position: relative; }
.ss-box input.ss-input {
  padding-right: 30px; cursor: text;
}
.ss-arrow {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--text-light); pointer-events: none; transition: transform .15s;
}
.ss-box.ss-open .ss-arrow { transform: translateY(-50%) rotate(180deg); }
.ss-box.ss-open input.ss-input { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(26,109,255,.10); }
.ss-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 3px); z-index: 60;
  max-height: 230px; overflow-y: auto; background: #fff;
  border: 1px solid var(--border-color); border-radius: var(--radius-xs);
  box-shadow: 0 10px 28px rgba(10,37,64,.16); padding: 4px;
}
.ss-menu[hidden] { display: none; }
.ss-item {
  padding: 7px 9px; font-size: 12.5px; color: var(--text); border-radius: 5px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ss-item:hover { background: var(--primary-lighter); color: var(--primary-dark); }
.ss-item.selected { background: var(--primary); color: #fff; }
.ss-empty { padding: 9px; font-size: 12.5px; color: var(--text-light); text-align: center; }
.ss-new { color: var(--primary); font-weight: 500; border-top: 1px solid var(--border); }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-item { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-lighter); color: var(--primary-dark); border: 1px solid var(--primary); border-radius: 12px; padding: 3px 6px 3px 10px; font-size: 12.5px; max-width: 100%; }
.chip-item .chip-x { border: none; background: none; color: var(--primary-dark); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; }
.chip-item .chip-x:hover { color: var(--danger); }
/* 浅灰占位提示（无编码-商品编码：不必填） */
.field input::placeholder, .field textarea::placeholder { color: #aab6c5; opacity: 1; }

/* ============ 重点品规划预排：月度日历（日期行 × 品类坑位列） ============ */
.pp-cal { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12.5px; }
.pp-cal th {
  position: sticky; top: 0; z-index: 2; background: var(--primary-lighter); color: var(--primary-dark);
  font-weight: 600; padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--border-color); white-space: normal; line-height: 1.35;
}
.pp-cal th.pp-dt, .pp-cal th.pp-wd { width: 76px; text-align: center; }
.pp-cal td { border-bottom: 1px solid var(--border-color); border-right: 1px solid var(--border-color); vertical-align: top; padding: 5px; min-height: 62px; }
.pp-cal td.pp-dt { text-align: center; color: var(--text-primary); background: #fafdff; }
.pp-cal td.pp-wd { text-align: center; color: var(--text-secondary); background: #fafdff; }
.pp-cal tr.pp-rest td.pp-dt, .pp-cal tr.pp-rest td.pp-wd { background: var(--danger-bg); }
.pp-cal .pp-hol { display: block; color: var(--danger); font-size: 10.5px; line-height: 1.1; }
.pp-cell { position: relative; }
.pp-cell:hover { background: #f4f9ff; }
/* 底部留出 + 按钮/角标的位置，避免遮住已填商品的编辑/删除按钮 */
.pp-items { display: flex; flex-direction: column; gap: 5px; padding-bottom: 28px; }
.pp-item {
  position: relative; background: #fff; border: 1px solid var(--border-color); border-left: 3px solid var(--primary);
  border-radius: var(--radius-xs); padding: 5px 6px; box-shadow: var(--shadow-sm); word-break: break-word;
}
.pp-item.pp-synced { border-left-color: var(--success); background: #fbfffc; }
.pp-item-top { display: flex; align-items: center; gap: 5px; }
.pp-item-top .pp-slot { font-size: 12.5px; line-height: 1.3; }
.pp-item .pp-sync-ico { color: var(--success); font-size: 12px; margin-left: auto; }
.pp-item-meta { color: var(--text-secondary); font-size: 11px; margin-top: 3px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 长文本：单行省略 + 点击展开/收起，避免悬停 title 不灵敏 */
.pp-item .pp-strategy { display: flex; align-items: center; gap: 4px; cursor: pointer; padding: 2px 4px; margin-left: -4px; margin-right: -4px; border-radius: 4px; }
.pp-item .pp-strategy:hover, .pp-item .pp-strategy.pp-open { background: var(--primary-lighter); color: var(--primary-dark); }
.pp-strategy-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-strategy-caret { flex: none; font-size: 10px; }
.pp-strategy-btn { flex: none; font-size: 10.5px; color: var(--primary-dark); }
.pp-detail-slot:empty { display: none; }
.pp-detail-body { margin-top: 5px; padding: 6px 7px; background: #f7faff; border: 1px solid var(--border-color); border-radius: 4px; font-size: 11.5px; line-height: 1.55; max-height: 240px; overflow-y: auto; }
.pp-detail-row + .pp-detail-row { margin-top: 5px; padding-top: 5px; border-top: 1px dashed var(--border-color); }
.pp-detail-row b { color: var(--primary-dark); }
.pp-detail-row div { white-space: pre-wrap; word-break: break-word; color: var(--text-primary); }
.pp-item-foot { display: flex; align-items: center; margin-top: 4px; gap: 4px; }
.pp-item-foot .pp-owner { font-size: 10.5px; color: var(--text-light); margin-right: auto; }
.pp-item-foot button { font-size: 11px; color: var(--text-light); padding: 1px 4px; border-radius: 4px; }
.pp-item-foot button:hover { background: var(--primary-lighter); color: var(--primary-dark); }
.pp-item-foot .pp-i-del:hover { background: var(--danger-bg); color: var(--danger); }
.pp-add {
  position: absolute; right: 5px; bottom: 5px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-lighter); color: var(--primary-dark); font-size: 11px; opacity: .55; transition: opacity .15s;
}
.pp-cell:hover .pp-add { opacity: 1; }
.pp-add:hover { background: var(--primary); color: #fff; }
/* 空格子：+ 居中显示，整格可点击新增；已填格子保持右下角原样式 */
.pp-cell.pp-empty { cursor: pointer; }
.pp-cell.pp-empty .pp-items { padding-bottom: 0; min-height: 46px; }
.pp-cell.pp-empty .pp-add {
  left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%, -50%);
  width: 30px; height: 30px; font-size: 14px; opacity: .5;
}
.pp-cell.pp-empty:hover .pp-add { opacity: 1; box-shadow: 0 2px 8px rgba(15, 90, 160, .16); }
.pp-cal .callout.warn { margin: 0; }

/* 预排：同格多商品标记 */
.pp-multi { position: absolute; left: 5px; bottom: 5px; font-size: 10px; color: var(--warning, #b7791f); background: #fff8e6; border: 1px solid #f5d99a; border-radius: 9px; padding: 0 5px; }

/* 预排：拖动商品到其他日期 */
.pp-item[draggable="true"] { cursor: grab; }
.pp-item[draggable="true"]:active { cursor: grabbing; }
.pp-item.pp-dragging { opacity: .4; }
.pp-drag-ico { color: var(--text-light); font-size: 11px; cursor: grab; }
.pp-cell.pp-drop-target { background: var(--primary-lighter) !important; outline: 2px dashed var(--primary); outline-offset: -2px; }
.pp-cell.pp-no-drop { background: var(--danger-bg) !important; outline: 2px dashed var(--danger); outline-offset: -2px; cursor: not-allowed; }

/* 种草素材上传 / CRM 映射配置 */
.callout.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.tag-warn { background: var(--warning-bg); color: #b45309; }
input[type="file"] { font-size: 12.5px; max-width: 320px; }

/* 供货价新增：多规格明细（一行一规格，一次保存新建多条） */
.sp-multi { margin-top: 18px; border-top: 1px solid var(--border-color); padding-top: 14px; }
.sp-multi-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sp-multi-head strong { font-size: 13.5px; }
.sp-spec-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sp-spec-table th {
  font-size: 12px; color: var(--text-secondary); font-weight: 600; text-align: left;
  padding: 6px; background: var(--bg-page); border-bottom: 1px solid var(--border-color);
}
.sp-spec-table td { padding: 5px 6px; border-bottom: 1px solid var(--border-color); }
.sp-spec-table th:last-child, .sp-spec-table td:last-child { width: 62px; }
.sp-spec-table .sp-cell {
  width: 100%; height: 34px; border: 1px solid var(--border-color);
  border-radius: var(--radius-xs); padding: 0 8px; font-size: 13px;
  color: var(--text-primary); background: var(--surface);
}
.sp-spec-table .sp-cell:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(26,109,255,.10); }
.sp-spec-table input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
