/* 客户详细资料分列展示；窄屏横向滚动，备注固定为紧凑宽度。 */
#customersPage .customers-table{width:100%!important;min-width:1770px!important;table-layout:fixed!important;}
#customersPage .customers-table th,#customersPage .customers-table td{box-sizing:border-box!important;}
#customersPage .customers-table th:nth-child(1),#customersPage .customers-table td:nth-child(1){width:32px!important;min-width:32px!important;max-width:32px!important;}
#customersPage .customers-table th:nth-child(2),#customersPage .customers-table td:nth-child(2){width:40px!important;min-width:40px!important;max-width:40px!important;}
#customersPage .customers-table th:nth-child(3),#customersPage .customers-table td:nth-child(3){width:78px!important;min-width:78px!important;max-width:78px!important;}
#customersPage .customers-table th:nth-child(4),#customersPage .customers-table td:nth-child(4){width:130px!important;min-width:130px!important;max-width:130px!important;}
#customersPage .customers-table th:nth-child(5),#customersPage .customers-table td:nth-child(5){width:70px!important;min-width:70px!important;max-width:70px!important;}
#customersPage .customers-table th:nth-child(6),#customersPage .customers-table td:nth-child(6){width:110px!important;min-width:110px!important;max-width:110px!important;}
#customersPage .customers-table th:nth-child(7),#customersPage .customers-table td:nth-child(7){width:170px!important;min-width:170px!important;max-width:170px!important;}
#customersPage .customers-table th:nth-child(8),#customersPage .customers-table td:nth-child(8){width:166px!important;min-width:166px!important;max-width:166px!important;}
#customersPage .customers-table th:nth-child(9),#customersPage .customers-table td:nth-child(9){width:130px!important;min-width:130px!important;max-width:130px!important;}
#customersPage .customers-table th:nth-child(10),#customersPage .customers-table td:nth-child(10){width:174px!important;min-width:174px!important;max-width:174px!important;}
#customersPage .customers-table th:nth-child(11),#customersPage .customers-table td:nth-child(11){width:150px!important;min-width:150px!important;max-width:150px!important;}
#customersPage .customers-table th:nth-child(13),#customersPage .customers-table td:nth-child(13){width:96px!important;min-width:96px!important;max-width:96px!important;}
#customersPage .customers-table th:nth-child(14),#customersPage .customers-table td:nth-child(14){width:110px!important;min-width:110px!important;max-width:110px!important;}
#customersPage .customers-table th:nth-child(15),#customersPage .customers-table td:nth-child(15){width:46px!important;min-width:46px!important;max-width:46px!important;}
#customersPage .customers-table th:nth-child(16),#customersPage .customers-table td:nth-child(16){width:72px!important;min-width:72px!important;max-width:72px!important;}
#customersPage .customers-table th:nth-child(17),#customersPage .customers-table td:nth-child(17){width:86px!important;min-width:86px!important;max-width:86px!important;}

#customersPage .customers-table tbody td{
  height:54px!important;
  padding:8px 6px!important;
  vertical-align:middle!important;
  border-right:1px solid rgba(102,112,133,.10)!important;
  border-bottom:1px solid rgba(102,112,133,.10)!important;
}
#customersPage .customers-table th:nth-child(14){text-align:center!important;}
#customersPage .customers-table td:nth-child(14){text-align:left!important;}
#customersPage .customers-table .customer-name-cell,
#customersPage .customers-table .customer-contact-cell,
#customersPage .customers-table .phone-cell,
#customersPage .customers-table .customer-created-at{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
#customersPage .customers-table .note-cell{text-align:left!important;white-space:normal!important;overflow:hidden!important;}
#customersPage .customer-note-text{
  display:-webkit-box;
  max-height:2.8em;
  overflow:hidden;
  line-height:1.4;
  overflow-wrap:anywhere;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
