/* ═══════════════════════════════════════════════════
   君林科技 Pipeline 管理系统 v3.0
   ═══════════════════════════════════════════════════ */

:root {
  --junlin-blue: #0B3D91;
  --junlin-blue-light: #3B6BC6;
  --junlin-blue-bg: #D6E4F5;
  --junlin-blue-pale: #F2F6FC;
  --bg: #F0F2F5;
  --card-bg: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #666;
  --text-light: #999;
  --border: #E4E7ED;
  --green: #2d8c4a;
  --green-bg: #E8F5E9;
  --orange: #FF9800;
  --orange-bg: #FFF3E0;
  --red: #f44336;
  --red-bg: #FFEBEE;
  --purple: #9C27B0;
  --purple-bg: #F3E5F5;
}

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

body {
  font-family: '微软雅黑', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ═══ 登录页 ═══ */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--junlin-blue) 0%, var(--junlin-blue-light) 100%);
}
.login-box {
  background: #fff; border-radius: 12px; padding: 40px;
  width: 360px; text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.login-logo { font-size: 28px; font-weight: bold; color: var(--junlin-blue); margin-bottom: 4px; }
.login-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 28px; }
.login-form input {
  width: 100%; padding: 12px 16px; margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
.login-form input:focus { border-color: var(--junlin-blue); outline: none; }
.btn-login {
  width: 100%; padding: 12px; background: var(--junlin-blue); color: #fff;
  border: none; border-radius: 6px; font-size: 16px; cursor: pointer; transition: 0.2s;
}
.btn-login:hover { background: var(--junlin-blue-light); }
.login-hint { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ═══ 主界面 ═══ */
.main-app { min-height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--junlin-blue); color: #fff; padding: 0 24px; height: 56px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-title { font-size: 18px; font-weight: bold; }
.topbar-version { font-size: 11px; opacity: 0.7; background: rgba(255,255,255,0.2); padding: 2px 6px; border-radius: 4px; }
.topbar-nav { display: flex; gap: 4px; }
.nav-btn {
  background: transparent; color: rgba(255,255,255,0.8); border: none;
  padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 14px; transition: 0.2s;
}
.nav-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.nav-btn.active { background: rgba(255,255,255,0.25); color: #fff; font-weight: bold; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-info { font-size: 13px; opacity: 0.9; }
.btn-logout {
  background: rgba(255,255,255,0.2); color: #fff; border: none;
  padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 13px;
}
.btn-logout:hover { background: rgba(255,255,255,0.3); }

/* ═══ Tab content ═══ */
.tab-content { display: none; padding: 20px 24px; }
.tab-content.active { display: block; }

/* ═══ 统计卡片 ═══ */
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.stat-card {
  background: var(--card-bg); border-radius: 8px; padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid var(--junlin-blue);
}
.stat-card.stat-blue { border-left-color: var(--junlin-blue-light); }
.stat-card.stat-green { border-left-color: var(--green); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: bold; color: var(--text); }

/* ═══ 看板行 ═══ */
.dash-row {
  display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px;
}
.dash-row:last-child { grid-template-columns: 1fr 1fr 1fr; }
.dash-card {
  background: var(--card-bg); border-radius: 8px; padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.dash-card h3 { font-size: 15px; color: var(--junlin-blue); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.dash-card-large { grid-column: span 1; }

/* ═══ 热力图表格 ═══ */
.heatmap-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.heatmap-table th, .heatmap-table td {
  padding: 8px 10px; text-align: center; border: 1px solid var(--border);
  font-weight: normal; background: transparent; color: var(--text-primary, #333);
}
.heatmap-table th { background: #fafafa; }
.heatmap-table .row-label { text-align: left; }

/* ═══ 赢率分布 ═══ */
.wr-bars { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding: 10px 0; }
.wr-bar-item { display: flex; flex-direction: column; align-items: center; flex: 1; height: 100%; justify-content: flex-end; }
.wr-bar-amount { font-size: 10px; color: var(--text-secondary); margin-bottom: 4px; white-space: nowrap; }
.wr-bar { width: 80%; min-height: 2px; border-radius: 4px 4px 0 0; transition: 0.3s; }
.wr-bar-label { font-size: 12px; text-align: center; margin-top: 6px; font-weight: bold; }
.wr-count { font-size: 11px; color: var(--text-light); font-weight: normal; }

/* ═══ 排行榜 ═══ */
.rank-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.rank-num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--junlin-blue);
  color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rank-name { font-weight: bold; min-width: 60px; }
.rank-detail { font-size: 12px; color: var(--text-secondary); flex: 1; }
.rank-amount { font-weight: bold; color: var(--junlin-blue); }

/* ═══ 看板 · 任务完成卡 + 双排行（v6.9）═══ */
.my-task-card {
  background: linear-gradient(135deg, #eef4fb 0%, #f7fafd 100%);
  border: 1px solid var(--border); border-left: 4px solid var(--junlin-blue);
  border-radius: 8px; padding: 14px 18px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.my-task-scope { min-width: 120px; }
.my-task-scope .t { font-size: 13px; color: var(--text-secondary); }
.my-task-scope .v { font-size: 16px; font-weight: 700; }
.my-task-nums { display: flex; gap: 24px; flex-wrap: wrap; flex: 1; }
.my-task-nums .item .t { font-size: 12px; color: var(--text-secondary); margin-bottom: 2px; }
.my-task-nums .item .v { font-size: 18px; font-weight: 700; }
.my-task-ratio { text-align: right; min-width: 90px; }
.my-task-ratio .v { font-size: 26px; font-weight: 800; color: var(--junlin-blue); }
.my-task-ratio .t { font-size: 12px; color: var(--text-secondary); }
.my-task-bar { flex-basis: 100%; height: 8px; background: #e3e9f0; border-radius: 4px; overflow: hidden; }
.my-task-bar .fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--junlin-blue), var(--junlin-blue-light, #4aa3e8)); }
.board-rank-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.board-rank-item .row1 { display: flex; align-items: center; gap: 8px; }
.board-rank-item .row1 .name { font-weight: bold; }
.board-rank-item .row1 .team-tag {
  font-size: 11px; padding: 1px 8px; border-radius: 10px;
  background: #eef2f7; color: var(--text-secondary); white-space: nowrap;
}
.board-rank-item .row1 .team-tag.own { background: #e3f2e8; color: #2d8c4a; font-weight: 600; }
.board-rank-item .row1 .team-tag.other { background: #fdf1e3; color: #b26a00; }
.board-rank-item .row1 .ratio { margin-left: auto; font-weight: 800; color: var(--junlin-blue); }
.board-rank-item .row2 { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.board-rank-item .row2 .amt { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.board-rank-item .row2 .bar { flex: 1; height: 6px; background: #e3e9f0; border-radius: 3px; overflow: hidden; }
.board-rank-item .row2 .bar .fill { height: 100%; background: var(--junlin-blue); border-radius: 3px; }
.board-rank-item.is-team .row1 .name::before { content: '👥 '; }
.board-rank-item.is-person .row1 .name::before { content: '👤 '; }

/* ═══ 行业分布 ═══ */
.ind-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.ind-label { min-width: 60px; font-size: 13px; }
.ind-bar-bg { flex: 1; height: 16px; background: var(--bg); border-radius: 8px; overflow: hidden; }
.ind-bar { height: 100%; background: var(--junlin-blue-light); border-radius: 8px; transition: 0.3s; }
.ind-amount { font-size: 12px; color: var(--text-secondary); min-width: 80px; text-align: right; }

/* ═══ Top 项目 ═══ */
.top-proj-item {
  display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.top-proj-item:hover { background: var(--junlin-blue-pale); }
.top-proj-item.no-click { cursor: default; }
.top-proj-item.no-click:hover { background: none; }
.top-proj-name { font-weight: bold; font-size: 13px; }
.top-proj-meta { font-size: 11px; color: var(--text-secondary); }
.top-proj-amount { font-weight: bold; color: var(--junlin-blue); font-size: 13px; }

/* ═══ 工具栏 ═══ */
.toolbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
  background: var(--card-bg); padding: 12px 16px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.search-input {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; width: 260px;
}
.search-input:focus { border-color: var(--junlin-blue); outline: none; }
.toolbar select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px;
  background: #fff; cursor: pointer;
}
.toolbar-count { margin-left: auto; font-size: 13px; color: var(--text-secondary); }
.btn-add, .btn-export, .btn-save, .btn-submit, .btn-print {
  padding: 8px 16px; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; color: #fff;
}
.btn-add { background: var(--junlin-blue); }
.btn-export { background: var(--green); }
.btn-save { background: var(--junlin-blue); }
.btn-submit { background: var(--orange); }
.btn-print { background: var(--junlin-blue); }
.btn-cancel { padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; cursor: pointer; background: #fff; color: var(--text-secondary); }

/* ═══ Pipeline 表格 ═══ */
.table-wrap { background: var(--card-bg); border-radius: 8px; overflow: auto; box-shadow: 0 1px 4px rgba(0,0,0,0.05); max-height: calc(100vh - 160px); }
.pipeline-table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.pipeline-table th {
  background: var(--junlin-blue); color: #fff; padding: 10px 8px; text-align: left;
  position: sticky; top: 0; z-index: 10; font-weight: 500;
}
.pipeline-table td { padding: 8px; border-bottom: 1px solid var(--border); }
.pipeline-table tbody tr:hover { background: var(--junlin-blue-pale); }
.pipeline-table .num { text-align: right; font-family: 'Consolas', monospace; }
.pipeline-table .cell-proj { color: var(--junlin-blue); cursor: pointer; text-decoration: underline; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.pipeline-table .cell-amount { font-weight: bold; color: var(--text); }
.pipeline-table .cell-weighted { color: var(--green); }
.pipeline-table .cell-actions { white-space: nowrap; }
.pipeline-table .summary-row td { background: var(--junlin-blue-pale); font-weight: bold; color: var(--junlin-blue); }
.pipeline-table .summary-row .num { font-size: 13px; }

/* ═══ 系列标签 ═══ */
.series-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.series-网络音频 { background: #E3F2FD; color: #1565C0; }
.series-无线会讨 { background: #F3E5F5; color: #7B1FA2; }
.series-数字会讨 { background: #E8F5E9; color: #2E7D32; }
.series-模拟音频 { background: #FFF3E0; color: #E65100; }
.series-专业音频 { background: #FFEBEE; color: #C62828; }
.series-智能安防 { background: #ECEFF1; color: #455A64; }

/* ═══ 赢率标签 ═══ */
.wr-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: bold;
}
.wr-won { background: var(--green-bg); color: var(--green); }
.wr-high { background: #E3F2FD; color: #1565C0; }
.wr-mid { background: var(--orange-bg); color: var(--orange); }
.wr-low { background: #FFF3E0; color: #E65100; }
.wr-lost { background: var(--red-bg); color: var(--red); }

/* ═══ 按钮组 ═══ */
.btn-mini {
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 11px; cursor: pointer; background: #fff; margin-right: 4px;
}
.btn-mini:hover { background: var(--junlin-blue-pale); border-color: var(--junlin-blue); }
/* v6.11.1：配置清单「+ 添加」高亮按钮（蓝底白字，突出主操作） */
.btn-mini.btn-hl {
  background: linear-gradient(135deg, var(--junlin-blue) 0%, var(--junlin-blue-light) 100%);
  color: #fff; border: none; font-weight: 600;
  box-shadow: 0 1px 4px rgba(11,61,145,.35);
}
.btn-mini.btn-hl:hover { filter: brightness(1.12); background: linear-gradient(135deg, var(--junlin-blue) 0%, var(--junlin-blue-light) 100%); }
/* v6.11.2：创建机会配置清单——刚添加的产品行蓝色高亮闪烁渐隐（突出「已加入」） */
@keyframes coItemFlash {
  0%   { background: var(--junlin-blue-bg); box-shadow: 0 0 0 2px var(--junlin-blue-light); }
  100% { background: var(--junlin-blue-pale); box-shadow: none; }
}
.co-item-new {
  border: 1px solid var(--junlin-blue-light);
  animation: coItemFlash 1.8s ease-out forwards;
}
.btn-mini.btn-danger { color: var(--red); border-color: var(--red); }
.btn-mini.btn-danger:hover { background: var(--red-bg); }
.btn-mini.btn-quote { color: var(--junlin-blue); border-color: var(--junlin-blue); }
.btn-mini.btn-approve { color: var(--green); border-color: var(--green); }
.btn-mini.btn-reject { color: var(--red); border-color: var(--red); }
.btn-mini.btn-send { color: var(--purple); border-color: var(--purple); }
.btn-mini.btn-win { color: var(--green); border-color: var(--green); font-weight: bold; }
.btn-mini.btn-lose { color: var(--red); border-color: var(--red); }

/* ═══ 项目卡片 ═══ */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.proj-card {
  background: var(--card-bg); border-radius: 8px; padding: 16px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: 0.2s; border: 2px solid transparent;
}
.proj-card:hover { border-color: var(--junlin-blue); box-shadow: 0 4px 16px rgba(11,61,145,0.15); transform: translateY(-2px); }
.proj-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.proj-card-name { font-weight: bold; font-size: 15px; color: var(--text); }
.proj-card-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.proj-card-body { padding: 8px 0; border-top: 1px solid var(--border); margin: 8px 0; }
.proj-product-line { font-size: 12px; padding: 2px 0; display: flex; align-items: center; gap: 6px; }
.proj-more { font-size: 11px; color: var(--text-light); padding-top: 4px; }
.proj-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--border); }
.proj-card-amount { font-weight: bold; font-size: 16px; color: var(--junlin-blue); }
.proj-card-weighted { font-size: 12px; color: var(--green); }
.proj-card-count { font-size: 12px; color: var(--text-secondary); }

/* ═══ 区域目标表 ═══ */
.targets-table, .stock-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: var(--card-bg); border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.targets-table th, .stock-table th {
  background: var(--junlin-blue); color: #fff; padding: 10px; text-align: center; font-weight: 500;
}
.targets-table td, .stock-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: center;
}
.targets-table .row-label { font-weight: bold; text-align: left; }
.targets-table .total-row td { font-weight: bold; background: var(--junlin-blue-pale); color: var(--junlin-blue); }
.targets-table .num, .stock-table .num { text-align: right; font-family: 'Consolas', monospace; }
.stock-table .cell-amount { font-weight: bold; }

.stock-status { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.stock-over { background: var(--orange-bg); color: var(--orange); }
.stock-ok { background: var(--green-bg); color: var(--green); }
.stock-low { background: var(--red-bg); color: var(--red); }
.stock-none { background: #ECEFF1; color: #78909C; }

/* ═══ 报价卡片 ═══ */
#quotesList { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 16px; }
.quote-card {
  background: var(--card-bg); border-radius: 8px; padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.quote-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--junlin-blue); }
.quote-no { font-weight: bold; font-size: 15px; color: var(--junlin-blue); }
.quote-status { padding: 3px 10px; border-radius: 10px; font-size: 12px; font-weight: bold; }
.st-draft { background: #ECEFF1; color: #78909C; }
.st-pending { background: var(--orange-bg); color: var(--orange); }
.st-approved { background: #E3F2FD; color: #1565C0; }
.st-sent { background: var(--purple-bg); color: var(--purple); }
.st-won { background: var(--green-bg); color: var(--green); }
.st-lost { background: var(--red-bg); color: var(--red); }
.quote-card-body { font-size: 13px; line-height: 1.8; }
.quote-card-actions { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--border); }
/* 草稿卡片：可点入继续编辑 */
.quote-card-editable { cursor: pointer; border: 1.5px dashed var(--junlin-blue); }
.quote-card-editable:hover { box-shadow: 0 4px 14px rgba(21,101,192,0.18); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); font-size: 16px; }
.empty-state span { font-size: 13px; }

/* ═══ 弹窗 ═══ */
.modal-mask {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center;
}
.modal-mask[hidden] { display: none !important; }
.modal-box {
  background: #fff; border-radius: 8px; max-height: 90vh; overflow: auto;
  display: flex; flex-direction: column;
}
.modal-large { width: 800px; }
.modal-xlarge { width: 1100px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-size: 16px; font-weight: bold; color: var(--junlin-blue);
}
.modal-close {
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--text-secondary); line-height: 1;
}
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ═══ 表单 ═══ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-grid label { display: flex; flex-direction: column; font-size: 13px; gap: 4px; }
.form-grid input, .form-grid select {
  padding: 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px;
}
.form-grid input:focus, .form-grid select:focus { border-color: var(--junlin-blue); outline: none; }

/* ═══ 项目详情弹窗 ═══ */
.proj-detail-info { margin-bottom: 16px; }
.detail-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-row span:first-child { color: var(--text-secondary); }
.detail-row.highlight { font-weight: bold; color: var(--junlin-blue); font-size: 15px; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.detail-table th { background: var(--junlin-blue-pale); padding: 8px; text-align: left; font-weight: bold; color: var(--junlin-blue); }
.detail-table td { padding: 8px; border-bottom: 1px solid var(--border); }
.detail-table .num { text-align: right; font-family: 'Consolas', monospace; }
.detail-table tfoot td { font-weight: bold; background: var(--junlin-blue-pale); }
.detail-actions { margin-top: 16px; text-align: center; }

/* ═══ 报价构建器 ═══ */
.quote-project-info { display: flex; gap: 24px; padding: 12px; background: var(--junlin-blue-pale); border-radius: 6px; margin-bottom: 16px; }
.quote-level-select { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.level-btn {
  padding: 6px 14px; border: 2px solid; border-radius: 6px; background: #fff;
  cursor: pointer; font-size: 13px; transition: 0.2s;
}
.level-btn.active { color: #fff; }
.quote-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.quote-table th { background: var(--junlin-blue); color: #fff; padding: 8px; text-align: center; }
.quote-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.quote-table .num { text-align: right; font-family: 'Consolas', monospace; }
.quote-table .cell-amount { font-weight: bold; }
.quote-total-row td { background: var(--junlin-blue-pale); font-weight: bold; }
.quote-selected-total td { background: var(--junlin-blue); color: #fff; font-weight: bold; font-size: 14px; }
.quote-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.quote-note input { padding: 8px; border: 1px solid var(--border); border-radius: 4px; }

/* ═══ 对外报价单 ═══ */
.ext-quote-doc { padding: 20px; }
.ext-quote-header { text-align: center; margin-bottom: 20px; }
.ext-quote-company { font-size: 18px; font-weight: bold; color: var(--junlin-blue); }
.ext-quote-title { font-size: 24px; font-weight: bold; margin: 12px 0; letter-spacing: 4px; }
.ext-quote-meta { display: flex; justify-content: center; gap: 40px; font-size: 13px; color: var(--text-secondary); }
.ext-quote-info { margin-bottom: 16px; padding: 12px; background: var(--junlin-blue-pale); border-radius: 6px; font-size: 13px; line-height: 1.8; }
.ext-quote-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ext-quote-table th { background: var(--junlin-blue); color: #fff; padding: 10px; text-align: center; }
.ext-quote-table td { padding: 8px; border: 1px solid var(--border); }
.ext-quote-table .num { text-align: right; font-family: 'Consolas', monospace; }
.ext-quote-table .center { text-align: center; }
.ext-quote-table tfoot td { font-weight: bold; background: var(--junlin-blue-pale); }
.ext-quote-notes { margin-top: 16px; font-size: 12px; color: var(--text-secondary); line-height: 1.8; }
.ext-quote-footer { margin-top: 24px; text-align: center; font-size: 12px; color: var(--text-light); line-height: 1.8; }
.ext-quote-seal { margin-top: 16px; font-size: 14px; color: var(--text-secondary); }

/* ═══ 响应式 ═══ */
@media (max-width: 1200px) {
  .dash-row { grid-template-columns: 1fr; }
  .dash-row:last-child { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .topbar-nav { flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .dash-row:last-child { grid-template-columns: 1fr; }
  #quotesList { grid-template-columns: 1fr; }
}

/* ═══ v4.0 新增：客户/代理商/报表/日志 ═══ */

/* 数据表格通用 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.data-table th {
  background: var(--junlin-blue);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr:hover { background: var(--junlin-blue-pale); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* 徽章 */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.badge-ok { background: var(--green-bg); color: var(--green); }
.badge-warn { background: var(--orange-bg); color: var(--orange); }

/* 报表 */
.report-builder {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.rpt-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}
.rpt-chart-wrap {
  background: var(--card-bg);
  padding: 16px;
  border-radius: 8px;
  min-height: 300px;
}
.preset-reports {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.preset-btn {
  padding: 8px 16px;
  border: 1px solid var(--junlin-blue-light);
  background: var(--junlin-blue-pale);
  color: var(--junlin-blue);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.preset-btn:hover {
  background: var(--junlin-blue);
  color: #fff;
}

/* 操作日志表格 */
#auditList table td { font-size: 13px; }

/* 代理商/客户列表 */
#customersList, #agentsList {
  background: var(--card-bg);
  border-radius: 8px;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* v6.33.4：报价审批 Tab 下折扣审批区块与报价单表格占满全屏，避免右侧留白 */
#tab-quotes {
  width: 100%;
  box-sizing: border-box;
}
#discountApprovalView,
#quotesList {
  display: block;          /* v6.33.7：覆盖早期 #quotesList 的 grid 卡片布局，避免 table 作为 grid item 无法满铺 */
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}
#tab-quotes .data-table {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
}
#tab-quotes .data-table th,
#tab-quotes .data-table td {
  white-space: nowrap;     /* v6.33.7：报价/折扣审批表格列不换行，避免内容被挤压 */
}

/* ═══ 打印样式 ═══ */
@media print {
  body * { visibility: hidden; }
  #modalExtQuote, #modalExtQuote * { visibility: visible; }
  #modalExtQuote { position: absolute; left: 0; top: 0; width: 100%; height: auto; background: #fff; }
  .modal-mask { background: none; }
  .modal-box { box-shadow: none; border: none; width: 100% !important; max-height: none; }
  .modal-header, .modal-footer { display: none; }
}

/* ═══ v5.0 审批流 + 竞品库 ═══ */
.appr-tag { display:inline-block; padding:1px 8px; border-radius:10px; font-size:11px; font-weight:600; white-space:nowrap; }
.appr-p1 { background:#FFF3E0; color:#E65100; border:1px solid #FFB74D; }
.appr-p2 { background:#E3F2FD; color:#1565C0; border:1px solid #64B5F6; }
.appr-ok { background:#E8F5E9; color:#2E7D32; border:1px solid #81C784; }
.appr-no { background:#FFEBEE; color:#C62828; border:1px solid #EF9A9A; }

.appr-timeline { display:flex; flex-direction:column; gap:8px; margin:8px 0 12px; }
.appr-step { display:grid; grid-template-columns:auto auto 1fr; gap:12px; align-items:center; padding:8px 12px; background:var(--junlin-blue-pale); border-radius:6px; font-size:13px; }
.appr-step-name { font-weight:600; }

.stat-red { background:linear-gradient(135deg,#FFEBEE,#FFCDD2); }

/* ═══ P0: 赅/输单 + 里程碑 + 超期预警 ═══ */
.wr-signed { background:#E0F7FA !important; color:#00695C !important; border:1px solid #26C6DA !important; }
.wr-mid-high { background:#FFF3E0; color:#EF6C00; }
.btn-win { background:#E8F5E9; color:#2E7D32; border:1px solid #81C784; }
.btn-win:hover { background:#C8E6C9; }
.btn-lose { background:#FFEBEE; color:#C62828; border:1px solid #EF9A9A; }
.btn-lose:hover { background:#FFCDD2; }

/* 超期预警灯 */
.alert-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:4px; vertical-align:middle; }
.alert-dot.alert-red { background:#F44336; box-shadow:0 0 4px #F44336; animation:pulse 1.5s infinite; }
.alert-dot.alert-yellow { background:#FFC107; box-shadow:0 0 4px #FFC107; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* 输单原因弹窗 */
.lose-reasons { display:flex; flex-direction:column; gap:6px; margin:10px 0; }
.lose-reason-opt { display:flex; align-items:center; gap:6px; padding:6px 10px; background:var(--junlin-blue-pale); border-radius:6px; cursor:pointer; font-size:13px; }
.lose-reason-opt:hover { background:var(--junlin-blue-light); }
.lose-reason-opt input { margin:0; }

/* 里程碑时间线 */
.ms-timeline { display:flex; gap:0; margin:8px 0; align-items:center; }
.ms-step { display:flex; flex-direction:column; align-items:center; position:relative; flex:1; }
.ms-step .ms-dot { width:14px; height:14px; border-radius:50%; border:2px solid #ccc; background:#fff; z-index:1; }
.ms-step.ms-done .ms-dot { background:#2E7D32; border-color:#2E7D32; }
.ms-step.ms-current .ms-dot { background:#1565C0; border-color:#1565C0; }
.ms-step .ms-label { font-size:10px; margin-top:4px; white-space:nowrap; color:#666; }
.ms-step .ms-date { font-size:9px; color:#999; }
.ms-line { position:absolute; top:6px; left:50%; width:100%; height:2px; background:#ddd; z-index:0; }
.ms-step:last-child .ms-line { display:none; }

/* ═══ 标准报表（817口径）主按钮 ═══ */
.preset-btn-main { background:linear-gradient(135deg,#1a5276,#2e86c1); color:#fff; border:none; padding:10px 22px; font-size:14px; }
.preset-btn-main:hover { background:linear-gradient(135deg,#21618c,#3498db); color:#fff; }
#stdReportResult table { margin-top:4px; }
#stdReportResult h4 { margin:6px 0 10px; color:#1a5276; }

/* ═══ Pipeline 表头排序 ═══ */
.pipeline-table th.sortable { cursor:pointer; user-select:none; white-space:nowrap; }
.pipeline-table th.sortable:hover { background:var(--junlin-blue-light, #d6eaf8); }
.pipeline-table th.sortable .sort-ind { font-size:10px; opacity:.45; margin-left:2px; }
.pipeline-table th.sorted { color:#1a5276; background:var(--junlin-blue-pale, #d4e6f1); }
.pipeline-table th.sorted .sort-ind { opacity:1; color:#2e86c1; }

/* ═══ 项目机会（情报待确认）═══ */
.opp-status { display:inline-block; padding:2px 10px; border-radius:10px; font-size:11px; font-weight:500; }
.opp-pending { background:#fef3cd; color:#856404; }
.opp-confirmed { background:#d4efdf; color:#1e6b34; }
.opp-abandoned { background:#e8e8e8; color:#888; text-decoration:line-through; }
.opp-value { display:inline-block; padding:1px 8px; border-radius:8px; font-size:11px; font-weight:bold; }
.opp-value-high { background:#fadbd8; color:#c0392b; }
.opp-value-mid { background:#fdebd0; color:#b9770e; }
.opp-pl-ref { font-size:11px; color:#1e6b34; font-family:'Consolas',monospace; }
.opp-abandon-detail { font-size:11px; color:#999; }
.cell-comp { font-size:11px; max-width:120px; overflow:hidden; text-overflow:ellipsis; }
.cell-abandon { font-size:11px; max-width:150px; }

/* ═══ v6.11 ②③④：逾期提醒 / 批量指派勾选列 / 同步信息 ═══ */
.opp-row-overdue td { background: var(--red-bg); }
.opp-row-overdue:hover td { background: #FFDDE0; }
.opp-overdue-date { color: var(--red); font-weight:500; white-space:nowrap; }
.opp-overdue-date b { background: var(--red); color:#fff; border-radius:8px; padding:1px 6px; font-size:10px; margin-left:4px; }
.opp-overdue-sub { font-size:11px; color: var(--red); font-weight:500; margin-top:2px; }
.opp-overdue-banner {
  background: var(--red-bg); border:1px solid #f5b7b1; border-left:4px solid var(--red);
  color:#922b21; border-radius:8px; padding:10px 14px; margin-bottom:12px; font-size:13px; line-height:1.6;
}
.cell-check { width:32px; text-align:center; }
.cell-check input[type="checkbox"] { width:15px; height:15px; cursor:pointer; }
#btnBatchAssign:disabled { opacity:0.5; cursor:not-allowed; }
#btnIntelSync:disabled { opacity:0.5; cursor:not-allowed; }

/* ═══════════════════════════════════════════════════
   组织架构 / 销售任务 / 个人设置
   ═══════════════════════════════════════════════════ */

/* 统计卡（兼容 stat-num 写法） */
.stat-card .stat-num { font-size: 24px; font-weight: bold; color: var(--text); }
.stat-card.stat-red { border-left-color: var(--red); }
.stat-card.stat-orange { border-left-color: var(--orange); }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }

/* ── 组织架构 ── */
.org-gm-wrap { display: flex; justify-content: center; margin-bottom: 20px; }
.org-lines {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  align-items: start;
}
.org-col {
  background: var(--card-bg); border-radius: 8px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); border-top: 3px solid var(--junlin-blue);
}
.org-col-head {
  font-size: 14px; font-weight: bold; color: var(--junlin-blue);
  padding: 10px 14px; background: var(--junlin-blue-pale); border-bottom: 1px solid var(--border);
}
.org-col-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.org-level-tag {
  font-size: 11px; color: var(--text-light); font-weight: 600;
  letter-spacing: .5px; margin-top: 6px; padding-left: 2px;
}
.org-level-tag:first-child { margin-top: 0; }

.org-card {
  border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px;
  background: #fff; transition: .15s; cursor: default;
}
.org-card[onclick] { cursor: pointer; }
.org-card[onclick]:hover { border-color: var(--junlin-blue); box-shadow: 0 2px 10px rgba(11,61,145,.12); transform: translateY(-1px); }
.org-card.gm { min-width: 280px; text-align: center; border-color: var(--junlin-blue); background: var(--junlin-blue-pale); }
.org-card.gm .org-card-title { font-size: 15px; }
.org-card.gm .org-card-holder { font-size: 18px; }
.org-card.l2 { border-left: 3px solid var(--junlin-blue-light); background: #FAFCFF; }
.org-card.l3 { border-left: 3px solid var(--junlin-blue-light); }
.org-card.l4 { border-left: 3px solid var(--border); }
.org-card.vacant { background: #FAFAFA; border-style: dashed; }
.org-card.vacant .org-card-holder { color: var(--orange); font-weight: 600; }
.org-card-title { font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; }
.org-card-holder { font-size: 15px; font-weight: 700; color: var(--text); }
.org-card-meta { font-size: 11px; color: var(--text-light); margin-top: 3px; }
.org-card-task {
  font-size: 11px; color: var(--junlin-blue); margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed var(--border); line-height: 1.5;
}
.org-empty { font-size: 12px; color: var(--text-light); padding: 6px 2px; font-style: italic; }

/* ── 达成率徽章 ── */
.rate-badge {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.rate-badge.ok  { background: var(--green-bg);  color: var(--green); }
.rate-badge.mid { background: var(--orange-bg); color: #b9770e; }
.rate-badge.low { background: var(--red-bg);    color: var(--red); }

/* ── 视图切换按钮激活态 ── */
.btn-mini.active {
  background: var(--junlin-blue); color: #fff; border-color: var(--junlin-blue);
}
.btn-mini.active:hover { background: var(--junlin-blue); color: #fff; }

/* ── 个人信息网格 ── */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.info-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px; background: var(--junlin-blue-pale); border-radius: 6px;
}
.info-label { font-size: 12px; color: var(--text-secondary); }
.info-value { font-size: 14px; font-weight: 600; color: var(--text); }

/* ── 密码明文列（仅管理员可见） ── */
.pass-cell { font-family: 'Consolas', monospace; font-size: 13px; }
.pass-cell .pass-mask { color: var(--text-light); letter-spacing: 2px; }
.pass-toggle {
  background: none; border: none; color: var(--junlin-blue-light);
  cursor: pointer; font-size: 11px; padding: 0 4px; text-decoration: underline;
}
.pass-cell.plain { color: var(--red); font-weight: 700; }

@media (max-width: 1200px) {
  .org-lines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .org-lines { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
}

/* ── 组织架构：我的位置 / 汇报链 ── */
.org-card.mine {
  border-color: var(--junlin-blue); background: var(--junlin-blue-pale);
  box-shadow: 0 0 0 2px rgba(11, 61, 145, .18);
}
.org-card.mine .org-card-holder { color: var(--junlin-blue); }
.org-me-tag {
  display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 8px;
  background: var(--junlin-blue); color: #fff; font-size: 10px; font-weight: 700;
  vertical-align: middle; line-height: 15px;
}
.org-card.chain { border-color: var(--junlin-blue-light); border-style: dashed; }
.org-chain { text-align: center; font-size: 12px; color: var(--text-light); margin-top: 8px; line-height: 1.7; }
.org-col.mine-line { border-top-color: var(--junlin-blue); box-shadow: 0 2px 12px rgba(11, 61, 145, .14); }
.org-col.mine-line .org-col-head { background: rgba(11, 61, 145, .12); }
