.customer-supplier-v3{display:grid;gap:18px}.customer-supplier-toolbar{align-items:flex-end}.customer-supplier-toolbar label{display:grid;gap:5px;color:var(--text-muted);font-size:12px}.customer-supplier-feedback{min-height:22px;color:var(--text-muted);font-size:13px}.customer-supplier-table{min-width:1080px}.customer-supplier-table td{display:table-cell;vertical-align:middle}.customer-supplier-name,.customer-supplier-contact{display:grid;gap:4px;min-width:150px}.customer-supplier-name b,.customer-supplier-contact b{overflow-wrap:anywhere}.customer-supplier-name small,.customer-supplier-contact small{color:var(--text-muted)}.customer-supplier-tags{display:flex;align-items:center;flex-wrap:wrap;gap:5px;min-width:140px}.customer-supplier-tags>b,.customer-supplier-tags>span,.customer-supplier-tags>small{padding:3px 7px;border:1px solid var(--border-color);border-radius:999px;background:var(--surface-soft);font-size:12px}.customer-supplier-pager .ds-pagination{margin-top:0}.customer-detail-v3-head{align-items:flex-start}.customer-detail-links{display:flex;flex-wrap:wrap;gap:8px;padding:2px 0}.customer-detail-grid,.customer-detail-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.customer-detail-columns{grid-template-columns:repeat(3,minmax(0,1fr))}.customer-supplier-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:16px 0 0}.customer-supplier-facts div{min-width:0}.customer-supplier-facts dt{color:var(--text-muted);font-size:12px}.customer-supplier-facts dd{margin:5px 0 0;font-weight:650;overflow-wrap:anywhere}.technical-id{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;color:var(--text-muted)}.customer-detail-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.customer-detail-metrics article{display:grid;gap:6px;padding:16px;border:1px solid var(--border-color);border-radius:var(--radius-lg);background:var(--surface-bg)}.customer-detail-metrics span,.customer-detail-metrics small{color:var(--text-muted)}.customer-detail-metrics b{font-size:22px}.customer-detail-list{display:grid;gap:0;margin-top:12px}.customer-detail-list>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:10px 0;border-bottom:1px solid var(--border-color)}.customer-detail-list span,.customer-detail-list small{color:var(--text-muted);font-size:12px}.supplier-detail-links{margin:12px 0}.supplier-table td{display:table-cell}.supplier-table{min-width:1120px}.supplier-toolbar.ds-list-surface{display:flex;align-items:center;justify-content:space-between}.supplier-toolbar .ds-toolbar{border:0;background:transparent;padding:0;box-shadow:none}.ds-filter-chips{display:flex;gap:6px;margin-top:9px}.ds-filter-chip{border:1px solid var(--accent-color,#087f5b);border-radius:999px;padding:5px 9px;background:var(--surface-soft);color:var(--accent-color,#087f5b);cursor:pointer}
.supplier-table.with-cost{min-width:1120px}.supplier-table.with-cost:not(.with-selection) th:nth-child(1){width:19%}.supplier-table.with-cost:not(.with-selection) th:nth-child(2){width:10%}.supplier-table.with-cost:not(.with-selection) th:nth-child(3){width:12%}.supplier-table.with-cost:not(.with-selection) th:nth-child(4){width:10%}.supplier-table.with-cost:not(.with-selection) th:nth-child(5){width:8%}.supplier-table.with-cost:not(.with-selection) th:nth-child(6){width:12%}.supplier-table.with-cost:not(.with-selection) th:nth-child(7){width:11%}.supplier-table.with-cost:not(.with-selection) th:nth-child(8){width:18%}.supplier-table.with-cost.with-selection th:nth-child(1){width:4%}.supplier-table.with-cost.with-selection th:nth-child(2){width:18%}.supplier-table.with-cost.with-selection th:nth-child(3){width:9%}.supplier-table.with-cost.with-selection th:nth-child(4){width:11%}.supplier-table.with-cost.with-selection th:nth-child(5){width:9%}.supplier-table.with-cost.with-selection th:nth-child(6){width:8%}.supplier-table.with-cost.with-selection th:nth-child(7){width:12%}.supplier-table.with-cost.with-selection th:nth-child(8){width:11%}.supplier-table.with-cost.with-selection th:nth-child(9){width:18%}.supplier-table time{white-space:nowrap}.supplier-purchase-scale small{white-space:nowrap}
@media(max-width:1100px){.customer-detail-columns{grid-template-columns:1fr 1fr}.customer-detail-metrics{grid-template-columns:1fr 1fr}}@media(max-width:760px){.customer-detail-grid,.customer-detail-columns,.customer-supplier-facts,.customer-detail-metrics{grid-template-columns:1fr}.customer-supplier-toolbar{align-items:stretch}.supplier-toolbar.ds-list-surface{align-items:stretch;flex-direction:column}}

.settlement-credit-card{display:grid;gap:16px}.settlement-credit-head{align-items:flex-start}.settlement-credit-status{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--border-color);border-radius:var(--radius-md);background:var(--surface-soft)}.settlement-credit-status p{margin:0;color:var(--text-muted)}.settlement-credit-status.is-success{border-color:#9dd8c3;background:#f0fbf6}.settlement-credit-status.is-warning{border-color:#ead08c;background:#fff9e9}.settlement-credit-status.is-danger{border-color:#efb2b7;background:#fff4f5}.settlement-credit-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.settlement-credit-metrics article{display:grid;gap:5px;padding:14px;border:1px solid var(--border-color);border-radius:var(--radius-md);background:var(--surface-bg)}.settlement-credit-metrics span,.settlement-credit-metrics small{color:var(--text-muted)}.settlement-credit-metrics b{font-size:20px;font-variant-numeric:tabular-nums}.settlement-credit-policy{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding-top:2px}.settlement-credit-policy div{display:grid;gap:4px}.settlement-credit-policy span{font-size:12px;color:var(--text-muted)}.settlement-credit-unallocated{margin:0;padding:10px 12px;border-left:3px solid #c58a08;background:#fff9e9;color:#795700}.settlement-credit-form{display:grid;gap:16px}.settlement-credit-form section{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:16px;border:1px solid var(--border-color);border-radius:var(--radius-md)}.settlement-credit-form section h4{grid-column:1/-1;margin:0}.settlement-credit-form label{display:grid;gap:6px;color:var(--text-muted);font-size:13px}.settlement-credit-form input,.settlement-credit-form select{min-height:40px;padding:8px 10px;border:1px solid var(--border-color);border-radius:var(--radius-sm);background:var(--surface-bg);color:var(--text-color)}.settlement-credit-form .settlement-credit-switch{display:flex;align-items:center;gap:8px;color:var(--text-color)}.settlement-credit-form .settlement-credit-switch input{min-height:0}.settlement-credit-readonly,.settlement-credit-boundary{grid-column:1/-1;margin:0;color:var(--text-muted)}.settlement-credit-form footer{display:flex;justify-content:flex-end;gap:8px}

@media(max-width:1100px){.settlement-credit-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.settlement-credit-policy{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:760px){.settlement-credit-status{align-items:flex-start;flex-direction:column}.settlement-credit-metrics,.settlement-credit-policy,.settlement-credit-form section{grid-template-columns:1fr}}
.crm-purchase-preference{grid-column:1/-1}.crm-purchase-preference[aria-busy="true"]{min-height:120px}.crm-purchase-preference-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:12px 0 16px}.crm-purchase-preference-summary article{padding:12px;border:1px solid var(--ds-border,#dfe7e4);border-radius:10px;background:var(--ds-surface-subtle,#f7faf9)}.crm-purchase-preference-summary span,.crm-purchase-preference-summary b{display:block}.crm-purchase-preference-summary span{font-size:12px;color:var(--ds-text-muted,#687775)}.crm-purchase-preference-summary b{margin-top:5px;font-size:18px}.crm-purchase-preference-columns{display:grid;grid-template-columns:1.15fr .9fr 1fr;gap:16px}.crm-purchase-preference-columns h4{margin:0 0 10px}.crm-purchase-reminder{margin:0 0 8px;padding:10px 12px;border-radius:8px;background:#fff7e6;color:#7a4b00}.crm-purchase-preference-foot{display:flex;justify-content:space-between;align-items:center;margin-top:12px;color:var(--ds-text-muted,#687775);font-size:12px}@media(max-width:900px){.crm-purchase-preference-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.crm-purchase-preference-columns{grid-template-columns:1fr}}
.settlement-credit-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.credit-history-panel{display:grid;gap:14px;min-width:0;max-width:100%}
#modal.credit-history-modal{width:min(820px,calc(100vw - 32px));max-width:calc(100vw - 32px)}
.credit-history-boundary,.credit-history-meta{color:var(--ds-text-muted,var(--muted));font-size:13px;margin:0}
.credit-history-item{padding:14px 0;border-bottom:1px solid var(--ds-border,var(--line));overflow-wrap:anywhere}
.credit-history-item header{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.credit-history-item time{color:var(--ds-text-muted,var(--muted));font-size:12px;white-space:nowrap}
.credit-history-item p,.credit-history-item ul{margin:8px 0;font-size:13px}
.credit-history-item ul{padding-left:20px}
.credit-history-snapshot summary{cursor:pointer;font-size:13px;color:var(--ds-text,var(--ink))}
.credit-history-snapshot dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;background:var(--ds-surface-subtle,#f7faf9);padding:12px;border-radius:8px}
.credit-history-snapshot dt{color:var(--ds-text-muted,var(--muted));font-size:12px}
.credit-history-snapshot dd{margin:4px 0 0;font-variant-numeric:tabular-nums}
.credit-history-panel footer{display:flex;justify-content:flex-end;gap:8px}
.credit-history-panel [data-credit-history-more][hidden]{display:none}
@media(max-width:760px){.settlement-credit-actions{justify-content:flex-start}.credit-history-item header{flex-direction:column}.credit-history-snapshot dl{grid-template-columns:1fr}}

.customer-credit-list-table{min-width:0;width:100%;table-layout:fixed}
.customer-credit-list-table th,.customer-credit-list-table td{overflow-wrap:anywhere;padding:12px 15px;border-left:0;border-right:0;box-sizing:border-box}
.customer-credit-list-table th{height:44px}.customer-credit-list-table tbody tr{height:64px}
.customer-credit-list-table th:nth-child(1){width:24%}.customer-credit-list-table th:nth-child(2){width:17%}.customer-credit-list-table th:nth-child(3){width:13%}.customer-credit-list-table th:nth-child(4){width:20%}.customer-credit-list-table th:nth-child(5){width:16%}.customer-credit-list-table th:nth-child(6){width:10%}
.customer-credit-list-table .customer-supplier-name,.customer-credit-list-table .customer-supplier-contact,.customer-credit-list-table .customer-supplier-tags,.customer-profile-summary,.customer-recent-activity{min-width:0}
.customer-credit-list-table .customer-info-group-start{border-left:1px solid rgba(101,126,119,.10);padding-left:14px}
.customer-credit-list-table .ds-cell-center{text-align:center;vertical-align:middle}.customer-credit-list-table .ds-table-actions{white-space:normal;justify-content:center;text-align:center}.customer-status-pills{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:7px}.customer-profile-summary,.customer-recent-activity{display:grid;gap:5px}.customer-profile-summary>small,.customer-recent-activity>small{color:var(--ui-text-secondary,var(--muted));font-size:12px}.customer-recent-activity{justify-items:center}.customer-recent-activity time{white-space:nowrap}
.customer-credit-list-table td.ds-table-actions{justify-content:center!important;text-align:center!important}
.customer-credit-pill,.customer-cooperation-pill{font:inherit;font-size:12px;cursor:pointer;white-space:normal;text-align:center;line-height:1.4}
.customer-credit-pill:hover,.customer-cooperation-pill:hover{box-shadow:0 0 0 2px rgba(101,126,119,.12)}
.customer-credit-unavailable{color:var(--ui-text-secondary,var(--muted))}
.customer-blacklist-launch.ds-btn,.customer-blacklist-confirm.ds-btn{background:var(--ui-surface,var(--white));border:1px solid #cf4d54;color:#b42332}
.customer-blacklist-launch.ds-btn:hover,.customer-blacklist-confirm.ds-btn:hover{background:#fff4f5;border-color:#b42332;color:#a21b29}
.customer-blacklist-launch.ds-btn:disabled,.customer-blacklist-confirm.ds-btn:disabled{opacity:.45;cursor:default}
.settlement-credit-card{scroll-margin-top:112px}
#modal.customer-blacklist-workbench-modal{width:min(1180px,calc(100vw - 64px));max-width:calc(100vw - 64px);height:min(82vh,calc(100vh - 96px));max-height:calc(100vh - 96px);overflow:hidden}
#modal.customer-blacklist-workbench-modal .modal-card{height:100%;display:flex;flex-direction:column;padding:22px}
#modal.customer-blacklist-workbench-modal .modal-card>header{flex-shrink:0;margin-bottom:12px}
#modal.customer-blacklist-workbench-modal #modalBody{flex:1;min-height:0;overflow:hidden}
.customer-blacklist-workbench{height:100%;min-height:0;min-width:0;display:flex;flex-direction:column;color:var(--ui-text-primary,var(--ink));gap:0}
.modal-card .customer-blacklist-workbench__head{display:block;flex-shrink:0;min-width:0;margin-bottom:0}
.customer-blacklist-workbench__head>p{margin:0 0 12px;color:var(--ui-text-secondary,var(--muted));font-size:13px}
.customer-blacklist-search{display:flex;gap:8px;min-width:0}
.customer-blacklist-search .ds-search{flex:1;min-width:0}
.customer-blacklist-search input{width:100%;min-width:0}
.customer-blacklist-filters{margin-top:12px;font-size:13px}
.customer-blacklist-filters>summary{cursor:pointer;color:var(--ui-text-secondary,var(--muted));padding:6px 0;font-weight:600}
.customer-blacklist-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;align-items:end;margin:8px 0}
.customer-blacklist-filter-grid label{display:grid;gap:5px;min-width:0;color:var(--ui-text-secondary,var(--muted));font-size:12px}
.customer-blacklist-filter-grid input,.customer-blacklist-filter-grid select{width:100%;min-width:0}
.customer-blacklist-dates{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;grid-column:span 2}
.customer-blacklist-feedback{min-height:26px;flex-shrink:0;padding:4px 0;font-size:12px;color:var(--ui-text-secondary,var(--muted));display:flex;align-items:center;gap:8px;overflow-wrap:anywhere}
.customer-blacklist-results-heading,.customer-blacklist-result{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1.4fr) minmax(0,1.4fr) minmax(0,.8fr) 112px;gap:12px;align-items:center}
.customer-blacklist-results-heading{flex-shrink:0;background:var(--ui-surface-soft,#f7faf9);padding:10px 12px;font-size:12px;color:var(--ui-text-secondary,var(--muted));border-radius:8px 8px 0 0}
.customer-blacklist-results-heading>span:nth-child(4){text-align:right}
.customer-blacklist-results{flex:1;min-height:100px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;border-bottom:1px solid var(--ui-border,var(--line))}
.customer-blacklist-result{padding:12px;border-bottom:1px solid var(--ui-border,var(--line));font-size:13px;cursor:pointer}
.customer-blacklist-result:hover{background:var(--ui-surface-soft,#f7faf9)}
.customer-blacklist-result.is-selected{background:#eef8f3;box-shadow:inset 3px 0 #087f5b}
.customer-blacklist-result>div{min-width:0}
.customer-blacklist-result__identity,.customer-blacklist-result__order{display:grid;gap:4px}
.customer-blacklist-result__identity b,.customer-blacklist-result__identity span,.customer-blacklist-result__identity small,.customer-blacklist-result__order span,.customer-blacklist-result__order small{overflow-wrap:anywhere}
.customer-blacklist-result__identity span,.customer-blacklist-result__identity small,.customer-blacklist-result__order small{color:var(--ui-text-secondary,var(--muted));font-size:12px}
.customer-blacklist-result__identity .customer-blacklist-match{color:#087f5b}
.customer-blacklist-remark{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.customer-blacklist-result__status{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.customer-blacklist-result__money{text-align:right;font-weight:600;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.customer-blacklist-result__action{text-align:right}
.customer-blacklist-pager{flex-shrink:0}
.customer-blacklist-pager .ds-pagination{margin-top:0;padding:10px 0}
.customer-blacklist-workbench__bottom{flex-shrink:0;display:grid;gap:8px;border-top:1px solid var(--ui-border,var(--line));padding-top:12px;min-width:0}
.customer-blacklist-selected{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;font-size:13px;min-width:0;overflow-wrap:anywhere}
.customer-blacklist-selected>span,.customer-blacklist-selected>small{color:var(--ui-text-secondary,var(--muted))}
.customer-blacklist-selected>small{font-size:12px}
.customer-blacklist-selected>b{overflow-wrap:anywhere}
.customer-blacklist-reason,.customer-blacklist-detail form>label{display:grid;gap:6px;font-size:13px;color:var(--ui-text-secondary,var(--muted))}
.customer-blacklist-reason textarea,.customer-blacklist-detail textarea{width:100%;min-width:0;min-height:64px;max-height:90px;resize:none;border:1px solid var(--ui-border,var(--line));border-radius:8px;padding:9px 11px;background:var(--ui-surface,var(--white));color:var(--ui-text-primary,var(--ink))}
.customer-blacklist-workbench__actions{display:flex;gap:8px;align-items:center;justify-content:flex-end}
.customer-blacklist-workbench__actions .form-status{flex:1;margin:0;min-width:0;overflow-wrap:anywhere}
.customer-blacklist-workbench [hidden],.customer-blacklist-detail [hidden]{display:none!important}
#modal.customer-blacklist-detail-modal{width:min(620px,calc(100vw - 32px));max-width:calc(100vw - 32px)}
.customer-blacklist-detail{display:grid;gap:16px;min-width:0;overflow-wrap:anywhere}
.customer-blacklist-detail h3{margin:0}
.customer-blacklist-detail dl{display:grid;gap:14px}
.customer-blacklist-detail dt{font-size:12px;color:var(--ui-text-secondary,var(--muted))}
.customer-blacklist-detail dd{margin:4px 0 0;line-height:1.6}
.customer-blacklist-detail p{font-size:13px;color:var(--ui-text-secondary,var(--muted))}
.customer-blacklist-detail footer{display:flex;gap:8px;justify-content:flex-end;margin-top:12px}
.customer-relation-confirmation{width:min(520px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);padding:0;border:1px solid var(--ui-border,var(--line));border-radius:14px;background:var(--ui-surface,var(--white));color:var(--ui-text-primary,var(--ink));box-shadow:0 20px 64px rgba(20,35,31,.24);overflow:hidden}
.customer-relation-confirmation::backdrop{background:rgba(17,29,25,.48)}
.customer-relation-confirmation__body{display:flex;flex-direction:column;gap:14px;padding:22px;max-height:calc(100dvh - 34px);min-width:0;box-sizing:border-box;overflow-wrap:anywhere}
.customer-relation-confirmation h3,.customer-relation-confirmation p,.customer-relation-confirmation dl{margin:0}
.customer-relation-confirmation h3{font-size:19px;flex-shrink:0}
.customer-relation-confirmation p{font-size:13px;line-height:1.65;color:var(--ui-text-secondary,var(--muted))}
.customer-relation-confirmation .customer-relation-confirmation__customer{font-size:16px;font-weight:650;color:var(--ui-text-primary,var(--ink))}
.customer-relation-confirmation dl{display:grid;gap:12px;overflow-y:auto;min-height:0;padding:14px;background:var(--ui-surface-soft,#f7faf9);border-radius:8px;overscroll-behavior:contain}
.customer-relation-confirmation dt{font-size:12px;color:var(--ui-text-secondary,var(--muted))}
.customer-relation-confirmation dd{margin:4px 0 0;font-size:13px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.customer-relation-confirmation footer{display:flex;gap:8px;justify-content:flex-end;flex-shrink:0}
.customer-relation-confirmation__danger.ds-btn{background:#b42332;border-color:#b42332;color:#fff}
.customer-relation-confirmation__danger.ds-btn:hover{background:#961b28;border-color:#961b28;color:#fff}

.crm-compact-hero{padding-top:14px;padding-bottom:14px}.crm-compact-hero h3{margin-bottom:4px}.crm-compact-hero p{margin-bottom:0}
.crm-analysis-customers{margin-bottom:18px;min-width:0}.customer-analysis-toolbar{margin:12px 0}.customer-analysis-toolbar .ds-toolbar__left,.customer-analysis-toolbar .ds-toolbar__right{min-width:0}.customer-analysis-table-host{max-width:100%;overflow-x:auto}.customer-analysis-customer-table{width:100%;min-width:980px;table-layout:fixed}.customer-analysis-customer-table th,.customer-analysis-customer-table td,.customer-analysis-detail-table th,.customer-analysis-detail-table td{padding:12px 15px;box-sizing:border-box;border-left:0;border-right:0}.customer-analysis-customer-table th{height:44px}.customer-analysis-customer-table tbody tr{height:64px}.customer-analysis-customer-table th:nth-child(1){width:18%}.customer-analysis-customer-table th:nth-child(2){width:15%}.customer-analysis-customer-table th:nth-child(3){width:16%}.customer-analysis-customer-table th:nth-child(4){width:16%}.customer-analysis-customer-table th:nth-child(5){width:15%}.customer-analysis-customer-table th:nth-child(6){width:11%}.customer-analysis-customer-table th:nth-child(7){width:9%}.customer-analysis-customer-table th:not(:first-child),.customer-analysis-customer-table td:not(:first-child){text-align:center;vertical-align:middle}.customer-analysis-customer-table th:nth-child(3),.customer-analysis-customer-table td:nth-child(3),.customer-analysis-customer-table th:nth-child(6),.customer-analysis-customer-table td:nth-child(6){border-left:1px solid rgba(101,126,119,.10)}.customer-analysis-customer-table td>div,.customer-analysis-identity{display:grid;gap:5px;justify-items:center}.customer-analysis-customer-table td:first-child>div{justify-items:start}.customer-analysis-customer-table td small,.customer-analysis-identity small{color:var(--ui-text-secondary,var(--muted));font-size:12px}.customer-analysis-trend-label.up{color:#087f5b}.customer-analysis-trend-label.down{color:#b42332}.customer-analysis-trend-label.flat,.customer-analysis-trend-label.new{color:#596b68}.customer-analysis-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0 0;color:var(--ui-text-secondary,var(--muted));font-size:13px}.customer-analysis-pagination>div{display:flex;gap:8px}
#modal.customer-analysis-detail-modal{width:min(1080px,70vw);max-width:calc(100vw - 40px);height:min(88vh,900px);max-height:calc(100dvh - 40px);overflow:hidden}#modal.customer-analysis-detail-modal .modal-card{height:100%;display:flex;flex-direction:column;padding:22px}#modal.customer-analysis-detail-modal #modalBody{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}.customer-analysis-loading{padding:48px;text-align:center;color:var(--ui-text-secondary,var(--muted))}.customer-analysis-detail{display:grid;gap:16px;min-width:0}.customer-analysis-detail__header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:2px 0 14px;border-bottom:1px solid var(--ui-border,var(--line))}.customer-analysis-detail__header h3,.customer-analysis-detail__header p{margin:0}.customer-analysis-detail__header p{margin-top:6px;color:var(--ui-text-secondary,var(--muted))}.customer-analysis-detail__badges{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px}.customer-analysis-detail__badges>span:last-child{color:var(--ui-text-secondary,var(--muted));font-size:13px}.customer-analysis-kpis{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}.customer-analysis-kpis article{display:grid;gap:6px;padding:12px;border:1px solid var(--ui-border,var(--line));border-radius:10px;background:var(--ui-surface-soft,#f7faf9)}.customer-analysis-kpis span{font-size:12px;color:var(--ui-text-secondary,var(--muted))}.customer-analysis-kpis b{font-size:16px;font-variant-numeric:tabular-nums}.customer-analysis-detail__columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.customer-analysis-detail__preferences{grid-template-columns:minmax(0,1.7fr) minmax(260px,.8fr)}.customer-analysis-block{min-width:0;padding:16px;border:1px solid var(--ui-border,var(--line));border-radius:12px;background:var(--ui-surface,var(--white))}.customer-analysis-block>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.customer-analysis-block h4,.customer-analysis-block p{margin:0}.customer-analysis-block header p{margin-top:5px;color:var(--ui-text-secondary,var(--muted));font-size:12px}.customer-analysis-compare{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.customer-analysis-compare article{display:grid;gap:5px;padding:12px;background:var(--ui-surface-soft,#f7faf9);border-radius:8px}.customer-analysis-compare span,.customer-analysis-compare small,.customer-analysis-cycle dt{font-size:12px;color:var(--ui-text-secondary,var(--muted))}.customer-analysis-cycle{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0}.customer-analysis-cycle div{padding:10px;background:var(--ui-surface-soft,#f7faf9);border-radius:8px;text-align:center}.customer-analysis-cycle dd{margin:5px 0 0;font-weight:700}.customer-analysis-periods{display:flex;gap:6px}.customer-analysis-periods button{border:1px solid var(--ui-border,var(--line));border-radius:999px;padding:5px 10px;background:transparent;color:inherit}.customer-analysis-periods button.is-active{background:#087f5b;border-color:#087f5b;color:#fff}.customer-analysis-trend{height:150px;display:flex;align-items:flex-end;gap:2px;padding:10px 0 0;border-bottom:1px solid var(--ui-border,var(--line));overflow:hidden}.customer-analysis-trend-bar{flex:1;min-width:2px;height:100%;display:flex;align-items:flex-end}.customer-analysis-trend-bar i{display:block;width:100%;height:var(--bar);max-height:100%;border-radius:3px 3px 0 0;background:#0f8f6d}.customer-analysis-detail-table{max-width:100%;overflow-x:auto}.customer-analysis-detail-table table{width:100%;min-width:680px;border-collapse:collapse}.customer-analysis-detail-table th{height:44px;background:var(--ui-surface-soft,#f7faf9);text-align:left}.customer-analysis-detail-table td{border-top:1px solid var(--ui-border,var(--line));height:60px}.customer-analysis-detail-table th:nth-child(n+3){text-align:center}.customer-analysis-categories{display:grid;gap:12px}.customer-analysis-categories article{display:grid;grid-template-columns:1fr auto;gap:6px}.customer-analysis-categories i{grid-column:1/-1;height:6px;border-radius:999px;background:linear-gradient(90deg,#0f8f6d var(--share),var(--ui-surface-soft,#edf2f0) var(--share))}.customer-analysis-reminders>article,.customer-analysis-reminders details article{padding:10px 0;border-top:1px solid var(--ui-border,var(--line))}.customer-analysis-reminders article p,.customer-analysis-reminders article small{display:block;margin:5px 0 0;color:var(--ui-text-secondary,var(--muted))}.customer-analysis-reminders summary{cursor:pointer;color:#087f5b;font-weight:600;padding-top:10px}
.customer-supplier-toolbar .ds-search{display:flex;min-width:0;align-items:center;gap:0;color:var(--ui-text-primary,var(--text-color));font-size:13px}
.customer-supplier-toolbar .ds-toolbar__search>.ds-search{flex:1 1 auto}
.ds-search>[data-ds-icon="search"]{position:absolute;left:11px;z-index:1;display:inline-flex;color:var(--ui-text-muted);pointer-events:none}
@media(max-width:760px){.customer-relation-confirmation__body{padding:18px;gap:12px}.customer-relation-confirmation footer .ds-btn{min-height:42px}}
@media(max-width:760px){
  .customer-credit-list-table{display:block;min-width:0;width:100%;table-layout:auto}
  .customer-credit-list-table thead{display:none}
  .customer-credit-list-table tbody{display:grid;gap:12px;padding:0 12px 12px}
  .customer-credit-list-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;border:1px solid var(--ui-border,var(--line));border-radius:10px;overflow:hidden}
  .customer-credit-list-table tbody tr{height:auto}
  .customer-credit-list-table td{display:flex;flex-direction:column;gap:6px;min-width:0;width:auto;padding:10px 12px;border:0;font-size:13px}
  .customer-credit-list-table td:before{content:attr(data-label);color:var(--ui-text-secondary,var(--muted));font-size:11px}
  .customer-credit-list-table td:nth-child(1),.customer-credit-list-table td:nth-child(2),.customer-credit-list-table td:nth-child(5),.customer-credit-list-table td:last-child{grid-column:1/-1}
  .customer-credit-list-table td:first-child{background:var(--ui-surface-soft,#f7faf9)}
  .customer-credit-list-table .customer-info-group-start{border-left:0;padding-left:12px}
  .customer-credit-list-table .ds-cell-money{text-align:left}
  .customer-credit-list-table .ds-status{align-self:flex-start}
  .customer-credit-list-table .ds-table-actions{flex-direction:row;align-items:center;justify-content:flex-end}
  .customer-credit-list-table .ds-table-actions:before{margin-right:auto}
  .customer-supplier-v3,.customer-supplier-table-host,.customer-supplier-toolbar,.customer-supplier-toolbar .ds-toolbar__left,.customer-supplier-toolbar .ds-toolbar__right{min-width:0}
  .customer-supplier-table-host:has(.customer-credit-list-table){overflow-x:hidden}
  .customer-supplier-toolbar input,.customer-supplier-toolbar select{max-width:100%;min-width:0}
  #modal.customer-blacklist-workbench-modal{width:calc(100vw - 16px);max-width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);margin:8px;border-radius:12px}
  #modal.customer-blacklist-workbench-modal .modal-card{padding:14px}
  #modal.customer-blacklist-workbench-modal .modal-card>header{margin-bottom:10px}
  .customer-blacklist-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .customer-blacklist-filters[open]{max-height:320px;overflow-y:auto}
  .customer-blacklist-results-heading{display:none}
  .customer-blacklist-result{grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:12px 8px}
  .customer-blacklist-result__identity{grid-column:1/-1}
  .customer-blacklist-result__status{grid-column:1/-1}
  .customer-blacklist-result__money:before{content:'当前应收 ';color:var(--ui-text-secondary,var(--muted));font-size:11px;font-weight:400}
  .customer-blacklist-result__action{grid-column:1/-1}
  .customer-blacklist-selected{gap:4px 8px}
  .customer-blacklist-selected>small{flex-basis:100%}
  .customer-blacklist-workbench__actions{flex-wrap:wrap}
  .customer-blacklist-workbench__actions .form-status{flex-basis:100%}
  .customer-blacklist-pager .ds-pagination{flex-wrap:wrap;gap:8px;font-size:12px}
  .customer-blacklist-workbench__bottom{padding-top:10px}
  .customer-blacklist-search .ds-btn{flex-shrink:0;padding-left:10px;padding-right:10px}
  .customer-status-pills{justify-content:flex-start}.customer-recent-activity{justify-items:start}.customer-credit-list-table .ds-cell-center{text-align:left}.customer-credit-list-table td.ds-table-actions{justify-content:flex-end!important;text-align:right!important}
  .customer-analysis-toolbar{align-items:stretch;flex-direction:column}.customer-analysis-toolbar .ds-toolbar__left,.customer-analysis-toolbar .ds-toolbar__right{width:100%;flex-wrap:wrap}.customer-analysis-toolbar .ds-search{min-width:0;flex:1}.customer-analysis-table-host{overflow-x:hidden}.customer-analysis-customer-table{display:block;min-width:0;table-layout:auto}.customer-analysis-customer-table thead{display:none}.customer-analysis-customer-table tbody{display:grid;gap:12px}.customer-analysis-customer-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid var(--ui-border,var(--line));border-radius:10px;overflow:hidden}.customer-analysis-customer-table td{display:flex;flex-direction:column;align-items:flex-start!important;text-align:left!important;gap:5px;padding:10px 12px;border:0!important}.customer-analysis-customer-table td:before{content:attr(data-label);font-size:11px;color:var(--ui-text-secondary,var(--muted))}.customer-analysis-customer-table td:first-child,.customer-analysis-customer-table td:nth-child(7){grid-column:1/-1}.customer-analysis-customer-table td:first-child{background:var(--ui-surface-soft,#f7faf9)}.customer-analysis-customer-table td>div{justify-items:start}.customer-analysis-pagination{align-items:flex-start;flex-direction:column}.customer-analysis-pagination>div{width:100%;justify-content:flex-end}
  .customer-analysis-customer-table tbody tr{height:auto}
  #modal.customer-analysis-detail-modal{width:calc(100vw - 12px);max-width:calc(100vw - 12px);height:calc(100dvh - 12px);max-height:calc(100dvh - 12px);margin:6px}#modal.customer-analysis-detail-modal .modal-card{padding:14px}.customer-analysis-detail__header{flex-direction:column}.customer-analysis-detail__badges{justify-content:flex-start}.customer-analysis-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.customer-analysis-detail__columns,.customer-analysis-detail__preferences{grid-template-columns:1fr}.customer-analysis-cycle{grid-template-columns:1fr}.customer-analysis-block>header{flex-direction:column}.customer-analysis-trend{height:120px}
}

/* Customer Settings UI refinement V1 */
.crm-hero{margin-bottom:16px}
.crm-hero>div>p,.crm-customer-hero>div>p{color:rgba(255,255,255,.86);font-size:13px;font-weight:400;line-height:1.6}
.crm-hero>div>.eyebrow,.crm-customer-hero>div>.eyebrow{color:rgba(255,255,255,.78);font-weight:600}
.crm-hero h3,.crm-customer-hero h3{font-weight:600}
.crm-level-rule,.crm-tag-create-panel,.crm-tag-list-panel,.quality-panel{padding:18px 20px}
.crm-level-rule .panel-head,.crm-tag-create-panel .panel-head,.crm-tag-list-panel .panel-head,.quality-panel .panel-head{margin-bottom:14px;align-items:flex-start}
.crm-level-rule .panel-head>div>p,.crm-level-base p,.crm-tag-create-panel .panel-head p,.crm-tag-list-panel .panel-head p,.quality-panel .panel-head p{color:var(--ui-text-secondary-readable,var(--ui-text-secondary,#586b67));font-size:13px;font-weight:400;line-height:1.6}
.crm-level-rule .panel-head h3{display:flex;align-items:center;gap:8px;margin:0;font-weight:600}
.crm-rule-switch{flex:0 0 auto;min-height:36px;color:var(--ui-text-primary,var(--ink));font-size:13px;font-weight:500;white-space:nowrap}
.crm-match-mode{margin-bottom:12px;color:var(--ui-text-secondary-readable,var(--ui-text-secondary));font-size:13px}
.crm-level-conditions{gap:8px}
.crm-level-condition{grid-template-columns:minmax(280px,360px) minmax(90px,110px) minmax(100px,116px) minmax(120px,140px) 44px minmax(48px,70px);justify-content:start;gap:8px;max-width:900px}
.crm-level-condition select,.crm-level-condition input,.crm-match-mode select,.crm-inline-form select{width:100%;min-width:0;min-height:36px;height:36px;padding:0 10px;border-color:var(--ui-border,var(--line));background:var(--ui-surface,#fff);color:var(--ui-text-primary,var(--ink));font-weight:400}
.crm-rule-unit{color:var(--ui-text-secondary-readable,var(--ui-text-secondary));font-size:13px;text-align:center}
.crm-remove-condition{justify-self:start;white-space:nowrap}
.crm-add-condition{min-height:36px;margin-top:12px;padding:0 13px}
.crm-level-base{padding:16px 20px}
.crm-level-badge{font-weight:600}

.crm-tag-create-form{display:grid;grid-template-columns:minmax(240px,340px) minmax(220px,320px) 86px minmax(120px,150px);align-items:end;justify-content:start;gap:10px;max-width:940px}
.crm-tag-create-form>label{display:grid;min-width:0;gap:6px;color:var(--ui-text-secondary-readable,var(--ui-text-secondary));font-size:12px;font-weight:500}
.crm-tag-create-form input{width:100%;min-width:0;height:36px;padding:0 10px;border:1px solid var(--ui-border,var(--line));border-radius:8px;background:var(--ui-surface,#fff);color:var(--ui-text-primary,var(--ink));font:inherit;font-weight:400}
.crm-tag-create-form input[type=color]{padding:4px 7px;cursor:pointer}
.crm-tag-create-form>button{width:100%;height:36px;padding:0 14px}
.crm-tag-category-list{display:grid;gap:16px}
.crm-tag-library-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.crm-tag-library-card{display:flex;min-width:0;min-height:150px;flex-direction:column;gap:12px;padding:14px;border:1px solid var(--ui-border,var(--line));border-radius:11px;background:var(--ui-surface,#fff)}
.crm-tag-library-card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.crm-tag-library-card .crm-tag{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.crm-tag-status{display:inline-flex;flex:0 0 auto;min-height:22px;align-items:center;padding:2px 7px;border-radius:999px;background:var(--status-success-soft,#e8f7ef);color:var(--status-success,#087f5b);font-size:11px;font-weight:600;white-space:nowrap}
.crm-tag-status.hidden,.crm-tag-status.disabled{background:var(--ui-surface-soft,#f1f4f3);color:var(--ui-text-secondary)}
.crm-tag-card-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--ui-text-secondary-readable,var(--ui-text-secondary));font-size:12px}
.crm-tag-card-meta b{color:var(--ui-text-primary,var(--ink));font-weight:500}
.crm-tag-card-actions{display:flex;align-items:center;gap:6px;margin-top:auto;padding-top:10px;border-top:1px solid var(--ui-border,var(--line));flex-wrap:wrap}
.crm-tag-card-actions button{min-height:32px;padding:0 9px;font-size:12px;font-weight:500}

.quality-kpi-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:16px}
.quality-kpi-grid .metric{min-width:0;padding:16px}
.quality-kpi-grid .metric strong{font-size:26px;font-weight:600}
.quality-kpi-grid .metric small{display:block;margin-top:5px;color:var(--ui-text-secondary-readable,var(--ui-text-secondary));font-size:11px;line-height:1.4}
.quality-customer-list{display:grid}
.quality-customer-card{display:grid;grid-template-columns:minmax(210px,260px) minmax(0,1fr) 160px;align-items:center;gap:20px;padding:16px 2px;border-top:1px solid var(--ui-border,var(--line))}
.quality-customer-card:first-child{border-top:0}
.quality-customer-identity{display:grid;min-width:0;gap:5px}
.quality-customer-identity b{overflow:hidden;color:var(--ui-text-primary,var(--ink));font-size:15px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}
.quality-customer-identity span,.quality-customer-identity small{color:var(--ui-text-secondary-readable,var(--ui-text-secondary));font-size:12px;line-height:1.45}
.quality-field-summary{display:grid;min-width:0;gap:9px}
.quality-field-summary>div{display:grid;grid-template-columns:52px minmax(0,1fr);align-items:start;gap:8px}
.quality-field-summary>div>span{padding-top:4px;color:var(--ui-text-secondary-readable,var(--ui-text-secondary));font-size:12px;font-weight:500}
.quality-chip-list{display:flex;min-width:0;flex-wrap:wrap;gap:5px}
.quality-chip{display:inline-flex;min-height:24px;align-items:center;padding:2px 8px;border-radius:999px;background:var(--status-success-soft,#e8f7ef);color:var(--status-success,#087f5b);font-size:11px;white-space:nowrap}
.quality-chip.missing{background:var(--status-caution-soft,#fff3df);color:var(--status-caution,#a05f00)}
.quality-chip.more{background:var(--ui-surface-soft,#f1f4f3);color:var(--ui-text-secondary)}
.quality-score{display:grid;gap:8px}
.quality-score>div:first-child{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.quality-score strong{color:var(--status-success,#087f5b);font-size:18px;font-weight:600;font-variant-numeric:tabular-nums}
.quality-score strong.missing{color:var(--status-caution,#a05f00)}
.quality-score span{color:var(--ui-text-secondary-readable,var(--ui-text-secondary));font-size:11px}
.quality-progress{height:6px;overflow:hidden;border-radius:999px;background:var(--ui-surface-soft,#edf2f0)}
.quality-progress i{display:block;width:var(--quality-progress);height:100%;border-radius:inherit;background:var(--status-success,#087f5b)}
.quality-score .secondary{width:100%;min-height:34px;padding:0 10px;font-size:12px}

@media(max-width:1100px){
 .crm-level-condition{grid-template-columns:minmax(240px,1fr) 100px 108px 126px 40px;max-width:none}.crm-level-condition .crm-remove-condition{grid-column:1/-1}
 .crm-tag-library-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .crm-tag-create-form{grid-template-columns:minmax(220px,1fr) minmax(200px,1fr) 82px 132px}
 .quality-customer-card{grid-template-columns:minmax(190px,230px) minmax(0,1fr) 150px;gap:14px}
}
@media(max-width:900px){.quality-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.quality-customer-card{grid-template-columns:1fr 150px}.quality-field-summary{grid-column:1/-1;grid-row:2}.quality-score{grid-column:2;grid-row:1}}
@media(max-width:760px){
 .crm-level-rule,.crm-tag-create-panel,.crm-tag-list-panel,.quality-panel{padding:16px}
 .crm-level-rule .panel-head{flex-direction:row;align-items:flex-start}.crm-rule-switch{max-width:128px;white-space:normal;text-align:right}
 .crm-level-condition{grid-template-columns:1fr 1fr}.crm-level-condition>*{width:100%}.crm-level-condition .crm-rule-metric,.crm-level-condition .crm-rule-threshold,.crm-level-condition .crm-remove-condition{grid-column:1/-1}.crm-rule-unit{align-self:center}.crm-remove-condition{justify-self:stretch;text-align:left}
 .crm-tag-create-form{grid-template-columns:1fr}.crm-tag-library-grid{grid-template-columns:1fr}
 .quality-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.quality-kpi-grid .metric{padding:13px}.quality-kpi-grid .metric strong{font-size:23px}
 .quality-customer-card{grid-template-columns:1fr;padding:15px 0;gap:13px}.quality-field-summary,.quality-score{grid-column:1;grid-row:auto}.quality-field-summary>div{grid-template-columns:48px minmax(0,1fr)}.quality-score .secondary{width:max-content;min-width:100px}
}
