/* 商机 · 复用客户库 crm-* / customers-* 视觉；此处只补页面壳与商机特有块 */
#opportunitiesPage.page-content:not(.d-none){flex:1 1 auto;display:flex;flex-direction:column;min-height:0;overflow:hidden;padding-bottom:16px}
#opportunitiesPage .customers-demo-banner,#opportunitiesPage #opportunitiesNoTeam{flex:0 0 auto}
#opportunitiesPage .customers-shell{
  display:grid;grid-template-columns:minmax(0,1fr);background:#fff;border:1px solid var(--crm-line,#e2e9ed);border-radius:12px;
  flex:1 1 auto;min-height:0;height:calc(100vh - 150px);max-height:calc(100vh - 150px);overflow:hidden;
  --crm-accent:#009c98;--crm-ink:#192b33;--crm-line:#e2e9ed;--crm-muted:#72808b;color:var(--crm-ink);font-size:14px;line-height:1.6
}
#opportunitiesPage .customers-shell *,#opportunitiesPage .crm-dialog *{box-sizing:border-box}
#opportunitiesPage .customers-shell.is-detail{grid-template-columns:minmax(0,1.05fr) minmax(0,1fr)}
#opportunitiesPage .customers-shell [hidden],#opportunitiesPage .crm-dialog [hidden]{display:none!important}
#opportunitiesPage .customers-list-pane{padding:20px 22px;min-width:0;min-height:0;display:flex;flex-direction:column;gap:20px;overflow:hidden}
#opportunitiesPage .customers-detail-pane{border-left:1px solid var(--crm-line);min-width:0;min-height:0;padding:24px;overflow:auto;background:#fff}
#opportunitiesPage .customers-list-head{display:flex;gap:12px;align-items:center}
#opportunitiesPage .customers-list-head input{flex:1;min-width:100px}
#opportunitiesPage .customers-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) minmax(240px,1.5fr) auto;gap:8px;align-items:center}
#opportunitiesPage .opp-range{position:relative;min-width:0}
#opportunitiesPage .opp-range-trigger{display:flex;align-items:center;gap:8px;width:100%;height:38px;min-height:38px;padding:0 10px;border:1px solid #dce4e9;border-radius:7px;background:#fff;color:#273e47;font:inherit;font-size:12px;line-height:38px;cursor:pointer;text-align:left}
#opportunitiesPage .opp-range-trigger.is-empty{color:#98a3ab}
#opportunitiesPage .opp-range-trigger i{flex:none;color:#8a979e;font-size:13px;line-height:1}
#opportunitiesPage .opp-range-trigger span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#opportunitiesPage .opp-range-pop{position:fixed;z-index:40;width:292px;padding:12px;border:1px solid #d8e5e8;border-radius:12px;background:#fff;box-shadow:0 18px 40px rgba(20,60,69,.16)}
#opportunitiesPage .opp-range-edges{display:grid;grid-template-columns:1fr auto 1fr;gap:8px;align-items:center}
#opportunitiesPage .opp-edge{position:relative;min-width:0}
#opportunitiesPage .opp-edge-main{width:100%;min-height:48px;padding:6px 22px 6px 8px;border:1px solid #dce4e9;border-radius:7px;background:#fff;text-align:left;font:inherit;cursor:pointer}
#opportunitiesPage .opp-edge-main small{display:block;color:#8a979e;font-size:11px;line-height:16px}
#opportunitiesPage .opp-edge-main strong{display:block;color:#98a3ab;font-size:12px;font-weight:400;line-height:18px}
#opportunitiesPage .opp-edge.is-set .opp-edge-main strong{color:#213b44;font-weight:600}
#opportunitiesPage .opp-edge.is-active .opp-edge-main{border-color:#009c98;box-shadow:0 0 0 2px #009c9833}
#opportunitiesPage .opp-edge-clear{position:absolute;top:4px;right:4px;width:18px;height:18px;border:0;border-radius:50%;background:transparent;color:#8a979e;font-size:14px;line-height:18px;cursor:pointer}
#opportunitiesPage .opp-edge-clear:hover{background:#eef3f4;color:#40535c}
#opportunitiesPage .opp-range-sep{color:#8a979e;font-size:12px}
#opportunitiesPage .opp-cal-head{display:flex;align-items:center;justify-content:space-between;margin-top:10px}
#opportunitiesPage .opp-cal-head strong{font-size:13px;font-weight:650;color:#213b44}
#opportunitiesPage .opp-cal-head button,#opportunitiesPage .opp-cal-grid button{border:0;background:transparent;font:inherit;cursor:pointer}
#opportunitiesPage .opp-cal-head button{width:28px;height:28px;border-radius:6px;color:#40535c}
#opportunitiesPage .opp-cal-head button:hover{background:#eef6f6}
#opportunitiesPage .opp-cal-week,#opportunitiesPage .opp-cal-grid{display:grid;grid-template-columns:repeat(7,1fr)}
#opportunitiesPage .opp-cal-week{margin-top:6px;color:#8a979e;font-size:11px;text-align:center}
#opportunitiesPage .opp-cal-grid{margin-top:4px}
#opportunitiesPage .opp-cal-grid button{height:32px;border-radius:6px;color:#213b44;font-size:12px;font-variant-numeric:tabular-nums}
#opportunitiesPage .opp-cal-grid button:hover{background:#eef6f6}
#opportunitiesPage .opp-cal-grid button.is-in{background:#e5f6f5;border-radius:0}
#opportunitiesPage .opp-cal-grid button.is-edge{background:#009c98;color:#fff;font-weight:650}
#opportunitiesPage .opp-cal-grid button.is-edge.is-start{border-radius:6px 0 0 6px}
#opportunitiesPage .opp-cal-grid button.is-edge.is-end{border-radius:0 6px 6px 0}
#opportunitiesPage .opp-cal-grid button.is-edge.is-only{border-radius:6px}
#opportunitiesPage .opp-range-actions{display:flex;justify-content:space-between;align-items:center;margin-top:10px}
#opportunitiesPage .opp-range-actions .crm-button{min-height:30px;font-size:12px}
#opportunitiesPage .customers-filters .crm-input{padding:7px 6px;font-size:12px}
#opportunitiesPage .customers-list{min-width:0;min-height:0;overflow:auto;border:1px solid var(--crm-line);border-radius:8px;flex:1}
#opportunitiesPage .customers-pager{display:flex;justify-content:stretch;align-items:stretch;gap:0;margin-top:auto;width:100%;font-size:14px}
/* 可点的客户名、未建档标记、复制 */
.opp-link{border:0;padding:0;background:none;font:inherit;color:#008d88;text-align:left;cursor:pointer;text-decoration:underline;text-decoration-color:#009c9855;text-underline-offset:3px}
.opp-link:hover{text-decoration-color:currentColor}
.opp-unfiled{display:inline-block;margin-left:4px;padding:0 5px;border-radius:4px;background:#f3f5f6;color:#8a979e;font-size:10px;white-space:nowrap;vertical-align:1px}
.opp-copyable{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}
.opp-copy{border:0;background:none;padding:0;font:inherit;font-size:11px;color:#008d88;cursor:pointer}
.opp-copy:hover{text-decoration:underline}
.opp-log-count{font-size:12px}
/* 修改记录：一次保存一条，字段前后值成行对齐 */
.opp-log{list-style:none;margin:0;padding:0 0 0 6px}
.opp-log-item{position:relative;padding:0 0 18px 20px;border-left:1px solid #d5e6e6}
.opp-log-item:last-child{padding-bottom:2px;border-left-color:transparent}
.opp-log-item::before{content:'';position:absolute;left:-5px;top:6px;width:9px;height:9px;border-radius:50%;background:#fff;border:2px solid var(--crm-accent,#009c98)}
.opp-log-item.is-create::before{background:var(--crm-accent,#009c98)}
.opp-log-head{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;font-size:13px;color:#56636b}
.opp-log-head strong{font-weight:600;color:#213b44}
.opp-log-head time{margin-left:auto;font-size:11px;color:#9aa5ab;font-variant-numeric:tabular-nums;white-space:nowrap}
.opp-change-list{list-style:none;margin:8px 0 0;padding:8px 12px;background:#f7fafa;border-radius:8px;display:flex;flex-direction:column;gap:6px}
.opp-change-row{display:grid;grid-template-columns:68px minmax(0,auto) 14px minmax(0,1fr);gap:8px;align-items:baseline;font-size:12px;line-height:1.6}
.opp-change-row.is-long{display:block}
.opp-change-label{color:#73838a}
.opp-change-from{color:#8a979e;text-decoration:line-through;text-decoration-color:#c3ccd0;overflow-wrap:anywhere}
.opp-change-arrow{color:#b3bec3}
.opp-change-to{color:#213b44;font-weight:600;overflow-wrap:anywhere}
.opp-change-blank{color:#aab4b9;font-weight:400;text-decoration:none;display:inline-block}
.opp-change-row summary{cursor:pointer;display:flex;gap:8px;align-items:baseline;list-style-position:inside}
.opp-change-row summary .opp-change-label{display:inline-block;min-width:60px}
.opp-change-hint{color:#008d88}
.opp-change-compare{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:8px}
.opp-change-compare>div{background:#fff;border:1px solid #e2e9ed;border-radius:6px;padding:8px 10px;min-width:0}
.opp-change-compare small{display:block;color:#8a979e;font-size:11px;margin-bottom:4px}
.opp-change-compare p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;color:#40535c}
.opp-log-more{margin-top:10px;text-align:center}
.opp-log-more .crm-button{font-size:12px;min-height:28px}
/* 表单：分组 + 客户搜索框（弹窗挂在 body 上，不能用页面 id 限定） */
.opp-dialog .opp-form-section{margin:0 0 4px;min-width:0}
.opp-dialog .opp-form-section+.opp-form-section{border-top:1px solid var(--crm-line);padding-top:16px}
.opp-dialog .opp-form-section h3{margin:0 0 12px;font-size:12px;font-weight:600;color:#8a979e}
.opp-dialog .opp-combo>label{font-size:13px;color:#46616a}
.opp-combo-box{position:relative}
.opp-combo-box .crm-input{padding-right:34px}
.opp-combo.is-linked .crm-input{border-color:#9ccac8;background:#f4fbfb;color:#00706c;font-weight:600}
.opp-combo-clear{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:24px;height:24px;border:0;border-radius:50%;background:none;color:#8a979e;font-size:16px;line-height:1;cursor:pointer}
.opp-combo-clear:hover{background:#eef3f4;color:#40535c}
.opp-combo-list{position:absolute;z-index:5;left:0;right:0;top:calc(100% + 4px);margin:0;padding:4px;list-style:none;background:#fff;border:1px solid #d8e5e8;border-radius:8px;box-shadow:0 12px 40px #143c4522;max-height:232px;overflow:auto}
.opp-combo-list [role=option]{display:flex;align-items:baseline;gap:8px;padding:8px 10px;border-radius:6px;cursor:pointer;font-size:13px}
.opp-combo-list [role=option] strong{font-weight:600;color:#213b44}
.opp-combo-list [role=option] small{color:#8a979e;font-size:11px}
.opp-combo-list [role=option]:hover,.opp-combo-list [role=option][aria-selected=true]{background:#edf6f6}
.opp-combo-note{padding:8px 10px;font-size:12px;color:#8a979e}
.opp-combo-list [role=option]+.opp-combo-note{border-top:1px solid #eef2f4;margin-top:4px}
.opp-combo-state{font-size:11px;color:#8a979e}
.opp-combo.is-linked .opp-combo-state{color:#008d88}
.opp-dialog .crm-option-add{display:flex;gap:8px;align-items:center;margin:12px 0 16px}
.opp-dialog .crm-option-add .crm-input{flex:1}
/* 客户详情「商机」页签里的行 */
.opp-customer-row{gap:12px;text-align:left}
.opp-customer-row .opp-customer-row-main{display:flex;flex-direction:column;min-width:0;color:#213b44;font-size:13px}
.opp-customer-row .opp-customer-row-main small{color:#8a979e;font-size:11px}
.opp-customer-row .opp-customer-row-tags{display:flex;gap:6px;flex:0 0 auto}
.opp-customer-row:hover strong{color:#008d88}
.opp-customer-more{font-size:12px;margin:10px 0 0}
@media(max-width:800px){.opp-change-compare{grid-template-columns:1fr}.opp-change-row{grid-template-columns:60px minmax(0,1fr)}.opp-change-arrow{display:none}}
#opportunitiesPage .crm-button[disabled],#opportunitiesPage .crm-text-button[disabled]{opacity:.5;cursor:not-allowed}
@media(max-width:1150px){
  #opportunitiesPage .customers-shell.is-detail{grid-template-columns:minmax(0,.95fr) minmax(0,1.1fr)}
  #opportunitiesPage .customers-filters{grid-template-columns:1fr 1fr}
  #opportunitiesPage .customers-filters .crm-text-button{grid-column:auto;grid-row:auto}
  #opportunitiesPage .opp-range{grid-column:1 / -1}
  #opportunitiesPage .crm-table{min-width:640px}
}
@media(max-width:800px){
  #opportunitiesPage .customers-shell.is-detail{grid-template-columns:minmax(0,1fr)}
  #opportunitiesPage .customers-shell.is-detail .customers-list-pane{display:none}
  #opportunitiesPage .customers-detail-pane{border-left:0}
  #opportunitiesPage .customers-shell{height:calc(100vh - 110px);max-height:calc(100vh - 110px)}
}