#customersPage .customers-table .customer-actions{display:table-cell!important;text-align:center!important;vertical-align:middle!important;}
#customersPage .customer-action-buttons{display:inline-flex;align-items:center;justify-content:center;gap:8px;vertical-align:middle;}
#customersPage .customer-action-buttons .icon-btn{
  width:28px!important;
  min-width:28px!important;
  height:28px!important;
  min-height:28px!important;
  padding:0!important;
  border:1px solid transparent!important;
  border-radius:10px!important;
  box-shadow:none!important;
  transform:none!important;
  transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease!important;
}
#customersPage .customer-action-buttons .icon-btn svg{width:14px;height:14px;pointer-events:none;}
#customersPage .customer-action-buttons .edit-btn{color:#087b73!important;background:#eef9f7!important;border-color:#d8efeb!important;}
#customersPage .customer-action-buttons .delete-btn{color:#c23b32!important;background:#fff4f2!important;border-color:#f6dfdc!important;}
#customersPage .customer-action-buttons .edit-btn:hover{color:#066b65!important;background:#dff3ef!important;border-color:#b9e3dc!important;box-shadow:0 4px 10px rgba(11,122,117,.12)!important;}
#customersPage .customer-action-buttons .delete-btn:hover{color:#a92f28!important;background:#fde9e6!important;border-color:#f0c8c3!important;box-shadow:0 4px 10px rgba(194,59,50,.10)!important;}
#customersPage .customers-table tbody tr:hover td{background:rgba(11,122,117,.055)!important;}
#customersPage .customers-table tbody tr.customer-row-selected td,
#customersPage .customers-table tbody tr.customer-row-selected:hover td{
  background:rgba(11,122,117,.12)!important;
  border-color:rgba(102,112,133,.10)!important;
  box-shadow:none!important;
}

#customersPage .page-filter-bar{column-gap:8px!important;row-gap:8px!important;}
#customersPage .page-filter-bar #customerSearchInput{width:240px!important;min-width:240px!important;}
#customersPage .page-filter-bar .customer-batch-hint{max-width:none!important;white-space:nowrap!important;}
#customersPage .page-filter-bar label:last-child{margin-left:auto!important;}
.copy-cell{cursor:pointer;}
.copy-cell:hover{color:#0b7a75;text-decoration:underline;}
.edit-btn{background:rgba(11,122,117,.09)!important;color:#0b7a75!important;}
.delete-btn{background:rgba(220,38,38,.10)!important;color:#b42318!important;}

.customer-suggest{display:grid!important; gap:4px!important; width:min(620px,calc(100vw - 420px))!important;}
.customer-suggest button{display:grid!important;grid-template-columns:110px minmax(140px,1fr) 100px 120px!important;align-items:center!important;}
.customer-suggest button strong{color:#0b7a75!important;}
.customer-suggest button em{font-style:normal!important;color:#111827!important;}
.customer-suggest button span{font-weight:700!important;color:#0b7a75!important;text-align:right!important;}

/* 文件夹显示全部筛选结果，分类折叠，拼音字母独立分行。 */
#customersPage #customerTableWrap.hidden,
#customersPage #customerFolderView.hidden{display:none!important;}
#customersPage .customer-folder-view{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;min-width:0;overflow:hidden;border:1px solid #dce6ea;border-radius:10px;background:#fff;}
#customersPage .customer-folder-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px 20px;padding:10px 16px;border-bottom:1px solid #e6ecef;background:#f7fafb;font-size:12px;color:#667085;}
#customersPage .customer-folder-toolbar>span:first-child{font-weight:600;color:#344054;}
#customersPage .customer-folder-toolbar label{display:inline-flex;align-items:center;gap:6px;margin-left:auto;cursor:pointer;}
#customersPage .customer-folder-toolbar input,
#customersPage .customer-folder-check{width:16px!important;height:16px!important;min-height:0!important;margin:0!important;padding:0!important;accent-color:#0b7a75;cursor:pointer;}
#customersPage .customer-folders{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:6px 18px 20px;}
#customersPage .customer-folder-category{display:block;}
#customersPage .customer-folder-category+.customer-folder-category{margin-top:8px;}
#customersPage .customer-folder-category-title{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:0;padding:12px 8px;border-bottom:1px solid #dce6ea;color:#1d4e55;font-size:16px;font-weight:700;cursor:pointer;list-style:none;}
#customersPage .customer-folder-category-title::-webkit-details-marker{display:none;}
#customersPage .customer-folder-category-title:before{content:"▶";font-size:11px;color:#7b8797;}
#customersPage .customer-folder-category[open]>.customer-folder-category-title:before{content:"▼";}
#customersPage .customer-folder-category-title:hover{background:#f1f7fb;}
#customersPage .customer-folder-category-title:focus-visible{outline:2px solid #5aa5df;outline-offset:-2px;}
#customersPage .customer-folder-category-title span{font-size:12px;font-weight:400;color:#7b8797;}
#customersPage .customer-folder-category:not([open])>.customer-folder-letter-group{display:none;}
#customersPage .customer-folder-letter-group{display:grid;grid-template-columns:32px minmax(0,1fr);gap:10px;padding:12px 0;border-bottom:1px solid #edf1f4;}
#customersPage .customer-folder-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(128px,100%),1fr));gap:8px;min-width:0;padding-bottom:6px;}
#customersPage .customer-folder-letter{margin:12px 0 0;text-align:center;font-size:16px;line-height:24px;color:#1d4e55;font-weight:700;}
#customersPage .customer-folder-initial{position:absolute;top:7px;right:9px;font-size:11px;line-height:16px;color:#8b98a6;}
#customersPage .customer-folder{position:relative;min-width:0;border:1px solid transparent;border-radius:5px;transition:background-color .12s,border-color .12s;}
#customersPage .customer-folder:hover{background:#f0f7ff;border-color:#d3e8fd;}
#customersPage .customer-folder:focus-within,
#customersPage .customer-folder-selected{background:#e5f2ff;border-color:#9bcaf1;}
#customersPage .customer-folder-open{display:flex;flex-direction:column;align-items:center;gap:8px;width:100%;height:100%;min-height:128px;padding:12px 8px 10px;border:0;border-radius:4px;box-shadow:none;background:transparent;color:#263445;font:inherit;cursor:default;user-select:none;transform:none;}
#customersPage .customer-folder-open:hover{background:transparent;box-shadow:none;transform:none;}
#customersPage .customer-folder-open:focus-visible{outline:2px solid #5aa5df;outline-offset:1px;}
#customersPage .customer-folder-icon{display:block;flex:none;width:76px;height:60px;filter:drop-shadow(0 2px 2px rgba(151,107,26,.13));}
#customersPage .customer-folder-name{display:-webkit-box;max-width:100%;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow-wrap:anywhere;text-align:center;font-size:13px;font-weight:400;line-height:1.5;}
#customersPage .customer-folder-check{position:absolute;top:7px;left:7px;z-index:1;}
#customersPage .customer-folder-empty{padding:64px 16px;text-align:center;font-size:14px;color:#7b8797;}
.customer-folder-context-menu{position:fixed;z-index:var(--layer-dropdown,1000);width:180px;max-width:calc(100vw - 16px);box-sizing:border-box;padding:5px;border:1px solid #dce6ea;border-radius:8px;background:#fff;box-shadow:0 8px 26px rgba(20,40,55,.18);}
.customer-folder-context-name{padding:7px 10px;border-bottom:1px solid #edf1f4;margin-bottom:4px;color:#667085;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.customer-folder-context-menu button{display:block;width:100%;min-height:34px;padding:7px 10px;border:0;border-radius:4px;background:transparent;box-shadow:none;text-align:left;font:14px "Microsoft YaHei",sans-serif;color:#263445;cursor:pointer;}
.customer-folder-context-menu button:hover,.customer-folder-context-menu button:focus-visible{background:#eaf4fb;outline:none;}
.customer-folder-context-menu .customer-folder-context-delete{color:#b42318;}
.customer-folder-context-menu button:disabled{opacity:.4;cursor:not-allowed;background:transparent;}
@media(max-width:760px){
  #customersPage .customer-folders{padding:4px 10px 16px;}
  #customersPage .customer-folder-grid{grid-template-columns:repeat(auto-fill,minmax(min(112px,100%),1fr));gap:6px;}
  #customersPage .customer-folder-toolbar{padding:10px;gap:6px 12px;}
  #customersPage .page-filter-bar .customer-batch-hint{white-space:normal!important;}
}

#customersPage .customers-table .customer-profile-cell{text-align:left!important;white-space:normal!important;overflow:hidden!important;}
#customersPage .customer-profile-text{display:-webkit-box;overflow:hidden;overflow-wrap:anywhere;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-height:1.4;max-height:2.8em;}

/* 信用代码和账号按完整数字长度排版，其余长文本保持紧凑。 */
#customersPage .customers-table th{padding-left:6px!important;padding-right:6px!important;}
#customersPage .customers-table td:nth-child(8),
#customersPage .customers-table td:nth-child(10){font-size:12px!important;}
#customersPage .customers-table td:nth-child(8) .customer-profile-text,
#customersPage .customers-table td:nth-child(10) .customer-profile-text{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
/* 操作和创建日期固定在右侧，横向滚动时仍可使用。 */
#customersPage .customers-table th:nth-child(16),
#customersPage .customers-table td:nth-child(16){position:sticky!important;right:86px;z-index:2;}
#customersPage .customers-table th:nth-child(17),
#customersPage .customers-table td:nth-child(17){position:sticky!important;right:0;z-index:2;}
#customersPage .customers-table thead th:nth-child(16),
#customersPage .customers-table thead th:nth-child(17){z-index:4;background:#e7f5f3!important;}
/* 所有列统一使用不透明行底色，固定列不会透出后方内容。 */
#customersPage .customers-table tbody tr td{background:#fff!important;}
#customersPage .customers-table tbody tr:nth-child(even) td{background:#f8fbfc!important;}
#customersPage .customers-table tbody tr:hover td{background:#e5f0ef!important;}
#customersPage .customers-table tbody tr.customer-row-selected td,
#customersPage .customers-table tbody tr.customer-row-selected:hover td{background:#d4e8e6!important;}

#customersPage .customers-table th:nth-child(12),#customersPage .customers-table td:nth-child(12){width:110px!important;min-width:110px!important;max-width:110px!important;white-space:nowrap!important;}

/* 客户资料与多套发票资料分栏。 */
#customerEditModal .customer-modal-card{width:min(1180px,96vw)!important;max-width:1180px!important;max-height:92vh!important;overflow:auto!important;}
#customerEditModal .customer-editor-columns{display:grid;grid-template-columns:minmax(280px,.85fr) minmax(360px,1.15fr);gap:22px;align-items:start;}
#customerEditModal .customer-basic-panel,#customerEditModal .customer-invoice-panel{min-width:0;}
#customerEditModal h3{font-size:16px;color:#175d58;margin:0 0 14px;}
#customerEditModal .customer-basic-panel{padding:16px;border:1px solid #e0e9ec;border-radius:12px;background:#f8fbfc;}
#customerEditModal .customer-invoice-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px;}
#customerEditModal .customer-invoice-heading h3{margin:0;}
#customerEditModal .customer-invoice-card{border:1px solid #d8e8e5;border-radius:10px;margin-bottom:12px;background:#fff;overflow:hidden;}
#customerEditModal .customer-invoice-card summary{cursor:pointer;padding:13px 14px;background:#eef7f5;color:#175d58;overflow-wrap:anywhere;}
#customerEditModal .customer-invoice-number{display:inline-block;font-size:12px;margin-right:10px;color:#667085;}
#customerEditModal .customer-invoice-name{font-size:14px;}
#customerEditModal .customer-invoice-body{padding:14px;}
#customerEditModal .customer-invoice-tools{display:flex;justify-content:space-between;gap:10px;margin-top:14px;}
#customerEditModal .order-form-grid input,#customerEditModal .order-form-grid select,#customerEditModal .order-form-grid textarea{width:100%;min-width:0;box-sizing:border-box;}
#customersPage .customers-table .customer-profile-cell{padding:0!important;vertical-align:top!important;}
#customersPage .customer-invoice-line{height:66px;box-sizing:border-box;padding:8px 6px;display:flex;flex-direction:column;justify-content:center;min-width:0;overflow:hidden;}
#customersPage .customer-invoice-line+.customer-invoice-line{border-top:1px solid rgba(102,112,133,.14);}
#customersPage .customer-invoice-line small{font-size:10px;color:#7b8797;line-height:14px;}
@media(max-width:760px){#customerEditModal .customer-editor-columns{grid-template-columns:minmax(0,1fr);gap:16px;}#customerEditModal .customer-invoice-heading{flex-wrap:wrap;}}

#customerEditModal .order-form-grid{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:10px 12px!important;}
#customerEditModal .order-note-field{grid-column:1/-1!important;}
#customerEditModal .modal-head{position:sticky;top:0;z-index:5;background:#fff;}
#customerEditModal .modal-actions{position:sticky;bottom:0;z-index:5;background:#fff;padding-top:12px;padding-bottom:10px;}
#customerEditModal .customer-invoice-empty{color:#7b8797;padding:20px 10px;text-align:center;}
@media(max-width:480px){#customerEditModal .order-form-grid{grid-template-columns:minmax(0,1fr)!important;}}

/* 客户列表占用剩余高度，分页固定在列表外，内容单独纵向滚动。 */
#customersPage .customer-manage-layout.customer-list-only{display:flex!important;flex-direction:column!important;flex:1 1 0!important;height:0!important;min-height:0!important;overflow:hidden!important;}
#customersPage #customerTableWrap{flex:1 1 0!important;height:0!important;min-height:0!important;max-height:none!important;overflow-x:auto!important;overflow-y:scroll!important;scrollbar-gutter:stable;overscroll-behavior:contain;}
#customersPage .customer-list-only>.pager-bar{flex:0 0 auto!important;min-height:48px;}
#customersPage .page-filter-bar{flex-shrink:0!important;}
